1 #
   2 # Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 ###############################################################################
  27 # Setup the most fundamental tools that relies on not much else to set up,
  28 # but is used by much of the early bootstrap code.
  29 AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
  30 [
  31   # Start with tools that do not need have cross compilation support
  32   # and can be expected to be found in the default PATH. These tools are
  33   # used by configure.
  34 
  35   # First are all the simple required tools.
  36   UTIL_REQUIRE_PROGS(BASENAME, basename)
  37   UTIL_REQUIRE_PROGS(BASH, bash)
  38   UTIL_REQUIRE_PROGS(CAT, cat)
  39   UTIL_REQUIRE_PROGS(CHMOD, chmod)
  40   UTIL_REQUIRE_PROGS(CMP, cmp)
  41   UTIL_REQUIRE_PROGS(COMM, comm)
  42   UTIL_REQUIRE_PROGS(CP, cp)
  43   UTIL_REQUIRE_PROGS(CUT, cut)
  44   UTIL_REQUIRE_PROGS(DATE, date)
  45   UTIL_REQUIRE_PROGS(DIFF, [gdiff diff])
  46   UTIL_REQUIRE_PROGS(DIRNAME, dirname)
  47   UTIL_REQUIRE_PROGS(ECHO, echo)
  48   UTIL_REQUIRE_PROGS(EXPR, expr)
  49   UTIL_REQUIRE_PROGS(FILE, file)
  50   UTIL_REQUIRE_PROGS(FIND, find)
  51   UTIL_REQUIRE_PROGS(HEAD, head)
  52   UTIL_REQUIRE_PROGS(GUNZIP, gunzip)
  53   UTIL_REQUIRE_PROGS(GZIP, pigz gzip)
  54   UTIL_REQUIRE_PROGS(LN, ln)
  55   UTIL_REQUIRE_PROGS(LS, ls)
  56   # gmkdir is known to be safe for concurrent invocations with -p flag.
  57   UTIL_REQUIRE_PROGS(MKDIR, [gmkdir mkdir])
  58   UTIL_REQUIRE_PROGS(MKTEMP, mktemp)
  59   UTIL_REQUIRE_PROGS(MV, mv)
  60   UTIL_REQUIRE_PROGS(NAWK, [nawk gawk awk])
  61   UTIL_REQUIRE_PROGS(PRINTF, printf)
  62   UTIL_REQUIRE_PROGS(READLINK, [greadlink readlink])
  63   UTIL_REQUIRE_PROGS(RM, rm)
  64   UTIL_REQUIRE_PROGS(RMDIR, rmdir)
  65   UTIL_REQUIRE_PROGS(SH, sh)
  66   UTIL_REQUIRE_PROGS(SORT, sort)
  67   UTIL_REQUIRE_PROGS(TAIL, tail)
  68   UTIL_REQUIRE_PROGS(TAR, gtar tar)
  69   UTIL_REQUIRE_PROGS(TEE, tee)
  70   UTIL_REQUIRE_PROGS(TOUCH, touch)
  71   UTIL_REQUIRE_PROGS(TR, tr)
  72   UTIL_REQUIRE_PROGS(UNAME, uname)
  73   UTIL_REQUIRE_PROGS(UNIQ, uniq)
  74   UTIL_REQUIRE_PROGS(WC, wc)
  75   UTIL_REQUIRE_PROGS(WHICH, which)
  76   UTIL_REQUIRE_PROGS(XARGS, xargs)
  77 
  78   # Then required tools that require some special treatment.
  79   UTIL_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
  80   UTIL_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
  81   UTIL_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
  82   UTIL_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
  83   UTIL_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
  84 
  85   # Always force rm.
  86   RM="$RM -f"
  87 
  88   # pwd behaves differently on various platforms and some don't support the -L flag.
  89   # Always use the bash builtin pwd to get uniform behavior.
  90   THEPWDCMD=pwd
  91 
  92   # These are not required on all platforms
  93   UTIL_PATH_PROGS(CYGPATH, cygpath)
  94   UTIL_PATH_PROGS(WSLPATH, wslpath)
  95   UTIL_PATH_PROGS(DF, df)
  96   UTIL_PATH_PROGS(CPIO, [cpio bsdcpio])
  97   UTIL_PATH_PROGS(NICE, nice)
  98 
  99   UTIL_PATH_PROGS(LSB_RELEASE, lsb_release)
 100   UTIL_PATH_PROGS(CMD, [cmd.exe /mnt/c/Windows/System32/cmd.exe])
 101 ])
 102 
 103 ###############################################################################
 104 # Check if we have found a usable version of make
 105 # $1: the path to a potential make binary (or empty)
 106 # $2: the description on how we found this
 107 AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
 108 [
 109   MAKE_CANDIDATE="$1"
 110   DESCRIPTION="$2"
 111 
 112   # On Cygwin, we require a newer version of make than on other platforms
 113   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 114     MAKE_VERSION_EXPR="-e 4\."
 115     MAKE_REQUIRED_VERSION="4.0"
 116    else
 117     MAKE_VERSION_EXPR="-e 3\.8[[12]] -e 4\."
 118     MAKE_REQUIRED_VERSION="3.81"
 119   fi
 120 
 121   if test "x$MAKE_CANDIDATE" != x; then
 122     AC_MSG_NOTICE([Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION])
 123     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
 124     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
 125     if test "x$IS_GNU_MAKE" = x; then
 126       AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
 127     else
 128       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR`
 129       if test "x$IS_MODERN_MAKE" = x; then
 130         AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
 131       else
 132         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
 133           if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 134             MAKE_EXPECTED_ENV='cygwin'
 135           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 136             MAKE_EXPECTED_ENV='msys'
 137           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
 138             MAKE_EXPECTED_ENV='x86_64-.*-linux-gnu'
 139           else
 140             AC_MSG_ERROR([Unknown Windows environment])
 141           fi
 142           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
 143           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
 144         else
 145           # Not relevant for non-Windows
 146           IS_MAKE_CORRECT_ENV=true
 147         fi
 148         if test "x$IS_MAKE_CORRECT_ENV" = x; then
 149           AC_MSG_NOTICE([Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring.])
 150         else
 151           FOUND_MAKE=$MAKE_CANDIDATE
 152           UTIL_FIXUP_EXECUTABLE(FOUND_MAKE)
 153         fi
 154       fi
 155     fi
 156   fi
 157 ])
 158 
 159 ###############################################################################
 160 AC_DEFUN([BASIC_CHECK_MAKE_OUTPUT_SYNC],
 161 [
 162   # Check if make supports the output sync option and if so, setup using it.
 163   AC_MSG_CHECKING([if make --output-sync is supported])
 164   if $MAKE --version -O > /dev/null 2>&1; then
 165     OUTPUT_SYNC_SUPPORTED=true
 166     AC_MSG_RESULT([yes])
 167     AC_MSG_CHECKING([for output-sync value])
 168     AC_ARG_WITH([output-sync], [AS_HELP_STRING([--with-output-sync],
 169       [set make output sync type if supported by make. @<:@recurse@:>@])],
 170       [OUTPUT_SYNC=$with_output_sync])
 171     if test "x$OUTPUT_SYNC" = "x"; then
 172       OUTPUT_SYNC=none
 173     fi
 174     AC_MSG_RESULT([$OUTPUT_SYNC])
 175     if ! $MAKE --version -O$OUTPUT_SYNC > /dev/null 2>&1; then
 176       AC_MSG_ERROR([Make did not the support the value $OUTPUT_SYNC as output sync type.])
 177     fi
 178   else
 179     OUTPUT_SYNC_SUPPORTED=false
 180     AC_MSG_RESULT([no])
 181   fi
 182   AC_SUBST(OUTPUT_SYNC_SUPPORTED)
 183   AC_SUBST(OUTPUT_SYNC)
 184 ])
 185 
 186 ###############################################################################
 187 # Goes looking for a usable version of GNU make.
 188 AC_DEFUN([BASIC_CHECK_GNU_MAKE],
 189 [
 190   UTIL_SETUP_TOOL([MAKE],
 191   [
 192     # Try our hardest to locate a correct version of GNU make
 193     AC_PATH_PROGS(CHECK_GMAKE, gmake)
 194     BASIC_CHECK_MAKE_VERSION("$CHECK_GMAKE", [gmake in PATH])
 195 
 196     if test "x$FOUND_MAKE" = x; then
 197       AC_PATH_PROGS(CHECK_MAKE, make)
 198       BASIC_CHECK_MAKE_VERSION("$CHECK_MAKE", [make in PATH])
 199     fi
 200 
 201     if test "x$FOUND_MAKE" = x; then
 202       if test "x$TOOLCHAIN_PATH" != x; then
 203         # We have a toolchain path, check that as well before giving up.
 204         OLD_PATH=$PATH
 205         PATH=$TOOLCHAIN_PATH:$PATH
 206         AC_PATH_PROGS(CHECK_TOOLSDIR_GMAKE, gmake)
 207         BASIC_CHECK_MAKE_VERSION("$CHECK_TOOLSDIR_GMAKE", [gmake in tools-dir])
 208         if test "x$FOUND_MAKE" = x; then
 209           AC_PATH_PROGS(CHECK_TOOLSDIR_MAKE, make)
 210           BASIC_CHECK_MAKE_VERSION("$CHECK_TOOLSDIR_MAKE", [make in tools-dir])
 211         fi
 212         PATH=$OLD_PATH
 213       fi
 214     fi
 215 
 216     if test "x$FOUND_MAKE" = x; then
 217       AC_MSG_ERROR([Cannot find GNU make $MAKE_REQUIRED_VERSION or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure.])
 218     fi
 219   ],[
 220     # If MAKE was set by user, verify the version
 221     BASIC_CHECK_MAKE_VERSION("$MAKE", [user supplied MAKE=$MAKE])
 222     if test "x$FOUND_MAKE" = x; then
 223       AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not GNU make $MAKE_REQUIRED_VERSION or newer.])
 224     fi
 225   ])
 226 
 227   MAKE=$FOUND_MAKE
 228   AC_SUBST(MAKE)
 229   AC_MSG_NOTICE([Using GNU make at $FOUND_MAKE (version: $MAKE_VERSION_STRING)])
 230 
 231   BASIC_CHECK_MAKE_OUTPUT_SYNC
 232 ])
 233 
 234 ###############################################################################
 235 AC_DEFUN([BASIC_CHECK_FIND_DELETE],
 236 [
 237   # Test if find supports -delete
 238   AC_MSG_CHECKING([if find supports -delete])
 239   FIND_DELETE="-delete"
 240 
 241   DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
 242 
 243   echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
 244 
 245   TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
 246   if test -f $DELETEDIR/TestIfFindSupportsDelete; then
 247     # No, it does not.
 248     $RM $DELETEDIR/TestIfFindSupportsDelete
 249     if test "x$OPENJDK_TARGET_OS" = "xaix"; then
 250       # AIX 'find' is buggy if called with '-exec {} \+' and an empty file list
 251       FIND_DELETE="-print | $XARGS $RM"
 252     else
 253       FIND_DELETE="-exec $RM \{\} \+"
 254     fi
 255     AC_MSG_RESULT([no])
 256   else
 257     AC_MSG_RESULT([yes])
 258   fi
 259   $RMDIR $DELETEDIR
 260   AC_SUBST(FIND_DELETE)
 261 ])
 262 
 263 ###############################################################################
 264 AC_DEFUN([BASIC_CHECK_TAR],
 265 [
 266   # Test which kind of tar was found
 267   if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then
 268     TAR_TYPE="gnu"
 269   elif test "x$($TAR --version | $GREP "bsdtar")" != "x"; then
 270     TAR_TYPE="bsd"
 271   elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
 272     TAR_TYPE="bsd"
 273   elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
 274     TAR_TYPE="solaris"
 275   elif test "x$OPENJDK_BUILD_OS" = "xaix"; then
 276     TAR_TYPE="aix"
 277   fi
 278   AC_MSG_CHECKING([what type of tar was found])
 279   AC_MSG_RESULT([$TAR_TYPE])
 280 
 281   TAR_CREATE_FILE_PARAM=""
 282 
 283   if test "x$TAR_TYPE" = "xgnu"; then
 284     TAR_INCLUDE_PARAM="T"
 285     TAR_SUPPORTS_TRANSFORM="true"
 286     if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
 287       # When using gnu tar for Solaris targets, need to use compatibility mode
 288       TAR_CREATE_EXTRA_PARAM="--format=ustar"
 289     fi
 290   elif test "x$TAR_TYPE" = "aix"; then
 291     # -L InputList of aix tar: name of file listing the files and directories
 292     # that need to be   archived or extracted
 293     TAR_INCLUDE_PARAM="L"
 294     TAR_SUPPORTS_TRANSFORM="false"
 295   else
 296     TAR_INCLUDE_PARAM="I"
 297     TAR_SUPPORTS_TRANSFORM="false"
 298   fi
 299   AC_SUBST(TAR_TYPE)
 300   AC_SUBST(TAR_CREATE_EXTRA_PARAM)
 301   AC_SUBST(TAR_INCLUDE_PARAM)
 302   AC_SUBST(TAR_SUPPORTS_TRANSFORM)
 303 ])
 304 
 305 ###############################################################################
 306 AC_DEFUN([BASIC_CHECK_GREP],
 307 [
 308   # Test that grep supports -Fx with a list of pattern which includes null pattern.
 309   # This is a problem for the grep resident on AIX.
 310   AC_MSG_CHECKING([that grep ($GREP) -Fx handles empty lines in the pattern list correctly])
 311   # Multiple subsequent spaces..
 312   STACK_SPACES='aaa   bbb   ccc'
 313   # ..converted to subsequent newlines, causes STACK_LIST to be a list with some empty
 314   # patterns in it.
 315   STACK_LIST=${STACK_SPACES// /$'\n'}
 316   NEEDLE_SPACES='ccc bbb aaa'
 317   NEEDLE_LIST=${NEEDLE_SPACES// /$'\n'}
 318   RESULT="$($GREP -Fvx "$STACK_LIST" <<< "$NEEDLE_LIST")"
 319   if test "x$RESULT" == "x"; then
 320     AC_MSG_RESULT([yes])
 321   else
 322     if test "x$OPENJDK_TARGET_OS" = "xaix"; then
 323       ADDINFO="Please make sure you use GNU grep, usually found at /opt/freeware/bin."
 324     fi
 325     AC_MSG_ERROR([grep does not handle -Fx correctly. ${ADDINFO}])
 326   fi
 327 ])
 328 
 329 ###############################################################################
 330 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
 331 [
 332   BASIC_CHECK_GNU_MAKE
 333 
 334   BASIC_CHECK_FIND_DELETE
 335   BASIC_CHECK_TAR
 336   BASIC_CHECK_GREP
 337   BASIC_SETUP_PANDOC
 338 
 339   # These tools might not be installed by default,
 340   # need hint on how to install them.
 341   UTIL_REQUIRE_PROGS(UNZIP, unzip)
 342   # Since zip uses "ZIP" as a environment variable for passing options, we need
 343   # to name our variable differently, hence ZIPEXE.
 344   UTIL_REQUIRE_PROGS(ZIPEXE, zip)
 345 
 346   # Non-required basic tools
 347 
 348   UTIL_PATH_PROGS(LDD, ldd)
 349   if test "x$LDD" = "x"; then
 350     # List shared lib dependencies is used for
 351     # debug output and checking for forbidden dependencies.
 352     # We can build without it.
 353     LDD="true"
 354   fi
 355   UTIL_PATH_PROGS(READELF, [greadelf readelf])
 356   UTIL_PATH_PROGS(DOT, dot)
 357   UTIL_PATH_PROGS(HG, hg)
 358   UTIL_PATH_PROGS(GIT, git)
 359   UTIL_PATH_PROGS(STAT, stat)
 360   UTIL_PATH_PROGS(TIME, time)
 361   UTIL_PATH_PROGS(FLOCK, flock)
 362   # Dtrace is usually found in /usr/sbin on Solaris, but that directory may not
 363   # be in the user path.
 364   UTIL_PATH_PROGS(DTRACE, dtrace, $PATH:/usr/sbin)
 365   UTIL_PATH_PROGS(PATCH, [gpatch patch])
 366   # Check if it's GNU time
 367   IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'`
 368   if test "x$IS_GNU_TIME" != x; then
 369     IS_GNU_TIME=yes
 370   else
 371     IS_GNU_TIME=no
 372   fi
 373   AC_SUBST(IS_GNU_TIME)
 374 
 375   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
 376     UTIL_REQUIRE_PROGS(DSYMUTIL, dsymutil)
 377     UTIL_REQUIRE_PROGS(MIG, mig)
 378     UTIL_REQUIRE_PROGS(XATTR, xattr)
 379     UTIL_PATH_PROGS(CODESIGN, codesign)
 380 
 381     if test "x$CODESIGN" != "x"; then
 382       # Check for user provided code signing identity.
 383       # If no identity was provided, fall back to "openjdk_codesign".
 384       AC_ARG_WITH([macosx-codesign-identity], [AS_HELP_STRING([--with-macosx-codesign-identity],
 385         [specify the code signing identity])],
 386         [MACOSX_CODESIGN_IDENTITY=$with_macosx_codesign_identity],
 387         [MACOSX_CODESIGN_IDENTITY=openjdk_codesign]
 388       )
 389 
 390       AC_SUBST(MACOSX_CODESIGN_IDENTITY)
 391 
 392       # Verify that the codesign certificate is present
 393       AC_MSG_CHECKING([if codesign certificate is present])
 394       $RM codesign-testfile
 395       $TOUCH codesign-testfile
 396       $CODESIGN -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile 2>&AS_MESSAGE_LOG_FD \
 397           >&AS_MESSAGE_LOG_FD || CODESIGN=
 398       $RM codesign-testfile
 399       if test "x$CODESIGN" = x; then
 400         AC_MSG_RESULT([no])
 401       else
 402         AC_MSG_RESULT([yes])
 403         # Verify that the codesign has --option runtime
 404         AC_MSG_CHECKING([if codesign has --option runtime])
 405         $RM codesign-testfile
 406         $TOUCH codesign-testfile
 407         $CODESIGN --option runtime -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile \
 408             2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
 409         $RM codesign-testfile
 410         if test "x$CODESIGN" = x; then
 411           AC_MSG_ERROR([codesign does not have --option runtime. macOS 10.13.6 and above is required.])
 412         else
 413           AC_MSG_RESULT([yes])
 414         fi
 415       fi
 416     fi
 417     UTIL_REQUIRE_PROGS(SETFILE, SetFile)
 418   elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
 419     UTIL_REQUIRE_PROGS(ELFEDIT, elfedit)
 420   fi
 421   if ! test "x$OPENJDK_TARGET_OS" = "xwindows"; then
 422     UTIL_REQUIRE_BUILTIN_PROGS(ULIMIT, ulimit)
 423   fi
 424 ])
 425 
 426 ###############################################################################
 427 # Check for support for specific options in bash
 428 AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
 429 [
 430   # Check bash version
 431   # Extra [ ] to stop m4 mangling
 432   [ BASH_VER=`$BASH --version | $SED -n  -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` ]
 433   AC_MSG_CHECKING([bash version])
 434   AC_MSG_RESULT([$BASH_VER])
 435 
 436   BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1`
 437   BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2`
 438   if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then
 439     AC_MSG_ERROR([bash version 3.2 or better is required])
 440   fi
 441 
 442   # Test if bash supports pipefail.
 443   AC_MSG_CHECKING([if bash supports pipefail])
 444   if ${BASH} -c 'set -o pipefail'; then
 445     BASH_ARGS="$BASH_ARGS -o pipefail"
 446     AC_MSG_RESULT([yes])
 447   else
 448     AC_MSG_RESULT([no])
 449   fi
 450 
 451   AC_MSG_CHECKING([if bash supports errexit (-e)])
 452   if ${BASH} -e -c 'true'; then
 453     BASH_ARGS="$BASH_ARGS -e"
 454     AC_MSG_RESULT([yes])
 455   else
 456     AC_MSG_RESULT([no])
 457   fi
 458 
 459   AC_SUBST(BASH_ARGS)
 460 ])
 461 
 462 ################################################################################
 463 #
 464 # Setup Pandoc
 465 #
 466 AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
 467 [
 468   UTIL_PATH_PROGS(PANDOC, pandoc)
 469 
 470   PANDOC_MARKDOWN_FLAG="markdown"
 471   if test -n "$PANDOC"; then
 472     AC_MSG_CHECKING(if the pandoc smart extension needs to be disabled for markdown)
 473     if $PANDOC --list-extensions | $GREP -q '\+smart'; then
 474       AC_MSG_RESULT([yes])
 475       PANDOC_MARKDOWN_FLAG="markdown-smart"
 476     else
 477       AC_MSG_RESULT([no])
 478     fi
 479   fi
 480 
 481   if test -n "$PANDOC"; then
 482     ENABLE_PANDOC="true"
 483   else
 484     ENABLE_PANDOC="false"
 485   fi
 486   AC_SUBST(ENABLE_PANDOC)
 487   AC_SUBST(PANDOC_MARKDOWN_FLAG)
 488 ])