From fdcf53c6886bbb73eb5094a6a1a16378059ecd4c Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 9 Feb 2010 09:26:04 +0000 Subject: [PATCH 1/6] Properly test for OpenThreads and bail out if it isn't found --- configure.ac | 38 +++++++++++++++++++++++--------------- simgear/props/Makefile.am | 2 +- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 6ac0c87b..7bebd560 100644 --- a/configure.ac +++ b/configure.ac @@ -475,18 +475,18 @@ LIBS="$saved_LIBS" case "${host}" in *-apple-darwin*) if test "x$with_osg_framework" != "x"; then - AC_CHECK_FRAMEWORK(osgViewer, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osgGA, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osgText, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osgFX, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osgUtil, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osgDB, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osgSim, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osgParticle, [#include ], $with_osg_framework) - AC_CHECK_FRAMEWORK(osg, [#include ], $with_osg_framework) - osg_FRAMEWORKS="$FRAMEWORKS" - FRAMEWORKS="" - AC_SUBST(osg_FRAMEWORKS) +# AC_CHECK_FRAMEWORK(osgViewer, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osgGA, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osgText, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osgFX, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osgUtil, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osgDB, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osgSim, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osgParticle, [#include ], $with_osg_framework) +# AC_CHECK_FRAMEWORK(osg, [#include ], $with_osg_framework) +# osg_FRAMEWORKS="$FRAMEWORKS" +# FRAMEWORKS="" +# AC_SUBST(osg_FRAMEWORKS) AC_CHECK_FRAMEWORK(OpenThreads, [#include ], $with_osg_framework) openthreads_FRAMEWORK="$FRAMEWORKS" FRAMEWORKS="" @@ -499,15 +499,23 @@ case "${host}" in LDFLAGS="$LDFLAGS -L$with_osg" fi ;; +*) + if test "x$enable_osgdebug" = "xyes"; then + AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion) + else + AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion) + fi + ;; esac AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x") AC_CHECK_HEADER(osg/Version) -if test "x$ac_cv_header_osg_Version" != "xyes"; then +if test "x$ac_cv_header_osg_Version" != "xyes" -o "x$ac_cv_lib_OpenThreads_OpenThreadsGetVersion" != "xyes"; then if test "x$ac_cv_framework_osg" != "xyes"; then echo - echo "You *must* have the OpenSceneGraph support library installed on your system" - echo "to build this version of SimGear!" + echo "Warning: The OpenThreads library was not found on this system." + echo " Mybe you forgot to sepcify --with-osg?" + echo "Without the OpenSceneGraph library FlightGear will not work." echo echo "Please see README.OSG for more details." echo diff --git a/simgear/props/Makefile.am b/simgear/props/Makefile.am index acf52017..658fe126 100644 --- a/simgear/props/Makefile.am +++ b/simgear/props/Makefile.am @@ -15,7 +15,7 @@ libsgprops_a_SOURCES = \ props_io.cxx \ AtomicChangeListener.cxx -noinst_PROGRAMS = props_test +check_PROGRAMS = props_test props_test_SOURCES = props_test.cxx props_test_LDADD = \ From bb370a304d9bc2cb9b48fb69f65e3eb484cd2542 Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 9 Feb 2010 09:28:40 +0000 Subject: [PATCH 2/6] smnall update for MacOS without framework support --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 7bebd560..75b95987 100644 --- a/configure.ac +++ b/configure.ac @@ -496,6 +496,7 @@ case "${host}" in dnl This is needed when osg dynamic libs are specified dnl instead of OSG frameworks on Mac OS X dnl + AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion) LDFLAGS="$LDFLAGS -L$with_osg" fi ;; From 6786a7be4ac56e8371777c90b3d13120f55752ad Mon Sep 17 00:00:00 2001 From: ehofman Date: Wed, 10 Feb 2010 08:13:09 +0000 Subject: [PATCH 3/6] small MacOS fix --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 75b95987..710a42f3 100644 --- a/configure.ac +++ b/configure.ac @@ -497,7 +497,6 @@ case "${host}" in dnl instead of OSG frameworks on Mac OS X dnl AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion) - LDFLAGS="$LDFLAGS -L$with_osg" fi ;; *) From f9b064cc197130b66c449780c9126d38360d5017 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 14 Feb 2010 14:21:59 +0000 Subject: [PATCH 4/6] Joe User updates by John Denker --- acinclude.m4 | 116 ++++++++++++++++++++++++++++++--------------------- configure.ac | 26 ++++++++++-- 2 files changed, 90 insertions(+), 52 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 9e46179f..0d645d98 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -6,19 +6,25 @@ dnl AC_DEFUN([wi_EXTRA_IDIR], [ incdir="$1" if test -r $incdir ; then - case "$CPPFLAGS" in - *-I${incdir}*) - # echo " + already had $incdir" 1>&6 - ;; - *) - if test "$CPPFLAGS" = "" ; then - CPPFLAGS="-I$incdir" - else - CPPFLAGS="$CPPFLAGS -I$incdir" - fi - echo " + found $incdir" 1>&6 - ;; - esac + already="" + for CPPflag in $CPPFLAGS ; do + if test "_$CPPflag" = "_-I${incdir}" ; then + already=yes + break + fi + done + if test -n "$already" ; then + echo " + already had -I$incdir" 1>&AS_MESSAGE_LOG_FD + else + if test "$CPPFLAGS" = "" ; then + CPPFLAGS="-I$incdir" + else + CPPFLAGS="$CPPFLAGS -I$incdir" + fi + echo " + added -I$incdir" 1>&AS_MESSAGE_LOG_FD + fi +else + echo " + IDIR is not accessible: '$myincdir'" 1>&AS_MESSAGE_LOG_FD fi ]) dnl @@ -28,19 +34,25 @@ dnl AC_DEFUN([wi_EXTRA_LDIR], [ mylibdir="$1" if test -r $mylibdir ; then - case "$LDFLAGS" in - *-L${mylibdir}*) - # echo " + already had $mylibdir" 1>&6 - ;; - *) - if test "$LDFLAGS" = "" ; then - LDFLAGS="-L$mylibdir" - else - LDFLAGS="$LDFLAGS -L$mylibdir" - fi - echo " + found $mylibdir" 1>&6 - ;; - esac + already="" + for LDflag in $LDFLAGS ; do + if test "_$LDflag" = "_-L${mylibdir}" ; then + already=yes + break + fi + done + if test -n "$already" ; then + echo " + already had -L$mylibdir" 1>&AS_MESSAGE_LOG_FD + else + if test "$LDFLAGS" = "" ; then + LDFLAGS="-L$mylibdir" + else + LDFLAGS="$LDFLAGS -L$mylibdir" + fi + echo " + added -L$mylibdir" 1>&AS_MESSAGE_LOG_FD + fi +else + echo " + LDIR is not accessible: '$mylibdir'" 1>&AS_MESSAGE_LOG_FD fi ]) dnl @@ -50,12 +62,9 @@ dnl AC_DEFUN([wi_EXTRA_PDIR], [ progdir="$1" if test -r $progdir ; then - case "$PATH" in - *:${progdir}*) - # echo " + already had $progdir" 1>&6 - ;; - *${progdir}:*) - # echo " + already had $progdir" 1>&6 + case ":$PATH:" in + *:${progdir}:*) + echo " + already had $progdir in \$PATH" 1>&AS_MESSAGE_LOG_FD ;; *) if test "$PATH" = "" ; then @@ -63,9 +72,11 @@ if test -r $progdir ; then else PATH="$PATH:$progdir" fi - echo " + found $progdir" 1>&6 + echo " + appended $progdir to \$PATH" 1>&AS_MESSAGE_LOG_FD ;; esac +else + echo " + PDIR is not accessible: '$progdir'" 1>&AS_MESSAGE_LOG_FD fi ]) dnl @@ -89,23 +100,32 @@ if test "$subexdirs" = "" ; then subexdirs="-" fi for subexdir in $subexdirs ; do -if test "$subexdir" = "-" ; then - subexdir="" -else - subexdir="/$subexdir" -fi -for exdir in $exdirs ; do - if test "$exdir" != "/usr" || test "$subexdir" != ""; then - incdir="${exdir}/include${subexdir}" - wi_EXTRA_IDIR($incdir) + if test "$subexdir" = "-" ; then + subexdir="" + else + subexdir="/$subexdir" + fi + for exdir in $exdirs ; do + if test "$exdir" != "/usr" || test "$subexdir" != ""; then + incdir="${exdir}/include${subexdir}" + wi_EXTRA_IDIR($incdir) - mylibdir="${exdir}/lib${subexdir}" - wi_EXTRA_LDIR($mylibdir) +dnl On 64-bit machines, if lib64/ exists and is not identical to lib/ +dnl then it should be listed here, listed ahead of lib/. + mylibdir64="${exdir}/lib64${subexdir}" + mylibdir="${exdir}/lib${subexdir}" - progdir="${exdir}/bin${subexdir}" - wi_EXTRA_PDIR($progdir) - fi -done + if test "x86_64" = $(uname -m) \ + -a ! ${mylibdir64} -ef ${mylibdir} ; then + wi_EXTRA_LDIR($mylibdir64) + fi + + wi_EXTRA_LDIR($mylibdir) + + progdir="${exdir}/bin${subexdir}" + wi_EXTRA_PDIR($progdir) + fi + done done ]) dnl diff --git a/configure.ac b/configure.ac index 710a42f3..38ae49f5 100644 --- a/configure.ac +++ b/configure.ac @@ -437,11 +437,18 @@ esac AM_CONDITIONAL(HAVE_FRAMEWORK_PLIB, test "x$ac_cv_framework_PLIB" != "x") AC_CHECK_HEADER(plib/ul.h) -if test "x$ac_cv_header_plib_ul_h" != "xyes"; then + +AC_CHECK_LIB(plibul,ulInit) +if test "x$ac_cv_header_plib_ul_h" != "xyes" \ + -o "x$ac_cv_lib_plibul_ulInit" != "xyes" ; then echo echo "You *must* have the plib library installed on your system to build" echo "SimGear!" echo + echo " LIBS: '$LIBS'" + echo " LDFLAGS: '$LDFLAGS'" + echo " CPPFLAGS: '$CPPFLAGS'" + echo echo "Please see README.plib for more details." echo echo "configure aborted." @@ -507,15 +514,22 @@ case "${host}" in fi ;; esac + AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x") AC_CHECK_HEADER(osg/Version) + if test "x$ac_cv_header_osg_Version" != "xyes" -o "x$ac_cv_lib_OpenThreads_OpenThreadsGetVersion" != "xyes"; then if test "x$ac_cv_framework_osg" != "xyes"; then echo - echo "Warning: The OpenThreads library was not found on this system." - echo " Mybe you forgot to sepcify --with-osg?" - echo "Without the OpenSceneGraph library FlightGear will not work." + echo "You *must* have the OpenThreads library installed on your system" + echo "to build this version of SimGear!" + echo " Maybe you need to specify --with-osg=DIR." + echo " Maybe you need to specify some LDFLAGS to help the linker." + echo + echo " LIBS: '$LIBS'" + echo " LDFLAGS: '$LDFLAGS'" + echo " CPPFLAGS: '$CPPFLAGS'" echo echo "Please see README.OSG for more details." echo @@ -530,6 +544,10 @@ if test "x$ac_cv_header_boost_version_hpp" != "xyes"; then echo "You *must* have the Boost library installed on your system" echo "to build this version of SimGear!" echo + echo " LIBS: '$LIBS'" + echo " LDFLAGS: '$LDFLAGS'" + echo " CPPFLAGS: '$CPPFLAGS'" + echo echo "configure aborted." exit fi From 8e47f5d4944eb595497b4cad9ce58dd17c6d1504 Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 16 Feb 2010 08:18:40 +0000 Subject: [PATCH 5/6] John Denker: Fix sneaky bug: 'mylibdir' variable getting trampled. --- acinclude.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 0d645d98..dcbe5681 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -113,14 +113,14 @@ for subexdir in $subexdirs ; do dnl On 64-bit machines, if lib64/ exists and is not identical to lib/ dnl then it should be listed here, listed ahead of lib/. mylibdir64="${exdir}/lib64${subexdir}" - mylibdir="${exdir}/lib${subexdir}" + mylibdir32="${exdir}/lib${subexdir}" if test "x86_64" = $(uname -m) \ - -a ! ${mylibdir64} -ef ${mylibdir} ; then + -a ! ${mylibdir64} -ef ${mylibdir32} ; then wi_EXTRA_LDIR($mylibdir64) fi - wi_EXTRA_LDIR($mylibdir) + wi_EXTRA_LDIR($mylibdir32) progdir="${exdir}/bin${subexdir}" wi_EXTRA_PDIR($progdir) From 44c93d5074a26133379a6f4e60547b17a05e1d71 Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 23 Mar 2010 08:19:43 +0000 Subject: [PATCH 6/6] Csaba Halasz: fix a compilation error for non-bsd systems that happen to return const char* from dlerror(). --- simgear/screen/extensions.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/simgear/screen/extensions.cxx b/simgear/screen/extensions.cxx index 7429c0f5..130673c5 100644 --- a/simgear/screen/extensions.cxx +++ b/simgear/screen/extensions.cxx @@ -121,11 +121,7 @@ void *SGGetGLProcAddress(const char *func) { libHandle = dlopen(NULL, RTLD_LAZY); if (!libHandle) { -#if defined (__FreeBSD__) const char *error = dlerror(); -#else - char *error = dlerror(); -#endif if (error) { SG_LOG(SG_GENERAL, SG_INFO, error); return 0; @@ -145,11 +141,7 @@ void *SGGetGLProcAddress(const char *func) { } else if (libHandle != NULL) { fptr = dlsym(libHandle, func); -#if defined (__FreeBSD__) const char *error = dlerror(); -#else - char *error = dlerror(); -#endif if (error) SG_LOG(SG_GENERAL, SG_INFO, error); }