[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libcdio-devel] How to handle getopt.c for those systems that don't
From: |
Steven M. Schultz |
Subject: |
Re: [Libcdio-devel] How to handle getopt.c for those systems that don't have... |
Date: |
Tue, 4 Oct 2005 19:47:48 -0700 (PDT) |
On Tue, 4 Oct 2005, R. Bernstein wrote:
> J. Creath noted that the libcdio configure test is actually for GNU
> getopt, which has slightly different (irrelevant) behavior than
> standard getopt.
Right - which is why there is 'libgnugetopt' in the FreeBSD ports.
Couple project I've dealt with over the years have just used that
for BSD systems.
> And he notes that FreeBSD 4.9 and earlier doesn't keep the information
> in <getopt.h>, but in <unistd.h>.
Sigh, but yep.
> So in src/util.h, instead of
>
> #include <popt.h>
>
> one might have:
>
> #if defined(__FreeBSD__)
> #if (OSVERSION > 500000)
> #include "getopt.h"
> #else
> #include "unistd.h"
> #endif
AC_CHECK_HEADER(unistd.h,getopt.h)
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
and avoid specific version checking.
> Any comments?
Or just put libpopt back (duck and run for cover ;))
Cheers,
Steven Schultz