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