patches for xerces on GNU/kFreeBSD (fwd)

Robert Millan rmh at aybabtu.com
Mon Oct 24 16:32:54 UTC 2005


On Mon, Oct 24, 2005 at 02:23:39PM +0200, Petr Salinger wrote:
> 
> Yes, you are right, but I just followed upstream style 
> for multi-platform support in xerces 2.x series: 
> 
> $ ls xerces-c-src_2_6_0/src/xercesc/util/Platforms
> AIX  BeOS  Cygwin  FreeBSD  HPUX  IRIX  Interix  Linux  MacOS  Makefile.in  
> NetBSD  OS2  OS390  OS400  OpenServer  PTX  QNX  Solaris  Tandem  Tru64  UnixWare  Win32

There are many packages whose upstream does this, but it's bogus.  It worked
well for stand-alone systems that are mostly different one from each other, but
for hybrids based on Glibc and GNUish/etc userland, most of the system is the
same.

Since this program doesn't (apparently) need to interact with kernel-specific
interfaces, it can probably be ported with just changing a pair of lines.

For example, postgresql was ported with only changing one line:

  http://glibc-bsd.alioth.debian.org/patches/debian-only/postgresql.bash

  (this kind of change is quite typical, you can browse the directory for more)

> > -                sh runConfigure -plinux -cgcc -xg++ -minmem -ticu \
> > 
> > Is that "linux" case really linux-specific?  Or just dependant on GNUish
> > userland stuff like Glibc?  If it's the latter, you can probably port xerces
> > by just changing a pair of lines in that file.
> 
> It is mainly glibc userland, but
>  
> * the platform argument (-plinux) from runConfigure is not passed to ./configure.

I don't think passing -plinux harms.  Does it break something?

> * Platforms/Linux/LinuxDefs.hpp defines LINUX

Same here.

> * util/AutoSense.hpp depends directly  on __linux__ 

Does AutoSense.hpp depend on Linux-specific stuff?  It's a common mistake to
depend on Glibc-specific stuff and use __linux__ to conditionalise that.

> But the problem of code unsynchronisation can be partially addressed:
> * Linux/LinuxPlatformUtils.cpp will include <sys/param.h> instead of <linux/limits.h>
> * KFreeBSD/KFreeBSDPlatformUtils.cpp then can be changed into #include "../Linux/LinuxPlatformUtils.cpp"

Sounds good.  For the latter, perhaps it's not needed if you keep "-plinux"
flag.  In any case, if you copy code in a new place, then maintainers of this
package (who probably don't use GNU/kFreeBSD ;) won't bother to update it when
something changes, and the package will eventualy break.  I've seen this
happening before and it's a mess.

> The multi-platform support in future xerces 3.x series is reworked and 
> snapshot xerces-c_20051021105601 builds fine without patching.
> May be etch will be release with xerces 3.x only.

Ah, well.  Then maybe it's not worth overengineering a solution if all this code
will be dumped later.  Anyway, I hope my comments are useful to you if you port
something else.

-- 
Robert Millan



More information about the Glibc-bsd-devel mailing list