]> git.mxchange.org Git - flightgear.git/blobdiff - configure.ac
Set initial environment visibility (thanks to kantoon)
[flightgear.git] / configure.ac
index 3292bfdf14741ad6f6c9a281d2134005c2c2bab6..cd12966c07fdead5d99666e256bc1ef25594bdee 100644 (file)
@@ -1,8 +1,12 @@
 dnl Process this file with autogen.sh to produce a working configure
 dnl script.
 
-AC_INIT
-AC_CONFIG_SRCDIR([src/Aircraft/aircraft.cxx])
+AC_INIT(FlightGear, m4_esyscmd([cat ./version | tr -d '\n']), [http://www.flightgear.org])
+
+dnl Ensure touching the version causes autoconf to re-run
+AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/version'])
+
+AC_CONFIG_SRCDIR([src/Airports/simple.cxx])
 
 dnl Require at least automake 2.52
 AC_PREREQ(2.52)
@@ -10,7 +14,31 @@ AC_PREREQ(2.52)
 dnl Initialize the automake stuff
 dnl set the $host variable based on local machine/os
 AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE(FlightGear, 2.0.0)
+AM_INIT_AUTOMAKE([dist-bzip2])
+
+# variables for version.h
+AC_DEFINE([HAVE_VERSION_H], 1, [Set if version.h is generated])
+
+# are we running under Hudson? (defines BUILD_ID, BUILD_NUMBER in the environment)
+if test "x$BUILD_ID" != "x" ; then
+    AC_SUBST([HUDSON_BUILD_ID], $BUILD_ID)
+    AC_SUBST([HUDSON_BUILD_NUMBER], $BUILD_NUMBER)
+else
+    AC_SUBST([HUDSON_BUILD_ID], [none])
+    AC_SUBST([HUDSON_BUILD_NUMBER], 0)
+fi
+
+AC_CHECK_PROG([HAVE_GIT], git, 1)
+if test "x$HAVE_GIT" != "x" ; then 
+    # git might be installed, but we might be building from a tarball
+    if git rev-parse ; then
+       AC_SUBST([REVISION], `git rev-parse HEAD`)
+    else
+       AC_SUBST([REVISION], [none])    
+    fi
+else
+    AC_SUBST([REVISION], [none])       
+fi
 
 dnl Checks for programs.
 AC_PROG_MAKE_SET
@@ -23,6 +51,10 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AX_BOOST_BASE([1.37.0])
 
+# Show all compiler warnings by default
+CXXFLAGS="$CXXFLAGS -Wall"
+CFLAGS="$CFLAGS -Wall"
+
 if test "x$BOOST_CPPFLAGS" != "x-I/usr/include" ; then
    CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
 fi
@@ -88,7 +120,7 @@ case "${host}" in
     ])
 
     # Mac OS X specific configure options
-    AC_ARG_WITH(cocoa_framework, [  --with-cocoa-framework       Use the Cocoa rather than Carbon]])
+    AC_ARG_WITH(cocoa_framework, [  --with-cocoa-framework         Use the Cocoa rather than Carbon])
     if test "x$with_cocoa_framework" != "x" ; then
         macAPI=Cocoa
         AC_MSG_NOTICE([Using Cocoa framework])
@@ -97,19 +129,19 @@ case "${host}" in
         AC_MSG_NOTICE([Using Carbon framework])
     fi
 
-    AC_ARG_WITH(osg_framework, [  --with-osg-framework=PREFIX       Specify the prefix path to osg frameworks [default=standard framework paths]])
+    AC_ARG_WITH(osg_framework, [  --with-osg-framework=PREFIX    Specify the prefix path to osg frameworks [default=standard framework paths]])
     if test "x$with_osg_framework" != "x" ; then
         echo "osg prefix is $with_osg_framework"
        export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_osg_framework"
     fi
 
-    AC_ARG_WITH(plib_framework, [  --with-plib-framework=PREFIX       Specify the prefix path to PLIB framework [default=standard framework paths]])
+    AC_ARG_WITH(plib_framework, [  --with-plib-framework=PREFIX   Specify the prefix path to PLIB framework [default=standard framework paths]])
     if test "x$with_plib_framework" != "x" ; then
         echo "plib prefix is $with_plib_framework"
        export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$with_plib_framework"
     fi
 
-    AC_ARG_WITH(alut_framework, [ --with-alut-framework=PREFIX    Specify the prefix path to ALUT.framework ])
+    AC_ARG_WITH(alut_framework, [  --with-alut-framework=PREFIX   Specify the prefix path to ALUT.framework ])
     if test "x$with_alut_framework" != "x"; then
         echo "ALUT framework prefix is $with_alut_framework"
     fi
@@ -179,15 +211,13 @@ AM_CONDITIONAL(ENABLE_SP_FDM, test "x$enable_sp_fdms" != "xno")
 
 # Specify whether we want to compile ATCDCL.
 # default to with_atcdcl=yes
