summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-03-26 15:23:54 -0700
committerDan Nicholson <dbn.lists@gmail.com>2010-05-27 06:07:59 -0700
commitc3a3bec97c1e85e333c4d6f958ee50d09e6a9429 (patch)
tree6950966f2356c46164688c9065ec8b589f7b5103 /src
parente7d90b04e507f4f1b1a2b6fc81e02a7b208d0090 (diff)
tet: Build TET API library as private shared module
Making libapi shared saves quite a bit of space since it's linked into every test program. However, parts of the API are intended to be linked statically into the program, so libapi and libtcm have been split into static and shared (_s) portions. In order to satisy undefined extern variables with shared libraries, tet_pname and tet_thistest have been added to tcc and exported. Hopefully, more code can be moved into the shared _s portion with just small stubs linked statically into the tests. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/tet3/apilib/Makefile.am14
-rw-r--r--src/tet3/tcc/tcc.c5
-rw-r--r--src/tet3/tcclib/Makefile.am2
-rw-r--r--src/tet3/tcm/Makefile.am18
4 files changed, 29 insertions, 10 deletions
diff --git a/src/tet3/apilib/Makefile.am b/src/tet3/apilib/Makefile.am
index 8bb5fbfd..bf5179e4 100644
--- a/src/tet3/apilib/Makefile.am
+++ b/src/tet3/apilib/Makefile.am
@@ -1,9 +1,15 @@
AM_CPPFLAGS = -I../inc -I$(top_srcdir)/include
+
+# libapi_s is the shared portion of the library
+xtslibdir = $(libexecdir)/xts5
+xtslib_LTLIBRARIES = libapi_s.la
noinst_LTLIBRARIES = libapi.la
+
# If we weren't building TeT lite, this could also add inetlib, servlib
# and xtilib
-libapi_la_LIBADD = ../tcm/libtcm.la ../dtet2lib/libdtet2.la
-libapi_la_SOURCES = \
+libapi_s_la_LIBADD = ../tcm/libtcm_s.la ../dtet2lib/libdtet2.la
+libapi_s_la_LDFLAGS = -avoid-version
+libapi_s_la_SOURCES = \
dcancel.c \
dconfig.c \
dresfile.c \
@@ -19,8 +25,10 @@ libapi_la_SOURCES = \
remwait.c \
rtab.c \
sync.c \
- tciface.c \
tdiscon.c \
tet_exec.c \
tet_fork.c \
tet_spawn.c
+libapi_la_LIBADD = ../tcm/libtcm.la
+libapi_la_SOURCES = \
+ tciface.c
diff --git a/src/tet3/tcc/tcc.c b/src/tet3/tcc/tcc.c
index bd9364bb..bdd05986 100644
--- a/src/tet3/tcc/tcc.c
+++ b/src/tet3/tcc/tcc.c
@@ -71,6 +71,7 @@ MODIFICATIONS:
#include <errno.h>
#include <signal.h>
# include <unistd.h>
+#include "tet_api.h"
#include "dtmac.h"
#include "dtmsg.h"
#include "error.h"
@@ -90,6 +91,10 @@ char tcc_options[] = "IT:Va:bcef:g:i:j:l:m:n:pr:s:t:v:x:y:";
static void badusage PROTOLIST((void));
static void prversioninfo PROTOLIST((void));
+/* satisfy libapi symbol resolution */
+TET_EXPORT char *tet_pname;
+TET_EXPORT int tet_thistest;
+
/* default root directories */
#ifndef DEFAULT_TET_ROOT
#define DEFAULT_TET_ROOT "/usr/local/share"
diff --git a/src/tet3/tcclib/Makefile.am b/src/tet3/tcclib/Makefile.am
index b4c923e2..e256b99d 100644
--- a/src/tet3/tcclib/Makefile.am
+++ b/src/tet3/tcclib/Makefile.am
@@ -1,6 +1,6 @@
AM_CPPFLAGS = -I../inc -I$(top_srcdir)/include
noinst_LTLIBRARIES = libtcc.la
-libtcc_la_LIBADD = ../apilib/libapi.la
+libtcc_la_LIBADD = ../apilib/libapi.la ../apilib/libapi_s.la
libtcc_la_SOURCES = \
lockfile.c \
lsdir.c \
diff --git a/src/tet3/tcm/Makefile.am b/src/tet3/tcm/Makefile.am
index 55cd0ab3..e68f1560 100644
--- a/src/tet3/tcm/Makefile.am
+++ b/src/tet3/tcm/Makefile.am
@@ -1,10 +1,16 @@
AM_CPPFLAGS = -I../inc -I$(top_srcdir)/include
-noinst_LTLIBRARIES = libtcm.la libtcmmain.la libtcmchild.la
-libtcm_la_SOURCES = child.c \
- ckversion.c \
- dynlink.c \
- ictp.c \
- tcmfuncs.c
+
+# libtcm_s is the shared part of the library pulled into libapi_s.
+# libtcmmain and libtcmchild basically provide main() for tests or their
+# children.
+noinst_LTLIBRARIES = libtcm_s.la libtcm.la libtcmmain.la libtcmchild.la
+libtcm_s_la_SOURCES = \
+ ictp.c
+libtcm_la_SOURCES = \
+ child.c \
+ ckversion.c \
+ dynlink.c \
+ tcmfuncs.c
# When linking to either of these libraries, remember to link libapi.la
# after them