chiark / gitweb /
Abolish shared libdisorder; now we use a static one.
authorrjk@greenend.org.uk <>
Sun, 15 Jul 2007 15:07:16 +0000 (16:07 +0100)
committerrjk@greenend.org.uk <>
Sun, 15 Jul 2007 15:07:16 +0000 (16:07 +0100)
New server/exports.c ensures that all the right symbols are exported
to plugins.

clients/Makefile.am
debian/rules.m4
disobedience/Makefile.am
lib/Makefile.am
lib/disorder.h
server/Makefile.am
server/exports.c [new file with mode: 0644]

index c2e51a9..358b075 100644 (file)
@@ -24,18 +24,20 @@ noinst_PROGRAMS=test-eclient filename-bytes
 AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
 
 disorder_SOURCES=disorder.c authorize.c authorize.h
-disorder_LDADD=$(LIBOBJS) ../lib/libdisorder.la
-disorder_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.la
+disorder_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
+       $(LIBDL) $(LIBGC) $(LIBGCRYPT) $(LIBPCRE)
+disorder_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.a
 
 disorderfm_SOURCES=disorderfm.c
-disorderfm_LDADD=$(LIBOBJS) ../lib/libdisorder.la
-disorderfm_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.la
+disorderfm_LDADD=$(LIBOBJS) ../lib/libdisorder.a $(LIBGC)
+disorderfm_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.a
 
 filename_bytes_SOURCES=filename-bytes.c
 
 test_eclient_SOURCES=test-eclient.c
