aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure62
1 files changed, 56 insertions, 6 deletions
diff --git a/configure b/configure
index 46b5b6d809..00f90702bc 100755
--- a/configure
+++ b/configure
@@ -1331,6 +1331,35 @@ else
error_exit "\"$cc\" either does not exist or does not work"
fi
+# Check that the C++ compiler exists and works with the C compiler
+if has $cxx; then
+ cat > $TMPC <<EOF
+int c_function(void);
+int main(void) { return c_function(); }
+EOF
+
+ compile_object
+
+ cat > $TMPC <<EOF
+extern "C" {
+ int c_function(void);
+}
+int c_function(void) { return 42; }
+EOF
+
+ if (cc=$cxx do_cc $QEMU_CFLAGS -o $TMPE $TMPC $TMPO $LDFLAGS); then
+ # C++ compiler $cxx works ok with C compiler $cc
+ :
+ else
+ echo "C++ compiler $cxx does not work with C compiler $cc"
+ echo "Disabling C++ specific optional code"
+ cxx=
+ fi
+else
+ echo "No C++ compiler available; disabling C++ specific optional code"
+ cxx=
+fi
+
# Consult white-list to determine whether to enable werror
# by default. Only enable by default for git builds
z_version=`cut -f3 -d. $source_path/VERSION`
@@ -3452,15 +3481,25 @@ fi
# For 'ust' backend, test if ust headers are present
if test "$trace_backend" = "ust"; then
cat > $TMPC << EOF
-#include <ust/tracepoint.h>
-#include <ust/marker.h>
+#include <lttng/tracepoint.h>
int main(void) { return 0; }
EOF
if compile_prog "" "" ; then
- LIBS="-lust -lurcu-bp $LIBS"
- libs_qga="-lust -lurcu-bp $libs_qga"
+ if $pkg_config lttng-ust --exists; then
+ lttng_ust_libs=`$pkg_config --libs lttng-ust`
+ else
+ lttng_ust_libs="-llttng-ust"
+ fi
+ if $pkg_config liburcu-bp --exists; then
+ urcu_bp_libs=`$pkg_config --libs liburcu-bp`
+ else
+ urcu_bp_libs="-lurcu-bp"
+ fi
+
+ LIBS="$lttng_ust_libs $urcu_bp_libs $LIBS"
+ libs_qga="$lttng_ust_libs $urcu_bp_libs $libs_qga"
else
- error_exit "Trace backend 'ust' missing libust header files"
+ error_exit "Trace backend 'ust' missing lttng-ust header files"
fi
fi
@@ -3637,7 +3676,18 @@ cpuid_h=no
cat > $TMPC << EOF
#include <cpuid.h>
int main(void) {
- return 0;
+ unsigned a, b, c, d;
+ int max = __get_cpuid_max(0, 0);
+
+ if (max >= 1) {
+ __cpuid(1, a, b, c, d);
+ }
+
+ if (max >= 7) {
+ __cpuid_count(7, 0, a, b, c, d);
+ }
+
+ return 0;
}
EOF
if compile_prog "" "" ; then