diff options
-rwxr-xr-x | config/auto-aux/hasgot | 8 | ||||
-rwxr-xr-x | configure | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/config/auto-aux/hasgot b/config/auto-aux/hasgot index 7ecb6e1b0..32cb4b4f0 100755 --- a/config/auto-aux/hasgot +++ b/config/auto-aux/hasgot @@ -4,9 +4,15 @@ opts="" libs="$cclibs" args=$* rm -f hasgot.c +sys_types_included="no" while : ; do case "$1" in - -i) echo "#include <$2>" >> hasgot.c; shift;; + -i) if test "$HAS_SYS_TYPES_H" = "yes" && test "$sys_types_included" = "no" + then + echo "#include <sys/types.h>" >> hasgot.c; + sys_types_included="yes"; + fi + echo "#include <$2>" >> hasgot.c; shift;; -t) echo "$2 the_$2;" >> hasgot.c; shift;; -l*|-L*) libs="$libs $1";; -*) opts="$opts $1";; @@ -429,6 +429,16 @@ fi echo '#define OCAML_OS_TYPE "Unix"' >> s.h +# If this system has <sys/types.h>, include it in all hasgot tests +# (FreeBSD 3.x requires it for many headers) + +if sh ./hasgot -i sys/types.h; then + echo "sys/types.h found." + echo "#define HAS_SYS_TYPES_H" >> s.h + HAS_SYS_TYPES_H=yes + export HAS_SYS_TYPES_H +fi + # Find a good byte move function if sh ./runtest -Dcopy=memmove -Dreverse bytecopy.c; then |