--
Gautam
I'm trying to port modular-xorg-server to Minix and I just managed to
install libXt.
> a. Because of the lack of a modular X server and shared-libraries:
>
> - Some pkgsrc packages (libXt) have X11-related dependencies that have
> their own confusing problems. They say pkg-config can't find
> dependencies, but then the packages fail by not proceeding to use the
> relevant buildlinks to build the dependencies. However, these parts
> are installed by the X11 package from bigports.
The X server from bigports does not include a xt.pc for libXt.a, perhaps
this missing xt.pc file makes pkg-config unable to find the dependencies.
The libXt from modular-xorg-server does installs a xt.pc. Here are the
contents of xt.pc:
-----------
prefix=/usr/pkg
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
appdefaultdir=/usr/pkg/lib/X11/app-defaults
Name: Xt
Description: X Toolkit Library
Version: 1.0.7
Requires: xproto x11 sm
Requires.private: x11 sm
Cflags: -I${includedir}
Libs: -L${libdir} -lXt
------------------
Perhaps if you change the contents to reflect the libXt.a from bigports,
you might get further with your build. Note that modular-xorg-server
installs in /usr/pkg, not /usr/pkg/X11R6.
I'm interested in your work so far with Mesa. It could save me some work
with modular-xorg-server, since the next dependency is MesaLib ... and
it's currently failing to build. Haven't investigated why though.
With kind regards,
Jorn van Engelen
> One thing I wonder about that is whether Arun Thomas porting something
> similar also?
I don't know whether Arun was working on modular-xorg-server. However,
the MinixRoadmap wiki page [1] says that "A port of X.org Release 7.4"
is a near-term project and that somebody is currently working on it.
[1] http://wiki.minix3.org/en/MinixRoadmap
> I combined your example of xt.pc with xcursor.pc's contents. The
> result is that when looking for Xt (pkg-config --libs xt), pkg-config
> says that it can't find and open sm.pc.
>
> I think this means that xt.pc might be working. :) But now I should
> make it so pkg-config can find libXt's dependencies also.
>
> Would you be able to show me what goes in the ".pc" files for the
> following libraries (plus maybe more), or would you know where I can
> look it up?
>
> libSM
> xproto
> libICE
Yes, of course. The contents of the files are included at the bottom. If
you need additional pkgconfig files, see:
http://ftp.quzart.com/minix/modular-xorg-server/
The files are in the pkgsrc_*.tar.bz2 tarbal.
> Thank you! There are only a few changes to make, if I understand
> things correctly:
>
> pkgsrc/graphics/Mesa/Makefile.lib: Change "-prefer-pic" to "-static"
> pkgsrc/graphics/MesaLib/files/configs/pkgsrc: Find and simply remove "-
> DUSE_XSHM"
>
>
> There's another change that might be unnecessary (it was to make sure
> things were included; pkg-config might solve this problem):
>
> pkgsrc/graphics/MesaLib/buildlink3.mk: Add ".include ..." statements
> for libXt and other X-related libraries, such as those you've ported
> and maybe others.
Thank you too!
Perhaps you haven't ran into this problem, but it took me a long time to
figure out. Outline is: order does matter when linking in static libraries.
Situation
=====
I was getting link errors with 'undefined reference too' descriptions.
No problem, I thought, just need to point the linker to the right
libraries with the -l switch. But that didn't work, this was the situation:
xkbcomp has references to libxkbfile.
libxkbfile has references to libX11.
xkbcomp got compiled with:
gcc -o xkbcomp xkbcomp.c -lX11 -llibxkbfile
but failed with 'undefined references in libxkbfile.a'.
Reason
====
These are the steps gcc takes (very simplified):
1. run the c preprocessor. Includes header files and stuff.
2. compiles xkbcomp.c into xkbcomp.o
3. 'copies' xkbcomp.o to xkbcomp.
4. searches xkbcomp for 'undefined references' and tries to find these
referenced functions in libX11.a. The found functions are 'copied' into
xkbcomp.
5. searches xkbcomp again for 'undefined references' (libX11 might have
dependencies, which form new 'undefined references') and tries to find
these referenced functions in libxkbfile.a. The found functions are
'copied' into xkbcomp.
6. make xkbcomp a runable binary.
7. fails because there are 'undefined references' in libxkbfile.a.
How come it failed? Remember that gcc first searched libX11 for
referenced functions and _then_ libxkbfile. It didn't know about
libxkbfile.a's 'references' when searching and copying from libX11.a.
The search order should thus be: first libxkbfile.a and _then_ libX11.a.
Solution
=====
So:
gcc -o xkbcomp xkbcomp.c -lxkbfile -lX11
works, but:
gcc -o xkbcomp xkbcomp.c -lX11 -lxkbfile
fails with 'undefined references in libxkbfile.a'. I think this
problem/feature only occurs with static linking, haven't encountered it
before with shared labraries.
What can be learned?
When linking, order _does_ matter.
Perhaps you already knew this. Else, it might save you hours searching
the interwebs: why doesn't foo compile when linked with all required
libraries? ... as I have searched for hours to find an answer to this
question ...
With kind regards,
Jorn van Engelen
sm.pc:
---------------
prefix=/usr/pkg
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: SM
Description: X Session Management Library
Version: 1.1.1
Requires: ice xproto
Requires.private: ice
Cflags: -I${includedir}
Libs: -L${libdir} -lSM
---------------
xproto.pc:
---------------
prefix=/usr/pkg
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
includex11dir=${prefix}/include/X11
Name: Xproto
Description: Xproto headers
Version: 7.0.16
Cflags: -I${includedir}
---------------
ice.pc:
---------------
prefix=/usr/pkg
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: ICE
Description: X Inter Client Exchange Library
Version: 1.0.6
Requires: xproto
Cflags: -I${includedir}
Libs: -L${libdir} -lICE
---------------
Telling us the version of Virtual Box you are running, and the command
line you are using to launch it.
Antoine
1. See http://wiki.minix3.org/en/UsersGuide/RunningMinixOnVirtualBox
Specifically point 7.2.
2. Once you fix the issue, please spend a moment updating the FAQ in
http://wiki.minix3.org/en/UsersGuide/RunningMinixOnVirtualBox
and
http://wiki.minix3.org/en/MinixFaq#Running_Minix_3_on_a_Virtual_Machine
so that the next person shouldn't need to ask this same question.
--
Juho Hiltunen
jhil...@ulapland.fi
+358 (0)407730352
Good move. Can you now complete the second step, and tell us the command
line?
Thanks in advance
Antoine