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