rx: Build libtool library
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 24 May 2012 10:08:48 +0000 (11:08 +0100)
committerDerrick Brashear <shadow@your-file-system.com>
Sun, 9 Sep 2012 03:28:32 +0000 (20:28 -0700)
Build a pthreaded, libtool, version of librx.a called liboafs_rx.la.
librx.a remains for LWP applications to use. With this change, all RX
objects are built in both the LWP and pthread cases, so some #ifdef
guards are required to protect code that isn't relevant in a given
build.

Currently, all of our pthreaded objects use libafsrpc to get RX
functionality, so this change is fairly minimal outside of the RX
directory.

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

src/rx/Makefile.in
src/rx/liboafs_rx.la.sym [new file with mode: 0644]
src/rx/rx_clock.c
src/rx/rx_lwp.c
src/rx/rx_pthread.c
tests/rx/Makefile.in

index 63108ed..630f402 100644 (file)
@@ -7,78 +7,46 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+include @TOP_OBJDIR@/src/config/Makefile.libtool
 include @TOP_OBJDIR@/src/config/Makefile.lwp
 
-
 MODULE_CFLAGS=$(RXDEBUG)
 
-#
-# Generic xdr objects (or, at least, xdr stuff that's not newly defined for rx).
-# Really the xdr stuff should be in its own directory.
-#
-XDROBJS_common = xdr.o xdr_array.o xdr_rx.o xdr_mem.o xdr_len.o xdr_afsuuid.o
-
-XDROBJS = xdr_arrayn.o ${XDROBJS_common}
-
-RXOBJS_common = rx_clock.o rx_call.o rx_conn.o rx_event.o rx_user.o rx_lwp.o \
-               rx.o rx_null.o rx_globals.o rx_getaddr.o rx_misc.o rx_packet.o \
-               rx_peer.o rx_rdwr.o rx_trace.o rx_conncache.o rx_opaque.o \
-               rx_identity.o rx_stats.o \
-               xdr_int32.o xdr_int64.o xdr_update.o xdr_refernce.o
-
-RXOBJS = ${RXOBJS_common} 
-
-MULTIOBJS = rx_multi.o
-
-LIBOBJS = ${RXOBJS} ${MULTIOBJS} ${XDROBJS}
-
-BASICINCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
-            rx_clock.h rx_queue.h rx_event.h
-
-LIBS=librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libcmd.a \
-              ${TOP_LIBDIR}/util.a
+LT_objs = xdr.lo xdr_array.lo xdr_rx.lo xdr_mem.lo xdr_len.lo xdr_afsuuid.lo \
+         xdr_int32.lo xdr_int64.lo xdr_update.lo xdr_refernce.lo \
+         rx_clock.lo rx_call.lo rx_conn.lo rx_event.lo rx_user.lo rx_lwp.lo \
+         rx_pthread.lo rx.lo rx_null.lo rx_globals.lo rx_getaddr.lo rx_misc.lo \
+         rx_packet.lo rx_peer.lo rx_rdwr.lo rx_trace.lo rx_conncache.lo \
+         rx_opaque.lo rx_identity.lo rx_stats.lo rx_multi.lo \
+         AFS_component_version_number.lo
+LT_deps = $(top_builddir)/src/opr/liboafs_opr.la
+LT_libs = $(MT_LIBS)
 
 all: \
        includes \
-       ${TOP_LIBDIR}/librx.a
+       ${TOP_LIBDIR}/librx.a \
+       liboafs_rx.la
 
 depinstall: includes
 
