-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathconfigure.ac
119 lines (102 loc) · 3.21 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
########################################################################
# configure.ac
# Source code file for G-Code generation, simulation, and visualization
# library. This software is Copyright (C) 2006 by Justin Shumaker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
########################################################################
AC_INIT
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([gcam.c])
AC_PREFIX_DEFAULT([/usr/local/gcam])
AM_INIT_AUTOMAKE(gcam, 2010.07.27)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
## Set the prefix to the default prefix if not defined.
if test "x$prefix" = "xNONE" ; then
prefix="$ac_default_prefix"
fi
##
## Windows Console
##
AC_MSG_CHECKING(whether to enable windows console)
want_windows_console=yes
AC_ARG_ENABLE(windows-console,
AC_HELP_STRING(--disable-windows-console, [Build with windows console [default=yes]]),
[
if test "x$enableval" = "xno"
then
extra_C_flags="-mwindows"
fi
]
)
##
## Debugging
##
AC_MSG_CHECKING(whether to compile for debugging)
want_debug=no
AC_ARG_ENABLE(debug,
AC_HELP_STRING(--enable-debug, [Build with debugging [default=no]]),
[
if test "x$enableval" = "xyes"
then
want_debug=yes
fi
]
)
AC_MSG_RESULT($want_debug)
if test "x$want_debug" = "xyes"
then
export CFLAGS="-O2 -g -Wall -Wmissing-prototypes -pedantic -pg $extra_C_flags"
else
export CFLAGS="-O3 -std=gnu99 -Wmissing-prototypes -pedantic -ffast-math -fomit-frame-pointer $extra_C_flags"
fi
## Support for European mantissa issues concerning ',' and '.'
export LC_NUMERIC="POSIX"
##
## GTK
##
AM_PATH_GTK_2_0(2.10.0,,AC_MSG_ERROR([GTK+ 2.10 or higher is required]))
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
## AC_DEFINE_UNQUOTED([GTK_MAJOR_VERSION], [$gtk_config_major_version], GTK Major Version)
## AC_DEFINE_UNQUOTED([GTK_MINOR_VERSION], [$gtk_config_minor_version], GTK Minor Version)
#AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR("gthread 2.0 is required"), gthread)
#AC_SUBST(GLIB_CFLAGS)
#AC_SUBST(GLIB_LIBS)
##
## GTK GL Extension
##
AM_PATH_GTKGLEXT_1_0(1.0.0,,AC_MSG_ERROR([GTK GL Extension is required]))
AC_SUBST(GTKGLEXT_CFLAGS)
AC_SUBST(GTKGLEXT_LIBS)
##
## Lib PNG
##
AC_MSG_CHECKING([for PNG])
PNG_LIBS=`pkg-config libpng --silence-errors --libs`
if test "x$PNG_LIBS" = "x"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([libPNG development files required.])
else
AC_MSG_RESULT([yes])
AC_SUBST(PNG_LIBS)
fi
AC_CONFIG_FILES([Makefile \
libgcode/Makefile \
libgui/Makefile \
samples/Makefile \
share/Makefile])
AC_OUTPUT