2 # Copyright (C) 2007-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 if
[ -f
"$(PKG_BUILD_DIR)/$(3)$(1)" -a
-e
"$(2)/$(if $(4),$(4),$(1))" ]; then \
10 rm -f
$(PKG_BUILD_DIR
)/$(3)$(1); \
11 ln
-s
$(2)/$(if
$(4),$(4),$(1)) $(PKG_BUILD_DIR
)/$(3)$(1); \
16 PKG_LIBTOOL_PATHS?
=$(CONFIGURE_PATH
)
18 # replace copies of ltmain.sh with the build system's version
19 update_libtool_common
= \
20 $(foreach p
,$(LIBTOOL_PATHS
), \
21 $(call replace
,ltmain.sh
,$(STAGING_DIR
)/host
/share
/libtool
,$(p
)/) \
22 $(call replace
,libtool.m4
,$(STAGING_DIR
)/host
/share
/aclocal
,$(p
)/) \
25 $(foreach p
,$(PKG_LIBTOOL_PATHS
), \
26 $(call replace
,libtool
,$(STAGING_DIR
)/host
/bin
,$(p
)/) \
28 $(call update_libtool_common
)
29 update_libtool_ucxx
= \
30 $(foreach p
,$(PKG_LIBTOOL_PATHS
), \
31 $(call replace
,libtool
,$(STAGING_DIR
)/host
/bin
,$(p
)/,libtool-ucxx
) \
33 $(call update_libtool_common
)
35 autoconf_bool
= $(patsubst %,$(if
$($(1)),--enable
,--disable
)-%,$(2))
37 # prevent libtool from linking against host development libraries
38 define libtool_fixup_libdir
39 find
$(1) -name
'*.la' |
$(XARGS
) \
40 $(SED
) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" \
41 -e
"s,$(STAGING_DIR)/usr/lib/\(libstdc++\|libsupc++\).la,$(TOOLCHAIN_DIR)/lib/\1.la,g"
44 define remove_version_check
45 if
[ -f
"$(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/configure" ]; then \
47 's,\(gentoo\|pardus\)_ltmain_version=.*,\1_ltmain_version="$$$$\1_lt_version",' \
48 $(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/configure
; \
52 # delete *.la-files from staging_dir - we can not yet remove respective lines within all package
53 # Makefiles, since backfire still uses libtool v1.5.x which (may) require those files
54 define libtool_remove_files
55 find
$(1) -name
'*.la' |
$(XARGS
) rm -f
58 Hooks
/InstallDev
/Post
+= libtool_remove_files
60 ifneq ($(filter libtool
,$(PKG_FIXUP
)),)
61 # WARNING: the use of PKG_FIXUP is DEPRECATED
62 PKG_BUILD_DEPENDS
+= libtool
65 ifneq ($(filter libtool-ucxx
,$(PKG_FIXUP
)),)
66 # WARNING: the use of PKG_FIXUP is DEPRECATED
67 PKG_BUILD_DEPENDS
+= libtool