|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
BSD >= 199306Hi all. I maintain a package (prayer) that doesn't use autotools and instead
detects BSD with: #include <sys/param.h> #if (defined(BSD) && BSD >= 199306) Googling around, this seems pretty standard and recommended procedure, but apparently it doesn't work on Debian GNU/*BSD. So how should I do? Please CC me when replying. -- Magnus Holmgren holmgren@... Debian Developer |
|
|
Re: BSD >= 199306> Hi all. I maintain a package (prayer) that doesn't use autotools and instead
> detects BSD with: > > #include <sys/param.h> > #if (defined(BSD) && BSD >= 199306) > > Googling around, this seems pretty standard and recommended procedure, but > apparently it doesn't work on Debian GNU/*BSD. So how should I do? It depends on what you really want to test. The kernel variant (FreeBSD) is signaled by __FreeBSD_kernel__ and libc variant (glibc) by __GLIBC__. You can take a look at http://io.debian.net/ssh.html and test directly on GNU/kFreeBSD whether your package is dependent on kernel or libc environment. In the worst case, it would be a mixture :-( Petr -- To UNSUBSCRIBE, email to debian-bsd-REQUEST@... with a subject of "unsubscribe". Trouble? Contact listmaster@... |
|
|
|
|
|
Re: BSD >= 199306On onsdagen den 25 juni 2008, Petr Salinger wrote:
> > Hi all. I maintain a package (prayer) that doesn't use autotools and > > instead detects BSD with: > > > > #include <sys/param.h> > > #if (defined(BSD) && BSD >= 199306) > > > > Googling around, this seems pretty standard and recommended procedure, > > but apparently it doesn't work on Debian GNU/*BSD. So how should I do? > > It depends on what you really want to test. > The kernel variant (FreeBSD) is signaled by __FreeBSD_kernel__ > and libc variant (glibc) by __GLIBC__. -- Magnus Holmgren holmgren@... Debian Developer (Not subscribed to this list) |
|
|
Re: BSD >= 199306Magnus Holmgren dixit:
>What about OpenBSD? OpenBSD only defines __OpenBSD__ in gcc, therefore you can use #if defined(__OpenBSD__) && !defined(__MirBSD__) to test (as MirBSD defines both __OpenBSD__ and __MirBSD__ in gcc and pcc). There’s also <sys/param.h> which has OpenBSD in OpenBSD but not in MirBSD, and MirBSD only in the latter. Note that MidnightBSD currently defines exactly the same things as FreeBSD (in gcc), but will _add_ a __MidnightBSD__ macro soo- nish (and already does that in pcc), but keep the FBSD ones too. You probably want to add … && !defined(__GLIBC__) to the test mentioned above then. //mirabilos -- Sometimes they [people] care too much: pretty printers [and syntax highligh- ting, d.A.] mechanically produce pretty output that accentuates irrelevant detail in the program, which is as sensible as putting all the prepositions in English text in bold font. -- Rob Pike in "Notes on Programming in C" -- To UNSUBSCRIBE, email to debian-bsd-REQUEST@... with a subject of "unsubscribe". Trouble? Contact listmaster@... |
|
|
Re: BSD >= 199306>> It depends on what you really want to test.
>> The kernel variant (FreeBSD) is signaled by __FreeBSD_kernel__ >> and libc variant (glibc) by __GLIBC__. > > What about OpenBSD? I have just looked into source of prayer, the main difference between linux and bsd are 1) os_limit_vm(), os_prctl_set_dumpable() they are no-op on BSD, so it is easy to guard them via __linux__ 2) os_run_pty() on linux, there are available two variants - bsd one and sysv one. once again, it is easy to guard sysv one by __linux__ The difference between linux and solaris is also small, on solaris is different locking and there is only one variant for os_run_pty(), the sysv one. The remaining differences are slightly different include files, nonexistent socklen_t and ipv6 support on solaris. IMHO, it would be much better to merge all three files into one and use sensible defaults, i.e. * IPV6 is supported * socklen_t is supported * os_limit_vm() and os_prctl_set_dumpable() are no-op by default * use BSD PTY * flock() does exist and create exception for the above based on __linux__, __svr4__ and SOLARIS macros. Petr -- To UNSUBSCRIBE, email to debian-bsd-REQUEST@... with a subject of "unsubscribe". Trouble? Contact listmaster@... |
| Free Forum Powered by Nabble | Forum Help |