configure.ac: use test "x$var" = "xyes"
[lttng-ust.git] / configure.ac
index 1c841da882c9328667372ef872a9c02626f9492f..cfb2ddf5ead414a66311501808121338321cfb44 100644 (file)
@@ -1,7 +1,17 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
+dnl                                               -*- Autoconf -*-
+dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([lttng-ust],[2.8.0-pre],[mathieu dot desnoyers at efficios dot com])
+dnl Version infos
+m4_define([V_MAJOR], [2])
+m4_define([V_MINOR], [8])
+m4_define([V_PATCH], [0])
+m4_define([V_EXTRA], [pre])
+m4_define([V_STRING], [V_MAJOR.V_MINOR.V_PATCH])
+m4_ifdef([V_EXTRA], [m4_append([V_STRING], [-V_EXTRA])])
+m4_define([V_NAME], [[Herbe à Détourne]])
+m4_define([V_DESC], [[Brewed with unrestrained amounts of Citra hop, the Herbe à Détourne is a fantastic New World Tripel brewed by "Dieu du Ciel!". Aromas of mango, cantaloupe melon and passion fruit, combined with a controlled bitter finish, unite in making this smooth golden-orange beer stand apart.]])
+
+AC_INIT([lttng-ust],V_STRING,[mathieu dot desnoyers at efficios dot com])
 
 # Following the numbering scheme proposed by libtool for the library version
 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
@@ -29,33 +39,20 @@ AH_TEMPLATE([LTTNG_UST_HAVE_EFFICIENT_UNALIGNED_ACCESS], [Use efficient unaligne
 AH_TEMPLATE([LTTNG_UST_HAVE_SDT_INTEGRATION], [SystemTap integration via sdt.h])
 AH_TEMPLATE([LTTNG_UST_HAVE_PERF_EVENT], [Perf event integration via perf_event.h])
 
-# Compute minor/major/patchlevel version numbers
+dnl Substitute minor/major/patchlevel version numbers
 AC_PROG_SED
-major_version=$(echo AC_PACKAGE_VERSION | sed 's/^\([[0-9]]\)*\.[[0-9]]*\.[[0-9]]*.*$/\1/')
-minor_version=$(echo AC_PACKAGE_VERSION | sed 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
-patchlevel_version=$(echo AC_PACKAGE_VERSION | sed 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*$/\1/')
-AC_SUBST([MAJOR_VERSION], [$major_version])
-AC_SUBST([MINOR_VERSION], [$minor_version])
-AC_SUBST([PATCHLEVEL_VERSION], [$patchlevel_version])
-AC_DEFINE_UNQUOTED([VERSION_MAJOR], $major_version, [UST major version number])
-AC_DEFINE_UNQUOTED([VERSION_MINOR], $minor_version, [UST minor version number])
-AC_DEFINE_UNQUOTED([VERSION_PATCHLEVEL], $patchlevel_version, [UST patchlevel version number])
-
-version_name="Herbe à Détourne"
-version_description='Brewed with unrestrained amounts of Citra hop, the Herbe à Détourne is a fantastic New World Tripel brewed by "Dieu du Ciel!". Aromas of mango, cantaloupe melon and passion fruit, combined with a controlled bitter finish, unite in making this smooth golden-orange beer stand apart.'
-version_description_c=$(echo $version_description | sed 's/"/\\"/g')
-
-AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], [UST version name])
-AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description_c"], [UST version description])
+AC_SUBST([MAJOR_VERSION], [V_MAJOR])
+AC_SUBST([MINOR_VERSION], [V_MINOR])
+AC_SUBST([PATCHLEVEL_VERSION], [V_PATCH])
 
 AC_PROG_GREP
 AC_PROG_LN_S
 # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
-AC_ARG_ENABLE(libtool-linkdep-fixup,
+AC_ARG_ENABLE([libtool-linkdep-fixup],
        AS_HELP_STRING([--disable-libtool-linkdep-fixup],
                        [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]),
-       libtool_fixup=$enableval,
-       libtool_fixup=yes)
+       [libtool_fixup=$enableval],
+       [libtool_fixup=yes])
 
 AS_IF([test "x$libtool_fixup" = "xyes"],
            [
@@ -90,7 +87,7 @@ AC_CACHE_CHECK([whether the C++ compiler works],
                AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
                                [check_cxx_designated_initializers=yes],
                                [rw_cv_prog_cxx_works=no])
-               if test "$check_cxx_designated_initializers" = "yes"; then
+               AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [
                        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
                                struct foo { int a; int b; };
                                void fct(void)
@@ -102,7 +99,7 @@ AC_CACHE_CHECK([whether the C++ compiler works],
                        ],[
                                rw_cv_prog_cxx_works=no
                        ])
-               fi
+               ])
                AC_LANG_POP([C++])])
 
 AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
