require automake >= 1.9, check NEWS, update NEWS, update so revision, add pedantic...
[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 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 LIBEXIF_AGE=0
50 LIBEXIF_REVISION=2
51 LIBEXIF_CURRENT=12
52 AC_SUBST([LIBEXIF_AGE])
53 AC_SUBST([LIBEXIF_REVISION])
54 AC_SUBST([LIBEXIF_CURRENT])
55 AC_SUBST([LIBEXIF_CURRENT_MIN],[`expr $LIBEXIF_CURRENT - $LIBEXIF_AGE`])
56 LIBEXIF_VERSION_INFO="$LIBEXIF_CURRENT:$LIBEXIF_REVISION:$LIBEXIF_AGE"
57 AC_SUBST([LIBEXIF_VERSION_INFO])
58
59 AC_PROG_CC
60 AC_C_CONST
61 dnl FIXME: AC_LIBTOOL_WIN32_DLL
62 AM_PROG_LIBTOOL
63 AM_CPPFLAGS="$CPPFLAGS"
64 GP_CONFIG_MSG([Compiler],[${CC}])
65
66
67 dnl Create a stdint.h-like file containing size-specific integer definitions
68 dnl that will always be available
69 AX_NEED_STDINT_H([libexif/_stdint.h])
70
71
72 dnl ------------------------------------------------------------------------
73 dnl Whether we're supposed to ship binaries in the tarball
74 dnl ------------------------------------------------------------------------
75
76 ship_binaries=false
77 AC_ARG_ENABLE([ship-binaries],
78 [AS_HELP_STRING([--enable-ship-binaries],
79 [Whether to ship binaries in the tarball [default=no]])],[
80         if test x$enableval = xyes; then
81                 ship_binaries=true
82         fi
83 ])
84 AM_CONDITIONAL([SHIP_BINARIES],[$ship_binaries])
85 GP_CONFIG_MSG([Ship binaries in tarball],[$ship_binaries])
86
87
88 dnl ---------------------------------------------------------------------------
89 dnl Whether -lm is required for our math functions
90 dnl ---------------------------------------------------------------------------
91
92 # we need sqrt and pow, but checking for sqrt should be sufficient
93 AC_ARG_VAR([MATHLIBS],[The libraries required for mathematical functions, e.g. -lm])
94 if test "x$MATHLIBS" = "x"; then
95         # We must not compile with -Wall -Werror here:
96         # char *sqrt() conflicts with double sin(const double xx) in any case.
97         CFLAGS_save="$CFLAGS"
98         CPPFLAGS_save="$CPPFLAGS"
99         CPPFLAGS=""
100         CFLAGS=""
101         AC_CHECK_FUNC([sqrt],[
102                 MATHLIBS=""
103         ],[
104                 AC_CHECK_LIB([m],[sqrt],[
105                         MATHLIBS="-lm"
106                 ],[
107                         AC_MSG_ERROR([
108 *** Could not find sqrt() function
109 ])
110                 ])
111         ])
112         CFLAGS="$CFLAGS_save"
113         CPPFLAGS="$CPPFLAGS_save"
114 fi
115 AC_SUBST([MATHLIBS])
116
117
118 # doc support
119 GP_CHECK_DOC_DIR
120 GP_CHECK_DOXYGEN
121
122
123 # ---------------------------------------------------------------------------
124 # i18n support
125 # ---------------------------------------------------------------------------
126 GP_GETTEXT_HACK([${PACKAGE}-${LIBEXIF_CURRENT_MIN}],
127                 [Lutz Mueller and others])
128 ALL_LINGUAS="de es fr pl ru vi"
129 AM_GNU_GETTEXT_VERSION([0.14.1])
130 AM_GNU_GETTEXT([external])
131 AM_PO_SUBDIRS()
132 AM_ICONV()
133 GP_GETTEXT_FLAGS()
134
135 dnl We cannot use AC_DEFINE_UNQUOTED() for these definitions, as
136 dnl we require make to do insert the proper $(datadir) value
137 localedir="\$(datadir)/locale"
138 AC_SUBST(localedir)
139 AM_CPPFLAGS="$AM_CPPFLAGS -DLOCALEDIR=\\\"${localedir}\\\""
140
141
142 dnl ---------------------------------------------------------------------------
143 dnl Compiler/Linker Options and Warnings
144 dnl ---------------------------------------------------------------------------
145 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
146 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/libexif"
147 AM_LDFLAGS="$LDFLAGS"
148 if test "x$GCC" = "xyes"; then
149     AM_CFLAGS="$AM_CFLAGS -ansi -pedantic-error"
150     AM_CXXFLAGS="$AM_CXXFLAGS -ansi -pedantic-error"
151     AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
152     AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
153 fi
154
155
156
157 AC_SUBST(AM_CPPFLAGS)
158 AC_SUBST(AM_LDFLAGS)
159
160
161 dnl ---------------------------------------------------------------------------
162 dnl Output files
163 dnl ---------------------------------------------------------------------------
164 AC_CONFIG_FILES([ 
165   po/Makefile.in
166   Makefile
167   libexif.spec
168   libexif/Makefile
169   libexif/canon/Makefile
170   libexif/olympus/Makefile
171   libexif/pentax/Makefile
172   test/Makefile
173   test/nls/Makefile
174   m4m/Makefile
175   doc/Makefile
176   doc/Doxyfile
177   doc/Doxyfile-internals
178   libexif/libexif.pc
179   binary/Makefile
180 ])
181 AC_OUTPUT
182
183 GP_CONFIG_OUTPUT