summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-11-11 15:09:06 (EST)
committer P. J. McDermott <pjm@nac.net>2012-11-11 15:11:02 (EST)
commit3ab308442fb42269d6b6b30427c8b6773ae23739 (patch)
treefb257a342ace0d93349448f6f685895c30364270 /build
parent50e3241ddfd637d031178b5fad8e48715cff1b2b (diff)
We don't need no stinkin' patch for the lib path.
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}-&" \