make user_generic a lib
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 7 Jul 2006 18:16:35 +0000 (18:16 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 7 Jul 2006 18:16:35 +0000 (18:16 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1984 04897980-b3bd-0310-b5e0-8ef037075253

ltt-usertrace/Makefile
ltt-usertrace/ltt/ltt-usertrace.h
ltt-usertrace/specs/ltt-usertrace.spec [new file with mode: 0644]

index c59c0edf6e294fcc386dad968802d2f92fa223be..719f8432b3b8ccaf361ac67ddcca5e0b56bc6c9a 100644 (file)
@@ -4,7 +4,7 @@ INCLUDE_DIR=/usr/include
 LIB_DIR?=/usr/lib
 RANLIB=ranlib
 
-LTT_CFLAGS=-I. -O2 -L.
+LTT_CFLAGS=-I. -O2 -L. -fPIC
 
 #For testing lib ltt-usertrace-fast
 #CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728
@@ -17,34 +17,35 @@ all: libs samples
 samples: sample sample-highspeed sample-printf \
        sample-instrument-fct sample-thread-slow sample-thread-fast sample-thread-brand sample-block
 
-sample: sample.c ltt-facility-loader-user_generic.c
-       $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
-sample-block: sample-block.c ltt-facility-loader-user_generic.c
-       $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
+sample: sample.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
+sample-block: sample-block.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
        
-sample-thread-brand: sample-thread-brand.c ltt-facility-loader-user_generic.c
-       $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
+sample-thread-brand: sample-thread-brand.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
 
-sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
-       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-usertrace-fast -o $@ $^
+sample-highspeed: sample-highspeed.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-usertrace-fast -lltt-loader-user_generic -o $@ $^
 
-sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
-       $(CC) $(LTT_CFLAGS) $(CFLAGS) -o $@ $^
+sample-printf: sample-printf.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
 
 sample-instrument-fct: sample-instrument-fct.c
        $(CC) $(LTT_CFLAGS) $(CFLAGS) -g -finstrument-functions -lltt-instrument-functions -o $@ $^
 
-sample-thread-slow: sample-thread-slow.c ltt-facility-loader-user_generic.c
-       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -o $@ $^
+sample-thread-slow: sample-thread-slow.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-loader-user_generic -o $@ $^
 
-sample-thread-fast: sample-thread-fast.c ltt-facility-loader-user_generic.c
-       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-usertrace-fast -o $@ $^
+sample-thread-fast: sample-thread-fast.c
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-usertrace-fast -lltt-loader-user_generic -o $@ $^
 
 
 #LIBRAIRIES
 
 libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
-                               libltt-usertrace-fast.a libltt-usertrace-fast.so.0
+                               libltt-usertrace-fast.a libltt-usertrace-fast.so.0 \
+                               libltt-loader-user_generic.a libltt-loader-user_generic.so.0
 
 libltt-usertrace-fast.a: ltt-usertrace-fast.o
        @rm -f libltt-usertrace-fast.a
@@ -66,6 +67,16 @@ libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader
        $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^
        ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so
 
+libltt-loader-user_generic.a: ltt-facility-loader-user_generic.o
+       @rm -f libltt-loader-user_generic.a
+       $(AR) rc $@ $^
+       $(RANLIB) $@
+
+libltt-loader-user_generic.so.0: ltt-facility-loader-user_generic.o
+       @rm -f libltt-loader-user_generic.so libltt-loader-user_generic.so.0
+       $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-loader-user_generic.so -o $@ $^
+       ln -s libltt-loader-user_generic.so.0 libltt-loader-user_generic.so
+
 %.o: %.c
        $(CC) $(LTT_CFLAGS) $(CFLAGS) -c -o $@ $+
 
@@ -78,9 +89,10 @@ install_headers:
 install_libs:
        cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR)
        cp -df libltt-usertrace-fast.so* libltt-usertrace-fast.a $(LIB_DIR)
+       cp -df libltt-loader-user_generic.so* libltt-loader-user_generic.a $(LIB_DIR)
 
 install: install_headers libs install_libs
 
 clean:
-       rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct libltt-instrument-functions.so* libltt-instrument-functions.a libltt-usertrace-fast.a libltt-usertrace-fast.so* sample-thread-slow sample-thread-fast sample-thread-brand
+       rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct libltt-instrument-functions.so* libltt-instrument-functions.a libltt-usertrace-fast.a libltt-usertrace-fast.so* libltt-loader-user_generic.so* libltt-loader-user_generic.a sample-thread-slow sample-thread-fast sample-thread-brand
 
index 373315ab0d052c577eac08f4e347e924a25b8811..60a6aabc9682e5e098ef5991f79828ea4e942e25 100644 (file)
 #include <ltt/system-ppc.h>
 #include <ltt/timex-ppc.h>
 #endif
+#elif defined(__x86_64__)
+#include <asm/timex.h>
+#include <asm/bitops.h>
+#include <asm/atomic.h>
+#include <asm/system.h>
 #else
 #include <asm/timex.h>
 #include <asm/atomic.h>
 #define NR_syscalls 319
 #endif
 
+#ifdef __x86_64__
+#define __NR_ltt_trace_generic 279
+#define __NR_ltt_register_generic      280
+#undef NR_syscalls
+#define NR_syscalls 281
+#endif
+
 #ifdef __powerpc__
 #define __NR_ltt_trace_generic 301
 #define __NR_ltt_register_generic      302
diff --git a/ltt-usertrace/specs/ltt-usertrace.spec b/ltt-usertrace/specs/ltt-usertrace.spec
new file mode 100644 (file)
index 0000000..0480933
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Spec file for LTT Usertrace
+#
+Summary: Linux Trace Toolkit Userspace Tracing Package
+Name: ltt-usertrace
+Version: 0.13
+License: GPL
+Release: 1
+Group: Applications/Development
+Source: http://ltt.polymtl.ca/packages/%{name}-%{version}.tar.gz
+URL: http://ltt.polymtl.ca
+Packager: Martin Bisson <bissonm@discreet.com>
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+# Where do we install the libs
+%ifarch x86_64 ppc64 ppc64iseries ia64 
+%define libdir /usr/lib64
+%else
+%define libdir /usr/lib
+%endif
+
+
+%description
+This packages makes it possible to do userspace tracing with the Linux
+Trace Toolkit.
+
+%prep
+%setup -q
+
+%build
+make libs
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT $RPM_BUILD_ROOT/usr/include $RPM_BUILD_ROOT/%{libdir}
+make INCLUDE_DIR=$RPM_BUILD_ROOT/usr/include LIB_DIR=$RPM_BUILD_ROOT/%{libdir} install
+
+%post
+echo "Running ldconfig (might take a while)"
+ldconfig
+
+%postun
+echo "Running ldconfig (might take a while)"
+ldconfig
+
+%files
+/usr/include/ltt
+/usr/include/ltt/atomic-ppc.h
+/usr/include/ltt/atomic-ppc64.h
+/usr/include/ltt/ltt-facility-custom-user_generic.h
+/usr/include/ltt/ltt-facility-id-user_generic.h
+/usr/include/ltt/ltt-facility-user_generic.h
+/usr/include/ltt/ltt-usertrace-fast.h
+/usr/include/ltt/ltt-usertrace-ppc.h
+/usr/include/ltt/ltt-usertrace.h
+/usr/include/ltt/ppc_asm-ppc.h
+/usr/include/ltt/system-ppc.h
+/usr/include/ltt/system-ppc64.h
+/usr/include/ltt/timex-ppc.h
+%{libdir}/libltt-instrument-functions.a
+%{libdir}/libltt-instrument-functions.so
+%{libdir}/libltt-instrument-functions.so.0
+%{libdir}/libltt-loader-user_generic.a
+%{libdir}/libltt-loader-user_generic.so
+%{libdir}/libltt-loader-user_generic.so.0
+%{libdir}/libltt-usertrace-fast.a
+%{libdir}/libltt-usertrace-fast.so
+%{libdir}/libltt-usertrace-fast.so.0
This page took 0.026908 seconds and 4 git commands to generate.