diff options
Diffstat (limited to 'prefix-stack-ccwrap')
-rw-r--r-- | prefix-stack-ccwrap | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/prefix-stack-ccwrap b/prefix-stack-ccwrap index 4e297ce..00b3a36 100644 --- a/prefix-stack-ccwrap +++ b/prefix-stack-ccwrap @@ -7,6 +7,7 @@ fi myself=${0##*/} # basename $0 link_dirs=() +linkopts=() opts=() chost="@GENTOO_PORTAGE_CHOST@" prefix="@GENTOO_PORTAGE_EPREFIX@" @@ -21,6 +22,18 @@ orig_args=("$@") for opt in "$@" do + if [[ ${chost} == *"-winnt"* ]]; then + # We depend on dev-libs/pthreads4w, no? + case ${opt} in + -pthread | -lpthread) + case " ${linkopts[*]} " in + *" -lpthread "*) ;; + *) linkopts=( "${linkopts[@]}" "-lpthread" ) ;; + esac + continue + ;; + esac + fi case "$opt" in -L) link_dirs=("${link_dirs[@]}" "-L$1") @@ -83,7 +96,7 @@ esac [[ ${myself} == *-*-*-* ]] || myself=${chost}-${myself#${chost}-} case "$mode" in -link) exec "${myself}" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" ;; +link) exec "${myself}" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" "${linkopts[@]}" ;; compile) exec "${myself}" "${link_dirs[@]}" "${opts[@]}" "${pfx_comp[@]}" ;; version) exec "${myself}" "${orig_args[@]}" ;; dirs) |