# libust and '.' (that contains the linker script). However, '.'
# must be installed after libust so it can overwrite libust.so with
# the linker script.
-SUBDIRS = snprintf libust . tests libmallocwrap ustd ustctl libinterfork include
+SUBDIRS = snprintf libustcomm libust . tests libmallocwrap ustd ustctl libinterfork include
EXTRA_DIST = doc libust.ldscript.in libust-initializer.c
dist_bin_SCRIPTS = usttrace
libinterfork/Makefile
ustd/Makefile
ustctl/Makefile
+ libustcomm/Makefile
snprintf/Makefile
])
AC_OUTPUT
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libustcomm
lib_LTLIBRARIES = libust.la
+
libust_la_SOURCES = \
marker.c \
tracepoint.c \
tracercore.h \
serialize.c \
tracectl.c \
- $(top_builddir)/libustcomm/ustcomm.c \
tracerconst.h \
header-inline.h
+
libust_la_LDFLAGS = -no-undefined -version-info 0:0:0
-libust_la_LIBADD = -lpthread $(top_builddir)/snprintf/libustsnprintf.la
+
+libust_la_LIBADD = \
+ -lpthread \
+ $(top_builddir)/snprintf/libustsnprintf.la \
+ $(top_builddir)/libustcomm/libustcomm.la
+
libust_la_CFLAGS = -DUST_COMPONENT="libust"
int result;
static int n_cpus = 0;
- if(n_cpus) {
- return n_cpus;
- }
+ if(!n_cpus) {
+ /* On Linux, when some processors are offline
+ * _SC_NPROCESSORS_CONF counts the offline
+ * processors, whereas _SC_NPROCESSORS_ONLN
+ * does not. If we used _SC_NPROCESSORS_ONLN,
+ * getcpu() could return a value greater than
+ * this sysconf, in which case the arrays
+ * indexed by processor would overflow.
+ */
+ result = sysconf(_SC_NPROCESSORS_CONF);
+ if(result == -1) {
+ return -1;
+ }
- /* On Linux, when some processors are offline
- * _SC_NPROCESSORS_CONF counts the offline
- * processors, whereas _SC_NPROCESSORS_ONLN
- * does not. If we used _SC_NPROCESSORS_ONLN,
- * getcpu() could return a value greater than
- * this sysconf, in which case the arrays
- * indexed by processor would overflow.
- */
- result = sysconf(_SC_NPROCESSORS_CONF);
- if(result == -1) {
- return -1;
+ n_cpus = result;
}
- n_cpus = result;
-
- return result;
+ return n_cpus;
}
/* _ust_buffers_write()
--- /dev/null
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+lib_LTLIBRARIES = libustcomm.la
+libustcomm_la_SOURCES = \
+ ustcomm.h \
+ ustcomm.c
+libustcomm_la_LDFLAGS = -no-undefined -version-info 0:0:0 -static
+libustcomm_la_CFLAGS = -DUST_COMPONENT="libustcomm" -fPIC
-I$(top_srcdir)/libustcmd $(KCOMPAT_CFLAGS)
bin_PROGRAMS = ustctl
-ustctl_SOURCES = ustctl.c $(top_srcdir)/libustcomm/ustcomm.c $(top_srcdir)/libustcomm/ustcomm.h $(top_srcdir)/libustcmd/ustcmd.c $(top_srcdir)/libustcmd/ustcmd.h
+
+ustctl_SOURCES = \
+ ustctl.c \
+ $(top_srcdir)/libustcmd/ustcmd.c \
+ $(top_srcdir)/libustcmd/ustcmd.h
+
ustctl_CFLAGS = -DUST_COMPONENT=ustctl
-ustctl_LDADD = $(top_builddir)/snprintf/libustsnprintf.la
+
+ustctl_LDADD = \
+ $(top_builddir)/snprintf/libustsnprintf.la \
+ $(top_builddir)/libustcomm/libustcomm.la
-I$(top_srcdir)/include
bin_PROGRAMS = ustd
-ustd_SOURCES = lowlevel.c ustd.c ustd.h $(top_srcdir)/libustcomm/ustcomm.c $(top_srcdir)/libustcomm/ustcomm.h
-ustd_LDADD = $(top_builddir)/snprintf/libustsnprintf.la
+
+ustd_SOURCES = lowlevel.c ustd.c ustd.h
+
+ustd_LDADD = \
+ $(top_builddir)/snprintf/libustsnprintf.la \
+ $(top_builddir)/libustcomm/libustcomm.la
+
ustd_LDFLAGS = -lpthread
ustd_CFLAGS = -DUST_COMPONENT=ustd