the USERCOMMENT field should be returned \0 terminated (AFL)
[platform/upstream/libexif.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT([EXIF library], [0.6.21.1], [libexif-devel@lists.sourceforge.net], [libexif])
3 AC_CONFIG_SRCDIR([libexif/exif-data.h])
4 AC_CONFIG_HEADERS([config.h])
5 AC_CONFIG_MACRO_DIR([auto-m4])
6 AM_INIT_AUTOMAKE([-Wall gnu 1.9 dist-bzip2 dist-zip check-news subdir-objects])
7 AM_MAINTAINER_MODE
8
9 # Use the silent-rules feature when possible.
10 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
11 AM_SILENT_RULES([yes])
12
13 GP_CHECK_SHELL_ENVIRONMENT
14 GP_CONFIG_MSG([Build])
15 GP_CONFIG_MSG([Source code location],[${srcdir}])
16
17 dnl ---------------------------------------------------------------------------
18 dnl Advanced information about versioning:
19 dnl   * "Writing shared libraries" by Mike Hearn
20 dnl         http://plan99.net/~mike/writing-shared-libraries.html
21 dnl   * libtool.info chapter "Versioning"
22 dnl   * libtool.info chapter "Updating library version information"
23 dnl ---------------------------------------------------------------------------
24 dnl Versioning:
25 dnl  - CURRENT (Major):  Increment if the interface has changes. AGE is always
26 dnl                      *changed* at the same time.
27 dnl  - AGE (Micro):      Increment if any interfaces have been added; set to 0
28 dnl                      if any interfaces have been removed. Removal has 
29 dnl                      precedence over adding, so set to 0 if both happened.
30 dnl                      It denotes upward compatibility.
31 dnl  - REVISION (Minor): Increment any time the source changes; set to 
32 dnl                      0 if you incremented CURRENT.
33 dnl
34 dnl  To summarize. Any interface *change* increment CURRENT. If that interface
35 dnl  change does not break upward compatibility (ie it is an addition), 
36 dnl  increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed, 
37 dnl  REVISION is set to 0, otherwise REVISION is incremented.
38 dnl ---------------------------------------------------------------------------
39 dnl C:A:R
40 dnl 12:0:1   0.6.13
41 dnl 13:1:0   added EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE (for 0.6.14)
42 dnl 14:2:0   added XP_ WinXP tags (for 0.6.15)
43 dnl 14:2:1   0.6.17
44 dnl 15:3:0   added exif_loader_get_buf (for 0.6.18)
45 dnl 15:3:1   0.6.19
46 dnl 15:3:2   0.6.20
47 dnl 15:3:3   0.6.21
48 LIBEXIF_CURRENT=15
49 LIBEXIF_AGE=3
50 LIBEXIF_REVISION=3
51 AC_SUBST([LIBEXIF_AGE])
52 AC_SUBST([LIBEXIF_REVISION])
53 AC_SUBST([LIBEXIF_CURRENT])
54 AC_SUBST([LIBEXIF_CURRENT_MIN],[`expr $LIBEXIF_CURRENT - $LIBEXIF_AGE`])
55 LIBEXIF_VERSION_INFO="$LIBEXIF_CURRENT:$LIBEXIF_REVISION:$LIBEXIF_AGE"
56 AC_SUBST([LIBEXIF_VERSION_INFO])
57
58 AM_PROG_CC_C_O
59 AC_C_CONST
60 AC_C_INLINE
61 dnl FIXME: AC_LIBTOOL_WIN32_DLL
62 AM_PROG_AR
63 AM_PROG_LIBTOOL
64 AM_CPPFLAGS="$CPPFLAGS"
65 GP_CONFIG_MSG([Compiler],[${CC}])
66
67 AC_SYS_LARGEFILE
68
69 dnl Create a stdint.h-like file containing size-specific integer definitions
70 dnl that will always be available
71 AX_NEED_STDINT_H([libexif/_stdint.h])
72
73
74 dnl ------------------------------------------------------------------------
75 dnl Whether we're supposed to ship binaries in the tarball
76 dnl ------------------------------------------------------------------------
77
78 ship_binaries=false
79 AC_ARG_ENABLE([ship-binaries],
80 [AS_HELP_STRING([--enable-ship-binaries],
81 [Whether to ship binaries in the tarball [default=no]])],[
82         if test x$enableval = xyes; then
83                 ship_binaries=true
84         fi
85 ])
86 AM_CONDITIONAL([SHIP_BINARIES],[$ship_binaries])
87 GP_CONFIG_MSG([Ship binaries in tarball],[$ship_binaries])
88
89
90 dnl ---------------------------------------------------------------------------
91 dnl Whether -lm is required for our math functions
92 dnl ---------------------------------------------------------------------------
93
94 # we need sqrt and pow which may be in libm
95 # We cannot use AC_CHECK_FUNC because if CFLAGS contains
96 # -Wall -Werror here the check fails because
97 # char *sqrt() conflicts with double sqrt(double xx)
98
99 # Start by assuming -lm is needed, because it's possible that the little
100 # test program below will be optimized to in-line floating point code that
101 # doesn't require -lm, whereas the library itself cannot be so optimized
102 # (this actually seems to be the case on x86 with gcc 4.2). Assuming the
103 # reverse means that -lm could be needed but wouldn't be detected below.
104
105 LIBS_orig="$LIBS"
106 LIBS="$LIBS -lm"
107 AC_MSG_CHECKING([for math functions in libm])
108 AC_LINK_IFELSE([AC_LANG_PROGRAM([
109           #include <math.h>
110           ],[
111             double s = sqrt(0);
112             double p = pow(s,s);
113           ])],
114         [AC_MSG_RESULT(yes)], [
115         AC_MSG_RESULT(no)
116         LIBS="$LIBS_orig"
117         AC_MSG_CHECKING([for math functions without libm])
118         AC_LINK_IFELSE([AC_LANG_PROGRAM([
119                 #include <math.h>
120                 ],[
121                   double s = sqrt(0);
122                   double p = pow(s,s);
123                 ])],
124         [
125                 AC_MSG_RESULT(yes)
126         ],[
127                 AC_MSG_RESULT(no)
128                 AC_MSG_ERROR([*** Could not find sqrt() & pow() functions])
129         ])
130 ])
131
132 # Check whether libfailmalloc is available for tests
133 CHECK_FAILMALLOC
134
135 # doc support
136 GP_CHECK_DOC_DIR
137 GP_CHECK_DOXYGEN
138
139 # Whether to enable the internal docs build.
140 #
141 # This takes quite some time due to the generation of lots of call
142 # graphs, so it is disabled by default.
143 set_enable_internal_docs=no
144 AC_ARG_ENABLE([internal-docs], [dnl
145 AS_HELP_STRING([--enable-internal-docs], 
146 [Build internal code docs if doxygen available])], [dnl
147 dnl If either --enable-foo nor --disable-foo were given, execute this.
148   if   test "x$enableval" = xno \
149     || test "x$enableval" = xoff \
150     || test "x$enableval" = xfalse; 
151   then
152     set_enable_internal_docs=no
153   elif test "x$enableval" = xyes \
154     || test "x$enableval" = xon \
155     || test "x$enableval" = xtrue
156   then
157     set_enable_internal_docs=yes
158   fi
159 ])
160 AC_MSG_CHECKING([whether to create internal code docs])
161 AC_MSG_RESULT([${set_enable_internal_docs}])
162 AM_CONDITIONAL([ENABLE_INTERNAL_DOCS], [test "x${set_enable_internal_docs}" = "xyes"])
163
164
165 # ---------------------------------------------------------------------------
166 # i18n support
167 # ---------------------------------------------------------------------------
168 ALL_LINGUAS="be bs cs da de en_AU en_CA en_GB es fr it ja ms nl pl pt pt_BR ru sk sq sr sv tr uk vi zh_CN"
169 AM_PO_SUBDIRS
170 GP_GETTEXT_HACK([${PACKAGE}-${LIBEXIF_CURRENT_MIN}],
171                 [Lutz Mueller and others])
172 AM_GNU_GETTEXT_VERSION([0.14.1])
173 AM_GNU_GETTEXT([external])
174 AM_ICONV()
175 GP_GETTEXT_FLAGS()
176
177
178 dnl ---------------------------------------------------------------------------
179 dnl Thread-safe functions
180 dnl ---------------------------------------------------------------------------
181 AC_CHECK_FUNCS(localtime_r)
182
183 dnl ---------------------------------------------------------------------------
184 dnl Compiler/Linker Options and Warnings
185 dnl ---------------------------------------------------------------------------
186 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
187 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)"
188 AM_LDFLAGS="$LDFLAGS"
189 if test "x$GCC" = "xyes"; then
190     AM_CFLAGS="$AM_CFLAGS -ansi -pedantic-error"
191     AM_CXXFLAGS="$AM_CXXFLAGS -ansi -pedantic-error"
192     AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
193     AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
194 fi
195
196
197
198 AC_SUBST(AM_CPPFLAGS)
199 AC_SUBST(AM_LDFLAGS)
200
201
202 dnl ---------------------------------------------------------------------------
203 dnl Output files
204 dnl ---------------------------------------------------------------------------
205 AC_CONFIG_FILES([  po/Makefile.in
206   Makefile
207   libexif.spec
208   libexif/Makefile
209   test/Makefile
210   test/check-vars.sh
211   test/nls/Makefile
212   m4m/Makefile
213   doc/Makefile
214   doc/Doxyfile
215   doc/Doxyfile-internals
216   libexif.pc
217   libexif-uninstalled.pc
218   binary/Makefile
219   contrib/Makefile
220   contrib/examples/Makefile
221 ])
222 AC_OUTPUT
223
224 GP_CONFIG_OUTPUT