Add a failure if libbabeltrace-ctf is not detected
[lttv.git] / configure.ac
... / ...
CommitLineData
1# This file is part of the Linux Trace Toolkit viewer
2# Copyright (C) 2003-2004 Mathieu Desnoyers
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License Version 2 as
6# published by the Free Software Foundation;
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16# MA 02111-1307, USA.
17
18
19
20# -*- Autoconf -*-
21# Process this file with autoconf to produce a configure script.
22
23AC_PREREQ(2.57)
24AC_INIT([lttv], [0.12.38-21032011], [yannick.brosseau@gmail.com])
25AC_CONFIG_AUX_DIR([config])
26AC_CONFIG_MACRO_DIR([config])
27AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
28AM_SILENT_RULES([yes])
29AC_CONFIG_HEADERS([config.h])
30LT_INIT
31
32# If requested, avoid building LTTV part
33AC_ARG_WITH(lttv-gui,
34 AS_HELP_STRING([--with-lttv-gui],
35 [build LTTV gui, as opposed to only build textmode LTTV [[default=yes]]]),
36 [with_lttv_gui="$withval"],
37 [with_lttv_gui="yes"])
38
39AM_CONDITIONAL([BUILD_LTTV_GUI], [ test "x$with_lttv_gui" = "xyes" ])
40
41AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR([glib is required in order to compile LTTV]) , gmodule)
42
43# GTK is only needed by the GUI
44AS_IF([test "x$with_lttv_gui" = "xyes"],[
45 AM_PATH_GTK_2_0(2.4.0, , AC_MSG_ERROR([GTK 2 is required in order to compile the LTTV GUI]) , gmodule)
46])
47
48AC_PATH_PROGS(BASH, bash)
49
50AC_SYS_LARGEFILE
51
52# Checks for programs.
53AC_PROG_CC
54
55# Checks for libraries.
56AC_CHECK_LIB([popt], [poptGetNextOpt], [],
57 AC_MSG_ERROR([libpopt is required in order to compile LTTV])
58)
59AC_CHECK_LIB([m], [round], [],
60 AC_MSG_ERROR([Mathematical libraries are missing.])
61)
62AC_CHECK_LIB([util], [forkpty], [],
63 AC_MSG_ERROR([libutil is required in order to compile LTTV])
64)
65
66# Trace synchronization feature, which requires libglpk
67AC_ARG_WITH([trace-sync],
68 AS_HELP_STRING([--with-trace-sync],
69 [support trace synchronization accuracy calculation (needs libglpk) [default=no]]),
70 [with_trace_sync="$withval"],
71 [with_trace_sync="no"])
72
73AS_IF([test "x$with_trace_sync" = "xyes"],[
74 AC_CHECK_LIB([glpk], [glp_create_prob], [], [
75 AC_MSG_ERROR([The trace synchronization feature requires libglpk, please install it first.])
76 ])
77 AC_DEFINE([HAVE_LIBGLPK], [1], [Define if you have libglpk]),
78])
79
80
81# Checks for header files.
82AC_HEADER_STDC
83AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h pthread.h])
84
85# Check for JNI header files if requested
86AC_ARG_WITH(jni-interface,
87 AS_HELP_STRING([--with-jni-interface],
88 [build JNI interface between C and Java. Needs JNI header file. [[default=no]]]),
89 [with_jni_interface="$withval"],
90 [with_jni_interface="no"])
91
92AS_IF([test "x$with_jni_interface" = "xyes"],[
93 AC_CHECK_HEADERS([jni.h], [], AC_MSG_ERROR([missing jni.h
94Make sure Sun Java or OpenJDK or GCJ is installed and that this header file exists in the system path.
95Use CFLAGS=-I/path/ to specify a non-standard path or disable the JNI interface.]))
96])
97AM_CONDITIONAL([BUILD_JNI_INTERFACE], [ test "$with_jni_interface" = "yes" ] )
98
99
100# If we want the gui, we need additionnal flags for GTK
101AS_IF([test "x$with_lttv_gui" = "xyes"],[
102 pkg_modules="gtk+-2.0 >= 2.0.0"
103 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
104])
105
106pkg_modules="gmodule-2.0 >= 2.0.0"
107PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
108
109pkg_modules="gobject-2.0 >= 2.0.0"
110PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
111
112PKG_CHECK_MODULES(BABELTRACE, [babeltrace >= 1.0.0])
113
114AC_CHECK_LIB([babeltrace], [bt_iter_equals_pos],
115 [AC_DEFINE([HAVE_BT_ITER_EQUALS_POS],[],[Have equal function])], [])
116
117AC_CHECK_LIB([babeltrace-ctf], [bt_ctf_event_name],
118 [], [AC_MSG_ERROR([libbabeltrace-ctf is required in order to compile LTTV])])
119
120LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS $BABELTRACE_LIBS"
121PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat-security"
122
123MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
124MODULE_LDFLAGS="-module -avoid-version"
125AC_SUBST([PACKAGE_CFLAGS])
126AC_SUBST(PACKAGE_LIBS)
127AC_SUBST([MODULE_CFLAGS])
128AC_SUBST([MODULE_LDFLAGS])
129
130# Checks for typedefs, structures, and compiler characteristics.
131AC_HEADER_STDBOOL
132AC_C_CONST
133AC_C_INLINE
134AC_TYPE_OFF_T
135AC_TYPE_SIZE_T
136AC_HEADER_TIME
137
138# Checks for library functions.
139AC_FUNC_ERROR_AT_LINE
140AC_FUNC_SELECT_ARGTYPES
141AC_CHECK_FUNCS([select])
142
143AC_ARG_ENABLE(lttvstatic,
144 AS_HELP_STRING([--enable-lttvstatic],
145 [build a statically linked executable [[default=no]]]),
146 [lttvstatic="$enableval"],
147 [lttvstatic="no"])
148AM_CONDITIONAL([LTTVSTATIC], [ test "x$lttvstatic" = "xyes" ] )
149
150lttvlibdir="${libdir}/lttv"
151lttvplugindir="${lttvlibdir}/plugins"
152#lttlibdir="${libdir}/ltt"
153top_lttvdir="\$(top_srcdir)/lttv"
154top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow"
155
156DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)"
157
158lttincludedir="${includedir}/ltt"
159lttvincludedir="${includedir}/lttv"
160lttvwindowincludedir="${includedir}/lttvwindow"
161lttctlincludedir="${includedir}/liblttctl"
162
163AC_SUBST(lttvlibdir)
164AC_SUBST(lttvplugindir)
165#AC_SUBST(lttlibdir)
166AC_SUBST(top_lttvdir)
167AC_SUBST(top_lttvwindowdir)
168AC_SUBST(DEFAULT_INCLUDES)
169AC_SUBST(lttincludedir)
170AC_SUBST(lttvincludedir)
171AC_SUBST(lttvwindowincludedir)
172AC_SUBST(lttctlincludedir)
173
174# ltt/Makefile
175
176AC_CONFIG_FILES([Makefile
177 lttv/Makefile
178 lttv/lttv/Makefile
179 lttv/lttv/sync/Makefile
180 lttv/modules/Makefile
181 lttv/modules/text/Makefile
182 lttv/modules/gui/Makefile
183 lttv/modules/gui/lttvwindow/Makefile
184 lttv/modules/gui/interrupts/Makefile
185 lttv/modules/gui/lttvwindow/lttvwindow/Makefile
186 lttv/modules/gui/lttvwindow/pixmaps/Makefile
187 lttv/modules/gui/controlflow/Makefile
188 lttv/modules/gui/detailedevents/Makefile
189 lttv/modules/gui/statistics/Makefile
190 lttv/modules/gui/histogram/Makefile
191 lttv/modules/gui/filter/Makefile
192 lttv/modules/gui/tracecontrol/Makefile
193 lttv/modules/gui/resourceview/Makefile
194 doc/Makefile
195 doc/developer/Makefile
196 doc/developer/developer_guide/Makefile
197 doc/developer/developer_guide/docbook/Makefile
198 doc/developer/developer_guide/html/Makefile
199 doc/user/Makefile
200 doc/user/user_guide/Makefile
201 doc/user/user_guide/docbook/Makefile
202 doc/user/user_guide/html/Makefile])
203
204AC_OUTPUT
205
206# Report on what will be built
207AS_ECHO()
208AS_ECHO("The following components will be built:")
209AS_ECHO("LTT trace reading library: Enabled") # It's always enabled!
210
211AS_ECHO_N("LTTV command line tool: ")
212AS_IF([test "x$with_lttv" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
213
214AS_ECHO_N("LTTV graphical interface: ")
215AS_IF([test "x$with_lttv_gui" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
216
217AS_ECHO_N("Trace synchronization: ")
218AS_IF([test "x$with_trace_sync" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
219
220AS_ECHO_N("Java (JNI) interface: ")
221AS_IF([test "x$with_jni_interface" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
222
223AS_ECHO()
224AS_ECHO_N("Statically linked executable: ")
225AS_IF([test "x$lttvstatic" = "xyes"],[AS_ECHO("Yes")],[AS_ECHO("No")])
226
227AS_ECHO()
228AS_ECHO("Type 'make' to build LTTV.")
229
This page took 0.022879 seconds and 4 git commands to generate.