* Removed compile-time checks for _SC_OPEN_MAX, _PC_PATH_MAX and _SC_PAGESIZE

and used simple build-time #ifdefs.


git-svn-id: svn://svn.zoy.org/elk/trunk@196 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2003-09-26 12:28:31 +00:00
parent 1e16bd8dd3
commit 5b1cb65202
4 changed files with 6 additions and 24 deletions

View File

@ -6,7 +6,7 @@ AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR(autotools) AC_CONFIG_AUX_DIR(autotools)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(elk, 3.99.4) AM_INIT_AUTOMAKE(elk, 3.99.5)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AC_PROG_CC AC_PROG_CC
@ -85,21 +85,9 @@ AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/filio.h)
# set sysconf_open_max=yes. # set sysconf_open_max=yes.
# If neither is set to "yes", an educated guess will be made. # If neither is set to "yes", an educated guess will be made.
AC_CHECK_FUNCS(getdtablesize) AC_CHECK_FUNCS(getdtablesize)
AC_MSG_CHECKING(for _SC_OPEN_MAX in unistd.h)
AC_EGREP_HEADER(_SC_OPEN_MAX, unistd.h, [
AC_MSG_RESULT(yes) AC_DEFINE(SC_OPEN_MAX_IN_UNISTD_H, 1, Define if <unistd.h> defines _SC_OPEN_MAX)
],[
AC_MSG_RESULT(no)
])
# If POSIX-style pathconf() can be invoked with _PC_PATH_MAX to determine # If POSIX-style pathconf() can be invoked with _PC_PATH_MAX to determine
# the maximum pathname length, set pathconf_path_max=yes. # the maximum pathname length, set pathconf_path_max=yes.
AC_MSG_CHECKING(for _PC_PATH_MAX in unistd.h)
AC_EGREP_HEADER(_PC_PATH_MAX, unistd.h, [
AC_MSG_RESULT(yes) AC_DEFINE(PC_PATH_MAX_IN_UNISTD_H, 1, Define if <unistd.h> defines _PC_PATH_MAX)
],[
AC_MSG_RESULT(no)
])
# If the system page size can be determined by calling getpagesize() # If the system page size can be determined by calling getpagesize()
# set getpagesize=yes. # set getpagesize=yes.
@ -108,12 +96,6 @@ AC_EGREP_HEADER(_PC_PATH_MAX, unistd.h, [
# These two variables are only required if the generational garbage # These two variables are only required if the generational garbage
# collector is used. # collector is used.
AC_CHECK_FUNCS(getpagesize) AC_CHECK_FUNCS(getpagesize)
AC_MSG_CHECKING(for _SC_PAGESIZE in unistd.h)
AC_EGREP_HEADER(_SC_PAGESIZE, unistd.h, [
AC_MSG_RESULT(yes) AC_DEFINE(SC_PAGESIZE_IN_UNISTD_H, 1, Define if <unistd.h> defines _SC_PAGESIZE)
],[
AC_MSG_RESULT(no)
])
# Set reliable_signals=bsd if your system supports BSD-style reliable # Set reliable_signals=bsd if your system supports BSD-style reliable
# signals (has sigblock and related functions); set reliable_signals=posix # signals (has sigblock and related functions); set reliable_signals=posix

View File

@ -194,7 +194,7 @@ int Num_Filedescriptors() {
ret = OPEN_MAX; ret = OPEN_MAX;
#elif defined(HAVE_GETDTABLESIZE) #elif defined(HAVE_GETDTABLESIZE)
ret = getdtablesize(); ret = getdtablesize();
#elif defined(SC_OPEN_MAX_IN_UNISTD_H) #elif defined(_SC_OPEN_MAX)
static r; static r;
if (r == 0) { if (r == 0) {
if ((r = sysconf(_SC_OPEN_MAX)) == -1) if ((r = sysconf(_SC_OPEN_MAX)) == -1)

View File

@ -42,7 +42,7 @@
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP) #if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
# include <sys/mman.h> # include <sys/mman.h>
#endif #endif
#if defined(HAVE_GETPAGESIZE) || defined(SC_PAGESIZE_IN_UNISTD_H) #if defined(HAVE_UNISTD_H)
# include <unistd.h> # include <unistd.h>
# if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE) /* Wrong in HP-UX */ # if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE) /* Wrong in HP-UX */
# define _SC_PAGESIZE _SC_PAGE_SIZE # define _SC_PAGESIZE _SC_PAGE_SIZE
@ -493,7 +493,7 @@ void Make_Heap (int size) {
* then calculate the resulting number of heap pages. * then calculate the resulting number of heap pages.
*/ */
#if defined(SC_PAGESIZE_IN_UNISTD_H) #if defined(_SC_PAGESIZE)
if ((bytes_per_pp = sysconf (_SC_PAGESIZE)) == -1) if ((bytes_per_pp = sysconf (_SC_PAGESIZE)) == -1)
Fatal_Error ("sysconf(_SC_PAGESIZE) failed; can't get pagesize"); Fatal_Error ("sysconf(_SC_PAGESIZE) failed; can't get pagesize");
#elif defined(HAVE_GETPAGESIZE) #elif defined(HAVE_GETPAGESIZE)

View File

@ -40,7 +40,7 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef PC_PATH_MAX_IN_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
@ -122,7 +122,7 @@ unsigned int Path_Max () {
return PATH_MAX; return PATH_MAX;
#elif defined(MAXPATHLEN) /* 4.3 BSD */ #elif defined(MAXPATHLEN) /* 4.3 BSD */
return MAXPATHLEN; return MAXPATHLEN;
#elif defined(PC_PATH_MAX_IN_UNISTD_H) #elif defined(_PC_PATH_MAX)
static int r; static int r;
if (r == 0) { if (r == 0) {
if ((r = pathconf ("/", _PC_PATH_MAX)) == -1) if ((r = pathconf ("/", _PC_PATH_MAX)) == -1)