Add a script to install TkImg
[msysgit.git] / src / tcltk / patches-tkImg / 0001-fix-compilation-on-MinGW.patch
blobbd796602b5682b7ad32774dc3257119be0fd1866
1 From e874100b4ce7ef4bb137d54d864269e5140f06b2 Mon Sep 17 00:00:00 2001
2 From: Johannes Schindelin <johannes.schindelin@gmx.de>
3 Date: Fri, 1 Jun 2007 18:37:00 +0100
4 Subject: [PATCH] fix compilation on MinGW
6 A couple of includes are needed, jconfig.h is not copied properly
7 (probably because of the lack of symlinks on MinGW), include paths
8 are hated by MinGW when they end with "/.", and you have to link
9 with the tk libs even when building a shared library.
11 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
12 ---
14 With this, the build runs through on my machine.
16 Of course, you have to generate the configure files (for some
17 reasons, this is not done automatically).
19 bmp/bmp.c | 1 +
20 tclconfig/img.m4 | 4 ++++
21 tclconfig/tcl.m4 | 2 +-
22 tiff/tiffJpeg.c | 2 +-
23 5 files changed, 8 insertions(+), 2 deletions(-)
25 diff --git a/bmp/bmp.c b/bmp/bmp.c
26 index 3528fe8..949e8f6 100644
27 --- a/bmp/bmp.c
28 +++ b/bmp/bmp.c
29 @@ -14,6 +14,7 @@
30 * Generic initialization code, parameterized via CPACKAGE and PACKAGE.
33 +#include <string.h>
34 #include "init.c"
37 diff --git a/tclconfig/img.m4 b/tclconfig/img.m4
38 index ac30ac0..4b12c68 100644
39 --- a/tclconfig/img.m4
40 +++ b/tclconfig/img.m4
41 @@ -11,6 +11,10 @@ AC_DEFUN(IMG_SRCPATH, [
42 case [$]$1_SRC_DIR in
43 /*) $1_SRC_PATH=[$]$1_SRC_DIR
45 +.)
46 + # SRC_DIR current dir, replace by BUILD_PATH
47 + $1_SRC_PATH="`dirname [$]$1_BUILD_STUB_LIB_PATH`"
48 + ;;
49 *) # SRC_DIR relative, splice with BUILD_PATH
50 $1_SRC_PATH="`dirname [$]$1_BUILD_STUB_LIB_PATH`/[$]$1_SRC_DIR"
51 esac
52 diff --git a/tclconfig/tcl.m4 b/tclconfig/tcl.m4
53 index 3b1f478..99ba384 100644
54 --- a/tclconfig/tcl.m4
55 +++ b/tclconfig/tcl.m4
56 @@ -3153,7 +3153,7 @@ AC_DEFUN(TEA_MAKE_LIB, [
57 MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$](PACKAGE)stub_OBJECTS)"
58 else
59 MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(\[$](PACKAGE)_OBJECTS)"
60 - MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$](PACKAGE)_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}"
61 + MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$](PACKAGE)_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \${TK_LIBS}"
62 MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(\[$](PACKAGE)stub_OBJECTS)"
65 diff --git a/tiff/tiffJpeg.c b/tiff/tiffJpeg.c
66 index 413e95b..7027c38 100644
67 --- a/tiff/tiffJpeg.c
68 +++ b/tiff/tiffJpeg.c
69 @@ -1520,7 +1520,7 @@ JPEGVGetField(tif, tag, ap)
70 case TIFFTAG_JPEGTABLES:
71 /* u_short is bogus --- should be uint32 ??? */
72 /* TIFFWriteNormalTag needs fixed XXX */
73 - *va_arg(ap, u_short*) = (u_short) sp->jpegtables_length;
74 + *va_arg(ap, unsigned short*) = (unsigned short) sp->jpegtables_length;
75 *va_arg(ap, void**) = sp->jpegtables;
76 break;
77 case TIFFTAG_JPEGQUALITY:
78 --
79 1.5.2.2663.gd77e7-dirty