aboutsummaryrefslogtreecommitdiff
path: root/sim/common/configure
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2001-03-20 17:13:39 +0000
committerFrank Ch. Eigler <fche@redhat.com>2001-03-20 17:13:39 +0000
commit764f1408a3fa9b1991e3e18d17ea857776c1503e (patch)
treef978f18906457011d87fe189fe741c1dcf1866b7 /sim/common/configure
parenta9cbbe6d3e713210dcb111b1fa2dacda55eab456 (diff)
downloadgdb-764f1408a3fa9b1991e3e18d17ea857776c1503e.zip
gdb-764f1408a3fa9b1991e3e18d17ea857776c1503e.tar.gz
gdb-764f1408a3fa9b1991e3e18d17ea857776c1503e.tar.bz2
* mmap support for common simulators
2001-03-16 Frank Ch. Eigler <fche@redhat.com> Add support for mmap-based memory regions. * sim-memopt.c (mmap_next_fd): New global. (sim_memory_init): Reinitialize it. (OPTION_MEMORY_MAPFILE, memory_option_handler): Support new "--memory-mapfile FILE" option. Check for some errors. (do_memopt_add): Conditionally do mmap instead of malloc for backing store of simulated memory. Check for more errors. (do_simopt_delete, sim_memory_uninstall): Corresponding cleanup. * sim-memopt.h (munmap_length): New member of _sim_memopt. * configure.in: Look for mmap/fstat related functions and headers. * config.in, configure: Regenerated.
Diffstat (limited to 'sim/common/configure')
-rwxr-xr-xsim/common/configure57
1 files changed, 56 insertions, 1 deletions
diff --git a/sim/common/configure b/sim/common/configure
index 8fc9d04..11c0e64 100755
--- a/sim/common/configure
+++ b/sim/common/configure
@@ -3522,7 +3522,7 @@ fi
# These aren't all needed yet, but will be eventually.
-for ac_hdr in stdlib.h string.h strings.h time.h sys/times.h
+for ac_hdr in stdlib.h string.h strings.h time.h sys/times.h sys/stat.h sys/mman.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -3562,6 +3562,61 @@ else
fi
done
+for ac_func in mmap munmap
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3569: 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 3574 "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:3597: \"$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
+
trap '' 1 2 15
cat > confcache <<\EOF