configure.ac 19 KB

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