Hi!

Am Samstag, 10.01.04 um 21:28 Uhr schrieb Warren Turkal:

You could just install X11 somewhere on your system, make a copy of
xmkmf, imake and its configuration, edit the config files according to
your needs and compile the X11 programs using your new configuration.
No changes should be needed anywhere inside of the X11 application
directories.

As a starting point you could pick up xlogo or xlock and compile them
stand alone. just type

Well, how do I do that and easily make them link against my libs?

First you need to understand, how the imake system and the configuration used by X11 works. In principle, imake uses cpp to process a small file, which mostly consists of #include directives. The result is stored as Makefile.


The Imakefile does mainly contain macro calls to macros defined in the imake configuration files. These macros often expand to one or even more make rules.

Here are some line from xclocks Imakefile:

        DEPLIBS = $(XRENDERDEPS) XkbClientDepLibs XawClientDepLibs
LOCAL_LIBRARIES = $(XRENDERLIBS) XkbClientLibs XawClientLibs
           SRCS = xclock.c Clock.c
           OBJS = xclock.o Clock.o
        HEADERS = ClockP.h Clock.h
       INCLUDES = $(XRENDERINCS)
        DEFINES = $(XRENDERDEFS) XkbClientDefines

ComplexProgramTarget(xclock)
InstallAppDefaults(XClock)
InstallAppDefaultsLong(XClk-col,XClock-color)

DEPLIBS is used for dependancies:


xclock: ..... $(DEPLIBS)

LOCAL_LIBRARIES is used during linking:

$(CC) ...... xclock.o .... -o xlock ... $(LOCAL_LIBRARIES)

The definition of LOCAL_LIBRARIES does contain two macro calls: XkbClientLibs and XawClientLibs. They deliver the flags needed to link these libs. This could be as simple as -lX11 but deliver more complex values like -L/where/some/lib/is -lX11 -lOtherLibX11DependsUpon

You need to change the imake configuration files to create Makefiles, that use your new libs instead of the X11 ones.

To get things running, you should first copy stuff like xmkmf, imake, makedepend (or whatever utility to generate dependencies X11 has used),.. to a new tree. xmkmf is just a shell script. It does contain the path to the imake config files. Copy this directory to the new tree, too and edit xmkmf accordingly.

Now, you should be able to use xmkmf to create a Makefile, but it still will reference the existing X11R6 installation. But you can change yourt copy of the config files so that your new libs are used. X11.tmpl probably is a good starting point. BTW, there is a README in xc/config/cf.

Can I do this for the entire tree?

Of course, when its done properly. The entire tree uses Imakefiles, so if you got your configurations right, it should work.


So, now can I stop libX11 from compiling in the XF86 tree and force the tree
to use an external libX11?

Of course you can. Not compiling libX11 can simply be done by changing xc/lib/Imakefile. Just remove Xlibs subdir from the list. I just took a look into that makefile. the Xlib already is conditiojnal in there, so it can be left out by just #define-ing BuildX11Lib to 0. But you still have to change imakes configuration.


I am not only trying to use your Xlib with a new build system. We have a
prototype of the XCB/XCL implementation that I would like to use during the
build process. We have it building fine with autotools. How can I make the
XF86 tree use this?

Configure imake to create Makefiles, that use your lib. Oh, don't forget to make it pointing the compiler to your set of include files, too,


Do you have the imake build system? X11 applications generally have an
Imakefile, so you must have xmkmf, imake and the config files to build
it.

The only X11 apps that I know of that use imake are the ones that come with
XF86.

I know much more. E.g. take a look at http://www.ms.mff.cuni.cz/~beran/vyuka/X/prog/oreilly/xlib/ This is the location of the sample code for the O'Reilly and Associates' Xlib Programming Manual. They all do have Imakefiles and although they include Makefiles, these Makefiles are system dependent and you need the imake system to build these programs.


Dozens of other examples for Imakefiles can be found in the contributions. Almost every classical X11 application uses Imakefiles.

If you want X11 applications to use your libraries, you have to support Imakefiles.

KDE, Gnome, and <most oss projects> use autotools.

Most of them only use libX11.


73, Mario
--
Mario Klebsch                                      [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to