diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-18 23:55:22 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-18 23:55:22 +0000 |
commit | d245556583b36c672ae7a2129e97fd744be90e4f (patch) | |
tree | 9fc0e6f0808aab6252b356bb1128fac96c0b3d69 | |
parent | 38da065050668604784f8bb350b3181019f29c34 (diff) | |
download | ppe42-gcc-d245556583b36c672ae7a2129e97fd744be90e4f.tar.gz ppe42-gcc-d245556583b36c672ae7a2129e97fd744be90e4f.zip |
2004-09-15 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac (AC_CHECK_HEADERS): Check for sys/mman.h.
* unix.c: Include stdio.h.
(HAVE_SYS_MMAN_H): Check.
(PROT_READ, PROT_WRITE): Provide default definitions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87714 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libgfortran/ChangeLog | 9 | ||||
-rw-r--r-- | libgfortran/config.h.in | 3 | ||||
-rwxr-xr-x | libgfortran/configure | 149 | ||||
-rw-r--r-- | libgfortran/configure.ac | 1 | ||||
-rw-r--r-- | libgfortran/io/unix.c | 10 |
5 files changed, 172 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 3d7cf8c896c..a75b1e4b6bf 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,12 @@ +2004-09-15 Aaron W. LaFramboise <aaronavay62@aaronwl.com> + + * config.h.in: Regenerate. + * configure: Regenerate. + * configure.ac (AC_CHECK_HEADERS): Check for sys/mman.h. + * unix.c: Include stdio.h. + (HAVE_SYS_MMAN_H): Check. + (PROT_READ, PROT_WRITE): Provide default definitions. + 2004-09-15 Steven G. Kargl <kargls@comcast.net> * intrincics/getcwd.c: New file. diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in index c3d0d0b53fc..937f803fd87 100644 --- a/libgfortran/config.h.in +++ b/libgfortran/config.h.in @@ -150,6 +150,9 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the <sys/mman.h> header file. */ +#undef HAVE_SYS_MMAN_H + /* Define to 1 if you have the <sys/params.h> header file. */ #undef HAVE_SYS_PARAMS_H diff --git a/libgfortran/configure b/libgfortran/configure index b1193086185..efa41ddffbd 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -6358,6 +6358,155 @@ fi done + +for ac_header in sys/mman.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------------------ ## +## Report this to the GNU Fortran Runtime Library lists. ## +## ------------------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + if test "${ac_cv_header_complex_h+set}" = set; then echo "$as_me:$LINENO: checking for complex.h" >&5 echo $ECHO_N "checking for complex.h... $ECHO_C" >&6 diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index d1cf0276cc0..fc20a570739 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -152,6 +152,7 @@ AC_TYPE_OFF_T AC_STDC_HEADERS AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h) AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h) +AC_CHECK_HEADERS(sys/mman.h) AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])]) # Check for complex math functions diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 377cadd438e..e55966b2f2a 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -28,7 +28,9 @@ Boston, MA 02111-1307, USA. */ #include <sys/stat.h> #include <fcntl.h> +#ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> +#endif #include <string.h> #include <errno.h> @@ -43,6 +45,14 @@ Boston, MA 02111-1307, USA. */ #define MAP_FAILED ((void *) -1) #endif +#ifndef PROT_READ +#define PROT_READ 1 +#endif + +#ifndef PROT_WRITE +#define PROT_WRITE 2 +#endif + /* This implementation of stream I/O is based on the paper: * * "Exploiting the advantages of mapped files for stream I/O", |