diff options
-rw-r--r-- | src/Makefile.am | 9 | ||||
-rwxr-xr-x | src/helloworld.d | 3 | ||||
-rw-r--r-- | src/testshlibrary.d | 9 |
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:"; + } +} |