1 dnl -*- mode: autoconf -*-
4 dnl template for the configuration script for the Alice HLT
5 dnl analysis tutorial and example library
7 dnl ------------------------------------------------------------------
8 AC_INIT([Alice High Level Trigger Tutorial] , [0.1], [Matthias.Richter@ift.uib.no], alice-hlt-sample)
10 dnl ------------------------------------------------------------------
12 AC_PREFIX_DEFAULT(${PWD})
13 AC_CONFIG_SRCDIR(AliHLTDummyComponent.cxx)
22 dnl ------------------------------------------------------------------
26 ROOT_PATH(, [have_root=1], [AC_ERROR([Stop! The HLT package needs ROOT.])])
27 AM_CONDITIONAL(HAVE_ROOT, test "x$have_root" = "x1" )
29 CPPFLAGS="$CPPFLAGS ${ROOTCFLAGS}"
31 dnl ------------------------------------------------------------------
32 dnl check for AliRoot features
35 AC_ARG_WITH(aliroot,[ --with-aliroot top of the AliRoot installation],
36 [test -d $with_aliroot && ALICE_ROOT=$with_aliroot],
39 if test "x$ALICE_ROOT" != "x" && test -d $ALICE_ROOT ; then
40 dnl ------------------------------------------------------------------
41 dnl Try to estimate the system architecture
42 case $host_os:$host_cpu in
43 linux*:x86_64*) alice_target='linuxx8664gcc' ;;
44 linux*) alice_target='linux' ;;
45 *) alice_target='unknown' ;;
47 if test "x$alice_target" = "xunknown" ; then
48 if test -z $ALICE_TARGET ; then
49 AC_MSG_ERROR([Can not estimate system architecture.
50 To avoid the problem, set the ALICE_TARGET variable appropriately.
51 Please send the following information to Matthias.Richter@ift.uib.no:
52 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
54 AC_MSG_NOTICE([Unknown system architecture.
55 Please send the following information to Matthias.Richter@ift.uib.no:
56 ${PACKAGE}: no AliRoot target definition for os=$host_os and cpu=$host_cpu ])
59 if test "x$ALICE_TARGET" != "x" && test "x$ALICE_TARGET" != "x$alice_target" ; then
60 AC_MSG_WARN([The ALICE_TARGET variable does not match your current system
61 overriding $ALICE_TARGET by $alice_target])
63 ALICE_TARGET=$alice_target
65 ALIROOTLIBDIR=${ALICE_ROOT}/lib/tgt_${ALICE_TARGET}
66 ALIROOTINCDIR=${ALICE_ROOT}/include
67 test -d ${ALIROOTLIBDIR} || AC_MSG_WARN([can not find AliRoot library directory $ALIROOTLIBDIR])
68 test -d ${ALIROOTINCDIR} || AC_MSG_WARN([can not find AliRoot include directory $ALIROOTINCDIR])
71 AC_MSG_CHECKING([for AliRoot])
72 if test "x$ALICE_ROOT" != "x" \
73 && test -d ${ALIROOTLIBDIR} \
74 && test -d ${ALIROOTINCDIR}; then
75 have_aliroot=$ALICE_ROOT
80 AC_MSG_RESULT([$have_aliroot])
82 if test ! "x$have_aliroot" = "xno" ; then
83 # we check for the libSTEER library which is linked to
84 # - the ROOT libs libGeom libMinuit libVMC libEG
85 # - the AliRoot libESD libRAWData (libRAWDatarec from v4-04-Rev-07)
86 # - ROOT libCint needs also libdl
87 # - from Nov 1 2006 TTreeFormula is needed by AliTagAnalysis and requires
89 ALIROOT_CPPFLAGS="-I${ALIROOTINCDIR} -I${ALICE_ROOT}/RAW"
90 ALIROOT_LDFLAGS="-L${ALIROOTLIBDIR}"
91 ALIROOT_LIBS="-lESD -lGeom -lMinuit -lVMC -lEG -ldl -lTreePlayer"
92 save_CPPFLAGS=$CPPFLAGS
95 CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS"
96 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS"
98 # check for certain AliRoot libraries/files/features
99 # CBD library is present since AliRoot version v4-05-00 (02.06.2006)
100 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
102 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
104 # splitted RAW libraries since AliRoot version v4-04-Rev-07 (09.08.2006)
106 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
108 AC_CHECK_LIB([$CHECKLIB],[_init],
109 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
110 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
112 AC_CHECK_LIB([$CHECKLIB],[_init],
113 [ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"
114 AC_DEFINE(HAVE_ALIRAWDATA)
115 have_alirawdata=$CHECKLIB])],
116 [# second pass with -RAWData
118 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $CHECKLIB -lSTEER"
119 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliRawReaderMemory.h>
120 #include <AliRawReaderFile.h>
121 #include <AliRawReaderDate.h>
122 #include <AliRawReaderRoot.h>],
123 [AliRawReaderMemory mreader;
124 AliRawReaderFile freader;
125 AliRawReaderDate dreader(NULL,0);
126 AliRawReaderRoot rreader(NULL,0);])],
127 [AC_DEFINE(HAVE_ALIRAWDATA)
128 ALIROOT_LIBS="$ALIROOT_LIBS $CHECKLIB"
129 have_alirawdata=$CHECKLIB],
130 [have_alirawdata=no])
131 ]) dnl AC_CHECK_LIB RAWDatabase
132 AC_MSG_CHECKING(for AliRawReader classes in RAWData libraries)
133 AC_MSG_RESULT($have_alirawdata)
135 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
137 AC_CHECK_LIB([$CHECKLIB],[_init],[ALIROOT_LIBS="$ALIROOT_LIBS -l$CHECKLIB"])
139 if test "x$have_aliroot" = "xno" ; then
144 CPPFLAGS=$save_CPPFLAGS
145 LDFLAGS=$save_LDFLAGS
149 dnl ------------------------------------------------------------------
150 dnl check for the HLT component framework
151 AC_MSG_CHECKING([for HLT component framework in ])
152 AC_ARG_WITH(hltbase, [installation path of the HLT component framework],
154 [test -n $have_aliroot && with_hltbase=$have_aliroot ])
155 if test -z $with_hltbase || ! test -d $with_hltbase ; then
158 AC_MSG_RESULT([$with_hltbase])
159 if test "x$with_hltbase" = "xno" || test "x$with_hltbase" = "x$ALICE_ROOT" ; then
160 HLTBASE_CPPFLAGS=-I${ALICE_ROOT}/HLT/BASE
163 HLTBASE_CPPFLAGS=-I${with_hltbase}/include/alice-hlt
164 HLTBASE_LDFLAGS=-L${with_hltbase}/lib
167 save_CPPFLAGS=$CPPFLAGS
168 save_LDFLAGS=$LDFLAGS
170 CPPFLAGS="$save_CPPFLAGS $HLTBASE_CPPFLAGS -L${ALIROOTLIBDIR}"
171 LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS $HLTBASE_LDFLAGS"
172 LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS"
173 AC_CHECK_HEADER([AliHLTComponent.h])
174 AC_CHECK_HEADER([AliHLTLogging.h])
176 AC_CHECK_LIB([$CHECKLIB],[_init],
178 HLTBASE_LDFLAGS="$HLTBASE_LDFLAGS -l$CHECKLIB"])
180 test "x$have_hltbase" = "xyes" || \
181 AC_ERROR([Stop! The package needs the HLT component framework.
182 Use --with-hltbase option to point to the HLT component framework
185 CPPFLAGS=$save_CPPFLAGS
186 LDFLAGS=$save_LDFLAGS
190 AC_SUBST([ALIROOT_CPPFLAGS])
191 AC_SUBST([ALIROOT_LDFLAGS])
192 AC_SUBST([ALIROOTLIBDIR])
193 AC_SUBST([ALIROOT_LIBS])
194 AC_SUBST([HLTBASE_CPPFLAGS])
195 AC_SUBST([HLTBASE_LDFLAGS])
197 dnl ------------------------------------------------------------------
201 AC_ARG_VAR(DOXYGEN, The Documentation Generator)
202 AC_PATH_PROG(PERL, perl)
203 AC_PATH_PROG(DOXYGEN, doxygen)
204 AM_CONDITIONAL(HAVE_DOXYGEN, test ! "x$DOXYGEN" = "x")
207 AC_PATH_PROG(DOT, dot)
208 if ! test "x$DOT" = "x" ; then
210 DOT_PATH=`dirname $DOT`
215 dnl ------------------------------------------------------------------
216 dnl inatallation directory for libraries
218 if test "x$prefix" != "xNONE" && test $ALICE_ROOT = $prefix ; then
219 libdir=\${exec_prefix}/lib/tgt_$ALICE_TARGET
220 AC_MSG_NOTICE([libdir set to $libdir])
222 dnl ------------------------------------------------------------------
223 AC_CONFIG_FILES([Makefile])
231 dnl AC_CONFIG_FILES([Makefile
233 dnl doc/doxygen.conf])