update soname/age for 0.6.15
[platform/upstream/libexif.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT([EXIF library], [0.6.15], [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://navi.cx/~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 LIBEXIF_AGE=2
54 LIBEXIF_REVISION=0
55 LIBEXIF_CURRENT=14
56 AC_SUBST([LIBEXIF_AGE])
57 AC_SUBST([LIBEXIF_REVISION])
58 AC_SUBST([LIBEXIF_CURRENT])
59 AC_SUBST([LIBEXIF_CURRENT_MIN],[`expr $LIBEXIF_CURRENT - $LIBEXIF_AGE`])
60 LIBEXIF_VERSION_INFO="$LIBEXIF_CURRENT:$LIBEXIF_REVISION:$LIBEXIF_AGE"
61 AC_SUBST([LIBEXIF_VERSION_INFO])
62
63 AC_PROG_CC
64 AC_C_CONST
65 dnl FIXME: AC_LIBTOOL_WIN32_DLL
66 AM_PROG_LIBTOOL
67 AM_CPPFLAGS="$CPPFLAGS"
68 GP_CONFIG_MSG([Compiler],[${CC}])
69
70
71 dnl Create a stdint.h-like file containing size-specific integer definitions
72 dnl that will always be available
73 AX_NEED_STDINT_H([libexif/_stdint.h])
74
75
76 dnl ------------------------------------------------------------------------
77 dnl Whether we're supposed to ship binaries in the tarball
78 dnl ------------------------------------------------------------------------
79
80 ship_binaries=false
81 AC_ARG_ENABLE([ship-binaries],
82 [AS_HELP_STRING([--enable-ship-binaries],
83 [Whether to ship binaries in the tarball [default=no]])],[
84         if test x$enableval = xyes; then
85                 ship_binaries=true
86         fi
87 ])
88 AM_CONDITIONAL([SHIP_BINARIES],[$ship_binaries])
89 GP_CONFIG_MSG([Ship binaries in tarball],[$ship_binaries])
90
91
92 dnl ---------------------------------------------------------------------------
93 dnl Whether -lm is required for our math functions
94 dnl ---------------------------------------------------------------------------
95
96 # we need sqrt and pow, but checking for sqrt should be sufficient
97 AC_ARG_VAR([MATHLIBS],[The libraries required for mathematical functions, e.g. -lm])
98 if test "x$MATHLIBS" = "x"; then
99         # We must not compile with -Wall -Werror here:
100         # char *sqrt() conflicts with double sin(const double xx) in any case.
101         CFLAGS_save="$CFLAGS"
102         CPPFLAGS_save="$CPPFLAGS"
103         CPPFLAGS=""
104         CFLAGS=""
105         AC_CHECK_FUNC([sqrt],[
106                 MATHLIBS=""
107         ],[
108                 AC_CHECK_LIB([m],[sqrt],[
109                         MATHLIBS="-lm"
110                 ],[
111                         AC_MSG_ERROR([
112 *** Could not find sqrt() function
113 ])
114                 ])
115         ])
116         CFLAGS="$CFLAGS_save"
117         CPPFLAGS="$CPPFLAGS_save"
118 fi
119 AC_SUBST([MATHLIBS])
120
121
122 # doc support
123 GP_CHECK_DOC_DIR
124 GP_CHECK_DOXYGEN
125
126 # Whether to enable the internal docs build.
127 #
128 # This takes quite some time due to the generation of lots of call
129 # graphs, so it is disabled by default.
130 set_enable_internal_docs=no
131 AC_ARG_ENABLE([internal-docs], [dnl
132 AS_HELP_STRING([--enable-internal-docs], 
133 [Build internal code docs if doxygen available])], [dnl
134 dnl If either --enable-foo nor --disable-foo were given, execute this.
135   if   test "x$enableval" = xno \
136     || test "x$enableval" = xoff \
137     || test "x$enableval" = xfalse; 
138   then
139     set_enable_internal_docs=no
140   elif test "x$enableval" = xyes \
141     || test "x$enableval" = xon \
142     || test "x$enableval" = xtrue
143   then
144     set_enable_internal_docs=yes
145   fi
146 ])
147 AC_MSG_CHECKING([whether to create internal code docs])
148 AC_MSG_RESULT([${set_enable_internal_docs}])
149 AM_CONDITIONAL([ENABLE_INTERNAL_DOCS], [test "x${set_enable_internal_docs}" = "xyes"])
150
151
152 # ---------------------------------------------------------------------------
153 # i18n support
154 # ---------------------------------------------------------------------------
155 ALL_LINGUAS="cs de es fr pl ru sk vi"
156 GP_GETTEXT_HACK([${PACKAGE}-${LIBEXIF_CURRENT_MIN}],
157                 [Lutz Mueller and others])
158 AM_GNU_GETTEXT_VERSION([0.14.1])
159 AM_GNU_GETTEXT([external])
160 AM_PO_SUBDIRS()
161 AM_ICONV()
162 GP_GETTEXT_FLAGS()
163
164 dnl We cannot use AC_DEFINE_UNQUOTED() for these definitions, as
165 dnl we require make to do insert the proper $(datadir) value
166 localedir="\$(datadir)/locale"
167 AC_SUBST(localedir)
168 AM_CPPFLAGS="$AM_CPPFLAGS -DLOCALEDIR=\\\"${localedir}\\\""
169
170
171 dnl ---------------------------------------------------------------------------
172 dnl Compiler/Linker Options and Warnings
173 dnl ---------------------------------------------------------------------------
174 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
175 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)"
176 AM_LDFLAGS="$LDFLAGS"
177 if test "x$GCC" = "xyes"; then
178     AM_CFLAGS="$AM_CFLAGS -ansi -pedantic-error"
179     AM_CXXFLAGS="$AM_CXXFLAGS -ansi -pedantic-error"
180     AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
181     AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
182 fi
183
184
185
186 AC_SUBST(AM_CPPFLAGS)
187 AC_SUBST(AM_LDFLAGS)
188
189
190 dnl ---------------------------------------------------------------------------
191 dnl Output files
192 dnl ---------------------------------------------------------------------------
193 AC_CONFIG_FILES([ 
194   po/Makefile.in
195   Makefile
196   libexif.spec
197   libexif/Makefile
198   libexif/canon/Makefile
199   libexif/olympus/Makefile
200   libexif/pentax/Makefile
201   test/Makefile
202   test/nls/Makefile
203   m4m/Makefile
204   doc/Makefile
205   doc/Doxyfile
206   doc/Doxyfile-internals
207   libexif.pc
208   libexif-uninstalled.pc
209   binary/Makefile
210 ])
211 AC_OUTPUT
212
213 GP_CONFIG_OUTPUT