Use bt_iter_equals_pos in compare function
[lttv.git] / configure.ac
CommitLineData
ce0214a6 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
9f14a497 20# -*- Autoconf -*-
21# Process this file with autoconf to produce a configure script.
22
23AC_PREREQ(2.57)
a0305332 24AC_INIT([lttv], [0.12.38-21032011], [yannick.brosseau@gmail.com])
2e589766
AM
25AC_CONFIG_AUX_DIR([config])
26AC_CONFIG_MACRO_DIR([config])
27AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
9ecb7d44 28AM_SILENT_RULES([yes])
2e589766
AM
29AC_CONFIG_HEADERS([config.h])
30LT_INIT
31
7b84cb1c 32# If requested, avoid building LTTV part
2e589766
AM
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"])
33cc9400
YB
38#TODO ybrosseau 2012-03-13: Remove this when babeltrace port is complete
39#Force GUI disabling while we port babeltrace
451aaf27 40#with_lttv_gui="no"
68d52dcc 41
2e589766 42AM_CONDITIONAL([BUILD_LTTV_GUI], [ test "x$with_lttv_gui" = "xyes" ])
68d52dcc 43
2e589766 44AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR([glib is required in order to compile LTTV]) , gmodule)
9f14a497 45
68d52dcc 46# GTK is only needed by the GUI
2e589766
AM
47AS_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)
49])
442137a6 50
065f8f41 51AC_PATH_PROGS(BASH, bash)
52
ddd2aaff 53AC_SYS_LARGEFILE
54
9f14a497 55# Checks for programs.
56AC_PROG_CC
57
58# Checks for libraries.
2e589766
AM
59AC_CHECK_LIB([popt], [poptGetNextOpt], [],
60 AC_MSG_ERROR([libpopt is required in order to compile LTTV])
61)
62AC_CHECK_LIB([m], [round], [],
63 AC_MSG_ERROR([Mathematical libraries are missing.])
64)
65AC_CHECK_LIB([util], [forkpty], [],
66 AC_MSG_ERROR([libutil is required in order to compile LTTV])
67)
68
69# Trace synchronization feature, which requires libglpk
70AC_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"])
75
76AS_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.])
79 ])
80 AC_DEFINE([HAVE_LIBGLPK], [1], [Define if you have libglpk]),
81])
82
36ea7706 83
9f14a497 84# Checks for header files.
85AC_HEADER_STDC
36ea7706 86AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h pthread.h])
9f14a497 87
68d52dcc 88# Check for JNI header files if requested
2e589766
AM
89AC_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"])
94
95AS_IF([test "x$with_jni_interface" = "xyes"],[
96 AC_CHECK_HEADERS([jni.h], [], AC_MSG_ERROR([missing jni.h
a709aa2c 97Make sure Sun Java or OpenJDK or GCJ is installed and that this header file exists in the system path.
be32e4b2 98Use CFLAGS=-I/path/ to specify a non-standard path or disable the JNI interface.]))
2e589766
AM
99])
100AM_CONDITIONAL([BUILD_JNI_INTERFACE], [ test "$with_jni_interface" = "yes" ] )
68d52dcc
WB
101
102
78608bce 103# If we want the gui, we need additionnal flags for GTK
2e589766
AM
104AS_IF([test "x$with_lttv_gui" = "xyes"],[
105 pkg_modules="gtk+-2.0 >= 2.0.0"
106 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
2e589766 107])
104325ef 108
31534155
AM
109pkg_modules="gmodule-2.0 >= 2.0.0"
110PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
111
3d55af6e
BP
112pkg_modules="gobject-2.0 >= 2.0.0"
113PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
114
fac33835
YB
115# Todo add test for babeltrace pkg-config
116BABELTRACE_LIBS="-lbabeltrace -lbabeltrace-ctf"
117
118LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS $BABELTRACE_LIBS"
2e589766 119PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat-security"
fac33835 120
104325ef
BP
121MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
122MODULE_LDFLAGS="-module -avoid-version"
123AC_SUBST([PACKAGE_CFLAGS])
2e589766 124AC_SUBST(PACKAGE_LIBS)
104325ef
BP
125AC_SUBST([MODULE_CFLAGS])
126AC_SUBST([MODULE_LDFLAGS])
388a40e9 127
9f14a497 128# Checks for typedefs, structures, and compiler characteristics.
129AC_HEADER_STDBOOL
130AC_C_CONST
131AC_C_INLINE
132AC_TYPE_OFF_T
133AC_TYPE_SIZE_T
134AC_HEADER_TIME
135
136# Checks for library functions.
137AC_FUNC_ERROR_AT_LINE
9f14a497 138AC_FUNC_SELECT_ARGTYPES
139AC_CHECK_FUNCS([select])
140
7d3dcbe0 141AC_ARG_ENABLE(lttvstatic,
2e589766
AM
142 AS_HELP_STRING([--enable-lttvstatic],
143 [build a statically linked executable [[default=no]]]),
76b647ab
AM
144 [lttvstatic="$enableval"],
145 [lttvstatic="no"])
146AM_CONDITIONAL([LTTVSTATIC], [ test "x$lttvstatic" = "xyes" ] )
2e589766 147
25fba836 148lttvlibdir="${libdir}/lttv"
96cbee09 149lttvplugindir="${lttvlibdir}/plugins"
6da3640c 150#lttlibdir="${libdir}/ltt"
0c56e138 151top_lttvdir="\$(top_srcdir)/lttv"
13f86ce2 152top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow"
fc17f7eb 153
f0d243f7 154DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)"
273475ce 155
d8f124de 156lttincludedir="${includedir}/ltt"
940dc6d6 157lttvincludedir="${includedir}/lttv"
13f86ce2 158lttvwindowincludedir="${includedir}/lttvwindow"
5cec0a15 159lttctlincludedir="${includedir}/liblttctl"
6591c2c3 160
25fba836 161AC_SUBST(lttvlibdir)
6591c2c3 162AC_SUBST(lttvplugindir)
6da3640c 163#AC_SUBST(lttlibdir)
6591c2c3 164AC_SUBST(top_lttvdir)
165AC_SUBST(top_lttvwindowdir)
166AC_SUBST(DEFAULT_INCLUDES)
167AC_SUBST(lttincludedir)
168AC_SUBST(lttvincludedir)
13f86ce2 169AC_SUBST(lttvwindowincludedir)
5cec0a15 170AC_SUBST(lttctlincludedir)
940dc6d6 171
1111bb0f
MD
172# ltt/Makefile
173
9f14a497 174AC_CONFIG_FILES([Makefile
84baf72b
BP
175 lttv/Makefile
176 lttv/lttv/Makefile
ccf1db70 177 lttv/lttv/sync/Makefile
84baf72b
BP
178 lttv/modules/Makefile
179 lttv/modules/text/Makefile
180 lttv/modules/gui/Makefile
181 lttv/modules/gui/lttvwindow/Makefile
182 lttv/modules/gui/interrupts/Makefile
183 lttv/modules/gui/lttvwindow/lttvwindow/Makefile
184 lttv/modules/gui/lttvwindow/pixmaps/Makefile
185 lttv/modules/gui/controlflow/Makefile
186 lttv/modules/gui/detailedevents/Makefile
187 lttv/modules/gui/statistics/Makefile
188 lttv/modules/gui/histogram/Makefile
189 lttv/modules/gui/filter/Makefile
190 lttv/modules/gui/tracecontrol/Makefile
191 lttv/modules/gui/resourceview/Makefile
84baf72b
BP
192 doc/Makefile
193 doc/developer/Makefile
194 doc/developer/developer_guide/Makefile
195 doc/developer/developer_guide/docbook/Makefile
196 doc/developer/developer_guide/html/Makefile
197 doc/user/Makefile
198 doc/user/user_guide/Makefile
199 doc/user/user_guide/docbook/Makefile
200 doc/user/user_guide/html/Makefile])
2e589766 201
9f14a497 202AC_OUTPUT
2e589766 203
67c06453
AM
204# Report on what will be built
205AS_ECHO()
206AS_ECHO("The following components will be built:")
207AS_ECHO("LTT trace reading library: Enabled") # It's always enabled!
208
209AS_ECHO_N("LTTV command line tool: ")
210AS_IF([test "x$with_lttv" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
211
212AS_ECHO_N("LTTV graphical interface: ")
213AS_IF([test "x$with_lttv_gui" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
214
215AS_ECHO_N("Trace synchronization: ")
216AS_IF([test "x$with_trace_sync" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
217
218AS_ECHO_N("Java (JNI) interface: ")
219AS_IF([test "x$with_jni_interface" = "xyes"],[AS_ECHO("Enabled")],[AS_ECHO("Disabled")])
220
76b647ab
AM
221AS_ECHO()
222AS_ECHO_N("Statically linked executable: ")
223AS_IF([test "x$lttvstatic" = "xyes"],[AS_ECHO("Yes")],[AS_ECHO("No")])
224
67c06453
AM
225AS_ECHO()
226AS_ECHO("Type 'make' to build LTTV.")
227
This page took 0.07859 seconds and 4 git commands to generate.