Re: [PATCH] build: fix fallout from swithing to common shared lib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




Reviewed-by: Jan Friesse <jfriesse@xxxxxxxxxx>

Fabio M. Di Nitto napsal(a):
From: "Fabio M. Di Nitto"<fdinitto@xxxxxxxxxx>

when building corosync on a clean system or for the very first
time, corosync_common needs to be visible both via -L for link
and for the LD_PATH, otherwise the linker cannot resolve
normal library dependencies.

This issue does NOT affect corosync users, but it's confined
to internal corosync only.

Signed-off-by: Fabio M. Di Nitto<fdinitto@xxxxxxxxxx>
---
  test/Makefile.am  |   44 ++++++++++++++++++++++----------------------
  tools/Makefile.am |   32 +++++++++++++++++++-------------
  2 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index ee64b9e..af19ab2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -34,53 +34,53 @@ MAINTAINERCLEANFILES    = Makefile.in
  INCLUDES       		= -I$(top_builddir)/include/corosync -I$(top_srcdir)/include

  noinst_PROGRAMS		= testevs evsbench evsverify cpgverify testcpg testcpg2 cpgbench \
-			testquorum testvotequorum1 testvotequorum2	\
-			stress_cpgfdget stress_cpgcontext cpgbound testsam \
-			testcpgzc cpgbenchzc testzcgc stress_cpgzc
+			  testquorum testvotequorum1 testvotequorum2	\
+			  stress_cpgfdget stress_cpgcontext cpgbound testsam \
+			  testcpgzc cpgbenchzc testzcgc stress_cpgzc

+COMMON_OPTS		= -L../lib -L../common_lib -Wl,-rpath,../common_lib

  testevs_LDADD		= -levs $(LIBQB_LIBS)
-testevs_LDFLAGS		= -L../lib
+testevs_LDFLAGS		= $(COMMON_OPTS)
  testcpg_LDADD		= -lcpg $(LIBQB_LIBS)
-testcpg_LDFLAGS		= -L../lib
+testcpg_LDFLAGS		= $(COMMON_OPTS)
  testcpg2_LDADD		= -lcpg $(LIBQB_LIBS)
-testcpg2_LDFLAGS	= -L../lib
+testcpg2_LDFLAGS	= $(COMMON_OPTS)
  testcpgzc_LDADD		= -lcpg $(LIBQB_LIBS)
-testcpgzc_LDFLAGS	= -L../lib
+testcpgzc_LDFLAGS	= $(COMMON_OPTS)
  testzcgc_LDADD		= -lcpg $(LIBQB_LIBS)
-testzcgc_LDFLAGS	= -L../lib
+testzcgc_LDFLAGS	= $(COMMON_OPTS)
  stress_cpgzc_LDADD	= -lcpg $(LIBQB_LIBS)
-stress_cpgzc_LDFLAGS	= -L../lib
+stress_cpgzc_LDFLAGS	= $(COMMON_OPTS)
  stress_cpgfdget_LDADD	= -lcpg $(LIBQB_LIBS)
-stress_cpgfdget_LDFLAGS	= -L../lib
+stress_cpgfdget_LDFLAGS	= $(COMMON_OPTS)
  stress_cpgcontext_LDADD	= -lcpg $(LIBQB_LIBS)
-stress_cpgcontext_LDFLAGS	= -L../lib
+stress_cpgcontext_LDFLAGS	= $(COMMON_OPTS)
  testquorum_LDADD	= -lquorum $(LIBQB_LIBS)
-testquorum_LDFLAGS	= -L../lib
+testquorum_LDFLAGS	= $(COMMON_OPTS)
  testvotequorum1_LDADD	= -lvotequorum $(LIBQB_LIBS)
-testvotequorum1_LDFLAGS	= -L../lib
+testvotequorum1_LDFLAGS	= $(COMMON_OPTS)
  testvotequorum2_LDADD	= -lvotequorum $(LIBQB_LIBS)
-testvotequorum2_LDFLAGS	= -L../lib
+testvotequorum2_LDFLAGS	= $(COMMON_OPTS)
  evsverify_LDADD		= -levs -ltotem_pg $(LIBQB_LIBS)
-evsverify_LDFLAGS	= -L../lib -L../exec
+evsverify_LDFLAGS	= $(COMMON_OPTS) -L../exec
  cpgverify_LDADD		= -lcpg -ltotem_pg $(LIBQB_LIBS)
