Quick fix for gdm -2.16.5 (was: Re: gdm build fails)

petr.snyder at yahoo.co.uk petr.snyder at yahoo.co.uk
Fri Mar 9 04:02:35 PST 2007


Building gdm-2.16.5 always stops at line 544 of keymouselistener.c (at least if Fink's XDarwin (the xorg-version) is installed).

In function 'event_time':
keymouselistener.c:544: error: 'XDeviceKeyEvent' undeclared (first use in this function)

Now I've found a fix for the gdm-port, necessary if Fink's xorg-X11 is installed. I've no idea whether this will be useful, if Apple's X11 is installed.

First I looked at keymouselistener.c itself. My little understanding of C tell me that X11's XInput.h will not be included, if HAVE_XINPUT isn't set. That will stop everything, if "XDeviceKeyEvent" is declared in XInput.h (it is).

40 #ifdef HAVE_XINPUT
41 #include <X11/extensions/XInput.h>
42 #endif

Now, HAVE_XINPUT isn't set, because the configure-skript fails to find XInput.h, though it's present in /usr/X11R6/include/X11/extensions, while it's good at finding some other extensions (e.g. Xinerama). Strange ...

When testing X11-extensions (e.g. Xinerama, DMX), the configure-skripts temporarily expands the compiler-options, as shown here for the Xinerama-extension

31980 xinerama_save_cppflags="$CPPFLAGS"

X_CFLAGS is set to "-I/usr/X11R6/include", which is necessary if later on configure calls gcc, which then has to find "X11/extensions/xinerama.h in order to successfully perform the test.

Before the Xinput.h-stuff is run, the CPPFLAGS are *not* modified, so gcc complains 

configure:31838: gcc -c -g -O2 -Wall -Wmissing-prototypes   conftest.c >&5
conftest.c:70:35: error: X11/extensions/XInput.h: No such file or directory

and HAVE_XINPUT isn't set. 

I thought about editing the configure-script, according to the examples given by the Xinerama- or dmext.h-check etc., and stuffing everything into a new gdm.tar.bz2, replacing the original one in distfiles.

Right now I have just expanded the CPPFLAGS-environment-variable in the gdm-Portfile. 

CPPFLAGS="-I${prefix}/include -L${prefix}/lib -I/usr/X11R6/include"

Gcc now always uses "-I/usr/X11R6/include", whether necessary or not, 
sometimes twice, makes the configure-script happy (it finds Xinput.h), and keymouselistener.c and the gdm-port is built correctly. I don't know if that's a good idea, but it works.

Best Regards,

----- Original Message ----
From: Randall Wood <rhwood at mac.com>
To: Peter Schneider <petr.snyder at yahoo.co.uk>
Cc: macports-users at lists.macosforge.org
Sent: Wednesday, 7 March, 2007 3:30:08 AM
Subject: Re: gdm build fails

I have only tested building gdm with Apple's X11, not with the x.org  
server installed from fink.

gdm allows you to login multiple times as different users into the X  
server, although there a couple of manual steps required to do so.

On 6 Mar 2007, at 16:46, Peter Schneider wrote:

> -I/opt/local/include/glib-2.0
> -I/opt/local/lib/glib-2.0/include -I/opt/local/include
> -I/opt/local/include/freetype2
> -I/opt/local/include/libpng12 -I/usr/X11R6/include
> -I/opt/local/include/libglade-2.0

Randall Wood
rhwood at mac.com

"The rules are simple: The ball is round. The game lasts 90 minutes.  
All the
rest is just philosophy."

Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. http://uk.docs.yahoo.com/trueswitch2.html

More information about the macports-users mailing list