blob: e846bfcf18f3dcc2a9bd838575a7ad4bad66bccd [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
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -05006dnl (third field in two places below) and set the PNGLIB_RELEASE
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -06007dnl 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-Pehrson047c34b2009-11-07 10:40:40 -060021AC_INIT([libpng], [1.4.0beta93], [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-Pehrson047c34b2009-11-07 10:40:40 -060026PNGLIB_VERSION=1.4.0beta93
Glenn Randers-Pehrson8568f6e2009-07-28 17:20:26 -050027PNGLIB_MAJOR=1
28PNGLIB_MINOR=4
29PNGLIB_RELEASE=0
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060030
31dnl End of version number stuff
32
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060033AC_CONFIG_SRCDIR([pngget.c])
Glenn Randers-Pehrson73b064c2006-05-15 06:44:21 -050034AM_CONFIG_HEADER(config.h)
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060035
36# Checks for programs.
37AC_PROG_CC
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060038AC_PROG_LD
39AC_PROG_CPP
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060040AC_CHECK_TOOL(SED, sed, :)
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -050041AC_LIBTOOL_WIN32_DLL
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060042AC_PROG_INSTALL
43AC_PROG_LN_S
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060044AC_PROG_MAKE_SET
45AC_PROG_LIBTOOL
46
47# Checks for header files.
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060048AC_HEADER_STDC
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060049AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060050
51# Checks for typedefs, structures, and compiler characteristics.
52AC_C_CONST
53AC_TYPE_SIZE_T
54AC_STRUCT_TM
55
56# Checks for library functions.
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060057AC_FUNC_STRTOD
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060058AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
Glenn Randers-Pehrson5c60b232006-03-07 07:09:22 -060059AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
60AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060061
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050062LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
Glenn Randers-Pehrson glennrp@comcast.net0a2547e2009-05-02 15:23:38 -050063LIBPNG_DEFINES=$LIBPNG_DEFINES
Glenn Randers-Pehrson629330e2006-04-17 14:33:23 -050064AC_SUBST(LIBPNG_DEFINES)
Glenn Randers-Pehrsonb511b602006-04-16 19:45:31 -050065
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060066AC_MSG_CHECKING([if libraries can be versioned])
67GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
68if test "$GLD"; then
69 have_ld_version_script=yes
70 AC_MSG_RESULT(yes)
71else
72 have_ld_version_script=no
73 AC_MSG_RESULT(no)
Glenn Randers-Pehrson17218292006-04-20 07:20:46 -050074 AC_MSG_WARN(*** You have not enabled versioned symbols.)
Glenn Randers-Pehrsone6474622006-03-04 16:50:47 -060075fi
76AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060077
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -050078if test "$have_ld_version_script" = "yes"; then
79 AC_MSG_CHECKING([for symbol prefix])
80 SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
81 | ${CPP-${CC-gcc} -E} - 2>&1 \
82 | ${EGREP-grep} "^PREFIX=" \
83 | ${SED-sed} "s:^PREFIX=::"`
84 AC_SUBST(SYMBOL_PREFIX)
85 AC_MSG_RESULT($SYMBOL_PREFIX)
86fi
87
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060088# Substitutions for .in files
89AC_SUBST(PNGLIB_VERSION)
90AC_SUBST(PNGLIB_MAJOR)
91AC_SUBST(PNGLIB_MINOR)
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -050092AC_SUBST(PNGLIB_RELEASE)
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -060093
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060094# Additional arguments (and substitutions)
95# Allow the pkg-config directory to be set
96AC_ARG_WITH(pkgconfigdir,
97 AC_HELP_STRING([--with-pkgconfigdir],
Glenn Randers-Pehrsonb511b602006-04-16 19:45:31 -050098 [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -060099 [pkgconfigdir=${withval}],
100 [pkgconfigdir='${libdir}/pkgconfig'])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600101
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600102AC_SUBST([pkgconfigdir])
103AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600104
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600105# Make the *-config binary config scripts optional
106AC_ARG_WITH(binconfigs,
107 AC_HELP_STRING([--with-binconfigs],
108 [Generate shell libpng-config scripts as well as pkg-config data]
109 [@<:@default=yes@:>@]),
110 [if test "${withval}" = no; then
111 binconfigs=
112 AC_MSG_NOTICE([libpng-config scripts will not be built])
113 else
114 binconfigs='${binconfigs}'
115 fi],
116 [binconfigs='${binconfigs}'])
117AC_SUBST([binconfigs])
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600118
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600119# Allow the old version number library, libpng.so, to be removed from
120# the build
121AC_ARG_WITH(libpng-compat,
122 AC_HELP_STRING([--with-libpng-compat],
123 [Generate the obsolete libpng.so library @<:@default=yes@:>@]),
124 [if test "${withval}" = no; then
125 compatlib=
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -0500126 AC_MSG_NOTICE([libpng.so will not be built])
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600127 else
128 compatlib=libpng.la
129 fi],
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -0500130 [compatlib=libpng.la])
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600131AC_SUBST([compatlib])
132
133# Config files, substituting as above
Glenn Randers-Pehrsoneb580912008-07-30 14:47:09 -0500134AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc-configure.in])
Glenn Randers-Pehrsonc3d51c12006-03-02 07:23:18 -0600135AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in],
136 [chmod +x libpng-config])
137
Glenn Randers-Pehrson917648e2004-12-02 18:14:51 -0600138AC_OUTPUT