diff options
author | Jim Huang <jim.huang@linaro.org> | 2011-05-27 01:13:31 +0800 |
---|---|---|
committer | Jim Huang <jim.huang@linaro.org> | 2011-05-27 01:22:52 +0800 |
commit | 054dccbe3328670482ed427d03f812d5325982eb (patch) | |
tree | 089ca11d69a7c400fcf3b8b4de6e369e6aa3a3a9 | |
parent | 045bccfdc96282321abda4d00e0d425ec30443de (diff) |
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).
Signed-off-by: Jim Huang <jim.huang@linaro.org>
-rw-r--r-- | Makefile.in | 6 | ||||
-rwxr-xr-x | configure | 92 | ||||
-rw-r--r-- | configure.ac | 1 |
3 files changed, 95 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in index d3de043..c93a0e0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -47,6 +47,8 @@ abs_builddir = @abs_builddir@ # # 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@ @@ -351,9 +353,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 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 @@ -2663,6 +2742,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir +INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -2841,6 +2921,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 @@ -3041,6 +3124,10 @@ case $ac_abs_builddir in esac + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 @@ -3102,6 +3189,7 @@ s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then diff --git a/configure.ac b/configure.ac index eb40d0c..7e77a3b 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 |