Skip to content

Commit

Permalink
Merge pull request #115 from dra27/cygwin64
Browse files Browse the repository at this point in the history
Switch CI over to Cygwin64
  • Loading branch information
dra27 committed Mar 2, 2023
2 parents f5ccd97 + 667ef87 commit 0be0cf0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ MSVC_DETECT=1
# Attempt to locate the Windows SDK

ifeq ($(MSVC_DETECT),1)
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
ifeq ($(if $(MAKECMDGOALS),$(if $(strip $(filter-out clean,$(MAKECMDGOALS))),,1)),)
include Makefile.winsdk
endif
endif
Expand Down Expand Up @@ -128,8 +128,7 @@ else
LINKFLAGS = -cclib "-link $(RES)"
endif

support:
for i in $(CHAINS); do $(MAKE) --no-print-directory build_$$i || break ; done
support: $(addprefix build_, $(CHAINS))

build_gnat: flexdll_gnat.o flexdll_initer_gnat.o
build_msvc: flexdll_msvc.obj flexdll_initer_msvc.obj
Expand Down
14 changes: 7 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ image: Visual Studio 2015

environment:
global:
CYG_ROOT: C:/cygwin
CYG_ROOT: C:/cygwin64
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
CYG_CACHE: C:/cygwin/var/cache/setup
CYG_CACHE: C:/cygwin64/var/cache/setup
OCAML_PORT: msvc64
ARTEFACTS: no
matrix:
Expand Down Expand Up @@ -48,12 +48,12 @@ cache:
install:
# Make sure the Cygwin path comes before the Git one (otherwise
# cygpath behaves crazily), but after the MSVC one.
- set Path=C:\cygwin\bin;%OCAMLROOT%\bin;C:\flexdll;%Path%
- set Path=C:\cygwin64\bin;%OCAMLROOT%\bin;C:\flexdll;%Path%
- '%CYG_ROOT%\bin\bash -lc "cygcheck -dc cygwin"'
- if exist "%CYG_ROOT%\setup-x86.exe" del "%CYG_ROOT%\setup-x86.exe"
- appveyor DownloadFile "https://cygwin.com/setup-x86.exe" -FileName "%CYG_ROOT%\setup-x86.exe"
- '"%CYG_ROOT%\setup-x86.exe" --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages cygwin64-gcc-core,unzip,zip > nul'
- '%CYG_ROOT%\bin\bash -lc "x86_64-pc-cygwin-gcc --version" > nul || "%CYG_ROOT%\setup-x86.exe" --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --upgrade-also > nul'
- if exist "%CYG_ROOT%\setup-x86_64.exe" del "%CYG_ROOT%\setup-x86_64.exe"
- appveyor DownloadFile "https://cygwin.com/setup-x86_64.exe" -FileName "%CYG_ROOT%\setup-x86_64.exe"
- '"%CYG_ROOT%\setup-x86_64.exe" --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages unzip,zip > nul'
- '%CYG_ROOT%\bin\bash -lc "zip --version" > nul || "%CYG_ROOT%\setup-x86_64.exe" --quiet-mode --no-shortcuts --no-startmenu --no-desktop --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --upgrade-also > nul'
- '%CYG_ROOT%\bin\bash -lc "cygcheck -dc cygwin"'
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
- appveyor DownloadFile "https://github.com/alainfrisch/flexdll/archive/0.37.tar.gz" -FileName "flexdll.tar.gz"
Expand Down
46 changes: 26 additions & 20 deletions appveyor_build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

function run {
NAME=$1
shift
Expand All @@ -22,7 +24,7 @@ function configure_ocaml {
sed -i -e 's/@iflexdir@/-I"$(ROOTDIR)\/flexdll"/' Makefile.config.in
fi

./configure --build=i686-pc-cygwin --host=$OCAML_TARGET \
./configure --build=x86_64-pc-cygwin --host=$OCAML_TARGET \
--prefix=$OCAMLROOT \
--disable-debugger \
--disable-ocamldoc \
Expand Down Expand Up @@ -52,11 +54,6 @@ case "$OCAML_PORT" in
*) echo "Unrecognised OCAML_PORT: $OCAML_PORT"; exit 1;;
esac

case "$OCAMLBRANCH" in
*.*|trunk) ;;
*) echo "Unrecognised OCAMLBRANCH: $OCAMLBRANCH"; exit 1;;
esac

