common/autoconf/basics.m4
changeset 13697 5262b00bc10c
parent 13133 701e61c32ece
child 14111 2a82ecb35fc7
equal deleted inserted replaced
13694:ffe6bce5a521 13697:5262b00bc10c
    32     if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
    32     if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
    33         $2="[$]$2 $1"
    33         $2="[$]$2 $1"
    34     fi
    34     fi
    35 ])
    35 ])
    36 
    36 
    37 AC_DEFUN([WHICHCMD],
    37 AC_DEFUN([SET_FULL_PATH],
    38 [
    38 [
    39     # Translate "gcc -E" into "`which gcc` -E" ie
    39     # Translate "gcc -E" into "`which gcc` -E" ie
    40     # extract the full path to the binary and at the
    40     # extract the full path to the binary and at the
    41     # same time maintain any arguments passed to it.
    41     # same time maintain any arguments passed to it.
    42     # The command MUST exist in the path, or else!
    42     # The command MUST exist in the path, or else!
    44     car="${tmp%% *}"
    44     car="${tmp%% *}"
    45     tmp="[$]$1 EOL"
    45     tmp="[$]$1 EOL"
    46     cdr="${tmp#* }"
    46     cdr="${tmp#* }"
    47     # On windows we want paths without spaces.
    47     # On windows we want paths without spaces.
    48     if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
    48     if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
    49         WHICHCMD_SPACESAFE(car)
    49         SET_FULL_PATH_SPACESAFE(car)
    50     else
    50     else
    51         # "which" is not portable, but is used here
    51         # "which" is not portable, but is used here
    52         # because we know that the command exists!
    52         # because we know that the command exists!
    53         car=`which $car`
    53         car=`which $car`
    54     fi
    54     fi
    64     # Fail with message $2 if var $1 contains a path with no spaces in it.
    64     # Fail with message $2 if var $1 contains a path with no spaces in it.
    65     # Unless on Windows, where we can rewrite the path.
    65     # Unless on Windows, where we can rewrite the path.
    66     HAS_SPACE=`echo "[$]$1" | grep " "`
    66     HAS_SPACE=`echo "[$]$1" | grep " "`
    67     if test "x$HAS_SPACE" != x; then
    67     if test "x$HAS_SPACE" != x; then
    68         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
    68         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
       
    69             # First convert it to DOS-style, short mode (no spaces)
    69             $1=`$CYGPATH -s -m -a "[$]$1"`
    70             $1=`$CYGPATH -s -m -a "[$]$1"`
    70             $1=`$CYGPATH -u "[$]$1"`            
    71             # Now it's case insensitive; let's make it lowercase to improve readability
       
    72             $1=`$ECHO "[$]$1" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'`
       
    73             # Now convert it back to Unix-stile (cygpath)
       
    74             $1=`$CYGPATH -u "[$]$1"`
    71         else
    75         else
    72             AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
    76             AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
    73         fi
    77         fi
    74     fi
    78     fi
    75 ])
    79 ])
    76 
    80 
    77 AC_DEFUN([WHICHCMD_SPACESAFE],
    81 AC_DEFUN([SET_FULL_PATH_SPACESAFE],
    78 [
    82 [
    79     # Translate long cygdrive or C:\sdfsf path
    83     # Translate long cygdrive or C:\sdfsf path
    80     # into a short mixed mode path that has no
    84     # into a short mixed mode path that has no
    81     # spaces in it.
    85     # spaces in it.
    82     tmp="[$]$1"
    86     tmp="[$]$1"
   146 [
   150 [
   147 # Save the original command line. This is passed to us by the wrapper configure script.
   151 # Save the original command line. This is passed to us by the wrapper configure script.
   148 AC_SUBST(CONFIGURE_COMMAND_LINE)
   152 AC_SUBST(CONFIGURE_COMMAND_LINE)
   149 DATE_WHEN_CONFIGURED=`LANG=C date`
   153 DATE_WHEN_CONFIGURED=`LANG=C date`
   150 AC_SUBST(DATE_WHEN_CONFIGURED)
   154 AC_SUBST(DATE_WHEN_CONFIGURED)
   151 
   155 ])
       
   156 
       
   157 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
       
   158 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
       
   159 [
   152 # Locate the directory of this script.
   160 # Locate the directory of this script.
   153 SCRIPT="[$]0"
   161 SCRIPT="[$]0"
   154 REMOVE_SYMBOLIC_LINKS(SCRIPT)        
   162 REMOVE_SYMBOLIC_LINKS(SCRIPT)
   155 AUTOCONF_DIR=`dirname [$]0`
   163 AUTOCONF_DIR=`dirname [$]0`
   156 ])
   164 
   157 
       
   158 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
       
   159 [
       
   160 # Where is the source? It is located two levels above the configure script.
   165 # Where is the source? It is located two levels above the configure script.
   161 CURDIR="$PWD"
   166 CURDIR="$PWD"
   162 cd "$AUTOCONF_DIR/../.."
   167 cd "$AUTOCONF_DIR/../.."
   163 SRC_ROOT="`pwd`"
   168 SRC_ROOT="`pwd`"
   164 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
   169 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
   170 AC_SUBST(SRC_ROOT)
   175 AC_SUBST(SRC_ROOT)
   171 cd "$CURDIR"
   176 cd "$CURDIR"
   172 
   177 
   173 SPACESAFE(SRC_ROOT,[the path to the source root])
   178 SPACESAFE(SRC_ROOT,[the path to the source root])
   174 SPACESAFE(CURDIR,[the path to the current directory])
   179 SPACESAFE(CURDIR,[the path to the current directory])
   175 ])
   180 
   176 
       
   177 AC_DEFUN_ONCE([BASIC_SETUP_SEARCHPATH],
       
   178 [
       
   179 if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   181 if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   180     # Add extra search paths on solaris for utilities like ar and as etc...
   182     # Add extra search paths on solaris for utilities like ar and as etc...
   181     PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
   183     PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
   182 fi
   184 fi
   183 ])
   185 
   184 
       
   185 AC_DEFUN_ONCE([BASIC_SETUP_PATH_SEP],
       
   186 [
       
   187 # For cygwin we need cygpath first, since it is used everywhere.
   186 # For cygwin we need cygpath first, since it is used everywhere.
   188 AC_PATH_PROG(CYGPATH, cygpath)
   187 AC_PATH_PROG(CYGPATH, cygpath)
   189 PATH_SEP=":"
   188 PATH_SEP=":"
   190 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
   189 if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
   191     if test "x$CYGPATH" = x; then
   190     if test "x$CYGPATH" = x; then
   192         AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
   191         AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
   193     fi
   192     fi
   194     PATH_SEP=";"
   193     PATH_SEP=";"
   195 fi
   194 fi
   196 AC_SUBST(PATH_SEP)
   195 AC_SUBST(PATH_SEP)
       
   196 
       
   197 # You can force the sys-root if the sys-root encoded into the cross compiler tools
       
   198 # is not correct.
       
   199 AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root],
       
   200   [pass this sys-root to the compilers and linker (useful if the sys-root encoded in
       
   201    the cross compiler tools is incorrect)])])
       
   202 
       
   203 if test "x$with_sys_root" != x; then
       
   204   SYS_ROOT=$with_sys_root
       
   205 else
       
   206   SYS_ROOT=/
       
   207 fi
       
   208 AC_SUBST(SYS_ROOT)
       
   209 
       
   210 AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
       
   211   [search this directory for (cross-compiling) compilers and tools])], [TOOLS_DIR=$with_tools_dir])
       
   212 
       
   213 AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
       
   214   [use this directory as base for tools-dir and sys-root (for cross-compiling)])],
       
   215   [
       
   216     if test "x$with_sys_root" != x; then
       
   217       AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time])
       
   218     fi
       
   219     if test "x$with_tools_dir" != x; then
       
   220       AC_MSG_ERROR([Cannot specify both --with-devkit and --with-tools-dir at the same time])
       
   221     fi
       
   222     TOOLS_DIR=$with_devkit/bin
       
   223     SYS_ROOT=$with_devkit/$host_alias/libc
       
   224   ])
       
   225 
   197 ])
   226 ])
   198 
   227 
   199 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
   228 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
   200 [
   229 [
   201 
   230 
   234 
   263 
   235 # Most of the probed defines are put into config.h
   264 # Most of the probed defines are put into config.h
   236 AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
   265 AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
   237 # The spec.gmk file contains all variables for the make system.
   266 # The spec.gmk file contains all variables for the make system.
   238 AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
   267 AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
   239 # The spec.sh file contains variables for compare{images|-objects}.sh scrips.
   268 # The hotspot-spec.gmk file contains legacy variables for the hotspot make system.
       
   269 AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in])
       
   270 # The bootcycle-spec.gmk file contains support for boot cycle builds.
       
   271 AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
       
   272 # The compare.sh is used to compare the build output to other builds.
       
   273 AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in])
       
   274 # Spec.sh is currently used by compare-objects.sh
   240 AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in])
   275 AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in])
   241 # The generated Makefile knows where the spec.gmk is and where the source is.
   276 # The generated Makefile knows where the spec.gmk is and where the source is.
   242 # You can run make from the OUTPUT_ROOT, or from the top-level Makefile
   277 # You can run make from the OUTPUT_ROOT, or from the top-level Makefile
   243 # which will look for generated configurations
   278 # which will look for generated configurations
   244 AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
   279 AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
   258 AC_SUBST(BUILD_LOG_WRAPPER)
   293 AC_SUBST(BUILD_LOG_WRAPPER)
   259 ])
   294 ])
   260 
   295 
   261 
   296 
   262 #%%% Simple tools %%%
   297 #%%% Simple tools %%%
       
   298 
       
   299 # Check if we have found a usable version of make
       
   300 # $1: the path to a potential make binary (or empty)
       
   301 # $2: the description on how we found this
       
   302 AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
       
   303 [
       
   304   MAKE_CANDIDATE="$1"
       
   305   DESCRIPTION="$2"
       
   306   if test "x$MAKE_CANDIDATE" != x; then
       
   307     AC_MSG_NOTICE([Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION])
       
   308     SET_FULL_PATH(MAKE_CANDIDATE)
       
   309     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
       
   310     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
       
   311     if test "x$IS_GNU_MAKE" = x; then
       
   312       AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
       
   313     else
       
   314       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[[12346789]]'`
       
   315       if test "x$IS_MODERN_MAKE" = x; then
       
   316         AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
       
   317       else 
       
   318         FOUND_MAKE=$MAKE_CANDIDATE
       
   319       fi
       
   320     fi
       
   321   fi
       
   322 ])
       
   323 
       
   324 # Goes looking for a usable version of GNU make.
       
   325 AC_DEFUN([BASIC_CHECK_GNU_MAKE],
       
   326 [
       
   327   # We need to find a recent version of GNU make. Especially on Solaris, this can be tricky.
       
   328   if test "x$MAKE" != x; then
       
   329     # User has supplied a make, test it.
       
   330     if test ! -f "$MAKE"; then
       
   331       AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not found.])
       
   332     fi
       
   333     BASIC_CHECK_MAKE_VERSION("$MAKE", [user supplied MAKE=])
       
   334     if test "x$FOUND_MAKE" = x; then
       
   335       AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer.])
       
   336     fi
       
   337   else
       
   338     # Try our hardest to locate a correct version of GNU make
       
   339     AC_PATH_PROGS(CHECK_GMAKE, gmake)
       
   340     BASIC_CHECK_MAKE_VERSION("$CHECK_GMAKE", [gmake in PATH])
       
   341 
       
   342     if test "x$FOUND_MAKE" = x; then
       
   343       AC_PATH_PROGS(CHECK_MAKE, make)
       
   344       BASIC_CHECK_MAKE_VERSION("$CHECK_MAKE", [make in PATH])
       
   345     fi
       
   346 
       
   347     if test "x$FOUND_MAKE" = x; then
       
   348       if test "x$TOOLS_DIR" != x; then
       
   349         # We have a tools-dir, check that as well before giving up.
       
   350         OLD_PATH=$PATH
       
   351         PATH=$TOOLS_DIR:$PATH
       
   352         AC_PATH_PROGS(CHECK_TOOLSDIR_GMAKE, gmake)
       
   353         BASIC_CHECK_MAKE_VERSION("$CHECK_TOOLSDIR_GMAKE", [gmake in tools-dir])
       
   354         if test "x$FOUND_MAKE" = x; then
       
   355           AC_PATH_PROGS(CHECK_TOOLSDIR_MAKE, make)
       
   356           BASIC_CHECK_MAKE_VERSION("$CHECK_TOOLSDIR_MAKE", [make in tools-dir])
       
   357         fi
       
   358         PATH=$OLD_PATH
       
   359       fi
       
   360     fi
       
   361 
       
   362     if test "x$FOUND_MAKE" = x; then
       
   363       AC_MSG_ERROR([Cannot find GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure.])
       
   364     fi
       
   365   fi
       
   366 
       
   367   MAKE=$FOUND_MAKE
       
   368   AC_SUBST(MAKE)
       
   369   AC_MSG_NOTICE([Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)])
       
   370 ])
   263 
   371 
   264 AC_DEFUN([BASIC_CHECK_FIND_DELETE],
   372 AC_DEFUN([BASIC_CHECK_FIND_DELETE],
   265 [
   373 [
   266     # Test if find supports -delete
   374     # Test if find supports -delete
   267     AC_MSG_CHECKING([if find supports -delete])
   375     AC_MSG_CHECKING([if find supports -delete])
   281         AC_MSG_RESULT([yes])    
   389         AC_MSG_RESULT([yes])    
   282     fi
   390     fi
   283     rmdir $DELETEDIR
   391     rmdir $DELETEDIR
   284 ])
   392 ])
   285 
   393 
       
   394 # Test that variable $1 denoting a program is not empty. If empty, exit with an error.
       
   395 # $1: variable to check
       
   396 # $2: executable name to print in warning (optional)
   286 AC_DEFUN([CHECK_NONEMPTY],
   397 AC_DEFUN([CHECK_NONEMPTY],
   287 [
   398 [
   288     # Test that variable $1 is not empty.
   399     if test "x[$]$1" = x; then
   289     if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
   400         if test "x$2" = x; then
       
   401           PROG_NAME=translit($1,A-Z,a-z)
       
   402         else
       
   403           PROG_NAME=$2
       
   404         fi
       
   405         AC_MSG_NOTICE([Could not find $PROG_NAME!])
       
   406         AC_MSG_ERROR([Cannot continue])
       
   407     fi
       
   408 ])
       
   409 
       
   410 # Does AC_PATH_PROG followed by CHECK_NONEMPTY.
       
   411 # Arguments as AC_PATH_PROG:
       
   412 # $1: variable to set
       
   413 # $2: executable name to look for
       
   414 AC_DEFUN([BASIC_REQUIRE_PROG],
       
   415 [
       
   416     AC_PATH_PROGS($1, $2)
       
   417     CHECK_NONEMPTY($1, $2)
   290 ])
   418 ])
   291 
   419 
   292 AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
   420 AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
   293 [
   421 [
   294 # Start with tools that do not need have cross compilation support
   422 # Start with tools that do not need have cross compilation support
   295 # and can be expected to be found in the default PATH. These tools are
   423 # and can be expected to be found in the default PATH. These tools are
   296 # used by configure. Nor are these tools expected to be found in the
   424 # used by configure. Nor are these tools expected to be found in the
   297 # devkit from the builddeps server either, since they are
   425 # devkit from the builddeps server either, since they are
   298 # needed to download the devkit. 
   426 # needed to download the devkit.
       
   427 
       
   428 # First are all the simple required tools.
       
   429 BASIC_REQUIRE_PROG(BASENAME, basename)
       
   430 BASIC_REQUIRE_PROG(CAT, cat)
       
   431 BASIC_REQUIRE_PROG(CHMOD, chmod)
       
   432 BASIC_REQUIRE_PROG(CMP, cmp)
       
   433 BASIC_REQUIRE_PROG(CP, cp)
       
   434 BASIC_REQUIRE_PROG(CPIO, cpio)
       
   435 BASIC_REQUIRE_PROG(CUT, cut)
       
   436 BASIC_REQUIRE_PROG(DATE, date)
       
   437 BASIC_REQUIRE_PROG(DF, df)
       
   438 BASIC_REQUIRE_PROG(DIFF, [gdiff diff])
       
   439 BASIC_REQUIRE_PROG(ECHO, echo)
       
   440 BASIC_REQUIRE_PROG(EXPR, expr)
       
   441 BASIC_REQUIRE_PROG(FILE, file)
       
   442 BASIC_REQUIRE_PROG(FIND, find)
       
   443 BASIC_REQUIRE_PROG(HEAD, head)
       
   444 BASIC_REQUIRE_PROG(LN, ln)
       
   445 BASIC_REQUIRE_PROG(LS, ls)
       
   446 BASIC_REQUIRE_PROG(MKDIR, mkdir)
       
   447 BASIC_REQUIRE_PROG(MV, mv)
       
   448 BASIC_REQUIRE_PROG(PRINTF, printf)
       
   449 BASIC_REQUIRE_PROG(SH, sh)
       
   450 BASIC_REQUIRE_PROG(SORT, sort)
       
   451 BASIC_REQUIRE_PROG(TAIL, tail)
       
   452 BASIC_REQUIRE_PROG(TAR, tar)
       
   453 BASIC_REQUIRE_PROG(TEE, tee)
       
   454 BASIC_REQUIRE_PROG(TOUCH, touch)
       
   455 BASIC_REQUIRE_PROG(TR, tr)
       
   456 BASIC_REQUIRE_PROG(UNIQ, uniq)
       
   457 BASIC_REQUIRE_PROG(UNZIP, unzip)
       
   458 BASIC_REQUIRE_PROG(WC, wc)
       
   459 BASIC_REQUIRE_PROG(XARGS, xargs)
       
   460 BASIC_REQUIRE_PROG(ZIP, zip)
       
   461 
       
   462 # Then required tools that require some special treatment.
   299 AC_PROG_AWK
   463 AC_PROG_AWK
   300 CHECK_NONEMPTY(AWK)
   464 CHECK_NONEMPTY(AWK)
   301 AC_PATH_PROG(CAT, cat)
   465 AC_PROG_GREP
   302 CHECK_NONEMPTY(CAT)
   466 CHECK_NONEMPTY(GREP)
   303 AC_PATH_PROG(CHMOD, chmod)
       
   304 CHECK_NONEMPTY(CHMOD)
       
   305 AC_PATH_PROG(CP, cp)
       
   306 CHECK_NONEMPTY(CP)
       
   307 AC_PATH_PROG(CPIO, cpio)
       
   308 CHECK_NONEMPTY(CPIO)
       
   309 AC_PATH_PROG(CUT, cut)
       
   310 CHECK_NONEMPTY(CUT)
       
   311 AC_PATH_PROG(DATE, date)
       
   312 CHECK_NONEMPTY(DATE)
       
   313 AC_PATH_PROG(DF, df)
       
   314 CHECK_NONEMPTY(DF)
       
   315 AC_PATH_PROG(DIFF, diff)
       
   316 CHECK_NONEMPTY(DIFF)
       
   317 # Warning echo is really, really unportable!!!!! Different
       
   318 # behaviour in bash and dash and in a lot of other shells!
       
   319 # Use printf for serious work! 
       
   320 AC_PATH_PROG(ECHO, echo)
       
   321 CHECK_NONEMPTY(ECHO)
       
   322 AC_PROG_EGREP
   467 AC_PROG_EGREP
   323 CHECK_NONEMPTY(EGREP)
   468 CHECK_NONEMPTY(EGREP)
   324 AC_PROG_FGREP
   469 AC_PROG_FGREP
   325 CHECK_NONEMPTY(FGREP)
   470 CHECK_NONEMPTY(FGREP)
   326 
   471 AC_PROG_SED
   327 AC_PATH_PROG(FIND, find)
   472 CHECK_NONEMPTY(SED)
   328 CHECK_NONEMPTY(FIND)
   473 
       
   474 AC_PATH_PROGS(NAWK, [nawk gawk awk])
       
   475 CHECK_NONEMPTY(NAWK)
       
   476 
       
   477 BASIC_CHECK_GNU_MAKE
       
   478 
       
   479 BASIC_REQUIRE_PROG(RM, rm)
       
   480 RM="$RM -f"
       
   481 
   329 BASIC_CHECK_FIND_DELETE
   482 BASIC_CHECK_FIND_DELETE
   330 AC_SUBST(FIND_DELETE)
   483 AC_SUBST(FIND_DELETE)
   331 
   484 
   332 AC_PROG_GREP
   485 # Non-required basic tools
   333 CHECK_NONEMPTY(GREP)
   486 
   334 AC_PATH_PROG(HEAD, head)
       
   335 CHECK_NONEMPTY(HEAD)
       
   336 AC_PATH_PROG(LN, ln)
       
   337 CHECK_NONEMPTY(LN)
       
   338 AC_PATH_PROG(LS, ls)
       
   339 CHECK_NONEMPTY(LS)
       
   340 AC_PATH_PROGS(MAKE, [gmake make])
       
   341 CHECK_NONEMPTY(MAKE)
       
   342 MAKE_VERSION=`$MAKE --version | head -n 1 | grep '3.8[[12346789]]'`
       
   343 if test "x$MAKE_VERSION" = x; then
       
   344     AC_MSG_ERROR([You must use GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure.])
       
   345 fi
       
   346 AC_PATH_PROG(MKDIR, mkdir)
       
   347 CHECK_NONEMPTY(MKDIR)
       
   348 AC_PATH_PROG(MV, mv)
       
   349 CHECK_NONEMPTY(MV)
       
   350 AC_PATH_PROGS(NAWK, [nawk gawk awk])
       
   351 CHECK_NONEMPTY(NAWK)
       
   352 AC_PATH_PROG(PRINTF, printf)
       
   353 CHECK_NONEMPTY(PRINTF)
       
   354 AC_PATH_PROG(THEPWDCMD, pwd)
   487 AC_PATH_PROG(THEPWDCMD, pwd)
   355 AC_PATH_PROG(RM, rm)
       
   356 CHECK_NONEMPTY(RM)
       
   357 RM="$RM -f"
       
   358 AC_PROG_SED
       
   359 CHECK_NONEMPTY(SED)
       
   360 AC_PATH_PROG(SH, sh)
       
   361 CHECK_NONEMPTY(SH)
       
   362 AC_PATH_PROG(SORT, sort)
       
   363 CHECK_NONEMPTY(SORT)
       
   364 AC_PATH_PROG(TAR, tar)
       
   365 CHECK_NONEMPTY(TAR)
       
   366 AC_PATH_PROG(TAIL, tail)
       
   367 CHECK_NONEMPTY(TAIL)
       
   368 AC_PATH_PROG(TEE, tee)
       
   369 CHECK_NONEMPTY(TEE)
       
   370 AC_PATH_PROG(TR, tr)
       
   371 CHECK_NONEMPTY(TR)
       
   372 AC_PATH_PROG(TOUCH, touch)
       
   373 CHECK_NONEMPTY(TOUCH)
       
   374 AC_PATH_PROG(WC, wc)
       
   375 CHECK_NONEMPTY(WC)
       
   376 AC_PATH_PROG(XARGS, xargs)
       
   377 CHECK_NONEMPTY(XARGS)
       
   378 AC_PATH_PROG(ZIP, zip)
       
   379 CHECK_NONEMPTY(ZIP)
       
   380 AC_PATH_PROG(UNZIP, unzip)
       
   381 CHECK_NONEMPTY(UNZIP)
       
   382 AC_PATH_PROG(LDD, ldd)
   488 AC_PATH_PROG(LDD, ldd)
   383 if test "x$LDD" = "x"; then
   489 if test "x$LDD" = "x"; then
   384     # List shared lib dependencies is used for
   490     # List shared lib dependencies is used for
   385     # debug output and checking for forbidden dependencies.
   491     # debug output and checking for forbidden dependencies.
   386     # We can build without it.
   492     # We can build without it.
   388 fi
   494 fi
   389 AC_PATH_PROG(OTOOL, otool)
   495 AC_PATH_PROG(OTOOL, otool)
   390 if test "x$OTOOL" = "x"; then
   496 if test "x$OTOOL" = "x"; then
   391    OTOOL="true"
   497    OTOOL="true"
   392 fi
   498 fi
   393 AC_PATH_PROG(READELF, readelf)
   499 AC_PATH_PROGS(READELF, [readelf greadelf])
   394 AC_PATH_PROG(EXPR, expr)
   500 AC_PATH_PROGS(OBJDUMP, [objdump gobjdump])
   395 CHECK_NONEMPTY(EXPR)
       
   396 AC_PATH_PROG(FILE, file)
       
   397 CHECK_NONEMPTY(FILE)
       
   398 AC_PATH_PROG(HG, hg)
   501 AC_PATH_PROG(HG, hg)
   399 ])
   502 ])
   400 
       
   401 
       
   402 
   503 
   403 AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE],
   504 AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE],
   404 [
   505 [
   405 # When using cygwin, we need a wrapper binary that renames
   506 # When using cygwin, we need a wrapper binary that renames
   406 # /cygdrive/c/ arguments into c:/ arguments and peeks into
   507 # /cygdrive/c/ arguments into c:/ arguments and peeks into
   431         cat $OUTPUT_ROOT/uncygdrive2.log
   532         cat $OUTPUT_ROOT/uncygdrive2.log
   432         AC_MSG_ERROR([Uncygdrive did not work!])
   533         AC_MSG_ERROR([Uncygdrive did not work!])
   433     fi
   534     fi
   434     AC_MSG_RESULT([yes])
   535     AC_MSG_RESULT([yes])
   435     rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj
   536     rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj
       
   537     # The path to uncygdrive to use should be Unix-style
       
   538     UNCYGDRIVE="$OUTPUT_ROOT/uncygdrive.exe"
   436 fi
   539 fi
   437 
   540 
   438 AC_SUBST(UNCYGDRIVE)
   541 AC_SUBST(UNCYGDRIVE)
   439 ])
   542 ])
   440 
   543