@@ -110,11 +107,11 @@ AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
 # Check if the compiler support weak symbols
 AX_SYS_WEAK_ALIAS
 
-if test "x${ax_cv_sys_weak_alias}" = "xno"; then
-   AC_MSG_ERROR([Your platform doesn't support weak symbols.])
-fi
+AS_IF([test "x${ax_cv_sys_weak_alias}" = "xno"], [
+       AC_MSG_ERROR([Your platform doesn't support weak symbols.])
+])
 
-## Checks for libraries.
+# Checks for libraries.
 AC_CHECK_LIB([dl], [dlopen],
 [
        have_libdl=yes
@@ -145,22 +142,22 @@ AS_IF([test "x${ac_cv_header_dlfcn_h}" = "xyes"],
 AM_CONDITIONAL([HAVE_DLINFO], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])
 
 # Checks for header files.
-#AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
+dnl AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_INLINE
-#AC_TYPE_INT16_T
-#AC_TYPE_INT32_T
-#AC_TYPE_INT64_T
-#AC_TYPE_INT8_T
-#AC_TYPE_PID_T
-#AC_TYPE_SIZE_T
-#AC_TYPE_SSIZE_T
-#AC_TYPE_UINT16_T
-#AC_TYPE_UINT32_T
-#AC_TYPE_UINT64_T
-#AC_TYPE_UINT8_T
-#AC_CHECK_TYPES([ptrdiff_t])
+dnl AC_TYPE_INT16_T
+dnl AC_TYPE_INT32_T
+dnl AC_TYPE_INT64_T
+dnl AC_TYPE_INT8_T
+dnl AC_TYPE_PID_T
+dnl AC_TYPE_SIZE_T
+dnl AC_TYPE_SSIZE_T
+dnl AC_TYPE_UINT16_T
+dnl AC_TYPE_UINT32_T
+dnl AC_TYPE_UINT64_T
+dnl AC_TYPE_UINT8_T
+dnl AC_CHECK_TYPES([ptrdiff_t])
 
 # Checks for library functions.
 AC_FUNC_MALLOC
@@ -206,52 +203,44 @@ AC_CHECK_HEADERS([linux/perf_event.h], [have_perf_event=yes], [])
 
 # Perf event counters are only supported on x86 so far.
 AC_MSG_CHECKING([UST support for architecture perf event counters])
-case $host_cpu in
-changequote(,)dnl
-       i[3456]86)
-changequote([,])dnl
-       UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=yes;;
-       x86_64) UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=yes;;
-       amd64) UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=yes;;
-       *) UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=no;;
-esac
+AS_CASE([$host_cpu],
+       [i[[3456]]86], [UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=yes],
+       [x86_64], [UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=yes],
+       [amd64], [UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=yes],
+       [UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS=no])
 AC_MSG_RESULT([$UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS])
 
 AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$have_perf_event" = "xyes" -a "x$UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS" = "xyes"])
 
-if test "x$have_perf_event" = "xyes" -a "x$UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS" = "xyes"; then
-AC_DEFINE([LTTNG_UST_HAVE_PERF_EVENT], [1])
-fi
+AS_IF([test "x$have_perf_event" = "xyes" -a "x$UST_SUPPORT_FOR_ARCH_PERF_EVENT_COUNTERS" = "xyes"], [
+       AC_DEFINE([LTTNG_UST_HAVE_PERF_EVENT], [1])
+])
 
 AC_MSG_CHECKING([host system alignment requirements])
-case $host_cpu in
-changequote(,)dnl
-       i[3456]86)
-changequote([,])dnl
-         ;;
-       x86_64) ;;
-       amd64) ;;
-       powerpc) ;;
-       ppc64) ;;
-       ppc64le) ;;
-       powerpc64) ;;
-       powerpc64le) ;;
-       s390) NO_UNALIGNED_ACCESS=1 ;;
-       s390x) NO_UNALIGNED_ACCESS=1 ;;
-        arm*) NO_UNALIGNED_ACCESS=1 ;;
-       aarch64) NO_UNALIGNED_ACCESS=1 ;;
-       mips*) NO_UNALIGNED_ACCESS=1 ;;
-       tile*) NO_UNALIGNED_ACCESS=1 ;;
-       *)
+AS_CASE([$host_cpu],
+       [i[[3456]]86], [],
+       [x86_64], [],
+       [amd64], [],
+       [powerpc], [],
+       [ppc64], [],
+       [ppc64le], [],
+       [powerpc64], [],
+       [powerpc64le], [],
+       [s390], [NO_UNALIGNED_ACCESS=1],
+       [s390x], [NO_UNALIGNED_ACCESS=1],
+       [arm*], [NO_UNALIGNED_ACCESS=1],
+       [aarch64], [NO_UNALIGNED_ACCESS=1],
+       [mips*], [NO_UNALIGNED_ACCESS=1],
+       [tile*], [NO_UNALIGNED_ACCESS=1],
+       [
                UNSUPPORTED_ARCH=1
                NO_UNALIGNED_ACCESS=1
-               ;;
-esac
+       ])
 AC_MSG_RESULT([$host_cpu])
 
