]> icculus.org git repositories - theoddone33/hhexen.git/blob - configure.in
Remove obnoxious documentation files
[theoddone33/hhexen.git] / configure.in
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)
6
7 dnl **** Command-line arguments ****
8
9 dnl Default values
10 GLHEXEN="false"
11 GLLIBS=""
12 BASELIBS=""
13 SVGALIBS=""
14 LIBS="-L/usr/X11R6/lib"
15 HAVEGL="no"
16 GLBASE="opengl/i_gl.cpp"
17 BUILDNAMES=""
18
19 AC_ARG_ENABLE(gl,
20 [  --enable-gl                  Enable OpenGL mode],
21 [GLHEXEN="true";SDL_VERSION="1.1.2"; AC_DEFINE(RENDER3D)],
22 [SDL_VERSION="1.1.0"])
23
24 AC_ARG_ENABLE(demowad,
25 [  --enable-demowad             Enable compilation with the demo wadfile],
26 [ AC_DEFINE(DEMO_WAD)])
27
28 AC_ARG_ENABLE(assassin,
29 [  --disable-assassin           Compile HHexen without support for the assassin],
30 , [AC_DEFINE(ASSASSIN)])
31
32 AC_SUBST(GLHEXEN)
33 AC_SUBST(SVGALIBS)
34
35 AC_DEFINE(_REENTRANT)
36 AC_DEFINE(NORANGECHECKING)
37
38 dnl **** Check for some programs ****
39
40 AC_PROG_CC
41 AC_PROG_CPP
42
43 dnl **** Check for some libraries ****
44
45 dnl Check for pthread
46 AC_CHECK_LIB(pthread, pthread_join, [BASELIBS="-lpthread"])
47
48 AC_SUBST(BASELIBS)
49
50 dnl Check for SDL
51 AM_PATH_SDL($SDL_VERSION,
52         [HAVESDL="yes";GLBASE="sdl/i_sdlgl.o";BUILDNAMES="sdl $BUILDNAMES";GLLIBS=""],
53         [HAVESDL="no"]
54 )
55
56 AC_SUBST(GLLIBS)
57 AC_SUBST(SDL_OGL)
58 AC_SUBST(HAVESDL)
59 AC_SUBST(GLBASE)
60
61 AC_CHECK_LIB(dl, dlopen)
62 AC_CHECK_LIB(m, sqrt)
63
64 dnl Check for GL libraries
65
66 if test "$GLHEXEN" = "true"
67 then
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"),
72           HAVEGL="no")
73         ),
74         AC_CHECK_LIB(MesaGL, glBindTexture,[LIBS="$LIBS -lMesaGL";]
75           AC_CHECK_LIB(MesaGLU, gluOrtho2D, [HAVEGL="yes"], HAVEGL="no"),
76         HAVEGL="no")
77     )
78 fi
79
80 dnl **** Check for gcc strength-reduce bug ****
81
82 if test "x${GCC}" = "xyes"
83 then
84   CFLAGS="$CFLAGS -Wall"
85   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
86                   AC_TRY_RUN([
87 int main(void) {
88   static int Array[[3]];
89   unsigned int B = 3;
90   int i;
91   for(i=0; i<B; i++) Array[[i]] = i - 3;
92   exit( Array[[1]] != -2 );
93 }],
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"
98   then
99     CFLAGS="$CFLAGS -fno-strength-reduce"
100   fi
101 fi
102
103 dnl **** Check for underscore on external symbols ****
104
105 AC_CACHE_CHECK("whether external symbols need an underscore prefix",
106                ac_cv_c_extern_prefix,
107 [saved_libs=$LIBS
108 LIBS="conftest_asm.s $LIBS"
109 cat > conftest_asm.s <<EOF
110         .globl _ac_test
111 _ac_test:
112         .long 0
113 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")
116 LIBS=$saved_libs])
117
118 dnl **** Check for endianness ****
119
120 dnl AC_C_BIGENDIAN
121
122 dnl **** Check for functions ****
123
124 dnl **** Check for header files ****
125
126 AC_CHECK_HEADERS(\
127         linux/cdrom.h \
128 )
129 AC_HEADER_STAT()
130
131 dnl **** Check for types ****
132
133 AC_C_CONST()
134 AC_C_INLINE()
135 AC_TYPE_SIZE_T()
136 AC_CHECK_SIZEOF(long long,0)
137
138 if test "$HAVEGL" = "yes"
139 then
140   if test "$HAVESDL" = "yes"
141   then
142     BUILDNAMES="OpenGL (SDL)"
143   else
144     BUILDNAMES="OpenGL (GLX)"
145   fi 
146 fi
147
148 dnl **** Generate output files ****
149
150 MAKE_NAME=Makefile
151 AC_SUBST_FILE(MAKE_RULES)
152
153 AC_OUTPUT(Makefile)
154
155 echo
156 echo "HHexen configuration finished."
157 echo "Enabled targets: $BUILDNAMES"
158 echo
159 if test "$HAVESDL" = "no"
160 then
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"
164   echo
165 fi  
166 echo "Type 'make' to compile."
167 echo