PSARC/2015/160 ISC libomapi, libdst, and libdhcpctl
authorPraveen Kumar Muthuswamy <praveen.muthuswamy@oracle.com>
Thu, 09 Apr 2015 15:37:57 -0700
changeset 4084 3b8278addf4b
parent 4083 70f2f26368fe
child 4085 936779f6ced9
PSARC/2015/160 ISC libomapi, libdst, and libdhcpctl 20411483 Need dynamic library support for ISC DHCP component
components/isc-dhcp/Makefile
components/isc-dhcp/dhcp.p5m
components/isc-dhcp/llib-ldhcpctl
components/isc-dhcp/llib-ldst
components/isc-dhcp/llib-lomapi
components/isc-dhcp/patches/dhcp-dynamiclibraries.patch
--- a/components/isc-dhcp/Makefile	Thu Apr 09 15:35:14 2015 -0700
+++ b/components/isc-dhcp/Makefile	Thu Apr 09 15:37:57 2015 -0700
@@ -40,32 +40,43 @@
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/configure.mk
 include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/lint-libraries.mk
+
+LINT_FLAGS +=   -I$(BUILD_DIR_32)/includes \
+	-I$(BUILD_DIR_64)/includes -I$(SOURCE_DIR)/includes -I.
 
 COMPONENT_PRE_CONFIGURE_ACTION = \
 	($(CLONEY) $(SOURCE_DIR) $(@D))
 
+# Some patches need configure script re-creation.
+COMPONENT_PREP_ACTION +=(cd $(@D); autoreconf -vfi);
+
 CONFIGURE_OPTIONS  +=	--sysconfdir=$(ETCDIR)/inet
 CONFIGURE_OPTIONS  +=	--sbindir=$(USRLIBDIR)/inet
 CONFIGURE_OPTIONS  +=	--bindir=$(USRSBINDIR)
 CONFIGURE_OPTIONS  +=	--enable-use-sockets
 CONFIGURE_OPTIONS  +=	--enable-ipv4-pktinfo
+CONFIGURE_OPTIONS  +=	--with-pic
 
 
 # Disable message in omapip/errwarn.c.
 CPPFLAGS  +=	        -DNOMINUM
 CONFIGURE_OPTIONS  +=   CPPFLAGS="$(CPPFLAGS)"
 
+CFLAGS += -g -fPIC
+CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
+
 COMPONENT_TEST_DIR =	$(@D)
 
-configure:	$(CONFIGURE_32)
+configure:	$(CONFIGURE_32_and_64)
 
-build:		$(BUILD_32)
+build:		$(BUILD_32_and_64)
 
-install:	build $(INSTALL_32) $(PROTO_DIR)/dhcpd.leases
+install:	build $(INSTALL_32_and_64) $(PROTO_DIR)/dhcpd.leases
 
-test:		$(TEST_32)
+test:		$(TEST_32_and_64)
 
-$(PROTO_DIR)/dhcpd.leases:	$(INSTALL_32)
+$(PROTO_DIR)/dhcpd.leases:	$(INSTALL_32_and_64)
 	$(TOUCH) [email protected]
 
 
--- a/components/isc-dhcp/dhcp.p5m	Thu Apr 09 15:35:14 2015 -0700
+++ b/components/isc-dhcp/dhcp.p5m	Thu Apr 09 15:37:57 2015 -0700
@@ -31,7 +31,7 @@
 set name=info.classification value=org.opensolaris.category.2008:System/Services
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
-set name=org.opensolaris.arc-caseid value=PSARC/2011/043
+set name=org.opensolaris.arc-caseid value=PSARC/2011/043 value=PSARC/2015/160
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
 file server/dhcpd.conf path=etc/inet/dhcpd.conf.example group=sys
 file dhcp_auths path=etc/security/auth_attr.d/service%2Fnetwork%2Fisc-dhcp
@@ -40,12 +40,38 @@
 file isc-dhcp-server.xml \
     path=lib/svc/manifest/network/dhcp/isc-dhcp-server.xml group=sys mode=0444
 file isc-dhcp path=lib/svc/method/isc-dhcp mode=0555
