* Added comments from the old config/ directory to configure.ac, and started
changing all the AC_DEFINEs into proper autoconf checks. git-svn-id: svn://svn.zoy.org/elk/trunk@36 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
+15
-15
@@ -12,13 +12,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
# include <sys/mman.h>
|
||||
#endif
|
||||
#ifdef GETPAGESIZE
|
||||
# define SYSCONF_PAGESIZE
|
||||
#ifdef HAVE_GETPAGESIZE
|
||||
# define SC_PAGESIZE_IN_UNISTD_H
|
||||
#endif
|
||||
#ifdef SYSCONF_PAGESIZE
|
||||
#ifdef SC_PAGESIZE_IN_UNISTD_H
|
||||
# define link FOO
|
||||
# include <unistd.h>
|
||||
# undef link
|
||||
@@ -191,7 +191,7 @@ static void TerminateGC ();
|
||||
#define SET_PROTECT(addr) { PMAP (addr) = 1; protected_pages++; }
|
||||
#define SET_UNPROTECT(addr) { PMAP (addr) = 0; protected_pages--; }
|
||||
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
# ifndef PROT_RW
|
||||
# define PROT_RW (PROT_READ | PROT_WRITE)
|
||||
# endif
|
||||
@@ -463,7 +463,7 @@ void Make_Heap (int size) {
|
||||
Object heap_obj;
|
||||
pageno_t i;
|
||||
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
InstallHandler ();
|
||||
#endif
|
||||
|
||||
@@ -472,14 +472,14 @@ void Make_Heap (int size) {
|
||||
* then calculate the resulting number of heap pages.
|
||||
*/
|
||||
|
||||
#ifdef SYSCONF_PAGESIZE
|
||||
#ifdef SC_PAGESIZE_IN_UNISTD_H
|
||||
if ((bytes_per_pp = sysconf (_SC_PAGESIZE)) == -1)
|
||||
Fatal_Error ("sysconf(_SC_PAGESIZE) failed; can't get pagesize");
|
||||
#else
|
||||
#ifdef GETPAGESIZE
|
||||
#ifdef HAVE_GETPAGESIZE
|
||||
bytes_per_pp = getpagesize ();
|
||||
#else
|
||||
# ifdef HAS_MPROTECT
|
||||
# ifdef HAVE_MPROTECT
|
||||
# include "mprotect requires getpagesize or sysconf_pagesize"
|
||||
# else
|
||||
bytes_per_pp = 4096;
|
||||
@@ -1290,7 +1290,7 @@ static int Scanner (pageno_t npages) {
|
||||
return (scanned);
|
||||
}
|
||||
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
/* the following function handles a page fault. If the fault was caused
|
||||
* by the mutator and incremental collection is enabled, this will result
|
||||
* in scanning the physical page the fault occured on.
|
||||
@@ -1328,7 +1328,7 @@ static void PagefaultHandler (int sig, int code, struct sigcontext *scp,
|
||||
static void PagefaultHandler (int sig, int code, struct sigcontext *scp) {
|
||||
|
||||
#else
|
||||
# include "HAS_MPROTECT defined, but missing SIGSEGV_xxx"
|
||||
# include "HAVE_MPROTECT defined, but missing SIGSEGV_xxx"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@@ -1633,7 +1633,7 @@ void Generational_GC_Finalize () {
|
||||
}
|
||||
|
||||
void Generational_GC_Reinitialize () {
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
InstallHandler ();
|
||||
#endif
|
||||
}
|
||||
@@ -1641,7 +1641,7 @@ void Generational_GC_Reinitialize () {
|
||||
|
||||
Object Internal_GC_Status (int strat, int flags) {
|
||||
Object list;
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
Object cell;
|
||||
#endif
|
||||
GC_Node;
|
||||
@@ -1650,7 +1650,7 @@ Object Internal_GC_Status (int strat, int flags) {
|
||||
GC_Link (list);
|
||||
switch (strat) {
|
||||
default: /* query or stop-and-copy */
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
if (inc_collection) {
|
||||
cell = Cons (Sym_Incremental_GC, Null);
|
||||
(void)P_Set_Cdr (list, cell);
|
||||
@@ -1659,7 +1659,7 @@ Object Internal_GC_Status (int strat, int flags) {
|
||||
break;
|
||||
case GC_STRAT_GEN:
|
||||
if (flags == GC_FLAGS_INCR) {
|
||||
#ifdef HAS_MPROTECT
|
||||
#ifdef HAVE_MPROTECT
|
||||
inc_collection = 1;
|
||||
cell = Cons (Sym_Incremental_GC, Null);
|
||||
(void)P_Set_Cdr (list, cell);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef PATHCONF_PATH_MAX
|
||||
#ifdef PC_PATH_MAX_IN_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -87,13 +87,11 @@ Object P_Output_Portp (Object x) {
|
||||
}
|
||||
|
||||
int Path_Max () {
|
||||
#ifdef PATH_MAX /* POSIX */
|
||||
#if defined(PATH_MAX) /* POSIX */
|
||||
return PATH_MAX;
|
||||
#else
|
||||
#ifdef MAXPATHLEN /* 4.3 BSD */
|
||||
#elif defined(MAXPATHLEN) /* 4.3 BSD */
|
||||
return MAXPATHLEN;
|
||||
#else
|
||||
#ifdef PATHCONF_PATH_MAX
|
||||
#elif defined(PC_PATH_MAX_IN_UNISTD_H)
|
||||
static int r;
|
||||
if (r == 0) {
|
||||
if ((r = pathconf ("/", _PC_PATH_MAX)) == -1)
|
||||
@@ -104,8 +102,6 @@ int Path_Max () {
|
||||
#else
|
||||
return 1024;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Object Get_File_Name (Object name) {
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef FIND_AOUT
|
||||
# ifdef INCLUDE_UNISTD_H
|
||||
# ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# else
|
||||
# include <sys/file.h>
|
||||
@@ -87,7 +87,7 @@ void Exit_Handler () {
|
||||
Free_Heap ();
|
||||
}
|
||||
|
||||
#ifndef ATEXIT
|
||||
#ifndef HAVE_ATEXIT
|
||||
/* Hack: __GNUC_MINOR__ was introduced together with __attribute__ */
|
||||
#ifdef __GNUC_MINOR__
|
||||
extern void _exit() __attribute__ ((noreturn));
|
||||
@@ -242,7 +242,7 @@ int main (int ac, char **av) {
|
||||
ALIGN(stkbase);
|
||||
Make_Heap (heap);
|
||||
Init_Everything ();
|
||||
#ifdef ATEXIT
|
||||
#ifdef HAVE_ATEXIT
|
||||
if (atexit (Exit_Handler) != 0)
|
||||
Fatal_Error ("atexit returned non-zero value");
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ extern int Bignum_To_Integer (Object);
|
||||
Object Generic_Multiply(), Generic_Divide();
|
||||
|
||||
void Init_Math () {
|
||||
#ifdef RANDOM
|
||||
#ifdef HAVE_RANDOM
|
||||
srandom (getpid ());
|
||||
#else
|
||||
srand (getpid ());
|
||||
@@ -1104,7 +1104,7 @@ Object P_Max (int argc, Object *argv) {
|
||||
}
|
||||
|
||||
Object P_Random () {
|
||||
#ifdef RANDOM
|
||||
#ifdef HAVE_RANDOM
|
||||
extern long int random();
|
||||
return Make_Long (random ());
|
||||
#else
|
||||
@@ -1113,7 +1113,7 @@ Object P_Random () {
|
||||
}
|
||||
|
||||
Object P_Srandom (Object x) {
|
||||
#ifdef RANDOM
|
||||
#ifdef HAVE_RANDOM
|
||||
srandom (Get_Unsigned (x));
|
||||
#else
|
||||
srand (Get_Unsigned (x));
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ void Print_String (Object port, register char *buf, register int len) {
|
||||
p->ptr += len;
|
||||
}
|
||||
|
||||
#ifndef VPRINTF
|
||||
#ifndef HAVE_VPRINTF
|
||||
void vfprintf (register FILE *f, register char *fmt, va_list ap) {
|
||||
_doprnt (fmt, ap, f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user