On 02/09/2010 03:08 AM, Erik Hofman wrote:

> I've updated configure of both FlightGear and SimGear to bail out if the 
> OpenScenegraph libraries are not found. 

Thanks!  That is a significant improvement.

That helped directly ... and also helped indirectly,
by giving me a valuable clue about how to fix some 
of the other bugs in the autoconfiguration setup.

The commit message should be self-explanatory.

This deals with the SG side of things, which is
where Joe User will usually first encounter
problems.  I haven't yet made the corresponding
fixes to the FG side of things.

commit 4eb51bb90f4e8c2ca9842ad248b5e0eb57e400f7
Author: John Denker <j...@av8n.com>
Date:   Fri Feb 12 01:25:25 2010 -0700

    Fix bug:  substrings in LDFLAGS
    Fix bug:  substrings in CPPFLAGS
    Fix bug:  now check libraries (not just headers) for plib.
    More informative error messages.
    Spelling.
    Slightly more informative logging.

diff --git a/acinclude.m4 b/acinclude.m4
index 9e46179..851e120 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -6,19 +6,23 @@ 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
 fi
 ])
 dnl
@@ -28,19 +32,23 @@ 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
 fi
 ])
 dnl
@@ -50,12 +58,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,7 +68,7 @@ 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
 fi
diff --git a/configure.ac b/configure.ac
index 710a42f..38ae49f 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


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to