$NetBSD: patch-configure,v 1.6 2018/01/16 14:53:27 jperkin Exp $ * Adding Interix support. * Ignore doxygen. * Pass LDFLAGS to LIBRUBY_DLDFLAGS via DLDFLAGS as Ruby 2.4 dose. * Handle SSP in pkgsrc. --- configure.orig 2017-12-14 16:00:13.000000000 +0000 +++ configure @@ -5581,7 +5581,7 @@ esac else if test x"$target_alias" = x; then case "$target_os" in #( - darwin*) : + notdarwin*) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for real target cpu" >&5 $as_echo_n "checking for real target cpu... " >&6; } @@ -7456,6 +7456,7 @@ fi +: ${DLDFLAGS="$LDFLAGS"} case $RUBY_PATCHLEVEL in #( -*) : @@ -7796,6 +7797,7 @@ esac stack_protector=no ;; #( *) : + stack_protector=no ;; esac if test -z "${stack_protector+set}"; then @@ -8909,6 +8911,10 @@ esac LIBS="-lm $LIBS" ac_cv_func_round=no ;; #( + interix*) : + LIBS="-lm $LIBS" + ac_cv_func_getpgrp_void=yes + ;; #( nacl) : LIBS="-lm $LIBS" @@ -17004,6 +17010,8 @@ else # ifdef _MSC_VER # include # define alloca _alloca +# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) +# include # else # ifdef HAVE_ALLOCA_H # include @@ -21293,7 +21301,9 @@ esac ;; #( interix*) : : ${LDSHARED='$(CC) -shared'} XLDFLAGS="$XLDFLAGS -Wl,-E" + DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(.TARGET) -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280))' LIBPATHFLAG=" -L%1\$-s" + RPATHFLAG=' -Wl,-R%1$-s' rb_cv_dlopen=yes ;; #( freebsd*|dragonfly*) : @@ -22503,7 +22513,17 @@ esac ;; #( linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu) : - LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'" $LDFLAGS_OPTDIR" + # RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS) + for rb_opt in '-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)' "$LDFLAGS_OPTDIR"; do + case " ${LIBRUBY_DLDFLAGS-} " in #( + *" ${rb_opt} "*) : + ;; #( + ' ') : + LIBRUBY_DLDFLAGS="${rb_opt}" ;; #( + *) : + LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS ${rb_opt}" ;; +esac + done LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so' if test "$load_relative" = yes; then libprefix="'\$\${ORIGIN}/../${libdir_basename}'" @@ -22514,7 +22534,7 @@ esac freebsd*|dragonfly*) : SOLIBS='$(LIBS)' - LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' + LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)$(TEENY)' if test "$rb_cv_binary_elf" != "yes" ; then LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)" LIBRUBY_ALIASES='' @@ -22524,7 +22544,17 @@ esac SOLIBS='$(LIBS)' LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)' - LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'" $LDFLAGS_OPTDIR" + # RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS) + for rb_opt in '-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' "$LDFLAGS_OPTDIR"; do + case " ${LIBRUBY_DLDFLAGS-} " in #( + *" ${rb_opt} "*) : + ;; #( + ' ') : + LIBRUBY_DLDFLAGS="${rb_opt}" ;; #( + *) : + LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS ${rb_opt}" ;; +esac + done if test "$rb_cv_binary_elf" = yes; then # ELF platforms LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so' else # a.out platforms @@ -22556,7 +22586,17 @@ esac ;; #( aix*) : - LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS $LDFLAGS_OPTDIR" + # RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS) + for rb_opt in "${linker_flag}-bnoentry" "$XLDFLAGS" "$LDFLAGS_OPTDIR"; do + case " ${LIBRUBY_DLDFLAGS-} " in #( + *" ${rb_opt} "*) : + ;; #( + ' ') : + LIBRUBY_DLDFLAGS="${rb_opt}" ;; #( + *) : + LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS ${rb_opt}" ;; +esac + done LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}' SOLIBS='-lm -lc' ;; #( @@ -22565,7 +22605,7 @@ esac case "$target_cpu" in #( powerpc*) : - LIBRUBY_DLDFLAGS="-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o $LDFLAGS_OPTDIR" + LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS -f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o $LDFLAGS_OPTDIR" ;; #( *) : ;; @@ -22593,7 +22633,12 @@ esac ;; #( interix*) : - LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)' + SOLIBS='$(LIBS)' + LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)' + # link explicitly to 0x48000000 + LIBRUBY_DLDFLAGS='-Wl,-h,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) -Wl,--image-base,1207959552' + LIBRUBYARG_SHARED='-Wl,-R -Wl,${PREFIX}/lib} -L${libdir} -L. -l$(RUBY_SO_NAME)' + LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so' ;; #( mingw*|cygwin*|mswin*) : @@ -22766,7 +22811,7 @@ if test "$enable_rpath" = yes; then esac rpathflag=`IFS="$PATH_SEPARATOR" echo x "$rpathflag" | - sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${libprefix}${IFS}g" + sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${PREFIX}/lib${IFS}g" ` LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${rpathflag}" LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED" @@ -23085,11 +23130,7 @@ if test "$install_doc" != no; then else RDOCTARGET="nodoc" fi - if test "$install_capi" != no -a -n "$DOXYGEN"; then - CAPITARGET="capi" - else - CAPITARGET="nodoc" - fi + CAPITARGET="nodoc" else RDOCTARGET="nodoc" CAPITARGET="nodoc" @@ -25195,17 +25236,7 @@ which seems to be undefined. Please mak "Makefile":F) tmpmk=confmk$$.tmp { - if test ${VCS+set}; then - : - elif svn info "$srcdir" > /dev/null 2>&1; then - VCS='svn' - elif test -d "$srcdir/.git/svn"; then - VCS='git svn' - elif test -d "$srcdir/.git"; then - VCS='git' - else - VCS='echo cannot' - fi + VCS='echo cannot' case "$VCS" in #( svn) : VCSUP='$(VCS) up $(SVNUPOPTIONS)' ;; #(