diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 58 |
1 files changed, 53 insertions, 5 deletions
diff --git a/configure.in b/configure.in index 699ca1eed3..9a59f42e0f 100644 --- a/configure.in +++ b/configure.in @@ -28,6 +28,35 @@ if test $rb_thread = yes; then 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. ], + [ fat_binary=$enableval ] ) +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" + else + TARGET_ARCHS="m68k `/usr/bin/arch`" + fi + fi + # /usr/lib/arch_tool -archify_list $TARGET_ARCHS + for archs in $TARGET_ARCHS + do + ARCH_FLAG="$ARCH_FLAG -arch $archs " + echo -n " $archs" + done + AC_DEFINE( NEXT_FAT_BINARY ) + echo "." +fi + + AC_ARG_PROGRAM dnl Checks for programs. @@ -75,7 +104,7 @@ AC_TYPE_SIGNAL AC_FUNC_ALLOCA AC_FUNC_VFORK AC_REPLACE_FUNCS(dup2 setenv memmove mkdir strcasecmp strerror strftime\ - strstr strtoul strdup strcasecmp crypt flock) + strstr strtoul strdup crypt flock) AC_CHECK_FUNCS(fmod killpg random wait4 waitpid syscall getcwd\ truncate chsize times utimes fcntl lockf setitimer\ setruid seteuid setreuid setrgid setegid setregid\ @@ -269,8 +298,11 @@ if test "$with_dln_a_out" != yes; then rb_cv_dlopen=yes ;; netbsd*) LDSHARED="ld -Bshareable" rb_cv_dlopen=yes ;; - nextstep*) LDSHARED='ld' + openbsd*) LDSHARED="ld -Bshareable" + rb_cv_dlopen=yes ;; + nextstep*) LDSHARED='cc -r' LDFLAGS="-u libsys_s" + DLDFLAGS="$ARCH_FLAG" rb_cv_dlopen=yes ;; aix*) LDSHARED='../../miniruby ../aix_ld.rb $(TARGET)' rb_cv_dlopen=yes ;; @@ -407,11 +439,27 @@ AC_SUBST(setup) if test "$prefix" = NONE; then prefix=$ac_default_prefix fi + +if test "$fat_binary" = yes ; then + CFLAGS="$CFLAGS -pipe $ARCH_FLAG" +fi + AC_DEFINE_UNQUOTED(RUBY_LIB, "${prefix}/lib/ruby") AC_SUBST(arch)dnl -arch="${host_cpu}-${host_os}" -AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${host_cpu}-${host_os}") -AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch") + +if test "$fat_binary" = yes ; then + arch="fat-${host_os}" + + AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB, + "${prefix}/lib/ruby/" __ARCHITECTURE__ "-${host_os}" ) + + AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/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_PLATFORM, "${arch}") +fi echo "creating config.h" cat confdefs.h > config.h |