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

Last change on this file since 10680 was 10559, checked in by tbretz, 13 years ago
Added an error in case readline was not found
File size: 13.4 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
73if test "x$have_readline" != "xyes"; then
74 AC_MSG_ERROR([The readline library is not properly installed.])
75fi
76
77CPPFLAGS+=" "$READLINE_INCLUDES" "
78LDFLAGS+=" "$READLINE_LIBS" "
79
80# Needed to compile FACT++
81AC_CHECK_HEADERS([panel.h],,
82 AC_MSG_ERROR([ncurses header not found]))
83
84# Needed to compile FACT++
85AC_CHECK_LIB(panel, update_panels,,
86 AC_MSG_ERROR([ncurses panel library not found]))
87
88# Xm.h (lesstif/motif, needed to compile did)
89AC_FIND_MOTIF
90
91CPPFLAGS+=" "$MOTIF_INCL" "
92LDFLAGS+=" "$MOTIF_LDFLAGS" "
93
94AM_COND_IF(HAS_LIBXP,,
95 AC_MSG_WARN([ Motif/lesstif not found!])
96)
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# MySQL(++) SUPPORT
118######################################################################
119
120# Needed to compile FACT++
121MYSQL_DEVEL
122MYSQLPP_DEVEL
123
124LDFLAGS+=" -lmysqlpp "
125
126######################################################################
127# BOOST SUPPORT
128######################################################################
129
130# Needed to compile FACT++
131AX_BOOST_BASE([1.40], [],
132 AC_MSG_ERROR([The boost C++ libraries (>=1.40) are not properly installed.])
133)
134
135AX_BOOST_ASIO
136AX_BOOST_DATE_TIME
137AX_BOOST_FILESYSTEM
138AX_BOOST_PROGRAM_OPTIONS
139AX_BOOST_REGEX
140AX_BOOST_SYSTEM
141AX_BOOST_THREAD
142#AX_BOOST_IOSTREAMS
143#AX_BOOST_PYTHON
144#AX_BOOST_SERIALIZATION
145#AX_BOOST_SIGNALS
146#AX_BOOST_TEST_EXEC_MONITOR
147#AX_BOOST_UNIT_TEST_FRAMEWORK
148#AX_BOOST_WAVE
149#AX_BOOST_WSERIALIZATION
150
151LDFLAGS+=" "$BOOST_LDFLAGS" "
152LDFLAGS+=" -lboost_date_time"
153LDFLAGS+=" -lboost_filesystem"
154LDFLAGS+=" -lboost_program_options"
155LDFLAGS+=" -lboost_regex"
156LDFLAGS+=" -lboost_system"
157LDFLAGS+=" -lboost_thread "
158
159CPPFLAGS+=" "$BOOST_CPPFLAGS" "
160
161#AC_CHECK_HEADERS(
162# [\
163# boost/bind.hpp \
164# boost/lexical_cast.hpp \
165# boost/filesystem.hpp \
166# boost/thread.hpp \
167# boost/function.hpp \
168# boost/regex.hpp \
169# boost/asio.hpp \
170# boost/enable_shared_from_this.hpp \
171# boost/asio/deadline_timer.hpp \
172# boost/date_time/posix_time/posix_time.hpp \
173# boost/date_time/local_time/local_time.hpp \
174# boost/date_time/gregorian/gregorian.hpp
175# ], [],
176# [
177# echo "Error! At least one needed header of the boost C++ libararies is missing."
178# exit -1
179# ]
180#)
181
182######################################################################
183# QT4/GUI SUPPORT
184######################################################################
185
186AC_ARG_WITH([qt4],
187 [AS_HELP_STRING([--without-qt4], [Disable qt4, i.e. disable gui support.])],
188 [], [QT4_DO_IT_ALL])
189
190######################################################################
191# ROOT SUPPORT
192######################################################################
193
194AC_ARG_WITH([root],
195 [AS_HELP_STRING([--without-root], [Disable root, i.e. disable gui support.])],
196 [], [ROOT_PATH([5.12/00])]
197)
198
199if test "$ROOTEXEC" != no ;
200then
201
202 ROOTCPPFLAGS=$ROOTCFLAGS" "$ROOTAUXCFLAGS
203 ROOTLDFLAGS="-L"$ROOTLIBDIR" -lGQt "
204
205 #AC_CHECK_PROG(HAVE_ROOT_QT, libGQt.so.$ROOTSOVERSION, yes, no, $ROOTLIBDIR)
206 #AC_CHECK_PROG(HAVE_GQT, libGQt.so.$ROOTSOVERSION, yes, no, $LD_LIBRARY_PATH)
207
208 # It seems it dooesn't work on older root versions
209 ROOT_FEATURE([qt], [HAVE_ROOT_QT=yes])
210
211 AC_SUBST(ROOTCPPFLAGS)
212 AC_SUBST(ROOTLDFLAGS)
213
214fi
215
216
217######################################################################
218# Check if we have colordiff to colorize 'svn diff'
219######################################################################
220
221# Nice to have to support colored diff
222AC_CHECK_PROG(COLORDIFF, colordiff, colordiff, cat)
223AC_CHECK_PROG(GROFF, groff, yes, no)
224AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no)
225AC_CHECK_PROG(HELP2MAN, help2man, yes, no)
226
227##########################################################################
228# debug compilation support
229##########################################################################
230#
231#AC_MSG_CHECKING([whether to build with debug information])
232#AC_ARG_ENABLE([debug],
233# [AS_HELP_STRING([--enable-debug],
234# [enable debug data generation (def=no)])],
235# [debugit="$enableval"],
236# [debugit=no])
237#AC_MSG_RESULT([$debugit])
238#
239#if test x"$debugit" = x"yes"; then
240# AC_DEFINE([DEBUG],[],[Debug Mode])
241# AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
242#else
243# AC_DEFINE([NDEBUG],[],[No-debug Mode])
244# AM_CXXFLAGS="$AM_CXXFLAGS -O3"
245#fi
246#
247
248##########################################################################
249# produce conditionals for Makefile.am and for summary
250##########################################################################
251
252AM_CONDITIONAL(HAS_COLORDIFF, [test "$COLORDIFF" = colordiff])
253AM_CONDITIONAL(HAS_GROFF, [test "$GROFF" = yes])
254AM_CONDITIONAL(HAS_PS2PDF, [test "$PS2PDF" = yes])
255AM_CONDITIONAL(HAS_HELP2MAN, [test "$HELP2MAN" = yes])
256AM_CONDITIONAL(HAS_DOXYGEN, [test -n "$DX_DOXYGEN"])
257AM_CONDITIONAL(HAS_DOT, [test -n "$DX_DOT"])
258AM_CONDITIONAL(HAS_COLORGCC, [test "$GCC" = colorgcc])
259AM_CONDITIONAL(HAS_QT4, [test -n "$QT4_VERSION"])
260AM_CONDITIONAL(HAS_ROOT, [test "$ROOTEXEC" != no])
261AM_CONDITIONAL(HAS_ROOT_QT, [test "$HAVE_ROOT_QT" = yes])
262AM_CONDITIONAL(HAS_GUI, [test "$QT4_VERSION" -a "$HAVE_ROOT_QT" = yes])
263
264AM_CONDITIONAL(IS_FALSE, [test "x" = "y"])
265AM_CONDITIONAL(IS_TRUE, [test "x" = "x"])
266
267##########################################################################
268# print summary
269##########################################################################
270
271AC_OUTPUT
272
273AC_MSG_NOTICE()
274AC_MSG_NOTICE(============================== summary =============================)
275AC_MSG_NOTICE()
276AC_MSG_NOTICE([ CPPFLAGS = $CPPFLAGS])
277AC_MSG_NOTICE()
278AC_MSG_NOTICE([ LDFLAGS = $LDFLAGS])
279AC_MSG_NOTICE()
280AC_MSG_NOTICE(--------------------------------------------------------------------)
281AC_MSG_NOTICE()
282AC_MSG_NOTICE([ BOOST_CPPFLAGS = $BOOST_CPPFLAGS])
283AC_MSG_NOTICE([ BOOST_LDFLAGS = $BOOST_LDFLAGS])
284AC_MSG_NOTICE()
285AM_COND_IF(HAS_QT4, [
286 AC_MSG_NOTICE(--------------------------------------------------------------------)
287 AC_MSG_NOTICE()
288 AC_MSG_NOTICE([ QT4_VERSION = $QT4_VERSION])
289 AC_MSG_NOTICE()
290 AC_MSG_NOTICE([ QT4_LIB = $QT4_LIB])
291 AC_MSG_NOTICE([ QT4_LDFLAGS = $QT4_LDFLAGS])
292 AC_MSG_NOTICE([ QT4_INCLUDES = $QT4_INCLUDES])
293 AC_MSG_NOTICE()
294 AC_MSG_NOTICE([ MOC4 = $MOC4])
295 AC_MSG_NOTICE([ UIC4 = $UIC4])
296 AC_MSG_NOTICE([ RCC4 = $RCC4])
297 AC_MSG_NOTICE()
298],[])
299AM_COND_IF(HAS_ROOT, [
300 AC_MSG_NOTICE(--------------------------------------------------------------------)
301 AC_MSG_NOTICE()
302 AC_MSG_NOTICE([ ROOTVERSION = $ROOTVERSION])
303 AC_MSG_NOTICE()
304 AC_MSG_NOTICE([ ROOTEXEC = $ROOTEXEC])
305 AC_MSG_NOTICE([ ROOTCONF = $ROOTCONF])
306 AC_MSG_NOTICE([ ROOTCINT = $ROOTCINT])
307 AC_MSG_NOTICE([ ROOTCPPFLAGS = $ROOTCPPFLAGS])
308 AC_MSG_NOTICE([ ROOTLDFLAGS = $ROOTLDFLAGS])
309 AC_MSG_NOTICE()
310],[])
311AC_MSG_NOTICE(--------------------------------------------------------------------)
312AC_MSG_NOTICE()
313AM_COND_IF(HAS_LIBXP,
314 AC_MSG_NOTICE([ Motif/lesstif / 'Xm/Xm.h' 'libXp' found: yes]),
315 AC_MSG_NOTICE([ Motif/lesstif / 'Xm/Xm.h' 'libXp' found: no])
316)
317AM_COND_IF(HAS_COLORDIFF,
318 AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: yes]),
319 AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: no])
320)
321AM_COND_IF(HAS_HELP2MAN,[
322 AC_MSG_NOTICE([ man-pages enabled / 'help2man' found: $HELP2MAN])
323 AM_COND_IF(HAS_GROFF,
324 AC_MSG_NOTICE([ build of html enabled / 'groff' found: yes])
325 AC_MSG_NOTICE([ build of pdf enabled / 'ps2pdf' found: $PS2PDF]),
326 AC_MSG_NOTICE([ build of html and pdf / 'groff' found: no])
327 )
328],[
329 AC_MSG_NOTICE([ man, html, pdf enabled / 'help2man' found: no])
330])
331
332AM_COND_IF(HAS_DOXYGEN,
333 AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: $DX_DOXYGEN]),
334 AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: no])
335)
336AM_COND_IF(HAS_DOT,
337 AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: $DX_DOT]),
338 AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: no])
339)
340AM_COND_IF(HAS_QT4,
341 AC_MSG_NOTICE([ QT4 support enabled / QT4 toolkit found: yes]),
342 AC_MSG_NOTICE([ QT4 support enabled / QT4 toolkit found: no])
343)
344AC_MSG_NOTICE([ ROOT support enabled / root >= 5.12/00 found: $ROOTEXEC])
345AM_COND_IF(HAS_ROOT_QT,
346 AC_MSG_NOTICE([ ROOT built with --with-qt found: yes]),
347 AC_MSG_NOTICE([ ROOT built with --with-qt found: no])
348)
349AC_MSG_NOTICE()
350AC_MSG_NOTICE(--------------------------------------------------------------------)
351AC_MSG_NOTICE()
352AC_MSG_NOTICE([Suggestions and hints:])
353AC_MSG_NOTICE()
354AC_MSG_NOTICE([ - Add 'V=1' to you make-call to switch on verbose output.])
355AC_MSG_NOTICE([ - Do not try to create man-pages with doxygen,])
356AC_MSG_NOTICE([ it does most probably not work.])
357AM_COND_IF(HAS_COLORGCC,,
358 AC_MSG_NOTICE([ - Install colorgcc to get colored compiler output.])
359)
360AC_MSG_NOTICE([ - If you send me a bug report about:])
361AC_MSG_NOTICE([ + configure: please attach the file config.log])
362AC_MSG_NOTICE([ + make: please send me the output of 'make V=1'])
363AC_MSG_NOTICE()
364AC_MSG_NOTICE(--------------------------------------------------------------------)
365AC_MSG_NOTICE()
366AC_MSG_NOTICE([Some interesting build targets:])
367AC_MSG_NOTICE()
368AC_MSG_NOTICE([ diff: colored 'svn diff' if colordiff is installed])
369AM_COND_IF(HAS_HELP2MAN,[
370 AC_MSG_NOTICE([ program.man: build man-page from 'program --help'])
371 AC_MSG_NOTICE([ (display with 'man ./program.man')])
372 AM_COND_IF(HAS_GROFF,[
373 AC_MSG_NOTICE([ program.html: build html page from man-page])
374 AM_COND_IF(HAS_PS2PDF,
375 AC_MSG_NOTICE([ program.pdf: build pdf documentation from man page])
376 )
377 ])
378])
379AM_COND_IF(HAS_DOXYGEN,
380 AC_MSG_NOTICE([ doxygen-run: build html documentation with doxygen])
381 AC_MSG_NOTICE([ doxygen-doc: build html and pdf documentation with doxygen])
382)
383AC_MSG_NOTICE([ man: build all buildable documentation])
384AC_MSG_NOTICE()
385AC_MSG_NOTICE(--------------------------------------------------------------------)
386AC_MSG_NOTICE()
387AM_COND_IF(HAS_LIBXP,,
388 AC_MSG_WARN([ Motif/lesstif not found. The dim gui did will not be built!])
389)
390AM_COND_IF(HAS_ROOT,
391 [AM_COND_IF(HAS_ROOT_QT,,
392 AC_MSG_WARN([ root found but it was built without the --with-qt option])
393 )]
394)
395AM_COND_IF(HAS_GUI, [],
396 AC_MSG_WARN([ Either QT4 or qt-root is missing: GUI disabled!])
397)
398AC_MSG_NOTICE()
Note: See TracBrowser for help on using the repository browser.