3 dnl Process this file with autoconf to produce a configure script.
5 dnl Minor upgrades (compatible ABI): increment the package version
6 dnl (third field in two places below) and set the PNGLIB_RELEASE
9 dnl Major upgrades (incompatible ABI): increment the package major
10 dnl version (second field, or first if desired), set the minor
11 dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in
12 dnl Makefile.am to upgrade the package name.
14 dnl This is here to prevent earlier autoconf from being used, it
15 dnl should not be necessary to regenerate configure if the time
16 dnl stamps are correct
19 dnl Version number stuff here:
21 AC_INIT([libpng], [1.2.34], [png-mng-implement@lists.sourceforge.net])
23 dnl stop configure from automagically running automake
31 dnl End of version number stuff
33 AC_CONFIG_SRCDIR([pngget.c])
34 AM_CONFIG_HEADER(config.h)
36 # Checks for programs.
40 AC_CHECK_TOOL(SED, sed, :)
47 # Checks for header files.
49 AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
51 # Checks for typedefs, structures, and compiler characteristics.
56 # Checks for library functions.
58 AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
59 AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
60 AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
62 LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
64 [if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
66 [#include "$srcdir/pnggccrd.c"],
71 LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE)
72 LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX
73 AC_SUBST(LIBPNG_DEFINES)
74 AC_SUBST(LIBPNG_NO_MMX)
76 AC_MSG_CHECKING([if libraries can be versioned])
77 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
79 have_ld_version_script=yes
82 have_ld_version_script=no
84 AC_MSG_WARN(*** You have not enabled versioned symbols.)
86 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
88 if test "$have_ld_version_script" = "yes"; then
89 AC_MSG_CHECKING([for symbol prefix])
90 SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
91 | ${CPP-${CC-gcc} -E} - 2>&1 \
92 | ${EGREP-grep} "^PREFIX=" \
93 | ${SED-sed} "s:^PREFIX=::"`
94 AC_SUBST(SYMBOL_PREFIX)
95 AC_MSG_RESULT($SYMBOL_PREFIX)
98 # Substitutions for .in files
99 AC_SUBST(PNGLIB_VERSION)
100 AC_SUBST(PNGLIB_MAJOR)
101 AC_SUBST(PNGLIB_MINOR)
102 AC_SUBST(PNGLIB_RELEASE)
104 # Additional arguments (and substitutions)
105 # Allow the pkg-config directory to be set
106 AC_ARG_WITH(pkgconfigdir,
107 AC_HELP_STRING([--with-pkgconfigdir],
108 [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
109 [pkgconfigdir=${withval}],
110 [pkgconfigdir='${libdir}/pkgconfig'])
112 AC_SUBST([pkgconfigdir])
113 AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
115 # Make the *-config binary config scripts optional
116 AC_ARG_WITH(binconfigs,
117 AC_HELP_STRING([--with-binconfigs],
118 [Generate shell libpng-config scripts as well as pkg-config data]
119 [@<:@default=yes@:>@]),
120 [if test "${withval}" = no; then
122 AC_MSG_NOTICE([libpng-config scripts will not be built])
124 binconfigs='${binconfigs}'
126 [binconfigs='${binconfigs}'])
127 AC_SUBST([binconfigs])
129 # Allow the old version number library, libpng.so, to be removed from
131 AC_ARG_WITH(libpng-compat,
132 AC_HELP_STRING([--with-libpng-compat],
133 [Generate the obsolete libpng.so library @<:@default=yes@:>@]),
134 [if test "${withval}" = no; then
136 AC_MSG_NOTICE([libpng.so will not be built])
140 [compatlib=libpng.la])
141 AC_SUBST([compatlib])
143 # Config files, substituting as above
144 AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc-configure.in])
145 AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in],
146 [chmod +x libpng-config])