aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-09-06 12:22:09 +0000
committerGerd Moellmann2000-09-06 12:22:09 +0000
commitfa0b693ce2fa8b1e5888e1becc774b875b95c414 (patch)
tree36e94d87aff622f0761d806d5c757d06ad35252b
parentb376258e9bd52016cdeaae760524fc9c408b07a4 (diff)
downloademacs-fa0b693ce2fa8b1e5888e1becc774b875b95c414.tar.gz
emacs-fa0b693ce2fa8b1e5888e1becc774b875b95c414.zip
*** empty log message ***
-rw-r--r--ChangeLog4
-rwxr-xr-xconfigure270
-rw-r--r--src/ChangeLog4
3 files changed, 276 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ffef6a2b305..d2002095210 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12000-09-06 Gerd Moellmann <gerd@gnu.org>
2
3 * configure.in (AC_FUNC_MMAP): Add.
4
12000-09-01 Gerd Moellmann <gerd@gnu.org> 52000-09-01 Gerd Moellmann <gerd@gnu.org>
2 6
3 * configure.in: Add ``checking'' messages for 7 * configure.in: Add ``checking'' messages for
diff --git a/configure b/configure
index 51f70e4b731..390be45d06f 100755
--- a/configure
+++ b/configure
@@ -8422,15 +8422,281 @@ EOF
8422 8422
8423fi 8423fi
8424 8424
8425for ac_hdr in unistd.h
8426do
8427ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8428echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8429echo "configure:8430: checking for $ac_hdr" >&5
8430if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8431 echo $ac_n "(cached) $ac_c" 1>&6
8432else
8433 cat > conftest.$ac_ext <<EOF
8434#line 8435 "configure"
8435#include "confdefs.h"
8436#include <$ac_hdr>
8437EOF
8438ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8439{ (eval echo configure:8440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8440ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8441if test -z "$ac_err"; then
8442 rm -rf conftest*
8443 eval "ac_cv_header_$ac_safe=yes"
8444else
8445 echo "$ac_err" >&5
8446 echo "configure: failed program was:" >&5
8447 cat conftest.$ac_ext >&5
8448 rm -rf conftest*
8449 eval "ac_cv_header_$ac_safe=no"
8450fi
8451rm -f conftest*
8452fi
8453if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8454 echo "$ac_t""yes" 1>&6
8455 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8456 cat >> confdefs.h <<EOF
8457#define $ac_tr_hdr 1
8458EOF
8459
8460else
8461 echo "$ac_t""no" 1>&6
8462fi
8463done
8464
8465for ac_func in getpagesize
8466do
8467echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8468echo "configure:8469: checking for $ac_func" >&5
8469if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8470 echo $ac_n "(cached) $ac_c" 1>&6
8471else
8472 cat > conftest.$ac_ext <<EOF
8473#line 8474 "configure"
8474#include "confdefs.h"
8475/* System header to define __stub macros and hopefully few prototypes,
8476 which can conflict with char $ac_func(); below. */
8477#include <assert.h>
8478/* Override any gcc2 internal prototype to avoid an error. */
8479/* We use char because int might match the return type of a gcc2
8480 builtin and then its argument prototype would still apply. */
8481char $ac_func();
8482
8483int main() {
8484
8485/* The GNU C library defines this for functions which it implements
8486 to always fail with ENOSYS. Some functions are actually named
8487 something starting with __ and the normal name is an alias. */
8488#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8489choke me
8490#else
8491$ac_func();
8492#endif
8493
8494; return 0; }
8495EOF
8496if { (eval echo configure:8497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8497 rm -rf conftest*
8498 eval "ac_cv_func_$ac_func=yes"
8499else
8500 echo "configure: failed program was:" >&5
8501 cat conftest.$ac_ext >&5
8502 rm -rf conftest*
8503 eval "ac_cv_func_$ac_func=no"
8504fi
8505rm -f conftest*
8506fi
8507
8508if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8509 echo "$ac_t""yes" 1>&6
8510 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8511 cat >> confdefs.h <<EOF
8512#define $ac_tr_func 1
8513EOF
8514
8515else
8516 echo "$ac_t""no" 1>&6
8517fi
8518done
8519
8520echo $ac_n "checking for working mmap""... $ac_c" 1>&6
8521echo "configure:8522: checking for working mmap" >&5
8522if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
8523 echo $ac_n "(cached) $ac_c" 1>&6
8524else
8525 if test "$cross_compiling" = yes; then
8526 ac_cv_func_mmap_fixed_mapped=no
8527else
8528 cat > conftest.$ac_ext <<EOF
8529#line 8530 "configure"
8530#include "confdefs.h"
8531
8532/* Thanks to Mike Haertel and Jim Avera for this test.
8533 Here is a matrix of mmap possibilities:
8534 mmap private not fixed
8535 mmap private fixed at somewhere currently unmapped
8536 mmap private fixed at somewhere already mapped
8537 mmap shared not fixed
8538 mmap shared fixed at somewhere currently unmapped
8539 mmap shared fixed at somewhere already mapped
8540 For private mappings, we should verify that changes cannot be read()
8541 back from the file, nor mmap's back from the file at a different
8542 address. (There have been systems where private was not correctly
8543 implemented like the infamous i386 svr4.0, and systems where the
8544 VM page cache was not coherent with the filesystem buffer cache
8545 like early versions of FreeBSD and possibly contemporary NetBSD.)
8546 For shared mappings, we should conversely verify that changes get
8547 propogated back to all the places they're supposed to be.
8548
8549 Grep wants private fixed already mapped.
8550 The main things grep needs to know about mmap are:
8551 * does it exist and is it safe to write into the mmap'd area
8552 * how to use it (BSD variants) */
8553#include <sys/types.h>
8554#include <fcntl.h>
8555#include <sys/mman.h>
8556
8557/* This mess was copied from the GNU getpagesize.h. */
8558#ifndef HAVE_GETPAGESIZE
8559# ifdef HAVE_UNISTD_H
8560# include <unistd.h>
8561# endif
8562
8563/* Assume that all systems that can run configure have sys/param.h. */
8564# ifndef HAVE_SYS_PARAM_H
8565# define HAVE_SYS_PARAM_H 1
8566# endif
8567
8568# ifdef _SC_PAGESIZE
8569# define getpagesize() sysconf(_SC_PAGESIZE)
8570# else /* no _SC_PAGESIZE */
8571# ifdef HAVE_SYS_PARAM_H
8572# include <sys/param.h>
8573# ifdef EXEC_PAGESIZE
8574# define getpagesize() EXEC_PAGESIZE
8575# else /* no EXEC_PAGESIZE */
8576# ifdef NBPG
8577# define getpagesize() NBPG * CLSIZE
8578# ifndef CLSIZE
8579# define CLSIZE 1
8580# endif /* no CLSIZE */
8581# else /* no NBPG */
8582# ifdef NBPC
8583# define getpagesize() NBPC
8584# else /* no NBPC */
8585# ifdef PAGESIZE
8586# define getpagesize() PAGESIZE
8587# endif /* PAGESIZE */
8588# endif /* no NBPC */
8589# endif /* no NBPG */
8590# endif /* no EXEC_PAGESIZE */
8591# else /* no HAVE_SYS_PARAM_H */
8592# define getpagesize() 8192 /* punt totally */
8593# endif /* no HAVE_SYS_PARAM_H */
8594# endif /* no _SC_PAGESIZE */
8595
8596#endif /* no HAVE_GETPAGESIZE */
8597
8598#ifdef __cplusplus
8599extern "C" { void *malloc(unsigned); }
8600#else
8601char *malloc();
8602#endif
8603
8604int
8605main()
8606{
8607 char *data, *data2, *data3;
8608 int i, pagesize;
8609 int fd;
8610
8611 pagesize = getpagesize();
8612
8613 /*
8614 * First, make a file with some known garbage in it.
8615 */
8616 data = malloc(pagesize);
8617 if (!data)
8618 exit(1);
8619 for (i = 0; i < pagesize; ++i)
8620 *(data + i) = rand();
8621 umask(0);
8622 fd = creat("conftestmmap", 0600);
8623 if (fd < 0)
8624 exit(1);
8625 if (write(fd, data, pagesize) != pagesize)
8626 exit(1);
8627 close(fd);
8628
8629 /*
8630 * Next, try to mmap the file at a fixed address which
8631 * already has something else allocated at it. If we can,
8632 * also make sure that we see the same garbage.
8633 */
8634 fd = open("conftestmmap", O_RDWR);
8635 if (fd < 0)
8636 exit(1);
8637 data2 = malloc(2 * pagesize);
8638 if (!data2)
8639 exit(1);
8640 data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
8641 if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
8642 MAP_PRIVATE | MAP_FIXED, fd, 0L))
8643 exit(1);
8644 for (i = 0; i < pagesize; ++i)
8645 if (*(data + i) != *(data2 + i))
8646 exit(1);
8647
8648 /*
8649 * Finally, make sure that changes to the mapped area
8650 * do not percolate back to the file as seen by read().
8651 * (This is a bug on some variants of i386 svr4.0.)
8652 */
8653 for (i = 0; i < pagesize; ++i)
8654 *(data2 + i) = *(data2 + i) + 1;
8655 data3 = malloc(pagesize);
8656 if (!data3)
8657 exit(1);
8658 if (read(fd, data3, pagesize) != pagesize)
8659 exit(1);
8660 for (i = 0; i < pagesize; ++i)
8661 if (*(data + i) != *(data3 + i))
8662 exit(1);
8663 close(fd);
8664 unlink("conftestmmap");
8665 exit(0);
8666}
8667
8668EOF
8669if { (eval echo configure:8670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8670then
8671 ac_cv_func_mmap_fixed_mapped=yes
8672else
8673 echo "configure: failed program was:" >&5
8674 cat conftest.$ac_ext >&5
8675 rm -fr conftest*
8676 ac_cv_func_mmap_fixed_mapped=no
8677fi
8678rm -fr conftest*
8679fi
8680
8681fi
8682
8683echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
8684if test $ac_cv_func_mmap_fixed_mapped = yes; then
8685 cat >> confdefs.h <<\EOF
8686#define HAVE_MMAP 1
8687EOF
8688
8689fi
8690
8425 8691
8426# Fixme: This should be replaced when we have autoconf 2.14. 8692# Fixme: This should be replaced when we have autoconf 2.14.
8427echo $ac_n "checking for size_t""... $ac_c" 1>&6 8693echo $ac_n "checking for size_t""... $ac_c" 1>&6
8428echo "configure:8429: checking for size_t" >&5 8694echo "configure:8695: checking for size_t" >&5
8429if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then 8695if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
8430 echo $ac_n "(cached) $ac_c" 1>&6 8696 echo $ac_n "(cached) $ac_c" 1>&6
8431else 8697else
8432 cat > conftest.$ac_ext <<EOF 8698 cat > conftest.$ac_ext <<EOF
8433#line 8434 "configure" 8699#line 8700 "configure"
8434#include "confdefs.h" 8700#include "confdefs.h"
8435#include <sys/types.h> 8701#include <sys/types.h>
8436#if STDC_HEADERS 8702#if STDC_HEADERS
diff --git a/src/ChangeLog b/src/ChangeLog
index c97898e70d7..beb4f6350d6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12000-09-06 Gerd Moellmann <gerd@gnu.org>
2
3 * config.in (HAVE_MMAP): Add #undef.
4
12000-09-05 Gerd Moellmann <gerd@gnu.org> 52000-09-05 Gerd Moellmann <gerd@gnu.org>
2 6
3 * frame.c (Qdisplay_type): New variable. 7 * frame.c (Qdisplay_type): New variable.