Pull in patches for libpng from rawhide
[fedora-mingw.git] / libpng / libpng-pngconf.patch
1 diff -Naur libpng-1.2.29.orig/configure.ac libpng-1.2.29/configure.ac
2 --- libpng-1.2.29.orig/configure.ac     2008-05-08 07:58:11.000000000 -0400
3 +++ libpng-1.2.29/configure.ac  2008-05-31 20:21:12.000000000 -0400
4 @@ -63,7 +63,8 @@
5  AC_MSG_CHECKING(
6    [if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
7  AC_TRY_COMPILE(
8 -  [#include "$srcdir/pnggccrd.c"],
9 +  [#define PNG_CONFIGURE_LIBPNG
10 +   #include "$srcdir/pnggccrd.c"],
11    [return 0;],
12    AC_MSG_RESULT(yes)
13    LIBPNG_NO_MMX="",
14 diff -Naur libpng-1.2.29.orig/pngconf.h libpng-1.2.29/pngconf.h
15 --- libpng-1.2.29.orig/pngconf.h        2008-05-08 07:58:03.000000000 -0400
16 +++ libpng-1.2.29/pngconf.h     2008-05-31 20:21:12.000000000 -0400
17 @@ -35,6 +35,25 @@
18  #ifdef HAVE_CONFIG_H
19  #include "config.h"
20  #endif
21 +#else
22 +/* pngconf.h is part of the exported API. When a libpng-using application
23 +   includes us, PNG_CONFIGURE_LIBPNG is of course not defined as we do not have
24 +   libpng's config.h available in this case. This means that we do not have the
25 +   defines added to config.h and the commandline by libpng's ./configure .
26 +   
27 +   For all defines from config.h not having them set is not a problem, however
28 +   ./configure also adds -DPNG_NO_ASSEMBLER_CODE to the CFLAGS when compiling
29 +   on a platform on which the MMX and SSE asm code in libpng is not supported.
30 +   
31 +   We do need this define as this define is used to determine whether or not
32 +   to define PNG_ASSEMBLER_CODE_SUPPORTED and other assembler related defines
33 +   and prototypes. PNG_ASSEMBLER_CODE_SUPPORTED in turn is used by applications
34 +   (ImageMagick for example) to determine whether or not they can use the asm
35 +   functions. Thus we need to define PNG_NO_ASSEMBLER_CODE here on platforms
36 +   on which the MMX and SSE asm code in libpng is not supported: */
37 +#ifndef __i386__ /* change this if MMX/SSE become supported on x86_64! */
38 +#define PNG_NO_ASSEMBLER_CODE
39 +#endif
40  #endif
41  
42  /*