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

Last change on this file since 10402 was 10402, checked in by tbretz, 9 years ago
Added QT4 support.
File size: 12.0 KB
Line 
1######################################################################
2# Autoconf initial setup
3######################################################################
4
5AC_INIT([FACT++],[1.0],[thomas.bretz@epfl.ch],[FACTpp],[http://hello.example.com/])
6AC_PREREQ([2.65])
7AC_CONFIG_FILES([Makefile])   # causes x/Makefile.in to be created if x/Makefile.am exists
8#AC_CONFIG_HEADERS([config.h])
9AC_CONFIG_MACRO_DIR([.macro_dir])
10AC_CONFIG_AUX_DIR([.aux_dir])
11AC_PROG_CC([colorgcc gcc])
12 #If output variable CXXFLAGS was not already set, set it to -g -O2
13AC_PROG_CXX([colorgcc g++])
14LT_INIT([disable-static])
15AC_LANG(C++)
16#AC_PATH_XTRA
17
18######################################################################
19# Automake initial setup
20######################################################################
21
22AM_INIT_AUTOMAKE([1.11 -Wall subdir-objects std-options no-define color-tests parallel-tests silent-rules])
23AM_SILENT_RULES([yes])
24AM_PROG_CC_C_O
25
26######################################################################
27# DOXYGEN SUPPORT
28######################################################################
29
30### FIXME: Need a configure commandline switch
31DX_ENV_APPEND(EXTRACT_ALL, YES)
32DX_ENV_APPEND(RECURSIVE,   YES)
33DX_ENV_APPEND(ALL_GRAPHS,  NO)  # change to yes to switch on call(er) graphs
34
35#DX_DOXYGEN_FEATURE(ON)
36#DX_DOT_FEATURE(ON)               # sets HAVE_DOT
37#DX_HTML_FEATURE(ON)              # sets GENERATE_HTML (default)
38#DX_CHM_FEATURE(ON|OFF)           # sets GENERATE_HTMLHELP
39#DX_CHI_FEATURE(ON|OFF)           # sets GENERATE_CHI
40#DX_MAN_FEATURE(ON)               # sets GENERATE_MAN (segfaults)
41#DX_RTF_FEATURE(ON|OFF)           # sets GENERATE_RTF
42#DX_XML_FEATURE(ON|OFF)           # sets GENERATE_XML
43#DX_PDF_FEATURE(ON|OFF)           # sets GENERATE_PDF (default)
44DX_PS_FEATURE(OFF)                # sets GENERATE_PS  (default)
45DX_INIT_DOXYGEN($PACKAGE_NAME)#, DOXYFILE-PATH, [OUTPUT-DIR])
46
47#USE_HTAGS              = $(USE_HTAGS)
48
49######################################################################
50# pthread/Readline/NCurses (pthread needed by dim and boost)
51######################################################################
52
53AC_LANG_PUSH(C)
54
55# Needed to compile dim
56ACX_PTHREAD
57
58CPPFLAGS+=" "$PTHREAD_CFLAGS" "
59LDFLAGS+=" "$PTHREAD_CFLAGS" "
60
61
62# Needed to compile FACT++
63AC_CHECK_READLINE
64
65CPPFLAGS+=" "$READLINE_INCLUDES" "
66LDFLAGS+=" "$READLINE_LIBS" "
67
68#AC_CHECK_LIB(readline, readline, [],
69#   [
70#      echo "Error! libreadline not found in default libarary paths."
71#      exit -1
72#   ]
73#)
74#AC_CHECK_HEADERS(readline/readline.h, [],
75#   [
76#      echo "Error! readline/readline.h not properly installed in default include path (maybe readline-dev missing)."
77#      exit -1
78#   ]
79#)
80#
81
82# Needed to compile FACT++
83AC_CHECK_HEADERS([panel.h],,
84   AC_MSG_ERROR([ncurses header not found]))
85   
86# Needed to compile FACT++
87AC_CHECK_LIB(panel, update_panels,,
88   AC_MSG_ERROR([ncurses panel library not found]))
89
90# Needed to compile FACT++
91AC_CHECK_PACKAGE(cfitsio, ffpss, cfitsio, fitsio.h,,
92   AC_MSG_ERROR([cfitsio not properly installed/not found.]))
93
94#AC_CHECK_HEADERS([fitsio.h],,AC_MSG_ERROR([cfitsio headers not found]))
95#AC_CHECK_LIB([cfitsio], main,,AC_MSG_ERROR([cfitsio library not found]))
96
97AC_LANG_POP
98
99# Needed to compile FACT++
100AC_CHECK_PACKAGE(ccfits, main, CCfits, CCfits/CCfits,,
101   AC_MSG_ERROR([CCfits not properly installed/not found.]))
102
103#AC_CHECK_HEADERS([CCfits/CCfits],,
104#   AC_MSG_ERROR(CCfits headers not found))
105#AC_CHECK_LIB(CCfits, main,,
106#   AC_MSG_ERROR(CCfits library not found))
107
108
109######################################################################
110# Xm.h (lesstif/motif, needed by did)
111######################################################################
112
113# Needed to compile dim
114AC_FIND_MOTIF
115
116CPPFLAGS+=" "$MOTIF_INCL" "
117LDFLAGS+=" "$MOTIF_LDFLAGS" "
118
119#AC_CHECK_HEADERS([Mrm/MrmAppl.h], [],
120#   [                             
121#      echo "Error! Mrm/MrmAppl.h not properly installed, needed to compile did (you need most probably lesstif2-dev)."
122#      exit -1
123#   ]
124#)
125
126######################################################################
127# MySQL(++) SUPPORT
128######################################################################
129
130# Needed to compile FACT++
131MYSQL_DEVEL
132MYSQLPP_DEVEL
133
134LDFLAGS+=" -lmysqlpp "
135
136######################################################################
137# BOOST SUPPORT
138######################################################################
139
140# Needed to compile FACT++
141AX_BOOST_BASE([1.40], [],
142   [
143      echo "Error! The boost C++ libraries are not properly installed."
144      exit -1
145   ]
146)
147
148AX_BOOST_ASIO
149AX_BOOST_DATE_TIME
150AX_BOOST_FILESYSTEM
151AX_BOOST_PROGRAM_OPTIONS
152AX_BOOST_REGEX
153AX_BOOST_SYSTEM
154AX_BOOST_THREAD
155#AX_BOOST_IOSTREAMS
156#AX_BOOST_PYTHON
157#AX_BOOST_SERIALIZATION
158#AX_BOOST_SIGNALS
159#AX_BOOST_TEST_EXEC_MONITOR
160#AX_BOOST_UNIT_TEST_FRAMEWORK
161#AX_BOOST_WAVE
162#AX_BOOST_WSERIALIZATION
163
164LDFLAGS+=" -lboost_date_time"
165LDFLAGS+=" -lboost_filesystem"
166LDFLAGS+=" -lboost_program_options"
167LDFLAGS+=" -lboost_regex"
168LDFLAGS+=" -lboost_system"
169LDFLAGS+=" -lboost_thread "
170
171#AC_CHECK_HEADERS(
172#   [\
173#      boost/bind.hpp \
174#      boost/lexical_cast.hpp \
175#      boost/filesystem.hpp \
176#      boost/thread.hpp \
177#      boost/function.hpp \
178#      boost/regex.hpp \
179#      boost/asio.hpp \
180#      boost/enable_shared_from_this.hpp \
181#      boost/asio/deadline_timer.hpp \
182#      boost/date_time/posix_time/posix_time.hpp \
183#      boost/date_time/local_time/local_time.hpp \
184#      boost/date_time/gregorian/gregorian.hpp
185#   ], [],
186#   [
187#      echo "Error! At least one needed header of the boost C++ libararies is missing."
188#      exit -1
189#   ]
190#)
191
192######################################################################
193# QT4/GUI SUPPORT
194######################################################################
195
196AC_ARG_WITH([qt4],
197   [AS_HELP_STRING([--without-qt4], [Disable qt4, i.e. disable gui support.])],
198   [], [QT4_DO_IT_ALL])
199
200#AC_CHECK_PROG(QT4_MOC, moc, moc,
201#   AC_MSG_ERROR([QT4 executable 'moc' not found in path.]))
202#AC_CHECK_PROG(QT4_UIC, uic, uic,
203#   AC_MSG_ERROR([QT4 executable 'moc' not found in path.]))
204
205######################################################################
206# ROOT SUPPORT
207######################################################################
208
209# ROOT_PATH([5.12/00, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]])
210# ROOT_PATH([5.12/00])
211# ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old))
212# ROOT_PATH(, AC_DEFINE([HAVE_ROOT]))
213
214# ROOTCONF           full path to root-config
215# ROOTEXEC           full path to root
216# ROOTCINT           full path to rootcint
217# ROOTLIBDIR         Where the ROOT libraries are
218# ROOTINCDIR         Where the ROOT headers are
219# ROOTETCDIR         Where the ROOT configuration is
220# ROOTCFLAGS         Extra compiler flags
221# ROOTLIBS           ROOT basic libraries
222# ROOTGLIBS          ROOT basic + GUI libraries
223# ROOTAUXLIBS        Auxilary libraries and linker flags for ROOT
224# ROOTAUXCFLAGS      Auxilary compiler flags
225# ROOTRPATH          Same as ROOTLIBDIR
226
227
228######################################################################
229# Check if we have colordiff to colorize 'svn diff'
230######################################################################
231
232# Nice to have to support colored diff
233AC_CHECK_PROG(COLORDIFF, colordiff,    colordiff, cat)
234AC_CHECK_PROG(GROFF,     groff,        yes, no)
235AC_CHECK_PROG(PS2PDF,    ps2pdf,       yes, no)
236AC_CHECK_PROG(HELP2MAN,  help2man,     yes, no)
237
238##########################################################################
239# debug compilation support
240##########################################################################
241#
242#AC_MSG_CHECKING([whether to build with debug information])
243#AC_ARG_ENABLE([debug],
244#    [AS_HELP_STRING([--enable-debug],
245#        [enable debug data generation (def=no)])],
246#    [debugit="$enableval"],
247#    [debugit=no])
248#AC_MSG_RESULT([$debugit])
249#
250#if test x"$debugit" = x"yes"; then
251#    AC_DEFINE([DEBUG],[],[Debug Mode])
252#    AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
253#else
254#    AC_DEFINE([NDEBUG],[],[No-debug Mode])
255#    AM_CXXFLAGS="$AM_CXXFLAGS -O3"
256#fi
257#
258
259##########################################################################
260# produce conditionals for Makefile.am and for summary
261##########################################################################
262
263AM_CONDITIONAL(HAS_COLORDIFF, [test "$COLORDIFF" = colordiff])
264AM_CONDITIONAL(HAS_GROFF,     [test "$GROFF" = yes])
265AM_CONDITIONAL(HAS_PS2PDF,    [test "$PS2PDF" = yes])
266AM_CONDITIONAL(HAS_HELP2MAN,  [test "$HELP2MAN" = yes])
267AM_CONDITIONAL(HAS_DOXYGEN,   [test -n "$DX_DOXYGEN"])
268AM_CONDITIONAL(HAS_DOT,       [test -n "$DX_DOT"])
269AM_CONDITIONAL(HAS_COLORGCC,  [test "$GCC" = colorgcc])
270AM_CONDITIONAL(HAS_QT4,       [test -n "$QT4_VERSION"])
271
272##########################################################################
273# print summary
274##########################################################################
275
276AC_OUTPUT
277
278AC_MSG_NOTICE()
279AC_MSG_NOTICE(============================== summary =============================)
280AC_MSG_NOTICE()
281
282AM_COND_IF(HAS_COLORDIFF,
283   AC_MSG_NOTICE([ colored svn diff       / 'colordiff'      found: yes]),
284   AC_MSG_NOTICE([ colored svn diff       / 'colordiff'      found: no])
285)
286AM_COND_IF(HAS_HELP2MAN,[
287   AC_MSG_NOTICE([ man-pages enabled      / 'help2man'       found: $HELP2MAN])
288   AM_COND_IF(HAS_GROFF,
289      AC_MSG_NOTICE([ build of html enabled  / 'groff'          found: yes])
290      AC_MSG_NOTICE([ build of pdf  enabled  / 'ps2pdf'         found: $PS2PDF]),
291      AC_MSG_NOTICE([ build of html and pdf  / 'groff'          found: no])
292   )
293],[
294   AC_MSG_NOTICE([ man, html, pdf enabled / 'help2man'       found: no])
295])   
296
297AM_COND_IF(HAS_DOXYGEN,
298   AC_MSG_NOTICE([ doxygen docu enabled   / 'doxygen'        found: $DX_DOXYGEN]),
299   AC_MSG_NOTICE([ doxygen docu enabled   / 'doxygen'        found: no])
300)
301AM_COND_IF(HAS_DOT,
302   AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: $DX_DOT]),
303   AC_MSG_NOTICE([ doxagen graphs enabled / 'dot' (graphviz) found: no])
304)
305AM_COND_IF(HAS_QT4,
306   AC_MSG_NOTICE([ GUI support enabled    / QT4 toolkit      found: yes]),
307   AC_MSG_NOTICE([ GUI support enabled    / QT4 toolkit      found: no])
308)
309AM_COND_IF(HAS_QT4, [
310   AC_MSG_NOTICE()
311   AC_MSG_NOTICE(--------------------------------------------------------------------)
312   AC_MSG_NOTICE()
313   AC_MSG_NOTICE([ QT4_VERSION  = $QT4_VERSION])
314   AC_MSG_NOTICE()
315   AC_MSG_NOTICE([ QT4_LIB      = $QT4_LIB])
316   AC_MSG_NOTICE([ QT4_LDFLAGS  = $QT4_LDFLAGS])
317   AC_MSG_NOTICE([ QT4_INCLUDES = $QT4_INCLUDES])
318   AC_MSG_NOTICE()
319   AC_MSG_NOTICE([ MOC4 = $MOC4])
320   AC_MSG_NOTICE([ UIC4 = $UIC4])
321   AC_MSG_NOTICE([ RCC4 = $RCC4])
322],[])
323AC_MSG_NOTICE()
324AC_MSG_NOTICE(--------------------------------------------------------------------)
325AC_MSG_NOTICE()
326AC_MSG_NOTICE([Suggestions and hits:])
327AC_MSG_NOTICE()
328AC_MSG_NOTICE([  - Add 'V=1' to you make-call to switch on verbose output.])
329AC_MSG_NOTICE([  - Do not try to create man-pages with doxygen,])
330AC_MSG_NOTICE([    it does most probably not work.])
331AM_COND_IF(HAS_COLORGCC,,
332   AC_MSG_NOTICE([  - Install colorgcc to get colored compiler output.])
333)
334AC_MSG_NOTICE()
335AC_MSG_NOTICE(--------------------------------------------------------------------)
336AC_MSG_NOTICE()
337AC_MSG_NOTICE([Some interesting build targets:])
338AC_MSG_NOTICE()
339AC_MSG_NOTICE([ diff:          colored 'svn diff' if colordiff is installed])
340AM_COND_IF(HAS_HELP2MAN,[
341   AC_MSG_NOTICE([ program.man:   build man-page from 'program --help'])
342   AC_MSG_NOTICE([                (display with 'man ./program.man')])
343   AM_COND_IF(HAS_GROFF,[
344      AC_MSG_NOTICE([ program.html:  build html page from man-page])
345      AM_COND_IF(HAS_PS2PDF,
346         AC_MSG_NOTICE([ program.pdf:   build pdf documentation from man page])
347      )
348   ])
349])
350AM_COND_IF(HAS_DOXYGEN,
351   AC_MSG_NOTICE([ doxygen-run:   build html documentation with doxygen])
352   AC_MSG_NOTICE([ doxygen-doc:   build html and pdf documentation with doxygen])
353)
354AC_MSG_NOTICE([ man:           build all buildable documentation])
355AC_MSG_NOTICE()
356
357#[AC_]PACKAGE_NAME
358#[AC_]PACKAGE_TARNAME
359#[AC_]PACKAGE_VERSION
360#[AC_]PACKAGE_STRING
361#[AC_]PACKAGE_BUGREPORT
Note: See TracBrowser for help on using the repository browser.