+file dhcpctl/dhcpctl.h path=usr/include/isc-dhcp/dhcpctl.h
+file includes/isc-dhcp/dst.h path=usr/include/isc-dhcp/dst.h
+file includes/omapip/omapip.h path=usr/include/isc-dhcp/omapip.h
+file includes/omapip/trace.h path=usr/include/isc-dhcp/trace.h
+link path=usr/lib/$(MACH64)/libdhcpctl.so target=libdhcpctl.so.1
+file path=usr/lib/$(MACH64)/libdhcpctl.so.1
+link path=usr/lib/$(MACH64)/libdst.so target=libdst.so.1
+file path=usr/lib/$(MACH64)/libdst.so.1
+link path=usr/lib/$(MACH64)/libomapi.so target=libomapi.so.1
+file path=usr/lib/$(MACH64)/libomapi.so.1
+file path=usr/lib/$(MACH64)/llib-ldhcpctl.ln
+file path=usr/lib/$(MACH64)/llib-ldst.ln
+file path=usr/lib/$(MACH64)/llib-lomapi.ln
 file SmfDHCPStates.html path=usr/lib/help/auths/locale/SmfDHCPStates.html
 file SmfValueDHCP.html path=usr/lib/help/auths/locale/SmfValueDHCP.html
 file path=usr/lib/inet/dhcpd
 file path=usr/lib/inet/dhcrelay
+link path=usr/lib/libdhcpctl.so target=libdhcpctl.so.1
+file path=usr/lib/libdhcpctl.so.1
+link path=usr/lib/libdst.so target=libdst.so.1
+file path=usr/lib/libdst.so.1
+link path=usr/lib/libomapi.so target=libomapi.so.1
+file path=usr/lib/libomapi.so.1
+file path=usr/lib/llib-ldhcpctl
+file path=usr/lib/llib-ldhcpctl.ln
+file path=usr/lib/llib-ldst
+file path=usr/lib/llib-ldst.ln
+file path=usr/lib/llib-lomapi
+file path=usr/lib/llib-lomapi.ln
 file path=usr/sbin/omshell
 file path=usr/share/man/man1/omshell.1
+file path=usr/share/man/man3/omapi.3
 file path=usr/share/man/man5/dhcp-eval.5
 file path=usr/share/man/man5/dhcp-options.5
 file path=usr/share/man/man5/dhcpd.conf.5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/llib-ldhcpctl	Thu Apr 09 15:37:57 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <stdlib.h>
