|
root / lang / dune / build.sh
build.sh Bash 30 lines 712 B
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/zsh
# Build script for dune on Hammerhead
#
# illumos patches (readdir d_type, winsize, wait4) applied via [patches]
set -e
cd "$SRCDIR"

# Ensure OCaml is in PATH
export PATH="$PREFIX/bin:$PATH"

# Force 64-bit compilation
export CC="gcc -m64"
export CXX="g++ -m64"
export CFLAGS="-m64"
export CXXFLAGS="-m64"
export LDFLAGS="-m64 $LDFLAGS"

# libatomic is at /usr/lib (hammerhead BSD layout)
export LD_LIBRARY_PATH="/usr/lib:${LD_LIBRARY_PATH:-}"
export LIBRARY_PATH="/usr/lib:${LIBRARY_PATH:-}"

# Bootstrap dune (creates _boot/dune.exe)
ocaml boot/bootstrap.ml

# Build dune for release (packager mode)
gmake release

# Install dune to package directory
gmake install PREFIX=$PREFIX DESTDIR="$PKGDIR"