#!/usr/bin/env bash ##################################################################### ## _______ _______ _______ ## ## | ___ |____ | ___ | ## ## | | |_| / /| | |_| ## ## | |_____ / / | |_____ ## ## |_____ | / / |_____ | ## ## _ | | / / _ | | ## ## | |___| |/ /____| |___| | ## ## |_______|_______|_______| ## ## ## ## Wiimms SZS Tools ## ## http://szs.wiimm.de/ ## ## ## ##################################################################### ## ## ## This file is part of the SZS project. ## ## Visit http://szs.wiimm.de/ for project details and sources. ## ## ## ## Copyright (c) 2011-2019 by Dirk Clemens ## ## ## ##################################################################### #------------------------------------------------------------------------------ # setup CYGWIN_DIR="@@CYGWIN-DIR@@" CYGWIN_TOOLS="@@CYGWIN-TOOLS@@" BIN_FILES="@@BIN-FILES@@" DISTRIB_PATH="@@DISTRIB-PATH@@" BIN_PATH="$DISTRIB_PATH/bin" mkdir -p "$BIN_PATH" || exit 1 #------------------------------------------------------------------------------ # copy cygwin tools for tool in $CYGWIN_TOOLS do cp --preserve=time "$CYGWIN_DIR/$tool.exe" "$BIN_PATH" || exit 1 done #------------------------------------------------------------------------------ # copy wit tools for tool in $BIN_FILES do if [[ -s ./$tool.exe ]] then CYGWIN_TOOLS="$CYGWIN_TOOLS $tool" ln -f ./$tool.exe "$BIN_PATH" || exit 1 fi done #------------------------------------------------------------------------------ # copy needed cygwin dlls CYGCHECK="$( which cygcheck 2>/dev/null )" for tool in $CYGWIN_TOOLS do if [[ $CYGCHECK ]] then "$CYGCHECK" "$BIN_PATH/$tool.exe" \ | grep -E 'cygwin.*\\bin\\.*\.dll' \ | sed 's/.*\\//' else ldd "$BIN_PATH/$tool.exe" | grep -F "=> $CYGWIN_DIR/" | awk '{print $1}' fi done | sort | uniq | while read dll do cp --preserve=time "$CYGWIN_DIR/$dll" "$BIN_PATH" || exit 1 done #------------------------------------------------------------------------------ # done exit 0