Skip to content

Commit

Permalink
enable unprefixed executables for windows (#137)
Browse files Browse the repository at this point in the history
automerged PR by conda-forge/automerge-action
  • Loading branch information
github-actions[bot] authored Jun 14, 2024
2 parents 8ac7fcc + 30127ee commit cb349bb
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion recipe/install-g++.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ set +x
# and strip in there so that we do not change files that are not
# part of this package.
pushd ${PREFIX}
_files=$(find bin libexec -type f)
_files=$(find bin libexec -type f -not -name '*.dll')
for _file in ${_files}; do
_type="$( file "${_file}" | cut -d ' ' -f 2- )"
case "${_type}" in
Expand Down
14 changes: 9 additions & 5 deletions recipe/install-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ pushd ${SRC_DIR}/build

# many packages expect this symlink
[[ -f ${PREFIX}/bin/${TARGET}-cc${EXEEXT} ]] && rm ${PREFIX}/bin/${TARGET}-cc${EXEEXT}
if [[ "${TARGET}" != *mingw* ]]; then
pushd ${PREFIX}/bin
pushd ${PREFIX}/bin
if [[ "${HOST}" != *mingw* ]]; then
ln -s ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT}
popd
fi
else
cp ${TARGET}-gcc${EXEEXT} ${TARGET}-cc${EXEEXT}
fi
popd

# POSIX conformance launcher scripts for c89 and c99
cat > ${PREFIX}/bin/${TARGET}-c89${EXEEXT} <<"EOF"
Expand Down Expand Up @@ -176,7 +178,7 @@ set +x
# and strip in there so that we do not change files that are not
# part of this package.
pushd ${PREFIX}
_files=$(find bin libexec -type f)
_files=$(find bin libexec -type f -not -name '*.dll')
for _file in ${_files}; do
_type="$( file "${_file}" | cut -d ' ' -f 2- )"
case "${_type}" in
Expand Down Expand Up @@ -229,4 +231,6 @@ if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then
mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${TARGET}/lib/libgomp.spec
fi

rm -f ${PREFIX}/share/info/dir

source ${RECIPE_DIR}/make_tool_links.sh
4 changes: 3 additions & 1 deletion recipe/install-gfortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ set +x
# and strip in there so that we do not change files that are not
# part of this package.
pushd ${PREFIX}
_files=$(find bin libexec -type f)
_files=$(find bin libexec -type f -not -name '*.dll')
for _file in ${_files}; do
_type="$( file "${_file}" | cut -d ' ' -f 2- )"
case "${_type}" in
Expand All @@ -76,4 +76,6 @@ if [[ -f ${PREFIX}/lib/libgomp.spec ]]; then
mv ${PREFIX}/lib/libgomp.spec ${PREFIX}/${CHOST}/lib/libgomp.spec
fi

rm -f ${PREFIX}/share/info/dir

source ${RECIPE_DIR}/make_tool_links.sh
2 changes: 2 additions & 0 deletions recipe/install-libgcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ if [[ "${PKG_NAME}" != gcc_impl* ]]; then
install -Dm644 ${SRC_DIR}/COPYING.RUNTIME \
${PREFIX}/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION
fi

rm -f ${PREFIX}/share/info/dir
14 changes: 10 additions & 4 deletions recipe/install-symlinks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

source ${RECIPE_DIR}/setup_compiler.sh

if [[ "$target_platform" == "win-"* ]]; then
symlink_or_copy="cp"
else
symlink_or_copy="ln -sf"
fi

if [[ "${PKG_NAME}" == "gcc" ]]; then
for tool in cc cpp gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool; do
ln -sf ${PREFIX}/bin/${triplet}-${tool} ${PREFIX}/bin/${tool}
$symlink_or_copy ${PREFIX}/bin/${triplet}-${tool}${EXEEXT} ${PREFIX}/bin/${tool}${EXEEXT}
done
elif [[ "${PKG_NAME}" == "gxx" ]]; then
ln -sf ${PREFIX}/bin/${triplet}-g++ ${PREFIX}/bin/g++
ln -sf ${PREFIX}/bin/${triplet}-c++ ${PREFIX}/bin/c++
$symlink_or_copy ${PREFIX}/bin/${triplet}-g++${EXEEXT} ${PREFIX}/bin/g++${EXEEXT}
$symlink_or_copy ${PREFIX}/bin/${triplet}-c++${EXEEXT} ${PREFIX}/bin/c++${EXEEXT}
elif [[ "${PKG_NAME}" == "gfortran" ]]; then
ln -sf ${PREFIX}/bin/${triplet}-gfortran ${PREFIX}/bin/gfortran
$symlink_or_copy ${PREFIX}/bin/${triplet}-gfortran${EXEEXT} ${PREFIX}/bin/gfortran${EXEEXT}
fi
8 changes: 4 additions & 4 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = gcc_version %}
{% set build_num = 8 %}
{% set build_num = 9 %}

# libgcc-devel is a noarch: generic package that is built for
# cross-compilers as well. Instead of skipping for cross-compilers,
Expand Down Expand Up @@ -214,7 +214,7 @@ outputs:
- name: gcc
script: install-symlinks.sh
build:
skip: true # [target_platform != cross_target_platform or win]
skip: true # [target_platform != cross_target_platform]
requirements:
host:
- gcc_impl_{{ target_platform }} {{ gcc_version }}.*
Expand Down Expand Up @@ -325,7 +325,7 @@ outputs:
- name: gxx
script: install-symlinks.sh
build:
skip: true # [target_platform != cross_target_platform or win]
skip: true # [target_platform != cross_target_platform]
requirements:
host:
- gxx_impl_{{ target_platform }} {{ gcc_version }}.*
Expand Down Expand Up @@ -400,7 +400,7 @@ outputs:
- name: gfortran
script: install-symlinks.sh
build:
skip: true # [target_platform != cross_target_platform or win]
skip: true # [target_platform != cross_target_platform]
requirements:
host:
- gfortran_impl_{{ target_platform }} {{ gcc_version }}.*
Expand Down

0 comments on commit cb349bb

Please sign in to comment.