summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-10-20 19:37:29 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-10-20 19:37:29 +0000
commit78328da62d78e81be8e7147fa26e6f30545cce2a (patch)
tree6ab36b628d662355f84e999d4fe9393e9b23ed18
parentd44480b2467caeeba61be5bc0566a2c54e2bd176 (diff)
Detection of various functions and header files.
Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1073 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--lib/make/config.h.in11
-rwxr-xr-xlib/make/configure140
-rw-r--r--lib/make/configure.in13
-rw-r--r--lib/make/make.config.defn.in4
4 files changed, 166 insertions, 2 deletions
diff --git a/lib/make/config.h.in b/lib/make/config.h.in
index 03ebdc94..4b11594d 100644
--- a/lib/make/config.h.in
+++ b/lib/make/config.h.in
@@ -62,6 +62,17 @@
#undef MKDIR
#undef MKDIRFLAGS
+/* Various library functions */
+
+#undef HAVE_MKDIR
+#undef HAVE_GETTIMEOFDAY
+#undef HAVE_GETRUSAGE
+#undef HAVE__FTIME
+
+/* Some include things */
+#undef TIME_WITH_SYS_TIME
+#undef HAVE_TIME_H
+
/******************************************************************************/
#ifdef CCODE
diff --git a/lib/make/configure b/lib/make/configure
index 99352e07..a3aa205a 100755
--- a/lib/make/configure
+++ b/lib/make/configure
@@ -2186,6 +2186,139 @@ echo "$ac_t""$NULL_DEVICE" 1>&6
: ${F77FLAGS="$CFLAGS"}
+for ac_func in mkdir gettimeofday getrusage _ftime
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2193: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2198 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:2248: checking whether time.h and sys/time.h may both be included" >&5
+if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2253 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int main() {
+struct tm *tp;
+; return 0; }
+EOF
+if { (eval echo configure:2262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_time=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_time=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_time" 1>&6
+if test $ac_cv_header_time = yes; then
+ cat >> confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+for ac_hdr in sys/time.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2286: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2291 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
@@ -2362,7 +2495,7 @@ EOF
# Define how to make a directory in the config.h file
cat >> confdefs.h <<EOF
-#define MKDIR "$MKDIR "
+#define MKDIR "$MKDIR"
EOF
@@ -2466,6 +2599,10 @@ LDFLAGS="$KNOWN_LDFLAGS $LDFLAGS"
: ${GENERAL_LIBRARIES='$(LIBDIRS:%=-L%) $(LIBS:%=-l%)'}
+
+: ${PERL_BACKUP_NECESSARY=""}
+
+
trap '' 1 2 15
@@ -2657,6 +2794,7 @@ s%@F_DEPEND_OUT@%$F_DEPEND_OUT%g
s%@GET_WD@%$GET_WD%g
s%@SYS_INC_DIRS@%$SYS_INC_DIRS%g
s%@GENERAL_LIBRARIES@%$GENERAL_LIBRARIES%g
+s%@PERL_BACKUP_NECESSARY@%$PERL_BACKUP_NECESSARY%g
CEOF
EOF
diff --git a/lib/make/configure.in b/lib/make/configure.in
index b6febc29..3d7f41f4 100644
--- a/lib/make/configure.in
+++ b/lib/make/configure.in
@@ -228,6 +228,13 @@ AC_SUBST(F77FLAGS)
dnl Checks for library functions.
+AC_CHECK_FUNCS(mkdir gettimeofday getrusage _ftime)
+
+dnl Include file stuff
+
+AC_HEADER_TIME
+AC_CHECK_HEADERS(sys/time.h)
+
dnl Misc stuff
AC_SUBST(LIBDIRS)
@@ -359,7 +366,7 @@ AC_DEFINE_UNQUOTED(FMODIFIER, $FMODIFIER)
# Define how to make a directory in the config.h file
-AC_DEFINE_UNQUOTED(MKDIR, "$MKDIR ")
+AC_DEFINE_UNQUOTED(MKDIR, "$MKDIR")
AC_SUBST(MKDIRFLAGS)
@@ -457,6 +464,10 @@ AC_SUBST(SYS_INC_DIRS)
AC_SUBST(GENERAL_LIBRARIES)
: ${GENERAL_LIBRARIES='$(LIBDIRS:%=-L%) $(LIBS:%=-l%)'}
+AC_SUBST(PERL_BACKUP_NECESSARY)
+
+: ${PERL_BACKUP_NECESSARY=""}
+
dnl Run any other scripts necessary
AC_OUTPUT_COMMANDS(,$PERL -s $PERL_CONFIGURE_SCRIPT -compiler="$F77" -opts="$F77FLAGS" .)
diff --git a/lib/make/make.config.defn.in b/lib/make/make.config.defn.in
index 9a407179..11abe3c3 100644
--- a/lib/make/make.config.defn.in
+++ b/lib/make/make.config.defn.in
@@ -85,6 +85,10 @@ GENERAL_LIBRARIES = @GENERAL_LIBRARIES@
SYS_INC_DIRS += @SYS_INC_DIRS@
+# Annoying stuff for some file systems.
+
+PERL_BACKUP_NECESSARY = @PERL_BACKUP_NECESSARY@
+
# Stuff for the architecture
OS = @host_os@