Skip to content

Commit

Permalink
Add tcl/tk 8.5.12 recipe with patches
Browse files Browse the repository at this point in the history
  • Loading branch information
shirosaki authored and luislavena committed Sep 8, 2012
1 parent 14886eb commit a0b0878
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
54 changes: 54 additions & 0 deletions tcl/0001-Replace-pow-with-powl-under-x86_64-w64-mingw32.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
From a9a511fd4a5c7ae5c7570154a6a0eb636e4bc7d5 Mon Sep 17 00:00:00 2001
From: Hiroshi Shirosaki <[email protected]>
Date: Sat, 28 Jul 2012 10:00:32 +0900
Subject: [PATCH] Replace pow() with powl() under x86_64-w64-mingw32

Replace pow() implementation because of broken pow() with mingw x64.
---
win/tcl.m4 | 10 ++++++++++
win/tclWin32Dll.c | 8 ++++++++
2 files changed, 18 insertions(+)

diff --git a/win/tcl.m4 b/win/tcl.m4
index 83a4ea3..e20e6af 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -521,6 +521,16 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [

EXTRA_CFLAGS="${extra_cflags}"

+ AC_EGREP_CPP(yes,
+ [#ifdef __MINGW64__
+ yes
+ #endif
+ ], is_mingw64=yes, is_mingw64=no)
+
+ if test "$is_mingw64" = "yes"; then
+ EXTRA_CFLAGS="-fno-builtin-pow ${extra_cflags}"
+ fi
+
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
CFLAGS_WARNING="-Wall"
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 6c863b9..35d0c39 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -1232,6 +1232,14 @@ TclWinCPUID(
#endif
return status;
}
+
+#ifdef __MINGW64__
+#include <math.h>
+double pow(double x, double y)
+{
+ return powl(x, y);
+}
+#endif

/*
* Local Variables:
--
1.7.11.msysgit.1

13 changes: 13 additions & 0 deletions tcl/tcl-8.5.12.knapfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
recipe "tcl", "8.5.12" do
use :autotools
use :patch

fetch "http://downloads.sourceforge.net/#{name}/#{name}#{version}-src.tar.gz",
:md5 => "174b2b4c619ba8f96875d8a051917703"

before :configure do
run "cd win && sh -c \"autoconf\""
options.configure = "win/configure"
options.configure_args << "--enable-threads"
end
end
16 changes: 16 additions & 0 deletions tk/tk-8.5.12.knapfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
recipe "tk", "8.5.12" do
use :autotools

depends_on "tcl"

fetch "http://downloads.sourceforge.net/tcl/#{name}#{version}-src.tar.gz",
:md5 => "a01640176845c1f654a412cfc9bab13b"

before :configure do
run "cd win && sh -c \"autoconf\""
options.configure = "win/configure"
options.configure_args << "--enable-threads"
tcl_path = Knapsack.work_path("tcl", version, platform)
options.configure_args << "--with-tcl=#{tcl_path}"
end
end

0 comments on commit a0b0878

Please sign in to comment.