AC_INIT(q3base, 0.1) AC_CONFIG_SRCDIR([src/game/q_shared.h]) AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE # ------------------ # Check for programs # ------------------ AC_PROG_CC AC_PROG_CPP AC_PROG_LIBTOOL # ---- # NASM # ---- # We need nasm on x86 for the VM (ftol.nasm) case "${host}" in i?86-*-*) AC_PATH_PROG(NASM, nasm, AC_MSG_ERROR([You'll need nasm to build Q3Base on i386])) ;; esac # ------------------- # Check for libraries # ------------------- # ------ # Curses # ------ BUILD_CURSES_CON=no AC_CHECK_HEADERS(curses.h, [ AC_CHECK_LIB(curses, initscr, [ CFLAGS="$CFLAGS -DCURSES_CON" LIBS="$LIBS -lcurses" BUILD_CURSES_CON=yes ]) ]) AM_CONDITIONAL(BUILD_CURSES_CON, test "$BUILD_CURSES_CON" = "yes") # --- # SDL # --- AM_PATH_SDL(1.2.0, , AC_MSG_ERROR([You'll need at least SDL 1.2.0 to build Q3Base])) CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" # ------- # SDL_net # ------- AC_CHECK_HEADERS(SDL_net.h, , AC_MSG_ERROR([You'll need SDL_net to build Q3Base])) AC_CHECK_LIB(SDL_net, SDLNet_Init, , AC_MSG_ERROR([You'll need SDL_net to build Q3Base])) LIBS="$LIBS -lSDL_net" AC_ARG_ENABLE(client, [ --disable-client dedicated server only (client requires OpenGL)]) if test x"$enable_client" != x"no"; then # --------- # SDL_image # --------- BUILD_CLIENT=yes AC_CHECK_HEADERS(SDL_image.h, , AC_MSG_ERROR([You'll need SDL_image to build the client])) AC_CHECK_LIB(SDL_image, IMG_Load_RW, , AC_MSG_ERROR([You'll need SDL_image to build the client])) LIBS="$LIBS -lSDL_image" CFLAGS="$CFLAGS -DSDL_GLIMP" # ------ # OpenGL # ------ AC_MSG_CHECKING(if we can build against SDL_opengl.h) CFLAGS="$CFLAGS -I/usr/X11R6/include" opengl_works=no AC_TRY_COMPILE([ #include "SDL_opengl.h" ], [], opengl_works=yes) AC_MSG_RESULT($opengl_works) if test x"$opengl_works" = x"no"; then AC_MSG_ERROR([It looks like we can't build against SDL_opengl. Check your include paths...]) fi else BUILD_CLIENT=no CFLAGS="$CFLAGS -DDEDICATED" fi AM_CONDITIONAL(BUILD_CLIENT, test x"$BUILD_CLIENT" = x"yes") # -- # VM # -- AC_MSG_CHECKING(whether a VM is available for your platform) vm_x86=no vm_ppc=no case "${host}" in i?86-*-*) AC_MSG_RESULT(x86) vm_x86=yes ;; powerpc-*-*) AC_MSG_RESULT(x86) vm_x86=yes ;; *) AC_MSG_RESULT(no) ;; esac AM_CONDITIONAL(BUILD_VM_I386, test x"$vm_x86" = x"yes") AM_CONDITIONAL(BUILD_VM_PPC, test x"$vm_ppc" = x"yes") # ------------ # Search paths # ------------ test "$prefix" = "NONE" && prefix=/usr/local test "$exec_prefix" = "NONE" && exec_prefix=$prefix eval PKGLIBDIR="$libdir/quake3" AC_DEFINE_UNQUOTED(PKGLIBDIR, "$PKGLIBDIR", [Define this to the path containing the dynamic modules (\${exec-prefix}/lib/quake3/)]) eval PKGDATADIR="$datadir/quake3" AC_DEFINE_UNQUOTED(PKGDATADIR, "$PKGDATADIR", [Define this to the path containing the game data (\${prefix}/share/quake3/)]) AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT