diff options
author | neroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-03 20:33:23 +0000 |
---|---|---|
committer | neroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-03 20:33:23 +0000 |
commit | b0b8d1803b005ed131387ea9a9880757cd2b4b77 (patch) | |
tree | 5d0b79312956dbb5c464f4a1d69e27b0ec2f6ebe | |
parent | 561866edc1ae53c842df6c6338336e7d4cc4fe1b (diff) | |
download | gcc-b0b8d1803b005ed131387ea9a9880757cd2b4b77.tar.gz |
2004-07-30 Maciej W. Rozycki <macro@linux-mips.org>
* aclocal.m4 (gcc_AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
and mmap() explicitly instead of relying on preset autoconf cache
variables.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85498 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/aclocal.m4 | 8 | ||||
-rwxr-xr-x | gcc/configure | 148 |
3 files changed, 160 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ac4825fce5..4c306f4e356 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-07-30 Maciej W. Rozycki <macro@linux-mips.org> + + * aclocal.m4 (gcc_AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h> + and mmap() explicitly instead of relying on preset autoconf cache + variables. + * configure: Regenerate. + 2004-08-03 H.J. Lu <hongjiu.lu@intel.com> PR target/16570 @@ -21,6 +28,7 @@ * config/i386/gmm_malloc.h: New file. +>>>>>>> 2.4781 2004-08-03 Dale Johannesen <dalej@apple.com> * config/rs6000/rs6000.c (machopic_output_stub): Align Darwin stubs. diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index c5c71caa31a..6f1679e009a 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -269,8 +269,12 @@ AC_SUBST($1)dnl # mmap(2) blacklisting. Some platforms provide the mmap library routine # but don't support all of the features we need from it. AC_DEFUN([gcc_AC_FUNC_MMAP_BLACKLIST], -[if test $ac_cv_header_sys_mman_h != yes \ - || test $ac_cv_func_mmap != yes; then +[ +AC_CHECK_HEADER([sys/mman.h], + [gcc_header_sys_mman_h=yes], [gcc_header_sys_mman_h=no]) +AC_CHECK_FUNC([mmap], [gcc_func_mmap=yes], [gcc_func_mmap=no]) +if test "$gcc_header_sys_mman_h" != yes \ + || test "$gcc_func_mmap" != yes; then gcc_cv_func_mmap_file=no gcc_cv_func_mmap_dev_zero=no gcc_cv_func_mmap_anon=no diff --git a/gcc/configure b/gcc/configure index f32b8af211f..af7056d9528 100755 --- a/gcc/configure +++ b/gcc/configure @@ -7265,8 +7265,152 @@ _ACEOF fi -if test $ac_cv_header_sys_mman_h != yes \ - || test $ac_cv_func_mmap != yes; then + +echo "$as_me:$LINENO: checking for sys/mman.h" >&5 +echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_mman_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/mman.h> +_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_cv_header_sys_mman_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_sys_mman_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 +if test $ac_cv_header_sys_mman_h = yes; then + gcc_header_sys_mman_h=yes +else + gcc_header_sys_mman_h=no +fi + +echo "$as_me:$LINENO: checking for mmap" >&5 +echo $ECHO_N "checking for mmap... $ECHO_C" >&6 +if test "${ac_cv_func_mmap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mmap to an innocuous variant, in case <limits.h> declares mmap. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define mmap innocuous_mmap + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mmap (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef mmap + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mmap (); +/* 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_mmap) || defined (__stub___mmap) +choke me +#else +char (*f) () = mmap; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mmap; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 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_exeext' + { (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_cv_func_mmap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mmap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5 +echo "${ECHO_T}$ac_cv_func_mmap" >&6 +if test $ac_cv_func_mmap = yes; then + gcc_func_mmap=yes +else + gcc_func_mmap=no +fi + +if test "$gcc_header_sys_mman_h" != yes \ + || test "$gcc_func_mmap" != yes; then gcc_cv_func_mmap_file=no gcc_cv_func_mmap_dev_zero=no gcc_cv_func_mmap_anon=no |