fix a mistake in the interpretation of CURRENT:AGE:REVISION meaning that could
[platform/upstream/libexif.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT([EXIF library],[0.6.14],[libexif-devel@lists.sourceforge.net],[libexif])
3 AC_CONFIG_SRCDIR([libexif/exif-data.h])
4 AC_CONFIG_HEADERS([config.h])
5 AM_INIT_AUTOMAKE([gnu 1.8 dist-bzip2 dist-zip])
6
7 if test ! -d "$srcdir/m4m"; then
8 AC_MSG_ERROR([
9 You are missing the m4m/ directory in your top
10 $PACKAGE_TARNAME source directory.
11
12 You are probably using an ill-maintained CVS tree.
13 Running
14
15     cd $srcdir
16     cvs co m4m
17
18 and re-running autogen.sh might help.
19 ])
20 fi
21
22 GP_CHECK_SHELL_ENVIRONMENT
23 GP_CONFIG_MSG([Build])
24 GP_CONFIG_MSG([Source code location],[${srcdir}])
25
26 dnl ---------------------------------------------------------------------------
27 dnl Advanced information about versioning:
28 dnl   * "Writing shared libraries" by Mike Hearn
29 dnl         http://navi.cx/~mike/writing-shared-libraries.html
30 dnl   * libtool.info chapter "Versioning"
31 dnl ---------------------------------------------------------------------------
32 dnl Versioning:
33 dnl  - CURRENT (Major):  Increment if the interface has changes. AGE is always
34 dnl                      *changed* at the same time.
35 dnl  - AGE (Micro):      Increment if any interfaces have been added; set to 0
36 dnl                      if any interfaces have been removed. Removal has 
37 dnl                      precedence over adding, so set to 0 if both happened.
38 dnl                      It denotes upward compatibility.
39 dnl  - REVISION (Minor): Increment any time the source changes; set to 
40 dnl                      0 if you incremented CURRENT.
41 dnl
42 dnl  To summarize. Any interface *change* increment CURRENT. If that interface
43 dnl  change does not break upward compatibility (ie it is an addition), 
44 dnl  increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed, 
45 dnl  REVISION is set to 0, otherwise REVISION is incremented.
46 dnl ---------------------------------------------------------------------------
47 LIBEXIF_AGE=0
48 LIBEXIF_REVISION=1
49 LIBEXIF_CURRENT=12
50 AC_SUBST([LIBEXIF_AGE])
51 AC_SUBST([LIBEXIF_REVISION])
52 AC_SUBST([LIBEXIF_CURRENT])
53 LIBEXIF_VERSION_INFO=$LIBEXIF_CURRENT:$LIBEXIF_REVISION:$LIBEXIF_AGE
54 AC_SUBST([LIBEXIF_VERSION_INFO])
55
56 AC_PROG_CC
57 AC_C_CONST
58 dnl FIXME: AC_LIBTOOL_WIN32_DLL
59 AM_PROG_LIBTOOL
60 AM_CPPFLAGS="$CPPFLAGS"
61 GP_CONFIG_MSG([Compiler],[${CC}])
62
63
64 dnl Create a stdint.h-like file containing size-specific integer definitions
65 dnl that will always be available
66 AX_NEED_STDINT_H([libexif/_stdint.h])
67
68
69 dnl ------------------------------------------------------------------------
70 dnl Whether we're supposed to ship binaries in the tarball
71 dnl ------------------------------------------------------------------------
72
73 ship_binaries=false
74 AC_ARG_ENABLE([ship-binaries],
75 [AS_HELP_STRING([--enable-ship-binaries],
76 [Whether to ship binaries in the tarball [default=no]])],[
77         if test x$enableval = xyes; then
78                 ship_binaries=true
79         fi
80 ])
81 AM_CONDITIONAL([SHIP_BINARIES],[$ship_binaries])
82 GP_CONFIG_MSG([Ship binaries in tarball],[$ship_binaries])
83
84
85 dnl ---------------------------------------------------------------------------
86 dnl Whether -lm is required for our math functions
87 dnl ---------------------------------------------------------------------------
88
89 # we need sqrt and pow, but checking for sqrt should be sufficient
90 AC_ARG_VAR([MATHLIBS],[The libraries required for mathematical functions, e.g. -lm])
91 if test "x$MATHLIBS" = "x"; then
92         # We must not compile with -Wall -Werror here:
93         # char *sqrt() conflicts with double sin(const double xx) in any case.
94         CFLAGS_save="$CFLAGS"
95         CPPFLAGS_save="$CPPFLAGS"
96         CPPFLAGS=""
97         CFLAGS=""
98         AC_CHECK_FUNC([sqrt],[
99                 MATHLIBS=""
100         ],[
101                 AC_CHECK_LIB([m],[sqrt],[
102                         MATHLIBS="-lm"
103                 ],[
104                         AC_MSG_ERROR([
105 *** Could not find sqrt() function
106 ])
107                 ])
108         ])
109         CFLAGS="$CFLAGS_save"
110         CPPFLAGS="$CPPFLAGS_save"
111 fi
112 AC_SUBST([MATHLIBS])
113
114
115 # doc support
116 GP_CHECK_DOC_DIR
117 GP_CHECK_DOXYGEN
118
119
120 # ---------------------------------------------------------------------------
121 # i18n support
122 # ---------------------------------------------------------------------------
123 GP_GETTEXT_HACK([${PACKAGE}-${LIBEXIF_CURRENT}],
124                 [Lutz Müller and others])
125 ALL_LINGUAS="de es fr pl"
126 AM_GNU_GETTEXT_VERSION([0.14.1])
127 AM_GNU_GETTEXT([external])
128 AM_PO_SUBDIRS()
129 AM_ICONV()
130 GP_GETTEXT_FLAGS()
131
132 dnl We cannot use AC_DEFINE_UNQUOTED() for these definitions, as
133 dnl we require make to do insert the proper $(datadir) value
134 localedir="\$(datadir)/locale"
135 AC_SUBST(localedir)
136 AM_CPPFLAGS="$AM_CPPFLAGS -DLOCALEDIR=\\\"${localedir}\\\""
137
138
139 dnl ---------------------------------------------------------------------------
140 dnl Compiler/Linker Options and Warnings
141 dnl ---------------------------------------------------------------------------
142 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
143 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/libexif"
144 AM_LDFLAGS="$LDFLAGS"
145 if test "x$GCC" = "xyes"; then
146     AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
147     AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
148 fi
149
150
151
152 AC_SUBST(AM_CPPFLAGS)
153 AC_SUBST(AM_LDFLAGS)
154
155
156 dnl ---------------------------------------------------------------------------
157 dnl Output files
158 dnl ---------------------------------------------------------------------------
159 AC_CONFIG_FILES([ 
160   po/Makefile.in
161   Makefile
162   libexif.spec
163   libexif/Makefile
164   libexif/canon/Makefile
165   libexif/olympus/Makefile
166   libexif/pentax/Makefile
167   test/Makefile
168   test/nls/Makefile
169   m4m/Makefile
170   doc/Makefile
171   doc/Doxyfile
172   doc/Doxyfile-internals
173   libexif/libexif.pc
174   binary/Makefile
175 ])
176 AC_OUTPUT
177
178 GP_CONFIG_OUTPUT