summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.in4
-rw-r--r--lib/buildsystem.sh18
-rw-r--r--lib/buildsystem/autoconf.sh23
3 files changed, 41 insertions, 4 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 5c2a6f9..f52a0b3 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -27,12 +27,14 @@ datadir = @datadir@
localedir = @localedir@
libopkhelper = @libopkhelper@
libopkbuild_1 = @libopkbuild_1@
+archtab = @archtab@
sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\
s&@@PACKAGE_VERSION@@&$(package_version)&;\
s&@@LOCALEDIR@@&$(localedir)&;\
s&@@LIBOPKHELPER@@&$(libopkhelper)&;\
- s&@@LIBOPKBUILD_1@@&$(libopkbuild_1)&;
+ s&@@LIBOPKBUILD_1@@&$(libopkbuild_1)&;\
+ s&@@ARCHTAB@@&$(archtab)&;
.SUFFIXES:
.SUFFIXES: .sh .sm
diff --git a/lib/buildsystem.sh b/lib/buildsystem.sh
index 7cf70f5..0f9b8b0 100644
--- a/lib/buildsystem.sh
+++ b/lib/buildsystem.sh
@@ -66,6 +66,9 @@ oh_set_buildsystem_option()
'build-system')
_OH_BUILDSYSTEM_SYSTEM="${_ohsbso_value}"
;;
+ 'target-arch')
+ _OH_BUILDSYSTEM_TARGET_ARCH="${_ohsbso_value}"
+ ;;
*)
_oh_return 125
return ${?}
@@ -106,3 +109,18 @@ oh_buildsystem_do()
: error
fi
}
+
+oh_buildsystem_arch()
+{
+ _oh_local _ohbsa_arch _ohbsa_system
+
+ if [ ${#} -eq 2 ]; then
+ _ohbsa_arch="${1}"
+ _ohbsa_system="${2}"
+ else
+ _oh_return 125
+ return ${?}
+ fi
+
+ cat '@@ARCHTAB@@/'"${_ohbsa_arch}/${_ohbsa_system}"
+}
diff --git a/lib/buildsystem/autoconf.sh b/lib/buildsystem/autoconf.sh
index 13370ae..a1ae3ea 100644
--- a/lib/buildsystem/autoconf.sh
+++ b/lib/buildsystem/autoconf.sh
@@ -27,9 +27,25 @@ _oh_autoconf_can_configure()
_oh_autoconf_configure()
{
+ _oh_local _ohbsbac_arch_opts
+
mkdir -p "${_OH_BUILDSYSTEM_BUILD_DIR}"
cd "${_OH_BUILDSYSTEM_BUILD_DIR}"
+ _ohbsbac_arch_opts="
+ --build='$(oh_buildsystem_arch "${OPK_BUILD_ARCH}" 'autoconf')'
+ "
+ if [ "${OPK_BUILD_ARCH}" != "${OPK_HOST_ARCH}" ]; then
+ _ohbsbac_arch_opts="${_ohbsbac_arch_opts}
+ --host='$(oh_buildsystem_arch \
+ "${OPK_HOST_ARCH}" 'autoconf')'"
+ fi
+ if [ -n "${_OH_BUILDSYSTEM_TARGET_ARCH}" ]; then
+ _ohbsbac_arch_opts="${_ohbsbac_arch_opts}
+ --target='$(oh_buildsystem_arch \
+ "${_OH_BUILDSYSTEM_TARGET_ARCH}" 'autoconf')'"
+ fi
+
"${_OH_BUILDSYSTEM_SOURCE_DIR}/configure" \
--prefix='/usr' \
--bindir='${prefix}/bin' \
@@ -41,14 +57,15 @@ _oh_autoconf_configure()
--includedir='${prefix}/include' \
--infodir='${prefix}/share/info' \
--mandir='${prefix}/share/man' \
- --build="${OPK_BUILD_ARCH_GNU}" \
- $([ "${OPK_BUILD_ARCH}" != "${OPK_HOST_ARCH}" ] && \
- printf '%s' "--host=${OPK_HOST_ARCH_GNU}") \
+ ${_ohbsbac_arch_opts}
--disable-maintainer-mode \
--disable-dependency-tracking \
"${@}"
cd "${_OH_BUILDSYSTEM_WORK_AREA}"
+
+ _oh_return 0
+ return ${?}
}
_oh_autoconf_can_build()