]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/configure.ac
First version of ACORDE QA reference data. Up tp now, we use the modules activity...
[u/mrichter/AliRoot.git] / HLT / configure.ac
1 dnl -*- mode: autoconf -*- 
2 dnl
3 dnl $Id$
4 dnl template for the configuration script for the Alice HLT 
5 dnl framework and components
6 dnl 
7 dnl ------------------------------------------------------------------
8
9 dnl Take either the AliRoot tag as version id or the current revision
10 AC_INIT([Alice High Level Trigger] , 
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]),
20         [Matthias.Richter@ift.uib.no], 
21         [alice-hlt])
22
23 dnl ------------------------------------------------------------------
24 dnl the package from CVS contains the old Makefiles as well. In order to
25 dnl prevent them from becoming overwritten, we require a separate build
26 dnl directory
27 if test "`dirname $0`" = "." ; then
28    AC_ERROR([please run the script from a separate build directory])
29 fi
30
31 dnl ------------------------------------------------------------------
32 AC_CANONICAL_SYSTEM
33 AC_PREFIX_DEFAULT(${PWD})
34 AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
35 AM_INIT_AUTOMAKE
36 AC_PROG_CC
37 AC_PROG_CXX
38 AC_PROG_LIBTOOL
39
40 AC_DEBUG
41 AC_OPTIMIZATION
42 AM_CONDITIONAL(STANDALONE_SAMPLELIB, test 0 )
43
44 dnl ------------------------------------------------------------------
45 dnl A warning posted into the auto-generated files
46 dnl Does NOT concern this file ;-)
47 AUTOGENERATED_WARNING="!!!!!!!    DO NOT EDIT THIS FILE !!!!!!"
48 AC_SUBST([AUTOGENERATED_WARNING])
49
50 dnl ------------------------------------------------------------------
51 dnl
52 dnl Check for ROOT
53 dnl
54 ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
55 AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
56 AC_SUBST([ROOTSYS])
57 ROOTBINDIR=`dirname $ROOTEXEC`
58 AC_SUBST([ROOTBINDIR])
59
60 dnl test for additional required root libraries and headers
61 LIBS='-ldl'
62 if 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   
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
76   # - libSTEER depends on libProofPlayer since Oct 2007 (after v4-07-Release)
77   ROOT_CHECKLIBS='Geom Minuit EG VMC TreePlayer XMLIO Thread Proof ProofPlayer'
78   for CHECKLIB in $ROOT_CHECKLIBS ; do
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
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)
86   AC_CHECK_HEADER([TBufferFile.h], [], [HAVE_NOT_TBUFFERFILE])
87
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)
90   AC_CHECK_HEADER([TView3D.h], [], [HAVE_NOT_TVIEW3D])
91
92   CPPFLAGS=$save_CPPFLAGS
93   LDFLAGS=$save_LDFLAGS
94   LIBS=$save_LIBS
95   AC_LANG_POP(C++)
96 fi
97
98 dnl ------------------------------------------------------------------
99 # TODO: make this configurable through arguments
100 #Define whether you want to run with ALIROOT or only ROOT
101 AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
102 ALIHLT_USEPACKAGE=ALIROOT
103 #ALIHLT_USEPACKAGE=ROOT
104 #ALIHLT_USEPACKAGE=STANDALONE
105 AC_DEFINE(use_aliroot)
106 AC_DEFINE(use_root)
107 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
108 save_CPPFLAGS=$CPPFLAGS
109 save_LDFLAGS=$LDFLAGS
110 save_LIBS=$LIBS
111
112 dnl ------------------------------------------------------------------
113 dnl check for AliRoot features
114 AC_LANG_PUSH(C++)
115 have_aliroot=no
116 AC_ARG_WITH(aliroot,[  --with-aliroot   top of the AliRoot installation],
117                     [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
118                     [])
119
120 if 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
146   ALIROOTBINDIR=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}
147   ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
148   ALIROOTINCDIR=${ALICE_ROOT}/include
149   test -d ${ALIROOTBINDIR} || AC_MSG_WARN([can not find AliRoot binary directory $ALIROOTBINDIR])
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])
152 fi
153
154 AC_MSG_CHECKING([for AliRoot])
155 if test "x$ALICE_ROOT" != "x" \
156    && test -d ${ALIROOTBINDIR} \
157    && test -d ${ALIROOTLIBDIR} \
158    && test -d ${ALIROOTINCDIR}; then
159   have_aliroot=$ALICE_ROOT
160 else
161   ALIROOTBINDIR=
162   ALIROOTLIBDIR=
163   ALIROOTINCDIR=
164 fi
165 AC_MSG_RESULT([$have_aliroot])
166
167 if test ! "x$have_aliroot" = "xno" ; then
168   ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
169   ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
170   ALIROOT_LIBS="$ADD_ROOTLIBS"
171   save_CPPFLAGS=$CPPFLAGS
172   save_LDFLAGS=$LDFLAGS
173   save_LIBS=$LIBS
174   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
175   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
176   
177   # check for certain AliRoot libraries/files/features
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
183   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
184   CHECKLIB=AOD
185   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
186
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
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"
198          LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lESD -lSTEER"
199          CHECKLIB=RAWDatarec
200          AC_CHECK_LIB([$CHECKLIB],[_init],
201                [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
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);])],
214                                      [ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
215                                        have_alirawdata=$CHECKLIB], 
216                                       [have_alirawdata=no])
217         ]) dnl AC_CHECK_LIB RAWDatabase
218   AC_MSG_CHECKING([for AliRawReader classes in RAWData libraries])
219   AC_MSG_RESULT([$have_alirawdata])
220
221   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lSTEER"
222   CHECKLIB=ESD
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
259   dnl
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");
270                                    TClonesArray* a=new TClonesArray("AliExternalTrackParam");
271                                    a->SetName("SomeObject");
272                                    esd.AddObject(a);
273                                    esd.WriteToTree(tree);
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
282   dnl ESD copy function added May 9 2008 rev 25667
283   dnl
284   if test "x$have_esd_nonstd" != "xyes"; then
285   have_esd_copy=no
286   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliESDEvent.h>],
287                                   [AliESDEvent esd1;
288                                    AliESDEvent esd2;
289                                    esd2=esd1;])],
290                  [have_esd_copy=yes], 
291                  [AC_DEFINE(HAVE_NOT_ESD_COPY)])
292   AC_MSG_CHECKING(for ESD assignment operator)
293   AC_MSG_RESULT([$have_esd_copy])
294   fi
295
296   dnl
297   dnl AliRawReaderMemory support for multiple buffers added
298   dnl revision 26829 Jun 2008
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)])
307   AC_MSG_CHECKING(AliRawReaderMemory support for multiple buffers)
308   AC_MSG_RESULT([$have_rawreadermemory_multbuffers])
309
310   dnl
311   dnl required header files and libraries for modules
312   dnl
313
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
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
344   CPPFLAGS=$save_CPPFLAGS
345   LDFLAGS=$save_LDFLAGS
346   LIBS=$save_LIBS
347 fi # if test ! "x$have_aliroot" = "xno"
348
349 AC_LANG_POP(C++)
350 AC_SUBST([ALICE_ROOT])
351 AC_SUBST([ALIROOT_CPPFLAGS])
352 AC_SUBST([ALIROOT_LDFLAGS])
353 AC_SUBST([ALIROOTBINDIR])
354 AC_SUBST([ALIROOTLIBDIR])
355 AC_SUBST([ALIROOT_LIBS])
356 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
357
358 HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
359 HLTBASE_LDFLAGS=
360 AC_SUBST([HLTBASE_CPPFLAGS])
361 AC_SUBST([HLTBASE_LDFLAGS])
362
363 dnl ------------------------------------------------------------------
364 dnl check for the HLT PubSub Framework
365 dnl namely for the existence of the HOMER library
366 dnl from Sep 2007, the HOMER lib has been incorporated into the alice-hlt
367 dnl package. It os though possible to choose an external. library
368 dnl In order to make the origni of the HOMER lib clear, the one in AliRoot
369 dnl got the name libAliHLTHOMER
370 AC_MSG_CHECKING([for HLT PubSub Framework])
371 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
372                     [],
373                     [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
374 if test -z $with_pubsub || ! test -d $with_pubsub ; then
375   with_pubsub=no
376 fi
377 AC_MSG_RESULT([$with_pubsub])
378 HOMER_VERSION=2
379 HOMER_LIBS=
380
381 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
382 if test "x$with_pubsub" != "xno" ; then
383   save_CPPFLAGS=$CPPFLAGS
384   save_LDFLAGS=$LDFLAGS
385   save_LIBS=$LIBS
386   # currently the different versions of the HLT PubSub framework have a different
387   # directory layout
388   if test -d ${with_pubsub}/include/HOMER ; then
389     # the 'early' location of the include files with separated HOMER sub dirs
390     HOMER_INCDIRS="${with_pubsub}/include/HOMER ${with_pubsub}/include/HOMER/reader"
391   elif test -d ${with_pubsub}/include/Util/HOMER ; then
392     # location for HLT Framework versions after Sep 2006
393     HOMER_INCDIRS="${with_pubsub}/include/Util/HOMER"
394   elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
395     # fall back if include files were not installed (versions after Sep 06)
396     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/include"
397   else
398     # fall back if include files were not installed (versions before Sep 06)
399     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/reader/include ${with_pubsub}/src/Util/HOMER/data/include"
400   fi
401   HOMER_CPPFLAGS=`for i in ${HOMER_INCDIRS}; do echo -n "-I$i " ; done`
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}])
418   HOMERREADER_HEADER=HOMERReader.h
419   HOMER_BINDIR="${with_pubsub}/bin/${HOMER_TARGET}"
420   HOMER_LIBDIR="${with_pubsub}/lib/${HOMER_TARGET}"
421   HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
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++)
427   AC_CHECK_HEADER([$HOMERREADER_HEADER],
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"
435       AC_MSG_CHECKING([version of HOMER library])
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);])],
444                                       [],
445                                       [HOMER_VERSION=1])
446       AC_MSG_RESULT([$HOMER_VERSION])
447   ],
448   [HOMERREADER_HEADER=]) #AC_CHECK_HEADER([$HOMERREADER_HEADER])
449   AC_LANG_POP(C++)
450   HOMER_INBUILT_LIB=
451 else
452 dnl 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=
460 fi
461
462   if test "x$with_homer" = "xno" ; then
463     HOMER_CPPFLAGS=
464     HOMER_LDFLAGS=
465     HOMER_LIBS=
466   else
467     HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
468     AC_DEFINE(HAVE_HOMERREADER)
469   fi
470   CPPFLAGS="$save_CPPFLAGS"
471   LDFLAGS="$save_LDFLAGS"
472   LIBS="$save_LIBS"  
473
474 AC_SUBST([HOMERREADER_HEADER])
475 AC_SUBST([HOMER_INBUILT_LIB])
476 AC_SUBST([HOMER_CPPFLAGS])
477 AC_SUBST([HOMER_LDFLAGS])
478 AC_SUBST([HOMER_LIBDIR])
479 AC_SUBST([HOMER_BINDIR])
480 AC_SUBST([HOMER_LIBS])
481
482 dnl ------------------------------------------------------------------
483 AC_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
488 dnl ------------------------------------------------------------------
489 AC_MSG_CHECKING([whether to impose strict coding conventions])
490 AC_ARG_ENABLE(strict,
491   [AC_HELP_STRING([--disable-strict],
492       [disable coding convention checks ])],
493   [],[enable_strict=yes])
494 if test "x$enable_strict" = "xyes" ; then
495    CPPFLAGS="$CPPFLAGS -W -Weffc++ -Wall -Wshadow"
496 fi
497 AC_MSG_RESULT([$enable_strict])
498
499 dnl ------------------------------------------------------------------
500 AC_MSG_CHECKING([whether to enable component statistics])
501 AC_ARG_ENABLE(component-stat,
502   [AC_HELP_STRING([--enable-component-stat],
503       [enable component statistics ])],
504   [],[enable_component_stat=no])
505 if test "x$enable_component_stat" = "xyes" ; then
506    AC_DEFINE(HLT_COMPONENT_STATISTICS)
507 fi
508 AC_MSG_RESULT([$enable_component_stat])
509
510 dnl ------------------------------------------------------------------
511 dnl ----  module checks
512 dnl ------------------------------------------------------------------
513 save_CPPFLAGS=$CPPFLAGS
514 save_LDFLAGS=$LDFLAGS
515 save_LIBS=$LIBS
516
517 dnl ------------------------------------------------------------------
518 AC_MSG_CHECKING([whether to compile sample library])
519 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
520 AC_ARG_ENABLE(sample,
521   [AC_HELP_STRING([--disable-sample],
522       [compile the sample library ])],
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
531 if test "x$enable_sample" = "xyes" ; then 
532   AC_DEFINE(HLT_SAMPLE)
533 fi
534 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
535 AC_MSG_RESULT([$enable_sample])
536
537 dnl ------------------------------------------------------------------
538 AC_MSG_CHECKING([whether to compile util library])
539 AH_TEMPLATE([HLT_UTIL],[HLT utility library])
540 AC_ARG_ENABLE(util,
541   [AC_HELP_STRING([--disable-util],
542       [compile the util library ])],
543   [],
544   [if test "x$have_aliroot" = "xno" ; then
545      enable_util="no...requires.AliRoot"
546    else
547      enable_util=yes
548    fi
549   ])
550
551 if test "x$enable_util" = "xyes" ; then 
552   AC_DEFINE(HLT_UTIL)
553 fi
554 AM_CONDITIONAL(EN_HLT_UTIL, test x$enable_util = xyes)
555 AC_MSG_RESULT([$enable_util])
556
557 dnl ------------------------------------------------------------------
558 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
559
560 ALITPC_LIBS=
561 CHECK_HLTMODULE([tpc],
562                 [AliTPCRawStream.h], 
563                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/TPC],
564                 [Gui ANALYSIS STAT], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
565                 [TPCbase TPCrec TPCcalib], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
566                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
567
568 if test "x$enable_module" = "xmissheader"; then
569   enable_module="no...missing.headers"
570   enable_tpc=$enable_module
571 elif test "x$enable_module" = "xforce"; then
572   enable_tpc="yes"
573 else
574   enable_tpc=$enable_module
575 fi
576
577 if test "x$enable_tpc" = "xyes" ; then 
578   AC_LANG_PUSH(C++)
579   AC_DEFINE(HLT_TPC)
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);
597                                        cl.GetOutputClonesArray();])],
598                                     [have_tpc_hltoffline_rec=yes], 
599                                       [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)])
600     LIBS=$save_LIBS
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
624 else
625   enable_module=$enable_tpc
626 fi
627 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
628 AC_MSG_CHECKING([whether to compile TPC library])
629 AC_MSG_RESULT([$enable_module])
630 AC_SUBST([ALITPC_LIBS])
631
632 dnl ------------------------------------------------------------------
633 AH_TEMPLATE([HLT_RCU],[hlt rcu library])
634
635 CHECK_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
642 if test "x$enable_module" = "xmissheader"; then
643   enable_module="no...missing.headers"
644   enable_rcu=$enable_module
645 elif test "x$enable_module" = "xforce"; then
646   enable_rcu="yes"
647 else
648   AC_LANG_PUSH(C++)
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++)
662 fi
663
664 if test "x$enable_rcu" = "xyes" ; then 
665   AC_DEFINE(HLT_RCU)
666 else
667   enable_module=$enable_rcu
668 fi
669 AM_CONDITIONAL(EN_HLT_RCU, test x$enable_rcu = xyes)
670 AC_MSG_CHECKING([whether to compile RCU library])
671 AC_MSG_RESULT([$enable_module])
672 AC_SUBST([ALIRCU_LIBS])
673
674 dnl ------------------------------------------------------------------
675 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
676   
677 ALIPHOS_LIBS=
678 CHECK_HLTMODULE([phos],
679                 [], [$ALIROOT_CPPFLAGS],
680                 [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
681                 [PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
682                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
683
684 if test "x$enable_module" = "xmissheader"; then
685   enable_module="no...requires.AliRoot>v4-05-07"
686   enable_phos=$enable_module
687 elif test "x$enable_module" = "xforce"; then
688   enable_phos="yes"
689 else
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])
696     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
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                                        [])
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)])
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
720 fi
721
722 if test "x$enable_phos" = "xyes" ; then 
723   AC_DEFINE(HLT_PHOS)
724   ALIPHOS_LIBS=$ALIHLTMODULE_LIBS
725 else
726   enable_module=$enable_phos
727 fi
728 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
729 AC_MSG_CHECKING([whether to compile PHOS library])
730 AC_MSG_RESULT([$enable_module])
731 AC_SUBST([ALIPHOS_LIBS])
732
733 dnl ------------------------------------------------------------------
734 AH_TEMPLATE([HLT_TRD],[hlt trd library])
735   
736 ALITRD_LIBS=
737 CHECK_HLTMODULE([trd],
738                 [], [],
739                 [MLP XMLParser], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
740                 [TRDbase TRDrec TRDsim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
741                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
742
743 if test "x$enable_module" = "xmissheader"; then
744   enable_module="no...requires.AliRoot>v4-07-Release"
745   enable_trd=$enable_module
746 elif test "x$enable_module" = "xforce"; then
747   enable_trd="yes"
748 else
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"
754     # AliTRDclusterizer::SetRawVersion() requires >v4-07-Release
755     # changed to AliTRDrecoParam::SetSeedingOn() due to revision 26327, Mon Jun 2 2008
756     # changed to AliTRDReconstructor::SetStreamLevel() due to revision 27797, Tue Aug 5 2008
757     # changed to AliTRDReconstructor::SetClusters() according to revision 28069, Mon Aug 18 2008
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)])],
763                                        [], 
764                                        [enable_trd="no...requires.AliRoot>v4-16-Release"])
765     AC_MSG_RESULT([$enable_trd])       
766     AC_LANG_POP(C++)
767     CPPFLAGS="$save_CPPFLAGS"
768   fi
769 fi
770
771 if test "x$enable_trd" = "xyes" ; then 
772   AC_DEFINE(HLT_TRD)
773   ALITRD_LIBS=$ALIHLTMODULE_LIBS
774 else
775   enable_module=$enable_trd
776 fi
777 AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
778 AC_MSG_CHECKING([whether to compile TRD library])
779 AC_MSG_RESULT([$enable_module])
780 AC_SUBST([ALITRD_LIBS])
781
782 dnl ------------------------------------------------------------------
783 AH_TEMPLATE([HLT_FMD],[hlt fmd library])
784
785 ALIFMD_LIBS=$ALIHLTMODULE_LIBS
786 CHECK_HLTMODULE([fmd],
787                 [], [],
788                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
789                 [FMDbase FMDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
790                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
791
792 if test "x$enable_module" = "xmissheader"; then
793   enable_module="no...missing.headers"
794   enable_fmd=$enable_module
795 elif test "x$enable_module" = "xforce"; then
796   enable_fmd="yes"
797 else
798   enable_fmd=$enable_module
799 fi
800
801 if test "x$enable_fmd" = "xyes" ; then
802   AC_DEFINE(HLT_FMD)
803   ALIFMD_LIBS=$ALIHLTMODULE_LIBS
804 else
805   enable_module=$enable_fmd
806 fi
807 AM_CONDITIONAL(EN_HLT_FMD, test x$enable_fmd = xyes)
808 AC_MSG_CHECKING([whether to compile FMD library])
809 AC_MSG_RESULT([$enable_module])
810 AC_SUBST([ALIFMD_LIBS])
811
812 dnl ------------------------------------------------------------------
813 AH_TEMPLATE([HLT_MUON],[hlt dimuon library])
814
815 ALIMUON_LIBS=
816 CHECK_HLTMODULE([dimuon],
817                 [AliMpExMap.h AliMUONTriggerIO.h], 
818                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/MUON -I$ALICE_ROOT/MUON/mapping],
819                 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
820                 [MUONcore MUONraw MUONbase MUONgeometry MUONmapping MUONcalib MUONsim MUONtrigger MUONevaluation MUONrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
821                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
822
823 if test "x$enable_module" = "xmissheader"; then
824   enable_module="no...requires.AliRoot>=v4-08-Release"
825   enable_muon=$enable_module
826 elif test "x$enable_module" = "xforce"; then
827   enable_muon="yes"
828 else
829   enable_muon=$enable_module
830 fi
831
832 if test "x$enable_muon" = "xyes" ; then 
833   AC_DEFINE(HLT_MUON)
834   ALIMUON_LIBS=$ALIHLTMODULE_LIBS
835   AC_LANG_PUSH(C++)
836   save_CPPFLAGS="$CPPFLAGS"
837
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])
853   CPPFLAGS="$save_CPPFLAGS"
854
855   AC_LANG_POP(C++)
856 else
857   enable_module=$enable_muon
858 fi
859 AM_CONDITIONAL(EN_HLT_MUON, test x$enable_muon = xyes)
860 AC_MSG_CHECKING([whether to compile MUON library])
861 AC_MSG_RESULT([$enable_module])
862 AC_SUBST([ALIMUON_LIBS])
863
864 dnl ------------------------------------------------------------------
865 AH_TEMPLATE([HLT_TRIGGER],[hlt trigger library])
866
867 ALITRIGGER_LIBS=
868 CHECK_HLTMODULE([trigger],
869                 [], [$ALIROOT_CPPFLAGS],
870                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
871                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
872                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
873
874 if test "x$enable_module" = "xmissheader"; then
875   enable_module="no...header.missing"
876   enable_trigger=$enable_module
877 elif test "x$enable_module" = "xforce"; then
878   enable_trigger="yes"
879 else
880   enable_trigger=$enable_module
881 fi
882
883 if test "x$enable_trigger" = "xyes" ; then 
884   AC_DEFINE(HLT_TRIGGER)
885   ALITRIGGER_LIBS=$ALIHLTMODULE_LIBS
886 else
887   enable_module=$enable_trigger
888 fi
889 AM_CONDITIONAL(EN_HLT_TRIGGER, test x$enable_trigger = xyes)
890 AC_MSG_CHECKING([whether to compile Trigger library])
891 AC_MSG_RESULT([$enable_module])
892 AC_SUBST([ALITRIGGER_LIBS])
893
894 dnl ------------------------------------------------------------------
895 AH_TEMPLATE([HLT_GLOBAL],[hlt global library])
896
897 ALIGLOBAL_LIBS=
898 CHECK_HLTMODULE([global],
899                 [], [$ALIROOT_CPPFLAGS],
900                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
901                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
902                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
903
904 if test "x$enable_module" = "xmissheader"; then
905   enable_module="no...header.missing"
906   enable_global=$enable_module
907 elif test "x$enable_module" = "xforce"; then
908   enable_global="yes"
909 else
910   enable_global=$enable_module
911   if test "x$enable_global" = "xyes" ; then
912     AC_LANG_PUSH(C++)
913     save_CPPFLAGS="$CPPFLAGS"
914     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
915     AC_MSG_CHECKING([for required functions in AliESDtrack])
916     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliESDtrack.h>], 
917                                        [AliESDtrack t;
918                                        t.SetGlobalChi2(0)])],
919                                        [], 
920                                        [enable_global="no...requires.AliRoot>v4-17-Release"])
921     AC_MSG_RESULT([$enable_global])       
922     AC_LANG_POP(C++)
923     CPPFLAGS="$save_CPPFLAGS"
924   fi
925 fi
926
927 if test "x$enable_global" = "xyes" ; then 
928   AC_DEFINE(HLT_GLOBAL)
929   ALIGLOBAL_LIBS=$ALIHLTMODULE_LIBS
930 else
931   enable_module=$enable_global
932 fi
933 AM_CONDITIONAL(EN_HLT_GLOBAL, test x$enable_global = xyes)
934 AC_MSG_CHECKING([whether to compile Global library])
935 AC_MSG_RESULT([$enable_module])
936 AC_SUBST([ALIGLOBAL_LIBS])
937
938 dnl ------------------------------------------------------------------
939 AH_TEMPLATE([HLT_JET],[hlt jet library])
940
941 if test ! "x$FASTJET" = "x" ; then
942   enable_fastjet="yes"
943   AC_DEFINE(HAVE_FASTJET)
944   AC_DEFINE(WITHFASTJET)
945   CPPFLAGS_FASTJET="-I${FASTJET}/include"
946 else
947   enable_fastjet="no"
948 fi
949
950 if test "x$enable_fastjet" = "xyes"; then
951         ALIJET_LIBS= CHECK_HLTMODULE([jet],
952                 [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/JETAN -I${FASTJET}/include],
953                 [], [-L$ROOTLIBDIR -L${FASTJET}/lib], [$ROOTLIBS $ADD_ROOTLIBS],
954                 [AOD ESD ANALYSIS ANALYSISalice CGAL fastjet JETAN JETANMC], 
955                 [-L$ROOTLIBDIR $ALIROOT_LDFLAGS -L$ALICE_ROOT/lib/tgt_$ALICE_TARGET -L${FASTJET}/lib], 
956                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
957 else
958         ALIJET_LIBS= CHECK_HLTMODULE([jet],
959                 [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/JETAN],
960                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
961                 [AOD ESD ANALYSIS ANALYSISalice JETAN JETANMC], 
962                 [-L$ROOTLIBDIR $ALIROOT_LDFLAGS -L$ALICE_ROOT/lib/tgt_$ALICE_TARGET], 
963                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
964 fi
965
966 if test "x$enable_module" = "xmissheader"; then
967   enable_module="no...header.missing"
968   enable_jet=$enable_module
969 elif test "x$enable_module" = "xforce"; then
970   enable_jet="yes"
971 else
972   enable_jet=$enable_module
973 fi
974
975 if test "x$enable_jet" = "xyes" ; then 
976   AC_DEFINE(HLT_JET)
977   ALIJET_LIBS="$ALIHLTMODULE_LIBS"
978 else
979   enable_module=$enable_jet
980 fi
981
982 AC_MSG_NOTICE([++ ------------------------------])
983 AC_MSG_NOTICE([++ HAVE_FASTJET  = $enable_fastjet])
984 AC_MSG_NOTICE([++ MODULE ENABLE = $enable_module])
985 AC_MSG_NOTICE([++ MODULE JET    = $enable_jet])
986 AC_MSG_NOTICE([++ ALIJET_LIBS   = $ALIHLTMODULE_LIBS])
987 AC_MSG_NOTICE([++ ------------------------------])
988
989 AM_CONDITIONAL(EN_HLT_JET, test x$enable_jet = xyes)
990 AC_MSG_CHECKING([whether to compile Jet library])
991 AC_MSG_RESULT([$enable_module])
992 AC_SUBST([ALIJET_LIBS])
993
994 dnl ------------------------------------------------------------------
995 AH_TEMPLATE([HLT_ITS],[hlt its library])
996
997 ALIITS_LIBS=
998 CHECK_HLTMODULE([its],
999                 [AliITSCompressRawDataSDD.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS],
1000                 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1001                 [ITSbase ITSrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1002                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1003
1004 if test "x$enable_module" = "xmissheader"; then
1005   enable_module="no...header.missing"
1006   enable_its=$enable_module
1007 elif test "x$enable_module" = "xforce"; then
1008   enable_its="yes"
1009 else
1010   enable_its=$enable_module
1011   if test "x$enable_its" = "xyes" ; then
1012     AC_LANG_PUSH(C++)
1013     save_CPPFLAGS="$CPPFLAGS"
1014     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS"
1015     # changes in the AliVertexer base class revision 26414, Thu Jun 5 15:36:18 2008
1016     # require AliVertexer::GetNominalPos()
1017     AC_MSG_CHECKING([for required functions in AliITSVertexer])
1018     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliITSVertexerZ.h>], 
1019                                        [AliITSVertexerZ v;
1020                                        v.GetNominalPos()])],
1021                                        [], 
1022                                        [enable_its="no...requires.AliRoot>v4-13-Release"])
1023     AC_MSG_RESULT([$enable_its])       
1024     AC_LANG_POP(C++)
1025     CPPFLAGS="$save_CPPFLAGS"
1026   fi
1027 fi
1028
1029 if test "x$enable_its" = "xyes" ; then 
1030   AC_DEFINE(HLT_ITS)
1031   ALIITS_LIBS=$ALIHLTMODULE_LIBS
1032 else
1033   enable_module=$enable_its
1034 fi
1035 AM_CONDITIONAL(EN_HLT_ITS, test x$enable_its = xyes)
1036 AC_MSG_CHECKING([whether to compile ITS library])
1037 AC_MSG_RESULT([$enable_module])
1038 AC_SUBST([ALIITS_LIBS])
1039
1040 dnl ------------------------------------------------------------------
1041 AH_TEMPLATE([HLT_EMCAL],[hlt emcal library])
1042
1043 ALIEMCAL_LIBS=
1044 CHECK_HLTMODULE([emcal],
1045                 [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/EMCAL],
1046                 [RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1047                 [EMCALrec EMCALsim EMCALbase], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1048                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1049
1050 if test "x$enable_module" = "xmissheader"; then
1051   enable_module="no...header.missing"
1052   enable_emcal=$enable_module
1053 elif test "x$enable_module" = "xforce"; then
1054   enable_emcal="yes"
1055 else
1056   enable_emcal=$enable_module
1057 fi
1058
1059 if test "x$enable_emcal" = "xyes" ; then 
1060   AC_DEFINE(HLT_EMCAL)
1061   ALIEMCAL_LIBS=$ALIHLTMODULE_LIBS
1062 else
1063   enable_module=$enable_emcal
1064 fi
1065 AM_CONDITIONAL(EN_HLT_EMCAL, test x$enable_emcal = xyes)
1066 AC_MSG_CHECKING([whether to compile EMCAL library])
1067 AC_MSG_RESULT([$enable_module])
1068 AC_SUBST([ALIEMCAL_LIBS])
1069
1070 dnl ------------------------------------------------------------------
1071 AH_TEMPLATE([HLT_COMP],[hlt comp library])
1072
1073 ALICOMP_LIBS=
1074 CHECK_HLTMODULE([comp],
1075                 [], [$ALIROOT_CPPFLAGS],
1076                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1077                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1078                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1079
1080 if test "x$enable_module" = "xmissheader"; then
1081   enable_module="no...header.missing"
1082   enable_comp=$enable_module
1083 elif test "x$enable_module" = "xforce"; then
1084   enable_comp="yes"
1085 else
1086   enable_comp=$enable_module
1087 fi
1088
1089 if test "x$enable_comp" = "xyes" ; then 
1090   AC_DEFINE(HLT_COMP)
1091   ALICOMP_LIBS=$ALIHLTMODULE_LIBS
1092 else
1093   enable_module=$enable_comp
1094 fi
1095 AM_CONDITIONAL(EN_HLT_COMP, test x$enable_comp = xyes)
1096 AC_MSG_CHECKING([whether to compile comp library])
1097 AC_MSG_RESULT([$enable_module])
1098 AC_SUBST([ALICOMP_LIBS])
1099
1100 dnl ------------------------------------------------------------------
1101 AC_MSG_CHECKING([whether to disable AliRoot logging])
1102 AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
1103 AC_ARG_ENABLE(aliroot-logging,
1104   [AC_HELP_STRING([--disable-aliroot-logging],
1105       [disable logging through AliRoot logging methods])],
1106   [],[enable_aliroot_logging=no])
1107 if test "x$have_aliroot" = "xno" ; then
1108   enable_aliroot_logging=yes # this means 'disable'
1109 fi
1110 if test "x$enable_aliroot_logging" != "xno" ; then 
1111   AC_DEFINE(NOALIROOT_LOGGING)
1112 fi
1113 AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
1114 AC_MSG_RESULT([$enable_aliroot_logging])
1115
1116 dnl ------------------------------------------------------------------
1117 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
1118 AH_TEMPLATE([DOMC],[MC saving])
1119 AC_ARG_ENABLE(mc-saving,
1120   [AC_HELP_STRING([--enable-mc-saving],
1121       [enable saving MC data through the chain])],
1122   [],[enable_mc_saving=no])
1123 if test "x$enable_mc_saving" = "xyes" ; then 
1124   AC_DEFINE(DOMC)
1125 fi
1126 AC_MSG_RESULT([$enable_mc_saving])
1127
1128 dnl ------------------------------------------------------------------
1129 dnl certainly something old, but we keep the define
1130 AC_MSG_CHECKING([whether to use ROWHOUGH])
1131 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
1132 AC_ARG_ENABLE(rowhough,
1133   [AC_HELP_STRING([--enable-rowhough],
1134       [use ROWHOUGH ])],
1135   [],[enable_rowhough=no])
1136 if test "x$enable_rowhough" = "xyes" ; then 
1137   AC_DEFINE(USEROWHOUGH)
1138 fi
1139 AC_MSG_RESULT([$enable_rowhough])
1140
1141 dnl ------------------------------------------------------------------
1142 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
1143 dnl stand-alone build system. This is most likely something old we can
1144 dnl get rid off later, or do something more reasonable. Since the define
1145 dnl needs the quotes they have to be  escaped. This works well for the
1146 dnl Makefile but not for the configure script. So we have to add the
1147 dnl defines after all the other checks.
1148 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
1149 if test ! "x$have_aliroot" = "xno" ; then
1150   CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
1151 fi
1152
1153 dnl ------------------------------------------------------------------
1154 dnl
1155 dnl Documentation
1156 dnl
1157 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
1158 AC_PATH_PROG(PERL, perl)
1159 AC_PATH_PROG(DOXYGEN, doxygen)
1160 AC_ARG_ENABLE(dot,
1161   [AC_HELP_STRING([--enable-dot],
1162       [enable dot documentation generator])],
1163   [],[enable_dot=no])
1164 HAVE_DOT=NO
1165 DOT_PATH=
1166 AC_PATH_PROG(DOT, dot)
1167 if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
1168    HAVE_DOT=YES
1169    DOT_PATH=`dirname $DOT`
1170 fi
1171
1172 AC_MSG_CHECKING([for documentation mode])
1173 AC_ARG_ENABLE(doc,
1174   [AC_HELP_STRING([--disable-doc],
1175       [disable documentation build; monolithic build --enable-doc=mono ])],
1176   [],[enable_doc=modules])
1177
1178 if test "x$DOXYGEN" = "x" ; then
1179    enable_doc=no.doxygen
1180 elif test "x$enable_doc" = "xyes" ; then
1181    enable_doc=yes
1182 elif test ! "x$enable_doc" = "xmono" && \
1183      test ! "x$enable_doc" = "xmodules"  && \
1184      test ! "x$enable_doc" = "xno"; then
1185    enable_doc=no
1186    AC_MSG_WARN([unknown option])
1187 fi
1188 if test "x$enable_doc" = "xno" ; then
1189    enable_doc=off
1190    DOXYGEN=
1191 fi
1192
1193 AC_MSG_RESULT([$enable_doc])
1194 AM_CONDITIONAL(MONOLITHIC_DOC, test "x$enable_doc" = "xmono")
1195 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
1196 AC_SUBST([HAVE_DOT])
1197 AC_SUBST([DOT_PATH])
1198
1199 dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
1200 dnl echo $HAVE_SRC_SUBDIR
1201 dnl if ! test -d $HAVE_SRC_SUBDIR; then
1202 dnl   HAVE_SRC_SUBDIR=
1203 dnl fi
1204 dnl AC_SUBST([HAVE_SRC_SUBDIR])
1205
1206 dnl ------------------------------------------------------------------
1207 AC_MSG_NOTICE([---------------------------------------------- ])
1208 AC_MSG_NOTICE([                build summary                  ])
1209 AC_MSG_NOTICE([---------------------------------------------- ])
1210
1211 AC_CONFIG_FILES([Makefile 
1212                  BASE/Makefile
1213                  BASE/setenv.sh
1214                  BASE/setenv.csh
1215                  BASE/HOMER/Makefile
1216                  BASE/util/Makefile
1217                  BASE/util/test/Makefile
1218                  BASE/interface/Makefile
1219                  BASE/test/Makefile
1220                  BASE/interface/test/Makefile
1221                  doc/Makefile
1222                  doc/doxygen.conf
1223                  doc/doxymodule.conf])
1224
1225 dnl AliRoot and installation directory for libraries
1226 dnl 
1227 AC_MSG_NOTICE([AliRoot: $have_aliroot])
1228 AM_CONDITIONAL(HAVE_ALIROOT, test "x$have_aliroot" != "xno" )
1229 if test "x$have_aliroot" != "xno"; then 
1230   AC_CONFIG_FILES([sim/Makefile  
1231                    rec/Makefile  
1232                    rec/test/Makefile     
1233                    rec/startAliEVE-barrel-tracks.sh
1234                    shuttle/Makefile
1235                    pendolino/Makefile
1236                    benchmark/Makefile
1237                    ])
1238 fi
1239 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
1240 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
1241 AC_MSG_NOTICE([libdir set to $libdir])
1242 fi
1243
1244 AC_MSG_NOTICE([compile sample library: $enable_sample])
1245 if test "x$enable_sample" = "xyes"; then 
1246   AC_CONFIG_FILES([SampleLib/Makefile])
1247 fi
1248
1249 AC_MSG_NOTICE([compile RCU library: $enable_rcu])
1250 if test "x$enable_rcu" = "xyes"; then 
1251   AC_CONFIG_FILES([RCU/Makefile
1252                    RCU/test/Makefile
1253                    ])
1254 fi
1255
1256 AC_MSG_NOTICE([compile TPC library: $enable_tpc])
1257 if test "x$enable_tpc" = "xyes"; then 
1258   AC_CONFIG_FILES([TPCLib/Makefile            
1259                    TPCLib/test/Makefile       
1260                    TPCLib/mapping2array.cxx     
1261                    TPCLib/EVE/Makefile
1262                    ])
1263 fi
1264
1265 AC_MSG_NOTICE([compile PHOS library: $enable_phos])
1266 if test "x$enable_phos" = "xyes"; then 
1267   AC_CONFIG_FILES([PHOS/Makefile])
1268 fi
1269
1270 AC_MSG_NOTICE([compile TRD library: $enable_trd])
1271 if test "x$enable_trd" = "xyes"; then 
1272   AC_CONFIG_FILES([TRD/Makefile])
1273 fi
1274
1275 AC_MSG_NOTICE([compile FMD library: $enable_fmd])
1276 if test "x$enable_fmd" = "xyes"; then 
1277   AC_CONFIG_FILES([FMD/Makefile])
1278 fi
1279
1280 AC_MSG_NOTICE([compile MUON library: $enable_muon])
1281 if test "x$enable_muon" = "xyes"; then 
1282   AC_CONFIG_FILES([MUON/Makefile])
1283 fi
1284
1285 AC_MSG_NOTICE([compile ITS library: $enable_its])
1286 if test "x$enable_its" = "xyes"; then 
1287   AC_CONFIG_FILES([ITS/Makefile])
1288 fi
1289
1290 AC_MSG_NOTICE([compile EMCAL library: $enable_emcal])
1291 if test "x$enable_emcal" = "xyes"; then 
1292   AC_CONFIG_FILES([EMCAL/Makefile])
1293 fi
1294
1295 AC_MSG_NOTICE([compile trigger library: $enable_trigger])
1296 if test "x$enable_trigger" = "xyes"; then 
1297   AC_CONFIG_FILES([trigger/Makefile
1298                    trigger/test/Makefile])
1299 fi
1300
1301 AC_MSG_NOTICE([compile global library: $enable_global])
1302 if test "x$enable_global" = "xyes"; then 
1303   AC_CONFIG_FILES([global/Makefile])
1304 fi
1305
1306 AC_MSG_NOTICE([compile jet library: $enable_jet])
1307 if test "x$enable_jet" = "xyes"; then 
1308   AC_CONFIG_FILES([JET/Makefile])
1309 fi
1310
1311 AC_MSG_NOTICE([compile comp library: $enable_comp])
1312 if test "x$enable_comp" = "xyes"; then 
1313   AC_CONFIG_FILES([comp/Makefile])
1314 fi
1315
1316 AC_OUTPUT
1317 dnl
1318 dnl EOF
1319 dnl
1320