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 # FIXME: Replace `main' with a function in `-lGL':
19 AC_CHECK_LIB([GL], [glBegin])
20 # FIXME: Replace `main' with a function in `-lGLU':
21 AC_CHECK_LIB([GLU], [gluLookAt])
22 # I don't know how to check these.
23 # FIXME: Replace `main' with a function in `-lX11':
24 #AC_CHECK_LIB([X11], [main])
25 # FIXME: Replace `main' with a function in `-lXi':
26 #AC_CHECK_LIB([Xi], [main])
27 # FIXME: Replace `main' with a function in `-lXmu':
28 #AC_CHECK_LIB([Xmu], [main])
29 # FIXME: Replace `main' with a function in `-lglut':
30 AC_CHECK_LIB([glut], [glutInit])
33 dnl Checks for header files.
36 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h string.h sys/socket.h unistd.h sys/types.h stdlib.h])
37 AC_CHECK_HEADER(inttypes.h, break, echo "Must have inttypes.h for enet. Exiting..."; exit)
41 struct msghdr.msg_flags,
42 AC_DEFINE([HAS_MSGHDR_FLAGS], [], [has msghdr flags]),
46 AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAS_SOCKLEN_T], [], [has socklen t])], ,
47 #include <sys/types.h>
48 #include <sys/socket.h>
52 dnl BinReloc source additions
54 AM_CONDITIONAL([WANT_BINRELOC], [test "$br_cv_binreloc" = "yes"])
58 AC_HELP_STRING([--enable-gtk=[yes/no]],[Use gtk front-end [default=yes]]),
59 enable_gtk="$enableval",
61 if test "$enable_gtk" = "yes"; then
62 pkg_modules="gtk+-2.0 >= 2.6.0"
63 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
64 AC_DEFINE([WANT_GTK], [], [Wants to compile gtk front-end])
69 AC_SUBST(PACKAGE_CFLAGS)
70 AC_SUBST(PACKAGE_LIBS)
71 AM_CONDITIONAL([WANT_GTK], [test "$enable_gtk" = yes])
73 dnl Check for sound support
75 AC_HELP_STRING([--enable-sound=[yes/no]],
76 [Play sounds and music during game [default=no]]),
77 enable_sound="$enableval",
81 if test "$enable_sound" != "no"; then
85 AC_CHECK_LIB([SDL_mixer],
93 if test "$enable_sound" == "yes" -a "$found_sound" == "no"; then
94 AC_MSG_ERROR(libSDL and SDL_mixer are required for sound)
96 if test "$found_sound" == "yes"; then
97 AUDIO_CFLAGS="$SDL_CFLAGS"
98 AUDIO_LIBS="$SDL_LIBS -lSDL_mixer"
99 AC_DEFINE(AUDIO_ENABLED, 1, [Has audio support])
102 AC_SUBST(AUDIO_CFLAGS)
104 AM_CONDITIONAL([AUDIO_ENABLED], [test "$found_sound" = "yes"])
107 dnl Check for debugging
109 AC_HELP_STRING([--enable-debug=[no/yes]],[Compile extra debugging info [default=no]]),
110 enable_debug="$enableval",
112 if test "$enable_debug" = "yes"; then
113 DEBUG_INCLUDES=-DDEVELOPMENT
114 DEBUG_CFLAGS="-g3 -ggdb3 -Wall -pedantic"
116 DEBUG_INCLUDES=-DNDEBUG
119 AC_SUBST(DEBUG_INCLUDES)
120 AC_SUBST(DEBUG_CFLAGS)
122 # Suggested by davyd, borrowed from Nautilus
123 AC_ARG_ENABLE(more-warnings,
124 [ --enable-more-warnings Maximum compiler warnings],
125 set_more_warnings="$enableval",[
128 AC_MSG_CHECKING(for more warnings, including -Werror)
129 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
135 -Wcast-align -Wsign-compare \
138 for option in -Wno-strict-aliasing -Wno-sign-compare; do
139 SAVE_CXXFLAGS="$CXXFLAGS"
140 CXXFLAGS="$CXXFLAGS $option"
141 AC_MSG_CHECKING([whether gcc understands $option])
142 AC_TRY_COMPILE([], [],
145 if test $has_option = no; then
146 CXXFLAGS="$SAVE_CXXFLAGS"
148 AC_MSG_RESULT($has_option)
157 dnl Checks for typedefs, structures, and compiler characteristics.
165 dnl Checks for library functions.
169 AC_CHECK_FUNCS([atexit gethostbyname gethostbyname_r gethostbyaddr_r fcntl inet_ntoa mkdir pow socket sqrt strchr strcspn strstr poll])
178 autopackage/default.apspec
180 enet/include/Makefile
181 enet/include/enet/Makefile)