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, only build the ltt trace reading library
34 AS_HELP_STRING([--with-lttv],
35 [build whole LTTV system, as opposd to only the trace reading library [[default=yes]]]),
36 [with_lttv="$withval"],
39 # If we've requested the lib only, turn off the lttv-gui building as well
40 AS_IF([test "x$with_lttv" = "xno"], [with_lttv_gui="no"])
42 AM_CONDITIONAL([BUILD_LIB_ONLY], [ test "x$with_lttv" = "xno" ])
45 # If requested, avoid building LTTV part
47 AS_HELP_STRING([--with-lttv-gui],
48 [build LTTV gui, as opposed to only build textmode LTTV [[default=yes]]]),
49 [with_lttv_gui="$withval"],
50 [with_lttv_gui="yes"])
52 AM_CONDITIONAL([BUILD_LTTV_GUI], [ test "x$with_lttv_gui" = "xyes" ])
54 AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR([glib is required in order to compile LTTV]) , gmodule)
56 # GTK is only needed by the GUI
57 AS_IF([test "x$with_lttv_gui" = "xyes"],[
58 AM_PATH_GTK_2_0(2.4.0, , AC_MSG_ERROR([GTK 2 is required in order to compile the LTTV GUI]) , gmodule)
61 AC_PATH_PROGS(BASH, bash)
65 # Checks for programs.
68 # Checks for libraries.
69 AC_CHECK_LIB([popt], [poptGetNextOpt], [],
70 AC_MSG_ERROR([libpopt is required in order to compile LTTV])
72 AC_CHECK_LIB([m], [round], [],
73 AC_MSG_ERROR([Mathematical libraries are missing.])
75 AC_CHECK_LIB([util], [forkpty], [],
76 AC_MSG_ERROR([libutil is required in order to compile LTTV])
79 # Trace synchronization feature, which requires libglpk
80 AC_ARG_WITH([trace-sync],
81 AS_HELP_STRING([--with-trace-sync],
82 [support trace synchronization accuracy calculation (needs libglpk) [default=no]]),
83 [with_trace_sync="$withval"],
84 [with_trace_sync="no"])
86 AS_IF([test "x$with_trace_sync" = "xyes"],[
87 AC_CHECK_LIB([glpk], [glp_create_prob], [], [
88 AC_MSG_ERROR([The trace synchronization feature requires libglpk, please install it first.])
90 AC_DEFINE([HAVE_LIBGLPK], [1], [Define if you have libglpk]),
94 # Checks for header files.
96 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h pthread.h])
98 # Check for JNI header files if requested
99 AC_ARG_WITH(jni-interface,
100 AS_HELP_STRING([--with-jni-interface],
101 [build JNI interface between C and Java. Needs JNI header file. [[default=no]]]),
102 [with_jni_interface="$withval"],
103 [with_jni_interface="no"])
105 AS_IF([test "x$with_jni_interface" = "xyes"],[
106 AC_CHECK_HEADERS([jni.h], [], AC_MSG_ERROR([missing jni.h
107 Make sure Sun Java or OpenJDK or GCJ is installed and that this header file exists in the system path.
108 Use CFLAGS=-I/path/ to specify a non-standard path or disable the JNI interface.]))
110 AM_CONDITIONAL([BUILD_JNI_INTERFACE], [ test "$with_jni_interface" = "yes" ] )
113 # If we want the gui, we need additionnal flags for GTK
114 AS_IF([test "x$with_lttv_gui" = "xyes"],[
115 pkg_modules="gtk+-2.0 >= 2.0.0"
116 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
119 pkg_modules="gmodule-2.0 >= 2.0.0"
120 PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
122 pkg_modules="gobject-2.0 >= 2.0.0"
123 PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
125 # Todo add test for babeltrace pkg-config
126 BABELTRACE_LIBS="-lbabeltrace -lbabeltrace-ctf"
128 LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS $BABELTRACE_LIBS"
129 PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat-security"
131 MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
132 MODULE_LDFLAGS="-module -avoid-version"
133 AC_SUBST([PACKAGE_CFLAGS])
134 AC_SUBST(PACKAGE_LIBS)
135 AC_SUBST([MODULE_CFLAGS])
136 AC_SUBST([MODULE_LDFLAGS])
138 # Checks for typedefs, structures, and compiler characteristics.
146 # Checks for library functions.
147 AC_FUNC_ERROR_AT_LINE
148 AC_FUNC_SELECT_ARGTYPES
149 AC_CHECK_FUNCS([select])
151 AC_ARG_ENABLE(lttvstatic,
152 AS_HELP_STRING([--enable-lttvstatic],
153 [build a statically linked executable [[default=no]]]),
154 [lttvstatic="$enableval"],
156 AM_CONDITIONAL([LTTVSTATIC], [ test "x$lttvstatic" = "xyes" ] )
158 lttvlibdir="${libdir}/lttv"
159 lttvplugindir="${lttvlibdir}/plugins"
160 #lttlibdir="${libdir}/ltt"
161 top_lttvdir="\$(top_srcdir)/lttv"
162 top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow"
164 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)"
166 lttincludedir="${includedir}/ltt"
167 lttvincludedir="${includedir}/lttv"
168 lttvwindowincludedir="${includedir}/lttvwindow"
169 lttctlincludedir="${includedir}/liblttctl"
172 AC_SUBST(lttvplugindir)
174 AC_SUBST(top_lttvdir)
175 AC_SUBST(top_lttvwindowdir)
176 AC_SUBST(DEFAULT_INCLUDES)
177 AC_SUBST(lttincludedir)
178 AC_SUBST(lttvincludedir)
179 AC_SUBST(lttvwindowincludedir)
180 AC_SUBST(lttctlincludedir)
182 AC_CONFIG_FILES([Makefile
185 lttv/lttv/sync/Makefile
186 lttv/modules/Makefile
187 lttv/modules/text/Makefile
188 lttv/modules/gui/Makefile
189 lttv/modules/gui/lttvwindow/Makefile
190 lttv/modules/gui/interrupts/Makefile
191 lttv/modules/gui/lttvwindow/lttvwindow/Makefile
192 lttv/modules/gui/lttvwindow/pixmaps/Makefile
193 lttv/modules/gui/controlflow/Makefile
194 lttv/modules/gui/detailedevents/Makefile
195 lttv/modules/gui/statistics/Makefile
196 lttv/modules/gui/histogram/Makefile
197 lttv/modules/gui/filter/Makefile
198 lttv/modules/gui/tracecontrol/Makefile
199 lttv/modules/gui/resourceview/Makefile
202 doc/developer/Makefile
203 doc/developer/developer_guide/Makefile
204 doc/developer/developer_guide/docbook/Makefile
205 doc/developer/developer_guide/html/Makefile
207 doc/user/user_guide/Makefile
208 doc/user/user_guide/docbook/Makefile
209 doc/user/user_guide/html/Makefile])
213 # Report on what will be built
215 AS_ECHO("The following components will be built:")
216 AS_ECHO("LTT trace reading library: Enabled") # It's always enabled!
218 AS_ECHO_N("LTTV command line tool: ")
219 AS_IF([test "x$with_lttv" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
221 AS_ECHO_N("LTTV graphical interface: ")
222 AS_IF([test "x$with_lttv_gui" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
224 AS_ECHO_N("Trace synchronization: ")
225 AS_IF([test "x$with_trace_sync" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
227 AS_ECHO_N("Java (JNI) interface: ")
228 AS_IF([test "x$with_jni_interface" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
231 AS_ECHO_N("Statically linked executable: ")
232 AS_IF([test "x$lttvstatic" = "xyes"],[AS_ECHO("Yes")],[AS_ECHO("No")])
235 AS_ECHO("Type 'make' to build LTTV.")