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(userconfig,
35 [ --enable-userconfig Make HHexen store it's config in users' home directories],
36 [ AC_DEFINE(USERCONFIG)])
38 AC_ARG_ENABLE(assassin,
39 [ --disable-assassin Compile HHexen without support for the assassin],
40 , [AC_DEFINE(ASSASSIN)])
46 AC_DEFINE(NORANGECHECKING)
48 dnl **** Check for some programs ****
53 dnl **** Check for some libraries ****
56 AC_CHECK_LIB(pthread, pthread_create, [BASELIBS="-lpthread"])
60 AC_CHECK_LIB(vga, vga_setmode, [SVGALIBS="-lvga"; HAVESVGA="yes"])
62 dnl Check for all libs needed by X11 version
63 AC_CHECK_LIB(Xext,XShmQueryExtension, [LIBS="$LIBS -lXext"],[HAVEX11="no"])
64 AC_CHECK_LIB(X11, main, [LIBS="$LIBS -lX11"], [HAVEX11="no"])
65 AC_CHECK_LIB(dl, dlopen)
68 dnl Check for GL libraries
70 if test "$GLHEXEN" = "true"
72 if test "$FORCEMESAGL" = "yes"
74 AC_CHECK_LIB(MesaGL, glBindTexture, ,HAVEGL="no")
75 AC_CHECK_LIB(MesaGLU, gluOrtho2D, ,HAVEGL="no")
77 AC_CHECK_LIB(GL, glBindTexture,[LIBS="$LIBS -lGL";]
78 AC_CHECK_LIB(GLU, gluOrtho2D, ,
79 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
80 AC_CHECK_LIB(MesaGLU, gluOrtho2D, , HAVEGL="no"),
83 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
84 AC_CHECK_LIB(MesaGLU, gluOrtho2D, , HAVEGL="no"),
90 dnl **** Check for gcc strength-reduce bug ****
92 if test "x${GCC}" = "xyes"
94 CFLAGS="$CFLAGS -Wall"
95 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
98 static int Array[[3]];
101 for(i=0; i<B; i++) Array[[i]] = i - 3;
102 exit( Array[[1]] != -2 );
104 ac_cv_c_gcc_strength_bug="no",
105 ac_cv_c_gcc_strength_bug="yes",
106 ac_cv_c_gcc_strength_bug="yes") )
107 if test "$ac_cv_c_gcc_strength_bug" = "yes"
109 CFLAGS="$CFLAGS -fno-strength-reduce"
113 dnl **** Check for underscore on external symbols ****
115 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
116 ac_cv_c_extern_prefix,
118 LIBS="conftest_asm.s $LIBS"
119 cat > conftest_asm.s <<EOF
124 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
125 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
128 dnl **** Check for endianness ****
132 dnl **** Check for functions ****
136 dnl **** Check for header files ****
143 dnl **** Check for types ****
148 AC_CHECK_SIZEOF(long long,0)
150 dnl **** Generate output files ****
153 AC_SUBST_FILE(MAKE_RULES)
157 if test "$HAVESVGA" = "no"
160 echo "Warning: It appears that you do not have SvgaLib installed on your system"
161 echo " If you want to compile with SvgaLib support, you will need to"
162 echo " download the library from 'http://www.svgalib.org'."
165 if test "$HAVEX11" = "no"
168 echo "Warning: Configure did not find some necessary libraries for an X11"
169 echo " build. Perhaps you do not have X11 installed correctly."
170 echo " Until this problem is resolved, you won't be able to compile"
171 echo " the X11 or OpenGL versions."
172 dnl Add this line so we don't get two error messages
176 if test "$HAVEGL" = "no"
179 echo "Warning: Configure was not able to find your OpenGL libraries."
180 echo " Perhaps you do not have them installed correctly. Until"
181 echo " this problem is resolved, you won't be able to compile"
182 echo " the OpenGL version of HHexen."
185 if test "$GLHEXEN" = "true"
188 echo "Configure finished. Do 'make clean', then 'make' to build the OpenGL version."
192 echo "Configure finished. Do 'make clean', then 'make x11' or 'make svgalib' to build"