]> icculus.org git repositories - btb/d2x.git/blob - configure.in
This commit was generated by cvs2svn to compensate for changes in r2,
[btb/d2x.git] / configure.in
1 AC_INIT(main/game.c)
2
3 AM_CONFIG_HEADER(conf.h)
4 AM_INIT_AUTOMAKE(d2x, 0.0.8)
5
6 AM_MAINTAINER_MODE
7
8
9 AC_ISC_POSIX
10 AC_PROG_CC
11 AC_PROG_RANLIB
12 AC_STDC_HEADERS
13
14 AC_CYGWIN
15 AC_MINGW32
16
17 CFLAGS="-D_REENTRANT -g -O2 -Wall -pipe"
18 AC_SUBST(CFLAGS)
19
20 AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="-lSDL", AC_MSG_ERROR(The SDL, which is required, not found.),-ldl -lpthread)
21 AC_CHECK_HEADERS(netipx/ipx.h)
22 AC_SUBST(SDL_LIBS)
23
24 # Check for NASM and network
25 NO_ASM=0
26 NO_NETWORK=0
27 AC_ARG_WITH(assembler,
28   [  --without-assembler          Do not use assembler optimization ],
29       if test x$withval = xno; then
30         NO_ASM=1
31       fi)
32 AC_ARG_WITH(network,
33   [  --without-network            Do not build network/serial support ],
34       if test x$withval = xno; then
35         NO_NETWORK=1
36       fi)
37
38       
39 AC_PATH_PROG(NASM, nasm, no)
40 if test "$NASM" = "no"; then
41         NO_ASM=1        
42 fi
43 if test "$NO_ASM" = 1; then
44         AC_DEFINE(NO_ASM)
45         NASMFLAGS=""
46 else
47         case $ARCH in
48           win32)
49               NASMFLAGS="-f win32"
50               ;;
51           *)
52               NASMFLAGS="-f elf -d__ENV_LINUX__"
53               ;;
54         esac
55 fi
56 if test "$NO_NETWORK" = 0; then
57         AC_DEFINE(NETWORK)
58 fi
59 AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
60 AC_SUBST(NASMFLAGS)
61
62 # Check for OpenGL
63 AC_ARG_WITH(opengl,
64   [  --with-opengl                Build OpenGL support ],
65   [case "${withval}" in
66     yes) opengl=true ;;
67     no)  opengl=false ;;
68     *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
69   esac],[opengl=false])
70
71 if test x$opengl = xtrue; then
72   AC_CHECK_LIB(MesaGL, main,
73     OGL_LIBS="-lMesaGL", 
74     [AC_MSG_ERROR(MesaGL not found, OpenGL cannot be built)
75      opengl=false],
76      -L/usr/X11R6/lib -lX11 -lXext -lm)
77   AC_CHECK_LIB(MesaGLU,main,
78     OGL_LIBS="${OGL_LIBS} -lMesaGLU",
79     [AC_MSG_ERROR(MesaGLU not found, OpenGL cannot be built)
80      opengl=false],
81      -lMesaGL -L/usr/X11R6/lib -lX11 -lXext -lm)
82 fi
83
84 if test x$opengl = xtrue; then
85   AC_DEFINE(OGL)
86 fi
87 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
88
89
90 AC_ARG_PROGRAM
91
92 #libdir='$(shell pwd)/${top_srcdir}/main'
93
94 AC_OUTPUT(
95 Makefile
96 2d/Makefile
97 3d/Makefile
98 maths/Makefile
99 mem/Makefile
100 cfile/Makefile
101 iff/Makefile
102 texmap/Makefile
103 misc/Makefile
104 input/Makefile
105 input/sdl/Makefile
106 input/linux/Makefile
107 input/ggi/Makefile
108 video/Makefile
109 sound/Makefile
110 arch/Makefile
111 arch/linux/Makefile
112 arch/sdl/Makefile
113 main/Makefile
114 )
115