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