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_DEFUN([CHECK_MATH],
32 [OLD_CFLAGS="$CFLAGS"]
36 [AC_DEFINE(AS_TR_CPP([HAVE_$1]),
38 [Define to 1 if you have the `$1' function.])])]
39 [CFLAGS="$OLD_CFLAGS"])
44 # Checks for hypot (SVID 3, BSD 4.3).
45 # The replacement is #defined in the source.
49 # Checks for math functions using floats.
50 # Using floats instead of doubles makes gcc use SSE with -msse
51 # The replacement are #defined in math_floats.h.
63 # If we don't have ftello, we'll use ftell.
64 AC_CHECK_FUNCS([ftello])
67 # Checks for getdelim, this is a GNU extension.
68 CFLAGS="$CFLAGS -D_GNU_SOURCE"
69 AC_CHECK_FUNCS([getdelim], [
75 AM_CONDITIONAL([GETDELIM], [test "$have_getdelim" = "yes"])
78 # Checks for getopt_long, another GNU extension.
79 AC_CHECK_FUNCS([getopt_long], [
80 have_getopt_long="yes"
85 AM_CONDITIONAL([GETOPT_LONG], [test "$have_getopt_long" = "yes"])
88 if test "$have_getdelim" = "no" ||
89 test "$have_getopt_long" = "no"; then
90 AM_CONDITIONAL([NEED_REPLACEMENTS], [true])
91 CFLAGS="$CFLAGS -I${srcdir}/../lib"
93 AM_CONDITIONAL([NEED_REPLACEMENTS], [false])
97 # Checks for flavours of varargs macros (borrowed from glib-2)
99 AC_MSG_CHECKING([for ISO C99 varargs macros])
102 int a(int p1, int p2, int p3);
103 #define call_a(...) a(1,__VA_ARGS__)
105 ], [have_iso_c_varargs=yes], [have_iso_c_varargs=no])
107 AC_MSG_RESULT([$have_iso_c_varargs])
109 if test $have_iso_c_varargs = yes; then
115 AC_DEFINE_UNQUOTED([HAVE_ISO_C_VARARGS], [$iso_c_varargs],
116 [ISO C99 varargs macros in C])
118 if test $have_iso_c_varargs = no; then
119 AC_MSG_WARN([No ISO C99 variadic macros])
124 CFLAGS="$X_CFLAGS $CFLAGS"
125 LDFLAGS="$X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LDFLAGS"
129 AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lGL $LDFLAGS"], [ogl="no"])
130 if test "x$ogl" = "xno"; then
131 AC_MSG_NOTICE([Maybe libGL requires libpthread...])
132 unset ac_cv_lib_GL_glBegin
133 AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lpthread -lGL $LDFLAGS"],
134 AC_MSG_ERROR([Cannot use -lGL]), [-lpthread])
139 AM_PATH_GTK_2_0([2.2.0], [
140 CFLAGS="$GTK_CFLAGS $CFLAGS"
141 LDFLAGS="$GTK_LIBS $LDFLAGS"
142 GTK_VERSION="$($PKG_CONFIG --modversion gtk+-2.0)"
143 ], [exit 1], [gthread])
145 # Checks for GtkGLExt.
146 PKG_CHECK_MODULES(GTKGLEXT, [gtkglext-1.0 >= 0.7.0])
147 CFLAGS="$GTKGLEXT_CFLAGS $CFLAGS"
148 LDFLAGS="$GTKGLEXT_LIBS $LDFLAGS"
149 GTKGL_VERSION="$($PKG_CONFIG --modversion gtkglext-1.0)"
152 ALL_LINGUAS=$(echo po/*.po | sed 's|\.po||g' | sed 's|po/||g')
153 AM_GNU_GETTEXT_VERSION
155 CFLAGS="$CFLAGS -I../${srcdir}/intl"
156 LIBS="$LIBS $LIBINTL"
166 tools/glade/actions/Makefile
167 tools/glade/options/Makefile
175 echo "Using GTK+ $GTK_VERSION with GtkGLExt $GTKGL_VERSION"