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], [1.5-beta1], [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"])
39 AM_CONDITIONAL([BUILD_LTTV_GUI], [ test "x$with_lttv_gui" = "xyes" ])
41 AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR([glib is required in order to compile LTTV]) , gmodule)
43 # GTK is only needed by the GUI
44 AS_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)
48 AC_PATH_PROGS(BASH, bash)
52 # Checks for programs.
55 # Checks for libraries.
56 AC_CHECK_LIB([popt], [poptGetNextOpt], [],
57 AC_MSG_ERROR([libpopt is required in order to compile LTTV])
59 AC_CHECK_LIB([m], [round], [],
60 AC_MSG_ERROR([Mathematical libraries are missing.])
62 AC_CHECK_LIB([util], [forkpty], [],
63 AC_MSG_ERROR([libutil is required in order to compile LTTV])
66 # Trace synchronization feature, which requires libglpk
67 AC_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"])
73 AS_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.])
77 AC_DEFINE([HAVE_LIBGLPK], [1], [Define if you have libglpk]),
81 # Checks for header files.
83 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h pthread.h])
86 # If we want the gui, we need additionnal flags for GTK
87 AS_IF([test "x$with_lttv_gui" = "xyes"],[
88 pkg_modules="gtk+-2.0 >= 2.0.0"
89 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
92 pkg_modules="gmodule-2.0 >= 2.0.0"
93 PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
95 pkg_modules="gobject-2.0 >= 2.0.0"
96 PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
98 PKG_CHECK_MODULES(BABELTRACE, [babeltrace >= 1.1.0], [],
99 [AC_CHECK_LIB([babeltrace], [bt_context_create], [],
100 [AC_MSG_ERROR([Cannot find the babeltrace library.])]
103 # Check for libbabeltrace-ctf
104 AC_CHECK_LIB([babeltrace-ctf], [bt_ctf_iter_create], [],
105 [AC_MSG_ERROR([Cannot find the babeltrace-ctf library.])]
109 AC_CHECK_LIB([babeltrace], [bt_iter_equals_pos],
110 [AC_DEFINE([HAVE_BT_ITER_EQUALS_POS],[],[Have equal function])], [])
112 AC_CHECK_LIB([babeltrace-ctf], [bt_ctf_event_name],
113 [], [AC_MSG_ERROR([libbabeltrace-ctf is required in order to compile LTTV])])
115 LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS $BABELTRACE_LIBS"
116 PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat-security"
118 MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
119 MODULE_LDFLAGS="-module -avoid-version"
120 AC_SUBST([PACKAGE_CFLAGS])
121 AC_SUBST(PACKAGE_LIBS)
122 AC_SUBST([MODULE_CFLAGS])
123 AC_SUBST([MODULE_LDFLAGS])
125 # Checks for typedefs, structures, and compiler characteristics.
133 # Checks for library functions.
134 AC_FUNC_ERROR_AT_LINE
135 AC_FUNC_SELECT_ARGTYPES
136 AC_CHECK_FUNCS([select])
138 AC_ARG_ENABLE(lttvstatic,
139 AS_HELP_STRING([--enable-lttvstatic],
140 [build a statically linked executable [[default=no]]]),
141 [lttvstatic="$enableval"],
143 AM_CONDITIONAL([LTTVSTATIC], [ test "x$lttvstatic" = "xyes" ] )
145 lttvlibdir="${libdir}/lttv"
146 lttvplugindir="${lttvlibdir}/plugins"
147 top_lttvdir="\$(top_srcdir)/lttv"
148 top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow"
150 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)"
152 lttvincludedir="${includedir}/lttv"
153 lttvwindowincludedir="${includedir}/lttvwindow"
154 lttctlincludedir="${includedir}/liblttctl"
157 AC_SUBST(lttvplugindir)
158 AC_SUBST(top_lttvdir)
159 AC_SUBST(top_lttvwindowdir)
160 AC_SUBST(DEFAULT_INCLUDES)
161 AC_SUBST(lttvincludedir)
162 AC_SUBST(lttvwindowincludedir)
163 AC_SUBST(lttctlincludedir)
167 AC_CONFIG_FILES([Makefile
170 lttv/modules/Makefile
171 lttv/modules/text/Makefile
172 lttv/modules/gui/Makefile
173 lttv/modules/gui/lttvwindow/Makefile
174 lttv/modules/gui/lttvwindow/lttvwindow/Makefile
175 lttv/modules/gui/lttvwindow/pixmaps/Makefile
176 lttv/modules/gui/controlflow/Makefile
177 lttv/modules/gui/detailedevents/Makefile
178 lttv/modules/gui/histogram/Makefile
179 lttv/modules/gui/resourceview/Makefile
181 doc/developer/Makefile
182 doc/developer/developer_guide/Makefile
183 doc/developer/developer_guide/docbook/Makefile
184 doc/developer/developer_guide/html/Makefile
186 doc/user/user_guide/Makefile
187 doc/user/user_guide/docbook/Makefile
188 doc/user/user_guide/html/Makefile])
189 # lttv/lttv/sync/Makefile
190 # lttv/modules/gui/interrupts/Makefile
191 # lttv/modules/gui/statistics/Makefile
192 # lttv/modules/gui/filter/Makefile
193 # lttv/modules/gui/tracecontrol/Makefile
198 # Report on what will be built
200 AS_ECHO("The following components will be built:")
202 AS_ECHO_N("LTTV command line tool: ")
203 AS_IF([test "x$with_lttv" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
205 AS_ECHO_N("LTTV graphical interface: ")
206 AS_IF([test "x$with_lttv_gui" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
208 AS_ECHO_N("Trace synchronization: ")
209 AS_IF([test "x$with_trace_sync" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
212 AS_ECHO_N("Statically linked executable: ")
213 AS_IF([test "x$lttvstatic" = "xyes"],[AS_ECHO("Yes")],[AS_ECHO("No")])
216 AS_ECHO("Type 'make' to build LTTV.")