1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(crack-attack,1.1.15-cvs,lorien420@myrealbox.com)
4 AC_CONFIG_SRCDIR(src/Attack.cxx)
9 AM_CONFIG_HEADER(src/config.h)
11 dnl Checks for programs.
17 dnl Checks for libraries.
18 AC_CHECK_LIB([GL], [glBegin])
19 AC_CHECK_LIB([GLU], [gluLookAt])
20 # I don't know how to check these.
21 # FIXME: Replace `main' with a function in `-lX11':
22 #AC_CHECK_LIB([X11], [main])
23 # FIXME: Replace `main' with a function in `-lXi':
24 #AC_CHECK_LIB([Xi], [main])
25 AC_CHECK_LIB([glut], [glutInit])
27 AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, ,
28 AC_MSG_ERROR([ *** Unable to find SDL_image library with PNG support
29 (http://www.libsdl.org/projects/SDL_image/)]))
31 dnl Checks for header files.
34 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h string.h sys/socket.h unistd.h sys/types.h stdlib.h])
35 AC_CHECK_HEADER(inttypes.h, break, echo "Must have inttypes.h for enet. Exiting..."; exit)
39 struct msghdr.msg_flags,
40 AC_DEFINE([HAS_MSGHDR_FLAGS], [], [has msghdr flags]),
44 AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAS_SOCKLEN_T], [], [has socklen t])], ,
45 #include <sys/types.h>
46 #include <sys/socket.h>
50 dnl BinReloc source additions
52 AM_CONDITIONAL([WANT_BINRELOC], [test "$br_cv_binreloc" = "yes"])
56 AC_HELP_STRING([--enable-gtk=[yes/no]],[Use gtk front-end [default=yes]]),
57 enable_gtk="$enableval",
59 if test "$enable_gtk" = "yes"; then
60 pkg_modules="gtk+-2.0 >= 2.6.0"
61 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
62 AC_DEFINE([WANT_GTK], [], [Wants to compile gtk front-end])
67 AC_SUBST(PACKAGE_CFLAGS)
68 AC_SUBST(PACKAGE_LIBS)
69 AM_CONDITIONAL([WANT_GTK], [test "$enable_gtk" = yes])
71 dnl Check for sound support
73 AC_HELP_STRING([--enable-sound=[yes/no]],
74 [Play sounds and music during game [default=no]]),
75 enable_sound="$enableval",
79 if test "$enable_sound" != "no"; then
83 AC_CHECK_LIB([SDL_mixer],
91 if test "$enable_sound" == "yes" -a "$found_sound" == "no"; then
92 AC_MSG_ERROR(libSDL and SDL_mixer are required for sound)
94 if test "$found_sound" == "yes"; then
95 AUDIO_CFLAGS="$SDL_CFLAGS"
96 AUDIO_LIBS="$SDL_LIBS -lSDL_mixer"
97 AC_DEFINE(AUDIO_ENABLED, 1, [Has audio support])
100 AC_SUBST(AUDIO_CFLAGS)
102 AM_CONDITIONAL([AUDIO_ENABLED], [test "$found_sound" = "yes"])
105 dnl Check for debugging
107 AC_HELP_STRING([--enable-debug=[no/yes]],[Compile extra debugging info [default=no]]),
108 enable_debug="$enableval",
110 if test "$enable_debug" = "yes"; then
111 DEBUG_INCLUDES=-DDEVELOPMENT
112 DEBUG_CFLAGS="-g3 -ggdb3 -Wall -pedantic"
114 DEBUG_INCLUDES=-DNDEBUG
117 AC_SUBST(DEBUG_INCLUDES)
118 AC_SUBST(DEBUG_CFLAGS)
120 # Suggested by davyd, borrowed from Nautilus
121 AC_ARG_ENABLE(more-warnings,
122 [ --enable-more-warnings Maximum compiler warnings],
123 set_more_warnings="$enableval",[
126 AC_MSG_CHECKING(for more warnings, including -Werror)
127 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
133 -Wcast-align -Wsign-compare \
136 for option in -Wno-strict-aliasing -Wno-sign-compare; do
137 SAVE_CXXFLAGS="$CXXFLAGS"
138 CXXFLAGS="$CXXFLAGS $option"
139 AC_MSG_CHECKING([whether gcc understands $option])
140 AC_TRY_COMPILE([], [],
143 if test $has_option = no; then
144 CXXFLAGS="$SAVE_CXXFLAGS"
146 AC_MSG_RESULT($has_option)
155 dnl Checks for typedefs, structures, and compiler characteristics.
163 dnl Checks for library functions.
167 AC_CHECK_FUNCS([atexit gethostbyname gethostbyname_r gethostbyaddr_r fcntl inet_ntoa mkdir pow socket sqrt strchr strcspn strstr poll])
176 autopackage/default.apspec
178 enet/include/Makefile
179 enet/include/enet/Makefile)