Merge branches 'ehofman/config' and 'ehofman/dlerror'

This commit is contained in:
Tim Moore
2010-04-25 22:32:14 +02:00
4 changed files with 111 additions and 73 deletions
+68 -48
View File
@@ -6,19 +6,25 @@ dnl
AC_DEFUN([wi_EXTRA_IDIR], [ AC_DEFUN([wi_EXTRA_IDIR], [
incdir="$1" incdir="$1"
if test -r $incdir ; then if test -r $incdir ; then
case "$CPPFLAGS" in already=""
*-I${incdir}*) for CPPflag in $CPPFLAGS ; do
# echo " + already had $incdir" 1>&6 if test "_$CPPflag" = "_-I${incdir}" ; then
;; already=yes
*) break
if test "$CPPFLAGS" = "" ; then fi
CPPFLAGS="-I$incdir" done
else if test -n "$already" ; then
CPPFLAGS="$CPPFLAGS -I$incdir" echo " + already had -I$incdir" 1>&AS_MESSAGE_LOG_FD
fi else
echo " + found $incdir" 1>&6 if test "$CPPFLAGS" = "" ; then
;; CPPFLAGS="-I$incdir"
esac 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 fi
]) ])
dnl dnl
@@ -28,19 +34,25 @@ dnl
AC_DEFUN([wi_EXTRA_LDIR], [ AC_DEFUN([wi_EXTRA_LDIR], [
mylibdir="$1" mylibdir="$1"
if test -r $mylibdir ; then if test -r $mylibdir ; then
case "$LDFLAGS" in already=""
*-L${mylibdir}*) for LDflag in $LDFLAGS ; do
# echo " + already had $mylibdir" 1>&6 if test "_$LDflag" = "_-L${mylibdir}" ; then
;; already=yes
*) break
if test "$LDFLAGS" = "" ; then fi
LDFLAGS="-L$mylibdir" done
else if test -n "$already" ; then
LDFLAGS="$LDFLAGS -L$mylibdir" echo " + already had -L$mylibdir" 1>&AS_MESSAGE_LOG_FD
fi else
echo " + found $mylibdir" 1>&6 if test "$LDFLAGS" = "" ; then
;; LDFLAGS="-L$mylibdir"
esac 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 fi
]) ])
dnl dnl
@@ -50,12 +62,9 @@ dnl
AC_DEFUN([wi_EXTRA_PDIR], [ AC_DEFUN([wi_EXTRA_PDIR], [
progdir="$1" progdir="$1"
if test -r $progdir ; then if test -r $progdir ; then
case "$PATH" in case ":$PATH:" in
*:${progdir}*) *:${progdir}:*)
# echo " + already had $progdir" 1>&6 echo " + already had $progdir in \$PATH" 1>&AS_MESSAGE_LOG_FD
;;
*${progdir}:*)
# echo " + already had $progdir" 1>&6
;; ;;
*) *)
if test "$PATH" = "" ; then if test "$PATH" = "" ; then
@@ -63,9 +72,11 @@ if test -r $progdir ; then
else else
PATH="$PATH:$progdir" PATH="$PATH:$progdir"
fi fi
echo " + found $progdir" 1>&6 echo " + appended $progdir to \$PATH" 1>&AS_MESSAGE_LOG_FD
;; ;;
esac esac
else
echo " + PDIR is not accessible: '$progdir'" 1>&AS_MESSAGE_LOG_FD
fi fi
]) ])
dnl dnl
@@ -89,23 +100,32 @@ if test "$subexdirs" = "" ; then
subexdirs="-" subexdirs="-"
fi fi
for subexdir in $subexdirs ; do for subexdir in $subexdirs ; do
if test "$subexdir" = "-" ; then if test "$subexdir" = "-" ; then
subexdir="" subexdir=""
else else
subexdir="/$subexdir" subexdir="/$subexdir"
fi fi
for exdir in $exdirs ; do for exdir in $exdirs ; do
if test "$exdir" != "/usr" || test "$subexdir" != ""; then if test "$exdir" != "/usr" || test "$subexdir" != ""; then
incdir="${exdir}/include${subexdir}" incdir="${exdir}/include${subexdir}"
wi_EXTRA_IDIR($incdir) wi_EXTRA_IDIR($incdir)
mylibdir="${exdir}/lib${subexdir}" dnl On 64-bit machines, if lib64/ exists and is not identical to lib/
wi_EXTRA_LDIR($mylibdir) dnl then it should be listed here, listed ahead of lib/.
mylibdir64="${exdir}/lib64${subexdir}"
mylibdir32="${exdir}/lib${subexdir}"
progdir="${exdir}/bin${subexdir}" if test "x86_64" = $(uname -m) \
wi_EXTRA_PDIR($progdir) -a ! ${mylibdir64} -ef ${mylibdir32} ; then
fi wi_EXTRA_LDIR($mylibdir64)
done fi
wi_EXTRA_LDIR($mylibdir32)
progdir="${exdir}/bin${subexdir}"
wi_EXTRA_PDIR($progdir)
fi
done
done done
]) ])
dnl dnl
+42 -16
View File
@@ -437,11 +437,18 @@ esac
AM_CONDITIONAL(HAVE_FRAMEWORK_PLIB, test "x$ac_cv_framework_PLIB" != "x") AM_CONDITIONAL(HAVE_FRAMEWORK_PLIB, test "x$ac_cv_framework_PLIB" != "x")
AC_CHECK_HEADER(plib/ul.h) 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
echo "You *must* have the plib library installed on your system to build" echo "You *must* have the plib library installed on your system to build"
echo "SimGear!" echo "SimGear!"
echo echo
echo " LIBS: '$LIBS'"
echo " LDFLAGS: '$LDFLAGS'"
echo " CPPFLAGS: '$CPPFLAGS'"
echo
echo "Please see README.plib for more details." echo "Please see README.plib for more details."
echo echo
echo "configure aborted." echo "configure aborted."
@@ -475,18 +482,18 @@ LIBS="$saved_LIBS"
case "${host}" in case "${host}" in
*-apple-darwin*) *-apple-darwin*)
if test "x$with_osg_framework" != "x"; then if test "x$with_osg_framework" != "x"; then
AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgViewer, [#include <osgViewer/Version>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgGA, [#include <osgGA/Version>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgText, [#include <osgText/Version>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgFX, [#include <osgFX/AnisotropicLighting>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgUtil, [#include <osgUtil/Version>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgDB, [#include <osgDB/Version>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgSim, [#include <osgSim/Version>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osgParticle, [#include <osgParticle/Version>], $with_osg_framework)
AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework) # AC_CHECK_FRAMEWORK(osg, [#include <osg/Version>], $with_osg_framework)
osg_FRAMEWORKS="$FRAMEWORKS" # osg_FRAMEWORKS="$FRAMEWORKS"
FRAMEWORKS="" # FRAMEWORKS=""
AC_SUBST(osg_FRAMEWORKS) # AC_SUBST(osg_FRAMEWORKS)
AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework) AC_CHECK_FRAMEWORK(OpenThreads, [#include <OpenThreads/Version>], $with_osg_framework)
openthreads_FRAMEWORK="$FRAMEWORKS" openthreads_FRAMEWORK="$FRAMEWORKS"
FRAMEWORKS="" FRAMEWORKS=""
@@ -496,18 +503,33 @@ case "${host}" in
dnl This is needed when osg dynamic libs are specified dnl This is needed when osg dynamic libs are specified
dnl instead of OSG frameworks on Mac OS X dnl instead of OSG frameworks on Mac OS X
dnl dnl
LDFLAGS="$LDFLAGS -L$with_osg" AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
fi
;;
*)
if test "x$enable_osgdebug" = "xyes"; then
AC_CHECK_LIB(OpenThreadsd,OpenThreadsGetVersion)
else
AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
fi fi
;; ;;
esac esac
AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x") AM_CONDITIONAL(HAVE_FRAMEWORK_OSG, test "x$ac_cv_framework_osg" != "x")
AC_CHECK_HEADER(osg/Version) 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 if test "x$ac_cv_framework_osg" != "xyes"; then
echo echo
echo "You *must* have the OpenSceneGraph support library installed on your system" echo "You *must* have the OpenThreads library installed on your system"
echo "to build this version of SimGear!" 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
echo "Please see README.OSG for more details." echo "Please see README.OSG for more details."
echo echo
@@ -522,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 "You *must* have the Boost library installed on your system"
echo "to build this version of SimGear!" echo "to build this version of SimGear!"
echo echo
echo " LIBS: '$LIBS'"
echo " LDFLAGS: '$LDFLAGS'"
echo " CPPFLAGS: '$CPPFLAGS'"
echo
echo "configure aborted." echo "configure aborted."
exit exit
fi fi
+1 -1
View File
@@ -15,7 +15,7 @@ libsgprops_a_SOURCES = \
props_io.cxx \ props_io.cxx \
AtomicChangeListener.cxx AtomicChangeListener.cxx
noinst_PROGRAMS = props_test check_PROGRAMS = props_test
props_test_SOURCES = props_test.cxx props_test_SOURCES = props_test.cxx
props_test_LDADD = \ props_test_LDADD = \
-8
View File
@@ -121,11 +121,7 @@ void *SGGetGLProcAddress(const char *func) {
libHandle = dlopen(NULL, RTLD_LAZY); libHandle = dlopen(NULL, RTLD_LAZY);
if (!libHandle) { if (!libHandle) {
#if defined (__FreeBSD__)
const char *error = dlerror(); const char *error = dlerror();
#else
char *error = dlerror();
#endif
if (error) { if (error) {
SG_LOG(SG_GENERAL, SG_INFO, error); SG_LOG(SG_GENERAL, SG_INFO, error);
return 0; return 0;
@@ -145,11 +141,7 @@ void *SGGetGLProcAddress(const char *func) {
} else if (libHandle != NULL) { } else if (libHandle != NULL) {
fptr = dlsym(libHandle, func); fptr = dlsym(libHandle, func);
#if defined (__FreeBSD__)
const char *error = dlerror(); const char *error = dlerror();
#else
char *error = dlerror();
#endif
if (error) if (error)
SG_LOG(SG_GENERAL, SG_INFO, error); SG_LOG(SG_GENERAL, SG_INFO, error);
} }