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