diff options
author | Dan Albert <danalbert@google.com> | 2015-12-18 21:01:38 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-12-18 21:01:38 +0000 |
commit | 72e4c0d858821923ac145c3bdba94e2f272a3c0b (patch) | |
tree | 1c00526d494a677c1e788ca5363156f5d93be308 | |
parent | 25e976060c404785a3724be865d21e3f6019e6c8 (diff) | |
parent | 5489a0690d460a9976c8d143a0b937c88fc62654 (diff) | |
download | ndk-72e4c0d858821923ac145c3bdba94e2f272a3c0b.tar.gz |
Merge "Remove some unused bits."
am: 5489a0690d
* commit '5489a0690d460a9976c8d143a0b937c88fc62654':
Remove some unused bits.
-rwxr-xr-x | build/tools/build-support.sh | 315 | ||||
-rw-r--r-- | build/tools/ndk-common.sh | 44 | ||||
-rwxr-xr-x | tests/check-release.sh | 158 |
3 files changed, 0 insertions, 517 deletions
diff --git a/build/tools/build-support.sh b/build/tools/build-support.sh deleted file mode 100755 index dc7577799..000000000 --- a/build/tools/build-support.sh +++ /dev/null @@ -1,315 +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. - -# include common function and variable definitions -. `dirname $0`/prebuilt-common.sh -. `dirname $0`/builder-funcs.sh - -PROGRAM_PARAMETERS="" - -PROGRAM_DESCRIPTION=\ -"Rebuild android support library for the Android NDK. - -This requires a temporary NDK installation containing -toolchain binaries for all target architectures. - -By default, this will try with the current NDK directory, unless -you use the --ndk-dir=<path> option. - -The output will be placed in appropriate sub-directories of -<ndk>/$SUPPORT_SUBDIR, but you can override this with the --out-dir=<path> -option. -" - -PACKAGE_DIR= -register_var_option "--package-dir=<path>" PACKAGE_DIR "Put prebuilt tarballs into <path>." - -NDK_DIR= -register_var_option "--ndk-dir=<path>" NDK_DIR "Specify NDK root path for the build." - -BUILD_DIR= -OPTION_BUILD_DIR= -register_var_option "--build-dir=<path>" OPTION_BUILD_DIR "Specify temporary build dir." - -OUT_DIR= -register_var_option "--out-dir=<path>" OUT_DIR "Specify output directory directly." - -ABIS="$PREBUILT_ABIS" -register_var_option "--abis=<list>" ABIS "Specify list of target ABIs." - -NO_MAKEFILE= -register_var_option "--no-makefile" NO_MAKEFILE "Do not use makefile to speed-up build" - -GCC_VERSION= -register_var_option "--gcc-version=<ver>" GCC_VERSION "Specify GCC version" - -LLVM_VERSION= -register_var_option "--llvm-version=<ver>" LLVM_VERSION "Specify LLVM version" - -register_jobs_option - -extract_parameters "$@" - -ABIS=$(commas_to_spaces $ABIS) - -# Handle NDK_DIR -if [ -z "$NDK_DIR" ] ; then - NDK_DIR=$ANDROID_NDK_ROOT - log "Auto-config: --ndk-dir=$NDK_DIR" -else - if [ ! -d "$NDK_DIR" ] ; then - echo "ERROR: NDK directory does not exists: $NDK_DIR" - exit 1 - fi -fi - -if [ -z "$OPTION_BUILD_DIR" ]; then - BUILD_DIR=$NDK_TMPDIR/build-support -else - BUILD_DIR=$OPTION_BUILD_DIR -fi -rm -rf "$BUILD_DIR" -mkdir -p "$BUILD_DIR" -fail_panic "Could not create build directory: $BUILD_DIR" - -# Compiler flags we want to use -SUPPORT_CFLAGS="-fPIC -O2 -DANDROID -D__ANDROID__ -ffunction-sections -std=c99" -SUPPORT_CFLAGS=$SUPPORT_CFLAGS" -I$SUPPORT_SUBDIR/include" -SUPPORT_LDFLAGS="" - -# android/support files for libc++ -SUPPORT32_SOURCES=\ -"src/locale_support.c \ -src/math_support.c \ -src/stdlib_support.c \ -src/wchar_support.c \ -src/locale/duplocale.c \ -src/locale/freelocale.c \ -src/locale/localeconv.c \ -src/locale/newlocale.c \ -src/locale/uselocale.c \ -src/stdio/stdio_impl.c \ -src/stdio/strtod.c \ -src/stdio/vfprintf.c \ -src/stdio/vfwprintf.c \ -src/msun/e_log2.c \ -src/msun/e_log2f.c \ -src/msun/s_nan.c \ -src/musl-multibyte/btowc.c \ -src/musl-multibyte/internal.c \ -src/musl-multibyte/mblen.c \ -src/musl-multibyte/mbrlen.c \ -src/musl-multibyte/mbrtowc.c \ -src/musl-multibyte/mbsinit.c \ -src/musl-multibyte/mbsnrtowcs.c \ -src/musl-multibyte/mbsrtowcs.c \ -src/musl-multibyte/mbstowcs.c \ -src/musl-multibyte/mbtowc.c \ -src/musl-multibyte/wcrtomb.c \ -src/musl-multibyte/wcsnrtombs.c \ -src/musl-multibyte/wcsrtombs.c \ -src/musl-multibyte/wcstombs.c \ -src/musl-multibyte/wctob.c \ -src/musl-multibyte/wctomb.c \ -src/musl-ctype/iswalnum.c \ -src/musl-ctype/iswalpha.c \ -src/musl-ctype/iswblank.c \ -src/musl-ctype/iswcntrl.c \ -src/musl-ctype/iswctype.c \ -src/musl-ctype/iswdigit.c \ -src/musl-ctype/iswgraph.c \ -src/musl-ctype/iswlower.c \ -src/musl-ctype/iswprint.c \ -src/musl-ctype/iswpunct.c \ -src/musl-ctype/iswspace.c \ -src/musl-ctype/iswupper.c \ -src/musl-ctype/iswxdigit.c \ -src/musl-ctype/isxdigit.c \ -src/musl-ctype/towctrans.c \ -src/musl-ctype/wcswidth.c \ -src/musl-ctype/wctrans.c \ -src/musl-ctype/wcwidth.c \ -src/musl-locale/catclose.c \ -src/musl-locale/catgets.c \ -src/musl-locale/catopen.c \ -src/musl-locale/iconv.c \ -src/musl-locale/intl.c \ -src/musl-locale/isalnum_l.c \ -src/musl-locale/isalpha_l.c \ -src/musl-locale/isblank_l.c \ -src/musl-locale/iscntrl_l.c \ -src/musl-locale/isdigit_l.c \ -src/musl-locale/isgraph_l.c \ -src/musl-locale/islower_l.c \ -src/musl-locale/isprint_l.c \ -src/musl-locale/ispunct_l.c \ -src/musl-locale/isspace_l.c \ -src/musl-locale/isupper_l.c \ -src/musl-locale/iswalnum_l.c \ -src/musl-locale/iswalpha_l.c \ -src/musl-locale/iswblank_l.c \ -src/musl-locale/iswcntrl_l.c \ -src/musl-locale/iswctype_l.c \ -src/musl-locale/iswdigit_l.c \ -src/musl-locale/iswgraph_l.c \ -src/musl-locale/iswlower_l.c \ -src/musl-locale/iswprint_l.c \ -src/musl-locale/iswpunct_l.c \ -src/musl-locale/iswspace_l.c \ -src/musl-locale/iswupper_l.c \ -src/musl-locale/iswxdigit_l.c \ -src/musl-locale/isxdigit_l.c \ -src/musl-locale/langinfo.c \ -src/musl-locale/strcasecmp_l.c \ -src/musl-locale/strcoll.c \ -src/musl-locale/strerror_l.c \ -src/musl-locale/strfmon.c \ -src/musl-locale/strftime_l.c \ -src/musl-locale/strncasecmp_l.c \ -src/musl-locale/strxfrm.c \ -src/musl-locale/tolower_l.c \ -src/musl-locale/toupper_l.c \ -src/musl-locale/towctrans_l.c \ -src/musl-locale/towlower_l.c \ -src/musl-locale/towupper_l.c \ -src/musl-locale/wcscoll.c \ -src/musl-locale/wcsxfrm.c \ -src/musl-locale/wctrans_l.c \ -src/musl-locale/wctype_l.c \ -src/musl-math/frexpf.c \ -src/musl-math/frexpl.c \ -src/musl-math/frexp.c \ -src/musl-stdio/swprintf.c \ -src/musl-stdio/vwprintf.c \ -src/musl-stdio/wprintf.c \ -src/musl-stdio/printf.c \ -src/musl-stdio/snprintf.c \ -src/musl-stdio/sprintf.c \ -src/musl-stdio/vprintf.c \ -src/musl-stdio/vsprintf.c \ -src/wcstox/intscan.c \ -src/wcstox/floatscan.c \ -src/wcstox/shgetc.c \ -src/wcstox/wcstod.c \ -src/wcstox/wcstol.c \ -" -# Replaces broken implementations in x86 libm.so -SUPPORT32_SOURCES_x86=\ -"src/musl-math/scalbln.c \ -src/musl-math/scalblnf.c \ -src/musl-math/scalblnl.c \ -src/musl-math/scalbnl.c \ -" - -# android/support files for libc++ -SUPPORT64_SOURCES=\ -"src/musl-locale/catclose.c \ -src/musl-locale/catgets.c \ -src/musl-locale/catopen.c \ -" - -# If the --no-makefile flag is not used, we're going to put all build -# commands in a temporary Makefile that we will be able to invoke with -# -j$NUM_JOBS to build stuff in parallel. -# -if [ -z "$NO_MAKEFILE" ]; then - MAKEFILE=$BUILD_DIR/Makefile -else - MAKEFILE= -fi - -# build_support_libs_for_abi -# $1: ABI -# $2: build directory -# $3: (optional) installation directory -build_support_libs_for_abi () -{ - local ARCH BINPREFIX - local ABI=$1 - local BUILDDIR="$2" - local DSTDIR="$3" - local GCCVER - - mkdir -p "$BUILDDIR" - - # If the output directory is not specified, use default location - if [ -z "$DSTDIR" ]; then - DSTDIR=$NDK_DIR/$SUPPORT_SUBDIR/libs/$ABI - fi - - mkdir -p "$DSTDIR" - ARCH=$(convert_abi_to_arch $ABI) - if [ -n "$GCC_VERSION" ]; then - GCCVER=$GCC_VERSION - else - GCCVER=$(get_default_gcc_version_for_arch $ARCH) - fi - - builder_begin_android $ABI "$BUILDDIR" "$GCCVER" "$LLVM_VERSION" "$MAKEFILE" - builder_set_srcdir "$SUPPORT_SUBDIR" - builder_set_dstdir "$DSTDIR" - - builder_cflags "$SUPPORT_CFLAGS" - - if [ $ABI = "armeabi-v7a-hard" ]; then - builder_cflags "-mhard-float -D_NDK_MATH_NO_SOFTFP=1" - fi - - builder_ldflags "$SUPPORT_LDFLAGS" - if [ $ABI = "armeabi-v7a-hard" ]; then - builder_cflags "-Wl,--no-warn-mismatch -lm_hard" - fi - - if [ "$ABI" = "${ABI%%64*}" ]; then - if [ "$ABI" = "x86" ]; then - builder_sources $SUPPORT32_SOURCES $SUPPORT32_SOURCES_x86 - else - builder_sources $SUPPORT32_SOURCES - fi - else - builder_sources $SUPPORT64_SOURCES - fi - - log "Building $DSTDIR/libandroid_support.a" - builder_static_library libandroid_support - - builder_end -} - -for ABI in $ABIS; do - build_support_libs_for_abi $ABI "$BUILD_DIR/$ABI" "$OUT_DIR" -done - -# If needed, package files into tarballs -if [ -n "$PACKAGE_DIR" ] ; then - for ABI in $ABIS; do - FILES="$SUPPORT_SUBDIR/libs/$ABI/libandroid_support.a" - PACKAGE="$PACKAGE_DIR/support-libs-$ABI.tar.bz2" - log "Packaging: $PACKAGE" - pack_archive "$PACKAGE" "$NDK_DIR" "$FILES" - fail_panic "Could not package $ABI support binary!" - dump "Packaging: $PACKAGE" - done -fi - -if [ -z "$OPTION_BUILD_DIR" ]; then - log "Cleaning up..." - rm -rf $BUILD_DIR -else - log "Don't forget to cleanup: $BUILD_DIR" -fi - -log "Done!" diff --git a/build/tools/ndk-common.sh b/build/tools/ndk-common.sh index 66d44d9a2..27f131558 100644 --- a/build/tools/ndk-common.sh +++ b/build/tools/ndk-common.sh @@ -702,50 +702,6 @@ relpath () echo "$relative" } -# Unpack a given archive -# -# $1: archive file path -# $2: optional target directory (current one if omitted) -# -unpack_archive () -{ - local ARCHIVE="$1" - local DIR=${2-.} - local RESULT TARFLAGS ZIPFLAGS - - if [ ! -f $ARCHIVE ]; then - panic "$ARCHIVE does not exist!" - fi - - mkdir -p "$DIR" - TARFLAGS="xpf" - ZIPFLAGS="q" - case "$ARCHIVE" in - *.zip) - (cd $DIR && run unzip $ZIPFLAGS "$ARCHIVE") - ;; - *.tar) - run tar $TARFLAGS "$ARCHIVE" -C $DIR - ;; - *.tar.gz) - run tar z$TARFLAGS "$ARCHIVE" -C $DIR - ;; - *.tar.bz2) - find_pbzip2 - if [ -n "$PBZIP2" ] ; then - run tar --use-compress-prog=pbzip2 -$TARFLAGS "$ARCHIVE" -C $DIR - else - run tar j$TARFLAGS "$ARCHIVE" -C $DIR - fi - # remove ._* files by MacOSX to preserve resource forks we don't need - find $DIR -name "\._*" -exec rm {} \; - ;; - *) - panic "Cannot unpack archive with unknown extension: $ARCHIVE" - ;; - esac -} - # Pack a given archive # # $1: archive file path (including extension) diff --git a/tests/check-release.sh b/tests/check-release.sh deleted file mode 100755 index 32d0dc6ee..000000000 --- a/tests/check-release.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2012 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. -# - -# Run a few sanity checks on a given NDK release install/package - -PROGNAME=$(basename "$0") -PROGDIR=$(dirname "$0") - -. "$PROGDIR"/../build/tools/ndk-common.sh - -panic () { - echo "ERROR: $@" >&2 - exit 1 -} - -fail_panic () { - if [ $? != 0 ]; then panic "$@"; fi -} - -# Command-line processing. Please keep this alphabetically sorted. -HELP= -NDK_DIR= -NDK_PACKAGE= -SYSTEM= - -for opt; do - optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` - case $opt in - --help|-h|-?) - HELP=true - ;; - --package=*) - NDK_PACKAGE=$optarg - ;; - --system=*) - SYSTEM=$optarg - ;; - -*) - panic "Unknown option '$opt'. See --help for list of valid ones." - ;; - *) - if [ -z "$NDK_DIR" ]; then - NDK_DIR=$opt - else - panic "Only one parameter (ndk directory) is supported. See --help." - fi - ;; - esac -done - -if [ "$HELP" ]; then - echo "Usage: $PROGNAME [options] [<ndk-install-path>]" - echo "" - echo "This script is used to run a series of sanity checks on a given" - echo "NDK release installation, or alternatively an NDK release package." - echo "" - echo "Valid options:" - echo "" - echo " --help|-h|-? Print this message." - echo " --package=<file> Specify NDK release archive file." - echo " --system=<name> Specify host system type." - echo "" - exit 0 -fi - -if [ -n "$NDK_PACKAGE" ]; then - if [ -n "$NDK_DIR" ]; then - panic "You can't use --package=<file> and a directory path at the same time." - fi - TMP_DIR=/tmp/ndk-$USER/tests/release - mkdir -p $TMP_DIR && rm -rf $TMP_DIR/* - - echo "Unpacking '$(basename $NDK_PACKAGE)' into: $TMP_DIR" - unpack_archive "$NDK_PACKAGE" "$TMP_DIR" - fail_panic "Could not uncompress NDK release package!" - - # Get into the first sub-directory. It should be something like android-ndk-* - NDK_DIR=$(ls -d $TMP_DIR/android-ndk-* | head -1) - if [ -z "$NDK_DIR" ]; then - panic "Could not find uncompressed NDK directory. Please check your package file: $TMP_DIR" - fi -elif [ -z "$NDK_DIR" ]; then - panic "Please specify an NDK installation directory, or use --package=<file> option. See --help." -fi - -FAILURES=0 -COUNT=0 - -# Run a single test, and update failure/count appropriately. -# $1: test function name, without the test_ prefix. -# $2+: test textual abstract description. -do_test () { - local NAME TEXT RET - NAME=$1 - shift - echo -n "test: $@... " - TEXT=$(eval test_$NAME 2>/dev/null) - if [ $? != 0 ]; then - FAILURES=$(( $FAILURES + 1 )) - echo "KO: $TEXT" - else - echo "ok" - fi - COUNT=$(( $COUNT + 1 )) -} - -# There must be a RELEASE file at the top of the NDK -# installation tree. -# -test_RELEASE () { - local RELEASE - - # Check that the RELEASE.TXT file is here - if [ ! -f "$NDK_DIR/RELEASE.TXT" ]; then - echo "Missing RELEASE.TXT file." - return 1 - fi - - # Extract the release version - RELEASE=$(cat $NDK_DIR/RELEASE.TXT) - - # Check that the ChangeLog file documents the release properly - CHANGELOG_RELEASE=$(cat $NDK_DIR/docs/CHANGES.html | grep -e "^android-ndk-" | head -1) - CHANGELOG_RELEASE=${CHANGELOG_RELEASE##android-ndk-} - - if [ "$RELEASE" != "$CHANGELOG_RELEASE" ]; then - echo "CHANGES.html documents release '$CHANGELOG_RELEASE', but RELEASE.TXT contains '$RELEASE'!" - return 1 - fi - - return 0 -} - - -do_test RELEASE "Checking top-level release file" - -echo -n "$FAILURES/$COUNT tests failed." -if [ "$FAILURES" = 0 ]; then - echo "Congratulations!" - exit 0 -else - echo "Please fix the errors!" - exit 1 -fi |