need to define _ISOC99_SOURCE
Bruno Haible
haible@ilog.fr
Mon Jul 31 08:42:00 GMT 2000
Akim Demaille writes:
>
> Here is a proto patch. I send it mainly because I think we can
> simplify the approach in Autoconf a lot: my proposal always defines
> _GNU_SOURCE and _ALL_SOURCE,
And _HPUX_SOURCE ? I'd like to compile GNU packages with "cc -Aa"
instead of "cc -Aa -D_HPUX_SOURCE" on HP-UX.
> Also, I used a protected form for both (with ifndef guards). I don't
> think it is useful as config.h is expected to be the first file
> included.
It is useful because _GNU_SOURCE (or _ALL_SOURCE or _HPUX_SOURCE) may
already be present in the CFLAGS the user has set.
> I am also tempted to define unconditionally these symbols:
>
> #define _POSIX_SOURCE 1
> #define _POSIX_1_SOURCE 2
>
> since they cover those two macros:
>
> | # AC_MINIX
_POSIX_SOURCE may be ok for MINIX, but on other platforms is causes
more harm than good. On Solaris, _POSIX_SOURCE causes lots of APIs to
be *not* declared.
> | # AC_ISC_POSIX
> | # ------------
> | AC_DEFUN([AC_ISC_POSIX],
> | [AC_REQUIRE([AC_PROG_CC])dnl
> | AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
> | AC_BEFORE([$0], [AC_TRY_RUN])dnl
> | AC_MSG_CHECKING(for POSIXized ISC)
> | if test -d /etc/conf/kconfig.d &&
> | grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
> | then
> | AC_MSG_RESULT(yes)
> | ISC=yes # If later tests want to check for ISC.
> | AC_DEFINE(_POSIX_SOURCE, 1,
> | [Define if you need to in order for stat and other things to
> | work.])
> | if test "$GCC" = yes; then
> | CC="$CC -posix"
> | else
> | CC="$CC -Xp"
> | fi
> | else
> | AC_MSG_RESULT(no)
> | ISC=
> | fi
> | ])# AC_ISC_POSIX
Btw, gettext snapshots have a different test:
AC_DEFUN(AC_ISC_POSIX,
[AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])]
)
I can't give details on what this "cposix" library is meant to
contain.
Bruno
More information about the Libc-alpha
mailing list