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