diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 62 |
1 files changed, 54 insertions, 8 deletions
diff --git a/configure.in b/configure.in index b24f492665..094098861d 100644 --- a/configure.in +++ b/configure.in @@ -90,14 +90,20 @@ AC_CHECK_TOOL(AR, ar) AC_CHECK_PROGS(AR, ar aal, ar) case "$target_os" in - cygwin*|mingw*) - AC_CHECK_TOOL(NM, nm) - AC_CHECK_TOOL(DLLWRAP, dllwrap) - AC_CHECK_TOOL(AS, as) - AC_CHECK_TOOL(DLLTOOL, dlltool) - AC_CHECK_TOOL(WINDRES, windres) - ;; +cygwin*|mingw*) + AC_CHECK_TOOL(NM, nm) + AC_CHECK_TOOL(DLLWRAP, dllwrap) + AC_CHECK_TOOL(AS, as) + AC_CHECK_TOOL(DLLTOOL, dlltool) + AC_CHECK_TOOL(WINDRES, windres) + echo 'main(){}' > conftest.c + if $CC -mwin32 -c conftest.c 2> /dev/null; then + MWIN32=-mwin32 + CFLAGS="$CFLAGS $MWIN32" + fi + ;; esac +AC_SUBST(MWIN32) AC_PROG_LN_S AC_PROG_MAKE_SET @@ -163,6 +169,14 @@ if test "$rb_cv_have_attr_noreturn" = yes; then AC_DEFINE(HAVE_ATTR_NORETURN) fi +dnl wheather link libc_r or not +AC_ARG_WITH(libc_r, + [--with-libc_r link libc_r if possible (FreeBSD only)], [ + case $withval in + yes) with_libc_r=yes;; + *) with_libc_r=no;; + esac], [with_libc_r=yes]) + dnl Checks for libraries. case "$target_os" in nextstep*) ;; @@ -184,6 +198,8 @@ mingw*) LIBS="-lwsock32 -lmsvcrt $LIBS" ac_cv_func_times=yes;; os2_emx*) LIBS="-lm $LIBS" ac_cv_lib_dir_opendir=no;; +msdosdjgpp*) LIBS="-lm $LIBS" + ac_cv_func_getpgrp_void=yes;; freebsd*) LIBS="-lm $LIBS" AC_CACHE_CHECK([whether -lxpg4 has to be linked], rb_cv_lib_xpg4_needed, @@ -200,6 +216,25 @@ freebsd*) LIBS="-lm $LIBS" if test "$rb_cv_lib_xpg4_needed" = yes; then AC_CHECK_LIB(xpg4, setlocale) fi + if test "$with_libc_r" = yes; then + AC_CACHE_CHECK([whether libc_r is supplementary to libc], + rb_cv_supplementary_lib_c_r, + [AC_TRY_CPP([ +#include <osreldate.h> +#if 500016 <= __FreeBSD_version +#error libc_r is supplementary to libc +#endif + ], + rb_cv_supplementary_lib_c_r=no, + rb_cv_supplementary_lib_c_r=yes, + rb_cv_supplementary_lib_c_r=yes)]) + if test "$rb_cv_supplementary_lib_c_r" = yes; then + MAINLIBS="-lc_r $MAINLIBS" + else + MAINLIBS="-pthread $MAINLIBS" + CFLAGS="-D_THREAD_SAFE $CFLAGS" + fi + fi ;; *) LIBS="-lm $LIBS";; esac @@ -316,6 +351,7 @@ test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o" AC_C_BIGENDIAN AC_C_CONST AC_C_CHAR_UNSIGNED +AC_C_INLINE AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign, [AC_TRY_RUN([ @@ -380,7 +416,7 @@ AC_ARG_WITH(default-kcode, esac]) AC_DEFINE_UNQUOTED(DEFAULT_KCODE, $DEFAULT_KCODE) -dnl wheather use dln_a_out ot not +dnl wheather use dln_a_out or not AC_ARG_WITH(dln-a-out, [--with-dln-a-out use dln_a_out if possible], [ case $withval in @@ -757,6 +793,9 @@ if test "$enable_shared" = 'yes'; then LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)' CFLAGS="$CFLAGS $CCDLFLAGS" ENABLE_SHARED=yes + if test "$rb_cv_binary_elf" = yes; then + SOLIBS='$(LIBS)' + fi case "$target_os" in sunos4*) LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).so' @@ -766,6 +805,7 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).so' ;; freebsd*) + SOLIBS='$(LIBS)' LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR)' if test "$rb_cv_binary_elf" != "yes" ; then LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)" @@ -773,6 +813,7 @@ if test "$enable_shared" = 'yes'; then fi ;; netbsd*) + SOLIBS='$(LIBS)' LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)' if test "$rb_cv_binary_elf" = yes; then # ELF platforms LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so' @@ -780,6 +821,9 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_ALIASES= # a.out platforms fi ;; + openbsd*) + SOLIBS='$(LIBS)' + ;; solaris*) XLDFLAGS='-R${prefix}/lib' ;; @@ -893,6 +937,7 @@ AC_SUBST(LIBRUBYARG) AC_SUBST(SOLIBS) AC_SUBST(DLDLIBS) AC_SUBST(ENABLE_SHARED) +AC_SUBST(MAINLIBS) ri_prefix= test "$program_prefix" != NONE && @@ -963,5 +1008,6 @@ fi echo "creating config.h" tr -d '\015' < confdefs.h > config.h +: > confdefs.h AC_OUTPUT($FIRSTMAKEFILE Makefile ext/extmk.rb) |