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

Last change on this file since 10451 was 10445, checked in by tbretz, 14 years ago
More output; added missing BOOST flags to LDFLAGS and CPPFLAGS.
File size: 13.5 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])
16AC_PROG_CC([colorgcc gcc])
17 #If output variable CXXFLAGS was not already set, set it to -g -O2
18AC_PROG_CXX([colorgcc g++])
19LT_INIT([disable-static])
20AC_LANG(C++)
21#AC_PATH_XTRA
22
23######################################################################
24# Automake initial setup
25######################################################################
26
27AM_INIT_AUTOMAKE([1.11 -Wall subdir-objects std-options no-define color-tests parallel-tests silent-rules])
28AM_SILENT_RULES([yes])
29AM_PROG_CC_C_O
30
31######################################################################
32# DOXYGEN SUPPORT
33######################################################################
34
35### FIXME: Need a configure commandline switch
36DX_ENV_APPEND(EXTRACT_ALL, YES)
37DX_ENV_APPEND(RECURSIVE, YES)
38DX_ENV_APPEND(ALL_GRAPHS, NO) # change to yes to switch on call(er) graphs
39
40#DX_DOXYGEN_FEATURE(ON)
41#DX_DOT_FEATURE(ON) # sets HAVE_DOT
42#DX_HTML_FEATURE(ON) # sets GENERATE_HTML (default)
43#DX_CHM_FEATURE(ON|OFF) # sets GENERATE_HTMLHELP
44#DX_CHI_FEATURE(ON|OFF) # sets GENERATE_CHI
45#DX_MAN_FEATURE(ON) # sets GENERATE_MAN (segfaults)
46#DX_RTF_FEATURE(ON|OFF) # sets GENERATE_RTF
47#DX_XML_FEATURE(ON|OFF) # sets GENERATE_XML
48#DX_PDF_FEATURE(ON|OFF) # sets GENERATE_PDF (default)
49DX_PS_FEATURE(OFF) # sets GENERATE_PS (default)
50DX_INIT_DOXYGEN($PACKAGE_NAME)#, DOXYFILE-PATH, [OUTPUT-DIR])
51
52#USE_HTAGS = $(USE_HTAGS)
53
54######################################################################
55# pthread/Readline/NCurses (pthread needed by dim and boost)
56######################################################################
57
58AC_LANG_PUSH(C)
59
60# Check for math library (some linux need this to compile cfitsio)
61AC_CHECK_LIB([m],[cos])
62
63# Needed to compile dim
64ACX_PTHREAD
65
66CPPFLAGS+=" "$PTHREAD_CFLAGS" "
67LDFLAGS+=" "$PTHREAD_CFLAGS" "
68
69
70# Needed to compile FACT++
71AC_CHECK_READLINE
72
73CPPFLAGS+=" "$READLINE_INCLUDES" "
74LDFLAGS+=" "$READLINE_LIBS" "
75
76#AC_CHECK_LIB(readline, readline, [],
77# [
78# echo "Error! libreadline not found in default libarary paths."
79# exit -1
80# ]
81#)
82#AC_CHECK_HEADERS(readline/readline.h, [],
83# [
84# echo "Error! readline/readline.h not properly installed in default include path (maybe readline-dev missing)."
85# exit -1
86# ]
87#)
88#
89
90# Needed to compile FACT++
91AC_CHECK_HEADERS([panel.h],,
92 AC_MSG_ERROR([ncurses header not found]))
93
94# Needed to compile FACT++
95AC_CHECK_LIB(panel, update_panels,,
96 AC_MSG_ERROR([ncurses panel library not found]))
97
98# Needed to compile FACT++
99AC_CHECK_PACKAGE(cfitsio, ffpss, cfitsio, fitsio.h,,
100 AC_MSG_ERROR([cfitsio not properly installed/not found.]))
101
102#AC_CHECK_HEADERS([fitsio.h],,AC_MSG_ERROR([cfitsio headers not found]))
103#AC_CHECK_LIB([cfitsio], main,,AC_MSG_ERROR([cfitsio library not found]))
104
105AC_LANG_POP
106
107# Needed to compile FACT++
108AC_CHECK_PACKAGE(ccfits, main, CCfits, CCfits/CCfits,,
109 AC_MSG_ERROR([CCfits not properly installed/not found.]))
110
111#AC_CHECK_HEADERS([CCfits/CCfits],,
112# AC_MSG_ERROR(CCfits headers not found))
113#AC_CHECK_LIB(CCfits, main,,
114# AC_MSG_ERROR(CCfits library not found))
115
116
117######################################################################
118# Xm.h (lesstif/motif, needed by did)
119######################################################################
120
121# Needed to compile dim
122AC_FIND_MOTIF
123
124CPPFLAGS+=" "$MOTIF_INCL" "
125LDFLAGS+=" "$MOTIF_LDFLAGS" "
126
127#AC_CHECK_HEADERS([Mrm/MrmAppl.h], [],
128# [
129# echo "Error! Mrm/MrmAppl.h not properly installed, needed to compile did (you need most probably lesstif2-dev)."
130# exit -1
131# ]
132#)
133
134######################################################################
135# MySQL(++) SUPPORT
136######################################################################
137
138# Needed to compile FACT++
139MYSQL_DEVEL
140MYSQLPP_DEVEL
141
142LDFLAGS+=" -lmysqlpp "
143
144######################################################################
145# BOOST SUPPORT
146######################################################################
147
148# Needed to compile FACT++
149AX_BOOST_BASE([1.40], [],
150 AC_MSG_ERROR([The boost C++ libraries (>=1.40) are not properly installed.])
151)
152
153AX_BOOST_ASIO
154AX_BOOST_DATE_TIME
155AX_BOOST_FILESYSTEM
156AX_BOOST_PROGRAM_OPTIONS
157AX_BOOST_REGEX
158AX_BOOST_SYSTEM
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+=" -lboost_date_time"
171LDFLAGS+=" -lboost_filesystem"
172LDFLAGS+=" -lboost_program_options"
173LDFLAGS+=" -lboost_regex"
174LDFLAGS+=" -lboost_system"
175LDFLAGS+=" -lboost_thread "
176
177CPPFLAGS+=" "$BOOST_CPPFLAGS" "
178
179#AC_CHECK_HEADERS(
180# [\
181# boost/bind.hpp \
182# boost/lexical_cast.hpp \
183# boost/filesystem.hpp \
184# boost/thread.hpp \
185# boost/function.hpp \
186# boost/regex.hpp \
187# boost/asio.hpp \
188# boost/enable_shared_from_this.hpp \
189# boost/asio/deadline_timer.hpp \
190# boost/date_time/posix_time/posix_time.hpp \
191# boost/date_time/local_time/local_time.hpp \
192# boost/date_time/gregorian/gregorian.hpp
193# ], [],
194# [
195# echo "Error! At least one needed header of the boost C++ libararies is missing."
196# exit -1
197# ]
198#)
199
200######################################################################
201# QT4/GUI SUPPORT
202######################################################################
203
204AC_ARG_WITH([qt4],
205 [AS_HELP_STRING([--without-qt4], [Disable qt4, i.e. disable gui support.])],
206 [], [QT4_DO_IT_ALL])
207
208######################################################################
209# ROOT SUPPORT
210######################################################################
211
212AC_ARG_WITH([root],
213 [AS_HELP_STRING([--without-root], [Disable root, i.e. disable gui support.])],
214 [], [ROOT_PATH([5.12/00])]
215)
216
217if test "$ROOTEXEC" != no ;
218then
219
220 ROOTCPPFLAGS=$ROOTCFLAGS" "$ROOTAUXCFLAGS
221 ROOTLDFLAGS="-L"$ROOTLIBDIR" -lGQt "
222
223 #AC_CHECK_PROG(HAVE_ROOT_QT, libGQt.so.$ROOTSOVERSION, yes, no, $ROOTLIBDIR)
224 #AC_CHECK_PROG(HAVE_GQT, libGQt.so.$ROOTSOVERSION, yes, no, $LD_LIBRARY_PATH)
225
226 # It seems it dooesn't work on older root versions
227 ROOT_FEATURE([qt], [HAVE_ROOT_QT=yes])
228
229 AC_SUBST(ROOTCPPFLAGS)
230 AC_SUBST(ROOTLDFLAGS)
231
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])
281
282##########################################################################
283# print summary
284##########################################################################
285
286AC_OUTPUT
287
288AC_MSG_NOTICE()
289AC_MSG_NOTICE(============================== summary =============================)
290AC_MSG_NOTICE()
291AC_MSG_NOTICE([ CPPFLAGS = $CPPFLAGS])
292AC_MSG_NOTICE()
293AC_MSG_NOTICE([ LDFLAGS = $LDFLAGS])
294AC_MSG_NOTICE()
295AC_MSG_NOTICE(--------------------------------------------------------------------)
296AC_MSG_NOTICE()
297AC_MSG_NOTICE([ BOOST_CPPFLAGS = $BOOST_CPPFLAGS])
298AC_MSG_NOTICE([ BOOST_LDFLAGS = $BOOST_LDFLAGS])
299 AC_MSG_NOTICE()
300AM_COND_IF(HAS_QT4, [
301 AC_MSG_NOTICE(--------------------------------------------------------------------)
302 AC_MSG_NOTICE()
303 AC_MSG_NOTICE([ QT4_VERSION = $QT4_VERSION])
304 AC_MSG_NOTICE()
305 AC_MSG_NOTICE([ QT4_LIB = $QT4_LIB])
306 AC_MSG_NOTICE([ QT4_LDFLAGS = $QT4_LDFLAGS])
307 AC_MSG_NOTICE([ QT4_INCLUDES = $QT4_INCLUDES])
308 AC_MSG_NOTICE()
309 AC_MSG_NOTICE([ MOC4 = $MOC4])
310 AC_MSG_NOTICE([ UIC4 = $UIC4])
311 AC_MSG_NOTICE([ RCC4 = $RCC4])
312 AC_MSG_NOTICE()
313],[])
314AM_COND_IF(HAS_ROOT, [
315 AC_MSG_NOTICE(--------------------------------------------------------------------)
316 AC_MSG_NOTICE()
317 AC_MSG_NOTICE([ ROOTVERSION = $ROOTVERSION])
318 AC_MSG_NOTICE()
319 AC_MSG_NOTICE([ ROOTEXEC = $ROOTEXEC])
320 AC_MSG_NOTICE([ ROOTCONF = $ROOTCONF])
321 AC_MSG_NOTICE([ ROOTCINT = $ROOTCINT])
322 AC_MSG_NOTICE([ ROOTCPPFLAGS = $ROOTCPPFLAGS])
323 AC_MSG_NOTICE([ ROOTLDFLAGS = $ROOTLDFLAGS])
324AC_MSG_NOTICE()
325],[])
326AC_MSG_NOTICE(--------------------------------------------------------------------)
327AC_MSG_NOTICE()
328
329AM_COND_IF(HAS_COLORDIFF,
330 AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: yes]),
331 AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: no])
332)
333AM_COND_IF(HAS_HELP2MAN,[
334 AC_MSG_NOTICE([ man-pages enabled / 'help2man' found: $HELP2MAN])
335 AM_COND_IF(HAS_GROFF,
336 AC_MSG_NOTICE([ build of html enabled / 'groff' found: yes])
337 AC_MSG_NOTICE([ build of pdf enabled / 'ps2pdf' found: $PS2PDF]),
338 AC_MSG_NOTICE([ build of html and pdf / 'groff' found: no])
339 )
340],[
341 AC_MSG_NOTICE([ man, html, pdf enabled / 'help2man' found: no])
342])
343
344AM_COND_IF(HAS_DOXYGEN,
345 AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: $DX_DOXYGEN]),
346 AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: no])
347)
348AM_COND_IF(HAS_DOT,
349 AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: $DX_DOT]),
350 AC_MSG_NOTICE([ doxagen graphs enabled / 'dot' (graphviz) found: no])
351)
352AM_COND_IF(HAS_QT4,
353 AC_MSG_NOTICE([ QT4 support enabled / QT4 toolkit found: yes]),
354 AC_MSG_NOTICE([ QT4 support enabled / QT4 toolkit found: no])
355)
356AC_MSG_NOTICE([ ROOT support enabled / root >= 5.12/00 found: $ROOTEXEC])
357AC_MSG_NOTICE([ ROOT built with --with-qt found: $HAVE_ROOT_QT])
358AC_MSG_NOTICE()
359AC_MSG_NOTICE(--------------------------------------------------------------------)
360AC_MSG_NOTICE()
361AC_MSG_NOTICE([Suggestions and hits:])
362AC_MSG_NOTICE()
363AC_MSG_NOTICE([ - Add 'V=1' to you make-call to switch on verbose output.])
364AC_MSG_NOTICE([ - Do not try to create man-pages with doxygen,])
365AC_MSG_NOTICE([ it does most probably not work.])
366AM_COND_IF(HAS_COLORGCC,,
367 AC_MSG_NOTICE([ - Install colorgcc to get colored compiler output.])
368)
369AC_MSG_NOTICE([ - If you send me a bug report about:])
370AC_MSG_NOTICE([ + configure please attach the file config.log])
371AC_MSG_NOTICE([ + make please send me the output of 'make V=1'])
372AC_MSG_NOTICE()
373AC_MSG_NOTICE(--------------------------------------------------------------------)
374AC_MSG_NOTICE()
375AC_MSG_NOTICE([Some interesting build targets:])
376AC_MSG_NOTICE()
377AC_MSG_NOTICE([ diff: colored 'svn diff' if colordiff is installed])
378AM_COND_IF(HAS_HELP2MAN,[
379 AC_MSG_NOTICE([ program.man: build man-page from 'program --help'])
380 AC_MSG_NOTICE([ (display with 'man ./program.man')])
381 AM_COND_IF(HAS_GROFF,[
382 AC_MSG_NOTICE([ program.html: build html page from man-page])
383 AM_COND_IF(HAS_PS2PDF,
384 AC_MSG_NOTICE([ program.pdf: build pdf documentation from man page])
385 )
386 ])
387])
388AM_COND_IF(HAS_DOXYGEN,
389 AC_MSG_NOTICE([ doxygen-run: build html documentation with doxygen])
390 AC_MSG_NOTICE([ doxygen-doc: build html and pdf documentation with doxygen])
391)
392AC_MSG_NOTICE([ man: build all buildable documentation])
393AC_MSG_NOTICE()
394AC_MSG_NOTICE(--------------------------------------------------------------------)
395AC_MSG_NOTICE()
396AM_COND_IF(HAS_ROOT,
397 [AM_COND_IF(HAS_ROOT_QT, [],
398 AC_MSG_WARN([ root found but it was built without the --with-qt option])
399 )]
400)
401AM_COND_IF(HAS_GUI, [],
402 AC_MSG_WARN([ Either QT4 or qt-root is missing: GUI disabled!])
403)
404AC_MSG_NOTICE()
Note: See TracBrowser for help on using the repository browser.