📄 configure.in
字号:
dnl This configuration script was based on that of Tuxracer. dnl http://www.tuxracer.com/dnl Process this file with autoconf to produce a configure script.AC_INIT(src/scourge.h)AM_INIT_AUTOMAKE(scourge, "0.61")AM_CONFIG_HEADER(config.h)dnl Check system typeAC_CANONICAL_HOSTdnl Check for compilers. We set CFLAGS and CXXFLAGS to null if unset, sodnl that these macros won't set them to default values that we don't want.if test "x${CFLAGS-notset}" = "xnotset" ; then export CFLAGS CFLAGS=""fiAC_PROG_CCif test "x${CXXFLAGS-notset}" = "xnotset" ; then export CXXFLAGS CXXFLAGS=""fiAC_PROG_CXXdnl Check for ranlibAC_PROG_RANLIBdnl we'll compile subdirectories into .la files.dnl AM_PROG_LIBTOOLdnl run make in subdirectoriesAC_PROG_MAKE_SETdnl Checks for header files.AC_HEADER_STDCAC_CHECK_HEADERS(sys/time.h unistd.h)dnl Checks for typedefs, structures, and compiler characteristics.AC_C_CONSTAC_HEADER_TIMEdnl Checks for library functions.AC_CHECK_FUNCS(getcwd gettimeofday strdup)dnl Check for non-standard floating point functions and headersAC_CHECK_FUNCS(finite isnan)AC_CHECK_FUNCS(_finite _isnan)AC_CHECK_HEADERS(ieeefp.h)dnl --------------------------------------------------------------------------dnl General optionsdnl --------------------------------------------------------------------------TR_CPPFLAGS=""TR_CFLAGS="-O2 -Wall -Wno-deprecated -fomit-frame-pointer -ffast-math -fexpensive-optimizations"TR_CXXFLAGS="-O2 -Wall -Wno-deprecated -fomit-frame-pointer -ffast-math -fexpensive-optimizations"TR_LIBS=""case "$host" ini*86-*-*) TR_CFLAGS="$TR_CFLAGS -falign-loops=2 -falign-jumps=2 -falign-functions=2"; TR_CXXFLAGS="$TR_CXXFLAGS -falign-loops=2 -falign-jumps=2 -falign-functions=2";;alpha*-*-linux-*) TR_CFLAGS="$TR_CFLAGS -mieee";;esacAC_ARG_ENABLE(debug, [ --enable-debug Produce an executable with debugging symbols], [TR_CFLAGS="-g -Wall -Wno-deprecated -fno-inline"; TR_CXXFLAGS="-g -Wall -Wno-deprecated -fno-inline"], [TR_CPPFLAGS="$TR_CPPFLAGS -DTUXRACER_NO_ASSERT=1"])AC_ARG_ENABLE(pedantic, [ --enable-pedantic Enable -pedantic (and -ansi for C) when compiling], TR_CFLAGS="$TR_CFLAGS -ansi -pedantic"; TR_CXXFLAGS="$TR_CXXFLAGS -pedantic")AC_ARG_ENABLE(profile,[ --enable-profile Produce a profiled executable], [TR_CFLAGS="$TR_CFLAGS -pg"; TR_CXXFLAGS="$TR_CXXFLAGS -pg"])dnl --------------------------------------------------------------------------dnl Check if compiling for Win32dnl --------------------------------------------------------------------------AC_MSG_CHECKING([for Win32 platform])AC_EGREP_CPP(yes,[ #if defined(WIN32) || defined(__CYGWIN__) yes#endif], is_win32=yes, is_win32=no )AC_MSG_RESULT([$is_win32])dnl Add libs required for Windowsdnl I don't use -mwindows since I like having the console arounddnl If the console annoys you then remove "-luser32 -lgdi32" and replacednl with "-mwindows"if test "x$is_win32" = "xyes" ; then TR_LIBS="$TR_LIBS -luser32 -lgdi32"fidnl --------------------------------------------------------------------------dnl Check for X dnl Note that we only need libs (so that glut links properly on all systems).dnl --------------------------------------------------------------------------if test "x$is_win32" = "xno" ; then AC_PATH_XTRA if test "x$no_x" = "x" ; then TR_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXi -lXext -lXmu -lXt $X_EXTRA_LIBS $TR_LIBS" fifidnl --------------------------------------------------------------------------dnl Check for some common librariesdnl --------------------------------------------------------------------------AC_CHECK_LIB( dl, main, TR_LIBS="$TR_LIBS -ldl" )AC_CHECK_LIB( m, main, TR_LIBS="$TR_LIBS -lm" )dnl --------------------------------------------------------------------------dnl Check for SDLdnl --------------------------------------------------------------------------AC_ARG_ENABLE(sdl,[ --disable-sdl Disable detction and use of SDL])if test "x$enable_sdl" != "xno" ; then SDL_VERSION=1.0.1 AM_PATH_SDL($SDL_VERSION, have_SDL=yes, have_SDL=no) if test "x$have_SDL" = "xyes" ; then TR_CPPFLAGS="$TR_CPPFLAGS -DHAVE_SDL=1" TR_CFLAGS="$TR_CFLAGS $SDL_CFLAGS" TR_CXXFLAGS="$TR_CXXFLAGS $SDL_CFLAGS" TR_LIBS="$TR_LIBS $SDL_LIBS" dnl Check for joystick support in SDL saved_LIBS="$LIBS" LIBS="$saved_LIBS $TR_LIBS" AC_CHECK_FUNCS( SDL_JoystickOpen, have_SDL_joystick=yes, have_SDL_joystick=no ) if test "x$have_SDL_joystick" = "xno" ; then echo "*** This version of SDL doesn't have joystick support." echo "*** Configuring without joystick support." fi dnl Check for SDL_mixer AC_CHECK_LIB( SDL_mixer, Mix_OpenAudio, have_SDL_mixer=yes, have_SDL_mixer=no ) if test "x$have_SDL_mixer" = "xyes" ; then TR_CPPFLAGS="$TR_CPPFLAGS -DHAVE_SDL_MIXER=1" TR_LIBS="$TR_LIBS -lSDL_mixer" else echo "*** SDL_mixer not found. Configuring without audio support." fi LIBS="$saved_LIBS" else echo "*** SDL not found. Configuring without audio or joystick support." fifidnl --------------------------------------------------------------------------dnl Check for GL librarydnl --------------------------------------------------------------------------AC_ARG_WITH(gl-libs, [ --with-gl-libs=DIR GL/MesaGL library location])AC_ARG_WITH(gl-lib-name, [ --with-gl-lib-name=NAME GL library name])if test "x$with_gl_libs" = "x" ; then GL_LDOPTS=""else GL_LDOPTS="-L$with_gl_libs"fisaved_LIBS="$LIBS"AC_DEFUN( CHECK_FOR_GL_LIB, [ AC_MSG_CHECKING([for $GL_LIB_NAME library]) LIBS="$saved_LIBS $TR_LIBS $GL_LDOPTS -l$GL_LIB_NAME" AC_TRY_LINK( , , have_GL=yes, have_GL=no) AC_MSG_RESULT([$have_GL]) if test "x$have_GL" = "xyes" ; then TR_LIBS="$TR_LIBS $GL_LDOPTS -l$GL_LIB_NAME" else dnl Try with -lpthread AC_MSG_CHECKING([for $GL_LIB_NAME library (with pthreads)]) LIBS="$saved_LIBS $TR_LIBS $GL_LDOPTS -l$GL_LIB_NAME -lpthread" AC_TRY_LINK( , , have_GL=yes, have_GL=no) AC_MSG_RESULT([$have_GL]) if test "x$have_GL" = "xyes" ; then TR_LIBS="$TR_LIBS $GL_LDOPTS -l$GL_LIB_NAME -lpthread" fi fi])AC_DEFUN( FIND_GL_LIB, [ if test "x$with_gl_lib_name" = "x" ; then GL_LIB_NAME="GL" else GL_LIB_NAME="$with_gl_lib_name" fi CHECK_FOR_GL_LIB if test "x$have_GL" = "xno" -a "x$with_gl_lib_name" = "x" ; then GL_LIB_LIST=`grep -v -E "^$GL_LIB_NAME\$" <<EOFGLMesaGLopengl32EOF` for GL_LIB_NAME in $GL_LIB_LIST ; do CHECK_FOR_GL_LIB if test "x$have_GL" = "xyes" ; then break; fi done fi])FIND_GL_LIBif test "x$have_GL" = "xno" -a "x$GL_LDOPTS" = "x" ; then echo "*** Hmm, you don't seem to have OpenGL libraries installed in the standard" echo "*** location (/usr/lib). I'll check in /usr/X11R6/lib, since" echo "*** many distributions (incorrectly) put OpenGL libs there." GL_LDOPTS="-L/usr/X11R6/lib" FIND_GL_LIBfiif test "x$have_GL" = "xno" ; then AC_MSG_ERROR([Cannot find GL library])fidnl Check for glXGetProcAddressARBAC_CHECK_FUNCS( glXGetProcAddressARB, has_glx_get_proc=yes, has_glx_get_proc=no )LIBS="$saved_LIBS"dnl --------------------------------------------------------------------------dnl Check for GLU librarydnl --------------------------------------------------------------------------AC_ARG_WITH(glu-lib-name, [ --with-glu-lib-name=NAME GLU library name])AC_DEFUN( CHECK_FOR_GLU_LIB, [ AC_MSG_CHECKING([for $GLU_LIB_NAME library]) LIBS="$saved_LIBS $TR_LIBS -l$GLU_LIB_NAME" AC_TRY_LINK( , , have_GLU=yes, have_GLU=no) AC_MSG_RESULT([$have_GLU])])if test "x$with_glu_lib_name" = "x" ; then GLU_LIB_NAME="GLU"else GLU_LIB_NAME="$with_glu_lib_name"fisaved_LIBS="$LIBS"CHECK_FOR_GLU_LIBif test "x$have_GLU" = "xno" -a "x$with_glu_lib_name" = "x"; then GLU_LIB_LIST=`grep -v -E "^$GLU_LIB_NAME\$" <<EOFGLUMesaGLUglu32EOF` for GLU_LIB_NAME in $GLU_LIB_LIST ; do CHECK_FOR_GLU_LIB if test "x$have_GLU" = "xyes" ; then break fi donefiif test "x$have_GLU" = "xno" ; then AC_MSG_ERROR([Cannot find GLU library])fiLIBS="$saved_LIBS"TR_LIBS="$TR_LIBS -l$GLU_LIB_NAME"dnl --------------------------------------------------------------------------dnl Check for freetype librarydnl --------------------------------------------------------------------------dnl AC_ARG_WITH(freetype-config, [ --with-freetype-config=NAME path to freetype-config])saved_LIBS="$LIBS"saved_CPPFLAGS="$CPPFLAGS"AC_MSG_CHECKING([for freetype-config library])AC_PATH_PROG(FREETYPE, freetype-config, no)if test "$FREETYPE" = "no"; then AC_MSG_ERROR(Cannot find freetype2: Is freetype-config in path?) have_FREETYPE=noelse FREETYPE_CFLAGS=`freetype-config --cflags` FREETYPE_LIBS=`freetype-config --libs` have_FREETYPE=yesfiLIBS="$saved_LIBS"TR_LIBS="$TR_LIBS $FREETYPE_LIBS"CPPFLAGS="$saved_CPPFLAGS" TR_CPPFLAGS="$TR_CPPFLAGS $FREETYPE_CFLAGS"dnl --------------------------------------------------------------------------dnl Check for OpenGL headersdnl --------------------------------------------------------------------------AC_ARG_WITH(gl-inc, [ --with-gl-inc=DIR OpenGL header file location])if test "x$with_gl_inc" = "x" ; then GL_CPPFLAGS=""else GL_CPPFLAGS="-I$with_gl_inc"fidnl check for gl.hsaved_CPPFLAGS="$CPPFLAGS"AC_DEFUN( CHECK_FOR_GL_H, [ CPPFLAGS="$saved_CPPFLAGS $GL_CPPFLAGS $TR_CPPFLAGS" AC_MSG_CHECKING([for GL/gl.h]) AC_TRY_CPP( [ #include <GL/gl.h> ], have_gl_h=yes, have_gl_h=no ) AC_MSG_RESULT([$have_gl_h])])CHECK_FOR_GL_Hif test "x$have_gl_h" = "xno" -a "x$GL_CPPFLAGS" = "x" ; then echo "*** Hmm, you don't seem to have OpenGL headers installed in the standard" echo "*** location (/usr/include). I'll check in /usr/X11R6/include, since" echo "*** many distributions (incorrectly) put OpenGL headers there." GL_CPPFLAGS="-I/usr/X11R6/include" CHECK_FOR_GL_Hfiif test "x$have_gl_h" = "xno" ; then AC_MSG_ERROR([Cannot find GL/gl.h])fiif test "x$has_glx_get_proc" = "xyes" ; then dnl Check for glx.h AC_CHECK_HEADERS([GL/glx.h], have_glx_h=yes, have_glx_h=no ) if test "x$have_glx_h" = "xno" ; then AC_MSG_ERROR([Cannot find GL/glx.h]) fi dnl Check that glXGetProcAddressARB is defined in glx.h dnl AC_MSG_CHECKING([whether glx.h defines glXGetProcAddressARB]); dnl AC_TRY_COMPILE( [#include <GL/glx.h>], [ char *foo = (char*) glXGetProcAddressARB; ], dnl glx_h_up_to_date=yes, glx_h_up_to_date=no ) dnl AC_MSG_RESULT([$glx_h_up_to_date]) dnl if test "x$glx_h_up_to_date" = "xno" ; then dnl AC_MSG_ERROR([Your copy of glx.h is out of date. You can get a more recent copy from the latest Mesa distribution (http://mesa3d.sourceforge.net).]) dnl fifidnl Check for glext.h AC_CHECK_HEADERS( "GL/glext.h", have_glext_h=yes, have_glext_h=no )if test "x$have_glext_h" = "xno" ; then AC_MSG_ERROR([*****************************************************************You are missing the file glext.h.You can get a copy athttp://oss.sgi.com/projects/ogl-sample/ABI/glext.hPlace it in the directory /usr/include/GL.*****************************************************************])fidnl Check that glext.h version is recent enoughAC_MSG_CHECKING([whether glext.h is recent enough]);AC_EGREP_CPP(yes,[#include <GL/glext.h>#if defined(GL_GLEXT_VERSION) && GL_GLEXT_VERSION >= 6 yes#endif], is_glext_h_recent=yes, is_glext_h_recent=no )AC_MSG_RESULT([$is_glext_h_recent])if test "x$is_glext_h_recent" = "xno" ; then AC_MSG_ERROR([*****************************************************************Your copy of glext.h is out of date.You can get a copy of the latest version athttp://oss.sgi.com/projects/ogl-sample/ABI/glext.hPlace it in the directory /usr/include/GL.*****************************************************************])fiCPPFLAGS="$saved_CPPFLAGS" TR_CPPFLAGS="$TR_CPPFLAGS $GL_CPPFLAGS"dnl --------------------------------------------------------------------------dnl Other optionsdnl --------------------------------------------------------------------------dnl Turn use of stencil buffer on/offAC_ARG_ENABLE(stencil-buffer,[ --enable-stencil-buffer Use if your hardware has a stencil buffer],TR_CPPFLAGS="$TR_CPPFLAGS -DUSE_STENCIL_BUFFER")dnl Specify data directoryAC_ARG_WITH(data-dir,[ --with-data-dir=PATH Default scourge data directory],TR_CPPFLAGS="$TR_CPPFLAGS -DDATA_DIR=\\\"$withval\\\"")AC_SUBST(TR_CPPFLAGS)AC_SUBST(TR_CFLAGS)AC_SUBST(TR_CXXFLAGS)AC_SUBST(TR_LIBS)CPPFLAGS="$CPPFLAGS $TR_CPPFLAGS"CFLAGS="$CFLAGS $TR_CFLAGS"CXXFLAGS="$CXXFLAGS $TR_CXXFLAGS"LIBS="$LIBS $TR_LIBS"AC_OUTPUT(Makefile src/Makefile src/gui/Makefile src/rpg/Makefile src/events/Makefile src/freetype/Makefile )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -