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

Last change on this file since 10401 was 10401, checked in by tbretz, 9 years ago
Implemented QT4 detection.
File size: 11.6 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#AC_DEFUN([QT4_TRY_LINK],
193#AC_DEFUN([QT4_CHECK_COMPILE],
194#AC_DEFUN([QT4_GET_VERSION],
195QT4_DO_IT_ALL
196#AC_DEFUN([QT4_DO_PKG_CONFIG],
197#AC_DEFUN([QT4_DO_MANUAL_CONFIG],
198
199#AC_CHECK_PROG(QT4_MOC, moc, moc,
200#   AC_MSG_ERROR([QT4 executable 'moc' not found in path.]))
201#AC_CHECK_PROG(QT4_UIC, uic, uic,
202#   AC_MSG_ERROR([QT4 executable 'moc' not found in path.]))
203
204######################################################################
205# ROOT SUPPORT
206######################################################################
207
208# ROOT_PATH([5.12/00, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]])
209# ROOT_PATH([5.12/00])
210# ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old))
211# ROOT_PATH(, AC_DEFINE([HAVE_ROOT]))
212
213# ROOTCONF           full path to root-config
214# ROOTEXEC           full path to root
215# ROOTCINT           full path to rootcint
216# ROOTLIBDIR         Where the ROOT libraries are
217# ROOTINCDIR         Where the ROOT headers are
218# ROOTETCDIR         Where the ROOT configuration is
219# ROOTCFLAGS         Extra compiler flags
220# ROOTLIBS           ROOT basic libraries
221# ROOTGLIBS          ROOT basic + GUI libraries
222# ROOTAUXLIBS        Auxilary libraries and linker flags for ROOT
223# ROOTAUXCFLAGS      Auxilary compiler flags
224# ROOTRPATH          Same as ROOTLIBDIR
225
226
227######################################################################
228# Check if we have colordiff to colorize 'svn diff'
229######################################################################
230
231# Nice to have to support colored diff
232AC_CHECK_PROG(COLORDIFF, colordiff,    colordiff, cat)
233AC_CHECK_PROG(GROFF,     groff,        yes, no)
234AC_CHECK_PROG(PS2PDF,    ps2pdf,       yes, no)
235AC_CHECK_PROG(HELP2MAN,  help2man,     yes, no)
236
237##########################################################################
238# debug compilation support
239##########################################################################
240#
241#AC_MSG_CHECKING([whether to build with debug information])
242#AC_ARG_ENABLE([debug],
243#    [AS_HELP_STRING([--enable-debug],
244#        [enable debug data generation (def=no)])],
245#    [debugit="$enableval"],
246#    [debugit=no])
247#AC_MSG_RESULT([$debugit])
248#
249#if test x"$debugit" = x"yes"; then
250#    AC_DEFINE([DEBUG],[],[Debug Mode])
251#    AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
252#else
253#    AC_DEFINE([NDEBUG],[],[No-debug Mode])
254#    AM_CXXFLAGS="$AM_CXXFLAGS -O3"
255#fi
256#
257
258##########################################################################
259# produce conditionals for Makefile.am and for summary
260##########################################################################
261
262AM_CONDITIONAL(HAS_COLORDIFF, [test "$COLORDIFF" = colordiff])
263AM_CONDITIONAL(HAS_GROFF,     [test "$GROFF" = yes])
264AM_CONDITIONAL(HAS_PS2PDF,    [test "$PS2PDF" = yes])
265AM_CONDITIONAL(HAS_HELP2MAN,  [test "$HELP2MAN" = yes])
266AM_CONDITIONAL(HAS_DOXYGEN,   [test -n "$DX_DOXYGEN"])
267AM_CONDITIONAL(HAS_DOT,       [test -n "$DX_DOT"])
268AM_CONDITIONAL(HAS_COLORGCC,  [test "$GCC" = colorgcc])
269
270##########################################################################
271# print summary
272##########################################################################
273
274AC_OUTPUT
275
276AC_MSG_NOTICE()
277AC_MSG_NOTICE(============================== summary =============================)
278AC_MSG_NOTICE()
279
280AM_COND_IF(HAS_COLORDIFF,
281   AC_MSG_NOTICE([ colored svn diff       / 'colordiff'      found: yes]),
282   AC_MSG_NOTICE([ colored svn diff       / 'colordiff'      found: no])
283)
284AM_COND_IF(HAS_HELP2MAN,[
285   AC_MSG_NOTICE([ man-pages enabled      / 'help2man'       found: $HELP2MAN])
286   AM_COND_IF(HAS_GROFF,
287      AC_MSG_NOTICE([ build of html enabled  / 'groff'          found: yes])
288      AC_MSG_NOTICE([ build of pdf  enabled  / 'ps2pdf'         found: $PS2PDF]),
289      AC_MSG_NOTICE([ build of html and pdf  / 'groff'          found: no])
290   )
291],[
292   AC_MSG_NOTICE([ man, html, pdf enabled / 'help2man'       found: no])
293])   
294
295AM_COND_IF(HAS_DOXYGEN,
296   AC_MSG_NOTICE([ doxygen docu enabled   / 'doxygen'        found: $DX_DOXYGEN]),
297   AC_MSG_NOTICE([ doxygen docu enabled   / 'doxygen'        found: no])
298)
299AM_COND_IF(HAS_DOT,
300   AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: $DX_DOT]),
301   AC_MSG_NOTICE([ doxagen graphs enabled / 'dot' (graphviz) found: no])
302)
303AC_MSG_NOTICE()
304AC_MSG_NOTICE(--------------------------------------------------------------------)
305AC_MSG_NOTICE()
306AC_MSG_NOTICE([ QT4_VERSION  = $QT4_VERSION])
307AC_MSG_NOTICE()
308AC_MSG_NOTICE([ QT4_LIB      = $QT4_LIB])
309AC_MSG_NOTICE([ QT4_LDFLAGS  = $QT4_LDFLAGS])
310AC_MSG_NOTICE([ QT4_INCLUDES = $QT4_INCLUDES])
311AC_MSG_NOTICE()
312AC_MSG_NOTICE([ MOC4 = $MOC4])
313AC_MSG_NOTICE([ UIC4 = $UIC4])
314AC_MSG_NOTICE([ RCC4 = $RCC4])
315AC_MSG_NOTICE()
316AC_MSG_NOTICE(--------------------------------------------------------------------)
317AC_MSG_NOTICE()
318AC_MSG_NOTICE([Suggestions and hits:])
319AC_MSG_NOTICE()
320AC_MSG_NOTICE([  - Add 'V=1' to you make-call to switch on verbose output.])
321AC_MSG_NOTICE([  - Do not try to create man-pages with doxygen,])
322AC_MSG_NOTICE([    it does most probably not work.])
323AM_COND_IF(HAS_COLORGCC,,
324   AC_MSG_NOTICE([  - Install colorgcc to get colored compiler output.])
325)
326AC_MSG_NOTICE()
327AC_MSG_NOTICE(--------------------------------------------------------------------)
328AC_MSG_NOTICE()
329AC_MSG_NOTICE([Some interesting build targets:])
330AC_MSG_NOTICE()
331AC_MSG_NOTICE([ diff:          colored 'svn diff' if colordiff is installed])
332AM_COND_IF(HAS_HELP2MAN,[
333   AC_MSG_NOTICE([ program.man:   build man-page from 'program --help'])
334   AC_MSG_NOTICE([                (display with 'man ./program.man')])
335   AM_COND_IF(HAS_GROFF,[
336      AC_MSG_NOTICE([ program.html:  build html page from man-page])
337      AM_COND_IF(HAS_PS2PDF,
338         AC_MSG_NOTICE([ program.pdf:   build pdf documentation from man page])
339      )
340   ])
341])
342AM_COND_IF(HAS_DOXYGEN,
343   AC_MSG_NOTICE([ doxygen-run:   build html documentation with doxygen])
344   AC_MSG_NOTICE([ doxygen-doc:   build html and pdf documentation with doxygen])
345)
346AC_MSG_NOTICE([ man:           build all buildable documentation])
347AC_MSG_NOTICE()
348
349#[AC_]PACKAGE_NAME
350#[AC_]PACKAGE_TARNAME
351#[AC_]PACKAGE_VERSION
352#[AC_]PACKAGE_STRING
353#[AC_]PACKAGE_BUGREPORT
Note: See TracBrowser for help on using the repository browser.