-dnl $Id: aclocal.m4,v 1.73 2001/05/27 05:00:08 sof Exp $
+dnl $Id: aclocal.m4,v 1.77 2001/06/30 00:00:49 sof Exp $
dnl
dnl Extra autoconf macros for the Glasgow fptools
dnl
dnl set to a value which is suitable for use in a Makefile (for example,
dnl in make's LOADLIBES macro) provided you AC_SUBST it first.
dnl
-dnl @version 0.01 $Id: aclocal.m4,v 1.73 2001/05/27 05:00:08 sof Exp $
dnl @author Matthew D. Langston <langston@SLAC.Stanford.EDU>
# FPTOOLS_CHECK_LIBM - check for math library
dnl the version number increases, so you may have to adjust the above
dnl URL accordingly.
dnl
-dnl @version 0.01 $Id: aclocal.m4,v 1.73 2001/05/27 05:00:08 sof Exp $
dnl @author Matthew D. Langston <langston@SLAC.Stanford.EDU>
AC_DEFUN(FPTOOLS_HAVE_OPENGL,
test -z "$LEX" && AC_MSG_ERROR(['lex' or 'flex' is required to compile GHC.])
fi
])
+
+dnl
+dnl Check to see whether CC (gcc) supports a particular option.
+dnl
+AC_DEFUN(FPTOOLS_CC_FLAG,
+[save_CFLAGS="$CFLAGS"
+AC_CACHE_CHECK([whether $CC accepts $1], [ac_cv_cc_$2],
+[CFLAGS="$CFLAGS $1"
+ AC_LANG_C
+ AC_TRY_COMPILE(,[int main(){return(0);}],
+ [ac_cv_cc_$2=yes],
+ [ac_cv_cc_$2=no])
+])
+if test "$ac_cv_cc_$2"x = "yesx"; then
+ $2=$extra_flag;
+else
+ $2=$extra_flag;
+fi;
+])