Skip to content
This repository was archived by the owner on Oct 18, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ env:
- OCAML_VERSION=4.05
- OCAML_VERSION=4.06
- OCAML_VERSION=4.07
- OCAML_VERSION=4.08
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v3.3.1 (2019-06-25)

* Fix CFLAGS generation with repeated spaces on Linux (#210 @TheLortex)
* Add support for 4.08 final release (continued from #206 by @avsm)

## v3.3.0 (2019-02-16)

Expand Down
28 changes: 17 additions & 11 deletions xen-ocaml/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,44 +105,50 @@ case $OCAMLOPT_VERSION in
echo Applying OCaml 4.08.0 config
cp config/version-4080.h ocaml-src/runtime/caml/version.h
S_H_LOCATION="ocaml-src/runtime/caml/"
BIGARRAY_OBJ="mmap.o mmap_ba.o"
BIGARRAY_OBJ=""
CFLAGS="-D__ANDROID__ $CFLAGS"
CONFIGURE_OPTS="--disable-vmthreads --disable-systhreads --disable-graph-lib --disable-str-lib --disable-unix-lib --disable-ocamldoc"
;;
*)
echo unsupported OCaml version $OCAMLOPT_VERSION
exit 1
;;
esac

cd ocaml-src && ./configure && cd ..
cd ocaml-src && ./configure ${CONFIGURE_OPTS} && cd ..
cp config/s.h $S_H_LOCATION

cd ocaml-src

# cd byterun && make BYTECCCOMPOPTS="${CFLAGS}" BYTECCCOMPOPTS="${CFLAGS}" libcamlrun.a && cd ..

case $OCAMLOPT_VERSION in
4.04.2|4.05.*)
cd asmrun && make -j${NJOBS} UNIX_OR_WIN32=unix NATIVECCCOMPOPTS="-DNATIVE_CODE ${CFLAGS}" NATIVECCPROFOPTS="-DNATIVE_CODE ${CFLAGS}" libasmrun.a && cd ..
IS_408_OR_MORE=0
;;
4.06.*|4.07.*)
cd asmrun && make -j${NJOBS} UNIX_OR_WIN32=unix CPPFLAGS="-DNATIVE_CODE ${CFLAGS} -I../byterun -DTARGET_${TARGET_ARCH}" NATIVECCPROFOPTS="-DNATIVE_CODE ${CFLAGS}" libasmrun.a && cd ..
IS_408_OR_MORE=0
;;
4.08.*)
cd runtime && make -j${NJOBS} UNIX_OR_WIN32=unix CPPFLAGS="-DNATIVE_CODE ${CFLAGS} -DTARGET_${TARGET_ARCH}" NATIVECCPROFOPTS="-DNATIVE_CODE ${CFLAGS}" libasmrun.a && cd ..
cd runtime && make -j${NJOBS} UNIX_OR_WIN32=unix OC_NATIVE_CPPFLAGS="-DNATIVE_CODE -DXXXX=1 ${CFLAGS} -DTARGET_${TARGET_ARCH}" libasmrun.a && cd ..
IS_408_OR_MORE=1
;;
*)
echo unsupported OCaml version $OCAMLOPT_VERSION
exit 1
;;
esac
# This directory doesn't really exist on 4.08, but it's also unneeded, so it's
# effectively harmless to leave it here.
CFLAGS="$CFLAGS -I../../byterun"
cd otherlibs/bigarray && make CFLAGS="${CFLAGS} -I../unix -DIN_OCAML_BIGARRAY" ${BIGARRAY_OBJ}
ar rcs ../../libxenotherlibs.a ${BIGARRAY_OBJ}

cd ../../..
if [ $IS_408_OR_MORE -eq 0 ]; then
CFLAGS="$CFLAGS -I../../byterun"
cd otherlibs/bigarray && make CFLAGS="${CFLAGS} -I../unix -DIN_OCAML_BIGARRAY" ${BIGARRAY_OBJ}
ar rcs ../../libxenotherlibs.a ${BIGARRAY_OBJ}
cd ../..
else
ar rcs libxenotherlibs.a
fi

cd ..

echo "($(cat flags/libs.tmp) -cclib \"$(pkg-config libminios-xen openlibm --libs | xargs)\")" > flags/libs
echo "($(pkg-config libminios-xen openlibm --cflags | xargs) $(cat flags/cflags.tmp))" > flags/cflags