Introduction of so called symbolic names used to identify the alignable volumes ...
[u/mrichter/AliRoot.git] / HLT / configure.ac
CommitLineData
b521659f 1dnl -*- mode: autoconf -*-
2dnl
3dnl $Id$
4dnl template for the configuration script for the Alice HLT
5dnl framework and components
6dnl
7dnl ------------------------------------------------------------------
4a6b4894 8AC_INIT([Alice High Level Trigger] , [0.4], [Matthias.Richter@ift.uib.no], alice-hlt)
b521659f 9
10dnl ------------------------------------------------------------------
11dnl the package from CVS contains the old Makefiles as well. In order to
12dnl prevent them from becoming overwritten, we require a separate build
13dnl directory
14if test "`dirname $0`" = "." ; then
15 AC_ERROR([please run the script from a separate build directory])
16fi
17
18dnl ------------------------------------------------------------------
19AC_CANONICAL_SYSTEM
20AC_PREFIX_DEFAULT(${PWD})
21AC_CONFIG_SRCDIR(BASE/AliHLTComponent.cxx)
22AM_INIT_AUTOMAKE
23AC_PROG_CC
24AC_PROG_CXX
25AC_PROG_LIBTOOL
26
27AC_DEBUG
28AC_OPTIMIZATION
29
30dnl ------------------------------------------------------------------
31dnl
32dnl Check for ROOT
33dnl
34ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
35AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
36
37dnl ------------------------------------------------------------------
38# TODO: make this configurable through arguments
39#Define whether you want to run with ALIROOT or only ROOT
40AH_TEMPLATE([ALIHLT_USEPACKAGE],[running environment])
41ALIHLT_USEPACKAGE=ALIROOT
42#ALIHLT_USEPACKAGE=ROOT
43#ALIHLT_USEPACKAGE=STANDALONE
44AC_DEFINE(use_aliroot)
45AC_DEFINE(use_root)
85869391 46CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
85869391 47
48dnl ------------------------------------------------------------------
74c73e5a 49dnl check for AliRoot features
50AC_LANG_PUSH(C++)
51AC_MSG_CHECKING([for AliRoot])
52have_aliroot=no
53with_aliroot=yes
54if test "x$with_aliroot" = "xyes" || test "x$with_aliroot" = "x" ; then
55 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
56 ALIROOTINCDIR=${ALICE_ROOT}/include
57elif test "x$with_aliroot" != "xno" ; then
58 # TODO: think about the tgt_* subfolder
59 ALICE_ROOT="$with_aliroot"
60 ALIROOTLIBDIR="$ALICE_ROOT/lib"
61 ALIROOTINCDIR="$ALICE_ROOT/include"
62fi
63if test "x$ALICE_ROOT" != "x" \
64 && test -d ${ALIROOTLIBDIR} \
65 && test -d ${ALIROOTINCDIR}; then
66 have_aliroot=$ALICE_ROOT
67else
68 ALIROOTLIBDIR=
69 ALIROOTINCDIR=
70fi
71AC_MSG_RESULT([$have_aliroot])
72
73if test ! "x$have_aliroot" = "xno" ; then
74 # we check for the libSTEER library which is linked to
75 # - the ROOT libs libGeom libMinuit libVMC libEG
76 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
77 # - ROOT libCint needs also libdl
78 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
79 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
80 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl -lSTEER"
81 save_CPPFLAGS=$CPPFLAGS
82 save_LDFLAGS=$LDFLAGS
83 save_LIBS=$LIBS
84 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
db16520a 85 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
86 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
74c73e5a 87
88 # check for certain AliRoot libraries/files/features
89 if test ! "x$have_aliroot" = "xno" ; then
90 # the RAWReader classe are needed by the TPCLib/AliHLTTPCDigitReaderPacket
91 # and by the STEER library. From version v4-04-Rev-07 on the RawReader classes
92 # are in libRAWDatarec, before in libRAWData
93 have_alirawdata=yes
94 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
95 if test ! "x$have_alirawdata" = "xno" ; then
96 CHECKLIB="-lRAWDatarec"
db16520a 97 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS -lRAWDatabase $CHECKLIB"
74c73e5a 98 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
99 #include <AliRawReaderFile.h>
100 #include <AliRawReaderDate.h>
101 #include <AliRawReaderRoot.h>],
102 [AliRawReaderMemory mreader;
103 AliRawReaderFile freader;
104 AliRawReaderDate dreader(NULL,0);
105 AliRawReaderRoot rreader(NULL,0)])],
106 [AC_DEFINE(HAVE_ALIRAWDATA)
107 ALIROOT_LIBS="$ALIROOT_LIBS -lRAWDatabase $CHECKLIB"
108 have_alirawdata=$CHECKLIB],
109 [have_alirawdata=no])
110 # second pass with -RAWData
111 if test "x$have_alirawdata" = "xno" ; then
112 CHECKLIB="-lRAWData"
db16520a 113 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB"
74c73e5a 114 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
115 #include <AliRawReaderFile.h>
116 #include <AliRawReaderDate.h>
117 #include <AliRawReaderRoot.h>],
118 [AliRawReaderMemory mreader;
119 AliRawReaderFile freader;
120 AliRawReaderDate dreader(NULL,0);
121 AliRawReaderRoot rreader(NULL,0);])],
122 [AC_DEFINE(HAVE_ALIRAWDATA)
123 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
124 have_alirawdata=$CHECKLIB],
125 [have_alirawdata=no])
126 fi
127 fi
128 AC_MSG_RESULT($have_alirawdata)
129 fi
130
131 have_alisteer=yes
132 #AC_CHECK_HEADERS([AliRun.h],[have_alisteer=yes])
133 AC_MSG_CHECKING(for AliRun in -lSTEER)
134 if test "x$have_alisteer" = "xyes" ; then
135 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRun.h>], [AliRun aliroot])],
136 [AC_DEFINE(HAVE_ALISTEER)],
137 [have_alisteer=no
138 have_aliroot=no])
139 fi
140 AC_MSG_RESULT($have_alisteer)
141
142 if test ! "x$have_aliroot" = "xno" ; then
143 # the HLTTPCLib needs to link agains TPCbase and TPCrec
144 # TPC library for AliTPCParam and AliSimDigits used in
145 # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
146 saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
147 ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
148 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
149 have_alitpc=yes
150 AC_MSG_CHECKING(for required classes in TPC libraries)
151 if test ! "x$have_alitpc" = "xno" ; then
152 save_ALIROOT_LIBS=$ALIROOT_LIBS
153 ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
db16520a 154 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
74c73e5a 155 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
156 #include <AliTPCParam.h>
157 #include <AliTPCParamSR.h>
158 #include <AliTPCDigitsArray.h>
159 #include <AliTPCClustersArray.h>
160 #include <AliTPCcluster.h>
161 #include <AliTPCClustersRow.h>],
162 [AliSimDigits dig;
163 AliTPCParam param;
164 AliTPCParamSR paramsr;
165 AliTPCDigitsArray digarray;
166 AliTPCClustersArray clustarray;
167 AliTPCcluster clust;
168 AliTPCClustersRow row])],
169 [AC_DEFINE(HAVE_ALITPC)
170 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
171 saveALIROOT_LIBS=$ALIROOT_LIBS],
172 [have_alitpc=no
173 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
174 ALIROOT_LIBS=$saveALIROOT_LIBS])
175 fi
176 AC_MSG_RESULT($have_alitpc)
177 fi
178
179 if test ! "x$have_alirawdata" = "xno" ; then
180 # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
181 # the header file has been moved to the TPC module
182 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
183 # AliRawReaderMemory.h AliRawReaderFile.h already checked
184 #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
185 AC_CHECK_HEADERS([AliTPCRawStream.h])
186 fi
85869391 187
db16520a 188 have_tpc_mapping=no
189 if test ! "x$have_aliroot" = "xno" ; then
190 # the TPCLib/AliHLTTPCRawReader needs the actual Pad layot of the TPC
191 # which is stored in the TPC/mapping/Patchx.data files from
192 # AliRoot version v4-04-Release (May 2006)
193 AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
194 TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
195 AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data],
196 [have_tpc_mapping=yes
197 AC_SUBST(TPC_PAD_MAPPING_PATH)
198 AC_DEFINE(HAVE_TPC_MAPPING)],
199 [])
200
201 fi
202 AC_MSG_CHECKING([for TPC mapping layout])
203 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
204 AC_MSG_RESULT([$have_tpc_mapping])
205
74c73e5a 206 if test "x$have_aliroot" = "xno" ; then
207 ALIROOT_CPPFLAGS=
208 ALIROOT_LDFLAGS=
209 ALIROOT_LIBS=
210 fi
211 CPPFLAGS=$save_CPPFLAGS
212 LDFLAGS=$save_LDFLAGS
213 LIBS=$save_LIBS
214 if test ! "x$have_aliroot" = "xno" ; then
215 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
216 fi
217fi
218AC_LANG_POP(C++)
219AC_SUBST([ALIROOT_CPPFLAGS])
220AC_SUBST([ALIROOT_LDFLAGS])
221AC_SUBST([ALIROOT_LIBS])
222CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
85869391 223
224dnl ------------------------------------------------------------------
78b557c2 225dnl check for the HLT PubSub Framework
226AC_MSG_CHECKING([for HLT PubSub Framework])
227AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
228 [],
229 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
230if test -z $with_pubsub || ! test -d $with_pubsub ; then
231 with_pubsub=no
232fi
233AC_MSG_RESULT([$with_pubsub])
234
235AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
236if test "x$with_pubsub" != "xno" ; then
237 save_CPPFLAGS=$CPPFLAGS
238 save_LDFLAGS=$LDFLAGS
239 save_LIBS=$LIBS
4a6b4894 240 # currently the different versions of the HLT PubSub framework have a different
241 # directory layout
242 if test -d ${with_pubsub}/include/HOMER/reader ; then
243 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER/reader"
244 else
245 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
246 fi
247 HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
78b557c2 248 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
249 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
250 LIBS="$save_LIBS "
251 with_homer=no
252 AC_LANG_PUSH(C++)
253 AC_CHECK_HEADER([HOMERReader.h],
254 [ AC_CHECK_LIB([HOMERReader],[_init],[with_homer=yes])])
255 AC_LANG_POP(C++)
256 if test "x$with_homer" = "xno" ; then
257 HOMER_CPPFLAGS=
258 HOMER_LDFLAGS=
259 else
260 AC_DEFINE(HAVE_HOMERREADER)
261 fi
262 CPPFLAGS="$save_CPPFLAGS"
263 LDFLAGS="$save_LDFLAGS"
264 LIBS="$save_LIBS"
265fi
266AC_SUBST([HOMER_CPPFLAGS])
267AC_SUBST([HOMER_LDFLAGS])
268
269dnl ------------------------------------------------------------------
85869391 270AC_MSG_CHECKING([whether to impose strict coding conventions])
271AC_ARG_ENABLE(strict,
272 [AC_HELP_STRING([--enable-strict],
273 [enable coding convention checks ])],
274 [],[enable_strict=no])
275if test "x$enable_strict" = "xyes" ; then
276 CPPFLAGS="$CPPFLAGS -Weffc++"
277fi
278AC_MSG_RESULT([$enable_strict])
b521659f 279
280dnl ------------------------------------------------------------------
281AC_MSG_CHECKING([whether to compile sample library])
282AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
283AC_ARG_ENABLE(sample,
284 [AC_HELP_STRING([--enable-sample],
285 [compile the sample library ])],
286 [],[enable_sample=yes])
287if test "x$enable_sample" = "xyes" ; then
288 AC_DEFINE(HLT_SAMPLE)
289fi
290AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
291AC_MSG_RESULT([$enable_sample])
292
293dnl ------------------------------------------------------------------
294AC_MSG_CHECKING([whether to compile tpc library])
295AH_TEMPLATE([HLT_TPC],[hlt tpc library])
296AC_ARG_ENABLE(tpc,
297 [AC_HELP_STRING([--enable-tpc],
298 [compile the tpc library ])],
299 [],[enable_tpc=yes])
74c73e5a 300if test "x$have_aliroot" = "xno" ; then
301 enable_tpc="no...requires.AliRoot"
302elif test "x$have_alitpc" = "xno" ; then
303 enable_tpc="no...requires.AliRoot.TPC.libraries"
304fi
b521659f 305if test "x$enable_tpc" = "xyes" ; then
306 AC_DEFINE(HLT_TPC)
307fi
308AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
309AC_MSG_RESULT([$enable_tpc])
310
311dnl ------------------------------------------------------------------
312AC_MSG_CHECKING([whether to enable HLT logging])
313AH_TEMPLATE([NOLOGGING],[disable hlt logging])
314AC_ARG_ENABLE(logging,
315 [AC_HELP_STRING([--enable-logging],
316 [enable logging])],
317 [],[enable_logging=yes])
318if test "x$enable_logging" != "xyes" ; then
319 AC_DEFINE(NOLOGGING)
320fi
321AC_MSG_RESULT([$enable_logging])
322
323dnl ------------------------------------------------------------------
324AC_MSG_CHECKING([whether to enable saving MC data through the chain])
325AH_TEMPLATE([DOMC],[MC saving])
326AC_ARG_ENABLE(mc-saving,
327 [AC_HELP_STRING([--enable-mc-saving],
328 [enable saving MC data through the chain])],
329 [],[enable_mc_saving=no])
330if test "x$enable_mc_saving" = "xyes" ; then
331 AC_DEFINE(DOMC)
332fi
333AC_MSG_RESULT([$enable_mc_saving])
334
335dnl ------------------------------------------------------------------
b521659f 336AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
337AH_TEMPLATE([use_newio],[AliRoot NEWIO])
338AC_ARG_ENABLE(newio,
339 [AC_HELP_STRING([--enable-newio],
340 [enable AliRoot NEWIO ])],
341 [],[enable_newio=yes])
342if test "x$enable_newio" = "xyes" ; then
343 AC_DEFINE(use_newio)
344fi
345AC_MSG_RESULT([$enable_newio])
346
347dnl ------------------------------------------------------------------
348dnl certainly something old, but we keep the define
349AC_MSG_CHECKING([whether to use ROWHOUGH])
350AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
351AC_ARG_ENABLE(rowhough,
352 [AC_HELP_STRING([--enable-rowhough],
353 [use ROWHOUGH ])],
354 [],[enable_rowhough=no])
355if test "x$enable_rowhough" = "xyes" ; then
356 AC_DEFINE(USEROWHOUGH)
357fi
358AC_MSG_RESULT([$enable_rowhough])
359
360dnl ------------------------------------------------------------------
361dnl
362dnl Documentation
363dnl
364AC_ARG_VAR(DOXYGEN, The Documentation Generator)
365AC_PATH_PROG(PERL, perl)
366AC_PATH_PROG(DOXYGEN, doxygen)
367AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
368HAVE_DOT=NO
369DOT_PATH=
370AC_PATH_PROG(DOT, dot)
371if ! test "x$DOT" = "x" ; then
372 HAVE_DOT=YES
373 DOT_PATH=`dirname $DOT`
374fi
375AC_SUBST([HAVE_DOT])
376AC_SUBST([DOT_PATH])
377
378dnl ------------------------------------------------------------------
379AC_CONFIG_FILES([Makefile
380 BASE/Makefile
381 SampleLib/Makefile
382 TPCLib/Makefile
db16520a 383 TPCLib/mapping2array.cxx
78b557c2 384 TPCLib/OnlineDisplay/Makefile
b521659f 385 doc/Makefile
386 doc/doxygen.conf])
387
388
389AC_OUTPUT
390dnl
391dnl EOF
392dnl
393