X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=configure.in;h=da528a3e08f87cfba8f7b846c8303e6c42e27e91;hb=26cdcb3064c2da842e06f4e7f4fa38656611dae3;hp=0be9d99ca409b522a24555b427be529dbb52639b;hpb=80add1e6e9403e373f35dab1c62b3cd47d9f0c1d;p=flightgear.git diff --git a/configure.in b/configure.in index 0be9d99ca..da528a3e0 100644 --- a/configure.in +++ b/configure.in @@ -2,30 +2,87 @@ dnl Process this file with autoconf to produce a configure script. dnl dnl The basis for this file was generated by autoscan(1) [pere 1998-03-19] dnl -AC_INIT(Simulator/Aircraft/aircraft.c) + +AC_INIT(Simulator/Aircraft/aircraft.cxx) dnl Initialize the automake stuff -AM_INIT_AUTOMAKE(FlightGear, 0.50) +AM_INIT_AUTOMAKE(FlightGear, 0.6.0) -dnl Checks for programs. +dnl configure other independant packages included with flight gear for +dnl convenience +AC_CONFIG_SUBDIRS( Lib/plib ) +dnl Checks for programs. AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_CXX +AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S + dnl Initialize libtool -AM_PROG_LIBTOOL +dnl AM_PROG_LIBTOOL dnl Initialize maintainer mode -AM_MAINTAINER_MODE +dnl AM_MAINTAINER_MODE dnl This is needed for AC_TRY_COMPILE later -AC_ISC_POSIX +dnl AC_ISC_POSIX -dnl Check to see if this `configure' is being run in the `Cygwin32' environment +dnl Check to see if this `configure' is being run in the `Cygwin32' environmentplib-1.0_fgfs_a.tar.gz dnl AM_CYGWIN32 +dnl Specify if we want logging (testing build) or not (release build) +# set logging default value +# with_logging=yes +AC_ARG_WITH(logging, [ --with-logging Include logging output (default)]) +if test "x$with_logging" = "xno" ; then + AC_DEFINE(FG_NDEBUG) +fi + + +dnl specify if we are building with "checker" +AC_ARG_WITH(efence, [ --with-efence Specify if we are building with "electric-fence"]) + +if test "x$with_efence" = "xyes" ; then + echo "Building with efence" + LIBS= "$LIBS -lefence" +fi + +dnl specify the compiled flight model +AC_ARG_WITH(flight-model, [ --with-flight-model=xxx Specify the flight model (navion, cherokee)]) + +if test "x$with_flight_model" = "xcherokee" ; then + echo "Building with cherokee flight model" +else + echo "Building with navion flight model" +fi +AM_CONDITIONAL(ENABLE_CHEROKEE, test "x$with_flight_model" = "xcherokee") + +dnl Let the Win32 user specify if they want to build with the SGI +dnl opengl.dll as opposed to the more standard openg32.dll +AC_ARG_WITH(sgi-opengl, [ --with-sgi-opengl Build against SGI's opengl.dll glu.dll and glut.dll]) + +dnl Check for "plib" without which we cannot go on +AC_CHECK_HEADER(plib/pu.h) +if test "x$ac_cv_header_plib_pu_h" != "xyes"; then + echo + echo "You *must* have the plib library installed on your system to build" + echo "the FGFS simulator!" + echo + echo "You can get the original library from:" + echo + echo " http://www.woodsoup.org/projs/plib" + echo + echo "However, I recommend you grab a copy with a couple modifications I" + echo "have made which should eliminate a few plib-1.0 build problems:" + echo + echo " ftp://ftp.flightgear.org/pub/fgfs/Source/plib-1.0_fgfs_a.tar.gz" + echo + echo "configure aborted." + exit +fi + dnl Check for MS Windows environment AC_CHECK_HEADER(windows.h) @@ -44,16 +101,29 @@ AC_EXT_TIMEZONE AM_CONDITIONAL(HAVE_TIMEZONE, test "$have_timezone" = yes ) dnl Check for Linux style audio support -AM_CONDITIONAL(HAVE_AUDIO_SUPPORT, \ +AM_CONDITIONAL(ENABLE_AUDIO_SUPPORT, \ test -r /usr/include/soundcard.h \ -o -r /usr/include/linux/soundcard.h \ -o -r /usr/include/machine/soundcard.h \ + -o -r /usr/include/audio.h \ -o "x$ac_cv_header_windows_h" = "xyes" ) -AM_CONDITIONAL(HAVE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes") +AM_CONDITIONAL(ENABLE_IRIX_AUDIO, test -r /usr/include/audio.h) + +AM_CONDITIONAL(ENABLE_WIN32_AUDIO, test "x$ac_cv_header_windows_h" = "xyes") + +dnl Check for (currently Linux only style) joystick support +AM_CONDITIONAL(ENABLE_LINUX_JOYSTICK, test -r /usr/include/linux/joystick.h ) + +dnl Enable serial support on Unix type systems +AM_CONDITIONAL(ENABLE_UNIX_SERIAL, true) dnl extra library and include directories -EXTRA_DIRS="/usr/local /usr/X11R6 /opt/X11R6" +EXTRA_DIRS="/usr/local /usr/X11R6" + +if test -d /opt/X11R6 ; then + EXTRA_DIRS="$EXTRA_DIRS /opt/X11R6" +fi if test "x$ac_cv_header_windows_h" = "xyes" ; then EXTRA_DIRS="${EXTRA_DIRS} `pwd`/Win32" @@ -67,7 +137,12 @@ AC_PATH_XTRA dnl Checks for libraries. +null_LIBS="$LIBS" + AC_CHECK_LIB(m, cos) + +base_LIBS="$LIBS" + AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(X11, XCreateWindow) AC_CHECK_LIB(Xext, XShmCreateImage) @@ -77,69 +152,167 @@ AC_CHECK_LIB(SM, SmcOpenConnection) AC_CHECK_LIB(Xt, XtMalloc) AC_CHECK_LIB(Xmu, XmuLookupStandardColormap) -# dnl Solaris OpenGL pain -# AC_CHECK_LIB(eprintf, __eprintf) +dnl check for OpenGL related libraries + +if test "x$ac_cv_header_windows_h" != "xyes" ; then + dnl Reasonable stuff non-windoze variants ... :-) -AC_CHECK_LIB(GLcore, glNewList) -if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then - dnl if no GLcore, check for GL - AC_CHECK_LIB(GL, glNewList) - if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then - dnl if no GL, check for MesaGL - AC_CHECK_LIB(MesaGL, glNewList) + AC_CHECK_LIB(GLcore, glNewList) + if test "x$ac_cv_lib_GLcore_glNewList" = "xno" ; then + dnl if no GLcore, check for GL + AC_CHECK_LIB(GL, glNewList) + if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then + dnl if no GL, check for MesaGL + AC_CHECK_LIB(MesaGL, glNewList) + fi + else + dnl if GLcore found, then also check for GL + AC_CHECK_LIB(GL, glXCreateContext) fi -else - dnl if GLcore found, then also check for GL - AC_CHECK_LIB(GL, glXCreateContext) -fi -AC_CHECK_LIB(GLU, gluLookAt) -if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then - dnl if no GLU, check for MesaGLU - AC_CHECK_LIB(MesaGLU, gluLookAt) -fi + dnl if using mesa, check for xmesa.h + if test "x$ac_cv_lib_MesaGL_glNewList" = "xyes" ; then + AC_CHECK_HEADER(GL/xmesa.h) + AM_CONDITIONAL(ENABLE_XMESA_FX, \ + test "x$ac_cv_header_GL_xmesa_h" = "xyes") + else + dnl force a failed check + AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes") + fi + + AC_CHECK_LIB(GLU, gluLookAt) + if test "x$ac_cv_lib_GLU_gluLookAt" = "xno" ; then + dnl if no GLU, check for MesaGLU + AC_CHECK_LIB(MesaGLU, gluLookAt) + fi + + dnl check for glut + AC_CHECK_LIB(glut, glutGetModifiers) + + dnl test for glutGameModeString, but avoid adding glut a second time into + dnl the list of libraries + save_LIBS="$LIBS" + AC_CHECK_LIB(glut, glutGameModeString) + LIBS="$save_LIBS" +else + dnl Win32 is a little wierd because it has to try to handle the various + dnl winbloze-isms. We'll just do this manually for now. -AC_CHECK_LIB(glut, glutGetModifiers) - -dnl Win32 is a little wierd because it has to try to handle the various -dnl winbloze-isms. We'll just do this manually for now. -if test "x$ac_cv_header_windows_h" = "xyes" ; then echo Win32 specific hacks... AC_DEFINE(WIN32) - dnl Note, the double square brackets are required becuase single brackets - dnl seem to get stripped out - if [[ -f `pwd`/Win32/glut.dll ]]; then - echo " found glut.dll, adding -lglut" - LIBS="$LIBS -lglut" + dnl force a failed check since we will be building under windoze + AM_CONDITIONAL(ENABLE_XMESA_FX, test "no" = "yes") + + if test "x$with_sgi_opengl" = "xyes" ; then + echo "Building with glut.dll, glu.dll, and opengl.dll" + WIN32_GLUT=glut + WIN32_GLU=glu + WIN32_OPENGL=opengl + else + echo "Building with glut32.dll, glu32.dll, and opengl32.dll" + WIN32_GLUT=glut32 + WIN32_GLU=glu32 + WIN32_OPENGL=opengl32 + fi + + if test -f `pwd`/Win32/${WIN32_GLUT}.dll; then + echo " found ${WIN32_GLUT}.dll, adding -l${WIN32_GLUT}" + LIBS="$LIBS -l${WIN32_GLUT}" else - echo " Cannot find glut.dll" - exit 1 + echo " Cannot find ${WIN32_GLUT}.dll" + exit 1 fi - if [[ -f `pwd`/Win32/glu.dll ]]; then - echo " found glu.dll" + + if test -f `pwd`/Win32/${WIN32_GLU}.dll; then + echo " found ${WIN32_GLU}.dll" else - echo " Can't find glu.dll, assuming it's someplace" + echo " Can't find ${WIN32_GLU}.dll, assuming it's someplace" fi - echo " adding -lglu" - LIBS="$LIBS -lglu" - if [[ -f `pwd`/Win32/opengl.dll ]]; then - echo " found opengl.dll" + echo " adding -l${WIN32_GLU}" + LIBS="$LIBS -l${WIN32_GLU}" + + if test -f `pwd`/Win32/${WIN32_OPENGL}.dll; then + echo " found ${WIN32_OPENGL}.dll" else - echo " Can't find opengl.dll, assuming it's somplace" + echo " Can't find ${WIN32_OPENGL}.dll, assuming it's somplace" fi - echo " adding -lopengl" - LIBS="$LIBS -lopengl" + echo " adding -l${WIN32_OPENGL}" + LIBS="$LIBS -l${WIN32_OPENGL}" + echo " adding -luser32 -lgdi32" LIBS="$LIBS -luser32 -lgdi32" ac_cv_lib_glut_glutGetModifiers="yes" + ac_cv_lib_glut_glutGameModeString="yes" +fi + +if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then + echo + echo "Unable to find the necessary OpenGL or GLUT libraries." + echo "See config.log for automated test details and results ..." + exit 1 +fi + +if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then + echo + echo "Your version of glut doesn't support game mode." + echo "You need to fetch and install the latest version of glut from:" + echo + echo " http://reality.sgi.com/opengl/glut3/glut3.html" + exit 1 +fi + +opengl_LIBS="$LIBS" +LIBS="$base_LIBS" + +AC_SUBST(base_LIBS) +AC_SUBST(opengl_LIBS) + +AM_CONDITIONAL(HAVE_XWINDOWS, test "x$ac_cv_lib_X11_XCreateWindow" = "xyes" ) + +dnl Check if Generic Polygon Clipping library is installed +dnl (from http://www.cs.man.ac.uk/aig/staff/alan/software/) +AC_CHECK_HEADERS( gpc.h ) +if test "x$ac_cv_header_gpc_h" != "xyes"; then + echo + echo "You need to have the GPC library installed on your system to build" + echo "some of the scenery generation tools, otherwise you won't be able." + echo "to create scenery." + echo + echo "Please see README.gpc for more details." + echo + echo "(pausing 2 seconds)" + sleep 2 + echo +fi + +dnl Check if Geographic Foundation Classes library is installed +dnl (from http://www.geog.psu.edu/~qian/gfc/index.html) +AC_CHECK_HEADERS( gfc/gdbf.h ) +if test "x$ac_cv_header_gfc_gdbf_h" != "xyes"; then + echo + echo "You need to have the GFC library installed on your system to build" + echo "some of the scenery generation tools, otherwise, they may fail." + echo + echo "You can get the original library from:" + echo + echo " http://www.geog.psu.edu/~qian/gfc/index.html" + echo + echo "However, I recommend you grab a copy with a couple modifications I" + echo "have made which should eliminate several gfc build problems:" + echo + echo " ftp://ftp.flightgear.org/pub/fgfs/Source/gfc-0.8.8.1a.tar.gz" + echo + echo "(pausing 5 seconds)" + sleep 5 + echo fi dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS( \ - fcntl.h getopt.h malloc.h stdlib.h sys/time.h sys/timeb.h \ - unistd.h windows.h winbase.h values.h ) + fcntl.h getopt.h malloc.h memory.h stdlib.h sys/stat.h sys/time.h \ + sys/timeb.h unistd.h windows.h winbase.h values.h ) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -150,60 +323,69 @@ AC_STRUCT_TM dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_VPRINTF -AC_CHECK_FUNCS( ftime gettimeofday mktime strstr rand random \ - setitimer getitimer signal GetLocalTime rint ) - -if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno"; then - echo - echo "Unable to find the necessary GL libraries." - exit 1 -fi +AC_CHECK_FUNCS( ftime gettimeofday memcpy bcopy mktime strstr rand random \ + setitimer getitimer signal GetLocalTime rint getrusage ) AM_CONFIG_HEADER(Include/config.h) AC_OUTPUT( \ + VERSION \ Makefile \ Include/Makefile \ Lib/Makefile \ - Lib/Audio/Makefile \ - Lib/Audio/src/Makefile \ - Lib/Audio/example/Makefile \ Lib/Bucket/Makefile \ Lib/Debug/Makefile \ - Lib/DEM/Makefile \ Lib/Math/Makefile \ - Lib/PUI/Makefile \ + Lib/Misc/Makefile \ + Lib/Serial/Makefile \ Lib/XGL/Makefile \ Lib/zlib/Makefile \ Simulator/Makefile \ Simulator/Aircraft/Makefile \ + Simulator/Airports/Makefile \ Simulator/Astro/Makefile \ Simulator/Autopilot/Makefile \ Simulator/Cockpit/Makefile \ Simulator/Controls/Makefile \ - Simulator/Flight/LaRCsim/Makefile \ - Simulator/Flight/Slew/Makefile \ - Simulator/Flight/Makefile \ + Simulator/FDM/External/Makefile \ + Simulator/FDM/JSBsim/Makefile \ + Simulator/FDM/LaRCsim/Makefile \ + Simulator/FDM/Slew/Makefile \ + Simulator/FDM/Makefile \ Simulator/GUI/Makefile \ Simulator/Joystick/Makefile \ Simulator/Main/Makefile \ - Simulator/Main/runfg \ - Simulator/Main/runfg.bat \ + Simulator/Main/runfgfs \ + Simulator/Main/runfgfs.bat \ Simulator/Makefile \ + Simulator/Objects/Makefile \ Simulator/Scenery/Makefile \ Simulator/Time/Makefile \ Simulator/Weather/Makefile \ Tools/Makefile \ + Tools/Construct/Makefile \ + Tools/Construct/Array/Makefile \ + Tools/Construct/Clipper/Makefile \ + Tools/Construct/Combine/Makefile \ + Tools/Construct/GenOutput/Makefile \ + Tools/Construct/Match/Makefile \ + Tools/Construct/Triangulate/Makefile \ + Tools/Construct/Main/Makefile \ + Tools/Lib/Makefile \ + Tools/Lib/DEM/Makefile \ + Tools/Lib/Polygon/Makefile \ + Tools/Lib/Triangle/Makefile \ + Tools/Prep/Makefile \ + Tools/Prep/DemChop/Makefile \ + Tools/Prep/DemInfo/Makefile \ + Tools/Prep/DemRaw2ascii/Makefile \ + Tools/Prep/GenAirports/Makefile \ + Tools/Prep/ShapeFile/Makefile \ + Tools/Utils/Makefile \ + Tools/Utils/Makedir/Makefile \ Tools/Areas/Makefile \ - Tools/AssemTris/Makefile \ - Tools/Dem2node/Makefile \ - Tools/DemInfo/Makefile \ - Tools/DemRaw2ascii/Makefile \ - Tools/FixNode/Makefile \ - Tools/FixObj/Makefile \ - Tools/SplitTris/Makefile \ - Tools/Stripe_w/Makefile \ - Tools/Tri2obj/Makefile \ - Tools/Triangle/Makefile \ Tests/Makefile \ ) + +AC_OUTPUT_COMMANDS([chmod 755 Simulator/Main/runfgfs]) +