Symlinks are teh awesome
[crack-attack.git] / configure.ac
blobd93970d0cd607c4205596e8ce3db6a6abccfe7c1
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(crack-attack,1.1.14-cvs,lorien420@myrealbox.com)
4 AC_CONFIG_SRCDIR(src/Attack.cxx)
5 AM_INIT_AUTOMAKE
6 AM_CONFIG_HEADER(src/config.h)
7 AM_BINRELOC
9 dnl Checks for programs.
10 AC_PROG_CC
11 AC_PROG_CXX
12 AC_PROG_INSTALL
13 AC_PROG_RANLIB
15 AC_CANONICAL_HOST 
16 AC_CANONICAL_TARGET
18 dnl BinReloc source additions
19 AM_CONDITIONAL([WANT_BINRELOC], [test "$br_cv_binreloc" = "yes"])
21 dnl Checks for libraries.
22 # FIXME: Replace `main' with a function in `-lGL':
23 AC_CHECK_LIB([GL], [glBegin])
24 # FIXME: Replace `main' with a function in `-lGLU':
25 AC_CHECK_LIB([GLU], [gluLookAt])
26 # I don't know how to check these.
27 # FIXME: Replace `main' with a function in `-lX11':
28 #AC_CHECK_LIB([X11], [main])
29 # FIXME: Replace `main' with a function in `-lXi':
30 #AC_CHECK_LIB([Xi], [main])
31 # FIXME: Replace `main' with a function in `-lXmu':
32 #AC_CHECK_LIB([Xmu], [main])
33 # FIXME: Replace `main' with a function in `-lglut':
34 AC_CHECK_LIB([glut], [glutInit])
36 dnl Checks for header files.
37 AC_HEADER_STDC
38 AC_HEADER_SYS_WAIT
39 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h string.h sys/socket.h unistd.h])
41 dnl Check for gtk
42 AC_ARG_ENABLE(gtk,
43   AC_HELP_STRING([--enable-gtk=[yes/no]],[Use gtk front-end [default=yes]]),
44   enable_gtk="$enableval",
45   enable_gtk=yes)
46 if test "$enable_gtk" = "yes"; then
47   pkg_modules="gtk+-2.0 >= 2.0.0"
48   PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
49   AC_DEFINE([WANT_GTK], [], [Wants to compile gtk front-end])
50 else
51   PACKAGE_CFLAGS=""
52   PACKAGE_LIBS=""
54 AC_SUBST(PACKAGE_CFLAGS)
55 AC_SUBST(PACKAGE_LIBS)
56 AM_CONDITIONAL([WANT_GTK], [test "$enable_gtk" = yes])
58 dnl Check for sound support
59 AC_ARG_ENABLE(sound,
60   AC_HELP_STRING([--enable-sound=[yes/no]],
61     [Play sounds and music during game [default=yes]]),
62   enable_sound="$enableval",
63   enable_sound=auto)
64 AUDIO_CFLAGS=""
65 AUDIO_LIBS=""
66 if test "$enable_sound" != "no"; then
67   found_sound="no"
68   AM_PATH_SDL(1.2.0,
69     [
70       AC_CHECK_LIB([SDL_mixer],
71         [Mix_OpenAudio],
72         [found_sound=yes],
73         [found_sound=no]
74       )
75     ],[found_sound=no]
76   )
78   if test "$enable_sound" == "yes" -a "$found_sound" == "no"; then
79     AC_MSG_ERROR(libSDL and SDL_mixer are required for sound)
80   fi
81   if test "$found_sound" == "yes"; then
82     AUDIO_CFLAGS="$SDL_CFLAGS"
83     AUDIO_LIBS="$SDL_LIBS -lSDL_mixer"
84     AC_DEFINE(AUDIO_ENABLED, 1, [Has audio support])
85   fi
87 AC_SUBST(AUDIO_CFLAGS)
88 AC_SUBST(AUDIO_LIBS)
89 AM_CONDITIONAL([AUDIO_ENABLED], [test "$found_sound" = "yes"])
92 dnl Check for debugging
93 AC_ARG_ENABLE(debug,
94   AC_HELP_STRING([--enable-debug=[no/yes]],[Compile extra debugging info [default=no]]),
95   enable_debug="$enableval",
96   enable_debug=no)
97 if test "$enable_debug" = "yes"; then
98   DEBUG_INCLUDES=-DDEVELOPMENT
99   DEBUG_CFLAGS="-g -Wall -pedantic"
100 else
101   DEBUG_INCLUDES=-DNDEBUG
102   DEBUG_CFLAGS=
104 AC_SUBST(DEBUG_INCLUDES)
105 AC_SUBST(DEBUG_CFLAGS)
107 dnl Checks for typedefs, structures, and compiler characteristics.
108 AC_HEADER_STDBOOL
109 AC_C_CONST
110 AC_C_INLINE
111 AC_TYPE_PID_T
113 AC_PATH_XTRA
115 dnl Checks for library functions.
116 AC_FUNC_FORK
117 AC_FUNC_MEMCMP
118 AC_FUNC_STAT
119 AC_CHECK_FUNCS([atexit gethostbyname inet_ntoa mkdir pow socket sqrt strchr strcspn strstr poll])
121 AC_CONFIG_FILES(
122   Makefile 
123   src/Makefile 
124   src/gtk-gui/Makefile
125   data/Makefile 
126   doc/Makefile
127   autopackage/default.apspec)
129 AC_OUTPUT