1 # This file is part of the Linux Trace Toolkit viewer
2 # Copyright (C) 2003-2004 Mathieu Desnoyers
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;
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.
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,
21 # Process this file with autoconf to produce a configure script.
24 AC_INIT([lttv], [0.12.38-21032011], [yannick.brosseau@gmail.com])
25 AC_CONFIG_AUX_DIR([config])
26 AC_CONFIG_MACRO_DIR([config])
27 AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
28 AM_SILENT_RULES([yes])
29 AC_CONFIG_HEADERS([config.h])
32 # If requested, avoid building LTTV part
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 #TODO ybrosseau 2012-03-13: Remove this when babeltrace port is complete
39 #Force GUI disabling while we port babeltrace
42 AM_CONDITIONAL([BUILD_LTTV_GUI], [ test "x$with_lttv_gui" = "xyes" ])
44 AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR([glib is required in order to compile LTTV]) , gmodule)
46 # GTK is only needed by the GUI
47 AS_IF([test "x$with_lttv_gui" = "xyes"],[
48 AM_PATH_GTK_2_0(2.4.0, , AC_MSG_ERROR([GTK 2 is required in order to compile the LTTV GUI]) , gmodule)
51 AC_PATH_PROGS(BASH, bash)
55 # Checks for programs.
58 # Checks for libraries.
59 AC_CHECK_LIB([popt], [poptGetNextOpt], [],
60 AC_MSG_ERROR([libpopt is required in order to compile LTTV])
62 AC_CHECK_LIB([m], [round], [],
63 AC_MSG_ERROR([Mathematical libraries are missing.])
65 AC_CHECK_LIB([util], [forkpty], [],
66 AC_MSG_ERROR([libutil is required in order to compile LTTV])
69 # Trace synchronization feature, which requires libglpk
70 AC_ARG_WITH([trace-sync],
71 AS_HELP_STRING([--with-trace-sync],
72 [support trace synchronization accuracy calculation (needs libglpk) [default=no]]),
73 [with_trace_sync="$withval"],
74 [with_trace_sync="no"])
76 AS_IF([test "x$with_trace_sync" = "xyes"],[
77 AC_CHECK_LIB([glpk], [glp_create_prob], [], [
78 AC_MSG_ERROR([The trace synchronization feature requires libglpk, please install it first.])
80 AC_DEFINE([HAVE_LIBGLPK], [1], [Define if you have libglpk]),
84 # Checks for header files.
86 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h pthread.h])
88 # Check for JNI header files if requested
89 AC_ARG_WITH(jni-interface,
90 AS_HELP_STRING([--with-jni-interface],
91 [build JNI interface between C and Java. Needs JNI header file. [[default=no]]]),
92 [with_jni_interface="$withval"],
93 [with_jni_interface="no"])
95 AS_IF([test "x$with_jni_interface" = "xyes"],[
96 AC_CHECK_HEADERS([jni.h], [], AC_MSG_ERROR([missing jni.h
97 Make sure Sun Java or OpenJDK or GCJ is installed and that this header file exists in the system path.
98 Use CFLAGS=-I/path/ to specify a non-standard path or disable the JNI interface.]))
100 AM_CONDITIONAL([BUILD_JNI_INTERFACE], [ test "$with_jni_interface" = "yes" ] )
103 # If we want the gui, we need additionnal flags for GTK
104 AS_IF([test "x$with_lttv_gui" = "xyes"],[
105 pkg_modules="gtk+-2.0 >= 2.0.0"
106 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
109 pkg_modules="gmodule-2.0 >= 2.0.0"
110 PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
112 pkg_modules="gobject-2.0 >= 2.0.0"
113 PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
115 PKG_CHECK_MODULES(BABELTRACE, [babeltrace >= 1.0.0])
117 AC_CHECK_LIB([babeltrace], [bt_iter_equals_pos],
118 [AC_DEFINE([HAVE_BT_ITER_EQUALS_POS],[],[Have equal function])], [])
122 LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS $BABELTRACE_LIBS"
123 PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat-security"
125 MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
126 MODULE_LDFLAGS="-module -avoid-version"
127 AC_SUBST([PACKAGE_CFLAGS])
128 AC_SUBST(PACKAGE_LIBS)
129 AC_SUBST([MODULE_CFLAGS])
130 AC_SUBST([MODULE_LDFLAGS])
132 # Checks for typedefs, structures, and compiler characteristics.
140 # Checks for library functions.
141 AC_FUNC_ERROR_AT_LINE
142 AC_FUNC_SELECT_ARGTYPES
143 AC_CHECK_FUNCS([select])
145 AC_ARG_ENABLE(lttvstatic,
146 AS_HELP_STRING([--enable-lttvstatic],
147 [build a statically linked executable [[default=no]]]),
148 [lttvstatic="$enableval"],
150 AM_CONDITIONAL([LTTVSTATIC], [ test "x$lttvstatic" = "xyes" ] )
152 lttvlibdir="${libdir}/lttv"
153 lttvplugindir="${lttvlibdir}/plugins"
154 #lttlibdir="${libdir}/ltt"
155 top_lttvdir="\$(top_srcdir)/lttv"
156 top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow"
158 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)"
160 lttincludedir="${includedir}/ltt"
161 lttvincludedir="${includedir}/lttv"
162 lttvwindowincludedir="${includedir}/lttvwindow"
163 lttctlincludedir="${includedir}/liblttctl"
166 AC_SUBST(lttvplugindir)
168 AC_SUBST(top_lttvdir)
169 AC_SUBST(top_lttvwindowdir)
170 AC_SUBST(DEFAULT_INCLUDES)
171 AC_SUBST(lttincludedir)
172 AC_SUBST(lttvincludedir)
173 AC_SUBST(lttvwindowincludedir)
174 AC_SUBST(lttctlincludedir)
178 AC_CONFIG_FILES([Makefile
181 lttv/lttv/sync/Makefile
182 lttv/modules/Makefile
183 lttv/modules/text/Makefile
184 lttv/modules/gui/Makefile
185 lttv/modules/gui/lttvwindow/Makefile
186 lttv/modules/gui/interrupts/Makefile
187 lttv/modules/gui/lttvwindow/lttvwindow/Makefile
188 lttv/modules/gui/lttvwindow/pixmaps/Makefile
189 lttv/modules/gui/controlflow/Makefile
190 lttv/modules/gui/detailedevents/Makefile
191 lttv/modules/gui/statistics/Makefile
192 lttv/modules/gui/histogram/Makefile
193 lttv/modules/gui/filter/Makefile
194 lttv/modules/gui/tracecontrol/Makefile
195 lttv/modules/gui/resourceview/Makefile
197 doc/developer/Makefile
198 doc/developer/developer_guide/Makefile
199 doc/developer/developer_guide/docbook/Makefile
200 doc/developer/developer_guide/html/Makefile
202 doc/user/user_guide/Makefile
203 doc/user/user_guide/docbook/Makefile
204 doc/user/user_guide/html/Makefile])
208 # Report on what will be built
210 AS_ECHO("The following components will be built:")
211 AS_ECHO("LTT trace reading library: Enabled") # It's always enabled!
213 AS_ECHO_N("LTTV command line tool: ")
214 AS_IF([test "x$with_lttv" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
216 AS_ECHO_N("LTTV graphical interface: ")
217 AS_IF([test "x$with_lttv_gui" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
219 AS_ECHO_N("Trace synchronization: ")
220 AS_IF([test "x$with_trace_sync" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
222 AS_ECHO_N("Java (JNI) interface: ")
223 AS_IF([test "x$with_jni_interface" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
226 AS_ECHO_N("Statically linked executable: ")
227 AS_IF([test "x$lttvstatic" = "xyes"],[AS_ECHO("Yes")],[AS_ECHO("No")])
230 AS_ECHO("Type 'make' to build LTTV.")