From patchwork Wed Jan 4 21:06:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 134358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "rcsinet15.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id BB1281007D7 for ; Thu, 5 Jan 2012 08:06:32 +1100 (EST) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q04L6Q9o031940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 4 Jan 2012 21:06:27 GMT Received: from oss.oracle.com (oss.oracle.com [141.146.12.120]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q04L6PhK003285 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Jan 2012 21:06:26 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RiY2T-0001gH-Nt; Wed, 04 Jan 2012 13:06:25 -0800 Received: from rcsinet12.oracle.com ([148.87.113.124]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1RiY2R-0001g9-EN for fedfs-utils-devel@oss.oracle.com; Wed, 04 Jan 2012 13:06:23 -0800 Received: from mail-gy0-f171.google.com (mail-gy0-f171.google.com [209.85.160.171]) by rcsinet12.oracle.com (Sentrion-MTA-4.2.0/Sentrion-MTA-4.2.0) with ESMTP id q04L6DpH008243 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 4 Jan 2012 21:06:22 GMT Received: by mail-gy0-f171.google.com with SMTP id 10so9357234ghy.2 for ; Wed, 04 Jan 2012 13:06:22 -0800 (PST) Received: by 10.100.244.7 with SMTP id r7mr17006223anh.10.1325711182717; Wed, 04 Jan 2012 13:06:22 -0800 (PST) Received: from degas.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id b6sm5768987ani.16.2012.01.04.13.06.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Jan 2012 13:06:22 -0800 (PST) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Wed, 04 Jan 2012 16:06:20 -0500 Message-ID: <20120104210620.8810.32134.stgit@degas.1015granger.net> In-Reply-To: <20120104204207.8810.10569.stgit@degas.1015granger.net> References: <20120104204207.8810.10569.stgit@degas.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Flow-Control-Info: class=Default ip=209.85.160.171 ct-class=R6 ct-vol1=0 ct-vol2=0 ct-vol3=0 ct-risk=68 ct-spam1=0 ct-spam2=0 ct-bulk=0 rcpts=1 size=13758 Subject: [fedfs-utils] [PATCH 1/7] Makefile: Enable building shared libraries X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-CT-RefId: str=0001.0A090201.4F04BF53.009D:SCFSTAT1119972, ss=1, re=-6.300, fgs=0 X-Auth-Type: Internal IP The new junction plug-ins will be shared libraries. You can't build a shared library from static libraries, so all of the libraries we have in fedfs-utils need to be converted to shared libraries. The use of "-fPIC" as a flag on $(LD) is incorrect, so I moved it to $(CFLAGS) where needed. "-fPIE" is appropriate for finished executables. As a final touch I converted all of the existing commands to grab the shared version instead of the static version of each library. Signed-off-by: Chuck Lever --- .gitignore | 3 +++ src/fedfsc/Makefile.am | 15 +++++++-------- src/fedfsd/Makefile.am | 15 +++++++-------- src/libadmin/Makefile.am | 6 +++--- src/libjunction/Makefile.am | 10 +++++----- src/libnsdb/Makefile.am | 11 ++++++----- src/libparser/Makefile.am | 10 +++++----- src/libsi/Makefile.am | 10 +++++----- src/libxlog/Makefile.am | 10 +++++----- src/mount/Makefile.am | 11 +++++------ src/nsdbc/Makefile.am | 13 ++++++------- src/nsdbparams/Makefile.am | 13 ++++++------- src/resolve-junction/Makefile.am | 15 +++++++-------- 13 files changed, 70 insertions(+), 72 deletions(-) diff --git a/.gitignore b/.gitignore index e9ab4a6..468a533 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ ChangeLog Doxygen/ .*.swp *.o +*.lo +*.la src/fedfsd/fedfsd src/resolve-junction/resolve-junction src/nsdbparams/nsdbparams @@ -64,4 +66,5 @@ libtool stamp-h1 depcomp .deps/ +.libs/ .stgit* diff --git a/src/fedfsc/Makefile.am b/src/fedfsc/Makefile.am index 2fd4d4d..2659e35 100644 --- a/src/fedfsc/Makefile.am +++ b/src/fedfsc/Makefile.am @@ -32,16 +32,15 @@ sbin_PROGRAMS = fedfs-null \ fedfs-lookup-replication LDADD = $(LIBTIRPC) $(LIBLDAP) $(LIBLBER) \ $(LIBSQLITE3) $(LIBIDN) $(LIBUUID) \ - $(top_builddir)/src/libadmin/libadmin.a \ - $(top_builddir)/src/libjunction/libjunction.a \ - $(top_builddir)/src/libnsdb/libnsdb.a \ - $(top_builddir)/src/libxlog/libxlog.a + $(top_builddir)/src/libadmin/libadmin.la \ + $(top_builddir)/src/libjunction/libjunction.la \ + $(top_builddir)/src/libnsdb/libnsdb.la \ + $(top_builddir)/src/libxlog/libxlog.la CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIE \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc -AM_LDFLAGS = -fPIC diff --git a/src/fedfsd/Makefile.am b/src/fedfsd/Makefile.am index c8332dc..37fd42f 100644 --- a/src/fedfsd/Makefile.am +++ b/src/fedfsd/Makefile.am @@ -29,19 +29,18 @@ sbin_PROGRAMS = fedfsd fedfsd_SOURCES = listen.c main.c privilege.c svc.c fedfsd_LDADD = $(LIBTIRPC) $(LIBLDAP) $(LIBLBER) \ $(LIBSQLITE3) $(LIBIDN) $(LIBUUID) $(LIBCAP) \ - $(top_builddir)/src/libadmin/libadmin.a \ - $(top_builddir)/src/libnsdb/libnsdb.a \ - $(top_builddir)/src/libjunction/libjunction.a \ - $(top_builddir)/src/libxlog/libxlog.a + $(top_builddir)/src/libadmin/libadmin.la \ + $(top_builddir)/src/libnsdb/libnsdb.la \ + $(top_builddir)/src/libjunction/libjunction.la \ + $(top_builddir)/src/libxlog/libxlog.la CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIE \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc -AM_LDFLAGS = -fPIC ####################################################################### # The following allows the current practice of having diff --git a/src/libadmin/Makefile.am b/src/libadmin/Makefile.am index ac0095b..d59bc57 100644 --- a/src/libadmin/Makefile.am +++ b/src/libadmin/Makefile.am @@ -23,12 +23,12 @@ ## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt ## -noinst_LIBRARIES = libadmin.a -libadmin_a_SOURCES = fedfs_admin_clnt.c fedfs_admin_svc.c fedfs_admin_xdr.c +noinst_LTLIBRARIES = libadmin.la +libadmin_la_SOURCES = fedfs_admin_clnt.c fedfs_admin_svc.c fedfs_admin_xdr.c CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in # Squelch compiler warnings for rpcgen-produced source code -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIC AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc diff --git a/src/libjunction/Makefile.am b/src/libjunction/Makefile.am index b9e7b1a..bc97bf3 100644 --- a/src/libjunction/Makefile.am +++ b/src/libjunction/Makefile.am @@ -23,13 +23,13 @@ ## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt ## -noinst_LIBRARIES = libjunction.a -libjunction_a_SOURCES = junction.c +noinst_LTLIBRARIES = libjunction.la +libjunction_la_SOURCES = junction.c CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIC \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include diff --git a/src/libnsdb/Makefile.am b/src/libnsdb/Makefile.am index f0a4dd6..cd7805b 100644 --- a/src/libnsdb/Makefile.am +++ b/src/libnsdb/Makefile.am @@ -24,14 +24,15 @@ ## noinst_HEADERS = nsdb-internal.h -noinst_LIBRARIES = libnsdb.a -libnsdb_a_SOURCES = administrator.c annotation.c display.c fileserver.c \ + +noinst_LTLIBRARIES = libnsdb.la +libnsdb_la_SOURCES = administrator.c annotation.c display.c fileserver.c \ ldap.c nsdb.c path.c sqlite.c CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIC \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include diff --git a/src/libparser/Makefile.am b/src/libparser/Makefile.am index 2ef8549..75b43e9 100644 --- a/src/libparser/Makefile.am +++ b/src/libparser/Makefile.am @@ -23,13 +23,13 @@ ## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt ## -noinst_LIBRARIES = libparser.a -libparser_a_SOURCES = parse_opt.c token.c +noinst_LTLIBRARIES = libparser.la +libparser_la_SOURCES = parse_opt.c token.c CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIC \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include diff --git a/src/libsi/Makefile.am b/src/libsi/Makefile.am index af9fe8c..e270d4a 100644 --- a/src/libsi/Makefile.am +++ b/src/libsi/Makefile.am @@ -23,13 +23,13 @@ ## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt ## -noinst_LIBRARIES = libsi.a -libsi_a_SOURCES = getsrvinfo.c +noinst_LTLIBRARIES = libsi.la +libsi_la_SOURCES = getsrvinfo.c CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIC \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include diff --git a/src/libxlog/Makefile.am b/src/libxlog/Makefile.am index 677e7b8..1e85fa6 100644 --- a/src/libxlog/Makefile.am +++ b/src/libxlog/Makefile.am @@ -23,13 +23,13 @@ ## http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt ## -noinst_LIBRARIES = libxlog.a -libxlog_a_SOURCES = xlog.c +noinst_LTLIBRARIES = libxlog.la +libxlog_la_SOURCES = xlog.c CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIC \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I $(top_srcdir)/src/include diff --git a/src/mount/Makefile.am b/src/mount/Makefile.am index 7dbab03..7b00b4a 100644 --- a/src/mount/Makefile.am +++ b/src/mount/Makefile.am @@ -28,17 +28,16 @@ root_sbin_PROGRAMS = mount.fedfs sbin_PROGRAMS = fedfs-map-nfs4 fedfs_map_nfs4_SOURCES = fedfs-map-nfs4.c fedfs_map_nfs4_LDADD = $(LIBRESOLV) \ - $(top_builddir)/src/libsi/libsi.a + $(top_builddir)/src/libsi/libsi.la mount_fedfs_SOURCES = main.c # mount.fedfs must never link against libraries in /usr mount_fedfs_LDADD = $(LIBRESOLV) \ - $(top_builddir)/src/libsi/libsi.a + $(top_builddir)/src/libsi/libsi.la CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIE \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -AM_LDFLAGS = -fPIC diff --git a/src/nsdbc/Makefile.am b/src/nsdbc/Makefile.am index 9dfb642..a52d91c 100644 --- a/src/nsdbc/Makefile.am +++ b/src/nsdbc/Makefile.am @@ -30,15 +30,14 @@ sbin_PROGRAMS = nsdb-annotate nsdb-describe nsdb-list \ nsdb-create-fsl nsdb-delete-fsl nsdb-update-fsl LDADD = $(LIBLDAP) $(LIBLBER) \ $(LIBSQLITE3) $(LIBIDN) $(LIBUUID) \ - $(top_builddir)/src/libnsdb/libnsdb.a \ - $(top_builddir)/src/libxlog/libxlog.a \ - $(top_builddir)/src/libjunction/libjunction.a + $(top_builddir)/src/libnsdb/libnsdb.la \ + $(top_builddir)/src/libxlog/libxlog.la \ + $(top_builddir)/src/libjunction/libjunction.la CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIE \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I$(top_srcdir)/src/include -I/usr/include/tirpc -AM_LDFLAGS = -fPIC diff --git a/src/nsdbparams/Makefile.am b/src/nsdbparams/Makefile.am index 2109c87..b21220e 100644 --- a/src/nsdbparams/Makefile.am +++ b/src/nsdbparams/Makefile.am @@ -28,15 +28,14 @@ sbin_PROGRAMS = nsdbparams nsdbparams_SOURCES = delete.c list.c main.c show.c update.c LDADD = $(LIBLDAP) $(LIBLBER) \ $(LIBSQLITE3) $(LIBIDN) $(LIBUUID) $(LIBCAP) \ - $(top_builddir)/src/libnsdb/libnsdb.a \ - $(top_builddir)/src/libjunction/libjunction.a \ - $(top_builddir)/src/libxlog/libxlog.a + $(top_builddir)/src/libnsdb/libnsdb.la \ + $(top_builddir)/src/libjunction/libjunction.la \ + $(top_builddir)/src/libxlog/libxlog.la CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIE \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc -AM_LDFLAGS = -fPIC diff --git a/src/resolve-junction/Makefile.am b/src/resolve-junction/Makefile.am index ec5f5a7..323a1d9 100644 --- a/src/resolve-junction/Makefile.am +++ b/src/resolve-junction/Makefile.am @@ -29,16 +29,15 @@ sbin_PROGRAMS = resolve-junction resolve_junction_SOURCES = main.c privilege.c privilege.h LDADD = $(LIBLDAP) $(LIBLBER) \ $(LIBSQLITE3) $(LIBIDN) $(LIBUUID) $(LIBCAP) \ - $(top_builddir)/src/libadmin/libadmin.a \ - $(top_builddir)/src/libnsdb/libnsdb.a \ - $(top_builddir)/src/libjunction/libjunction.a \ - $(top_builddir)/src/libxlog/libxlog.a + $(top_builddir)/src/libadmin/libadmin.la \ + $(top_builddir)/src/libnsdb/libnsdb.la \ + $(top_builddir)/src/libjunction/libjunction.la \ + $(top_builddir)/src/libxlog/libxlog.la CLEANFILES = cscope.in.out cscope.out cscope.po.out *~ DISTCLEANFILES = Makefile.in -AM_CFLAGS = -ggdb -fstrict-aliasing -fpie -Wall -Wextra \ - -pedantic -Wformat=2 -Wstrict-aliasing=2 \ - -Wp,-D_FORTIFY_SOURCE=2 +AM_CFLAGS = -ggdb -fstrict-aliasing -fPIE \ + -Wall -Wextra -pedantic -Wformat=2 \ + -Wstrict-aliasing=2 -Wp,-D_FORTIFY_SOURCE=2 AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include -I/usr/include/tirpc -AM_LDFLAGS = -fPIC