1 # Process this file with autoconf to produce a configure script.
2 AC_INIT([gliv], esyscmd([echo -n $(head -n 1 NEWS)]), [guichaz@gmail.com])
3 AC_CONFIG_SRCDIR([src/main.c])
4 AM_INIT_AUTOMAKE([foreign])
5 AM_CONFIG_HEADER([config.h])
10 # We check this before AC_PROG_CC fills blank CFLAGS with "-g -O2".
11 if test "x$CFLAGS" = "x"; then
17 # Checks for programs.
23 if test "x$GCC" = "xyes" && test "$DEFAULT_CFLAGS" = "yes"; then
24 CFLAGS="-Wall -O2 -fomit-frame-pointer -ffast-math"
26 CFLAGS="$CFLAGS -I${srcdir}/../lib"
28 # Checks for LFS flags, we may not handle big files, but it doesn't hurt.
32 AC_DEFUN([CHECK_MATH],
33 [OLD_CFLAGS="$CFLAGS"]
37 [AC_DEFINE(AS_TR_CPP([HAVE_$1]),
39 [Define to 1 if you have the `$1' function.])])]
40 [CFLAGS="$OLD_CFLAGS"])
45 # Checks for hypot (SVID 3, BSD 4.3).
46 # The replacement is #defined in the source.
50 # Checks for math functions using floats.
51 # Using floats instead of doubles makes gcc use SSE with -msse
52 # The replacement are #defined in math_floats.h.
65 # If we don't have ftello, we'll use ftell.
66 AC_CHECK_FUNCS([ftello])
68 # If we don't have fseeko, we'll use fseek.
69 AC_CHECK_FUNCS([fseeko])
72 # Checks for getdelim, this is a GNU extension.
73 CFLAGS="$CFLAGS -D_GNU_SOURCE"
74 AC_CHECK_FUNCS([getdelim], [
80 AM_CONDITIONAL([GETDELIM], [test "$have_getdelim" = "yes"])
83 # Checks for getopt_long, another GNU extension.
84 AC_CHECK_FUNCS([getopt_long], [
85 have_getopt_long="yes"
90 AM_CONDITIONAL([GETOPT_LONG], [test "$have_getopt_long" = "yes"])
93 if test "$have_getdelim" = "no" ||
94 test "$have_getopt_long" = "no"; then
95 AM_CONDITIONAL([NEED_REPLACEMENTS], [true])
97 AM_CONDITIONAL([NEED_REPLACEMENTS], [false])
101 # Checks for flavours of varargs macros (borrowed from glib-2)
103 AC_MSG_CHECKING([for ISO C99 varargs macros])
106 int a(int p1, int p2, int p3);
107 #define call_a(...) a(1,__VA_ARGS__)
109 ], [have_iso_c_varargs=yes], [have_iso_c_varargs=no])
111 AC_MSG_RESULT([$have_iso_c_varargs])
113 if test $have_iso_c_varargs = yes; then
119 AC_DEFINE_UNQUOTED([HAVE_ISO_C_VARARGS], [$iso_c_varargs],
120 [ISO C99 varargs macros in C])
122 if test $have_iso_c_varargs = no; then
123 AC_MSG_WARN([No ISO C99 variadic macros])
127 AC_CHECK_SIZEOF([unsigned long])
131 CFLAGS="$X_CFLAGS $CFLAGS"
132 LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
134 # Checks for GtkGLExt.
135 PKG_CHECK_MODULES(GTKGLEXT, [gtkglext-1.0 >= 0.7.0])
136 CFLAGS="$GTKGLEXT_CFLAGS $CFLAGS"
137 LIBS="$GTKGLEXT_LIBS $LIBS"
138 GTKGL_VERSION="$($PKG_CONFIG --modversion gtkglext-1.0)"
141 AC_TRY_LINK([#include "GL/gl.h"],
142 [glBegin(GL_QUADS);],
146 if test "x$ogl" = "xno"; then
147 AC_MSG_NOTICE([maybe libGL requires libpthread...])
148 LIBS="$LIBS -lpthread"
149 AC_TRY_LINK([#include "GL/gl.h"],
150 [glBegin(GL_QUADS);],
152 AC_MSG_ERROR([cannot use -lGL]))
156 AM_PATH_GTK_2_0([2.6.0], [
157 CFLAGS="$GTK_CFLAGS $CFLAGS"
158 LIBS="$GTK_LIBS $LIBS"
159 GTK_VERSION="$($PKG_CONFIG --modversion gtk+-2.0)"
160 ], [exit 1], [gthread])
163 ALL_LINGUAS=$(echo po/*.po | sed -e 's|\.po||g' -e 's|po/||g')
164 AM_GNU_GETTEXT_VERSION
166 CFLAGS="$CFLAGS -I../${srcdir}/intl"
167 LIBS="$LIBS $LIBINTL"
170 AC_CONFIG_FILES([ intl/Makefile
176 tools/glade/actions/Makefile
177 tools/glade/image_nr/Makefile
178 tools/glade/options/Makefile
192 echo "Using GTK+ $GTK_VERSION with GtkGLExt $GTKGL_VERSION"