-AC_ARG_ENABLE(atcdcl, [  --enable-atcdcl                Compile and link the depricated atc/ai module], [enable_atcdcl="$enableval"] )
-if test "x$enable_atcdcl" != "xno"; then
+AC_ARG_ENABLE(atcdcl, [  --enable-atcdcl                Compile and link the deprecated atc/ai module], [], [enable_atcdcl="$enableval"] )
+if test "x$enable_atcdcl" = "xyes"; then
     AC_DEFINE([ENABLE_ATCDCL], 1, [Define to include old ATC/AI module])
 else
     AC_DEFINE([ENABLE_ATCDCL], 0, [Define to include old ATC/AI module])
 fi
-AM_CONDITIONAL(ENABLE_ATCDCL, test "x$enable_atcdcl" != "xno")
-
-
+AM_CONDITIONAL(ENABLE_ATCDCL, test "x$enable_atcdcl" = "xyes")
 
 dnl EXPERIMENTAL generic event driven input device
 # defaults to no
@@ -231,7 +261,6 @@ if test "x$with_threads" = "xyes"; then
 fi
 AC_CHECK_HEADER(pthread.h)
 
-
 dnl Used by JSBSim to conditionally compile in fgfs interface code
 AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
 
@@ -314,7 +343,7 @@ AC_SEARCH_LIBS(clock_gettime, rt)
 base_LIBS="$LIBS"
 
 dnl Check for SDL or glut if enabled.
-AC_ARG_ENABLE(osgviewer, [  --enable-osgviewer             Configure to use osgViewer(default)], [enable_osgviewer="$enableval"])
+AC_ARG_ENABLE(osgviewer, [  --enable-osgviewer             Configure to use osgViewer (default)], [enable_osgviewer="$enableval"])
 AC_ARG_ENABLE(sdl,  [  --enable-sdl                   Configure to use SDL], [enable_sdl="$enableval"])
 AC_ARG_ENABLE(glut, [  --enable-glut                  Configure to use GLUT], [enable_glut="$enableval"])
 AM_CONDITIONAL(USE_SDL, test "x$enable_sdl" = "xyes")
@@ -367,6 +396,7 @@ case "${host}" in
     dnl Mac OS X
 
     LIBS="$LIBS -framework GLUT -framework OpenGL -framework AGL -framework $macAPI -lobjc"
+    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
     joystick_LIBS="$joystick_LIBS -framework IOKit -framework CoreFoundation"
     ;;
 
@@ -432,13 +462,12 @@ case "${host}" in
 
     # Mac OS X has OpenAL.framework, but no ALUT, by default, so we
     # require use of a non-Apple ALUT.framework which we provide
-    LIBS="$LIBS -framework IOKit -framework OpenAL"
-    openal_LIBS="$LIBS"
+    openal_LIBS="-framework IOKit -framework OpenAL"
     
     AC_CHECK_FRAMEWORK(OpenAL, [#include <OpenAL/al.h>], "", [OPENAL_OK="yes"])
     AC_CHECK_FRAMEWORK(ALUT, [#include <ALUT/alut.h>], $with_alut_framework, [
         ALUT_OK="yes"
-        LIBS = "$LIBS -framework ALUT"
+        openal_LIBS="$openal_LIBS -framework ALUT"
     ])
     ;;
 
@@ -746,10 +775,9 @@ fi
 dnl Check for Subversion library support
 save_LIBS=$LIBS
 save_CPPFLAGS=$CPPFLAGS
-LIBS=""
+LIBS="`apr-1-config --link-ld`"
 CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes`"
-AC_CHECK_LIB(svn_client-1, svn_client_checkout3)
-AC_CHECK_HEADERS([svn_client.h glut.h])
+AC_CHECK_HEADERS([svn_client.h])
 if test "x$ac_cv_header_svn_client_h" != "xyes"; then
   echo "TerraSync will shell out for command line subversion"
   svn_LIBS=""
@@ -757,6 +785,7 @@ if test "x$ac_cv_header_svn_client_h" != "xyes"; then
 else
   echo "TerraSync will use integrated subversion library"
   AC_SEARCH_LIBS(svn_client_checkout, svn_client-1)
+  AC_SEARCH_LIBS(svn_cmdline_init, svn_subr-1)
   svn_LIBS=$LIBS
   svn_CPPFLAGS=$CPPFLAGS
   AC_SUBST(svn_LIBS)
@@ -814,10 +843,6 @@ AC_CONFIG_FILES([ \
        src/Makefile \
        src/Include/Makefile \
        src/Include/version.h \
-       src/Include/config.h-msvc6 \
-       src/Include/config.h-msvc71 \
-       src/Include/config.h-msvc8 \
-       src/Include/config.h-msvc90 \
        src/Aircraft/Makefile \
        src/Airports/Makefile \
        src/ATC/Makefile \
@@ -913,8 +938,9 @@ else
     echo "Include special purpose flight models: no"
 fi
 
-if test "x$enable_atcdcl" != "xno"; then
+if test "x$enable_atcdcl" = "xyes"; then
     echo "Build depricated ATC/AI module: yes"
 else
     echo "Build depricated ATC/AI module: no"
 fi
+