ruby-changes:47015
From: nobu <ko1@a...>
Date: Wed, 21 Jun 2017 12:27:26 +0900 (JST)
Subject: [ruby-changes:47015] nobu:r59130 (trunk): configure.in: use AS_IF
nobu 2017-06-21 12:27:21 +0900 (Wed, 21 Jun 2017) New Revision: 59130 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59130 Log: configure.in: use AS_IF Modified files: trunk/configure.in Index: configure.in =================================================================== --- configure.in (revision 59129) +++ configure.in (revision 59130) @@ -28,7 +28,7 @@ rm() { https://github.com/ruby/ruby/blob/trunk/configure.in#L28 AS_CASE("$arg", [--*], [], [-*r*], [break], - [conftest.*], [if test -d "$arg"; then rm_recursive=-r; break; fi], + [conftest.*], [AS_IF([test -d "$arg"], [rm_recursive=-r; break])], []) done command rm $rm_recursive "[$]@" @@ -48,15 +48,15 @@ AC_ARG_WITH(baseruby, https://github.com/ruby/ruby/blob/trunk/configure.in#L48 [ AC_PATH_PROG([BASERUBY], [ruby], [false]) ]) -if test "$HAVE_BASERUBY" = yes -a "`RUBYOPT=- $BASERUBY -e 'print 42' 2>/dev/null`" = 42; then - if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'print 42' 2>/dev/null`" = 42; then +AS_IF([test "$HAVE_BASERUBY" = yes -a "`RUBYOPT=- $BASERUBY -e 'print 42' 2>/dev/null`" = 42], [ + AS_IF([test "`RUBYOPT=- $BASERUBY --disable=gems -e 'print 42' 2>/dev/null`" = 42], [ BASERUBY="$BASERUBY --disable=gems" - fi + ]) $BASERUBY -C "$srcdir" tool/downloader.rb -d tool -e gnu config.guess config.sub -else +], [ BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false" HAVE_BASERUBY=no -fi +]) AC_SUBST(BASERUBY) AC_SUBST(HAVE_BASERUBY) @@ -82,10 +82,10 @@ AC_CACHE_CHECK(for mingw32 environment, https://github.com/ruby/ruby/blob/trunk/configure.in#L82 #endif ], rb_cv_mingw32=yes,rb_cv_mingw32=no) rm -f conftest*]) -if test "$rb_cv_mingw32" = yes; then +AS_IF([test "$rb_cv_mingw32" = yes], [ target_os="mingw32" : ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"} -fi +]) ]) AS_CASE(["$target_os"], [mingw*msvc], [ target_os="`echo ${target_os} | sed 's/msvc$//'`" @@ -103,10 +103,10 @@ AC_DEFUN([RUBY_NACL], https://github.com/ruby/ruby/blob/trunk/configure.in#L103 host_vendor=chromium ac_cv_host=chromium AC_MSG_CHECKING([wheather \$NACL_SDK_ROOT is set]) - if test x"${NACL_SDK_ROOT}" = x; then + AS_IF([test x"${NACL_SDK_ROOT}" = x], [ AC_MSG_RESULT([no]) AC_MSG_ERROR([You need to set \$NACL_SDK_ROOT environment variable to build for NativeClient]) - fi + ]) AC_MSG_RESULT([yes]) nacl_cv_build_variant=glibc @@ -135,59 +135,59 @@ AC_DEFUN([RUBY_NACL], https://github.com/ruby/ruby/blob/trunk/configure.in#L135 ac_tool_prefix="$host_cpu-nacl-" AC_MSG_CHECKING([NativeClient toolchain]) - if test x"$nacl_cv_cpu_nick" = xpnacl; then + AS_IF([test x"$nacl_cv_cpu_nick" = xpnacl], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_pnacl" ac_tool_prefix=pnacl- - elif test -d \ - "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then + ], [test -d \ + "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}" - elif test -d \ - "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"; then + ], [test -d \ + "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}" - else + ], [ AS_CASE( ["${nacl_cv_build_variant}"], - [glibc], [if test \ + [glibc], [AS_IF([test \ -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_newlib" \ - -a -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"; then + -a -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}" - fi], + ])], [newlib], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}" ]) - fi - if test ! -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/${ac_tool_prefix}gcc"; then - if test "${build_cpu}" = i686 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then + ]) + AS_IF([test ! -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/${ac_tool_prefix}gcc"], [ + AS_IF([test "${build_cpu}" = i686 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"], [ ac_tool_prefix=nacl- - fi - if test "${build_cpu}" = x86_64 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then + ]) + AS_IF([test "${build_cpu}" = x86_64 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"], [ ac_tool_prefix=nacl64- - fi - fi - if test -z "${NACL_TOOLCHAIN}"; then + ]) + ]) + AS_IF([test -z "${NACL_TOOLCHAIN}"], [ AC_MSG_ERROR([Unrecognized --host and --build combination or NaCl SDK is not installed]) - fi + ]) AC_MSG_RESULT(${NACL_TOOLCHAIN}) AC_MSG_CHECKING([path to SDK]) - if ! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then + AS_IF([! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null], [ PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" - fi + ]) AC_MSG_RESULT(${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin) RUBY_APPEND_OPTIONS(XCFLAGS, '-I$(NACL_SDK_ROOT)/include') - if test x"${nacl_cv_cpu_nick}" = xpnacl; then + AS_IF([test x"${nacl_cv_cpu_nick}" = xpnacl], [ RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/pnacl') - elif test x"${nacl_cv_build_variant}" = xnewlib; then + ], [test x"${nacl_cv_build_variant}" = xnewlib], [ RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/newlib') - fi + ]) AC_MSG_CHECKING([nacl library path]) - if test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}/Release"; then + AS_IF([test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}/Release"], [ nacl_cv_libpath="${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}" - elif test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_cpu_nick2}/Release"; then + ], [test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_cpu_nick2}/Release"], [ nacl_cv_libpath="${nacl_cv_cpu_nick2}" - else + ], [ AC_MSG_ERROR([not found]) - fi + ]) AC_MSG_RESULT([${nacl_cv_libpath}]) RUBY_APPEND_OPTIONS(XLDFLAGS, '-L$(NACL_SDK_ROOT)/'"lib/${nacl_cv_libpath}/Release") @@ -218,23 +218,22 @@ AC_TRY_CPP([test-for-cppout], https://github.com/ruby/ruby/blob/trunk/configure.in#L218 [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes]) CPPFLAGS="$save_CPPFLAGS" rm -f conftest*]) -if test "$rb_cv_cppoutfile" = yes; then +AS_IF([test "$rb_cv_cppoutfile" = yes], [ CPPOUTFILE='-o conftest.i' -elif test "$rb_cv_cppoutfile" = no; then +], [test "$rb_cv_cppoutfile" = no], [ CPPOUTFILE='> conftest.i' -elif test -n "$rb_cv_cppoutfile"; then +], [test -n "$rb_cv_cppoutfile"], [ CPPOUTFILE="$rb_cv_cppoutfile" -fi +]) AC_SUBST(CPPOUTFILE)]) AC_DEFUN([RUBY_PROG_GNU_LD], [AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld, -[if `$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null; then +[AS_IF([`$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null], [ rb_cv_prog_gnu_ld=yes -else +], [ rb_cv_prog_gnu_ld=no -fi -]) +])]) GNU_LD=$rb_cv_prog_gnu_ld AC_SUBST(GNU_LD)]) @@ -244,9 +243,9 @@ MAJOR=`echo $RUBY_PROGRAM_VERSION | cut https://github.com/ruby/ruby/blob/trunk/configure.in#L243 MINOR=`echo $RUBY_PROGRAM_VERSION | cut -d. -f2` TEENY=`echo $RUBY_PROGRAM_VERSION | cut -d. -f3` for v in MAJOR MINOR TEENY; do - if eval "test \"\$$v\" = ''"; then + AS_IF([eval "test \"\$$v\" = ''"], [ AC_MSG_ERROR(could not determine $v number from version.h) - fi + ]) done AS_IF([test "$MAJOR.$MINOR" != "$API_MAJOR.$API_MINOR"], [ AC_MSG_ERROR([API version $API_MAJOR.$API_MINOR differs from program version $MAJOR.$MINOR]) @@ -268,19 +267,18 @@ AC_ARG_WITH(gcc, https://github.com/ruby/ruby/blob/trunk/configure.in#L267 [yes], [: ${CC=gcc}], [CC=$withval])]) dnl If the user switches compilers, we can't believe the cache -if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" -then +AS_IF([test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"], [ AC_MSG_ERROR(cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)) -fi +]) test -z "$CC" || ac_cv_prog_CC="$CC" -if test "$program_prefix" = NONE; then +AS_IF([test "$program_prefix" = NONE], [ program_prefix= -fi -if test "$prefix" -ef .; then +]) +AS_IF([test "$prefix" -ef .], [ AC_MSG_ERROR(--prefix cannot be the current working directory.) -fi +]) RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"` RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"` AC_SUBST(RUBY_BASE_NAME) @@ -371,7 +369,7 @@ ARCH_FLAG=`expr " $CFLAGS " : ['.* \(-m[ https://github.com/ruby/ruby/blob/trunk/configure.in#L369 test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']` test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed [-e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g']` unset universal_binary universal_archnames -if test ${target_archs+set}; then +AS_IF([test ${target_archs+set}], [ AC_MSG_CHECKING([target architectures]) target_archs=`echo $target_archs | tr , ' '` # /usr/lib/arch_tool -archify_list $TARGET_ARCHS @@ -397,25 +395,25 @@ if test ${target_archs+set}; then https://github.com/ruby/ruby/blob/trunk/configure.in#L395 target=`echo $target | sed "s/^$target_cpu-/-/"` target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"` - if test "${universal_binary-no}" = yes; then + AS_IF([test "${universal_binary-no}" = yes], [ AC_SUBST(try_header,try_compile) target_cpu=universal real_cross_compiling=$cross_compiling - else - if test x"$target_cpu" != x"${target_archs}"; then + ], [ + AS_IF([test x"$target_cpu" != x"${target_archs}"], [ echo 'int main(){return 0;}' > conftest.c - if $CC $CFLAGS $ARCH_FLAG -o conftest conftest.c > /dev/null 2>&1; then + AS_IF([$CC $CFLAGS $ARCH_FLAG -o conftest conftest.c > /dev/null 2>&1], [ rm -fr conftest.* - else + ], [ RUBY_DEFAULT_ARCH("$target_archs") - fi - fi + ]) + ]) target_cpu=${target_archs} - fi + ]) AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"]) AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"]) -else - if test x"$target_alias" = x; then +], [ + AS_IF([test x"$target_alias" = x], [ AS_CASE(["$target_os"], [darwin*], [ AC_MSG_CHECKING([for real target cpu]) @@ -438,18 +436,18 @@ EOF https://github.com/ruby/ruby/blob/trunk/configure.in#L436 target="$target_cpu${target}" AC_MSG_RESULT([$target_cpu]) ]) - fi + ]) target_archs="$target_cpu" -fi -if test "${target_archs}" != "${rb_cv_target_archs-${target_archs}}"; then +]) +AS_IF([test "${target_archs}" != "${rb_cv_target_archs-${target_archs}}"], [ AC_MSG_ERROR([target arch(s) has changed from ${rb_cv_target_archs-nothing} to ${target_archs}]) -else +], [ rb_cv_target_archs=${target_archs} -fi -if test "x${ARCH_FLAG}" != x; then +]) +AS_IF([test "x${ARCH_FLAG}" != x], [ CFLAGS="${CFLAGS:+$CFLAGS }${ARCH_FLAG}" LDFLAGS="${LDFLAGS:+$LDFLAGS }${ARCH_FLAG}" -fi +]) # RUBY_UNIVERSAL_ARCH end ]) @@ -468,16 +466,16 @@ test -z "$debugflags" || https://github.com/ruby/ruby/blob/trunk/configure.in#L466 cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g' test -z "warnflags" || cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g' -if test -z "${CFLAGS+set}"; then +AS_IF([test -z "${CFLAGS+set}"], [ cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"` orig_cflags="$cflags" cflags="$cflags "'${optflags} ${debugflags} ${warnflags}' -fi -if test -z "${CXXFLAGS+set}"; then +]) +AS_IF([test -z "${CXXFLAGS+set}"], [ cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"` orig_cxxflags="$cxxflags" cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}' -fi +]) RUBY_NACL AS_CASE(["$host_os:$build_os"], @@ -487,17 +485,17 @@ AS_CASE(["$host_os:$build_os"], https://github.com/ruby/ruby/blob/trunk/configure.in#L485 # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported) # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn) # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn) - if ! $CC -E -xc - <<SRC >/dev/null; then + AS_IF([! $CC -E -xc - <<SRC >/dev/null], [ @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 @%:@error premature clang @%:@endif SRC AC_MSG_ERROR([clang version 3.0 or later is required]) - fi + ]) ]) -if test x"${build}" != x"${host}"; then +AS_IF([test x"${build}" != x"${host}"], [ AC_CHECK_TOOL(CC, gcc) -fi +]) AC_PROG_CC @@ -521,7 +519,7 @@ AS_CASE(["$target_os"], https://github.com/ruby/ruby/blob/trunk/configure.in#L519 [solaris*], [AC_PATH_TOOL([LD], [ld], [/usr/ccs/bin/ld], [/usr/ccs/bin:$PATH])], [AC_CHECK_TOOL([LD], [ld], [ld])]) AC_SUBST(LD) -if test "$GCC" = yes; then +AS_IF([test "$GCC" = yes], [ linker_flag=-Wl, : ${optflags=-O3} gcc_major=`echo =__GNUC__ | $CC -E -xc - | sed '/^=/!d;s///'` @@ -529,9 +527,9 @@ if test "$GCC" = yes; then https://github.com/ruby/ruby/blob/trunk/configure.in#L527 test -n "$gcc_major" || gcc_major=0 test -n "$gcc_minor" || gcc_minor=0 # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"]) -else +], [ linker_flag= -fi +]) RUBY_PROG_GNU_LD RUBY_CPPOUTFILE @@ -556,9 +554,9 @@ AC_SUBST(CC_VERSION, $cc_version) https://github.com/ruby/ruby/blob/trunk/configure.in#L554 AC_SUBST(CC_VERSION_MESSAGE, $cc_version_message) RUBY_UNIVERSAL_ARCH -if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no; then +AS_IF([test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no], [ RUBY_DEFAULT_ARCH("$target_cpu") -fi +]) AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [ AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [ @@ -568,7 +566,7 @@ AS_CASE(["$target_cpu-$target_os"], [[i[ https://github.com/ruby/ruby/blob/trunk/configure.in#L566 ], [rb_cv_gcc_compiler_cas=yes], [rb_cv_gcc_compiler_cas=no])]) - if test "$rb_cv_gcc_compiler_cas" = no; then + AS_IF([test "$rb_cv_gcc_compiler_cas" = no], [ unset rb_cv_gcc_compiler_cas save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486" @@ -581,13 +579,13 @@ AS_CASE(["$target_cpu-$target_os"], [[i[ https://github.com/ruby/ruby/blob/trunk/configure.in#L579 ARCH_FLAG="-march=i486"], [rb_cv_gcc_compiler_cas=no])]) CFLAGS="$save_CFLAGS" - fi]) + ])]) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(AR, ar) -if test -z "$AR"; then +AS_IF([test -z "$AR"], [ AC_CHECK_PROGS(AR, aal, ar) -fi +]) AC_CACHE_CHECK([for $AR D option], [rb_cv_ar_D_option], [ AS_IF([$AR rcD conftest.a > /dev/null 2>&1 && rm conftest.a], [rb_cv_ar_D_option=yes], [rb_cv_ar_D_option=no]) @@ -639,14 +637,14 @@ AC_PROG_LN_S https://github.com/ruby/ruby/blob/trunk/configure.in#L637 AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_MKDIR_P -if test "x$MKDIR_P" = "x -d"; then - if test x"$as_mkdir_p" != xfalse; then +AS_IF([test "x$MKDIR_P" = "x -d"], [ + AS_IF([test x"$as_mkdir_p" != xfalse], [ MKDIR_P='mkdir -p' echo "use 'mkdir -p' as MKDIR_P" - else + ], [ AC_MSG_ERROR([mkdir -p is required]) - fi -fi + ]) +]) MAKEDIRS="$MKDIR_P" AC_SUBST(MAKEDIRS) @@ -674,7 +672,7 @@ AC_DEFUN([RUBY_DTRACE_POSTPROCESS], https://github.com/ruby/ruby/blob/trunk/configure.in#L672 [AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g, [ rb_cv_prog_dtrace_g=no - if { + AS_IF([{ cat >conftest_provider.d <<_PROBES && provider conftest { probe fire(); @@ -682,28 +680,28 @@ AC_DEFUN([RUBY_DTRACE_POSTPROCESS], https://github.com/ruby/ruby/blob/trunk/configure.in#L680 _PROBES $DTRACE ${DTRACE_OPT} -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && : - }; then + }], [ AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [ - if { + AS_IF([{ cp -p conftest.${ac_objext} conftest.${ac_objext}.save && $DTRACE ${DTRACE_OPT} -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null && : - }; then - if cmp -s conftest.o conftest.${ac_objext}.save; then + }], [ + AS_IF([cmp -s conftest.o conftest.${ac_objext}.save], [ rb_cv_prog_dtrace_g=yes - else + ], [ rb_cv_prog_dtrace_g=rebuild - fi - fi]) - fi + ]) + ])]) + ]) rm -f conftest.[co] conftest_provider.[dho] ]) ]) AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace]) -if test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"; then +AS_IF([test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"], [ AC_CHECK_PROG([DTRACE], [dtrace], [dtrace]) -fi +]) AC_CHECK_PROGS(DOT, dot) AC_CHECK_PROGS(DOXYGEN, doxygen) @@ -737,11 +735,11 @@ $as_ln_s ../build . > /dev/null 2>&1 && https://github.com/ruby/ruby/blob/trunk/configure.in#L735 for chdir in 'cd -P' 'PWD= cd'; do /bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break done) -if test -f conf$$.dir/src/cdcmd; then +AS_IF([test -f conf$$.dir/src/cdcmd], [ read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null -else +], [ CHDIR=cd -fi +]) rm -fr conf$$.dir AC_MSG_RESULT([$CHDIR]) AC_SUBST(CHDIR) @@ -752,20 +750,20 @@ AC_SUBST(CHDIR) https://github.com/ruby/ruby/blob/trunk/configure.in#L750 AC_DEFUN([RUBY_WERROR_FLAG], [dnl save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $rb_cv_warnflags" -if test "${ac_c_werror_flag+set}"; then +AS_IF([test "${ac_c_werror_flag+set}"], [ rb_c_werror_flag="$ac_c_werror_flag" -else +], [ unset rb_c_werror_flag -fi +]) ac_c_werror_flag=yes $1 CFLAGS="$save_CFLAGS" save_CFLAGS= -if test "${rb_c_werror_flag+set}"; then +AS_IF([test "${rb_c_werror_flag+set}"], [ ac_c_werror_flag="$rb_c_werror_flag" -else +], [ unset ac_c_werror_flag -fi]) +])]) RUBY_WERROR_FLAG([ AC_MSG_CHECKING([whether CFLAGS is valid]) @@ -851,15 +849,15 @@ AC_ARG_ENABLE(werror, https://github.com/ruby/ruby/blob/trunk/configure.in#L849 [particular_werror_flags=$enableval]) rb_cv_warnflags="$warnflags" -if test "$GCC:${warnflags+set}:no" = yes::no; then - if test $gcc_major -ge 4; then +AS_IF([test "$GCC:${warnflags+set}:no" = yes::no], [ + AS_IF([test $gcc_major -ge 4], [ extra_warning=-Werror=extra-tokens - else + ], [ extra_warning= - fi - if test $gcc_major -ge 5 -a $gcc_major -le 6; then + ]) + AS_IF([test $gcc_major -ge 5 -a $gcc_major -le 6], [ extra_warning="$extra_warning -Wno-maybe-uninitialized" - fi + ]) for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \ -diag-disable=2259 \ -Wno-missing-field-initializers \ @@ -882,9 +880,9 @@ if test "$GCC:${warnflags+set}:no" = yes https://github.com/ruby/ruby/blob/trunk/configure.in#L880 -Wimplicit-fallthrough=0 \ $extra_warning \ ; do - if test "$particular_werror_flags" != yes; then + AS_IF([test "$particular_werror_flags" != yes], [ wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'` - fi + ]) ok=no RUBY_TRY_CFLAGS($wflag, [ RUBY_APPEND_OPTIONS(warnflags, $wflag) @@ -904,7 +902,7 @@ if test "$GCC:${warnflags+set}:no" = yes https://github.com/ruby/ruby/blob/trunk/configure.in#L902 # Di (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/