summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-05-17 19:41:08 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-05-17 19:41:08 +0200
commit136ddd860cabb806fa7a442d02c784a13300f0c3 (patch)
tree48490796639c6dd558026a73e083c331d29a81b2
parent444ff228d2ac521d3dcdcdc5675238fa1e618fe0 (diff)
downloadembtoolkit-136ddd860cabb806fa7a442d02c784a13300f0c3.tar.gz
embtoolkit-136ddd860cabb806fa7a442d02c784a13300f0c3.tar.bz2
embtoolkit-136ddd860cabb806fa7a442d02c784a13300f0c3.tar.xz
Build system: autotools packages: give ability to build package with configure script not in standard path
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r--core/mk/pkg-macros/configure.mk10
-rw-r--r--core/mk/pkg-macros/vars.mk2
-rw-r--r--packages/misc/foo/foo-autotools.mk1
3 files changed, 9 insertions, 4 deletions
diff --git a/core/mk/pkg-macros/configure.mk b/core/mk/pkg-macros/configure.mk
index 5d2151c..ee822c9 100644
--- a/core/mk/pkg-macros/configure.mk
+++ b/core/mk/pkg-macros/configure.mk
@@ -65,6 +65,8 @@ define __embtk_print_configure_opts
echo
endef
+__embtk_pkg_configurescript = $(__embtk_pkg_srcdir)/$(__embtk_pkg_configuredir)configure
+
__embtk_pkg_ildflags = -L$(embtk_sysroot)/$(LIBDIR)
__embtk_pkg_ildflags += -L$(embtk_sysroot)/usr/$(LIBDIR)
__embtk_pkg_cc = CC=$(if $(__embtk_pkg_noccache),$(TARGETCC),$(TARGETCC_CACHED))
@@ -74,7 +76,7 @@ define embtk_configure_pkg
$(if $(EMBTK_BUILDSYS_DEBUG),
$(call embtk_pinfo,"Configure $(__embtk_pkg_package)..."))
$(call __embtk_configure_autoreconfpkg,$(1))
- $(Q)test -e $(__embtk_pkg_srcdir)/configure || exit 1
+ $(Q)test -e $(__embtk_pkg_configurescript) || exit 1
$(call __embtk_print_configure_opts,$(__embtk_pkg_configureopts))
$(if $(CONFIG_EMBTK_CLIB_MUSL),$(call __embtk_fixgconfigsfor_pkg,$(1)))
$(Q)cd $(__embtk_pkg_builddir); \
@@ -98,7 +100,7 @@ define embtk_configure_pkg
ac_cv_func_realloc_0_nonnull=yes \
CONFIG_SHELL=$(CONFIG_EMBTK_SHELL) \
$(__embtk_pkg_configureenv) $(__embtk_pkg_scanbuild) \
- $(CONFIG_EMBTK_SHELL) $(__embtk_pkg_srcdir)/configure \
+ $(CONFIG_EMBTK_SHELL) $(__embtk_pkg_configurescript) \
--build=$(HOST_BUILD) --host=$(STRICT_GNU_TARGET) \
--target=$(STRICT_GNU_TARGET) --libdir=/usr/$(LIBDIR) \
--prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-rpath \
@@ -125,7 +127,7 @@ define embtk_configure_hostpkg
$(call embtk_pinfo,"Configure $(__embtk_pkg_package) for host..."))
$(call __embtk_configure_autoreconfpkg,$(1))
$(if $(CONFIG_EMBTK_CLIB_MUSL),$(call __embtk_fixgconfigsfor_pkg,$(1)))
- $(Q)test -e $(__embtk_pkg_srcdir)/configure || exit 1
+ $(Q)test -e $(__embtk_pkg_configurescript) || exit 1
$(call __embtk_print_configure_opts,$(__embtk_pkg_configureopts))
$(Q)cd $(__embtk_pkg_builddir); \
CPPFLAGS="$(__embtk_hostpkg_cppflags)" \
@@ -136,7 +138,7 @@ define embtk_configure_hostpkg
$(if $(__embtk_pkg_noccache),,CXX=$(HOSTCXX_CACHED)) \
CONFIG_SHELL=$(CONFIG_EMBTK_SHELL) \
$(__embtk_pkg_configureenv) \
- $(CONFIG_EMBTK_SHELL) $(__embtk_pkg_srcdir)/configure \
+ $(CONFIG_EMBTK_SHELL) $(__embtk_pkg_configurescript) \
--build=$(HOST_BUILD) --host=$(HOST_ARCH) \
--prefix=$(strip $(if $(__embtk_pkg_prefix), \
$(__embtk_pkg_prefix),$(embtk_htools)/usr)) \
diff --git a/core/mk/pkg-macros/vars.mk b/core/mk/pkg-macros/vars.mk
index d48a061..c3d9877 100644
--- a/core/mk/pkg-macros/vars.mk
+++ b/core/mk/pkg-macros/vars.mk
@@ -129,5 +129,7 @@ __embtk_pkg_scanbuild = $(if $(__embtk_pkg_scanbuild-y),$(TARGETSCANBUILD) -o $
__embtk_pkg_makedirs = $(strip $($(PKGV)_MAKE_DIRS))
__embtk_pkg_makeenv = $(strip $($(PKGV)_MAKE_ENV))
__embtk_pkg_makeopts = $(strip $($(PKGV)_MAKE_OPTS))
+___embtk_pkg_configuredir = $(strip $($(PKGV)_CONFIGURE_DIR))
+__embtk_pkg_configuredir = $(if $(___embtk_pkg_configuredir),$(___embtk_pkg_configuredir)/)
__embtk_pkg_usewaf-y = $(CONFIG_EMBTK_$(PKGV)_USE_WAF)
diff --git a/packages/misc/foo/foo-autotools.mk b/packages/misc/foo/foo-autotools.mk
index 41dfc0c..3a5bd53 100644
--- a/packages/misc/foo/foo-autotools.mk
+++ b/packages/misc/foo/foo-autotools.mk
@@ -48,6 +48,7 @@ FOO_CONFIGURE_OPTS :=
FOO_MAKE_ENV :=
FOO_MAKE_OPTS :=
FOO_MAKE_DIRS :=
+FOO_CONFIGURE_DIR := # relative path in foo source where to find the configure script
FOO_DEPS :=