+#include <sys/time.h>
+#include <dhcpctl/dhcpctl.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/llib-ldst	Thu Apr 09 15:37:57 2015 -0700
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <stdlib.h>
+#include <config.h>
+#include <isc-dhcp/dst.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/llib-lomapi	Thu Apr 09 15:37:57 2015 -0700
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include <config.h>
+#include <omapip/omapip.h>
+#include <omapip/trace.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/patches/dhcp-dynamiclibraries.patch	Thu Apr 09 15:37:57 2015 -0700
@@ -0,0 +1,154 @@
+# HG changeset patch
+# User Praveen Kumar Muthuswamy <[email protected]>
+# Date 1428520414 25200
+#      Wed Apr 08 12:13:34 2015 -0700
+# Node ID 045f212982ea4578a9dafb925ad62cf366802dc6
+# Parent  6470d3cc3ce1677a8283cdf15257c2b8c0ab43c9
+/*
+ * This patch file (dhcp-dynamiclibraries.patch) was developed in-house to
+ * allow isc-dhcp to build and package shared objects for libomapi, libdhcpctl,
+ * and libdst. Upstream (ISC) has been made aware of this requirement and the
+ * the patch through a service ticket and they are actively working on
+ * developing the patch.
+ */
+
+diff --git a/client/Makefile.am b/client/Makefile.am
+--- a/client/Makefile.am
++++ b/client/Makefile.am
[email protected]@ -5,7 +5,7 @@
+ 		   scripts/netbsd scripts/nextstep scripts/openbsd \
+ 		   scripts/solaris scripts/openwrt
+ dhclient_LDADD = ../common/libdhcp.a ../minires/libres.a \
+-		 ../omapip/libomapi.a ../dst/libdst.a
++		 ../omapip/libomapi.la ../dst/libdst.la
+ man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
+ EXTRA_DIST = $(man_MANS)
+ 
+diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
+--- a/common/tests/Makefile.am
++++ b/common/tests/Makefile.am
[email protected]@ -13,7 +13,7 @@
+ alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c
+ alloc_unittest_LDADD = $(ATF_LDFLAGS)
+ alloc_unittest_LDADD += ../libdhcp.a  \
+-	../../omapip/libomapi.a ../../dst/libdst.a ../../minires/libres.a
++	../../omapip/libomapi.la ../../dst/libdst.la ../../minires/libres.a
+ 
+ check: $(ATF_TESTS)
+ 	atf-run | atf-report
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
[email protected]@ -37,7 +37,7 @@
+ # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+ AC_USE_SYSTEM_EXTENSIONS
+ 
+-AC_PROG_RANLIB
++AC_PROG_LIBTOOL
+ AC_CONFIG_HEADERS([includes/config.h])
+ 
+ # we sometimes need to know byte order for building packets
+diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
[email protected]@ -1,15 +1,16 @@
+ bin_PROGRAMS = omshell
+-lib_LIBRARIES = libdhcpctl.a
++lib_LTLIBRARIES = libdhcpctl.la
++libdhcpctl_la_LDFLAGS = -version-info 1
+ noinst_PROGRAMS = cltest
+ man_MANS = omshell.1 dhcpctl.3
+ EXTRA_DIST = $(man_MANS)
+ 
+ omshell_SOURCES = omshell.c
+-omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../minires/libres.a \
+-                ../omapip/libomapi.a ../dst/libdst.a
++omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../minires/libres.a \
++                ../omapip/libomapi.la ../dst/libdst.la
+ 
+-libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
++libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c
+ 
+ cltest_SOURCES = cltest.c
+-cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../minires/libres.a \
+-               ../omapip/libomapi.a ../dst/libdst.a
++cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../minires/libres.a \
++               ../omapip/libomapi.la ../dst/libdst.la
+diff --git a/dst/Makefile.am b/dst/Makefile.am
+--- a/dst/Makefile.am
++++ b/dst/Makefile.am
[email protected]@ -1,8 +1,9 @@
+ AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5
+ 
+-lib_LIBRARIES = libdst.a
++lib_LTLIBRARIES = libdst.la
++libdst_la_LDFLAGS = -version-info 1
+ 
+-libdst_a_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
++libdst_la_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
+ 		   base64.c prandom.c
+ 
+ EXTRA_DIST = dst_internal.h md5.h md5_locl.h
+diff --git a/omapip/Makefile.am b/omapip/Makefile.am
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
[email protected]@ -1,7 +1,8 @@
+-lib_LIBRARIES = libomapi.a
++lib_LTLIBRARIES = libomapi.la
++libomapi_la_LDFLAGS = -version-info 1
+ noinst_PROGRAMS = svtest
+ 
+-libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
++libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
+ 		     errwarn.c listener.c dispatch.c generic.c support.c \
+ 		     handle.c message.c convert.c hash.c auth.c inet_addr.c \
+ 		     array.c trace.c mrtrace.c toisc.c iscprint.c
[email protected]@ -9,5 +10,5 @@
+ EXTRA_DIST = $(man_MANS)
+ 
+ svtest_SOURCES = test.c
+-svtest_LDADD = libomapi.a ../dst/libdst.a
++svtest_LDADD = libomapi.la ../dst/libdst.la
+ 
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
[email protected]@ -2,7 +2,7 @@
+ 
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c
+-dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../dst/libdst.a ../minires/libres.a
++dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la ../dst/libdst.la ../minires/libres.a
+ man_MANS = dhcrelay.8
+ EXTRA_DIST = $(man_MANS)
+ 
+diff --git a/server/Makefile.am b/server/Makefile.am
+--- a/server/Makefile.am
++++ b/server/Makefile.am
[email protected]@ -13,9 +13,9 @@
+ 		dhcpv6.c mdb6.c
+ 
+ # libomapi.a this is here twice to handle circular library dependencies :(
+-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../dst/libdst.a \
+-	      ../dhcpctl/libdhcpctl.a ../minires/libres.a \
+-	      ../omapip/libomapi.a
++dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la ../dst/libdst.la \
++	      ../dhcpctl/libdhcpctl.la ../minires/libres.a \
++	      ../omapip/libomapi.la
+ 
+ man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+ EXTRA_DIST = $(man_MANS)
+diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
+--- a/server/tests/Makefile.am
++++ b/server/tests/Makefile.am
[email protected]@ -17,8 +17,8 @@
+           ../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c        \
+           ../dhcpd.c
+ 
+-DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a    \
+-          $(top_builddir)/dhcpctl/libdhcpctl.a $(top_builddir)/dst/libdst.a \
++DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la    \
++          $(top_builddir)/dhcpctl/libdhcpctl.la $(top_builddir)/dst/libdst.la \
+           $(top_builddir)/minires/libres.a
+ 
+ ATF_TESTS =