]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/configure.ac
removing all library checks from the (deprecated) HLT autoconf build system to make...
[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 AC_LANG_POP(C++)
171 AC_SUBST([ALICE_ROOT])
172 AC_SUBST([ALIROOT_CPPFLAGS])
173 AC_SUBST([ALIROOT_LDFLAGS])
174 AC_SUBST([ALIROOTBINDIR])
175 AC_SUBST([ALIROOTLIBDIR])
176
177 ALIROOT_LIBS="$ALIROOT_LIBS $ADD_ROOTLIBS"
178 AC_SUBST([ALIROOT_LIBS])
179 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
180
181 HLTBASE_CPPFLAGS='-I${top_srcdir}/BASE'
182 HLTBASE_LDFLAGS=
183 AC_SUBST([HLTBASE_CPPFLAGS])
184 AC_SUBST([HLTBASE_LDFLAGS])
185
186 dnl ------------------------------------------------------------------
187 AC_ARG_ENABLE(all,
188   [AC_HELP_STRING([--disable-all],
189       [disable all detector modules, individual modules can be switched on by --enable-det])],
190   [disable_all=yes],[])
191
192 dnl ------------------------------------------------------------------
193 AC_MSG_CHECKING([whether to impose strict coding conventions])
194 AC_ARG_ENABLE(strict,
195   [AC_HELP_STRING([--disable-strict],
196       [disable coding convention checks ])],
197   [],[enable_strict=yes])
198 if test "x$enable_strict" = "xyes" ; then
199    CPPFLAGS="$CPPFLAGS -W -Weffc++ -Wall -Wshadow"
200 fi
201 AC_MSG_RESULT([$enable_strict])
202
203 dnl ------------------------------------------------------------------
204 AC_MSG_CHECKING([whether to enable component statistics])
205 AC_ARG_ENABLE(component-stat,
206   [AC_HELP_STRING([--enable-component-stat],
207       [enable component statistics ])],
208   [],[])
209
210 dnl enable component statistics if not explicitely disabled
211 if test "x$enable_component_stat" != "xno" &&
212    test "x$enable_debug" = "xyes" ; then
213    enable_component_stat=yes.debug
214 fi
215
216 if test "x$enable_component_stat" = "x" ; then
217    enable_component_stat=no
218 fi
219
220 if test "x$enable_component_stat" != "xno" ; then
221    AC_DEFINE(HLT_COMPONENT_STATISTICS)
222 fi
223 AC_MSG_RESULT([$enable_component_stat])
224
225 dnl ------------------------------------------------------------------
226 dnl ----  module checks
227 dnl ------------------------------------------------------------------
228 save_CPPFLAGS=$CPPFLAGS
229 save_LDFLAGS=$LDFLAGS
230 save_LIBS=$LIBS
231
232 dnl ------------------------------------------------------------------
233 AC_MSG_NOTICE([-------------------------------------------------])
234 AC_MSG_NOTICE([checking dependencies for HLTbase library])
235 HLTBASE_CHECKLIBS='XMLParser'
236 for CHECKLIB in $HLTBASE_CHECKLIBS ; do
237   LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR}"
238   LIBS="$save_LIBS $ROOTLIBS $ALIHLTBASE_LIBS"
239   AC_CHECK_LIB([$CHECKLIB],[_init], [ALIHLTBASE_LIBS="$ALIHLTBASE_LIBS -l$CHECKLIB"])
240 done
241 AC_SUBST([ALIHLTBASE_LIBS])
242
243 dnl ------------------------------------------------------------------
244 AC_MSG_CHECKING([whether to compile sample library])
245 AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
246 AC_ARG_ENABLE(sample,
247   [AC_HELP_STRING([--disable-sample],
248       [compile the sample library ])],
249   [],
250   [if test "x$have_aliroot" = "xno" ; then
251      enable_sample="no...requires.AliRoot"
252    else
253      enable_sample=yes
254    fi
255   ])
256
257 if test "x$enable_sample" = "xyes" ; then 
258   AC_DEFINE(HLT_SAMPLE)
259 fi
260 AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
261 AC_MSG_RESULT([$enable_sample])
262
263 dnl ------------------------------------------------------------------
264 AH_TEMPLATE([HLT_UTIL],[HLT utility library])
265 ALIUTIL_LIBS=
266 CHECK_HLTMODULE([util],
267                 [], 
268                 [],
269                 [], [], [],
270                 [], [], 
271                 [])
272
273 if test "x$enable_module" = "xmissheader"; then
274   enable_module="no...missing.headers"
275   enable_util=$enable_module
276 elif test "x$enable_module" = "xforce"; then
277   enable_util="yes"
278 else
279   enable_util=$enable_module
280 fi
281 if test "x$enable_util" = "xyes" ; then 
282   AC_DEFINE(HLT_UTIL)
283   ALIUTIL_LIBS=$ALIHLTMODULE_LIBS
284 fi
285 AM_CONDITIONAL(EN_HLT_UTIL, test x$enable_util = xyes)
286 AC_MSG_CHECKING([whether to compile Util library])
287 AC_MSG_RESULT([$enable_module])
288 AC_SUBST([ALIUTIL_LIBS])
289
290 dnl ------------------------------------------------------------------
291 AH_TEMPLATE([HLT_TPC],[hlt tpc library])
292
293 ALITPC_LIBS=
294 CHECK_HLTMODULE([tpc],
295                 [], 
296                 [],
297                 [], [], [],
298                 [], [], 
299                 [])
300
301 if test "x$enable_module" = "xmissheader"; then
302   enable_module="no...missing.headers"
303   enable_tpc=$enable_module
304 elif test "x$enable_module" = "xforce"; then
305   enable_tpc="yes"
306 else
307   enable_tpc=$enable_module
308 fi
309
310 if test "x$enable_tpc" = "xyes" ; then 
311   AC_LANG_PUSH(C++)
312   AC_DEFINE(HLT_TPC)
313   ALITPC_LIBS=$ALIHLTMODULE_LIBS
314   dnl
315   dnl Check for functionality in the TPC reconstruction required for online
316   dnl processing
317   dnl 
318   have_tpc_hltoffline_rec=no
319   AC_MSG_CHECKING(for on-line features of TPC offline reconstruction)
320     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
321     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
322     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
323     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliTPCtrackerMI.h>
324                                        #include <AliTPCclustererMI.h>   
325                                        #include <TObjArray.h>], 
326                                     [AliTPCtrackerMI tracker;
327                                        TObjArray* array=NULL;
328                                        tracker.LoadClusters(array);
329                                        AliTPCclustererMI cl(NULL, NULL);
330                                        cl.GetOutputClonesArray();])],
331                                     [have_tpc_hltoffline_rec=yes], 
332                                       [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)])
333   AC_MSG_RESULT([$have_tpc_hltoffline_rec])
334
335     have_alitpcclusterparam_r40128=no
336     AC_MSG_CHECKING([checking for AliTPCClusterParam r40128])
337     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AliTPCClusterParam.h>], 
338                                        [AliTPCClusterParam param;
339                                           float test=param.ParamS0Par(0,0,0)]);],
340                                        [have_alitpcclusterparam_r40128=yes],
341                                          [AC_DEFINE(HAVE_NOT_ALITPCCLUSTERPARAM_r40128)])
342     AC_MSG_RESULT([$have_alitpcclusterparam_r40128])
343
344     LIBS=$save_LIBS
345
346
347   AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])
348   AC_CHECK_HEADER([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)])
349   AC_CHECK_HEADER([AliAltroRawStreamV3.h], [], [AC_DEFINE(HAVE_NOT_ALTRORAWSTREAMV3)])
350
351   have_tpc_mapping=no
352   if test ! "x$have_aliroot" = "xno" ; then
353     # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC 
354     # which is stored in the TPC/mapping/Patchx.data files from
355     # AliRoot version v4-04-Release (May 2006)
356     AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
357     TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
358     AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], 
359                    [have_tpc_mapping=yes
360                     AC_SUBST(TPC_PAD_MAPPING_PATH)
361                     AC_DEFINE(HAVE_TPC_MAPPING)],
362                    [])
363     
364   fi
365   AC_MSG_CHECKING([for TPC mapping layout])
366   AC_MSG_RESULT([$have_tpc_mapping])
367   AC_LANG_POP(C++)
368
369 else
370   enable_module=$enable_tpc
371 fi
372 AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
373 AC_MSG_CHECKING([whether to compile TPC library])
374 AC_MSG_RESULT([$enable_module])
375 AC_SUBST([ALITPC_LIBS])
376
377 dnl ------------------------------------------------------------------
378 AH_TEMPLATE([HLT_RCU],[hlt rcu library])
379
380 CHECK_HLTMODULE([rcu],
381                 [], 
382                 [],
383                 [], [], [],
384                 [], [], 
385                 [])
386
387 if test "x$enable_module" = "xmissheader"; then
388   enable_module="no...missing.headers"
389   enable_rcu=$enable_module
390 elif test "x$enable_module" = "xforce"; then
391   enable_rcu="yes"
392 else
393   enable_rcu=$enable_module
394 fi
395
396 if test "x$enable_rcu" = "xyes" ; then 
397   AC_DEFINE(HLT_RCU)
398 else
399   enable_module=$enable_rcu
400 fi
401 AM_CONDITIONAL(EN_HLT_RCU, test x$enable_rcu = xyes)
402 AC_MSG_CHECKING([whether to compile RCU library])
403 AC_MSG_RESULT([$enable_module])
404 AC_SUBST([ALIRCU_LIBS])
405
406 dnl ------------------------------------------------------------------
407 AH_TEMPLATE([HLT_CALO],[hlt calo(rimeter) library])
408   
409 ALICALO_LIBS=
410 CHECK_HLTMODULE([calo],
411                 [], [],
412                 [], [], [],
413                 [], [], 
414                 [])
415
416 if test "x$enable_module" = "xmissheader"; then
417   enable_module="no...missing.headers"
418   enable_calo=$enable_module
419 elif test "x$enable_module" = "xforce"; then
420   enable_calo="yes"
421 else
422     enable_calo=$enable_module
423 fi
424
425 if test "x$enable_calo" = "xyes" ; then 
426   AC_DEFINE(HLT_CALO)
427   ALICALO_LIBS=$ALIHLTMODULE_LIBS
428 else
429   enable_module=$enable_calo
430 fi
431 AM_CONDITIONAL(EN_HLT_CALO, test x$enable_calo = xyes)
432 AC_MSG_CHECKING([whether to compile CALO library])
433 AC_MSG_RESULT([$enable_module])
434 AC_SUBST([ALICALO_LIBS])
435
436 dnl ------------------------------------------------------------------
437 AH_TEMPLATE([HLT_PHOS],[hlt phos library])
438   
439 ALIPHOS_LIBS=
440 CHECK_HLTMODULE([phos],
441                 [], [],
442                 [], [], [],
443                 [], [], 
444                 [])
445
446 if test "x$enable_module" = "xmissheader"; then
447   enable_module="no...requires.AliRoot>v4-05-07"
448   enable_phos=$enable_module
449 elif test "x$enable_module" = "xforce"; then
450   enable_phos="yes"
451 else
452     enable_phos=$enable_module
453 fi
454
455 if test "x$enable_phos" = "xyes" ; then 
456   AC_DEFINE(HLT_PHOS)
457   ALIPHOS_LIBS=$ALIHLTMODULE_LIBS
458 else
459   enable_module=$enable_phos
460 fi
461 AM_CONDITIONAL(EN_HLT_PHOS, test x$enable_phos = xyes)
462 AC_MSG_CHECKING([whether to compile PHOS library])
463 AC_MSG_RESULT([$enable_module])
464 AC_SUBST([ALIPHOS_LIBS])
465
466 dnl ------------------------------------------------------------------
467 AH_TEMPLATE([HLT_EMCAL],[hlt emcal library])
468
469 ALIEMCAL_LIBS=
470 CHECK_HLTMODULE([emcal],
471                 [], [],
472                 [], [], [],
473                 [], [], 
474                 [])
475
476 if test "x$enable_module" = "xmissheader"; then
477   enable_module="no...header.missing"
478   enable_emcal=$enable_module
479 elif test "x$enable_module" = "xforce"; then
480   enable_emcal="yes"
481 else
482   enable_emcal=$enable_module
483 fi
484
485 if test "x$enable_emcal" = "xyes" ; then 
486   AC_DEFINE(HLT_EMCAL)
487   ALIEMCAL_LIBS=$ALIHLTMODULE_LIBS
488 else
489   enable_module=$enable_emcal
490 fi
491 AM_CONDITIONAL(EN_HLT_EMCAL, test x$enable_emcal = xyes)
492 AC_MSG_CHECKING([whether to compile EMCAL library])
493 AC_MSG_RESULT([$enable_module])
494 AC_SUBST([ALIEMCAL_LIBS])
495
496 dnl ------------------------------------------------------------------
497 AH_TEMPLATE([HLT_TRD],[hlt trd library])
498   
499 ALITRD_LIBS=
500 CHECK_HLTMODULE([trd],
501                 [], [],
502                 [], [], [],
503                 [], [], 
504                 [])
505
506 if test "x$enable_module" = "xmissheader"; then
507   enable_module="no...requires.AliRoot>v4-07-Release"
508   enable_trd=$enable_module
509 elif test "x$enable_module" = "xforce"; then
510   enable_trd="yes"
511 else
512   enable_trd=$enable_module
513 fi
514
515 if test "x$enable_trd" = "xyes" ; then 
516   AC_DEFINE(HLT_TRD)
517   ALITRD_LIBS=$ALIHLTMODULE_LIBS
518 else
519   enable_module=$enable_trd
520 fi
521 AM_CONDITIONAL(EN_HLT_TRD, test x$enable_trd = xyes)
522 AC_MSG_CHECKING([whether to compile TRD library])
523 AC_MSG_RESULT([$enable_module])
524 AC_SUBST([ALITRD_LIBS])
525
526 dnl ------------------------------------------------------------------
527 AH_TEMPLATE([HLT_FMD],[hlt fmd library])
528
529 ALIFMD_LIBS=$ALIHLTMODULE_LIBS
530 CHECK_HLTMODULE([fmd],
531                 [], [],
532                 [], [], [],
533                 [], [],
534                 [])
535
536 if test "x$enable_module" = "xmissheader"; then
537   enable_module="no...missing.headers"
538   enable_fmd=$enable_module
539 elif test "x$enable_module" = "xforce"; then
540   enable_fmd="yes"
541 else
542   enable_fmd=$enable_module
543 fi
544
545 if test "x$enable_fmd" = "xyes" ; then
546   AC_DEFINE(HLT_FMD)
547   ALIFMD_LIBS=$ALIHLTMODULE_LIBS
548 else
549   enable_module=$enable_fmd
550 fi
551 AM_CONDITIONAL(EN_HLT_FMD, test x$enable_fmd = xyes)
552 AC_MSG_CHECKING([whether to compile FMD library])
553 AC_MSG_RESULT([$enable_module])
554 AC_SUBST([ALIFMD_LIBS])
555
556 dnl ------------------------------------------------------------------
557 AH_TEMPLATE([HLT_ZDC],[hlt zdc library])
558
559 ALIZDC_LIBS=$ALIHLTMODULE_LIBS
560 CHECK_HLTMODULE([zdc],
561                 [], [],
562                 [], [], [],
563                 [], [],
564                 [])
565
566 if test "x$enable_module" = "xmissheader"; then
567   enable_module="no...missing.headers"
568   enable_zdc=$enable_module
569 elif test "x$enable_module" = "xforce"; then
570   enable_zdc="yes"
571 else
572   enable_zdc=$enable_module
573 fi
574
575 if test "x$enable_zdc" = "xyes" ; then
576   AC_DEFINE(HLT_ZDC)
577   ALIZDC_LIBS=$ALIHLTMODULE_LIBS
578 else
579   enable_module=$enable_zdc
580 fi
581 AM_CONDITIONAL(EN_HLT_ZDC, test x$enable_zdc = xyes)
582 AC_MSG_CHECKING([whether to compile ZDC library])
583 AC_MSG_RESULT([$enable_module])
584 AC_SUBST([ALIZDC_LIBS])
585
586 dnl ------------------------------------------------------------------
587 AH_TEMPLATE([HLT_MUON],[hlt dimuon library])
588
589 ALIMUON_LIBS=
590 CHECK_HLTMODULE([dimuon],
591                 [], 
592                 [],
593                 [], [], [],
594                 [], [], 
595                 [])
596
597 if test "x$enable_module" = "xmissheader"; then
598   enable_module="no...requires.AliRoot>=v4-08-Release"
599   enable_muon=$enable_module
600 elif test "x$enable_module" = "xforce"; then
601   enable_muon="yes"
602 else
603   enable_muon=$enable_module
604 fi
605
606 if test "x$enable_muon" = "xyes" ; then 
607   AC_DEFINE(HLT_MUON)
608   ALIMUON_LIBS=$ALIHLTMODULE_LIBS
609   AC_LANG_PUSH(C++)
610   save_CPPFLAGS="$CPPFLAGS"
611
612   dnl
613   dnl Check for functionality GetRawStream AliMUONDigitMaker.h
614   dnl 
615   have_muon_digitmaker_getrawstream=no
616   AC_MSG_CHECKING(for GetRawStream methods of AliMUONDigitMaker)
617     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON"
618     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
619     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
620     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMUONDigitMaker.h>], 
621                                     [AliMUONDigitMaker dm;
622                                        dm.GetRawStreamTracker();])],
623                                     [have_muon_digitmaker_getrawstream=yes], 
624                                       [AC_DEFINE(HAVE_NOT_MUON_DIGITMAKER_GETRAWSTREAM)])
625     LIBS=$save_LIBS
626   AC_MSG_RESULT([$have_muon_digitmaker_getrawstream])
627
628   dnl
629   dnl Check for AliMpPad::GetPositionX/Y
630   dnl change of implementation in MUON code
631   dnl revision 31769, Wed Apr 1 2009
632   dnl 
633   have_muon_alimppad_getposition=no
634   AC_MSG_CHECKING(for GetPosition methods of AliMpPad)
635     CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/MUON/mapping"
636     LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
637     LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALIMUON_LIBS"
638     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliMpPad.h>], 
639                                     [AliMpPad pad;
640                                      pad.GetPositionX();])],
641                                     [have_muon_alimppad_getposition=yes], 
642                                       [AC_DEFINE(HAVE_NOT_MUON_ALIMPPAD_GETPOSITION)])
643     LIBS=$save_LIBS
644   AC_MSG_RESULT([$have_muon_alimppad_getposition])
645
646   CPPFLAGS="$save_CPPFLAGS"
647
648   AC_LANG_POP(C++)
649 else
650   enable_module=$enable_muon
651 fi
652 AM_CONDITIONAL(EN_HLT_MUON, test x$enable_muon = xyes)
653 AC_MSG_CHECKING([whether to compile MUON library])
654 AC_MSG_RESULT([$enable_module])
655 AC_SUBST([ALIMUON_LIBS])
656
657 dnl ------------------------------------------------------------------
658 AH_TEMPLATE([HLT_TRIGGER],[hlt trigger library])
659
660 ALITRIGGER_LIBS=
661 CHECK_HLTMODULE([trigger],
662                 [], [],
663                 [], [], [],
664                 [], [], 
665                 [])
666
667 if test "x$enable_module" = "xmissheader"; then
668   enable_module="no...header.missing"
669   enable_trigger=$enable_module
670 elif test "x$enable_module" = "xforce"; then
671   enable_trigger="yes"
672 else
673   enable_trigger=$enable_module
674 fi
675
676 if test "x$enable_trigger" = "xyes" ; then 
677   AC_DEFINE(HLT_TRIGGER)
678   ALITRIGGER_LIBS=$ALIHLTMODULE_LIBS
679 else
680   enable_module=$enable_trigger
681 fi
682 AM_CONDITIONAL(EN_HLT_TRIGGER, test x$enable_trigger = xyes)
683 AC_MSG_CHECKING([whether to compile Trigger library])
684 AC_MSG_RESULT([$enable_module])
685 AC_SUBST([ALITRIGGER_LIBS])
686
687 dnl ------------------------------------------------------------------
688 AH_TEMPLATE([HLT_GLOBAL],[hlt global library])
689
690 ALIGLOBAL_LIBS=
691 CHECK_HLTMODULE([global],
692                 [], [],
693                 [], [], [],
694                 [], [], 
695                 [])
696
697 if test "x$enable_module" = "xmissheader"; then
698   enable_module="no...header.missing"
699   enable_global=$enable_module
700 elif test "x$enable_module" = "xforce"; then
701   enable_global="yes"
702 else
703   enable_global=$enable_module
704 fi
705
706 if test "x$enable_global" = "xyes" ; then 
707   AC_DEFINE(HLT_GLOBAL)
708   ALIGLOBAL_LIBS=$ALIHLTMODULE_LIBS
709 else
710   enable_module=$enable_global
711 fi
712 AM_CONDITIONAL(EN_HLT_GLOBAL, test x$enable_global = xyes)
713 AC_MSG_CHECKING([whether to compile Global library])
714 AC_MSG_RESULT([$enable_module])
715 AC_SUBST([ALIGLOBAL_LIBS])
716
717 dnl ------------------------------------------------------------------
718 AH_TEMPLATE([HLT_JET],[hlt jet library])
719
720 ALIFASTJET_HEADER=
721 ALIFASTJET_INCFLAGS=
722 ALIFASTJET_LIBS=
723 ALIFASTJET_LDFLAGS=
724 AC_ARG_WITH(fastjet, [installation path of the FASTJET package],
725                      [ test "x$with_fastjet" != "xno" && export FASTJET=$with_fastjet],
726                      [ test -n $FASTJET && with_fastjet=$FASTJET ])
727
728 if test "x$with_fastjet" != "x" && test "x$with_fastjet" != "xno" ; then
729   ALIFASTJET_INCFLAGS="-I${with_fastjet}/include"
730   ALIFASTJET_HEADER="fastjet/PseudoJet.hh"
731   ALIFASTJET_LDFLAGS="-L${with_fastjet}/lib"
732   ALIFASTJET_LIBS="CGAL fastjet"
733 else
734   with_fastjet=no
735 fi
736
737 CHECK_HLTMODULE([jet],
738         [], [],
739         [], [], [],
740         [], 
741         [],
742         [])
743
744 if test "x$enable_module" = "xmissheader"; then
745   enable_module="no...header.missing"
746   enable_jet=$enable_module
747 elif test "x$enable_module" = "xforce"; then
748   enable_jet="yes"
749 else
750   enable_jet=$enable_module
751 fi
752
753 if test "x$enable_jet" = "xyes" ; then
754   AC_DEFINE(HLT_JET)
755   ALIJET_LIBS="$ALIHLTMODULE_LIBS"
756   
757   if test "x$with_fastjet" != "xno"; then
758      AC_DEFINE(HAVE_FASTJET)
759      AC_DEFINE(WITHFASTJET)
760      ALIJET_LIBS="$ALIJET_LIBS $FASTJET_LDFLAGS"
761   fi
762   AC_MSG_CHECKING([compilation with FASTJET package])
763   AC_MSG_RESULT($with_fastjet)
764
765 else
766   enable_module=$enable_jet
767 fi
768
769 AM_CONDITIONAL(EN_HLT_JET, test x$enable_jet = xyes)
770 AC_MSG_CHECKING([whether to compile Jet library])
771 AC_MSG_RESULT([$enable_module])
772 AC_SUBST([ALIJET_LIBS])
773
774 dnl ------------------------------------------------------------------
775 AH_TEMPLATE([HLT_VZERO],[hlt vzero library])
776
777 ALIVZERO_LIBS=
778 CHECK_HLTMODULE([vzero],
779                 [], [],
780                 [], [], [],
781                 [], [], 
782                 [])
783
784 if test "x$enable_module" = "xmissheader"; then
785   enable_module="no...header.missing"
786   enable_vzero=$enable_module
787 elif test "x$enable_module" = "xforce"; then
788   enable_vzero="yes"
789 else
790   enable_vzero=$enable_module
791 fi
792
793 if test "x$enable_vzero" = "xyes" ; then 
794   AC_DEFINE(HLT_VZERO)
795   ALIVZERO_LIBS=$ALIHLTMODULE_LIBS
796 else
797   enable_module=$enable_vzero
798 fi
799 AM_CONDITIONAL(EN_HLT_VZERO, test x$enable_vzero = xyes)
800 AC_MSG_CHECKING([whether to compile VZERO library])
801 AC_MSG_RESULT([$enable_module])
802 AC_SUBST([ALIVZERO_LIBS])
803
804 dnl ------------------------------------------------------------------
805 AH_TEMPLATE([HLT_ITS],[hlt its library])
806
807 ALIITS_LIBS=
808 CHECK_HLTMODULE([its],
809                 [], [],
810                 [], [], [],
811                 [], [], 
812                 [])
813
814 if test "x$enable_module" = "xmissheader"; then
815   enable_module="no...header.missing"
816   enable_its=$enable_module
817 elif test "x$enable_module" = "xforce"; then
818   enable_its="yes"
819 else
820   enable_its=$enable_module
821 fi
822
823 if test "x$enable_its" = "xyes" ; then 
824   AC_DEFINE(HLT_ITS)
825   ALIITS_LIBS=$ALIHLTMODULE_LIBS
826 else
827   enable_module=$enable_its
828 fi
829 AM_CONDITIONAL(EN_HLT_ITS, test x$enable_its = xyes)
830 AC_MSG_CHECKING([whether to compile ITS library])
831 AC_MSG_RESULT([$enable_module])
832 AC_SUBST([ALIITS_LIBS])
833
834 dnl ------------------------------------------------------------------
835 AH_TEMPLATE([HLT_COMP],[hlt comp library])
836
837 ALICOMP_LIBS=
838 CHECK_HLTMODULE([comp],
839                 [], [],
840                 [], [], [],
841                 [], [], 
842                 [])
843
844 if test "x$enable_module" = "xmissheader"; then
845   enable_module="no...header.missing"
846   enable_comp=$enable_module
847 elif test "x$enable_module" = "xforce"; then
848   enable_comp="yes"
849 else
850   enable_comp=$enable_module
851 fi
852
853 if test "x$enable_comp" = "xyes" ; then 
854   AC_DEFINE(HLT_COMP)
855   ALICOMP_LIBS=$ALIHLTMODULE_LIBS
856 else
857   enable_module=$enable_comp
858 fi
859 AM_CONDITIONAL(EN_HLT_COMP, test x$enable_comp = xyes)
860 AC_MSG_CHECKING([whether to compile comp library])
861 AC_MSG_RESULT([$enable_module])
862 AC_SUBST([ALICOMP_LIBS])
863
864 dnl ------------------------------------------------------------------
865 AC_MSG_CHECKING([whether to disable AliRoot logging])
866 AH_TEMPLATE([NOALIROOT_LOGGING],[disable AliRoot logging])
867 AC_ARG_ENABLE(aliroot-logging,
868   [AC_HELP_STRING([--disable-aliroot-logging],
869       [disable logging through AliRoot logging methods])],
870   [],[enable_aliroot_logging=no])
871 if test "x$have_aliroot" = "xno" ; then
872   enable_aliroot_logging=yes # this means 'disable'
873 fi
874 if test "x$enable_aliroot_logging" != "xno" ; then 
875   AC_DEFINE(NOALIROOT_LOGGING)
876 fi
877 AM_CONDITIONAL(NOALIROOT_LOGGING, test x$enable_aliroot_logging != no)
878 AC_MSG_RESULT([$enable_aliroot_logging])
879
880 dnl ------------------------------------------------------------------
881 AC_MSG_CHECKING([whether to enable saving MC data through the chain])
882 AH_TEMPLATE([DOMC],[MC saving])
883 AC_ARG_ENABLE(mc-saving,
884   [AC_HELP_STRING([--enable-mc-saving],
885       [enable saving MC data through the chain])],
886   [],[enable_mc_saving=no])
887 if test "x$enable_mc_saving" = "xyes" ; then 
888   AC_DEFINE(DOMC)
889 fi
890 AC_MSG_RESULT([$enable_mc_saving])
891
892 dnl ------------------------------------------------------------------
893 dnl certainly something old, but we keep the define
894 AC_MSG_CHECKING([whether to use ROWHOUGH])
895 AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
896 AC_ARG_ENABLE(rowhough,
897   [AC_HELP_STRING([--enable-rowhough],
898       [use ROWHOUGH ])],
899   [],[enable_rowhough=no])
900 if test "x$enable_rowhough" = "xyes" ; then 
901   AC_DEFINE(USEROWHOUGH)
902 fi
903 AC_MSG_RESULT([$enable_rowhough])
904
905 dnl ------------------------------------------------------------------
906 dnl The ROOTVERSION and ALIROOTVERSION defines were used by the old
907 dnl stand-alone build system. This is most likely something old we can
908 dnl get rid off later, or do something more reasonable. Since the define
909 dnl needs the quotes they have to be  escaped. This works well for the
910 dnl Makefile but not for the configure script. So we have to add the
911 dnl defines after all the other checks.
912 CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
913 if test ! "x$have_aliroot" = "xno" ; then
914   CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
915 fi
916
917 dnl ------------------------------------------------------------------
918 dnl
919 dnl Documentation
920 dnl
921 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
922 AC_PATH_PROG(PERL, perl)
923 AC_PATH_PROG(DOXYGEN, doxygen)
924 AC_ARG_ENABLE(dot,
925   [AC_HELP_STRING([--enable-dot],
926       [enable dot documentation generator])],
927   [],[enable_dot=no])
928 HAVE_DOT=NO
929 DOT_PATH=
930 AC_PATH_PROG(DOT, dot)
931 if test "x$DOT" != "x" && test "x$enable_dot" = "xyes" ; then
932    HAVE_DOT=YES
933    DOT_PATH=`dirname $DOT`
934 fi
935
936 AC_MSG_CHECKING([for documentation mode])
937 AC_ARG_ENABLE(doc,
938   [AC_HELP_STRING([--disable-doc],
939       [disable documentation build; monolithic build --enable-doc=mono ])],
940   [],[enable_doc=modules])
941
942 if test "x$DOXYGEN" = "x" ; then
943    enable_doc=no.doxygen
944 elif test "x$enable_doc" = "xyes" ; then
945    enable_doc=yes
946 elif test ! "x$enable_doc" = "xmono" && \
947      test ! "x$enable_doc" = "xmodules"  && \
948      test ! "x$enable_doc" = "xno"; then
949    enable_doc=no
950    AC_MSG_WARN([unknown option])
951 fi
952 if test "x$enable_doc" = "xno" ; then
953    enable_doc=off
954    DOXYGEN=
955 fi
956
957 AC_MSG_RESULT([$enable_doc])
958 AM_CONDITIONAL(MONOLITHIC_DOC, test "x$enable_doc" = "xmono")
959 AM_CONDITIONAL(BUILD_DOC, test ! "x$DOXYGEN" = "x")
960 AC_SUBST([HAVE_DOT])
961 AC_SUBST([DOT_PATH])
962
963 dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
964 dnl echo $HAVE_SRC_SUBDIR
965 dnl if ! test -d $HAVE_SRC_SUBDIR; then
966 dnl   HAVE_SRC_SUBDIR=
967 dnl fi
968 dnl AC_SUBST([HAVE_SRC_SUBDIR])
969
970 dnl ------------------------------------------------------------------
971 AC_MSG_NOTICE([---------------------------------------------- ])
972 AC_MSG_NOTICE([                build summary                  ])
973 AC_MSG_NOTICE([---------------------------------------------- ])
974
975 AC_CONFIG_FILES([Makefile 
976                  BASE/Makefile
977                  BASE/setenv.sh
978                  BASE/setenv.csh
979                  BASE/HOMER/Makefile
980                  BASE/util/Makefile
981                  BASE/util/test/Makefile
982                  BASE/interface/Makefile
983                  BASE/test/Makefile
984                  BASE/interface/test/Makefile
985                  doc/Makefile
986                  doc/doxygen.conf
987                  doc/doxymodule.conf])
988
989 dnl AliRoot and installation directory for libraries
990 dnl 
991 AC_MSG_NOTICE([AliRoot: $have_aliroot])
992 AM_CONDITIONAL(HAVE_ALIROOT, test "x$have_aliroot" != "xno" )
993 if test "x$have_aliroot" != "xno"; then 
994   AC_CONFIG_FILES([sim/Makefile  
995                    rec/Makefile  
996                    rec/test/Makefile     
997                    rec/startAliEVE-barrel-tracks.sh
998                    shuttle/Makefile
999                    pendolino/Makefile
1000                    benchmark/Makefile
1001                    QA/Makefile
1002                    ])
1003 fi
1004 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
1005 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
1006 AC_MSG_NOTICE([libdir set to $libdir])
1007 fi
1008
1009 AC_MSG_NOTICE([compile sample library: $enable_sample])
1010 if test "x$enable_sample" = "xyes"; then 
1011   AC_CONFIG_FILES([SampleLib/Makefile])
1012 fi
1013
1014 AC_MSG_NOTICE([compile RCU library: $enable_rcu])
1015 if test "x$enable_rcu" = "xyes"; then 
1016   AC_CONFIG_FILES([RCU/Makefile
1017                    RCU/test/Makefile
1018                    ])
1019 fi
1020
1021 AC_MSG_NOTICE([compile TPC library: $enable_tpc])
1022 if test "x$enable_tpc" = "xyes"; then 
1023   AC_CONFIG_FILES([TPCLib/Makefile            
1024                    TPCLib/test/Makefile       
1025                    TPCLib/mapping2array.cxx     
1026                    TPCLib/EVE/Makefile
1027                    TPCLib/calibration/Makefile
1028                    ])
1029 fi
1030
1031 AC_MSG_NOTICE([compile CALO library: $enable_calo])
1032 if test "x$enable_calo" = "xyes"; then 
1033   AC_CONFIG_FILES([CALO/Makefile
1034                    CALO/test/Makefile])
1035 fi
1036
1037 AC_MSG_NOTICE([compile PHOS library: $enable_phos])
1038 if test "x$enable_phos" = "xyes"; then 
1039   AC_CONFIG_FILES([PHOS/Makefile])
1040 fi
1041
1042 AC_MSG_NOTICE([compile EMCAL library: $enable_emcal])
1043 if test "x$enable_emcal" = "xyes"; then 
1044   AC_CONFIG_FILES([EMCAL/Makefile])
1045 fi
1046
1047 AC_MSG_NOTICE([compile TRD library: $enable_trd])
1048 if test "x$enable_trd" = "xyes"; then 
1049   AC_CONFIG_FILES([TRD/Makefile])
1050 fi
1051
1052 AC_MSG_NOTICE([compile FMD library: $enable_fmd])
1053 if test "x$enable_fmd" = "xyes"; then 
1054   AC_CONFIG_FILES([FMD/Makefile])
1055 fi
1056
1057 AC_MSG_NOTICE([compile ZDC library: $enable_zdc])
1058 if test "x$enable_zdc" = "xyes"; then 
1059   AC_CONFIG_FILES([ZDC/Makefile])
1060 fi
1061
1062 AC_MSG_NOTICE([compile MUON library: $enable_muon])
1063 if test "x$enable_muon" = "xyes"; then 
1064   AC_CONFIG_FILES([MUON/Makefile])
1065 fi
1066
1067 AC_MSG_NOTICE([compile ITS library: $enable_its])
1068 if test "x$enable_its" = "xyes"; then 
1069   AC_CONFIG_FILES([ITS/Makefile])
1070 fi
1071
1072 AC_MSG_NOTICE([compile trigger library: $enable_trigger])
1073 if test "x$enable_trigger" = "xyes"; then 
1074   AC_CONFIG_FILES([trigger/Makefile
1075                    trigger/test/Makefile])
1076 fi
1077
1078 AC_MSG_NOTICE([compile global library: $enable_global])
1079 if test "x$enable_global" = "xyes"; then 
1080   AC_CONFIG_FILES([global/Makefile])
1081 fi
1082
1083 AC_MSG_NOTICE([compile jet library: $enable_jet])
1084 if test "x$enable_jet" = "xyes"; then 
1085   AC_CONFIG_FILES([JET/Makefile])
1086 fi
1087
1088 AC_MSG_NOTICE([compile vzero library: $enable_vzero])
1089 if test "x$enable_vzero" = "xyes"; then 
1090   AC_CONFIG_FILES([VZERO/Makefile])
1091 fi
1092
1093 AC_MSG_NOTICE([compile comp library: $enable_comp])
1094 if test "x$enable_comp" = "xyes"; then 
1095   AC_CONFIG_FILES([comp/Makefile])
1096 fi
1097
1098 AC_OUTPUT
1099 dnl
1100 dnl EOF
1101 dnl
1102