[OpenWrt-Devel] autotools.mk: autoreconf: Fix missing install-sh by forcing install in libtoolize

Message ID 1543931243-16001-1-git-send-email-ynezz@true.cz
State New
Headers show
Series
  • [OpenWrt-Devel] autotools.mk: autoreconf: Fix missing install-sh by forcing install in libtoolize
Related show

Commit Message

Petr Štetiar Dec. 4, 2018, 1:47 p.m.
I'm trying to create a package for libgpiod, which uses
AC_CONFIG_AUX_DIR macro, which is probably leading to the following
configure error:

 autoreconf: running: /openwrt.git/staging_dir/host/bin/libtoolize --force
 OpenWrt-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `autostuff'.
 OpenWrt-libtoolize: linking file `autostuff/ltmain.sh'
 OpenWrt-libtoolize: putting macros in `m4'.
 ...
 configure: error: cannot find install-sh, install.sh, or shtool in autostuff "."/autostuff

From the build output it's clear, that libtoolize isn't installing
install-sh symlink, because libtoolize would install install-sh only if
it's being run with --install parameter. Corresponding part in
libtoolize:

 if $opt_install; then
   func_config_update config.guess \
     "$pkgdatadir/config" "$auxdir" pkgconfig_header
   func_config_update config.sub \
     "$pkgdatadir/config" "$auxdir" pkgconfig_header
   func_install_update install-sh \
     "$pkgdatadir/config" "$auxdir" pkgconfig_header
 fi
 func_ltmain_update ltmain.sh \
    "$pkgdatadir/config" "$auxdir" pkgconfig_header

Adding --install parameter to libtoolize fixes this build issue:

 autoreconf: running: /openwrt.git/staging_dir/host/bin/libtoolize --install --force
 OpenWrt-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `autostuff'.
 OpenWrt-libtoolize: linking file `autostuff/config.guess'
 OpenWrt-libtoolize: linking file `autostuff/config.sub'
 OpenWrt-libtoolize: linking file `autostuff/install-sh'
 OpenWrt-libtoolize: linking file `autostuff/ltmain.sh'
 OpenWrt-libtoolize: putting macros in `m4'.

Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 include/autotools.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Michael Heimpold Dec. 4, 2018, 8:08 p.m. | #1
Hi,

Am Dienstag, 4. Dezember 2018, 14:47:23 CET schrieb Petr Štetiar:
> I'm trying to create a package for libgpiod,

libgpiod is already part of package feed:
https://github.com/openwrt/packages/blob/master/libs/libgpiod/Makefile

> which uses
> AC_CONFIG_AUX_DIR macro, which is probably leading to the following
> configure error:
> 
>  autoreconf: running: /openwrt.git/staging_dir/host/bin/libtoolize --force
>  OpenWrt-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR,
> `autostuff'. OpenWrt-libtoolize: linking file `autostuff/ltmain.sh'
>  OpenWrt-libtoolize: putting macros in `m4'.

The build seems to run fine without any further tweaking, at least
I cannot remember that I've seen problems so far and buildbots
seem to be happy, too.

Regards,
mhei

>  ...
>  configure: error: cannot find install-sh, install.sh, or shtool in
> autostuff "."/autostuff
> 
> From the build output it's clear, that libtoolize isn't installing
> install-sh symlink, because libtoolize would install install-sh only if
> it's being run with --install parameter. Corresponding part in
> libtoolize:
> 
>  if $opt_install; then
>    func_config_update config.guess \
>      "$pkgdatadir/config" "$auxdir" pkgconfig_header
>    func_config_update config.sub \
>      "$pkgdatadir/config" "$auxdir" pkgconfig_header
>    func_install_update install-sh \
>      "$pkgdatadir/config" "$auxdir" pkgconfig_header
>  fi
>  func_ltmain_update ltmain.sh \
>     "$pkgdatadir/config" "$auxdir" pkgconfig_header
> 
> Adding --install parameter to libtoolize fixes this build issue:
> 
>  autoreconf: running: /openwrt.git/staging_dir/host/bin/libtoolize --install
> --force OpenWrt-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR,
> `autostuff'. OpenWrt-libtoolize: linking file `autostuff/config.guess'
>  OpenWrt-libtoolize: linking file `autostuff/config.sub'
>  OpenWrt-libtoolize: linking file `autostuff/install-sh'
>  OpenWrt-libtoolize: linking file `autostuff/ltmain.sh'
>  OpenWrt-libtoolize: putting macros in `m4'.
> 
> Cc: Felix Fietkau <nbd@nbd.name>
> Signed-off-by: Petr Štetiar <ynezz@true.cz>
> ---
>  include/autotools.mk | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/autotools.mk b/include/autotools.mk
> index aa044aa..ae320fb 100644
> --- a/include/autotools.mk
> +++ b/include/autotools.mk
> @@ -39,7 +39,9 @@ define autoreconf
>  				[ -e $(p)/config.rpath ] || \
>  						ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath; \
>  				touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
> -				$(AM_TOOL_PATHS) $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
> +				$(AM_TOOL_PATHS) \
> +					LIBTOOLIZE='$(STAGING_DIR_HOST)/bin/libtoolize --install' \
> +					$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
>  					$(if $(word 2,$(3)),--no-recursive) \
>  					-B $(STAGING_DIR_HOST)/share/aclocal \
>  					$(patsubst %,-I %,$(5)) \
Petr Štetiar Dec. 4, 2018, 9:25 p.m. | #2
Michael Heimpold <mhei@heimpold.de> [2018-12-04 21:08:51]:

Hi,

> libgpiod is already part of package feed:
> https://github.com/openwrt/packages/blob/master/libs/libgpiod/Makefile

nice, *facepalm* :-) Thanks for letting me know! I've just missed it, sorry
for the noise.

> >  autoreconf: running: /openwrt.git/staging_dir/host/bin/libtoolize --force
> >  OpenWrt-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR,
> > `autostuff'. OpenWrt-libtoolize: linking file `autostuff/ltmain.sh'
> >  OpenWrt-libtoolize: putting macros in `m4'.
> 
> The build seems to run fine without any further tweaking, at least
> I cannot remember that I've seen problems so far and buildbots
> seem to be happy, too.

That's because I've run out of the luck today and I've picked up "wrong"
source file[1], the one from the Git snapshot for 1.2 tag, and since it's not
release tarball, it's missing the `autostuff` subdir with install-sh script,
leading to my build problems which this patch tried to fix.

1. https://github.com/ynezz/openwrt/commit/0e6e823b5a819d9e4ec62c186a68a4fa6afb9945

-- ynezz

Patch

diff --git a/include/autotools.mk b/include/autotools.mk
index aa044aa..ae320fb 100644
--- a/include/autotools.mk
+++ b/include/autotools.mk
@@ -39,7 +39,9 @@  define autoreconf
 				[ -e $(p)/config.rpath ] || \
 						ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath; \
 				touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
-				$(AM_TOOL_PATHS) $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
+				$(AM_TOOL_PATHS) \
+					LIBTOOLIZE='$(STAGING_DIR_HOST)/bin/libtoolize --install' \
+					$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
 					$(if $(word 2,$(3)),--no-recursive) \
 					-B $(STAGING_DIR_HOST)/share/aclocal \
 					$(patsubst %,-I %,$(5)) \