Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: third_party/libpng/configure.ac

Issue 2033063003: Check libpng directly into third_party/ (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # configure.ac
2
3 # Copyright (c) 2016 Google, Inc.
4 # Written by Mike Klein and Matt Sarett
5 # Derived from the ARM supporting code in libpng/configure.ac, which was
6 # Copyright (c) 2004-2015 Glenn Randers-Pehrson
7 # Last changed in libpng 1.6.22 [(PENDING RELEASE)]
8
9 # This code is released under the libpng license.
10 # For conditions of distribution and use, see the disclaimer
11 # and license in png.h
12
13 dnl Process this file with autoconf to produce a configure script.
14 dnl
15 dnl Minor upgrades (compatible ABI): increment the package version
16 dnl (third field in two places below) and set the PNGLIB_RELEASE
17 dnl variable.
18 dnl
19 dnl Major upgrades (incompatible ABI): increment the package major
20 dnl version (second field, or first if desired), set the minor
21 dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in
22 dnl Makefile.am to upgrade the package name.
23
24 dnl This is here to prevent earlier autoconf from being used, it
25 dnl should not be necessary to regenerate configure if the time
26 dnl stamps are correct
27 AC_PREREQ([2.68])
28
29 dnl Version number stuff here:
30
31 AC_INIT([libpng],[1.6.22rc01],[png-mng-implement@lists.sourceforge.net])
32 AC_CONFIG_MACRO_DIR([scripts])
33
34 # libpng does not follow GNU file name conventions (hence 'foreign')
35 # color-tests requires automake 1.11 or later
36 # silent-rules requires automake 1.11 or later
37 # dist-xz requires automake 1.11 or later
38 # 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
39 # 1.13 is required for parallel tests
40 AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules subdir-objects])
41 # The following line causes --disable-maintainer-mode to be the default to
42 # configure, this is necessary because libpng distributions cannot rely on the
43 # time stamps of the autotools generated files being correct
44 AM_MAINTAINER_MODE
45
46 dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later
47 dnl version; aclocal.m4 will generate a failure if you use a prior version of
48 dnl automake, so the following is not necessary (and is not defined anyway):
49 dnl AM_PREREQ([1.11.2])
50 dnl stop configure from automagically running automake
51
52 PNGLIB_VERSION=1.6.22rc01
53 PNGLIB_MAJOR=1
54 PNGLIB_MINOR=6
55 PNGLIB_RELEASE=22
56
57 dnl End of version number stuff
58
59 AC_CONFIG_SRCDIR([pngget.c])
60 AC_CONFIG_HEADERS([config.h])
61
62 # Checks for programs.
63 AC_LANG([C])
64 AC_PROG_CC
65 AM_PROG_AS
66 LT_PATH_LD
67 AC_PROG_CPP
68 AC_PROG_AWK
69 AC_PROG_INSTALL
70 AC_PROG_LN_S
71 AC_PROG_MAKE_SET
72
73 dnl libtool/libtoolize; version 2.4.2 is the tested version, this or any
74 dnl compatible later version may be used
75 LT_INIT([win32-dll])
76 LT_PREREQ([2.4.2])
77
78 # Some awks crash when confronted with pnglibconf.dfa, do a test run now
79 # to make sure this doesn't happen
80 AC_MSG_CHECKING([that AWK works])
81 if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
82 ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
83 ${srcdir}/pngusr.dfa 1>&2
84 then
85 AC_MSG_RESULT([ok])
86 else
87 AC_MSG_FAILURE([failed], 1)
88 fi
89
90 # This is a remnant of the old cc -E validation, where it may have been
91 # necessary to use a different preprocessor for .dfn files
92 DFNCPP="$CPP"
93 AC_SUBST(DFNCPP)
94
95 # -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
96 # checks the compiler with a program that generates a warning), add the
97 # following option to deal with this
98 AC_ARG_VAR(PNG_COPTS,
99 [additional flags for the C compiler, use this for options that would]
100 [cause configure itself to fail])
101 AC_ARG_ENABLE(werror,
102 AS_HELP_STRING([[[--enable-werror[=OPT]]]],
103 [Pass -Werror or the given argument to the compiler if it is supported]),
104 [test "$enable_werror" = "yes" && enable_werror="-Werror"
105 if test "$enable_werror" != "no"; then
106 sav_CFLAGS="$CFLAGS"
107 CFLAGS="$enable_werror $CFLAGS"
108 AC_MSG_CHECKING([if the compiler allows $enable_werror])
109 AC_COMPILE_IFELSE(
110 [AC_LANG_SOURCE([
111 [int main(int argc, char **argv){]
112 [return argv[argc-1][0];]
113 [}]])],
114 AC_MSG_RESULT(yes)
115 PNG_COPTS="$PNG_COPTS $enable_werror",
116 AC_MSG_RESULT(no))
117 CFLAGS="$sav_CFLAGS"
118 fi],)
119
120 # For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89
121 # In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_ SOURCE to 1
122 # This is incompatible with the new default mode, so we test for that and force the
123 # "-std=c89" compiler option:
124 AC_MSG_CHECKING([if we need to force back C standard to C89])
125 AC_COMPILE_IFELSE(
126 [AC_LANG_PROGRAM([
127 [#define _POSIX_SOURCE 1]
128 [#include <stdio.h>]
129 ])],
130 AC_MSG_RESULT(no),[
131 if test "x$GCC" != "xyes"; then
132 AC_MSG_ERROR(
133 [Forcing back to C89 is required but the flags are only known for GC C])
134 fi
135 AC_MSG_RESULT(yes)
136 CFLAGS="$CFLAGS -std=c89"
137 ])
138
139 # Checks for header files.
140 AC_HEADER_STDC
141
142 # Checks for typedefs, structures, and compiler characteristics.
143 AC_C_CONST
144 AC_TYPE_SIZE_T
145 AC_STRUCT_TM
146 AC_C_RESTRICT
147
148 # Checks for library functions.
149 AC_FUNC_STRTOD
150 AC_CHECK_FUNCS([memset], , AC_MSG_ERROR(memset not found in libc))
151 AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) )
152 AC_ARG_WITH(zlib-prefix,
153 AS_HELP_STRING([[[--with-zlib-prefix]]],
154 [prefix that may have been used in installed zlib]),
155 [ZPREFIX=${withval}],
156 [ZPREFIX='z_'])
157 AC_CHECK_LIB(z, zlibVersion, ,
158 AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed)))
159
160 # The following is for pngvalid, to ensure it catches FP errors even on
161 # platforms that don't enable FP exceptions, the function appears in the math
162 # library (typically), it's not an error if it is not found.
163 AC_CHECK_LIB([m], [feenableexcept])
164 AC_CHECK_FUNCS([feenableexcept])
165
166 AC_MSG_CHECKING([if using Solaris linker])
167 SLD=`$LD --version 2>&1 | grep Solaris`
168 if test "$SLD"; then
169 have_solaris_ld=yes
170 AC_MSG_RESULT(yes)
171 else
172 have_solaris_ld=no
173 AC_MSG_RESULT(no)
174 fi
175 AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes")
176
177 AC_MSG_CHECKING([if libraries can be versioned])
178 # Special case for PE/COFF platforms: ld reports
179 # support for version-script, but doesn't actually
180 # DO anything with it.
181 case $host in
182 *cygwin* | *mingw32* | *interix* )
183 have_ld_version_script=no
184 AC_MSG_RESULT(no)
185 ;;
186 * )
187
188 if test "$have_solaris_ld" = "yes"; then
189 GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'`
190 else
191 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
192 fi
193
194 if test "$GLD"; then
195 have_ld_version_script=yes
196 AC_MSG_RESULT(yes)
197 else
198 have_ld_version_script=no
199 AC_MSG_RESULT(no)
200 AC_MSG_WARN(*** You have not enabled versioned symbols.)
201 fi
202 ;;
203 esac
204
205 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
206
207 if test "$have_ld_version_script" = "yes"; then
208 AC_MSG_CHECKING([for symbol prefix])
209 SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
210 | ${CPP-${CC-gcc} -E} - 2>&1 \
211 | ${EGREP-grep} "^PREFIX=" \
212 | ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
213 AC_SUBST(SYMBOL_PREFIX)
214 AC_MSG_RESULT($SYMBOL_PREFIX)
215 fi
216
217 # Substitutions for .in files
218 AC_SUBST(PNGLIB_VERSION)
219 AC_SUBST(PNGLIB_MAJOR)
220 AC_SUBST(PNGLIB_MINOR)
221 AC_SUBST(PNGLIB_RELEASE)
222
223 # Additional arguments (and substitutions)
224 # Allow the pkg-config directory to be set
225 AC_ARG_WITH(pkgconfigdir,
226 AS_HELP_STRING([[[--with-pkgconfigdir]]],
227 [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
228 [pkgconfigdir=${withval}],
229 [pkgconfigdir='${libdir}/pkgconfig'])
230
231 AC_SUBST([pkgconfigdir])
232 AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]])
233
234 # Make the *-config binary config scripts optional
235 AC_ARG_WITH(binconfigs,
236 AS_HELP_STRING([[[--with-binconfigs]]],
237 [Generate shell libpng-config scripts as well as pkg-config data]
238 [@<:@default=yes@:>@]),
239 [if test "${withval}" = no; then
240 binconfigs=
241 AC_MSG_NOTICE([[libpng-config scripts will not be built]])
242 else
243 binconfigs='${binconfigs}'
244 fi],
245 [binconfigs='${binconfigs}'])
246 AC_SUBST([binconfigs])
247
248 # Support for prefixes to the API function names; this will generate defines
249 # at the start of the build to rename exported library functions
250 AC_ARG_WITH(libpng-prefix,
251 AS_HELP_STRING([[[--with-libpng-prefix]]],
252 [prefix libpng exported function (API) names with the given value]),
253 [if test "${withval:-no}" != "no"; then
254 AC_SUBST([PNG_PREFIX], [${withval}])
255 fi])
256 AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
257
258 # Control over what links are made for installed files. Versioned files are
259 # always installed, when the following options are turned on corresponding
260 # unversioned links are also created (normally as symbolic links):
261 AC_ARG_ENABLE([unversioned-links],
262 AS_HELP_STRING([[[--enable-unversioned-links]]],
263 [Installed libpng header files are placed in a versioned subdirectory]
264 [and installed libpng library (including DLL) files are versioned.]
265 [If this option is enabled unversioned links will be created pointing to]
266 [the corresponding installed files. If you use libpng.pc or]
267 [libpng-config for all builds you do not need these links, but if you]
268 [compile programs directly they will typically #include <png.h> and]
269 [link with -lpng; in that case you need the links.]
270 [The links can be installed manually using 'make install-header-links']
271 [and 'make install-library-links' and can be removed using the]
272 [corresponding uninstall- targets. If you do enable this option every]
273 [libpng 'make install' will recreate the links to point to the just]
274 [installed version of libpng. The default is to create the links;]
275 [use --disable-unversioned-links to change this]))
276
277 # The AM_CONDITIONAL test is written so that the default is enabled;
278 # --disable-unversioned-links must be given to turn the option off.
279 AM_CONDITIONAL([DO_INSTALL_LINKS],[test "$enable_unversioned_links" != "no"])
280
281 AC_ARG_ENABLE([unversioned-libpng-pc],
282 AS_HELP_STRING([[[--enable-unversioned-libpng-pc]]],
283 [Install the configuration file 'libpng.pc' as a link to the versioned]
284 [version. This is done by default - use --disable-unversioned-libpng-pc]
285 [to change this.]))
286 AM_CONDITIONAL([DO_INSTALL_LIBPNG_PC],
287 [test "$enable_unversioned_libpng_pc" != "no"])
288
289 AC_ARG_ENABLE([unversioned-libpng-config],
290 AS_HELP_STRING([[[--enable-unversioned-libpng-config]]],
291 [Install the configuration file 'libpng-config' as a link to the]
292 [versioned version. This is done by default - use]
293 [--disable-unversioned-libpng-config to change this.]))
294 AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
295 [test "$enable_unversioned_libpng_config" != "no"])
296
297 # HOST SPECIFIC OPTIONS
298 # =====================
299 #
300 # ARM
301 # ===
302 #
303 # ARM NEON (SIMD) support.
304
305 AC_ARG_ENABLE([arm-neon],
306 AS_HELP_STRING([[[--enable-arm-neon]]],
307 [Enable ARM NEON optimizations: =no/off, check, api, yes/on:]
308 [no/off: disable the optimizations; check: use internal checking code]
309 [(deprecated and poorly supported); api: disable by default, enable by]
310 [a call to png_set_option; yes/on: turn on unconditionally.]
311 [If not specified: determined by the compiler.]),
312 [case "$enableval" in
313 no|off)
314 # disable the default enabling on __ARM_NEON__ systems:
315 AC_DEFINE([PNG_ARM_NEON_OPT], [0],
316 [Disable ARM Neon optimizations])
317 # Prevent inclusion of the assembler files below:
318 enable_arm_neon=no;;
319 check)
320 AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
321 [Check for ARM Neon support at run-time]);;
322 api)
323 AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
324 [Turn on ARM Neon optimizations at run-time]);;
325 yes|on)
326 AC_DEFINE([PNG_ARM_NEON_OPT], [2],
327 [Enable ARM Neon optimizations])
328 AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if]
329 [you want the optimizations unconditionally pass -mfpu=neon]
330 [to the compiler.]);;
331 *)
332 AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
333 esac])
334
335 # Add ARM specific files to all builds where the host_cpu is arm ('arm*') or
336 # where ARM optimizations were explicitly requested (this allows a fallback if a
337 # future host CPU does not match 'arm*')
338
339 AM_CONDITIONAL([PNG_ARM_NEON],
340 [test "$enable_arm_neon" != 'no' &&
341 case "$host_cpu" in
342 arm*|aarch64*) :;;
343 *) test "$enable_arm_neon" != '';;
344 esac])
345
346 # INTEL
347 # =====
348 #
349 # INTEL SSE (SIMD) support.
350
351 AC_ARG_ENABLE([intel-sse],
352 AS_HELP_STRING([[[--enable-intel-sse]]],
353 [Enable Intel SSE optimizations: =no/off, yes/on:]
354 [no/off: disable the optimizations;]
355 [yes/on: enable the optimizations.]
356 [If not specified: determined by the compiler.]),
357 [case "$enableval" in
358 no|off)
359 # disable the default enabling:
360 AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
361 [Disable Intel SSE optimizations])
362 # Prevent inclusion of the assembler files below:
363 enable_intel_sse=no;;
364 yes|on)
365 AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
366 [Enable Intel SSE optimizations]);;
367 *)
368 AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
369 esac])
370
371 # Add Intel specific files to all builds where the host_cpu is Intel ('x86*')
372 # or where Intel optimizations were explicitly requested (this allows a
373 # fallback if a future host CPU does not match 'x86*')
374 AM_CONDITIONAL([PNG_INTEL_SSE],
375 [test "$enable_intel_sse" != 'no' &&
376 case "$host_cpu" in
377 i?86|x86_64) :;;
378 *) test "$enable_intel_sse" != '';;
379 esac])
380 AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
381
382 # Config files, substituting as above
383 AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
384 AC_CONFIG_FILES([libpng-config:libpng-config.in],
385 [chmod +x libpng-config])
386
387 AC_OUTPUT
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698