Add test for compilation of libust against a shared library
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 14 Dec 2009 07:17:34 +0000 (02:17 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 14 Dec 2009 07:17:34 +0000 (02:17 -0500)
tests/make_shared_lib/Makefile [new file with mode: 0644]
tests/make_shared_lib/basic_lib.c [new file with mode: 0644]
tests/make_shared_lib/prog.c [new file with mode: 0644]

diff --git a/tests/make_shared_lib/Makefile b/tests/make_shared_lib/Makefile
new file mode 100644 (file)
index 0000000..7c56a73
--- /dev/null
@@ -0,0 +1,21 @@
+#all: libbasic.so prog libbasic-noscript.so prog_noscript
+all: libbasic.so prog
+
+libbasic.so: basic_lib.o
+       gcc -g $(LDFLAGS) -fPIC -o libbasic.so -shared -lust basic_lib.o
+libbasic-noscript.so: basic_lib_noscript.o
+       gcc -g $(LDFLAGS) -fPIC -o libbasic-noscript.so -shared basic_lib_noscript.o /usr/local/lib/libust.so.0 /usr/local/lib/libust-initializer.o
+
+basic_lib.o: basic_lib.c
+       gcc -g $(CFLAGS) -DCONFIG_UST_GDB_INTEGRATION -fPIC -c basic_lib.c
+basic_lib_noscript.o: basic_lib.c
+       gcc -g -DCONFIG_UST_GDB_INTEGRATION -fPIC -o basic_lib_noscript.o -c basic_lib.c
+
+prog: prog.c
+       gcc -g -DCONFIG_UST_GDB_INTEGRATION $(CFLAGS) $(LDFLAGS) -o prog -L . -lbasic -lust prog.c
+prog_noscript: prog.c
+       gcc -g -DCONFIG_UST_GDB_INTEGRATION -o prog_noscript -L . -lbasic-noscript prog.c /usr/local/lib/libust.so.0 /usr/local/lib/libust-initializer.o
+
+.PHONY: clean
+clean:
+       rm -f basic_lib.o libbasic.so prog basic_lib_noscript.o libbasic-noscript.so
diff --git a/tests/make_shared_lib/basic_lib.c b/tests/make_shared_lib/basic_lib.c
new file mode 100644 (file)
index 0000000..2c1366e
--- /dev/null
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <ust/marker.h>
+
+void myfunc(void)
+{
+       trace_mark(ust, in_lib, MARK_NOARGS);
+       printf("testfunc\n");
+}
+
+//MARKER_LIB
diff --git a/tests/make_shared_lib/prog.c b/tests/make_shared_lib/prog.c
new file mode 100644 (file)
index 0000000..c1f5ac8
--- /dev/null
@@ -0,0 +1,10 @@
+#include <ust/marker.h>
+
+extern myfunc(void);
+
+int main(void)
+{
+       myfunc();
+       trace_mark(ust, in_prog, MARK_NOARGS);
+       return 0;
+}
This page took 0.024703 seconds and 4 git commands to generate.