]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/configure.ac
Fixing compilation problem. fBlock was not dereferenced in BlockHeader() method.
[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.7-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   # TView.h has been made pure virtual right after root v5-15-02 and one
75   # has to derive from TView3D.h (needed for TPCLib/OnlineDisplay/AliHLTTPCDisplay3D)
76   AC_CHECK_HEADERS([TView3D.h])
77
78   CPPFLAGS=$save_CPPFLAGS
79   LDFLAGS=$save_LDFLAGS
80   LIBS=$save_LIBS
81   AC_LANG_POP(C++)
82 fi
83
84 dnl ------------------------------------------------------------------
85 # TODO: make this configurable through arguments
86 #Define whether you want to run with ALIROOT or only ROOT
87 AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
88 ALIHLT_USEPACKAGE=ALIROOT
89 #ALIHLT_USEPACKAGE=ROOT
90 #ALIHLT_USEPACKAGE=STANDALONE
91 AC_DEFINE(use_aliroot)
92 AC_DEFINE(use_root)
93 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
94
95 dnl ------------------------------------------------------------------
96 dnl check for AliRoot features
97 AC_LANG_PUSH(C++)
98 have_aliroot=no
99 AC_ARG_WITH(aliroot,[  --with-aliroot   top of the AliRoot installation],
100                     [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
101                     [])
102
103 if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
104   dnl ------------------------------------------------------------------
105   dnl Try to estimate the system architecture
106   case $host_os:$host_cpu in
107   linux*:x86_64*)       alice_target='linuxx8664gcc'            ;;
108   linux*)               alice_target='linux'                    ;;
109   *)                    alice_target='unknown'                  ;;
110   esac
111   if test "x$alice_target" = "xunknown" ; then
112     if test -z $ALICE_TARGET ; then
113     AC_MSG_ERROR([Can not estimate system architecture.
114     To avoid the problem, set the ALICE_TARGET variable appropriately.
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     else
118     AC_MSG_NOTICE([Unknown system architecture.
119     Please send the following information to Matthias.Richter@ift.uib.no:
120         ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])  
121     fi
122   else
123     if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
124     AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
125     overriding $ALICE_TARGET by $alice_target])
126     fi
127     ALICE_TARGET=$alice_target
128   fi
129   ALIROOTBINDIR=${ALICE_ROOT}/bin/tgt_${ALICE_TARGET}
130   ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
131   ALIROOTINCDIR=${ALICE_ROOT}/include
132   test -d ${ALIROOTBINDIR} || AC_MSG_WARN([can not find AliRoot binary directory $ALIROOTBINDIR])
133   test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
134   test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
135 fi
136
137 AC_MSG_CHECKING([for AliRoot])
138 if test "x$ALICE_ROOT" != "x" \
139    && test -d ${ALIROOTBINDIR} \
140    && test -d ${ALIROOTLIBDIR} \
141    && test -d ${ALIROOTINCDIR}; then
142   have_aliroot=$ALICE_ROOT
143 else
144   ALIROOTBINDIR=
145   ALIROOTLIBDIR=
146   ALIROOTINCDIR=
147 fi
148 AC_MSG_RESULT([$have_aliroot])
149
150 if test ! "x$have_aliroot" = "xno" ; then
151   ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
152   ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
153   ALIROOT_LIBS="-lESD $ADD_ROOTLIBS"
154   save_CPPFLAGS=$CPPFLAGS
155   save_LDFLAGS=$LDFLAGS
156   save_LIBS=$LIBS
157   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
158   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
159   
160   # check for certain AliRoot libraries/files/features
161   # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
162   have_alirawdata=no
163   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
164   CHECKLIB=RAWDatabase
165   AC_CHECK_LIB([$CHECKLIB],[_init],
166         [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
167          LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
168          CHECKLIB=RAWDatarec
169          AC_CHECK_LIB([$CHECKLIB],[_init],
170                [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
171                 AC_DEFINE(HAVE_ALIRAWDATA)
172                 have_alirawdata=$CHECKLIB])],
173         [# second pass with -RAWData
174          CHECKLIB="-lRAWData"
175          LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
176          AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
177                                        #include <AliRawReaderFile.h>
178                                        #include <AliRawReaderDate.h>
179                                        #include <AliRawReaderRoot.h>], 
180                                      [AliRawReaderMemory mreader;
181                                        AliRawReaderFile freader;
182                                        AliRawReaderDate dreader(NULL,0);
183                                        AliRawReaderRoot rreader(NULL,0);])],
184                                      [AC_DEFINE(HAVE_ALIRAWDATA)
185                                        ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
186                                        have_alirawdata=$CHECKLIB], 
187                                       [have_alirawdata=no])
188         ]) dnl AC_CHECK_LIB RAWDatabase
189   AC_MSG_CHECKING([for AliRawReader classes in RAWData libraries])
190   AC_MSG_RESULT([$have_alirawdata])
191
192   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
193   CHECKLIB=AOD
194   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
195
196   # Jun 22 2007: a circular dependency has been introduced between libCDB/libSTEER
197   # and libRAWDatasim/libSTEER in AliCTPRawData due to use of AliFstream
198   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lSTEER -lCDB"
199   CHECKLIB=RAWDatasim
200   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
201
202   # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
203   # in addition a circular dependency has been introduced in March 06 which
204   # requires to add libSTEER already here
205   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lSTEER"
206   CHECKLIB=CDB
207   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
208
209   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
210   CHECKLIB=STEER
211   AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
212
213   dnl
214   dnl check whether AliLog supports notification callback
215   dnl
216   LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
217   have_alilog_notification=no
218   AC_MSG_CHECKING([whether AliLog supports notification callback])
219   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliLog.h>], 
220                                   [AliLog::AliLogNotification fct])],
221                                   [have_alilog_notification=yes], 
222                                   [AC_DEFINE(NO_ALILOG_NOTIFICATION)])
223   AC_MSG_RESULT([$have_alilog_notification])
224
225   dnl
226   dnl Check for the interface of AliExternalTrackParam which has been changed
227   dnl in revision 1.17 of AliExternalTrackParam.h (AliRoot version v4-05-04
228   dnl or higher)
229   externaltrackparam_version=1
230   AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliExternalTrackParam.h>], 
231                                   [AliExternalTrackParam trackparam;
232                                    Double_t param[[5]]; Double_t covar[[15]];
233                                    trackparam.Set(0., 0., param, covar);])],
234                                   [externaltrackparam_version=2],
235                                   [AC_DEFINE(EXTERNALTRACKPARAM_V1)])
236   AC_MSG_CHECKING(for version of AliExternalTrackParam)
237   AC_MSG_RESULT($externaltrackparam_version)
238
239   dnl
240   dnl required header files and libraries for the AliHLTPHOS library  
241   dnl
242   have_alicalorawstream=no
243   if test ! "x$have_aliroot" = "xno" ; then
244     # this can not be used as AliCaloRawStream.h indirectly depends on TString.h
245     #AC_CHECK_HEADERS([AliCaloRawStream.h], [have_alicalorawstream=yes])
246     AC_MSG_CHECKING([for AliCaloRawStream.h usability])
247     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <TString.h>
248                                      #include <AliCaloRawStream.h>], 
249                                     [int i])],
250                                     [AC_DEFINE(HAVE_ALICALORAWSTREAM)
251                                      have_alicalorawstream=yes], 
252                                     [])
253     AC_MSG_RESULT([$have_alicalorawstream])
254   fi
255
256   dnl
257   dnl required header files and libraries for the AliHLTTRD library  
258   dnl
259   AC_CHECK_HEADERS([AliGeomManager.h], [], [AC_DEFINE([HAVNT_ALIGEOMMANAGER])])
260
261   dnl
262   dnl required header files and libraries for the AliHLTTPC library  
263   dnl
264   if test ! "x$have_aliroot" = "xno" ; then
265     # the HLTTPCLib needs to link agains TPCbase and TPCrec
266     # TPC library for AliTPCParam and AliSimDigits used in 
267     # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
268     # fram May 07 TPCbase depends on libGui.so
269     saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
270     ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
271     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
272     have_alitpc=yes
273     AC_MSG_CHECKING(for required classes in TPC libraries)
274     if test ! "x$have_alitpc" = "xno" ; then
275       save_ALIROOT_LIBS=$ALIROOT_LIBS
276       ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec -lGui"
277       LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
278       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
279                                        #include <AliTPCParam.h>
280                                        #include <AliTPCParamSR.h>
281                                        #include <AliTPCDigitsArray.h>
282                                        #include <AliTPCClustersArray.h>
283                                        #include <AliTPCcluster.h>     
284                                        #include <AliTPCClustersRow.h>], 
285                                       [AliSimDigits dig;
286                                        AliTPCParam param;
287                                        AliTPCParamSR paramsr;
288                                        AliTPCDigitsArray digarray;
289                                        AliTPCClustersArray clustarray;
290                                        AliTPCcluster clust;
291                                        AliTPCClustersRow row])],
292                                       [AC_DEFINE(HAVE_ALITPC)
293                                        saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
294                                        saveALIROOT_LIBS=$ALIROOT_LIBS], 
295                                       [have_alitpc=no
296                                        ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
297                                        ALIROOT_LIBS=$saveALIROOT_LIBS])
298     fi
299     AC_MSG_RESULT($have_alitpc)
300   fi
301
302   if test ! "x$have_alirawdata" = "xno" ; then
303     # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
304     # the header file has been moved to the TPC module
305     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
306     # AliRawReaderMemory.h AliRawReaderFile.h already checked
307     #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
308     AC_CHECK_HEADERS([AliTPCRawStream.h])
309   fi
310
311   have_tpc_mapping=no
312   if test ! "x$have_aliroot" = "xno" ; then
313     # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC 
314     # which is stored in the TPC/mapping/Patchx.data files from
315     # AliRoot version v4-04-Release (May 2006)
316     AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
317     TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
318     AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], 
319                    [have_tpc_mapping=yes
320                     AC_SUBST(TPC_PAD_MAPPING_PATH)
321                     AC_DEFINE(HAVE_TPC_MAPPING)],
322                    [])
323     
324   fi
325   AC_MSG_CHECKING([for TPC mapping layout])
326   AC_MSG_RESULT([$have_tpc_mapping])
327
328   if test "x$have_aliroot" = "xno" ; then
329     ALIROOT_CPPFLAGS=
330     ALIROOT_LDFLAGS=
331     ALIROOT_LIBS=
332   fi
333   CPPFLAGS=$save_CPPFLAGS
334   LDFLAGS=$save_LDFLAGS
335   LIBS=$save_LIBS
336 fi
337 AC_LANG_POP(C++)
338 AC_SUBST([ALICE_ROOT])
339 AC_SUBST([ALIROOT_CPPFLAGS])
340 AC_SUBST([ALIROOT_LDFLAGS])
341 AC_SUBST([ALIROOTBINDIR])
342 AC_SUBST([ALIROOTLIBDIR])
343 AC_SUBST([ALIROOT_LIBS])
344 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
345
346 HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
347 HLTBASE_LDFLAGS=
348 AC_SUBST([HLTBASE_CPPFLAGS])
349 AC_SUBST([HLTBASE_LDFLAGS])
350
351 dnl ------------------------------------------------------------------
352 dnl check for the HLT PubSub Framework
353 AC_MSG_CHECKING([for HLT PubSub Framework])
354 AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
355                     [],
356                     [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
357 if test -z $with_pubsub || ! test -d $with_pubsub ; then
358   with_pubsub=no
359 fi
360 AC_MSG_RESULT([$with_pubsub])
361 HOMER_VERSION=1
362 HOMER_LIBS=
363
364 AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
365 if test "x$with_pubsub" != "xno" ; then
366   save_CPPFLAGS=$CPPFLAGS
367   save_LDFLAGS=$LDFLAGS
368   save_LIBS=$LIBS
369   # currently the different versions of the HLT PubSub framework have a different
370   # directory layout
371   if test -d ${with_pubsub}/include/HOMER ; then
372     # the 'early' location of the include files with separated HOMER sub dirs
373     HOMER_INCDIRS="${with_pubsub}/include/HOMER ${with_pubsub}/include/HOMER/reader"
374   elif test -d ${with_pubsub}/include/Util/HOMER ; then
375     # location for HLT Framework versions after Sep 2006
376     HOMER_INCDIRS="${with_pubsub}/include/Util/HOMER"
377   elif test -d ${with_pubsub}/src/Util/HOMER/include ; then
378     # fall back if include files were not installed (versions after Sep 06)
379     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/include"
380   else
381     # fall back if include files were not installed (versions before Sep 06)
382     HOMER_INCDIRS="${with_pubsub}/src/Util/HOMER/reader/include ${with_pubsub}/src/Util/HOMER/data/include"
383   fi
384   HOMER_CPPFLAGS=`for i in ${HOMER_INCDIRS}; do echo -n "-I$i " ; done`
385
386   AC_ARG_ENABLE(pubsub-debug,
387     [AC_HELP_STRING([--disable-pubsub-debug],
388         [force the production version of the PubSub framework])],
389     [],[enable_pubsub_debug=yes])
390   homer_type="none"
391   HOMER_TARGET="`uname -s`-`uname -m`"
392   AC_MSG_CHECKING([for HLT PubSub Framework release type])
393   if test -d "${with_pubsub}/lib/${HOMER_TARGET}-release" ; then
394     homer_type="production"
395     HOMER_TARGET="${HOMER_TARGET}-release"
396   elif test "x$enable_pubsub_debug" = "xyes" && test -d "${with_pubsub}/lib/${HOMER_TARGET}-debug" ; then
397     homer_type="debug"
398     HOMER_TARGET="${HOMER_TARGET}-debug"
399   fi
400   AC_MSG_RESULT([${homer_type}])
401   HOMER_BINDIR="${with_pubsub}/bin/${HOMER_TARGET}"
402   HOMER_LIBDIR="${with_pubsub}/lib/${HOMER_TARGET}"
403   HOMER_LDFLAGS="-L${HOMER_LIBDIR}"
404   CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
405   LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
406   LIBS="$save_LIBS "
407   with_homer=no
408   AC_LANG_PUSH(C++)
409   AC_CHECK_HEADER([HOMERReader.h],
410     [ AC_CHECK_LIB([HOMER],[_init],
411       [with_homer=yes
412        HOMER_LIBS="-lHOMER"],
413       [ AC_CHECK_LIB([HOMERReader],[_init],
414                      [with_homer=yes
415                       HOMER_LIBS="-lHOMERReader"])])
416       LIBS="$LIBS $HOMER_LIBS"
417       AC_MSG_CHECKING([version of HOMER library])
418       dnl The Homer library has no versioning, so we do our own
419       dnl version           description
420       dnl ----------------------------------------------------------------------
421       dnl   1          inintial version
422       dnl   2          GetBlockStatusFlags added to the interface
423       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <HOMERReader.h>],
424                                       [HOMERReader reader("dummy", 0);
425                                        reader.GetBlockStatusFlags(0);])],
426                                       [if test $HOMER_VERSION -lt 2 ; then HOMER_VERSION=2; fi],
427                                       [])
428       AC_MSG_RESULT([$HOMER_VERSION])
429   ]) #AC_CHECK_HEADER([HOMERReader.h])
430   AC_LANG_POP(C++)
431   if test "x$with_homer" = "xno" ; then
432     HOMER_CPPFLAGS=
433     HOMER_LDFLAGS=
434     HOMER_LIBS=
435   else
436     HOMER_CPPFLAGS="$HOMER_CPPFLAGS -DHOMER_VERSION=$HOMER_VERSION"
437     AC_DEFINE(HAVE_HOMERREADER)
438   fi
439   CPPFLAGS="$save_CPPFLAGS"
440   LDFLAGS="$save_LDFLAGS"
441   LIBS="$save_LIBS"  
442 fi
443 AC_SUBST([HOMER_CPPFLAGS])
444 AC_SUBST([HOMER_LDFLAGS])
445 AC_SUBST([HOMER_LIBDIR])
446 AC_SUBST([HOMER_BINDIR])
447 AC_SUBST([HOMER_LIBS])
448
449 dnl ------------------------------------------------------------------
450 AC_MSG_CHECKING([whether to impose strict coding conventions])
451 AC_ARG_ENABLE(strict,
452   [AC_HELP_STRING([--enable-strict],
453       [enable coding convention checks ])],
454   [],[enable_strict=no])
455 if test "x$enable_strict" = "xyes" ; then
456    CPPFLAGS="$CPPFLAGS -Weffc++"
457 fi
458 AC_MSG_RESULT([$enable_strict])
459
460 dnl ------------------------------------------------------------------
461 AC_MSG_CHECKING([whether to compile sample library])
462 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
463 AC_ARG_ENABLE(sample,
464   [AC_HELP_STRING([--enable-sample],
465       [compile the sample library ])],
466   [],[enable_sample=yes])
467 if test "x$enable_sample" = "xyes" ; then 
468   AC_DEFINE(HLT_SAMPLE)
469 fi
470 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
471 AC_MSG_RESULT([$enable_sample])
472
473 dnl ------------------------------------------------------------------
474 AC_MSG_CHECKING([whether to compile tpc library])
475 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
476 AC_ARG_ENABLE(tpc,
477   [AC_HELP_STRING([--enable-tpc],
478       [compile the tpc library ])],
479   [],[enable_tpc=yes])
480 if test "x$have_aliroot" = "xno" ; then
481    enable_tpc="no...requires.AliRoot"
482 elif test "x$have_alitpc" = "xno" ; then
483    enable_tpc="no...requires.AliRoot.TPC.libraries"
484 fi
485 if test "x$enable_tpc" = "xyes" ; then 
486   AC_DEFINE(HLT_TPC)
487 fi
488 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
489 AC_MSG_RESULT([$enable_tpc])
490
491 dnl ------------------------------------------------------------------
492 AC_MSG_CHECKING([whether to compile phos library])
493 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
494 AC_ARG_ENABLE(phos,
495   [AC_HELP_STRING([--enable-phos],
496       [compile the phos library ])],
497   [],[enable_phos=yes])
498 if test "x$have_aliroot" = "xno" ; then
499    enable_phos="no...requires.AliRoot"
500 elif ! test "x$have_alicalorawstream" = "xyes"; then
501    enable_phos="no...requires.AliRoot>v4-05-07"
502 fi
503 if test "x$enable_phos" = "xyes" ; then 
504   AC_DEFINE(HLT_PHOS)
505 fi
506 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
507 AC_MSG_RESULT([$enable_phos])
508
509 dnl ------------------------------------------------------------------
510 AC_MSG_CHECKING([whether to compile trd library])
511 AH_TEMPLATE([HLT_TRD],[hlt trd library])
512 AC_ARG_ENABLE(trd,
513   [AC_HELP_STRING([--enable-trd],
514       [compile the trd library ])],
515   [],[enable_trd=yes])
516 if test "x$have_aliroot" = "xno" ; then
517    enable_trd="no...requires.AliRoot"
518 fi
519 if test "x$enable_trd" = "xyes" ; then 
520   AC_DEFINE(HLT_TRD)
521 fi
522 AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
523 AC_MSG_RESULT([$enable_trd])
524
525 dnl ------------------------------------------------------------------
526 AC_MSG_CHECKING([whether to compile dimuon library])
527 AH_TEMPLATE([HLT_MUON],[hlt dimuon library])
528 AC_ARG_ENABLE(dimuon,
529   [AC_HELP_STRING([--enable-dimuon],
530       [compile the dimuon library ])],
531   [],[enable_dimuon=yes])
532 if test "x$have_aliroot" = "xno" ; then
533    enable_dimuon="no...requires.AliRoot"
534 fi
535 if test "x$enable_dimuon" = "xyes" ; then 
536   AC_DEFINE(HLT_MUON)
537 fi
538 AM_CONDITIONAL(EN_HLT_MUON, test x$enable_dimuon = xyes)
539 AC_MSG_RESULT([$enable_dimuon])
540
541 dnl ------------------------------------------------------------------
542 AC_MSG_CHECKING([whether to disable AliRoot logging])
543 AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
544 AC_ARG_ENABLE(aliroot-logging,
545   [AC_HELP_STRING([--disable-aliroot-logging],
546       [disable logging through AliRoot logging methods])],
547   [],[enable_aliroot_logging=no])
548 if test "x$enable_aliroot_logging" != "xno" ; then 
549   AC_DEFINE(NOALIROOT_LOGGING)
550 fi
551 AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
552 AC_MSG_RESULT([$enable_aliroot_logging])
553
554 dnl ------------------------------------------------------------------
555 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
556 AH_TEMPLATE([DOMC],[MC saving])
557 AC_ARG_ENABLE(mc-saving,
558   [AC_HELP_STRING([--enable-mc-saving],
559       [enable saving MC data through the chain])],
560   [],[enable_mc_saving=no])
561 if test "x$enable_mc_saving" = "xyes" ; then 
562   AC_DEFINE(DOMC)
563 fi
564 AC_MSG_RESULT([$enable_mc_saving])
565
566 dnl ------------------------------------------------------------------
567 dnl certainly something old, but we keep the define
568 AC_MSG_CHECKING([whether to use ROWHOUGH])
569 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
570 AC_ARG_ENABLE(rowhough,
571   [AC_HELP_STRING([--enable-rowhough],
572       [use ROWHOUGH ])],
573   [],[enable_rowhough=no])
574 if test "x$enable_rowhough" = "xyes" ; then 
575   AC_DEFINE(USEROWHOUGH)
576 fi
577 AC_MSG_RESULT([$enable_rowhough])
578
579 dnl ------------------------------------------------------------------
580 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
581 dnl stand-alone build system. This is most likely something old we can
582 dnl get rid off later, or do something more reasonable. Since the define
583 dnl needs the quotes they have to be  escaped. This works well for the
584 dnl Makefile but not for the configure script. So we have to add the
585 dnl defines after all the other checks.
586 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
587 if test ! "x$have_aliroot" = "xno" ; then
588   CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
589 fi
590
591 dnl ------------------------------------------------------------------
592 dnl
593 dnl Documentation
594 dnl
595 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
596 AC_PATH_PROG(PERL, perl)
597 AC_PATH_PROG(DOXYGEN, doxygen)
598 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
599 AC_ARG_ENABLE(dot,
600   [AC_HELP_STRING([--enable-dot],
601       [enable dot documentation generator])],
602   [],[enable_dot=no])
603 HAVE_DOT=NO
604 DOT_PATH=
605 AC_PATH_PROG(DOT, dot)
606 if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
607    HAVE_DOT=YES
608    DOT_PATH=`dirname $DOT`
609 fi
610 AC_SUBST([HAVE_DOT])
611 AC_SUBST([DOT_PATH])
612
613 dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
614 dnl echo $HAVE_SRC_SUBDIR
615 dnl if ! test -d $HAVE_SRC_SUBDIR; then
616 dnl   HAVE_SRC_SUBDIR=
617 dnl fi
618 dnl AC_SUBST([HAVE_SRC_SUBDIR])
619
620 dnl ------------------------------------------------------------------
621 dnl inatallation directory for libraries
622 dnl 
623 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
624 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
625 AC_MSG_NOTICE([libdir set to $libdir])
626 fi
627 dnl ------------------------------------------------------------------
628 AC_CONFIG_FILES([Makefile 
629                  BASE/Makefile
630                  BASE/setenv.sh
631                  BASE/setenv.csh
632                  BASE/util/Makefile
633                  BASE/interface/Makefile
634                  SampleLib/Makefile
635                  TPCLib/Makefile
636                  TPCLib/mapping2array.cxx
637                  TPCLib/OnlineDisplay/Makefile
638                  PHOS/Makefile
639                  TRD/Makefile
640                  MUON/Makefile
641                  doc/Makefile
642                  doc/doxygen.conf])
643
644
645 AC_OUTPUT
646 dnl
647 dnl EOF
648 dnl
649