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