-test_eclient_LDADD=../lib/libdisorder.la
-test_eclient_DEPENDENCIES=../lib/libdisorder.la
+test_eclient_LDADD=../lib/libdisorder.a \
+       $(LIBDL) $(LIBGC) $(LIBGCRYPT) $(LIBPCRE)
+test_eclient_DEPENDENCIES=../lib/libdisorder.a
 
 install-exec-hook:
        $(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
index fd4aade..51678c4 100644 (file)
@@ -42,7 +42,6 @@ archpkg([disorder], [ m4_dnl
                debian/disorder/usr/bin/* \
                debian/disorder/usr/lib/cgi-bin/disorder/* \
                debian/disorder/usr/sbin/* \
-               debian/disorder/usr/lib/*.so* \
                debian/disorder/usr/lib/disorder/*.so*
        $(INSTALL) -m 644 debian/htaccess \
                debian/disorder/usr/lib/cgi-bin/disorder/.htaccess
index 35b2962..cfa1f38 100644 (file)
@@ -25,7 +25,7 @@ AM_CFLAGS=$(GLIB_CFLAGS) $(GTK_CFLAGS)
 
 disobedience_SOURCES=disobedience.h disobedience.c client.c queue.c    \
                  choose.c misc.c style.h control.c properties.c menu.c
-disobedience_LDADD=../lib/libdisorder.la
+disobedience_LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBGC) $(LIBGCRYPT)
 disobedience_LDFLAGS=$(GTK_LIBS)
 
 install-exec-hook:
index 145b3af..195d864 100644 (file)
@@ -1,3 +1,4 @@
+
 #
 # This file is part of DisOrder.
 # Copyright (C) 2004, 2005, 2006 Richard Kettlewell
 # USA
 #
 
-lib_LTLIBRARIES=libdisorder.la
+noinst_LIBRARIES=libdisorder.a
 include_HEADERS=disorder.h
 noinst_PROGRAMS=test
 
-# This library is there to share code between the DisOrder applications,
-# not to provide an interface to anyone else.  As such there are no
-# guarantees regarding its ABI.
-libdisorder_la_SOURCES=charset.c charset.h             \
+libdisorder_a_SOURCES=charset.c charset.h              \
        addr.c addr.h                                   \
        authhash.c authhash.h                           \
        basen.c basen.h                                 \
@@ -68,9 +66,9 @@ libdisorder_la_SOURCES=charset.c charset.h            \
        words.c words.h casefold.h unicodegc.h          \
        wstat.c wstat.h                                 \
        disorder.h
-libdisorder_la_LIBADD=$(LIBGCRYPT) $(LIBGC) $(LIBICONV) $(LIBNSL) \
-       $(LIBSOCKET) $(LIBDL) $(LIBPCRE)
-libdisorder_la_LDFLAGS=-release ${VERSION}
+#libdisorder_la_LIBADD=$(LIBGCRYPT) $(LIBGC) $(LIBICONV) $(LIBNSL) \
+#      $(LIBSOCKET) $(LIBDL) $(LIBPCRE)
+#libdisorder_la_LDFLAGS=-release ${VERSION}
 
 definitions.h: Makefile
        rm -f $@.new
@@ -83,8 +81,8 @@ defs.o: definitions.h
 defs.lo: definitions.h
 
 test_SOURCES=test.c
-test_LDADD=libdisorder.la $(LIBPCRE)
-test_DEPENDENCIES=libdisorder.la
+test_LDADD=libdisorder.a $(LIBPCRE) $(LIBGC)
+test_DEPENDENCIES=libdisorder.a
 
 check: test
        ./test
index db41eec..98ddff0 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef DISORDER_H
 #define DISORDER_H
 
+#include <stddef.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 9284ac8..9441503 100644 (file)
@@ -30,42 +30,48 @@ disorderd_SOURCES=disorderd.c                               \
        play.c play.h                                   \
        server.c server.h                               \
        state.c state.h                                 \
-       trackdb.c trackdb.h trackdb-int.h
-disorderd_LDADD=$(LIBOBJS) ../lib/libdisorder.la $(LIBPCRE) $(LIBDB) $(LIBAO)
+       trackdb.c trackdb.h trackdb-int.h exports.c
+disorderd_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
+       $(LIBPCRE) $(LIBDB) $(LIBAO) $(LIBGC) $(LIBGCRYPT)
 disorderd_LDFLAGS=-export-dynamic
-disorderd_DEPENDENCIES=../lib/libdisorder.la
+disorderd_DEPENDENCIES=../lib/libdisorder.a
 
 disorder_deadlock_SOURCES=deadlock.c                    \
        trackdb.c trackdb.h
-disorder_deadlock_LDADD=$(LIBOBJS) ../lib/libdisorder.la $(LIBDB)
-disorder_deadlock_DEPENDENCIES=../lib/libdisorder.la
+disorder_deadlock_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
+       $(LIBDB) $(LIBPCRE) $(LIBGC)
+disorder_deadlock_DEPENDENCIES=../lib/libdisorder.a
 
 disorder_speaker_SOURCES=speaker.c
-disorder_speaker_LDADD=$(LIBOBJS) ../lib/libdisorder.la $(LIBASOUND)
-disorder_speaker_DEPENDENCIES=../lib/libdisorder.la
+disorder_speaker_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
+       $(LIBASOUND) $(LIBGC) $(LIBPCRE)
+disorder_speaker_DEPENDENCIES=../lib/libdisorder.a
 
 disorder_rescan_SOURCES=rescan.c                        \
        api.c api-server.c                              \
-       trackdb.c trackdb.h
-disorder_rescan_LDADD=$(LIBOBJS) ../lib/libdisorder.la $(LIBDB)
+       trackdb.c trackdb.h exports.c
+disorder_rescan_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
+       $(LIBDB) $(LIBGC) $(LIBPCRE)
 disorder_rescan_LDFLAGS=-export-dynamic
-disorder_rescan_DEPENDENCIES=../lib/libdisorder.la
+disorder_rescan_DEPENDENCIES=../lib/libdisorder.a
 
 disorder_dump_SOURCES=dump.c                           \
         trackdb.c trackdb.h
-disorder_dump_LDADD=$(LIBOBJS) ../lib/libdisorder.la $(LIBPCRE) $(LIBDB)
-disorder_dump_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.la
+disorder_dump_LDADD=$(LIBOBJS) ../lib/libdisorder.a \
+       $(LIBPCRE) $(LIBDB) $(LIBGC)
+disorder_dump_DEPENDENCIES=$(LIBOBJS) ../lib/libdisorder.a
 
 disorder_cgi_SOURCES=dcgi.c dcgi.h                     \
        api.c api-client.c api-client.h                 \
-       cgi.c cgi.h cgimain.c
-disorder_cgi_LDADD=../lib/libdisorder.la $(LIBPCRE)
+       cgi.c cgi.h cgimain.c exports.c
+disorder_cgi_LDADD=../lib/libdisorder.a \
+       $(LIBPCRE) $(LIBGC) $(LIBGCRYPT) $(LIBDL)
 disorder_cgi_LDFLAGS=-export-dynamic
-disorder_cgi_DEPENDENCIES=../lib/libdisorder.la
+disorder_cgi_DEPENDENCIES=../lib/libdisorder.a
 
 trackname_SOURCES=trackname.c
-trackname_LDADD=../lib/libdisorder.la
-trackname_DEPENDENCIES=../lib/libdisorder.la
+trackname_LDADD=../lib/libdisorder.a $(LIBGC) $(LIBPCRE)
+trackname_DEPENDENCIES=../lib/libdisorder.a
 
 install-exec-hook:
        $(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
diff --git a/server/exports.c b/server/exports.c
new file mode 100644 (file)
index 0000000..ddfabbb
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * This file is part of DisOrder.
+ * Copyright (C) 2007 Richard Kettlewell
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#include "disorder.h"
+
+typedef void (*fptr)(void);
+
+const fptr exported[] = {
+  (fptr)disorder_malloc,
+  (fptr)disorder_realloc,
+  (fptr)disorder_malloc_noptr,
+  (fptr)disorder_realloc_noptr,
+  (fptr)disorder_strdup,
+  (fptr)disorder_strndup,
+  (fptr)disorder_asprintf,
+  (fptr)disorder_snprintf,
+  (fptr)disorder_error,
+  (fptr)disorder_fatal,
+  (fptr)disorder_info,
+  (fptr)disorder_track_exists,
+  (fptr)disorder_track_get_data,
+  (fptr)disorder_track_set_data,
+};
+
+/*
+Local Variables:
+c-basic-offset:2
+comment-column:40
+fill-column:79
+indent-tabs-mode:nil
+End:
+*/