summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
commite4b53b22228d935847b72e8f9ab0f49a15b54215 (patch)
treeae6cd78921bf626d54145b5485474bf59c3dceb4 /configure.in
parent005f12582975d8382851b740690f97dba35aaa2a (diff)
2000-02-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in88
1 files changed, 56 insertions, 32 deletions
diff --git a/configure.in b/configure.in
index 54cb416..69ef552 100644
--- a/configure.in
+++ b/configure.in
@@ -68,13 +68,27 @@ fi
AC_ARG_PROGRAM
dnl Checks for programs.
+
+if test x"${build}" != x"${host}"; then
+ AC_CHECK_TOOL(CC, gcc)
+fi
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
+
AC_PROG_YACC
-AC_PROG_RANLIB
-AC_SUBST(AR)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(AR, ar)
AC_CHECK_PROGS(AR, ar aal, ar)
+case "$target_os" in
+ cygwin*)
+ AC_CHECK_TOOL(NM, nm)
+ AC_CHECK_TOOL(DLLWRAP, dllwrap)
+ AC_CHECK_TOOL(AS, as)
+ AC_CHECK_TOOL(DLLTOOL, dlltool)
+ ;;
+esac
+
AC_PROG_LN_S
AC_PROG_MAKE_SET
@@ -310,10 +324,14 @@ AC_SUBST(DEFAULT_KCODE)
AC_ARG_WITH(default-kcode,
[--with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
[case $withval in
- utf8) AC_DEFINE(DEFAULT_KCODE, KCODE_UTF8);;
- euc) AC_DEFINE(DEFAULT_KCODE, KCODE_EUC);;
- sjis) AC_DEFINE(DEFAULT_KCODE, KCODE_SJIS);;
- none) AC_DEFINE(DEFAULT_KCODE, KCODE_NONE);;
+ utf8) AC_DEFINE(DEFAULT_KCODE, KCODE_UTF8)
+ DEFAULT_KCODE="KCODE_UTF8";;
+ euc) AC_DEFINE(DEFAULT_KCODE, KCODE_EUC)
+ DEFAULT_KCODE="KCODE_EUC";;
+ sjis) AC_DEFINE(DEFAULT_KCODE, KCODE_SJIS)
+ DEFAULT_KCODE="KCODE_SJIS";;
+ none) AC_DEFINE(DEFAULT_KCODE, KCODE_NONE)
+ DEFAULT_KCODE="KCODE_NONE";;
*) AC_MSG_WARN($withval is not valid kcode; ignored);;
esac])
@@ -327,10 +345,8 @@ AC_ARG_WITH(dln-a-out,
AC_SUBST(XLDFLAGS)dnl
-case "$target_os" in
- linux*)
- AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
- [AC_TRY_RUN([
+AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
+[AC_TRY_RUN([
/* Test for whether ELF binaries are produced */
#include <fcntl.h>
#include <stdlib.h>
@@ -347,15 +363,30 @@ main() {
exit(0); /* succeed (yes, it's ELF) */
}
],
- rb_cv_binary_elf=yes,
- rb_cv_binary_elf=no,
- rb_cv_binary_elf=yes)])
+rb_cv_binary_elf=yes,
+rb_cv_binary_elf=no,
+rb_cv_binary_elf=yes)])
+
+if test "$rb_cv_binary_elf" = yes; then
+ AC_DEFINE(USE_ELF)
+fi
+
+case "$target_os" in
+ linux*)
if test "$rb_cv_binary_elf" = no; then
with_dln_a_out=yes
target_os=${target_os}-a_out
else
LDFLAGS="-rdynamic"
fi;;
+netbsd*)
+ if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
+ then
+ netbsd_elf=yes
+ else
+ netbsd_elf=no
+ fi
+ ;;
esac
AC_SUBST(DLDFLAGS)dnl
@@ -420,20 +451,17 @@ if test "$with_dln_a_out" != yes; then
linux*) LDSHARED="$CC -shared"
rb_cv_dlopen=yes ;;
freebsd*) LDSHARED="$CC -shared"
- if test -x /usr/bin/objformat && \
- test `/usr/bin/objformat` = "elf" ; then
+ if test "$rb_cv_binary_elf" = yes; then
LDFLAGS="-rdynamic"
DLDFLAGS='-Wl,-soname,$(.TARGET)'
- rb_cv_freebsd_elf=yes
else
test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null || LDSHARED="ld -Bshareable"
fi
rb_cv_dlopen=yes ;;
- netbsd*) LDSHARED="ld -shared"
- case "$target_cpu" in
- alpha)
- LDFLAGS="-export-dynamic" ;;
- esac
+ netbsd*) LDSHARED="ld -shared"
+ if test "$rb_cv_binary_elf" = yes; then
+ LDFLAGS="-export-dynamic"
+ fi
rb_cv_dlopen=yes ;;
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
rb_cv_dlopen=yes ;;
@@ -478,7 +506,7 @@ if test "$with_dln_a_out" != yes; then
DLDFLAGS="ruby.def -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
esac
rb_cv_dlopen=yes ;;
- cygwin*) : ${LDSHARED='dllwrap --export-all -s'}
+ cygwin*) : ${LDSHARED="${DLLWRAP} --as=${AS} --dlltool-name=${DLLTOOL} --driver-name=${CC} --export-all -s"}
rb_cv_dlopen=yes ;;
*) LDSHARED='ld' ;;
esac
@@ -687,18 +715,18 @@ if test "$enable_shared" = 'yes'; then
;;
freebsd*)
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR)'
- if test "$rb_cv_freebsd_elf" != "yes" ; then
+ if test "$rb_cv_binary_elf" != "yes" ; then
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
fi
;;
netbsd*)
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
- case "$target_cpu" in
- alpha|mipsel|mipseb|powerpc|sparc64) # ELF platforms
- LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so' ;;
- *) LIBRUBY_ALIASES= ;; # a.out platforms
- esac
+ if test "$rb_cv_binary_elf" = yes; then # ELF platforms
+ LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so'
+ else
+ LIBRUBY_ALIASES= # a.out platforms
+ fi
;;
solaris*)
XLDFLAGS='-R${prefix}/lib'
@@ -727,10 +755,6 @@ if test "$enable_shared" = 'yes'; then
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
LIBOBJS="$LIBOBJS strftime.o"
CCDLFLAGS=-DUSEIMPORTLIB
- : ${NM=nm}
- AC_SUBST(NM)
- : ${DLLWRAP=dllwrap}
- AC_SUBST(DLLWRAP)
;;
*)
;;