summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:39 +0000
commit210367ec889f5910e270d6ea2c7ddb8a8d939e61 (patch)
treefeb35473da45947378fbc02defe39bcd79ef600e /configure.in
parent9c5b1986a36c7a700b4c76817e35aa874ba7907c (diff)
This commit was generated by cvs2svn to compensate for changes in r372,
which included commits to RCS files with non-trunk default branches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in249
1 files changed, 211 insertions, 38 deletions
diff --git a/configure.in b/configure.in
index 567e58c..0477ade 100644
--- a/configure.in
+++ b/configure.in
@@ -24,28 +24,47 @@ AC_ARG_ENABLE(thread, [--disable-thread never use user-level thread], [
rb_thread=$enableval
])
if test $rb_thread = yes; then
- AC_DEFINE(THREAD)
+ AC_DEFINE(USE_THREAD)
fi
AC_CANONICAL_HOST
-
dnl checks for fat-binary
fat_binary=no
AC_ARG_ENABLE( fat-binary,
- [--enable-fat-binary build a NeXT Multi Architecture Binary. ],
+ [--enable-fat-binary build a NeXT/Apple Multi Architecture Binary. ],
[ fat_binary=$enableval ] )
-if test "$fat_binary" = yes ; then
+ if test "$fat_binary" = yes ; then
AC_MSG_CHECKING( target architecture )
- if test "$TARGET_ARCHS" = "" ; then
- if test `/usr/bin/arch` = "m68k" ; then
- TARGET_ARCHS="m68k i486"
+ case "$host_os" in
+ rhapsody*)
+ echo -n "MacOS X Server: "
+ if test "$TARGET_ARCHS" = "" ; then
+ TARGET_ARCHS="ppc i386"
+ fi
+ ;;
+ nextstep*|openstep*)
+ echo -n "NeXTSTEP/OPENSTEP: "
+
+ if test "$host_os" = "rhapsody" ; then
+ echo -n "Rhapsody: "
+ if test "$TARGET_ARCHS" = "" ; then
+ TARGET_ARCHS="ppc i486"
+ fi
else
- TARGET_ARCHS="m68k `/usr/bin/arch`"
+ echo -n "NeXTSTEP/OPENSTEP: "
+ if test "$TARGET_ARCHS" = "" ; then
+ if test `/usr/bin/arch` = "m68k" ; then
+ TARGET_ARCHS="m68k i486"
+ else # Black and Native one
+ TARGET_ARCHS="m68k `/usr/bin/arch`"
+ fi
+ fi
fi
- fi
+ ;;
+ esac
# /usr/lib/arch_tool -archify_list $TARGET_ARCHS
for archs in $TARGET_ARCHS
do
@@ -56,7 +75,6 @@ if test "$fat_binary" = yes ; then
echo "."
fi
-
AC_ARG_PROGRAM
dnl Checks for programs.
@@ -72,22 +90,70 @@ AC_PROG_MAKE_SET
# checks for UNIX variants that set C preprocessor variables
AC_MINIX
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(void*)
+
+AC_MSG_CHECKING(for prototypes)
+AC_CACHE_VAL(rb_cv_have_prototypes,
+ [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
+ rb_cv_have_prototypes=yes,
+ rb_cv_have_prototypes=no)])
+AC_MSG_RESULT($rb_cv_have_prototypes)
+if test "$rb_cv_have_prototypes" = yes; then
+ AC_DEFINE(HAVE_PROTOTYPES)
+fi
+
+AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
+AC_CACHE_VAL(rb_cv_stdarg,
+ [AC_TRY_COMPILE([
+#include <stdarg.h>
+int foo(int x, ...) {
+ va_list va;
+ va_start(va, x);
+ va_arg(va, int);
+ va_arg(va, char *);
+ va_arg(va, double);
+ return 0;
+}
+], [return foo(10, "", 3.14);],
+ rb_cv_stdarg=yes,
+ rb_cv_stdarg=no)])
+AC_MSG_RESULT($rb_cv_stdarg)
+if test "$rb_cv_stdarg" = yes; then
+ AC_DEFINE(HAVE_STDARG_PROTOTYPES)
+fi
+
+AC_MSG_CHECKING(for gcc attribute noreturn)
+AC_CACHE_VAL(rb_cv_have_attr_noreturn,
+ [AC_TRY_COMPILE([void exit(int x) __attribute__ ((noreturn));], [],
+ rb_cv_have_attr_noreturn=yes,
+ rb_cv_have_attr_noreturn=no)])
+AC_MSG_RESULT($rb_cv_have_attr_noreturn)
+if test "$rb_cv_have_attr_noreturn" = yes; then
+ AC_DEFINE(HAVE_ATTR_NORETURN)
+fi
+
dnl Checks for libraries.
case "$host_os" in
nextstep*) ;;
+openstep*) ;;
+rhapsody*) ;;
human*) ;;
+beos*) ;;
*) LIBS="-lm $LIBS";;
esac
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
+AC_CHECK_LIB(xpg4, setlocale) # FreeBSD needs this
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
sys/select.h sys/time.h sys/times.h sys/param.h sys/wait.h\
- syscall.h a.out.h string.h utime.h memory.h)
+ syscall.h a.out.h string.h utime.h memory.h direct.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
@@ -98,23 +164,19 @@ AC_STRUCT_ST_BLOCKS
LIBOBJS="$save_LIBOBJS"
AC_STRUCT_ST_RDEV
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(void*)
-
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
AC_FUNC_ALLOCA
AC_FUNC_VFORK
-AC_REPLACE_FUNCS(dup2 setenv memmove mkdir strcasecmp strerror strftime\
- strstr strtoul strdup crypt flock)
-AC_CHECK_FUNCS(fmod killpg random wait4 waitpid syscall getcwd\
+AC_FUNC_MEMCMP
+AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strerror strftime\
+ strchr strstr strtoul strdup crypt flock vsnprintf)
+AC_CHECK_FUNCS(fmod killpg drand48 random wait4 waitpid syscall getcwd\
truncate chsize times utimes fcntl lockf setitimer\
setruid seteuid setreuid setrgid setegid setregid\
- setpgrp2 getpgid getgroups getpriority\
- dlopen sigprocmask sigaction _setjmp)
+ setpgrp2 getpgid setpgid getgroups getpriority\
+ dlopen sigprocmask sigaction _setjmp setpgrp setsid)
if test "$ac_cv_func_strftime" = no; then
AC_STRUCT_TIMEZONE
AC_TRY_LINK([],
@@ -181,6 +243,26 @@ fi
AC_C_BIGENDIAN
AC_CHAR_UNSIGNED
+AC_MSG_CHECKING(whether right shift preserve sign bit)
+AC_CACHE_VAL(rb_cv_rshift_sign,
+ [AC_TRY_RUN([
+int
+main()
+{
+ if (-1==(-1>>1))
+ return 0;
+ return 1;
+}
+],
+ rb_cv_rshift_sign=yes,
+ rb_cv_rshift_sign=no)])
+ AC_MSG_RESULT($rb_cv_rshift_sign)
+if test "$rb_cv_rshift_sign" = yes; then
+ AC_DEFINE(RSHIFT(x,y), ((x)>>y))
+else
+ AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
+fi
+
AC_MSG_CHECKING([count field in FILE structures])
AC_CACHE_VAL(rb_cv_fcnt,
[AC_TRY_COMPILE([#include <stdio.h>],
@@ -205,17 +287,6 @@ else
AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)
fi
-if test "$ac_cv_func_getpwent" = yes; then
- AC_MSG_CHECKING(struct passwd)
- AC_EGREP_HEADER(pw_change, pwd.h, AC_DEFINE(PW_CHANGE))
- AC_EGREP_HEADER(pw_quota, pwd.h, AC_DEFINE(PW_QUOTA))
- AC_EGREP_HEADER(pw_age, pwd.h, AC_DEFINE(PW_AGE))
- 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)
-fi
-
dnl wheather use dln_a_out ot not
AC_ARG_WITH(dln-a-out, [--with-dln-a-out use dln_a_out if possible], [
case $withval in
@@ -271,7 +342,10 @@ if test "$with_dln_a_out" != yes; then
if test "$GCC" = yes; then
case "$host_os" in
nextstep*) ;;
+ openstep*) ;;
+ rhapsody*) ;;
human*) ;;
+ cygwin*) CCDLFLAGS=-DDLLIMPORT;;
*) CCDLFLAGS=-fpic;;
esac
else
@@ -301,21 +375,44 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes ;;
linux*) LDSHARED="gcc -shared"
rb_cv_dlopen=yes ;;
+ freebsd3*) LDSHARED="ld -Bshareable"
+ LDFLAGS="-rdynamic"
+ rb_cv_dlopen=yes ;;
freebsd*) LDSHARED="ld -Bshareable"
rb_cv_dlopen=yes ;;
netbsd*) LDSHARED="ld -Bshareable"
rb_cv_dlopen=yes ;;
- openbsd*) LDSHARED="ld -Bshareable"
+ openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
+ CCDLFLAGS=-fPIC
rb_cv_dlopen=yes ;;
nextstep*) LDSHARED='cc -r'
LDFLAGS="-u libsys_s"
DLDFLAGS="$ARCH_FLAG"
rb_cv_dlopen=yes ;;
+ openstep*) LDSHARED='cc -dynamic -bundle -undefined suppress'
+ LDFLAGS=""
+ DLDFLAGS="$ARCH_FLAG"
+ rb_cv_dlopen=yes ;;
+ rhapsody*) LDSHARED='cc -dynamic -bundle -undefined suppress'
+ LDFLAGS=""
+ DLDFLAGS="$ARCH_FLAG"
+ rb_cv_dlopen=yes ;;
aix*) LDSHARED='../../miniruby ../aix_ld.rb $(TARGET)'
rb_cv_dlopen=yes ;;
human*) DLDFLAGS=''
LDSHARED=''
LDFLAGS='' ;;
+ beos*) LDSHARED="ld -xms"
+ case "$host_cpu" in
+ powerpc*)
+ DLDFLAGS="-f ruby.exp -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
+ ;;
+ *)
+ DLDFLAGS="ruby.def -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
+ ;;
+ esac
+ rb_cv_dlopen=yes ;;
+ cygwin*) LDSHARED='../../miniruby ../cygwin32_ld.rb' ;;
*) LDSHARED='ld' ;;
esac
AC_MSG_RESULT($rb_cv_dlopen)
@@ -357,6 +454,12 @@ else
AC_DEFINE(DLEXT, ".sl");;
nextstep*) DLEXT=o
AC_DEFINE(DLEXT, ".o");;
+ openstep*) DLEXT=bundle
+ AC_DEFINE(DLEXT, ".bundle");;
+ rhapsody*) DLEXT=bundle
+ AC_DEFINE(DLEXT, ".bundle");;
+ cygwin*) DLEXT=dll
+ AC_DEFINE(DLEXT, ".dll");;
*) DLEXT=so
AC_DEFINE(DLEXT, ".so");;
esac
@@ -374,6 +477,10 @@ case "$host_os" in
STRIP='strip -S -x';;
nextstep*)
STRIP='strip -A -n';;
+ openstep*)
+ STRIP='strip -A -n';;
+ rhapsody*)
+ STRIP='strip -A -n';;
esac
EXTSTATIC=
@@ -435,11 +542,18 @@ rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no)])
binsuffix=.x
setup=Setup.x68
;;
+ cygwin*)
+ binsuffix=.exe
+ setup=Setup
+ ;;
*)
binsuffix=
setup=Setup
;;
esac
+
+
+
AC_SUBST(binsuffix)
AC_SUBST(setup)
@@ -448,23 +562,82 @@ if test "$prefix" = NONE; then
fi
if test "$fat_binary" = yes ; then
- CFLAGS="$CFLAGS -pipe $ARCH_FLAG"
+ CFLAGS="$CFLAGS $ARCH_FLAG"
+fi
+
+LIBRUBY='libruby.a'
+LIBRUBYARG='libruby.a'
+SOLIBS=
+if test "$host_os" = "beos"; then
+ CFLAGS="$CFLAGS -relax_pointers"
+ LIBRUBY='libruby.so'
+ LIBRUBYARG='-lruby'
+ SOLIBS='-lnet'
+ echo creating ruby.def
+ case "$host_cpu" in
+ powerpc*)
+ cp beos/ruby.def.in ruby.exp
+ ;;
+ *)
+ echo EXPORTS > ruby.def
+ cat beos/ruby.def.in >> ruby.def
+ ;;
+ esac
fi
-AC_DEFINE_UNQUOTED(RUBY_LIB, "${prefix}/lib/ruby")
+if test "$enable_shared" = 'yes'; then
+ LIBRUBY='libruby.so'
+ LIBRUBYARG='-L./ -lruby'
+fi
+
+case "$host_os" in
+ nextstep*)
+ CFLAGS="$CFLAGS -pipe"
+ ;;
+ openstep*)
+ CFLAGS="$CFLAGS -pipe"
+ ;;
+ rhasody*)
+ CFLAGS="$CFLAGS -pipe -no-precomp"
+ ;;
+ *)
+ ;;
+esac
+
+
+AC_SUBST(LIBRUBY)
+AC_SUBST(LIBRUBYARG)
+AC_SUBST(SOLIBS)
+
+ri_prefix=
+test "$program_prefix" != NONE &&
+ ri_prefix=$program_prefix
+
+ri_suffix=
+test "$program_suffix" != NONE &&
+ ri_suffix=$program_suffix
+
+RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
+AC_DEFINE_UNQUOTED(RUBY_LIB, "${prefix}/lib/${RUBY_INSTALL_NAME}")
+AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby")
AC_SUBST(arch)dnl
if test "$fat_binary" = yes ; then
arch="fat-${host_os}"
AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
- "${prefix}/lib/ruby/" __ARCHITECTURE__ "-${host_os}" )
+ "${prefix}/lib/${RUBY_INSTALL_NAME}/" __ARCHITECTURE__ "-${host_os}" )
+
+ AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
+ "${prefix}/lib/${RUBY_INSTALL_NAME}/" __ARCHITECTURE__ "-${host_os}" )
- AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby/${arch}")
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${host_os}" )
else
arch="${host_cpu}-${host_os}"
- AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby/${arch}")
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
fi