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
|
---|
10 | AC_INIT([FACT++],[1.0],[thomas.bretz@epfl.ch],[FACTpp],[http://hello.example.com/])
|
---|
11 | AC_PREREQ([2.65])
|
---|
12 | AC_CONFIG_FILES([Makefile]) # causes x/Makefile.in to be created if x/Makefile.am exists
|
---|
13 | #AC_CONFIG_HEADERS([config.h])
|
---|
14 | AC_CONFIG_MACRO_DIR([.macro_dir])
|
---|
15 | AC_CONFIG_AUX_DIR([.aux_dir])
|
---|
16 | AC_PROG_CC([colorgcc gcc])
|
---|
17 | #If output variable CXXFLAGS was not already set, set it to -g -O2
|
---|
18 | AC_PROG_CXX([colorgcc g++])
|
---|
19 | LT_INIT([disable-static])
|
---|
20 | AC_LANG(C++)
|
---|
21 | #AC_PATH_XTRA
|
---|
22 |
|
---|
23 | ######################################################################
|
---|
24 | # Automake initial setup
|
---|
25 | ######################################################################
|
---|
26 |
|
---|
27 | AM_INIT_AUTOMAKE([1.11 -Wall subdir-objects std-options no-define color-tests parallel-tests silent-rules])
|
---|
28 | AM_SILENT_RULES([yes])
|
---|
29 | AM_PROG_CC_C_O
|
---|
30 |
|
---|
31 | ######################################################################
|
---|
32 | # DOXYGEN SUPPORT
|
---|
33 | ######################################################################
|
---|
34 |
|
---|
35 | ### FIXME: Need a configure commandline switch
|
---|
36 | DX_ENV_APPEND(EXTRACT_ALL, YES)
|
---|
37 | DX_ENV_APPEND(RECURSIVE, YES)
|
---|
38 | DX_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)
|
---|
49 | DX_PS_FEATURE(OFF) # sets GENERATE_PS (default)
|
---|
50 | DX_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 |
|
---|
58 | AC_LANG_PUSH(C)
|
---|
59 |
|
---|
60 | # Needed to compile dim
|
---|
61 | ACX_PTHREAD
|
---|
62 |
|
---|
63 | CPPFLAGS+=" "$PTHREAD_CFLAGS" "
|
---|
64 | LDFLAGS+=" "$PTHREAD_CFLAGS" "
|
---|
65 |
|
---|
66 |
|
---|
67 | # Needed to compile FACT++
|
---|
68 | AC_CHECK_READLINE
|
---|
69 |
|
---|
70 | CPPFLAGS+=" "$READLINE_INCLUDES" "
|
---|
71 | LDFLAGS+=" "$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++
|
---|
88 | AC_CHECK_HEADERS([panel.h],,
|
---|
89 | AC_MSG_ERROR([ncurses header not found]))
|
---|
90 |
|
---|
91 | # Needed to compile FACT++
|
---|
92 | AC_CHECK_LIB(panel, update_panels,,
|
---|
93 | AC_MSG_ERROR([ncurses panel library not found]))
|
---|
94 |
|
---|
95 | # Needed to compile FACT++
|
---|
96 | AC_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 |
|
---|
102 | AC_LANG_POP
|
---|
103 |
|
---|
104 | # Needed to compile FACT++
|
---|
105 | AC_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
|
---|
119 | AC_FIND_MOTIF
|
---|
120 |
|
---|
121 | CPPFLAGS+=" "$MOTIF_INCL" "
|
---|
122 | LDFLAGS+=" "$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++
|
---|
136 | MYSQL_DEVEL
|
---|
137 | MYSQLPP_DEVEL
|
---|
138 |
|
---|
139 | LDFLAGS+=" -lmysqlpp "
|
---|
140 |
|
---|
141 | ######################################################################
|
---|
142 | # BOOST SUPPORT
|
---|
143 | ######################################################################
|
---|
144 |
|
---|
145 | # Needed to compile FACT++
|
---|
146 | AX_BOOST_BASE([1.40], [],
|
---|
147 | AC_MSG_ERROR([The boost C++ libraries (>=1.40) are not properly installed.])
|
---|
148 | )
|
---|
149 |
|
---|
150 | AX_BOOST_ASIO
|
---|
151 | AX_BOOST_DATE_TIME
|
---|
152 | AX_BOOST_FILESYSTEM
|
---|
153 | AX_BOOST_PROGRAM_OPTIONS
|
---|
154 | AX_BOOST_REGEX
|
---|
155 | AX_BOOST_SYSTEM
|
---|
156 | AX_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 |
|
---|
166 | LDFLAGS+=" -lboost_date_time"
|
---|
167 | LDFLAGS+=" -lboost_filesystem"
|
---|
168 | LDFLAGS+=" -lboost_program_options"
|
---|
169 | LDFLAGS+=" -lboost_regex"
|
---|
170 | LDFLAGS+=" -lboost_system"
|
---|
171 | LDFLAGS+=" -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 |
|
---|
198 | AC_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 |
|
---|
206 | AC_ARG_WITH([root],
|
---|
207 | [AS_HELP_STRING([--without-root], [Disable root, i.e. disable gui support.])],
|
---|
208 | [], [ROOT_PATH([5.12/00])]
|
---|
209 | )
|
---|
210 |
|
---|
211 | HAVE_ROOT_QT=no
|
---|
212 |
|
---|
213 | if test "$ROOTEXEC" != no ;
|
---|
214 | then
|
---|
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 |
|
---|
224 | fi
|
---|
225 |
|
---|
226 | ######################################################################
|
---|
227 | # Check if we have colordiff to colorize 'svn diff'
|
---|
228 | ######################################################################
|
---|
229 |
|
---|
230 | # Nice to have to support colored diff
|
---|
231 | AC_CHECK_PROG(COLORDIFF, colordiff, colordiff, cat)
|
---|
232 | AC_CHECK_PROG(GROFF, groff, yes, no)
|
---|
233 | AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no)
|
---|
234 | AC_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 |
|
---|
261 | AM_CONDITIONAL(HAS_COLORDIFF, [test "$COLORDIFF" = colordiff])
|
---|
262 | AM_CONDITIONAL(HAS_GROFF, [test "$GROFF" = yes])
|
---|
263 | AM_CONDITIONAL(HAS_PS2PDF, [test "$PS2PDF" = yes])
|
---|
264 | AM_CONDITIONAL(HAS_HELP2MAN, [test "$HELP2MAN" = yes])
|
---|
265 | AM_CONDITIONAL(HAS_DOXYGEN, [test -n "$DX_DOXYGEN"])
|
---|
266 | AM_CONDITIONAL(HAS_DOT, [test -n "$DX_DOT"])
|
---|
267 | AM_CONDITIONAL(HAS_COLORGCC, [test "$GCC" = colorgcc])
|
---|
268 | AM_CONDITIONAL(HAS_QT4, [test -n "$QT4_VERSION"])
|
---|
269 | AM_CONDITIONAL(HAS_ROOT, [test "$ROOTEXEC" != no])
|
---|
270 | AM_CONDITIONAL(HAS_ROOT_QT, [test "$HAVE_ROOT_QT" = yes])
|
---|
271 | AM_CONDITIONAL(HAS_GUI, [test "$QT4_VERSION" -a "$HAVE_ROOT_QT" = yes])
|
---|
272 |
|
---|
273 | ##########################################################################
|
---|
274 | # print summary
|
---|
275 | ##########################################################################
|
---|
276 |
|
---|
277 | AC_OUTPUT
|
---|
278 |
|
---|
279 | AC_MSG_NOTICE()
|
---|
280 | AC_MSG_NOTICE(============================== summary =============================)
|
---|
281 | AC_MSG_NOTICE()
|
---|
282 |
|
---|
283 | AM_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 | )
|
---|
287 | AM_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 |
|
---|
298 | AM_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 | )
|
---|
302 | AM_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 | )
|
---|
306 | AM_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 | )
|
---|
310 | AC_MSG_NOTICE([ ROOT support enabled / root >= 5.12/00 found: $ROOTEXEC])
|
---|
311 | AC_MSG_NOTICE([ ROOT built with --with-qt found: $HAVE_ROOT_QT])
|
---|
312 | AM_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 | ],[])
|
---|
326 | AM_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 | ],[])
|
---|
338 | AC_MSG_NOTICE()
|
---|
339 | AC_MSG_NOTICE(--------------------------------------------------------------------)
|
---|
340 | AC_MSG_NOTICE()
|
---|
341 | AC_MSG_NOTICE([Suggestions and hits:])
|
---|
342 | AC_MSG_NOTICE()
|
---|
343 | AC_MSG_NOTICE([ - Add 'V=1' to you make-call to switch on verbose output.])
|
---|
344 | AC_MSG_NOTICE([ - Do not try to create man-pages with doxygen,])
|
---|
345 | AC_MSG_NOTICE([ it does most probably not work.])
|
---|
346 | AM_COND_IF(HAS_COLORGCC,,
|
---|
347 | AC_MSG_NOTICE([ - Install colorgcc to get colored compiler output.])
|
---|
348 | )
|
---|
349 | AC_MSG_NOTICE()
|
---|
350 | AC_MSG_NOTICE(--------------------------------------------------------------------)
|
---|
351 | AC_MSG_NOTICE()
|
---|
352 | AC_MSG_NOTICE([Some interesting build targets:])
|
---|
353 | AC_MSG_NOTICE()
|
---|
354 | AC_MSG_NOTICE([ diff: colored 'svn diff' if colordiff is installed])
|
---|
355 | AM_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 | ])
|
---|
365 | AM_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 | )
|
---|
369 | AC_MSG_NOTICE([ man: build all buildable documentation])
|
---|
370 | AC_MSG_NOTICE()
|
---|
371 | AC_MSG_NOTICE(--------------------------------------------------------------------)
|
---|
372 | AC_MSG_NOTICE()
|
---|
373 | AM_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 | )
|
---|
378 | AM_COND_IF(HAS_GUI, [],
|
---|
379 | AC_MSG_WARN([ Either QT4 or qt-root is missing: GUI disabled!])
|
---|
380 | )
|
---|
381 | AC_MSG_NOTICE()
|
---|