diff options
Diffstat (limited to 'build')
-rwxr-xr-x | build | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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}-&" \ |