diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-05-17 13:36:06 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-05-17 13:44:36 +0200 |
commit | 8d93c1c255f8d171716ad35691281d7967b643ad (patch) | |
tree | 28dc4519dd7341901bd5623c32f277a384ace8bc /core/mk/pkg-macros/pkg-config.mk | |
parent | 49bce85534212c58f6b77272bca6f036db1ec6cc (diff) | |
download | embtoolkit-8d93c1c255f8d171716ad35691281d7967b643ad.tar.gz embtoolkit-8d93c1c255f8d171716ad35691281d7967b643ad.tar.bz2 embtoolkit-8d93c1c255f8d171716ad35691281d7967b643ad.tar.xz |
Build system: improve __embtk_fix_pkgconfig_files internal macro
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'core/mk/pkg-macros/pkg-config.mk')
-rw-r--r-- | core/mk/pkg-macros/pkg-config.mk | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/mk/pkg-macros/pkg-config.mk b/core/mk/pkg-macros/pkg-config.mk index 8fe591d..bcae8e2 100644 --- a/core/mk/pkg-macros/pkg-config.mk +++ b/core/mk/pkg-macros/pkg-config.mk @@ -47,16 +47,26 @@ define embtk_pkgconfig-cflags $(PKGCONFIG_BIN) $(strip $(1)) --cflags) endef +# +# FIXME: Get rid of this macro, each package should indicate its .pc files # Macro to adapt pkg-config files for cross compiling +# __pkgconfig_includedir = includedir=$(embtk_sysroot)/usr/include __pkgconfig_prefix = prefix=$(embtk_sysroot)/usr __pkgconfig_libdir = libdir=$(embtk_sysroot)/usr/$(LIBDIR) +__embtk_pkgconfig_dir0 = $(embtk_sysroot)/usr/$(LIBDIR)/pkgconfig +__embtk_pkgconfig_dir1 = $(embtk_sysroot)/usr/share/pkgconfig define __embtk_fix_pkgconfig_files - __conf_files0=$$(find $(embtk_sysroot)/usr/$(LIBDIR)/pkgconfig -name *.pc); \ - __conf_files1=$$(find $(embtk_sysroot)/usr/share/pkgconfig -name *.pc); \ + if [ -d $(__embtk_pkgconfig_dir0) ]; then \ + __conf_files0=$$(find $(__embtk_pkgconfig_dir0) -name *.pc); \ + fi; \ + if [ -d $(__embtk_pkgconfig_dir1) ]; then \ + __conf_files1=$$(find $(__embtk_pkgconfig_dir1) -name *.pc); \ + fi; \ for i in $$__conf_files0 $$__conf_files1; do \ sed -e 's;prefix=.*;$(__pkgconfig_prefix);' \ -e 's;includedir=$${prefix}/include;$(__pkgconfig_includedir);' \ + -e 's;includedir=/usr/include;$(__pkgconfig_includedir);' \ -e 's;libdir=.*;$(__pkgconfig_libdir);' < $$i > $$i.new; \ mv $$i.new $$i; \ done |