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