# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. #AC_PREREQ(2.56) AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@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_HEADER_STDC ### CHECKING FOR SYSTEM ### AC_MSG_CHECKING([for System]) ## checking for openGL-environment and other sys-specific parameters case "$target" in ### WINDOWS ### *-*-mingw32*) echo "mingw-WINDOWS detected" mingw="yes" MSBITFIELDS="-mms-bitfields" MWINDOWS="-mwindows" # checking gl header #done before loop # 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 "$FOUND_opengl32" = "yes" ; 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 "$FOUND_glu32" = "yes" ; 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 # checking for mingw32 AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) if test $FOUND_mingw32 = "yes"; then LIBS="$LIBS -lmingw32" fi # 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 "$FOUND_sdlmain" = "yes" ; 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 "$FOUND_sdl" = "yes" ; 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 ;; ### LINUX ### *-*-linux*) echo "Linux detected" Linux="yes" # checking gl header AC_CHECK_HEADERS(GL/gl.h ,, [AC_MSG_ERROR([cannot find opengl headers]) ]) # checking for Unix GL AC_CHECK_LIB([GL], [main], FOUND_GL=yes) if test "$FOUND_GL" = "yes" ; 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 "$FOUND_GLU" = "yes" ; 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 # checking for SDL-headers AC_CHECK_HEADERS(SDL/SDL.h ,, [AC_MSG_ERROR([cannot find SDL headers]) ]) # checking for SDL-lib AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes) if test "$FOUND_SDL" = "yes" ; 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 # checking for SDL_image-headers AC_CHECK_HEADERS(SDL/SDL_image.h ,, [AC_MSG_ERROR([cannot find SDL_image headers]) ]) # checking for SDL_image-lib AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes) if test "$FOUND_SDL_image" = "yes" ; 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 ## checking for SDL # SDL_VERSION=1.2.7 # AM_PATH_SDL($SDL_VERSION, # :, # AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) # ) # CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" # LIBS="$LIBS $SDL_LIBS" ;; ### OS X ### *darwin*) echo "OS X detected" osX="yes" # 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" # 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!]) # ) SDL_CFLAGS=`sdl-config --cflags` SDL_LIBS=`sdl-config --libs` CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" ;; *) ;; esac AC_SUBST(MSBITFIELDS) ## checking for libjpeg AC_CHECK_HEADERS(jpeglib.h ,, [AC_MSG_ERROR([cannot find jpeg headers]) ]) AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes) if test "$FOUND_jpeg" = "yes" ; then LIBS="$LIBS -ljpeg" else echo "------------------" echo "jpeg library not found." echo "please install the jpeg library from the Independent JPEG Group, which can be found at http://www.ijg.org" echo "------------------" exit -1 fi ## checking for libpng AC_CHECK_HEADERS(png.h ,, [AC_MSG_ERROR([cannot find jpeg headers]) ]) AC_CHECK_LIB([png], [main], FOUND_png=yes) if test "$FOUND_png" = "yes" ; then LIBS="$LIBS -lpng" else echo "------------------" echo "png library not found." echo "please install the png library, which can be found at http://libpng.org/pub/png/libpng.html" echo "------------------" exit -1 fi ## checking for GTK PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) AC_SUBST(GTK2_LIBS) AC_SUBST(GTK2_CFLAGS) AM_CONDITIONAL(HAVE_GTK2, test "x$have_gtk2" = xyes) #checking for pthread libs AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) if test "$FOUND_pthread" = "yes" ; then LIBS="$LIBS -lpthread" 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]) AC_CONFIG_FILES([Makefile console/Makefile gui/Makefile src/Makefile importer/Makefile]) AC_OUTPUT