OSDN Git Service

libdrm: Set _XOPEN_SOURCE and _GNU_SOURCE
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 6 Jul 2009 20:23:46 +0000 (13:23 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 6 Jul 2009 20:48:19 +0000 (13:48 -0700)
Several POSIX extensions are used in the libdrm code (e.g., mknod and ffs).
Set _XOPEN_SOURCE and _GNU_SOURCE to something reasonable to ensure that
prototypes for these functions are available.  This is done in configure.ac
using AC_USE_SYSTEM_MACROS.  This requires autoconf 2.60 or later.  Eventually
the code should check for the existance of these defines and do something
reasonable if they are not available.

Inspired by a patch by Pauli Nieminen and suggestions from Julien Cristau.
Thanks.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
configure.ac

index be2fbbf..1c20398 100644 (file)
@@ -18,7 +18,7 @@
 #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-AC_PREREQ(2.57)
+AC_PREREQ(2.60)
 AC_INIT([libdrm], 2.4.11, [dri-devel@lists.sourceforge.net], libdrm)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2])
@@ -31,6 +31,7 @@ AC_PROG_CC
 
 AC_HEADER_STDC
 AC_SYS_LARGEFILE
+AC_USE_SYSTEM_MACROS
 
 PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
 AC_SUBST(PTHREADSTUBS_CFLAGS)
@@ -145,7 +146,6 @@ if test "x$HAVE_LIBUDEV" = xyes; then
 fi
 AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
 
-
 AC_SUBST(WARN_CFLAGS)
 AC_OUTPUT([
        Makefile