summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild18
1 files changed, 16 insertions, 2 deletions
diff --git a/build b/build
index 0b16f5c..6bdaa7a 100755
--- a/build
+++ b/build
@@ -4,13 +4,27 @@ CFLAGS = -g -O2
configure:
# Generate the main makefile.
+ # Use (optionally sysroot-prefixed) multiarch library search directories.
# Use shared BFD and opcodes libraries for all utilities.
# Don't enable multilib (multiarch is better).
# Enable plugins.
# Don't expect to find Gettext.
for target in $$(cat ../targets); do \
- CFLAGS='$(CFLAGS)' oh-autoconfigure \
- -B "build-$${target}" -t "$${target}" -- \
+ if [ -n '$(OPK_SYSROOT)' ]; then \
+ LIB_PATH="=/usr/local/lib/$${target}:=/usr/local/lib"; \
+ LIB_PATH="$${LIB_PATH}:=/lib/$${target}:=/lib"; \
+ LIB_PATH="$${LIB_PATH}:=/usr/lib/$${target}:=/usr/lib"; \
+ elif [ '$(OPK_HOST_ARCH)' = "$${target}" ]; then \
+ LIB_PATH="/usr/local/lib/$${target}:/usr/local/lib"; \
+ LIB_PATH="$${LIB_PATH}:/lib/$${target}:/lib"; \
+ LIB_PATH="$${LIB_PATH}:/usr/lib/$${target}:/usr/lib"; \
+ else \
+ LIB_PATH="/usr/local/lib/$${target}"; \
+ LIB_PATH="$${LIB_PATH}:/lib/$${target}"; \
+ LIB_PATH="$${LIB_PATH}:/usr/lib/$${target}"; \
+ fi; \
+ CFLAGS='$(CFLAGS)' host_configargs="--with-lib-path=$${LIB_PATH}" \
+ oh-autoconfigure -B "build-$${target}" -t "$${target}" -- \
$$([ -n "$${OPK_SYSROOT}" ] && \
printf "--with-sysroot='%s'" "$${OPK_SYSROOT}") \
--program-transform-name="s&^&$${target}-&" \