Skip to content

Commit

Permalink
Merge pull request #191 from trws/shared-library-core
Browse files Browse the repository at this point in the history
module libraries and libcore built as shared libs
  • Loading branch information
grondo committed May 19, 2015
2 parents 152eac3 + 2c75c7e commit acd42ce
Show file tree
Hide file tree
Showing 33 changed files with 161 additions and 142 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.NOTPARALLEL:

SUBDIRS = src doc etc t

EXTRA_DIST = \
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ AC_CONFIG_FILES( \
src/common/libev/Makefile \
src/common/libzio/Makefile \
src/common/libflux/Makefile \
src/common/libmrpc/Makefile \
src/lib/Makefile \
src/lib/libcore/Makefile \
src/lib/libpmi/Makefile \
src/bindings/Makefile \
src/bindings/lua/Makefile \
Expand All @@ -141,6 +139,7 @@ AC_CONFIG_FILES( \
src/modules/api/Makefile \
src/modules/kvs/Makefile \
src/modules/modctl/Makefile \
src/modules/libmrpc/Makefile \
src/modules/live/Makefile \
src/modules/mecho/Makefile \
src/modules/barrier/Makefile \
Expand Down
8 changes: 7 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
SUBDIRS = common modules broker connectors lib bindings cmd test
.NOTPARALLEL:

#This order is *important*, common must preceed modules,
# modules must preceed lib
SUBDIRS = common modules lib broker connectors bindings cmd test

check-local: all

noinst_HEADERS = include/flux/core.h
23 changes: 10 additions & 13 deletions src/bindings/lua/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,18 @@ noinst_LTLIBRARIES = \
lalarm.la

luamod_ldflags = \
-avoid-version -module
-avoid-version -module -shared --disable-static \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(top_builddir)/src/modules/libmrpc/libmrpc.la \
$(top_builddir)/src/common/libzio/libzio.la \
$(top_builddir)/src/common/libflux-internal.la \
$(top_builddir)/src/common/libflux-core.la \
$(LUA_LIB)

flux_la_LDFLAGS = \
$(luamod_ldflags)

flux_la_LIBADD = \
$(top_builddir)/src/common/libmrpc/libmrpc.la \
$(top_builddir)/src/common/libzio/libzio.la \
$(top_builddir)/src/lib/libcore/libflux-core.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/libev/libev.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(JSON_LIBS) \
$(LIBZMQ) \
$(LIBCZMQ) \
$(LIBUTIL)
flux_la_LIBADD =

flux_la_SOURCES = \
flux-lua.c \
Expand Down Expand Up @@ -87,7 +83,8 @@ tests_zmsgtest_la_SOURCES = \
tests/zmsg-test.c

tests_zmsgtest_la_LIBADD = \
$(top_builddir)/src/lib/libcore/libflux-core.la \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(top_builddir)/src/common/libflux-core.la \
$(LIBCZMQ) \
$(LUA_LIB)

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/lua/flux-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "flux/core.h"

#include "src/common/libutil/jsonutil.h"
#include "src/common/libmrpc/mrpc.h"
#include "src/modules/libmrpc/mrpc.h"
#include "src/common/libzio/zio.h"
#include "src/common/libzio/kz.h"

Expand Down
8 changes: 4 additions & 4 deletions src/broker/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ flux_broker_SOURCES = \

flux_broker_LDADD = \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/libev/libev.la \
$(LIBMUNGE) $(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBPTHREAD) $(LIBDL)
$(top_builddir)/src/common/libflux-core.la \
$(top_builddir)/src/common/libflux-internal.la

flux_broker_LDFLAGS =
8 changes: 4 additions & 4 deletions src/cmd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ AM_CPPFLAGS = \
-DMANDIR=\"$(mandir)\"

fluxcmd_ldadd = \
$(top_builddir)/src/modules/live/liblive.la \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libev/libev.la \
-L$(top_builddir)/src/modules/live -llive \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBMUNGE) $(LIBPTHREAD) $(LIBDL)

LDADD = $(fluxcmd_ldadd)
Expand Down Expand Up @@ -57,12 +57,12 @@ flux_zio_LDADD = \
$(fluxcmd_ldadd) \
$(LIBUTIL)
flux_mping_LDADD = \
$(top_builddir)/src/common/libmrpc/libmrpc.la \
$(top_builddir)/src/modules/libmrpc/libmrpc.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(fluxcmd_ldadd) \
$(LIBUTIL)
flux_module_LDADD = \
$(top_builddir)/src/modules/modctl/libmodctl.la \
$(top_builddir)/src/common/libmrpc/libmrpc.la \
$(top_builddir)/src/modules/libmrpc/libmrpc.la \
$(fluxcmd_ldadd) \
$(LIBUTIL)
2 changes: 1 addition & 1 deletion src/cmd/flux-mping.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "src/common/libutil/xzmalloc.h"
#include "src/common/libutil/jsonutil.h"
#include "src/common/libutil/monotime.h"
#include "src/common/libmrpc/mrpc.h"
#include "src/modules/libmrpc/mrpc.h"


#define OPTIONS "hp:d:c:"
Expand Down
9 changes: 6 additions & 3 deletions src/cmd/flux.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static const struct option longopts[] = {

static void usage (void)
{
fprintf (stderr,
fprintf (stderr,
"Usage: flux [OPTIONS] COMMAND ARGS\n"
" -x,--exec-path PATH prepend PATH to command search path\n"
" -M,--module-path PATH prepend PATH to module search path\n"
Expand Down Expand Up @@ -270,8 +270,11 @@ char *intree_confdir (void)
char *confdir = NULL;
char *selfdir = dir_self ();

if (strcmp (selfdir, X_BINDIR) != 0)
confdir = xasprintf ("%s/../../etc/flux", selfdir);
if (strcmp (selfdir, X_BINDIR) != 0){
confdir = xasprintf ("%s/%s../../etc/flux",
selfdir,
strstr(selfdir, "/.libs") != NULL ? "../" : "");
}
free (selfdir);
return confdir;
}
Expand Down
28 changes: 27 additions & 1 deletion src/common/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
SUBDIRS = libtap libev liblsd libutil libflux libzio libmrpc
SUBDIRS = libtap libev liblsd libutil libflux libzio

AM_CFLAGS = @GCCWARN@

AM_CPPFLAGS =

fluxinclude_HEADERS = core.h
noinst_LTLIBRARIES = libflux-internal.la
fluxlib_LTLIBRARIES = libflux-core.la
libflux_internal_la_SOURCES =
libflux_internal_la_LIBADD = \
$(builddir)/libflux/libflux.la \
$(builddir)/liblsd/liblsd.la \
$(builddir)/libutil/libutil.la \
$(builddir)/libev/libev.la \
$(LIBMUNGE) $(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBPTHREAD) $(LIBUTIL) \
$(LIBDL) -lrt
libflux_core_la_SOURCES =
libflux_core_la_LIBADD = \
libflux-internal.la
#-lrt is for clock_gettime, this should be abstracted

libflux_core_la_LDFLAGS = -Wl,--version-script=$(srcdir)/version.map \
-shared -export-dynamic --disable-static \
-Wl,--no-undefined

EXTRA_DIST = version.map
File renamed without changes.
11 changes: 0 additions & 11 deletions src/common/libmrpc/Makefile.am

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SUBDIRS = libcore libpmi
SUBDIRS = libpmi
2 changes: 0 additions & 2 deletions src/lib/libcore/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions src/lib/libcore/Makefile.am

This file was deleted.

5 changes: 3 additions & 2 deletions src/lib/libpmi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ libpmi_la_SOURCES = \
pmi.c

libpmi_la_LIBADD = \
$(top_builddir)/src/lib/libcore/libflux-core.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libev/libev.la
$(top_builddir)/src/common/libev/libev.la \
$(top_builddir)/src/common/libflux-core.la \
$(top_builddir)/src/modules/kvs/libkvs.la

libpmi_la_LDFLAGS = -Wl,--version-script=$(srcdir)/version.map

Expand Down
3 changes: 2 additions & 1 deletion src/modules/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
SUBDIRS = api kvs modctl live mecho barrier wreck
#This order is *important*
SUBDIRS = api kvs libmrpc modctl live mecho barrier wreck
9 changes: 3 additions & 6 deletions src/modules/api/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ AM_CPPFLAGS = \
fluxmod_LTLIBRARIES = api.la

fluxmod_libadd = \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libev/libev.la \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ)

fluxmod_ldflags = -avoid-version -module -shared -export-dynamic \
-export-symbols-regex '^mod_(main|name)$$'
fluxmod_ldflags = --disable-static -avoid-version -module -shared -export-dynamic \
-export-symbols-regex '^mod_(main|name)$$' \
$(top_builddir)/src/common/libflux-core.la

api_la_SOURCES = api.c
api_la_LDFLAGS = $(fluxmod_ldflags)
Expand Down
16 changes: 9 additions & 7 deletions src/modules/barrier/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ AM_CPPFLAGS = \
fluxmod_LTLIBRARIES = barrier.la

fluxmod_libadd = \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libev/libev.la \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ)

fluxmod_ldflags = -avoid-version -module -shared -export-dynamic \
-export-symbols-regex '^mod_(main|name)$$'
general_ldflags = --disable-static -avoid-version -shared -export-dynamic \
$(top_builddir)/src/common/libflux-internal.la \
$(top_builddir)/src/common/libflux-core.la

fluxmod_ldflags = -module -Wl,--no-undefined \
-export-symbols-regex '^mod_(main|name)$$' \
$(general_ldflags)

barrier_la_SOURCES = barrier.c
barrier_la_LDFLAGS = $(fluxmod_ldflags)
Expand All @@ -27,5 +28,6 @@ barrier_la_LIBADD = $(fluxmod_libadd)
# API for module
#
fluxcoreinclude_HEADERS = barrier.h
noinst_LTLIBRARIES = libbarrier.la
fluxlib_LTLIBRARIES = libbarrier.la
libbarrier_la_SOURCES = libbarrier.c
libbarrier_la_LDFLAGS = $(general_ldflags)
16 changes: 7 additions & 9 deletions src/modules/kvs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ AM_CPPFLAGS = \
fluxmod_LTLIBRARIES = kvs.la

fluxmod_libadd = \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libev/libev.la \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ)

fluxmod_ldflags = -avoid-version -module -shared -export-dynamic \
Expand All @@ -32,12 +28,17 @@ kvs_la_LIBADD = $(fluxmod_libadd)
#
# API for module
#
noinst_LTLIBRARIES = libkvs.la
fluxlib_LTLIBRARIES = libkvs.la
fluxcoreinclude_HEADERS = kvs.h
libkvs_la_SOURCES = \
libkvs.c \
conf.c \
proto.c
libkvs_la_LDFLAGS = -shared -export-dynamic --disable-static \
$(top_builddir)/src/common/libflux-internal.la \
$(top_builddir)/src/common/libflux-core.la

#-lrt is for clock_gettime, this should be abstracted

TESTS = \
test_waitqueue.t \
Expand All @@ -46,10 +47,7 @@ TESTS = \
test_ldadd = \
$(top_builddir)/src/modules/kvs/waitqueue.o \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/libtap/libtap.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libtap/libtap.la \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBPTHREAD)

