From 26e6cbdc6c4dd5d249d0069288bfd99ac401cf5c Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 14 2020 13:38:41 +0000 Subject: Apply patch libpng12-pngconf.patch patch_name: libpng12-pngconf.patch present_in_specfile: true --- diff --git a/configure.ac b/configure.ac index 5baf228..eabffe5 100644 --- a/configure.ac +++ b/configure.ac @@ -68,7 +68,8 @@ esac AC_MSG_CHECKING( [if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE]) AC_TRY_COMPILE( - [#include "$srcdir/pnggccrd.c"], + [#define PNG_CONFIGURE_LIBPNG + #include "$srcdir/pnggccrd.c"], [return 0;], AC_MSG_RESULT(yes) LIBPNG_NO_MMX="", diff --git a/pngconf.h b/pngconf.h index 20a338c..8304989 100644 --- a/pngconf.h +++ b/pngconf.h @@ -38,6 +38,25 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif +#else +/* pngconf.h is part of the exported API. When a libpng-using application + includes us, PNG_CONFIGURE_LIBPNG is of course not defined as we do not have + libpng's config.h available in this case. This means that we do not have the + defines added to config.h and the commandline by libpng's ./configure . + + For all defines from config.h not having them set is not a problem, however + ./configure also adds -DPNG_NO_ASSEMBLER_CODE to the CFLAGS when compiling + on a platform on which the MMX and SSE asm code in libpng is not supported. + + We do need this define as this define is used to determine whether or not + to define PNG_ASSEMBLER_CODE_SUPPORTED and other assembler related defines + and prototypes. PNG_ASSEMBLER_CODE_SUPPORTED in turn is used by applications + (ImageMagick for example) to determine whether or not they can use the asm + functions. Thus we need to define PNG_NO_ASSEMBLER_CODE here on platforms + on which the MMX and SSE asm code in libpng is not supported: */ +#ifndef __i386__ /* change this if MMX/SSE become supported on x86_64! */ +#define PNG_NO_ASSEMBLER_CODE +#endif #endif /*