blob: cbe9e930f23b47cb532cf9b12c7e0681c860ce63 [file] [log] [blame]
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -06001# configure.ac
2
3dnl Process this file with autoconf to produce a configure script.
4dnl
5dnl Minor upgrades (compatible ABI): increment the package version
6dnl (third field in two places below) and set the PNGLIB_MINOR
7dnl variable.
8dnl
9dnl Major upgrades (incompatible ABI): increment the package major
10dnl version (second field, or first if desired), set the minor
11dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in
12dnl Makefile.am to upgrade the package name.
13
14dnl This is here to prevent earlier autoconf from being used, it
15dnl should not be necessary to regenerate configure if the time
16dnl stamps are correct
17AC_PREREQ(2.59)
18
19dnl Version number stuff here:
20
Glenn Randers-Pehrsonb511b602006-04-16 19:45:31 -050021AC_INIT([libpng], [1.2.10beta5], [png-mng-implement@lists.sourceforge.net])
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060022AM_INIT_AUTOMAKE
23dnl stop configure from automagically running automake
24AM_MAINTAINER_MODE
25
Glenn Randers-Pehrsonb511b602006-04-16 19:45:31 -050026PNGLIB_VERSION=1.2.10beta5
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060027PNGLIB_MAJOR=12
Glenn Randers-Pehrsond5d63602006-04-15 06:37:45 -050028PNGLIB_MINOR=10
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060029
30dnl End of version number stuff
31
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060032AC_CONFIG_SRCDIR([pngget.c])
Glenn Randers-Pehrson3a5a7592006-04-15 14:14:42 -050033AM_CONFIG_HEADER([config.h])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060034
35# Checks for programs.
36AC_PROG_CC
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060037AC_PROG_LD
38AC_PROG_CPP
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060039AC_CHECK_TOOL(SED, sed, :)
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060040AC_PROG_INSTALL
41AC_PROG_LN_S
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060042AC_PROG_MAKE_SET
43AC_PROG_LIBTOOL
44
45# Checks for header files.
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060046AC_HEADER_STDC
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060047AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060048
49# Checks for typedefs, structures, and compiler characteristics.
50AC_C_CONST
51AC_TYPE_SIZE_T
52AC_STRUCT_TM
53
54# Checks for library functions.
55AC_FUNC_MALLOC
56AC_FUNC_STRTOD
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060057AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
Glenn Randers-Pehrson5c60b232006-03-07 07:09:22 -060058AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
59AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060060
Glenn Randers-Pehrsonb511b602006-04-16 19:45:31 -050061AC_MSG_CHECKING([if assembler code in pnggccrd.c can be compiled])
62AC_TRY_COMPILE(
63 [#include "pnggccrd.c"],
64 [int main() { return 0; }],
65 LIBPNG_DEFINES=,LIBPNG_DEFINES=-DPNG_NO_ASSEMBLER_CODE)
66AC_SUBST(LIBPNG_DEFINES)
67if test "$LIBPNG_DEFINES"; then
68 AC_MSG_RESULT(no)
69else
70 AC_MSG_RESULT(yes)
71fi
72
73
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060074AC_MSG_CHECKING([if libraries can be versioned])
75GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
76if test "$GLD"; then
77 have_ld_version_script=yes
78 AC_MSG_RESULT(yes)
79else
80 have_ld_version_script=no
81 AC_MSG_RESULT(no)
82 AC_MSG_WARN(*** You may want to rerun configure using --with-gnu-ld to enable versioned symbols.)
83fi
84AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060085
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060086# Substitutions for .in files
87AC_SUBST(PNGLIB_VERSION)
88AC_SUBST(PNGLIB_MAJOR)
89AC_SUBST(PNGLIB_MINOR)
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060090
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060091# Additional arguments (and substitutions)
92# Allow the pkg-config directory to be set
93AC_ARG_WITH(pkgconfigdir,
94 AC_HELP_STRING([--with-pkgconfigdir],
Glenn Randers-Pehrsonb511b602006-04-16 19:45:31 -050095 [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060096 [pkgconfigdir=${withval}],
97 [pkgconfigdir='${libdir}/pkgconfig'])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060098
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060099AC_SUBST([pkgconfigdir])
100AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600101
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600102# Make the *-config binary config scripts optional
103AC_ARG_WITH(binconfigs,
104 AC_HELP_STRING([--with-binconfigs],
105 [Generate shell libpng-config scripts as well as pkg-config data]
106 [@<:@default=yes@:>@]),
107 [if test "${withval}" = no; then
108 binconfigs=
109 AC_MSG_NOTICE([libpng-config scripts will not be built])
110 else
111 binconfigs='${binconfigs}'
112 fi],
113 [binconfigs='${binconfigs}'])
114AC_SUBST([binconfigs])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600115
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600116# Allow the old version number library, libpng.so, to be removed from
117# the build
118AC_ARG_WITH(libpng-compat,
119 AC_HELP_STRING([--with-libpng-compat],
120 [Generate the obsolete libpng.so library @<:@default=yes@:>@]),
121 [if test "${withval}" = no; then
122 compatlib=
123 AC_MSG_NOTICE([libpng.so will not be built])
124 else
125 compatlib=libpng.la
126 fi],
127 [compatlib=libpng.la])
128AC_SUBST([compatlib])
129
130# Config files, substituting as above
131AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc.in])
132AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in],
133 [chmod +x libpng-config])
134
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600135AC_OUTPUT