libtr_di: new library
authorSam Hartman <hartmans@debian.org>
Wed, 20 Mar 2013 16:55:14 +0000 (12:55 -0400)
committerSam Hartman <hartmans@debian.org>
Wed, 20 Mar 2013 16:55:14 +0000 (12:55 -0400)
Default visibility to hidden for components
Set up TR_EXPORT as an API marker
Add build glue

Makefile.am
gsscon/Makefile.am
include/tid.h
include/tr_versioning.h [new file with mode: 0644]

index 746eaf1..218ddf0 100644 (file)
@@ -1,33 +1,31 @@
 bin_PROGRAMS= tr/tr tid/example/tidc tid/example/tids common/dh_test/dh_test
 AM_CPPFLAGS=-I$(srcdir)/include
 SUBDIRS = gsscon 
+common_srcs = common/tr_name.c \
+common/tr_msg.c \
+common/tr_dh.c
+
+lib_LTLIBRARIES = libtr_tid.la
 
 tr_tr_SOURCES = tr/tr_main.c \
-tid/tidc.c \
-tid/tids.c \
-common/tr_name.c \
-common/tr_msg.c \
-common/tr_dh.c \
 common/tr_config.c 
 
-tr_tr_LDADD = gsscon/libgsscon.la
+tr_tr_LDADD = gsscon/libgsscon.la libtr_tid.la
 
-tid_example_tidc_SOURCES = tid/example/tidc_main.c \
-tid/tidc.c \
-common/tr_name.c \
-common/tr_msg.c \
-common/tr_dh.c
+tid_example_tidc_SOURCES = tid/example/tidc_main.c 
 
-tid_example_tidc_LDADD = gsscon/libgsscon.la
+tid_example_tidc_LDADD = gsscon/libgsscon.la libtr_tid.la
 
-tid_example_tids_SOURCES = tid/example/tids_main.c \
-tid/tids.c \
-common/tr_name.c \
-common/tr_msg.c \
-common/tr_dh.c
+tid_example_tids_SOURCES = tid/example/tids_main.c 
 
-tid_example_tids_LDADD = gsscon/libgsscon.la
+tid_example_tids_LDADD = gsscon/libgsscon.la libtr_tid.la
 
 common_dh_test_dh_test_SOURCES = common/tr_dh.c \
 common/dh_test/dh_test.c
 
+libtr_tid_la_SOURCES = tid/tids.c tid/tidc.c \
+$(common_srcs)
+
+libtr_tid_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
+libtr_tid_la_LIBADD = gsscon/libgsscon.la
+libtr_tid_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0 -no-undefined
index f39b06e..0ffcb25 100644 (file)
@@ -1,4 +1,5 @@
 AM_CPPFLAGS=-I$(top_srcdir)/include
+AM_CFLAGS = -fvisibility=hidden
 
 noinst_LTLIBRARIES = libgsscon.la
 noinst_PROGRAMS=test/gsscon_client test/gsscon_server
index 69aa32a..8e923e9 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <gsscon.h>
 #include <tr_name.h>
+#include <tr_versioning.h>
 
 #define TID_PORT       12309
 
@@ -89,13 +90,13 @@ typedef struct tids_instance {
 typedef void (TIDC_RESP_FUNC)(TIDC_INSTANCE *, TID_RESP *, void *);
 typedef int (TIDS_REQ_FUNC)(TIDS_INSTANCE *, TID_REQ *, TID_RESP *, void *);
 
-TIDC_INSTANCE *tidc_create (void);
-int tidc_open_connection (TIDC_INSTANCE *tidc, char *server, gss_ctx_id_t *gssctx);
-int tidc_send_request (TIDC_INSTANCE *tidc, int conn, gss_ctx_id_t gssctx, char *rp_realm, char *realm, char *coi, TIDC_RESP_FUNC *resp_handler, void *cookie);
-void tidc_destroy (TIDC_INSTANCE *tidc);
+TR_EXPORT TIDC_INSTANCE *tidc_create (void);
+TR_EXPORT int tidc_open_connection (TIDC_INSTANCE *tidc, char *server, gss_ctx_id_t *gssctx);
+TR_EXPORT int tidc_send_request (TIDC_INSTANCE *tidc, int conn, gss_ctx_id_t gssctx, char *rp_realm, char *realm, char *coi, TIDC_RESP_FUNC *resp_handler, void *cookie);
+TR_EXPORT void tidc_destroy (TIDC_INSTANCE *tidc);
 
-TIDS_INSTANCE *tids_create ();
-int tids_start (TIDS_INSTANCE *tids, TIDS_REQ_FUNC *req_handler, void *cookie);
-void tids_destroy (TIDS_INSTANCE *tids);
+TR_EXPORT TIDS_INSTANCE *tids_create ();
+TR_EXPORT int tids_start (TIDS_INSTANCE *tids, TIDS_REQ_FUNC *req_handler, void *cookie);
+TR_EXPORT void tids_destroy (TIDS_INSTANCE *tids);
 
 #endif
diff --git a/include/tr_versioning.h b/include/tr_versioning.h
new file mode 100644 (file)
index 0000000..7c3bfd5
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2012, JANET(UK)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of JANET(UK) nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef TR_VERSIONING_H
+#define TR_VERSIONING_H
+
+#define TR_EXPORT __attribute__((visibility("default")))
+
+#endif /*TR_VERSIONING_h*/