[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 4 May 2006 11:20:37 +0200
* Andreas Volz wrote on Thu, May 04, 2006 at 10:36:13AM CEST:
> Am Wed, 3 May 2006 19:06:17 +0200 schrieb Ralf Wildenhues:
> > > Ok, at first I show the cross build of freeglut. Here is the
> > > packages configured and build: (log files and .la files included)
> > Thanks. The first point where the X11 libraries come into play even
> > when --without-x is given is in src/Makefile.am, where they are added
> > unconditionally to address@hidden@_la_LIBADD.
> Where should I add them? To _LDADD or _LDFLAGS? I've not complete
> understand this. It "simply worked" in the past for all my apps.
Oh, sorry, I was not precise. freeglut-2.4.0/src/Makefile.am has:
| address@hidden@_la_LIBADD = $(LIBM) $(X_LIBS) -lGL -lGLU -lXext -lX11
| address@hidden@_la_LDFLAGS = -version-info 11:0:8
| address@hidden@_la_CFLAGS = $(X_CFLAGS)
(and @LIBRARY@ will be one of glut or freeglut) which is ok, except that
-lGL -lGLU -lXext -lX11
will always be added as library dependencies. If you know that these
libraries are not needed always, you could write the appropriate logic
that determines when they are needed into configure.ac, like so:
if $gl_libs_are_needed; then
and then you change above line to
address@hidden@_la_LIBADD = $(LIBM) $(X_LIBS) $(GL_LIBS) -lXext -lX11
or somehow like this; again, I can't tell you about when they are
actually needed, and which libraries you need to get rid of, since I
> > PATH=/opt/xmingw/bin:/opt/xmingw/i386-mingw32msvc/bin:$PATH
> > export PATH
> > ./configure --host=i386-mingw32msvc \
> > LDFLAGS=-L/opt/xmingw/i386-mingw32msvc/lib \
> > CPPFLAGS=-I/opt/xmingw/i386-mingw32msvc/include \
> > "$@"
> Thanks, this works. For what reason do I need the --target switch?
Only when compiling a compiler. Say, I have a GNU/Linux system and a
friend who has a FreeBSD system; he needs a cross compiler to build
programs to run with MinGW. Then I produce a compiler for him by using
configure --build=..linux-gnu --host=..freebsd.. --target=..mingw..
(omitting any number of steps I have to do before that).
> > > It seems the mingw environment doesn't provide much .la files. Are
> > > this files on Windows not as usefull as on Linux or UNIX?
> > No. They are intended to be useful on all systems that Libtool
> > supports. Some distributors choose not to ship them; often though,
> > the respective libraries just aren't built with libtool.
> Perhaps there's also a very special problem with the win32 platform.
> The la files contain often absolute paths. But at mingw installation
> time I could choose where to install it. So all la files needs to be
> rewritten while installing.
One way to achieve this is to use the actual path where they will appear
*once being used* with --prefix; then at "make install" time, use
DESTDIR to install them elsewhere, and manually move them to the correct
This is one of the trouble spots of Libtool cross compile support,
because that will give you issues if you use those installed .la files
for further cross compiles: the dependent paths and such will all be
wrong. But you need to be aware that, portably, it's not just an issue
with the .la files: on some systems similarly paths are hardcoded into
the libraries; and for this you may need to take measures to cope with.
(Not a problem with w32 DLLs, I think).
> I've the same bugging problem with
> providing pkg-config pc files for my binaries. This is nearly
> impossible for win32, because everyone like to relocate the files :-(
Solving all this portably is rather difficult.