1 dnl Process this file with autoconf to produce a configure script.
2 dnl configure.in for HHexen v1.3
3 AC_REVISION([configure.in 1.00])
4 AC_INIT(base/a_action.c)
5 AC_CONFIG_HEADER(include/config.h)
7 # We want these before the checks, so the checks can modify their values.
9 dnl **** Command-line arguments ****
16 LIBS="-L/usr/X11R6/lib"
23 [ --enable-gl Enable OpenGL mode],
24 [GLHEXEN="true"; AC_DEFINE(RENDER3D)])
26 AC_ARG_ENABLE(gl-mesa,
27 [ --enable-gl-mesa Enable OpenGL mode for Mesa 3d acceleration],
28 [GLHEXEN="true"; FORCEMESAGL="yes" ;AC_DEFINE(RENDER3D)])
30 AC_ARG_ENABLE(demowad,
31 [ --enable-demowad Enable compilation with the demo wadfile],
32 [ AC_DEFINE(DEMO_WAD)])
34 AC_ARG_ENABLE(assassin,
35 [ --disable-assassin Compile HHexen without support for the assassin],
36 , [AC_DEFINE(ASSASSIN)])
42 AC_DEFINE(NORANGECHECKING)
44 dnl **** Check for some programs ****
49 dnl **** Check for some libraries ****
52 AC_CHECK_LIB(pthread, pthread_create, [BASELIBS="-lpthread"])
56 AC_CHECK_LIB(vga, vga_setmode, [SVGALIBS="-lvga"; HAVESVGA="yes"])
58 dnl Check for all libs needed by X11 version
59 AC_CHECK_LIB(Xext,XShmQueryExtension, [LIBS="$LIBS -lXext"],[HAVEX11="no"])
60 AC_CHECK_LIB(X11, main, [LIBS="$LIBS -lX11"], [HAVEX11="no"])
61 AC_CHECK_LIB(dl, dlopen)
64 dnl Check for GL libraries
66 if test "$GLHEXEN" = "true"
68 if test "$FORCEMESAGL" = "yes"
70 AC_CHECK_LIB(MesaGL, glBindTexture, ,HAVEGL="no")
71 AC_CHECK_LIB(MesaGLU, gluOrtho2D, ,HAVEGL="no")
73 AC_CHECK_LIB(GL, glBindTexture,[LIBS="$LIBS -lGL";]
74 AC_CHECK_LIB(GLU, gluOrtho2D, ,
75 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
76 AC_CHECK_LIB(MesaGLU, gluOrtho2D, , HAVEGL="no"),
79 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
80 AC_CHECK_LIB(MesaGLU, gluOrtho2D, , HAVEGL="no"),
86 dnl **** Check for gcc strength-reduce bug ****
88 if test "x${GCC}" = "xyes"
90 CFLAGS="$CFLAGS -Wall"
91 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
94 static int Array[[3]];
97 for(i=0; i<B; i++) Array[[i]] = i - 3;
98 exit( Array[[1]] != -2 );
100 ac_cv_c_gcc_strength_bug="no",
101 ac_cv_c_gcc_strength_bug="yes",
102 ac_cv_c_gcc_strength_bug="yes") )
103 if test "$ac_cv_c_gcc_strength_bug" = "yes"
105 CFLAGS="$CFLAGS -fno-strength-reduce"
109 dnl **** Check for underscore on external symbols ****
111 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
112 ac_cv_c_extern_prefix,
114 LIBS="conftest_asm.s $LIBS"
115 cat > conftest_asm.s <<EOF
120 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
121 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
124 dnl **** Check for endianness ****
128 dnl **** Check for functions ****
132 dnl **** Check for header files ****
139 dnl **** Check for types ****
144 AC_CHECK_SIZEOF(long long,0)
146 dnl **** Generate output files ****
149 AC_SUBST_FILE(MAKE_RULES)
153 if test "$HAVESVGA" = "no"
156 echo "Warning: It appears that you do not have SvgaLib installed on your system"
157 echo " If you want to compile with SvgaLib support, you will need to"
158 echo " download the library from 'http://www.svgalib.org'."
161 if test "$HAVEX11" = "no"
164 echo "Warning: Configure did not find some necessary libraries for an X11"
165 echo " build. Perhaps you do not have X11 installed correctly."
166 echo " Until this problem is resolved, you won't be able to compile"
167 echo " the X11 or OpenGL versions."
168 dnl Add this line so we don't get two error messages
172 if test "$HAVEGL" = "no"
175 echo "Warning: Configure was not able to find your OpenGL libraries."
176 echo " Perhaps you do not have them installed correctly. Until"
177 echo " this problem is resolved, you won't be able to compile"
178 echo " the OpenGL version of HHexen."
181 if test "$GLHEXEN" = "true"
184 echo "Configure finished. Do 'make clean', then 'make' to build the OpenGL version."
188 echo "Configure finished. Do 'make clean', then 'make x11' or 'make svgalib' to build"