Skip to contentSkip to conversation

package/asterisk: fix host build

PATCH New Yann E. MORIN 2 participants 5 messages Sep 24, 2017 – Sep 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/asterisk: fix host build

The host menuselect tool is linked to our host libxml2 library, but it is missing an RPATH to the host directory.

This is because menuselect does not use automake, so does not inherit the LDFLAGS from the configure run.

We fix that by simply passing $(HOST_CONFIGURE_OPTS) in the make environment.

At the same time, we also install the tool in the host directory, even if not used from there, so that the sanity checks we run are properly passed.

Cc Arnout Vandecappelle <[email protected]>
---
 package/asterisk/asterisk.mk | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
package/asterisk/asterisk.mk +16 -5
index a6801a006d..50512c0b3a 100644
@@ -294,12 +294,23 @@ HOST_ASTERISK_CONF_OPTS = \
 	--without-curses \
 	--with-ncurses=$(HOST_DIR)/usr
 
-# Even though menuselect is an autotools package, it is *not* installed,
-# as asterisk does expect it to be in a sub-directory of its source tree,
-# which do by copying the full menuselect build tree as a pre-configure
-# hook in the target variant.
+# Not an automake package, so does not inherit LDFLAGS et al. from
+# the configure run.
+HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
+
+# Even though menuselect is an autotools package, it is not an automake
+# package and does not have an 'install' rule, as asterisk does expect
+# it to be in a sub-directory of its source tree. We do so by copying
+# the full menuselect build tree as a pre-configure hook in the target
+# variant.
+# However, the sanity checks on host packages are not run on menuselect.
+# But we still want to catch that menuselect has the proper rpath set,
+# for example, as it uses host libraries that we do build, like
+# host-libxml2.
+# So we do manually install the menuselect tool.
 define HOST_ASTERISK_INSTALL_CMDS
