From: Gary V. Vaughan Date: Tue, 20 Jul 1999 09:29:31 +0000 (+0000) Subject: * configure.in (AC_PROG_RANLIB): No longer required as we now use X-Git-Tag: multi-language-fork~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2cc31a3e286819182ec347956d028f0518e39d4c;p=thirdparty%2Flibtool.git * configure.in (AC_PROG_RANLIB): No longer required as we now use AC_CHECK_TOOL in AC_LIBTOOL_SETUP. * libtool.m4 (AC_PROG_LIBTOOL): Pass the $build variable to ltconfig. (AC_PROG_RANLIB): replaced with AC_CHECK_TOOL. * ltconfig.in (build): new variable to hold the build triplet which is now checked for unless --no-verify is specified. (--build): new argument to set the build triplet. (ranlib): Prefer ${host_alias}-ranlib[.exe] if $build is different to $host. * doc/libtool.texi (Invoking ltconfig): Document --build option. * NEWS: Note --build option. --- diff --git a/ChangeLog b/ChangeLog index ae10d1f2a..f3fe8c986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +1999-07-20 Gary V. Vaughan + + * configure.in (AC_PROG_RANLIB): No longer required as we now use + AC_CHECK_TOOL in AC_LIBTOOL_SETUP. + * libtool.m4 (AC_PROG_LIBTOOL): Pass the $build variable to + ltconfig. + (AC_PROG_RANLIB): replaced with AC_CHECK_TOOL. + * ltconfig.in (build): new variable to hold the build triplet + which is now checked for unless --no-verify is specified. + (--build): new argument to set the build triplet. + (ranlib): Prefer ${host_alias}-ranlib[.exe] if $build is different + to $host. + * doc/libtool.texi (Invoking ltconfig): Document --build option. + * NEWS: Note --build option. + 1999-07-19 Erez Zadok * doc/PLATFORMS: Updated mostly *bsd platforms. diff --git a/NEWS b/NEWS index 5e9893af3..7680ea61f 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.3d: 1999-??-??; CVS version 1.3c, Libtool team: * New --with-pic flag to control the generation of PIC/non-PIC code. +* New --build flag to ltconfig to help with build cross compilation + environments is inherited from --build flag passed to configure. * Various bugfixes New in 1.3b: 1999-07-02; CVS version 1.3a, Libtool team: diff --git a/configure.in b/configure.in index 4e6dbd81a..a70cc419f 100644 --- a/configure.in +++ b/configure.in @@ -29,9 +29,8 @@ AC_SUBST(pkgdatadir) dnl automake does not need this, but libtoolize does aclocaldir='${datadir}/aclocal' AC_SUBST(aclocaldir) -dnl Use the specified CC, RANLIB, and LD while running ltconfig. +dnl Use the specified CC and LD while running ltconfig. AC_PROG_CC -AC_PROG_RANLIB AM_PROG_LD AM_PROG_NM AC_PROG_LN_S diff --git a/doc/libtool.texi b/doc/libtool.texi index 0c9e18837..dcf4d3e87 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1558,6 +1558,14 @@ ltconfig [@var{option}]@dots{} @var{ltmain} [@var{host}] and accepts the following options: @table @samp +@item --build=@var{build} +Set the build system to be different to the host system. This creates a +libtool which prefers build tools which are prefixed by the host alias over +the standard tools. For example, specifying @code{--build=i486-pc-linux-gnu} +on a host described by i486-pc-cygwin would create a libtool which used +@code{i486-pc-cygwin-ranlib} in preference to @code{ranlib} if present. This +is useful for cross build environments. + @item --debug Dump a trace of shell script execution to standard output. This produces a lot of output, so you may wish to pipe it to @code{less} (or diff --git a/libtool.m4 b/libtool.m4 index fc24e1176..0fb19502c 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -34,7 +34,7 @@ LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ +$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ || AC_MSG_ERROR([libtool configure failed]) # Reload cache, that may have been modified by ltconfig @@ -59,13 +59,14 @@ AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl dnl +AC_CHECK_TOOL(RANLIB, ranlib, :) + # Check for any special flags to pass to ltconfig. libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" diff --git a/ltconfig.in b/ltconfig.in index a0817d0db..d5cc5705f 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -194,7 +194,8 @@ srcdir= ac_config_guess= ac_config_sub= host= -nonopt= +build=NONE +nonopt=NONE ofile="$default_ofile" verify_host=yes with_gcc=no @@ -243,6 +244,7 @@ Usage: $progname [OPTION]... [HOST [LTMAIN]] Generate a system-specific libtool script. + --build configure for building on BUILD [BUILD=HOST] --debug enable verbose shell tracing --disable-shared do not build shared libraries --disable-static do not build static libraries @@ -271,6 +273,9 @@ EOM exit 0 ;; + --build) prev=build ;; + --build=*) build="$optarg" ;; + --debug) echo "$progname: enabling shell trace mode" set -x @@ -445,12 +450,38 @@ if test "$verify_host" = yes; then # Make sure the host verified. test -z "$host" && exit 1 + # Check for the build system type + echo $ac_n "checking build system type... $ac_c" 1>&6 + + build_alias=$build + case "$build_alias" in + NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; + esac + + build=`SHELL $ac_config_sub $build_alias` + build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$build" 1>&6 + elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host + build_alias=$host_alias + build=$host +fi + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. @@ -519,35 +550,38 @@ LN_S="$ac_cv_prog_LN_S" echo "$ac_t""$result" 1>&6 # Search for a ranlib program -echo $ac_n "checking for ranlib... $ac_c" 1>&6 -echo "$progname:@LINENO@: checking for ranlib" 1>&5 -if test "X${ac_cv_prog_RANLIB+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 - result="$ac_cv_prog_RANLIB" -else - if test -n "$RANLIB"; then - result="$RANLIB" # Let the user override the test. - ac_cv_prog_RANLIB="$result" +for ac_prog in "${ac_host_prefix}ranlib" ranlib : +do + echo $ac_n "checking for $ac_prog... $ac_c" 1>&6 + echo "$progname:@LINENO@: checking for $ac_prog" 1>&5 + if test "X${ac_cv_prog_RANLIB+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 else - result=no - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then - result="ranlib" - ac_cv_prog_RANLIB="$result" - break - fi - done - IFS="$save_ifs" + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + else + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/$ac_prog || test -f $dir/$ac_prog$ac_exeext; then + ac_cv_prog_RANLIB="$ac_prog" + break + fi + done + IFS="$save_ifs" + fi fi -fi -if test -n "$ac_cv_prog_RANLIB"; then - RANLIB="$ac_cv_prog_RANLIB" - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi -echo "$ac_t$result" 1>&6 + if test -n "$ac_cv_prog_RANLIB"; then + RANLIB="$ac_cv_prog_RANLIB" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + echo "$ac_t$RANLIB" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + test -n "$RANLIB" && break +done if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6