Modify buildsystem to be able to compile with installed libraries
[lttng-ust.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 #AC_PREREQ([2.63])
5 AC_INIT([ust], [0.0], [pierre-marc dot fournier at polymtl dot ca])
6 AC_CONFIG_AUX_DIR(make_scripts)
7 AM_INIT_AUTOMAKE([0.0 foreign])
8 AC_CONFIG_SRCDIR([ust/localerr.h])
9 AC_CONFIG_HEADERS([config.h])
10
11 # Checks for programs.
12 AC_PROG_CC
13 AC_PROG_MAKE_SET
14 AC_PROG_LIBTOOL
15
16 ## Checks for libraries.
17 ## FIXME: Replace `main' with a function in `-ldl':
18 #AC_CHECK_LIB([dl], [main])
19 ## FIXME: Replace `main' with a function in `-lmarkers':
20 #AC_CHECK_LIB([markers], [main])
21 ## FIXME: Replace `main' with a function in `-lpthread':
22 #AC_CHECK_LIB([pthread], [main])
23 ## FIXME: Replace `main' with a function in `-ltracectl':
24 #AC_CHECK_LIB([tracectl], [main])
25 ## FIXME: Replace `main' with a function in `-ltracing':
26 #AC_CHECK_LIB([tracing], [main])
27 ## FIXME: Replace `main' with a function in `-lurcu':
28 #AC_CHECK_LIB([urcu], [main])
29
30 # Checks for header files.
31 #AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
32
33 # Checks for typedefs, structures, and compiler characteristics.
34 AC_C_INLINE
35 #AC_TYPE_INT16_T
36 #AC_TYPE_INT32_T
37 #AC_TYPE_INT64_T
38 #AC_TYPE_INT8_T
39 #AC_TYPE_PID_T
40 #AC_TYPE_SIZE_T
41 #AC_TYPE_SSIZE_T
42 #AC_TYPE_UINT16_T
43 #AC_TYPE_UINT32_T
44 #AC_TYPE_UINT64_T
45 #AC_TYPE_UINT8_T
46 #AC_CHECK_TYPES([ptrdiff_t])
47
48 # Checks for library functions.
49 AC_FUNC_MALLOC
50 AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol])
51
52 KCOMPAT_PATH=
53 AC_ARG_WITH(kcompat, [ --with-kcompat path Path to userspace kcompat source], [
54 AC_CHECK_FILE(["$withval/kcompat.h"], KCOMPAT_PATH="$withval", [
55 AC_MSG_ERROR([Cannot find kcompat.h in kcompat directory])
56 ])
57 ])
58 if test -n "${KCOMPAT_PATH}" ; then
59 CPPFLAGS="-I$KCOMPAT_PATH/ $CPPFLAGS"
60 AC_SUBST(CPPFLAGS)
61 fi
62 AC_CHECK_HEADER([kcompat.h], , AC_MSG_ERROR([Must specify kcompat path.]))
63 AC_SUBST(KCOMPAT_PATH)
64
65 URCU_LIB=
66 AC_CHECK_HEADER([urcu.h], [
67 AC_CHECK_LIB(urcu, synchronize_rcu, [
68 URCU_PATH=
69 URCU_LIB="-lurcu"
70 ])
71 ])
72 AC_ARG_WITH(urcu, [ --with-urcu path Path to userspace RCU source], [
73 AC_CHECK_FILE(["$withval/urcu.h"], [
74 URCU_PATH="$withval"
75 URCU_LIB="/liburcu.la" ],
76 AC_MSG_ERROR([Cannot find urcu.h in urcu directory]))
77 ])
78 if test -z "${URCU_LIB}" ; then
79 AC_MSG_ERROR([Must specify urcu path.])
80 fi
81 AC_SUBST(URCU_PATH)
82 AC_SUBST(URCU_LIB)
83
84 #AC_CONFIG_FILES([Makefile
85 # hello/Makefile
86 # libmallocwrap/Makefile
87 # libmarkers/Makefile
88 # libtracectl/Makefile
89 # libtracing/Makefile
90 # ust/Makefile
91 # ustd/Makefile])
92
93 AC_CONFIG_FILES([Makefile libust/Makefile hello/Makefile libmallocwrap/Makefile ustd/Makefile ust/Makefile])
94 AC_OUTPUT
This page took 0.039782 seconds and 5 git commands to generate.