1 # Process this file with autoconf to produce a configure script.
2 AC_INIT([gliv], esyscmd([echo -n $(head -n 1 NEWS)]), [guichaz@yahoo.fr])
3 AC_CONFIG_SRCDIR([src/main.c])
5 AM_CONFIG_HEADER([config.h])
9 # We check this before AC_PROG_CC fills blank CFLAGS with "-g -O2".
10 if test "x$CFLAGS" = "x"; then
16 # Checks for programs.
22 if test "x$GCC" = "xyes" && test "$DEFAULT_CFLAGS" = "yes"; then
23 CFLAGS="-Wall -O2 -fomit-frame-pointer -ffast-math"
27 # Checks for LFS flags, we may not handle big files, but it doesn't hurt.
31 AC_CHECK_LIB([m], [atan2], [
32 LDFLAGS="-lm $LDFLAGS"
34 AC_MSG_ERROR([Cannot use -lm])
38 # Checks for hypot (SVID 3, BSD 4.3).
39 # The replacement is #defined in the source.
40 AC_CHECK_FUNCS([hypot])
43 # Checks for math functions using floats.
44 # Using floats instead of doubles makes gcc use SSE with -msse
45 # The replacement are #defined in math_floats.h.
46 AC_CHECK_FUNCS([sqrtf])
47 AC_CHECK_FUNCS([hypotf])
48 AC_CHECK_FUNCS([atan2f])
49 AC_CHECK_FUNCS([powf])
50 AC_CHECK_FUNCS([ceilf])
51 AC_CHECK_FUNCS([cosf])
52 AC_CHECK_FUNCS([sinf])
53 AC_CHECK_FUNCS([acosf])
54 AC_CHECK_FUNCS([fmodf])
55 AC_CHECK_FUNCS([fabsf])
56 AC_CHECK_FUNCS([powf])
58 # If we don't have ftello, we'll use ftell.
59 AC_CHECK_FUNCS([ftello])
62 # Checks for getdelim, this is a GNU extension.
63 CFLAGS="$CFLAGS -D_GNU_SOURCE"
64 AC_CHECK_FUNCS([getdelim], [
70 AM_CONDITIONAL([GETDELIM], [test "$have_getdelim" = "yes"])
73 # Checks for getopt_long, another GNU extension.
74 AC_CHECK_FUNCS([getopt_long], [
75 have_getopt_long="yes"
80 AM_CONDITIONAL([GETOPT_LONG], [test "$have_getopt_long" = "yes"])
83 if test "$have_getdelim" = "no" ||
84 test "$have_getopt_long" = "no"; then
85 AM_CONDITIONAL([NEED_REPLACEMENTS], [true])
86 CFLAGS="$CFLAGS -I${srcdir}/../lib"
88 AM_CONDITIONAL([NEED_REPLACEMENTS], [false])
92 # Checks for flavours of varargs macros (borrowed from glib-2)
94 AC_MSG_CHECKING([for ISO C99 varargs macros])
97 int a(int p1, int p2, int p3);
98 #define call_a(...) a(1,__VA_ARGS__)
100 ], [have_iso_c_varargs=yes], [have_iso_c_varargs=no])
102 AC_MSG_RESULT([$have_iso_c_varargs])
104 if test $have_iso_c_varargs = yes; then
110 AC_DEFINE_UNQUOTED([HAVE_ISO_C_VARARGS], [$iso_c_varargs],
111 [ISO C99 varargs macros in C])
113 if test $have_iso_c_varargs = no; then
114 AC_MSG_WARN([No ISO C99 variadic macros])
119 CFLAGS="$X_CFLAGS $CFLAGS"
120 LDFLAGS="$X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LDFLAGS"
124 AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lGL $LDFLAGS"], [ogl="no"])
125 if test "x$ogl" = "xno"; then
126 AC_MSG_NOTICE([Maybe libGL requires libpthread...])
127 unset ac_cv_lib_GL_glBegin
128 AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lpthread -lGL $LDFLAGS"],
129 AC_MSG_ERROR([Cannot use -lGL]), [-lpthread])
134 AM_PATH_GTK_2_0([2.2.0], [
135 CFLAGS="$GTK_CFLAGS $CFLAGS"
136 LDFLAGS="$GTK_LIBS $LDFLAGS"
137 GTK_VERSION="$($PKG_CONFIG --modversion gtk+-2.0)"
138 ], [exit 1], [gthread])
140 # Checks for GtkGLExt.
141 PKG_CHECK_MODULES(GTKGLEXT, [gtkglext-1.0 >= 0.7.0])
142 CFLAGS="$GTKGLEXT_CFLAGS $CFLAGS"
143 LDFLAGS="$GTKGLEXT_LIBS $LDFLAGS"
144 GTKGL_VERSION="$($PKG_CONFIG --modversion gtkglext-1.0)"
147 ALL_LINGUAS=$(echo po/*.po | sed 's|\.po||g' | sed 's|po/||g')
148 AM_GNU_GETTEXT_VERSION
150 CFLAGS="$CFLAGS -I../${srcdir}/intl"
151 LIBS="$LIBS $LIBINTL"
161 tools/glade/options/Makefile
169 echo "Using GTK+ $GTK_VERSION with GtkGLExt $GTKGL_VERSION"