Skip to content

Commit

Permalink
Review fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
vvuk committed Apr 19, 2020
1 parent 2bde8b9 commit a1be37b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,23 @@ PREFIX?=c:/wasi-sdk
# who knows what
BASH?=bash -c

ifneq (x$(MSYSTEM),x)
ifeq (x$(MSYSTEM),x)
$(error On Windows, this Makefile only works in MSYS2 environments such as git-bash.)
endif

# msys needs any /-prefixed arguments, or =/ containing, to turn into //
# because it tries to path-expand the / into the msys root. // escapes this.
SLASHY_SLASH=/
# assuming we're running under msys2 (git-bash), PATH needs /c/foo format directories
ESCAPE_SLASH=/

# assuming we're running under msys2 (git-bash), PATH needs /c/foo format directories (because
# it itself is :-delimited)
PATH_PREFIX=$(shell cygpath.exe -u $(PREFIX))
endif

endif

PREFIX?=/opt/wasi-sdk
PATH_PREFIX?=$(PREFIX)
SLASHY_SLASH?=
ESCAPE_SLASH?=
BASH?=

CLANG_VERSION=$(shell $(BASH) ./llvm_version.sh $(LLVM_PROJ_DIR))
Expand Down Expand Up @@ -131,7 +135,7 @@ build/libcxx.BUILT: build/llvm.BUILT build/compiler-rt.BUILT build/wasi-libc.BUI
cd build/libcxx && cmake -G Ninja $(LIBCXX_CMAKE_FLAGS) \
-DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP)" \
-DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP)" \
-DLIBCXX_LIBDIR_SUFFIX=$(SLASHY_SLASH)/wasm32-wasi \
-DLIBCXX_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \
$(LLVM_PROJ_DIR)/libcxx
ninja $(NINJA_FLAGS) -v -C build/libcxx
# Do the install.
Expand Down Expand Up @@ -169,7 +173,7 @@ build/libcxxabi.BUILT: build/libcxx.BUILT build/llvm.BUILT
cd build/libcxxabi && cmake -G Ninja $(LIBCXXABI_CMAKE_FLAGS) \
-DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP)" \
-DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP)" \
-DLIBCXXABI_LIBDIR_SUFFIX=$(SLASHY_SLASH)/wasm32-wasi \
-DLIBCXXABI_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \
$(LLVM_PROJ_DIR)/libcxxabi
ninja $(NINJA_FLAGS) -v -C build/libcxxabi
# Do the install.
Expand Down
18 changes: 13 additions & 5 deletions tar_from_installation.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/usr/bin/env bash
set -ex
OUTDIR=$PWD/dist
VERSION=`./version.sh`
INDIR=/opt/wasi-sdk

if [ -n "$1" ]; then
OUTDIR=$1
else
OUTDIR=$PWD/dist
fi

if [ -n "$2" ]; then
VERSION="$2"
else
VERSION=`./version.sh`
fi

if [ -n "$3" ]; then
INDIR="$3"
INSTALL_DIR="$3"
else
INSTALL_DIR=/opt/wasi-sdk
fi

PKGDIR=build/wasi-sdk-$VERSION
Expand All @@ -26,8 +29,13 @@ case "$(uname -s)" in
*) MACHINE="UNKNOWN"
esac

if [ ! -d $INSTALL_DIR ] ; then
echo "Directory $INSTALL_DIR doesn't exist. Nothing to copy from."
exit 1
fi

rm -rf $PKGDIR
cp -R $INDIR $PKGDIR
cp -R $INSTALL_DIR $PKGDIR
cd build
tar czf $OUTDIR/wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION

Expand Down

0 comments on commit a1be37b

Please sign in to comment.