ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/BOSS/acinclude.m4
Revision: 1.22
Committed: Sat Jan 20 11:20:56 2007 UTC (18 years, 3 months ago) by gcodispo
Branch: MAIN
CVS Tags: BOSS_4_3_4a, BOSS_4_3_5, BOSS_4_3_4, BOSS_4_3_3, BOSS_4_3_2, BOSS_4_3_1b, BOSS_4_3_1a, BOSS_4_3_1
Branch point for: BOSS_4_3_1c
Changes since 1.21: +6 -3 lines
Log Message:
Reorganization of linker flags

File Contents

# User Rev Content
1 gcodispo 1.1 AC_DEFUN([AC_CHECK_SYSTEM],
2     [
3     AC_CACHE_VAL(ARCH, [
4 gcodispo 1.21 os=`uname`
5     if test ${os} = "Linux"; then
6     SONAME="so"
7 gcodispo 1.22 LD_FLAGS="-Wl,-E"
8     LIB_OPT="-shared"
9 gcodispo 1.21 AC_MSG_RESULT(Operating System... Linux)
10     elif test ${os} = "Darwin"; then
11     AC_MSG_RESULT(Operating System... Darwin)
12     SONAME="dylib"
13 gcodispo 1.22 LD_FLAGS=""
14     LIB_OPT="-dynamiclib"
15 gcodispo 1.21 else
16     AC_MSG_ERROR( Unsupported OS )
17     fi
18 gcodispo 1.1 for p in `uname -m` ; do
19     case "$p" in
20     *x86_64*)
21     ARCH=amd64_
22     ;;
23     *i386* | *i686* )
24     ARCH=ia32_
25     ;;
26     esac
27     done
28 gcodispo 1.21 AC_SUBST(SONAME)
29 gcodispo 1.22 AC_SUBST(LD_FLAGS)
30     AC_SUBST(LIB_OPT)
31 gcodispo 1.1 AC_SUBST(ARCH)
32     ])
33    
34     AC_CACHE_VAL(RELEASE, [
35 gcodispo 1.8 for p in `cat /etc/redhat-release /etc/issue* 2>/dev/null| sed 's/ //g'` ; do
36 gcodispo 1.1 case "$p" in
37 gcodispo 1.8 *Debian*GNU*Linux*3*1* | *Fedora* | *Fermi* | *Red*Hat*Enterprise* | *Rocks* )
38     RELEASE=slc3_
39     break
40     ;;
41 gcodispo 1.1 *SL* | *Scientific*Linux* )
42     RELEASE=slc[`sed 's/[^0-9]//g' /etc/redhat-release | cut -c 1`]_
43 gcodispo 1.7 break
44 gcodispo 1.1 ;;
45     *Mandrake* | *Red*Hat*Linux* | *SuSE* | *Debian*GNU*Linux*3*0* )
46     RELEASE=rh73_
47     ARC=""
48     AC_SUBST(ARCH)
49 gcodispo 1.7 break
50 gcodispo 1.1 ;;
51     esac
52     done
53     AC_SUBST(RELEASE)
54     ])
55    
56     AC_CACHE_VAL(GCC_VERSION, [
57     for p in "`gcc --version | cut -d ' ' -f 1,3 `" ; do
58     case "$p" in
59     *gcc* )
60     GCC_VERSION=gcc[`echo $p | cut -d ' ' -f 2 |sed 's/[^0-9]//g' `]
61     ;;
62     esac
63     done
64     AC_SUBST(GCC_VERSION)
65     ])
66    
67     AC_CACHE_VAL(SYSTEM, [
68     SYSTEM=${RELEASE}${ARCH}${GCC_VERSION}
69     echo system attributes... ${SYSTEM}
70     AC_SUBST(SYSTEM)
71     ])
72     ]
73     )
74    
75    
76     dn1 # Checks for SQLite libs
77     AC_DEFUN([AC_CHECK_SQLITE],
78 gcodispo 1.10 [
79     AC_MSG_RESULT(checking for sqlite in:)
80     # checking command line options
81 gcodispo 1.16 AC_ARG_WITH(sqlite_dir, [ --with-sqlite-dir=DIR top directory containing sqlite tree], sqlite_dir=${withval})
82     AC_ARG_WITH(sqlite_lib, [ --with-sqlite-lib=DIR directory containing sqlite lib], sqlite_lib=${withval})
83     AC_ARG_WITH(sqlite_include, [ --with-sqlite-include=DIR directory containing sqlite include], sqlite_inc=${withval})
84 gcodispo 1.10 #
85     # if a top dir is provided
86     #
87     if test [-n] "${sqlite_dir}" ; then
88     if test [-d] "${sqlite_dir}/lib" ; then
89     sqlite_lib=`(cd ${sqlite_dir}/lib; pwd)`
90     sqlite_lib_sh=${sqlite_lib}
91     else
92     AC_MSG_ERROR(sqlite lib dir not found. Please check sqlite installation and path)
93     fi
94     if test [-d] "${sqlite_dir}/include" ; then
95     sqlite_inc=`(cd ${sqlite_dir}/include; pwd)`
96     else
97     AC_MSG_ERROR(sqlite include dir not found. Please check sqlite installation and path)
98     fi
99     # test -d "${sqlite_dir}/lib" && sqlite_lib=`(cd ${sqlite_dir}/lib; pwd)`
100     # test -d "${sqlite_dir}/include" && sqlite_inc=`(cd ${sqlite_dir}/include; pwd)`
101     LIBS=[" -L${sqlite_lib}"]
102     fi
103     #
104     # otherwise check for libs
105     # starting from the one provided
106     #
107     if test [-n] "${sqlite_lib}" ; then
108     test -d "${sqlite_lib}" && sqlite_lib=`(cd ${sqlite_lib}; pwd)`
109     LIBS=[" -L${sqlite_lib}"]
110     sqlite_lib_sh=${sqlite_lib}
111     #
112     # if not provided look in the current dir
113     #
114     else
115 gcodispo 1.1 if test -d "$srcdir/sqlite" ; then
116 gcodispo 1.13 sqlite_ld_path="$srcdir/sqlite/lib"
117 gcodispo 1.17 sqlite_inc="\$(BOSS_ROOT)/sqlite/include"
118     sqlite_lib="\$(BOSS_ROOT)/sqlite/lib"
119     sqlite_lib_sh="\\\$BOSS_ROOT/sqlite/lib"
120 gcodispo 1.13 LIBS=[" -L$sqlite_ld_path"]
121 gcodispo 1.1 if test -f "$srcdir/sqlite/src/Makefile.in" ; then
122     MAKE_SQLITE_DIR="$srcdir/sqlite/src/Makefile"
123     fi
124     if test -f "$srcdir/sqlite/Makefile" ; then
125     MAKE_SQLITE="\$(MAKE) -C sqlite"
126     MAKE_SQLITE_CLEAN="\$(MAKE) -C sqlite clean"
127     AC_SUBST(MAKE_SQLITE)
128     AC_SUBST(MAKE_SQLITE_CLEAN)
129     fi
130     fi
131 gcodispo 1.10 #
132     # then in ${VO_CMS_SW_DIR}/lcg/external/sqlite
133     #
134     if test x"${sqlite_lib}" = x ; then
135 gcodispo 1.1 for i in \
136 gcodispo 1.8 `ls -dr ${VO_CMS_SW_DIR}/lcg/external/sqlite/*[3.[^0].*]*/${SYSTEM} 2>/dev/null` \
137     `ls -dr /afs/cern.ch/cms/external/lcg/external/sqlite/*[3.[^0].*]*/${SYSTEM} 2>/dev/null`
138 gcodispo 1.1 do
139     if test -f "$i/lib/libsqlite3.a" ; then
140 gcodispo 1.2 sqlite_lib=`(cd $i/lib; pwd)`
141 gcodispo 1.5 sqlite_lib_sh=${sqlite_lib}
142 gcodispo 1.2 sqlite_inc=`(cd $i/include; pwd)`
143 gcodispo 1.5 LIBS=[" -L${sqlite_lib}"]
144 gcodispo 1.1 break
145     fi
146     done
147     fi
148 gcodispo 1.10 #
149     # at the end check in a few common install locations
150     #
151     if test x"${sqlite_lib}" = x ; then
152 gcodispo 1.1 for i in \
153     `ls -d ${libdir} 2>/dev/null` \
154 gcodispo 1.2 `ls -d /usr/lib/sqlite/libsqlite3.a 2>/dev/null` \
155     `ls -d /usr/lib/libsqlite3.a 2>/dev/null` \
156     `ls -d /usr/local/lib/sqlite/libsqlite3.a 2>/dev/null` \
157     `ls -d /usr/local/lib/libsqlite3.a 2>/dev/null` \
158     `ls -d /usr/contrib/lib/sqlite/libsqlite3.a 2>/dev/null` \
159     `ls -d /usr/contrib/lib/libsqlite3.a 2>/dev/null`
160 gcodispo 1.1 do
161 gcodispo 1.2 if test -f "$i" ; then
162     sqlite_lib=`dirname $i`
163 gcodispo 1.5 sqlite_lib_sh=${sqlite_lib}
164     LIBS=[" -L${sqlite_lib}"]
165 gcodispo 1.1 break
166     fi
167     done
168 gcodispo 1.2 if test x"${sqlite_lib}" != x; then
169     for i in \
170     `ls -d ${includedir} 2>/dev/null` \
171     `ls -d /usr/include/sqlite/sqlite3.h 2>/dev/null` \
172     `ls -d /usr/include/sqlite3.h 2>/dev/null` \
173     `ls -d /usr/local/include/sqlite/sqlite3.h 2>/dev/null` \
174     `ls -d /usr/local/include/sqlite3.h 2>/dev/null` \
175     `ls -d /usr/contrib/include/sqlite/sqlite3.h 2>/dev/null` \
176     `ls -d /usr/contrib/include/sqlite3.h 2>/dev/null`
177     do
178     if test -f "$i" ; then
179     sqlite_inc=`dirname $i`
180     break
181     fi
182     done
183     fi
184 gcodispo 1.1 fi
185 gcodispo 1.10 fi
186     #
187 gcodispo 1.13 # now check if the include dir is there
188     #
189     if test [-n] "${sqlite_inc}" ; then
190     test -z "${sqlite_ld_path}" && sqlite_inc=`(cd ${sqlite_inc}; pwd)`
191     else
192     AC_MSG_ERROR(sqlite include dir not found. Please check sqlite installation and path)
193     fi
194     AC_MSG_RESULT(-> $sqlite_inc)
195     #
196 gcodispo 1.10 # check if the library is actually there
197     #
198     AC_MSG_RESULT(-> $sqlite_lib)
199     if test x"${MAKE_SQLITE}" = x ; then
200     AC_CHECK_LIB([sqlite3], [main], , [
201     AC_MSG_ERROR(sqlite3 library not found. Please check sqlite installation and path)])
202     fi
203     #
204     # perform variable substitution
205     #
206     if test -n "${sqlite_lib}" && test -n "${sqlite_inc}" ; then
207     sqlite=sqlite
208     AC_SUBST(sqlite)
209     AC_SUBST(sqlite_lib)
210     AC_SUBST(sqlite_lib_sh)
211     AC_SUBST(sqlite_inc)
212     else
213     AC_MSG_WARN("Can't find sqlite")
214     AC_MSG_ERROR(Please install it and rerun configuration)
215     fi
216     ])
217 gcodispo 1.1
218    
219    
220     dnl # Checks for MySQL
221     AC_DEFUN([AC_CHECK_MYSQL],
222 gcodispo 1.10 [
223     AC_MSG_RESULT(checking for mysql in:)
224     # checking command line options
225 gcodispo 1.16 AC_ARG_WITH(mysql_dir, [ --with-mysql-dir=DIR top directory containing mysql tree], mysql_dir=${withval})
226     AC_ARG_WITH(mysql_lib, [ --with-mysql-lib=DIR directory containing mysql lib], mysql_lib=${withval})
227     AC_ARG_WITH(mysql_include, [ --with-mysql-include=DIR directory containing mysql include], mysql_inc=${withval})
228 gcodispo 1.10 #
229     # if a top dir is provided
230     #
231     if test [-n] "${mysql_dir}" ; then
232     if test [-d] "${mysql_dir}/lib/mysql" ; then
233     mysql_lib=`(cd ${mysql_dir}/lib/mysql; pwd)`
234     elif test [-d] "${mysql_dir}/lib" ; then
235     mysql_lib=`(cd ${mysql_dir}/lib; pwd)`
236     else
237     AC_MSG_ERROR(mysql lib dir not found. Please check mysql installation and path)
238     fi
239     if test [-d] "${mysql_dir}/include/mysql" ; then
240     mysql_inc=`(cd ${mysql_dir}/include/mysql; pwd)`
241     elif test [-d] "${mysql_dir}/include" ; then
242     mysql_inc=`(cd ${mysql_dir}/include; pwd)`
243     else
244     AC_MSG_ERROR(mysql lib dir not found. Please check mysql installation and path)
245     fi
246     mysql_lib_sh=${mysql_lib}
247     LIBS=[" -L${mysql_lib}"]
248     fi
249     #
250     # otherwise check for libs
251     # starting from the one provided
252     #
253     if test [-n] "${mysql_lib}" ; then
254     mysql_lib=`(cd ${mysql_lib} 2>/dev/null; pwd)`
255     LIBS=[" -L${mysql_lib}"]
256     mysql_lib_sh=${mysql_lib}
257     #
258     # if not provided look in the current dir
259     #
260     else
261 gcodispo 1.1 if test -d "$srcdir/mysql" ; then
262 gcodispo 1.12 mysql_ld_path="$srcdir/mysql/lib"
263 gcodispo 1.17 mysql_inc="\$(BOSS_ROOT)/mysql/include"
264     mysql_lib="\$(BOSS_ROOT)/mysql/lib"
265     mysql_lib_sh="\\\$BOSS_ROOT/mysql/lib"
266 gcodispo 1.12 LIBS=[" -L$mysql_ld_path"]
267 gcodispo 1.1 if test -f "$srcdir/mysql/Makefile.in" ; then
268     MAKE_MYSQL_DIR="$srcdir/mysql/src/Makefile"
269     fi
270     if test -f "$srcdir/mysql/Makefile" ; then
271     MAKE_MYSQL="\$(MAKE) -C mysql"
272     MAKE_MYSQL_CLEAN="\$(MAKE) -C mysql clean"
273     AC_SUBST(MAKE_MYSQL)
274     AC_SUBST(MAKE_MYSQL_CLEAN)
275     fi
276     fi
277 gcodispo 1.10 #
278     # then in ${VO_CMS_SW_DIR}/lcg/external/mysql
279     #
280     if test x"${mysql_lib}" = x ; then
281 gcodispo 1.1 for i in \
282 gcodispo 1.8 `ls -dr ${VO_CMS_SW_DIR}/lcg/external/mysql/*4.*[^0].*/${SYSTEM} 2>/dev/null` \
283     `ls -dr ${VO_CMS_SW_DIR}/lcg/external/mysql/*5.*.*/${SYSTEM} 2>/dev/null` \
284     `ls -dr /afs/cern.ch/cms/external/lcg/external/mysql/*4.*[^0].*/${SYSTEM} 2>/dev/null` \
285     `ls -dr /afs/cern.ch/cms/external/lcg/external/mysql/*5.*.*/${SYSTEM} 2>/dev/null`
286 gcodispo 1.1 do
287     if test -f "$i/lib/libmysqlclient.so" ; then
288 gcodispo 1.2 mysql_lib=`(cd $i/lib; pwd)`
289 gcodispo 1.5 mysql_lib_sh=${mysql_lib}
290 gcodispo 1.2 mysql_inc=`(cd $i/include; pwd)`
291 gcodispo 1.5 LIBS=[" -L${mysql_lib}"]
292 gcodispo 1.1 break
293     fi
294     done
295     fi
296 gcodispo 1.10 #
297     # at the end check in a few common install locations
298     #
299     if test x"${mysql_lib}" = x ; then
300 gcodispo 1.1 for i in \
301     `ls -d ${libdir} 2>/dev/null` \
302 gcodispo 1.2 `ls -d /usr/lib/mysql/libmysqlclient.a 2>/dev/null` \
303     `ls -d /usr/lib/libmysqlclient.a 2>/dev/null` \
304     `ls -d /usr/local/lib/mysql/libmysqlclient.a 2>/dev/null` \
305     `ls -d /usr/local/lib/libmysqlclient.a 2>/dev/null` \
306     `ls -d /usr/contrib/lib/mysql/libmysqlclient.a 2>/dev/null` \
307     `ls -d /usr/contrib/lib/libmysqlclient.a 2>/dev/null`
308 gcodispo 1.1 do
309 gcodispo 1.2 if test -f "$i" ; then
310     mysql_lib=`dirname $i`
311 gcodispo 1.5 mysql_lib_sh=${mysql_lib}
312     LIBS=[" -L${mysql_lib}"]
313 gcodispo 1.2 # echo $mysql_inc
314 gcodispo 1.1 break
315     fi
316     done
317 gcodispo 1.2 if test x"${mysql_lib}" != x; then
318     for i in \
319     `ls -d ${includedir} 2>/dev/null` \
320     `ls -d /usr/include/mysql/mysql.h 2>/dev/null` \
321     `ls -d /usr/include/mysql.h 2>/dev/null` \
322     `ls -d /usr/local/include/mysql/mysql.h 2>/dev/null` \
323     `ls -d /usr/local/include/mysql.h 2>/dev/null` \
324     `ls -d /usr/contrib/include/mysql/mysql.h 2>/dev/null` \
325     `ls -d /usr/contrib/include/mysql.h 2>/dev/null`
326     do
327     if test -f "$i" ; then
328     mysql_inc=`dirname $i`
329     # echo $mysql_inc
330     break
331     fi
332     done
333     fi
334 gcodispo 1.1 fi
335 gcodispo 1.10 fi
336     #
337 gcodispo 1.13 # now check if the include dir is there
338     #
339     if test [-n] "${mysql_inc}" ; then
340     test -z "${mysql_ld_path}" && mysql_inc=`(cd ${mysql_inc}; pwd)`
341     else
342     AC_MSG_ERROR(mysql include dir not found. Please check mysql installation and path)
343     fi
344     AC_MSG_RESULT(-> $mysql_inc)
345     #
346     #
347 gcodispo 1.10 # check if the library is actually there
348     #
349     AC_MSG_RESULT(-> $mysql_lib)
350     if test x"${MAKE_MYSQL}" = x ; then
351     AC_CHECK_LIB([mysqlclient], [main], [
352 gcodispo 1.13 test -z "${mysql_ld_path}" && mysql_ld_path="${mysql_lib}"
353 gcodispo 1.12 for p in `ldd ${mysql_ld_path}/libmysqlclient.so`; do
354 gcodispo 1.10 case $p in
355     *ssl* )
356     ssl="yes"
357     ;;
358     * )
359     ;;
360     esac
361     done
362     if test "${ssl}" = "yes" ; then
363     AC_MSG_RESULT([-> found ssl dependency in mysl])
364     AC_CHECK_LIB([ssl], [main], , AC_MSG_ERROR(Missing ssl library needed by mysql))
365     ssl_lib="-lssl"
366 gcodispo 1.2 # if test -f "/usr/lib/libssl.a" ; then
367     # ssl_lib="/usr/lib/libssl.a"
368     # else
369     # AC_MSG_WARN(found only dynamic library for ssl)
370     # AC_MSG_WARN(your mysql dbUpdator may not work always)
371     # echo -e "\tPRESS ANY KEY TO CONTINUE"
372     # read -n 1 junk
373     # ssl_lib="-lssl"
374     # fi
375 gcodispo 1.10 AC_SUBST(ssl_lib)
376     fi
377     ], [
378     AC_MSG_ERROR(mysqlclient library not found. Please check mysql installation and path)
379     ])
380     fi
381     # perform variable substitution
382     #
383     if test -n "${mysql_lib}" && test -n "${mysql_inc}" ; then
384     mysql=mysql
385     AC_SUBST(mysql)
386     AC_SUBST(mysql_lib)
387     AC_SUBST(mysql_lib_sh)
388     AC_SUBST(mysql_inc)
389     else
390     echo "${mysql_lib}"
391     AC_MSG_WARN("Can't find mysql")
392     AC_MSG_ERROR(Please install it and rerun configuration)
393     fi
394    
395     ])
396 gcodispo 1.2
397    
398    
399 gcodispo 1.10 dn1 # Checks for Clarens libs
400 gcodispo 1.2 AC_DEFUN([AC_CHECK_CLARENS],
401 gcodispo 1.10 [
402     # AC_MSG_RESULT(checking for clarens in:)
403     # checking command line options
404 gcodispo 1.16 AC_ARG_WITH(clarens_dir, [ --with-clarens-dir=DIR top directory containing clarens tree], clarens_dir=${withval})
405     AC_ARG_WITH(clarens_lib, [ --with-clarens-lib=DIR directory containing clarens lib], clarens_lib=${withval})
406     AC_ARG_WITH(clarens_include, [ --with-clarens-include=DIR directory containing clarens include], clarens_inc=${withval})
407 gcodispo 1.2
408     clarens_lib=""
409     clarens_inc=""
410     clarens=""
411 gcodispo 1.10 clarens_lib_sh=""
412 gcodispo 1.2 AC_SUBST(clarens)
413 gcodispo 1.10 AC_SUBST(clarens_inc)
414 gcodispo 1.2 AC_SUBST(clarens_lib)
415 gcodispo 1.10 AC_SUBST(clarens_lib_sh)
416 gcodispo 1.2
417     ])
418    
419 gcodispo 1.10
420     dn1 # Checks for monalisa libs
421 gcodispo 1.2 AC_DEFUN([AC_CHECK_MONALISA],
422 gcodispo 1.10 [
423     AC_MSG_RESULT(checking for MonaLisa in:)
424     # checking command line options
425 gcodispo 1.16 AC_ARG_WITH(monalisa_dir, [ --with-monalisa-dir=DIR top directory containing monalisa tree], monalisa_dir=${withval})
426     AC_ARG_WITH(monalisa_lib, [ --with-monalisa-lib=DIR directory containing monalisa lib], monalisa_lib=${withval})
427 gcodispo 1.10 AC_ARG_WITH(monalisa_include, [ --with-monalisa-include=DIR directory containing monalisa lib], monalisa_inc=${withval})
428     #
429     # if a top dir is provided
430     #
431     if test [-n] "${monalisa_dir}" ; then
432     if test [-d] "${monalisa_dir}/lib" ; then
433     monalisa_lib=`(cd ${monalisa_dir}/lib; pwd)`
434     else
435     AC_MSG_ERROR(monalisa lib dir not found. Please check monalisa installation and path)
436     fi
437     if test [-d] "${monalisa_dir}/include" ; then
438     monalisa_inc=`(cd ${monalisa_dir}/include; pwd)`
439     else
440     AC_MSG_ERROR(monalisa include dir not found. Please check monalisa installation and path)
441     fi
442     monalisa_lib_sh=${monalisa_lib}
443     LIBS=[" -L${monalisa_lib}"]
444     fi
445     #
446     # otherwise check for libs
447     # starting from the one provided
448     #
449     if test [-n] "${monalisa_lib}" ; then
450     test -d "${monalisa_lib}" && monalisa_lib=`(cd ${monalisa_lib}; pwd)`
451     LIBS=[" -L${monalisa_lib}"]
452     monalisa_lib_sh=${monalisa_lib}
453     #
454     # if not provided look in the current dir
455     #
456     else
457 gcodispo 1.2 if test -d "$srcdir/MonaLisa" ; then
458 gcodispo 1.13 monalisa_ld_path="$srcdir/MonaLisa/lib"
459 gcodispo 1.17 monalisa_inc="\$(BOSS_ROOT)/MonaLisa/include"
460     monalisa_lib="\$(BOSS_ROOT)/MonaLisa/lib"
461     monalisa_lib_sh="\\\$BOSS_ROOT/MonaLisa/lib"
462 gcodispo 1.13 LIBS=[" -L$monalisa_ld_path"]
463 gcodispo 1.2 if test -f "$srcdir/MonaLisa/Makefile.in" ; then
464     MAKE_MONALISA_DIR="$srcdir/MonaLisa/src/Makefile"
465     fi
466     if test -f "$srcdir/MonaLisa/Makefile" ; then
467     MAKE_MONALISA="\$(MAKE) -C MonaLisa"
468     MAKE_MONALISA_CLEAN="\$(MAKE) -C MonaLisa clean"
469     AC_SUBST(MAKE_MONALISA)
470     AC_SUBST(MAKE_MONALISA_CLEAN)
471     fi
472     fi
473 gcodispo 1.10 #
474     # then in ${VO_CMS_SW_DIR}/lcg/app/releases/MonaLisa
475     #
476     if test x"${monalisa_lib}" = x ; then
477 gcodispo 1.2 for i in \
478     `ls -dr ${VO_CMS_SW_DIR}/lcg/app/releases/MonaLisa 2>/dev/null` \
479     `ls -dr /afs/cern.ch/cms/external/lcg/app/releases/MonaLisa 2>/dev/null`
480     do
481     if test -f "$i/lib/libMonaLisa.so" ; then
482     monalisa_lib=`(cd $i/lib; pwd)`
483     monalisa_inc=`(cd $i/include; pwd)`
484 gcodispo 1.5 monalisa_lib_sh=${monalisa_lib}
485     LIBS=[" -L${monalisa_lib}"]
486 gcodispo 1.2 break
487     fi
488     done
489     fi
490     fi
491 gcodispo 1.10 #
492     # check if the library is actually there
493     #
494     AC_MSG_RESULT(-> $monalisa_lib)
495     if test x"${MAKE_MONALISA}" = x ; then
496     AC_CHECK_LIB([apmoncpp], [main], ,[
497     AC_MSG_ERROR(MonaLisa library not found. Please check MonaLisa installation and path)
498     ])
499     fi
500     #
501     # now check if the include dir is there
502     #
503     AC_MSG_RESULT(-> $monalisa_inc)
504     if test [-n] "${monalisa_inc}"; then
505 gcodispo 1.13 test -z "${monalisa_ld_path}" && monalisa_inc=`(cd ${monalisa_inc}; pwd)`
506 gcodispo 1.10 else
507     AC_MSG_ERROR( monalisa include dir not found. Please check monalisa installation and path)
508     fi
509     #
510     # perform variable substitution
511     #
512     if test -n "${monalisa_lib}" && test -n "${monalisa_inc}" ; then
513     monalisa=monalisa
514     AC_SUBST(monalisa)
515     AC_SUBST(monalisa_lib)
516     AC_SUBST(monalisa_lib_sh)
517     AC_SUBST(monalisa_inc)
518     else
519     AC_MSG_WARN("Can't find monalisa")
520     AC_MSG_ERROR(Please install it and rerun configuration)
521     fi
522 gcodispo 1.1
523 gcodispo 1.10 ])
524 gcodispo 1.9
525    
526     AC_DEFUN([AC_CHECK_PYTHON],
527     [
528     for p in `python -V 2>/dev/stdout | cut -d ' ' -f 2` ; do
529     case "$p" in
530     2.*.* | 2.* )
531     AC_MSG_RESULT(found python version: "$p")
532     MAKE_PYTHON="\$(MAKE) -C BossPython"
533     MAKE_PYTHON_CLEAN="\$(MAKE) -C BossPython clean"
534     AC_SUBST(MAKE_PYTHON)
535     AC_SUBST(MAKE_PYTHON_CLEAN)
536     break
537     ;;
538     * )
539     break
540     ;;
541     esac
542     done
543     if test x"${MAKE_PYTHON}" = x ; then
544     AC_MSG_WARN("Not found: python 2.*")
545     fi
546     for p in `swig -version 2>/dev/stdout | cut -d ' ' -f 3` ; do
547     case "$p" in
548     1.*.* | 1.* )
549     AC_MSG_RESULT(found swig version: "$p")
550     swig_generate=generate
551     AC_SUBST(swig_generate)
552     break
553     ;;
554     * )
555     break
556     ;;
557     esac
558     done
559     if test x"${swig_generate}" = x ; then
560     AC_MSG_WARN("Not found: swig 1.*")
561     fi
562     ]
563     )
564 gcodispo 1.10
565 gcodispo 1.20 # AC_CHECK_LIB([libz], [main])
566     AC_DEFUN([AC_CHECK_ZLIB],
567     [
568     # checking command line options
569     AC_ARG_WITH(zlib_dir, [ --with-zlib-dir=DIR top directory containing zlib tree], zlib_dir=${withval})
570     AC_ARG_WITH(zlib_lib, [ --with-zlib-lib=PATH directory containig the zlib library], zlib_lib=${withval})
571     AC_ARG_WITH(zlib_include, [ --with-zlib-include=PATH directory containig the zlib.h include file ], zlib_inc=${withval})
572     #
573     # if a top dir is provided
574     #
575     if test [-n] "${zlib_dir}" ; then
576     if test [-d] "${zlib_dir}/lib" ; then
577     zlib_lib=`(cd ${zlib_dir}/lib; pwd)`
578     else
579     AC_MSG_ERROR(zlib lib dir not found. Please check zlib installation and path)
580     fi
581     if test [-d] "${zlib_dir}/include" ; then
582     zlib_inc=`(cd ${zlib_dir}/include; pwd)`
583     else
584     AC_MSG_ERROR(zlib include dir not found. Please check zlib installation and path)
585     fi
586     fi
587    
588     #
589     # otherwise check for libs
590     # starting from the one provided
591     #
592     if test [-z] "${zlib_lib}" ; then
593     zlib_inc="/usr/include"
594     zlib_lib="/usr/lib"
595     elif test [-d] "${zlib_lib}" ; then
596     test [-f] "${zlib_lib}/libz.so" ||
597     AC_MSG_ERROR([${zlib_lib}/libz.so not found.])
598     test [-f] "${zlib_lib}/libz.a" ||
599     AC_MSG_ERROR([${zlib_lib}/libz.a not found.])
600     zlib_lib=`cd ${zlib_lib}; pwd`
601     AC_MSG_RESULT([checking for ${zlib_lib}/libz.so])
602     LIBS=[" -L${zlib_lib}"]
603     else
604     AC_MSG_ERROR([zlib directory not found: ${zlib_lib}])
605     fi
606     #
607     AC_CHECK_LIB([z], [main], ,[
608     AC_MSG_ERROR([Library zlib not found in ${zlib_lib}])
609     ])
610     #
611     # now check if the include dir is there
612     #
613     if test [-f] "${zlib_inc}/zlib.h" ; then
614     zlib_inc=`cd ${zlib_inc}; pwd`
615     AC_MSG_RESULT([checking for ${zlib_inc}/zlib.h... yes])
616     else
617     AC_MSG_WARN([checking for ${zlib_inc}/zlib.h... not found!])
618     AC_MSG_ERROR([Please specify a valid path for zlib.h])
619     fi
620     #
621     # perform variable substitution
622     #
623     if test -n "${zlib_lib}" && test -n "${zlib_inc}" ; then
624     zlib=zlib
625     AC_SUBST(zlib_lib)
626     AC_SUBST(zlib_inc)
627     else
628     AC_MSG_WARN("Missing gzip compression library libz.a and libz.so needed by MySQL client library mysqlclient")
629     AC_MSG_ERROR(Please install it and rerun configuration)
630     fi
631     ]
632     )
633    
634    
635 gcodispo 1.10 # AC_CHECK_LIB([uuid], [main])
636     AC_DEFUN([AC_CHECK_UUID],
637     [
638 gcodispo 1.15 # checking command line options
639 gcodispo 1.16 AC_ARG_WITH(uuid_dir, [ --with-uuid-dir=DIR top directory containing uuid tree], uuid_dir=${withval})
640     AC_ARG_WITH(uuid_lib, [ --with-uuid-lib=PATH directory containig the uuid library], uuid_lib=${withval})
641     AC_ARG_WITH(uuid_include, [ --with-uuid-include=PATH directory containig the uuid.h include file ], uuid_inc=${withval})
642 gcodispo 1.15 #
643     # if a top dir is provided
644     #
645     if test [-n] "${uuid_dir}" ; then
646     if test [-d] "${uuid_dir}/lib" ; then
647     uuid_lib=`(cd ${uuid_dir}/lib; pwd)`
648     else
649     AC_MSG_ERROR(uuid lib dir not found. Please check uuid installation and path)
650     fi
651     if test [-d] "${uuid_dir}/include" ; then
652     uuid_inc=`(cd ${uuid_dir}/include; pwd)`
653     else
654     AC_MSG_ERROR(uuid include dir not found. Please check uuid installation and path)
655     fi
656     fi
657    
658     #
659     # otherwise check for libs
660     # starting from the one provided
661     #
662 gcodispo 1.14 if test [-z] "${uuid_lib}" ; then
663     uuid_inc="/usr/include/uuid/"
664     uuid_lib="/usr/lib"
665     elif test [-d] "${uuid_lib}" ; then
666     test [-f] "${uuid_lib}/libuuid.so" ||
667     AC_MSG_ERROR([${uuid_lib}/libuuid.so not found.])
668     uuid_lib=`cd ${uuid_lib}; pwd`
669     AC_MSG_RESULT([checking for ${uuid_lib}/libuuid.so])
670     LIBS=[" -L${uuid_lib}"]
671 gcodispo 1.10 else
672 gcodispo 1.14 AC_MSG_ERROR([uuid-lib directory not found: ${uuid_lib}])
673 gcodispo 1.10 fi
674     #
675 gcodispo 1.14 AC_CHECK_LIB([uuid], [main], ,[
676     AC_MSG_ERROR([Library uuid not found in ${uuid_lib}])
677     ])
678     #
679 gcodispo 1.15 # now check if the include dir is there
680     #
681 gcodispo 1.14 if test [-f] "${uuid_inc}/uuid.h" ; then
682     uuid_inc=`cd ${uuid_inc}; pwd`
683     AC_MSG_RESULT([checking for ${uuid_inc}/uuid.h... yes])
684 gcodispo 1.10 else
685 gcodispo 1.14 AC_MSG_WARN([checking for ${uuid_inc}/uuid.h... not found!])
686     AC_MSG_ERROR([Please specify a valid path for uuid.h])
687 gcodispo 1.10 fi
688 gcodispo 1.14 #
689     # perform variable substitution
690     #
691     if test -n "${uuid_lib}" && test -n "${uuid_inc}" ; then
692     uuid=uuid
693     AC_SUBST(uuid_lib)
694     AC_SUBST(uuid_inc)
695     else
696     AC_MSG_WARN("Can't find uuid")
697     AC_MSG_ERROR(Please install it and rerun configuration)
698     fi
699 gcodispo 1.10 ]
700 gcodispo 1.16 )
701    
702    
703 gcodispo 1.18 # AC_CHECK_LIB([xercesc], [main])
704     AC_DEFUN([AC_CHECK_XERCESC],
705     [
706 gcodispo 1.19 AC_MSG_RESULT(checking for XercesC in:)
707 gcodispo 1.18 # checking command line options
708     AC_ARG_WITH(xercesc_dir, [ --with-xercesc-dir=DIR top directory containing xercesc tree], xercesc_dir=${withval})
709     AC_ARG_WITH(xercesc_lib, [ --with-xercesc-lib=PATH directory containig the xercesc library], xercesc_lib=${withval})
710     AC_ARG_WITH(xercesc_include, [ --with-xercesc-include=PATH directory containig the xercesc.h include file ], xercesc_inc=${withval})
711     #
712     # if a top dir is provided
713     #
714     if test [-n] "${xercesc_dir}" ; then
715     if test [-d] "${xercesc_dir}/lib" ; then
716     xercesc_lib=`(cd ${xercesc_dir}/lib; pwd)`
717     xercesc_lib_sh=${xercesc_lib}
718     else
719     AC_MSG_ERROR(xercesc lib dir not found. Please check xercesc installation and path)
720     fi
721     if test [-d] "${xercesc_dir}/include" ; then
722     xercesc_inc=`(cd ${xercesc_dir}/include; pwd)`
723     else
724     AC_MSG_ERROR(xercesc include dir not found. Please check xercesc installation and path)
725     fi
726     LIBS=[" -L${xercesc_lib}"]
727     fi
728     #
729     # otherwise check for libs
730     # starting from the one provided
731     #
732     if test [-n] "${xercesc_lib}" ; then
733     test -d "${xercesc_lib}" && xercesc_lib=`(cd ${xercesc_lib}; pwd)`
734     LIBS=[" -L${xercesc_lib}"]
735     xercesc_lib_sh=${xercesc_lib}
736     #
737     # if not provided look in the current dir
738     #
739     else
740     if test -d "$srcdir/xercesc" ; then
741     xercesc_ld_path="$srcdir/xercesc/lib"
742     xercesc_inc="\$(BOSS_ROOT)/xercesc/include"
743     xercesc_lib="\$(BOSS_ROOT)/xercesc/lib"
744     xercesc_lib_sh="\\\$BOSS_ROOT/xercesc/lib"
745     LIBS=[" -L$xercesc_ld_path"]
746     if test -f "$srcdir/xercesc/src/Makefile.in" ; then
747     MAKE_XERCESC_DIR="$srcdir/xercesc/src/Makefile"
748     fi
749     if test -f "$srcdir/xercesc/Makefile" ; then
750     MAKE_XERCESC="\$(MAKE) -C xercesc"
751     MAKE_XERCESC_CLEAN="\$(MAKE) -C xercesc clean"
752     AC_SUBST(MAKE_XERCESC)
753     AC_SUBST(MAKE_XERCESC_CLEAN)
754     fi
755     fi
756     #
757     # then in ${VO_CMS_SW_DIR}/lcg/external/xercesc
758     #
759     if test x"${xercesc_lib}" = x ; then
760     for i in \
761     `ls -dr ${VO_CMS_SW_DIR}/lcg/external/xerces-c/2.*.*/${SYSTEM} 2>/dev/null` \
762     `ls -dr /afs/cern.ch/cms/external/lcg/external/XercesC/2.*.*/${SYSTEM} 2>/dev/null`
763     do
764     if test -f "$i/lib/libxerces-c.so" ; then
765     xercesc_lib=`(cd $i/lib; pwd)`
766     xercesc_lib_sh=${xercesc_lib}
767     xercesc_inc=`(cd $i/include; pwd)`
768     LIBS=[" -L${xercesc_lib}"]
769     break
770     fi
771     done
772     fi
773     #
774     # at the end check in a few common install locations
775     #
776     if test x"${xercesc_lib}" = x ; then
777     for i in \
778     `ls -d ${libdir} 2>/dev/null` \
779     `ls -d /usr/lib/xercesc/libxerces-c.so 2>/dev/null` \
780     `ls -d /usr/lib/libxerces-c.so 2>/dev/null` \
781     `ls -d /usr/local/lib/xercesc/libxerces-c.so 2>/dev/null` \
782     `ls -d /usr/local/lib/libxerces-c.so 2>/dev/null` \
783     `ls -d /usr/contrib/lib/xercesc/libxerces-c.so 2>/dev/null` \
784     `ls -d /usr/contrib/lib/libxerces-c.so 2>/dev/null`
785     do
786     if test -f "$i" ; then
787     xercesc_lib=`dirname $i`
788     xercesc_lib_sh=${xercesc_lib}
789     LIBS=[" -L${xercesc_lib}"]
790     # echo $xercesc_inc
791     break
792     fi
793     done
794     if test x"${xercesc_lib}" != x; then
795     for i in \
796     `ls -d ${includedir} 2>/dev/null` \
797     `ls -d /usr/include/xercesc/dom/DOM.hpp 2>/dev/null` \
798     `ls -d /usr/local/include/xercesc/dom/DOM.hpp 2>/dev/null` \
799     `ls -d /usr/contrib/include/xercesc/dom/DOM.hpp 2>/dev/null`
800     do
801     if test -f "$i" ; then
802     xercesc_inc=`dirname $i`
803     break
804     fi
805     done
806     fi
807     fi
808     fi
809     #
810 gcodispo 1.19 # check if the library is actually there
811     #
812     AC_MSG_RESULT(-> $xercesc_lib)
813     if test x"${MAKE_XERCESC}" = x ; then
814     AC_CHECK_LIB([xerces-c], [main], , [
815     AC_MSG_ERROR(xerces-c library not found. Please check xercesc installation and path)])
816     fi
817     #
818 gcodispo 1.18 # now check if the include dir is there
819     #
820 gcodispo 1.19 AC_MSG_RESULT(-> $xercesc_inc)
821 gcodispo 1.18 if test [-n] "${xercesc_inc}" ; then
822     test -z "${xercesc_ld_path}" && xercesc_inc=`(cd ${xercesc_inc}; pwd)`
823     else
824     AC_MSG_ERROR([xercesc include dir not found. Please check xercesc installation and path])
825     fi
826    
827 gcodispo 1.19 # if test [-f] "${xercesc_inc}/xercesc/dom/DOM.hpp" ; then
828     # AC_MSG_RESULT([checking for ${xercesc_inc}/xercesc/dom/DOM.hpp... yes])
829     # else
830     # AC_MSG_WARN([checking for ${xercesc_inc}/xercesc/dom/DOM.hpp... not found!])
831     # AC_MSG_ERROR([Please specify a valid path for xercesc/dom/DOM.hpp])
832     # fi
833 gcodispo 1.18 #
834     # perform variable substitution
835     #
836     if test -n "${xercesc_lib}" && test -n "${xercesc_inc}" ; then
837     xercesc=xercesc
838     AC_SUBST(xercesc)
839     AC_SUBST(xercesc_lib)
840     AC_SUBST(xercesc_lib_sh)
841     AC_SUBST(xercesc_inc)
842     else
843     AC_MSG_WARN("Can't find xercesc")
844     AC_MSG_ERROR(Please install it and rerun configuration)
845     fi
846     ]
847     )
848