2005-08-23 Lutz Mueller <lutz@users.sourceforge.net>
[platform/upstream/libexif.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT([EXIF library],[0.6.13],[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])
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 -lm is required for our math functions
64 dnl ---------------------------------------------------------------------------
65
66 # we need sqrt and pow, but checking for sqrt should be sufficient
67 AC_ARG_VAR([MATHLIBS],[The libraries required for mathematical functions, e.g. -lm])
68 if test "x$MATHLIBS" = "x"; then
69         # We must not compile with -Wall -Werror here:
70         # char *sqrt() conflicts with double sin(const double xx) in any case.
71         CFLAGS_save="$CPPFLAGS"
72         CPPFLAGS_save="$CPPFLAGS"
73         CPPFLAGS=""
74         CFLAGS=""
75         AC_CHECK_FUNC([sqrt],[
76                 MATHLIBS=""
77         ],[
78                 AC_CHECK_LIB([m],[sqrt],[
79                         MATHLIBS="-lm"
80                 ],[
81                         AC_MSG_ERROR([
82 *** Could not find sqrt() function
83 ])
84                 ])
85         ])
86         CFLAGS="$CFLAGS_save"
87         CPPFLAGS="$CPPFLAGS_save"
88 fi
89 AC_SUBST([MATHLIBS])
90
91
92 # doc support
93 GP_CHECK_DOC_DIR
94 GP_CHECK_DOXYGEN
95
96
97 # ---------------------------------------------------------------------------
98 # i18n support
99 # ---------------------------------------------------------------------------
100 GP_GETTEXT_HACK([${PACKAGE}-${LIBEXIF_CURRENT}],
101                 [Lutz Müller and others])
102 ALL_LINGUAS="de es fr pl"
103 AM_GNU_GETTEXT_VERSION([0.14.1])
104 AM_GNU_GETTEXT([external])
105 AM_PO_SUBDIRS()
106 AM_ICONV()
107 GP_GETTEXT_FLAGS()
108
109 dnl We cannot use AC_DEFINE_UNQUOTED() for these definitions, as
110 dnl we require make to do insert the proper $(datadir) value
111 localedir="\$(datadir)/locale"
112 AC_SUBST(localedir)
113 AM_CPPFLAGS="$AM_CPPFLAGS -DLOCALEDIR=\\\"${localedir}\\\""
114
115
116 dnl ---------------------------------------------------------------------------
117 dnl Compiler/Linker Options and Warnings
118 dnl ---------------------------------------------------------------------------
119 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
120 AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/libexif"
121 AM_LDFLAGS="$LDFLAGS"
122 if test "x$GCC" = "xyes"; then
123     AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
124     AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
125 fi
126
127
128
129 AC_SUBST(AM_CPPFLAGS)
130 AC_SUBST(AM_LDFLAGS)
131
132
133 dnl ---------------------------------------------------------------------------
134 dnl Output files
135 dnl ---------------------------------------------------------------------------
136 AC_CONFIG_FILES([ 
137   po/Makefile.in
138   Makefile
139   libexif.spec
140   libexif/Makefile
141   libexif/canon/Makefile
142   libexif/olympus/Makefile
143   libexif/pentax/Makefile
144   test/Makefile
145   test/nls/Makefile
146   m4m/Makefile
147   doc/Makefile
148   doc/Doxyfile
149   doc/Doxyfile-internals
150   libexif/libexif.pc
151 ])
152 AC_OUTPUT
153
154 GP_CONFIG_OUTPUT