From bcc1d7910f668b76c53606df892b27b39522fdaa Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 07 Nov 2012 20:00:42 -0500 Subject: Merge branch 'feature/build-sys-arches'. --- (limited to 'lib') 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() -- cgit v0.9.1