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