]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/configure.ac
removing temporary workaround for circular dependency libSTEERbase libRAWDatabase
[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_ITS],[hlt its library])
940
941 ALIITS_LIBS=
942 CHECK_HLTMODULE([its],
943                 [AliITSCompressRawDataSDD.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS],
944                 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
945                 [ITSbase ITSrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
946                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
947
948 if test "x$enable_module" = "xmissheader"; then
949   enable_module="no...header.missing"
950   enable_its=$enable_module
951 elif test "x$enable_module" = "xforce"; then
952   enable_its="yes"
953 else
954   enable_its=$enable_module
955   if test "x$enable_its" = "xyes" ; then
956     AC_LANG_PUSH(C++)
957     save_CPPFLAGS="$CPPFLAGS"
958     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS"
959     # changes in the AliVertexer base class revision 26414, Thu Jun 5 15:36:18 2008
960     # require AliVertexer::GetNominalPos()
961     AC_MSG_CHECKING([for required functions in AliITSVertexer])
962     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliITSVertexerZ.h>], 
963                                        [AliITSVertexerZ v;
964                                        v.GetNominalPos()])],
965                                        [], 
966                                        [enable_its="no...requires.AliRoot>v4-13-Release"])
967     AC_MSG_RESULT([$enable_its])       
968     AC_LANG_POP(C++)
969     CPPFLAGS="$save_CPPFLAGS"
970   fi
971 fi
972
973 if test "x$enable_its" = "xyes" ; then 
974   AC_DEFINE(HLT_ITS)
975   ALIITS_LIBS=$ALIHLTMODULE_LIBS
976 else
977   enable_module=$enable_its
978 fi
979 AM_CONDITIONAL(EN_HLT_ITS, test x$enable_its = xyes)
980 AC_MSG_CHECKING([whether to compile ITS library])
981 AC_MSG_RESULT([$enable_module])
982 AC_SUBST([ALIITS_LIBS])
983
984 dnl ------------------------------------------------------------------
985 AH_TEMPLATE([HLT_EMCAL],[hlt emcal library])
986
987 ALIEMCAL_LIBS=
988 CHECK_HLTMODULE([emcal],
989                 [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/EMCAL],
990                 [RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
991                 [EMCALrec EMCALsim EMCALbase], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
992                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
993
994 if test "x$enable_module" = "xmissheader"; then
995   enable_module="no...header.missing"
996   enable_emcal=$enable_module
997 elif test "x$enable_module" = "xforce"; then
998   enable_emcal="yes"
999 else
1000   enable_emcal=$enable_module
1001 fi
1002
1003 if test "x$enable_emcal" = "xyes" ; then 
1004   AC_DEFINE(HLT_EMCAL)
1005   ALIEMCAL_LIBS=$ALIHLTMODULE_LIBS
1006 else
1007   enable_module=$enable_emcal
1008 fi
1009 AM_CONDITIONAL(EN_HLT_EMCAL, test x$enable_emcal = xyes)
1010 AC_MSG_CHECKING([whether to compile EMCAL library])
1011 AC_MSG_RESULT([$enable_module])
1012 AC_SUBST([ALIEMCAL_LIBS])
1013
1014 dnl ------------------------------------------------------------------
1015 AH_TEMPLATE([HLT_COMP],[hlt comp library])
1016
1017 ALICOMP_LIBS=
1018 CHECK_HLTMODULE([comp],
1019                 [], [$ALIROOT_CPPFLAGS],
1020                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1021                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1022                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1023
1024 if test "x$enable_module" = "xmissheader"; then
1025   enable_module="no...header.missing"
1026   enable_comp=$enable_module
1027 elif test "x$enable_module" = "xforce"; then
1028   enable_comp="yes"
1029 else
1030   enable_comp=$enable_module
1031 fi
1032
1033 if test "x$enable_comp" = "xyes" ; then 
1034   AC_DEFINE(HLT_COMP)
1035   ALICOMP_LIBS=$ALIHLTMODULE_LIBS
1036 else
1037   enable_module=$enable_comp
1038 fi
1039 AM_CONDITIONAL(EN_HLT_COMP, test x$enable_comp = xyes)
1040 AC_MSG_CHECKING([whether to compile comp library])
1041 AC_MSG_RESULT([$enable_module])
1042 AC_SUBST([ALICOMP_LIBS])
1043
1044 dnl ------------------------------------------------------------------
1045 AC_MSG_CHECKING([whether to disable AliRoot logging])
1046 AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
1047 AC_ARG_ENABLE(aliroot-logging,
1048   [AC_HELP_STRING([--disable-aliroot-logging],
1049       [disable logging through AliRoot logging methods])],
1050   [],[enable_aliroot_logging=no])
1051 if test "x$have_aliroot" = "xno" ; then
1052   enable_aliroot_logging=yes # this means 'disable'
1053 fi
1054 if test "x$enable_aliroot_logging" != "xno" ; then 
1055   AC_DEFINE(NOALIROOT_LOGGING)
1056 fi
1057 AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
1058 AC_MSG_RESULT([$enable_aliroot_logging])
1059
1060 dnl ------------------------------------------------------------------
1061 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
1062 AH_TEMPLATE([DOMC],[MC saving])
1063 AC_ARG_ENABLE(mc-saving,
1064   [AC_HELP_STRING([--enable-mc-saving],
1065       [enable saving MC data through the chain])],
1066   [],[enable_mc_saving=no])
1067 if test "x$enable_mc_saving" = "xyes" ; then 
1068   AC_DEFINE(DOMC)
1069 fi
1070 AC_MSG_RESULT([$enable_mc_saving])
1071
1072 dnl ------------------------------------------------------------------
1073 dnl certainly something old, but we keep the define
1074 AC_MSG_CHECKING([whether to use ROWHOUGH])
1075 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
1076 AC_ARG_ENABLE(rowhough,
1077   [AC_HELP_STRING([--enable-rowhough],
1078       [use ROWHOUGH ])],
1079   [],[enable_rowhough=no])
1080 if test "x$enable_rowhough" = "xyes" ; then 
1081   AC_DEFINE(USEROWHOUGH)
1082 fi
1083 AC_MSG_RESULT([$enable_rowhough])
1084
1085 dnl ------------------------------------------------------------------
1086 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
1087 dnl stand-alone build system. This is most likely something old we can
1088 dnl get rid off later, or do something more reasonable. Since the define
1089 dnl needs the quotes they have to be  escaped. This works well for the
1090 dnl Makefile but not for the configure script. So we have to add the
1091 dnl defines after all the other checks.
1092 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
1093 if test ! "x$have_aliroot" = "xno" ; then
1094   CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
1095 fi
1096
1097 dnl ------------------------------------------------------------------
1098 dnl
1099 dnl Documentation
1100 dnl
1101 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
1102 AC_PATH_PROG(PERL, perl)
1103 AC_PATH_PROG(DOXYGEN, doxygen)
1104 AC_ARG_ENABLE(dot,
1105   [AC_HELP_STRING([--enable-dot],
1106       [enable dot documentation generator])],
1107   [],[enable_dot=no])
1108 HAVE_DOT=NO
1109 DOT_PATH=
1110 AC_PATH_PROG(DOT, dot)
1111 if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
1112    HAVE_DOT=YES
1113    DOT_PATH=`dirname $DOT`
1114 fi
1115
1116 AC_MSG_CHECKING([for documentation mode])
1117 AC_ARG_ENABLE(doc,
1118   [AC_HELP_STRING([--disable-doc],
1119       [disable documentation build; monolithic build --enable-doc=mono ])],
1120   [],[enable_doc=modules])
1121
1122 if test "x$DOXYGEN" = "x" ; then
1123    enable_doc=no.doxygen
1124 elif test "x$enable_doc" = "xyes" ; then
1125    enable_doc=yes
1126 elif test ! "x$enable_doc" = "xmono" && \
1127      test ! "x$enable_doc" = "xmodules"  && \
1128      test ! "x$enable_doc" = "xno"; then
1129    enable_doc=no
1130    AC_MSG_WARN([unknown option])
1131 fi
1132 if test "x$enable_doc" = "xno" ; then
1133    enable_doc=off
1134    DOXYGEN=
1135 fi
1136
1137 AC_MSG_RESULT([$enable_doc])
1138 AM_CONDITIONAL(MONOLITHIC_DOC, test "x$enable_doc" = "xmono")
1139 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
1140 AC_SUBST([HAVE_DOT])
1141 AC_SUBST([DOT_PATH])
1142
1143 dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
1144 dnl echo $HAVE_SRC_SUBDIR
1145 dnl if ! test -d $HAVE_SRC_SUBDIR; then
1146 dnl   HAVE_SRC_SUBDIR=
1147 dnl fi
1148 dnl AC_SUBST([HAVE_SRC_SUBDIR])
1149
1150 dnl ------------------------------------------------------------------
1151 AC_MSG_NOTICE([---------------------------------------------- ])
1152 AC_MSG_NOTICE([                build summary                  ])
1153 AC_MSG_NOTICE([---------------------------------------------- ])
1154
1155 AC_CONFIG_FILES([Makefile 
1156                  BASE/Makefile
1157                  BASE/setenv.sh
1158                  BASE/setenv.csh
1159                  BASE/HOMER/Makefile
1160                  BASE/util/Makefile
1161                  BASE/util/test/Makefile
1162                  BASE/interface/Makefile
1163                  BASE/test/Makefile
1164                  BASE/interface/test/Makefile
1165                  doc/Makefile
1166                  doc/doxygen.conf
1167                  doc/doxymodule.conf])
1168
1169 dnl AliRoot and installation directory for libraries
1170 dnl 
1171 AC_MSG_NOTICE([AliRoot: $have_aliroot])
1172 AM_CONDITIONAL(HAVE_ALIROOT, test "x$have_aliroot" != "xno" )
1173 if test "x$have_aliroot" != "xno"; then 
1174   AC_CONFIG_FILES([sim/Makefile  
1175                    rec/Makefile  
1176                    rec/test/Makefile     
1177                    rec/startAliEVE-barrel-tracks.sh
1178                    shuttle/Makefile
1179                    pendolino/Makefile
1180                    benchmark/Makefile
1181                    ])
1182 fi
1183 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
1184 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
1185 AC_MSG_NOTICE([libdir set to $libdir])
1186 fi
1187
1188 AC_MSG_NOTICE([compile sample library: $enable_sample])
1189 if test "x$enable_sample" = "xyes"; then 
1190   AC_CONFIG_FILES([SampleLib/Makefile])
1191 fi
1192
1193 AC_MSG_NOTICE([compile RCU library: $enable_rcu])
1194 if test "x$enable_rcu" = "xyes"; then 
1195   AC_CONFIG_FILES([RCU/Makefile
1196                    RCU/test/Makefile
1197                    ])
1198 fi
1199
1200 AC_MSG_NOTICE([compile TPC library: $enable_tpc])
1201 if test "x$enable_tpc" = "xyes"; then 
1202   AC_CONFIG_FILES([TPCLib/Makefile            
1203                    TPCLib/test/Makefile       
1204                    TPCLib/mapping2array.cxx     
1205                    TPCLib/EVE/Makefile
1206                    ])
1207 fi
1208
1209 AC_MSG_NOTICE([compile PHOS library: $enable_phos])
1210 if test "x$enable_phos" = "xyes"; then 
1211   AC_CONFIG_FILES([PHOS/Makefile])
1212 fi
1213
1214 AC_MSG_NOTICE([compile TRD library: $enable_trd])
1215 if test "x$enable_trd" = "xyes"; then 
1216   AC_CONFIG_FILES([TRD/Makefile])
1217 fi
1218
1219 AC_MSG_NOTICE([compile FMD library: $enable_fmd])
1220 if test "x$enable_fmd" = "xyes"; then 
1221   AC_CONFIG_FILES([FMD/Makefile])
1222 fi
1223
1224 AC_MSG_NOTICE([compile MUON library: $enable_muon])
1225 if test "x$enable_muon" = "xyes"; then 
1226   AC_CONFIG_FILES([MUON/Makefile])
1227 fi
1228
1229 AC_MSG_NOTICE([compile ITS library: $enable_its])
1230 if test "x$enable_its" = "xyes"; then 
1231   AC_CONFIG_FILES([ITS/Makefile])
1232 fi
1233
1234 AC_MSG_NOTICE([compile EMCAL library: $enable_emcal])
1235 if test "x$enable_emcal" = "xyes"; then 
1236   AC_CONFIG_FILES([EMCAL/Makefile])
1237 fi
1238
1239 AC_MSG_NOTICE([compile trigger library: $enable_trigger])
1240 if test "x$enable_trigger" = "xyes"; then 
1241   AC_CONFIG_FILES([trigger/Makefile
1242                    trigger/test/Makefile])
1243 fi
1244
1245 AC_MSG_NOTICE([compile global library: $enable_global])
1246 if test "x$enable_global" = "xyes"; then 
1247   AC_CONFIG_FILES([global/Makefile])
1248 fi
1249
1250 AC_MSG_NOTICE([compile comp library: $enable_comp])
1251 if test "x$enable_comp" = "xyes"; then 
1252   AC_CONFIG_FILES([comp/Makefile])
1253 fi
1254
1255 AC_OUTPUT
1256 dnl
1257 dnl EOF
1258 dnl
1259