Bug#545948: ptlib: FTBFS on GNU/kFreeBSD
Craig Southeren
craigs at postincrement.com
Fri Sep 11 06:26:23 UTC 2009
Petr Salinger wrote:
> Hello.
>
>> Eugen passed on your patches to me to be applied to PTLib, however I
>> have
>> some concerns about them.
>>
>> Now, I had fairly recently received some patches for FreeBSD that had
>> presumably fixed PTLib to compile for him on his particular flavour of
>> FreeBSD.
>>
>> Now you are asking me to add things like:
>>
>> +#if defined (__GLIBC__)
>> +#define PSETPGRP() setpgrp()
>> +#else
>> #define PSETPGRP() setpgrp(0, 0)
>> +#endif
>>
>> Which, if I am reading it correctly, will change the code the other
>> gentleman had used simply if the GNU compiler is used. Now maybe I am
>> wrong,
>> but I would be VERY surprised if he was NOT using the GNU compiler. As
>> far
>> as I am aware the GNU compiler is used by all open source operating
>> systems,
>> the only people that don't are commercial entities like Sun or Microsoft.
>>
>> I have never really used any flavour of FreeBSD so I don't know if all
>> this
>> if fine, but it just doesn't look right to me. I am unwilling to make
>> patches that I am fairly sure will break someone else's compile.
>>
>> If FreeBSD and kFreeBSD are sufficiently different they should
>> probably have
>> a different define P_KFREEBSD for example.
>
> They have same kernel (FreeBSD), same compiler (gcc),
> but different userspace C library (native FreeBSD/GLIBC).
>
> The __GLIBC__ signals used C-library, not compiler,
> the compiler defines __GNUC__.
>
> Therefore these changes will not break previous build on plain FreeBSD.
> From ptlib view, there are only 2 differences.
>
> 1) macro PSETPGRP
> 2) location of SDL.h
>
> The third change is fix of creating shared libraries,
> otherwise the P_SHAREDLIB is not honored at all.
>
> To reduce differences, it is possible to use on both systems
> #define PSETPGRP() setpgid(0, 0)
> http://www.opengroup.org/onlinepubs/9699919799/functions/setpgid.html
> http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/compat-43/setpgrp.c
These kind of problems should be addressed by writing a configure test
that sets a #define flag, not by relying on various symbols that may, or
may not, be defined by the run-time library.
Craig
More information about the Pkg-voip-maintainers
mailing list