echo ** OCAMLROOT=$OCAMLROOT

#echo "APPVEYOR_PULL_REQUEST_NUMBER = $APPVEYOR_PULL_REQUEST_NUMBER"
Expand All @@ -79,33 +76,42 @@ git clone https://github.com/ocaml/ocaml.git --branch $OCAMLBRANCH${OCAMLREV:+.}

cd ocaml

if [[ $OCAMLBRANCH = trunk ]]; then
OCAMLBRANCH="$(sed -ne '1s/\([^.]*\.[^.]*\).*/\1/p' VERSION)"
echo "trunk VERSION is $OCAMLBRANCH"
fi
case "$OCAMLBRANCH" in
trunk|[0-9].[0-9])
if [ "$OCAMLBRANCH" = 'trunk' ]; then
OCAML_RELEASE="$(sed -ne '1s/\([^.]*\.[^.]*\).*/\1/p' VERSION)"
echo "trunk VERSION is $OCAML_RELEASE"
else
OCAML_RELEASE="$OCAMLBRANCH"
fi
OCAML_RELEASE="${OCAML_RELEASE%.*}0${OCAML_RELEASE#*.}";;
[0-9].[0-9][0-9])
OCAML_RELEASE="${OCAMLBRANCH/./}";;
*) echo "Unsupported OCAMLBRANCH: $OCAMLBRANCH"; exit 1;;
esac

MAKEOCAML=make
CONFIG_DIR=config
GRAPHICS_DISABLE=
HEADER_DIR=
FLEXDLL_BOOTSTRAP_WORKS=1

case $OCAMLBRANCH in
3.11|3.12|4.00|4.01|4.02|4.03|4.04)
case $OCAML_RELEASE in
311|312|400|401|402|403|404)
MAKEOCAML="make -f Makefile.nt"
HEADER_DIR=config;;
4.05)
405)
HEADER_DIR=config;;
4.06|4.07)
406|407)
HEADER_DIR=byterun/caml;;
4.08)
408)
GRAPHICS_DISABLE=--disable-graph-lib
FLEXDLL_BOOTSTRAP_WORKS=0;;
4.09|4.10|4.11|4.12)
409|410|411|412)
FLEXDLL_BOOTSTRAP_WORKS=0;;
esac

if [ $OCAMLBRANCH = "4.03" ] ; then
if [ $OCAML_RELEASE -eq 403 ] ; then
sed -i -e "s/:=.*/:=/" config/Makefile.msvc64
fi

Expand All @@ -120,7 +126,7 @@ if [ ! -f $OCAMLROOT/STAMP ] || [ "$(git rev-parse HEAD)" != "$(cat $OCAMLROOT/S

configure_ocaml

if [ ${OCAMLBRANCH/./} -lt 403 ] ; then
if [ $OCAML_RELEASE -lt 403 ] ; then
mkdir -p /cygdrive/c/flexdll
mv "$APPVEYOR_BUILD_FOLDER/flexdll.zip" /cygdrive/c/flexdll
pushd /cygdrive/c/flexdll
Expand Down Expand Up @@ -171,7 +177,7 @@ pushd $APPVEYOR_BUILD_FOLDER

run "make flexlink.exe" make MSVC_DETECT=0 flexlink.exe

CHAINS="mingw mingw64 cygwin cygwin64 msvc msvc64"
CHAINS="mingw mingw64 cygwin64 msvc msvc64"

for CHAIN in $CHAINS; do
run "make build_$CHAIN" make build_$CHAIN
Expand All @@ -197,7 +203,7 @@ fi
if [ "$ARTEFACTS" = 'yes' ] ; then
pushd "$APPVEYOR_BUILD_FOLDER" &> /dev/null

make package_bin installer
make CHAINS="$CHAINS" package_bin installer
SUFFIX="$(git describe)"
VERSION="$(sed -ne 's/^VERSION *= *//p' Makefile)"
if [ "$SUFFIX" != "$VERSION" ] ; then
Expand Down

0 comments on commit 0be0cf0

Please sign in to comment.