3 AM_CONFIG_HEADER(conf.h)
4 AM_INIT_AUTOMAKE(d2x, 0.0.9)
18 dnl Count warnings as errors?
20 [ --enable-werror Count compiler warning as errors ],
21 [case "${enableval}" in
22 yes) CFLAGS="-Werror $CFLAGS" ;;
24 *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
27 dnl Build with NDEBUG?
29 [ --enable-ndebug Take out extra Asserts, Int3, etc ],
30 [case "${enableval}" in
31 yes) AC_DEFINE(NDEBUG) ;;
33 *) AC_MSG_ERROR(bad value ${withval} for --enable-ndebug) ;;
37 if test "$OSTYPE" = "MSDOS"; then
39 CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS"
40 AM_CONDITIONAL(ENV_DJGPP, test "$OSTYPE" = "MSDOS")
41 AC_DEFINE(__ENV_DJGPP__)
42 AC_PATH_PROG(NASM, nasmw, no)
46 CFLAGS="-D_REENTRANT -pipe $CFLAGS"
47 AM_CONDITIONAL(ENV_LINUX, test "$OSTYPE" != "MSDOS")
48 AC_DEFINE(__ENV_LINUX__)
51 AC_CHECK_LIB(SDL, SDL_Init, SDL_LIBS="-lSDL", AC_MSG_ERROR(The SDL which is required not found.),-ldl -lpthread)
52 AC_CHECK_HEADERS(netipx/ipx.h)
57 [ --with-opengl Build OpenGL support ],
61 *) AC_MSG_ERROR(bad value ${withval} for --with-opengl) ;;
64 if test x$opengl = xtrue; then
65 AC_CHECK_LIB(GL, main,
67 [AC_MSG_ERROR([GL not found, OpenGL cannot be built])
69 -L/usr/X11R6/lib -lX11 -lXext -lm)
70 AC_CHECK_LIB(GLU,main,
71 OGL_LIBS="${OGL_LIBS} -lGLU",
72 [AC_MSG_ERROR([GLU not found, OpenGL cannot be built])
74 -lGL -L/usr/X11R6/lib -lX11 -lXext -lm)
77 AM_CONDITIONAL(USE_OPENGL, test x$opengl = xtrue)
81 [ --with-ggi Build GGI support ],
85 *) AC_MSG_ERROR(bad value ${withval} for --with-ggi) ;;
88 if test x$ggi = xtrue; then
89 AC_CHECK_LIB(ggi, ggiInit,
91 [AC_MSG_ERROR([GGI not found, GGI version cannot be built]); ggi=false])
92 AC_CHECK_LIB(gii, giiInit,
93 GGI_LIBS="${GGI_LIBS} -lgii",
94 [AC_MSG_ERROR([GII not found, GGI version cannot be built]); ggi=false])
97 AM_CONDITIONAL(USE_GGI, test x$ggi = xtrue)
101 [ --with-svga Build SVGALib support ],
102 [case "${withval}" in
105 *) AC_MSG_ERROR(bad value ${withval} for --with-svga) ;;
108 if test x$svga = xtrue; then
109 AC_CHECK_LIB(vga, vga_getmousetype,
111 [AC_MSG_ERROR([vga not found, SVGALib cannot be built])
114 AC_CHECK_LIB(vgagl,gl_getcontext,
115 SVGA_LIBS="${SVGA_LIBS} -lvgagl",
116 [AC_MSG_ERROR([vgagl not found, SVGALib cannot be built])
121 AM_CONDITIONAL(USE_SVGALIB, test x$svga = xtrue)
123 if test x$opengl = xtrue; then
125 CFLAGS="-I \$(top_srcdir)/input/ggi/include $CFLAGS"
127 if test x$svga = xtrue; then
129 CFLAGS="-I \$(top_srcdir)/input/svgalib/include $CFLAGS"
131 if test x$ggi = xtrue; then
133 CFLAGS="-I \$(top_srcdir)/input/ggi/include $CFLAGS"
135 CFLAGS="-I \$(top_srcdir)/input/sdl/include $CFLAGS"
140 AC_PATH_PROG(NASM, nasm, no)
141 CFLAGS="-I \$(top_srcdir)/input/linux/include -I \$(top_srcdir)/arch/linux/include $CFLAGS"
145 # Check for NASM and network
148 AC_ARG_WITH(assembler,
149 [ --without-assembler Do not use assembler optimization ],
150 if test x$withval = xno; then
154 [ --without-network Do not build network/serial support ],
155 if test x$withval = xno; then
159 if test "$NASM" = "no"; then
162 if test "$NO_ASM" = 1; then
171 if test "$OSTYPE" = "MSDOS"; then
174 NASMFLAGS="-f elf -d__ENV_LINUX__ -i\$(srcdir)/"
179 if test "$NO_NETWORK" = 0; then
182 AM_CONDITIONAL(USE_ASM, test "$NO_ASM" != 1)
189 #libdir='$(shell pwd)/${top_srcdir}/main'