-if test x$NO_UNALIGNED_ACCESS = x ; then
-AC_DEFINE([LTTNG_UST_HAVE_EFFICIENT_UNALIGNED_ACCESS], [1])
-fi
+AS_IF([test "x$NO_UNALIGNED_ACCESS" = "x"], [
+       AC_DEFINE([LTTNG_UST_HAVE_EFFICIENT_UNALIGNED_ACCESS], [1])
+])
 
 # Check for JNI header files if requested
 AC_ARG_ENABLE([jni-interface],
@@ -287,30 +276,30 @@ AM_CONDITIONAL([BUILD_JAVA_AGENT], [test "x$java_agent_jul" = "xyes" || test "x$
 AM_CONDITIONAL([BUILD_JAVA_AGENT_WITH_JUL], [test "x$java_agent_jul" = "xyes"])
 AM_CONDITIONAL([BUILD_JAVA_AGENT_WITH_LOG4J], [test "x$java_agent_log4j" = "xyes"])
 
-if test "x$jni_interface" = "xyes" || test "x$java_agent_jul" = "xyes" || test "x$java_agent_log4j" = "xyes"; then
-  AX_JAVA_OPTIONS
-  AX_PROG_JAVAC
-  AX_PROG_JAVA
-  AX_PROG_JAR
+AS_IF([test "x$jni_interface" = "xyes" || test "x$java_agent_jul" = "xyes" || test "x$java_agent_log4j" = "xyes"], [
+       AX_JAVA_OPTIONS
+       AX_PROG_JAVAC
+       AX_PROG_JAVA
+       AX_PROG_JAR
 
-  AX_JNI_INCLUDE_DIR
-  for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
-  do
-       CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
-  done
+       AX_JNI_INCLUDE_DIR
+       for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+       do
+               CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
+       done
 
-  AX_PROG_JAVAH
-fi
+       AX_PROG_JAVAH
+])
 
-if test "x$java_agent_log4j" = "xyes"; then
-  AX_CHECK_CLASSPATH
+AS_IF([test "x$java_agent_log4j" = "xyes"], [
+       AX_CHECK_CLASSPATH
 
-  AX_CHECK_CLASS(org.apache.log4j.Logger)
+       AX_CHECK_CLASS([org.apache.log4j.Logger])
 
-  if test "x$ac_cv_class_org_apache_log4j_Logger" = "xno"; then
-     AC_MSG_ERROR([The UST Java agent support for log4j was requested but the Log4j classes were not found. Please specify the location of the Log4j jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/log4j.jar"])
-  fi
-fi
+       AS_IF([test "x$ac_cv_class_org_apache_log4j_Logger" = "xno"], [
+               AC_MSG_ERROR([The UST Java agent support for log4j was requested but the Log4j classes were not found. Please specify the location of the Log4j jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/log4j.jar"])
+       ])
+])
 
 # Option to build the python agent
 AC_ARG_ENABLE([python-agent],
@@ -319,6 +308,9 @@ AC_ARG_ENABLE([python-agent],
        [:]
 )
 AM_CONDITIONAL([BUILD_PYTHON_AGENT], [test "x$python_agent" = "xyes"])
+AS_IF([test "x$python_agent" = "xyes"], [
+       AM_PATH_PYTHON([2.7])
+])
 
 # sdt.h integration
 AC_ARG_WITH([sdt],
@@ -364,7 +356,7 @@ AC_DEFINE_UNQUOTED([LTTNG_SYSTEM_RUNDIR], ["$lttng_system_rundir"],
        [LTTng system runtime directory])
 
 AC_CHECK_PROG([BUILD_GEN_TP_EXAMPLES],[python],["yes"])
-AM_CONDITIONAL([BUILD_GEN_TP_EXAMPLES], [test $BUILD_GEN_TP_EXAMPLES], [Build examples requiring lttng-gen-tp])
+AM_CONDITIONAL([BUILD_GEN_TP_EXAMPLES], [test "x$BUILD_GEN_TP_EXAMPLES" = "xyes"])
 
 AC_CONFIG_FILES([
        Makefile
@@ -386,54 +378,69 @@ AC_CONFIG_FILES([
        liblttng-ust-java-agent/java/lttng-ust-agent-jul/Makefile
        liblttng-ust-java-agent/java/lttng-ust-agent-log4j/Makefile
        liblttng-ust-java-agent/jni/Makefile
+       liblttng-ust-java-agent/jni/common/Makefile
        liblttng-ust-java-agent/jni/jul/Makefile
        liblttng-ust-java-agent/jni/log4j/Makefile
        liblttng-ust-libc-wrapper/Makefile
        liblttng-ust-cyg-profile/Makefile
        liblttng-ust-python-agent/Makefile
+       python-lttngust/Makefile
+       python-lttngust/setup.py
+       python-lttngust/lttngust/__init__.py
        tools/Makefile
        tests/Makefile
+       tests/ctf-types/Makefile
        tests/hello/Makefile
        tests/hello.cxx/Makefile
        tests/same_line_tracepoint/Makefile
        tests/snprintf/Makefile
+       tests/ust-elf/Makefile
        tests/benchmark/Makefile
        tests/utils/Makefile
+       tests/test-app-ctx/Makefile
        lttng-ust.pc
 ])
 
+# Create link for python agent for the VPATH guru.
+AC_CONFIG_LINKS([
+       python-lttngust/lttngust/agent.py:python-lttngust/lttngust/agent.py
+       python-lttngust/lttngust/cmd.py:python-lttngust/lttngust/cmd.py
+       python-lttngust/lttngust/debug.py:python-lttngust/lttngust/debug.py
+       python-lttngust/lttngust/loghandler.py:python-lttngust/lttngust/loghandler.py
+])
+
 AC_OUTPUT
 
+AS_ECHO(["m4_bpatsubst(V_NAME, ["], [\\"])"])
 AS_ECHO()
-AS_ECHO("Version name: $version_name")
-AS_ECHO("$version_description")
+AS_ECHO(["m4_bpatsubst(V_DESC, ["], [\\"])"])
 
 # Report on the configuration options
 AS_ECHO()
-AS_ECHO("LTTng-UST will be built with the following options:")
+AS_ECHO(["LTTng-UST will be built with the following options:"])
 
 AS_ECHO()
 
-AS_ECHO_N("Java agent (JUL support): ")
-AS_IF([test "x$java_agent_jul" = "xyes"], [AS_ECHO("Enabled")], [AS_ECHO("Disabled")])
+AS_ECHO_N(["Java agent (JUL support): "])
+AS_IF([test "x$java_agent_jul" = "xyes"], [AS_ECHO(["Enabled"])], [AS_ECHO(["Disabled"])])
 
-AS_ECHO_N("Java agent (Log4j support): ")
-AS_IF([test "x$java_agent_log4j" = "xyes"], [AS_ECHO("Enabled")], [AS_ECHO("Disabled")])
+AS_ECHO_N(["Java agent (Log4j support): "])
+AS_IF([test "x$java_agent_log4j" = "xyes"], [AS_ECHO(["Enabled"])], [AS_ECHO(["Disabled"])])
 
-AS_ECHO_N("JNI interface (JNI): ")
-AS_IF([test "x$jni_interface" = "xyes"], [AS_ECHO("Enabled")], [AS_ECHO("Disabled")])
+AS_ECHO_N(["JNI interface (JNI): "])
+AS_IF([test "x$jni_interface" = "xyes"], [AS_ECHO(["Enabled"])], [AS_ECHO(["Disabled"])])
 
-AS_ECHO_N("Python agent: ")
-AS_IF([test "x$python_agent" = "xyes"], [AS_ECHO("Enabled")], [AS_ECHO("Disabled")])
+AS_ECHO_N(["Python ($PYTHON) agent: "])
+AS_IF([test "x$python_agent" = "xyes"], [AS_ECHO(["Enabled"])], [AS_ECHO(["Disabled"])])
 
-AS_ECHO_N("sdt.h integration: ")
-AS_IF([test "x$with_sdt" = "xyes"], [AS_ECHO("Enabled")], [AS_ECHO("Disabled")])
+AS_ECHO_N(["sdt.h integration: "])
+AS_IF([test "x$with_sdt" = "xyes"], [AS_ECHO(["Enabled"])], [AS_ECHO(["Disabled"])])
 
-AS_ECHO("Architecture: $host_cpu")
-AS_ECHO_N("Efficient unaligned memory access: ")
-AS_IF([test "x$NO_UNALIGNED_ACCESS" != "x1"], [AS_ECHO("yes")], [AS_IF([test "x$UNSUPPORTED_ARCH" != "x1"], [AS_ECHO("no")], [AS_ECHO("unknown")])])
+AS_ECHO(["Architecture: $host_cpu"])
+AS_ECHO_N(["Efficient unaligned memory access: "])
+AS_IF([test "x$NO_UNALIGNED_ACCESS" != "x1"], [AS_ECHO(["yes"])], [AS_IF([test "x$UNSUPPORTED_ARCH" != "x1"], [AS_ECHO(["no"])], [AS_ECHO(["unknown"])])])
 AS_IF([test "x$UNSUPPORTED_ARCH" = "x1"], [AC_MSG_WARN([Your architecture ($host_cpu) is unsupported, using safe default of no unaligned access])])
 AS_ECHO()
 
-AS_ECHO("Type 'make' to compile.")
+AS_ECHO(["Type 'make' to compile."])
 
This page took 0.031451 seconds and 4 git commands to generate.