-	@:
+	$(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
+		$(HOST_DIR)/bin/asterisk-menuselect
 endef
 
 $(eval $(host-autotools-package))
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 package/asterisk: fix host build

Quoted 39 lines · Yann E. MORIN

The host menuselect tool is linked to our host libxml2 library, but it is missing an RPATH to the host directory.

This is because menuselect does not use automake, so does not inherit the LDFLAGS from the configure run.

We fix that by simply passing $(HOST_CONFIGURE_OPTS) in the make environment.

At the same time, we also install the tool in the host directory, even if not used from there, so that the sanity checks we run are properly passed.

Cc Arnout Vandecappelle <[email protected]>
---
 package/asterisk/asterisk.mk | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
package/asterisk/asterisk.mk +8 -4
index a6801a006d..50512c0b3a 100644
@@ -294,12 +294,23 @@ HOST_ASTERISK_CONF_OPTS = \
 	--without-curses \
 	--with-ncurses=$(HOST_DIR)/usr
 
-# Even though menuselect is an autotools package, it is *not* installed,
-# as asterisk does expect it to be in a sub-directory of its source tree,
-# which do by copying the full menuselect build tree as a pre-configure
-# hook in the target variant.
+# Not an automake package, so does not inherit LDFLAGS et al. from
+# the configure run.
+HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
+
+# Even though menuselect is an autotools package, it is not an automake
+# package and does not have an 'install' rule, as asterisk does expect
+# it to be in a sub-directory of its source tree. We do so by copying
+# the full menuselect build tree as a pre-configure hook in the target

package/asterisk/asterisk.mk HOST_ASTERISK_CONF_OPTS = \ · line 313

Quoted 10 lines
package/asterisk/asterisk.mk +8 -1
+# variant.
+# However, the sanity checks on host packages are not run on menuselect.
+# But we still want to catch that menuselect has the proper rpath set,
+# for example, as it uses host libraries that we do build, like
+# host-libxml2.
+# So we do manually install the menuselect tool.
 define HOST_ASTERISK_INSTALL_CMDS
-	@:
+	$(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
+		$(HOST_DIR)/bin/asterisk-menuselect

So then could you symlink to this instead of copying the entire tree?

Regards,
Arnout

Quoted 4 lines
package/asterisk/asterisk.mk +0 -0
 endef
 
 $(eval $(host-autotools-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 package/asterisk: fix host build

On 2017-09-24 18:51 +0200, Arnout Vandecappelle spake thusly:

Quoted 46 lines · Yann E. MORIN
Quoted 43 lines

The host menuselect tool is linked to our host libxml2 library, but it is missing an RPATH to the host directory.

This is because menuselect does not use automake, so does not inherit the LDFLAGS from the configure run.

We fix that by simply passing $(HOST_CONFIGURE_OPTS) in the make environment.

At the same time, we also install the tool in the host directory, even if not used from there, so that the sanity checks we run are properly passed.

Cc Arnout Vandecappelle <[email protected]>
---
 package/asterisk/asterisk.mk | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
package/asterisk/asterisk.mk +12 -4
index a6801a006d..50512c0b3a 100644
@@ -294,12 +294,23 @@ HOST_ASTERISK_CONF_OPTS = \
 	--without-curses \
 	--with-ncurses=$(HOST_DIR)/usr
 
-# Even though menuselect is an autotools package, it is *not* installed,
-# as asterisk does expect it to be in a sub-directory of its source tree,
-# which do by copying the full menuselect build tree as a pre-configure
-# hook in the target variant.
+# Not an automake package, so does not inherit LDFLAGS et al. from
+# the configure run.
+HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
+
+# Even though menuselect is an autotools package, it is not an automake
+# package and does not have an 'install' rule, as asterisk does expect
+# it to be in a sub-directory of its source tree. We do so by copying
+# the full menuselect build tree as a pre-configure hook in the target
+# variant.
+# However, the sanity checks on host packages are not run on menuselect.
+# But we still want to catch that menuselect has the proper rpath set,
+# for example, as it uses host libraries that we do build, like
Quoted 8 lines

package/asterisk/asterisk.mk HOST_ASTERISK_CONF_OPTS = \ · line 313

Quoted 6 lines
package/asterisk/asterisk.mk +4 -1
+# host-libxml2.
+# So we do manually install the menuselect tool.
 define HOST_ASTERISK_INSTALL_CMDS
-	@:
+	$(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
+		$(HOST_DIR)/bin/asterisk-menuselect

So then could you symlink to this instead of copying the entire tree?

Nope, because all the intermediate object files would missing, so the Makefile would try to build them, and would then rebuild menuseclect as well, and all those efforts would have been in vain...

And anyway, this would have been a topic different from this patch.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/asterisk: fix host build

Arnout, All,

On 2017-09-24 19:04 +0200, Yann E. MORIN spake thusly:

Quoted 2 lines

On 2017-09-24 18:51 +0200, Arnout Vandecappelle spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
package/asterisk/asterisk.mk +8 -0
+# Even though menuselect is an autotools package, it is not an automake
+# package and does not have an 'install' rule, as asterisk does expect
+# it to be in a sub-directory of its source tree. We do so by copying
+# the full menuselect build tree as a pre-configure hook in the target
+# variant.
+# However, the sanity checks on host packages are not run on menuselect.
+# But we still want to catch that menuselect has the proper rpath set,
+# for example, as it uses host libraries that we do build, like
Quoted 8 lines

package/asterisk/asterisk.mk HOST_ASTERISK_CONF_OPTS = \ · line 313

Quoted 6 lines
package/asterisk/asterisk.mk +4 -1
+# host-libxml2.
+# So we do manually install the menuselect tool.
 define HOST_ASTERISK_INSTALL_CMDS
-	@:
+	$(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
+		$(HOST_DIR)/bin/asterisk-menuselect

So then could you symlink to this instead of copying the entire tree?

Quoted 3 lines

Nope, because all the intermediate object files would missing, so the Makefile would try to build them, and would then rebuild menuseclect as well, and all those efforts would have been in vain...

Oh, and I forgot: it needs a file, makeopts, generated by configure, but running menuselect's configure in the target variant is the things we want to avoid in the first place.

And to be sure, I tried what you suggest, and it does not work (build failure).

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 package/asterisk: fix host build

In reply to Yann E. MORIN
Quoted 6 lines · Yann E. MORIN

The host menuselect tool is linked to our host libxml2 library, but it is missing an RPATH to the host directory.

This is because menuselect does not use automake, so does not inherit the LDFLAGS from the configure run.

Quoted 6 lines

We fix that by simply passing $(HOST_CONFIGURE_OPTS) in the make environment.

At the same time, we also install the tool in the host directory, even if not used from there, so that the sanity checks we run are properly passed.

I think this is a bit over the top, but oh well.

Quoted 3 lines
Cc Arnout Vandecappelle <[email protected]>

Applied to master, thanks.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF