summaryrefslogtreecommitdiffstats
path: root/buildrun.cxx
diff options
context:
space:
mode:
authorfche <fche>2007-03-19 19:19:38 +0000
committerfche <fche>2007-03-19 19:19:38 +0000
commit255e4c681ec42ab8a88ac60d1a31fd8209a90fb1 (patch)
tree7905fbb9c92fd717937ded0be75a38c89dad8ef4 /buildrun.cxx
parent99c3c059961e9abdf76b92e9ab22fe26b929ec20 (diff)
downloadsystemtap-steved-255e4c681ec42ab8a88ac60d1a31fd8209a90fb1.tar.gz
systemtap-steved-255e4c681ec42ab8a88ac60d1a31fd8209a90fb1.tar.xz
systemtap-steved-255e4c681ec42ab8a88ac60d1a31fd8209a90fb1.zip
2007-03-19 Frank Ch. Eigler <fche@elastic.org>
* buildrun.cxx (compile_pass): Emit kbuild-time autoconf widgets to customize runtime or translator C code to actual kernel rather than kernel version string. Thanks to FC 2.6."20" for the nudge. * tapsets.cxx (hrtimer*emit_module): First client: HRTIMER_{MODE_}REL. 2007-03-19 Frank Ch. Eigler <fche@elastic.org> * autoconf-hrtimer-rel.c: New file.
Diffstat (limited to 'buildrun.cxx')
-rw-r--r--buildrun.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/buildrun.cxx b/buildrun.cxx
index 1c5ce0f6..8bd4cc3e 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -1,5 +1,5 @@
// build/run probes
-// Copyright (C) 2005, 2006 Red Hat Inc.
+// Copyright (C) 2005-2007 Red Hat Inc.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
@@ -39,6 +39,18 @@ compile_pass (systemtap_session& s)
// Create makefile
+ // Clever hacks copied from vmware modules
+ o << "stap_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo \"$(1)\"; else echo \"$(2)\"; fi)" << endl;
+ o << "stap_check_build = " /* << "set -x; " */ << "$(shell if $(CC) $(CPPFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc $(1) > /dev/null 2>&1; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl;
+
+ o << "SYSTEMTAP_RUNTIME = \"" << s.runtime_path << "\"" << endl;
+
+ // "autoconf" options go here
+
+ // enum hrtimer_mode renaming near 2.6.21; see tapsets.cxx hrtimer_derived_probe_group::emit_module_decls
+ o << "CFLAGS += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-hrtimer-rel.c, -DSTAPCONF_HRTIMER_REL,)" << endl;
+
+
for (unsigned i=0; i<s.macros.size(); i++)
o << "CFLAGS += -D " << lex_cast_qstring(s.macros[i]) << endl;