summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mszulecki2007-02-23 14:42:57 +0000
committerGravatar mszulecki2007-02-23 14:42:57 +0000
commite871e41637d8c511a0cf0379c5e4ca872f6cf469 (patch)
tree03cf75db28b8e8fe24c389b64bf9645decbc4b07
parent9d7a4bddb8e15687c654ab54c8e194fce2f00617 (diff)
downloaddskel-e871e41637d8c511a0cf0379c5e4ca872f6cf469.tar.gz
dskel-e871e41637d8c511a0cf0379c5e4ca872f6cf469.tar.bz2
Attempt at shared object library building.
git-svn-id: http://svn.sukimashita.com/repos/dskel/trunk@14 4281df72-ff29-0410-8fee-2d9ac0c5f5a7
-rw-r--r--src/Makefile.am9
-rwxr-xr-xsrc/helloworld.d3
-rw-r--r--src/testshlibrary.d9
3 files changed, 17 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 2a97177..84f04c3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,13 +1,16 @@
+lib_LTLIBRARIES = libtestshlibrary.la
+libtestshlibrary_la_SOURCES = testshlibrary.d
+libtestshlibrary_la_LDFLAGS = -version-info 0:1:0 -module
+
noinst_LIBRARIES = libtestlibrary.a
libtestlibrary_a_SOURCES = testlibrary.d
-libtestlibrary_a_LDFLAGS = -static
bin_PROGRAMS = helloworld
helloworld_SOURCES = helloworld.d
-helloworld_LDADD = $(DEPS_LIBS) $(top_srcdir)/config.d libtestlibrary.a
+helloworld_LDADD = $(DEPS_LIBS) $(top_srcdir)/config.d libtestlibrary.a libtestshlibrary.la
helloworld_LINK = $(GDC) $(DFLAGS) -o $@
-DFLAGS = -I$(top_srcdir) -I$(srcdir)
+DFLAGS += -I$(top_srcdir) -I$(srcdir)
.d.o:
$(GDC) $(DFLAGS) -c -o $@ $<
diff --git a/src/helloworld.d b/src/helloworld.d
index 74f6428..f2f328b 100755
--- a/src/helloworld.d
+++ b/src/helloworld.d
@@ -1,10 +1,11 @@
import config;
import testlibrary;
+import testshlibrary;
import std.stdio;
void main(char[][] args)
{
- writefln(HelloWorldFactory.getName() ~ ", Version: " ~ config.VERSION);
+ writefln(HelloWorldFactory.getName() ~ ", " ~ HelloWorldSharedObjectFactory.getVersion() ~ " " ~ config.VERSION);
// auto type inference and built-in foreach
foreach (argc, argv; args)
diff --git a/src/testshlibrary.d b/src/testshlibrary.d
new file mode 100644
index 0000000..13cbea9
--- /dev/null
+++ b/src/testshlibrary.d
@@ -0,0 +1,9 @@
+module testshlibrary;
+
+public static class HelloWorldSharedObjectFactory
+{
+ public static char[] getVersion()
+ {
+ return "Version:";
+ }
+}