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 dnl BinReloc source additions
48 AM_CONDITIONAL([WANT_BINRELOC], [test "$br_cv_binreloc" = "yes"])
52 AC_HELP_STRING([--enable-gtk=[yes/no]],[Use gtk front-end [default=yes]]),
53 enable_gtk="$enableval",
55 if test "$enable_gtk" = "yes"; then
56 pkg_modules="gtk+-2.0 >= 2.6.0"
57 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
58 AC_DEFINE([WANT_GTK], [], [Wants to compile gtk front-end])
63 AC_SUBST(PACKAGE_CFLAGS)
64 AC_SUBST(PACKAGE_LIBS)
65 AM_CONDITIONAL([WANT_GTK], [test "$enable_gtk" = yes])
67 dnl Check for sound support
69 AC_HELP_STRING([--enable-sound=[yes/no]],
70 [Play sounds and music during game [default=no]]),
71 enable_sound="$enableval",
75 if test "$enable_sound" != "no"; then
79 AC_CHECK_LIB([SDL_mixer],
87 if test "$enable_sound" == "yes" -a "$found_sound" == "no"; then
88 AC_MSG_ERROR(libSDL and SDL_mixer are required for sound)
90 if test "$found_sound" == "yes"; then
91 AUDIO_CFLAGS="$SDL_CFLAGS"
92 AUDIO_LIBS="$SDL_LIBS -lSDL_mixer"
93 AC_DEFINE(AUDIO_ENABLED, 1, [Has audio support])
96 AC_SUBST(AUDIO_CFLAGS)
98 AM_CONDITIONAL([AUDIO_ENABLED], [test "$found_sound" = "yes"])
101 dnl Check for debugging
103 AC_HELP_STRING([--enable-debug=[no/yes]],[Compile extra debugging info [default=no]]),
104 enable_debug="$enableval",
106 if test "$enable_debug" = "yes"; then
107 DEBUG_INCLUDES=-DDEVELOPMENT
108 DEBUG_CFLAGS="-g3 -ggdb3 -Wall -pedantic"
110 DEBUG_INCLUDES=-DNDEBUG
113 AC_SUBST(DEBUG_INCLUDES)
114 AC_SUBST(DEBUG_CFLAGS)
116 # Suggested by davyd, borrowed from Nautilus
117 AC_ARG_ENABLE(more-warnings,
118 [ --enable-more-warnings Maximum compiler warnings],
119 set_more_warnings="$enableval",[
122 AC_MSG_CHECKING(for more warnings, including -Werror)
123 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
129 -Wcast-align -Wsign-compare \
132 for option in -Wno-strict-aliasing -Wno-sign-compare; do
133 SAVE_CXXFLAGS="$CXXFLAGS"
134 CXXFLAGS="$CXXFLAGS $option"
135 AC_MSG_CHECKING([whether gcc understands $option])
136 AC_TRY_COMPILE([], [],
139 if test $has_option = no; then
140 CXXFLAGS="$SAVE_CXXFLAGS"
142 AC_MSG_RESULT($has_option)
151 dnl Checks for typedefs, structures, and compiler characteristics.
159 dnl Checks for library functions.
163 AC_CHECK_FUNCS([atexit gethostbyname gethostbyname_r gethostbyaddr_r fcntl inet_ntoa mkdir pow socket sqrt strchr strcspn strstr poll])
171 autopackage/default.apspec
173 enet/include/Makefile
174 enet/include/enet/Makefile)