Skip to content

Commit

Permalink
Update configure patch to be more finer-grained when deciding to link
Browse files Browse the repository at this point in the history
against gcc_egh. Fixes: ocaml-cross#313
  • Loading branch information
toots committed Feb 27, 2024
1 parent 1c80241 commit de5d5df
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
--- ocaml-5.1.1/configure.orig 2024-02-25 18:21:29.787786010 +0000
+++ ocaml-5.1.1/configure 2024-02-25 18:21:31.795786011 +0000
@@ -13947,6 +13947,14 @@
--- a/configure.orig 2024-02-27 21:22:55.384420013 +0000
+++ a/configure 2024-02-27 21:19:10.686935006 +0000
@@ -14274,17 +14274,9 @@



+ flexlink_where_cmd_prefix=''
+ case $build in #(
+ *-w64-mingw32*|*-pc-windows) :
+ flexlink_where_cmd_prefix="cmd /c" ;; #(
+ *) :
+ ;;
+esac
+
if test -n "$flexlink" && test -z "$flexdir"
- flexlink_exec_cmd=''
- case $build in #(
- *-w64-mingw32*|*-pc-windows) :
- flexlink_exec_cmd=cmd /c ;; #(
- *) :
- ;;
-esac
-
case $host in #(
*-w64-mingw32*|*-pc-windows) :
- flexlink_where="$($flexlink_exec_cmd "$flexlink" -where 2>/dev/null)"
+ flexlink_where="$(cmd /c "$flexlink" -where 2>/dev/null)"
if test -z "$flexlink_where"
then :
as_fn_error $? "$flexlink is not executable from a native Win32 process" "$LINENO" 5
opam@7bc71e662445:/tmp/ocaml$ diff -urN configure configure.new
--- configure 2024-02-27 21:22:55.384420013 +0000
+++ configure.new 2024-02-27 21:19:10.686935006 +0000
@@ -14274,17 +14274,9 @@

@@ -14024,7 +14032,7 @@


- flexlink_exec_cmd=''
- case $build in #(
- *-w64-mingw32*|*-pc-windows) :
- flexlink_exec_cmd=cmd /c ;; #(
- *) :
- ;;
-esac
-
case $host in #(
*-w64-mingw32*|*-pc-windows) :
- flexlink_where="$(cmd /c "$flexlink" -where 2>/dev/null)"
+ flexlink_where="$($flexlink_where_cmd_prefix "$flexlink" -where 2>/dev/null)"
if test -z "$flexlink_where"
- flexlink_where="$($flexlink_exec_cmd "$flexlink" -where 2>/dev/null)"
+ flexlink_where="$(cmd /c "$flexlink" -where 2>/dev/null)"
if test -z "$flexlink_where"
then :
as_fn_error $? "$flexlink is not executable from a native Win32 process" "$LINENO" 5
@@ -18358,9 +18366,17 @@

## Determine how to link with the POSIX threads library

+extra_mingw_pthread_lib=''
+case $build in #(
+ *-*-mingw32*) :
+ extra_mingw_pthread_lib="-lgcc_eh" ;; #(
+ *) :
+ ;;
+esac
+
case $host in #(
*-*-mingw32*) :
- PTHREAD_LIBS="-l:libpthread.a -lgcc_eh" ;; #(
+ PTHREAD_LIBS="-l:libpthread.a $extra_mingw_pthread_lib" ;; #(
*-pc-windows) :
PTHREAD_LIBS="-l:libpthread.lib" ;; #(
*) :
2 changes: 1 addition & 1 deletion packages/ocaml-windows64/ocaml-windows64.5.1.1/opam
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extra-files: [
["build.sh" "md5=60fbd2b09fecf1e886605f38e81922ed"]
["install.sh" "md5=771227318703c168f819281d3c051b29"]
["patches/ostype-fix.patch" "md5=57404edca01e9a353f28d3b3c0139f55"]
["patches/configure.patch" "md5=668bfb4f3fccd959daa553f70b28e803"]
["patches/configure.patch" "md5=31e9d8c2a8af36a563eddc3ab307725d"]
]
url {
src: "https://github.com/ocaml/ocaml/archive/5.1.1.tar.gz"
Expand Down

0 comments on commit de5d5df

Please sign in to comment.