1 dnl Process this file with autoconf to produce a configure script.
2 dnl configure.in for HHeretic
3 AC_REVISION([configure.in 1.00])
5 AC_CONFIG_HEADER(include/config.h)
7 dnl **** Command-line arguments ****
13 LIBS="-L/usr/X11R6/lib"
18 [ --enable-gl Enable OpenGL mode],
19 [GLHEXEN="true";SDL_VERSION="1.1.2"; AC_DEFINE(RENDER3D)],
20 [SDL_VERSION="1.1.0"])
26 AC_DEFINE(NORANGECHECKING)
28 dnl **** Check for some programs ****
33 dnl **** Check for some libraries ****
36 AC_CHECK_LIB(pthread, pthread_join, [BASELIBS="-lpthread"])
41 AM_PATH_SDL($SDL_VERSION,
42 [HAVESDL="yes";GLBASE="sdl/i_sdlgl.o";BUILDNAMES="sdl $BUILDNAMES"],
51 AC_CHECK_LIB(dl, dlopen)
54 dnl Check for GL libraries
56 if test "$GLHEXEN" = "true"
58 AC_CHECK_LIB(GL, glBindTexture,[LIBS="$LIBS -lGL";]
59 AC_CHECK_LIB(GLU, gluOrtho2D, [HAVEGL="yes"],
60 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
61 AC_CHECK_LIB(MesaGLU, gluOrtho2D, [HAVEGL="yes"], HAVEGL="no"),
64 AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
65 AC_CHECK_LIB(MesaGLU, gluOrtho2D, [HAVEGL="yes"], HAVEGL="no"),
70 dnl **** Check for gcc strength-reduce bug ****
72 if test "x${GCC}" = "xyes"
74 CFLAGS="$CFLAGS -Wall"
75 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
78 static int Array[[3]];
81 for(i=0; i<B; i++) Array[[i]] = i - 3;
82 exit( Array[[1]] != -2 );
84 ac_cv_c_gcc_strength_bug="no",
85 ac_cv_c_gcc_strength_bug="yes",
86 ac_cv_c_gcc_strength_bug="yes") )
87 if test "$ac_cv_c_gcc_strength_bug" = "yes"
89 CFLAGS="$CFLAGS -fno-strength-reduce"
93 dnl **** Check for underscore on external symbols ****
95 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
96 ac_cv_c_extern_prefix,
98 LIBS="conftest_asm.s $LIBS"
99 cat > conftest_asm.s <<EOF
104 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
105 ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
108 dnl **** Check for endianness ****
112 dnl **** Check for functions ****
116 dnl **** Check for header files ****
123 dnl **** Check for types ****
128 AC_CHECK_SIZEOF(long long,0)
130 if test "$HAVEGL" = "yes"
132 if test "$HAVESDL" = "yes"
134 BUILDNAMES="OpenGL (SDL)"
138 dnl **** Generate output files ****
141 AC_SUBST_FILE(MAKE_RULES)
146 echo "HHeretic configuration finished."
147 echo "Enabled targets: $BUILDNAMES"
149 if test "$HAVESDL" = "no"
151 echo "It is recommended that you install SDL (http://www.libsdl.org)."
152 echo "Other targets will compile, but they are no longer supported."
153 echo "If SDL is installed, you will need to upgrade to version $SDL_VERSION"
156 echo "Type 'make' to compile."