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.2], [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.
79
# Checks for library functions.
81
AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
82
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
83
AC_ARG_WITH(zlib-prefix,
84
AC_HELP_STRING([--with-zlib-prefix],
85
[prefix that may have been used in installed zlib]),
88
AC_CHECK_LIB(z, zlibVersion, ,
89
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, ,
90
AC_ERROR([zlib not installed])))
93
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
94
LIBPNG_DEFINES=$LIBPNG_DEFINES
95
AC_SUBST(LIBPNG_DEFINES)
97
AC_MSG_CHECKING([if libraries can be versioned])
98
# Special case for PE/COFF platforms: ld reports
99
# support for version-script, but doesn't actually
100
# DO anything with it.
102
*cygwin* | *mingw32* | *interix* )
103
have_ld_version_script=no
107
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
109
have_ld_version_script=yes
112
have_ld_version_script=no
114
AC_MSG_WARN(*** You have not enabled versioned symbols.)
119
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
121
if test "$have_ld_version_script" = "yes"; then
122
AC_MSG_CHECKING([for symbol prefix])
123
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
124
| ${CPP-${CC-gcc} -E} - 2>&1 \
125
| ${EGREP-grep} "^PREFIX=" \
126
| ${SED-sed} "s:^PREFIX=::"`
127
AC_SUBST(SYMBOL_PREFIX)
128
AC_MSG_RESULT($SYMBOL_PREFIX)
131
# Substitutions for .in files
132
AC_SUBST(PNGLIB_VERSION)
133
AC_SUBST(PNGLIB_MAJOR)
134
AC_SUBST(PNGLIB_MINOR)
135
AC_SUBST(PNGLIB_RELEASE)
137
# Additional arguments (and substitutions)
138
# Allow the pkg-config directory to be set
139
AC_ARG_WITH(pkgconfigdir,
140
AC_HELP_STRING([--with-pkgconfigdir],
141
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
142
[pkgconfigdir=${withval}],
143
[pkgconfigdir='${libdir}/pkgconfig'])
145
AC_SUBST([pkgconfigdir])
146
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
148
# Make the *-config binary config scripts optional
149
AC_ARG_WITH(binconfigs,
150
AC_HELP_STRING([--with-binconfigs],
151
[Generate shell libpng-config scripts as well as pkg-config data]
152
[@<:@default=yes@:>@]),
153
[if test "${withval}" = no; then
155
AC_MSG_NOTICE([libpng-config scripts will not be built])
157
binconfigs='${binconfigs}'
159
[binconfigs='${binconfigs}'])
160
AC_SUBST([binconfigs])
162
# Config files, substituting as above
163
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
164
AC_CONFIG_FILES([libpng-config:libpng-config.in],
165
[chmod +x libpng-config])