diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/auto-aux/align.c | 96 | ||||
| -rw-r--r-- | config/auto-aux/async_io.c | 44 | ||||
| -rw-r--r-- | config/auto-aux/bytecopy.c | 19 | ||||
| -rw-r--r-- | config/auto-aux/dblalign.c | 37 | ||||
| -rw-r--r-- | config/auto-aux/endian.c | 26 | ||||
| -rw-r--r-- | config/auto-aux/getgroups.c | 17 | ||||
| -rwxr-xr-x | config/auto-aux/hasgot | 18 | ||||
| -rwxr-xr-x | config/auto-aux/runtest | 3 | ||||
| -rw-r--r-- | config/auto-aux/schar.c | 7 | ||||
| -rw-r--r-- | config/auto-aux/schar2.c | 7 | ||||
| -rw-r--r-- | config/auto-aux/setjmp.c | 12 | ||||
| -rw-r--r-- | config/auto-aux/sighandler.c | 8 | ||||
| -rw-r--r-- | config/auto-aux/signals.c | 58 | ||||
| -rw-r--r-- | config/auto-aux/sizes.c | 7 | ||||
| -rwxr-xr-x | config/autoconf | 254 |
15 files changed, 0 insertions, 613 deletions
diff --git a/config/auto-aux/align.c b/config/auto-aux/align.c deleted file mode 100644 index 15efbd4f71..0000000000 --- a/config/auto-aux/align.c +++ /dev/null @@ -1,96 +0,0 @@ -#include <stdio.h> -#include <signal.h> -#include <setjmp.h> - -long foo; - -void access16(p) - short * p; -{ - foo = *p; -} - -void access32(p) - long * p; -{ - foo = *p; -} - -jmp_buf failure; - -void sig_handler(dummy) - int dummy; -{ - longjmp(failure, 1); -} - -int test(fct, p) - void (*fct)(); - char * p; -{ - int res; - - signal(SIGSEGV, sig_handler); - signal(SIGBUS, sig_handler); - if(setjmp(failure) == 0) { - fct(p); - res = 0; - } else { - res = 1; - } - signal(SIGSEGV, SIG_DFL); - signal(SIGBUS, SIG_DFL); - return res; -} - -jmp_buf timer; - -void alarm_handler(dummy) - int dummy; -{ - longjmp(timer, 1); -} - -void use(n) - int n; -{ - return; -} - -int speedtest(p) - char * p; -{ - int * q; - volatile int total; - int i; - volatile int sum; - - signal(SIGALRM, alarm_handler); - sum = 0; - if (setjmp(timer) == 0) { - alarm(1); - total = 0; - while(1) { - for (q = (int *) p, i = 1000; i > 0; q++, i--) - sum += *q; - total++; - } - } - use(sum); - signal(SIGALRM, SIG_DFL); - return total; -} - -main() -{ - long n[1001]; - int speed_aligned, speed_unaligned; - - if (test(access16, (char *) n + 1)) exit(1); - if (test(access32, (char *) n + 1)) exit(1); - if (test(access32, (char *) n + 2)) exit(1); - speed_aligned = speedtest((char *) n); - speed_unaligned = speedtest((char *) n + 1); - if (speed_aligned >= 3 * speed_unaligned) exit(1); - exit(0); -} diff --git a/config/auto-aux/async_io.c b/config/auto-aux/async_io.c deleted file mode 100644 index 2fb04a6c67..0000000000 --- a/config/auto-aux/async_io.c +++ /dev/null @@ -1,44 +0,0 @@ -#include <stdio.h> -#include <fcntl.h> -#include <signal.h> -#include <errno.h> -#include "s.h" - -int signalled; - -void sigio_handler(arg) - int arg; -{ - signalled = 1; -} - -int main() -{ -#if defined(SIGIO) && defined(FASYNC) && defined(F_SETFL) && defined(F_SETOWN) - int p[2]; - int ret; -#define OUT 0 -#define IN 1 - if (pipe(p) == -1) return 1; - signalled = 0; - signal(SIGIO, sigio_handler); - ret = fcntl(p[OUT], F_GETFL, 0); - fcntl(p[OUT], F_SETFL, ret | FASYNC); - fcntl(p[OUT], F_SETOWN, getpid()); - switch(fork()) { - case -1: - return 1; - case 0: - close(p[OUT]); - write(p[IN], "x", 1); - sleep(1); - exit(0); - default: - close(p[IN]); - while(wait(NULL) == -1 && errno == EINTR) /*nothing*/; - } - if (signalled) return 0; else return 1; -#else - return 1; -#endif -} diff --git a/config/auto-aux/bytecopy.c b/config/auto-aux/bytecopy.c deleted file mode 100644 index 61fbb18d5e..0000000000 --- a/config/auto-aux/bytecopy.c +++ /dev/null @@ -1,19 +0,0 @@ -char buffer[27]; - -#ifdef reverse -#define cpy(s1,s2,n) copy(s2,s1,n) -#else -#define cpy copy -#endif - -main() -{ - cpy("abcdefghijklmnopqrstuvwxyz", buffer, 27); - if (strcmp(buffer, "abcdefghijklmnopqrstuvwxyz") != 0) exit(1); - cpy(buffer, buffer+3, 26-3); - if (strcmp(buffer, "abcabcdefghijklmnopqrstuvw") != 0) exit(1); - cpy("abcdefghijklmnopqrstuvwxyz", buffer, 27); - cpy(buffer+3, buffer, 26-3); - if (strcmp(buffer, "defghijklmnopqrstuvwxyzxyz") != 0) exit(1); - exit(0); -} diff --git a/config/auto-aux/dblalign.c b/config/auto-aux/dblalign.c deleted file mode 100644 index dd3099ab6e..0000000000 --- a/config/auto-aux/dblalign.c +++ /dev/null @@ -1,37 +0,0 @@ -#include <stdio.h> -#include <signal.h> -#include <setjmp.h> - -double foo; - -void access_double(p) - double * p; -{ - foo = *p; -} - -jmp_buf failure; - -void sig_handler() -{ - longjmp(failure, 1); -} - -main() -{ - long n[10]; - int res; - signal(SIGSEGV, sig_handler); - signal(SIGBUS, sig_handler); - if(setjmp(failure) == 0) { - access_double((double *) n); - access_double((double *) (n+1)); - res = 0; - } else { - res = 1; - } - signal(SIGSEGV, SIG_DFL); - signal(SIGBUS, SIG_DFL); - exit(res); -} - diff --git a/config/auto-aux/endian.c b/config/auto-aux/endian.c deleted file mode 100644 index 776ab04833..0000000000 --- a/config/auto-aux/endian.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "m.h" - -#ifndef SIXTYFOUR -long intval = 0x41424344L; -char * bigendian = "ABCD"; -char * littleendian = "DCBA"; -#else -long intval = 0x4142434445464748L; -char * bigendian = "ABCDEFGH"; -char * littleendian = "HGFEDCBA"; -#endif - -main() -{ - long n[2]; - char * p; - - n[0] = intval; - n[1] = 0; - p = (char *) n; - if (strcmp(p, bigendian) == 0) - exit(0); - if (strcmp(p, littleendian) == 0) - exit(1); - exit(2); -} diff --git a/config/auto-aux/getgroups.c b/config/auto-aux/getgroups.c deleted file mode 100644 index 8520c5c677..0000000000 --- a/config/auto-aux/getgroups.c +++ /dev/null @@ -1,17 +0,0 @@ -#include <sys/types.h> -#include <sys/param.h> - -#ifdef NGROUPS - -int main() -{ - int gidset[NGROUPS]; - if (getgroups(NGROUPS, gidset) == -1) return 1; - return 0; -} - -#else - -int main() { return 1; } - -#endif diff --git a/config/auto-aux/hasgot b/config/auto-aux/hasgot deleted file mode 100755 index b87fdfc5c5..0000000000 --- a/config/auto-aux/hasgot +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -ccopts="" -cclibs="" -rm -f hasgot.c -while : ; do - case "$1" in - -i) echo "#include <$2>" >> hasgot.c; shift;; - -l*) cclibs="$cclibs $1";; - -*) ccopts="$ccopts $1";; - *) break;; - esac - shift -done -(echo "main() {" - for f in $*; do echo " $f();"; done - echo "}") >> hasgot.c -exec $cc $ccopts -o tst hasgot.c $cclibs > /dev/null 2>/dev/null diff --git a/config/auto-aux/runtest b/config/auto-aux/runtest deleted file mode 100755 index 92c30362cc..0000000000 --- a/config/auto-aux/runtest +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -$cc -o tst $* || exit 100 -exec ./tst diff --git a/config/auto-aux/schar.c b/config/auto-aux/schar.c deleted file mode 100644 index 3890c495a1..0000000000 --- a/config/auto-aux/schar.c +++ /dev/null @@ -1,7 +0,0 @@ -char foo[]="\377"; -main() -{ - int i; - i = foo[0]; - exit(i != -1); -} diff --git a/config/auto-aux/schar2.c b/config/auto-aux/schar2.c deleted file mode 100644 index 0c6a6ce4bf..0000000000 --- a/config/auto-aux/schar2.c +++ /dev/null @@ -1,7 +0,0 @@ -signed char foo[]="\377"; -main() -{ - int i; - i = foo[0]; - exit(i != -1); -} diff --git a/config/auto-aux/setjmp.c b/config/auto-aux/setjmp.c deleted file mode 100644 index 0867e62bba..0000000000 --- a/config/auto-aux/setjmp.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <setjmp.h> - -main() -{ - jmp_buf buf; - int i; - i = _setjmp(buf); - if (i == 0) { - _longjmp(buf, 12345); - } - exit (i != 12345); -} diff --git a/config/auto-aux/sighandler.c b/config/auto-aux/sighandler.c deleted file mode 100644 index d8d2e5df48..0000000000 --- a/config/auto-aux/sighandler.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <signal.h> - -main() -{ - SIGRETURN (*old)(); - old = signal(SIGQUIT, SIG_DFL); - return 0; -} diff --git a/config/auto-aux/signals.c b/config/auto-aux/signals.c deleted file mode 100644 index c355545d83..0000000000 --- a/config/auto-aux/signals.c +++ /dev/null @@ -1,58 +0,0 @@ -/* To determine the semantics of signal handlers - (System V: signal is reset to default behavior on entrance to the handler - BSD: signal handler remains active). */ - -#include <stdio.h> -#include <signal.h> - -/* Find a signal that is ignored by default */ - -#ifdef SIGCHLD -#define IGNSIG SIGCHLD -#else -#ifdef SIGIO -#define IGNSIG SIGIO -#else -#ifdef SIGCLD -#define IGNSIG SIGCLD -#else -#ifdef SIGPWR -#define IGNSIG SIGPWR -#endif -#endif -#endif -#endif - -#ifdef IGNSIG - -int counter; - -void sig_handler(dummy) - int dummy; -{ - counter++; -} - -int main(argc, argv) - int argc; - char ** argv; -{ - signal(IGNSIG, sig_handler); - counter = 0; - kill(getpid(), IGNSIG); - kill(getpid(), IGNSIG); - return (counter == 2 ? 0 : 1); -} - -#else - -/* If no suitable signal was found, assume System V */ - -int main(argc, argv) - int argc; - char ** argv; -{ - return 1; -} - -#endif diff --git a/config/auto-aux/sizes.c b/config/auto-aux/sizes.c deleted file mode 100644 index 02ce675066..0000000000 --- a/config/auto-aux/sizes.c +++ /dev/null @@ -1,7 +0,0 @@ -int main(argc, argv) - int argc; - char ** argv; -{ - printf("%d %d %d\n", sizeof(int), sizeof(long), sizeof(long *)); - return 0; -} diff --git a/config/autoconf b/config/autoconf deleted file mode 100755 index a1d1930520..0000000000 --- a/config/autoconf +++ /dev/null @@ -1,254 +0,0 @@ -#!/bin/sh - -case $1 in - "") cc=cc;; - *) cc=$1;; -esac -export cc - -cd auto-aux -rm -f s.h m.h Makefile.h -touch s.h m.h Makefile.h - -# Check the sizes of data types - -echo "Checking the sizes of integers and pointers..." -set `sh ./runtest sizes.c` -case "$1,$2,$3" in - 4,4,4) echo "OK, this is a regular 32 bit architecture.";; - 4,8,8) echo "Wow! A 64 bit architecture!" - echo "#define SIXTYFOUR" >> m.h;; - 8,*,*) echo "Wow! A 64 bit architecture!" - echo "Unfortunately, Caml Light does not handle the case" - echo "sizeof(int) = 8." - echo "Caml Light won't run on this architecture." - exit 2;; - *,4,8) echo "Wow! A 64 bit architecture!" - echo "Unfortunately, Caml Light cannot work in the case" - echo "sizeof(long) != sizeof(long *)." - echo "Caml Light won't run on this architecture." - exit 2;; - ?,?,?) echo "This architecture seems to be neither 32 bits nor 64 bits." - echo "Caml Light won't run on this architecture." - exit 2;; - *) echo "Unable to compile the test program." - echo "Make sure the C compiler is properly installed." - exit 2;; -esac - -# Determine endianness - -sh ./runtest endian.c -case $? in - 0) echo "This is a big-endian architecture." - echo "#define BIG_ENDIAN" >> m.h;; - 1) echo "This is a little-endian architecture." - echo "#undef BIG_ENDIAN" >> m.h;; - 2) echo "This architecture seems to be neither big endian nor little endian." - echo "Caml Light won't run on this architecture." - exit 2;; - *) echo "Something went wrong during endianness determination." - echo "You'll have to figure out endianness yourself" - echo "(option BIG_ENDIAN in m.h).";; -esac - -# Determine alignment constraints - -sh ./runtest dblalign.c -case $? in - 0) echo "Doubles can be word-aligned.";; - 1) echo "Doubles must be doubleword-aligned." - echo "#define ALIGN_DOUBLE" >> m.h;; - *) echo "Something went wrong during alignment determination for doubles." - echo "I'm going to assume this architecture has alignment constraints over doubles." - echo "That's a safe bet: Caml Light will work even if it turns out that" - echo "this architecture actually has no alignment constraints." - echo "#define ALIGN_DOUBLE" >> m.h;; -esac - -# Are chars signed? - -sh ./runtest schar.c -case $? in - 0) echo "The char type is signed. Good!";; - 1) echo "The char type is not signed. Let's see if 'signed char' works." - sh ./runtest schar2.c - case $? in - 0) echo "Yes, it works. Good!" - echo "#define SIGNED_CHAR_WORKS" >> s.h;; - *) echo "No, it does not work." - echo "You'll have to figure out a compiler option that" - echo "causes the 'char' type to be signed, and" - echo "add it to CCCOMPOPTS in Makefile.config.";; - esac;; -esac - -# To find a good byte copy function - -if sh ./runtest -Dcopy=memmove -Dreverse bytecopy.c; then - echo "Function \"memmove\" is provided and handles overlapping moves correctly." - echo "#define HAS_MEMMOVE" >> s.h -fi -if sh ./runtest -Dcopy=bcopy bytecopy.c; then - echo "Function \"bcopy\" is provided and handles overlapping moves correctly." - echo "#define HAS_BCOPY" >> s.h -fi -if sh ./runtest -Dcopy=memcpy -Dreverse bytecopy.c; then - echo "Function \"memcpy\" is provided and handles overlapping moves correctly." - echo "#define HAS_MEMCPY" >> s.h -fi - -# Check for _longjmp and _setjmp - -sh ./runtest setjmp.c -case $? in - 0) echo "_setjmp and _longjmp appear to work. Good!" - echo "#define HAS__SETJMP" >> s.h;; - *) echo "No _setjmp, _longjmp. We'll use setjmp and longjmp instead." -esac - -# Check the semantics of signal handlers - -if sh ./runtest signals.c; then - echo "Signals have the BSD semantics." - echo "#define BSD_SIGNALS" >> s.h -else - echo "Signals have the System V semantics." -fi - -# For the terminfo module - -if sh hasgot -lcurses setupterm tigetstr tigetnum tputs; then - echo "terminfo functions found." - echo "#define HAS_TERMINFO" >> s.h - echo "TERMINFOLIBS=-lcurses" >> Makefile.h -fi - -if sh hasgot -lcurses -ltermcap tgetent tgetstr tgetnum tputs; then - echo "termcap functions found." - echo "#define HAS_TERMCAP" >> s.h - echo "TERMINFOLIBS=-lcurses -ltermcap" >> Makefile.h -fi - -# For the Unix library - -if sh hasgot socket socketpair bind listen accept connect; then - echo "You have BSD sockets." - echo "#define HAS_SOCKETS" >> s.h -fi - -if test -f /usr/include/unistd.h; then - echo "unistd.h found." - echo "#define HAS_UNISTD" >> s.h -fi - -if test -f /usr/include/dirent.h; then - echo "dirent.h found." - echo "#define HAS_DIRENT" >> s.h -fi - -if sh hasgot lockf; then - echo "lockf() found." - echo "#define HAS_LOCKF" >> s.h -fi - -if sh hasgot mkfifo; then - echo "mkfifo() found." - echo "#define HAS_MKFIFO" >> s.h -fi - -if sh hasgot getcwd; then - echo "getcwd() found." - echo "#define HAS_GETCWD" >> s.h -fi - -if sh hasgot getwd; then - echo "getwd() found." - echo "#define HAS_GETWD" >> s.h -fi - -if sh hasgot getpriority setpriority; then - echo "getpriority() found." - echo "#define HAS_GETPRIORITY" >> s.h -fi - -if test -f /usr/include/utime.h && sh hasgot utime; then - echo "utime() found." - echo "#define HAS_UTIME" >> s.h -fi - -if sh hasgot utimes; then - echo "utimes() found." - echo "#define HAS_UTIMES" >> s.h -fi - -if sh hasgot dup2; then - echo "dup2() found." - echo "#define HAS_DUP2" >> s.h -fi - -if sh hasgot fchmod fchown; then - echo "fchmod() found." - echo "#define HAS_FCHMOD" >> s.h -fi - -if sh hasgot truncate ftruncate; then - echo "truncate() found." - echo "#define HAS_TRUNCATE" >> s.h -fi - -if sh hasgot select; then - echo "select() found." - echo "#define HAS_SELECT" >> s.h -fi - -if sh hasgot symlink readlink lstat; then - echo "symlink() found." - echo "#define HAS_SYMLINK" >> s.h -fi - -if sh hasgot wait3; then - echo "wait3() found." - echo "#define HAS_WAIT3" >> s.h -fi - -if sh hasgot waitpid; then - echo "waitpid() found." - echo "#define HAS_WAITPID" >> s.h -fi - -if test -f /usr/include/sys/param.h && sh ./runtest getgroups.c; then - echo "getgroups() found." - echo "#define HAS_GETGROUPS" >> s.h -fi - -if test -f /usr/include/termios.h && - sh hasgot tcgetattr tcsetattr tcsendbreak tcflush tcflow; then - echo "POSIX termios found." - echo "#define HAS_TERMIOS" >> s.h -fi - -# The following four lines must be commented out on DEC OSF1 3.0 -if sh ./runtest async_io.c; then - echo "Asynchronous I/O are supported." - echo "#define HAS_ASYNC_IO" >> s.h -fi - -if sh hasgot setitimer; then - echo "setitimer() found." - echo "#define HAS_SETITIMER" >> s.h -fi - -if sh hasgot gethostname; then - echo "gethostname() found." - echo "#define HAS_GETHOSTNAME" >> s.h -fi - -if test -f /usr/include/sys/utsname.h && sh hasgot uname; then - echo "uname() found." - echo "#define HAS_UNAME" >> s.h -fi - -rm -f tst hasgot.c -rm -f ../m.h ../s.h ../Makefile.h -mv m.h s.h Makefile.h .. |