-RX_component_version_number.c: AFS_component_version_number.c
-       sed 's/cml_version/rx_cml_version/' <AFS_component_version_number.c >RX_component_version_number.c
-
-RX_component_version_number.o: RX_component_version_number.c
-
-${RXOBJS}: ${BASICINCLS} rx.h rx_user.h rx_globals.h rx_prototypes.h
-
-${MULTIOBJS}: rx.h rx_multi.h rx_prototypes.h
-
-${XDROBJS}: xdr.h xdr_prototypes.h
-
-rx_user.o: rx.h rx_user.h rx_prototypes.h
-
-rx_packet.o: rx_packet.c rx_packet.h rx.h
-
-rx_rdwr.o: rx_rdwr.c rx.h rx_prototypes.h
-
-rx.o: rx.h rx_user.h rx_prototypes.h
-
-rx_conncache.o: rx.h rx_prototypes.h
-
-rx_trace.o: rx_trace.h
-
-rx_getaddr.o: rx.h rx_getaddr.c rx_prototypes.h
-
-rx_globals.o: rx.h rx_user.h rx_globals.h rx_prototypes.h
+rx_user.lo: rx.h rx_user.h rx_prototypes.h
+rx_packet.lo: rx_packet.c rx_packet.h rx.h
+rx_rdwr.lo: rx_rdwr.c rx.h rx_prototypes.h
+rx.lo: rx.h rx_user.h rx_prototypes.h
+rx_conncache.lo: rx.h rx_prototypes.h
+rx_trace.lo: rx_trace.h
+rx_getaddr.lo: rx.h rx_getaddr.c rx_prototypes.h
+rx_globals.lo: rx.h rx_user.h rx_globals.h rx_prototypes.h
+xdr_rx.lo: xdr.h rx.h xdr_prototypes.h rx_prototypes.h
+xdr_refernce.lo: xdr_refernce.c xdr.h xdr_prototypes.h
 
-xdr_rx.o: xdr.h rx.h xdr_prototypes.h rx_prototypes.h
+librx.a: $(LT_objs)
+       $(LT_LDLIB_lwp) $(LT_objs)
 
-xdr_refernce.o: xdr_refernce.c xdr.h xdr_prototypes.h
+liboafs_rx.la: liboafs_rx.la.sym $(LT_objs) $(LT_deps)
+       $(LT_LDLIB_shlib) $(LT_objs) $(LT_deps) $(LT_libs)
 
-librx.a: ${LIBOBJS} RX_component_version_number.o
-       -$(RM) -f $@
-       $(AR) crv $@ ${LIBOBJS} RX_component_version_number.o
-       $(RANLIB) $@
+CFLAGS_rx.lo = @CFLAGS_NOERROR@
 
 #
 # Install targets
@@ -210,6 +178,7 @@ dest: librx.a
 # Misc. targets
 #
 clean:
+       $(LT_CLEAN)
        $(RM) -f *.o *.a core *_component_version_number.c
 
 include ../config/Makefile.version
