]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/configure.ac
- Change in the Online display because Histograms and calibration data is now produced
[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 AC_INIT([Alice High Level Trigger] , [0.6-dev], [Matthias.Richter@ift.uib.no], alice-hlt)
9
10 dnl ------------------------------------------------------------------
11 dnl the package from CVS contains the old Makefiles as well. In order to
12 dnl prevent them from becoming overwritten, we require a separate build
13 dnl directory
14 if test "`dirname $0`" = "." ; then
15    AC_ERROR([please run the script from a separate build directory])
16 fi
17
18 dnl ------------------------------------------------------------------
19 AC_CANONICAL_SYSTEM
20 AC_PREFIX_DEFAULT(${PWD})
21 AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
22 AM_INIT_AUTOMAKE
23 AC_PROG_CC
24 AC_PROG_CXX
25 AC_PROG_LIBTOOL
26
27 AC_DEBUG
28 AC_OPTIMIZATION
29 AM_CONDITIONAL(STANDALONE_SAMPLELIB, test 0 )
30
31 dnl ------------------------------------------------------------------
32 dnl A warning posted into the auto-generated files
33 dnl Does NOT concern this file ;-)
34 AUTOGENERATED_WARNING="!!!!!!!    DO NOT EDIT THIS FILE !!!!!!"
35 AC_SUBST([AUTOGENERATED_WARNING])
36
37 dnl ------------------------------------------------------------------
38 dnl
39 dnl Check for ROOT
40 dnl
41 ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
42 AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
43 AC_SUBST([ROOTSYS])
44 ROOTBINDIR=`dirname $ROOTEXEC`
45 AC_SUBST([ROOTBINDIR])
46
47 dnl test for additional required root libraries and headers
48 LIBS='-ldl'
49 if test "x$have_root" = "x1"; then
50   AC_LANG_PUSH(C++)
51   save_CPPFLAGS=$CPPFLAGS
52   save_LDFLAGS=$LDFLAGS
53   save_LIBS=$LIBS
54   CPPFLAGS=`echo $save_CPPFLAGS; for i in ${ROOTINCDIR}; do echo -n "-I$i " ; done`
55   
56   # we check for the libSTEER library which is linked to
57   # - the ROOT libs libGeom libMinuit libVMC libEG
58   # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
59   # - ROOT libCint needs also libdl
60   # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
61   #   libTreePlayer.so
62   # - from Jan 07 libESD also depends on libXMLIO
63   ROOT_CHECKLIBS='Geom Minuit EG VMC TreePlayer XMLIO'
64   for CHECKLIB in $ROOT_CHECKLIBS ; do
65     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
66     LIBS="$save_LIBS $ROOTLIBS $ADD_ROOTLIBS"
67     AC_CHECK_LIB([$CHECKLIB],[_init], [ADD_ROOTLIBS="$ADD_ROOTLIBS -l$CHECKLIB"])
68   done
69
70   # TBuffer.h has been made pure virtual in root v5-15-02 and one
71   # has to derive from TBufferFile.h (needed for BASE/AliHLTMessage.h)
72   AC_CHECK_HEADERS([TBufferFile.h])
73
74   CPPFLAGS=$save_CPPFLAGS
75   LDFLAGS=$save_LDFLAGS
76   LIBS=$save_LIBS
77   AC_LANG_POP(C++)
78 fi
79
80 dnl ------------------------------------------------------------------
81 # TODO: make this configurable through arguments
82 #Define whether you want to run with ALIROOT or only ROOT
83 AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
84 ALIHLT_USEPACKAGE=ALIROOT
85 #ALIHLT_USEPACKAGE=ROOT
86 #ALIHLT_USEPACKAGE=STANDALONE
87 AC_DEFINE(use_aliroot)
88 AC_DEFINE(use_root)
89 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
90
91 dnl ------------------------------------------------------------------
92 dnl check for AliRoot features
93 AC_LANG_PUSH(C++)
94 have_aliroot=no
95 AC_ARG_WITH(aliroot,[  --with-aliroot   top of the AliRoot installation],
96                     [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
97                     [])
98
99 if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
100   dnl ------------------------------------------------------------------
101   dnl Try to estimate the system architecture
102   case $host_os:$host_cpu in
103   linux*:x86_64*)       alice_target='linuxx8664gcc'            ;;
104   linux*)               alice_target='linux'                    ;;
105   *)                    alice_target='unknown'                  ;;
106   esac
107   if test "x$alice_target" = "xunknown" ; then
108     if test -z $ALICE_TARGET ; then
109     AC_MSG_ERROR([Can not estimate system architecture.
110     To avoid the problem, set the ALICE_TARGET variable appropriately.
111     Please send the following information to Matthias.Richter@ift.uib.no:
112         ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
113     else
114     AC_MSG_NOTICE([Unknown system architecture.
115     Please send the following information to Matthias.Richter@ift.uib.no:
116         ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])  
117     fi
118   else
119     if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
120     AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
121     overriding $ALICE_TARGET by $alice_target])
122     fi
123     ALICE_TARGET=$alice_target
124   fi
125   ALIROOTBINDIR=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}
126   ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
127   ALIROOTINCDIR=${ALICE_ROOT}/include
128   test -d ${ALIROOTBINDIR} || AC_MSG_WARN([can not find AliRoot binary directory $ALIROOTBINDIR])
129   test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
130   test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
131 fi
132
133 AC_MSG_CHECKING([for AliRoot])
134 if test "x$ALICE_ROOT" != "x" \
135    && test -d ${ALIROOTBINDIR} \
136    && test -d ${ALIROOTLIBDIR} \
137    && test -d ${ALIROOTINCDIR}; then
138   have_aliroot=$ALICE_ROOT
139 else
140   ALIROOTBINDIR=
141   ALIROOTLIBDIR=
142   ALIROOTINCDIR=
143 fi
144 AC_MSG_RESULT([$have_aliroot])
145
146 if test ! "x$have_aliroot" = "xno" ; then
147   ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
148   ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
149   ALIROOT_LIBS="-lESD $ADD_ROOTLIBS"
150   save_CPPFLAGS=$CPPFLAGS
151   save_LDFLAGS=$LDFLAGS
152   save_LIBS=$LIBS
153   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
154   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
155   
156   # check for certain AliRoot libraries/files/features
157   # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
158   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
159   CHECKLIB=CDB
160   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
161
162   # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
163   have_alirawdata=no
164   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
165   CHECKLIB=RAWDatabase
166   AC_CHECK_LIB([$CHECKLIB],[_init],
167         [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
168          LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
169          CHECKLIB=RAWDatarec
170          AC_CHECK_LIB([$CHECKLIB],[_init],
171                [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
172                 AC_DEFINE(HAVE_ALIRAWDATA)
173                 have_alirawdata=$CHECKLIB])],
174         [# second pass with -RAWData
175          CHECKLIB="-lRAWData"
176          LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
177          AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
178                                        #include <AliRawReaderFile.h>
179                                        #include <AliRawReaderDate.h>
180                                        #include <AliRawReaderRoot.h>], 
181                                      [AliRawReaderMemory mreader;
182                                        AliRawReaderFile freader;
183                                        AliRawReaderDate dreader(NULL,0);
184                                        AliRawReaderRoot rreader(NULL,0);])],
185                                      [AC_DEFINE(HAVE_ALIRAWDATA)
186                                        ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
187                                        have_alirawdata=$CHECKLIB], 
188                                       [have_alirawdata=no])
189         ]) dnl AC_CHECK_LIB RAWDatabase
190   AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
191   AC_MSG_RESULT($have_alirawdata)
192
193   dnl
194   dnl Check for the interface of AliExternalTrackParam which has been changed
195   dnl in revision 1.17 of AliExternalTrackParam.h (AliRoot version v4-05-04
196   dnl or higher)
197   externaltrackparam_version=1
198   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliExternalTrackParam.h>], 
199                                   [AliExternalTrackParam trackparam;
200                                    Double_t param[[5]]; Double_t covar[[15]];
201                                    trackparam.Set(0., 0., param, covar);])],
202                                   [externaltrackparam_version=2],
203                                   [AC_DEFINE(EXTERNALTRACKPARAM_V1)])
204   AC_MSG_CHECKING(for version of AliExternalTrackParam)
205   AC_MSG_RESULT($externaltrackparam_version)
206
207   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
208   CHECKLIB=STEER
209   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
210
211   if test ! "x$have_aliroot" = "xno" ; then
212     # the HLTTPCLib needs to link agains TPCbase and TPCrec
213     # TPC library for AliTPCParam and AliSimDigits used in 
214     # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
215     saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
216     ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
217     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
218     have_alitpc=yes
219     AC_MSG_CHECKING(for required classes in TPC libraries)
220     if test ! "x$have_alitpc" = "xno" ; then
221       save_ALIROOT_LIBS=$ALIROOT_LIBS
222       ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
223       LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
224       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
225                                        #include <AliTPCParam.h>
226                                        #include <AliTPCParamSR.h>
227                                        #include <AliTPCDigitsArray.h>
228                                        #include <AliTPCClustersArray.h>
229                                        #include <AliTPCcluster.h>     
230                                        #include <AliTPCClustersRow.h>], 
231                                       [AliSimDigits dig;
232                                        AliTPCParam param;
233                                        AliTPCParamSR paramsr;
234                                        AliTPCDigitsArray digarray;
235                                        AliTPCClustersArray clustarray;
236                                        AliTPCcluster clust;
237                                        AliTPCClustersRow row])],
238                                       [AC_DEFINE(HAVE_ALITPC)
239                                        saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
240                                        saveALIROOT_LIBS=$ALIROOT_LIBS], 
241                                       [have_alitpc=no
242                                        ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
243                                        ALIROOT_LIBS=$saveALIROOT_LIBS])
244     fi
245     AC_MSG_RESULT($have_alitpc)
246   fi
247
248   if test ! "x$have_alirawdata" = "xno" ; then
249     # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
250     # the header file has been moved to the TPC module
251     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
252     # AliRawReaderMemory.h AliRawReaderFile.h already checked
253     #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
254     AC_CHECK_HEADERS([AliTPCRawStream.h])
255   fi
256
257   have_tpc_mapping=no
258   if test ! "x$have_aliroot" = "xno" ; then
259     # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC 
260     # which is stored in the TPC/mapping/Patchx.data files from
261     # AliRoot version v4-04-Release (May 2006)
262     AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
263     TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
264     AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], 
265                    [have_tpc_mapping=yes
266                     AC_SUBST(TPC_PAD_MAPPING_PATH)
267                     AC_DEFINE(HAVE_TPC_MAPPING)],
268                    [])
269     
270   fi
271   AC_MSG_CHECKING([for TPC mapping layout])
272   AC_MSG_RESULT([$have_tpc_mapping])
273
274   dnl
275   dnl required header files and libraries for the AliHLTPHOS library  
276   dnl
277   have_alicalorawstream=no
278   if test ! "x$have_aliroot" = "xno" ; then
279     # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
280     #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
281     AC_MSG_CHECKING([for AliCaloRawStream.h usability])
282     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
283                                      #include <AliCaloRawStream.h>], 
284                                     [int i])],
285                                     [AC_DEFINE(HAVE_ALICALORAWSTREAM)
286                                      have_alicalorawstream=yes], 
287                                     [])
288     AC_MSG_RESULT([$have_alicalorawstream])
289   fi
290
291   if test "x$have_aliroot" = "xno" ; then
292     ALIROOT_CPPFLAGS=
293     ALIROOT_LDFLAGS=
294     ALIROOT_LIBS=
295   fi
296   CPPFLAGS=$save_CPPFLAGS
297   LDFLAGS=$save_LDFLAGS
298   LIBS=$save_LIBS
299 fi
300 AC_LANG_POP(C++)
301 AC_SUBST([ALICE_ROOT])
302 AC_SUBST([ALIROOT_CPPFLAGS])
303 AC_SUBST([ALIROOT_LDFLAGS])
304 AC_SUBST([ALIROOTBINDIR])
305 AC_SUBST([ALIROOTLIBDIR])
306 AC_SUBST([ALIROOT_LIBS])
307 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
308
309 HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
310 HLTBASE_LDFLAGS=
311 AC_SUBST([HLTBASE_CPPFLAGS])
312 AC_SUBST([HLTBASE_LDFLAGS])
313
314 dnl ------------------------------------------------------------------
315 dnl check for the HLT PubSub Framework
316 AC_MSG_CHECKING([for HLT PubSub Framework])
317 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
318                     [],
319                     [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
320 if test -z $with_pubsub || ! test -d $with_pubsub ; then
321   with_pubsub=no
322 fi
323 AC_MSG_RESULT([$with_pubsub])
324 HOMER_VERSION=1
325 HOMER_LIBS=
326
327 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
328 if test "x$with_pubsub" != "xno" ; then
329   save_CPPFLAGS=$CPPFLAGS
330   save_LDFLAGS=$LDFLAGS
331   save_LIBS=$LIBS
332   # currently the different versions of the HLT PubSub framework have a different
333   # directory layout
334   if test -d ${with_pubsub}/include/HOMER ; then
335     # the 'early' location of the include files with separated HOMER sub dirs
336     HOMER_INCDIRS="${with_pubsub}/include/HOMER ${with_pubsub}/include/HOMER/reader"
337   elif test -d ${with_pubsub}/include/Util/HOMER ; then
338     # location for HLT Framework versions after Sep 2006
339     HOMER_INCDIRS="${with_pubsub}/include/Util/HOMER"
340   elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
341     # fall back if include files were not installed (versions after Sep 06)
342     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/include"
343   else
344     # fall back if include files were not installed (versions before Sep 06)
345     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/reader/include ${with_pubsub}/src/Util/HOMER/data/include"
346   fi
347   HOMER_CPPFLAGS=`for i in ${HOMER_INCDIRS}; do echo -n "-I$i " ; done`
348   HOMER_BINDIR="${with_pubsub}/bin/`uname -s`-`uname -m`"
349   HOMER_LIBDIR="${with_pubsub}/lib/`uname -s`-`uname -m`"
350   HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
351   CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
352   LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
353   LIBS="$save_LIBS "
354   with_homer=no
355   AC_LANG_PUSH(C++)
356   AC_CHECK_HEADER([HOMERReader.h],
357     [ AC_CHECK_LIB([HOMER],[_init],
358       [with_homer=yes
359        HOMER_LIBS="-lHOMER"],
360       [ AC_CHECK_LIB([HOMERReader],[_init],
361                      [with_homer=yes
362                       HOMER_LIBS="-lHOMERReader"])])
363       LIBS="$LIBS $HOMER_LIBS"
364       AC_MSG_CHECKING([version of HOMER library])
365       dnl The Homer library has no versioning, so we do our own
366       dnl version           description
367       dnl ----------------------------------------------------------------------
368       dnl   1          inintial version
369       dnl   2          GetBlockStatusFlags added to the interface
370       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
371                                       [HOMERReader reader("dummy", 0);
372                                        reader.GetBlockStatusFlags(0);])],
373                                       [if test $HOMER_VERSION -lt 2 ; then HOMER_VERSION=2; fi],
374                                       [])
375       AC_MSG_RESULT([$HOMER_VERSION])
376   ]) #AC_CHECK_HEADER([HOMERReader.h])
377   AC_LANG_POP(C++)
378   if test "x$with_homer" = "xno" ; then
379     HOMER_CPPFLAGS=
380     HOMER_LDFLAGS=
381     HOMER_LIBS=
382   else
383     HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
384     AC_DEFINE(HAVE_HOMERREADER)
385   fi
386   CPPFLAGS="$save_CPPFLAGS"
387   LDFLAGS="$save_LDFLAGS"
388   LIBS="$save_LIBS"  
389 fi
390 AC_SUBST([HOMER_CPPFLAGS])
391 AC_SUBST([HOMER_LDFLAGS])
392 AC_SUBST([HOMER_LIBDIR])
393 AC_SUBST([HOMER_BINDIR])
394 AC_SUBST([HOMER_LIBS])
395
396 dnl ------------------------------------------------------------------
397 AC_MSG_CHECKING([whether to impose strict coding conventions])
398 AC_ARG_ENABLE(strict,
399   [AC_HELP_STRING([--enable-strict],
400       [enable coding convention checks ])],
401   [],[enable_strict=no])
402 if test "x$enable_strict" = "xyes" ; then
403    CPPFLAGS="$CPPFLAGS -Weffc++"
404 fi
405 AC_MSG_RESULT([$enable_strict])
406
407 dnl ------------------------------------------------------------------
408 AC_MSG_CHECKING([whether to compile sample library])
409 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
410 AC_ARG_ENABLE(sample,
411   [AC_HELP_STRING([--enable-sample],
412       [compile the sample library ])],
413   [],[enable_sample=yes])
414 if test "x$enable_sample" = "xyes" ; then 
415   AC_DEFINE(HLT_SAMPLE)
416 fi
417 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
418 AC_MSG_RESULT([$enable_sample])
419
420 dnl ------------------------------------------------------------------
421 AC_MSG_CHECKING([whether to compile tpc library])
422 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
423 AC_ARG_ENABLE(tpc,
424   [AC_HELP_STRING([--enable-tpc],
425       [compile the tpc library ])],
426   [],[enable_tpc=yes])
427 if test "x$have_aliroot" = "xno" ; then
428    enable_tpc="no...requires.AliRoot"
429 elif test "x$have_alitpc" = "xno" ; then
430    enable_tpc="no...requires.AliRoot.TPC.libraries"
431 fi
432 if test "x$enable_tpc" = "xyes" ; then 
433   AC_DEFINE(HLT_TPC)
434 fi
435 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
436 AC_MSG_RESULT([$enable_tpc])
437
438 dnl ------------------------------------------------------------------
439 AC_MSG_CHECKING([whether to compile phos library])
440 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
441 AC_ARG_ENABLE(phos,
442   [AC_HELP_STRING([--enable-phos],
443       [compile the phos library ])],
444   [],[enable_phos=yes])
445 if test "x$have_aliroot" = "xno" ; then
446    enable_phos="no...requires.AliRoot"
447 elif ! test "x$have_alicalorawstream" = "xyes"; then
448    enable_phos="no...requires.AliRoot>v4-05-07"
449 fi
450 if test "x$enable_phos" = "xyes" ; then 
451   AC_DEFINE(HLT_PHOS)
452 fi
453 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
454 AC_MSG_RESULT([$enable_phos])
455
456 dnl ------------------------------------------------------------------
457 AC_MSG_CHECKING([whether to compile trd library])
458 AH_TEMPLATE([HLT_TRD],[hlt trd library])
459 AC_ARG_ENABLE(trd,
460   [AC_HELP_STRING([--enable-trd],
461       [compile the trd library ])],
462   [],[enable_trd=yes])
463 if test "x$have_aliroot" = "xno" ; then
464    enable_trd="no...requires.AliRoot"
465 fi
466 if test "x$enable_trd" = "xyes" ; then 
467   AC_DEFINE(HLT_TRD)
468 fi
469 AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
470 AC_MSG_RESULT([$enable_trd])
471
472 dnl ------------------------------------------------------------------
473 AC_MSG_CHECKING([whether to enable HLT logging])
474 AH_TEMPLATE([NOLOGGING],[disable hlt logging])
475 AC_ARG_ENABLE(logging,
476   [AC_HELP_STRING([--enable-logging],
477       [enable logging])],
478   [],[enable_logging=yes])
479 if test "x$enable_logging" != "xyes" ; then 
480   AC_DEFINE(NOLOGGING)
481 fi
482 AC_MSG_RESULT([$enable_logging])
483
484 dnl ------------------------------------------------------------------
485 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
486 AH_TEMPLATE([DOMC],[MC saving])
487 AC_ARG_ENABLE(mc-saving,
488   [AC_HELP_STRING([--enable-mc-saving],
489       [enable saving MC data through the chain])],
490   [],[enable_mc_saving=no])
491 if test "x$enable_mc_saving" = "xyes" ; then 
492   AC_DEFINE(DOMC)
493 fi
494 AC_MSG_RESULT([$enable_mc_saving])
495
496 dnl ------------------------------------------------------------------
497 dnl certainly something old, but we keep the define
498 AC_MSG_CHECKING([whether to use ROWHOUGH])
499 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
500 AC_ARG_ENABLE(rowhough,
501   [AC_HELP_STRING([--enable-rowhough],
502       [use ROWHOUGH ])],
503   [],[enable_rowhough=no])
504 if test "x$enable_rowhough" = "xyes" ; then 
505   AC_DEFINE(USEROWHOUGH)
506 fi
507 AC_MSG_RESULT([$enable_rowhough])
508
509 dnl ------------------------------------------------------------------
510 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
511 dnl stand-alone build system. This is most likely something old we can
512 dnl get rid off later, or do something more reasonable. Since the define
513 dnl needs the quotes they have to be  escaped. This works well for the
514 dnl Makefile but not for the configure script. So we have to add the
515 dnl defines after all the other checks.
516 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
517 if test ! "x$have_aliroot" = "xno" ; then
518   CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
519 fi
520
521 dnl ------------------------------------------------------------------
522 dnl
523 dnl Documentation
524 dnl
525 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
526 AC_PATH_PROG(PERL, perl)
527 AC_PATH_PROG(DOXYGEN, doxygen)
528 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
529 HAVE_DOT=NO
530 DOT_PATH=
531 AC_PATH_PROG(DOT, dot)
532 if ! test "x$DOT" = "x" ; then
533    HAVE_DOT=YES
534    DOT_PATH=`dirname $DOT`
535 fi
536 AC_SUBST([HAVE_DOT])
537 AC_SUBST([DOT_PATH])
538
539 dnl ------------------------------------------------------------------
540 dnl inatallation directory for libraries
541 dnl 
542 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
543 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
544 AC_MSG_NOTICE([libdir set to $libdir])
545 fi
546 dnl ------------------------------------------------------------------
547 AC_CONFIG_FILES([Makefile 
548                  BASE/Makefile
549                  BASE/setenv.sh
550                  BASE/setenv.csh
551                  SampleLib/Makefile
552                  TPCLib/Makefile
553                  TPCLib/mapping2array.cxx
554                  TPCLib/OnlineDisplay/Makefile
555                  PHOS/Makefile
556                  TRD/Makefile
557                  doc/Makefile
558                  doc/doxygen.conf])
559
560
561 AC_OUTPUT
562 dnl
563 dnl EOF
564 dnl
565