1 | ######################################################################
|
---|
2 | # Autoconf initial setup
|
---|
3 | ######################################################################
|
---|
4 |
|
---|
5 | AC_INIT([FACT++],[1.0],[thomas.bretz@epfl.ch],[FACTpp],[http://hello.example.com/])
|
---|
6 | AC_PREREQ([2.65])
|
---|
7 | AC_CONFIG_FILES([Makefile]) # causes x/Makefile.in to be created if x/Makefile.am exists
|
---|
8 | #AC_CONFIG_HEADERS([config.h])
|
---|
9 | AC_CONFIG_MACRO_DIR([.macro_dir])
|
---|
10 | AC_CONFIG_AUX_DIR([.aux_dir])
|
---|
11 | AC_PROG_CC([colorgcc gcc])
|
---|
12 | #If output variable CXXFLAGS was not already set, set it to -g -O2
|
---|
13 | AC_PROG_CXX([colorgcc g++])
|
---|
14 | LT_INIT([disable-static])
|
---|
15 | AC_LANG(C++)
|
---|
16 | #AC_PATH_XTRA
|
---|
17 |
|
---|
18 | ######################################################################
|
---|
19 | # Automake initial setup
|
---|
20 | ######################################################################
|
---|
21 |
|
---|
22 | AM_INIT_AUTOMAKE([1.11 -Wall subdir-objects std-options no-define color-tests parallel-tests silent-rules])
|
---|
23 | AM_SILENT_RULES([yes])
|
---|
24 | AM_PROG_CC_C_O
|
---|
25 |
|
---|
26 | ######################################################################
|
---|
27 | # DOXYGEN SUPPORT
|
---|
28 | ######################################################################
|
---|
29 |
|
---|
30 | ### FIXME: Need a configure commandline switch
|
---|
31 | DX_ENV_APPEND(EXTRACT_ALL, YES)
|
---|
32 | DX_ENV_APPEND(RECURSIVE, YES)
|
---|
33 | DX_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)
|
---|
44 | DX_PS_FEATURE(OFF) # sets GENERATE_PS (default)
|
---|
45 | DX_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 |
|
---|
53 | AC_LANG_PUSH(C)
|
---|
54 |
|
---|
55 | # Needed to compile dim
|
---|
56 | ACX_PTHREAD
|
---|
57 |
|
---|
58 | CPPFLAGS+=" "$PTHREAD_CFLAGS" "
|
---|
59 | LDFLAGS+=" "$PTHREAD_CFLAGS" "
|
---|
60 |
|
---|
61 |
|
---|
62 | # Needed to compile FACT++
|
---|
63 | AC_CHECK_READLINE
|
---|
64 |
|
---|
65 | CPPFLAGS+=" "$READLINE_INCLUDES" "
|
---|
66 | LDFLAGS+=" "$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++
|
---|
83 | AC_CHECK_HEADERS([panel.h],,
|
---|
84 | AC_MSG_ERROR([ncurses header not found]))
|
---|
85 |
|
---|
86 | # Needed to compile FACT++
|
---|
87 | AC_CHECK_LIB(panel, update_panels,,
|
---|
88 | AC_MSG_ERROR([ncurses panel library not found]))
|
---|
89 |
|
---|
90 | # Needed to compile FACT++
|
---|
91 | AC_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 |
|
---|
97 | AC_LANG_POP
|
---|
98 |
|
---|
99 | # Needed to compile FACT++
|
---|
100 | AC_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
|
---|
114 | AC_FIND_MOTIF
|
---|
115 |
|
---|
116 | CPPFLAGS+=" "$MOTIF_INCL" "
|
---|
117 | LDFLAGS+=" "$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++
|
---|
131 | MYSQL_DEVEL
|
---|
132 | MYSQLPP_DEVEL
|
---|
133 |
|
---|
134 | LDFLAGS+=" -lmysqlpp "
|
---|
135 |
|
---|
136 | ######################################################################
|
---|
137 | # BOOST SUPPORT
|
---|
138 | ######################################################################
|
---|
139 |
|
---|
140 | # Needed to compile FACT++
|
---|
141 | AX_BOOST_BASE([1.40], [],
|
---|
142 | [
|
---|
143 | echo "Error! The boost C++ libraries are not properly installed."
|
---|
144 | exit -1
|
---|
145 | ]
|
---|
146 | )
|
---|
147 |
|
---|
148 | AX_BOOST_ASIO
|
---|
149 | AX_BOOST_DATE_TIME
|
---|
150 | AX_BOOST_FILESYSTEM
|
---|
151 | AX_BOOST_PROGRAM_OPTIONS
|
---|
152 | AX_BOOST_REGEX
|
---|
153 | AX_BOOST_SYSTEM
|
---|
154 | AX_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 |
|
---|
164 | LDFLAGS+=" -lboost_date_time"
|
---|
165 | LDFLAGS+=" -lboost_filesystem"
|
---|
166 | LDFLAGS+=" -lboost_program_options"
|
---|
167 | LDFLAGS+=" -lboost_regex"
|
---|
168 | LDFLAGS+=" -lboost_system"
|
---|
169 | LDFLAGS+=" -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 | # ROOT SUPPORT
|
---|
194 | ######################################################################
|
---|
195 |
|
---|
196 | # ROOT_PATH([5.12/00, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]])
|
---|
197 | # ROOT_PATH([5.12/00])
|
---|
198 | # ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old))
|
---|
199 | # ROOT_PATH(, AC_DEFINE([HAVE_ROOT]))
|
---|
200 |
|
---|
201 | # ROOTCONF full path to root-config
|
---|
202 | # ROOTEXEC full path to root
|
---|
203 | # ROOTCINT full path to rootcint
|
---|
204 | # ROOTLIBDIR Where the ROOT libraries are
|
---|
205 | # ROOTINCDIR Where the ROOT headers are
|
---|
206 | # ROOTETCDIR Where the ROOT configuration is
|
---|
207 | # ROOTCFLAGS Extra compiler flags
|
---|
208 | # ROOTLIBS ROOT basic libraries
|
---|
209 | # ROOTGLIBS ROOT basic + GUI libraries
|
---|
210 | # ROOTAUXLIBS Auxilary libraries and linker flags for ROOT
|
---|
211 | # ROOTAUXCFLAGS Auxilary compiler flags
|
---|
212 | # ROOTRPATH Same as ROOTLIBDIR
|
---|
213 |
|
---|
214 |
|
---|
215 | ######################################################################
|
---|
216 | # Check if we have colordiff to colorize 'svn diff'
|
---|
217 | ######################################################################
|
---|
218 |
|
---|
219 | # Nice to have to support colored diff
|
---|
220 | AC_CHECK_PROG(COLORDIFF, colordiff, colordiff, cat)
|
---|
221 | AC_CHECK_PROG(GROFF, groff, yes, no)
|
---|
222 | AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no)
|
---|
223 | AC_CHECK_PROG(HELP2MAN, help2man, yes, no)
|
---|
224 |
|
---|
225 | ##########################################################################
|
---|
226 | # debug compilation support
|
---|
227 | ##########################################################################
|
---|
228 | #
|
---|
229 | #AC_MSG_CHECKING([whether to build with debug information])
|
---|
230 | #AC_ARG_ENABLE([debug],
|
---|
231 | # [AS_HELP_STRING([--enable-debug],
|
---|
232 | # [enable debug data generation (def=no)])],
|
---|
233 | # [debugit="$enableval"],
|
---|
234 | # [debugit=no])
|
---|
235 | #AC_MSG_RESULT([$debugit])
|
---|
236 | #
|
---|
237 | #if test x"$debugit" = x"yes"; then
|
---|
238 | # AC_DEFINE([DEBUG],[],[Debug Mode])
|
---|
239 | # AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
|
---|
240 | #else
|
---|
241 | # AC_DEFINE([NDEBUG],[],[No-debug Mode])
|
---|
242 | # AM_CXXFLAGS="$AM_CXXFLAGS -O3"
|
---|
243 | #fi
|
---|
244 | #
|
---|
245 |
|
---|
246 | ##########################################################################
|
---|
247 | # produce conditionals for Makefile.am and for summary
|
---|
248 | ##########################################################################
|
---|
249 |
|
---|
250 | AM_CONDITIONAL(HAS_COLORDIFF, [test "$COLORDIFF" = colordiff])
|
---|
251 | AM_CONDITIONAL(HAS_GROFF, [test "$GROFF" = yes])
|
---|
252 | AM_CONDITIONAL(HAS_PS2PDF, [test "$PS2PDF" = yes])
|
---|
253 | AM_CONDITIONAL(HAS_HELP2MAN, [test "$HELP2MAN" = yes])
|
---|
254 | AM_CONDITIONAL(HAS_DOXYGEN, [test -n "$DX_DOXYGEN"])
|
---|
255 | AM_CONDITIONAL(HAS_DOT, [test -n "$DX_DOT"])
|
---|
256 | AM_CONDITIONAL(HAS_COLORGCC, [test "$GCC" = colorgcc])
|
---|
257 |
|
---|
258 | ##########################################################################
|
---|
259 | # print summary
|
---|
260 | ##########################################################################
|
---|
261 |
|
---|
262 | AC_OUTPUT
|
---|
263 |
|
---|
264 | AC_MSG_NOTICE()
|
---|
265 | AC_MSG_NOTICE(============================== summary =============================)
|
---|
266 | AC_MSG_NOTICE()
|
---|
267 |
|
---|
268 | AM_COND_IF(HAS_COLORDIFF,
|
---|
269 | AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: yes]),
|
---|
270 | AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: no])
|
---|
271 | )
|
---|
272 | AM_COND_IF(HAS_HELP2MAN,[
|
---|
273 | AC_MSG_NOTICE([ man-pages enabled / 'help2man' found: $HELP2MAN])
|
---|
274 | AM_COND_IF(HAS_GROFF,
|
---|
275 | AC_MSG_NOTICE([ build of html enabled / 'groff' found: yes])
|
---|
276 | AC_MSG_NOTICE([ build of pdf enabled / 'ps2pdf' found: $PS2PDF]),
|
---|
277 | AC_MSG_NOTICE([ build of html and pdf / 'groff' found: no])
|
---|
278 | )
|
---|
279 | ],[
|
---|
280 | AC_MSG_NOTICE([ man, html, pdf enabled / 'help2man' found: no])
|
---|
281 | ])
|
---|
282 |
|
---|
283 | AM_COND_IF(HAS_DOXYGEN,
|
---|
284 | AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: $DX_DOXYGEN]),
|
---|
285 | AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: no])
|
---|
286 | )
|
---|
287 | AM_COND_IF(HAS_DOT,
|
---|
288 | AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: $DX_DOT]),
|
---|
289 | AC_MSG_NOTICE([ doxagen graphs enabled / 'dot' (graphviz) found: no])
|
---|
290 | )
|
---|
291 | AC_MSG_NOTICE()
|
---|
292 | AC_MSG_NOTICE(--------------------------------------------------------------------)
|
---|
293 | AC_MSG_NOTICE()
|
---|
294 | AC_MSG_NOTICE([Suggestions and hits:])
|
---|
295 | AC_MSG_NOTICE()
|
---|
296 | AC_MSG_NOTICE([ - Add 'V=1' to you make-call to switch on verbose output.])
|
---|
297 | AC_MSG_NOTICE([ - Do not try to create man-pages with doxygen,])
|
---|
298 | AC_MSG_NOTICE([ it does most probably not work.])
|
---|
299 | AM_COND_IF(HAS_COLORGCC,,
|
---|
300 | AC_MSG_NOTICE([ - Install colorgcc to get colored compiler output.])
|
---|
301 | )
|
---|
302 | AC_MSG_NOTICE()
|
---|
303 | AC_MSG_NOTICE(--------------------------------------------------------------------)
|
---|
304 | AC_MSG_NOTICE()
|
---|
305 | AC_MSG_NOTICE([Some interesting build targets:])
|
---|
306 | AC_MSG_NOTICE()
|
---|
307 | AC_MSG_NOTICE([ diff: colored 'svn diff' if colordiff is installed])
|
---|
308 | AM_COND_IF(HAS_HELP2MAN,[
|
---|
309 | AC_MSG_NOTICE([ program.man: build man-page from 'program --help'])
|
---|
310 | AC_MSG_NOTICE([ (display with 'man ./program.man')])
|
---|
311 | AM_COND_IF(HAS_GROFF,[
|
---|
312 | AC_MSG_NOTICE([ program.html: build html page from man-page])
|
---|
313 | AM_COND_IF(HAS_PS2PDF,
|
---|
314 | AC_MSG_NOTICE([ program.pdf: build pdf documentation from man page])
|
---|
315 | )
|
---|
316 | ])
|
---|
317 | ])
|
---|
318 | AM_COND_IF(HAS_DOXYGEN,
|
---|
319 | AC_MSG_NOTICE([ doxygen-run: build html documentation with doxygen])
|
---|
320 | AC_MSG_NOTICE([ doxygen-doc: build html and pdf documentation with doxygen])
|
---|
321 | )
|
---|
322 | AC_MSG_NOTICE([ man: build all buildable documentation])
|
---|
323 | AC_MSG_NOTICE()
|
---|