From 25a2779b00f20c67c57fbe41efad551a6c1e9d4f Mon Sep 17 00:00:00 2001 From: dtucker Date: Mon, 18 Sep 2006 13:17:40 +0000 Subject: [PATCH] - (dtucker) [configure.ac] On AIX, check to see if the compiler will allow macro redefinitions, and if not, remove "-qlanglvl=ansi" from the flags. Allows build out of the box with older VAC and XLC compilers. Found by David Bronder and Bernhard Simon. --- ChangeLog | 6 ++++++ configure.ac | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2973498f..c1de453a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +20060918 + - (dtucker) [configure.ac] On AIX, check to see if the compiler will allow + macro redefinitions, and if not, remove "-qlanglvl=ansi" from the flags. + Allows build out of the box with older VAC and XLC compilers. Found by + David Bronder and Bernhard Simon. + 20060916 - OpenBSD CVS Sync - djm@cvs.openbsd.org 2006/09/16 19:53:37 diff --git a/configure.ac b/configure.ac index 365eac46..af92560e 100644 --- a/configure.ac +++ b/configure.ac @@ -134,6 +134,27 @@ SPC_MSG="no" # Check for some target-specific stuff case "$host" in *-*-aix*) + # Some versions of VAC won't allow macro redefinitions at + # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that + # particularly with older versions of vac or xlc. + # It also throws errors about null macro argments, but these are + # not fatal. + AC_MSG_CHECKING(if compiler allows macro redefinitions) + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ +#define testmacro foo +#define testmacro bar +int main(void) { exit(0); } + ]])], + [ AC_MSG_RESULT(yes) ], + [ AC_MSG_RESULT(no) + CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" + LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" + CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" + CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`" + ] + ) + AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) if (test -z "$blibpath"); then blibpath="/usr/lib:/lib" -- 2.45.2