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

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