patches for proto, libs and apps on BSD systems
Matthieu Herrb
matthieu.herrb at laas.fr
Tue Jul 26 05:36:26 EST 2005
Keith Packard wrote:
> On Sun, 2005-07-24 at 19:43 +0200, Matthieu Herrb wrote:
>
>>Hi,
>>
>>with the attached patch the modular proto, libs and apps parts of the
>>modular tree builds and mostly works on OpenBSD. There are still a few
>>rought edges, but I think they are pretty minor. I'd like to have some
>>comments of the people who did the most of the modularization work
>>before committing this. It consists of the following elements:
>>
>>- define a new autoconf test, AC_CSRG_BASED, which will define
>>CSRG_BASED for BSD systems in config.h. The current imake configuration
>>adds -DCSRG_BASED to StandardDefines for those systems and this macro is
>>used to activate BSD specific behaviour in various places in the
>>sources. I've also added this check to the configure.ac files where it's
>>needed. There are still some of them missing, but I've not been able to
>>fully test every application to spot them.
>
>
> I'm wondering how many of these behaviours can be autodetected instead
> of prescribed. For instance,
>
> +if CSRG_BASED
> +xconsole_LDADD += -lutil
> +endif
> +
>
> This should be done based on symbols needed that appear in libutil, not
> based on knowledge that this library is needed on CSRG systems.
>
> Your example:
>
> +AC_CHECK_LIB(c, getpwuid_r, [mtsafeapi="yes"], [mtsafeapi="no"])
> +
>
> is exactly the kind of test that should be used above.
>
> If you could describe what -lutil is needed for, then we can probably
> figure out a suitable autoconf test for that.
>
> Thanks much for getting this working.
I agree 100% with what you said. But this means starting to unwind the
maze of ifdefs in various places in the source tree where #ifdef
CSRG_BASED is used. I had the impression that, in the Karlsruhe meeting,
Daniel was saying that this will be done after the initial release.
For other systems (Linux, SVR4) there are also quite a lot of #ifdef in
the source. The only difference is that those macros are cpp builtins on
those systems. Iirc, the CSRG_BASED macro was invented by X.Org for
X11R6 to replace 'defined(__bsdi__) || defined(__FreeBSD__) ||
defined(__NetBSD__)' constructs in XFree86 2.1.1.
So using this CSRG_BASED macro looks as the least intrusive way to have
something working for 7.0. I can start unwinding the macros in the
source, but given the amount of testing it will require, I fear it will
take too much time to be ready in time.
--
Matthieu Herrb
More information about the xorg-modular
mailing list