remove duplicate file
[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.9)
5
6 AM_MAINTAINER_MODE
7
8 AC_ISC_POSIX
9 AC_PROG_CC
10 AC_PROG_RANLIB
11 AC_STDC_HEADERS
12
13 AC_CYGWIN
14 AC_MINGW32
15
16 CFLAGS="-g -O2 -Wall"
17
18 # Test for DJGPP
19 if test "$OSTYPE" = "MSDOS"; then
20
21   CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
22   AM_CONDITIONAL(ENV_DJGPP, test "$OSTYPE" = "MSDOS")
23   AC_DEFINE(__ENV_DJGPP__)
24   AC_PATH_PROG(NASM, nasmw, no)
25
26
27 else
28   CFLAGS="-D_REENTRANT -pipe $CFLAGS"
29   AM_CONDITIONAL(ENV_LINUX, test "$OSTYPE" != "MSDOS")
30   AC_DEFINE(__ENV_LINUX__)
31
32
33   AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="-lSDL", AC_MSG_ERROR(The SDL which is required not found.),-ldl -lpthread)
34   AC_CHECK_HEADERS(netipx/ipx.h)
35   AC_SUBST(SDL_LIBS)
36
37   
38   # Check for OpenGL
39   AC_ARG_WITH(opengl,
40     [  --with-opengl                Build OpenGL support ],
41     [case "${withval}" in
42       yes) opengl=true ;;
43       no)  opengl=false ;;
44       *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
45     esac],[opengl=false])
46   
47   if test x$opengl = xtrue; then
48     AC_CHECK_LIB(MesaGL, main,
49       OGL_LIBS="-lMesaGL", 
50       [AC_MSG_ERROR(MesaGL not found, OpenGL cannot be built)
51        opengl=false],
52        -L/usr/X11R6/lib -lX11 -lXext -lm)
53     AC_CHECK_LIB(MesaGLU,main,
54       OGL_LIBS="${OGL_LIBS} -lMesaGLU",
55       [AC_MSG_ERROR(MesaGLU not found, OpenGL cannot be built)
56        opengl=false],
57        -lMesaGL -L/usr/X11R6/lib -lX11 -lXext -lm)
58   fi
59
60   if test x$opengl = xtrue; then
61     AC_DEFINE(OGL)
62     CFLAGS="-I \$(top_srcdir)/input/ggi/include $CFLAGS"
63   else
64     CFLAGS="-I \$(top_srcdir)/input/sdl/include $CFLAGS"
65   fi
66   AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
67
68   AC_PATH_PROG(NASM, nasm, no)
69   CFLAGS="-I \$(top_srcdir)/input/linux/include -I \$(top_srcdir)/arch/linux/include $CFLAGS"
70
71 fi
72
73 # Check for NASM and network
74 NO_ASM=0
75 NO_NETWORK=0
76 AC_ARG_WITH(assembler,
77   [  --without-assembler          Do not use assembler optimization ],
78       if test x$withval = xno; then
79         NO_ASM=1
80       fi)
81 AC_ARG_WITH(network,
82   [  --without-network            Do not build network/serial support ],
83       if test x$withval = xno; then
84         NO_NETWORK=1
85       fi)
86       
87 if test "$NASM" = "no"; then
88         NO_ASM=1 
89 fi
90 if test "$NO_ASM" = 1; then
91         AC_DEFINE(NO_ASM)
92         NASMFLAGS=""
93 else
94         case $ARCH in
95           win32)
96               NASMFLAGS="-f win32"
97               ;;
98           *)
99               if test "$OSTYPE" = "MSDOS"; then
100                   NASMFLAGS="-f coff"
101               else
102                   NASMFLAGS="-f elf -d__ENV_LINUX__"
103               fi
104               ;;
105         esac
106 fi  
107 if test "$NO_NETWORK" = 0; then
108         AC_DEFINE(NETWORK)
109 fi
110 AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
111 AC_SUBST(NASMFLAGS)
112
113 AC_SUBST(CFLAGS)
114
115 AC_ARG_PROGRAM
116
117 #libdir='$(shell pwd)/${top_srcdir}/main'
118 AC_OUTPUT(
119 Makefile
120 2d/Makefile
121 3d/Makefile
122 maths/Makefile
123 mem/Makefile
124 cfile/Makefile
125 iff/Makefile
126 texmap/Makefile
127 misc/Makefile
128 input/Makefile
129 video/Makefile
130 sound/Makefile
131 arch/Makefile
132 main/Makefile
133 )
134