ubik: Use libtool
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 23 Aug 2012 20:35:35 +0000 (21:35 +0100)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 11 Sep 2012 21:41:37 +0000 (14:41 -0700)
Use libtool to build LWP and pthreaded versions of the ubik library.
Both versions are built in the src/ubik directory. src/tubik is modified
to only build pthreaded versions of the ubik test commands.

Replace use of libubik_pthread.a with the libtool generated library.

Change-Id: Id441fe00dbe801e38a108600bfbe06c292383872
Reviewed-on: http://gerrit.openafs.org/8090
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/tbudb/Makefile.in
src/tptserver/Makefile.in
src/tubik/Makefile.in
src/tvlserver/Makefile.in
src/tvolser/Makefile.in
src/ubik/Makefile.in
src/ubik/liboafs_ubik.la.sym [new file with mode: 0644]

index 09f1118..24f7861 100644 (file)
@@ -33,7 +33,7 @@ INCLS=\
 # library ordering defined by top level makefile
 LIBS= \
        ${TOP_LIBDIR}/libbubasics.a \
-       ${TOP_LIBDIR}/libubik_pthread.a \
+       $(top_builddir)/src/ubik/liboafs_ubik.la \
        ${TOP_LIBDIR}/libafsauthent.a \
        $(top_builddir)/src/sys/liboafs_sys.la \
        $(top_builddir)/src/rxkad/liboafs_rxkad.la \
index 9f67edc..450a93e 100644 (file)
@@ -28,7 +28,7 @@ INCLS=${TOP_INCDIR}/ubik.h \
        pterror.h
 
 LIBS_common= \
-       ${TOP_LIBDIR}/libubik_pthread.a \
+       $(top_builddir)/src/ubik/liboafs_ubik.la \
        ${TOP_LIBDIR}/libafsauthent.a \
        $(top_builddir)/src/sys/liboafs_sys.la \
        $(top_builddir)/src/rx/liboafs_rx.la \
index b9641ce..4a8caf1 100644 (file)
@@ -14,72 +14,20 @@ ENABLE_PTHREADED_UBIK=@ENABLE_PTHREADED_UBIK@
 
 UBIK=$(srcdir)/../ubik
 
-LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
-       ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
-       ubikclient.o uerrors.o uinit.o
-
 INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
        ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
        ${TOP_INCDIR}/lock.h ubik.h ubik_int.h utst_int.h
 
+LTLIBS=@TOP_OBJDIR@/src/util/liboafs_util.la \
+       @TOP_OBJDIR@/src/ubik/liboafs_ubik.la \
+       @TOP_OBJDIR@/src/cmd/liboafs_cmd.la
 
-LIBS=${TOP_LIBDIR}/libafsauthent.a \
-     $(top_builddir)/src/lwp/liboafs_lwpcompat.la \
-     $(top_builddir)/src/comerr/liboafs_comerr.la \
-     ${top_builddir}/src/cmd/liboafs_cmd.la \
-     $(top_builddir)/src/sys/liboafs_sys.la \
-     $(top_builddir)/src/util/liboafs_util.la \
-     $(top_builddir)/src/opr/liboafs_opr.la \
-     ${XLIBS} ${MT_LIBS}
-
-all: depinstall ${TOP_LIBDIR}/libubik_pthread.a udebug utst_server utst_client
-
-depinstall: \
-       ubik_int.cs.c ubik_int.xdr.c \
-       ${TOP_INCDIR}/ubik.h \
-       ${TOP_INCDIR}/ubik_int.h
+all: udebug utst_server utst_client
 
 #
 # insert comments here
 #
 
-utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o libubik_pthread.a
-       $(LT_LDRULE_static) utst_server.o utst_int.ss.o utst_int.xdr.o \
-               libubik_pthread.a $(LIBS) $(LIB_hcrypto) $(LIB_roken)
-
-utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik_pthread.a
-       $(LT_LDRULE_static) utst_client.o utst_int.cs.o utst_int.xdr.o \
-               libubik_pthread.a $(LIBS) $(LIB_hcrypto) $(LIB_roken)
-
-udebug: udebug.o libubik_pthread.a
-       $(LT_LDRULE_static) udebug.o libubik_pthread.a \
-               $(LIBS) $(LIB_hcrypto) $(LIB_roken)
-
-ubik_int.cs.c: ${UBIK}/ubik_int.xg
-       ${RXGEN} -A -x -C -o $@ ${UBIK}/ubik_int.xg
-
-ubik_int.ss.c: ${UBIK}/ubik_int.xg
-       ${RXGEN} -A -x -S -o $@ ${UBIK}/ubik_int.xg
-
-ubik_int.xdr.c: ${UBIK}/ubik_int.xg
-       ${RXGEN} -A -x -c -o $@ ${UBIK}/ubik_int.xg
-
-ubik_int.h: ${UBIK}/ubik_int.xg
-       ${RXGEN} -A -x -h -o $@ ${UBIK}/ubik_int.xg
-
-ubik_int.cs.c: ubik_int.h
-ubik_int.ss.c: ubik_int.h
-ubik_int.xdr.c: ubik_int.h
-
-Kubik_int.cs.c: ${UBIK}/ubik_int.xg Kubik_int.h
-       ${RXGEN} -A -x -k -C -o Kubik_int.cs.c ${UBIK}/ubik_int.xg
-Kubik_int.xdr.c: ${UBIK}/ubik_int.xg
-       ${RXGEN} -A -x -k -c -o Kubik_int.xdr.c ${UBIK}/ubik_int.xg
-Kubik_int.h: ${UBIK}/ubik_int.xg
-       ${RXGEN} -A -x -k -h -o Kubik_int.h ${UBIK}/ubik_int.xg
-
 utst_int.ss.o: utst_int.ss.c
 utst_int.cs.o: utst_int.cs.c
 utst_int.xdr.o: utst_int.xdr.c
@@ -106,80 +54,39 @@ utst_server.o: ${UBIK}/utst_server.c
 utst_client.o: ${UBIK}/utst_client.c
        ${AFS_CCRULE} ${UBIK}/utst_client.c
 
-udebug.o: ${UBIK}/udebug.c
-       ${AFS_CCRULE} ${UBIK}/udebug.c
-
-uerrors.c ubik.h: ${UBIK}/uerrors.et ${UBIK}/ubik.p.h
-       $(RM) -f ubik.h uerrors.c
-       ${COMPILE_ET} -p ${UBIK} uerrors -h ubik
-
-libubik_pthread.a: ${INCLS} ${LIBOBJS} AFS_component_version_number.o
-       -$(RM) -f $@
-       $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
-       $(RANLIB) $@
-
-disk.o: ${UBIK}/disk.c
-       $(AFS_CCRULE) $(UBIK)/disk.c
-
-uinit.o: ${UBIK}/uinit.c
-       $(AFS_CCRULE) $(UBIK)/uinit.c
-
-remote.o: ${UBIK}/remote.c
-       $(AFS_CCRULE) $(UBIK)/remote.c
-
-beacon.o: ${UBIK}/beacon.c
-       $(AFS_CCRULE) $(UBIK)/beacon.c
-
-lock.o: ${UBIK}/lock.c
-       $(AFS_CCRULE) $(UBIK)/lock.c
-
-recovery.o: ${UBIK}/recovery.c
-       $(AFS_CCRULE) $(UBIK)/recovery.c
-
-ubik.o: ${UBIK}/ubik.c
-       $(AFS_CCRULE) $(UBIK)/ubik.c
-
-phys.o: ${UBIK}/phys.c
-       $(AFS_CCRULE) $(UBIK)/phys.c
+utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o $(LTLIBS)
+       $(LT_LDRULE_static) utst_server.o utst_int.ss.o utst_int.xdr.o \
+               $(LTLIBS) $(LIBS) $(LIB_hcrypto) $(LIB_roken)
 
-vote.o: ${UBIK}/vote.c
-       $(AFS_CCRULE) $(UBIK)/vote.c
+utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o $(LTLIBS)
+       $(LT_LDRULE_static) utst_client.o utst_int.cs.o utst_int.xdr.o \
+               $(LTLIBS) $(LIBS) $(LIB_hcrypto) $(LIB_roken)
 
-ubikcmd.o: ${UBIK}/ubikcmd.c
-       $(AFS_CCRULE) $(UBIK)/ubikcmd.c
+udebug.o: ${UBIK}/udebug.c
+       ${AFS_CCRULE} ${UBIK}/udebug.c
 
-ubikclient.o: ${UBIK}/ubikclient.c
-       $(AFS_CCRULE) $(UBIK)/ubikclient.c
-ubik_int.xdr.o: ubik_int.xdr.c
+udebug: udebug.o $(LTLIBS)
+       $(LT_LDRULE_static) udebug.o \
+               $(LTLIBS) $(LIBS) $(LIB_hcrypto) $(LIB_roken)
 
 #
 # Installation targets
 #
 test: all
 
-install: libubik_pthread.a ubik.h ubik_int.h udebug
-       ${INSTALL} -d ${DESTDIR}${libdir}
-       ${INSTALL} -d ${DESTDIR}${includedir}
+install: udebug
        ${INSTALL} -d ${DESTDIR}${bindir}
        ${INSTALL} -d ${DESTDIR}${afssrvbindir}