-cpgverify_LDFLAGS	= -L../lib -L../exec
+cpgverify_LDFLAGS	= $(COMMON_OPTS) -L../exec
  cpgbound_LDADD		= -lcpg $(LIBQB_LIBS)
-cpgbound_LDFLAGS	= -L../lib
+cpgbound_LDFLAGS	= $(COMMON_OPTS)
  evsbench_LDADD		= -levs $(LIBQB_LIBS)
-evsbench_LDFLAGS	= -L../lib
+evsbench_LDFLAGS	= $(COMMON_OPTS)
  cpgbench_LDADD		= -lcpg $(LIBQB_LIBS)
-cpgbench_LDFLAGS	= -L../lib
+cpgbench_LDFLAGS	= $(COMMON_OPTS)
  cpgbenchzc_LDADD	= -lcpg -lcorosync_common $(LIBQB_LIBS)
-cpgbenchzc_LDFLAGS	= -L../lib -L../common_lib
+cpgbenchzc_LDFLAGS	= $(COMMON_OPTS)
  testsam_LDADD		= -lsam -lcmap -lquorum $(LIBQB_LIBS)
-testsam_LDFLAGS		= -L../lib
+testsam_LDFLAGS		= $(COMMON_OPTS)

  LINT_FILES1:=$(filter-out sa_error.c, $(wildcard *.c))
  LINT_FILES2:=$(filter-out testevsth.c, $(LINT_FILES1))
  LINT_FILES:=$(filter-out testparse.c, $(LINT_FILES2))

-
  lint:
  	-for f in $(LINT_FILES) ; do echo Splint $$f ; splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) $$f ; done

diff --git a/tools/Makefile.am b/tools/Makefile.am
index 7021845..10b80c4 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -49,25 +49,31 @@ corosync-xmlproc: corosync-xmlproc.sh

  EXTRA_DIST		= $(bin_SCRIPTS) corosync-xmlproc.sh corosync-notifyd.sysconfig.example

+COMMON_OPTS		= -L../lib -L../common_lib -Wl,-rpath,../common_lib
+
+corosync_cmapctl_LDFLAGS= $(COMMON_OPTS)
  corosync_cmapctl_LDADD	= -lcorosync_common -lcmap $(LIBQB_LIBS)
-corosync_cmapctl_LDFLAGS= -L../lib -L../common_lib
+
  corosync_fplay_LDADD	= $(LIBQB_LIBS)
+
+corosync_pload_LDFLAGS	= $(COMMON_OPTS)
  corosync_pload_LDADD	= -lpload $(LIBQB_LIBS)
-corosync_pload_LDFLAGS	= -L../lib
+
+corosync_cfgtool_LDFLAGS= $(COMMON_OPTS)
  corosync_cfgtool_LDADD	= -lcfg $(LIBQB_LIBS)
-corosync_cfgtool_LDFLAGS= -L../lib
+
+corosync_cpgtool_LDFLAGS= $(COMMON_OPTS)
  corosync_cpgtool_LDADD	= -lcfg -lcpg $(LIBQB_LIBS)
-corosync_cpgtool_LDFLAGS= -L../lib
-corosync_quorumtool_LDADD = -lcmap -lcfg -lquorum \
-			    -lvotequorum $(LIBQB_LIBS)
-corosync_quorumtool_LDFLAGS = -L../lib
-
-corosync_notifyd_LDADD = -lcfg -lcmap \
-			   $(LIBQB_LIBS) $(DBUS_LIBS) $(SNMPLIBS) \
-			   -lquorum
-corosync_notifyd_LDFLAGS = -L../lib
-corosync_notifyd_CPPFLAGS = $(DBUS_CFLAGS)

+corosync_quorumtool_LDFLAGS = $(COMMON_OPTS)
+corosync_quorumtool_LDADD   = -lcmap -lcfg -lquorum \
+			      -lvotequorum $(LIBQB_LIBS)
+
+corosync_notifyd_CPPFLAGS = $(DBUS_CFLAGS)
+corosync_notifyd_LDFLAGS  = $(COMMON_OPTS)
+corosync_notifyd_LDADD    = -lcfg -lcmap \
+			    $(LIBQB_LIBS) $(DBUS_LIBS) $(SNMPLIBS) \
+			    -lquorum

  lint:
  	-splint $(LINT_FLAGS) $(DBUS_CFLAGS) $(INCLUDES) $(CFLAGS) *.c

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Corosync Project]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux