Adding the AliRunTagCuts class in the repository.
[u/mrichter/AliRoot.git] / HLT / configure.ac
CommitLineData
b521659f 1dnl -*- mode: autoconf -*-
2dnl
3dnl $Id$
4dnl template for the configuration script for the Alice HLT
5dnl framework and components
6dnl
7dnl ------------------------------------------------------------------
2ba6298d 8AC_INIT([Alice High Level Trigger] , [0.3], [Matthias.Richter@ift.uib.no], alice-hlt)
b521659f 9
10dnl ------------------------------------------------------------------
11dnl the package from CVS contains the old Makefiles as well. In order to
12dnl prevent them from becoming overwritten, we require a separate build
13dnl directory
14if test "`dirname $0`" = "." ; then
15 AC_ERROR([please run the script from a separate build directory])
16fi
17
18dnl ------------------------------------------------------------------
19AC_CANONICAL_SYSTEM
20AC_PREFIX_DEFAULT(${PWD})
21AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
22AM_INIT_AUTOMAKE
23AC_PROG_CC
24AC_PROG_CXX
25AC_PROG_LIBTOOL
26
27AC_DEBUG
28AC_OPTIMIZATION
29
30dnl ------------------------------------------------------------------
31dnl
32dnl Check for ROOT
33dnl
34ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
35AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
36
37dnl ------------------------------------------------------------------
38# TODO: make this configurable through arguments
39#Define whether you want to run with ALIROOT or only ROOT
40AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
41ALIHLT_USEPACKAGE=ALIROOT
42#ALIHLT_USEPACKAGE=ROOT
43#ALIHLT_USEPACKAGE=STANDALONE
44AC_DEFINE(use_aliroot)
45AC_DEFINE(use_root)
85869391 46CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
47LDFLAGS="$LDFLAGS -L${ROOTLIBDIR} ${ROOTLIBS}"
48
49dnl ------------------------------------------------------------------
74c73e5a 50dnl check for AliRoot features
51AC_LANG_PUSH(C++)
52AC_MSG_CHECKING([for AliRoot])
53have_aliroot=no
54with_aliroot=yes
55if test "x$with_aliroot" = "xyes" || test "x$with_aliroot" = "x" ; then
56 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
57 ALIROOTINCDIR=${ALICE_ROOT}/include
58elif test "x$with_aliroot" != "xno" ; then
59 # TODO: think about the tgt_* subfolder
60 ALICE_ROOT="$with_aliroot"
61 ALIROOTLIBDIR="$ALICE_ROOT/lib"
62 ALIROOTINCDIR="$ALICE_ROOT/include"
63fi
64if test "x$ALICE_ROOT" != "x" \
65 && test -d ${ALIROOTLIBDIR} \
66 && test -d ${ALIROOTINCDIR}; then
67 have_aliroot=$ALICE_ROOT
68else
69 ALIROOTLIBDIR=
70 ALIROOTINCDIR=
71fi
72AC_MSG_RESULT([$have_aliroot])
73
74if test ! "x$have_aliroot" = "xno" ; then
75 # we check for the libSTEER library which is linked to
76 # - the ROOT libs libGeom libMinuit libVMC libEG
77 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
78 # - ROOT libCint needs also libdl
79 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
80 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
81 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl -lSTEER"
82 save_CPPFLAGS=$CPPFLAGS
83 save_LDFLAGS=$LDFLAGS
84 save_LIBS=$LIBS
85 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
86 LDFLAGS="$save_LDFLAGS $ALIROOT_LDFLAGS"
87 LIBS="$save_LIBS $ALIROOT_LIBS"
88
89 # check for certain AliRoot libraries/files/features
90 if test ! "x$have_aliroot" = "xno" ; then
91 # the RAWReader classe are needed by the TPCLib/AliHLTTPCDigitReaderPacket
92 # and by the STEER library. From version v4-04-Rev-07 on the RawReader classes
93 # are in libRAWDatarec, before in libRAWData
94 have_alirawdata=yes
95 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
96 if test ! "x$have_alirawdata" = "xno" ; then
97 CHECKLIB="-lRAWDatarec"
98 LIBS="$save_LIBS $ALIROOT_LIBS -lRAWDatabase $CHECKLIB"
99 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
100 #include <AliRawReaderFile.h>
101 #include <AliRawReaderDate.h>
102 #include <AliRawReaderRoot.h>],
103 [AliRawReaderMemory mreader;
104 AliRawReaderFile freader;
105 AliRawReaderDate dreader(NULL,0);
106 AliRawReaderRoot rreader(NULL,0)])],
107 [AC_DEFINE(HAVE_ALIRAWDATA)
108 ALIROOT_LIBS="$ALIROOT_LIBS -lRAWDatabase $CHECKLIB"
109 have_alirawdata=$CHECKLIB],
110 [have_alirawdata=no])
111 # second pass with -RAWData
112 if test "x$have_alirawdata" = "xno" ; then
113 CHECKLIB="-lRAWData"
114 LIBS="$save_LIBS $ALIROOT_LIBS $CHECKLIB"
115 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
116 #include <AliRawReaderFile.h>
117 #include <AliRawReaderDate.h>
118 #include <AliRawReaderRoot.h>],
119 [AliRawReaderMemory mreader;
120 AliRawReaderFile freader;
121 AliRawReaderDate dreader(NULL,0);
122 AliRawReaderRoot rreader(NULL,0);])],
123 [AC_DEFINE(HAVE_ALIRAWDATA)
124 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
125 have_alirawdata=$CHECKLIB],
126 [have_alirawdata=no])
127 fi
128 fi
129 AC_MSG_RESULT($have_alirawdata)
130 fi
131
132 have_alisteer=yes
133 #AC_CHECK_HEADERS([AliRun.h],[have_alisteer=yes])
134 AC_MSG_CHECKING(for AliRun in -lSTEER)
135 if test "x$have_alisteer" = "xyes" ; then
136 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRun.h>], [AliRun aliroot])],
137 [AC_DEFINE(HAVE_ALISTEER)],
138 [have_alisteer=no
139 have_aliroot=no])
140 fi
141 AC_MSG_RESULT($have_alisteer)
142
143 if test ! "x$have_aliroot" = "xno" ; then
144 # the HLTTPCLib needs to link agains TPCbase and TPCrec
145 # TPC library for AliTPCParam and AliSimDigits used in
146 # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
147 saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
148 ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
149 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
150 have_alitpc=yes
151 AC_MSG_CHECKING(for required classes in TPC libraries)
152 if test ! "x$have_alitpc" = "xno" ; then
153 save_ALIROOT_LIBS=$ALIROOT_LIBS
154 ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
155 LIBS="$save_LIBS $ALIROOT_LIBS"
156 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
157 #include <AliTPCParam.h>
158 #include <AliTPCParamSR.h>
159 #include <AliTPCDigitsArray.h>
160 #include <AliTPCClustersArray.h>
161 #include <AliTPCcluster.h>
162 #include <AliTPCClustersRow.h>],
163 [AliSimDigits dig;
164 AliTPCParam param;
165 AliTPCParamSR paramsr;
166 AliTPCDigitsArray digarray;
167 AliTPCClustersArray clustarray;
168 AliTPCcluster clust;
169 AliTPCClustersRow row])],
170 [AC_DEFINE(HAVE_ALITPC)
171 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
172 saveALIROOT_LIBS=$ALIROOT_LIBS],
173 [have_alitpc=no
174 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
175 ALIROOT_LIBS=$saveALIROOT_LIBS])
176 fi
177 AC_MSG_RESULT($have_alitpc)
178 fi
179
180 if test ! "x$have_alirawdata" = "xno" ; then
181 # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
182 # the header file has been moved to the TPC module
183 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
184 # AliRawReaderMemory.h AliRawReaderFile.h already checked
185 #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
186 AC_CHECK_HEADERS([AliTPCRawStream.h])
187 fi
85869391 188
74c73e5a 189 if test "x$have_aliroot" = "xno" ; then
190 ALIROOT_CPPFLAGS=
191 ALIROOT_LDFLAGS=
192 ALIROOT_LIBS=
193 fi
194 CPPFLAGS=$save_CPPFLAGS
195 LDFLAGS=$save_LDFLAGS
196 LIBS=$save_LIBS
197 if test ! "x$have_aliroot" = "xno" ; then
198 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
199 fi
200fi
201AC_LANG_POP(C++)
202AC_SUBST([ALIROOT_CPPFLAGS])
203AC_SUBST([ALIROOT_LDFLAGS])
204AC_SUBST([ALIROOT_LIBS])
205CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
85869391 206
207dnl ------------------------------------------------------------------
208AC_MSG_CHECKING([whether to impose strict coding conventions])
209AC_ARG_ENABLE(strict,
210 [AC_HELP_STRING([--enable-strict],
211 [enable coding convention checks ])],
212 [],[enable_strict=no])
213if test "x$enable_strict" = "xyes" ; then
214 CPPFLAGS="$CPPFLAGS -Weffc++"
215fi
216AC_MSG_RESULT([$enable_strict])
b521659f 217
218dnl ------------------------------------------------------------------
219AC_MSG_CHECKING([whether to compile sample library])
220AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
221AC_ARG_ENABLE(sample,
222 [AC_HELP_STRING([--enable-sample],
223 [compile the sample library ])],
224 [],[enable_sample=yes])
225if test "x$enable_sample" = "xyes" ; then
226 AC_DEFINE(HLT_SAMPLE)
227fi
228AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
229AC_MSG_RESULT([$enable_sample])
230
231dnl ------------------------------------------------------------------
232AC_MSG_CHECKING([whether to compile tpc library])
233AH_TEMPLATE([HLT_TPC],[hlt tpc library])
234AC_ARG_ENABLE(tpc,
235 [AC_HELP_STRING([--enable-tpc],
236 [compile the tpc library ])],
237 [],[enable_tpc=yes])
74c73e5a 238if test "x$have_aliroot" = "xno" ; then
239 enable_tpc="no...requires.AliRoot"
240elif test "x$have_alitpc" = "xno" ; then
241 enable_tpc="no...requires.AliRoot.TPC.libraries"
242fi
b521659f 243if test "x$enable_tpc" = "xyes" ; then
244 AC_DEFINE(HLT_TPC)
245fi
246AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
247AC_MSG_RESULT([$enable_tpc])
248
85869391 249dnl ------------------------------------------------------------------
250if test "x$enable_tpc" = "xyes" ; then
251 AC_MSG_CHECKING([whether to compile tpc reference library])
252 AH_TEMPLATE([HLT_TPCREF],[hlt tpc reference library])
253 AC_ARG_ENABLE(tpcref,
254 [AC_HELP_STRING([--enable-tpcref],
255 [compile the tpc reference library ])],
256 [],[enable_tpcref=no])
257 if test "x$enable_tpcref" = "xyes" ; then
258 AC_DEFINE(HLT_TPCREF)
259 fi
85869391 260 AC_MSG_RESULT([$enable_tpcref])
261fi
74c73e5a 262AM_CONDITIONAL(EN_HLT_TPCREF, test x$enable_tpcref = xyes)
85869391 263
b521659f 264dnl ------------------------------------------------------------------
265AC_MSG_CHECKING([whether to enable HLT logging])
266AH_TEMPLATE([NOLOGGING],[disable hlt logging])
267AC_ARG_ENABLE(logging,
268 [AC_HELP_STRING([--enable-logging],
269 [enable logging])],
270 [],[enable_logging=yes])
271if test "x$enable_logging" != "xyes" ; then
272 AC_DEFINE(NOLOGGING)
273fi
274AC_MSG_RESULT([$enable_logging])
275
276dnl ------------------------------------------------------------------
277AC_MSG_CHECKING([whether to enable saving MC data through the chain])
278AH_TEMPLATE([DOMC],[MC saving])
279AC_ARG_ENABLE(mc-saving,
280 [AC_HELP_STRING([--enable-mc-saving],
281 [enable saving MC data through the chain])],
282 [],[enable_mc_saving=no])
283if test "x$enable_mc_saving" = "xyes" ; then
284 AC_DEFINE(DOMC)
285fi
286AC_MSG_RESULT([$enable_mc_saving])
287
b521659f 288dnl ------------------------------------------------------------------
289AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
290AH_TEMPLATE([use_newio],[AliRoot NEWIO])
291AC_ARG_ENABLE(newio,
292 [AC_HELP_STRING([--enable-newio],
293 [enable AliRoot NEWIO ])],
294 [],[enable_newio=yes])
295if test "x$enable_newio" = "xyes" ; then
296 AC_DEFINE(use_newio)
297fi
298AC_MSG_RESULT([$enable_newio])
299
300dnl ------------------------------------------------------------------
301dnl certainly something old, but we keep the define
302AC_MSG_CHECKING([whether to use ROWHOUGH])
303AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
304AC_ARG_ENABLE(rowhough,
305 [AC_HELP_STRING([--enable-rowhough],
306 [use ROWHOUGH ])],
307 [],[enable_rowhough=no])
308if test "x$enable_rowhough" = "xyes" ; then
309 AC_DEFINE(USEROWHOUGH)
310fi
311AC_MSG_RESULT([$enable_rowhough])
312
313dnl ------------------------------------------------------------------
314dnl
315dnl Documentation
316dnl
317AC_ARG_VAR(DOXYGEN, The Documentation Generator)
318AC_PATH_PROG(PERL, perl)
319AC_PATH_PROG(DOXYGEN, doxygen)
320AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
321HAVE_DOT=NO
322DOT_PATH=
323AC_PATH_PROG(DOT, dot)
324if ! test "x$DOT" = "x" ; then
325 HAVE_DOT=YES
326 DOT_PATH=`dirname $DOT`
327fi
328AC_SUBST([HAVE_DOT])
329AC_SUBST([DOT_PATH])
330
331dnl ------------------------------------------------------------------
332AC_CONFIG_FILES([Makefile
333 BASE/Makefile
334 SampleLib/Makefile
335 TPCLib/Makefile
336 TPCLib/Ref/Makefile
b521659f 337 doc/Makefile
338 doc/doxygen.conf])
339
340
341AC_OUTPUT
342dnl
343dnl EOF
344dnl
345