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