diff --git a/src/rx/liboafs_rx.la.sym b/src/rx/liboafs_rx.la.sym
new file mode 100644 (file)
index 0000000..e5cd4a8
--- /dev/null
@@ -0,0 +1,150 @@
+RX_IPUDP_SIZE
+afs_xdr_alloc
+afs_xdr_array
+afs_xdr_bytes
+afs_xdr_char
+afs_xdr_enum
+afs_xdr_free
+afs_xdr_int
+afs_xdr_opaque
+afs_xdr_pointer
+afs_xdr_short
+afs_xdr_string
+afs_xdr_u_char
+afs_xdr_u_short
+afs_xdr_vector
+afs_xdrmem_create
+hton_syserr_conv
+multi_Finalize
+multi_Finalize_Ignore
+multi_Init
+multi_Select
+osi_AssertFailU
+osi_Panic
+rx_BusyError
+rx_BusyThreshold
+rx_ConnError
+rx_ConnectionOf
+rx_DestroyConnection
+rx_EndCall
+rx_Error
+rx_Finalize
+rx_FlushWrite
+rx_FreeStatistics
+rx_GetCachedConnection
+rx_GetCallAbortCode
+rx_GetConnection
+rx_GetConnectionEpoch
+rx_GetConnectionId
+rx_GetIFInfo
+rx_GetSecurityData
+rx_GetSecurityHeaderSize
+rx_GetSpecific
+rx_GetStatistics
+rx_GetThreadNum
+rx_HostOf
+rx_IncrementTimeAndCount
+rx_Init
+rx_InitHost
+rx_InterruptCall
+rx_IsServerConn
+rx_IsUsingPktCksum
+rx_KeepAliveOff
+rx_KeepAliveOn
+rx_KeyCreate
+rx_MyMaxSendSize
+rx_NewCall
+rx_NewConnection
+rx_NewService
+rx_NewServiceHost
+rx_PeerOf
+rx_PortOf
+rx_PrintStats
+rx_ReadProc
+rx_RecordCallStatistics
+rx_ReleaseCachedConnection
+rx_RetrievePeerRPCStats
+rx_RetrieveProcessRPCStats
+rx_RxStatUserOk
+rx_SecurityClassOf
+rx_SecurityObjectOf
+rx_ServerProc
+rx_ServiceIdOf
+rx_ServiceOf
+rx_SetCallAbortCode
+rx_SetConnDeadTime
+rx_SetConnHardDeadTime
+rx_SetConnSecondsUntilNatPing
+rx_SetConnectionEpoch
+rx_SetConnectionId
+rx_SetEpoch
+rx_SetLocalStatus
+rx_SetMaxMTU
+rx_SetNoJumbo
+rx_SetRxStatUserOk
+rx_SetSecurityConfiguration
+rx_SetSecurityData
+rx_SetSecurityHeaderSize
+rx_SetSecurityMaxTrailerSize
+rx_SetSpecific
+rx_SetThreadNum
+rx_SlowGetInt32
+rx_SlowPutInt32
+rx_SlowReadPacket
+rx_SlowWritePacket
+rx_StartServer
+rx_UdpBufSize
+rx_WriteProc
+rx_clearPeerRPCStats
+rx_clearProcessRPCStats
+rx_connDeadTime
+rx_debugFile
+rx_disablePeerRPCStats
+rx_disableProcessRPCStats
+rx_enablePeerRPCStats
+rx_enableProcessRPCStats
+rx_enable_hot_thread
+rx_enable_stats
+rx_extraPackets
+rx_extraQuota
+rx_getAllAddr
+rx_getAllAddrMaskMtu
+rx_identity_copy
+rx_identity_free
+rx_identity_freeContents
+rx_identity_match
+rx_identity_new
+rx_identity_populate
+rx_nPackets
+rx_opaque_alloc
+rx_opaque_copy
+rx_opaque_freeContents
+rx_opaque_populate
+rx_queryPeerRPCStats
+rx_queryProcessRPCStats
+rx_socket
+rx_stackSize
+rx_tranquil
+rxevent_debugFile
+rxi_Alloc
+rxi_AllocDataBuf
+rxi_CallError
+rxi_Free
+rxi_GetCallNumberVector
+rxi_RoundUpPacket
+rxi_SetCallNumberVector
+rxi_callAbortThreshhold
+rxi_connAbortThreshhold
+rxi_getaddr
+rxi_syscallp
+rxi_tracename
+rxnull_NewClientSecurityObject
+rxnull_NewServerSecurityObject
+rxs_Release
+xdr_afsUUID
+xdr_afs_int32
+xdr_afs_int64
+xdr_afs_uint32
+xdr_afs_uint64
+xdrlen_create
+xdrrx_create
index 057e1c4..ddf7bd9 100644 (file)
@@ -29,6 +29,8 @@
 # include <roken.h>
 #endif
 
+#ifndef AFS_PTHREAD_ENV
+
 #include "rx.h"
 #include "rx_clock.h"
 
@@ -140,3 +142,4 @@ clock_UpdateTime(void)
 #endif /* KERNEL */
 
 #endif /* AFS_USE_GETTIMEOFDAY */
+#endif /* !AFS_PTHREAD_ENV */
index 0923642..e6ae068 100644 (file)
@@ -27,6 +27,8 @@
 # include <sys/file.h>
 #endif
 
+#ifndef AFS_PTHREAD_ENV
+
 #include <lwp.h>
 
 #include "rx.h"
@@ -482,3 +484,4 @@ rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
        IOMGR_FreeFDSet(sfds);
     return 0;
 }
+#endif
index d76ed6d..a1af2b4 100644 (file)
@@ -23,6 +23,8 @@
 
 #include <assert.h>
 
+#ifdef AFS_PTHREAD_ENV
+
 #include "rx.h"
 #include "rx_globals.h"
 #include "rx_pthread.h"
@@ -464,3 +466,4 @@ rx_SetThreadNum(void) {
     return threadId;
 }
 
+#endif
index f352bcd..f629d1b 100644 (file)
@@ -8,8 +8,7 @@ include @TOP_OBJDIR@/src/config/Makefile.pthread
 MODULE_CFLAGS = -I$(srcdir)/../..
 
 LIBS = ../tap/libtap.a \
-       $(abs_top_builddir)/lib/libafsrpc.a \
-       $(abs_top_builddir)/src/opr/liboafs_opr.la
+       $(abs_top_builddir)/src/rx/liboafs_rx.la
 
 tests = event-t