Mercurial > libpst
comparison configure.ac @ 385:0917d53d78b3
Rename configure.in to configure.ac
The old name was deprecated in 2013.
See-also: https://lists.gnu.org/archive/html/automake/2013-05/msg00049.html
Suggested-by: lintian, aclocal
X: libpst source: deprecated-configure-filename
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
author | Paul Wise <pabs3@bonedaddy.net> |
---|---|
date | Sat, 21 Dec 2019 21:25:44 +0800 |
parents | |
children | f1f9920cc7b1 |
comparison
equal
deleted
inserted
replaced
384:58149891ea7b | 385:0917d53d78b3 |
---|---|
1 AC_PREREQ(2.60) | |
2 AC_INIT(libpst,0.6.73,carl@five-ten-sg.com) | |
3 AC_CONFIG_SRCDIR([src/libpst.c]) | |
4 AC_CONFIG_HEADER([config.h]) | |
5 AC_CONFIG_MACRO_DIR([m4]) | |
6 AM_INIT_AUTOMAKE | |
7 AC_CANONICAL_HOST | |
8 AC_USE_SYSTEM_EXTENSIONS | |
9 | |
10 # | |
11 # 1. Remember that version-info is current:revision:age, and age <= current. | |
12 # 2. If the source code has changed at all since the last public release, | |
13 # then increment revision (`c:r:a' becomes `c:r+1:a'). | |
14 # 3. If any interfaces have been added, removed, or changed since the last | |
15 # update, increment current, and set revision to 0. | |
16 # 4. If any interfaces have been added since the last public release, then | |
17 # increment age, since we should be backward compatible with the previous | |
18 # version. | |
19 # 5. If any interfaces have been removed or changed since the last public | |
20 # release, then set age to 0, since we are not backward compatible. | |
21 # 6. libtool will build libpst.so.x.y.z where the SONAME is libpst.so.x | |
22 # and x=current-age, y=age, z=revision | |
23 | |
24 libpst_version_info='5:15:1' | |
25 AC_SUBST(LIBPST_VERSION_INFO, [$libpst_version_info]) | |
26 libpst_so_major='4' | |
27 AC_SUBST(LIBPST_SO_MAJOR, [$libpst_so_major]) | |
28 | |
29 # libpst | |
30 # version soname so library name | |
31 # 0.6.35 libpst.so.2 libpst.so.2.0.0 | |
32 # 0.6.37 libpst.so.2 libpst.so.2.1.0 | |
33 # 0.6.38 libpst.so.2 libpst.so.2.1.0 | |
34 # 0.6.40 libpst.so.4 libpst.so.4.0.0 | |
35 # 0.6.43 libpst.so.4 libpst.so.4.0.1 | |
36 # 0.6.47 libpst.so.4 libpst.so.4.0.2 | |
37 # 0.6.48 libpst.so.4 libpst.so.4.0.3 | |
38 # 0.6.49 libpst.so.4 libpst.so.4.0.4 | |
39 # 0.6.50 libpst.so.4 libpst.so.4.1.0 | |
40 # 0.6.51 libpst.so.4 libpst.so.4.1.1 | |
41 # 0.6.52 libpst.so.4 libpst.so.4.1.2 | |
42 # 0.6.53 libpst.so.4 libpst.so.4.1.3 | |
43 # 0.6.54 libpst.so.4 libpst.so.4.1.4 | |
44 # 0.6.55 libpst.so.4 libpst.so.4.1.5 | |
45 # 0.6.56 libpst.so.4 libpst.so.4.1.6 | |
46 # 0.6.57 libpst.so.4 libpst.so.4.1.6 | |
47 # 0.6.58 libpst.so.4 libpst.so.4.1.7 | |
48 # 0.6.59 libpst.so.4 libpst.so.4.1.8 | |
49 # 0.6.60 libpst.so.4 libpst.so.4.1.9 | |
50 # 0.6.61 libpst.so.4 libpst.so.4.1.9 | |
51 # 0.6.62 libpst.so.4 libpst.so.4.1.9 | |
52 # 0.6.63 libpst.so.4 libpst.so.4.1.10 | |
53 # 0.6.66 libpst.so.4 libpst.so.4.1.11 | |
54 # 0.6.67 libpst.so.4 libpst.so.4.1.12 | |
55 # 0.6.68 libpst.so.4 libpst.so.4.1.13 | |
56 # 0.6.69 libpst.so.4 libpst.so.4.1.14 | |
57 # 0.6.73 libpst.so.4 libpst.so.4.1.15 | |
58 | |
59 | |
60 | |
61 # Check for solaris | |
62 AC_MSG_CHECKING([for Solaris]) | |
63 case "$host" in | |
64 *solaris*) | |
65 os_solaris=yes | |
66 ;; | |
67 *) | |
68 os_solaris=no | |
69 ;; | |
70 esac | |
71 AC_MSG_RESULT($os_solaris) | |
72 AM_CONDITIONAL(OS_SOLARIS, [test "$os_solaris" = "yes"]) | |
73 | |
74 | |
75 # Check for win32 | |
76 AC_MSG_CHECKING([for Win32]) | |
77 case "$host" in | |
78 *-mingw*) | |
79 os_win32=yes | |
80 ;; | |
81 *) | |
82 os_win32=no | |
83 ;; | |
84 esac | |
85 AC_MSG_RESULT($os_win32) | |
86 AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"]) | |
87 | |
88 | |
89 # Check for Win32 platform | |
90 AC_MSG_CHECKING([for Win32 platform in general]) | |
91 case "$host" in | |
92 *-cygwin*) | |
93 platform_win32=yes | |
94 ;; | |
95 *) | |
96 platform_win32=$os_win32 | |
97 ;; | |
98 esac | |
99 AC_MSG_RESULT($platform_win32) | |
100 AM_CONDITIONAL(PLATFORM_WIN32, [test "$platform_win32" = "yes"]) | |
101 | |
102 | |
103 # Checks for programs. | |
104 # The following lines adds the --enable-dii option to configure: | |
105 # | |
106 # Give the user the choice to enter one of these: | |
107 # --enable-dii | |
108 # --enable-dii=yes | |
109 # --enable-dii=no | |
110 # | |
111 AC_MSG_CHECKING([whether we are enabling dii utility]) | |
112 AC_ARG_ENABLE(dii, | |
113 AC_HELP_STRING([--enable-dii], [enable dii utility]), | |
114 [ | |
115 case "${enableval}" in | |
116 yes) ;; | |
117 no) ;; | |
118 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dii) ;; | |
119 esac | |
120 ], | |
121 # default if not specified | |
122 enable_dii=yes | |
123 ) | |
124 AC_MSG_RESULT([$enable_dii]) | |
125 AC_PATH_PROG(CONVERT, convert) | |
126 if test "x$CONVERT" = "x" ; then | |
127 if test "$enable_dii" = "yes"; then | |
128 enable_dii=no | |
129 AC_MSG_WARN([convert program not found. pst2dii disabled]) | |
130 fi | |
131 else | |
132 if test "x`$CONVERT --version 2>&1 | grep -i imagemagick >/dev/null ; echo $?`" != "x0"; then | |
133 if test "$enable_dii" = "yes"; then | |
134 enable_dii=no | |
135 AC_MSG_WARN([wrong convert program found. pst2dii disabled]) | |
136 fi | |
137 fi | |
138 fi | |
139 AC_CHECK_HEADER([gd.h], | |
140 [ | |
141 AC_DEFINE([HAVE_GD_H], [1], [Define to 1 if you have the <gd.h> header file.]) | |
142 ], | |
143 [ | |
144 if test "$enable_dii" = "yes"; then | |
145 enable_dii=no | |
146 AC_MSG_WARN([gd.h not found. pst2dii disabled]) | |
147 fi | |
148 ]) | |
149 AM_CONDITIONAL(BUILD_DII, [test "$enable_dii" = "yes"]) | |
150 | |
151 | |
152 # Checks for programs. | |
153 AC_PROG_CXX | |
154 AC_PROG_CC | |
155 AM_PROG_CC_C_O | |
156 AC_PROG_CPP | |
157 AC_PROG_INSTALL | |
158 AC_PROG_LN_S | |
159 AC_PROG_LIBTOOL | |
160 AC_PROG_MAKE_SET | |
161 | |
162 | |
163 # make sure we get large file support | |
164 AC_SYS_LARGEFILE | |
165 AC_CHECK_SIZEOF(off_t) | |
166 | |
167 | |
168 # Checks for header files. | |
169 AC_CHECK_HEADER([unistd.h], | |
170 AM_CONDITIONAL(NEED_XGETOPT, [test yes = no]), | |
171 AM_CONDITIONAL(NEED_XGETOPT, [test yes = yes]) | |
172 ) | |
173 AC_HEADER_DIRENT | |
174 AC_HEADER_STDC | |
175 AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h inttypes.h limits.h regex.h semaphore.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/param.h sys/shm.h sys/stat.h sys/types.h time.h unistd.h wchar.h]) | |
176 AC_SEARCH_LIBS([sem_init],[pthread rt]) | |
177 | |
178 | |
179 # Checks for typedefs, structures, and compiler characteristics. | |
180 AC_HEADER_STDBOOL | |
181 AC_HEADER_SYS_WAIT | |
182 AC_C_CONST | |
183 AC_C_INLINE | |
184 AC_TYPE_OFF_T | |
185 AC_TYPE_SIZE_T | |
186 AC_TYPE_PID_T | |
187 AC_STRUCT_TM | |
188 | |
189 | |
190 # Checks for library functions. | |
191 AC_FUNC_FORK | |
192 AC_FUNC_FSEEKO | |
193 AC_FUNC_STAT | |
194 AC_FUNC_LSTAT | |
195 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK | |
196 if test "$cross_compiling" != "yes"; then | |
197 AC_FUNC_MALLOC | |
198 AC_FUNC_MKTIME | |
199 AC_FUNC_REALLOC | |
200 fi | |
201 AC_FUNC_STRFTIME | |
202 AC_FUNC_VPRINTF | |
203 AC_CHECK_FUNCS([chdir getcwd memchr memmove memset regcomp strcasecmp strncasecmp strchr strdup strerror strpbrk strrchr strstr strtol get_current_dir_name]) | |
204 AM_ICONV | |
205 if test "$am_cv_func_iconv" != "yes"; then | |
206 AC_MSG_ERROR([libpst requires iconv which is missing]) | |
207 fi | |
208 | |
209 | |
210 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec, | |
211 [REGEXLIB=-lregex | |
212 AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])], | |
213 [AC_MSG_ERROR([No regex library found])])]) | |
214 AC_SUBST(REGEXLIB) | |
215 | |
216 | |
217 # The following lines adds the --enable-pst-debug option to configure: | |
218 # | |
219 # Give the user the choice to enter one of these: | |
220 # --enable-pst-debug | |
221 # --enable-pst-debug=yes | |
222 # --enable-pst-debug=no | |
223 # | |
224 AC_MSG_CHECKING([whether we are forcing debug dump file creation]) | |
225 AC_ARG_ENABLE(pst-debug, | |
226 AC_HELP_STRING([--enable-pst-debug], [force debug dump file creation]), | |
227 [ | |
228 case "${enableval}" in | |
229 yes) ;; | |
230 no) ;; | |
231 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pst-debug) ;; | |
232 esac | |
233 ], | |
234 # default if not specified | |
235 enable_pst_debug=no | |
236 ) | |
237 AC_MSG_RESULT([$enable_pst_debug]) | |
238 if test "$enable_pst_debug" = "yes"; then | |
239 AC_DEFINE(DEBUG_ALL, 1, Define to 1 to force debug dump file creation) | |
240 fi | |
241 | |
242 | |
243 # The following lines adds the --enable-libpst-shared option to configure: | |
244 # | |
245 # Give the user the choice to enter one of these: | |
246 # --enable-libpst-shared | |
247 # --enable-libpst-shared=yes | |
248 # --enable-libpst-shared=no | |
249 # | |
250 AC_MSG_CHECKING([whether we are building libpst shared object]) | |
251 AC_ARG_ENABLE(libpst-shared, | |
252 AC_HELP_STRING([--enable-libpst-shared], [build libpst shared object]), | |
253 [ | |
254 case "${enableval}" in | |
255 yes) ;; | |
256 no) ;; | |
257 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libpst-shared) ;; | |
258 esac | |
259 ], | |
260 # default if not specified | |
261 enable_libpst_shared=no | |
262 ) | |
263 AC_MSG_RESULT([$enable_libpst_shared]) | |
264 enable_static_tools=yes | |
265 if test "$enable_libpst_shared" = "yes"; then | |
266 enable_shared=yes | |
267 enable_static_tools=no | |
268 fi | |
269 | |
270 # needed by STATIC_TOOLS in src/Makefile.am | |
271 AC_SUBST(PST_OBJDIR, [$objdir]) | |
272 | |
273 | |
274 # The following lines adds the --enable-static-tools option to configure: | |
275 # | |
276 # Give the user the choice to enter one of these: | |
277 # --enable-static-tools | |
278 # --enable-static-tools=yes | |
279 # --enable-static-tools=no | |
280 # | |
281 AC_MSG_CHECKING([whether to link command line tools with libpst statically]) | |
282 AC_ARG_ENABLE([static-tools], | |
283 AC_HELP_STRING([--enable-static-tools], [link command line tools with libpst statically]), | |
284 [ | |
285 case "${enableval}" in | |
286 yes) ;; | |
287 no) ;; | |
288 *) AC_MSG_ERROR(bad value ${enableval} for --enable-static-tools) ;; | |
289 esac | |
290 ], | |
291 [ | |
292 enable_static_tools=no | |
293 ]) | |
294 AC_MSG_RESULT([$enable_static_tools]) | |
295 AM_CONDITIONAL(STATIC_TOOLS, [test "$enable_static_tools" = "yes"]) | |
296 if test "$enable_static_tools" = "yes"; then | |
297 enable_static="yes" | |
298 fi | |
299 | |
300 | |
301 # The following lines adds the --enable-python option to configure: | |
302 # | |
303 # Give the user the choice to enter one of these: | |
304 # --enable-python | |
305 # --enable-python=yes | |
306 # --enable-python=no | |
307 # | |
308 AC_MSG_CHECKING([whether to build the libpst python interface]) | |
309 AC_ARG_ENABLE([python], | |
310 AC_HELP_STRING([--enable-python], [build libpst python interface]), | |
311 [ | |
312 case "${enableval}" in | |
313 yes) ;; | |
314 no) ;; | |
315 *) AC_MSG_ERROR(bad value ${enableval} for --python) ;; | |
316 esac | |
317 ], | |
318 [ | |
319 enable_python=yes | |
320 ]) | |
321 AC_MSG_RESULT([$enable_python]) | |
322 AM_CONDITIONAL(PYTHON_INTERFACE, [test "$enable_python" = "yes"]) | |
323 if test "$enable_python" = "yes"; then | |
324 enable_shared="yes" | |
325 # get the version of installed python | |
326 AX_PYTHON | |
327 if test "$ax_python_bin" = "no"; then | |
328 AC_MSG_ERROR(python binary not found) | |
329 fi | |
330 PYTHON_VERSION=`echo $ax_python_bin | cut -c7-` | |
331 | |
332 # find the flags for that version | |
333 AX_PYTHON_DEVEL([$PYTHON_VERSION]) | |
334 | |
335 # do we have boost python? | |
336 AX_BOOST_PYTHON | |
337 if test "$ac_cv_boost_python" = "no"; then | |
338 AC_MSG_ERROR(boost python not found) | |
339 fi | |
340 AC_SUBST(PYTHON_VERSION, [$ax_python_bin]) | |
341 fi | |
342 | |
343 | |
344 # The following lines adds the --enable-profiling option to configure: | |
345 # | |
346 # Give the user the choice to enter one of these: | |
347 # --enable-profiling | |
348 # --enable-profiling=yes | |
349 # --enable-profiling=no | |
350 # | |
351 AC_MSG_CHECKING([whether to link with gprof profiling]) | |
352 AC_ARG_ENABLE([profiling], | |
353 AC_HELP_STRING([--enable-profiling], [link with gprof profiling]), | |
354 [ | |
355 case "${enableval}" in | |
356 yes) | |
357 CFLAGS="$CFLAGS -pg" | |
358 CPPFLAGS="$CPPFLAGS -pg" | |
359 CXXFLAGS="$CXXFLAGS -pg" | |
360 ;; | |
361 no) | |
362 ;; | |
363 *) AC_MSG_ERROR(bad value ${enableval} for --profiling) ;; | |
364 esac | |
365 ], | |
366 [ | |
367 enable_profiling=no | |
368 ]) | |
369 AC_MSG_RESULT([$enable_profiling]) | |
370 AM_CONDITIONAL(GPROF_PROFILING, [test "$enable_profiling" = "yes"]) | |
371 | |
372 gsf_flags="`pkg-config libgsf-1 --cflags`" | |
373 gsf_libs="`pkg-config libgsf-1 --libs`" | |
374 if test "$gsf_flags" = ""; then | |
375 AC_MSG_ERROR(libgsf not found) | |
376 fi | |
377 | |
378 AC_SUBST(GSF_FLAGS, [$gsf_flags]) | |
379 AC_SUBST(GSF_LIBS, [$gsf_libs]) | |
380 | |
381 PKG_CHECK_MODULES([ZLIB], [zlib]) | |
382 | |
383 AC_OUTPUT( \ | |
384 Makefile \ | |
385 html/Makefile \ | |
386 libpst.pc \ | |
387 libpst.spec \ | |
388 man/Makefile \ | |
389 src/Makefile \ | |
390 src/pst2dii.cpp \ | |
391 python/Makefile \ | |
392 xml/Makefile \ | |
393 xml/libpst \ | |
394 ) |