From e871e41637d8c511a0cf0379c5e4ca872f6cf469 Mon Sep 17 00:00:00 2001 From: mszulecki Date: Fri, 23 Feb 2007 14:42:57 +0000 Subject: Attempt at shared object library building. git-svn-id: http://svn.sukimashita.com/repos/dskel/trunk@14 4281df72-ff29-0410-8fee-2d9ac0c5f5a7 --- src/Makefile.am | 9 ++++++--- src/helloworld.d | 3 ++- src/testshlibrary.d | 9 +++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 src/testshlibrary.d (limited to 'src') 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:"; + } +} -- cgit v1.1-32-gdbae