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