adding Root libGui as dependency for libCDB after changes in r 41238
[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
356   dnl
357   dnl required header files and libraries for modules
358   dnl
359
360   dnl
361   dnl Check for the interface of AliExternalTrackParam which has been changed
362   dnl in revision 1.17 of AliExternalTrackParam.h (AliRoot version v4-05-04
363   dnl or higher)
364   externaltrackparam_version=1
365   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliExternalTrackParam.h>], 
366                                   [AliExternalTrackParam trackparam;
367                                    Double_t param[[5]]; Double_t covar[[15]];
368                                    trackparam.Set(0., 0., param, covar);])],
369                                   [externaltrackparam_version=2],
370                                   [AC_DEFINE(EXTERNALTRACKPARAM_V1)])
371   AC_MSG_CHECKING(for version of AliExternalTrackParam)
372   AC_MSG_RESULT($externaltrackparam_version)
373
374   dnl The AliShuttleInterface was changed in rev 29388. Some return types
375   dnl had been const, now changed according to gcc 4.3 warnings 
376   AC_MSG_CHECKING(for version of AliShuttleInterface.h)
377     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/"
378     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
379     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
380     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliShuttleInterface.h>],
381                                     [class dummy : public AliShuttleInterface {
382                                      public:
383                                        const UInt_t GetStartTimeDCSQuery() {;}
384                                      };])],
385                                     [AC_DEFINE(SHUTTLE_PRE_REV29388_INTERFACE)
386                                      alishuttleinterface_version=pre.rev.29388],
387                                     [alishuttleinterface_version=up.to.date])
388   AC_MSG_RESULT([$alishuttleinterface_version])
389
390   CPPFLAGS=$save_CPPFLAGS
391   LDFLAGS=$save_LDFLAGS
392   LIBS=$save_LIBS
393 fi # if test ! "x$have_aliroot" = "xno"
394
395 AC_LANG_POP(C++)
396 AC_SUBST([ALICE_ROOT])
397 AC_SUBST([ALIROOT_CPPFLAGS])
398 AC_SUBST([ALIROOT_LDFLAGS])
399 AC_SUBST([ALIROOTBINDIR])
400 AC_SUBST([ALIROOTLIBDIR])
401
402 ALIROOT_LIBS="$ALIROOT_LIBS $ADD_ROOTLIBS"
403 AC_SUBST([ALIROOT_LIBS])
404 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
405
406 HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
407 HLTBASE_LDFLAGS=
408 AC_SUBST([HLTBASE_CPPFLAGS])
409 AC_SUBST([HLTBASE_LDFLAGS])
410
411 dnl ------------------------------------------------------------------
412 dnl check for the HLT PubSub Framework
413 dnl namely for the existence of the HOMER library
414 dnl from Sep 2007, the HOMER lib has been incorporated into the alice-hlt
415 dnl package. It os though possible to choose an external. library
416 dnl In order to make the origni of the HOMER lib clear, the one in AliRoot
417 dnl got the name libAliHLTHOMER
418 AC_MSG_CHECKING([for HLT PubSub Framework])
419 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
420                     [],
421                     [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
422 if test -z $with_pubsub || ! test -d $with_pubsub ; then
423   with_pubsub=no
424 fi
425 AC_MSG_RESULT([$with_pubsub])
426 HOMER_VERSION=2
427 HOMER_LIBS=
428
429 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
430 if test "x$with_pubsub" != "xno" ; then
431   save_CPPFLAGS=$CPPFLAGS
432   save_LDFLAGS=$LDFLAGS
433   save_LIBS=$LIBS
434   # currently the different versions of the HLT PubSub framework have a different
435   # directory layout
436   if test -d ${with_pubsub}/include/HOMER ; then
437     # the 'early' location of the include files with separated HOMER sub dirs
438     HOMER_INCDIRS="${with_pubsub}/include/HOMER ${with_pubsub}/include/HOMER/reader"
439   elif test -d ${with_pubsub}/include/Util/HOMER ; then
440     # location for HLT Framework versions after Sep 2006
441     HOMER_INCDIRS="${with_pubsub}/include/Util/HOMER"
442   elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
443     # fall back if include files were not installed (versions after Sep 06)
444     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/include"
445   else
446     # fall back if include files were not installed (versions before Sep 06)
447     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/reader/include ${with_pubsub}/src/Util/HOMER/data/include"
448   fi
449   HOMER_CPPFLAGS=`for i in ${HOMER_INCDIRS}; do echo -n "-I$i " ; done`
450
451   AC_ARG_ENABLE(pubsub-debug,
452     [AC_HELP_STRING([--disable-pubsub-debug],
453         [force the production version of the PubSub framework])],
454     [],[enable_pubsub_debug=yes])
455   homer_type="none"
456   HOMER_TARGET="`uname -s`-`uname -m`"
457   AC_MSG_CHECKING([for HLT PubSub Framework release type])
458   if test -d "${with_pubsub}/lib/${HOMER_TARGET}-release" ; then
459     homer_type="production"
460     HOMER_TARGET="${HOMER_TARGET}-release"
461   elif test "x$enable_pubsub_debug" = "xyes" && test -d "${with_pubsub}/lib/${HOMER_TARGET}-debug" ; then
462     homer_type="debug"
463     HOMER_TARGET="${HOMER_TARGET}-debug"
464   fi
465   AC_MSG_RESULT([${homer_type}])
466   HOMERREADER_HEADER=HOMERReader.h
467   HOMER_BINDIR="${with_pubsub}/bin/${HOMER_TARGET}"
468   HOMER_LIBDIR="${with_pubsub}/lib/${HOMER_TARGET}"
469   HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
470   CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
471   LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
472   LIBS="$save_LIBS "
473   with_homer=no
474   AC_LANG_PUSH(C++)
475   AC_CHECK_HEADER([$HOMERREADER_HEADER],
476     [ AC_CHECK_LIB([HOMER],[_init],
477       [with_homer=yes
478        HOMER_LIBS="-lHOMER"],
479       [ AC_CHECK_LIB([HOMERReader],[_init],
480                      [with_homer=yes
481                       HOMER_LIBS="-lHOMERReader"])])
482       LIBS="$LIBS $HOMER_LIBS"
483       AC_MSG_CHECKING([version of HOMER library])
484       dnl The Homer library has no versioning, so we do our own
485       dnl version           description
486       dnl ----------------------------------------------------------------------
487       dnl   1          inintial version
488       dnl   2          GetBlockStatusFlags added to the interface
489       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
490                                       [HOMERReader reader("dummy", 0);
491                                        reader.GetBlockStatusFlags(0);])],
492                                       [],
493                                       [HOMER_VERSION=1])
494       AC_MSG_RESULT([$HOMER_VERSION])
495   ],
496   [HOMERREADER_HEADER=]) #AC_CHECK_HEADER([$HOMERREADER_HEADER])
497   AC_LANG_POP(C++)
498   HOMER_INBUILT_LIB=
499 else
500 dnl no pubsub version defined, check if the HOMER lib is available in AliRoot
501   topdir=`dirname $0`
502   HOMER_CPPFLAGS="-I`(cd $topdir; pwd)`/BASE/HOMER"
503   HOMERREADER_HEADER=AliHLTHOMERReader.h
504   HOMER_INBUILT_LIB=`pwd`/BASE/HOMER/libAliHLTHOMER.la
505   HOMER_BINDIR=
506   HOMER_LIBDIR=
507   HOMER_LDFLAGS=
508 fi
509
510   if test "x$with_homer" = "xno" ; then
511     HOMER_CPPFLAGS=
512     HOMER_LDFLAGS=
513     HOMER_LIBS=
514   else
515     HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
516     AC_DEFINE(HAVE_HOMERREADER)
517   fi
518   CPPFLAGS="$save_CPPFLAGS"
519   LDFLAGS="$save_LDFLAGS"
520   LIBS="$save_LIBS"  
521
522 AC_SUBST([HOMERREADER_HEADER])
523 AC_SUBST([HOMER_INBUILT_LIB])
524 AC_SUBST([HOMER_CPPFLAGS])
525 AC_SUBST([HOMER_LDFLAGS])
526 AC_SUBST([HOMER_LIBDIR])
527 AC_SUBST([HOMER_BINDIR])
528 AC_SUBST([HOMER_LIBS])
529
530 dnl ------------------------------------------------------------------
531 AC_ARG_ENABLE(all,
532   [AC_HELP_STRING([--disable-all],
533       [disable all detector modules, individual modules can be switched on by --enable-det])],
534   [disable_all=yes],[])
535
536 dnl ------------------------------------------------------------------
537 AC_MSG_CHECKING([whether to impose strict coding conventions])
538 AC_ARG_ENABLE(strict,
539   [AC_HELP_STRING([--disable-strict],
540       [disable coding convention checks ])],
541   [],[enable_strict=yes])
542 if test "x$enable_strict" = "xyes" ; then
543    CPPFLAGS="$CPPFLAGS -W -Weffc++ -Wall -Wshadow"
544 fi
545 AC_MSG_RESULT([$enable_strict])
546
547 dnl ------------------------------------------------------------------
548 AC_MSG_CHECKING([whether to enable component statistics])
549 AC_ARG_ENABLE(component-stat,
550   [AC_HELP_STRING([--enable-component-stat],
551       [enable component statistics ])],
552   [],[])
553
554 dnl enable component statistics if not explicitely disabled
555 if test "x$enable_component_stat" != "xno" &&
556    test "x$enable_debug" = "xyes" ; then
557    enable_component_stat=yes.debug
558 fi
559
560 if test "x$enable_component_stat" = "x" ; then
561    enable_component_stat=no
562 fi
563
564 if test "x$enable_component_stat" != "xno" ; then
565    AC_DEFINE(HLT_COMPONENT_STATISTICS)
566 fi
567 AC_MSG_RESULT([$enable_component_stat])
568
569 dnl ------------------------------------------------------------------
570 dnl ----  module checks
571 dnl ------------------------------------------------------------------
572 save_CPPFLAGS=$CPPFLAGS
573 save_LDFLAGS=$LDFLAGS
574 save_LIBS=$LIBS
575
576 dnl ------------------------------------------------------------------
577 AC_MSG_NOTICE([-------------------------------------------------])
578 AC_MSG_NOTICE([checking dependencies for HLTbase library])
579 HLTBASE_CHECKLIBS='XMLParser'
580 for CHECKLIB in $HLTBASE_CHECKLIBS ; do
581   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
582   LIBS="$save_LIBS $ROOTLIBS $ALIHLTBASE_LIBS"
583   AC_CHECK_LIB([$CHECKLIB],[_init], [ALIHLTBASE_LIBS="$ALIHLTBASE_LIBS -l$CHECKLIB"])
584 done
585 AC_SUBST([ALIHLTBASE_LIBS])
586
587 dnl ------------------------------------------------------------------
588 AC_MSG_CHECKING([whether to compile sample library])
589 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
590 AC_ARG_ENABLE(sample,
591   [AC_HELP_STRING([--disable-sample],
592       [compile the sample library ])],
593   [],
594   [if test "x$have_aliroot" = "xno" ; then
595      enable_sample="no...requires.AliRoot"
596    else
597      enable_sample=yes
598    fi
599   ])
600
601 if test "x$enable_sample" = "xyes" ; then 
602   AC_DEFINE(HLT_SAMPLE)
603 fi
604 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
605 AC_MSG_RESULT([$enable_sample])
606
607 dnl ------------------------------------------------------------------
608 AH_TEMPLATE([HLT_UTIL],[HLT utility library])
609 ALIUTIL_LIBS=
610 CHECK_HLTMODULE([util],
611                 [], 
612                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/STEER -I$ALICE_ROOT/RAW -I$ALICE_ROOT/PYTHIA6],
613                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
614                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
615                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
616
617 if test "x$enable_module" = "xmissheader"; then
618   enable_module="no...missing.headers"
619   enable_util=$enable_module
620 elif test "x$enable_module" = "xforce"; then
621   enable_util="yes"
622 else
623   enable_util=$enable_module
624 fi
625 if test "x$enable_util" = "xyes" ; then 
626   AC_DEFINE(HLT_UTIL)
627   ALIUTIL_LIBS=$ALIHLTMODULE_LIBS
628 fi
629 AM_CONDITIONAL(EN_HLT_UTIL, test x$enable_util = xyes)
630 AC_MSG_CHECKING([whether to compile Util library])
631 AC_MSG_RESULT([$enable_module])
632 AC_SUBST([ALIUTIL_LIBS])
633
634 dnl ------------------------------------------------------------------
635 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
636
637 ALITPC_LIBS=
638 CHECK_HLTMODULE([tpc],
639                 [AliTPCRawStream.h], 
640                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/TPC],
641                 [Gui ANALYSIS STAT], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
642                 [TPCbase TPCrec TPCcalib], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
643                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
644
645 if test "x$enable_module" = "xmissheader"; then
646   enable_module="no...missing.headers"
647   enable_tpc=$enable_module
648 elif test "x$enable_module" = "xforce"; then
649   enable_tpc="yes"
650 else
651   enable_tpc=$enable_module
652 fi
653
654 if test "x$enable_tpc" = "xyes" ; then 
655   AC_LANG_PUSH(C++)
656   AC_DEFINE(HLT_TPC)
657   ALITPC_LIBS=$ALIHLTMODULE_LIBS
658   dnl
659   dnl Check for functionality in the TPC reconstruction required for online
660   dnl processing
661   dnl 
662   have_tpc_hltoffline_rec=no
663   AC_MSG_CHECKING(for on-line features of TPC offline reconstruction)
664     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
665     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
666     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
667     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliTPCtrackerMI.h>
668                                        #include <AliTPCclustererMI.h>   
669                                        #include <TObjArray.h>], 
670                                     [AliTPCtrackerMI tracker;
671                                        TObjArray* array=NULL;
672                                        tracker.LoadClusters(array);
673                                        AliTPCclustererMI cl(NULL, NULL);
674                                        cl.GetOutputClonesArray();])],
675                                     [have_tpc_hltoffline_rec=yes], 
676                                       [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)])
677   AC_MSG_RESULT([$have_tpc_hltoffline_rec])
678
679     have_alitpcclusterparam_r40128=no
680     AC_MSG_CHECKING([checking for AliTPCClusterParam r40128])
681     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTPCClusterParam.h>], 
682                                        [AliTPCClusterParam param;
683                                           float test=param.ParamS0Par(0,0,0)]);],
684                                        [have_alitpcclusterparam_r40128=yes],
685                                          [AC_DEFINE(HAVE_NOT_ALITPCCLUSTERPARAM_r40128)])
686     AC_MSG_RESULT([$have_alitpcclusterparam_r40128])
687
688     LIBS=$save_LIBS
689
690
691   AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])
692   AC_CHECK_HEADER([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)])
693   AC_CHECK_HEADER([AliAltroRawStreamV3.h], [], [AC_DEFINE(HAVE_NOT_ALTRORAWSTREAMV3)])
694
695   have_tpc_mapping=no
696   if test ! "x$have_aliroot" = "xno" ; then
697     # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC 
698     # which is stored in the TPC/mapping/Patchx.data files from
699     # AliRoot version v4-04-Release (May 2006)
700     AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
701     TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
702     AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], 
703                    [have_tpc_mapping=yes
704                     AC_SUBST(TPC_PAD_MAPPING_PATH)
705                     AC_DEFINE(HAVE_TPC_MAPPING)],
706                    [])
707     
708   fi
709   AC_MSG_CHECKING([for TPC mapping layout])
710   AC_MSG_RESULT([$have_tpc_mapping])
711   AC_LANG_POP(C++)
712
713 else
714   enable_module=$enable_tpc
715 fi
716 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
717 AC_MSG_CHECKING([whether to compile TPC library])
718 AC_MSG_RESULT([$enable_module])
719 AC_SUBST([ALITPC_LIBS])
720
721 dnl ------------------------------------------------------------------
722 AH_TEMPLATE([HLT_RCU],[hlt rcu library])
723
724 CHECK_HLTMODULE([rcu],
725                 [AliAltroDecoder.h], 
726                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/RAW],
727                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
728                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
729                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
730
731 if test "x$enable_module" = "xmissheader"; then
732   enable_module="no...missing.headers"
733   enable_rcu=$enable_module
734 elif test "x$enable_module" = "xforce"; then
735   enable_rcu="yes"
736 else
737   AC_LANG_PUSH(C++)
738   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
739   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
740   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
741   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliAltroDecoder.h>], 
742                                   [AliAltroDecoder decoder;
743                                   decoder.CopyBackward(NULL, 0);])],
744                                   [enable_rcu=$enable_module], 
745                                   [enable_module="no...requires.AliRoot>v4-10-Release"
746                                    enable_rcu="no...requires.AliRoot>v4-10-Release"])
747   CPPFLAGS=$save_CPPFLAGS
748   LDFLAGS=$save_LDFLAGS
749   LIBS=$save_LIBS
750   AC_LANG_POP(C++)
751 fi
752
753 if test "x$enable_rcu" = "xyes" ; then 
754   AC_DEFINE(HLT_RCU)
755 else
756   enable_module=$enable_rcu
757 fi
758 AM_CONDITIONAL(EN_HLT_RCU, test x$enable_rcu = xyes)
759 AC_MSG_CHECKING([whether to compile RCU library])
760 AC_MSG_RESULT([$enable_module])
761 AC_SUBST([ALIRCU_LIBS])
762
763 dnl ------------------------------------------------------------------
764 AH_TEMPLATE([HLT_CALO],[hlt calo(rimeter) library])
765   
766 ALICALO_LIBS=
767 CHECK_HLTMODULE([calo],
768                 [], [$ALIROOT_CPPFLAGS],
769                 [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
770                 [EMCALUtils PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
771                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
772
773 if test "x$enable_module" = "xmissheader"; then
774   enable_module="no...missing.headers"
775   enable_calo=$enable_module
776 elif test "x$enable_module" = "xforce"; then
777   enable_calo="yes"
778 else
779   have_alicalorawstream=no
780   if test ! "x$have_aliroot" = "xno" ; then
781     AC_LANG_PUSH(C++)
782     save_CPPFLAGS="$CPPFLAGS"
783     # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
784     #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
785     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
786     AC_MSG_CHECKING([for AliCaloRawStream.h usability])
787     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
788                                         #include <AliCaloRawStream.h>], 
789                                        [int i])],
790                                        [AC_DEFINE(HAVE_ALICALORAWSTREAM)
791                                         have_alicalorawstream=yes], 
792                                        [])
793     AC_MSG_RESULT([$have_alicalorawstream])
794
795     have_aliesdcalocluster_r38477=no
796     AC_MSG_CHECKING([for AliESDCaloCluster r38477])
797     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliESDCaloCluster.h>], 
798                                        [AliESDCaloCluster cluster;
799                                         cluster.SetTrackDistance(0.0, 0.0)]);],
800                                        [have_aliesdcalocluster_r38477=yes],
801                                          [AC_DEFINE(HAVE_NOT_ALIESDCALOCLUSTER_r38477)])
802     AC_MSG_RESULT([$have_aliesdcalocluster_r38477])
803
804     AC_LANG_POP(C++)
805     CPPFLAGS="$save_CPPFLAGS"
806   fi
807   if test "x$have_alicalorawstream" != "xyes"; then
808     enable_calo="no...requires.AliRoot>v4-05-07"
809   else
810     enable_calo=$enable_module
811   fi
812 fi
813
814 if test "x$enable_calo" = "xyes" ; then 
815   AC_DEFINE(HLT_CALO)
816   ALICALO_LIBS=$ALIHLTMODULE_LIBS
817 else
818   enable_module=$enable_calo
819 fi
820 AM_CONDITIONAL(EN_HLT_CALO, test x$enable_calo = xyes)
821 AC_MSG_CHECKING([whether to compile CALO library])
822 AC_MSG_RESULT([$enable_module])
823 AC_SUBST([ALICALO_LIBS])
824
825 dnl ------------------------------------------------------------------
826 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
827   
828 ALIPHOS_LIBS=
829 CHECK_HLTMODULE([phos],
830                 [], [$ALIROOT_CPPFLAGS],
831                 [RAWDatasim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS],
832                 [PHOSUtils PHOSbase PHOSrec PHOSsim PHOSshuttle], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
833                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
834
835 if test "x$enable_module" = "xmissheader"; then
836   enable_module="no...requires.AliRoot>v4-05-07"
837   enable_phos=$enable_module
838 elif test "x$enable_module" = "xforce"; then
839   enable_phos="yes"
840 else
841   have_alicalorawstream=no
842   if test ! "x$have_aliroot" = "xno" ; then
843     AC_LANG_PUSH(C++)
844     save_CPPFLAGS="$CPPFLAGS"
845     # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
846     #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
847     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/PHOS"
848     AC_MSG_CHECKING([for AliCaloRawStream.h usability])
849     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
850                                         #include <AliCaloRawStream.h>], 
851                                        [int i])],
852                                        [AC_DEFINE(HAVE_ALICALORAWSTREAM)
853                                         have_alicalorawstream=yes], 
854                                        [])
855     AC_MSG_RESULT([$have_alicalorawstream])
856     AC_MSG_CHECKING([for required EMC functionality in AliPHOSRecoParam.h ])
857     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliPHOSRecoParam.h>], 
858                                        [AliPHOSRecoParam param;
859                                         param.GetEMCClusteringThreshold()])],
860                                        [have_aliphosrecoparam=yes], 
861                                        [AC_DEFINE(HAVE_NOT_PHOSRECOPARAMEMC)])
862     AC_MSG_RESULT([$have_aliphosrecoparam])
863     AC_LANG_POP(C++)
864     CPPFLAGS="$save_CPPFLAGS"
865   fi
866   if test "x$have_alicalorawstream" != "xyes"; then
867     enable_phos="no...requires.AliRoot>v4-05-07"
868   else
869     enable_phos=$enable_module
870   fi
871 fi
872
873 if test "x$enable_phos" = "xyes" ; then 
874   AC_DEFINE(HLT_PHOS)
875   ALIPHOS_LIBS=$ALIHLTMODULE_LIBS
876 else
877   enable_module=$enable_phos
878 fi
879 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
880 AC_MSG_CHECKING([whether to compile PHOS library])
881 AC_MSG_RESULT([$enable_module])
882 AC_SUBST([ALIPHOS_LIBS])
883
884 dnl ------------------------------------------------------------------
885 AH_TEMPLATE([HLT_EMCAL],[hlt emcal library])
886
887 ALIEMCAL_LIBS=
888 CHECK_HLTMODULE([emcal],
889                 [], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/VZERO],
890                 [RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
891                 [EMCALrec EMCALsim EMCALbase EMCALUtils VZERObase], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
892                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
893
894 if test "x$enable_module" = "xmissheader"; then
895   enable_module="no...header.missing"
896   enable_emcal=$enable_module
897 elif test "x$enable_module" = "xforce"; then
898   enable_emcal="yes"
899 else
900   enable_emcal=$enable_module
901 fi
902
903 if test "x$enable_emcal" = "xyes" ; then 
904   AC_DEFINE(HLT_EMCAL)
905   ALIEMCAL_LIBS=$ALIHLTMODULE_LIBS
906 else
907   enable_module=$enable_emcal
908 fi
909 AM_CONDITIONAL(EN_HLT_EMCAL, test x$enable_emcal = xyes)
910 AC_MSG_CHECKING([whether to compile EMCAL library])
911 AC_MSG_RESULT([$enable_module])
912 AC_SUBST([ALIEMCAL_LIBS])
913
914 dnl ------------------------------------------------------------------
915 AH_TEMPLATE([HLT_TRD],[hlt trd library])
916   
917 ALITRD_LIBS=
918 CHECK_HLTMODULE([trd],
919                 [], [],
920                 [MLP XMLParser], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
921                 [STAT TRDbase TRDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
922                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
923
924 if test "x$enable_module" = "xmissheader"; then
925   enable_module="no...requires.AliRoot>v4-07-Release"
926   enable_trd=$enable_module
927 elif test "x$enable_module" = "xforce"; then
928   enable_trd="yes"
929 else
930   enable_trd=$enable_module
931   if test "x$enable_trd" = "xyes" ; then
932     AC_LANG_PUSH(C++)
933     save_CPPFLAGS="$CPPFLAGS"
934     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/TRD"
935     # AliTRDclusterizer::SetRawVersion() requires >v4-07-Release
936     # changed to AliTRDrecoParam::SetSeedingOn() due to revision 26327, Mon Jun 2 2008
937     # changed to AliTRDReconstructor::SetStreamLevel() due to revision 27797, Tue Aug 5 2008
938     # changed to AliTRDReconstructor::SetClusters() according to revision 28069, Mon Aug 18 2008
939     # changed to AliTRDCluster according to revision 30461, Thu Dec 18 2008
940     # changed to AliTRDclusterizer::GetAddedClusters according to revision 31299, Wed Mar 4 2009
941     # changed to AliTRDclusterizer::GetNTimeBins according to revision 37102 Sun Nov 22 2009
942     AC_MSG_CHECKING([for required functions in AliTRDclusterizer])
943     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDclusterizer.h>], 
944                                        [AliTRDclusterizer c;
945                                        c.GetNTimeBins()])],
946                                        [], 
947                                        [enable_trd="no...requires.AliRoot>v4-18-Release"])
948     AC_MSG_RESULT([$enable_trd])       
949
950     if test "x$enable_trd" = "xyes" ; then
951       have_alitrdseedv1_r39693=no
952       AC_MSG_CHECKING([checking for AliTRDseedV1 r39693])
953       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDseedV1.h>], 
954                                          [AliTRDseedV1 seed;
955                                           seed.SetC(0.0, 1)]);],
956                                          [have_alitrdseedv1_r39693=yes],
957                                          [AC_DEFINE(HAVE_NOT_ALITRD_SEEDV1_r39693)])
958       AC_MSG_RESULT([$have_alitrdseedv1_r39693])
959
960       have_alitrdrawstream_r39608=no
961       AC_MSG_CHECKING([checking for AliTRDrawStream r39608])
962       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTRDrawStreamBase.h>], 
963                                          [AliTRDrawStreamBase::SetRawStreamVersion(AliTRDrawStreamBase::kTRDdefaultStream)]);],
964                                          [have_alitrdrawstream_r39608=yes],
965                                          [AC_DEFINE(HAVE_NOT_ALITRD_RAWSTREAM_r39608)])
966       AC_MSG_RESULT([$have_alitrdrawstream_r39608])
967     fi
968
969     AC_LANG_POP(C++)
970     CPPFLAGS="$save_CPPFLAGS"
971   fi
972 fi
973
974 if test "x$enable_trd" = "xyes" ; then 
975   AC_DEFINE(HLT_TRD)
976   ALITRD_LIBS=$ALIHLTMODULE_LIBS
977 else
978   enable_module=$enable_trd
979 fi
980 AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
981 AC_MSG_CHECKING([whether to compile TRD library])
982 AC_MSG_RESULT([$enable_module])
983 AC_SUBST([ALITRD_LIBS])
984
985 dnl ------------------------------------------------------------------
986 AH_TEMPLATE([HLT_FMD],[hlt fmd library])
987
988 ALIFMD_LIBS=$ALIHLTMODULE_LIBS
989 CHECK_HLTMODULE([fmd],
990                 [], [],
991                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
992                 [FMDbase FMDrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS],
993                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
994
995 if test "x$enable_module" = "xmissheader"; then
996   enable_module="no...missing.headers"
997   enable_fmd=$enable_module
998 elif test "x$enable_module" = "xforce"; then
999   enable_fmd="yes"
1000 else
1001   enable_fmd=$enable_module
1002 fi
1003
1004 if test "x$enable_fmd" = "xyes" ; then
1005   AC_DEFINE(HLT_FMD)
1006   ALIFMD_LIBS=$ALIHLTMODULE_LIBS
1007 else
1008   enable_module=$enable_fmd
1009 fi
1010 AM_CONDITIONAL(EN_HLT_FMD, test x$enable_fmd = xyes)
1011 AC_MSG_CHECKING([whether to compile FMD library])
1012 AC_MSG_RESULT([$enable_module])
1013 AC_SUBST([ALIFMD_LIBS])
1014
1015 dnl ------------------------------------------------------------------
1016 AH_TEMPLATE([HLT_MUON],[hlt dimuon library])
1017
1018 ALIMUON_LIBS=
1019 CHECK_HLTMODULE([dimuon],
1020                 [AliMpExMap.h AliMUONTriggerIO.h], 
1021                 [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/MUON -I$ALICE_ROOT/MUON/mapping],
1022                 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1023                 [MUONcore MUONraw MUONbase MUONgeometry MUONmapping MUONcalib MUONsim MUONtrigger MUONevaluation MUONrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1024                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1025
1026 if test "x$enable_module" = "xmissheader"; then
1027   enable_module="no...requires.AliRoot>=v4-08-Release"
1028   enable_muon=$enable_module
1029 elif test "x$enable_module" = "xforce"; then
1030   enable_muon="yes"
1031 else
1032   enable_muon=$enable_module
1033 fi
1034
1035 if test "x$enable_muon" = "xyes" ; then 
1036   AC_DEFINE(HLT_MUON)
1037   ALIMUON_LIBS=$ALIHLTMODULE_LIBS
1038   AC_LANG_PUSH(C++)
1039   save_CPPFLAGS="$CPPFLAGS"
1040
1041   dnl
1042   dnl Check for functionality GetRawStream AliMUONDigitMaker.h
1043   dnl 
1044   have_muon_digitmaker_getrawstream=no
1045   AC_MSG_CHECKING(for GetRawStream methods of AliMUONDigitMaker)
1046     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON"
1047     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
1048     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
1049     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMUONDigitMaker.h>], 
1050                                     [AliMUONDigitMaker dm;
1051                                        dm.GetRawStreamTracker();])],
1052                                     [have_muon_digitmaker_getrawstream=yes], 
1053                                       [AC_DEFINE(HAVE_NOT_MUON_DIGITMAKER_GETRAWSTREAM)])
1054     LIBS=$save_LIBS
1055   AC_MSG_RESULT([$have_muon_digitmaker_getrawstream])
1056
1057   dnl
1058   dnl Check for AliMpPad::GetPositionX/Y
1059   dnl change of implementation in MUON code
1060   dnl revision 31769, Wed Apr 1 2009
1061   dnl 
1062   have_muon_alimppad_getposition=no
1063   AC_MSG_CHECKING(for GetPosition methods of AliMpPad)
1064     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON/mapping"
1065     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
1066     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
1067     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMpPad.h>], 
1068                                     [AliMpPad pad;
1069                                      pad.GetPositionX();])],
1070                                     [have_muon_alimppad_getposition=yes], 
1071                                       [AC_DEFINE(HAVE_NOT_MUON_ALIMPPAD_GETPOSITION)])
1072     LIBS=$save_LIBS
1073   AC_MSG_RESULT([$have_muon_alimppad_getposition])
1074
1075   CPPFLAGS="$save_CPPFLAGS"
1076
1077   AC_LANG_POP(C++)
1078 else
1079   enable_module=$enable_muon
1080 fi
1081 AM_CONDITIONAL(EN_HLT_MUON, test x$enable_muon = xyes)
1082 AC_MSG_CHECKING([whether to compile MUON library])
1083 AC_MSG_RESULT([$enable_module])
1084 AC_SUBST([ALIMUON_LIBS])
1085
1086 dnl ------------------------------------------------------------------
1087 AH_TEMPLATE([HLT_TRIGGER],[hlt trigger library])
1088
1089 ALITRIGGER_LIBS=
1090 CHECK_HLTMODULE([trigger],
1091                 [], [$ALIROOT_CPPFLAGS],
1092                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1093                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1094                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1095
1096 if test "x$enable_module" = "xmissheader"; then
1097   enable_module="no...header.missing"
1098   enable_trigger=$enable_module
1099 elif test "x$enable_module" = "xforce"; then
1100   enable_trigger="yes"
1101 else
1102   enable_trigger=$enable_module
1103 fi
1104
1105 if test "x$enable_trigger" = "xyes" ; then 
1106   AC_DEFINE(HLT_TRIGGER)
1107   ALITRIGGER_LIBS=$ALIHLTMODULE_LIBS
1108 else
1109   enable_module=$enable_trigger
1110 fi
1111 AM_CONDITIONAL(EN_HLT_TRIGGER, test x$enable_trigger = xyes)
1112 AC_MSG_CHECKING([whether to compile Trigger library])
1113 AC_MSG_RESULT([$enable_module])
1114 AC_SUBST([ALITRIGGER_LIBS])
1115
1116 dnl ------------------------------------------------------------------
1117 AH_TEMPLATE([HLT_GLOBAL],[hlt global library])
1118
1119 ALIGLOBAL_LIBS=
1120 CHECK_HLTMODULE([global],
1121                 [], [$ALIROOT_CPPFLAGS],
1122                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1123                 [PHOSUtils ], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1124                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1125
1126 if test "x$enable_module" = "xmissheader"; then
1127   enable_module="no...header.missing"
1128   enable_global=$enable_module
1129 elif test "x$enable_module" = "xforce"; then
1130   enable_global="yes"
1131 else
1132   enable_global=$enable_module
1133   if test "x$enable_global" = "xyes" ; then
1134     AC_LANG_PUSH(C++)
1135     save_CPPFLAGS="$CPPFLAGS"
1136     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
1137     AC_MSG_CHECKING([for required functions in AliESDtrack])
1138     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliESDtrack.h>], 
1139                                        [AliESDtrack t;
1140                                        t.SetGlobalChi2(0)])],
1141                                        [], 
1142                                        [enable_global="no...requires.AliRoot>v4-17-Release"])
1143     AC_MSG_RESULT([$enable_global])       
1144     AC_LANG_POP(C++)
1145     CPPFLAGS="$save_CPPFLAGS"
1146   fi
1147 fi
1148
1149 if test "x$enable_global" = "xyes" ; then 
1150   AC_DEFINE(HLT_GLOBAL)
1151   ALIGLOBAL_LIBS=$ALIHLTMODULE_LIBS
1152 else
1153   enable_module=$enable_global
1154 fi
1155 AM_CONDITIONAL(EN_HLT_GLOBAL, test x$enable_global = xyes)
1156 AC_MSG_CHECKING([whether to compile Global library])
1157 AC_MSG_RESULT([$enable_module])
1158 AC_SUBST([ALIGLOBAL_LIBS])
1159
1160 dnl ------------------------------------------------------------------
1161 AH_TEMPLATE([HLT_JET],[hlt jet library])
1162
1163 ALIFASTJET_HEADER=
1164 ALIFASTJET_INCFLAGS=
1165 ALIFASTJET_LIBS=
1166 ALIFASTJET_LDFLAGS=
1167 AC_ARG_WITH(fastjet, [installation path of the FASTJET package],
1168                      [ test "x$with_fastjet" != "xno" && export FASTJET=$with_fastjet],
1169                      [ test -n $FASTJET && with_fastjet=$FASTJET ])
1170
1171 if test "x$with_fastjet" != "x" && test "x$with_fastjet" != "xno" ; then
1172   ALIFASTJET_INCFLAGS="-I${with_fastjet}/include"
1173   ALIFASTJET_HEADER="fastjet/PseudoJet.hh"
1174   ALIFASTJET_LDFLAGS="-L${with_fastjet}/lib"
1175   ALIFASTJET_LIBS="CGAL fastjet"
1176 else
1177   with_fastjet=no
1178 fi
1179
1180 CHECK_HLTMODULE([jet],
1181         [$ALIFASTJET_HEADER], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/JETAN $ALIFASTJET_INCFLAGS],
1182         [$ALIFASTJET_LIBS], [$ROOTLIBDIR $ALIFASTJET_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS],
1183         [AOD ESD ANALYSIS ANALYSISalice JETAN], 
1184         [-L$ROOTLIBDIR $ALIROOT_LDFLAGS $ALIFASTJET_LDFLAGS -L$ALICE_ROOT/lib/tgt_$ALICE_TARGET],
1185         [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1186
1187 if test "x$enable_module" = "xmissheader"; then
1188   enable_module="no...header.missing"
1189   enable_jet=$enable_module
1190 elif test "x$enable_module" = "xforce"; then
1191   enable_jet="yes"
1192 else
1193   enable_jet=$enable_module
1194 fi
1195
1196 if test "x$enable_jet" = "xyes" ; then
1197   AC_DEFINE(HLT_JET)
1198   ALIJET_LIBS="$ALIHLTMODULE_LIBS"
1199   
1200   if test "x$with_fastjet" != "xno"; then
1201      AC_DEFINE(HAVE_FASTJET)
1202      AC_DEFINE(WITHFASTJET)
1203      ALIJET_LIBS="$ALIJET_LIBS $FASTJET_LDFLAGS"
1204   fi
1205   AC_MSG_CHECKING([compilation with FASTJET package])
1206   AC_MSG_RESULT($with_fastjet)
1207
1208 else
1209   enable_module=$enable_jet
1210 fi
1211
1212 AM_CONDITIONAL(EN_HLT_JET, test x$enable_jet = xyes)
1213 AC_MSG_CHECKING([whether to compile Jet library])
1214 AC_MSG_RESULT([$enable_module])
1215 AC_SUBST([ALIJET_LIBS])
1216
1217 dnl ------------------------------------------------------------------
1218 AH_TEMPLATE([HLT_ITS],[hlt its library])
1219
1220 ALIITS_LIBS=
1221 CHECK_HLTMODULE([its],
1222                 [AliITSCompressRawDataSDD.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS],
1223                 [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1224                 [ITSbase ITSrec ITSsim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1225                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1226
1227 if test "x$enable_module" = "xmissheader"; then
1228   enable_module="no...header.missing"
1229   enable_its=$enable_module
1230 elif test "x$enable_module" = "xforce"; then
1231   enable_its="yes"
1232 else
1233   enable_its=$enable_module
1234   if test "x$enable_its" = "xyes" ; then
1235     AC_LANG_PUSH(C++)
1236     save_CPPFLAGS="$CPPFLAGS"
1237     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS"
1238     # changes in the AliVertexer base class revision 26414, Thu Jun 5 15:36:18 2008
1239     # require AliVertexer::GetNominalPos()
1240     AC_MSG_CHECKING([for required functions in AliITSVertexer])
1241     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliITSVertexerZ.h>], 
1242                                        [AliITSVertexerZ v;
1243                                        v.GetNominalPos()])],
1244                                        [], 
1245                                        [enable_its="no...requires.AliRoot>v4-13-Release"])
1246     AC_MSG_RESULT([$enable_its])       
1247     AC_LANG_POP(C++)
1248     CPPFLAGS="$save_CPPFLAGS"
1249   fi
1250 fi
1251
1252 if test "x$enable_its" = "xyes" ; then 
1253   AC_DEFINE(HLT_ITS)
1254   ALIITS_LIBS=$ALIHLTMODULE_LIBS
1255 else
1256   enable_module=$enable_its
1257 fi
1258 AM_CONDITIONAL(EN_HLT_ITS, test x$enable_its = xyes)
1259 AC_MSG_CHECKING([whether to compile ITS library])
1260 AC_MSG_RESULT([$enable_module])
1261 AC_SUBST([ALIITS_LIBS])
1262
1263 dnl ------------------------------------------------------------------
1264 AH_TEMPLATE([HLT_COMP],[hlt comp library])
1265
1266 ALICOMP_LIBS=
1267 CHECK_HLTMODULE([comp],
1268                 [], [$ALIROOT_CPPFLAGS],
1269                 [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
1270                 [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
1271                 [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
1272
1273 if test "x$enable_module" = "xmissheader"; then
1274   enable_module="no...header.missing"
1275   enable_comp=$enable_module
1276 elif test "x$enable_module" = "xforce"; then
1277   enable_comp="yes"
1278 else
1279   enable_comp=$enable_module
1280 fi
1281
1282 if test "x$enable_comp" = "xyes" ; then 
1283   AC_DEFINE(HLT_COMP)
1284   ALICOMP_LIBS=$ALIHLTMODULE_LIBS
1285 else
1286   enable_module=$enable_comp
1287 fi
1288 AM_CONDITIONAL(EN_HLT_COMP, test x$enable_comp = xyes)
1289 AC_MSG_CHECKING([whether to compile comp library])
1290 AC_MSG_RESULT([$enable_module])
1291 AC_SUBST([ALICOMP_LIBS])
1292
1293 dnl ------------------------------------------------------------------
1294 AC_MSG_CHECKING([whether to disable AliRoot logging])
1295 AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
1296 AC_ARG_ENABLE(aliroot-logging,
1297   [AC_HELP_STRING([--disable-aliroot-logging],
1298       [disable logging through AliRoot logging methods])],
1299   [],[enable_aliroot_logging=no])
1300 if test "x$have_aliroot" = "xno" ; then
1301   enable_aliroot_logging=yes # this means 'disable'
1302 fi
1303 if test "x$enable_aliroot_logging" != "xno" ; then 
1304   AC_DEFINE(NOALIROOT_LOGGING)
1305 fi
1306 AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
1307 AC_MSG_RESULT([$enable_aliroot_logging])
1308
1309 dnl ------------------------------------------------------------------
1310 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
1311 AH_TEMPLATE([DOMC],[MC saving])
1312 AC_ARG_ENABLE(mc-saving,
1313   [AC_HELP_STRING([--enable-mc-saving],
1314       [enable saving MC data through the chain])],
1315   [],[enable_mc_saving=no])
1316 if test "x$enable_mc_saving" = "xyes" ; then 
1317   AC_DEFINE(DOMC)
1318 fi
1319 AC_MSG_RESULT([$enable_mc_saving])
1320
1321 dnl ------------------------------------------------------------------
1322 dnl certainly something old, but we keep the define
1323 AC_MSG_CHECKING([whether to use ROWHOUGH])
1324 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
1325 AC_ARG_ENABLE(rowhough,
1326   [AC_HELP_STRING([--enable-rowhough],
1327       [use ROWHOUGH ])],
1328   [],[enable_rowhough=no])
1329 if test "x$enable_rowhough" = "xyes" ; then 
1330   AC_DEFINE(USEROWHOUGH)
1331 fi
1332 AC_MSG_RESULT([$enable_rowhough])
1333
1334 dnl ------------------------------------------------------------------
1335 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
1336 dnl stand-alone build system. This is most likely something old we can
1337 dnl get rid off later, or do something more reasonable. Since the define
1338 dnl needs the quotes they have to be  escaped. This works well for the
1339 dnl Makefile but not for the configure script. So we have to add the
1340 dnl defines after all the other checks.
1341 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
1342 if test ! "x$have_aliroot" = "xno" ; then
1343   CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
1344 fi
1345
1346 dnl ------------------------------------------------------------------
1347 dnl
1348 dnl Documentation
1349 dnl
1350 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
1351 AC_PATH_PROG(PERL, perl)
1352 AC_PATH_PROG(DOXYGEN, doxygen)
1353 AC_ARG_ENABLE(dot,
1354   [AC_HELP_STRING([--enable-dot],
1355       [enable dot documentation generator])],
1356   [],[enable_dot=no])
1357 HAVE_DOT=NO
1358 DOT_PATH=
1359 AC_PATH_PROG(DOT, dot)
1360 if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
1361    HAVE_DOT=YES
1362    DOT_PATH=`dirname $DOT`
1363 fi
1364
1365 AC_MSG_CHECKING([for documentation mode])
1366 AC_ARG_ENABLE(doc,
1367   [AC_HELP_STRING([--disable-doc],
1368       [disable documentation build; monolithic build --enable-doc=mono ])],
1369   [],[enable_doc=modules])
1370
1371 if test "x$DOXYGEN" = "x" ; then
1372    enable_doc=no.doxygen
1373 elif test "x$enable_doc" = "xyes" ; then
1374    enable_doc=yes
1375 elif test ! "x$enable_doc" = "xmono" && \
1376      test ! "x$enable_doc" = "xmodules"  && \
1377      test ! "x$enable_doc" = "xno"; then
1378    enable_doc=no
1379    AC_MSG_WARN([unknown option])
1380 fi
1381 if test "x$enable_doc" = "xno" ; then
1382    enable_doc=off
1383    DOXYGEN=
1384 fi
1385
1386 AC_MSG_RESULT([$enable_doc])
1387 AM_CONDITIONAL(MONOLITHIC_DOC, test "x$enable_doc" = "xmono")
1388 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
1389 AC_SUBST([HAVE_DOT])
1390 AC_SUBST([DOT_PATH])
1391
1392 dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
1393 dnl echo $HAVE_SRC_SUBDIR
1394 dnl if ! test -d $HAVE_SRC_SUBDIR; then
1395 dnl   HAVE_SRC_SUBDIR=
1396 dnl fi
1397 dnl AC_SUBST([HAVE_SRC_SUBDIR])
1398
1399 dnl ------------------------------------------------------------------
1400 AC_MSG_NOTICE([---------------------------------------------- ])
1401 AC_MSG_NOTICE([                build summary                  ])
1402 AC_MSG_NOTICE([---------------------------------------------- ])
1403
1404 AC_CONFIG_FILES([Makefile 
1405                  BASE/Makefile
1406                  BASE/setenv.sh
1407                  BASE/setenv.csh
1408                  BASE/HOMER/Makefile
1409                  BASE/util/Makefile
1410                  BASE/util/test/Makefile
1411                  BASE/interface/Makefile
1412                  BASE/test/Makefile
1413                  BASE/interface/test/Makefile
1414                  doc/Makefile
1415                  doc/doxygen.conf
1416                  doc/doxymodule.conf])
1417
1418 dnl AliRoot and installation directory for libraries
1419 dnl 
1420 AC_MSG_NOTICE([AliRoot: $have_aliroot])
1421 AM_CONDITIONAL(HAVE_ALIROOT, test "x$have_aliroot" != "xno" )
1422 if test "x$have_aliroot" != "xno"; then 
1423   AC_CONFIG_FILES([sim/Makefile  
1424                    rec/Makefile  
1425                    rec/test/Makefile     
1426                    rec/startAliEVE-barrel-tracks.sh
1427                    shuttle/Makefile
1428                    pendolino/Makefile
1429                    benchmark/Makefile
1430                    QA/Makefile
1431                    ])
1432 fi
1433 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
1434 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
1435 AC_MSG_NOTICE([libdir set to $libdir])
1436 fi
1437
1438 AC_MSG_NOTICE([compile sample library: $enable_sample])
1439 if test "x$enable_sample" = "xyes"; then 
1440   AC_CONFIG_FILES([SampleLib/Makefile])
1441 fi
1442
1443 AC_MSG_NOTICE([compile RCU library: $enable_rcu])
1444 if test "x$enable_rcu" = "xyes"; then 
1445   AC_CONFIG_FILES([RCU/Makefile
1446                    RCU/test/Makefile
1447                    ])
1448 fi
1449
1450 AC_MSG_NOTICE([compile TPC library: $enable_tpc])
1451 if test "x$enable_tpc" = "xyes"; then 
1452   AC_CONFIG_FILES([TPCLib/Makefile            
1453                    TPCLib/test/Makefile       
1454                    TPCLib/mapping2array.cxx     
1455                    TPCLib/EVE/Makefile
1456                    TPCLib/calibration/Makefile
1457                    ])
1458 fi
1459
1460 AC_MSG_NOTICE([compile CALO library: $enable_calo])
1461 if test "x$enable_calo" = "xyes"; then 
1462   AC_CONFIG_FILES([CALO/Makefile
1463                    CALO/test/Makefile])
1464 fi
1465
1466 AC_MSG_NOTICE([compile PHOS library: $enable_phos])
1467 if test "x$enable_phos" = "xyes"; then 
1468   AC_CONFIG_FILES([PHOS/Makefile])
1469 fi
1470
1471 AC_MSG_NOTICE([compile EMCAL library: $enable_emcal])
1472 if test "x$enable_emcal" = "xyes"; then 
1473   AC_CONFIG_FILES([EMCAL/Makefile])
1474 fi
1475
1476 AC_MSG_NOTICE([compile TRD library: $enable_trd])
1477 if test "x$enable_trd" = "xyes"; then 
1478   AC_CONFIG_FILES([TRD/Makefile])
1479 fi
1480
1481 AC_MSG_NOTICE([compile FMD library: $enable_fmd])
1482 if test "x$enable_fmd" = "xyes"; then 
1483   AC_CONFIG_FILES([FMD/Makefile])
1484 fi
1485
1486 AC_MSG_NOTICE([compile MUON library: $enable_muon])
1487 if test "x$enable_muon" = "xyes"; then 
1488   AC_CONFIG_FILES([MUON/Makefile])
1489 fi
1490
1491 AC_MSG_NOTICE([compile ITS library: $enable_its])
1492 if test "x$enable_its" = "xyes"; then 
1493   AC_CONFIG_FILES([ITS/Makefile])
1494 fi
1495
1496 AC_MSG_NOTICE([compile trigger library: $enable_trigger])
1497 if test "x$enable_trigger" = "xyes"; then 
1498   AC_CONFIG_FILES([trigger/Makefile
1499                    trigger/test/Makefile])
1500 fi
1501
1502 AC_MSG_NOTICE([compile global library: $enable_global])
1503 if test "x$enable_global" = "xyes"; then 
1504   AC_CONFIG_FILES([global/Makefile])
1505 fi
1506
1507 AC_MSG_NOTICE([compile jet library: $enable_jet])
1508 if test "x$enable_jet" = "xyes"; then 
1509   AC_CONFIG_FILES([JET/Makefile])
1510 fi
1511
1512 AC_MSG_NOTICE([compile comp library: $enable_comp])
1513 if test "x$enable_comp" = "xyes"; then 
1514   AC_CONFIG_FILES([comp/Makefile])
1515 fi
1516
1517 AC_OUTPUT
1518 dnl
1519 dnl EOF
1520 dnl
1521