diff options
author | Kai Kang <kai.kang@windriver.com> | 2017-05-19 16:52:47 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-05-29 15:15:20 +0100 |
commit | 291a273502b5675455de30cd652850517d425f4f (patch) | |
tree | 3eeb2b34c3b0167aca2357c34fde34f25ae3f894 | |
parent | e680f23c8b644051486c21d77442190ec80494de (diff) | |
download | poky-291a273502b5675455de30cd652850517d425f4f.tar.gz |
dhcp: build shared libraries
When enable bind threads support, it fails to compile dhcp:
| tmp/work/armv5e-poky-linux-gnueabi/bind/9.10.3-P3-r0/build/lib/isc/pthreads/../../../
| ../bind-9.10.3-P3/lib/isc/pthreads/thread.c:64: undefined reference to `pthread_create'
Enable build shared libraries for bind and dhcp to fix the build
failure. And the patch is ported from Fedora.
Add sub-package dhcp-libs to package shared libraries.
(From OE-Core rev: dde83ec778c09557d28b4388258e594be653875c)
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp.inc | 6 | ||||
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp/build-shared-libs.patch | 186 | ||||
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb | 1 |
3 files changed, 191 insertions, 2 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc index aafdd0a13d..969fdcbd5b 100644 --- a/meta/recipes-connectivity/dhcp/dhcp.inc +++ b/meta/recipes-connectivity/dhcp/dhcp.inc | |||
@@ -46,7 +46,7 @@ EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \ | |||
46 | --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \ | 46 | --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \ |
47 | --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \ | 47 | --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \ |
48 | --with-libbind=${STAGING_LIBDIR}/ \ | 48 | --with-libbind=${STAGING_LIBDIR}/ \ |
49 | --enable-paranoia \ | 49 | --enable-paranoia --disable-static \ |
50 | --with-randomdev=/dev/random \ | 50 | --with-randomdev=/dev/random \ |
51 | " | 51 | " |
52 | 52 | ||
@@ -82,12 +82,14 @@ do_install_append () { | |||
82 | sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service | 82 | sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service |
83 | } | 83 | } |
84 | 84 | ||
85 | PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" | 85 | PACKAGES += "dhcp-libs dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" |
86 | 86 | ||
87 | FILES_${PN} = "" | 87 | FILES_${PN} = "" |
88 | RDEPENDS_${PN}-dev = "" | 88 | RDEPENDS_${PN}-dev = "" |
89 | RDEPENDS_${PN}-staticdev = "" | 89 | RDEPENDS_${PN}-staticdev = "" |
90 | 90 | ||
91 | FILES_${PN}-libs = "${libdir}/libdhcpctl.so.0* ${libdir}/libomapi.so.0*" | ||
92 | |||
91 | FILES_${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server" | 93 | FILES_${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server" |
92 | RRECOMMENDS_${PN}-server = "dhcp-server-config" | 94 | RRECOMMENDS_${PN}-server = "dhcp-server-config" |
93 | 95 | ||
diff --git a/meta/recipes-connectivity/dhcp/dhcp/build-shared-libs.patch b/meta/recipes-connectivity/dhcp/dhcp/build-shared-libs.patch new file mode 100644 index 0000000000..0b3d6e42b0 --- /dev/null +++ b/meta/recipes-connectivity/dhcp/dhcp/build-shared-libs.patch | |||
@@ -0,0 +1,186 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Port patches from Fedora to build shared libs rather than static libs. | ||
4 | |||
5 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
6 | --- | ||
7 | diff --git a/client/Makefile.am b/client/Makefile.am | ||
8 | index 84d8131..e776bf0 100644 | ||
9 | --- a/client/Makefile.am | ||
10 | +++ b/client/Makefile.am | ||
11 | @@ -15,7 +15,7 @@ dhclient_SOURCES = $(srcdir)/clparse.c $(srcdir)/dhclient.c $(srcdir)/dhc6.c \ | ||
12 | scripts/bsdos scripts/freebsd scripts/linux scripts/macos \ | ||
13 | scripts/netbsd scripts/nextstep scripts/openbsd \ | ||
14 | scripts/solaris scripts/openwrt | ||
15 | -dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \ | ||
16 | - $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
17 | +dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ | ||
18 | + -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc | ||
19 | man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5 | ||
20 | EXTRA_DIST = $(man_MANS) | ||
21 | diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am | ||
22 | index 05cd9c1..ab7a5a3 100644 | ||
23 | --- a/common/tests/Makefile.am | ||
24 | +++ b/common/tests/Makefile.am | ||
25 | @@ -15,26 +15,23 @@ ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest | ||
26 | alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c | ||
27 | alloc_unittest_LDADD = $(ATF_LDFLAGS) | ||
28 | alloc_unittest_LDADD += ../libdhcp.a \ | ||
29 | - ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \ | ||
30 | - $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
31 | + ../../omapip/libomapi.la -L$(BINDLIBDIR) -ldns -lisccfg -lisc | ||
32 | |||
33 | dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c | ||
34 | dns_unittest_LDADD = $(ATF_LDFLAGS) | ||
35 | dns_unittest_LDADD += ../libdhcp.a \ | ||
36 | - ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \ | ||
37 | - $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
38 | + ../../omapip/libomapi.la -L$(BINDLIBDIR) -ldns -lisccfg -lisc | ||
39 | |||
40 | misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c | ||
41 | misc_unittest_LDADD = $(ATF_LDFLAGS) | ||
42 | misc_unittest_LDADD += ../libdhcp.a \ | ||
43 | - ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \ | ||
44 | - $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
45 | + ../../omapip/libomapi.la -L$(BINDLIBDIR) -ldns -lisccfg -lisc | ||
46 | |||
47 | ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c | ||
48 | ns_name_unittest_LDADD = $(ATF_LDFLAGS) | ||
49 | ns_name_unittest_LDADD += ../libdhcp.a \ | ||
50 | - ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \ | ||
51 | - $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
52 | + ../../omapip/libomapi.a -L$(BINDLIBDIR) \ | ||
53 | + -ldns -lisccfg -lisc | ||
54 | |||
55 | check: $(ATF_TESTS) | ||
56 | -cp -n $(top_srcdir)/common/tests/Atffile Atffile | ||
57 | diff --git a/configure.ac b/configure.ac | ||
58 | index 1684df1..dadc3f1 100644 | ||
59 | --- a/configure.ac | ||
60 | +++ b/configure.ac | ||
61 | @@ -47,16 +47,8 @@ AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes") | ||
62 | # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API. | ||
63 | AC_USE_SYSTEM_EXTENSIONS | ||
64 | |||
65 | -AC_PROG_RANLIB | ||
66 | - | ||
67 | -AC_PATH_PROG(AR, ar) | ||
68 | -AC_SUBST(AR) | ||
69 | - | ||
70 | -if test "X$AR" = "X"; then | ||
71 | - AC_MSG_ERROR([ | ||
72 | -ar program not found. Please fix your PATH to include the directory in | ||
73 | -which ar resides, or set AR in the environment with the full path to ar.]) | ||
74 | -fi | ||
75 | +# Use libtool to simplify building of shared libraries | ||
76 | +AC_PROG_LIBTOOL | ||
77 | |||
78 | AC_CONFIG_HEADERS([includes/config.h]) | ||
79 | |||
80 | diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am | ||
81 | index 9b2486e..784cdf7 100644 | ||
82 | --- a/dhcpctl/Makefile.am | ||
83 | +++ b/dhcpctl/Makefile.am | ||
84 | @@ -3,19 +3,17 @@ BINDLIBDIR = @BINDDIR@ | ||
85 | AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) | ||
86 | |||
87 | bin_PROGRAMS = omshell | ||
88 | -lib_LIBRARIES = libdhcpctl.a | ||
89 | +lib_LTLIBRARIES = libdhcpctl.la | ||
90 | noinst_PROGRAMS = cltest | ||
91 | man_MANS = omshell.1 dhcpctl.3 | ||
92 | EXTRA_DIST = $(man_MANS) | ||
93 | |||
94 | omshell_SOURCES = omshell.c | ||
95 | -omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ | ||
96 | - $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \ | ||
97 | - $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
98 | +omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \ | ||
99 | + -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc | ||
100 | |||
101 | -libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c | ||
102 | +libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c | ||
103 | |||
104 | cltest_SOURCES = cltest.c | ||
105 | -cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ | ||
106 | - $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \ | ||
107 | - $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
108 | +cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \ | ||
109 | + -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc | ||
110 | diff --git a/omapip/Makefile.am b/omapip/Makefile.am | ||
111 | index e4a8599..c0c7a1e 100644 | ||
112 | --- a/omapip/Makefile.am | ||
113 | +++ b/omapip/Makefile.am | ||
114 | @@ -1,10 +1,10 @@ | ||
115 | BINDLIBDIR = @BINDDIR@ | ||
116 | AM_CPPFLAGS = -I$(top_srcdir)/includes | ||
117 | |||
118 | -lib_LIBRARIES = libomapi.a | ||
119 | +lib_LTLIBRARIES = libomapi.la | ||
120 | noinst_PROGRAMS = svtest | ||
121 | |||
122 | -libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \ | ||
123 | +libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \ | ||
124 | errwarn.c listener.c dispatch.c generic.c support.c \ | ||
125 | handle.c message.c convert.c hash.c auth.c inet_addr.c \ | ||
126 | array.c trace.c toisc.c iscprint.c isclib.c | ||
127 | @@ -13,6 +13,5 @@ man_MANS = omapi.3 | ||
128 | EXTRA_DIST = $(man_MANS) | ||
129 | |||
130 | svtest_SOURCES = test.c | ||
131 | -svtest_LDADD = libomapi.a $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \ | ||
132 | - $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
133 | +svtest_LDADD = libomapi.la -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc | ||
134 | |||
135 | diff --git a/relay/Makefile.am b/relay/Makefile.am | ||
136 | index b3bf578..f47009f 100644 | ||
137 | --- a/relay/Makefile.am | ||
138 | +++ b/relay/Makefile.am | ||
139 | @@ -4,9 +4,8 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes | ||
140 | |||
141 | sbin_PROGRAMS = dhcrelay | ||
142 | dhcrelay_SOURCES = dhcrelay.c | ||
143 | -dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ | ||
144 | - $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \ | ||
145 | - $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a | ||
146 | +dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ | ||
147 | + -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc | ||
148 | man_MANS = dhcrelay.8 | ||
149 | EXTRA_DIST = $(man_MANS) | ||
150 | |||
151 | diff --git a/server/Makefile.am b/server/Makefile.am | ||
152 | index b5d8c2d..d7f876d 100644 | ||
153 | --- a/server/Makefile.am | ||
154 | +++ b/server/Makefile.am | ||
155 | @@ -15,10 +15,9 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \ | ||
156 | dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c | ||
157 | |||
158 | dhcpd_CFLAGS = $(LDAP_CFLAGS) | ||
159 | -dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ | ||
160 | - ../dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \ | ||
161 | - $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \ | ||
162 | - $(BINDLIBDIR)/libisc.a $(LDAP_LIBS) | ||
163 | +dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ | ||
164 | + ../dhcpctl/libdhcpctl.la -L$(BINDLIBDIR) \ | ||
165 | + -lirs -ldns -lisccfg -lisc $(LDAP_LIBS) | ||
166 | |||
167 | man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 | ||
168 | EXTRA_DIST = $(man_MANS) | ||
169 | diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am | ||
170 | index 2892309..056978b 100644 | ||
171 | --- a/server/tests/Makefile.am | ||
172 | +++ b/server/tests/Makefile.am | ||
173 | @@ -19,10 +19,9 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c \ | ||
174 | ../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c \ | ||
175 | ../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c | ||
176 | |||
177 | -DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \ | ||
178 | - $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \ | ||
179 | - $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \ | ||
180 | - $(BINDLIBDIR)/libisc.a | ||
181 | +DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la \ | ||
182 | + $(top_builddir)/dhcpctl/libdhcpctl.la \ | ||
183 | + -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc | ||
184 | |||
185 | ATF_TESTS = | ||
186 | if HAVE_ATF | ||
diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb b/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb index 678c29a28f..0a73eccc4b 100644 --- a/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb +++ b/meta/recipes-connectivity/dhcp/dhcp_4.3.5.bb | |||
@@ -9,6 +9,7 @@ SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \ | |||
9 | file://libxml2-configure-argument.patch \ | 9 | file://libxml2-configure-argument.patch \ |
10 | file://tweak-to-support-external-bind.patch \ | 10 | file://tweak-to-support-external-bind.patch \ |
11 | file://remove-dhclient-script-bash-dependency.patch \ | 11 | file://remove-dhclient-script-bash-dependency.patch \ |
12 | file://build-shared-libs.patch \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | SRC_URI[md5sum] = "2b5e5b2fa31c2e27e487039d86f83d3f" | 15 | SRC_URI[md5sum] = "2b5e5b2fa31c2e27e487039d86f83d3f" |