diff options
author | Jim Huang <jim.huang@linaro.org> | 2011-05-27 01:24:34 +0800 |
---|---|---|
committer | Jim Huang <jserv@0xlab.org> | 2011-05-27 01:25:31 +0800 |
commit | 7ee395d10100fc9ed2c03c49b949033600082a4f (patch) | |
tree | 0b2d233ffadee334ce820572e07cdb97b5e572c9 | |
parent | c8f863ea379ef46539fd3185a33f17220aab970e (diff) | |
download | build-7ee395d10100fc9ed2c03c49b949033600082a4f.tar.gz |
Fix host-libbfd installation problem caused by undefined $(INSTALL)
While executing target install-host-libbfd, the build system complains:
make -C libbfd-binutils-2.20.1/bfd install \
bfdlibdir=/tmp/android-toolchain-eabi/lib
bfdincludedir=/tmp/android-toolchain-eabi/include && \ -m 644
libbfd-binutils-2.20.1/intl/libintl.a \ /tmp/android-toolchain-eabi/lib
&& \ -m 644 libbfd-binutils-2.20.1/libiberty/libiberty.a \
/tmp/android-toolchain-eabi/lib
/bin/sh: line 2: -m: command not found
The problem was caused by undefined $(INSTALL). The patch attempts to
configure `install' program by autotool in order to set $(INSTALL)
properly and replace $(INSTALL) -m 644 with multi-platform friendly
$(INSTALL_DATA).
Change-Id: I7f08aa442d62f3d3d8cef2c482c76e6a93500de8
Signed-off-by: Jim Huang <jserv@0xlab.org>
-rw-r--r-- | Makefile.in | 6 | ||||
-rwxr-xr-x | configure | 89 | ||||
-rw-r--r-- | configure.ac | 1 |
3 files changed, 89 insertions, 7 deletions
diff --git a/Makefile.in b/Makefile.in index d16e622..fa59097 100644 --- a/Makefile.in +++ b/Makefile.in @@ -50,6 +50,8 @@ INSTALL=@INSTALL@ # # miscellaneous variables # +INSTALL:=@INSTALL@ +INSTALL_DATA:=@INSTALL_DATA@ TOPLEVEL_CONFIGURE_ARGUMENTS:=@TOPLEVEL_CONFIGURE_ARGUMENTS@ baseargs = @baseargs@ GCC_MIN_VERSION_4_3_0:=@GCC_MIN_VERSION_4_3_0@ @@ -353,9 +355,9 @@ stmp-build-host-libbfd: stmp-config-host-libbfd install-host-libbfd: stmp-build-host-libbfd install-target-binutils $(MAKE) -C libbfd-${BINUTILS_VERSION}/bfd install \ bfdlibdir=$(libdir) bfdincludedir=$(includedir) && \ - $(INSTALL) -m 644 libbfd-${BINUTILS_VERSION}/intl/libintl.a \ + $(INSTALL_DATA) libbfd-${BINUTILS_VERSION}/intl/libintl.a \ $(libdir) && \ - $(INSTALL) -m 644 libbfd-${BINUTILS_VERSION}/libiberty/libiberty.a \ + $(INSTALL_DATA) libbfd-${BINUTILS_VERSION}/libiberty/libiberty.a \ $(libdir) # target gcc rules @@ -271,7 +271,7 @@ PACKAGE_VERSION='2.0' PACKAGE_STRING='android-tools 2.0' PACKAGE_BUGREPORT='' -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BUILD_ANDROID_GCC GDB_TARGET TOPLEVEL_CONFIGURE_ARGUMENTS baseargs gold_baseargs ENABLE_GRAPHITE package_to_srcdir BINUTILS_VERSION GOLD_VERSION GCC_VERSION GCC_MIN_VERSION_4_3_0 GCC_MIN_VERSION_4_5_0 NEWLIB_VERSION GMP_VERSION MPFR_VERSION MPC_VERSION PPL_VERSION CLOOG_VERSION GDB_VERSION sysroot have_mpc have_mpfr have_gmp have_ppl have_cloog LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os BUILD_ANDROID_GCC GDB_TARGET TOPLEVEL_CONFIGURE_ARGUMENTS baseargs gold_baseargs ENABLE_GRAPHITE package_to_srcdir BINUTILS_VERSION GOLD_VERSION GCC_VERSION GCC_MIN_VERSION_4_3_0 GCC_MIN_VERSION_4_5_0 NEWLIB_VERSION GMP_VERSION MPFR_VERSION MPC_VERSION PPL_VERSION CLOOG_VERSION GDB_VERSION sysroot have_mpc have_mpfr have_gmp have_ppl have_cloog LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1281,7 +1281,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_files="$ac_config_files Makefile" - ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -1307,6 +1306,86 @@ ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 @@ -2923,6 +3002,9 @@ s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t @@ -2935,9 +3017,6 @@ s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@BUILD_ANDROID_GCC@,$BUILD_ANDROID_GCC,;t t s,@GDB_TARGET@,$GDB_TARGET,;t t s,@TOPLEVEL_CONFIGURE_ARGUMENTS@,$TOPLEVEL_CONFIGURE_ARGUMENTS,;t t diff --git a/configure.ac b/configure.ac index 2fecd4f..289e487 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,7 @@ AC_INIT(android-tools,2.0) AC_PREREQ(2.59) AC_CONFIG_FILES([Makefile]) +AC_PROG_INSTALL AC_CANONICAL_SYSTEM |