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