########################################################################## # orxonox - the future of 3D-vertical-scrollers # # # # Copyright (C) 2004 orx # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2, or (at your option) # # any later version. # # # # ### File Specific: # # main-programmer: Benjamin Grauer # # co-programmer: ... # # # # This is the main configuration File of autoconf. # # Please edit this file only, if you exactly know what you are doing. # # It is quite fragile, and compiling orxonox on different Platforms # # is only guarantied, if build with the right config. # # # # You might also have a look at the acinclude.m4, where many macros # # for this configuration files are stored # # # # be sure to visit us at http://www.orxonox.net # ########################################################################## ######################### ## AUTOCONF INIT PHASE ## ######################### AC_PREREQ(2.56) AC_INIT([orxonox], [0.3.5_alpha], [orxonox-dev at mail.datacore.ch]) ## Detect the canonical host and target build environment. AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/orxonox.cc]) AC_CONFIG_HEADER([config.h]) ######################### ## Checks for programs ## ######################### AC_PROG_CXX AC_PROG_RANLIB AC_HEADER_STDC ## THIS IS OUR DEFAULT-DATA-DIRECTORY ################################## ## CHECKING OPTIONAL ARGUMENTS ## ################################## #----------------# # Data-Directory # #----------------# DATA_DIR=$datadir if test $DATA_DIR = \$\{prefix\}/share ; then echo "not given" DATA_DIR=/usr/share else echo "given: $DATA_DIR" fi AC_DEFINE_UNQUOTED([ORX_DATADIR], ["$DATA_DIR"], [Define to the read-only architecture-independent data directory of ORXONOX.]) #-----------------# # shared-lib-path # #-----------------# SHARED_LIB_PATH=no AC_MSG_CHECKING([shared lib path]) AC_ARG_WITH([shared-lib-path], AS_HELP_STRING(--with-shared-lib-path,Tells the executable, where to look for the shared libraries.), SHARED_LIB_PATH=$withval) if test x$SHARED_LIB_PATH != xno; then echo "set to $SHARED_LIB_PATH" else echo "no" fi #-----------------# # DEBUG-statement # #-----------------# DEBUG_LEVEL=no AC_MSG_CHECKING([if DEBUG-mode should be enabled]) AC_ARG_ENABLE([debug], AS_HELP_STRING(--enable-debug,compiles in debug mode. Lots of debug info about the game.), DEBUG_LEVEL=$enableval) if test x$DEBUG_LEVEL = xno; then echo "no" echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed." DEBUG_LEVEL=4 elif test x$DEBUG_LEVEL = xyes; then echo "yes" echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!." DEBUG_LEVEL=4 else if test x$DEBUG_LEVEL = x0 || test x$DEBUG_LEVEL = x1 || test x$DEBUG_LEVEL = x2 || test x$DEBUG_LEVEL = x3 || test x$DEBUG_LEVEL = x4 || test x$DEBUG_LEVEL = x5 ; then echo "yes: setting debuglevel to to $DEBUG_LEVEL" else echo "yes: invalid Value for Debug ($DEBUG_LEVEL). setting to 4(DEBUG)" DEBUG_LEVEL=4 fi fi if test ${DEBUG_LEVEL} -gt 3 ; then CPPFLAGS="${CPPFLAGS} -g -Wall" fi AC_DEFINE_UNQUOTED(DEBUG_LEVEL, ${DEBUG_LEVEL}, [in which debug mode we are]) AC_SUBST(DEBUG_LEVEL) #---------------# # Modular Debug # #---------------# MODULAR_DEBUG=yes AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled]) AC_ARG_ENABLE([modular-debug], AS_HELP_STRING(--disable-modular-debug,compiles in modular-debug mode, that logs differently on the many modules of orxonox.), MODULAR_DEBUG=$enableval) if test x$MODULAR_DEBUG = xno; then echo "no" elif test x$MODULAR_DEBUG = xyes; then echo "yes" AC_DEFINE_UNQUOTED(MODULAR_DEBUG, 1, [if Modular-DUBUG mode is enabled]) fi #------------------# # libCurl-disabled # #------------------# AC_MSG_CHECKING([if libcURL should be enabled]) AC_ARG_ENABLE([curl], AS_HELP_STRING(--disable-curl,Prevents libcURL from being loaded), [def_curl=no], [def_curl=yes]) if test x$def_curl = xyes; then echo "yes" fi if test x$def_curl = xno; then echo "no" fi #--------------# # GTK-disabled # #--------------# AC_MSG_CHECKING([if gtk should be enabled]) AC_ARG_WITH([gtk], AS_HELP_STRING(--with-gtk, uses GTK for the GUI), [def_gtk=yes], [def_gtk=no]) if test x$def_gtk = xyes; then echo "yes - will be overwritten if Qt is enabled" fi if test x$def_gtk = xno; then echo "no" fi #-------------------# # SubProject-enable # #-------------------# def_sub_projects=no AC_MSG_CHECKING([if the SubProjects should be built]) AC_ARG_WITH([sub-projects], AS_HELP_STRING(--with-sub-projects,also builds the subProjects while make from srcdir), [def_sub_projects=yes]) if test x$def_sub_projects = xyes; then echo "yes" fi if test x$def_sub_projects = xno; then echo "no" fi AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes) #-------------------# # Profiling Enabled # #-------------------# def_profiling=no AC_MSG_CHECKING([if Profiling should be enabled]) AC_ARG_ENABLE([profile], AS_HELP_STRING(--enable-profile,builds orxonox with profiling support), [def_profiling=yes]) if test x$def_profiling = xyes; then echo "yes" CXXFLAGS="$CXXFLAGS -pg" fi if test x$def_profiling = xno; then echo "no" fi #----------------# # efence Enabled # #----------------# def_efence=no AC_MSG_CHECKING([if efence should be enabled]) AC_ARG_ENABLE([efence], AS_HELP_STRING(--enable-efence,builds orxonox with efence support), [def_efence=yes]) if test x$def_efence = xyes; then echo "yes" fi if test x$def_efence = xno; then echo "no" fi #----------------------# # Documentation-enable # #----------------------# def_documentation=no AC_MSG_CHECKING([if the Documentation should be build by default]) AC_ARG_ENABLE([documentation], AS_HELP_STRING(--enable-documentation,also builds the sDocumentation while make from srcdir), [def_documentation=yes]) if test x$def_documentation = xyes; then echo "yes" fi if test x$def_documentation = xno; then echo "no" fi AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes) #---------------------------# # WITH TARDIS (convenience) # #---------------------------# def_tardis=no GTKPATH="" AC_MSG_CHECKING([convenience flag for working at the taris in the ETH zurich]) AC_ARG_WITH([tardis], AS_HELP_STRING(--with-tardis,sets all the necesary environment flags for linux-TARDIS boxes at the ETH Zurich), [def_tardis=yes]) if test x$def_tardis = xyes; then ARCH=i686-debian-linux3.1 ## GAMELIBS PREFIX=/usr/pack/gamelibs-1.0-to CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include" LDFLAGS="${LDFLAGS} -L$PREFIX/${ARCH}/lib -Wl,-rpath -Wl,${PREFIX}/${ARCH}/lib" ## QT on Tardis QT_PREFIX=/usr/pack/qt-4.1.1-mo/${ARCH} # CPPFLAGS="${CPPFLAGS} -I${PREFIX_QT}/include" # LDFLAGS="${LDFLAGS} -L${QT_PREFIX}/lib -Wl,-rpath -Wl,${QT_PREFIX}/${ARCH}/lib" fi if test x$def_tardis = xno; then echo "no" fi ####################### ## PROGRAMM CHECKING ## ## 3. party Programs ## ####################### #----------------------# # checking for Doxygen # #----------------------# AC_PATH_PROG(DOXYGEN, doxygen) AM_CONDITIONAL(DOXYGEN, test $DOXYGEN) #--------------------# # checking for gprof # #--------------------# AC_PATH_PROG(GPROF, gprof) #-------------------------# # checking for pkg-config # #-------------------------# if test x$def_gtk = xyes; then if test x${GTKPATH} != x; then AC_PATH_PROG([PKG_CONFIG], [pkg-config],[], $GTKPATH ) else AC_PATH_PROG(PKG_CONFIG, pkg-config ) fi fi ######################### ## CHECKING FOR SYSTEM ## ######################### ## here the system is checked, and openGL is included ## also checking for SDL on differen Systems AC_MSG_CHECKING([for System]) ## checking for openGL-environment and other sys-specific parameters case "$target" in ########### #---------# # WINDOWS # #---------# ########### *-*-mingw32*) echo "mingw-WINDOWS detected" CPPFLAGS="-I/usr/include -I/mingw/include ${CPPFLAGS}" LDFLAGS="${LDFLAGS} -L/mingw/lib" mingw="yes" MSBITFIELDS="-mms-bitfields" MWINDOWS="-mwindows" #--------# # MIN-GW # #--------# # checking for mingw32 AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) if test x$FOUND_mingw32 = xyes; then LIBS="$LIBS -lmingw32" fi AC_CHECK_LIB([winmm], [main], [FOUND_winmm=yes]) if test x${FOUND_winmm} = xyes ; then LIBS="$LIBS -lwinmm" fi #---------------# # open-GL (win) # #---------------# # checking gl header AC_CHECK_HEADERS(GL/gl.h ,, [AC_MSG_ERROR([cannot find opengl headers])]) # checking for Windows openGl library AC_CHECK_LIB([opengl32], [main], [FOUND_GL=yes; LIBS="$LIBS -lopengl32"]) if test x$FOUND_GL != xyes ; then echo "------------------" echo "opengl not found." echo "please install the opengl package which can be found at http://www.opengl.org" echo "------------------" exit -1 fi # cheking for GLU-header AC_CHECK_HEADERS([GL/glu.h] ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) # checking for libGLU AC_CHECK_LIB([glu32], [main], [FOUND_GLU=yes; LIBS="$LIBS -lGLU32"]) if test x$FOUND_GLU != xyes ; then echo "------------------" echo "GLU library not found." echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" echo "------------------" exit -1 fi # checking glew header AC_CHECK_HEADERS(GL/glew.h ,, [AC_MSG_ERROR([cannot find opengl extension wrangler headers]) ]) # checking for Windows glew library AC_CHECK_LIB([glew32], [main], [FOUND_GLEW=yes; LIBS="$LIBS -lglew32"]) if test x$FOUND_GLEW != xyes ; then echo "------------------" echo "opengl extension wrangler not found." echo "please install the glew package which can be found at http://glew.sourceforge.net" echo "------------------" exit -1 fi #--------# # openAL # #--------# AX_CHECK_REQUIRED_HEADER_LIB([AL/al.h], [OpenAL32], [main],,, [http://www.openal.org]) #-----------# # SDL(win) # #-----------# # checking for SDL-headers AC_CHECK_HEADERS([SDL/SDL.h] ,, [AC_MSG_ERROR([cannot find SDL headers]) ]) #checking for libSDL AC_CHECK_LIB([sdlmain], [main], [FOUND_sdlmain=yes; LIBS="$LIBS -lsdlmain"]) if test x$FOUND_sdlmain != xyes ; then echo "------------------" echo "SDL library not found." echo "please install the SDL library, which can be found at http://www.libsdl.org" echo "------------------" exit 1 fi AC_CHECK_LIB([sdl], [main], [FOUND_SDL=yes; LIBS="$LIBS -lsdl"]) if test x$FOUND_SDL != xyes ; then echo "------------------" echo "SDL library not found." echo "please install the SDL library, which can be found at http://www.libsdl.org" echo "------------------" exit -1 fi ;; ######### #-------# # LINUX # #-------# ######### *-*-linux*) echo "Linux detected" Linux="yes" ##CPPFLAGS="-I/usr/include $CPPFLAGS" ##LDFLAGS="-L/usr/lib $LDFLAGS" if test x$SHARED_LIB_PATH != xno; then echo "setting new LDFLAGS with $SHARED_LIB_PATH" LDFLAGS="-Wl,-rpath,$SHARED_LIB_PATH -L$SHARED_LIB_PATH $LDFLAGS" fi #--------# # openGL # #--------# AX_CHECK_REQUIRED_HEADER_LIB([GL/gl.h], [GL], [main],,, [http://www.opengl.org]) AX_CHECK_REQUIRED_HEADER_LIB([GL/glu.h], [GLU], [main],,, [http://www.opengl.org]) AX_CHECK_REQUIRED_HEADER_LIB([GL/glew.h], [GLEW], [main],,, [http://glew.sourceforge.net]) #--------# # openAL # #--------# AX_CHECK_REQUIRED_HEADER_LIB([AL/al.h], [openal], [main],,, [http://www.openal.org]) #-----# # SDL # #-----# # checking for SDL AC_MSG_CHECKING([for SDL-version]) SDL_VERSION=`sdl-config --version` echo $SDL_VERSION CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`" AX_CHECK_REQUIRED_HEADER_LIB([SDL.h SDL/SDL.h], [SDL], [main],,, [http://www.libsdl.org]) ;; ############# #-----------# # MAC -OS X # #-----------# ############# *darwin*) echo "OS X detected" osX="yes" QT_PREFIX="$prefix" CPPFLAGS="-I/$prefix/include $CPPFLAGS -F$prefix/lib -I/opt/local" LDFLAGS="$LDFLAGS -L$prefix/lib -F$prefix/lib -L/opt/local" PCK_CONFIG_PATH='/opt/local' # checking gl header AC_CHECK_HEADERS([OpenGL/gl.h] ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) # checking for GLU-header AC_CHECK_HEADERS([OpenGL/glu.h] ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) AC_CHECK_LIB( OpenGL, main, , ) LIBS="$LIBS -framework OpenGL" # checking for GLEW-headers AC_CHECK_HEADERS([GL/glew.h] ,, [AC_MSG_ERROR([cannot find glew headers]) ]) # checking for GLEW-lib AC_CHECK_LIB([GLEW], [main], [FOUND_GLEW=yes; LIBS="$LIBS -lGLEW"]) if test x$FOUND_GLEW != xyes ; then echo "------------------" echo "glew not found." echo "please install the glew package which can be found at http://glew.sourceforge.net" echo "------------------" exit -1 fi LIBS="$LIBS" AC_CHECK_HEADERS([OpenAL/al.h] ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) HAVE_OPENAL=yes LIBS="$LIBS -framework OpenAL" ## SDL-check SDL_CFLAGS=`sdl-config --cflags` SDL_LIBS=`sdl-config --libs` CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" AC_CHECK_HEADERS([SDL/SDL.h] ,, [AC_MSG_ERROR([cannot find SDL headers]) ]) HAVE_SDL=yes # LIBS="$LIBS -framework SDL" # checking for SDL-headers # AC_CHECK_HEADERS(SDL/SDL.h ,, # [AC_MSG_ERROR([cannot find SDL headers]) ]) ## checking for SDL # SDL_VERSION=1.2.7 # AM_PATH_SDL($SDL_VERSION, # :, # AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) # ) ;; *) ;; esac AC_SUBST(MSBITFIELDS) ################################### ## CHECKING FOR HEADERS AND LIBS ## ################################### #---------# # SDL_ttf # #---------# AX_CHECK_REQUIRED_HEADER_LIB([SDL_ttf.h SDL/SDL_ttf.h], [SDL_ttf], [TTF_OpenFont],,, [http://www.libsdl.org/projects/SDL_ttf]) #-----------# # SDL_Image # #-----------# AX_CHECK_REQUIRED_HEADER_LIB([SDL_image.h SDL/SDL_image.h], [SDL_image], [main],,, [http://www.libsdl.org/projects/SDL_image]) #---------# # SDL_Net # #---------# AX_CHECK_REQUIRED_HEADER_LIB([SDL_net.h SDL/SDL_net.h], [SDL_net], [main],,, [http://www.libsdl.org/projects/SDL_net]) #--------# # FFmpeg # #--------# # checking for FFmpeg-headers AX_CHECK_REQUIRED_HEADER_LIB([avformat.h ffmpeg/avformat.h] ,[avformat], [main], [AX_CHECK_REQUIRED_HEADER_LIB([avcodec.h ffmpeg/avcodec.h], [avcodec], [main],,, [http://ffmpeg.sourceforge.net]) LIBS="${LIBS} -lavformat -lavcodec"], [AX_GET_INSTALL_NECESSARY_LIB([http://svn.orxonox.net/webdev/develop/ext_libs], [ffmpeg.tar.gz], [ffmpeg], [extern_libs/], [include/*.h lib/*.a]) LIBS="-llualib -llua" CPPFLAGS="${CPPFLAGS} -I$(top_build_dir)/extern_libs" ], [http://ffmpeg.sourceforge.net]) AC_CHECK_LIB([avutil], [main], [FOUND_avutil=yes; LIBS="$LIBS -lavutil"]) AC_CHECK_LIB([xvid], [main], [FOUND_xvid=yes; LIBS="$LIBS -lxvid"]) AC_CHECK_LIB([gcj], [main], [FOUND_gcj=yes; LIBS="$LIBS -lgcj"]) AC_CHECK_LIB([theora], [main], [FOUND_theora=yes; LIBS="$LIBS -ltheora"]) AC_CHECK_LIB([dts], [main], [FOUND_dts=yes; LIBS="$LIBS -ldts"]) AC_CHECK_LIB([gsm], [main], [FOUND_gsm=yes; LIBS="$LIBS -lgsm"]) AC_CHECK_LIB([dc1394_control], [main], [FOUND_dc1394_control=yes; LIBS="$LIBS -ldc1394_control"]) AC_CHECK_LIB([vorbisenc], [main], [FOUND_vorbisenc=yes; LIBS="$LIBS -lvorbisenc"]) #--------# # vorbis # #--------# AX_CHECK_REQUIRED_HEADER_LIB([vorbis/vorbisfile.h], [vorbisfile], [main],,, [http://www.xiph.org/ogg/vorbis/index.html]) AX_CHECK_REQUIRED_HEADER_LIB([vorbis/codec.h], [vorbis], [main],,, [http://www.xiph.org/ogg/vorbis/index.html]) #-----# # ogg # #-----# AX_CHECK_REQUIRED_HEADER_LIB([ogg/ogg.h], [ogg], [main],,, [http://www.xiph.org/ogg/vorbis/index.html]) #----# # QT # #----# if test x$osX = xyes ; then # PKG_CONFIG_PATH="$prefix" # PKG_CHECK_MODULES( QT, QtOpenGL >= 4.01 QtCore >= 4.01 QtGui >= 4.0.1 ) # QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtOpenGL QtCore QtGui` #----------# AC_PATH_PROG([QT_MOC], [moc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"]) if test x${QT_MOC} = xno ; then AC_MSG_ERROR([QT MOC not found]) fi AC_SUBST([QT_MOC]) AC_PATH_PROG([QT_UIC], [uic], [no], ["${QT_BIN_DIRECTORY}:${PATH}"]) AC_SUBST([QT_UIC]) AC_PATH_PROG([QT_RCC], [rcc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"]) AC_SUBST([QT_RCC]) AC_SUBST( QT_INCLUDE_DIR ) AC_SUBST( QT_CFLAGS ) AC_SUBST( QT_LDFLAGS ) AC_SUBST( QT_LIBS ) echo "QT_LIBS = $QT_LIBS" echo "QT_CFLAGS = $QT_CFLAGS" echo "QT_INCLUDE_DIR = $QT_INCLUDE_DIR" else AX_CHECK_QT([${QT_PREFIX}], [QtCore QtCore4],, [http://www.trolltech.com]) if test x$have_qt = xno ; then WITH_QT=no fi fi #---------# # libcURL # #---------# AX_CHECK_HEADER_LIB([curl/curl.h], [curl], [main], [ have_curl=yes CURL_LIBS=`curl-config --libs` CURLCFLAGS=`curl-config --cflags` AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL]) ] ,, [http://curl.haxx.se/]) AC_SUBST(CURL_LIBS) AC_SUBST(CURL_CFLAGS) AM_CONDITIONAL(HAVE_CURL, test "x$have_curl" = "xyes") AX_CHECK_REQUIRED_HEADER_LIB([zlib.h], [z], [zlibVersion],,, [http://www.zlib.net]) AX_CHECK_REQUIRED_HEADER_LIB([math.h], [m], [sqrt]) #-----# # LUA # #-----# LUA_DIR="/usr/include/lua" AX_CHECK_LUA([${LUA_DIR}]) #--------# # efence # #--------# if test x$def_efence = xyes ; then AC_CHECK_LIB([efence], [main], [FOUND_efence=yes; LIBS="$LIBS -lefence"]) if test x$FOUND_efence != xyes ; then echo "efence was requested, but is not installed!! going on" fi fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([bzero sqrt]) ###################### ## OUTPUT CONFIGURE ## ###################### AC_CONFIG_FILES([Makefile src/Makefile src/lib/Makefile src/lib/math/Makefile src/lib/util/Makefile src/lib/graphics/Makefile src/lib/graphics/importer/Makefile src/lib/graphics/spatial_separation/Makefile src/lib/sound/Makefile src/lib/event/Makefile src/lib/physics/Makefile src/lib/particles/Makefile src/lib/collision_detection/Makefile src/lib/collision_reaction/Makefile src/lib/network/Makefile src/lib/shell/Makefile src/lib/gui/Makefile src/lib/gui/gtk/Makefile src/lib/gui/gl/Makefile src/lib/gui/qt/Makefile src/lib/script_engine/Makefile src/lib/parser/Makefile src/lib/parser/tinyxml/Makefile src/lib/parser/ini_parser/Makefile src/lib/parser/cmdline_parser/Makefile src/lib/parser/preferences/Makefile src/util/Makefile src/world_entities/Makefile src/subprojects/Makefile src/subprojects/testmain/Makefile src/subprojects/importer/Makefile src/subprojects/particles/Makefile src/subprojects/collision_detection/Makefile src/subprojects/network/Makefile ]) AC_OUTPUT