#!/bin/bash
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#

# nacl-glibc-compat-0.1.sh
#
# usage: nacl-glibc-compat-0.1.sh
#
# this script builds glibc comaptibility for Native Client 
#

readonly PACKAGE_NAME=glibc-compat-0.1

readonly LIB_ROOT=`pwd`
readonly LIB_GLIBC_COMPAT=libglibc-compat.a

source pkg_info
source ../../build_tools/common.sh

CustomExtractStep() {
  ChangeDir ${NACL_PACKAGES_REPOSITORY}
  mkdir -p ${PACKAGE_NAME}
  cp -r ${LIB_ROOT}/* ${PACKAGE_NAME}
}

CustomConfigureStep() {
  Banner "Configuring ${PACKAGE_NAME}"
  # export the nacl tools
  export CC=${NACLCC}
  export CXX=${NACLCXX}
  export AR=${NACLAR}
  ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}
}

CustomInstallStep() {
  Remove ${NACLPORTS_LIBDIR}/${LIB_GLIBC_COMPAT}
  Remove ${NACLPORTS_INCLUDE}/glibc-compat
  install -m 644 out/${LIB_GLIBC_COMPAT} ${NACLPORTS_LIBDIR}/${LIB_GLIBC_COMPAT}
  cp -r include ${NACLPORTS_INCLUDE}/glibc-compat
}

CustomPackageInstall() {
  DefaultPreInstallStep
  CustomExtractStep
  CustomConfigureStep
  DefaultBuildStep
  CustomInstallStep
  DefaultCleanUpStep
}

CustomPackageInstall

#!/bin/bash
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

readonly PACKAGE_NAME=glibc-compat-0.1
readonly LIB_ROOT=`pwd`
readonly LIB_GLIBC_COMPAT=libglibc-compat.a

source ../../build_tools/common.sh

CustomExtractStep() {
  ChangeDir ${NACL_PACKAGES_REPOSITORY}
  mkdir -p ${PACKAGE_NAME}
  cp -r ${LIB_ROOT}/* ${PACKAGE_NAME}
}

CustomConfigureStep() {
  Banner "Configuring ${PACKAGE_NAME}"
  # export the nacl tools
  export CC=${NACLCC}
  export CXX=${NACLCXX}
  export AR=${NACLAR}
  ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME}
}

CustomInstallStep() {
  Remove ${NACLPORTS_LIBDIR}/${LIB_GLIBC_COMPAT}
  Remove ${NACLPORTS_INCLUDE}/glibc-compat
  install -m 644 out/${LIB_GLIBC_COMPAT} ${NACLPORTS_LIBDIR}/${LIB_GLIBC_COMPAT}
  cp -r include ${NACLPORTS_INCLUDE}/glibc-compat
}

CustomPackageInstall() {
  DefaultPreInstallStep
  CustomExtractStep
  CustomConfigureStep
  DefaultBuildStep
  CustomInstallStep
  DefaultCleanUpStep
}

CustomPackageInstall

Fix warning in glibc-compat build
Fix warning in glibc-compat build

R=binji@chromium.org
BUG=

Review URL: https://codereview.chromium.org/16562007

git-svn-id: 84b3587ce119b778414dcb50e18b7479aacf4f1d@780 7dad1e8b-422e-d2af-fbf5-8013b78bd812
