runlttv: use cmd line arguments instead of environment variables
[lttv.git] / configure.ac
... / ...
CommitLineData
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
20# -*- Autoconf -*-
21# Process this file with autoconf to produce a configure script.
22
23AC_PREREQ(2.57)
24AC_INIT([lttv], [0.12.17-01072009], [ltt-dev@lists.casi.polymtl.ca])
25AM_INIT_AUTOMAKE
26AM_CONFIG_HEADER(config.h)
27AM_PROG_LIBTOOL
28
29# If requested, only build LTT library part
30AC_ARG_WITH(liblttvtraceread-only, [ --with-liblttvtraceread-only Do not build any LTT ui, only compile the trace reading library])
31if test -z "$with_liblttvtraceread_only"; then
32 with_liblttvtraceread_only=${with_liblttvtraceread_only_default-no}
33else
34 # Requesting lib-only turn off the lttv-gui building as well
35 enable_lttv_gui="no"
36fi
37AM_CONDITIONAL(BUILD_LIB_ONLY, test "$with_liblttvtraceread_only" = "yes")
38
39
40# If requested, avoid building LTTV part
41AC_ARG_ENABLE(lttv-gui,
42[ --disable-lttv-gui Do not build LTTV gui, only build textmode LTTV])
43
44if test -z "$enable_lttv_gui"; then
45 enable_lttv_gui=${enable_lttv_gui_default-yes}
46fi
47AM_CONDITIONAL(BUILD_LTTV_GUI, test "$enable_lttv_gui" = "yes")
48
49AM_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)
50
51# GTK is only needed by the GUI
52if test "$enable_lttv_gui" = "yes" ; then
53 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)
54fi
55
56AC_PATH_PROGS(BASH, bash)
57
58AC_SYS_LARGEFILE
59
60# Checks for programs.
61AC_PROG_CC
62
63# Checks for libraries.
64AC_CHECK_LIB([popt], [poptGetNextOpt], POPT_LIBS="-lpopt",AC_MSG_ERROR([libpopt is required in order to compile LinuxTraceToolkit]) )
65#AC_CHECK_LIB([m], [round], M_LIBS="-lm",AC_MSG_ERROR([Mathematical libraries are missing.]) )
66
67AC_CHECK_LIB([util], [forkpty], UTIL_LIBS="-lutil", AC_MSG_ERROR([
68libutil is required in order to compile LinuxTraceToolkit]))
69
70
71# pthread for gdb with dlopen().
72AC_CHECK_LIB(pthread, pthread_join, [], AC_MSG_ERROR([LinuxThreads is required in order to make sure gdb works fine with lttv-gui]))
73
74# Checks for header files.
75AC_HEADER_STDC
76AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h pthread.h])
77
78# Set compile flags to java include files if given
79AC_ARG_WITH(java_jdk, [ --with-java-jdk=DIR use java jdk from DIR. Ex : $JAVA_HOME.], JAVA_SDK=$withval,)
80if test $JAVA_SDK; then
81 if test -d $JAVA_SDK; then
82 AC_MSG_RESULT([using java include in $JAVA_SDK])
83 SUBDIRS=`find $JAVA_SDK/include -type d`
84 CFLAGS+=" "
85 CFLAGS+=`for x in $SUBDIRS; do echo -n "-I$x "; done`
86 CFLAGS+=" "
87 else
88 AC_MSG_ERROR(Unable to find java include file in $JAVA_JDK)
89 fi
90fi
91
92
93# Check for JNI header files if requested
94AC_ARG_ENABLE(jni-interface,
95[ --enable-jni-interface build JNI interface between C and java. Need java include files. ])
96
97if test -z "$enable_jni_interface"; then
98 enable_jni_interface=${enable_jni_interface_default-no}
99fi
100
101if test "$enable_jni_interface" = "yes"; then
102 AC_CHECK_HEADERS([jni.h],,AC_MSG_ERROR([
103missing jni.h
104Make sure Sun Java or GJC is installed and that this header file exists in the system path.
105Use --with-java-jdk=DIR flag to point to your java include files or desactivate the JNI interface.]))
106fi
107AM_CONDITIONAL(BUILD_JNI_INTERFACE, test "$enable_jni_interface" = "yes")
108
109
110AC_ISC_POSIX
111AC_PROG_CC
112AM_PROG_CC_STDC
113AC_HEADER_STDC
114
115# If we want the gui, we need additionnal flags for GTK
116if test "$enable_lttv_gui" = "yes" ; then
117 pkg_modules="gtk+-2.0 >= 2.0.0"
118 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
119 PACKAGE_CFLAGS="-Wall -Wformat"
120 AC_SUBST(PACKAGE_CFLAGS)
121 AC_SUBST(PACKAGE_LIBS)
122# Else, we still have a dependency on gmodule
123# We will add flags for gmodule alone
124else
125 pkg_modules="gmodule-2.0 >= 2.0.0"
126 PKG_CHECK_MODULES(GMODULE, [$pkg_modules])
127 PACKAGE_CFLAGS="-Wall -Wformat"
128 AC_SUBST(PACKAGE_CFLAGS)
129 AC_SUBST(PACKAGE_LIBS)
130fi
131
132pkg_modules="gobject-2.0 >= 2.0.0"
133PKG_CHECK_MODULES(GOBJECT, [$pkg_modules])
134
135LIBS="$LIBS $GTK_LIBS $GOBJECT_LIBS $GMODULE_LIBS"
136PACKAGE_CFLAGS="$GTK_CFLAGS $GOBJECT_CFLAGS $GMODULE_CFLAGS -Wall -Wformat"
137MODULE_CFLAGS="$PACKAGE_CFLAGS -fvisibility=hidden"
138MODULE_LDFLAGS="-module -avoid-version"
139AC_SUBST([PACKAGE_CFLAGS])
140AC_SUBST([MODULE_CFLAGS])
141AC_SUBST([MODULE_LDFLAGS])
142
143# Checks for typedefs, structures, and compiler characteristics.
144AC_HEADER_STDBOOL
145AC_C_CONST
146AC_C_INLINE
147AC_TYPE_OFF_T
148AC_TYPE_SIZE_T
149AC_HEADER_TIME
150
151# Checks for library functions.
152AC_FUNC_ERROR_AT_LINE
153#AC_FUNC_MALLOC
154AC_FUNC_SELECT_ARGTYPES
155AC_CHECK_FUNCS([select])
156
157#CPPFLAGS="$CPPFLAGS -I"
158
159AC_ARG_ENABLE(lttvstatic,
160 AC_HELP_STRING( [--enable-lttvstatic],
161 [Build a statically linked executable @<:@default=no@:>@]),
162 [with_lttvstatic="yes"],
163 [with_lttvstatic="no"])
164AM_CONDITIONAL(LTTVSTATIC, test "x$with_lttvstatic" = "xyes")
165lttvlibdir="${libdir}/lttv"
166lttvplugindir="${lttvlibdir}/plugins"
167#lttlibdir="${libdir}/ltt"
168top_lttvdir="\$(top_srcdir)/lttv"
169top_lttvwindowdir="\$(top_srcdir)/lttv/modules/gui/lttvwindow"
170
171DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_lttvdir) -I\$(top_lttvwindowdir)"
172
173lttincludedir="${includedir}/ltt"
174lttvincludedir="${includedir}/lttv"
175lttvwindowincludedir="${includedir}/lttvwindow"
176lttctlincludedir="${includedir}/liblttctl"
177
178AC_SUBST([POPT_LIBS])
179AC_SUBST([UTIL_LIBS])
180AC_SUBST(lttvlibdir)
181AC_SUBST(lttvplugindir)
182#AC_SUBST(lttlibdir)
183AC_SUBST(top_lttvdir)
184AC_SUBST(top_lttvwindowdir)
185AC_SUBST(DEFAULT_INCLUDES)
186AC_SUBST(lttincludedir)
187AC_SUBST(lttvincludedir)
188AC_SUBST(lttvwindowincludedir)
189AC_SUBST(lttctlincludedir)
190
191 #lttv/modules/gui/tutorial/Makefile
192 #lttv/modules/gui/diskperformance/Makefile
193AC_CONFIG_FILES([Makefile
194 lttv/Makefile
195 lttv/lttv/Makefile
196 lttv/modules/Makefile
197 lttv/modules/text/Makefile
198 lttv/modules/gui/Makefile
199 lttv/modules/gui/lttvwindow/Makefile
200 lttv/modules/gui/interrupts/Makefile
201 lttv/modules/gui/lttvwindow/lttvwindow/Makefile
202 lttv/modules/gui/lttvwindow/pixmaps/Makefile
203 lttv/modules/gui/controlflow/Makefile
204 lttv/modules/gui/detailedevents/Makefile
205 lttv/modules/gui/statistics/Makefile
206 lttv/modules/gui/histogram/Makefile
207 lttv/modules/gui/filter/Makefile
208 lttv/modules/gui/tracecontrol/Makefile
209 lttv/modules/gui/resourceview/Makefile
210 ltt/Makefile
211 doc/Makefile
212 doc/developer/Makefile
213 doc/developer/developer_guide/Makefile
214 doc/developer/developer_guide/docbook/Makefile
215 doc/developer/developer_guide/html/Makefile
216 doc/user/Makefile
217 doc/user/user_guide/Makefile
218 doc/user/user_guide/docbook/Makefile
219 doc/user/user_guide/html/Makefile])
220AC_OUTPUT
This page took 0.022601 seconds and 4 git commands to generate.