source: trunk/FACT++/configure.ac@ 10848

Last change on this file since 10848 was 10830, checked in by tbretz, 14 years ago
Added support for _GNU_SOURCE as needed by the event-builder.
File size: 14.7 KB
Line 
1######################################################################
2# Autoconf initial setup
3######################################################################
4
5#[AC_]PACKAGE_NAME
6#[AC_]PACKAGE_TARNAME
7#[AC_]PACKAGE_VERSION
8#[AC_]PACKAGE_STRING
9#[AC_]PACKAGE_BUGREPORT
10AC_INIT([FACT++],[1.0],[thomas.bretz@epfl.ch],[FACTpp],[http://hello.example.com/])
11AC_PREREQ([2.65])
12AC_CONFIG_FILES([Makefile]) # causes x/Makefile.in to be created if x/Makefile.am exists
13#AC_CONFIG_HEADERS([config.h])
14AC_CONFIG_MACRO_DIR([.macro_dir])
15AC_CONFIG_AUX_DIR([.aux_dir])
16
17AC_PROG_CC([colorgcc gcc])
18AC_PROG_CXX([colorgcc g++])
19
20######################################################################
21# GNUC extension support (needed for the evnt builder)
22######################################################################
23
24AC_USE_SYSTEM_EXTENSIONS(_GNU_SOURCE)
25
26######################################################################
27# Setup the libtool and the language
28######################################################################
29
30LT_INIT([disable-static])
31AC_LANG(C++)
32#AC_PATH_XTRA
33
34######################################################################
35# Automake initial setup
36######################################################################
37
38AM_INIT_AUTOMAKE([1.11 -Wall subdir-objects std-options no-define color-tests parallel-tests silent-rules])
39AM_SILENT_RULES([yes])
40AM_PROG_CC_C_O
41
42######################################################################
43# DOXYGEN SUPPORT
44######################################################################
45
46### FIXME: Need a configure commandline switch
47DX_ENV_APPEND(EXTRACT_ALL, YES)
48DX_ENV_APPEND(RECURSIVE, YES)
49DX_ENV_APPEND(ALL_GRAPHS, NO) # change to yes to switch on call(er) graphs
50
51#DX_DOXYGEN_FEATURE(ON)
52#DX_DOT_FEATURE(ON) # sets HAVE_DOT
53#DX_HTML_FEATURE(ON) # sets GENERATE_HTML (default)
54#DX_CHM_FEATURE(ON|OFF) # sets GENERATE_HTMLHELP
55#DX_CHI_FEATURE(ON|OFF) # sets GENERATE_CHI
56#DX_MAN_FEATURE(ON) # sets GENERATE_MAN (segfaults)
57#DX_RTF_FEATURE(ON|OFF) # sets GENERATE_RTF
58#DX_XML_FEATURE(ON|OFF) # sets GENERATE_XML
59#DX_PDF_FEATURE(ON|OFF) # sets GENERATE_PDF (default)
60DX_PS_FEATURE(OFF) # sets GENERATE_PS (default)
61DX_INIT_DOXYGEN($PACKAGE_NAME)#, DOXYFILE-PATH, [OUTPUT-DIR])
62
63#USE_HTAGS = $(USE_HTAGS)
64
65######################################################################
66# pthread/Readline/NCurses (pthread needed by dim and boost)
67######################################################################
68
69AC_LANG_PUSH(C)
70
71# Check for math library (some linux need this to compile cfitsio)
72AC_CHECK_LIB([m],[cos])
73
74# Needed to compile dim
75ACX_PTHREAD
76
77CPPFLAGS+=" "$PTHREAD_CFLAGS" "
78LDFLAGS+=" "$PTHREAD_CFLAGS" "
79
80
81# Needed to compile FACT++
82AC_CHECK_READLINE
83
84if test "x$have_readline" != "xyes"; then
85 AC_MSG_ERROR([The readline library is not properly installed.])
86fi
87
88CPPFLAGS+=" "$READLINE_INCLUDES" "
89LDFLAGS+=" "$READLINE_LIBS" "
90
91# Needed to compile FACT++
92AC_CHECK_HEADERS([panel.h],,
93 AC_MSG_ERROR([ncurses header not found]))
94
95# Needed to compile FACT++
96AC_CHECK_LIB(panel, update_panels,,
97 AC_MSG_ERROR([ncurses panel library not found]))
98
99# Xm.h (lesstif/motif, needed to compile did)
100AC_FIND_MOTIF
101
102CPPFLAGS+=" "$MOTIF_INCL" "
103LDFLAGS+=" "$MOTIF_LDFLAGS" "
104
105AM_COND_IF(HAS_LIBXP,,
106 AC_MSG_WARN([ Motif/lesstif not found!])
107)
108
109# Needed to compile FACT++
110AC_CHECK_PACKAGE(cfitsio, ffpss, cfitsio, fitsio.h,
111 HAVE_CFITSIO=yes, HAVE_CFITSIO=no)
112
113#AC_CHECK_HEADERS([fitsio.h],,AC_MSG_ERROR([cfitsio headers not found]))
114#AC_CHECK_LIB([cfitsio], main,,AC_MSG_ERROR([cfitsio library not found]))
115
116AC_LANG_POP
117
118# Needed to compile FACT++
119AC_CHECK_PACKAGE(ccfits, main, CCfits, CCfits/CCfits,
120 HAVE_CCFITS=yes, HAVE_CCFITS=no)
121
122#AC_CHECK_HEADERS([CCfits/CCfits],,
123# AC_MSG_ERROR(CCfits headers not found))
124#AC_CHECK_LIB(CCfits, main,,
125# AC_MSG_ERROR(CCfits library not found))
126
127######################################################################
128# MySQL(++) SUPPORT
129######################################################################
130
131# Needed to compile FACT++
132MYSQL_DEVEL
133MYSQLPP_DEVEL
134
135LDFLAGS+=" -lmysqlpp "
136
137######################################################################
138# BOOST SUPPORT
139######################################################################
140
141# Needed to compile FACT++
142AX_BOOST_BASE([1.40], [],
143 AC_MSG_ERROR([The boost C++ libraries (>=1.40) are not properly installed.])
144)
145
146AC_MSG_CHECKING([for BOOST_CPPFLAGS])
147AC_MSG_RESULT([$BOOST_CPPFLAGS])
148
149AC_MSG_CHECKING([for BOOST_LDFLAGS])
150AC_MSG_RESULT([$BOOST_LDFLAGS])
151
152# Keep this order AX_BOOST_FILESYSTEM needs AX_BOOST_SYSTEM_LIB
153AX_BOOST_SYSTEM
154AX_BOOST_ASIO
155AX_BOOST_DATE_TIME
156AX_BOOST_FILESYSTEM
157AX_BOOST_PROGRAM_OPTIONS
158AX_BOOST_REGEX
159AX_BOOST_THREAD
160#AX_BOOST_IOSTREAMS
161#AX_BOOST_PYTHON
162#AX_BOOST_SERIALIZATION
163#AX_BOOST_SIGNALS
164#AX_BOOST_TEST_EXEC_MONITOR
165#AX_BOOST_UNIT_TEST_FRAMEWORK
166#AX_BOOST_WAVE
167#AX_BOOST_WSERIALIZATION
168
169LDFLAGS+=" "$BOOST_LDFLAGS
170LDFLAGS+=" "$BOOST_SYSTEM_LIB
171LDFLAGS+=" "$BOOST_ASIO_LIB
172LDFLAGS+=" "$BOOST_DATE_TIME_LIB
173LDFLAGS+=" "$BOOST_FILESYSTEM_LIB
174LDFLAGS+=" "$BOOST_PROGRAM_OPTIONS_LIB
175LDFLAGS+=" "$BOOST_REGEX_LIB
176LDFLAGS+=" "$BOOST_THREAD_LIB" "
177
178CPPFLAGS+=" "$BOOST_CPPFLAGS" "
179
180#AC_CHECK_HEADERS(
181# [\
182# boost/bind.hpp \
183# boost/lexical_cast.hpp \
184# boost/filesystem.hpp \
185# boost/thread.hpp \
186# boost/function.hpp \
187# boost/regex.hpp \
188# boost/asio.hpp \
189# boost/enable_shared_from_this.hpp \
190# boost/asio/deadline_timer.hpp \
191# boost/date_time/posix_time/posix_time.hpp \
192# boost/date_time/local_time/local_time.hpp \
193# boost/date_time/gregorian/gregorian.hpp
194# ], [],
195# [
196# echo "Error! At least one needed header of the boost C++ libararies is missing."
197# exit -1
198# ]
199#)
200
201######################################################################
202# QT4/GUI SUPPORT
203######################################################################
204
205AC_ARG_WITH([qt4],
206 [AS_HELP_STRING([--without-qt4], [Disable qt4, i.e. disable gui support.])],
207 [], [QT4_DO_IT_ALL])
208
209######################################################################
210# ROOT SUPPORT
211######################################################################
212
213AC_ARG_WITH([root],
214 [AS_HELP_STRING([--without-root], [Disable root, i.e. disable gui support.])],
215 [], [ROOT_PATH([5.12/00])]
216)
217
218if test "$ROOTEXEC" != no ;
219then
220
221 ROOTCPPFLAGS=$ROOTCFLAGS" "$ROOTAUXCFLAGS
222 ROOTLDFLAGS="-L"$ROOTLIBDIR" -lGQt "
223
224 #AC_CHECK_PROG(HAVE_ROOT_QT, libGQt.so.$ROOTSOVERSION, yes, no, $ROOTLIBDIR)
225 #AC_CHECK_PROG(HAVE_GQT, libGQt.so.$ROOTSOVERSION, yes, no, $LD_LIBRARY_PATH)
226
227 # It seems it dooesn't work on older root versions
228 ROOT_FEATURE([qt], [HAVE_ROOT_QT=yes])
229
230 AC_SUBST(ROOTCPPFLAGS)
231 AC_SUBST(ROOTLDFLAGS)
232fi
233
234
235######################################################################
236# Check if we have colordiff to colorize 'svn diff'
237######################################################################
238
239# Nice to have to support colored diff
240AC_CHECK_PROG(COLORDIFF, colordiff, colordiff, cat)
241AC_CHECK_PROG(GROFF, groff, yes, no)
242AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no)
243AC_CHECK_PROG(HELP2MAN, help2man, yes, no)
244
245##########################################################################
246# debug compilation support
247##########################################################################
248#
249#AC_MSG_CHECKING([whether to build with debug information])
250#AC_ARG_ENABLE([debug],
251# [AS_HELP_STRING([--enable-debug],
252# [enable debug data generation (def=no)])],
253# [debugit="$enableval"],
254# [debugit=no])
255#AC_MSG_RESULT([$debugit])
256#
257#if test x"$debugit" = x"yes"; then
258# AC_DEFINE([DEBUG],[],[Debug Mode])
259# AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
260#else
261# AC_DEFINE([NDEBUG],[],[No-debug Mode])
262# AM_CXXFLAGS="$AM_CXXFLAGS -O3"
263#fi
264#
265
266##########################################################################
267# produce conditionals for Makefile.am and for summary
268##########################################################################
269
270AM_CONDITIONAL(HAS_COLORDIFF, [test "$COLORDIFF" = colordiff])
271AM_CONDITIONAL(HAS_GROFF, [test "$GROFF" = yes])
272AM_CONDITIONAL(HAS_PS2PDF, [test "$PS2PDF" = yes])
273AM_CONDITIONAL(HAS_HELP2MAN, [test "$HELP2MAN" = yes])
274AM_CONDITIONAL(HAS_DOXYGEN, [test -n "$DX_DOXYGEN"])
275AM_CONDITIONAL(HAS_DOT, [test -n "$DX_DOT"])
276AM_CONDITIONAL(HAS_COLORGCC, [test "$GCC" = colorgcc])
277AM_CONDITIONAL(HAS_QT4, [test -n "$QT4_VERSION"])
278AM_CONDITIONAL(HAS_ROOT, [test "$ROOTEXEC" != no])
279AM_CONDITIONAL(HAS_ROOT_QT, [test "$HAVE_ROOT_QT" = yes])
280AM_CONDITIONAL(HAS_GUI, [test "$QT4_VERSION" -a "$HAVE_ROOT_QT" = yes])
281AM_CONDITIONAL(HAS_CFITSIO, [test "$HAVE_CFITSIO" = yes])
282AM_CONDITIONAL(HAS_CCFITS, [test "$HAVE_CCFITS" = yes])
283AM_CONDITIONAL(HAS_FITS, [test "$HAVE_CFITSIO" = yes -a "$HAVE_CCFITS" = yes])
284
285AM_CONDITIONAL(IS_FALSE, [test "x" = "y"])
286AM_CONDITIONAL(IS_TRUE, [test "x" = "x"])
287
288AM_COND_IF(HAS_FITS, [AC_DEFINE(HAVE_FITS)], )
289AM_COND_IF(HAS_ROOT, [AC_DEFINE(HAVE_ROOT)], )
290
291##########################################################################
292# print summary
293##########################################################################
294
295AC_OUTPUT
296
297AC_MSG_NOTICE()
298AC_MSG_NOTICE(============================== summary =============================)
299AC_MSG_NOTICE()
300AC_MSG_NOTICE([ CPPFLAGS = $CPPFLAGS])
301AC_MSG_NOTICE()
302AC_MSG_NOTICE([ LDFLAGS = $LDFLAGS])
303AC_MSG_NOTICE()
304AC_MSG_NOTICE(--------------------------------------------------------------------)
305AC_MSG_NOTICE()
306AC_MSG_NOTICE([ BOOST_CPPFLAGS = $BOOST_CPPFLAGS])
307AC_MSG_NOTICE([ BOOST_LDFLAGS = $BOOST_LDFLAGS])
308AC_MSG_NOTICE()
309AM_COND_IF(HAS_QT4, [
310 AC_MSG_NOTICE(--------------------------------------------------------------------)
311 AC_MSG_NOTICE()
312 AC_MSG_NOTICE([ QT4_VERSION = $QT4_VERSION])
313 AC_MSG_NOTICE()
314 AC_MSG_NOTICE([ QT4_LIB = $QT4_LIB])
315 AC_MSG_NOTICE([ QT4_LDFLAGS = $QT4_LDFLAGS])
316 AC_MSG_NOTICE([ QT4_INCLUDES = $QT4_INCLUDES])
317 AC_MSG_NOTICE()
318 AC_MSG_NOTICE([ MOC4 = $MOC4])
319 AC_MSG_NOTICE([ UIC4 = $UIC4])
320 AC_MSG_NOTICE([ RCC4 = $RCC4])
321 AC_MSG_NOTICE()
322],[])
323AM_COND_IF(HAS_ROOT, [
324 AC_MSG_NOTICE(--------------------------------------------------------------------)
325 AC_MSG_NOTICE()
326 AC_MSG_NOTICE([ ROOTVERSION = $ROOTVERSION])
327 AC_MSG_NOTICE()
328 AC_MSG_NOTICE([ ROOTEXEC = $ROOTEXEC])
329 AC_MSG_NOTICE([ ROOTCONF = $ROOTCONF])
330 AC_MSG_NOTICE([ ROOTCINT = $ROOTCINT])
331 AC_MSG_NOTICE([ ROOTCPPFLAGS = $ROOTCPPFLAGS])
332 AC_MSG_NOTICE([ ROOTLDFLAGS = $ROOTLDFLAGS])
333 AC_MSG_NOTICE()
334],[])
335AC_MSG_NOTICE(--------------------------------------------------------------------)
336AC_MSG_NOTICE()
337AC_MSG_NOTICE([ cfitsio / 'fitsio.h' found: $HAVE_CFITSIO])
338AC_MSG_NOTICE([ CCfits / 'CCfits/CCfits' found: $HAVE_CCFITS])
339AM_COND_IF(HAS_LIBXP,
340 AC_MSG_NOTICE([ Motif/lesstif / 'Xm/Xm.h' 'libXp' found: yes]),
341 AC_MSG_NOTICE([ Motif/lesstif / 'Xm/Xm.h' 'libXp' found: no])
342)
343
344AM_COND_IF(HAS_LIBXP,
345 AC_MSG_NOTICE([ Motif/lesstif / 'Xm/Xm.h' 'libXp' found: yes]),
346 AC_MSG_NOTICE([ Motif/lesstif / 'Xm/Xm.h' 'libXp' found: no])
347)
348AM_COND_IF(HAS_COLORDIFF,
349 AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: yes]),
350 AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: no])
351)
352AM_COND_IF(HAS_HELP2MAN,[
353 AC_MSG_NOTICE([ man-pages enabled / 'help2man' found: $HELP2MAN])
354 AM_COND_IF(HAS_GROFF,
355 AC_MSG_NOTICE([ build of html enabled / 'groff' found: yes])
356 AC_MSG_NOTICE([ build of pdf enabled / 'ps2pdf' found: $PS2PDF]),
357 AC_MSG_NOTICE([ build of html and pdf / 'groff' found: no])
358 )
359],[
360 AC_MSG_NOTICE([ man, html, pdf enabled / 'help2man' found: no])
361])
362
363AM_COND_IF(HAS_DOXYGEN,
364 AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: $DX_DOXYGEN]),
365 AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: no])
366)
367AM_COND_IF(HAS_DOT,
368 AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: $DX_DOT]),
369 AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: no])
370)
371AM_COND_IF(HAS_QT4,
372 AC_MSG_NOTICE([ QT4 support enabled / QT4 toolkit found: yes]),
373 AC_MSG_NOTICE([ QT4 support enabled / QT4 toolkit found: no])
374)
375AC_MSG_NOTICE([ ROOT support enabled / root >= 5.12/00 found: $ROOTEXEC])
376AM_COND_IF(HAS_ROOT_QT,
377 AC_MSG_NOTICE([ ROOT built with --with-qt found: yes]),
378 AC_MSG_NOTICE([ ROOT built with --with-qt found: no])
379)
380AC_MSG_NOTICE()
381AC_MSG_NOTICE(--------------------------------------------------------------------)
382AC_MSG_NOTICE()
383AC_MSG_NOTICE([Suggestions and hints:])
384AC_MSG_NOTICE()
385AC_MSG_NOTICE([ - Add 'V=1' to you make-call to switch on verbose output.])
386AC_MSG_NOTICE([ - Do not try to create man-pages with doxygen,])
387AC_MSG_NOTICE([ it does most probably not work.])
388AM_COND_IF(HAS_COLORGCC,,
389 AC_MSG_NOTICE([ - Install colorgcc to get colored compiler output.])
390)
391AC_MSG_NOTICE([ - If you send me a bug report about:])
392AC_MSG_NOTICE([ + configure: please attach the file config.log])
393AC_MSG_NOTICE([ + make: please send me the output of 'make V=1'])
394AC_MSG_NOTICE()
395AC_MSG_NOTICE(--------------------------------------------------------------------)
396AC_MSG_NOTICE()
397AC_MSG_NOTICE([Some interesting build targets:])
398AC_MSG_NOTICE()
399AC_MSG_NOTICE([ diff: colored 'svn diff' if colordiff is installed])
400AM_COND_IF(HAS_HELP2MAN,[
401 AC_MSG_NOTICE([ program.man: build man-page from 'program --help'])
402 AC_MSG_NOTICE([ (display with 'man ./program.man')])
403 AM_COND_IF(HAS_GROFF,[
404 AC_MSG_NOTICE([ program.html: build html page from man-page])
405 AM_COND_IF(HAS_PS2PDF,
406 AC_MSG_NOTICE([ program.pdf: build pdf documentation from man page])
407 )
408 ])
409])
410AM_COND_IF(HAS_DOXYGEN,
411 AC_MSG_NOTICE([ doxygen-run: build html documentation with doxygen])
412 AC_MSG_NOTICE([ doxygen-doc: build html and pdf documentation with doxygen])
413)
414AC_MSG_NOTICE([ man: build all buildable documentation])
415AC_MSG_NOTICE()
416AC_MSG_NOTICE(--------------------------------------------------------------------)
417AC_MSG_NOTICE()
418AM_COND_IF(HAS_LIBXP,,
419 AC_MSG_WARN([ Motif/lesstif not found. The dim gui did will not be built!])
420)
421AM_COND_IF(HAS_FITS,,
422 AC_MSG_WARN([ FITS support disabled. cfitsio/CCfits missing!])
423)
424AM_COND_IF(HAS_ROOT,
425 [AM_COND_IF(HAS_ROOT_QT,,
426 AC_MSG_WARN([ root found but it was built without the --with-qt option])
427 )]
428)
429AM_COND_IF(HAS_GUI, [],
430 AC_MSG_WARN([ Either QT4 or qt-root is missing: GUI disabled!])
431)
432AC_MSG_NOTICE()
Note: See TracBrowser for help on using the repository browser.