-       ${INSTALL_DATA} libubik_pthread.a ${DESTDIR}${libdir}/libubik_pthread.a
        if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then                 \
            $(LT_INSTALL_PROGRAM) udebug ${DESTDIR}${bindir}/udebug;          \
            $(LT_INSTALL_PROGRAM) udebug ${DESTDIR}${afssrvbindir}/udebug;    \
-           ${INSTALL_DATA} ubik.h ${DESTDIR}${includedir}/ubik.h;         \
-           ${INSTALL_DATA} ubik_int.h ${DESTDIR}${includedir}/ubik_int.h; \
        fi
 
-dest: libubik_pthread.a ubik.h ubik_int.h udebug
-       ${INSTALL} -d ${DEST}/lib
-       ${INSTALL} -d ${DEST}/include
+dest: udebug
        ${INSTALL} -d ${DEST}/root.server/usr/afs/bin
-       ${INSTALL_DATA} libubik_pthread.a ${DEST}/lib/libubik_pthread.a
        if [ "x$(ENABLE_PTHREADED_UBIK)" = "xyes" ] ; then                    \
            ${INSTALL_PROGRAM} udebug ${DEST}/bin/udebug;                     \
            ${INSTALL_PROGRAM} udebug ${DEST}/root.server/usr/afs/bin/udebug; \
-           ${INSTALL_DATA} ubik.h ${DEST}/include/ubik.h;                    \
-           ${INSTALL_DATA} ubik_int.h ${DEST}/include/ubik_int.h;            \
        fi
 #
 # Misc. targets
@@ -187,17 +94,6 @@ dest: libubik_pthread.a ubik.h ubik_int.h udebug
 clean:
        $(LT_CLEAN)
        $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
-       $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
+       $(RM) -f utst_int.h core AFS_component_version_number.c
 
 include ../config/Makefile.version
-
-${TOP_LIBDIR}/libubik_pthread.a: libubik_pthread.a
-       ${INSTALL} $? $@
-
-${TOP_INCDIR}/ubik.h: ubik.h
-       ${INSTALL} $? $@
-
-${TOP_INCDIR}/ubik_int.h: ubik_int.h
-       ${INSTALL} $? $@
-
-
index 409e0c7..e460cd7 100644 (file)
@@ -24,7 +24,7 @@ INCLS=${TOP_INCDIR}/ubik.h \
        vlserver.h vldbint.h
 
 LIBS_common = \
-       ${TOP_LIBDIR}/libubik_pthread.a \
+       $(top_builddir)/src/ubik/liboafs_ubik.la \
        ${TOP_LIBDIR}/libafsauthent.a \
        $(top_builddir)/src/sys/liboafs_sys.la \
        $(top_builddir)/src/rx/liboafs_rx.la \
index 8e2c4b4..e7d594e 100644 (file)
@@ -53,7 +53,7 @@ LIBS_common = \
        $(top_builddir)/src/opr/liboafs_opr.la
 
 LIBS_client = \
-       $(TOP_LIBDIR)/libubik_pthread.a \
+       $(top_builddir)/src/ubik/liboafs_ubik.la \
        $(LIBS_common)
 
 LIBS_server = \
index 00bd23d..3cdf456 100644 (file)
@@ -7,12 +7,20 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.libtool
 include @TOP_OBJDIR@/src/config/Makefile.lwp
 
+LT_objs =   disk.lo remote.lo beacon.lo recovery.lo ubik.lo vote.lo lock.lo \
+           phys.lo ubik_int.cs.lo ubik_int.ss.lo ubik_int.xdr.lo ubikcmd.lo \
+           ubikclient.lo uerrors.lo uinit.lo \
+           AFS_component_version_number.lo
 
-LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
-       ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
-       ubikclient.o uerrors.o uinit.o
+LT_deps =   $(top_builddir)/src/auth/liboafs_auth.la \
+           $(top_builddir)/src/opr/liboafs_opr.la \
+           $(top_builddir)/src/comerr/liboafs_comerr.la \
+           $(top_builddir)/src/lwp/liboafs_lwpcompat.la \
+           $(top_builddir)/src/rx/liboafs_rx.la \
+           $(top_builddir)/src/util/liboafs_util.la
 
 INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
        ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
