[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Detecting gated functions w/ AC_CHECK_FUNCS()
From: |
Philip Prindeville |
Subject: |
Detecting gated functions w/ AC_CHECK_FUNCS() |
Date: |
Mon, 2 May 2022 12:00:29 -0600 |
Hi,
I was wondering how to do discovery of functions like open_memstream() which is
only exposed by <features.h> when compilation used -D_GNU_SOURCE or
-D_POSIX_C_SOURCE=200809L.
It might be the case that I compile everything with a certain flag, or I might
just compile one-off modules such as:
time.o: _ASTCFLAGS+=-D_XOPEN_SOURCE=700
What's best practices for handling situations like this?
How do I bracket a particular AC_CHECK_FUNCS() invocation with defines that
might be critical?
I tried using:
save_CFLAGS="$CFLAGS"
CFLAGS="CFLAGS -D_POSIX_C_SOURCE=200809L"
AC_CHECK_FUNCS([open_memstream])
CFLAGS="$save_CFLAGS"
But this doesn't seem to make a difference.
Thanks,
-Philip
- Detecting gated functions w/ AC_CHECK_FUNCS(),
Philip Prindeville <=