dnl Process this file with autoconf to produce a configure script. AC_INIT(src/d_main.c) AC_CONFIG_AUX_DIR(autotools) dnl --- Set version strings PR_MAJOR_VERSION=2 PR_MINOR_VERSION=3 PR_MICRO_VERSION=2 PR_VERSION=$PR_MAJOR_VERSION.$PR_MINOR_VERSION.$PR_MICRO_VERSION AC_SUBST(PR_VERSION) dnl --- Check for system type AC_CANONICAL_SYSTEM use_i386_asm=no case "$target" in i?86-*) use_i386_asm=yes ;; esac AC_ARG_ENABLE(i386-asm,[ --disable-i386-asm Do not use i386 assembly], use_i386_asm=no) echo "checking whether to use x86 asm versions of some functions..." $use_i386_asm if test "$use_i386_asm" = yes; then AC_DEFINE(I386_ASM) fi dnl --- Fire up automake AM_INIT_AUTOMAKE(prboom,$PR_VERSION) AM_CONFIG_HEADER(config.h) if test "x$prefix" != xNONE; then DOOMWADDIR="$prefix/share/games/doom" else DOOMWADDIR="$ac_default_prefix/share/games/doom" fi AC_DEFINE_UNQUOTED(DOOMWADDIR,"$DOOMWADDIR") dnl --- Check for programs AC_PROG_CC AC_PROG_LN_S AC_PROG_RANLIB dnl --- cph: work out flags to pass to compiler CFLAGS_OPT="-O2 -fomit-frame-pointer" dnl --- Option to enable debugging AC_ARG_ENABLE(debug,[ --enable-debug turns on various debugging features, like range checking and internal heap diagnostics], AC_ARG_ENABLE(dmalloc,[ --enable-dmalloc use the dmalloc heap debug library],AC_CHECK_LIB(dmalloc,malloc)) AC_DEFINE(RANGECHECK) AC_DEFINE(INSTRUMENTED) AC_DEFINE(TIMEDIAG) CFLAGS_OPT="-g" ) AC_ARG_ENABLE(profile,[ --enable-profile turns on profiling], CFLAGS_OPT="-pg" ) dnl --- Try for processor optimisations AC_CPU_OPTIMISATIONS dnl --- some defaults for CFLAGS AC_C_COMPILE_FLAGS(-Wall -Winline -Wwrite-strings -ffast-math $CFLAGS_OPT $CPU_CFLAGS) CFLAGS="$CFLAGS -I\$(top_srcdir)/src" dnl --- Compiler characteristics AC_C_CONST AC_C_INLINE if test "$cross_compiling" != "yes"; then AC_C_BIGENDIAN fi dnl --- Header files, typedefs, structures AC_TYPE_UID_T AC_TYPE_SIZE_T AC_DECL_SYS_SIGLIST AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(unistd.h asm/byteorder.h) dnl --- Library functions AC_CHECK_FUNC(stricmp,,AC_DEFINE(stricmp,strcasecmp)) AC_CHECK_FUNC(strnicmp,,AC_DEFINE(strnicmp,strncasecmp)) AC_CHECK_FUNCS(getopt inet_aton inet_pton inet_ntop snprintf vsnprintf mmap vasprintf usleep strlwr) dnl --- Check for libraries dnl --- cph: we need pow(3) in SDL/i_sound.c; on some systems it gets pulled dnl --- in by other libraries, ubt we can't rely on that. AC_CHECK_LIB(m,pow) dnl - system specific stuff case "$target" in *-*-cygwin* | *-*-mingw32*) MATHLIB="" SYS_GL_LIBS="" ;; *-*-beos*) MATHLIB="" SYS_GL_LIBS="" ;; *-*-aix*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -mthreads" fi ;; *) MATHLIB="-lm" SYS_GL_LIBS="" ;; esac dnl - SDL AM_PATH_SDL(1.1.3, sdl_main="yes") AC_CHECK_LIB(SDL_mixer,Mix_LoadMUS,[ AC_DEFINE(HAVE_LIBSDL_MIXER) MIXER_LIBS="$MIXER_LIBS -lSDL_mixer" BUILD_DOOM="prboom" ],echo "*** Cannot compile PrBoom without SDL_mixer installed" echo "But I can compile the game server" BUILD_DOOM="" ,$SDL_LIBS $MIXER_LIBS) AC_CHECK_LIB(SDL_net,SDLNet_UDP_Bind,[ AC_DEFINE(HAVE_LIBSDL_NET) AC_DEFINE(USE_SDL_NET) NET_LIBS=-lSDL_net has_net=yes sdl_net=yes save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $SDL_CFLAGS" AC_TRY_COMPILE([ #include "SDL_net.h" ],[ UDPpacket *p; int n = sizeof(p->src); ], AC_DEFINE(SDL_NET_UDP_PACKET_SRC)) CFLAGS="$save_CFLAGS" ],,$SDL_LIBS) AM_CONDITIONAL(SDL_NET, test "$sdl_net" = yes) if test "$sdl_main" != "yes" || test "$sdl_net" != yes then AC_MSG_ERROR([*** You must have the SDL libraries installed before you can compile prboom *** See http://prboom.sourceforge.net/linux.html ]) fi dnl - Net AC_DEFINE(HAVE_NET) AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,AC_DEFINE(HAVE_IPv6)) dnl --- Options dnl - Always use highres mode, unless explicitely --disabled AC_ARG_ENABLE(highres,[ --disable-highres disables support for resulutions greater than 320x200],,AC_DEFINE(HIGHRES)) AC_ARG_ENABLE(dogs,[ --disable-dogs disables support for helper dogs],,AC_DEFINE(DOGS)) dnl - By default, simple checks with little overhead are done to catch memory corruption, or dnl - problems with new code AC_ARG_ENABLE(checks,[ --disable-checks disables some basic internal sanity checks],, AC_DEFINE(SIMPLECHECKS) AC_DEFINE(ZONEIDCHECK)) AC_ARG_ENABLE(heapcheck,[ --enable-heapcheck turns on continuous heap checking (very slow)],AC_DEFINE(CHECKHEAP)) AC_ARG_ENABLE(heapdump,[ --enable-heapdump turns on dumping the heap state for debugging],AC_DEFINE(HEAPDUMP)) AM_CONDITIONAL(WAD_MMAP,test "$ac_cv_func_mmap" = yes) AC_SUBST(BUILD_DOOM) AC_SUBST(MIXER_CFLAGS) AC_SUBST(MIXER_LIBS) AC_SUBST(NET_CFLAGS) AC_SUBST(NET_LIBS) AC_SUBST(LIB_SND) AC_SUBST(MATH_LIB) AC_SUBST(GL_LIBS) AC_SUBST(DLL_LIBS) AC_SUBST(CFLAGS) dnl -- ac_aux_dir - see Makefile.am AC_SUBST(ac_aux_dir) AC_DEFINE(GL_DOOM) AC_MSG_CHECKING(whether compiler supports ULL number suffix) AC_TRY_COMPILE(,[ #define STUFF 0x0000000000000001ULL ],[ AC_DEFINE(USE_ULL_SUFFIX) AC_MSG_RESULT(yes) ],[AC_MSG_RESULT(no)]) dnl --- output AC_OUTPUT(Makefile src/Makefile src/inl/Makefile src/POSIX/Makefile src/SDL/Makefile src/vidd/Makefile doc/Makefile data/Makefile ICONS/Makefile ViddSys/Makefile ViddSys/bzlib/Makefile ViddSys/XML/Makefile ViddSys/zlib/Makefile VISUALC5/Makefile VISUALC6/Makefile VISUALCNET/Makefile prboom.spec) # src/OSS/Makefile src/X11/Makefile