-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·60 lines (51 loc) · 2.02 KB
/
configure
File metadata and controls
executable file
·60 lines (51 loc) · 2.02 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
set -ex
# Setup parallel compilation if MAKEFLAGS not already set
cd "$(dirname "$0")"
if [ -z "${MAKEFLAGS}" ]; then
makeflags_value=$(Rscript scripts/setup-makeflags.R 2>/dev/null || echo "")
if [ -n "${makeflags_value}" ]; then
export MAKEFLAGS="${makeflags_value}"
echo "Setting MAKEFLAGS=${makeflags_value} for parallel compilation"
echo "Set NOT_CRAN or MAKEFLAGS to override"
fi
else
echo "MAKEFLAGS already set to: ${MAKEFLAGS}"
fi
cd "$(dirname "$0")/src"
# Not used on Linux, for completeness.
echo DUCKDB_RSTRTMGR=1 > Makevars.rstrtmgr
echo DUCKDB_RSTRTMGR_LIB= >> Makevars.rstrtmgr
# The purpose of this is to avoid rebuilding duckdb in every CI/CD run.
# We set the DUCKDB_R_PREBUILT_ARCHIVE environment variable to a file path
# that contains a .tar of all object files.
# This .tar file is cached and restored in CI/CD, keyed by compiler, OS,
# and hash of the duckdb/src subtree.
#
# Depending on the availability of the file, we either use the object files
# (via the rules in include/from-tar.mk), or create them as usual
# (via include/to-tar.mk). In the latter case, if the DUCKDB_R_PREBUILT_ARCHIVE
# environment variable is set, the .tar file is created.
#
# For local installations, this is typically not needed
# because ccache achieves the same purpose but better.
# In CI/CD, this approach gives better results than ccache.
#
# This logic is identical for Windows or non-Windows builds,
# only that we need to-tar-win.mk instead of to-tar.mk on Windows.
if [ -f "${DUCKDB_R_PREBUILT_ARCHIVE}" ] && tar -xm -f "${DUCKDB_R_PREBUILT_ARCHIVE}"; then
cp include/from-tar.mk Makevars.duckdb
else
cp include/to-tar.mk Makevars.duckdb
fi
# The duckdb sources are xz-compressed in the tarball to keep it under 5000000 bytes.
# This happens in the cleanup script.
if [ -f duckdb.tar.xz ]; then
# Use gtar if available (e.g., on macOS via Homebrew), otherwise tar.
if command -v gtar >/dev/null 2>&1 && command -v xz >/dev/null 2>&1; then
TAR=gtar
else
TAR=tar
fi
$TAR xJf duckdb.tar.xz
fi