summaryrefslogtreecommitdiffstats
path: root/development/colm/without-static.patch
blob: 64ef8720d499d3d28fc2d86e4f5f209596560cc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
diff --git a/configure.ac b/configure.ac
index aa127b68..fc034f28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,7 @@ AC_PROG_CXX
 AC_CHECK_TOOL(AR, ar)
 AC_PROG_RANLIB
 AC_PROG_LIBTOOL
+
 SED_SUBST=["\
 	-e 's|@CXX@|${CXX}|g' \
 	-e 's|@CC@|${CC}|g' \
@@ -420,6 +421,13 @@ test -e src/include/colm || ln -s .. src/include/colm
 echo "#define VERSION \"$VERSION\"" > src/version.h
 echo "#define PUBDATE \"$PUBDATE\"" >> src/version.h
 
+if test "x$enable_static" = "xyes"; then 
+	AC_DEFINE([LINK_STATIC], [1], [Link static lib when invoking C compile and link])
+fi
+
+if test "x$enable_shared" = "xyes"; then
+	AC_DEFINE([LINK_SHARED], [1], [Link shared lib when invoking C compile and link])
+fi
 
 dnl
 dnl Wrap up.
diff --git a/src/main.cc b/src/main.cc
index 301fae91..8ca395f0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -485,7 +485,14 @@ void compileOutput( const char *argv0, const bool inSource, char *srcLocation )
 				" -I%s/../aapl"
 				" -I%s/include"
 				" -L%s"
+#if defined(LINK_STATIC)
 				" %s/libcolm.a",
+#elif defined(LINK_SHARED)
+				" %s/libcolm.so",
+#else
+#				error "must enabled at least one of shared or static libs"
+#endif
+
 				binaryFn, intermedFn, srcLocation,
 				srcLocation, location, location );
 	}
diff --git a/src/libfsm/codegen.cc b/src/libfsm/codegen.cc
index 21edb5ac..1150384e 100644
--- a/src/libfsm/codegen.cc
+++ b/src/libfsm/codegen.cc
@@ -30,6 +30,8 @@
 #include <assert.h>
 #include <iomanip>
 
+// Convenience: for checking for the presence of the libfsm.
+extern "C" void libfsm_present() {}
 
 using std::ostream;
 using std::ostringstream;