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 dnl **** Command-line arguments ****
14 LIBS="-L/usr/X11R6/lib"
16 GLBASE="opengl/i_gl.cpp"
20 [ --enable-gl Enable OpenGL mode],
21 [GLHEXEN="true";SDL_VERSION="1.1.2"; AC_DEFINE(RENDER3D)],
22 [SDL_VERSION="1.1.0"])
24 AC_ARG_ENABLE(demowad,
25 [ --enable-demowad Enable compilation with the demo wadfile],
26 [ AC_DEFINE(DEMO_WAD)])
28 AC_ARG_ENABLE(assassin,
29 [ --disable-assassin Compile HHexen without support for the assassin],
30 , [AC_DEFINE(ASSASSIN)])
36 AC_DEFINE(NORANGECHECKING)
38 dnl **** Check for some programs ****
43 dnl **** Check for some libraries ****
46 AC_CHECK_LIB(pthread, pthread_join, [BASELIBS="-lpthread"])
51 AM_PATH_SDL($SDL_VERSION,
52 [HAVESDL="yes";GLBASE="sdl/i_sdlgl.o";BUILDNAMES="sdl $BUILDNAMES";GLLIBS=""],
61 AC_CHECK_LIB(dl, dlopen)
64 dnl Check for GL libraries
66 if test "$GLHEXEN" = "true"
68 AC_CHECK_LIB(GL, glBindTexture,[LIBS="$LIBS -lGL";]
69 AC_CHECK_LIB(GLU, gluOrtho2D, [HAVEGL="yes"],
70 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
71 AC_CHECK_LIB(MesaGLU, gluOrtho2D, [HAVEGL="yes"], HAVEGL="no"),
74 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
75 AC_CHECK_LIB(MesaGLU, gluOrtho2D, [HAVEGL="yes"], HAVEGL="no"),
80 dnl **** Check for gcc strength-reduce bug ****
82 if test "x${GCC}" = "xyes"
84 CFLAGS="$CFLAGS -Wall"
85 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
88 static int Array[[3]];
91 for(i=0; i<B; i++) Array[[i]] = i - 3;
92 exit( Array[[1]] != -2 );
94 ac_cv_c_gcc_strength_bug="no",
95 ac_cv_c_gcc_strength_bug="yes",
96 ac_cv_c_gcc_strength_bug="yes") )
97 if test "$ac_cv_c_gcc_strength_bug" = "yes"
99 CFLAGS="$CFLAGS -fno-strength-reduce"
103 dnl **** Check for underscore on external symbols ****
105 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
106 ac_cv_c_extern_prefix,
108 LIBS="conftest_asm.s $LIBS"
109 cat > conftest_asm.s <<EOF
114 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
115 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
118 dnl **** Check for endianness ****
122 dnl **** Check for functions ****
124 dnl **** Check for header files ****
131 dnl **** Check for types ****
136 AC_CHECK_SIZEOF(long long,0)
138 if test "$HAVEGL" = "yes"
140 if test "$HAVESDL" = "yes"
142 BUILDNAMES="OpenGL (SDL)"
144 BUILDNAMES="OpenGL (GLX)"
148 dnl **** Generate output files ****
151 AC_SUBST_FILE(MAKE_RULES)
156 echo "HHexen configuration finished."
157 echo "Enabled targets: $BUILDNAMES"
159 if test "$HAVESDL" = "no"
161 echo "It is recommended that you install SDL (http://www.libsdl.org)."
162 echo "Other targets will compile, but they are no longer supported."
163 echo "If SDL is installed, you will need to upgrade to version $SDL_VERSION"
166 echo "Type 'make' to compile."