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