corrections in class docu
[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 ------------------------------------------------------------------
408c5899 8
9dnl Take either the AliRoot tag as version id or the current revision
10AC_INIT([Alice High Level Trigger] ,
7233bc62 11 m4_esyscmd([url=`svn info 2> /dev/null | grep "URL:" | cut -d: -f3 | sed -e 's|[/]*HLT[/]*$||' | sed -e 's|^[/]*||g' | cut -d '/' -f 4`; \
12 revision=`svn info 2> /dev/null | grep "Revision:" | cut -d ' ' -f 2 | cut -d '/' -f 4`; \
13 if test "x$url" != "x"; then echo -n $url; \
14 elif test "x$revision" != "x"; then echo -n $revision ; \
15 elif test -e .revision && test x`cat .revision` != x; then \
16 cat .revision; \
17 else \
18 echo -n invalid-version; \
19 fi]),
408c5899 20 [Matthias.Richter@ift.uib.no],
21 [alice-hlt])
b521659f 22
23dnl ------------------------------------------------------------------
24dnl the package from CVS contains the old Makefiles as well. In order to
25dnl prevent them from becoming overwritten, we require a separate build
26dnl directory
27if test "`dirname $0`" = "." ; then
28 AC_ERROR([please run the script from a separate build directory])
29fi
30
31dnl ------------------------------------------------------------------
32AC_CANONICAL_SYSTEM
33AC_PREFIX_DEFAULT(${PWD})
34AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
35AM_INIT_AUTOMAKE
36AC_PROG_CC
37AC_PROG_CXX
38AC_PROG_LIBTOOL
39
40AC_DEBUG
41AC_OPTIMIZATION
dc8f7cb7 42AM_CONDITIONAL(STANDALONE_SAMPLELIB, test 0 )
43
44dnl ------------------------------------------------------------------
45dnl A warning posted into the auto-generated files
46dnl Does NOT concern this file ;-)
47AUTOGENERATED_WARNING="!!!!!!! DO NOT EDIT THIS FILE !!!!!!"
48AC_SUBST([AUTOGENERATED_WARNING])
b521659f 49
50dnl ------------------------------------------------------------------
51dnl
52dnl Check for ROOT
53dnl
54ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
55AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
53feaef5 56AC_SUBST([ROOTSYS])
dc8f7cb7 57ROOTBINDIR=`dirname $ROOTEXEC`
58AC_SUBST([ROOTBINDIR])
59
dfaa582a 60dnl test for additional required root libraries and headers
61LIBS='-ldl'
62if test "x$have_root" = "x1"; then
63 AC_LANG_PUSH(C++)
64 save_CPPFLAGS=$CPPFLAGS
65 save_LDFLAGS=$LDFLAGS
66 save_LIBS=$LIBS
67 CPPFLAGS=`echo $save_CPPFLAGS; for i in ${ROOTINCDIR}; do echo -n "-I$i " ; done`
68
dc8f7cb7 69 # we check for the libSTEER library which is linked to
70 # - the ROOT libs libGeom libMinuit libVMC libEG
71 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
72 # - ROOT libCint needs also libdl
73 # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
74 # libTreePlayer.so
75 # - from Jan 07 libESD also depends on libXMLIO
fbf4d793 76 # - libSTEER depends on libProofPlayer since Oct 2007 (after v4-07-Release)
77 ROOT_CHECKLIBS='Geom Minuit EG VMC TreePlayer XMLIO Thread Proof ProofPlayer'
dc8f7cb7 78 for CHECKLIB in $ROOT_CHECKLIBS ; do
dc8f7cb7 79 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
80 LIBS="$save_LIBS $ROOTLIBS $ADD_ROOTLIBS"
81 AC_CHECK_LIB([$CHECKLIB],[_init], [ADD_ROOTLIBS="$ADD_ROOTLIBS -l$CHECKLIB"])
82 done
dfaa582a 83
84 # TBuffer.h has been made pure virtual in root v5-15-02 and one
85 # has to derive from TBufferFile.h (needed for BASE/AliHLTMessage.h)
ba4b0dd7 86 AC_CHECK_HEADER([TBufferFile.h], [], [HAVE_NOT_TBUFFERFILE])
dfaa582a 87
0b6c2560 88 # TView.h has been made pure virtual right after root v5-15-02 and one
89 # has to derive from TView3D.h (needed for TPCLib/OnlineDisplay/AliHLTTPCDisplay3D)
ba4b0dd7 90 AC_CHECK_HEADER([TView3D.h], [], [HAVE_NOT_TVIEW3D])
0b6c2560 91
dc8f7cb7 92 CPPFLAGS=$save_CPPFLAGS
93 LDFLAGS=$save_LDFLAGS
94 LIBS=$save_LIBS
dfaa582a 95 AC_LANG_POP(C++)
dc8f7cb7 96fi
b521659f 97
98dnl ------------------------------------------------------------------
99# TODO: make this configurable through arguments
100#Define whether you want to run with ALIROOT or only ROOT
101AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
102ALIHLT_USEPACKAGE=ALIROOT
103#ALIHLT_USEPACKAGE=ROOT
104#ALIHLT_USEPACKAGE=STANDALONE
105AC_DEFINE(use_aliroot)
106AC_DEFINE(use_root)
85869391 107CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
7233bc62 108save_CPPFLAGS=$CPPFLAGS
109save_LDFLAGS=$LDFLAGS
110save_LIBS=$LIBS
85869391 111
112dnl ------------------------------------------------------------------
74c73e5a 113dnl check for AliRoot features
114AC_LANG_PUSH(C++)
74c73e5a 115have_aliroot=no
2bbbadd1 116AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
117 [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
118 [])
119
120if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
121 dnl ------------------------------------------------------------------
122 dnl Try to estimate the system architecture
123 case $host_os:$host_cpu in
124 linux*:x86_64*) alice_target='linuxx8664gcc' ;;
125 linux*) alice_target='linux' ;;
126 *) alice_target='unknown' ;;
127 esac
128 if test "x$alice_target" = "xunknown" ; then
129 if test -z $ALICE_TARGET ; then
130 AC_MSG_ERROR([Can not estimate system architecture.
131 To avoid the problem, set the ALICE_TARGET variable appropriately.
132 Please send the following information to Matthias.Richter@ift.uib.no:
133 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
134 else
135 AC_MSG_NOTICE([Unknown system architecture.
136 Please send the following information to Matthias.Richter@ift.uib.no:
137 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
138 fi
139 else
140 if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
141 AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
142 overriding $ALICE_TARGET by $alice_target])
143 fi
144 ALICE_TARGET=$alice_target
145 fi
dc8f7cb7 146 ALIROOTBINDIR=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}
74c73e5a 147 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
148 ALIROOTINCDIR=${ALICE_ROOT}/include
dc8f7cb7 149 test -d ${ALIROOTBINDIR} || AC_MSG_WARN([can not find AliRoot binary directory $ALIROOTBINDIR])
2bbbadd1 150 test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
151 test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
74c73e5a 152fi
2bbbadd1 153
154AC_MSG_CHECKING([for AliRoot])
74c73e5a 155if test "x$ALICE_ROOT" != "x" \
dc8f7cb7 156 && test -d ${ALIROOTBINDIR} \
74c73e5a 157 && test -d ${ALIROOTLIBDIR} \
158 && test -d ${ALIROOTINCDIR}; then
159 have_aliroot=$ALICE_ROOT
160else
dc8f7cb7 161 ALIROOTBINDIR=
74c73e5a 162 ALIROOTLIBDIR=
163 ALIROOTINCDIR=
164fi
165AC_MSG_RESULT([$have_aliroot])
166
167if test ! "x$have_aliroot" = "xno" ; then
74c73e5a 168 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
169 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
cef8ce36 170 ALIROOT_LIBS="$ADD_ROOTLIBS"
74c73e5a 171 save_CPPFLAGS=$CPPFLAGS
172 save_LDFLAGS=$LDFLAGS
173 save_LIBS=$LIBS
174 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
db16520a 175 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
2bbbadd1 176
f8c5e339 177 # check for certain AliRoot libraries/files/features
c018a1bd 178 # libSTEERBase present since Aug 7 2007
179 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
180 CHECKLIB=STEERBase
181 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
182
f5bf5fc3 183 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
184 CHECKLIB=AOD
185 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
186
cef8ce36 187 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
188 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
189 CHECKLIB=CDB
190 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
191
2bbbadd1 192 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
193 have_alirawdata=no
194 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
195 CHECKLIB=RAWDatabase
196 AC_CHECK_LIB([$CHECKLIB],[_init],
197 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
cef8ce36 198 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lESD -lSTEER"
2bbbadd1 199 CHECKLIB=RAWDatarec
200 AC_CHECK_LIB([$CHECKLIB],[_init],
201 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
2bbbadd1 202 have_alirawdata=$CHECKLIB])],
203 [# second pass with -RAWData
204 CHECKLIB="-lRAWData"
205 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
206 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
207 #include <AliRawReaderFile.h>
208 #include <AliRawReaderDate.h>
209 #include <AliRawReaderRoot.h>],
210 [AliRawReaderMemory mreader;
211 AliRawReaderFile freader;
212 AliRawReaderDate dreader(NULL,0);
213 AliRawReaderRoot rreader(NULL,0);])],
e962f438 214 [ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
2bbbadd1 215 have_alirawdata=$CHECKLIB],
216 [have_alirawdata=no])
217 ]) dnl AC_CHECK_LIB RAWDatabase
fa274626 218 AC_MSG_CHECKING([for AliRawReader classes in RAWData libraries])
219 AC_MSG_RESULT([$have_alirawdata])
220
fbf4d793 221 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lSTEER"
cef8ce36 222 CHECKLIB=ESD
fbf4d793 223 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
224
225 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
226 CHECKLIB=STEER
227 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"],[have_aliroot=no])
228
229 dnl
230 dnl check whether AliLog supports notification callback
231 dnl
232 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
233 have_alilog_notification=no
234 if test ! "x$have_aliroot" = "xno" ; then
235 AC_MSG_CHECKING([whether AliLog supports notification callback])
236 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliLog.h>],
237 [AliLog::AliLogNotification fct])],
238 [have_alilog_notification=yes],
239 [AC_DEFINE(NO_ALILOG_NOTIFICATION)])
240 AC_MSG_RESULT([$have_alilog_notification])
241 fi
242
243 if test "x$have_aliroot" = "xno" ; then
244 # 2007-08-18 dont reset ALIROOT_CPPFLAGS in order to allow compilation
245 # but library dependencies might not be resolved completely
246 #ALIROOT_CPPFLAGS=
247 AC_MSG_WARN([some of the AliRoot library dependencies are not resolved.
248 This can happen from time to time due to development in AliRoot. You can
249 force compilation of detector libs by --enable-<detector>, but be aware
250 of unresolved references at runtime.])
251 AC_MSG_WARN([ ------------------------------------------ ])
252 AC_MSG_WARN([ Report this to $PACKAGE_BUGREPORT ])
253 AC_MSG_WARN([ please include config.log ])
254 AC_MSG_WARN([ ------------------------------------------ ])
255 ALIROOT_LDFLAGS=
256 ALIROOT_LIBS=
257 fi
258
f5bf5fc3 259 dnl
f527516f 260 dnl ESD supports non-std content
261 dnl
262 have_esd_nonstd=no
263 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <AliESDEvent.h>
264 #include <AliExternalTrackParam.h>
265 #include <TTree.h>
266 #include <TClonesArray.h>],
267 [AliESDEvent esd;
268 esd.CreateStdContent();
269 TTree* tree=new TTree("esdTree", "Tree with HLT ESD objects");
f527516f 270 TClonesArray* a=new TClonesArray("AliExternalTrackParam");
271 a->SetName("SomeObject");
272 esd.AddObject(a);
50a3793d 273 esd.WriteToTree(tree);
f527516f 274 if (!tree->FindBranch("SomeObject")) return 1;
275 return 0;])],
276 [have_esd_nonstd=yes],
277 [AC_DEFINE(HAVE_NOT_ESD_NONSTD)])
278 AC_MSG_CHECKING(whether ESD supports non standard content)
279 AC_MSG_RESULT([$have_esd_nonstd])
280
281 dnl
83cb7e1d 282 dnl ESD copy function added May 9 2008 rev 25667
283 dnl
f527516f 284 if test "x$have_esd_nonstd" != "xyes"; then
83cb7e1d 285 have_esd_copy=no
286 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliESDEvent.h>],
287 [AliESDEvent esd1;
288 AliESDEvent esd2;
289 esd2=esd1;])],
9877121c 290 [have_esd_copy=yes],
291 [AC_DEFINE(HAVE_NOT_ESD_COPY)])
83cb7e1d 292 AC_MSG_CHECKING(for ESD assignment operator)
293 AC_MSG_RESULT([$have_esd_copy])
f527516f 294 fi
83cb7e1d 295
296 dnl
296b5188 297 dnl AliRawReaderMemory support for multiple buffers added
c03e064d 298 dnl revision 26829 Jun 2008
296b5188 299 dnl
300 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/RAW"
301 have_rawreadermemory_multbuffers=no
302 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>],
303 [AliRawReaderMemory rr;
304 rr.AddBuffer(NULL, 0, 0);])],
305 [have_rawreadermemory_multbuffers=yes],
306 [AC_DEFINE(HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER)])
c03e064d 307 AC_MSG_CHECKING(AliRawReaderMemory support for multiple buffers)
296b5188 308 AC_MSG_RESULT([$have_rawreadermemory_multbuffers])
309
310 dnl
fbf4d793 311 dnl required header files and libraries for modules
f5bf5fc3 312 dnl
04dbc9e4 313
f59fee6d 314 dnl
315 dnl Check for the interface of AliExternalTrackParam which has been changed
316 dnl in revision 1.17 of AliExternalTrackParam.h (AliRoot version v4-05-04
317 dnl or higher)
318 externaltrackparam_version=1
319 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliExternalTrackParam.h>],
320 [AliExternalTrackParam trackparam;
321 Double_t param[[5]]; Double_t covar[[15]];
322 trackparam.Set(0., 0., param, covar);])],
323 [externaltrackparam_version=2],
324 [AC_DEFINE(EXTERNALTRACKPARAM_V1)])
325 AC_MSG_CHECKING(for version of AliExternalTrackParam)
326 AC_MSG_RESULT($externaltrackparam_version)
327
4646c6e3 328 dnl The AliShuttleInterface was changed in rev 29388. Some return types
329 dnl had been const, now changed according to gcc 4.3 warnings
330 AC_MSG_CHECKING(for version of AliShuttleInterface.h)
331 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/"
332 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
333 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
334 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliShuttleInterface.h>],
335 [class dummy : public AliShuttleInterface {
336 public:
337 const UInt_t GetStartTimeDCSQuery() {;}
338 };])],
339 [AC_DEFINE(SHUTTLE_PRE_REV29388_INTERFACE)
340 alishuttleinterface_version=pre.rev.29388],
341 [alishuttleinterface_version=up.to.date])
342 AC_MSG_RESULT([$alishuttleinterface_version])
343
74c73e5a 344 CPPFLAGS=$save_CPPFLAGS
345 LDFLAGS=$save_LDFLAGS
346 LIBS=$save_LIBS
7233bc62 347fi # if test ! "x$have_aliroot" = "xno"
f59fee6d 348
74c73e5a 349AC_LANG_POP(C++)
5f5b708b 350AC_SUBST([ALICE_ROOT])
74c73e5a 351AC_SUBST([ALIROOT_CPPFLAGS])
352AC_SUBST([ALIROOT_LDFLAGS])
dc8f7cb7 353AC_SUBST([ALIROOTBINDIR])
53feaef5 354AC_SUBST([ALIROOTLIBDIR])
74c73e5a 355AC_SUBST([ALIROOT_LIBS])
0f51f5b8 356AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
85869391 357
6c1a9d9e 358HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
359HLTBASE_LDFLAGS=
360AC_SUBST([HLTBASE_CPPFLAGS])
361AC_SUBST([HLTBASE_LDFLAGS])
362
85869391 363dnl ------------------------------------------------------------------
78b557c2 364dnl check for the HLT PubSub Framework
f8c5e339 365dnl namely for the existence of the HOMER library
366dnl from Sep 2007, the HOMER lib has been incorporated into the alice-hlt
367dnl package. It os though possible to choose an external. library
368dnl In order to make the origni of the HOMER lib clear, the one in AliRoot
369dnl got the name libAliHLTHOMER
78b557c2 370AC_MSG_CHECKING([for HLT PubSub Framework])
371AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
372 [],
373 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
374if test -z $with_pubsub || ! test -d $with_pubsub ; then
375 with_pubsub=no
376fi
377AC_MSG_RESULT([$with_pubsub])
f8c5e339 378HOMER_VERSION=2
5f1685a0 379HOMER_LIBS=
78b557c2 380
381AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
382if test "x$with_pubsub" != "xno" ; then
383 save_CPPFLAGS=$CPPFLAGS
384 save_LDFLAGS=$LDFLAGS
385 save_LIBS=$LIBS
4a6b4894 386 # currently the different versions of the HLT PubSub framework have a different
387 # directory layout
20b6dd9a 388 if test -d ${with_pubsub}/include/HOMER ; then
5235c3e9 389 # the 'early' location of the include files with separated HOMER sub dirs
9ce4bf4a 390 HOMER_INCDIRS="${with_pubsub}/include/HOMER ${with_pubsub}/include/HOMER/reader"
5235c3e9 391 elif test -d ${with_pubsub}/include/Util/HOMER ; then
392 # location for HLT Framework versions after Sep 2006
9ce4bf4a 393 HOMER_INCDIRS="${with_pubsub}/include/Util/HOMER"
5235c3e9 394 elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
395 # fall back if include files were not installed (versions after Sep 06)
9ce4bf4a 396 HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/include"
4a6b4894 397 else
5235c3e9 398 # fall back if include files were not installed (versions before Sep 06)
9ce4bf4a 399 HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/reader/include ${with_pubsub}/src/Util/HOMER/data/include"
4a6b4894 400 fi
9ce4bf4a 401 HOMER_CPPFLAGS=`for i in ${HOMER_INCDIRS}; do echo -n "-I$i " ; done`
5894eaa5 402
403 AC_ARG_ENABLE(pubsub-debug,
404 [AC_HELP_STRING([--disable-pubsub-debug],
405 [force the production version of the PubSub framework])],
406 [],[enable_pubsub_debug=yes])
407 homer_type="none"
408 HOMER_TARGET="`uname -s`-`uname -m`"
409 AC_MSG_CHECKING([for HLT PubSub Framework release type])
410 if test -d "${with_pubsub}/lib/${HOMER_TARGET}-release" ; then
411 homer_type="production"
412 HOMER_TARGET="${HOMER_TARGET}-release"
413 elif test "x$enable_pubsub_debug" = "xyes" && test -d "${with_pubsub}/lib/${HOMER_TARGET}-debug" ; then
414 homer_type="debug"
415 HOMER_TARGET="${HOMER_TARGET}-debug"
416 fi
417 AC_MSG_RESULT([${homer_type}])
f8c5e339 418 HOMERREADER_HEADER=HOMERReader.h
5894eaa5 419 HOMER_BINDIR="${with_pubsub}/bin/${HOMER_TARGET}"
420 HOMER_LIBDIR="${with_pubsub}/lib/${HOMER_TARGET}"
53feaef5 421 HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
78b557c2 422 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
423 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
424 LIBS="$save_LIBS "
425 with_homer=no
426 AC_LANG_PUSH(C++)
f8c5e339 427 AC_CHECK_HEADER([$HOMERREADER_HEADER],
5f1685a0 428 [ AC_CHECK_LIB([HOMER],[_init],
429 [with_homer=yes
430 HOMER_LIBS="-lHOMER"],
431 [ AC_CHECK_LIB([HOMERReader],[_init],
432 [with_homer=yes
433 HOMER_LIBS="-lHOMERReader"])])
434 LIBS="$LIBS $HOMER_LIBS"
9ce4bf4a 435 AC_MSG_CHECKING([version of HOMER library])
5f1685a0 436 dnl The Homer library has no versioning, so we do our own
437 dnl version description
438 dnl ----------------------------------------------------------------------
439 dnl 1 inintial version
440 dnl 2 GetBlockStatusFlags added to the interface
441 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
442 [HOMERReader reader("dummy", 0);
443 reader.GetBlockStatusFlags(0);])],
f8c5e339 444 [],
445 [HOMER_VERSION=1])
5f1685a0 446 AC_MSG_RESULT([$HOMER_VERSION])
f8c5e339 447 ],
448 [HOMERREADER_HEADER=]) #AC_CHECK_HEADER([$HOMERREADER_HEADER])
78b557c2 449 AC_LANG_POP(C++)
f8c5e339 450 HOMER_INBUILT_LIB=
451else
452dnl no pubsub version defined, check if the HOMER lib is available in AliRoot
453 topdir=`dirname $0`
454 HOMER_CPPFLAGS="-I`(cd $topdir; pwd)`/BASE/HOMER"
455 HOMERREADER_HEADER=AliHLTHOMERReader.h
456 HOMER_INBUILT_LIB=`pwd`/BASE/HOMER/libAliHLTHOMER.la
457 HOMER_BINDIR=
458 HOMER_LIBDIR=
459 HOMER_LDFLAGS=
460fi
461
78b557c2 462 if test "x$with_homer" = "xno" ; then
463 HOMER_CPPFLAGS=
464 HOMER_LDFLAGS=
5f1685a0 465 HOMER_LIBS=
78b557c2 466 else
5f1685a0 467 HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
78b557c2 468 AC_DEFINE(HAVE_HOMERREADER)
469 fi
470 CPPFLAGS="$save_CPPFLAGS"
471 LDFLAGS="$save_LDFLAGS"
472 LIBS="$save_LIBS"
f8c5e339 473
474AC_SUBST([HOMERREADER_HEADER])
475AC_SUBST([HOMER_INBUILT_LIB])
78b557c2 476AC_SUBST([HOMER_CPPFLAGS])
477AC_SUBST([HOMER_LDFLAGS])
53feaef5 478AC_SUBST([HOMER_LIBDIR])
479AC_SUBST([HOMER_BINDIR])
5f1685a0 480AC_SUBST([HOMER_LIBS])
78b557c2 481
482dnl ------------------------------------------------------------------
7233bc62 483AC_ARG_ENABLE(all,
484 [AC_HELP_STRING([--disable-all],
485 [disable all detector modules, individual modules can be switched on by --enable-det])],
486 [disable_all=yes],[])
487
488dnl ------------------------------------------------------------------
85869391 489AC_MSG_CHECKING([whether to impose strict coding conventions])
490AC_ARG_ENABLE(strict,
2028353f 491 [AC_HELP_STRING([--disable-strict],
492 [disable coding convention checks ])],
493 [],[enable_strict=yes])
85869391 494if test "x$enable_strict" = "xyes" ; then
f7561f8d 495 CPPFLAGS="$CPPFLAGS -W -Weffc++ -Wall -Wshadow"
85869391 496fi
497AC_MSG_RESULT([$enable_strict])
b521659f 498
499dnl ------------------------------------------------------------------
5b6ab198 500AC_MSG_CHECKING([whether to enable component statistics])
501AC_ARG_ENABLE(component-stat,
502 [AC_HELP_STRING([--enable-component-stat],
503 [enable component statistics ])],
504 [],[enable_component_stat=no])
505if test "x$enable_component_stat" = "xyes" ; then
506 AC_DEFINE(HLT_COMPONENT_STATISTICS)
507fi
508AC_MSG_RESULT([$enable_component_stat])
509
510dnl ------------------------------------------------------------------
cad2d06c 511dnl ---- module checks
512dnl ------------------------------------------------------------------
513save_CPPFLAGS=$CPPFLAGS
514save_LDFLAGS=$LDFLAGS
515save_LIBS=$LIBS
516
517dnl ------------------------------------------------------------------
b521659f 518AC_MSG_CHECKING([whether to compile sample library])
519AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
520AC_ARG_ENABLE(sample,
c018a1bd 521 [AC_HELP_STRING([--disable-sample],
b521659f 522 [compile the sample library ])],
2e742d30 523 [],
524 [if test "x$have_aliroot" = "xno" ; then
525 enable_sample="no...requires.AliRoot"
526 else
527 enable_sample=yes
528 fi
529 ])
530
b521659f 531if test "x$enable_sample" = "xyes" ; then
532 AC_DEFINE(HLT_SAMPLE)
533fi
534AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
535AC_MSG_RESULT([$enable_sample])
536
537dnl ------------------------------------------------------------------
c018a1bd 538AC_MSG_CHECKING([whether to compile util library])
539AH_TEMPLATE([HLT_UTIL],[HLT utility library])
540AC_ARG_ENABLE(util,
541 [AC_HELP_STRING([--disable-util],
542 [compile the util library ])],
2e742d30 543 [],
544 [if test "x$have_aliroot" = "xno" ; then
545 enable_util="no...requires.AliRoot"
546 else
547 enable_util=yes
548 fi
549 ])
c018a1bd 550
551if test "x$enable_util" = "xyes" ; then
552 AC_DEFINE(HLT_UTIL)
553fi
554AM_CONDITIONAL(EN_HLT_UTIL, test x$enable_util = xyes)
555AC_MSG_RESULT([$enable_util])
556
557dnl ------------------------------------------------------------------
b521659f 558AH_TEMPLATE([HLT_TPC],[hlt tpc library])
f59fee6d 559
e642ae99 560ALITPC_LIBS=
f59fee6d 561CHECK_HLTMODULE([tpc],
e962f438 562 [AliTPCRawStream.h],
563 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/TPC],
70d00903 564 [Gui ANALYSIS STAT], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
e642ae99 565 [TPCbase TPCrec TPCcalib], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
f59fee6d 566 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
567
c6b46c3f 568if test "x$enable_module" = "xmissheader"; then
569 enable_module="no...missing.headers"
50a3793d 570 enable_tpc=$enable_module
c6b46c3f 571elif test "x$enable_module" = "xforce"; then
572 enable_tpc="yes"
f59fee6d 573else
574 enable_tpc=$enable_module
575fi
2e742d30 576
b521659f 577if test "x$enable_tpc" = "xyes" ; then
e642ae99 578 AC_LANG_PUSH(C++)
b521659f 579 AC_DEFINE(HLT_TPC)
e642ae99 580 ALITPC_LIBS=$ALIHLTMODULE_LIBS
581 dnl
582 dnl Check for functionality in the TPC reconstruction required for online
583 dnl processing
584 dnl
585 have_tpc_hltoffline_rec=no
586 AC_MSG_CHECKING(for on-line features of TPC offline reconstruction)
587 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
588 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
589 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
590 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliTPCtrackerMI.h>
591 #include <AliTPCclustererMI.h>
592 #include <TObjArray.h>],
593 [AliTPCtrackerMI tracker;
594 TObjArray* array=NULL;
595 tracker.LoadClusters(array);
596 AliTPCclustererMI cl(NULL, NULL);
89c2e505 597 cl.GetOutputClonesArray();])],
e642ae99 598 [have_tpc_hltoffline_rec=yes],
599 [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)])
cad2d06c 600 LIBS=$save_LIBS
e642ae99 601 AC_MSG_RESULT([$have_tpc_hltoffline_rec])
602
603 AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])
604 AC_CHECK_HEADER([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)])
605
606 have_tpc_mapping=no
607 if test ! "x$have_aliroot" = "xno" ; then
608 # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC
609 # which is stored in the TPC/mapping/Patchx.data files from
610 # AliRoot version v4-04-Release (May 2006)
611 AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
612 TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
613 AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data],
614 [have_tpc_mapping=yes
615 AC_SUBST(TPC_PAD_MAPPING_PATH)
616 AC_DEFINE(HAVE_TPC_MAPPING)],
617 [])
618
619 fi
620 AC_MSG_CHECKING([for TPC mapping layout])
621 AC_MSG_RESULT([$have_tpc_mapping])
622 AC_LANG_POP(C++)
623
adec4ad4 624else
625 enable_module=$enable_tpc
b521659f 626fi
627AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
d6e2c707 628AC_MSG_CHECKING([whether to compile TPC library])
c6b46c3f 629AC_MSG_RESULT([$enable_module])
f59fee6d 630AC_SUBST([ALITPC_LIBS])
b521659f 631
632dnl ------------------------------------------------------------------
5e3820e2 633AH_TEMPLATE([HLT_RCU],[hlt rcu library])
634
635CHECK_HLTMODULE([rcu],
636 [AliAltroDecoder.h],
637 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/RAW],
638 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
639 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
640 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
641
642if test "x$enable_module" = "xmissheader"; then
643 enable_module="no...missing.headers"
50a3793d 644 enable_rcu=$enable_module
5e3820e2 645elif test "x$enable_module" = "xforce"; then
646 enable_rcu="yes"
647else
648 AC_LANG_PUSH(C++)
5e3820e2 649 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
650 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
651 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
652 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliAltroDecoder.h>],
653 [AliAltroDecoder decoder;
654 decoder.CopyBackward(NULL, 0);])],
655 [enable_rcu=$enable_module],
656 [enable_module="no...requires.AliRoot>v4-10-Release"
657 enable_rcu="no...requires.AliRoot>v4-10-Release"])
658 CPPFLAGS=$save_CPPFLAGS
659 LDFLAGS=$save_LDFLAGS
660 LIBS=$save_LIBS
661 AC_LANG_POP(C++)
662fi
663
664if test "x$enable_rcu" = "xyes" ; then
665 AC_DEFINE(HLT_RCU)
adec4ad4 666else
667 enable_module=$enable_rcu
5e3820e2 668fi
669AM_CONDITIONAL(EN_HLT_RCU, test x$enable_rcu = xyes)
d6e2c707 670AC_MSG_CHECKING([whether to compile RCU library])
5e3820e2 671AC_MSG_RESULT([$enable_module])
672AC_SUBST([ALIRCU_LIBS])
673
674dnl ------------------------------------------------------------------
c160eda8 675AH_TEMPLATE([HLT_PHOS],[hlt phos library])
f59fee6d 676
677ALIPHOS_LIBS=
678CHECK_HLTMODULE([phos],
679 [], [$ALIROOT_CPPFLAGS],
680 [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
70979a80 681 [PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
f59fee6d 682 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
683
c6b46c3f 684if test "x$enable_module" = "xmissheader"; then
685 enable_module="no...requires.AliRoot>v4-05-07"
50a3793d 686 enable_phos=$enable_module
c6b46c3f 687elif test "x$enable_module" = "xforce"; then
688 enable_phos="yes"
f59fee6d 689else
690 have_alicalorawstream=no
691 if test ! "x$have_aliroot" = "xno" ; then
692 AC_LANG_PUSH(C++)
693 save_CPPFLAGS="$CPPFLAGS"
694 # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
695 #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
56584e00 696 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
f59fee6d 697 AC_MSG_CHECKING([for AliCaloRawStream.h usability])
698 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
699 #include <AliCaloRawStream.h>],
700 [int i])],
701 [AC_DEFINE(HAVE_ALICALORAWSTREAM)
702 have_alicalorawstream=yes],
703 [])
ae1c1854 704 AC_MSG_RESULT([$have_aliphosrecoparam])
705 AC_MSG_CHECKING([for required EMC functionality in AliPHOSRecoParam.h ])
706 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliPHOSRecoParam.h>],
707 [AliPHOSRecoParam param;
708 param.GetEMCClusteringThreshold()])],
709 [have_aliphosrecoparam=yes],
710 [AC_DEFINE(HAVE_NOT_PHOSRECOPARAMEMC)])
f59fee6d 711 AC_MSG_RESULT([$have_alicalorawstream])
712 AC_LANG_POP(C++)
713 CPPFLAGS="$save_CPPFLAGS"
714 fi
715 if test "x$have_alicalorawstream" != "xyes"; then
716 enable_phos="no...requires.AliRoot>v4-05-07"
717 else
718 enable_phos=$enable_module
719 fi
720fi
2e742d30 721
c160eda8 722if test "x$enable_phos" = "xyes" ; then
723 AC_DEFINE(HLT_PHOS)
f59fee6d 724 ALIPHOS_LIBS=$ALIHLTMODULE_LIBS
adec4ad4 725else
726 enable_module=$enable_phos
c160eda8 727fi
728AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
d6e2c707 729AC_MSG_CHECKING([whether to compile PHOS library])
c6b46c3f 730AC_MSG_RESULT([$enable_module])
f59fee6d 731AC_SUBST([ALIPHOS_LIBS])
c160eda8 732
c6b46c3f 733dnl ------------------------------------------------------------------
734AH_TEMPLATE([HLT_TRD],[hlt trd library])
735
f59fee6d 736ALITRD_LIBS=
737CHECK_HLTMODULE([trd],
738 [], [],
b3f74118 739 [MLP XMLParser], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
f59fee6d 740 [TRDbase TRDrec TRDsim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
741 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
742
c6b46c3f 743if test "x$enable_module" = "xmissheader"; then
744 enable_module="no...requires.AliRoot>v4-07-Release"
50a3793d 745 enable_trd=$enable_module
c6b46c3f 746elif test "x$enable_module" = "xforce"; then
747 enable_trd="yes"
f59fee6d 748else
749 enable_trd=$enable_module
750 if test "x$enable_trd" = "xyes" ; then
751 AC_LANG_PUSH(C++)
752 save_CPPFLAGS="$CPPFLAGS"
753 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/TRD"
adec4ad4 754 # AliTRDclusterizer::SetRawVersion() requires >v4-07-Release
755 # changed to AliTRDrecoParam::SetSeedingOn() due to revision 26327, Mon Jun 2 2008
0d66dbf5 756 # changed to AliTRDReconstructor::SetStreamLevel() due to revision 27797, Tue Aug 5 2008
ae5bf1dd 757 # changed to AliTRDReconstructor::SetClusters() according to revision 28069, Mon Aug 18 2008
cef8ce36 758 # changed to AliTRDCluster according to revision 30461, Thu Dec 18 2008
759 AC_MSG_CHECKING([for required functions in AliTRDCluster])
760 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDcluster.h>],
761 [AliTRDcluster c;
762 c.SetDetector(0)])],
f59fee6d 763 [],
cef8ce36 764 [enable_trd="no...requires.AliRoot>v4-16-Release"])
f59fee6d 765 AC_MSG_RESULT([$enable_trd])
766 AC_LANG_POP(C++)
767 CPPFLAGS="$save_CPPFLAGS"
768 fi
769fi
2e742d30 770
0f51f5b8 771if test "x$enable_trd" = "xyes" ; then
772 AC_DEFINE(HLT_TRD)
f59fee6d 773 ALITRD_LIBS=$ALIHLTMODULE_LIBS
adec4ad4 774else
775 enable_module=$enable_trd
0f51f5b8 776fi
777AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
d6e2c707 778AC_MSG_CHECKING([whether to compile TRD library])
c6b46c3f 779AC_MSG_RESULT([$enable_module])
f59fee6d 780AC_SUBST([ALITRD_LIBS])
0f51f5b8 781
782dnl ------------------------------------------------------------------
629266d1 783AH_TEMPLATE([HLT_FMD],[hlt fmd library])
784
785ALIFMD_LIBS=$ALIHLTMODULE_LIBS
786CHECK_HLTMODULE([fmd],
787 [], [],
788 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
50a3793d 789 [FMDbase FMDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
629266d1 790 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
791
792if test "x$enable_module" = "xmissheader"; then
50a3793d 793 enable_module="no...missing.headers"
794 enable_fmd=$enable_module
629266d1 795elif test "x$enable_module" = "xforce"; then
796 enable_fmd="yes"
797else
798 enable_fmd=$enable_module
629266d1 799fi
800
801if test "x$enable_fmd" = "xyes" ; then
802 AC_DEFINE(HLT_FMD)
803 ALIFMD_LIBS=$ALIHLTMODULE_LIBS
804else
805 enable_module=$enable_fmd
806fi
807AM_CONDITIONAL(EN_HLT_FMD, test x$enable_fmd = xyes)
808AC_MSG_CHECKING([whether to compile FMD library])
809AC_MSG_RESULT([$enable_module])
810AC_SUBST([ALIFMD_LIBS])
811
629266d1 812dnl ------------------------------------------------------------------
94cc9aab 813AH_TEMPLATE([HLT_MUON],[hlt dimuon library])
2e742d30 814
f59fee6d 815ALIMUON_LIBS=
e89e6b23 816CHECK_HLTMODULE([dimuon],
41f99620 817 [AliMpExMap.h AliMUONTriggerIO.h],
818 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/MUON -I$ALICE_ROOT/MUON/mapping],
b3f74118 819 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
820 [MUONcore MUONraw MUONbase MUONgeometry MUONmapping MUONcalib MUONsim MUONtrigger MUONevaluation MUONrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
f59fee6d 821 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
822
823if test "x$enable_module" = "xmissheader"; then
a853a794 824 enable_module="no...requires.AliRoot>=v4-08-Release"
50a3793d 825 enable_muon=$enable_module
c6b46c3f 826elif test "x$enable_module" = "xforce"; then
827 enable_muon="yes"
f59fee6d 828else
829 enable_muon=$enable_module
830fi
831
832if test "x$enable_muon" = "xyes" ; then
94cc9aab 833 AC_DEFINE(HLT_MUON)
f59fee6d 834 ALIMUON_LIBS=$ALIHLTMODULE_LIBS
6ed1b948 835 AC_LANG_PUSH(C++)
accd4c8f 836 save_CPPFLAGS="$CPPFLAGS"
837
6ed1b948 838 dnl
839 dnl Check for functionality GetRawStream AliMUONDigitMaker.h
840 dnl
841 have_muon_digitmaker_getrawstream=no
842 AC_MSG_CHECKING(for GetRawStream methods of AliMUONDigitMaker)
843 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON"
844 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
845 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
846 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMUONDigitMaker.h>],
847 [AliMUONDigitMaker dm;
848 dm.GetRawStreamTracker();])],
849 [have_muon_digitmaker_getrawstream=yes],
850 [AC_DEFINE(HAVE_NOT_MUON_DIGITMAKER_GETRAWSTREAM)])
851 LIBS=$save_LIBS
852 AC_MSG_RESULT([$have_muon_digitmaker_getrawstream])
accd4c8f 853 CPPFLAGS="$save_CPPFLAGS"
6ed1b948 854
855 AC_LANG_POP(C++)
adec4ad4 856else
857 enable_module=$enable_muon
94cc9aab 858fi
f59fee6d 859AM_CONDITIONAL(EN_HLT_MUON, test x$enable_muon = xyes)
d6e2c707 860AC_MSG_CHECKING([whether to compile MUON library])
c6b46c3f 861AC_MSG_RESULT([$enable_module])
f59fee6d 862AC_SUBST([ALIMUON_LIBS])
94cc9aab 863
864dnl ------------------------------------------------------------------
d6e2c707 865AH_TEMPLATE([HLT_TRIGGER],[hlt trigger library])
866
867ALITRIGGER_LIBS=
868CHECK_HLTMODULE([trigger],
869 [], [$ALIROOT_CPPFLAGS],
870 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
871 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
872 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
873
874if test "x$enable_module" = "xmissheader"; then
875 enable_module="no...header.missing"
50a3793d 876 enable_trigger=$enable_module
d6e2c707 877elif test "x$enable_module" = "xforce"; then
878 enable_trigger="yes"
879else
880 enable_trigger=$enable_module
881fi
882
883if test "x$enable_trigger" = "xyes" ; then
884 AC_DEFINE(HLT_TRIGGER)
885 ALITRIGGER_LIBS=$ALIHLTMODULE_LIBS
adec4ad4 886else
887 enable_module=$enable_trigger
d6e2c707 888fi
889AM_CONDITIONAL(EN_HLT_TRIGGER, test x$enable_trigger = xyes)
890AC_MSG_CHECKING([whether to compile Trigger library])
891AC_MSG_RESULT([$enable_module])
892AC_SUBST([ALITRIGGER_LIBS])
893
894dnl ------------------------------------------------------------------
895AH_TEMPLATE([HLT_ITS],[hlt its library])
896
897ALIITS_LIBS=
898CHECK_HLTMODULE([its],
ae5bf1dd 899 [AliITSCompressRawDataSDD.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS],
cad2d06c 900 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
901 [ITSbase ITSrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
d6e2c707 902 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
903
904if test "x$enable_module" = "xmissheader"; then
905 enable_module="no...header.missing"
50a3793d 906 enable_its=$enable_module
d6e2c707 907elif test "x$enable_module" = "xforce"; then
908 enable_its="yes"
909else
910 enable_its=$enable_module
adec4ad4 911 if test "x$enable_its" = "xyes" ; then
912 AC_LANG_PUSH(C++)
913 save_CPPFLAGS="$CPPFLAGS"
914 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS"
915 # changes in the AliVertexer base class revision 26414, Thu Jun 5 15:36:18 2008
916 # require AliVertexer::GetNominalPos()
917 AC_MSG_CHECKING([for required functions in AliITSVertexer])
918 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliITSVertexerZ.h>],
919 [AliITSVertexerZ v;
920 v.GetNominalPos()])],
921 [],
922 [enable_its="no...requires.AliRoot>v4-13-Release"])
923 AC_MSG_RESULT([$enable_its])
924 AC_LANG_POP(C++)
925 CPPFLAGS="$save_CPPFLAGS"
926 fi
d6e2c707 927fi
928
929if test "x$enable_its" = "xyes" ; then
930 AC_DEFINE(HLT_ITS)
931 ALIITS_LIBS=$ALIHLTMODULE_LIBS
adec4ad4 932else
933 enable_module=$enable_its
d6e2c707 934fi
935AM_CONDITIONAL(EN_HLT_ITS, test x$enable_its = xyes)
936AC_MSG_CHECKING([whether to compile ITS library])
937AC_MSG_RESULT([$enable_module])
938AC_SUBST([ALIITS_LIBS])
939
940dnl ------------------------------------------------------------------
5dded172 941AH_TEMPLATE([HLT_EMCAL],[hlt emcal library])
942
943ALIEMCAL_LIBS=
944CHECK_HLTMODULE([emcal],
945 [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/EMCAL],
accd4c8f 946 [RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
947 [EMCALrec EMCALsim EMCALbase], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
5dded172 948 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
949
950if test "x$enable_module" = "xmissheader"; then
951 enable_module="no...header.missing"
952 enable_emcal=$enable_module
953elif test "x$enable_module" = "xforce"; then
954 enable_emcal="yes"
955else
956 enable_emcal=$enable_module
957fi
958
959if test "x$enable_emcal" = "xyes" ; then
960 AC_DEFINE(HLT_EMCAL)
961 ALIEMCAL_LIBS=$ALIHLTMODULE_LIBS
962else
963 enable_module=$enable_emcal
964fi
965AM_CONDITIONAL(EN_HLT_EMCAL, test x$enable_emcal = xyes)
966AC_MSG_CHECKING([whether to compile EMCAL library])
967AC_MSG_RESULT([$enable_module])
968AC_SUBST([ALIEMCAL_LIBS])
969
970dnl ------------------------------------------------------------------
e89e6b23 971AH_TEMPLATE([HLT_COMP],[hlt comp library])
972
973ALICOMP_LIBS=
974CHECK_HLTMODULE([comp],
975 [], [$ALIROOT_CPPFLAGS],
976 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
977 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
978 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
979
980if test "x$enable_module" = "xmissheader"; then
c6b46c3f 981 enable_module="no...header.missing"
50a3793d 982 enable_comp=$enable_module
c6b46c3f 983elif test "x$enable_module" = "xforce"; then
984 enable_comp="yes"
e89e6b23 985else
986 enable_comp=$enable_module
987fi
988
989if test "x$enable_comp" = "xyes" ; then
990 AC_DEFINE(HLT_COMP)
991 ALICOMP_LIBS=$ALIHLTMODULE_LIBS
adec4ad4 992else
993 enable_module=$enable_comp
e89e6b23 994fi
995AM_CONDITIONAL(EN_HLT_COMP, test x$enable_comp = xyes)
996AC_MSG_CHECKING([whether to compile comp library])
c6b46c3f 997AC_MSG_RESULT([$enable_module])
e89e6b23 998AC_SUBST([ALICOMP_LIBS])
999
1000dnl ------------------------------------------------------------------
fc455fba 1001AC_MSG_CHECKING([whether to disable AliRoot logging])
1002AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
1003AC_ARG_ENABLE(aliroot-logging,
1004 [AC_HELP_STRING([--disable-aliroot-logging],
1005 [disable logging through AliRoot logging methods])],
1006 [],[enable_aliroot_logging=no])
c018a1bd 1007if test "x$have_aliroot" = "xno" ; then
1008 enable_aliroot_logging=yes # this means 'disable'
1009fi
fc455fba 1010if test "x$enable_aliroot_logging" != "xno" ; then
1011 AC_DEFINE(NOALIROOT_LOGGING)
b521659f 1012fi
fc455fba 1013AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
1014AC_MSG_RESULT([$enable_aliroot_logging])
b521659f 1015
1016dnl ------------------------------------------------------------------
1017AC_MSG_CHECKING([whether to enable saving MC data through the chain])
1018AH_TEMPLATE([DOMC],[MC saving])
1019AC_ARG_ENABLE(mc-saving,
1020 [AC_HELP_STRING([--enable-mc-saving],
1021 [enable saving MC data through the chain])],
1022 [],[enable_mc_saving=no])
1023if test "x$enable_mc_saving" = "xyes" ; then
1024 AC_DEFINE(DOMC)
1025fi
1026AC_MSG_RESULT([$enable_mc_saving])
1027
1028dnl ------------------------------------------------------------------
b521659f 1029dnl certainly something old, but we keep the define
1030AC_MSG_CHECKING([whether to use ROWHOUGH])
1031AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
1032AC_ARG_ENABLE(rowhough,
1033 [AC_HELP_STRING([--enable-rowhough],
1034 [use ROWHOUGH ])],
1035 [],[enable_rowhough=no])
1036if test "x$enable_rowhough" = "xyes" ; then
1037 AC_DEFINE(USEROWHOUGH)
1038fi
1039AC_MSG_RESULT([$enable_rowhough])
1040
1041dnl ------------------------------------------------------------------
53feaef5 1042dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
1043dnl stand-alone build system. This is most likely something old we can
1044dnl get rid off later, or do something more reasonable. Since the define
1045dnl needs the quotes they have to be escaped. This works well for the
1046dnl Makefile but not for the configure script. So we have to add the
1047dnl defines after all the other checks.
1048CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
1049if test ! "x$have_aliroot" = "xno" ; then
1050 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
1051fi
1052
1053dnl ------------------------------------------------------------------
b521659f 1054dnl
1055dnl Documentation
1056dnl
1057AC_ARG_VAR(DOXYGEN, The Documentation Generator)
1058AC_PATH_PROG(PERL, perl)
1059AC_PATH_PROG(DOXYGEN, doxygen)
5894eaa5 1060AC_ARG_ENABLE(dot,
1061 [AC_HELP_STRING([--enable-dot],
1062 [enable dot documentation generator])],
1063 [],[enable_dot=no])
b521659f 1064HAVE_DOT=NO
1065DOT_PATH=
1066AC_PATH_PROG(DOT, dot)
5894eaa5 1067if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
b521659f 1068 HAVE_DOT=YES
1069 DOT_PATH=`dirname $DOT`
1070fi
ae1c1854 1071
1072AC_MSG_CHECKING([for documentation mode])
1073AC_ARG_ENABLE(doc,
1074 [AC_HELP_STRING([--disable-doc],
1075 [disable documentation build; monolithic build --enable-doc=mono ])],
1076 [],[enable_doc=modules])
fb345ed7 1077
ae1c1854 1078if test "x$DOXYGEN" = "x" ; then
1079 enable_doc=no.doxygen
fb345ed7 1080elif test "x$enable_doc" = "xyes" ; then
1081 enable_doc=yes
ae1c1854 1082elif test ! "x$enable_doc" = "xmono" && \
1083 test ! "x$enable_doc" = "xmodules" && \
1084 test ! "x$enable_doc" = "xno"; then
1085 enable_doc=no
1086 AC_MSG_WARN([unknown option])
1087fi
1088if test "x$enable_doc" = "xno" ; then
1089 enable_doc=off
1090 DOXYGEN=
1091fi
1092
1093AC_MSG_RESULT([$enable_doc])
1094AM_CONDITIONAL(MONOLITHIC_DOC, test "x$enable_doc" = "xmono")
1095AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
b521659f 1096AC_SUBST([HAVE_DOT])
1097AC_SUBST([DOT_PATH])
1098
90ebac25 1099dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
1100dnl echo $HAVE_SRC_SUBDIR
1101dnl if ! test -d $HAVE_SRC_SUBDIR; then
1102dnl HAVE_SRC_SUBDIR=
1103dnl fi
1104dnl AC_SUBST([HAVE_SRC_SUBDIR])
1105
b521659f 1106dnl ------------------------------------------------------------------
7233bc62 1107AC_MSG_NOTICE([---------------------------------------------- ])
1108AC_MSG_NOTICE([ build summary ])
1109AC_MSG_NOTICE([---------------------------------------------- ])
1110
b521659f 1111AC_CONFIG_FILES([Makefile
1112 BASE/Makefile
53feaef5 1113 BASE/setenv.sh
1114 BASE/setenv.csh
2be16a33 1115 BASE/HOMER/Makefile
242bb794 1116 BASE/util/Makefile
d098ebd4 1117 BASE/interface/Makefile
853121af 1118 BASE/test/Makefile
1a21074a 1119 BASE/interface/test/Makefile
b521659f 1120 doc/Makefile
2efb85be 1121 doc/doxygen.conf
1122 doc/doxymodule.conf])
b521659f 1123
7233bc62 1124dnl AliRoot and installation directory for libraries
1125dnl
1126AC_MSG_NOTICE([AliRoot: $have_aliroot])
1127AM_CONDITIONAL(HAVE_ALIROOT, test "x$have_aliroot" != "xno" )
1128if test "x$have_aliroot" != "xno"; then
1129 AC_CONFIG_FILES([sim/Makefile
1130 rec/Makefile
652cf9d2 1131 rec/test/Makefile
436c2d0c 1132 rec/startAliEVE-barrel-tracks.sh
7233bc62 1133 shuttle/Makefile
ff4edcee 1134 pendolino/Makefile
ce5f90bf 1135 benchmark/Makefile
7233bc62 1136 ])
1137fi
1138if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
1139libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
1140AC_MSG_NOTICE([libdir set to $libdir])
1141fi
1142
1143AC_MSG_NOTICE([compile sample library: $enable_sample])
1144if test "x$enable_sample" = "xyes"; then
1145 AC_CONFIG_FILES([SampleLib/Makefile])
1146fi
1147
652cf9d2 1148AC_MSG_NOTICE([compile RCU library: $enable_rcu])
1149if test "x$enable_rcu" = "xyes"; then
1150 AC_CONFIG_FILES([RCU/Makefile
1151 RCU/test/Makefile
1152 ])
1153fi
1154
7233bc62 1155AC_MSG_NOTICE([compile TPC library: $enable_tpc])
1156if test "x$enable_tpc" = "xyes"; then
1157 AC_CONFIG_FILES([TPCLib/Makefile
1158 TPCLib/test/Makefile
1159 TPCLib/mapping2array.cxx
b658d7e4 1160 TPCLib/EVE/Makefile
7233bc62 1161 ])
1162fi
1163
7233bc62 1164AC_MSG_NOTICE([compile PHOS library: $enable_phos])
1165if test "x$enable_phos" = "xyes"; then
1166 AC_CONFIG_FILES([PHOS/Makefile])
1167fi
1168
1169AC_MSG_NOTICE([compile TRD library: $enable_trd])
1170if test "x$enable_trd" = "xyes"; then
1171 AC_CONFIG_FILES([TRD/Makefile])
1172fi
1173
50a3793d 1174AC_MSG_NOTICE([compile FMD library: $enable_fmd])
1175if test "x$enable_fmd" = "xyes"; then
1176 AC_CONFIG_FILES([FMD/Makefile])
1177fi
1178
7233bc62 1179AC_MSG_NOTICE([compile MUON library: $enable_muon])
1180if test "x$enable_muon" = "xyes"; then
1181 AC_CONFIG_FILES([MUON/Makefile])
1182fi
1183
1184AC_MSG_NOTICE([compile ITS library: $enable_its])
1185if test "x$enable_its" = "xyes"; then
1186 AC_CONFIG_FILES([ITS/Makefile])
1187fi
1188
5dded172 1189AC_MSG_NOTICE([compile EMCAL library: $enable_emcal])
1190if test "x$enable_emcal" = "xyes"; then
1191 AC_CONFIG_FILES([EMCAL/Makefile])
1192fi
1193
7233bc62 1194AC_MSG_NOTICE([compile trigger library: $enable_trigger])
1195if test "x$enable_trigger" = "xyes"; then
0a76630e 1196 AC_CONFIG_FILES([trigger/Makefile
1197 trigger/test/Makefile])
7233bc62 1198fi
1199
1200AC_MSG_NOTICE([compile comp library: $enable_comp])
1201if test "x$enable_comp" = "xyes"; then
1202 AC_CONFIG_FILES([comp/Makefile])
1203fi
b521659f 1204
1205AC_OUTPUT
1206dnl
1207dnl EOF
1208dnl
1209