@@ -20,10 +28,12 @@ INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
 
 LIBS=${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libauth.a \
        ${TOP_LIBDIR}/libafscom_err.a ${TOP_LIBDIR}/libcmd.a \
-       ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libafsutil.a \
-       ${TOP_LIBDIR}/libopr.a ${XLIBS}
+       ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libauth.a \
+       ${TOP_LIBDIR}/libafsutil.a ${TOP_LIBDIR}/libopr.a \
+       ${XLIBS}
 
-all: depinstall ${TOP_LIBDIR}/libubik.a udebug utst_server utst_client
+all: depinstall ${TOP_LIBDIR}/libubik.a udebug utst_server utst_client \
+     liboafs_ubik.la
 
 generated: \
        utst_int.cs.c utst_int.ss.c utst_int.xdr.c utst_int.h \
@@ -113,29 +123,18 @@ uerrors.c: uerrors.et ubik.p.h
        $(RM) -f ubik.h uerrors.c
        ${COMPILE_ET} -p ${srcdir} uerrors -h ubik
 
-libubik.a: ${LIBOBJS} AFS_component_version_number.o
-       -$(RM) -f $@
-       $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
-       $(RANLIB) $@
-
-disk.o: disk.c ${INCLS}
-uinit.o: uinit.c ${INCLS}
-remote.o: remote.c ${INCLS}
-beacon.o: beacon.c ${INCLS}
-lock.o: lock.c ${INCLS}
-recovery.o: recovery.c ${INCLS}
-ubik.o: ubik.c ${INCLS}
-phys.o: phys.c ${INCLS}
-vote.o: vote.c ${INCLS}
-ubikcmd.o: ubikcmd.c ${INCLS}
-ubikclient.o: ubikclient.c ${INCLS}
-ubik_int.ss.o: ubik_int.ss.c ${INCLS}
-ubik_int.cs.o: ubik_int.cs.c ${INCLS}
-ubik_int.xdr.o: ubik_int.xdr.c ${INCLS}
+libubik.a: ${LT_objs}
+       $(LT_LDLIB_lwp) $(LT_objs)
+
+$(LT_objs): $(INCLS)
+
 utst_int.ss.o: utst_int.ss.c ${INCLS} utst_int.h
 utst_int.cs.o: utst_int.cs.c ${INCLS} utst_int.h
 utst_int.xdr.o: utst_int.xdr.c ${INCLS} utst_int.h 
 
+liboafs_ubik.la: liboafs_ubik.la.sym $(LT_objs) $(LT_deps)
+       $(LT_LDLIB_shlib) $(LT_objs) $(LT_deps) $(LT_libs)
+
 #
 # Installation targets
 #
@@ -147,6 +146,7 @@ install: libubik.a ubik.h ubik_int.h udebug
        ${INSTALL} -d ${DESTDIR}${bindir}
        ${INSTALL} -d ${DESTDIR}${afssrvbindir}
        ${INSTALL_DATA} libubik.a ${DESTDIR}${libdir}/libubik.a
+       $(LT_INSTALL_DATA) liboafs_ubik.la $(DESTDIR)$(libdir)/liboafs_ubik.la
        ${INSTALL_DATA} ubik.h ${DESTDIR}${includedir}/ubik.h
        ${INSTALL_DATA} ubik_int.h ${DESTDIR}${includedir}/ubik_int.h
        ${INSTALL_PROGRAM} udebug ${DESTDIR}${bindir}/udebug
@@ -166,6 +166,7 @@ dest: libubik.a ubik.h ubik_int.h udebug
 # Misc. targets
 #
 clean:
+       $(LT_CLEAN)
        $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
        $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
 
diff --git a/src/ubik/liboafs_ubik.la.sym b/src/ubik/liboafs_ubik.la.sym
new file mode 100644 (file)
index 0000000..499aa62
--- /dev/null
@@ -0,0 +1,35 @@
+VOTE_Debug
+VOTE_DebugOld
+VOTE_GetSyncSite
+VOTE_SDebug
+VOTE_SDebugOld
+VOTE_XDebug
+VOTE_XSDebug
+initialize_U_error_table
+ubik_AbortTrans
+ubik_BeginTrans
+ubik_BeginTransReadAny
+ubik_BeginTransReadAnyWrite
+ubik_CallIter
+ubik_CheckCache
+ubik_ClientDestroy
+ubik_ClientInit
+ubik_EndTrans
+ubik_ParseClientList
+ubik_ParseServerList
+ubik_Read
+ubik_RefreshConn
+ubik_Seek
+ubik_ServerInit
+ubik_ServerInitByInfo
+ubik_SetClientSecurityProcs
+ubik_SetLock
+ubik_SetServerSecurityProcs
+ubik_SyncWriterCacheProc
+ubik_Truncate
+ubik_Write
+ubik_dbase
+ubik_nBuffers
+ugen_ClientInit
+ugen_ClientInitFlags
+ugen_ClientInitServer