test_cppflags = \
Expand Down
17 changes: 17 additions & 0 deletions src/modules/libmrpc/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
AM_CFLAGS = @GCCWARN@

AM_CPPFLAGS = \
$(JSON_CFLAGS) \
-I$(top_srcdir) -I$(top_srcdir)/src/include

fluxlib_LTLIBRARIES = libmrpc.la

libmrpc_la_SOURCES = \
mrpc.c \
mrpc.h
libmrpc_la_LDFLAGS = -shared -export-dynamic \
$(top_builddir)/src/common/libflux-internal.la \
$(top_builddir)/src/common/libflux-core.la \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(LIBMUNGE) $(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBPTHREAD) $(LIBUTIL) \
$(LIBDL) -lrt
File renamed without changes.
File renamed without changes.
19 changes: 11 additions & 8 deletions src/modules/live/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ AM_CPPFLAGS = \
fluxmod_LTLIBRARIES = live.la

fluxmod_libadd = \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libev/libev.la \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ)

fluxmod_ldflags = -avoid-version -module -shared -export-dynamic \
-export-symbols-regex '^mod_(main|name)$$'
general_ldflags = --disable-static -avoid-version -shared -export-dynamic \
$(top_builddir)/src/common/libflux-internal.la \
$(top_builddir)/src/common/libflux-core.la \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(LIBMUNGE) $(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBPTHREAD) $(LIBUTIL) \
$(LIBDL) -lrt
fluxmod_ldflags = -module \
-export-symbols-regex '^mod_(main|name)$$' \
$(general_ldflags)

live_la_SOURCES = live.c
live_la_LDFLAGS = $(fluxmod_ldflags)
Expand All @@ -28,5 +30,6 @@ live_la_LIBADD = $(fluxmod_libadd)
# API for module
#
fluxcoreinclude_HEADERS = live.h
noinst_LTLIBRARIES = liblive.la
fluxlib_LTLIBRARIES = liblive.la
liblive_la_SOURCES = liblive.c
liblive_la_LDFLAGS = $(general_ldflags)
Loading

0 comments on commit acd42ce

Please sign in to comment.