########################################################################## # 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. # # # # be sure to visit us at http://www.orxonox.net # ########################################################################## ######################### ## AUTOCONF INIT PHASE ## ######################### AC_PREREQ(2.56) AC_INIT(orxonox, 0.3.1_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([.]) 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 echo \$\{prefix\} if test $DATA_DIR = \$\{prefix\}/share ; then echo "not given" DATA_DIR=/usr/share else echo "given: $DATA_DIR" fi AC_DEFINE_UNQUOTED([DATADIR], ["$DATA_DIR"], [Define to the read-only architecture-independent data directory.]) #-----------------# # DEBUG-statement # #-----------------# DEBUG=no AC_MSG_CHECKING([if DEBUG-mode should be enabled]) AC_ARG_ENABLE([debug], AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]), DEBUG=$enableval) if test x$DEBUG = xno; then echo "no" echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed." DEBUG=4 elif test x$DEBUG = xyes; then echo "yes" echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!." DEBUG=4 else echo "yes: setting debuglevel to to $DEBUG" fi AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are]) AC_SUBST(DEBUG) #---------------# # Modular Debug # #---------------# MODULAR_DEBUG=yes AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled]) AC_ARG_ENABLE([modular-debug], AC_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 #--------------# # GTK-disabled # #--------------# AC_MSG_CHECKING([if gtk should be enabled]) AC_ARG_ENABLE([gtk], AC_HELP_STRING( [--disable-gtk], [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes]) if test x$def_gtk = xyes; then echo "yes" fi if test x$def_gtk = xno; then echo "no" fi #------------------# # libCurl-disabled # #------------------# AC_MSG_CHECKING([if libcURL should be enabled]) AC_ARG_ENABLE([curl], AC_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 #-------------------# # SubProject-enable # #-------------------# def_sub_projects=no AC_MSG_CHECKING([if the SubProjects should be built]) AC_ARG_WITH([sub-projects], AC_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], AC_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], AC_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], AC_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) ####################### ## 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 AC_PATH_PROG(PKG_CONFIG, pkg-config) 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" mingw="yes" MSBITFIELDS="-mms-bitfields" MWINDOWS="-mwindows" # checking for mingw32 AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) if test x$FOUND_mingw32 = xyes; then LIBS="$LIBS -lmingw32" fi #-----------# # 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) if test x$FOUND_sdlmain = xyes ; then LIBS="$LIBS -lsdlmain" else 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) if test x$FOUND_sdl = xyes ; then LIBS="$LIBS -lsdl" else 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 #---------------# # 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_opengl32=yes, "gl/gl.h") if test x$FOUND_opengl32 = xyes ; then LIBS="$LIBS -lopengl32" else 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_glu32=yes) if test x$FOUND_glu32 = xyes ; then LIBS="$LIBS -lGLU32" else 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 #--------# # openAL # #--------# # checking for openAL-headers AC_CHECK_HEADERS([AL/al.h] ,, [AC_MSG_ERROR([cannot find openAL header.])]) # checking for openAL-lib AC_CHECK_LIB([OpenAL32], [main], [FOUND_openal=yes]) AC_CHECK_LIB([ALut], [main], [FOUND_ALut=yes]) if test x$FOUND_openal = xyes ; then if test x$FOUND_ALut = xyes ; then LIBS="$LIBS -lALut -lOpenAL32" else echo "------------------" echo "openal library not found." echo "please install the openal library, which can be found at http://www.openal.org" echo "------------------" exit -1 fi fi ;; ######### #-------# # LINUX # #-------# ######### *-*-linux*) echo "Linux detected" Linux="yes" CPPFLAGS="-I/usr/X11R6/include -I/usr/include" LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS" # checking gl header AC_CHECK_HEADERS([GL/gl.h] ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) # checking for Unix GL AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes) if test x$FOUND_GL = xyes ; then LIBS="$LIBS -lGL" else 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]) ]) AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) if test x$FOUND_GLU = xyes ; then LIBS="$LIBS -lGLU" else 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 #--------# # openAL # #--------# # checking for openAL-headers AC_CHECK_HEADERS([AL/al.h] ,, [AC_MSG_ERROR([cannot find openAL header.])]) # checking for openAL-lib AC_CHECK_LIB([openal], [main], [FOUND_openal=yes]) if test x$FOUND_openal = xyes ; then LIBS="$LIBS -lopenal" else echo "------------------" echo "openal library not found." echo "please install the openal library, which can be found at http://www.openal.org" echo "------------------" exit -1 fi # checking for SDL AC_MSG_CHECKING([for SDL-version]) SDL_VERSION=`sdl-config --version` echo $SDL_VERSION CPPFLAGS="`sdl-config --cflags` $CPPFLAGS" AC_CHECK_HEADERS([SDL.h] ,, [AC_CHECK_HEADERS([SDL/SDL.h] ,,AC_MSG_ERROR([cannot find SDL header. please download from libsdl.org])])) LIBS="`sdl-config --libs` $LIBS" ;; ############# #-----------# # MAC -OS X # #-----------# ############# *darwin*) echo "OS X detected" osX="yes" CPPFLAGS="-I/sw/include -I/sw/include $CPPFLAGS" # checking gl header AC_CHECK_HEADERS([OpenGL/gl.h] ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) # cheking for GLU-header AC_CHECK_HEADERS([OpenGL/glu.h] ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) LIBS="$LIBS -framework OpenGL" ## SDL-check SDL_CFLAGS=`sdl-config --cflags` SDL_LIBS=`sdl-config --libs` CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" # 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 # #---------# # checking for SDL_ttf-headers AC_CHECK_HEADERS([SDL_ttf.h] ,, [AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])])) # checking for SDL_ttf-lib AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes]) if test x$FOUND_SDL_ttf = xyes ; then LIBS="$LIBS -lSDL_ttf" else echo "------------------" echo "SDL_ttf library not found." echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/" echo "------------------" exit -1 fi #-----------# # SDL_Image # #-----------# # checking for SDL_image-headers AC_CHECK_HEADERS([SDL_image.h] ,, [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([SDL_image header not found.]))]) # checking for SDL_image-lib AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes]) if test x$FOUND_SDL_image = xyes ; then LIBS="$LIBS -lSDL_image" else echo "------------------" echo "SDL_image library not found." echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/" echo "------------------" exit -1 fi #-----# # ogg # #-----# # checking for ogg-headers AC_CHECK_HEADERS([ogg/ogg.h] ,, [AC_MSG_ERROR([cannot find ogg header.])]) # checking for ogg-lib AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes]) if test x$FOUND_ogg = xyes ; then LIBS="$LIBS -logg" else echo "------------------" echo "ogg library not found." echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" echo "------------------" exit -1 fi #--------# # vorbis # #--------# # checking for vorbis-lib AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes]) if test x$FOUND_vorbis = xyes ; then LIBS="$LIBS -lvorbis" else echo "------------------" echo "vorbis library not found." echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" echo "------------------" exit -1 fi #------------# # vorbisfile # #------------# # checking for vorbis-headers AC_CHECK_HEADERS([vorbis/vorbisfile.h] ,, [AC_MSG_ERROR([cannot find vorbisfile header.])]) # checking for vorbisfile-lib AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes]) if test x$FOUND_vorbisfile = xyes ; then LIBS="$LIBS -lvorbisfile" else echo "------------------" echo "vorbisfile library not found." echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" echo "------------------" exit -1 fi #-----# # GTK # #-----# if test x$def_gtk = xyes; then #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) AC_MSG_CHECKING([for gtk2.0]) if `$PKG_CONFIG --exists gtk+-2.0`; then echo "yes" have_gtk2=yes GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0` GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2]) if test $DEBUG -ge 3; then echo "cflags: $GTK2_CFLAGS" echo "libs: $GTK2_LIBS" fi else echo "no" fi fi AC_SUBST(GTK2_LIBS) AC_SUBST(GTK2_CFLAGS) AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes) #---------# # libcURL # #---------# if test x$def_curl = xyes; then AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"]) AC_CHECK_LIB([curl], [main], [FOUND_curl=yes]) if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then have_curl=yes CURL_LIBS=`curl-config --libs` CURLCFLAGS=`curl-config --cflags` AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL]) else have_curl=no fi fi AC_SUBST(CURL_LIBS) AC_SUBST(CURL_CFLAGS) AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes) #--------# # efence # #--------# if test x$def_efence = xyes ; then AC_CHECK_LIB([efence], [main], [FOUND_efence=yes]) if test x$FOUND_efence = xyes ; then LIBS="$LIBS -lefence" fi fi # FIXME: Replace `main' with a function in `-lm': AC_CHECK_LIB([m], [main]) # 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/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/gui/Makefile src/lib/tinyxml/Makefile src/subprojects/Makefile src/subprojects/testmain/Makefile src/subprojects/importer/Makefile src/subprojects/particles/Makefile src/subprojects/collision_detection/Makefile ]) AC_OUTPUT