From: Pierre-Marc Fournier Date: Fri, 9 Oct 2009 22:52:35 +0000 (-0400) Subject: update build system to find automatically installed kcompat and urcu X-Git-Tag: v0.1~97 X-Git-Url: http://git.lttng.org/?p=ust.git;a=commitdiff_plain;h=8624c5493f7a6a9dd7bc4d32eb2731a16b78d6e5 update build system to find automatically installed kcompat and urcu --- diff --git a/README b/README index d2f78bc..306ef58 100644 --- a/README +++ b/README @@ -13,8 +13,7 @@ Dependencies: Installation instruction: - Download, compile and install liburcu and libkcompat. -- In this package's tree, run ./configure, specifying the location of - liburcu and libkcompat with the --with-urcu and --with-kcompat options. +- In this package's tree, run ./configure. - Run make. - See the manual in the doc/ directory for usage instructions. diff --git a/configure.ac b/configure.ac index bc8c325..070093b 100644 --- a/configure.ac +++ b/configure.ac @@ -50,30 +50,18 @@ AC_C_INLINE AC_FUNC_MALLOC AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol]) -AC_ARG_WITH(urcu, [ --with-urcu path Path to userspace RCU source], [ - AC_CHECK_FILE(["$withval/urcu.h"], [ - URCU_CFLAGS="-I$withval" - URCU_LIBS="-L$withval -lurcu-bp" ], - AC_MSG_ERROR([Cannot find urcu.h in urcu directory])) -], [ - PKG_CHECK_MODULES(URCU, [liburcu], , [ - AC_MSG_ERROR([Must specify urcu path.])]) -]) -AC_SUBST(URCU_CFLAGS) -AC_SUBST(URCU_LIBS) +# URCU + +# urcu - check if we just find the headers it out of the box. +AC_CHECK_HEADERS([urcu-bp.h], [], [AC_MSG_ERROR([Cannot find [URCU] headers (urcu-bp.h). Use [CFLAGS]=-Idir to specify their location.])]) + +# urcu - check that URCU lib is available to compilation +AC_CHECK_LIB([urcu-bp], [synchronize_rcu], [], [AC_MSG_ERROR([Cannot find liburcu-bp lib. Use [LDFLAGS]=-Ldir to specify its location.])]) + +# kcompat + +AC_CHECK_HEADERS([kcompat.h], [], [AC_MSG_ERROR([Cannot find kcompat headers (kcompat.h). Use [CFLAGS]=-Idir to specify their location.])]) -AC_ARG_WITH(kcompat, [ --with-kcompat path Path to userspace kcompat source -], [ - AC_CHECK_FILE("$withval/kcompat.h", [ - KCOMPAT_CFLAGS="-I$withval $URCU_CFLAGS" - KCOMPAT_LIBS= - ], AC_MSG_ERROR([Cannot find kcompat.h in kcompat directory])) -], [ - PKG_CHECK_MODULES(KCOMPAT, [libkcompat], , [ - AC_MSG_ERROR([Must specify kcompat path.])]) -]) -AC_SUBST(KCOMPAT_CFLAGS) -AC_SUBST(KCOMPAT_LIBS) AC_CONFIG_FILES([ Makefile diff --git a/java/Makefile.am b/java/Makefile.am index e818b81..f9deb7a 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust lib_LTLIBRARIES = libustjava.la libustjava_la_SOURCES = UST.c UST.h diff --git a/libmallocwrap/Makefile.am b/libmallocwrap/Makefile.am index acc8556..1f7dad3 100644 --- a/libmallocwrap/Makefile.am +++ b/libmallocwrap/Makefile.am @@ -1,5 +1,4 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \ - $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust lib_LTLIBRARIES = libmallocwrap.la libmallocwrap_la_SOURCES = mallocwrap.c diff --git a/libust/Makefile.am b/libust/Makefile.am index df5f46a..1aec7b3 100644 --- a/libust/Makefile.am +++ b/libust/Makefile.am @@ -1,8 +1,7 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libustcomm \ - $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libustcomm lib_LTLIBRARIES = libust.la libust_la_SOURCES = marker.c marker.h tracepoint.c tracepoint.h immediate.h channels.c channels.h marker-control.c marker-control.h relay.c relay.h tracer.c tracer.h tracercore.c tracercore.h serialize.c tracectl.c $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/share/usterr.h libust_la_LDFLAGS = -no-undefined -version-info 0:0:0 -libust_la_LIBADD = $(URCU_LIBS) -lpthread +libust_la_LIBADD = -lpthread libust_la_CFLAGS = -DUST_COMPONENT="libust" diff --git a/tests/basic/Makefile.am b/tests/basic/Makefile.am index d949bb4..669cb82 100644 --- a/tests/basic/Makefile.am +++ b/tests/basic/Makefile.am @@ -1,9 +1,8 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \ - $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust noinst_PROGRAMS = basic basic_SOURCES = basic.c -basic_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS) +basic_LDADD = $(top_builddir)/libust/libust.la noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/basic_long/Makefile.am b/tests/basic_long/Makefile.am index 219be7a..a6e0f7c 100644 --- a/tests/basic_long/Makefile.am +++ b/tests/basic_long/Makefile.am @@ -1,9 +1,8 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \ - $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust noinst_PROGRAMS = basic_long basic_long_SOURCES = basic_long.c -basic_long_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS) +basic_long_LDADD = $(top_builddir)/libust/libust.la noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/fork/Makefile.am b/tests/fork/Makefile.am index 4813bf8..86a1a79 100644 --- a/tests/fork/Makefile.am +++ b/tests/fork/Makefile.am @@ -1,11 +1,10 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \ - $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust noinst_PROGRAMS = fork fork2 fork_SOURCES = fork.c -fork_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS) +fork_LDADD = $(top_builddir)/libust/libust.la fork2_SOURCES = fork2.c -fork2_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS) +fork2_LDADD = $(top_builddir)/libust/libust.la noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am index 845773e..bef643d 100644 --- a/tests/hello/Makefile.am +++ b/tests/hello/Makefile.am @@ -1,9 +1,8 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \ - $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust noinst_PROGRAMS = hello hello_SOURCES = hello.c tp.c tp.h -hello_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS) +hello_LDADD = $(top_builddir)/libust/libust.la noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/tests/hello2/Makefile.am b/tests/hello2/Makefile.am index 1abdae0..8c3aad1 100644 --- a/tests/hello2/Makefile.am +++ b/tests/hello2/Makefile.am @@ -1,9 +1,8 @@ -INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \ - $(KCOMPAT_CFLAGS) $(URCU_CFLAGS) +INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust noinst_PROGRAMS = hello2 hello2_SOURCES = hello2.c -hello2_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS) +hello2_LDADD = $(top_builddir)/libust/libust.la noinst_SCRIPTS = run EXTRA_DIST = run diff --git a/ustd/Makefile.am b/ustd/Makefile.am index e178540..df49a82 100644 --- a/ustd/Makefile.am +++ b/ustd/Makefile.am @@ -1,5 +1,5 @@ INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \ - -I$(top_builddir)/libustcomm $(KCOMPAT_CFLAGS) + -I$(top_builddir)/libustcomm bin_PROGRAMS = ustd ustd_SOURCES = lowlevel.c ustd.c ustd.h $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/libustcomm/ustcomm.h $(top_builddir)/share/usterr.h