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:
26 AC_INIT([libpng], [1.4.4], [png-mng-implement@lists.sourceforge.net])
28 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, :)
46 # Checks for header files.
48 AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
50 # Checks for typedefs, structures, and compiler characteristics.
55 # Checks for library functions.
57 AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
58 AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
59 AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
63 LIBPNG_DEFINES="-DPNG_CONFIGURE_LIBPNG -D_ALL_SOURCE";;
65 LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG;;
67 LIBPNG_DEFINES=$LIBPNG_DEFINES
68 AC_SUBST(LIBPNG_DEFINES)
70 AC_MSG_CHECKING([if libraries can be versioned])
71 # Special case for PE/COFF platforms: ld reports
72 # support for version-script, but doesn't actually
73 # DO anything with it.
75 *cygwin* | *mingw32* )
76 have_ld_version_script=no
80 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
82 have_ld_version_script=yes
85 have_ld_version_script=no
87 AC_MSG_WARN(*** You have not enabled versioned symbols.)
92 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
94 if test "$have_ld_version_script" = "yes"; then
95 AC_MSG_CHECKING([for symbol prefix])
96 SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
97 | ${CPP-${CC-gcc} -E} - 2>&1 \
98 | ${EGREP-grep} "^PREFIX=" \
99 | ${SED-sed} "s:^PREFIX=::"`
100 AC_SUBST(SYMBOL_PREFIX)
101 AC_MSG_RESULT($SYMBOL_PREFIX)
104 # Substitutions for .in files
105 AC_SUBST(PNGLIB_VERSION)
106 AC_SUBST(PNGLIB_MAJOR)
107 AC_SUBST(PNGLIB_MINOR)
108 AC_SUBST(PNGLIB_RELEASE)
110 # Additional arguments (and substitutions)
111 # Allow the pkg-config directory to be set
112 AC_ARG_WITH(pkgconfigdir,
113 AC_HELP_STRING([--with-pkgconfigdir],
114 [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
115 [pkgconfigdir=${withval}],
116 [pkgconfigdir='${libdir}/pkgconfig'])
118 AC_SUBST([pkgconfigdir])
119 AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
121 # Make the *-config binary config scripts optional
122 AC_ARG_WITH(binconfigs,
123 AC_HELP_STRING([--with-binconfigs],
124 [Generate shell libpng-config scripts as well as pkg-config data]
125 [@<:@default=yes@:>@]),
126 [if test "${withval}" = no; then
128 AC_MSG_NOTICE([libpng-config scripts will not be built])
130 binconfigs='${binconfigs}'
132 [binconfigs='${binconfigs}'])
133 AC_SUBST([binconfigs])
135 # Config files, substituting as above
136 AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
137 AC_CONFIG_FILES([libpng-config:libpng-config.in],
138 [chmod +x libpng-config])