]> git.mxchange.org Git - flightgear.git/blobdiff - configure.ac
Merge branch 'next' of gitorious.org:fg/flightgear into atcdcl
[flightgear.git] / configure.ac
index 20be785085f17a7b0630b71fb5ba597a52b8f5e0..5f0dae1a8115624623d534547f4a8a8155ad6fba 100644 (file)
@@ -1,7 +1,11 @@
 dnl Process this file with autogen.sh to produce a working configure
 dnl script.
 
-AC_INIT
+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
@@ -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
@@ -181,16 +209,6 @@ else
 fi
 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 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" = "xyes")
-
 dnl EXPERIMENTAL generic event driven input device
 # defaults to no
 AC_ARG_WITH(eventinput, [  --with-eventinput       Include event driven input (EXPERIMENTAL) [default=no]], [], [with_eventinput=no])
@@ -368,6 +386,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"
     ;;
 
@@ -744,23 +763,31 @@ if test "x$ac_cv_header_zlib_h" != "xyes"; then
 fi
 
 dnl Check for Subversion library support
+# libsvn support defaults to yes
 save_LIBS=$LIBS
 save_CPPFLAGS=$CPPFLAGS
-LIBS="`apr-1-config --link-ld`"
-CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes`"
-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"
+AC_ARG_WITH(libsvn, [  --without-libsvn        Do not use libsvn for terrasync [default=no]], [], [with_libsvn=yes])
+if test "x$with_libsvn" = "xyes"; then
+    LIBS="`apr-1-config --link-ld`"
+    CPPFLAGS="-I/usr/include/subversion-1 `apr-1-config --includes --cppflags`"
+    AC_CHECK_HEADERS([svn_client.h])
+       if test "x$ac_cv_header_svn_client_h" = "xyes"; then
+       echo "TerraSync will use libsvn"
+       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)
+       AC_SUBST(svn_CPPFLAGS)
+       else
+       echo "Libsvn not found. TerraSync will use command line subversion"
+       svn_LIBS=""
+       svn_CPPFLAGS=""
+       fi
+else
+echo "Libsvn explicitly disabled. TerraSync will use command line subversion"
   svn_LIBS=""
   svn_CPPFLAGS=""
-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)
-  AC_SUBST(svn_CPPFLAGS)
 fi
 LIBS=$save_LIBS
 CPPFLAGS=$save_CPPFLAGS
@@ -879,9 +906,9 @@ echo "================="
 echo "Prefix: $prefix"
 
 if test "x$with_logging" != "x"; then
-    echo "Debug messages: $with_logging"
+    echo "Log messages: $with_logging"
 else
-    echo "Debug messages: yes"
+    echo "Log messages: yes"
 fi
 
 echo -n "Automake version: "
@@ -892,15 +919,15 @@ if test "x$with_multiplayer" != "xno"; then
 fi
 
 if test "x$with_threads" = "xyes"; then
-    echo "threads: yes"
+    echo "Threads: yes"
 else
-    echo "threads: no"
+    echo "Threads: no"
 fi
 
 if test "x$with_eventinput" = "xyes"; then
-    echo "event input: yes"
+    echo "Event input: yes"
 else
-    echo "event input: no"
+    echo "Event input: no"
 fi
 
 if test "x$enable_sp_fdms" != "xno"; then
@@ -908,10 +935,3 @@ if test "x$enable_sp_fdms" != "xno"; then
 else
     echo "Include special purpose flight models: no"
 fi
-
-if test "x$enable_atcdcl" = "xyes"; then
-    echo "Build depricated ATC/AI module: yes"
-else
-    echo "Build depricated ATC/AI module: no"
-fi
-