1 dnl -*- mode: autoconf -*-
4 dnl template for the configuration script for the Alice HLT
5 dnl framework and components
7 dnl ------------------------------------------------------------------
8 AC_INIT([Alice High Level Trigger] , [0.4-dev], [Matthias.Richter@ift.uib.no], alice-hlt)
10 dnl ------------------------------------------------------------------
11 dnl the package from CVS contains the old Makefiles as well. In order to
12 dnl prevent them from becoming overwritten, we require a separate build
14 if test "`dirname $0`" = "." ; then
15 AC_ERROR([please run the script from a separate build directory])
18 dnl ------------------------------------------------------------------
20 AC_PREFIX_DEFAULT(${PWD})
21 AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
30 dnl ------------------------------------------------------------------
34 ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
35 AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
37 dnl ------------------------------------------------------------------
38 # TODO: make this configurable through arguments
39 #Define whether you want to run with ALIROOT or only ROOT
40 AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
41 ALIHLT_USEPACKAGE=ALIROOT
42 #ALIHLT_USEPACKAGE=ROOT
43 #ALIHLT_USEPACKAGE=STANDALONE
44 AC_DEFINE(use_aliroot)
46 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
48 dnl ------------------------------------------------------------------
49 dnl check for AliRoot features
51 AC_MSG_CHECKING([for AliRoot])
54 if test "x$with_aliroot" = "xyes" || test "x$with_aliroot" = "x" ; then
55 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
56 ALIROOTINCDIR=${ALICE_ROOT}/include
57 elif test "x$with_aliroot" != "xno" ; then
58 # TODO: think about the tgt_* subfolder
59 ALICE_ROOT="$with_aliroot"
60 ALIROOTLIBDIR="$ALICE_ROOT/lib"
61 ALIROOTINCDIR="$ALICE_ROOT/include"
63 if test "x$ALICE_ROOT" != "x" \
64 && test -d ${ALIROOTLIBDIR} \
65 && test -d ${ALIROOTINCDIR}; then
66 have_aliroot=$ALICE_ROOT
71 AC_MSG_RESULT([$have_aliroot])
73 if test ! "x$have_aliroot" = "xno" ; then
74 # we check for the libSTEER library which is linked to
75 # - the ROOT libs libGeom libMinuit libVMC libEG
76 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
77 # - ROOT libCint needs also libdl
78 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
79 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
80 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl -lSTEER"
81 save_CPPFLAGS=$CPPFLAGS
84 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
85 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
86 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
88 # check for certain AliRoot libraries/files/features
89 if test ! "x$have_aliroot" = "xno" ; then
90 # the RAWReader classe are needed by the TPCLib/AliHLTTPCDigitReaderPacket
91 # and by the STEER library. From version v4-04-Rev-07 on the RawReader classes
92 # are in libRAWDatarec, before in libRAWData
94 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
95 if test ! "x$have_alirawdata" = "xno" ; then
96 CHECKLIB="-lRAWDatarec"
97 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lRAWDatabase $CHECKLIB"
98 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
99 #include <AliRawReaderFile.h>
100 #include <AliRawReaderDate.h>
101 #include <AliRawReaderRoot.h>],
102 [AliRawReaderMemory mreader;
103 AliRawReaderFile freader;
104 AliRawReaderDate dreader(NULL,0);
105 AliRawReaderRoot rreader(NULL,0)])],
106 [AC_DEFINE(HAVE_ALIRAWDATA)
107 ALIROOT_LIBS="$ALIROOT_LIBS -lRAWDatabase $CHECKLIB"
108 have_alirawdata=$CHECKLIB],
109 [have_alirawdata=no])
110 # second pass with -RAWData
111 if test "x$have_alirawdata" = "xno" ; then
113 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB"
114 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
115 #include <AliRawReaderFile.h>
116 #include <AliRawReaderDate.h>
117 #include <AliRawReaderRoot.h>],
118 [AliRawReaderMemory mreader;
119 AliRawReaderFile freader;
120 AliRawReaderDate dreader(NULL,0);
121 AliRawReaderRoot rreader(NULL,0);])],
122 [AC_DEFINE(HAVE_ALIRAWDATA)
123 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
124 have_alirawdata=$CHECKLIB],
125 [have_alirawdata=no])
128 AC_MSG_RESULT($have_alirawdata)
132 #AC_CHECK_HEADERS([AliRun.h],[have_alisteer=yes])
133 AC_MSG_CHECKING(for AliRun in -lSTEER)
134 if test "x$have_alisteer" = "xyes" ; then
135 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRun.h>], [AliRun aliroot])],
136 [AC_DEFINE(HAVE_ALISTEER)],
140 AC_MSG_RESULT($have_alisteer)
142 if test ! "x$have_aliroot" = "xno" ; then
143 # the HLTTPCLib needs to link agains TPCbase and TPCrec
144 # TPC library for AliTPCParam and AliSimDigits used in
145 # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
146 saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
147 ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
148 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
150 AC_MSG_CHECKING(for required classes in TPC libraries)
151 if test ! "x$have_alitpc" = "xno" ; then
152 save_ALIROOT_LIBS=$ALIROOT_LIBS
153 ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
154 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
155 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
156 #include <AliTPCParam.h>
157 #include <AliTPCParamSR.h>
158 #include <AliTPCDigitsArray.h>
159 #include <AliTPCClustersArray.h>
160 #include <AliTPCcluster.h>
161 #include <AliTPCClustersRow.h>],
164 AliTPCParamSR paramsr;
165 AliTPCDigitsArray digarray;
166 AliTPCClustersArray clustarray;
168 AliTPCClustersRow row])],
169 [AC_DEFINE(HAVE_ALITPC)
170 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
171 saveALIROOT_LIBS=$ALIROOT_LIBS],
173 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
174 ALIROOT_LIBS=$saveALIROOT_LIBS])
176 AC_MSG_RESULT($have_alitpc)
179 if test ! "x$have_alirawdata" = "xno" ; then
180 # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
181 # the header file has been moved to the TPC module
182 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
183 # AliRawReaderMemory.h AliRawReaderFile.h already checked
184 #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
185 AC_CHECK_HEADERS([AliTPCRawStream.h])
189 if test ! "x$have_aliroot" = "xno" ; then
190 # the TPCLib/AliHLTTPCRawReader needs the actual Pad layot of the TPC
191 # which is stored in the TPC/mapping/Patchx.data files from
192 # AliRoot version v4-04-Release (May 2006)
193 AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
194 TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
195 AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data],
196 [have_tpc_mapping=yes
197 AC_SUBST(TPC_PAD_MAPPING_PATH)
198 AC_DEFINE(HAVE_TPC_MAPPING)],
202 AC_MSG_CHECKING([for TPC mapping layout])
203 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
204 AC_MSG_RESULT([$have_tpc_mapping])
206 if test "x$have_aliroot" = "xno" ; then
211 CPPFLAGS=$save_CPPFLAGS
212 LDFLAGS=$save_LDFLAGS
214 if test ! "x$have_aliroot" = "xno" ; then
215 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
219 AC_SUBST([ALIROOT_CPPFLAGS])
220 AC_SUBST([ALIROOT_LDFLAGS])
221 AC_SUBST([ALIROOT_LIBS])
222 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
224 dnl ------------------------------------------------------------------
225 AC_MSG_CHECKING([whether to impose strict coding conventions])
226 AC_ARG_ENABLE(strict,
227 [AC_HELP_STRING([--enable-strict],
228 [enable coding convention checks ])],
229 [],[enable_strict=no])
230 if test "x$enable_strict" = "xyes" ; then
231 CPPFLAGS="$CPPFLAGS -Weffc++"
233 AC_MSG_RESULT([$enable_strict])
235 dnl ------------------------------------------------------------------
236 AC_MSG_CHECKING([whether to compile sample library])
237 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
238 AC_ARG_ENABLE(sample,
239 [AC_HELP_STRING([--enable-sample],
240 [compile the sample library ])],
241 [],[enable_sample=yes])
242 if test "x$enable_sample" = "xyes" ; then
243 AC_DEFINE(HLT_SAMPLE)
245 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
246 AC_MSG_RESULT([$enable_sample])
248 dnl ------------------------------------------------------------------
249 AC_MSG_CHECKING([whether to compile tpc library])
250 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
252 [AC_HELP_STRING([--enable-tpc],
253 [compile the tpc library ])],
255 if test "x$have_aliroot" = "xno" ; then
256 enable_tpc="no...requires.AliRoot"
257 elif test "x$have_alitpc" = "xno" ; then
258 enable_tpc="no...requires.AliRoot.TPC.libraries"
260 if test "x$enable_tpc" = "xyes" ; then
263 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
264 AC_MSG_RESULT([$enable_tpc])
266 dnl ------------------------------------------------------------------
267 AC_MSG_CHECKING([whether to enable HLT logging])
268 AH_TEMPLATE([NOLOGGING],[disable hlt logging])
269 AC_ARG_ENABLE(logging,
270 [AC_HELP_STRING([--enable-logging],
272 [],[enable_logging=yes])
273 if test "x$enable_logging" != "xyes" ; then
276 AC_MSG_RESULT([$enable_logging])
278 dnl ------------------------------------------------------------------
279 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
280 AH_TEMPLATE([DOMC],[MC saving])
281 AC_ARG_ENABLE(mc-saving,
282 [AC_HELP_STRING([--enable-mc-saving],
283 [enable saving MC data through the chain])],
284 [],[enable_mc_saving=no])
285 if test "x$enable_mc_saving" = "xyes" ; then
288 AC_MSG_RESULT([$enable_mc_saving])
290 dnl ------------------------------------------------------------------
291 AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
292 AH_TEMPLATE([use_newio],[AliRoot NEWIO])
294 [AC_HELP_STRING([--enable-newio],
295 [enable AliRoot NEWIO ])],
296 [],[enable_newio=yes])
297 if test "x$enable_newio" = "xyes" ; then
300 AC_MSG_RESULT([$enable_newio])
302 dnl ------------------------------------------------------------------
303 dnl certainly something old, but we keep the define
304 AC_MSG_CHECKING([whether to use ROWHOUGH])
305 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
306 AC_ARG_ENABLE(rowhough,
307 [AC_HELP_STRING([--enable-rowhough],
309 [],[enable_rowhough=no])
310 if test "x$enable_rowhough" = "xyes" ; then
311 AC_DEFINE(USEROWHOUGH)
313 AC_MSG_RESULT([$enable_rowhough])
315 dnl ------------------------------------------------------------------
319 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
320 AC_PATH_PROG(PERL, perl)
321 AC_PATH_PROG(DOXYGEN, doxygen)
322 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
325 AC_PATH_PROG(DOT, dot)
326 if ! test "x$DOT" = "x" ; then
328 DOT_PATH=`dirname $DOT`
333 dnl ------------------------------------------------------------------
334 AC_CONFIG_FILES([Makefile
338 TPCLib/mapping2array.cxx