On Sun, 2010-02-14 at 15:22 +0100, Erik Hofman wrote:
> John Denker wrote:
> > In this case it appears that adding about five lines
> > of code to acinclude.m4 will remove the need for at
> > least five paragraphs of documentation. It turns
> > out to be quite possible to each the configuration
> > system to search lib64.
>
> Both patches have been committed to CVS.
>
Hi John, Erik,
Re: README.OSG
`
Thank you Erik for adding the README.OSG updates
to FlightGear. You might note this file was previously
also 'mirrored' in SimGear, but maybe it is sufficient
that it is at least in FG. Thanks.
Even if I do say so myself, I think it now gives
'quality' information to the user, should they run
into an OSG shared library problem.
And thank you for adding the <GL/glut.h> patch to
FG configure.ac. Now tests/gl-info runs fine.
Re: Patching acinclude.m4
Concerning the SG acinclude.m4 changes, I guess I am
really misunderstanding something here ;=(( Sorry
if this is true...
--------------------
1. The change has been done only to SimGear
acinclude.m4!
Why to SimGear? Is there, was there a problem in
SimGear? What is the problem being overcome in SG
by this patch?
I _THOUGHT_ all this discussion was about FlightGear!
And the fact that, by default, cmake of OSG, installs
the OSG libraries in $prefix/lib64 when in x86_64!!!
SimGear is a set of static libraries only, thus NEVER
needs to 'find' OSG libraries. Libraries do _NOT_ link
with other 'libraries'!!!
As far as I can see, NONE of the SG 'test' executables,
like decode_binobj, lowtest, socktest, tcp_client,
waytest, TestRenderTexture, testserial, etc...
require linking with OSG libraries.
SG libraries do NOT need OSG libraries... includes,
yes, but libraries, no.
The problem I read was when LINKING FG, specifically
a FG tests program, but it would be the same when later
linking fgfs itself, with OSG libraries.
How can changes to SG effect this FG link failure?
BUT UGH: Just did a full SG cvs update, and this
acinclude.m4 patch _BREAKS_ the SG build for me! I
do like the more 'informative' output though ;=))
--------------------
2. But even if we now modify FG's acinclude.m4 to
correctly find OSG libraries in $prefix/lib64,
then you only move the problem back to when
trying to RUN gl-info, or fgfs, or any others
program dependant on OSG shared libraries.
So, to 'run' anything which includes these OSG
shared libraries, the user must KNOW about one, or
all, of :-
(a) Using 'export LD_LIBRARY_PATH=...', like
export LD_LIBRARY_PATH=/path/to/lib[64][:/other/paths]
(b) Making and using a lib -> lib64 link, if the $prefix
is unique, and does not contain a 'lib' folder
(c) Using /etc/ld.so.conf and ldconfig, to
setup the $prefix/lib64 in the ld cache.
(d) And maybe other solutions...
So yes, such a patch to FG could make the build
appear 'easier', but still leaves the 'user' with
a later, perhaps bigger problem to overcome ;=((.
And again, these user 'options' are now enumerated
in the README.OSG.
--------------------
3. _ALL_ of this can be _AVOIDED_ completely if the
user knows about, and uses the OSG cmake option -
'-D LIB_POSTFIX='
seemingly the single root cause of ALL THIS!!!
Using this puts the OSG shared libraries in
the 'standard' place, namely $prefix/lib. If this
option is used, then :-
(a) SG will build using --with-osg=$prefix to
allow it to find OSG $prefix/include. This has
never been a problem, has it?
(b) FG will build using --with-osg=$prefix to
allow it to find _BOTH_ OSG $prefix/include _AND_
equally important, $prefix/lib
(c) Executables using OSG shared libraries
can be run without any special provision, if
OSG installed in /usr/[local/]lib, or with a
simple /etc/ld.so.conf change if otherwise, or
using LD_LIBRARY_PATH for a temporary solution.
All that by adding one parameter to cmake when
building OSG libraries from source. Does not
seem a _BIG_ thing...
--------------------
4. While I too thought of, and mentioned 'fixing'
the auto-make to deal with this non-standard
OSG install into 'lib64', I later canceled it,
due to it being only _PART_ of the problem.
It does seem cmake OSG is the root cause,
and I really question what should be done in FG
make process to 'fix' this, other than fully
explaining possible 'fixes' in README.OSG,
which is now done ;=))
BUT, ok, I too 'like' the idea of improving
the FG auto-make process, so added the fixes
from SG to FG acinclude.m4, to give it a try...
using a scenario where OSG libraries are installed
in $prefix/lib64
*** IT FAILED! ***
Yes, it got through the FG ./configure --with-osg=$prefix ...
but the Makefiles generated FAILED to add a path for
the SG, and other libraries. They _DO_ have a path for
OSG 'lib64' libraries.
So the main link line (truncated) for fgfs was :-
g++ -DPKGLIBDIR=\"/home/geoff/fg/fg8/install/fgfs/share/FlightGear\" \
-g -O2 -I/home/geoff/fg/fg8/install/simgear -D_REENTRANT \
-L/home/geoff/fg/fg8/install/OSG282/lib64 -o fgfs bootstrap.o libMain.a
../../src/Aircraft/libAircraft.a etc, etc, etc...
-lsgroute -lsgsky -lsgsound etc, etc, etc...
...
/usr/bin/ld: cannot find -lsgroute
ERROR - ABORT!
So, the ONLY -L/path added was that for OSG! The
patch _KILLED_ the other necessary -L/path/to/SG/lib,
-L/path/to/PLIB/lib, etc, etc...
Putting back the original FG acinclude.m4, and
making a simple link in install/OSG282 of
lib -> lib64...
It again gets through the ./configure, using
--with-osg=$prefix, etc, AND now the fgfs link line
(truncated) correctly becomes :-
g++ -DPKGLIBDIR=\"/home/geoff/fg/fg8/install/fgfs/share/FlightGear\" \
-g -O2 -I/home/geoff/fg/fg8/install/simgear -D_REENTRANT \
-L/home/geoff/fg/fg8/install/simgear/lib \
-L/home/geoff/fg/fg8/install/plib/lib \
-L/home/geoff/fg/fg8/install/OSG282/lib \
-L/usr/X11R6/lib \
-L/usr/local/lib -o fgfs bootstrap.o libMain.a \
-lsgroute -lsgsky -lsgsound etc, etc, etc...
...
and the LINK succeeded.
Note 5 distinct -L/path/to/lib parameters...
If I did _NOT_ have the 'link' in place, then
only the 3rd -L should be changed to
OSG282/lib64, but the others _MUST_ remain, as
is...
So OK, it may be possible to PATCH the PATCH,
and GET IT RIGHT, but as it stands - yes, it
helps get through the FG ./configure, BUT it
FAILS on the FG LINK!!!
Most probably a case of SOME_VAR="something",
instead of SOME_VAR="$SOME_VAR something".
That is it is 'set', rather than 'accumulated',
since previous paths are lost, but do not exactly
know... I can see in part the patch does try
to account for this, so maybe this is NOT
the problem...
BUT even if we get the patch of the patch
right, which I have NO DOUBT is very possible,
then we _STILL_ have to deal with the finding
of the OSG shared libraries at RUNTIME...
So although the patch, as it stands, is BAD,
it is only in simgear, where no LIBRARY link
parameters, like -L/path/, are required, but as
stated above, this BREAKS the SG build for me.
So, if others find this, then it should be backed
out of SG until it is CHECKED and FULLY TESTED, and
put in FG, where it has purpose and meaning, if
thought fit...
As stated, maybe I am way out of line here ;=()
I may have made a mistake with the patch,
which is very possible ;=(), since I moved it from
SG to FG, so I attach my FLIGHTGEAR acinclude.m4
final patch used to do the above time consuming
test build, which FAILED...
HTH!
Regards,
Geoff.
attached: bad-acinc.patch
Index: acinclude.m4
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/acinclude.m4,v
retrieving revision 1.5
diff -u -r1.5 acinclude.m4
--- acinclude.m4 22 Nov 2009 22:23:40 -0000 1.5
+++ acinclude.m4 15 Feb 2010 17:10:41 -0000
@@ -6,19 +6,25 @@
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 @@
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 @@
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 @@
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 @@
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)
+
+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}"
+
+ if test "x86_64" = $(uname -m) \
+ -a ! ${mylibdir64} -ef ${mylibdir} ; then
+ wi_EXTRA_LDIR($mylibdir64)
+ fi
- mylibdir="${exdir}/lib${subexdir}"
- wi_EXTRA_LDIR($mylibdir)
+ wi_EXTRA_LDIR($mylibdir)
- progdir="${exdir}/bin${subexdir}"
- wi_EXTRA_PDIR($progdir)
- fi
-done
+ progdir="${exdir}/bin${subexdir}"
+ wi_EXTRA_PDIR($progdir)
+ fi
+ done
done
])
dnl
------------------------------------------------------------------------------
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