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.5.1], [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.
41 AC_CHECK_TOOL(SED, sed, :)
42 AC_CHECK_TOOL(AWK, awk, :)
48 # On Solaris 10 and 12 CPP gets set to cc -E, however this still
49 # does some input parsing. We need strict ANSI-C style tokenization,
52 AC_MSG_CHECKING([for a C preprocessor that does not parse its input])
53 AC_TRY_CPP([1.5.0 16BIT],
57 for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp"; do
58 AC_TRY_CPP([1.5.0 16BIT],
63 if test -n "$DFNCPP"; then
64 AC_MSG_RESULT([$DFNCPP])
67 AC_MSG_FAILURE([not found], 1)
70 # Checks for header files.
72 AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
74 # Checks for typedefs, structures, and compiler characteristics.
78 # Checks for library functions.
80 AC_ARG_WITH(zlib-prefix,
81 AC_HELP_STRING([--with-zlib-prefix],
82 [prefix that may have been used in installed zlib]),
85 AC_CHECK_LIB(z, zlibVersion, ,
86 AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, ,
87 AC_ERROR([zlib not installed])))
90 LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
91 LIBPNG_DEFINES=$LIBPNG_DEFINES
92 AC_SUBST(LIBPNG_DEFINES)
94 AC_MSG_CHECKING([if libraries can be versioned])
95 # Special case for PE/COFF platforms: ld reports
96 # support for version-script, but doesn't actually
97 # DO anything with it.
99 *cygwin* | *mingw32* | *interix* )
100 have_ld_version_script=no
104 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
106 have_ld_version_script=yes
109 have_ld_version_script=no
111 AC_MSG_WARN(*** You have not enabled versioned symbols.)
116 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
118 if test "$have_ld_version_script" = "yes"; then
119 AC_MSG_CHECKING([for symbol prefix])
120 SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
121 | ${CPP-${CC-gcc} -E} - 2>&1 \
122 | ${EGREP-grep} "^PREFIX=" \
123 | ${SED-sed} "s:^PREFIX=::"`
124 AC_SUBST(SYMBOL_PREFIX)
125 AC_MSG_RESULT($SYMBOL_PREFIX)
128 # Substitutions for .in files
129 AC_SUBST(PNGLIB_VERSION)
130 AC_SUBST(PNGLIB_MAJOR)
131 AC_SUBST(PNGLIB_MINOR)
132 AC_SUBST(PNGLIB_RELEASE)
134 # Additional arguments (and substitutions)
135 # Allow the pkg-config directory to be set
136 AC_ARG_WITH(pkgconfigdir,
137 AC_HELP_STRING([--with-pkgconfigdir],
138 [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
139 [pkgconfigdir=${withval}],
140 [pkgconfigdir='${libdir}/pkgconfig'])
142 AC_SUBST([pkgconfigdir])
143 AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
145 # Make the *-config binary config scripts optional
146 AC_ARG_WITH(binconfigs,
147 AC_HELP_STRING([--with-binconfigs],
148 [Generate shell libpng-config scripts as well as pkg-config data]
149 [@<:@default=yes@:>@]),
150 [if test "${withval}" = no; then
152 AC_MSG_NOTICE([libpng-config scripts will not be built])
154 binconfigs='${binconfigs}'
156 [binconfigs='${binconfigs}'])
157 AC_SUBST([binconfigs])
159 # Config files, substituting as above
160 AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
161 AC_CONFIG_FILES([libpng-config:libpng-config.in],
162 [chmod +x libpng-config])