AM_SILENT_RULES([yes])
+## ##
+## OS and Arch specific defaults ##
+## ##
+
+# Set os specific options
+AS_CASE([$host_os],
+ [freebsd*], [NO_NUMA=1]
+)
+
+# Set architecture specific options
+AS_CASE([$host_cpu],
+ [i[[3456]]86], [],
+ [x86_64], [],
+ [amd64], [],
+ [powerpc], [],
+ [ppc64], [],
+ [ppc64le], [],
+ [powerpc64], [],
+ [powerpc64le], [],
+ [s390], [],
+ [s390x], [],
+ [arm*], [
+ NO_NUMA=1
+ ],
+ [aarch64*], [],
+ [mips*], [],
+ [tile*], [],
+ [
+ unsupported_arch="yes"
+ ])
+
+
## ##
## C compiler checks ##
## ##
])
-# Checks for programs.
+## ##
+## Programs checks ##
+## ##
+
AM_PROG_AR
AC_PROG_SED
AC_PROG_GREP
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_MAKE_SET
-AC_CHECK_PROG([CMAKE], [cmake])
-AM_CONDITIONAL([HAVE_CMAKE], [test "x$CMAKE" != "x"])
+AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
+AC_CHECK_PROGS([CMAKE], [cmake])
+AC_CHECK_PROGS([FOLD], [fold])
+AC_CHECK_PROGS([XMLTO], [xmlto])
-# libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
-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
-])
+AM_PATH_PYTHON([2.7], [], [PYTHON=""])
-AS_IF([test "x$libtool_fixup" = "xyes"], [
- libtool_m4="$srcdir/m4/libtool.m4"
- libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)"
- AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4])
- libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4)
+AX_PROG_JAVAC
+AX_PROG_JAVA
+AX_PROG_JAR
- AS_IF([test $libtool_flag_pattern_count -ne 0], [
- AC_MSG_RESULT([$libtool_flag_pattern_count])
- AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown])
- $SED -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4
- ], [
- AC_MSG_RESULT([none])
- ])
-])
+# Initialize and configure libtool
LT_INIT([disable-static])
-AC_MSG_CHECKING([whether shared libraries are enabled])
-AS_IF([test "x$enable_shared" = "xyes"], [
- AC_MSG_RESULT([yes])
-], [
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([LTTng-UST requires shared libraries to be enabled])
-])
-# Checks for library functions.
+## ##
+## Library checks ##
+## ##
+
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_MMAP
-AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_FUNC_STRNLEN
AC_CHECK_FUNCS([ \
- atexit \
- clock_gettime \
- ftruncate \
- getpagesize \
- gettimeofday \
- localeconv \
- memchr \
- memmove \
- memset \
- mkdir \
- munmap \
- realpath \
- sched_getcpu \
- socket \
- strchr \
- strdup \
- strerror \
- strtol \
- strtoul \
- sysconf \
+ atexit \
+ clock_gettime \
+ ftruncate \
+ getpagesize \
+ gettimeofday \
+ localeconv \
+ memchr \
+ memmove \
+ memset \
+ mkdir \
+ munmap \
+ realpath \
+ sched_getcpu \
+ socket \
+ strchr \
+ strdup \
+ strerror \
+ strtol \
+ strtoul \
+ sysconf \
])
+# AC_FUNC_MALLOC causes problems when cross-compiling.
+#AC_FUNC_MALLOC
+#AC_FUNC_REALLOC
+
# Check for pthread_setname_np and its signature
LTTNG_PTHREAD_SETNAME_NP
LTTNG_PTHREAD_GETNAME_NP
-# AC_FUNC_MALLOC causes problems when cross-compiling.
-#AC_FUNC_MALLOC
+# Check dor dlopen() in -ldl or -lc
+AC_CHECK_LIB([dl], [dlopen], [
+ libdl_name=dl
+ DL_LIBS="-ldl"
+], [
+ # dlopen not found in libdl, check in libc
+ AC_CHECK_LIB([c], [dlopen], [
+ libdl_name=c
+ DL_LIBS="-lc"
+ ], [
+ AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
+ ])
+])
+AC_SUBST(DL_LIBS)
-# Set architecture specific options
-AS_CASE([$host_cpu],
- [i[[3456]]86], [],
- [x86_64], [],
- [amd64], [],
- [powerpc], [],
- [ppc64], [],
- [ppc64le], [],
- [powerpc64], [],
- [powerpc64le], [],
- [s390], [],
- [s390x], [],
- [arm*], [
- NO_NUMA=1
- ],
- [aarch64*], [],
- [mips*], [],
- [tile*], [],
- [
- UNSUPPORTED_ARCH=1
- ])
+# Check if libdl has dlmopen()
+AC_CHECK_LIB([$libdl_name], [dlmopen], [
+ AC_DEFINE([HAVE_DLMOPEN], [1], [Define to 1 if dlmopen is available.])
+])
-# Set os specific options
-AS_CASE([$host_os],
- [freebsd*], [NO_NUMA=1]
-)
+# Require URCU >= 0.12 for DEFINE_URCU_TLS_INIT
+PKG_CHECK_MODULES([URCU], [liburcu >= 0.12])
-# Configuration options, which will be installed in the config.h
-AH_TEMPLATE([LTTNG_UST_HAVE_SDT_INTEGRATION], [SystemTap integration via sdt.h])
-# Checks for libraries.
-AC_CHECK_LIB([dl], [dlopen], [
- libdl_name=dl
- DL_LIBS="-ldl"
+AM_CONDITIONAL([HAVE_CMAKE], [test "x$CMAKE" != "x"])
+
+AC_MSG_CHECKING([whether shared libraries are enabled])
+AS_IF([test "x$enable_shared" = "xyes"], [
+ AC_MSG_RESULT([yes])
], [
- #libdl not found, check for dlopen in libc.
- AC_CHECK_LIB([c], [dlopen], [
- libdl_name=c
- DL_LIBS="-lc"
- ], [
- AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
- ])
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([LTTng-UST requires shared libraries to be enabled])
])
-AC_SUBST(DL_LIBS)
-# Check if libdl has dlmopen support.
-AH_TEMPLATE([HAVE_DLMOPEN], ["Define to 1 if dlmopen is available."])
-AC_CHECK_LIB([$libdl_name], [dlmopen],
- [AC_DEFINE([HAVE_DLMOPEN], [1])]
-)
+# Configuration options, which will be installed in the config.h
+AH_TEMPLATE([LTTNG_UST_HAVE_SDT_INTEGRATION], [SystemTap integration via sdt.h])
-AM_CONDITIONAL([ENABLE_UST_DL], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])
-# Require URCU >= 0.12 for DEFINE_URCU_TLS_INIT
-PKG_CHECK_MODULES([URCU], [liburcu >= 0.12])
+AM_CONDITIONAL([ENABLE_UST_DL], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])
# numa.h integration
AS_IF([test "x$NO_NUMA" = "x1"],[
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
AC_ARG_VAR([CLASSPATH], [Java class path])
AX_JNI_INCLUDE_DIR
python_agent=$enableval
], [:])
AM_CONDITIONAL([ENABLE_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], [
AC_DEFINE_UNQUOTED([LTTNG_SYSTEM_RUNDIR], ["$lttng_system_rundir"],
[LTTng system runtime directory])
-AC_CHECK_PROG([ENABLE_GEN_TP_EXAMPLES], [python], ["yes"])
-AM_CONDITIONAL([ENABLE_GEN_TP_EXAMPLES], [test "x$ENABLE_GEN_TP_EXAMPLES" = "xyes"])
+AM_CONDITIONAL([ENABLE_GEN_TP_EXAMPLES], [test "x$PYTHON" != "x"])
# Enable building examples
AC_ARG_ENABLE(
warn_prebuilt_man_pages=no
AS_IF([test "x$man_pages_opt" = "xyes"], [
- AC_PATH_PROG([ASCIIDOC], [asciidoc], [no])
- AC_PATH_PROG([XMLTO], [xmlto], [no])
-
- AS_IF([test "x$ASCIIDOC" = "xno" || test "x$XMLTO" = "xno"], [
+ AS_IF([test "x$ASCIIDOC" = "x" || test "x$XMLTO" = "x"], [
AE_IF_IN_GIT_REPO([
# This is an error because we're in the Git repo, which
# means the man pages are not already generated for us,
PPRINT_PROP_STRING([Target architecture], $host_cpu)
-AS_IF([test "x$UNSUPPORTED_ARCH" = "x1"],[
+AS_IF([test "x$unsupported_arch" = "xyes"],[
PPRINT_WARN([Your architecture ($host_cpu) is unsupported, using safe default of no unaligned access.])
])