aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-08-24 11:19:26 -0700
committerHaibo Huang <hhb@google.com>2019-08-24 11:19:26 -0700
commit7a28367b72cb1e1667b081d6404afbd063898e70 (patch)
tree5e3e8f9184a6fa1bf0659eeb947a113aadb50465
parent47d0219b276bea1230272e361739ab389b31d080 (diff)
downloadyasm-7a28367b72cb1e1667b081d6404afbd063898e70.tar.gz
Test: build Change-Id: Iaf607ecd75999837512064518298a1afd737810d
-rwxr-xr-xbuild-yasm.sh144
-rwxr-xr-xbuild.py49
2 files changed, 0 insertions, 193 deletions
diff --git a/build-yasm.sh b/build-yasm.sh
deleted file mode 100755
index 60a27bf1..00000000
--- a/build-yasm.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Build the host version of the yasm executable and place it
-# at the right location
-
-PROGDIR=$(dirname $0)
-. $NDK_BUILDTOOLS_PATH/prebuilt-common.sh
-
-PROGRAM_PARAMETERS="<src-dir> <ndk-dir>"
-PROGRAM_DESCRIPTION=\
-"Rebuild yasm tool used by the NDK."
-
-register_try64_option
-register_canadian_option
-register_jobs_option
-
-BUILD_DIR=
-register_var_option "--build-dir=<path>" BUILD_DIR "Set temporary build directory"
-
-PACKAGE_DIR=
-register_var_option "--package-dir=<path>" PACKAGE_DIR "Archive binaries into package directory"
-
-extract_parameters "$@"
-
-set_parameters ()
-{
- SRC_DIR="$1"
- NDK_DIR="$2"
-
- # Check source directory
- #
- if [ -z "$SRC_DIR" ] ; then
- echo "ERROR: Missing source directory parameter. See --help for details."
- exit 1
- fi
-
- if [ ! -d "$SRC_DIR/yasm" ] ; then
- echo "ERROR: Source directory does not contain llvm sources: $SRC_DIR/yasm"
- exit 1
- fi
-
- SRC_DIR=`cd $SRC_DIR; pwd`
- log "Using source directory: $SRC_DIR"
-
- # Check NDK installation directory
- #
- if [ -z "$NDK_DIR" ] ; then
- echo "ERROR: Missing NDK directory parameter. See --help for details."
- exit 1
- fi
-
- if [ ! -d "$NDK_DIR" ] ; then
- mkdir -p $NDK_DIR
- if [ $? != 0 ] ; then
- echo "ERROR: Could not create target NDK installation path: $NDK_DIR"
- exit 1
- fi
- fi
- NDK_DIR=`cd $NDK_DIR; pwd`
- log "Using NDK directory: $NDK_DIR"
-}
-
-set_parameters $PARAMETERS
-
-prepare_abi_configure_build
-prepare_host_build
-
-if [ -z "$BUILD_DIR" ]; then
- panic "--build-dir is required"
-fi
-
-INSTALL_DIR=$BUILD_DIR/install
-BUILD_DIR=$BUILD_DIR/build
-
-rm -rf $BUILD_DIR
-mkdir -p $BUILD_DIR
-
-log "Copying yasm sources to $BUILD_DIR/src"
-mkdir -p "$BUILD_DIR/src" && copy_directory "$SRC_DIR/yasm" "$BUILD_DIR/src"
-fail_panic "Could not copy yasm sources to: $BUILD_DIR/src"
-
-CONFIGURE_FLAGS="--disable-nls --disable-rpath --prefix=$BUILD_DIR/prefix"
-if [ "$MINGW" = "yes" -o "$DARWIN" = "yes" ]; then
- # Required for a proper mingw or darwin cross compile
- CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --host=$ABI_CONFIGURE_HOST"
-fi
-
-prepare_canadian_toolchain $BUILD_DIR
-
-CFLAGS=$HOST_CFLAGS" -O2 -s"
-CFLAGS_FOR_BUILD=$CFLAGS
-export CC CFLAGS CFLAGS_FOR_BUILD
-
-log "Configuring the build"
-cd $BUILD_DIR/src && run ./configure $CONFIGURE_FLAGS --build=$ABI_CONFIGURE_BUILD
-fail_panic "configure failed in $BUILD_DIR/yasm!"
-
-log "Building yasm"
-# build yasm in -j1 to avoid a race condition not well understood at this moment
-# which causes failure with error message reads:
-# perfect.c: Duplicates keys!
-# make: *** [x86insn_nasm.c] Error 1
-# make: *** Waiting for unfinished jobs....
-run make -j1 # -j$NUM_JOBS
-fail_panic "Failed to build the $BUILD_DIR/yasm!"
-
-log "Installing yasm"
-run make install
-fail_panic "Failed to install $BUILD_DIR/yasm!"
-
-run rm -rf $BUILD_DIR/prefix/share
-
-log "Stripping yasm"
-test -z "$STRIP" && STRIP=strip
-find $BUILD_DIR/prefix/bin -maxdepth 1 -type f -exec $STRIP {} \;
-
-log "Copying yasm"
-#run copy_directory "$BUILD_DIR/prefix" "$(get_prebuilt_install_prefix)"
-SUBDIR=$(get_prebuilt_host_exec yasm)
-OUT=$INSTALL_DIR/$SUBDIR
-run mkdir -p $(dirname "$OUT") && cp $BUILD_DIR/prefix/bin/$(get_host_exec_name yasm) $OUT
-fail_panic "Could not copy yasm"
-
-if [ "$PACKAGE_DIR" ]; then
- ARCHIVE=ndk-yasm-$HOST_TAG.tar.bz2
- dump "Packaging: $ARCHIVE"
- mkdir -p "$PACKAGE_DIR" &&
- pack_archive "$PACKAGE_DIR/$ARCHIVE" "$INSTALL_DIR" "$SUBDIR"
- fail_panic "Could not package archive: $PACKAGE_DIR/$ARCHIVE"
-fi
diff --git a/build.py b/build.py
deleted file mode 100755
index e0fc23a3..00000000
--- a/build.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-"""Builds YASM for the NDK."""
-from __future__ import print_function
-
-import os
-import site
-
-site.addsitedir(os.path.join(os.path.dirname(__file__), '../../ndk/build/lib'))
-site.addsitedir(os.path.join(os.path.dirname(__file__), '../../ndk'))
-
-# pylint: disable=import-error,wrong-import-position
-import build_support
-from ndk.hosts import Host
-# pylint: enable=import-error,wrong-import-position
-
-
-def main(args):
- build_cmd = [
- 'bash',
- 'build-yasm.sh',
- build_support.toolchain_path(),
- build_support.ndk_path(),
- '--try-64',
- ]
-
- if args.host.is_windows:
- build_cmd.append('--mingw')
-
- build_cmd.append('--build-dir=' + os.path.join(args.out_dir, 'yasm'))
- build_support.build(build_cmd, args, intermediate_package=True)
-
-
-if __name__ == '__main__':
- build_support.run(main)