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