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) | |
4306107a | 24 | AC_INIT([lttv], [0.12.38-21032011], [ltt-dev@lists.casi.polymtl.ca]) |
7b84cb1c | 25 | AM_INIT_AUTOMAKE |
9ecb7d44 | 26 | AM_SILENT_RULES([yes]) |
b445142a | 27 | AM_CONFIG_HEADER(config.h) |
39407106 | 28 | AM_PROG_LIBTOOL |
b00eda44 | 29 | |
68d52dcc | 30 | # If requested, only build LTT library part |
c2e0a887 | 31 | AC_ARG_WITH(lttv, [ --with-lttv build whole LTTV system, as opposd to only the trace reading library |
3421f649 | 32 | [[default=yes]]]) |
04d4798d WB |
33 | if test -z "$with_lttv"; then |
34 | with_lttv=${with_lttv_default-yes} | |
68d52dcc | 35 | else |
04d4798d WB |
36 | if test "$with_lttv" = "no"; then |
37 | # Requesting lib-only turn off the lttv-gui building as well | |
38 | with_lttv_gui="no" | |
39 | fi | |
68d52dcc | 40 | fi |
04d4798d | 41 | AM_CONDITIONAL(BUILD_LIB_ONLY, test "$with_lttv" = "no") |
68d52dcc WB |
42 | |
43 | ||
7b84cb1c | 44 | # If requested, avoid building LTTV part |
c2e0a887 | 45 | AC_ARG_WITH(lttv-gui, [ --with-lttv-gui build LTTV gui, as opposed to only build textmode LTTV |
3421f649 | 46 | [[default=yes]]]) |
68d52dcc | 47 | |
04d4798d WB |
48 | if test -z "$with_lttv_gui"; then |
49 | with_lttv_gui=${with_lttv_gui_default-yes} | |
68d52dcc | 50 | fi |
04d4798d | 51 | AM_CONDITIONAL(BUILD_LTTV_GUI, test "$with_lttv_gui" = "yes") |
68d52dcc | 52 | |
b37f012b | 53 | AM_PATH_GLIB_2_0(2.4.0, ,AC_MSG_ERROR([glib is required in order to compile LinuxTraceToolkit - download it from ftp://ftp.gtk.org/pub/gtk]) , gmodule) |
9f14a497 | 54 | |
68d52dcc | 55 | # GTK is only needed by the GUI |
04d4798d | 56 | if test "$with_lttv_gui" = "yes" ; then |
68d52dcc WB |
57 | AM_PATH_GTK_2_0(2.4.0, ,AC_MSG_ERROR([gtk is required in order to compile GUI - download it from ftp://ftp.gtk.org/pub/gtk]) , gmodule) |
58 | fi | |
442137a6 | 59 | |
065f8f41 | 60 | AC_PATH_PROGS(BASH, bash) |
61 | ||
ddd2aaff | 62 | AC_SYS_LARGEFILE |
63 | ||
9f14a497 | 64 | # Checks for programs. |
65 | AC_PROG_CC | |
66 | ||
67 | # Checks for libraries. | |
66eaf2eb BP |
68 | AC_CHECK_LIB([popt], [poptGetNextOpt], POPT_LIBS="-lpopt", |
69 | AC_MSG_ERROR([libpopt is required in order to compile LinuxTraceToolkit])) | |
70 | AC_CHECK_LIB([m], [round], M_LIBS="-lm", | |
71 | AC_MSG_ERROR([Mathematical libraries are missing.])) | |
72 | AC_CHECK_LIB([util], [forkpty], UTIL_LIBS="-lutil", | |
73 | AC_MSG_ERROR([libutil is required in order to compile LinuxTraceToolkit])) | |
74 | ||
75 | AC_ARG_WITH([glpk], | |
76 | [AS_HELP_STRING([--with-glpk@<:@=DIR@:>@], | |
77 | [support trace synchronization accuracy calculation (needs glpk) | |
78 | @<:@default=check@:>@])], | |
79 | [], | |
80 | [with_glpk=check]) | |
81 | ||
82 | GLPK_LIBS= | |
83 | AS_IF([test "x$with_glpk" != xno], | |
84 | [if test "x$with_glpk" != xyes -a -d "$with_glpk"; then | |
85 | LDFLAGS="$LDFLAGS -L$with_glpk" | |
86 | fi | |
87 | AC_CHECK_LIB([glpk], [glp_create_prob], | |
88 | [AC_SUBST([GLPK_LIBS], ["-lglpk"]) | |
89 | AC_DEFINE([HAVE_LIBGLPK], [1], [Define if you have libglpk])], | |
90 | [if test "x$with_glpk" != xcheck; then | |
91 | AC_MSG_FAILURE( | |
92 | [--with-glpk was given, but test for glpk failed]) | |
93 | fi], | |
94 | -lm)]) | |
36ea7706 | 95 | |
750eb11a | 96 | # pthread for gdb with dlopen(). |
3d55af6e | 97 | AC_CHECK_LIB(pthread, pthread_join, [], AC_MSG_ERROR([LinuxThreads is required in order to make sure gdb works fine with lttv-gui])) |
36ea7706 | 98 | |
9f14a497 | 99 | # Checks for header files. |
100 | AC_HEADER_STDC | |
36ea7706 | 101 | AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h pthread.h]) |
9f14a497 | 102 | |
68d52dcc WB |
103 | # Set compile flags to java include files if given |
104 | AC_ARG_WITH(java_jdk, [ --with-java-jdk=DIR use java jdk from DIR. Ex : $JAVA_HOME.], JAVA_SDK=$withval,) | |
105 | if test $JAVA_SDK; then | |
106 | if test -d $JAVA_SDK; then | |
107 | AC_MSG_RESULT([using java include in $JAVA_SDK]) | |
108 | SUBDIRS=`find $JAVA_SDK/include -type d` | |
a97fddd2 | 109 | CFLAGS+=" " |
78608bce | 110 | CFLAGS+=`for x in $SUBDIRS; do echo -n "-I$x "; done` |
a97fddd2 | 111 | CFLAGS+=" " |
68d52dcc WB |
112 | else |
113 | AC_MSG_ERROR(Unable to find java include file in $JAVA_JDK) | |
114 | fi | |
115 | fi | |
116 | ||
117 | ||
118 | # Check for JNI header files if requested | |
c2e0a887 | 119 | AC_ARG_WITH(jni-interface, [ --with-jni-interface build JNI interface between C and java. Need java include files. |
3421f649 | 120 | [[default=no]]]) |
68d52dcc | 121 | |
04d4798d WB |
122 | if test -z "$with_jni_interface"; then |
123 | with_jni_interface=${with_jni_interface_default-no} | |
68d52dcc WB |
124 | fi |
125 | ||
04d4798d | 126 | if test "$with_jni_interface" = "yes"; then |
68d52dcc WB |
127 | AC_CHECK_HEADERS([jni.h],,AC_MSG_ERROR([ |
128 | missing jni.h | |
a709aa2c | 129 | Make sure Sun Java or OpenJDK or GCJ is installed and that this header file exists in the system path. |
68d52dcc WB |
130 | Use --with-java-jdk=DIR flag to point to your java include files or desactivate the JNI interface.])) |
131 | fi | |
04d4798d | 132 | AM_CONDITIONAL(BUILD_JNI_INTERFACE, test "$with_jni_interface" = "yes") |
68d52dcc WB |
133 | |
134 | ||
c8faea22 | 135 | AC_ISC_POSIX |
136 | AC_PROG_CC | |
137 | AM_PROG_CC_STDC | |
138 | AC_HEADER_STDC | |
139 | ||
78608bce | 140 | # If we want the gui, we need additionnal flags for GTK |
04d4798d | 141 | if test "$with_lttv_gui" = "yes" ; then |
68d52dcc WB |
142 | pkg_modules="gtk+-2.0 >= 2.0.0" |
143 | PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) | |
144 | PACKAGE_CFLAGS="-Wall -Wformat" | |
145 | AC_SUBST(PACKAGE_CFLAGS) | |
146 | AC_SUBST(PACKAGE_LIBS) | |
78608bce WB |
147 | # Else, we still have a dependency on gmodule |
148 | # We will add flags for gmodule alone | |
149 | else | |
150 | pkg_modules="gmodule-2.0 >= 2.0.0" | |
151 | PKG_CHECK_MODULES(GMODULE, [$pkg_modules]) | |
152 | PACKAGE_CFLAGS="-Wall -Wformat" | |
153 | AC_SUBST(PACKAGE_CFLAGS) | |
154 | AC_SUBST(PACKAGE_LIBS) | |
68d52dcc | 155 | fi |
104325ef | 156 | |
3d55af6e BP |
157 | pkg_modules="gobject-2.0 >= 2.0.0" |
158 | PKG_CHECK_MODULES(GOBJECT, [$pkg_modules]) | |
159 | ||
6d3ad1b2 | 160 | LIBS="$LIBS $M_LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS" |
78608bce | 161 | PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat" |
104325ef BP |
162 | MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden" |
163 | MODULE_LDFLAGS="-module -avoid-version" | |
164 | AC_SUBST([PACKAGE_CFLAGS]) | |
165 | AC_SUBST([MODULE_CFLAGS]) | |
166 | AC_SUBST([MODULE_LDFLAGS]) | |
388a40e9 | 167 | |
9f14a497 | 168 | # Checks for typedefs, structures, and compiler characteristics. |
169 | AC_HEADER_STDBOOL | |
170 | AC_C_CONST | |
171 | AC_C_INLINE | |
172 | AC_TYPE_OFF_T | |
173 | AC_TYPE_SIZE_T | |
174 | AC_HEADER_TIME | |
175 | ||
176 | # Checks for library functions. | |
177 | AC_FUNC_ERROR_AT_LINE | |
f5eafc51 | 178 | #AC_FUNC_MALLOC |
9f14a497 | 179 | AC_FUNC_SELECT_ARGTYPES |
180 | AC_CHECK_FUNCS([select]) | |
181 | ||
182 | #CPPFLAGS="$CPPFLAGS -I" | |
183 | ||
7d3dcbe0 BP |
184 | AC_ARG_ENABLE(lttvstatic, |
185 | AC_HELP_STRING( [--enable-lttvstatic], | |
c2e0a887 | 186 | [build a statically linked executable @<:@default=no@:>@]), |
7d3dcbe0 BP |
187 | [with_lttvstatic="yes"], |
188 | [with_lttvstatic="no"]) | |
189 | AM_CONDITIONAL(LTTVSTATIC, test "x$with_lttvstatic" = "xyes") | |
25fba836 | 190 | lttvlibdir="${libdir}/lttv" |
96cbee09 | 191 | lttvplugindir="${lttvlibdir}/plugins" |
6da3640c | 192 | #lttlibdir="${libdir}/ltt" |
0c56e138 | 193 | top_lttvdir="\$(top_srcdir)/lttv" |
13f86ce2 | 194 | top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow" |
fc17f7eb | 195 | |
f0d243f7 | 196 | DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)" |
273475ce | 197 | |
d8f124de | 198 | lttincludedir="${includedir}/ltt" |
940dc6d6 | 199 | lttvincludedir="${includedir}/lttv" |
13f86ce2 | 200 | lttvwindowincludedir="${includedir}/lttvwindow" |
5cec0a15 | 201 | lttctlincludedir="${includedir}/liblttctl" |
6591c2c3 | 202 | |
3d55af6e BP |
203 | AC_SUBST([POPT_LIBS]) |
204 | AC_SUBST([UTIL_LIBS]) | |
25fba836 | 205 | AC_SUBST(lttvlibdir) |
6591c2c3 | 206 | AC_SUBST(lttvplugindir) |
6da3640c | 207 | #AC_SUBST(lttlibdir) |
6591c2c3 | 208 | AC_SUBST(top_lttvdir) |
209 | AC_SUBST(top_lttvwindowdir) | |
210 | AC_SUBST(DEFAULT_INCLUDES) | |
211 | AC_SUBST(lttincludedir) | |
212 | AC_SUBST(lttvincludedir) | |
13f86ce2 | 213 | AC_SUBST(lttvwindowincludedir) |
5cec0a15 | 214 | AC_SUBST(lttctlincludedir) |
940dc6d6 | 215 | |
c17abb87 | 216 | #lttv/modules/gui/tutorial/Makefile |
217 | #lttv/modules/gui/diskperformance/Makefile | |
9f14a497 | 218 | AC_CONFIG_FILES([Makefile |
84baf72b BP |
219 | lttv/Makefile |
220 | lttv/lttv/Makefile | |
ccf1db70 | 221 | lttv/lttv/sync/Makefile |
84baf72b BP |
222 | lttv/modules/Makefile |
223 | lttv/modules/text/Makefile | |
224 | lttv/modules/gui/Makefile | |
225 | lttv/modules/gui/lttvwindow/Makefile | |
226 | lttv/modules/gui/interrupts/Makefile | |
227 | lttv/modules/gui/lttvwindow/lttvwindow/Makefile | |
228 | lttv/modules/gui/lttvwindow/pixmaps/Makefile | |
229 | lttv/modules/gui/controlflow/Makefile | |
230 | lttv/modules/gui/detailedevents/Makefile | |
231 | lttv/modules/gui/statistics/Makefile | |
232 | lttv/modules/gui/histogram/Makefile | |
233 | lttv/modules/gui/filter/Makefile | |
234 | lttv/modules/gui/tracecontrol/Makefile | |
235 | lttv/modules/gui/resourceview/Makefile | |
236 | ltt/Makefile | |
237 | doc/Makefile | |
238 | doc/developer/Makefile | |
239 | doc/developer/developer_guide/Makefile | |
240 | doc/developer/developer_guide/docbook/Makefile | |
241 | doc/developer/developer_guide/html/Makefile | |
242 | doc/user/Makefile | |
243 | doc/user/user_guide/Makefile | |
244 | doc/user/user_guide/docbook/Makefile | |
245 | doc/user/user_guide/html/Makefile]) | |
9f14a497 | 246 | AC_OUTPUT |