X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=configure.ac;h=1046369af69c7a6a0fb7432b1f7d5ff6efdf6a98;hb=4b6242610975228a8471c5221d7cffe0069b5eea;hp=58a41557d98f19ce0617f80842bcc2f29e44d5b9;hpb=f29b5d98a16a546088cc69402db638cff5fb8219;p=flightgear.git diff --git a/configure.ac b/configure.ac index 58a41557d..1046369af 100644 --- a/configure.ac +++ b/configure.ac @@ -21,19 +21,32 @@ AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S +# specify the simgear location +AC_ARG_WITH(simgear, [ --with-simgear=PREFIX Specify the prefix path to simgear]) + +if test "x$with_simgear" != "x" ; then + echo "SimGear prefix path is $with_simgear" + EXTRA_DIRS="${EXTRA_DIRS} $with_simgear" +fi + dnl set the $host variable based on local machine/os AC_CANONICAL_HOST -dnl Used on the Irix platform -AR="ar" -ARFLAGS="cru" case "${host}" in *-*-irix*) if test "$CXX" = "CC"; then AR="CC -ar" ARFLAGS="-o" + CXXFLAGS="$CXXFLAGS -I$with_simgear/include/simgear/compatibility" + else + AR="ar" + ARFLAGS="cru" fi ;; +*) + AR="ar" + ARFLAGS="cru" + ;; esac AC_SUBST(AR) AC_SUBST(ARFLAGS) @@ -44,21 +57,32 @@ if test "x$with_logging" = "xno" ; then AC_DEFINE([FG_NDEBUG], 1, [Define for no logging output]) fi -# Specify if we want to build with Oliver's networking support +# Specify if we want to build with Multiplayer support # default to with_network=yes -AC_ARG_WITH(network_olk, [ --with-network-olk Include Oliver's multi-pilot networking support]) -if test "x$with_network_olk" = "xno" ; then - echo "Building without Oliver's multi-pilot network support" +AC_ARG_WITH(multiplayer, [ --with-multiplayer Include default multiplayer support]) +AC_ARG_WITH(network_olk, [ --with-network-olk Include Oliver's multi-pilot networking support [default=no]]) + +if test "x$with_multiplayer" = "xno" -a "x$with_network_olk" = "xno"; then + echo "Building without any kind of multiplayer support" + +elif test "x$with_multiplayer" = "xno"; then +# echo "Building without default multiplayer support" + echo "Building with Oliver's multi-pilot network support" + AC_DEFINE([FG_NETWORK_OLK], 1, [Define to build with Oliver's networking]) + else - echo "Building with Oliver's multi-pilot network support" - AC_DEFINE([FG_NETWORK_OLK], 1, [Define to build with Oliver's networking]) + echo "Building with default multiplayer support" +# echo "Building without Oliver's multi-pilot network support" + AC_DEFINE([FG_MPLAYER_AS], 1, [Define to build with default multiplayer support]) fi -AM_CONDITIONAL(ENABLE_NETWORK_OLK, test "x$with_network_olk" != "xno") + +AM_CONDITIONAL(ENABLE_NETWORK_OLK, test "x$with_network_olk" != "xno" -a "x$with_multiplayer" = "xno") +AM_CONDITIONAL(ENABLE_MPLAYER_AS, test "x$with_multiplayer" != "xno") # Specify if we want to use WeatherCM instead of FGEnvironment. # default to with_weathercm=no -AC_ARG_WITH(new-environment, [ --with-weathercm Use WeatherCM instead of FGEnvironment]) +AC_ARG_WITH(weathercm, [ --with-weathercm Use WeatherCM instead of FGEnvironment]) if test "x$with_weathercm" = "xyes" ; then echo "Building with WeatherCM" AC_DEFINE([FG_WEATHERCM], 1, @@ -68,14 +92,24 @@ else fi AM_CONDITIONAL(ENABLE_WEATHERCM, test "x$with_weathercm" = "xyes") +dnl Specify if we want the old menubar; default to the new one +AC_ARG_WITH(old-menubar, [ --with-old-menubar Use the old menu bar]) +if test "x$with_old_menubar" = "xyes" ; then + echo "Building with old menubar" + AC_DEFINE([FG_OLD_MENUBAR], 1, + [Define to build with old menubar]) +else + echo "Building with new menubar" +fi + dnl Thread related checks AC_ARG_WITH(threads, [ --with-threads Include tile loading threads [default=no]]) if test "x$with_threads" = "xyes"; then AC_DEFINE([ENABLE_THREADS], 1, [Define to enable threaded tile paging]) CXXFLAGS="$CXXFLAGS -D_REENTRANT" CFLAGS="$CFLAGS -D_REENTRANT" - AC_CHECK_HEADER(pthread.h) fi +AC_CHECK_HEADER(pthread.h) AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes") # specify the plib location @@ -94,14 +128,6 @@ if test "x$with_metakit" != "x" ; then EXTRA_DIRS="${EXTRA_DIRS} $with_metakit" fi -# specify the simgear location -AC_ARG_WITH(simgear, [ --with-simgear=PREFIX Specify the prefix path to simgear]) - -if test "x$with_simgear" != "x" ; then - echo "SimGear prefix path is $with_simgear" - EXTRA_DIRS="${EXTRA_DIRS} $with_simgear" -fi - dnl Used by JSBSim to conditionally compile in fgfs interface code AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode]) @@ -121,7 +147,7 @@ case "${host}" in if test -d /opt/X11R6 ; then EXTRA_DIR2="/opt/X11R6" fi - EXTRA_DIRS="$EXTRA_DIR1 $EXTRA_DIR2" + EXTRA_DIRS="${EXTRA_DIRS} $EXTRA_DIR1 $EXTRA_DIR2" ;; esac @@ -152,13 +178,19 @@ case "${host}" in *-*-cygwin* | *-*-mingw32*) audio_LIBS="$audio_LIBS -lwinmm" ;; - +*-apple-darwin*) + audio_LIBS="$audio_LIBS -framework IOKit -framework CoreFoundation" + ;; *-*-irix* ) audio_LIBS="$audio_LIBS -laudio" ;; esac AC_SUBST(audio_LIBS) + +dnl ENABLE_AUDIO_SUPPORT could be depricated at any time in favor of +dnl just assuming we have audio support on all platform. We can +dnl depend on plib to hide the details. AC_DEFINE([ENABLE_AUDIO_SUPPORT], 1, [Define for audio support]) dnl X11 might be installed on Mac OS X or cygwin/mingwin, we don't want @@ -180,15 +212,27 @@ null_LIBS="$LIBS" AC_CHECK_LIB(m, cos) -dnl MINGW requires libwsock32 -if test "x$is_mingw" = "xyes" ; then - LIBS="$LIBS -lws2_32" -fi - base_LIBS="$LIBS" dnl Thread related checks AC_CHECK_LIB(pthread, pthread_exit) +if test "x$ac_cv_lib_pthread_pthread_exit" != "xyes" \ + -a "x$ac_cv_header_pthread_h" = "xyes"; then + dnl FreeBSD: System has pthread.h, but -lpthread library check + dnl fails. See if we need -pthread instead of -lpthread and look + dnl for the functions in libc_r. + save_CXXFLAGS="$CXXFLAGS" + save_CFLAGS="$CFLAGS" + CXXFLAGS="-pthread $CXXFLAGS" + CFLAGS="-pthread $FLAGS" + save_LIBS=$LIBS + AC_CHECK_LIB(c_r, pthread_exit) + if test "x$ac_cv_lib_c_r_pthread_exit" != "xyes"; then + CXXFLAGS=$save_CXXFLAGS + CFLAGS=$save_CFLAGS + fi + LIBS=$save_LIBS +fi AC_CHECK_LIB(socket, socket) dnl check for glut location @@ -198,7 +242,7 @@ if test "x$ac_cv_header_GL_glut_h" = "xyes"; then else AC_CHECK_HEADER(GLUT/glut.h) if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then - AC_DEFINE([GLUT_H], "GLUT/glut.h", [Define as glut.h include location]) + AC_DEFINE([GLUT_H], , [Define as glut.h include location]) else echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue" exit @@ -220,7 +264,8 @@ case "${host}" in dnl add -lwsock32 for mingwin case "${host}" in *-*-mingw32*) - LIBS="$LIBS -lws2_32" + echo "********** BUILDING FOR MINGW32 *************" + base_LIBS="$base_LIBS -lws2_32" ;; esac @@ -276,7 +321,11 @@ case "${host}" in AC_CHECK_LIB(MesaGLU, gluLookAt) fi - LIBS="$LIBS -lglut" + AC_CHECK_LIB(glut, glutGetModifiers) + if test "x$ac_cv_lib_glut_glutGetModifiers" = "xno" ; then + dnl if no "real" glut, check for freeglut + AC_CHECK_LIB(freeglut, glutGetModifiers) + fi ;; esac @@ -331,8 +380,26 @@ int main() { dnl If we get here then plib is available, so force use of plib dnl joystick lib AC_DEFINE([ENABLE_PLIB_JOYSTICK], 1, [Define to enable plib joystick support]) -AC_DEFINE([FG_PLIB_JOYSTICK_GETNAME], 1, - [Define to enable plib joystick name support]) + + +dnl Checking for PSL in plib +dnl version of plib, so check for it. +AC_MSG_CHECKING([for plib PSL scripting support]) +AC_COMPILE_IFELSE([ +#include + +int main() { + // not for running... + pslProgram program((pslExtension *)0); + program.compile("int main () {}", ""); + return 0; +} +], + [AC_MSG_RESULT(yes); + have_plib_psl=yes], + AC_MSG_RESULT(no) +) +AM_CONDITIONAL(HAVE_PLIB_PSL, test "x$have_plib_psl" = "xyes") dnl Check for MetaKit AC_CHECK_HEADER(mk4.h) @@ -519,6 +586,7 @@ AC_CONFIG_FILES([ \ src/Environment/Makefile \ src/FDM/Balloon/Makefile \ src/FDM/ExternalNet/Makefile \ + src/FDM/ExternalPipe/Makefile \ src/FDM/JSBSim/Makefile \ src/FDM/JSBSim/filtersjb/Makefile \ src/FDM/LaRCsim/Makefile \ @@ -532,11 +600,13 @@ AC_CONFIG_FILES([ \ src/Main/runfgfs \ src/Main/runfgfs.bat \ src/Model/Makefile \ + src/MultiPlayer/Makefile \ src/Navaids/Makefile \ src/Network/Makefile \ src/NetworkOLK/Makefile \ src/Objects/Makefile \ src/Scenery/Makefile \ + src/Scripting/Makefile \ src/Sound/Makefile \ src/Systems/Makefile \ src/Time/Makefile \ @@ -555,6 +625,16 @@ echo "=================" echo "Prefix: $prefix" +if test "x$have_plib_psl" = "xyes"; then + echo "Plib PSL scripting: yes" +else + echo "Plib PSL scripting: $fg_psl_string_compile" + echo " You will not be able to run scripts written in PSL" + echo " and some advanced GUI and input features may not" + echo " work. Download and install the latest CVS version" + echo " of plib if you would like to enable PSL support." +fi + if test "x$with_logging" != "x"; then echo "Debug messages: $with_logging" else @@ -564,14 +644,24 @@ fi echo -n "Automake version: " automake --version | head -1 -echo "New plib joystick name support: $plib_js_has_getname" - if test "x$with_weathercm" != "x"; then echo "WeatherCM instead of FGEnvironment: $with_weathercm" else echo "Using FGEnvironment" fi +if test "x$with_multiplayer" != "xno"; then + echo "Using default multiplayer support" +elif test "x$with_network_olk" != "xno"; then + echo "Using Oliver's multi-pilot network support" +fi + +if test "x$with_old_menubar" != "x"; then + echo "Using old menubar" +else + echo "Defaulting to new XML-configurable menubar" +fi + if test "x$with_threads" = "xyes"; then echo "threads: yes" else