check for compilation of trunk with release
[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([-Wno-portability])
36 AC_PROG_CC
37 AC_PROG_CXX
38 AC_PROG_LIBTOOL
39
40 AC_DEBUG
41 AC_PROFILING
42 AC_OPTIMIZATION
43 AM_CONDITIONAL(STANDALONE_SAMPLELIB, test 0 )
44
45 dnl ------------------------------------------------------------------
46 dnl A warning posted into the auto-generated files
47 dnl Does NOT concern this file ;-)
48 AUTOGENERATED_WARNING="!!!!!!!    DO NOT EDIT THIS FILE !!!!!!"
49 AC_SUBST([AUTOGENERATED_WARNING])
50
51 dnl ------------------------------------------------------------------
52 dnl
53 dnl Check for ROOT
54 dnl
55 ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
56 AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
57 AC_SUBST([ROOTSYS])
58 ROOTBINDIR=`dirname $ROOTEXEC`
59 AC_SUBST([ROOTBINDIR])
60
61 dnl test for additional required root libraries and headers
62 LIBS='-ldl'
63 if test "x$have_root" = "x1"; then
64   AC_LANG_PUSH(C++)
65   save_CPPFLAGS=$CPPFLAGS
66   save_LDFLAGS=$LDFLAGS
67   save_LIBS=$LIBS
68   CPPFLAGS=`echo $save_CPPFLAGS; for i in ${ROOTINCDIR}; do echo -n "-I$i " ; done`
69   
70   # we check for the libSTEER library which is linked to
71   # - the ROOT libs libGeom libMinuit libVMC libEG
72   # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
73   # - ROOT libCint needs also libdl
74   # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
75   #   libTreePlayer.so
76   # - from Jan 07 libESD also depends on libXMLIO
77   # - libSTEER depends on libProofPlayer since Oct 2007 (after v4-07-Release)
78   # - libCDB.so depends on libXMLParser since Mar 11 2009 r 31411
79   # - libCDB.so depends on libGui.so since May 14 2010 r 41238
80   ROOT_CHECKLIBS='Geom Minuit EG VMC TreePlayer XMLIO Thread Proof ProofPlayer XMLParser Gui'
81   for CHECKLIB in $ROOT_CHECKLIBS ; do
82     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
83     LIBS="$save_LIBS $ROOTLIBS $ADD_ROOTLIBS"
84     AC_CHECK_LIB([$CHECKLIB],[_init], [ADD_ROOTLIBS="$ADD_ROOTLIBS -l$CHECKLIB"])
85   done
86
87   # TBuffer.h has been made pure virtual in root v5-15-02 and one
88   # has to derive from TBufferFile.h (needed for BASE/AliHLTMessage.h)
89   AC_CHECK_HEADER([TBufferFile.h], [], [HAVE_NOT_TBUFFERFILE])
90
91   # TView.h has been made pure virtual right after root v5-15-02 and one
92   # has to derive from TView3D.h (needed for TPCLib/OnlineDisplay/AliHLTTPCDisplay3D)
93   AC_CHECK_HEADER([TView3D.h], [], [HAVE_NOT_TVIEW3D])
94
95   CPPFLAGS=$save_CPPFLAGS
96   LDFLAGS=$save_LDFLAGS
97   LIBS=$save_LIBS
98   AC_LANG_POP(C++)
99 fi
100
101 dnl ------------------------------------------------------------------
102 # TODO: make this configurable through arguments
103 #Define whether you want to run with ALIROOT or only ROOT
104 AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
105 ALIHLT_USEPACKAGE=ALIROOT
106 #ALIHLT_USEPACKAGE=ROOT
107 #ALIHLT_USEPACKAGE=STANDALONE
108 AC_DEFINE(use_aliroot)
109 AC_DEFINE(use_root)
110 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
111 save_CPPFLAGS=$CPPFLAGS
112 save_LDFLAGS=$LDFLAGS
113 save_LIBS=$LIBS
114
115 dnl ------------------------------------------------------------------
116 dnl check for AliRoot features
117 AC_LANG_PUSH(C++)
118 have_aliroot=no
119 AC_ARG_WITH(aliroot,[  --with-aliroot   top of the AliRoot installation],
120                     [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
121                     [])
122
123 if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
124   dnl ------------------------------------------------------------------
125   dnl Try to estimate the system architecture
126   case $host_os:$host_cpu in
127   linux*:x86_64*)       alice_target='linuxx8664gcc'            ;;
128   linux*)               alice_target='linux'                    ;;
129   *)                    alice_target='unknown'                  ;;
130   esac
131   if test "x$alice_target" = "xunknown" ; then
132     if test -z $ALICE_TARGET ; then
133     AC_MSG_ERROR([Can not estimate system architecture.
134     To avoid the problem, set the ALICE_TARGET variable appropriately.
135     Please send the following information to Matthias.Richter@ift.uib.no:
136         ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
137     else
138     AC_MSG_NOTICE([Unknown system architecture.
139     Please send the following information to Matthias.Richter@ift.uib.no:
140         ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])  
141     fi
142   else
143     if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
144     AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
145     overriding $ALICE_TARGET by $alice_target])
146     fi
147     ALICE_TARGET=$alice_target
148   fi
149   ALIROOTBINDIR=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}
150   ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
151   ALIROOTINCDIR=${ALICE_ROOT}/include
152   test -d ${ALIROOTBINDIR} || AC_MSG_WARN([can not find AliRoot binary directory $ALIROOTBINDIR])
153   test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
154   test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
155 fi
156
157 AC_MSG_CHECKING([for AliRoot])
158 if test "x$ALICE_ROOT" != "x" \
159    && test -d ${ALIROOTBINDIR} \
160    && test -d ${ALIROOTLIBDIR} \
161    && test -d ${ALIROOTINCDIR}; then
162   have_aliroot=$ALICE_ROOT
163 else
164   ALIROOTBINDIR=
165   ALIROOTLIBDIR=
166   ALIROOTINCDIR=
167 fi
168 AC_MSG_RESULT([$have_aliroot])
169
170 if test ! "x$have_aliroot" = "xno" ; then
171   ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
172   ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
173   ALIROOT_LIBS="$ADD_ROOTLIBS"
174   save_CPPFLAGS=$CPPFLAGS
175   save_LDFLAGS=$LDFLAGS
176   save_LIBS=$LIBS
177   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
178   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
179   
180   # check for certain AliRoot libraries/files/features
181   # libSTEERBase present since Aug 7 2007
182   # ###########################################
183   # temporary workaround for circular dependency libSTEERbase libSTEER   
184   # https://savannah.cern.ch/bugs/index.php?49914
185   # disable the sequence of checks and load libraries in parallel
186   ALIROOT_LIBS="$ALIROOT_LIBS -lAOD -lCDB -lRAWDatabase -lRAWDatarec -lESD -lSTEER"
187   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
188   CHECKLIB=STEERBase
189   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
190
191   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
192   CHECKLIB=AOD
193   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
194
195   # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
196   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
197   CHECKLIB=CDB
198   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
199
200   # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
201   have_alirawdata=no
202   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
203   CHECKLIB=RAWDatabase
204   AC_CHECK_LIB([$CHECKLIB],[_init],
205         [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
206          LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lESD -lSTEER"
207          CHECKLIB=RAWDatarec
208          AC_CHECK_LIB([$CHECKLIB],[_init],
209                [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
210                 have_alirawdata=$CHECKLIB])],
211         [# second pass with -RAWData
212          CHECKLIB="-lRAWData"
213          LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
214          AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
215                                        #include <AliRawReaderFile.h>
216                                        #include <AliRawReaderDate.h>
217                                        #include <AliRawReaderRoot.h>], 
218                                      [AliRawReaderMemory mreader;
219                                        AliRawReaderFile freader;
220                                        AliRawReaderDate dreader(NULL,0);
221                                        AliRawReaderRoot rreader(NULL,0);])],
222                                      [ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
223                                        have_alirawdata=$CHECKLIB], 
224                                       [have_alirawdata=no])
225         ]) dnl AC_CHECK_LIB RAWDatabase
226   AC_MSG_CHECKING([for AliRawReader classes in RAWData libraries])
227   AC_MSG_RESULT([$have_alirawdata])
228
229   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lSTEER"
230   CHECKLIB=ESD
231   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
232
233   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
234   CHECKLIB=STEER
235   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"],[have_aliroot=no])
236
237   dnl
238   dnl check whether AliLog supports notification callback
239   dnl 2010-03-03: revision 38921 introduces AliLog::GetRootLogger in order to make AliLog
240   dnl a pure sigleton, introduce a 2-level check here
241   dnl
242   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
243   have_alilog_notification=no
244   if test ! "x$have_aliroot" = "xno" ; then
245   AC_MSG_CHECKING([whether AliLog supports notification callback])
246   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliLog.h>], 
247                                   [AliLog* logger=AliLog::GetRootLogger();])],
248                                   [have_alilog_notification=yes],
249                                   [AC_DEFINE(NO_ALILOG_GETROOTLOGGER)
250                                   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliLog.h>], 
251                                                                   [AliLog::AliLogNotification fct])],
252                                                                   [have_alilog_notification=yes], 
253                                                                   [AC_DEFINE(NO_ALILOG_NOTIFICATION)])
254                                   ])
255   AC_MSG_RESULT([$have_alilog_notification])
256   fi
257
258   if test "x$have_aliroot" = "xno" ; then
259     # 2007-08-18 dont reset ALIROOT_CPPFLAGS in order to allow compilation
260     # but library dependencies might not be resolved completely
261     #ALIROOT_CPPFLAGS=
262     AC_MSG_WARN([some of the AliRoot library dependencies are not resolved.
263     This can happen from time to time due to development in AliRoot. You can
264     force compilation of detector libs by --enable-<detector>, but be aware
265     of unresolved references at runtime.])
266     AC_MSG_WARN([       ------------------------------------------ ])
267     AC_MSG_WARN([       Report this to $PACKAGE_BUGREPORT ])
268     AC_MSG_WARN([       please include config.log                  ])
269     AC_MSG_WARN([       ------------------------------------------ ])
270     ALIROOT_LDFLAGS=
271     ALIROOT_LIBS=
272   fi
273
274   dnl
275   dnl ESD supports non-std content
276   dnl
277   have_esd_nonstd=no
278   AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <AliESDEvent.h>
279                                    #include <AliExternalTrackParam.h>
280                                    #include <TTree.h>
281                                    #include <TClonesArray.h>],
282                                   [AliESDEvent esd;
283                                    esd.CreateStdContent();
284                                    TTree* tree=new TTree("esdTree", "Tree with HLT ESD objects");
285                                    TClonesArray* a=new TClonesArray("AliExternalTrackParam");
286                                    a->SetName("SomeObject");
287                                    esd.AddObject(a);
288                                    esd.WriteToTree(tree);
289                                    if (!tree->FindBranch("SomeObject")) return 1;
290                                    return 0;])],
291                  [have_esd_nonstd=yes], 
292                  [AC_DEFINE(HAVE_NOT_ESD_NONSTD)])
293   AC_MSG_CHECKING(whether ESD supports non standard content)
294   AC_MSG_RESULT([$have_esd_nonstd])
295
296   dnl
297   dnl ESD copy function added May 9 2008 rev 25667
298   dnl
299   if test "x$have_esd_nonstd" != "xyes"; then
300   have_esd_copy=no
301   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliESDEvent.h>],
302                                   [AliESDEvent esd1;
303                                    AliESDEvent esd2;
304                                    esd2=esd1;])],
305                  [have_esd_copy=yes], 
306                  [AC_DEFINE(HAVE_NOT_ESD_COPY)])
307   AC_MSG_CHECKING(for ESD assignment operator)
308   AC_MSG_RESULT([$have_esd_copy])
309   fi
310
311   dnl
312   dnl AliRawReaderMemory support for multiple buffers added
313   dnl revision 26829 Jun 2008
314   dnl
315   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/RAW"
316   have_rawreadermemory_multbuffers=no
317   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>],
318                                   [AliRawReaderMemory rr;
319                                    rr.AddBuffer(NULL, 0, 0);])],
320                  [have_rawreadermemory_multbuffers=yes], 
321                  [AC_DEFINE(HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER)])
322   AC_MSG_CHECKING(AliRawReaderMemory support for multiple buffers)
323   AC_MSG_RESULT([$have_rawreadermemory_multbuffers])
324
325   dnl
326   dnl Changes in the magnetic field implementation
327   dnl revision 30848 Feb 1 2009
328   dnl
329   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/STEER"
330   have_alimagf30848=no
331   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMagF.h>],
332                                   [int test=AliMagF::k5kG;])],
333                  [have_alimagf30848=yes], 
334                  [AC_DEFINE(HAVE_NOT_ALIMAGF30848)])
335   AC_MSG_CHECKING(AliMagF contains field definitions)
336   AC_MSG_RESULT([$have_alimagf30848])
337
338   dnl
339   dnl Cleanup of the RunLoader implementation
340   dnl revision 30859 Feb 2 2009
341   dnl
342   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/STEER"
343   have_alirunloader30859=no
344   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRunLoader.h>],
345                                   [AliRunLoader* rl=AliRunLoader::Instance();])],
346                  [have_alirunloader30859=yes], 
347                  [AC_DEFINE(HAVE_NOT_ALIRUNLOADER30859)])
348   AC_MSG_CHECKING(AliRunLoader::Instance)
349   AC_MSG_RESULT([$have_alirunloader30859])
350
351   have_aliqav1=no
352   AC_CHECK_HEADER([AliQAv1.h], [have_aliqav1=yes], [])
353   AM_CONDITIONAL(EN_HLT_QA, test x$have_aliqav1 = xyes)
354   AC_CHECK_HEADER([AliESDHLTDecision.h], [], [AC_DEFINE(HAVE_NOT_ALIESDHLTDECISION)])
355   AC_CHECK_HEADER([AliVCluster.h], [], [AC_DEFINE(HAVE_NOT_ALIVCLUSTER)])
356
357   dnl
358   dnl required header files and libraries for modules
359   dnl
360
361   dnl
362   dnl Check for the interface of AliExternalTrackParam which has been changed
363   dnl in revision 1.17 of AliExternalTrackParam.h (AliRoot version v4-05-04
364   dnl or higher)
365   externaltrackparam_version=1
366   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliExternalTrackParam.h>], 
367                                   [AliExternalTrackParam trackparam;
368                                    Double_t param[[5]]; Double_t covar[[15]];
369                                    trackparam.Set(0., 0., param, covar);])],
370                                   [externaltrackparam_version=2],
371                                   [AC_DEFINE(EXTERNALTRACKPARAM_V1)])
372   AC_MSG_CHECKING(for version of AliExternalTrackParam)
373   AC_MSG_RESULT($externaltrackparam_version)
374
375   dnl The AliShuttleInterface was changed in rev 29388. Some return types
376   dnl had been const, now changed according to gcc 4.3 warnings 
377   AC_MSG_CHECKING(for version of AliShuttleInterface.h)
378     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/"
379     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
380     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
381     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliShuttleInterface.h>],
382                                     [class dummy : public AliShuttleInterface {
383                                      public:
384                                        const UInt_t GetStartTimeDCSQuery() {;}
385                                      };])],
386                                     [AC_DEFINE(SHUTTLE_PRE_REV29388_INTERFACE)
387                                      alishuttleinterface_version=pre.rev.29388],
388                                     [alishuttleinterface_version=up.to.date])
389   AC_MSG_RESULT([$alishuttleinterface_version])
390
391   CPPFLAGS=$save_CPPFLAGS
392   LDFLAGS=$save_LDFLAGS
393   LIBS=$save_LIBS
394 fi # if test ! "x$have_aliroot" = "xno"
395
396 AC_LANG_POP(C++)
397 AC_SUBST([ALICE_ROOT])
398 AC_SUBST([ALIROOT_CPPFLAGS])
399 AC_SUBST([ALIROOT_LDFLAGS])
400 AC_SUBST([ALIROOTBINDIR])
401 AC_SUBST([ALIROOTLIBDIR])
402
403 ALIROOT_LIBS="$ALIROOT_LIBS $ADD_ROOTLIBS"
404 AC_SUBST([ALIROOT_LIBS])
405 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
406
407 HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
408 HLTBASE_LDFLAGS=
409 AC_SUBST([HLTBASE_CPPFLAGS])
410 AC_SUBST([HLTBASE_LDFLAGS])
411
412 dnl ------------------------------------------------------------------
413 dnl check for the HLT PubSub Framework
414 dnl namely for the existence of the HOMER library
415 dnl from Sep 2007, the HOMER lib has been incorporated into the alice-hlt
416 dnl package. It os though possible to choose an external. library
417 dnl In order to make the origni of the HOMER lib clear, the one in AliRoot
418 dnl got the name libAliHLTHOMER
419 AC_MSG_CHECKING([for HLT PubSub Framework])
420 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
421                     [],
422                     [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
423 if test -z $with_pubsub || ! test -d $with_pubsub ; then
424   with_pubsub=no
425 fi
426 AC_MSG_RESULT([$with_pubsub])
427 HOMER_VERSION=2
428 HOMER_LIBS=
429
430 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
431 if test "x$with_pubsub" != "xno" ; then
432   save_CPPFLAGS=$CPPFLAGS
433   save_LDFLAGS=$LDFLAGS
434   save_LIBS=$LIBS
435   # currently the different versions of the HLT PubSub framework have a different
436   # directory layout
437   if test -d ${with_pubsub}/include/HOMER ; then
438     # the 'early' location of the include files with separated HOMER sub dirs
439     HOMER_INCDIRS="${with_pubsub}/include/HOMER ${with_pubsub}/include/HOMER/reader"
440   elif test -d ${with_pubsub}/include/Util/HOMER ; then
441     # location for HLT Framework versions after Sep 2006
442     HOMER_INCDIRS="${with_pubsub}/include/Util/HOMER"
443   elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
444     # fall back if include files were not installed (versions after Sep 06)
445     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/include"
446   else
447     # fall back if include files were not installed (versions before Sep 06)
448     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/reader/include ${with_pubsub}/src/Util/HOMER/data/include"
449   fi
450   HOMER_CPPFLAGS=`for i in ${HOMER_INCDIRS}; do echo -n "-I$i " ; done`
451
452   AC_ARG_ENABLE(pubsub-debug,
453     [AC_HELP_STRING([--disable-pubsub-debug],
454         [force the production version of the PubSub framework])],
455     [],[enable_pubsub_debug=yes])
456   homer_type="none"
457   HOMER_TARGET="`uname -s`-`uname -m`"
458   AC_MSG_CHECKING([for HLT PubSub Framework release type])
459   if test -d "${with_pubsub}/lib/${HOMER_TARGET}-release" ; then
460     homer_type="production"
461     HOMER_TARGET="${HOMER_TARGET}-release"
462   elif test "x$enable_pubsub_debug" = "xyes" && test -d "${with_pubsub}/lib/${HOMER_TARGET}-debug" ; then
463     homer_type="debug"
464     HOMER_TARGET="${HOMER_TARGET}-debug"
465   fi
466   AC_MSG_RESULT([${homer_type}])
467   HOMERREADER_HEADER=HOMERReader.h
468   HOMER_BINDIR="${with_pubsub}/bin/${HOMER_TARGET}"
469   HOMER_LIBDIR="${with_pubsub}/lib/${HOMER_TARGET}"
470   HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
471   CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
472   LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
473   LIBS="$save_LIBS "
474   with_homer=no
475   AC_LANG_PUSH(C++)
476   AC_CHECK_HEADER([$HOMERREADER_HEADER],
477     [ AC_CHECK_LIB([HOMER],[_init],
478       [with_homer=yes
479        HOMER_LIBS="-lHOMER"],
480       [ AC_CHECK_LIB([HOMERReader],[_init],
481                      [with_homer=yes
482                       HOMER_LIBS="-lHOMERReader"])])
483       LIBS="$LIBS $HOMER_LIBS"
484       AC_MSG_CHECKING([version of HOMER library])
485       dnl The Homer library has no versioning, so we do our own
486       dnl version           description
487       dnl ----------------------------------------------------------------------
488       dnl   1          inintial version
489       dnl   2          GetBlockStatusFlags added to the interface
490       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
491                                       [HOMERReader reader("dummy", 0);
492                                        reader.GetBlockStatusFlags(0);])],
493                                       [],
494                                       [HOMER_VERSION=1])
495       AC_MSG_RESULT([$HOMER_VERSION])
496   ],
497   [HOMERREADER_HEADER=]) #AC_CHECK_HEADER([$HOMERREADER_HEADER])
498   AC_LANG_POP(C++)
499   HOMER_INBUILT_LIB=
500 else
501 dnl no pubsub version defined, check if the HOMER lib is available in AliRoot
502   topdir=`dirname $0`
503   HOMER_CPPFLAGS="-I`(cd $topdir; pwd)`/BASE/HOMER"
504   HOMERREADER_HEADER=AliHLTHOMERReader.h
505   HOMER_INBUILT_LIB=`pwd`/BASE/HOMER/libAliHLTHOMER.la
506   HOMER_BINDIR=
507   HOMER_LIBDIR=
508   HOMER_LDFLAGS=
509 fi
510
511   if test "x$with_homer" = "xno" ; then
512     HOMER_CPPFLAGS=
513     HOMER_LDFLAGS=
514     HOMER_LIBS=
515   else
516     HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
517     AC_DEFINE(HAVE_HOMERREADER)
518   fi
519   CPPFLAGS="$save_CPPFLAGS"
520   LDFLAGS="$save_LDFLAGS"
521   LIBS="$save_LIBS"  
522
523 AC_SUBST([HOMERREADER_HEADER])
524 AC_SUBST([HOMER_INBUILT_LIB])
525 AC_SUBST([HOMER_CPPFLAGS])
526 AC_SUBST([HOMER_LDFLAGS])
527 AC_SUBST([HOMER_LIBDIR])
528 AC_SUBST([HOMER_BINDIR])
529 AC_SUBST([HOMER_LIBS])
530
531 dnl ------------------------------------------------------------------
532 AC_ARG_ENABLE(all,
533   [AC_HELP_STRING([--disable-all],
534       [disable all detector modules, individual modules can be switched on by --enable-det])],
535   [disable_all=yes],[])
536
537 dnl ------------------------------------------------------------------
538 AC_MSG_CHECKING([whether to impose strict coding conventions])
539 AC_ARG_ENABLE(strict,
540   [AC_HELP_STRING([--disable-strict],
541       [disable coding convention checks ])],
542   [],[enable_strict=yes])
543 if test "x$enable_strict" = "xyes" ; then
544    CPPFLAGS="$CPPFLAGS -W -Weffc++ -Wall -Wshadow"
545 fi
546 AC_MSG_RESULT([$enable_strict])
547
548 dnl ------------------------------------------------------------------
549 AC_MSG_CHECKING([whether to enable component statistics])
550 AC_ARG_ENABLE(component-stat,
551   [AC_HELP_STRING([--enable-component-stat],
552       [enable component statistics ])],
553   [],[])
554
555 dnl enable component statistics if not explicitely disabled
556 if test "x$enable_component_stat" != "xno" &&
557    test "x$enable_debug" = "xyes" ; then
558    enable_component_stat=yes.debug
559 fi
560
561 if test "x$enable_component_stat" = "x" ; then
562    enable_component_stat=no
563 fi
564
565 if test "x$enable_component_stat" != "xno" ; then
566    AC_DEFINE(HLT_COMPONENT_STATISTICS)
567 fi
568 AC_MSG_RESULT([$enable_component_stat])
569
570 dnl ------------------------------------------------------------------
571 dnl ----  module checks
572 dnl ------------------------------------------------------------------
573 save_CPPFLAGS=$CPPFLAGS
574 save_LDFLAGS=$LDFLAGS
575 save_LIBS=$LIBS
576
577 dnl ------------------------------------------------------------------
578 AC_MSG_NOTICE([-------------------------------------------------])
579 AC_MSG_NOTICE([checking dependencies for HLTbase library])
580 HLTBASE_CHECKLIBS='XMLParser'
581 for CHECKLIB in $HLTBASE_CHECKLIBS ; do
582   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
583   LIBS="$save_LIBS $ROOTLIBS $ALIHLTBASE_LIBS"
584   AC_CHECK_LIB([$CHECKLIB],[_init], [ALIHLTBASE_LIBS="$ALIHLTBASE_LIBS -l$CHECKLIB"])
585 done
586 AC_SUBST([ALIHLTBASE_LIBS])
587
588 dnl ------------------------------------------------------------------
589 AC_MSG_CHECKING([whether to compile sample library])
590 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
591 AC_ARG_ENABLE(sample,
592   [AC_HELP_STRING([--disable-sample],
593       [compile the sample library ])],
594   [],
595   [if test "x$have_aliroot" = "xno" ; then
596      enable_sample="no...requires.AliRoot"
597    else
598      enable_sample=yes
599    fi
600   ])
601
602 if test "x$enable_sample" = "xyes" ; then 
603   AC_DEFINE(HLT_SAMPLE)
604 fi
605 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
606 AC_MSG_RESULT([$enable_sample])
607
608 dnl ------------------------------------------------------------------
609 AH_TEMPLATE([HLT_UTIL],[HLT utility library])
610 ALIUTIL_LIBS=
611 CHECK_HLTMODULE([util],
612                 [], 
613                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/STEER -I$ALICE_ROOT/RAW -I$ALICE_ROOT/PYTHIA6 -I$ALICE_ROOT/ANALYSIS],
614                 [ANALYSIS ANALYSISalice], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
615                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
616                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
617
618 if test "x$enable_module" = "xmissheader"; then
619   enable_module="no...missing.headers"
620   enable_util=$enable_module
621 elif test "x$enable_module" = "xforce"; then
622   enable_util="yes"
623 else
624   enable_util=$enable_module
625 fi
626 if test "x$enable_util" = "xyes" ; then 
627   AC_DEFINE(HLT_UTIL)
628   ALIUTIL_LIBS=$ALIHLTMODULE_LIBS
629 fi
630 AM_CONDITIONAL(EN_HLT_UTIL, test x$enable_util = xyes)
631 AC_MSG_CHECKING([whether to compile Util library])
632 AC_MSG_RESULT([$enable_module])
633 AC_SUBST([ALIUTIL_LIBS])
634
635 dnl ------------------------------------------------------------------
636 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
637
638 ALITPC_LIBS=
639 CHECK_HLTMODULE([tpc],
640                 [AliTPCRawStream.h], 
641                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/TPC],
642                 [Gui ANALYSIS STAT], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
643                 [TPCbase TPCrec TPCcalib], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
644                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
645
646 if test "x$enable_module" = "xmissheader"; then
647   enable_module="no...missing.headers"
648   enable_tpc=$enable_module
649 elif test "x$enable_module" = "xforce"; then
650   enable_tpc="yes"
651 else
652   enable_tpc=$enable_module
653 fi
654
655 if test "x$enable_tpc" = "xyes" ; then 
656   AC_LANG_PUSH(C++)
657   AC_DEFINE(HLT_TPC)
658   ALITPC_LIBS=$ALIHLTMODULE_LIBS
659   dnl
660   dnl Check for functionality in the TPC reconstruction required for online
661   dnl processing
662   dnl 
663   have_tpc_hltoffline_rec=no
664   AC_MSG_CHECKING(for on-line features of TPC offline reconstruction)
665     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
666     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
667     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
668     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliTPCtrackerMI.h>
669                                        #include <AliTPCclustererMI.h>   
670                                        #include <TObjArray.h>], 
671                                     [AliTPCtrackerMI tracker;
672                                        TObjArray* array=NULL;
673                                        tracker.LoadClusters(array);
674                                        AliTPCclustererMI cl(NULL, NULL);
675                                        cl.GetOutputClonesArray();])],
676                                     [have_tpc_hltoffline_rec=yes], 
677                                       [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)])
678   AC_MSG_RESULT([$have_tpc_hltoffline_rec])
679
680     have_alitpcclusterparam_r40128=no
681     AC_MSG_CHECKING([checking for AliTPCClusterParam r40128])
682     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTPCClusterParam.h>], 
683                                        [AliTPCClusterParam param;
684                                           float test=param.ParamS0Par(0,0,0)]);],
685                                        [have_alitpcclusterparam_r40128=yes],
686                                          [AC_DEFINE(HAVE_NOT_ALITPCCLUSTERPARAM_r40128)])
687     AC_MSG_RESULT([$have_alitpcclusterparam_r40128])
688
689     LIBS=$save_LIBS
690
691
692   AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])
693   AC_CHECK_HEADER([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)])
694   AC_CHECK_HEADER([AliAltroRawStreamV3.h], [], [AC_DEFINE(HAVE_NOT_ALTRORAWSTREAMV3)])
695
696   have_tpc_mapping=no
697   if test ! "x$have_aliroot" = "xno" ; then
698     # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC 
699     # which is stored in the TPC/mapping/Patchx.data files from
700     # AliRoot version v4-04-Release (May 2006)
701     AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
702     TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
703     AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], 
704                    [have_tpc_mapping=yes
705                     AC_SUBST(TPC_PAD_MAPPING_PATH)
706                     AC_DEFINE(HAVE_TPC_MAPPING)],
707                    [])
708     
709   fi
710   AC_MSG_CHECKING([for TPC mapping layout])
711   AC_MSG_RESULT([$have_tpc_mapping])
712   AC_LANG_POP(C++)
713
714 else
715   enable_module=$enable_tpc
716 fi
717 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
718 AC_MSG_CHECKING([whether to compile TPC library])
719 AC_MSG_RESULT([$enable_module])
720 AC_SUBST([ALITPC_LIBS])
721
722 dnl ------------------------------------------------------------------
723 AH_TEMPLATE([HLT_RCU],[hlt rcu library])
724
725 CHECK_HLTMODULE([rcu],
726                 [AliAltroDecoder.h], 
727                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/RAW],
728                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
729                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
730                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
731
732 if test "x$enable_module" = "xmissheader"; then
733   enable_module="no...missing.headers"
734   enable_rcu=$enable_module
735 elif test "x$enable_module" = "xforce"; then
736   enable_rcu="yes"
737 else
738   AC_LANG_PUSH(C++)
739   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
740   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
741   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
742   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliAltroDecoder.h>], 
743                                   [AliAltroDecoder decoder;
744                                   decoder.CopyBackward(NULL, 0);])],
745                                   [enable_rcu=$enable_module], 
746                                   [enable_module="no...requires.AliRoot>v4-10-Release"
747                                    enable_rcu="no...requires.AliRoot>v4-10-Release"])
748   CPPFLAGS=$save_CPPFLAGS
749   LDFLAGS=$save_LDFLAGS
750   LIBS=$save_LIBS
751   AC_LANG_POP(C++)
752 fi
753
754 if test "x$enable_rcu" = "xyes" ; then 
755   AC_DEFINE(HLT_RCU)
756 else
757   enable_module=$enable_rcu
758 fi
759 AM_CONDITIONAL(EN_HLT_RCU, test x$enable_rcu = xyes)
760 AC_MSG_CHECKING([whether to compile RCU library])
761 AC_MSG_RESULT([$enable_module])
762 AC_SUBST([ALIRCU_LIBS])
763
764 dnl ------------------------------------------------------------------
765 AH_TEMPLATE([HLT_CALO],[hlt calo(rimeter) library])
766   
767 ALICALO_LIBS=
768 CHECK_HLTMODULE([calo],
769                 [], [$ALIROOT_CPPFLAGS],
770                 [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
771                 [EMCALUtils PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
772                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
773
774 if test "x$enable_module" = "xmissheader"; then
775   enable_module="no...missing.headers"
776   enable_calo=$enable_module
777 elif test "x$enable_module" = "xforce"; then
778   enable_calo="yes"
779 else
780   have_alicalorawstream=no
781   if test ! "x$have_aliroot" = "xno" ; then
782     AC_LANG_PUSH(C++)
783     save_CPPFLAGS="$CPPFLAGS"
784     # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
785     #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
786     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
787     AC_MSG_CHECKING([for AliCaloRawStream.h usability])
788     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
789                                         #include <AliCaloRawStream.h>], 
790                                        [int i])],
791                                        [AC_DEFINE(HAVE_ALICALORAWSTREAM)
792                                         have_alicalorawstream=yes], 
793                                        [])
794     AC_MSG_RESULT([$have_alicalorawstream])
795
796     have_aliesdcalocluster_r38477=no
797     AC_MSG_CHECKING([for AliESDCaloCluster r38477])
798     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliESDCaloCluster.h>], 
799                                        [AliESDCaloCluster cluster;
800                                         cluster.SetTrackDistance(0.0, 0.0)]);],
801                                        [have_aliesdcalocluster_r38477=yes],
802                                          [AC_DEFINE(HAVE_NOT_ALIESDCALOCLUSTER_r38477)])
803     AC_MSG_RESULT([$have_aliesdcalocluster_r38477])
804
805     AC_LANG_POP(C++)
806     CPPFLAGS="$save_CPPFLAGS"
807   fi
808   if test "x$have_alicalorawstream" != "xyes"; then
809     enable_calo="no...requires.AliRoot>v4-05-07"
810   else
811     enable_calo=$enable_module
812   fi
813 fi
814
815 if test "x$enable_calo" = "xyes" ; then 
816   AC_DEFINE(HLT_CALO)
817   ALICALO_LIBS=$ALIHLTMODULE_LIBS
818 else
819   enable_module=$enable_calo
820 fi
821 AM_CONDITIONAL(EN_HLT_CALO, test x$enable_calo = xyes)
822 AC_MSG_CHECKING([whether to compile CALO library])
823 AC_MSG_RESULT([$enable_module])
824 AC_SUBST([ALICALO_LIBS])
825
826 dnl ------------------------------------------------------------------
827 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
828   
829 ALIPHOS_LIBS=
830 CHECK_HLTMODULE([phos],
831                 [], [$ALIROOT_CPPFLAGS],
832                 [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
833                 [PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
834                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
835
836 if test "x$enable_module" = "xmissheader"; then
837   enable_module="no...requires.AliRoot>v4-05-07"
838   enable_phos=$enable_module
839 elif test "x$enable_module" = "xforce"; then
840   enable_phos="yes"
841 else
842   have_alicalorawstream=no
843   if test ! "x$have_aliroot" = "xno" ; then
844     AC_LANG_PUSH(C++)
845     save_CPPFLAGS="$CPPFLAGS"
846     # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
847     #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
848     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
849     AC_MSG_CHECKING([for AliCaloRawStream.h usability])
850     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
851                                         #include <AliCaloRawStream.h>], 
852                                        [int i])],
853                                        [AC_DEFINE(HAVE_ALICALORAWSTREAM)
854                                         have_alicalorawstream=yes], 
855                                        [])
856     AC_MSG_RESULT([$have_alicalorawstream])
857     AC_MSG_CHECKING([for required EMC functionality in AliPHOSRecoParam.h ])
858     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliPHOSRecoParam.h>], 
859                                        [AliPHOSRecoParam param;
860                                         param.GetEMCClusteringThreshold()])],
861                                        [have_aliphosrecoparam=yes], 
862                                        [AC_DEFINE(HAVE_NOT_PHOSRECOPARAMEMC)])
863     AC_MSG_RESULT([$have_aliphosrecoparam])
864     AC_LANG_POP(C++)
865     CPPFLAGS="$save_CPPFLAGS"
866   fi
867   if test "x$have_alicalorawstream" != "xyes"; then
868     enable_phos="no...requires.AliRoot>v4-05-07"
869   else
870     enable_phos=$enable_module
871   fi
872 fi
873
874 if test "x$enable_phos" = "xyes" ; then 
875   AC_DEFINE(HLT_PHOS)
876   ALIPHOS_LIBS=$ALIHLTMODULE_LIBS
877 else
878   enable_module=$enable_phos
879 fi
880 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
881 AC_MSG_CHECKING([whether to compile PHOS library])
882 AC_MSG_RESULT([$enable_module])
883 AC_SUBST([ALIPHOS_LIBS])
884
885 dnl ------------------------------------------------------------------
886 AH_TEMPLATE([HLT_EMCAL],[hlt emcal library])
887
888 ALIEMCAL_LIBS=
889 CHECK_HLTMODULE([emcal],
890                 [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/VZERO],
891                 [RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
892                 [EMCALrec EMCALsim EMCALbase EMCALUtils VZERObase], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
893                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
894
895 if test "x$enable_module" = "xmissheader"; then
896   enable_module="no...header.missing"
897   enable_emcal=$enable_module
898 elif test "x$enable_module" = "xforce"; then
899   enable_emcal="yes"
900 else
901   enable_emcal=$enable_module
902 fi
903
904 if test "x$enable_emcal" = "xyes" ; then 
905   AC_DEFINE(HLT_EMCAL)
906   ALIEMCAL_LIBS=$ALIHLTMODULE_LIBS
907 else
908   enable_module=$enable_emcal
909 fi
910 AM_CONDITIONAL(EN_HLT_EMCAL, test x$enable_emcal = xyes)
911 AC_MSG_CHECKING([whether to compile EMCAL library])
912 AC_MSG_RESULT([$enable_module])
913 AC_SUBST([ALIEMCAL_LIBS])
914
915 dnl ------------------------------------------------------------------
916 AH_TEMPLATE([HLT_TRD],[hlt trd library])
917   
918 ALITRD_LIBS=
919 CHECK_HLTMODULE([trd],
920                 [], [],
921                 [MLP XMLParser], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
922                 [STAT TRDbase TRDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
923                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
924
925 if test "x$enable_module" = "xmissheader"; then
926   enable_module="no...requires.AliRoot>v4-07-Release"
927   enable_trd=$enable_module
928 elif test "x$enable_module" = "xforce"; then
929   enable_trd="yes"
930 else
931   enable_trd=$enable_module
932   if test "x$enable_trd" = "xyes" ; then
933     AC_LANG_PUSH(C++)
934     save_CPPFLAGS="$CPPFLAGS"
935     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/TRD"
936     # AliTRDclusterizer::SetRawVersion() requires >v4-07-Release
937     # changed to AliTRDrecoParam::SetSeedingOn() due to revision 26327, Mon Jun 2 2008
938     # changed to AliTRDReconstructor::SetStreamLevel() due to revision 27797, Tue Aug 5 2008
939     # changed to AliTRDReconstructor::SetClusters() according to revision 28069, Mon Aug 18 2008
940     # changed to AliTRDCluster according to revision 30461, Thu Dec 18 2008
941     # changed to AliTRDclusterizer::GetAddedClusters according to revision 31299, Wed Mar 4 2009
942     # changed to AliTRDclusterizer::GetNTimeBins according to revision 37102 Sun Nov 22 2009
943     AC_MSG_CHECKING([for required functions in AliTRDclusterizer])
944     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDclusterizer.h>], 
945                                        [AliTRDclusterizer c;
946                                        c.GetNTimeBins()])],
947                                        [], 
948                                        [enable_trd="no...requires.AliRoot>v4-18-Release"])
949     AC_MSG_RESULT([$enable_trd])       
950
951     if test "x$enable_trd" = "xyes" ; then
952       have_alitrdseedv1_r39693=no
953       AC_MSG_CHECKING([checking for AliTRDseedV1 r39693])
954       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDseedV1.h>], 
955                                          [AliTRDseedV1 seed;
956                                           seed.SetC(0.0, 1)]);],
957                                          [have_alitrdseedv1_r39693=yes],
958                                          [AC_DEFINE(HAVE_NOT_ALITRD_SEEDV1_r39693)])
959       AC_MSG_RESULT([$have_alitrdseedv1_r39693])
960
961       have_alitrdrawstream_r39608=no
962       AC_MSG_CHECKING([checking for AliTRDrawStream r39608])
963       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDrawStreamBase.h>], 
964                                          [AliTRDrawStreamBase::SetRawStreamVersion(AliTRDrawStreamBase::kTRDdefaultStream)]);],
965                                          [have_alitrdrawstream_r39608=yes],
966                                          [AC_DEFINE(HAVE_NOT_ALITRD_RAWSTREAM_r39608)])
967       AC_MSG_RESULT([$have_alitrdrawstream_r39608])
968
969       have_alitrdrecoparam_r41621=no
970       AC_MSG_CHECKING([checking for AliTRDrecoParam r41621])
971       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDrecoParam.h>], 
972                                          [AliTRDrecoParam::GetLowFluxHLTParam()]);],
973                                          [have_alitrdrecoparam_r41621=yes],
974                                          [AC_DEFINE(HAVE_NOT_ALITRD_RECOPARAM_r41621)])
975       AC_MSG_RESULT([$have_alitrdrecoparam_r41621])
976
977       have_alitrdclusterizer_r42837=no
978       AC_MSG_CHECKING([checking for AliTRDclusterizer r42837])
979       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDclusterizer.h>], 
980                                          [AliTRDclusterizer o; o.SetSkipTransform()]);],
981                                          [have_alitrdclusterizer_r42837=yes],
982                                          [AC_DEFINE(HAVE_NOT_ALITRD_CLUSTERIZER_r42837)])
983       AC_MSG_RESULT([$have_alitrdclusterizer_r42837])
984     fi
985
986     AC_LANG_POP(C++)
987     CPPFLAGS="$save_CPPFLAGS"
988   fi
989 fi
990
991 if test "x$enable_trd" = "xyes" ; then 
992   AC_DEFINE(HLT_TRD)
993   ALITRD_LIBS=$ALIHLTMODULE_LIBS
994 else
995   enable_module=$enable_trd
996 fi
997 AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
998 AC_MSG_CHECKING([whether to compile TRD library])
999 AC_MSG_RESULT([$enable_module])
1000 AC_SUBST([ALITRD_LIBS])
1001
1002 dnl ------------------------------------------------------------------
1003 AH_TEMPLATE([HLT_FMD],[hlt fmd library])
1004
1005 ALIFMD_LIBS=$ALIHLTMODULE_LIBS
1006 CHECK_HLTMODULE([fmd],
1007                 [], [],
1008                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1009                 [FMDbase FMDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
1010                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1011
1012 if test "x$enable_module" = "xmissheader"; then
1013   enable_module="no...missing.headers"
1014   enable_fmd=$enable_module
1015 elif test "x$enable_module" = "xforce"; then
1016   enable_fmd="yes"
1017 else
1018   enable_fmd=$enable_module
1019 fi
1020
1021 if test "x$enable_fmd" = "xyes" ; then
1022   AC_DEFINE(HLT_FMD)
1023   ALIFMD_LIBS=$ALIHLTMODULE_LIBS
1024 else
1025   enable_module=$enable_fmd
1026 fi
1027 AM_CONDITIONAL(EN_HLT_FMD, test x$enable_fmd = xyes)
1028 AC_MSG_CHECKING([whether to compile FMD library])
1029 AC_MSG_RESULT([$enable_module])
1030 AC_SUBST([ALIFMD_LIBS])
1031
1032 dnl ------------------------------------------------------------------
1033 AH_TEMPLATE([HLT_ZDC],[hlt zdc library])
1034
1035 ALIZDC_LIBS=$ALIHLTMODULE_LIBS
1036 CHECK_HLTMODULE([zdc],
1037                 [], [$ALIROOT_CPPFLAGS],
1038                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1039                 [ZDCbase ZDCrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
1040                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1041
1042 if test "x$enable_module" = "xmissheader"; then
1043   enable_module="no...missing.headers"
1044   enable_zdc=$enable_module
1045 elif test "x$enable_module" = "xforce"; then
1046   enable_zdc="yes"
1047 else
1048   enable_zdc=$enable_module
1049
1050   if test "x$enable_zdc" = "xyes" ; then
1051     AC_LANG_PUSH(C++)
1052     save_CPPFLAGS="$CPPFLAGS"
1053     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/ZDC"
1054
1055
1056     # AliZDCReconstructor::GetZDCESDData() is needed, requires revision 43770, Wed Sep 22 2010
1057     AC_MSG_CHECKING([checking for  AliZDCReconstructor::GetZDCESDData() r43770])
1058     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliZDCReconstructor.h>], 
1059                                        [AliZDCReconstructor rec;
1060                                         rec.GetZDCESDData()])],
1061                                        [], 
1062                                        [enable_zdc="no...requires.r43770"])
1063     AC_MSG_RESULT([$enable_zdc])       
1064
1065     AC_LANG_POP(C++)
1066     CPPFLAGS="$save_CPPFLAGS"
1067   fi
1068
1069 fi
1070
1071 if test "x$enable_zdc" = "xyes" ; then
1072   AC_DEFINE(HLT_ZDC)
1073   ALIZDC_LIBS=$ALIHLTMODULE_LIBS
1074 else
1075   enable_module=$enable_zdc
1076 fi
1077 AM_CONDITIONAL(EN_HLT_ZDC, test x$enable_zdc = xyes)
1078 AC_MSG_CHECKING([whether to compile ZDC library])
1079 AC_MSG_RESULT([$enable_module])
1080 AC_SUBST([ALIZDC_LIBS])
1081
1082 dnl ------------------------------------------------------------------
1083 AH_TEMPLATE([HLT_MUON],[hlt dimuon library])
1084
1085 ALIMUON_LIBS=
1086 CHECK_HLTMODULE([dimuon],
1087                 [AliMpExMap.h AliMUONTriggerIO.h], 
1088                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/MUON -I$ALICE_ROOT/MUON/mapping],
1089                 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1090                 [MUONcore MUONraw MUONbase MUONgeometry MUONmapping MUONcalib MUONsim MUONtrigger MUONevaluation MUONrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1091                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1092
1093 if test "x$enable_module" = "xmissheader"; then
1094   enable_module="no...requires.AliRoot>=v4-08-Release"
1095   enable_muon=$enable_module
1096 elif test "x$enable_module" = "xforce"; then
1097   enable_muon="yes"
1098 else
1099   enable_muon=$enable_module
1100 fi
1101
1102 if test "x$enable_muon" = "xyes" ; then 
1103   AC_DEFINE(HLT_MUON)
1104   ALIMUON_LIBS=$ALIHLTMODULE_LIBS
1105   AC_LANG_PUSH(C++)
1106   save_CPPFLAGS="$CPPFLAGS"
1107
1108   dnl
1109   dnl Check for functionality GetRawStream AliMUONDigitMaker.h
1110   dnl 
1111   have_muon_digitmaker_getrawstream=no
1112   AC_MSG_CHECKING(for GetRawStream methods of AliMUONDigitMaker)
1113     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON"
1114     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
1115     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
1116     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMUONDigitMaker.h>], 
1117                                     [AliMUONDigitMaker dm;
1118                                        dm.GetRawStreamTracker();])],
1119                                     [have_muon_digitmaker_getrawstream=yes], 
1120                                       [AC_DEFINE(HAVE_NOT_MUON_DIGITMAKER_GETRAWSTREAM)])
1121     LIBS=$save_LIBS
1122   AC_MSG_RESULT([$have_muon_digitmaker_getrawstream])
1123
1124   dnl
1125   dnl Check for AliMpPad::GetPositionX/Y
1126   dnl change of implementation in MUON code
1127   dnl revision 31769, Wed Apr 1 2009
1128   dnl 
1129   have_muon_alimppad_getposition=no
1130   AC_MSG_CHECKING(for GetPosition methods of AliMpPad)
1131     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON/mapping"
1132     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
1133     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
1134     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMpPad.h>], 
1135                                     [AliMpPad pad;
1136                                      pad.GetPositionX();])],
1137                                     [have_muon_alimppad_getposition=yes], 
1138                                       [AC_DEFINE(HAVE_NOT_MUON_ALIMPPAD_GETPOSITION)])
1139     LIBS=$save_LIBS
1140   AC_MSG_RESULT([$have_muon_alimppad_getposition])
1141
1142   CPPFLAGS="$save_CPPFLAGS"
1143
1144   AC_LANG_POP(C++)
1145 else
1146   enable_module=$enable_muon
1147 fi
1148 AM_CONDITIONAL(EN_HLT_MUON, test x$enable_muon = xyes)
1149 AC_MSG_CHECKING([whether to compile MUON library])
1150 AC_MSG_RESULT([$enable_module])
1151 AC_SUBST([ALIMUON_LIBS])
1152
1153 dnl ------------------------------------------------------------------
1154 AH_TEMPLATE([HLT_TRIGGER],[hlt trigger library])
1155
1156 ALITRIGGER_LIBS=
1157 CHECK_HLTMODULE([trigger],
1158                 [], [$ALIROOT_CPPFLAGS],
1159                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1160                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1161                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1162
1163 if test "x$enable_module" = "xmissheader"; then
1164   enable_module="no...header.missing"
1165   enable_trigger=$enable_module
1166 elif test "x$enable_module" = "xforce"; then
1167   enable_trigger="yes"
1168 else
1169   enable_trigger=$enable_module
1170 fi
1171
1172 if test "x$enable_trigger" = "xyes" ; then 
1173   AC_DEFINE(HLT_TRIGGER)
1174   ALITRIGGER_LIBS=$ALIHLTMODULE_LIBS
1175 else
1176   enable_module=$enable_trigger
1177 fi
1178 AM_CONDITIONAL(EN_HLT_TRIGGER, test x$enable_trigger = xyes)
1179 AC_MSG_CHECKING([whether to compile Trigger library])
1180 AC_MSG_RESULT([$enable_module])
1181 AC_SUBST([ALITRIGGER_LIBS])
1182
1183 dnl ------------------------------------------------------------------
1184 AH_TEMPLATE([HLT_GLOBAL],[hlt global library])
1185
1186 ALIGLOBAL_LIBS=
1187 CHECK_HLTMODULE([global],
1188                 [], [$ALIROOT_CPPFLAGS],
1189                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1190                 [PHOSUtils ], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1191                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1192
1193 if test "x$enable_module" = "xmissheader"; then
1194   enable_module="no...header.missing"
1195   enable_global=$enable_module
1196 elif test "x$enable_module" = "xforce"; then
1197   enable_global="yes"
1198 else
1199   enable_global=$enable_module
1200   if test "x$enable_global" = "xyes" ; then
1201     AC_LANG_PUSH(C++)
1202     save_CPPFLAGS="$CPPFLAGS"
1203     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
1204     AC_MSG_CHECKING([for required functions in AliESDtrack])
1205     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliESDtrack.h>], 
1206                                        [AliESDtrack t;
1207                                        t.SetGlobalChi2(0)])],
1208                                        [], 
1209                                        [enable_global="no...requires.AliRoot>v4-17-Release"])
1210     AC_MSG_RESULT([$enable_global])       
1211     AC_LANG_POP(C++)
1212     CPPFLAGS="$save_CPPFLAGS"
1213   fi
1214 fi
1215
1216 if test "x$enable_global" = "xyes" ; then 
1217   AC_DEFINE(HLT_GLOBAL)
1218   ALIGLOBAL_LIBS=$ALIHLTMODULE_LIBS
1219 else
1220   enable_module=$enable_global
1221 fi
1222 AM_CONDITIONAL(EN_HLT_GLOBAL, test x$enable_global = xyes)
1223 AC_MSG_CHECKING([whether to compile Global library])
1224 AC_MSG_RESULT([$enable_module])
1225 AC_SUBST([ALIGLOBAL_LIBS])
1226
1227 dnl ------------------------------------------------------------------
1228 AH_TEMPLATE([HLT_JET],[hlt jet library])
1229
1230 ALIFASTJET_HEADER=
1231 ALIFASTJET_INCFLAGS=
1232 ALIFASTJET_LIBS=
1233 ALIFASTJET_LDFLAGS=
1234 AC_ARG_WITH(fastjet, [installation path of the FASTJET package],
1235                      [ test "x$with_fastjet" != "xno" && export FASTJET=$with_fastjet],
1236                      [ test -n $FASTJET && with_fastjet=$FASTJET ])
1237
1238 if test "x$with_fastjet" != "x" && test "x$with_fastjet" != "xno" ; then
1239   ALIFASTJET_INCFLAGS="-I${with_fastjet}/include"
1240   ALIFASTJET_HEADER="fastjet/PseudoJet.hh"
1241   ALIFASTJET_LDFLAGS="-L${with_fastjet}/lib"
1242   ALIFASTJET_LIBS="CGAL fastjet"
1243 else
1244   with_fastjet=no
1245 fi
1246
1247 CHECK_HLTMODULE([jet],
1248         [$ALIFASTJET_HEADER], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/JETAN $ALIFASTJET_INCFLAGS],
1249         [$ALIFASTJET_LIBS], [-L$ROOTLIBDIR $ALIFASTJET_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS],
1250         [AOD ESD ANALYSIS ANALYSISalice JETAN], 
1251         [-L$ROOTLIBDIR $ALIROOT_LDFLAGS $ALIFASTJET_LDFLAGS -L$ALICE_ROOT/lib/tgt_$ALICE_TARGET],
1252         [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1253
1254 if test "x$enable_module" = "xmissheader"; then
1255   enable_module="no...header.missing"
1256   enable_jet=$enable_module
1257 elif test "x$enable_module" = "xforce"; then
1258   enable_jet="yes"
1259 else
1260   enable_jet=$enable_module
1261 fi
1262
1263 if test "x$enable_jet" = "xyes" ; then
1264   AC_DEFINE(HLT_JET)
1265   ALIJET_LIBS="$ALIHLTMODULE_LIBS"
1266   
1267   if test "x$with_fastjet" != "xno"; then
1268      AC_DEFINE(HAVE_FASTJET)
1269      AC_DEFINE(WITHFASTJET)
1270      ALIJET_LIBS="$ALIJET_LIBS $FASTJET_LDFLAGS"
1271   fi
1272   AC_MSG_CHECKING([compilation with FASTJET package])
1273   AC_MSG_RESULT($with_fastjet)
1274
1275 else
1276   enable_module=$enable_jet
1277 fi
1278
1279 AM_CONDITIONAL(EN_HLT_JET, test x$enable_jet = xyes)
1280 AC_MSG_CHECKING([whether to compile Jet library])
1281 AC_MSG_RESULT([$enable_module])
1282 AC_SUBST([ALIJET_LIBS])
1283
1284 dnl ------------------------------------------------------------------
1285 AH_TEMPLATE([HLT_VZERO],[hlt vzero library])
1286
1287 ALIVZERO_LIBS=
1288 CHECK_HLTMODULE([vzero],
1289                 [], [$ALIROOT_CPPFLAGS],
1290                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1291                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1292                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1293
1294 if test "x$enable_module" = "xmissheader"; then
1295   enable_module="no...header.missing"
1296   enable_vzero=$enable_module
1297 elif test "x$enable_module" = "xforce"; then
1298   enable_vzero="yes"
1299 else
1300   enable_vzero=$enable_module
1301
1302   if test "x$enable_vzero" = "xyes" ; then
1303     AC_LANG_PUSH(C++)
1304     save_CPPFLAGS="$CPPFLAGS"
1305     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/VZERO"
1306
1307     # AliVZEROReconstructor::GetESDVZERO() is needed, requires revision 43718, Tue Sep 21 2010
1308     AC_MSG_CHECKING([checking for AliVZEROReconstructor::GetESDVZERO() r43718])
1309     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliVZEROReconstructor.h>], 
1310                                        [AliVZEROReconstructor rec;
1311                                         rec.GetESDVZERO()])],
1312                                        [], 
1313                                        [enable_vzero="no...requires.r43718"])
1314     AC_MSG_RESULT([$enable_vzero])       
1315
1316     AC_LANG_POP(C++)
1317     CPPFLAGS="$save_CPPFLAGS"
1318   fi
1319 fi
1320
1321 if test "x$enable_vzero" = "xyes" ; then 
1322   AC_DEFINE(HLT_VZERO)
1323   ALIVZERO_LIBS=$ALIHLTMODULE_LIBS
1324 else
1325   enable_module=$enable_vzero
1326 fi
1327 AM_CONDITIONAL(EN_HLT_VZERO, test x$enable_vzero = xyes)
1328 AC_MSG_CHECKING([whether to compile VZERO library])
1329 AC_MSG_RESULT([$enable_module])
1330 AC_SUBST([ALIVZERO_LIBS])
1331
1332 dnl ------------------------------------------------------------------
1333 AH_TEMPLATE([HLT_ITS],[hlt its library])
1334
1335 ALIITS_LIBS=
1336 CHECK_HLTMODULE([its],
1337                 [AliITSCompressRawDataSDD.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS],
1338                 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1339                 [ITSbase ITSrec ITSsim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1340                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1341
1342 if test "x$enable_module" = "xmissheader"; then
1343   enable_module="no...header.missing"
1344   enable_its=$enable_module
1345 elif test "x$enable_module" = "xforce"; then
1346   enable_its="yes"
1347 else
1348   enable_its=$enable_module
1349   if test "x$enable_its" = "xyes" ; then
1350     AC_LANG_PUSH(C++)
1351     save_CPPFLAGS="$CPPFLAGS"
1352     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS"
1353     # changes in the AliVertexer base class revision 26414, Thu Jun 5 15:36:18 2008
1354     # require AliVertexer::GetNominalPos()
1355     AC_MSG_CHECKING([for required functions in AliITSVertexer])
1356     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliITSVertexerZ.h>], 
1357                                        [AliITSVertexerZ v;
1358                                        v.GetNominalPos()])],
1359                                        [], 
1360                                        [enable_its="no...requires.AliRoot>v4-13-Release"])
1361     AC_MSG_RESULT([$enable_its])       
1362     AC_LANG_POP(C++)
1363     CPPFLAGS="$save_CPPFLAGS"
1364   fi
1365 fi
1366
1367 if test "x$enable_its" = "xyes" ; then 
1368   AC_DEFINE(HLT_ITS)
1369   ALIITS_LIBS=$ALIHLTMODULE_LIBS
1370 else
1371   enable_module=$enable_its
1372 fi
1373 AM_CONDITIONAL(EN_HLT_ITS, test x$enable_its = xyes)
1374 AC_MSG_CHECKING([whether to compile ITS library])
1375 AC_MSG_RESULT([$enable_module])
1376 AC_SUBST([ALIITS_LIBS])
1377
1378 dnl ------------------------------------------------------------------
1379 AH_TEMPLATE([HLT_COMP],[hlt comp library])
1380
1381 ALICOMP_LIBS=
1382 CHECK_HLTMODULE([comp],
1383                 [], [$ALIROOT_CPPFLAGS],
1384                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1385                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1386                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1387
1388 if test "x$enable_module" = "xmissheader"; then
1389   enable_module="no...header.missing"
1390   enable_comp=$enable_module
1391 elif test "x$enable_module" = "xforce"; then
1392   enable_comp="yes"
1393 else
1394   enable_comp=$enable_module
1395 fi
1396
1397 if test "x$enable_comp" = "xyes" ; then 
1398   AC_DEFINE(HLT_COMP)
1399   ALICOMP_LIBS=$ALIHLTMODULE_LIBS
1400 else
1401   enable_module=$enable_comp
1402 fi
1403 AM_CONDITIONAL(EN_HLT_COMP, test x$enable_comp = xyes)
1404 AC_MSG_CHECKING([whether to compile comp library])
1405 AC_MSG_RESULT([$enable_module])
1406 AC_SUBST([ALICOMP_LIBS])
1407
1408 dnl ------------------------------------------------------------------
1409 AC_MSG_CHECKING([whether to disable AliRoot logging])
1410 AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
1411 AC_ARG_ENABLE(aliroot-logging,
1412   [AC_HELP_STRING([--disable-aliroot-logging],
1413       [disable logging through AliRoot logging methods])],
1414   [],[enable_aliroot_logging=no])
1415 if test "x$have_aliroot" = "xno" ; then
1416   enable_aliroot_logging=yes # this means 'disable'
1417 fi
1418 if test "x$enable_aliroot_logging" != "xno" ; then 
1419   AC_DEFINE(NOALIROOT_LOGGING)
1420 fi
1421 AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
1422 AC_MSG_RESULT([$enable_aliroot_logging])
1423
1424 dnl ------------------------------------------------------------------
1425 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
1426 AH_TEMPLATE([DOMC],[MC saving])
1427 AC_ARG_ENABLE(mc-saving,
1428   [AC_HELP_STRING([--enable-mc-saving],
1429       [enable saving MC data through the chain])],
1430   [],[enable_mc_saving=no])
1431 if test "x$enable_mc_saving" = "xyes" ; then 
1432   AC_DEFINE(DOMC)
1433 fi
1434 AC_MSG_RESULT([$enable_mc_saving])
1435
1436 dnl ------------------------------------------------------------------
1437 dnl certainly something old, but we keep the define
1438 AC_MSG_CHECKING([whether to use ROWHOUGH])
1439 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
1440 AC_ARG_ENABLE(rowhough,
1441   [AC_HELP_STRING([--enable-rowhough],
1442       [use ROWHOUGH ])],
1443   [],[enable_rowhough=no])
1444 if test "x$enable_rowhough" = "xyes" ; then 
1445   AC_DEFINE(USEROWHOUGH)
1446 fi
1447 AC_MSG_RESULT([$enable_rowhough])
1448
1449 dnl ------------------------------------------------------------------
1450 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
1451 dnl stand-alone build system. This is most likely something old we can
1452 dnl get rid off later, or do something more reasonable. Since the define
1453 dnl needs the quotes they have to be  escaped. This works well for the
1454 dnl Makefile but not for the configure script. So we have to add the
1455 dnl defines after all the other checks.
1456 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
1457 if test ! "x$have_aliroot" = "xno" ; then
1458   CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
1459 fi
1460
1461 dnl ------------------------------------------------------------------
1462 dnl
1463 dnl Documentation
1464 dnl
1465 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
1466 AC_PATH_PROG(PERL, perl)
1467 AC_PATH_PROG(DOXYGEN, doxygen)
1468 AC_ARG_ENABLE(dot,
1469   [AC_HELP_STRING([--enable-dot],
1470       [enable dot documentation generator])],
1471   [],[enable_dot=no])
1472 HAVE_DOT=NO
1473 DOT_PATH=
1474 AC_PATH_PROG(DOT, dot)
1475 if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
1476    HAVE_DOT=YES
1477    DOT_PATH=`dirname $DOT`
1478 fi
1479
1480 AC_MSG_CHECKING([for documentation mode])
1481 AC_ARG_ENABLE(doc,
1482   [AC_HELP_STRING([--disable-doc],
1483       [disable documentation build; monolithic build --enable-doc=mono ])],
1484   [],[enable_doc=modules])
1485
1486 if test "x$DOXYGEN" = "x" ; then
1487    enable_doc=no.doxygen
1488 elif test "x$enable_doc" = "xyes" ; then
1489    enable_doc=yes
1490 elif test ! "x$enable_doc" = "xmono" && \
1491      test ! "x$enable_doc" = "xmodules"  && \
1492      test ! "x$enable_doc" = "xno"; then
1493    enable_doc=no
1494    AC_MSG_WARN([unknown option])
1495 fi
1496 if test "x$enable_doc" = "xno" ; then
1497    enable_doc=off
1498    DOXYGEN=
1499 fi
1500
1501 AC_MSG_RESULT([$enable_doc])
1502 AM_CONDITIONAL(MONOLITHIC_DOC, test "x$enable_doc" = "xmono")
1503 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
1504 AC_SUBST([HAVE_DOT])
1505 AC_SUBST([DOT_PATH])
1506
1507 dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
1508 dnl echo $HAVE_SRC_SUBDIR
1509 dnl if ! test -d $HAVE_SRC_SUBDIR; then
1510 dnl   HAVE_SRC_SUBDIR=
1511 dnl fi
1512 dnl AC_SUBST([HAVE_SRC_SUBDIR])
1513
1514 dnl ------------------------------------------------------------------
1515 AC_MSG_NOTICE([---------------------------------------------- ])
1516 AC_MSG_NOTICE([                build summary                  ])
1517 AC_MSG_NOTICE([---------------------------------------------- ])
1518
1519 AC_CONFIG_FILES([Makefile 
1520                  BASE/Makefile
1521                  BASE/setenv.sh
1522                  BASE/setenv.csh
1523                  BASE/HOMER/Makefile
1524                  BASE/util/Makefile
1525                  BASE/util/test/Makefile
1526                  BASE/interface/Makefile
1527                  BASE/test/Makefile
1528                  BASE/interface/test/Makefile
1529                  doc/Makefile
1530                  doc/doxygen.conf
1531                  doc/doxymodule.conf])
1532
1533 dnl AliRoot and installation directory for libraries
1534 dnl 
1535 AC_MSG_NOTICE([AliRoot: $have_aliroot])
1536 AM_CONDITIONAL(HAVE_ALIROOT, test "x$have_aliroot" != "xno" )
1537 if test "x$have_aliroot" != "xno"; then 
1538   AC_CONFIG_FILES([sim/Makefile  
1539                    rec/Makefile  
1540                    rec/test/Makefile     
1541                    rec/startAliEVE-barrel-tracks.sh
1542                    shuttle/Makefile
1543                    pendolino/Makefile
1544                    benchmark/Makefile
1545                    QA/Makefile
1546                    ])
1547 fi
1548 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
1549 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
1550 AC_MSG_NOTICE([libdir set to $libdir])
1551 fi
1552
1553 AC_MSG_NOTICE([compile sample library: $enable_sample])
1554 if test "x$enable_sample" = "xyes"; then 
1555   AC_CONFIG_FILES([SampleLib/Makefile])
1556 fi
1557
1558 AC_MSG_NOTICE([compile RCU library: $enable_rcu])
1559 if test "x$enable_rcu" = "xyes"; then 
1560   AC_CONFIG_FILES([RCU/Makefile
1561                    RCU/test/Makefile
1562                    ])
1563 fi
1564
1565 AC_MSG_NOTICE([compile TPC library: $enable_tpc])
1566 if test "x$enable_tpc" = "xyes"; then 
1567   AC_CONFIG_FILES([TPCLib/Makefile            
1568                    TPCLib/test/Makefile       
1569                    TPCLib/mapping2array.cxx     
1570                    TPCLib/EVE/Makefile
1571                    TPCLib/calibration/Makefile
1572                    ])
1573 fi
1574
1575 AC_MSG_NOTICE([compile CALO library: $enable_calo])
1576 if test "x$enable_calo" = "xyes"; then 
1577   AC_CONFIG_FILES([CALO/Makefile
1578                    CALO/test/Makefile])
1579 fi
1580
1581 AC_MSG_NOTICE([compile PHOS library: $enable_phos])
1582 if test "x$enable_phos" = "xyes"; then 
1583   AC_CONFIG_FILES([PHOS/Makefile])
1584 fi
1585
1586 AC_MSG_NOTICE([compile EMCAL library: $enable_emcal])
1587 if test "x$enable_emcal" = "xyes"; then 
1588   AC_CONFIG_FILES([EMCAL/Makefile])
1589 fi
1590
1591 AC_MSG_NOTICE([compile TRD library: $enable_trd])
1592 if test "x$enable_trd" = "xyes"; then 
1593   AC_CONFIG_FILES([TRD/Makefile])
1594 fi
1595
1596 AC_MSG_NOTICE([compile FMD library: $enable_fmd])
1597 if test "x$enable_fmd" = "xyes"; then 
1598   AC_CONFIG_FILES([FMD/Makefile])
1599 fi
1600
1601 AC_MSG_NOTICE([compile ZDC library: $enable_zdc])
1602 if test "x$enable_zdc" = "xyes"; then 
1603   AC_CONFIG_FILES([ZDC/Makefile])
1604 fi
1605
1606 AC_MSG_NOTICE([compile MUON library: $enable_muon])
1607 if test "x$enable_muon" = "xyes"; then 
1608   AC_CONFIG_FILES([MUON/Makefile])
1609 fi
1610
1611 AC_MSG_NOTICE([compile ITS library: $enable_its])
1612 if test "x$enable_its" = "xyes"; then 
1613   AC_CONFIG_FILES([ITS/Makefile])
1614 fi
1615
1616 AC_MSG_NOTICE([compile trigger library: $enable_trigger])
1617 if test "x$enable_trigger" = "xyes"; then 
1618   AC_CONFIG_FILES([trigger/Makefile
1619                    trigger/test/Makefile])
1620 fi
1621
1622 AC_MSG_NOTICE([compile global library: $enable_global])
1623 if test "x$enable_global" = "xyes"; then 
1624   AC_CONFIG_FILES([global/Makefile])
1625 fi
1626
1627 AC_MSG_NOTICE([compile jet library: $enable_jet])
1628 if test "x$enable_jet" = "xyes"; then 
1629   AC_CONFIG_FILES([JET/Makefile])
1630 fi
1631
1632 AC_MSG_NOTICE([compile vzero library: $enable_vzero])
1633 if test "x$enable_vzero" = "xyes"; then 
1634   AC_CONFIG_FILES([VZERO/Makefile])
1635 fi
1636
1637 AC_MSG_NOTICE([compile comp library: $enable_comp])
1638 if test "x$enable_comp" = "xyes"; then 
1639   AC_CONFIG_FILES([comp/Makefile])
1640 fi
1641
1642 AC_OUTPUT
1643 dnl
1644 dnl EOF
1645 dnl
1646