summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-06-06 00:03:50 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-06-06 00:03:50 +0200
commite0ca5593b3d0d0697592ab0b703b8bb445d75bdc (patch)
tree855863103d5ccee7e4e80905129e24c1d08f4176 /mk
parent610baa60688f5d15a3e1b1632e4b41770f3a669b (diff)
downloadembtoolkit-e0ca5593b3d0d0697592ab0b703b8bb445d75bdc.tar.gz
embtoolkit-e0ca5593b3d0d0697592ab0b703b8bb445d75bdc.tar.bz2
embtoolkit-e0ca5593b3d0d0697592ab0b703b8bb445d75bdc.tar.xz
Build system: simplify libtool/pkgconfig files fixup macros
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/macros.mk59
1 files changed, 21 insertions, 38 deletions
diff --git a/mk/macros.mk b/mk/macros.mk
index ec02a0a..4aca579 100644
--- a/mk/macros.mk
+++ b/mk/macros.mk
@@ -143,24 +143,16 @@ endif
$(call ECHO_BLUE,"################################################################################")
#Macro to adapt libtool files (*.la) for cross compiling
-libtool_files_adapt:
-ifeq ($(CONFIG_EMBTK_64BITS_FS_COMPAT32),y)
- @LIBTOOLS_LA_FILES=`find $(SYSROOT)/usr/lib32 -name *.la`; \
- for i in $$LIBTOOLS_LA_FILES; \
- do \
- sed -e "s;libdir='\/usr\/lib32';libdir='$(SYSROOT)\/usr\/lib32';" $$i \
- > $$i.new; \
- mv $$i.new $$i; \
- done
-else
- @LIBTOOLS_LA_FILES=`find $(SYSROOT)/usr/lib -name *.la`; \
- for i in $$LIBTOOLS_LA_FILES; \
- do \
- sed -e "s;libdir='\/usr\/lib';libdir='$(SYSROOT)\/usr\/lib';" < $$i \
- > $$i.new; \
- mv $$i.new $$i; \
+define __EMBTK_FIX_LIBTOOL_FILES
+ @LIBTOOLS_LA_FILES=`find $(SYSROOT)/usr/$(LIBDIR) -name *.la`; \
+ for i in $$LIBTOOLS_LA_FILES; do \
+ sed -e "s;libdir='\/usr\/$(LIBDIR)';libdir='$(SYSROOT)\/usr\/$(LIBDIR)';" $$i \
+ > $$i.new; \
+ mv $$i.new $$i; \
done
-endif
+endef
+libtool_files_adapt:
+ $(Q)$(call __EMBTK_FIX_LIBTOOL_FILES)
#Macro to restore libtool files (*.la)
libtool_files_restore:
@@ -183,26 +175,17 @@ else
endif
#Macro to adapt pkg-config files for cross compiling
-pkgconfig_files_adapt:
-ifeq ($(CONFIG_EMBTK_64BITS_FS_COMPAT32),y)
- @PKGCONF_FILES=`find $(SYSROOT)/usr/lib32/pkgconfig -name *.pc`; \
- for i in $$PKGCONF_FILES; \
- do \
- sed -e 's;prefix=.*;prefix=$(SYSROOT)/usr;' \
- -e 's;includedir=$${prefix}/include;includedir=$(SYSROOT)/usr/include;' \
- -e 's;libdir=.*;libdir=$(SYSROOT)/usr/lib32;' < $$i > $$i.new; \
- mv $$i.new $$i; \
+define __EMBTK_FIX_PKGCONFIG_FILES
+ @PKGCONFIG_FILES=`find $(SYSROOT)/usr/$(LIBDIR)/pkgconfig -name *.pc`; \
+ for i in $$PKGCONFIG_FILES; do \
+ sed -e 's;prefix=.*;prefix=$(SYSROOT)/usr;' \
+ -e 's;includedir=$${prefix}/include;includedir=$(SYSROOT)/usr/include;' \
+ -e 's;libdir=.*;libdir=$(SYSROOT)/usr/$(LIBDIR);' < $$i > $$i.new; \
+ mv $$i.new $$i; \
done
-else
- @PKGCONF_FILES=`find $(SYSROOT)/usr/lib/pkgconfig -name *.pc`; \
- for i in $$PKGCONF_FILES; \
- do \
- sed -e 's;prefix=.*;prefix=$(SYSROOT)/usr;' \
- -e 's;includedir=$${prefix}/include;includedir=$(SYSROOT)/usr/include;' \
- -e 's;libdir=.*;libdir=$(SYSROOT)/usr/lib;' < $$i > $$i.new; \
- mv $$i.new $$i; \
- done
-endif
+endef
+pkgconfig_files_adapt:
+ $(Q)$(call __EMBTK_FIX_PKGCONFIG_FILES)
#A macro to remove rpath in packages that use libtool -rpath
define EMBTK_KILL_LT_RPATH
@@ -311,8 +294,8 @@ define __EMBTK_INSTALL_PKG_MAKE
$(Q)$(MAKE) -C $($(1)_BUILD_DIR) $(J)
$(Q)$(MAKE) -C $($(1)_BUILD_DIR) \
DESTDIR=$(SYSROOT)/$($(1)_SYSROOT_SUFFIX) install
- $(Q)$(MAKE) libtool_files_adapt
- $(Q)$(MAKE) pkgconfig_files_adapt
+ $(Q)$(call __EMBTK_FIX_LIBTOOL_FILES)
+ $(Q)$(call __EMBTK_FIX_PKGCONFIG_FILES)
@touch $($(1)_BUILD_DIR)/.installed
endef
define EMBTK_INSTALL_PKG