]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/configure.ac
extensions in AliHLTTPCDisplay
[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 ------------------------------------------------------------------
2bbbadd1 8AC_INIT([Alice High Level Trigger] , [0.5-dev], [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++)
74c73e5a 51have_aliroot=no
2bbbadd1 52AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
53 [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
54 [])
55
56if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
57 dnl ------------------------------------------------------------------
58 dnl Try to estimate the system architecture
59 case $host_os:$host_cpu in
60 linux*:x86_64*) alice_target='linuxx8664gcc' ;;
61 linux*) alice_target='linux' ;;
62 *) alice_target='unknown' ;;
63 esac
64 if test "x$alice_target" = "xunknown" ; then
65 if test -z $ALICE_TARGET ; then
66 AC_MSG_ERROR([Can not estimate system architecture.
67 To avoid the problem, set the ALICE_TARGET variable appropriately.
68 Please send the following information to Matthias.Richter@ift.uib.no:
69 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
70 else
71 AC_MSG_NOTICE([Unknown system architecture.
72 Please send the following information to Matthias.Richter@ift.uib.no:
73 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
74 fi
75 else
76 if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
77 AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
78 overriding $ALICE_TARGET by $alice_target])
79 fi
80 ALICE_TARGET=$alice_target
81 fi
74c73e5a 82 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
83 ALIROOTINCDIR=${ALICE_ROOT}/include
2bbbadd1 84 test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
85 test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
74c73e5a 86fi
2bbbadd1 87
88AC_MSG_CHECKING([for AliRoot])
74c73e5a 89if test "x$ALICE_ROOT" != "x" \
90 && test -d ${ALIROOTLIBDIR} \
91 && test -d ${ALIROOTINCDIR}; then
92 have_aliroot=$ALICE_ROOT
93else
94 ALIROOTLIBDIR=
95 ALIROOTINCDIR=
96fi
97AC_MSG_RESULT([$have_aliroot])
98
99if test ! "x$have_aliroot" = "xno" ; then
100 # we check for the libSTEER library which is linked to
101 # - the ROOT libs libGeom libMinuit libVMC libEG
102 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
103 # - ROOT libCint needs also libdl
104 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
105 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
2bbbadd1 106 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl"
74c73e5a 107 save_CPPFLAGS=$CPPFLAGS
108 save_LDFLAGS=$LDFLAGS
109 save_LIBS=$LIBS
110 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
db16520a 111 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
2bbbadd1 112
74c73e5a 113 # check for certain AliRoot libraries/files/features
2bbbadd1 114 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
115 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
116 CHECKLIB=CDB
117 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
74c73e5a 118
2bbbadd1 119 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
120 have_alirawdata=no
121 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
122 CHECKLIB=RAWDatabase
123 AC_CHECK_LIB([$CHECKLIB],[_init],
124 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
125 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
126 CHECKLIB=RAWDatarec
127 AC_CHECK_LIB([$CHECKLIB],[_init],
128 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
129 AC_DEFINE(HAVE_ALIRAWDATA)
130 have_alirawdata=$CHECKLIB])],
131 [# second pass with -RAWData
132 CHECKLIB="-lRAWData"
133 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
134 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
135 #include <AliRawReaderFile.h>
136 #include <AliRawReaderDate.h>
137 #include <AliRawReaderRoot.h>],
138 [AliRawReaderMemory mreader;
139 AliRawReaderFile freader;
140 AliRawReaderDate dreader(NULL,0);
141 AliRawReaderRoot rreader(NULL,0);])],
142 [AC_DEFINE(HAVE_ALIRAWDATA)
143 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
144 have_alirawdata=$CHECKLIB],
145 [have_alirawdata=no])
146 ]) dnl AC_CHECK_LIB RAWDatabase
147 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
148 AC_MSG_RESULT($have_alirawdata)
149
150 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
151 CHECKLIB=STEER
152 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
74c73e5a 153
154 if test ! "x$have_aliroot" = "xno" ; then
155 # the HLTTPCLib needs to link agains TPCbase and TPCrec
156 # TPC library for AliTPCParam and AliSimDigits used in
157 # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx
158 saveALIROOT_CPPFLAGS="$ALIROOT_CPPFLAGS"
159 ALIROOT_CPPFLAGS="$saveALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC"
160 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
161 have_alitpc=yes
162 AC_MSG_CHECKING(for required classes in TPC libraries)
163 if test ! "x$have_alitpc" = "xno" ; then
164 save_ALIROOT_LIBS=$ALIROOT_LIBS
165 ALIROOT_LIBS="$save_ALIROOT_LIBS -lTPCbase -lTPCrec"
db16520a 166 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
74c73e5a 167 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliSimDigits.h>
168 #include <AliTPCParam.h>
169 #include <AliTPCParamSR.h>
170 #include <AliTPCDigitsArray.h>
171 #include <AliTPCClustersArray.h>
172 #include <AliTPCcluster.h>
173 #include <AliTPCClustersRow.h>],
174 [AliSimDigits dig;
175 AliTPCParam param;
176 AliTPCParamSR paramsr;
177 AliTPCDigitsArray digarray;
178 AliTPCClustersArray clustarray;
179 AliTPCcluster clust;
180 AliTPCClustersRow row])],
181 [AC_DEFINE(HAVE_ALITPC)
182 saveALIROOT_CPPFLAGS=$ALIROOT_CPPFLAGS
183 saveALIROOT_LIBS=$ALIROOT_LIBS],
184 [have_alitpc=no
185 ALIROOT_CPPFLAGS=$saveALIROOT_CPPFLAGS
186 ALIROOT_LIBS=$saveALIROOT_LIBS])
187 fi
188 AC_MSG_RESULT($have_alitpc)
189 fi
190
191 if test ! "x$have_alirawdata" = "xno" ; then
192 # check for header files needed by the TPCLib/AliHLTTPCDigitReaderPacket
193 # the header file has been moved to the TPC module
194 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
195 # AliRawReaderMemory.h AliRawReaderFile.h already checked
196 #AC_CHECK_HEADERS([AliRawReaderMemory.h AliRawReaderFile.h AliTPCRawStream.h])
197 AC_CHECK_HEADERS([AliTPCRawStream.h])
198 fi
85869391 199
db16520a 200 have_tpc_mapping=no
201 if test ! "x$have_aliroot" = "xno" ; then
202 # the TPCLib/AliHLTTPCRawReader needs the actual Pad layot of the TPC
203 # which is stored in the TPC/mapping/Patchx.data files from
204 # AliRoot version v4-04-Release (May 2006)
205 AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available])
206 TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping
207 AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data],
208 [have_tpc_mapping=yes
209 AC_SUBST(TPC_PAD_MAPPING_PATH)
210 AC_DEFINE(HAVE_TPC_MAPPING)],
211 [])
212
213 fi
214 AC_MSG_CHECKING([for TPC mapping layout])
215 AM_CONDITIONAL(USE_TPC_MAPPING, test x$have_tpc_mapping = xyes)
216 AC_MSG_RESULT([$have_tpc_mapping])
217
74c73e5a 218 if test "x$have_aliroot" = "xno" ; then
219 ALIROOT_CPPFLAGS=
220 ALIROOT_LDFLAGS=
221 ALIROOT_LIBS=
222 fi
223 CPPFLAGS=$save_CPPFLAGS
224 LDFLAGS=$save_LDFLAGS
225 LIBS=$save_LIBS
226 if test ! "x$have_aliroot" = "xno" ; then
227 CPPFLAGS="$CPPFLAGS -DALIROOTVERSION=\\\"Unknown\\\""
228 fi
229fi
230AC_LANG_POP(C++)
231AC_SUBST([ALIROOT_CPPFLAGS])
232AC_SUBST([ALIROOT_LDFLAGS])
233AC_SUBST([ALIROOT_LIBS])
234CPPFLAGS="$CPPFLAGS -DROOTVERSION=\\\"`${ROOTCONF} --version`\\\""
85869391 235
78b557c2 236dnl ------------------------------------------------------------------
237dnl check for the HLT PubSub Framework
238AC_MSG_CHECKING([for HLT PubSub Framework])
239AC_ARG_WITH(pubsub, [installation path of the HLT PubSub framework],
240 [],
241 [ test -n $ALIHLT_DC_DIR && with_pubsub=$ALIHLT_DC_DIR ])
242if test -z $with_pubsub || ! test -d $with_pubsub ; then
243 with_pubsub=no
244fi
245AC_MSG_RESULT([$with_pubsub])
246
247AH_TEMPLATE([HAVE_HOMERREADER],[the HLT PubSub Homer Reader interface])
248if test "x$with_pubsub" != "xno" ; then
249 save_CPPFLAGS=$CPPFLAGS
250 save_LDFLAGS=$LDFLAGS
251 save_LIBS=$LIBS
4a6b4894 252 # currently the different versions of the HLT PubSub framework have a different
253 # directory layout
20b6dd9a 254 if test -d ${with_pubsub}/include/HOMER ; then
255 HOMER_CPPFLAGS="-I${with_pubsub}/include/HOMER -I${with_pubsub}/include/HOMER/reader"
4a6b4894 256 else
257 HOMER_CPPFLAGS="-I${with_pubsub}/src/Util/HOMER/reader/include -I${with_pubsub}/src/Util/HOMER/data/include"
258 fi
259 HOMER_LDFLAGS="-L${with_pubsub}/lib/`uname -s`-`uname -m`"
78b557c2 260 CPPFLAGS="$save_CPPFLAGS $HOMER_CPPFLAGS"
261 LDFLAGS="$save_LDFLAGS $HOMER_LDFLAGS"
262 LIBS="$save_LIBS "
263 with_homer=no
264 AC_LANG_PUSH(C++)
265 AC_CHECK_HEADER([HOMERReader.h],
266 [ AC_CHECK_LIB([HOMERReader],[_init],[with_homer=yes])])
267 AC_LANG_POP(C++)
268 if test "x$with_homer" = "xno" ; then
269 HOMER_CPPFLAGS=
270 HOMER_LDFLAGS=
271 else
272 AC_DEFINE(HAVE_HOMERREADER)
273 fi
274 CPPFLAGS="$save_CPPFLAGS"
275 LDFLAGS="$save_LDFLAGS"
276 LIBS="$save_LIBS"
277fi
278AC_SUBST([HOMER_CPPFLAGS])
279AC_SUBST([HOMER_LDFLAGS])
280
85869391 281dnl ------------------------------------------------------------------
282AC_MSG_CHECKING([whether to impose strict coding conventions])
283AC_ARG_ENABLE(strict,
284 [AC_HELP_STRING([--enable-strict],
285 [enable coding convention checks ])],
286 [],[enable_strict=no])
287if test "x$enable_strict" = "xyes" ; then
288 CPPFLAGS="$CPPFLAGS -Weffc++"
289fi
290AC_MSG_RESULT([$enable_strict])
b521659f 291
292dnl ------------------------------------------------------------------
293AC_MSG_CHECKING([whether to compile sample library])
294AH_TEMPLATE([HLT_SAMPLE],[hlt sample library])
295AC_ARG_ENABLE(sample,
296 [AC_HELP_STRING([--enable-sample],
297 [compile the sample library ])],
298 [],[enable_sample=yes])
299if test "x$enable_sample" = "xyes" ; then
300 AC_DEFINE(HLT_SAMPLE)
301fi
302AM_CONDITIONAL(EN_HLT_SAMPLE, test x$enable_sample = xyes)
303AC_MSG_RESULT([$enable_sample])
304
305dnl ------------------------------------------------------------------
306AC_MSG_CHECKING([whether to compile tpc library])
307AH_TEMPLATE([HLT_TPC],[hlt tpc library])
308AC_ARG_ENABLE(tpc,
309 [AC_HELP_STRING([--enable-tpc],
310 [compile the tpc library ])],
311 [],[enable_tpc=yes])
74c73e5a 312if test "x$have_aliroot" = "xno" ; then
313 enable_tpc="no...requires.AliRoot"
314elif test "x$have_alitpc" = "xno" ; then
315 enable_tpc="no...requires.AliRoot.TPC.libraries"
316fi
b521659f 317if test "x$enable_tpc" = "xyes" ; then
318 AC_DEFINE(HLT_TPC)
319fi
320AM_CONDITIONAL(EN_HLT_TPC, test x$enable_tpc = xyes)
321AC_MSG_RESULT([$enable_tpc])
322
323dnl ------------------------------------------------------------------
324AC_MSG_CHECKING([whether to enable HLT logging])
325AH_TEMPLATE([NOLOGGING],[disable hlt logging])
326AC_ARG_ENABLE(logging,
327 [AC_HELP_STRING([--enable-logging],
328 [enable logging])],
329 [],[enable_logging=yes])
330if test "x$enable_logging" != "xyes" ; then
331 AC_DEFINE(NOLOGGING)
332fi
333AC_MSG_RESULT([$enable_logging])
334
335dnl ------------------------------------------------------------------
336AC_MSG_CHECKING([whether to enable saving MC data through the chain])
337AH_TEMPLATE([DOMC],[MC saving])
338AC_ARG_ENABLE(mc-saving,
339 [AC_HELP_STRING([--enable-mc-saving],
340 [enable saving MC data through the chain])],
341 [],[enable_mc_saving=no])
342if test "x$enable_mc_saving" = "xyes" ; then
343 AC_DEFINE(DOMC)
344fi
345AC_MSG_RESULT([$enable_mc_saving])
346
b521659f 347dnl ------------------------------------------------------------------
348AC_MSG_CHECKING([whether to enable AliRoot NEWIO])
349AH_TEMPLATE([use_newio],[AliRoot NEWIO])
350AC_ARG_ENABLE(newio,
351 [AC_HELP_STRING([--enable-newio],
352 [enable AliRoot NEWIO ])],
353 [],[enable_newio=yes])
354if test "x$enable_newio" = "xyes" ; then
355 AC_DEFINE(use_newio)
356fi
357AC_MSG_RESULT([$enable_newio])
358
359dnl ------------------------------------------------------------------
360dnl certainly something old, but we keep the define
361AC_MSG_CHECKING([whether to use ROWHOUGH])
362AH_TEMPLATE([USEROWHOUGH],[HLT ROWHOUGH])
363AC_ARG_ENABLE(rowhough,
364 [AC_HELP_STRING([--enable-rowhough],
365 [use ROWHOUGH ])],
366 [],[enable_rowhough=no])
367if test "x$enable_rowhough" = "xyes" ; then
368 AC_DEFINE(USEROWHOUGH)
369fi
370AC_MSG_RESULT([$enable_rowhough])
371
372dnl ------------------------------------------------------------------
373dnl
374dnl Documentation
375dnl
376AC_ARG_VAR(DOXYGEN, The Documentation Generator)
377AC_PATH_PROG(PERL, perl)
378AC_PATH_PROG(DOXYGEN, doxygen)
379AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
380HAVE_DOT=NO
381DOT_PATH=
382AC_PATH_PROG(DOT, dot)
383if ! test "x$DOT" = "x" ; then
384 HAVE_DOT=YES
385 DOT_PATH=`dirname $DOT`
386fi
387AC_SUBST([HAVE_DOT])
388AC_SUBST([DOT_PATH])
389
2bbbadd1 390dnl ------------------------------------------------------------------
391dnl inatallation directory for libraries
392dnl
393if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
394libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
395AC_MSG_NOTICE([libdir set to $libdir])
396fi
b521659f 397dnl ------------------------------------------------------------------
398AC_CONFIG_FILES([Makefile
399 BASE/Makefile
400 SampleLib/Makefile
401 TPCLib/Makefile
db16520a 402 TPCLib/mapping2array.cxx
78b557c2 403 TPCLib/OnlineDisplay/Makefile
b521659f 404 doc/Makefile
405 doc/doxygen.conf])
406
407
408AC_OUTPUT
409dnl
410dnl EOF
411dnl
412