diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 104 |
1 files changed, 68 insertions, 36 deletions
diff --git a/configure.in b/configure.in index 13468317ba..77153b6ed0 100644 --- a/configure.in +++ b/configure.in @@ -1,38 +1,52 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(ruby.h) + PROGS="ruby" AC_SUBST(PROGS)dnl + +dnl Checks for programs. AC_PROG_CC AC_PROG_GCC_TRADITIONAL AC_PROG_YACC AC_PROG_INSTALL -AC_CHECK_HEADERS(unistd.h stdlib.h syscall.h a.out.h dirent.h\ - string.h utime.h) +AC_PROG_MAKE_SET + +dnl Checks for libraries. +AC_CHECK_LIB(m, pow) +AC_CHECK_LIB(crypt, crypt) +AC_CHECK_LIB(dl, dlopen, [:]) + +dnl Checks for header files. AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h\ + stdlib.h syscall.h a.out.h string.h utime.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_UID_T +AC_TYPE_SIZE_T +AC_STRUCT_ST_BLKSIZE +AC_STRUCT_ST_BLOCKS +AC_STRUCT_ST_RDEV + +dnl Checks for library functions. AC_TYPE_GETGROUPS AC_TYPE_SIGNAL -AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"]) -AC_CHECK_LIB(dbm, dbm_open, AC_DEFINE(HAVE_LIBDBM)) -AC_CHECK_LIB(socket, socket, AC_DEFINE(HAVE_LIBSOKCET)) -AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt"]) +AC_FUNC_ALLOCA AC_FUNC_VFORK AC_REPLACE_FUNCS(memmove mkdir strerror strftime\ strstr strtoul strdup) -AC_CHECK_FUNCS(fmod killpg socket random wait4 waitpid syscall getcwd\ +AC_CHECK_FUNCS(fmod killpg random wait4 waitpid syscall getcwd\ setruid seteuid setreuid setrgid setegid setregid\ getpriority sigprocmask dlopen utimes) AC_CHECK_FUNC(setenv, [], AC_CHECK_FUNCS(putenv)) -if test $ac_cv_func strftime = no; then +if test "$ac_cv_func strftime" = no; then AC_STRUCT_TIMEZONE AC_TRY_LINK([], [extern int daylight; int i = daylight;], AC_DEFINE(HAVE_DAYLIGHT)) fi -AC_FUNC_ALLOCA AC_C_BIGENDIAN -AC_STRUCT_ST_BLKSIZE -AC_STRUCT_ST_BLOCKS -AC_STRUCT_ST_RDEV AC_MSG_CHECKING(std stdio) AC_CACHE_VAL(rb_cv_stdstdio, [AC_TRY_COMPILE([#include <stdio.h>], @@ -40,7 +54,7 @@ AC_CACHE_VAL(rb_cv_stdstdio, rb_cv_stdstdio=yes, rb_cv_stdstdio=no)]) AC_MSG_RESULT($rb_cv_stdstdio) -if test $rb_cv_stdstdio = yes; then +if test "$rb_cv_stdstdio" = yes; then AC_DEFINE(STDSTDIO) fi AC_MSG_CHECKING(struct passwd) @@ -51,9 +65,10 @@ AC_EGREP_HEADER(pw_class, pwd.h, AC_DEFINE(PW_CLASS)) AC_EGREP_HEADER(pw_comment, pwd.h, AC_DEFINE(PW_COMMENT)) AC_EGREP_HEADER(pw_expire, pwd.h, AC_DEFINE(PW_EXPIRE)) AC_MSG_RESULT(done) -AC_MSG_CHECKING(whether matz's dln works) -cp confdefs.h config.h -if test $ac_cv_header_a_out_h = yes; then + +if test "$ac_cv_header_a_out_h" = yes; then + AC_MSG_CHECKING(whether matz's dln works) + cp confdefs.h config.h AC_CACHE_VAL(rb_cv_mydln, [AC_TRY_COMPILE([ #define USE_MY_DLN @@ -63,41 +78,58 @@ if test $ac_cv_header_a_out_h = yes; then rb_cv_mydln=yes, rb_cv_mydln=no)]) AC_MSG_RESULT($rb_cv_mydln) - if test $rb_cv_mydln = yes; then + if test "$rb_cv_mydln" = yes; then AC_DEFINE(USE_MY_DLN) fi fi AC_SUBST(STATIC)dnl AC_SUBST(CCDLFLAGS)dnl -AC_SUBST(EXT)dnl +AC_SUBST(LDDLFLAGS)dnl +AC_SUBST(DLEXT)dnl AC_SUBST(EXTMAKE)dnl EXTMAKE= STATIC= -if test $ac_cv_func_dlopen = yes -o $rb_cv_mydln = yes; then +if test "$rb_cv_mydln" = yes; then EXTMAKE=extmake - if test "$rb_cv_mydln" = yes; then - if test "$HOSTTYPE" = sparc; then - if test $ac_cv_prog_CC = gcc; then - STATIC=-static - else - STATIC=-Bstatic - fi - fi - EXT=o - CCDLFLAGS= - LDCMD= - else - EXT=so - if test $ac_cv_prog_CC = gcc; then - CCDLFLAGS=-fpic + if test "$HOSTTYPE" = sparc; then + if test "$ac_cv_prog_CC" = gcc; then + STATIC=-static else - CCDLFLAGS=-pic + STATIC=-Bstatic fi fi + DLEXT=o + AC_DEFINE(DLEXT, ".o") + CCDLFLAGS= + LDCMD= +elif test "$ac_cv_lib_dl" = yes || test "$ac_cv_func_dlopen" = yes; then + AC_CANONICAL_HOST + echo "please mail this value to matz -- $host_os" + EXTMAKE=extmake + DLEXT=so + AC_DEFINE(DLEXT, ".so") + if test "$ac_cv_prog_CC" = gcc; then + CCDLFLAGS=-fpic + else + case "$host_os" in + hpux*) CCDLFLAGS='+z' ;; + solaris*|irix*) CCDLFLAGS='-K pic' ;; + sunos*) CCDLFLAGS='-pic' ;; + svr4*|esix*) CCDLFLAGS='-Kpic' ;; + *) CCDLFLAGS='' ;; + esac + fi + case "$host_os" in + hpux*) LDDLFLAGS='-b' ;; + solaris*) LDDLFLAGS='-G' ;; + sunos*) LDDLFLAGS='-assert nodefinitions' ;; + svr4*|esix*) LDDLFLAGS="-G $LDFLAGS" ;; + *) LDDLFLAGS="" ;; + esac fi cp confdefs.h config.h -AC_OUTPUT(Makefile ext/Makefile) +AC_OUTPUT(Makefile ext/extmk.rb) |