[project @ 2001-06-30 00:00:49 by sof]
[ghc-hetmet.git] / aclocal.m4
index aa3bc3f..aa8856a 100644 (file)
@@ -1,4 +1,4 @@
-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
@@ -891,7 +891,6 @@ dnl The variable LIBM (which is not an output variable by default) is
 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
@@ -979,7 +978,6 @@ dnl Please note that as the ac_opengl macro and the toy example evolves,
 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,
@@ -1066,3 +1064,22 @@ then
   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;
+])