* [Buildroot] [PATCH] package/attr: fix building out-of-tree
@ 2013-05-23 10:25 Yann E. MORIN
2013-05-23 10:32 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2013-05-23 10:25 UTC (permalink / raw)
To: buildroot
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
This needs touching a m4 macro, so requires autoreconf.
But since this is not a true autotools-package, autoreconf whines
about missing macros. So we have to explicitly pass '-I m4'.
But since this is not a true autotools-package, the build then fails
with missing definition for _() as the configure scripts gets confused.
So, we just call autoconf, not autoreconf.
This means we have to provide our own hook. Ideally, this would be a
post-patch hook, but post-patch hooks are run before dependencies,
so host-autoconf is not built at that point. So this has to be a
pre-configure hook.
Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/attr/attr-002-fix-build-out-of-tree.patch | 19 +++++++++++++++++++
package/attr/attr.mk | 16 ++++++++++++++++
2 files changed, 35 insertions(+)
create mode 100644 package/attr/attr-002-fix-build-out-of-tree.patch
diff --git a/package/attr/attr-002-fix-build-out-of-tree.patch b/package/attr/attr-002-fix-build-out-of-tree.patch
new file mode 100644
index 0000000..f21ed1a
--- /dev/null
+++ b/package/attr/attr-002-fix-build-out-of-tree.patch
@@ -0,0 +1,19 @@
+configure: fix building out of tree
+
+Do not expect that builddir == srcdir when scanning the VERSION file.
+
+Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff -durN attr-2.4.46.old/m4/package_globals.m4 attr-2.4.46/m4/package_globals.m4
+--- attr-2.4.46.old/m4/package_globals.m4 2010-01-22 23:55:11.000000000 +0100
++++ attr-2.4.46/m4/package_globals.m4 2013-05-23 00:15:30.124341001 +0200
+@@ -24,7 +24,7 @@
+
+ AC_PROG_CC
+
+- . ./VERSION
++ . "${srcdir}/VERSION"
+ pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
+ AC_SUBST(pkg_version)
+ pkg_release=$PKG_BUILD
diff --git a/package/attr/attr.mk b/package/attr/attr.mk
index 288052d..5933e6a 100644
--- a/package/attr/attr.mk
+++ b/package/attr/attr.mk
@@ -10,6 +10,22 @@ ATTR_SITE = http://download.savannah.gnu.org/releases/attr
ATTR_INSTALL_STAGING = YES
ATTR_CONF_OPT = --enable-gettext=no
+# Since we touch the m4 macros, we need to re-autoconf.
+# But since this is not a real autotools package, we can't use
+# AUTORECONF=YES, so we have to provide our own hook for that.
+# Also, there is no need to run that before all calls to
+# ./configure, but since post-patch hooks are run before
+# dependencies, this can't be a post-patch hook, and has to be
+# a pre-configure hook... :-(
+ATTR_DEPENDENCIES += host-autoconf
+define ATTR_REAUTOCONF
+ @$(call MESSAGE,"Re-autoconf")
+ ( cd $(@D); \
+ autoconf -I m4 -Wall --force -v \
+ )
+endef
+ATTR_PRE_CONFIGURE_HOOKS += ATTR_REAUTOCONF
+
# While the configuration system uses autoconf, the Makefiles are
# hand-written and do not use automake. Therefore, we have to hack
# around their deficiencies by passing installation paths.
--
1.8.1.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/attr: fix building out-of-tree
2013-05-23 10:25 [Buildroot] [PATCH] package/attr: fix building out-of-tree Yann E. MORIN
@ 2013-05-23 10:32 ` Thomas Petazzoni
2013-05-23 11:25 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2013-05-23 10:32 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Thu, 23 May 2013 12:25:28 +0200, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> This needs touching a m4 macro, so requires autoreconf.
>
> But since this is not a true autotools-package, autoreconf whines
> about missing macros. So we have to explicitly pass '-I m4'.
>
> But since this is not a true autotools-package, the build then fails
> with missing definition for _() as the configure scripts gets confused.
> So, we just call autoconf, not autoreconf.
If it's not a true autotools-package, then it shouldn't be using the
autotools-package infrastructure, I'd say.
And making a change to the source code at the configure step (such
as autoconf or autoreconf) is fundamentally going into the wrong
direction with regard to out-of-tree support. All steps until configure
are done only once, on the source tree, and then all steps starting
from the configure step are done for both the target build and the host
build.
Therefore, autoreconf/autoconf should not be part of the configure
step anymore. I'm sending an e-mail about that in a moment.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/attr: fix building out-of-tree
2013-05-23 10:32 ` Thomas Petazzoni
@ 2013-05-23 11:25 ` Thomas Petazzoni
2013-05-23 17:41 ` Yann E. MORIN
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2013-05-23 11:25 UTC (permalink / raw)
To: buildroot
Yann,
On Thu, 23 May 2013 12:32:08 +0200, Thomas Petazzoni wrote:
> > This needs touching a m4 macro, so requires autoreconf.
> >
> > But since this is not a true autotools-package, autoreconf whines
> > about missing macros. So we have to explicitly pass '-I m4'.
> >
> > But since this is not a true autotools-package, the build then fails
> > with missing definition for _() as the configure scripts gets confused.
> > So, we just call autoconf, not autoreconf.
>
> If it's not a true autotools-package, then it shouldn't be using the
> autotools-package infrastructure, I'd say.
>
> And making a change to the source code at the configure step (such
> as autoconf or autoreconf) is fundamentally going into the wrong
> direction with regard to out-of-tree support. All steps until configure
> are done only once, on the source tree, and then all steps starting
> from the configure step are done for both the target build and the host
> build.
>
> Therefore, autoreconf/autoconf should not be part of the configure
> step anymore. I'm sending an e-mail about that in a moment.
Also, since this package doesn't use automake, most likely its
Makefiles are not out-of-tree capable, so in this case, there's no
point in fixing the configure script to be out-of-tree capable if the
rest of the build process isn't. Unless of course the entire package is
fixed to support out-of-tree, but I believe 'attr' is a very small
package which is not really worth fixing first. There will be many more
bigger packages that would be more useful to fix for out-of-tree
builds, I believe.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/attr: fix building out-of-tree
2013-05-23 11:25 ` Thomas Petazzoni
@ 2013-05-23 17:41 ` Yann E. MORIN
0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2013-05-23 17:41 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2013-05-23 13:25 +0200, Thomas Petazzoni spake thusly:
> On Thu, 23 May 2013 12:32:08 +0200, Thomas Petazzoni wrote:
> > > This needs touching a m4 macro, so requires autoreconf.
> > >
> > > But since this is not a true autotools-package, autoreconf whines
> > > about missing macros. So we have to explicitly pass '-I m4'.
> > >
> > > But since this is not a true autotools-package, the build then fails
> > > with missing definition for _() as the configure scripts gets confused.
> > > So, we just call autoconf, not autoreconf.
> >
> > If it's not a true autotools-package, then it shouldn't be using the
> > autotools-package infrastructure, I'd say.
> >
> > And making a change to the source code at the configure step (such
> > as autoconf or autoreconf) is fundamentally going into the wrong
> > direction with regard to out-of-tree support. All steps until configure
> > are done only once, on the source tree, and then all steps starting
> > from the configure step are done for both the target build and the host
> > build.
> >
> > Therefore, autoreconf/autoconf should not be part of the configure
> > step anymore. I'm sending an e-mail about that in a moment.
>
> Also, since this package doesn't use automake, most likely its
> Makefiles are not out-of-tree capable, so in this case, there's no
> point in fixing the configure script to be out-of-tree capable if the
> rest of the build process isn't.
Indeed. I'll look at making it a generic-package instead, which will
fix OOT at the same time (since generic-package will be not-OOT capable
by default).
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-23 17:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 10:25 [Buildroot] [PATCH] package/attr: fix building out-of-tree Yann E. MORIN
2013-05-23 10:32 ` Thomas Petazzoni
2013-05-23 11:25 ` Thomas Petazzoni
2013-05-23 17:41 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox