]> sourceware.org Git - systemtap.git/commitdiff
2005-12-11 Roland McGrath <roland@redhat.com>
authorroland <roland>
Mon, 12 Dec 2005 05:52:00 +0000 (05:52 +0000)
committerroland <roland>
Mon, 12 Dec 2005 05:52:00 +0000 (05:52 +0000)
PR 1916
* configure.ac: Grok --with-elfutils.
* Makefile.am [BUILD_ELFUTILS] (install-elfutils, stamp-elfutils):
New targets.
[BUILD_ELFUTILS] (stap_LDFLAGS, stap_LDFLAGS): Add flags
to point at local elfutils build.
[BUILD_ELFUTILS] (BUILT_SOURCES): Add stamp-elfutils.
[BUILD_ELFUTILS] (stap_DEPENDENCIES): New variable.
[BUILD_ELFUTILS] (lib-elfutils/libdw.so): New target.
[BUILD_ELFUTILS] (install-exec-local): Depend on install-elfutils.
(loc2c_test_LDADD): Set this to $(stap_LDADD).
(loc2c_test_CPPFLAGS, loc2c_test_LDFLAGS): New variables.
* Makefile.in: Regenerated.
* compile: New file from automakeland.
* systemtap.spec.in (elfutils_version): Require 0.118 or later.
[bundled_elfutils]: Remove old hacks for building elfutils, and rely
on configure --with-elfutils instead.
* Makefile.am (pkglibexecdir): New variable.
(AM_CPPFLAGS): Use it.
(pkglibexec_PROGRAMS): Set this instead of noinst_PROGRAMS with stpd.
(pkglibexec_SCRIPTS, CLEANFILES): New variables.
(install-exec-local): Target removed.
* runtest.sh: Set LD_LIBRARY_PATH when lib-elfutils is in use.

Makefile.am

index 936605d97822c5bccf82b0dc88de83cad3f2ce76..d8faa02066829c8b2063bd33ffbfb89446e9441b 100644 (file)
@@ -1,8 +1,9 @@
 # Makefile.am --- automake input file for systemtap
 ## process this file with automake to produce Makefile.in
 
-AM_CPPFLAGS = -DPKGLIBDIR='"${libexecdir}/${PACKAGE}"' \
-             -DPKGDATADIR='"${pkgdatadir}"'
+pkglibexecdir = ${libexecdir}/${PACKAGE}
+
+AM_CPPFLAGS = -DPKGLIBDIR='"$(pkglibexecdir)"' -DPKGDATADIR='"${pkgdatadir}"'
 
 AM_CFLAGS = -std=gnu99 -D_GNU_SOURCE -fexceptions \
            -Wall -Werror -Wshadow -Wunused -Wformat=2 -W
@@ -16,16 +17,48 @@ stap_SOURCES = main.cxx \
 stap_LDADD = @stap_LIBS@
 
 stap_CXXFLAGS = -Werror $(AM_CXXFLAGS)
+stap_CPPFLAGS = $(AM_CPPFLAGS)
+stap_LDFLAGS = $(AM_LDFLAGS)
+
+CLEANFILES =
+
+if BUILD_ELFUTILS
+stap_CPPFLAGS += -Iinclude-elfutils
+stap_LDFLAGS += -Llib-elfutils -Wl,-rpath-link,lib-elfutils \
+               -Wl,--enable-new-dtags,-rpath,$(pkglibdir)
+BUILT_SOURCES = stamp-elfutils
+CLEANFILES += stamp-elfutils
+stamp-elfutils: config.status
+       $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all
+       for dir in libelf libebl libdw libdwfl backends; do \
+         $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils/$$dir install; \
+       done
+       touch $@
+stap_DEPENDENCIES = lib-elfutils/libdw.so
+lib-elfutils/libdw.so: stamp-elfutils ;
+
+.PHONY: install-elfutils
+install-elfutils:
+       mkdir -p $(pkglibdir)
+       cp -df lib-elfutils/*.so* lib-elfutils/${PACKAGE_NAME}/*.so* \
+          $(pkglibdir)
+install-exec-local: install-elfutils
+endif
 
 # stpd goes into $libexec/$package, so libexec_PROGRAMS would
 # put it into the wrong location
-noinst_PROGRAMS = stpd
+pkglibexec_PROGRAMS = stpd
 stpd_SOURCES = runtime/stpd/stpd.c runtime/stpd/librelay.c
 stpd_LDADD = -lpthread
 
-noinst_PROGRAMS += loc2c-test
+pkglibexec_SCRIPTS = stp_check
+CLEANFILES += $(pkglibexec_SCRIPTS)
+
+noinst_PROGRAMS = loc2c-test
 loc2c_test_SOURCES = loc2c-test.c loc2c.c
-loc2c_test_LDADD = @stap_LIBS@
+loc2c_test_CPPFLAGS = $(stap_CPPFLAGS)
+loc2c_test_LDFLAGS = $(stap_LDFLAGS)
+loc2c_test_LDADD = $(stap_LDADD)
 
 # Get extra libs as needed
 LDADD =
@@ -37,11 +70,6 @@ dist-hook:
        find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf
        find $(distdir) -name '*.o' -o -name '*.ko' -o -name '*.cmd' -o -name '*.mod.c' -o -name '.??*' | xargs rm -rf
 
-install-exec-local:
-       mkdir -p $(DESTDIR)$(libexecdir)/systemtap
-       $(INSTALL) stpd $(DESTDIR)$(libexecdir)/systemtap
-       $(INSTALL) stp_check $(DESTDIR)$(libexecdir)/systemtap
-
 install-data-local:
        mkdir -p $(DESTDIR)$(pkgdatadir)/runtime/transport
        cp -rp $(srcdir)/runtime/*.[ch] $(srcdir)/runtime/Doxyfile \
This page took 0.047465 seconds and 5 git commands to generate.