From 8624c5493f7a6a9dd7bc4d32eb2731a16b78d6e5 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Fri, 9 Oct 2009 18:52:35 -0400 Subject: [PATCH] update build system to find automatically installed kcompat and urcu --- README | 3 +-- configure.ac | 34 +++++++++++----------------------- java/Makefile.am | 2 +- libmallocwrap/Makefile.am | 3 +-- libust/Makefile.am | 5 ++--- tests/basic/Makefile.am | 5 ++--- tests/basic_long/Makefile.am | 5 ++--- tests/fork/Makefile.am | 7 +++---- tests/hello/Makefile.am | 5 ++--- tests/hello2/Makefile.am | 5 ++--- ustd/Makefile.am | 2 +- 11 files changed, 28 insertions(+), 48 deletions(-) diff --git a/README b/README index d2f78bc7..306ef58a 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 bc8c325e..070093bb 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 e818b810..f9deb7ac 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 acc85568..1f7dad39 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 df5f46a4..1aec7b31 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 d949bb46..669cb826 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 219be7a7..a6e0f7c5 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 4813bf8c..86a1a798 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 845773ee..bef643db 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 1abdae01..8c3aad1e 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 e1785403..df49a820 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 -- 2.34.1