diff options
author | Manfred Hollstein <manfred@gcc.gnu.org> | 1998-05-21 07:52:41 +0000 |
---|---|---|
committer | Manfred Hollstein <manfred@gcc.gnu.org> | 1998-05-21 07:52:41 +0000 |
commit | b9256371fa7d10f7f401a68820fdcbe38c78885e (patch) | |
tree | 1171f46d2f27ceab4a009d3956976bac047427ec | |
parent | 3fe97d74adf47f126ba3c19e633826eeb95c2662 (diff) | |
download | gcc-b9256371fa7d10f7f401a68820fdcbe38c78885e.zip gcc-b9256371fa7d10f7f401a68820fdcbe38c78885e.tar.gz gcc-b9256371fa7d10f7f401a68820fdcbe38c78885e.tar.bz2 |
configure.in: Check for unistd.h as well.
0
* configure.in: Check for unistd.h as well.
* configure: Rebuild.
* config.in: Rebuild.
* getpagesize.c (GNU_OUR_PAGESIZE): Use sysconf only if _SC_PAGESIZE
is defined in unistd.h. Reformat conditional block for easier reading.
* config.table (shared): Default to no if ${enable_shared}
is unset or empty; this logic is used by the toplevel
configure scripts, too.
From-SVN: r19924
-rw-r--r-- | libiberty/config.in | 3 | ||||
-rwxr-xr-x | libiberty/configure | 2 | ||||
-rw-r--r-- | libiberty/getpagesize.c | 51 |
3 files changed, 32 insertions, 24 deletions
diff --git a/libiberty/config.in b/libiberty/config.in index 5ef47b0..4195348 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -186,3 +186,6 @@ /* Define if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H diff --git a/libiberty/configure b/libiberty/configure index d8ed85a..4b4dee5 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1019,7 +1019,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in sys/file.h sys/param.h stdlib.h string.h +for ac_hdr in sys/file.h sys/param.h stdlib.h string.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff --git a/libiberty/getpagesize.c b/libiberty/getpagesize.c index d6327a8..564d6c0 100644 --- a/libiberty/getpagesize.c +++ b/libiberty/getpagesize.c @@ -35,31 +35,36 @@ BUGS #include <sys/param.h> #endif -#ifdef HAVE_SYSCONF +#undef GNU_OUR_PAGESIZE +#if defined (HAVE_SYSCONF) && defined (HAVE_UNISTD_H) #include <unistd.h> +#ifdef _SC_PAGESIZE #define GNU_OUR_PAGESIZE sysconf(_SC_PAGESIZE) -#else -#ifdef PAGESIZE -#define GNU_OUR_PAGESIZE PAGESIZE -#else /* no PAGESIZE */ -#ifdef EXEC_PAGESIZE -#define GNU_OUR_PAGESIZE EXEC_PAGESIZE -#else /* no EXEC_PAGESIZE */ -#ifdef NBPG -#define GNU_OUR_PAGESIZE (NBPG * CLSIZE) -#ifndef CLSIZE -#define CLSIZE 1 -#endif /* CLSIZE */ -#else /* no NBPG */ -#ifdef NBPC -#define GNU_OUR_PAGESIZE NBPC -#else /* no NBPC */ -#define GNU_OUR_PAGESIZE 4096 /* Just punt and use reasonable value */ -#endif /* NBPC */ -#endif /* NBPG */ -#endif /* EXEC_PAGESIZE */ -#endif /* PAGESIZE */ -#endif /* HAVE_SYSCONF */ +#endif +#endif + +#ifndef GNU_OUR_PAGESIZE +# ifdef PAGESIZE +# define GNU_OUR_PAGESIZE PAGESIZE +# else /* no PAGESIZE */ +# ifdef EXEC_PAGESIZE +# define GNU_OUR_PAGESIZE EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define GNU_OUR_PAGESIZE (NBPG * CLSIZE) +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define GNU_OUR_PAGESIZE NBPC +# else /* no NBPC */ +# define GNU_OUR_PAGESIZE 4096 /* Just punt and use reasonable value */ +# endif /* NBPC */ +# endif /* NBPG */ +# endif /* EXEC_PAGESIZE */ +# endif /* PAGESIZE */ +#endif /* GNU_OUR_PAGESIZE */ int getpagesize () |