Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6271 in orxonox.OLD for trunk


Ignore:
Timestamp:
Dec 23, 2005, 1:54:58 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: MUCH better configure-checks

Location:
trunk
Files:
1 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/config.h.in

    r5822 r6271  
    66/* in which debug mode we are */
    77#undef DEBUG
    8 
    9 /* Define to 1 if you have the <AL/alut.h> header file. */
    10 #undef HAVE_AL_ALUT_H
    118
    129/* Define to 1 if you have the <AL/al.h> header file. */
     
    1815/* if we have CURL */
    1916#undef HAVE_CURL
    20 
    21 /* Define to 1 if you have the <curl/curl.h> header file. */
    22 #undef HAVE_CURL_CURL_H
    2317
    2418/* Define to 1 if you have the <GL/glew.h> header file. */
     
    4741#undef HAVE_MEMORY_H
    4842
    49 /* Define to 1 if you have the <ogg/ogg.h> header file. */
    50 #undef HAVE_OGG_OGG_H
    51 
    5243/* Define to 1 if you have the <OpenAL/al.h> header file. */
    5344#undef HAVE_OPENAL_AL_H
     
    5950#undef HAVE_OPENGL_GL_H
    6051
    61 /* Define to 1 if you have the <SDL.h> header file. */
    62 #undef HAVE_SDL_H
    63 
    64 /* Define to 1 if you have the <SDL_image.h> header file. */
    65 #undef HAVE_SDL_IMAGE_H
    66 
    67 /* Define to 1 if you have the <SDL_net.h> header file. */
    68 #undef HAVE_SDL_NET_H
    69 
    7052/* Define to 1 if you have the <SDL/SDL.h> header file. */
    7153#undef HAVE_SDL_SDL_H
    72 
    73 /* Define to 1 if you have the <SDL/SDL_image.h> header file. */
    74 #undef HAVE_SDL_SDL_IMAGE_H
    75 
    76 /* Define to 1 if you have the <SDL/SDL_net.h> header file. */
    77 #undef HAVE_SDL_SDL_NET_H
    78 
    79 /* Define to 1 if you have the <SDL/SDL_ttf.h> header file. */
    80 #undef HAVE_SDL_SDL_TTF_H
    81 
    82 /* Define to 1 if you have the <SDL_ttf.h> header file. */
    83 #undef HAVE_SDL_TTF_H
    8454
    8555/* Define to 1 if you have the `sqrt' function. */
     
    10979/* Define to 1 if you have the <unistd.h> header file. */
    11080#undef HAVE_UNISTD_H
    111 
    112 /* Define to 1 if you have the <vorbis/vorbisfile.h> header file. */
    113 #undef HAVE_VORBIS_VORBISFILE_H
    11481
    11582/* Define to 1 if the system has the type `_Bool'. */
  • trunk/configure.ac

    r6164 r6271  
    408408#--------#
    409409
    410 
    411 # checking for openAL-headers
    412   AC_CHECK_HEADERS([AL/al.h] ,,
    413       [AC_MSG_ERROR([cannot find openAL header.])])
    414 # checking for openAL-lib
    415   AC_CHECK_LIB([openal], [main], [FOUND_OPENAL=yes; LIBS="$LIBS -lopenal"])
    416      if test x$FOUND_OPENAL != xyes ; then
    417         echo "------------------"
    418         echo "openal library not found."
    419         echo "please install the openal library, which can be found at http://www.openal.org"
    420         echo "------------------"
    421         exit -1
    422      fi
    423 # checking for alut
    424   AC_CHECK_HEADERS([AL/alut.h] ,,
    425       [AC_MSG_ERROR([cannot find openAL Utility Toolkit (alut) header.])])
    426   AC_CHECK_LIB([alut], [main], [FOUND_ALUT=yes; LIBS="-lalut $LIBS"])
     410AX_CHECK_REQUIRED_HEADER_LIB([AL/al.h], [openal], [main],,, [http://www.openal.org])
     411AX_CHECK_HEADER_LIB([AL/alut.h], [alut], [main],,, [http://www.openal.org])
    427412
    428413#-----#
     
    433418  SDL_VERSION=`sdl-config --version`
    434419  echo $SDL_VERSION
    435 
    436420   CPPFLAGS="$CPPFLAGS `sdl-config --cflags`"
    437    AC_CHECK_HEADERS([SDL.h] ,,
    438       [AC_CHECK_HEADERS([SDL/SDL.h] ,,AC_MSG_ERROR([cannot find SDL header. please download from libsdl.org])]))
    439    LIBS="`sdl-config --libs` $LIBS"
    440    AC_CHECK_LIB([SDL], [main], [FOUND_SDL=yes])
    441     if test x$FOUND_SDL != xyes ; then
    442         echo "------------------"
    443         echo "SDL library not found."
    444         echo "please install the SDL library, which can be found at http://www.libsdl.org"
    445         echo "------------------"
    446         exit -1
    447      fi
     421
     422  AX_CHECK_REQUIRED_HEADER_LIB([SDL.h SDL/SDL.h], [SDL], [main],,, [http://www.libsdl.org])
    448423
    449424    ;;
     
    529504# SDL_ttf #
    530505#---------#
    531 # checking for SDL_ttf-headers
    532   AC_CHECK_HEADERS([SDL_ttf.h] ,,
    533       [AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])]))
    534 # checking for SDL_ttf-lib
    535   AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes; LIBS="$LIBS -lSDL_ttf"])
    536      if test x$FOUND_SDL_ttf != xyes ; then
    537         echo "------------------"
    538         echo "SDL_ttf library not found."
    539         echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
    540         echo "------------------"
    541         exit -1
    542      fi
    543 
     506AX_CHECK_REQUIRED_HEADER_LIB([SDL_ttf.h SDL/SDL_ttf.h], [SDL_ttf], [TTF_OpenFont],,, [http://www.libsdl.org/projects/SDL_ttf])
    544507#-----------#
    545508# SDL_Image #
    546509#-----------#
    547 # checking for SDL_image-headers
    548 AC_CHECK_HEADERS([SDL_image.h] ,,
    549     [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([SDL_image header not found.]))])
    550 # checking for SDL_image-lib
    551 AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes; LIBS="$LIBS -lSDL_image"])
    552    if test x$FOUND_SDL_image != xyes ; then
    553       echo "------------------"
    554       echo "SDL_image library not found."
    555       echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
    556       echo "------------------"
    557       exit -1
    558    fi
    559 
     510AX_CHECK_REQUIRED_HEADER_LIB([SDL_image.h SDL/SDL_image.h], [SDL_image], [main],,, [http://www.libsdl.org/projects/SDL_image])
    560511#---------#
    561512# SDL_Net #
    562513#---------#
    563 # checking for SDL_net-headers
    564 AC_CHECK_HEADERS([SDL_net.h] ,,
    565     [AC_CHECK_HEADERS([SDL/SDL_net.h],, AC_MSG_ERROR([SDL_net header not found.]))])
    566 # checking for SDL_net-lib
    567 AC_CHECK_LIB([SDL_net], [main], [FOUND_SDL_net=yes; LIBS="$LIBS -lSDL_net"])
    568    if test x$FOUND_SDL_net != xyes ; then
    569       echo "------------------"
    570       echo "SDL_net library not found."
    571       echo "please install the SDL_net library, which can be found at http://www.libsdl.org/projects/SDL_net/"
    572       echo "------------------"
    573       exit -1
    574    fi
    575 
     514AX_CHECK_REQUIRED_HEADER_LIB([SDL_net.h SDL/SDL_net.h], [SDL_net], [main],,, [http://www.libsdl.org/projects/SDL_net])
    576515
    577516#-----#
    578517# ogg #
    579518#-----#
    580 # checking for ogg-headers
    581   AC_CHECK_HEADERS([ogg/ogg.h] ,,
    582       [AC_MSG_ERROR([cannot find ogg header.])])
    583 # checking for ogg-lib
    584   AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes; LIBS="$LIBS -logg"])
    585      if test x$FOUND_ogg != xyes ; then
    586         echo "------------------"
    587         echo "ogg library not found."
    588         echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
    589         echo "------------------"
    590         exit -1
    591      fi
    592 
     519AX_CHECK_REQUIRED_HEADER_LIB([ogg/ogg.h], [ogg], [main],,, [http://www.xiph.org/ogg/vorbis/index.html])
    593520#--------#
    594521# vorbis #
    595522#--------#
    596 # checking for vorbis-lib
    597   AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes; LIBS="$LIBS -lvorbis"])
    598      if test x$FOUND_vorbis != xyes ; then
    599         echo "------------------"
    600         echo "vorbis library not found."
    601         echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
    602         echo "------------------"
    603         exit -1
    604      fi
    605 
    606 #------------#
    607 # vorbisfile #
    608 #------------#
    609 # checking for vorbis-headers
    610   AC_CHECK_HEADERS([vorbis/vorbisfile.h] ,,
    611       [AC_MSG_ERROR([cannot find vorbisfile header.])])
    612 # checking for vorbisfile-lib
    613   AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes; LIBS="$LIBS -lvorbisfile"])
    614      if test x$FOUND_vorbisfile != xyes ; then
    615         echo "------------------"
    616         echo "vorbisfile library not found."
    617         echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
    618         echo "------------------"
    619         exit -1
    620      fi
    621 
     523AX_CHECK_REQUIRED_HEADER_LIB([vorbis/codec.h], [vorbis], [main],,, [http://www.xiph.org/ogg/vorbis/index.html])
     524AX_CHECK_REQUIRED_HEADER_LIB([vorbis/vorbisfile.h], [vorbisfile], [main],,, [http://www.xiph.org/ogg/vorbis/index.html])
    622525
    623526#---------#
    624527# libcURL #
    625528#---------#
    626 if test x$def_curl = xyes; then
    627  AC_CHECK_HEADERS([curl/curl.h], [curlHeader=yes], [curlHeader=no])
    628  AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
    629  if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
    630   have_curl=yes
     529AX_CHECK_HEADER_LIB([curl/curl.h], [curl], [main], [
     530 have_curl=yes
    631531  CURL_LIBS=`curl-config --libs`
    632532  CURLCFLAGS=`curl-config --cflags`
    633   AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
    634  else
    635   have_curl=no
    636  fi
    637 
    638 fi
     533  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL]) ]
     534  ,, [http://curl.haxx.se/])
     535
    639536AC_SUBST(CURL_LIBS)
    640537AC_SUBST(CURL_CFLAGS)
    641 AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
     538AM_CONDITIONAL(HAVE_CURL, test "x$have_curl" = "xyes")
    642539
    643540#--------#
  • trunk/m4/ax_check_header_lib.m4

    r6270 r6271  
    1 dnl AX_CHECK_REQUIRED_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
    2 AC_DEFUN([AX_CHECK_REQUIRED_HEADER_LIB], [
    3     _header_check=""
    4     _lib_check=""
    5 
    6     AC_CHECK_HEADER([$1], [_header_check="yes"], [_header_check="no"])
    7     AC_CHECK_LIB([$2], [$3], [_lib_check="yes"], [_lib_check="no"])
    8     if [test x$_header_check = "xyes" && test "x$_lib_check" = "xyes"] ; then
    9          LIBS="$LIBS -l$2"
    10          $4
    11     else
    12          echo "------------------"
    13          echo "LIBRARY $2 not found."
    14          echo "please install the $2-LIBRARY-package which can be found at $6"
    15          echo "------------------"
    16          $5
    17          exit -1
    18     fi
    19 ])
    20 
    211
    222dnl AX_CHECK_HEADER_LIB([HEADER-NAME], [LIBRARY-NAME], [FUNCTION-IN-LIB], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [LIB-WEB-PAGE])
     
    277    AC_CHECK_HEADER([$1], [_header_check="yes"], [_header_check="no"])
    288    AC_CHECK_LIB([$2], [$3], [_lib_check="yes"], [_lib_check="no"])
    29     if [test x$_header_check = "xyes" && test "x$_lib_check" = "xyes"] ; then
     9    if [test "x$_header_check" = "xyes" && test "x$_lib_check" = "xyes"] ; then
    3010         LIBS="$LIBS -l$2"
    3111         $4
    3212    else
     13         echo "no Support for $2"
    3314         $5
    3415    fi
Note: See TracChangeset for help on using the changeset viewer.