Delete repository contents and replace with README.md
BUG= https://bugs.chromium.org/p/naclports/issues/detail?id=241
diff --git a/.clang-format b/.clang-format
deleted file mode 100644
index 6fdf1dc..0000000
--- a/.clang-format
+++ /dev/null
@@ -1,8 +0,0 @@
-# Defines the Chromium style for automatic reformatting.
-# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
-BasedOnStyle: Chromium
-# This defaults to 'Auto'. Explicitly set it for a while, so that
-# 'vector<vector<int> >' in existing files gets formatted to
-# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
-# 'int>>' if the file already contains at least one such instance.)
-Standard: Cpp11
diff --git a/.coveragerc b/.coveragerc
deleted file mode 100644
index 3cf3485..0000000
--- a/.coveragerc
+++ /dev/null
@@ -1,6 +0,0 @@
-[run]
-omit = *_test.py,*/tests/*.py,out/*
-data_file = out/coverage
-
-[html]
-directory = out/coverage_html
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 825ad2c..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# DEPS
-/third_party/
-/native_client/
-/node_modules/
-
-webports.lock
-*.pyc
-*~
-/out
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index e959c7c..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "third_party/hterm/src"]
- path = third_party/hterm/src
- url = http://chromium.googlesource.com/apps/libapps.git
diff --git a/.jshintignore b/.jshintignore
deleted file mode 100644
index 8f8b968..0000000
--- a/.jshintignore
+++ /dev/null
@@ -1 +0,0 @@
-ports/thttpd/json2min.js
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 1ea31f0..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "browser": true,
- "globalstrict": true,
- "sub": true,
- "devel": true,
- "shadow": true,
- "globals": {
- "chrome": true,
- "Promise": true
- }
-}
diff --git a/.jslintrc b/.jslintrc
deleted file mode 100644
index a7b608a..0000000
--- a/.jslintrc
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "browser": true,
- "indent": 2,
- "vars": true,
- "evil": true,
- "bitwise": true,
- "unparam": true,
- "laxbreak": true,
- "nomen": true,
- "white": true,
- "unused": true,
- "plusplus": true,
- "predef": "chrome,PipeServer,Blob,lib,NaClProcessManager,hterm,NaClTerm",
- "todo": true
-}
diff --git a/.pylintrc b/.pylintrc
deleted file mode 100644
index 2648aac..0000000
--- a/.pylintrc
+++ /dev/null
@@ -1,10 +0,0 @@
-[MESSAGES CONTROL]
-disable=invalid-name,no-member,missing-docstring,unused-argument,fixme,bad-continuation,global-statement,too-many-branches,too-few-public-methods,too-many-public-methods,star-args,duplicate-code,locally-disabled,cell-var-from-loop
-max-args=6
-
-[FORMAT]
-indent-string=' '
-max-line-length=80
-
-[REPORTS]
-reports=no
diff --git a/.style.yapf b/.style.yapf
deleted file mode 100644
index e0f95a6..0000000
--- a/.style.yapf
+++ /dev/null
@@ -1,3 +0,0 @@
-[style]
-split_before_named_assigns = False
-based_on_style = chromium
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index e2b8e98..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,18 +0,0 @@
-# Below is a list of people and organizations that have contributed source
-# code to the Native Client 'webports' project. Names should be added to the
-# list like this:
-#
-# Name/Organization <email address>
-
-Ashish Gaurav <gauravashish07@gmail.com>
-David Benjamin <davidben@mit.edu>
-Deepankar Tyagi <deepankar7tyagi@gmail.com>
-Jiří Daněk <dnk@mail.muni.cz>
-Marat Dukhan <maratek@gmail.com>
-Matthew Turk <matthewturk@gmail.com>
-Richard Diamond <wichard@vitalitystudios.com>
-Yi Sun <ratsunny@gmail.com>
-
-Google Inc. <*@google.com>
-The Chromium Authors <*@chromium.org>
-NVIDIA Corporation <*@nvidia.com>
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 7052684..0000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,136 +0,0 @@
-# Contibuting to webports #
-
-The webports project welcomes contributions. The most common forms of
-contribution are new ports, or updates to existing ports.
-
-Before we can use use your code, you must sign the [Google Individual
-Contributor License Agreement (CLA)][cla], which you can do online. The CLA is
-necessary mainly because you own the copyright to your changes, even after your
-contribution becomes part of our codebase, so we need your permission to use and
-distribute your code. We also need to be sure of various other things—for
-instance that you'll tell us if you know that your code infringes on other
-people's patents. You don't have to sign the CLA until after you've submitted
-your code for review and a member has approved it, but you must do it before we
-can put your code into our codebase. Before you start working on a larger
-contribution, you should get in touch with us first through the issue tracker
-with your idea so that we can help out and possibly guide you. Coordinating up
-front makes it much easier to avoid frustration later on.
-
-Once you have a change that you would like to submit you must upload it for
-review using:
-
-```
-$ git cl upload
-```
-
-This will upload the change to the code review tool. From there you can send it
-out for review via the web interface (you can also do this from the command line
-if you prefer). Once you have an 'lgtm' you can use the commit queue (CQ button
-in the review tool) to have your change submitted.
-
-## Adding a new package ##
-
-To add a package:
-
-1. Add a directory to the `ports` directory using the name your new package.
- For example: `ports/openssl`.
-2. Add the `build.sh` script and `pkg_info` to that directory.
-3. Optionally include the upstream tarball and add its SHA1 checksum to
- `pkg_info`. You can do this using `build_tools/sha1sum.py`. Redirect the
- script to append to the `pkg_info` file. e.g.:
-
-```
-$ sha1sum.py mypkg.tar.gz >> ports/openssl/pkg_info
-```
-
-4. Optionally include a patch file (nacl.patch). See below for the
- recommended way to generate this patch.
-5. Make sure your package builds for all architectures:
-
-```
-$ ./make_all.sh <PACKAGE_NAME>
-```
-
-## Writing build scripts ##
-
-Each port has an optional build script: ``build.sh``. Some ports, such as
-those that are based on autotools+make don't need a build script at all. The
-build script is run in a bash shell, it can set variables at the global scope
-that override the default behaviour of various steps in the build process. The
-most common steps that implement by package-specific scripts are:
-
-- ConfigureStep()
-- BuildStep()
-- InstallStep()
-- TestStep()
-
-When implementing a given step the default step can be still invoked, e.g.
-by calling DefaultBuildStep() from within BuildStep().
-
-Each build is is run independently in a subshell, so variables set in one
-step are not visible in others, and changing the working directory within a
-step will not effect other steps.
-
-A variety of shared variables and functions are available from with the build
-scripts. These are defined in `build_tools/common.sh`.
-
-## Modifying package sources / Working with patches ##
-
-When a package is first built, its source is downloaded and extracted to
-``out/build/<pkg_name>``. A new git repository is then created in this
-folder with the original archive contents on a branch called ``upstream``. The
-optional ``nacl.patch`` file is then applied on the ``master`` branch. This
-means that at any given time you can see the changes from upstream using ``git
-diff upstream``.
-
-To make changes to a package's patch file the recommended workflow is:
-
-1. Directly modify the sources in ``out/build/<pkg_name>``.
-2. Build the package and verify the changes.
-3. Use ``webports updatepatch <pkg_name>`` to (re)generate the patch file.
-
-Whenever the upstream archive or patch file changes and you try to build the
-package you will be prompted to remove the existing repository and start a new
-one. This is to avoid deleting a repository that might contain unsaved changed.
-
-## Coding Style ##
-
-For code that is authored in the webports repository (as opposed to patches)
-we follow the Chromium style guide:
-http://www.chromium.org/developers/coding-style.
-
-C/C++ code can be automatically formatted with Chromium's clang-format:
-https://code.google.com/p/chromium/wiki/ClangFormat. If you have checkout of
-Chromium you can set `CHROMIUM_BUILDTOOLS_PATH=<chromium>/src/buildtools`
-which will enable the `clang-format` script in depot\_tools to find the binary.
-
-Python code can be automatically formatted with the `yapf` tool which is
-automatically downloaded during `gclient sync`. e.g:
-
-```
-$ bin/yapf -i <path/to/my/file.py>
-```
-
-### Shell scripts ###
-
-When modifying any shell scripts in webports it is recommended that you
-run `shellcheck` to catch common errors. The recommended command line
-for this is:
-
-```
-$ shellcheck -e SC2044,SC2129,SC2046,SC2035,SC2034,SC2086,SC2148 \
- `git ls-files "*.sh"`
-```
-
-### Commit Messages ###
-
-Where possible try to follow the generally accepted best practices for git
-commit messages. That is, a single subject line of 50 characters or less
-followed by a blank line, followed by a longer description wrapped at 72
-characters. For more information of crafted good commit messages see:
-http://chris.beams.io/posts/git-commit/
-
-
-Happy porting!
-
-[CLA]: https://developers.google.com/open-source/cla/individual?csw=1
diff --git a/DEPS b/DEPS
deleted file mode 100644
index 0c32704..0000000
--- a/DEPS
+++ /dev/null
@@ -1,34 +0,0 @@
-deps = {
- "src/third_party/libapps":
- "https://chromium.googlesource.com/apps/libapps.git@6e65bd5",
- "src/third_party/zip.js":
- "https://github.com/gildas-lormeau/zip.js.git@4c93974",
- "src/third_party/clang_tools":
- "https://chromium.googlesource.com/chromium/src/tools/clang.git@7aa7166",
-}
-
-deps_os = {
- "win": {
- "src/third_party/cygwin":
- "http://src.chromium.org/svn/trunk/deps/third_party/cygwin@11984",
- "src/native_client/build":
- "http://src.chromium.org/native_client/trunk/src/native_client/build"
- },
-}
-
-hooks = [
- {
- "name": "clean_pyc",
- "pattern": ".",
- "action": [
- "python", "src/build_tools/clean_pyc.py", "src/build_tools", "src/lib"
- ],
- },
- {
- "name": "pip_install",
- "pattern": ".",
- "action": [
- "src/build_tools/pip_install.sh"
- ],
- },
-]
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 1941a11..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2008, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c12fcc6..0000000
--- a/Makefile
+++ /dev/null
@@ -1,92 +0,0 @@
-# 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.
-#
-# Makefile
-#
-# usage: 'make [package]'
-#
-# This makefile can by used to perform common actions such as building
-# all ports, building a give port, running a webserver to test the ports.
-# Each port has a dependency on its own sentinel file, which can be found
-# at out/sentinels/*
-
-PYLINT = build_tools/python_wrapper -m pylint
-NODE ?= nodejs
-JSHINT := $(NODE) node_modules/.bin/jshint
-JSLINT := $(NODE) node_modules/.bin/jslint
-COVERAGE := bin/coverage
-COVERAGE_ARGS := --fail-under=60
-COVERAGE_VER := $(shell $(COVERAGE) --version 2>/dev/null)
-
-ifeq ($(V),1)
-VERBOSE ?= 1
-endif
-
-ifeq ($(F),1)
-FORCE ?= 1
-endif
-
-ifeq ($(V),2)
-VERBOSE ?= 1
-VERBOSE_BUILD ?= 1
-endif
-
-ifeq ($(VERBOSE),1)
-BUILD_FLAGS += -v
-endif
-
-ifeq ($(VERBOSE_BUILD),1)
-BUILD_FLAGS += --verbose-build
-endif
-
-ifeq ($(FORCE),1)
-BUILD_FLAGS += -f
-endif
-
-ifeq ($(FROM_SOURCE),1)
-BUILD_FLAGS += --from-source
-endif
-
-export NACL_ARCH
-export TOOLCHAIN
-
-all:
- bin/webports --all install $(BUILD_FLAGS)
-
-run:
- ./build_tools/httpd.py
-
-clean:
- bin/webports --all clean
-
-reallyclean: clean
- rm -rf $(NACL_OUT)
-
-check: test
-
-JS_FILES := $(shell git ls-files "*.js")
-
-lint: pylint jshint jslint
-
-pylint:
- $(PYLINT) --rcfile=.pylintrc lib/webports lib/webports/tests/*.py
-
-jshint:
- $(JSHINT) $(JS_FILES)
-
-jslint:
- $(JSLINT) build_tools/naclprocess.js build_tools/naclterm.js
-
-test:
- $(COVERAGE) run --include=lib/webports/*,build_tools/* -m nose \
- --rednose build_tools lib
- @rm -rf out/coverage_html
- $(COVERAGE) html
- $(COVERAGE) report $(COVERAGE_ARGS)
-
-%:
- bin/webports install $* $(BUILD_FLAGS)
-
-.PHONY: all run clean sdklibs sdklibs_list reallyclean check test
-.PHONY: lint pylint jshint jslint
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index 42be3f7..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,8889 +0,0 @@
-======================================================================
-repository/ImageMagick-6.5.4-10 is licensed as follows
- (Cf. repository/ImageMagick-6.5.4-10/LICENSE):
-repository64/ImageMagick-6.5.4-10 is licensed as follows
- (Cf. repository64/ImageMagick-6.5.4-10/LICENSE):
-======================================================================
-The authoratitive ImageMagick license can be found at
-http://www.imagemagick.org/script/license.php and ImageMagick notices at
-http://www.imagemagick.org/script/notice.php.
-
-Before we get to the text of the license lets just review what the license says in simple terms:
-
-It allows you to:
-
- * freely download and use ImageMagick software, in whole or in part, for personal, company internal, or commercial purposes;
- * use ImageMagick software in packages or distributions that you create.
-
-It forbids you to:
-
- * redistribute any piece of ImageMagick-originated software without proper attribution;
- * use any marks owned by ImageMagick Studio LLC in any way that might state or imply that ImageMagick Studio LLC endorses your distribution;
- * use any marks owned by ImageMagick Studio LLC in any way that might state or imply that you created the ImageMagick software in question.
-
-It requires you to:
-
- * include a copy of the license in any redistribution you may make that includes ImageMagick software;
- * provide clear attribution to ImageMagick Studio LLC for any distributions that include ImageMagick software.
-
-It does not require you to:
-
- * include the source of the ImageMagick software itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it;
- * submit changes that you make to the software back to the ImageMagick Studio LLC (though such feedback is encouraged).
-
-A few other clarifications include:
- * ImageMagick is freely available without charge;
- * you may include ImageMagick on a CD-ROM as long as you comply with the terms of the license;
- * you can give modified code away for free or sell it under the terms of the ImageMagick license or distribute the result under a different license, but you need to acknowledge the use of the ImageMagick software;
- * the license is compatible with the GPL.
-
-The legally binding and authoritative terms and conditions for use, reproduction, and distribution of ImageMagick follow:
-
-Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available.
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 10 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication intentionally sent to the Licensor by its copyright holder or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
- a. You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
- b. You must cause any modified files to carry prominent notices stating that You changed the files; and
-
- c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
- d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License.
-
-
-APPENDIX: How to apply the ImageMagick License to your work
-
-To apply the ImageMagick License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the ImageMagick License (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.imagemagick.org/script/license.php
-
- 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.
-
-
-
-======================================================================
-repository/ImageMagick-6.5.4-10/www/Magick++ is licensed as follows
- (Cf. repository/ImageMagick-6.5.4-10/www/Magick++/COPYING):
-repository64/ImageMagick-6.5.4-10/www/Magick++ is licensed as follows
- (Cf. repository64/ImageMagick-6.5.4-10/www/Magick++/COPYING):
-======================================================================
-
-Copyright 1999, 2000, 2001 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files ("Magick++"), to deal in Magick++ without restriction,
-including without limitation the rights to use, copy, modify,
-merge, publish, distribute, sublicense, and/or sell copies of
-Magick++, and to permit persons to whom the Magick++ is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of Magick++.
-
-The software is provided "as is", without warranty of any kind,
-express or implied, including but not limited to the warranties of
-merchantability, fitness for a particular purpose and
-noninfringement. In no event shall Bob Friesenhahn be liable for
-any claim, damages or other liability, whether in an action of
-contract, tort or otherwise, arising from, out of or in connection
-with Magick++ or the use or other dealings in Magick++.
-
-
-
-======================================================================
-repository/Mesa-7.6/docs is licensed as follows
- (Cf. repository/Mesa-7.6/docs/COPYING):
-repository64/Mesa-7.6/docs is licensed as follows
- (Cf. repository64/Mesa-7.6/docs/COPYING):
-======================================================================
-
-Some parts of Mesa are copyrighted under the GNU LGPL. See the
-Mesa/docs/COPYRIGHT file for details.
-
-The following is the standard GNU copyright file.
-----------------------------------------------------------------------
-
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the library GPL. It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it. You can use it for
-your libraries, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link a program with the library, you must provide
-complete object files to the recipients so that they can relink them
-with the library, after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
-permission to copy, distribute and/or modify the library.
-
- Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library. If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software. To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
- Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs. This
-license, the GNU Library General Public License, applies to certain
-designated libraries. This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
- The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it. Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program. However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
- Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries. We
-concluded that weaker conditions might promote sharing better.
-
- However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves. This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them. (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.) The hope is that this
-will lead to faster development of free libraries.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, while the latter only
-works together with the library.
-
- Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License"). Each licensee is
-addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also compile or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- c) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- d) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Library General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/OpenSceneGraph-2.9.7 is licensed as follows
- (Cf. repository/OpenSceneGraph-2.9.7/LICENSE.txt):
-repository64/OpenSceneGraph-2.9.7 is licensed as follows
- (Cf. repository64/OpenSceneGraph-2.9.7/LICENSE.txt):
-======================================================================
- OpenSceneGraph Public License, Version 0.0
- ==========================================
-
- Copyright (C) 2002 Robert Osfield.
-
- Everyone is permitted to copy and distribute verbatim copies
- of this licence document, but changing it is not allowed.
-
- OPENSCENEGRAPH PUBLIC LICENCE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
- or later.
-
- Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
- out in the wxWindows section below. The LGPL is contained in the
- final section of this license.
-
-
--------------------------------------------------------------------------------
-
- wxWindows Library Licence, Version 3
- ====================================
-
- Copyright (C) 1998 Julian Smart, Robert Roebling [, ...]
-
- Everyone is permitted to copy and distribute verbatim copies
- of this licence document, but changing it is not allowed.
-
- WXWINDOWS LIBRARY LICENCE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public Licence as published by
- the Free Software Foundation; either version 2 of the Licence, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
- General Public Licence for more details.
-
- You should have received a copy of the GNU Library General Public Licence
- along with this software, usually in a file named COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA.
-
- EXCEPTION NOTICE
-
- 1. As a special exception, the copyright holders of this library give
- permission for additional uses of the text contained in this release of
- the library as licenced under the wxWindows Library Licence, applying
- either version 3 of the Licence, or (at your option) any later version of
- the Licence as published by the copyright holders of version 3 of the
- Licence document.
-
- 2. The exception is that you may use, copy, link, modify and distribute
- under the user's own terms, binary object code versions of works based
- on the Library.
-
- 3. If you copy code from files distributed under the terms of the GNU
- General Public Licence or the GNU Library General Public Licence into a
- copy of this library, as this licence permits, the exception does not
- apply to the code that you add in this way. To avoid misleading anyone as
- to the status of such modified files, you must delete this exception
- notice from such code and/or adjust the licensing conditions notice
- accordingly.
-
- 4. If you write modifications of your own for this library, it is your
- choice whether to permit this exception to apply to your modifications.
- If you do not wish that, you must delete the exception notice from such
- code and/or adjust the licensing conditions notice accordingly.
-
-
-------------------------------------------------------------------------------
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/OpenSceneGraph-2.9.7/Xcode/Packaging/Resources is licensed as follows
- (Cf. repository/OpenSceneGraph-2.9.7/Xcode/Packaging/Resources/LICENSE.txt):
-repository64/OpenSceneGraph-2.9.7/Xcode/Packaging/Resources is licensed as follows
- (Cf. repository64/OpenSceneGraph-2.9.7/Xcode/Packaging/Resources/LICENSE.txt):
-======================================================================
- OpenSceneGraph Public License, Version 0.0
- ==========================================
-
- Copyright (C) 2002 Robert Osfield.
-
- Everyone is permitted to copy and distribute verbatim copies
- of this licence document, but changing it is not allowed.
-
- OPENSCENEGRAPH PUBLIC LICENCE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
- or later.
-
- Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid in in
- the wxWindows section below. The LGPL in the final section of this
- license.
-
-
--------------------------------------------------------------------------------
-
- wxWindows Library Licence, Version 3
- ====================================
-
- Copyright (C) 1998 Julian Smart, Robert Roebling [, ...]
-
- Everyone is permitted to copy and distribute verbatim copies
- of this licence document, but changing it is not allowed.
-
- WXWINDOWS LIBRARY LICENCE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public Licence as published by
- the Free Software Foundation; either version 2 of the Licence, or (at
- your option) any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
- General Public Licence for more details.
-
- You should have received a copy of the GNU Library General Public Licence
- along with this software, usually in a file named COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA.
-
- EXCEPTION NOTICE
-
- 1. As a special exception, the copyright holders of this library give
- permission for additional uses of the text contained in this release of
- the library as licenced under the wxWindows Library Licence, applying
- either version 3 of the Licence, or (at your option) any later version of
- the Licence as published by the copyright holders of version 3 of the
- Licence document.
-
- 2. The exception is that you may use, copy, link, modify and distribute
- under the user's own terms, binary object code versions of works based
- on the Library.
-
- 3. If you copy code from files distributed under the terms of the GNU
- General Public Licence or the GNU Library General Public Licence into a
- copy of this library, as this licence permits, the exception does not
- apply to the code that you add in this way. To avoid misleading anyone as
- to the status of such modified files, you must delete this exception
- notice from such code and/or adjust the licensing conditions notice
- accordingly.
-
- 4. If you write modifications of your own for this library, it is your
- choice whether to permit this exception to apply to your modifications.
- If you do not wish that, you must delete the exception notice from such
- code and/or adjust the licensing conditions notice accordingly.
-
-
-------------------------------------------------------------------------------
-
-
-
-======================================================================
-repository/OpenSceneGraph-2.9.7/src/osgPlugins/3ds/lib3ds is licensed as follows
- (Cf. repository/OpenSceneGraph-2.9.7/src/osgPlugins/3ds/lib3ds/COPYING):
-repository/libpng-1.2.40/contrib/gregbook is licensed as follows
- (Cf. repository/libpng-1.2.40/contrib/gregbook/COPYING):
-repository/x264-snapshot-20091023-2245 is licensed as follows
- (Cf. repository/x264-snapshot-20091023-2245/COPYING):
-repository64/OpenSceneGraph-2.9.7/src/osgPlugins/3ds/lib3ds is licensed as follows
- (Cf. repository64/OpenSceneGraph-2.9.7/src/osgPlugins/3ds/lib3ds/COPYING):
-repository64/libpng-1.2.40/contrib/gregbook is licensed as follows
- (Cf. repository64/libpng-1.2.40/contrib/gregbook/COPYING):
-repository64/x264-snapshot-20091023-2245 is licensed as follows
- (Cf. repository64/x264-snapshot-20091023-2245/COPYING):
-======================================================================
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-
-======================================================================
-repository/OpenSceneGraph-2.9.7/src/osgPlugins/lwo is licensed as follows
- (Cf. repository/OpenSceneGraph-2.9.7/src/osgPlugins/lwo/COPYING):
-repository64/OpenSceneGraph-2.9.7/src/osgPlugins/lwo is licensed as follows
- (Cf. repository64/OpenSceneGraph-2.9.7/src/osgPlugins/lwo/COPYING):
-======================================================================
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/OpenSceneGraph-2.9.7/src/osgPlugins/vrml is licensed as follows
- (Cf. repository/OpenSceneGraph-2.9.7/src/osgPlugins/vrml/LICENSE.txt):
-repository64/OpenSceneGraph-2.9.7/src/osgPlugins/vrml is licensed as follows
- (Cf. repository64/OpenSceneGraph-2.9.7/src/osgPlugins/vrml/LICENSE.txt):
-======================================================================
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/OpenSceneGraph-2.9.7/src/osgPlugins/x is licensed as follows
- (Cf. repository/OpenSceneGraph-2.9.7/src/osgPlugins/x/LICENSE):
-repository64/OpenSceneGraph-2.9.7/src/osgPlugins/x is licensed as follows
- (Cf. repository64/OpenSceneGraph-2.9.7/src/osgPlugins/x/LICENSE):
-======================================================================
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/cairo-1.8.8 is licensed as follows
- (Cf. repository/cairo-1.8.8/COPYING):
-repository64/cairo-1.8.8 is licensed as follows
- (Cf. repository64/cairo-1.8.8/COPYING):
-======================================================================
-Cairo is free software.
-
-Every source file in the implementation[*] of cairo is available to be
-redistributed and/or modified under the terms of either the GNU Lesser
-General Public License (LGPL) version 2.1 or the Mozilla Public
-License (MPL) version 1.1. Some files are available under more
-liberal terms, but we believe that in all cases, each file may be used
-under either the LGPL or the MPL.
-
-See the following files in this directory for the precise terms and
-conditions of either license:
-
- COPYING-LGPL-2.1
- COPYING-MPL-1.1
-
-Please see each file in the implementation for copyright and licensing
-information, (in the opening comment of each file).
-
-[*] The implementation of cairo is contained entirely within the "src"
-and "pixman" directories of the cairo source distribution. There are
-other components of the cairo source distribution (such as the "test"
-and "perf") that are auxiliary to the library itself. None of the
-source code in these directories contributes to a build of the cairo
-library itself, (libcairo.so or cairo.dll or similar).
-
-These auxilary components are also free software, but may be under
-different license terms than cairo itself. For example, most of the
-test cases in the perf and test directories are made available under
-an MIT license to simplify any use of this code for reference purposes
-in using cairo itself. Other files might be available under the GNU
-General Public License (GPL), for example. Again, please see the
-opening comment of each file for copyright and licensing information.
-
-
-
-======================================================================
-repository/cairo-1.8.8 is licensed as follows
- (Cf. repository/cairo-1.8.8/COPYING-LGPL-2.1):
-repository64/cairo-1.8.8 is licensed as follows
- (Cf. repository64/cairo-1.8.8/COPYING-LGPL-2.1):
-======================================================================
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations
-below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it
-becomes a de-facto standard. To achieve this, non-free programs must
-be allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control
-compilation and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at least
- three years, to give the same user the materials specified in
- Subsection 6a, above, for a charge no more than the cost of
- performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply, and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License
-may add an explicit geographical distribution limitation excluding those
-countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms
-of the ordinary General Public License).
-
- To apply these terms, attach the following notices to the library.
-It is safest to attach them to the start of each source file to most
-effectively convey the exclusion of warranty; and each file should
-have at least the "copyright" line and a pointer to where the full
-notice is found.
-
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or
-your school, if any, to sign a "copyright disclaimer" for the library,
-if necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James
- Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/cairo-1.8.8 is licensed as follows
- (Cf. repository/cairo-1.8.8/COPYING-MPL-1.1):
-repository64/cairo-1.8.8 is licensed as follows
- (Cf. repository64/cairo-1.8.8/COPYING-MPL-1.1):
-======================================================================
- MOZILLA PUBLIC LICENSE
- Version 1.1
-
- ---------------
-
-1. Definitions.
-
- 1.0.1. "Commercial Use" means distribution or otherwise making the
- Covered Code available to a third party.
-
- 1.1. "Contributor" means each entity that creates or contributes to
- the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the Original
- Code, prior Modifications used by a Contributor, and the Modifications
- made by that particular Contributor.
-
- 1.3. "Covered Code" means the Original Code or Modifications or the
- combination of the Original Code and Modifications, in each case
- including portions thereof.
-
- 1.4. "Electronic Distribution Mechanism" means a mechanism generally
- accepted in the software development community for the electronic
- transfer of data.
-
- 1.5. "Executable" means Covered Code in any form other than Source
- Code.
-
- 1.6. "Initial Developer" means the individual or entity identified
- as the Initial Developer in the Source Code notice required by Exhibit
- A.
-
- 1.7. "Larger Work" means a work which combines Covered Code or
- portions thereof with code not governed by the terms of this License.
-
- 1.8. "License" means this document.
-
- 1.8.1. "Licensable" means having the right to grant, to the maximum
- extent possible, whether at the time of the initial grant or
- subsequently acquired, any and all of the rights conveyed herein.
-
- 1.9. "Modifications" means any addition to or deletion from the
- substance or structure of either the Original Code or any previous
- Modifications. When Covered Code is released as a series of files, a
- Modification is:
- A. Any addition to or deletion from the contents of a file
- containing Original Code or previous Modifications.
-
- B. Any new file that contains any part of the Original Code or
- previous Modifications.
-
- 1.10. "Original Code" means Source Code of computer software code
- which is described in the Source Code notice required by Exhibit A as
- Original Code, and which, at the time of its release under this
- License is not already Covered Code governed by this License.
-
- 1.10.1. "Patent Claims" means any patent claim(s), now owned or
- hereafter acquired, including without limitation, method, process,
- and apparatus claims, in any patent Licensable by grantor.
-
- 1.11. "Source Code" means the preferred form of the Covered Code for
- making modifications to it, including all modules it contains, plus
- any associated interface definition files, scripts used to control
- compilation and installation of an Executable, or source code
- differential comparisons against either the Original Code or another
- well known, available Covered Code of the Contributor's choice. The
- Source Code can be in a compressed or archival form, provided the
- appropriate decompression or de-archiving software is widely available
- for no charge.
-
- 1.12. "You" (or "Your") means an individual or a legal entity
- exercising rights under, and complying with all of the terms of, this
- License or a future version of this License issued under Section 6.1.
- For legal entities, "You" includes any entity which controls, is
- controlled by, or is under common control with You. For purposes of
- this definition, "control" means (a) the power, direct or indirect,
- to cause the direction or management of such entity, whether by
- contract or otherwise, or (b) ownership of more than fifty percent
- (50%) of the outstanding shares or beneficial ownership of such
- entity.
-
-2. Source Code License.
-
- 2.1. The Initial Developer Grant.
- The Initial Developer hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Initial Developer to use, reproduce,
- modify, display, perform, sublicense and distribute the Original
- Code (or portions thereof) with or without Modifications, and/or
- as part of a Larger Work; and
-
- (b) under Patents Claims infringed by the making, using or
- selling of Original Code, to make, have made, use, practice,
- sell, and offer for sale, and/or otherwise dispose of the
- Original Code (or portions thereof).
-
- (c) the licenses granted in this Section 2.1(a) and (b) are
- effective on the date Initial Developer first distributes
- Original Code under the terms of this License.
-
- (d) Notwithstanding Section 2.1(b) above, no patent license is
- granted: 1) for code that You delete from the Original Code; 2)
- separate from the Original Code; or 3) for infringements caused
- by: i) the modification of the Original Code or ii) the
- combination of the Original Code with other software or devices.
-
- 2.2. Contributor Grant.
- Subject to third party intellectual property claims, each Contributor
- hereby grants You a world-wide, royalty-free, non-exclusive license
-
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Contributor, to use, reproduce, modify,
- display, perform, sublicense and distribute the Modifications
- created by such Contributor (or portions thereof) either on an
- unmodified basis, with other Modifications, as Covered Code
- and/or as part of a Larger Work; and
-
- (b) under Patent Claims infringed by the making, using, or
- selling of Modifications made by that Contributor either alone
- and/or in combination with its Contributor Version (or portions
- of such combination), to make, use, sell, offer for sale, have
- made, and/or otherwise dispose of: 1) Modifications made by that
- Contributor (or portions thereof); and 2) the combination of
- Modifications made by that Contributor with its Contributor
- Version (or portions of such combination).
-
- (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
- effective on the date Contributor first makes Commercial Use of
- the Covered Code.
-
- (d) Notwithstanding Section 2.2(b) above, no patent license is
- granted: 1) for any code that Contributor has deleted from the
- Contributor Version; 2) separate from the Contributor Version;
- 3) for infringements caused by: i) third party modifications of
- Contributor Version or ii) the combination of Modifications made
- by that Contributor with other software (except as part of the
- Contributor Version) or other devices; or 4) under Patent Claims
- infringed by Covered Code in the absence of Modifications made by
- that Contributor.
-
-3. Distribution Obligations.
-
- 3.1. Application of License.
- The Modifications which You create or to which You contribute are
- governed by the terms of this License, including without limitation
- Section 2.2. The Source Code version of Covered Code may be
- distributed only under the terms of this License or a future version
- of this License released under Section 6.1, and You must include a
- copy of this License with every copy of the Source Code You
- distribute. You may not offer or impose any terms on any Source Code
- version that alters or restricts the applicable version of this
- License or the recipients' rights hereunder. However, You may include
- an additional document offering the additional rights described in
- Section 3.5.
-
- 3.2. Availability of Source Code.
- Any Modification which You create or to which You contribute must be
- made available in Source Code form under the terms of this License
- either on the same media as an Executable version or via an accepted
- Electronic Distribution Mechanism to anyone to whom you made an
- Executable version available; and if made available via Electronic
- Distribution Mechanism, must remain available for at least twelve (12)
- months after the date it initially became available, or at least six
- (6) months after a subsequent version of that particular Modification
- has been made available to such recipients. You are responsible for
- ensuring that the Source Code version remains available even if the
- Electronic Distribution Mechanism is maintained by a third party.
-
- 3.3. Description of Modifications.
- You must cause all Covered Code to which You contribute to contain a
- file documenting the changes You made to create that Covered Code and
- the date of any change. You must include a prominent statement that
- the Modification is derived, directly or indirectly, from Original
- Code provided by the Initial Developer and including the name of the
- Initial Developer in (a) the Source Code, and (b) in any notice in an
- Executable version or related documentation in which You describe the
- origin or ownership of the Covered Code.
-
- 3.4. Intellectual Property Matters
- (a) Third Party Claims.
- If Contributor has knowledge that a license under a third party's
- intellectual property rights is required to exercise the rights
- granted by such Contributor under Sections 2.1 or 2.2,
- Contributor must include a text file with the Source Code
- distribution titled "LEGAL" which describes the claim and the
- party making the claim in sufficient detail that a recipient will
- know whom to contact. If Contributor obtains such knowledge after
- the Modification is made available as described in Section 3.2,
- Contributor shall promptly modify the LEGAL file in all copies
- Contributor makes available thereafter and shall take other steps
- (such as notifying appropriate mailing lists or newsgroups)
- reasonably calculated to inform those who received the Covered
- Code that new knowledge has been obtained.
-
- (b) Contributor APIs.
- If Contributor's Modifications include an application programming
- interface and Contributor has knowledge of patent licenses which
- are reasonably necessary to implement that API, Contributor must
- also include this information in the LEGAL file.
-
- (c) Representations.
- Contributor represents that, except as disclosed pursuant to
- Section 3.4(a) above, Contributor believes that Contributor's
- Modifications are Contributor's original creation(s) and/or
- Contributor has sufficient rights to grant the rights conveyed by
- this License.
-
- 3.5. Required Notices.
- You must duplicate the notice in Exhibit A in each file of the Source
- Code. If it is not possible to put such notice in a particular Source
- Code file due to its structure, then You must include such notice in a
- location (such as a relevant directory) where a user would be likely
- to look for such a notice. If You created one or more Modification(s)
- You may add your name as a Contributor to the notice described in
- Exhibit A. You must also duplicate this License in any documentation
- for the Source Code where You describe recipients' rights or ownership
- rights relating to Covered Code. You may choose to offer, and to
- charge a fee for, warranty, support, indemnity or liability
- obligations to one or more recipients of Covered Code. However, You
- may do so only on Your own behalf, and not on behalf of the Initial
- Developer or any Contributor. You must make it absolutely clear than
- any such warranty, support, indemnity or liability obligation is
- offered by You alone, and You hereby agree to indemnify the Initial
- Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of warranty,
- support, indemnity or liability terms You offer.
-
- 3.6. Distribution of Executable Versions.
- You may distribute Covered Code in Executable form only if the
- requirements of Section 3.1-3.5 have been met for that Covered Code,
- and if You include a notice stating that the Source Code version of
- the Covered Code is available under the terms of this License,
- including a description of how and where You have fulfilled the
- obligations of Section 3.2. The notice must be conspicuously included
- in any notice in an Executable version, related documentation or
- collateral in which You describe recipients' rights relating to the
- Covered Code. You may distribute the Executable version of Covered
- Code or ownership rights under a license of Your choice, which may
- contain terms different from this License, provided that You are in
- compliance with the terms of this License and that the license for the
- Executable version does not attempt to limit or alter the recipient's
- rights in the Source Code version from the rights set forth in this
- License. If You distribute the Executable version under a different
- license You must make it absolutely clear that any terms which differ
- from this License are offered by You alone, not by the Initial
- Developer or any Contributor. You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by
- the Initial Developer or such Contributor as a result of any such
- terms You offer.
-
- 3.7. Larger Works.
- You may create a Larger Work by combining Covered Code with other code
- not governed by the terms of this License and distribute the Larger
- Work as a single product. In such a case, You must make sure the
- requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
- If it is impossible for You to comply with any of the terms of this
- License with respect to some or all of the Covered Code due to
- statute, judicial order, or regulation then You must: (a) comply with
- the terms of this License to the maximum extent possible; and (b)
- describe the limitations and the code they affect. Such description
- must be included in the LEGAL file described in Section 3.4 and must
- be included with all distributions of the Source Code. Except to the
- extent prohibited by statute or regulation, such description must be
- sufficiently detailed for a recipient of ordinary skill to be able to
- understand it.
-
-5. Application of this License.
-
- This License applies to code to which the Initial Developer has
- attached the notice in Exhibit A and to related Covered Code.
-
-6. Versions of the License.
-
- 6.1. New Versions.
- Netscape Communications Corporation ("Netscape") may publish revised
- and/or new versions of the License from time to time. Each version
- will be given a distinguishing version number.
-
- 6.2. Effect of New Versions.
- Once Covered Code has been published under a particular version of the
- License, You may always continue to use it under the terms of that
- version. You may also choose to use such Covered Code under the terms
- of any subsequent version of the License published by Netscape. No one
- other than Netscape has the right to modify the terms applicable to
- Covered Code created under this License.
-
- 6.3. Derivative Works.
- If You create or use a modified version of this License (which you may
- only do in order to apply it to code which is not already Covered Code
- governed by this License), You must (a) rename Your license so that
- the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
- "MPL", "NPL" or any confusingly similar phrase do not appear in your
- license (except to note that your license differs from this License)
- and (b) otherwise make it clear that Your version of the license
- contains terms which differ from the Mozilla Public License and
- Netscape Public License. (Filling in the name of the Initial
- Developer, Original Code or Contributor in the notice described in
- Exhibit A shall not of themselves be deemed to be modifications of
- this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
- COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
- DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
- THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
- IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
- YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
- COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
- OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
- ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
- 8.1. This License and the rights granted hereunder will terminate
- automatically if You fail to comply with terms herein and fail to cure
- such breach within 30 days of becoming aware of the breach. All
- sublicenses to the Covered Code which are properly granted shall
- survive any termination of this License. Provisions which, by their
- nature, must remain in effect beyond the termination of this License
- shall survive.
-
- 8.2. If You initiate litigation by asserting a patent infringement
- claim (excluding declatory judgment actions) against Initial Developer
- or a Contributor (the Initial Developer or Contributor against whom
- You file such action is referred to as "Participant") alleging that:
-
- (a) such Participant's Contributor Version directly or indirectly
- infringes any patent, then any and all rights granted by such
- Participant to You under Sections 2.1 and/or 2.2 of this License
- shall, upon 60 days notice from Participant terminate prospectively,
- unless if within 60 days after receipt of notice You either: (i)
- agree in writing to pay Participant a mutually agreeable reasonable
- royalty for Your past and future use of Modifications made by such
- Participant, or (ii) withdraw Your litigation claim with respect to
- the Contributor Version against such Participant. If within 60 days
- of notice, a reasonable royalty and payment arrangement are not
- mutually agreed upon in writing by the parties or the litigation claim
- is not withdrawn, the rights granted by Participant to You under
- Sections 2.1 and/or 2.2 automatically terminate at the expiration of
- the 60 day notice period specified above.
-
- (b) any software, hardware, or device, other than such Participant's
- Contributor Version, directly or indirectly infringes any patent, then
- any rights granted to You by such Participant under Sections 2.1(b)
- and 2.2(b) are revoked effective as of the date You first made, used,
- sold, distributed, or had made, Modifications made by that
- Participant.
-
- 8.3. If You assert a patent infringement claim against Participant
- alleging that such Participant's Contributor Version directly or
- indirectly infringes any patent where such claim is resolved (such as
- by license or settlement) prior to the initiation of patent
- infringement litigation, then the reasonable value of the licenses
- granted by such Participant under Sections 2.1 or 2.2 shall be taken
- into account in determining the amount or value of any payment or
- license.
-
- 8.4. In the event of termination under Sections 8.1 or 8.2 above,
- all end user license agreements (excluding distributors and resellers)
- which have been validly granted by You or any distributor hereunder
- prior to termination shall survive termination.
-
-9. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
- DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
- OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
- ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
- CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
- WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
- RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
- PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
- EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
- THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
- The Covered Code is a "commercial item," as that term is defined in
- 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
- software" and "commercial computer software documentation," as such
- terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
- C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
- all U.S. Government End Users acquire Covered Code with only those
- rights set forth herein.
-
-11. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the extent
- necessary to make it enforceable. This License shall be governed by
- California law provisions (except to the extent applicable law, if
- any, provides otherwise), excluding its conflict-of-law provisions.
- With respect to disputes in which at least one party is a citizen of,
- or an entity chartered or registered to do business in the United
- States of America, any litigation relating to this License shall be
- subject to the jurisdiction of the Federal Courts of the Northern
- District of California, with venue lying in Santa Clara County,
- California, with the losing party responsible for costs, including
- without limitation, court costs and reasonable attorneys' fees and
- expenses. The application of the United Nations Convention on
- Contracts for the International Sale of Goods is expressly excluded.
- Any law or regulation which provides that the language of a contract
- shall be construed against the drafter shall not apply to this
- License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
- As between Initial Developer and the Contributors, each party is
- responsible for claims and damages arising, directly or indirectly,
- out of its utilization of rights under this License and You agree to
- work with Initial Developer and Contributors to distribute such
- responsibility on an equitable basis. Nothing herein is intended or
- shall be deemed to constitute any admission of liability.
-
-13. MULTIPLE-LICENSED CODE.
-
- Initial Developer may designate portions of the Covered Code as
- "Multiple-Licensed". "Multiple-Licensed" means that the Initial
- Developer permits you to utilize portions of the Covered Code under
- Your choice of the NPL or the alternative licenses, if any, specified
- by the Initial Developer in the file described in Exhibit A.
-
-EXHIBIT A -Mozilla Public License.
-
- ``The contents of this file are subject to the Mozilla Public License
- Version 1.1 (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.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations
- under the License.
-
- The Original Code is ______________________________________.
-
- The Initial Developer of the Original Code is ________________________.
- Portions created by ______________________ are Copyright (C) ______
- _______________________. All Rights Reserved.
-
- Contributor(s): ______________________________________.
-
- Alternatively, the contents of this file may be used under the terms
- of the _____ license (the "[___] License"), in which case the
- provisions of [______] License are applicable instead of those
- above. If you wish to allow use of your version of this file only
- under the terms of the [____] License and not to allow others to use
- your version of this file under the MPL, indicate your decision by
- deleting the provisions above and replace them with the notice and
- other provisions required by the [___] License. If you do not delete
- the provisions above, a recipient may use your version of this file
- under either the MPL or the [___] License."
-
- [NOTE: The text of this Exhibit A may differ slightly from the text of
- the notices in the Source Code files of the Original Code. You should
- use the text of this Exhibit A rather than the text found in the
- Original Code Source Code for Your Modifications.]
-
-
-
-======================================================================
-repository/esidl-0.1.5 is licensed as follows
- (Cf. repository/esidl-0.1.5/LICENSE):
-repository64/esidl-0.1.5 is licensed as follows
- (Cf. repository64/esidl-0.1.5/LICENSE):
-======================================================================
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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.
-
-
-
-======================================================================
-repository/expat-2.0.1 is licensed as follows
- (Cf. repository/expat-2.0.1/COPYING):
-repository64/expat-2.0.1 is licensed as follows
- (Cf. repository64/expat-2.0.1/COPYING):
-======================================================================
-Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
- and Clark Cooper
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
-======================================================================
-repository/faac-1.28 is licensed as follows
- (Cf. repository/faac-1.28/COPYING):
-repository64/faac-1.28 is licensed as follows
- (Cf. repository64/faac-1.28/COPYING):
-======================================================================
- GNU LIBRARY GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the library GPL. It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it. You can use it for
-your libraries, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link a program with the library, you must provide
-complete object files to the recipients so that they can relink them
-with the library, after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
-permission to copy, distribute and/or modify the library.
-
- Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library. If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software. To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
- Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs. This
-license, the GNU Library General Public License, applies to certain
-designated libraries. This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
- The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it. Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program. However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
- Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries. We
-concluded that weaker conditions might promote sharing better.
-
- However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves. This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them. (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.) The hope is that this
-will lead to faster development of free libraries.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, while the latter only
-works together with the library.
-
- Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License"). Each licensee is
-addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also compile or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- c) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- d) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Library General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/faac-1.28/libfaac/kiss_fft is licensed as follows
- (Cf. repository/faac-1.28/libfaac/kiss_fft/COPYING):
-repository64/faac-1.28/libfaac/kiss_fft is licensed as follows
- (Cf. repository64/faac-1.28/libfaac/kiss_fft/COPYING):
-======================================================================
-Copyright (c) 2003-2004 Mark Borgerding
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-======================================================================
-repository/faad2-2.7 is licensed as follows
- (Cf. repository/faad2-2.7/COPYING):
-repository64/faad2-2.7 is licensed as follows
- (Cf. repository64/faad2-2.7/COPYING):
-======================================================================
-
-Any non-GPL usage of this software or parts of this software is strictly
-forbidden.
-
-Commercial non-GPL licensing of this software is possible.
-For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-
-
-
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-
-======================================================================
-repository/ffmpeg-0.5 is licensed as follows
- (Cf. repository/ffmpeg-0.5/COPYING.GPL):
-repository64/ffmpeg-0.5 is licensed as follows
- (Cf. repository64/ffmpeg-0.5/COPYING.GPL):
-======================================================================
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
-
-
-
-======================================================================
-repository/ffmpeg-0.5 is licensed as follows
- (Cf. repository/ffmpeg-0.5/COPYING.LGPL):
-repository64/ffmpeg-0.5 is licensed as follows
- (Cf. repository64/ffmpeg-0.5/COPYING.LGPL):
-======================================================================
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/flac-1.2.1 is licensed as follows
- (Cf. repository/flac-1.2.1/COPYING.FDL):
-repository64/flac-1.2.1 is licensed as follows
- (Cf. repository64/flac-1.2.1/COPYING.FDL):
-======================================================================
- GNU Free Documentation License
- Version 1.2, November 2002
-
-
- Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document "free" in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The "Document", below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as "you". You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (Thus, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML, PostScript or PDF designed for human modification. Examples of
-transparent image formats include PNG, XCF and JPG. Opaque formats
-include proprietary formats that can be read and edited only by
-proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML, PostScript or PDF produced by some word
-processors for output purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-A section "Entitled XYZ" means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as "Acknowledgements",
-"Dedications", "Endorsements", or "History".) To "Preserve the Title"
-of such a section when you modify the Document means that it remains a
-section "Entitled XYZ" according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has fewer than five),
- unless they release you from this requirement.
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section Entitled "History", Preserve its Title, and add
- to it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section Entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. For any section Entitled "Acknowledgements" or "Dedications",
- Preserve the Title of the section, and preserve in the section all
- the substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section Entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section to be Entitled "Endorsements"
- or to conflict in title with any Invariant Section.
-O. Preserve any Warranty Disclaimers.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled "History"
-in the various original documents, forming one section Entitled
-"History"; likewise combine any sections Entitled "Acknowledgements",
-and any sections Entitled "Dedications". You must delete all sections
-Entitled "Endorsements".
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an "aggregate" if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled "Acknowledgements",
-"Dedications", or "History", the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.2
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the "with...Texts." line with this:
-
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-
-
-
-======================================================================
-repository/flac-1.2.1 is licensed as follows
- (Cf. repository/flac-1.2.1/COPYING.GPL):
-repository64/flac-1.2.1 is licensed as follows
- (Cf. repository64/flac-1.2.1/COPYING.GPL):
-======================================================================
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-
-======================================================================
-repository/flac-1.2.1 is licensed as follows
- (Cf. repository/flac-1.2.1/COPYING.LGPL):
-repository64/flac-1.2.1 is licensed as follows
- (Cf. repository64/flac-1.2.1/COPYING.LGPL):
-======================================================================
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/flac-1.2.1 is licensed as follows
- (Cf. repository/flac-1.2.1/COPYING.Xiph):
-repository64/flac-1.2.1 is licensed as follows
- (Cf. repository64/flac-1.2.1/COPYING.Xiph):
-======================================================================
-Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-- Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-- Neither the name of the Xiph.org Foundation nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-======================================================================
-repository/fontconfig-2.7.3 is licensed as follows
- (Cf. repository/fontconfig-2.7.3/COPYING):
-repository64/fontconfig-2.7.3 is licensed as follows
- (Cf. repository64/fontconfig-2.7.3/COPYING):
-======================================================================
-fontconfig/COPYING
-
-Copyright © 2001,2003 Keith Packard
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation, and that the name of Keith Packard not be used in
-advertising or publicity pertaining to distribution of the software without
-specific, written prior permission. Keith Packard makes no
-representations about the suitability of this software for any purpose. It
-is provided "as is" without express or implied warranty.
-
-THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
-
-
-======================================================================
-repository/freetype-2.1.10/docs is licensed as follows
- (Cf. repository/freetype-2.1.10/docs/LICENSE.TXT):
-repository64/freetype-2.1.10/docs is licensed as follows
- (Cf. repository64/freetype-2.1.10/docs/LICENSE.TXT):
-======================================================================
-
-The FreeType 2 font engine is copyrighted work and cannot be used
-legally without a software license. In order to make this project
-usable to a vast majority of developers, we distribute it under two
-mutually exclusive open-source licenses.
-
-This means that *you* must choose *one* of the two licenses described
-below, then obey all its terms and conditions when using FreeType 2 in
-any of your projects or products.
-
- - The FreeType License, found in the file `FTL.TXT', which is similar
- to the original BSD license *with* an advertising clause that forces
- you to explicitly cite the FreeType project in your product's
- documentation. All details are in the license file. This license
- is suited to products which don't use the GNU General Public
- License.
-
- - The GNU General Public License version 2, found in `GPL.TXT' (any
- later version can be used also), for programs which already use the
- GPL. Note that the FTL is incompatible with the GPL due to its
- advertisement clause.
-
-The contributed PCF driver comes with a license similar to that of the X
-Window System. It is compatible to the above two licenses (see file
-src/pcf/readme).
-
-
---- end of LICENSE.TXT ---
-
-
-
-======================================================================
-repository/gsl-1.9 is licensed as follows
- (Cf. repository/gsl-1.9/COPYING):
-repository64/gsl-1.9 is licensed as follows
- (Cf. repository64/gsl-1.9/COPYING):
-======================================================================
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
-
-======================================================================
-repository/lame-398-2 is licensed as follows
- (Cf. repository/lame-398-2/COPYING):
-repository64/lame-398-2 is licensed as follows
- (Cf. repository64/lame-398-2/COPYING):
-======================================================================
- GNU LIBRARY GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the library GPL. It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it. You can use it for
-your libraries, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link a program with the library, you must provide
-complete object files to the recipients so that they can relink them
-with the library, after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
-permission to copy, distribute and/or modify the library.
-
- Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library. If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software. To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
- Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs. This
-license, the GNU Library General Public License, applies to certain
-designated libraries. This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
- The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it. Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program. However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
- Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries. We
-concluded that weaker conditions might promote sharing better.
-
- However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves. This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them. (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.) The hope is that this
-will lead to faster development of free libraries.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, while the latter only
-works together with the library.
-
- Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License"). Each licensee is
-addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also compile or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- c) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- d) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Library General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
-======================================================================
-repository/lame-398-2 is licensed as follows
- (Cf. repository/lame-398-2/LICENSE):
-repository64/lame-398-2 is licensed as follows
- (Cf. repository64/lame-398-2/LICENSE):
-======================================================================
-Can I use LAME in my commercial program?
-
-Yes, you can, under the restrictions of the LGPL. The easiest
-way to do this is to:
-
-1. Link to LAME as separate library (libmp3lame.a on unix or
- lame_enc.dll on windows)
-
-2. Fully acknowledge that you are using LAME, and give a link
- to our web site, www.mp3dev.org
-
-3. If you make modifications to LAME, you *must* release these
- these modifications back to the LAME project, under the LGPL.
-
-
-*** IMPORTANT NOTE ***
-
-The decoding functions provided in LAME use the mpglib decoding engine which
-is under the GPL. They may not be used by any program not released under the
-GPL unless you obtain such permission from the MPG123 project (www.mpg123.de).
-
-
-
-======================================================================
-repository/libmodplug-0.8.7 is licensed as follows
- (Cf. repository/libmodplug-0.8.7/COPYING):
-repository64/libmodplug-0.8.7 is licensed as follows
- (Cf. repository64/libmodplug-0.8.7/COPYING):
-======================================================================
-ModPlug-XMMS and libmodplug are now in the public domain.
-
-
-
-======================================================================
-repository/libogg-1.1.4 is licensed as follows
- (Cf. repository/libogg-1.1.4/COPYING):
-repository64/libogg-1.1.4 is licensed as follows
- (Cf. repository64/libogg-1.1.4/COPYING):
-======================================================================
-Copyright (c) 2002, Xiph.org Foundation
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-- Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-- Neither the name of the Xiph.org Foundation nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-======================================================================
-repository/libpng-1.2.40 is licensed as follows
- (Cf. repository/libpng-1.2.40/LICENSE):
-repository64/libpng-1.2.40 is licensed as follows
- (Cf. repository64/libpng-1.2.40/LICENSE):
-======================================================================
-
-This copy of the libpng notices is provided for your convenience. In case of
-any discrepancy between this copy and the notices in the file png.h that is
-included in the libpng distribution, the latter shall prevail.
-
-COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
-
-If you modify libpng you may insert additional notices immediately following
-this sentence.
-
-This code is released under the libpng license.
-
-libpng versions 1.2.6, August 15, 2004, through 1.2.40, September 10, 2009, are
-Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
-distributed according to the same disclaimer and license as libpng-1.2.5
-with the following individual added to the list of Contributing Authors
-
- Cosmin Truta
-
-libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
-Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
-distributed according to the same disclaimer and license as libpng-1.0.6
-with the following individuals added to the list of Contributing Authors
-
- Simon-Pierre Cadieux
- Eric S. Raymond
- Gilles Vollant
-
-and with the following additions to the disclaimer:
-
- There is no warranty against interference with your enjoyment of the
- library or against infringement. There is no warranty that our
- efforts or the library will fulfill any of your particular purposes
- or needs. This library is provided with all faults, and the entire
- risk of satisfactory quality, performance, accuracy, and effort is with
- the user.
-
-libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
-Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
-distributed according to the same disclaimer and license as libpng-0.96,
-with the following individuals added to the list of Contributing Authors:
-
- Tom Lane
- Glenn Randers-Pehrson
- Willem van Schaik
-
-libpng versions 0.89, June 1996, through 0.96, May 1997, are
-Copyright (c) 1996, 1997 Andreas Dilger
-Distributed according to the same disclaimer and license as libpng-0.88,
-with the following individuals added to the list of Contributing Authors:
-
- John Bowler
- Kevin Bracey
- Sam Bushell
- Magnus Holmgren
- Greg Roelofs
- Tom Tanner
-
-libpng versions 0.5, May 1995, through 0.88, January 1996, are
-Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
-
-For the purposes of this copyright and license, "Contributing Authors"
-is defined as the following set of individuals:
-
- Andreas Dilger
- Dave Martindale
- Guy Eric Schalnat
- Paul Schmidt
- Tim Wegner
-
-The PNG Reference Library is supplied "AS IS". The Contributing Authors
-and Group 42, Inc. disclaim all warranties, expressed or implied,
-including, without limitation, the warranties of merchantability and of
-fitness for any purpose. The Contributing Authors and Group 42, Inc.
-assume no liability for direct, indirect, incidental, special, exemplary,
-or consequential damages, which may result from the use of the PNG
-Reference Library, even if advised of the possibility of such damage.
-
-Permission is hereby granted to use, copy, modify, and distribute this
-source code, or portions hereof, for any purpose, without fee, subject
-to the following restrictions:
-
-1. The origin of this source code must not be misrepresented.
-
-2. Altered versions must be plainly marked as such and must not
- be misrepresented as being the original source.
-
-3. This Copyright notice may not be removed or altered from any
- source or altered source distribution.
-
-The Contributing Authors and Group 42, Inc. specifically permit, without
-fee, and encourage the use of this source code as a component to
-supporting the PNG file format in commercial products. If you use this
-source code in a product, acknowledgment is not required but would be
-appreciated.
-
-
-A "png_get_copyright" function is available, for convenient use in "about"
-boxes and the like:
-
- printf("%s",png_get_copyright(NULL));
-
-Also, the PNG logo (in PNG format, of course) is supplied in the
-files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
-
-Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
-certification mark of the Open Source Initiative.
-
-Glenn Randers-Pehrson
-glennrp at users.sourceforge.net
-September 10, 2009
-
-
-
-======================================================================
-repository/libpng-1.2.40/contrib/gregbook is licensed as follows
- (Cf. repository/libpng-1.2.40/contrib/gregbook/LICENSE):
-repository64/libpng-1.2.40/contrib/gregbook is licensed as follows
- (Cf. repository64/libpng-1.2.40/contrib/gregbook/LICENSE):
-======================================================================
- ---------------------------------------------------------------------------
-
- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
-
- This software is provided "as is," without warranty of any kind,
- express or implied. In no event shall the author or contributors
- be held liable for any damages arising in any way from the use of
- this software.
-
- The contents of this file are DUAL-LICENSED. You may modify and/or
- redistribute this software according to the terms of one of the
- following two licenses (at your option):
-
-
- LICENSE 1 ("BSD-like with advertising clause"):
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute
- it freely, subject to the following restrictions:
-
- 1. Redistributions of source code must retain the above copyright
- notice, disclaimer, and this list of conditions.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, disclaimer, and this list of conditions in the documenta-
- tion and/or other materials provided with the distribution.
- 3. All advertising materials mentioning features or use of this
- software must display the following acknowledgment:
-
- This product includes software developed by Greg Roelofs
- and contributors for the book, "PNG: The Definitive Guide,"
- published by O'Reilly and Associates.
-
-
- LICENSE 2 (GNU GPL v2 or later):
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- ---------------------------------------------------------------------------
-
-
-
-======================================================================
-repository/libtheora-1.1.1 is licensed as follows
- (Cf. repository/libtheora-1.1.1/COPYING):
-repository64/libtheora-1.1.1 is licensed as follows
- (Cf. repository64/libtheora-1.1.1/COPYING):
-======================================================================
-Copyright (C) 2002-2009 Xiph.org Foundation
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-- Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-- Neither the name of the Xiph.org Foundation nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-======================================================================
-repository/libtheora-1.1.1 is licensed as follows
- (Cf. repository/libtheora-1.1.1/LICENSE):
-repository64/libtheora-1.1.1 is licensed as follows
- (Cf. repository64/libtheora-1.1.1/LICENSE):
-======================================================================
-Please see the file COPYING for the copyright license for this software.
-
-In addition to and irrespective of the copyright license associated
-with this software, On2 Technologies, Inc. makes the following statement
-regarding technology used in this software:
-
- On2 represents and warrants that it shall not assert any rights
- relating to infringement of On2's registered patents, nor initiate
- any litigation asserting such rights, against any person who, or
- entity which utilizes the On2 VP3 Codec Software, including any
- use, distribution, and sale of said Software; which make changes,
- modifications, and improvements in said Software; and to use,
- distribute, and sell said changes as well as applications for other
- fields of use.
-
-This reference implementation is originally derived from the On2 VP3
-Codec Software, and the Theora video format is essentially compatible
-with the VP3 video format, consisting of a backward-compatible superset.
-
-
-
-======================================================================
-repository/libvorbis-1.2.3 is licensed as follows
- (Cf. repository/libvorbis-1.2.3/COPYING):
-repository64/libvorbis-1.2.3 is licensed as follows
- (Cf. repository64/libvorbis-1.2.3/COPYING):
-======================================================================
-Copyright (c) 2002-2008 Xiph.org Foundation
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-- Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-- Neither the name of the Xiph.org Foundation nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-======================================================================
-repository/pixman-0.16.2 is licensed as follows
- (Cf. repository/pixman-0.16.2/COPYING):
-repository64/pixman-0.16.2 is licensed as follows
- (Cf. repository64/pixman-0.16.2/COPYING):
-======================================================================
-The following is the 'standard copyright' agreed upon by most contributors,
-and is currently the canonical license, though a modification is currently
-under discussion. Copyright holders of new code should use this license
-statement where possible, and append their name to this list.
-
-Copyright 1987, 1988, 1989, 1998 The Open Group
-Copyright 1987, 1988, 1989 Digital Equipment Corporation
-Copyright 1999, 2004, 2008 Keith Packard
-Copyright 2000 SuSE, Inc.
-Copyright 2000 Keith Packard, member of The XFree86 Project, Inc.
-Copyright 2004, 2005, 2007, 2008 Red Hat, Inc.
-Copyright 2004 Nicholas Miell
-Copyright 2005 Lars Knoll & Zack Rusin, Trolltech
-Copyright 2005 Trolltech AS
-Copyright 2007 Luca Barbato
-Copyright 2008 Aaron Plattner, NVIDIA Corporation
-Copyright 2008 Rodrigo Kumpera
-Copyright 2008 André Tupinambá
-Copyright 2008 Mozilla Corporation
-Copyright 2008 Frederic Plourde
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-
-
-======================================================================
-repository/speex-1.2rc1 is licensed as follows
- (Cf. repository/speex-1.2rc1/COPYING):
-repository64/speex-1.2rc1 is licensed as follows
- (Cf. repository64/speex-1.2rc1/COPYING):
-======================================================================
-Copyright 2002-2008 Xiph.org Foundation
-Copyright 2002-2008 Jean-Marc Valin
-Copyright 2005-2007 Analog Devices Inc.
-Copyright 2005-2008 Commonwealth Scientific and Industrial Research
- Organisation (CSIRO)
-Copyright 1993, 2002, 2006 David Rowe
-Copyright 2003 EpicGames
-Copyright 1992-1994 Jutta Degener, Carsten Bormann
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-- Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-- Neither the name of the Xiph.org Foundation nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-======================================================================
-repository/zlib-1.2.3/contrib/dotzlib is licensed as follows
- (Cf. repository/zlib-1.2.3/contrib/dotzlib/LICENSE_1_0.txt):
-repository64/zlib-1.2.3/contrib/dotzlib is licensed as follows
- (Cf. repository64/zlib-1.2.3/contrib/dotzlib/LICENSE_1_0.txt):
-======================================================================
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/OWNERS b/OWNERS
deleted file mode 100644
index 72e8ffc..0000000
--- a/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
deleted file mode 100755
index c27b80b..0000000
--- a/PRESUBMIT.py
+++ /dev/null
@@ -1,174 +0,0 @@
-# Copyright (c) 2011 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.
-
-# Documentation on PRESUBMIT.py can be found at:
-# http://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
-
-import os
-import subprocess
-
-PYTHON = 'build_tools/python_wrapper'
-
-_EXCLUDED_PATHS = (
- # patch_configure.py contains long lines embedded in multi-line
- # strings.
- r"^build_tools[\\\/]patch_configure.py",
- # Many of the files in glibc-compat come from the other sources such as
- # newlib and as such do not contain our copyright header.
- r"^ports[\/\\]glibc-compat[\/\\]include[\/\\]err\.h",
- r"^ports[\/\\]glibc-compat[\/\\]include[\/\\]fts\.h",
- r"^ports[\/\\]glibc-compat[\/\\]include[\/\\]sys[\/\\]socket\.h",
- r"^ports[\/\\]glibc-compat[\/\\]src[\/\\]err\.c",
- r"^ports[\/\\]glibc-compat[\/\\]src[\/\\]libc-symbols\.h",
- r"^ports[\/\\]glibc-compat[\/\\]src[\/\\]dirfd.c",
- r"^ports[\/\\]glibc-compat[\/\\]src[\/\\]flock.c",
- r"^ports[\/\\]glibc-compat[\/\\]src[\/\\]fts.c",
- r"^ports[\/\\]glibc-compat[\/\\]src[\/\\]herror.c",
- r"^ports[\/\\]glibc-compat[\/\\]src[\/\\]timegm.c",
- r"^ports[\\\/]alut-demo[\\\/]alut_hello_world.c",
-)
-
-def RunPylint(input_api, output_api):
- output = []
- canned = input_api.canned_checks
- disabled_warnings = [
- 'W0613', # Unused argument
- ]
- black_list = list(input_api.DEFAULT_BLACK_LIST) + [
- r'ports[\/\\]ipython-ppapi[\/\\]kernel\.py',
- ]
- output.extend(canned.RunPylint(input_api, output_api, black_list=black_list,
- disabled_warnings=disabled_warnings, extra_paths_list=['lib']))
- return output
-
-
-
-def RunCommand(name, cmd, input_api, output_api):
- try:
- subprocess.check_call(cmd)
- except subprocess.CalledProcessError:
- message = '%s failed.' % name
- return [output_api.PresubmitError(message)]
- return []
-
-
-def RunPythonCommand(cmd, input_api, output_api):
- return RunCommand(cmd[0], [PYTHON] + cmd, input_api, output_api)
-
-
-def CheckPartioning(input_api, output_api):
- return RunPythonCommand(['build_tools/partition.py', '--check'],
- input_api,
- output_api)
-
-
-def CheckDeps(input_api, output_api):
- return RunPythonCommand(['build_tools/check_deps.py'],
- input_api,
- output_api)
-
-
-def CheckPortList(input_api, output_api):
- rtn = RunPythonCommand(['build_tools/generate_port_list.py', '-o', 'tmp.md'],
- input_api,
- output_api)
- if rtn:
- return rtn
- if open('tmp.md').read() != open('docs/port_list.md').read():
- subprocess.call(['diff', '-u', 'tmp.md', 'docs/port_list.md'])
- message = 'docs/port_list.md is out-of-date.'
- message += ' Run build_tools/generate_port_list.py to update.'
- return [output_api.PresubmitError(message)]
- os.remove('tmp.md')
- return []
-
-
-def CheckMirror(input_api, output_api):
- return RunPythonCommand(['build_tools/update_mirror.py', '--check'],
- input_api,
- output_api)
-
-
-def RunUnittests(input_api, output_api):
- return RunCommand('unittests', ['make', 'test'], input_api, output_api)
-
-
-# This check was copied from the chromium version.
-# TODO(sbc): should we add this to canned_checks?
-def CheckAuthorizedAuthor(input_api, output_api):
- """Verify the author's email address is in AUTHORS.
- """
- import fnmatch
-
- author = input_api.change.author_email
- if not author:
- input_api.logging.info('No author, skipping AUTHOR check')
- return []
- authors_path = input_api.os_path.join(
- input_api.PresubmitLocalPath(), 'AUTHORS')
- valid_authors = (
- input_api.re.match(r'[^#]+\s+\<(.+?)\>\s*$', line)
- for line in open(authors_path))
- valid_authors = [item.group(1).lower() for item in valid_authors if item]
- if not any(fnmatch.fnmatch(author.lower(), valid) for valid in valid_authors):
- input_api.logging.info('Valid authors are %s', ', '.join(valid_authors))
- return [output_api.PresubmitPromptWarning(
- ('%s is not in AUTHORS file. If you are a new contributor, please visit'
- '\n'
- 'http://www.chromium.org/developers/contributing-code and read the '
- '"Legal" section.\n') % author)]
- return []
-
-
-def CheckChangeOnUpload(input_api, output_api):
- report = []
- report.extend(CheckPortList(input_api, output_api))
- report.extend(CheckAuthorizedAuthor(input_api, output_api))
- report.extend(RunPylint(input_api, output_api))
- report.extend(RunUnittests(input_api, output_api))
- report.extend(CheckDeps(input_api, output_api))
- report.extend(input_api.canned_checks.PanProjectChecks(
- input_api, output_api, project_name='Native Client',
- excluded_paths=_EXCLUDED_PATHS))
- return report
-
-
-def CheckChangeOnCommit(input_api, output_api):
- report = []
- report.extend(CheckChangeOnUpload(input_api, output_api))
- report.extend(CheckMirror(input_api, output_api))
- report.extend(CheckPartioning(input_api, output_api))
- report.extend(input_api.canned_checks.CheckTreeIsOpen(
- input_api, output_api,
- json_url='http://naclports-status.appspot.com/current?format=json'))
- return report
-
-
-TRYBOTS = [
- 'webports-linux-glibc-0',
- 'webports-linux-glibc-1',
- 'webports-linux-glibc-2',
- 'webports-linux-glibc-3',
- 'webports-linux-glibc-4',
- 'webports-linux-glibc-5',
- 'webports-linux-pnacl-0',
- 'webports-linux-pnacl-1',
- 'webports-linux-pnacl-2',
- 'webports-linux-pnacl-3',
- 'webports-linux-pnacl-4',
- 'webports-linux-pnacl-5',
- 'webports-linux-clang-0',
- 'webports-linux-clang-1',
- 'webports-linux-clang-2',
- 'webports-linux-clang-3',
- 'webports-linux-clang-4',
- 'webports-linux-clang-5',
- 'webports-linux-emscripten-0',
-]
-
-
-def GetPreferredTryMasters(_, change):
- return {
- 'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS },
- }
diff --git a/README.md b/README.md
index f4c5ebb..0ecdffc 100644
--- a/README.md
+++ b/README.md
@@ -1,205 +1,11 @@
-webports
-========
+naclports is now webports
+=========================
-webports is collection of open source libraries and applications that
-have been ported to Native Client, along with set to tools for building
-and maintaining them.
+naclports has been renamed to webports and moved to a new
+repository: https://chromium.googlesource.com/webports/
-Packages can be built from source or prebuilt binaries packages can be
-downloaded from the continuous build system.
-
-The sources for the ports live in the `ports` directory. Each one
-contains at least the following file:
-
-- `pkg_info`: a description of the package.
-
-Most also contain the follow optional files:
-
-- `build.sh`: a bash script for building it
-- `nacl.patch`: an optional patch file.
-
-The tools for building packages live in `bin`. The binary tool is simple
-called `webports`. To build and install a package into the toolchain
-run `webports install <package_dir>`. This script will download, patch,
-build and install the application or library. By default it will first
-install any dependencies that that the package has.
-
-Links
------
-
-- Git: <https://chromium.googlesource.com/webports.git>
-- Bugs: <https://bugs.chromium.org/p/naclports/issues/list>
-- Continuous builder: <http://build.chromium.org/p/client.nacl.ports/>
-- Continuous build artifacts: <http://gsdview.appspot.com/webports/builds/>
-
-Prerequistes
-------------
-
-The minimum requirements for using webports are:
-
-- python 2.7
-- gclient (from depot\_tools)
-- Native Client SDK
-
-For building packages from source the build scripts require that certain
-tools are present in the host system:
-
-- bash
-- make
-- curl
-- sed
-- git
-
-To build all ports you will also need these:
-
-- cmake
-- texinfo
-- gettext
-- pkg-config
-- autoconf, automake, libtool
-- libglib2.0-dev \>= 2.26.0 (if you want to build glib)
-- xsltproc
-
-On Mac OS X you can use homebrew to install these using the following
-command:
+Run the following git command to update your remote:
```
-$ brew install autoconf automake cmake gettext libtool pkg-config
+$ git remote set-url origin https://chromium.googlesource.com/webports/
```
-
-The build system for some of the native Python modules relies on a
-32-bit host build of Python itself, which in turn relies on the
-development version of zlib and libssl being available. On 64-bit
-Ubuntu/Trusty this means installing:
-
-- zlib1g-dev:i386
-- libssl-dev:i386
-
-On older Debian/Ubuntu systems these packages were known as:
-
-- lib32z1-dev
-- libssl1.0.0:i386
-
-How to Checkout
----------------
-
-Although the code is stored in git webports uses `gclient` to manage
-the checkout of dependencies. You will need to install `depot_tools` in
-order to gclient.
-
-Use the following steps to correctly checkout webports:
-
-1. Create a directory:
-
-```
-$ mkdir webports
-$ cd webports
-```
-
-2. Create a .gclient Configuration:
-
-```
-$ gclient config --name=src https://chromium.googlesource.com/webports.git
-```
-
-3. Sync to the dependencies:
-
-```
-$ gclient sync
-```
-
-Building
---------
-
-Before you can build any of the package you must set the `NACL_SDK_ROOT`
-environment variable to top directory of a version of the Native Client
-SDK (the directory containing toolchain/). This path should be absolute.
-
-The top level Makefile can be used as a quick way to build one or more
-packages. For example, `make libvorbis` will build `libvorbis` and
-`libogg`. `make all` will build all the packages.
-
-There are 4 possible architectures that NaCl modules can be compiled
-for: i686, x86\_64, arm, pnacl. The webports build system will only
-build just one at at time. You can control which one by setting the
-`NACL_ARCH` environment variable. e.g.:
-
-```
-$ NACL_ARCH=arm make openssl
-```
-
-For some architectures there is more than one toolchain available. For
-example for x86 you can choose between clang-newlib and glibc. The
-toolchain defaults to pnacl and can be specified by setting the
-`TOOLCHAIN` environment variable:
-
-```
-$ NACL_ARCH=i686 TOOLCHAIN=glibc make openssl
-```
-
-If you want to build a certain package for all architectures and all
-toolchains you can use the top level `make_all.sh` script. e.g.:
-
-```
-$ ./make_all.sh openssl
-```
-
-Headers and libraries are installed into the toolchains directly so
-there is not add extra -I or -L options in order to use the libraries.
-
-The source code and build output for each package is placed in:
-
-```
-out/build/<PACKAGE_NAME>
-```
-
-By default all builds are in release configuration. If you want to build
-debug packages set `NACL_DEBUG=1` or pass `--debug` to the webports
-script.
-
-**Note**: Each package has its own license. Please read and understand
-these licenses before using these packages in your projects.
-
-**Note to Windows users**: These scripts are written in bash and must be
-launched from a Cygwin shell. While many of the scripts should work
-under Cygwin, webports is only tested on Linux and Mac so YMMV.
-
-Binary Packages
----------------
-
-By default webports will attempt to install binary packages rather than
-building them from source. The binary packages are produced by the
-buildbots and stored in Google cloud storage. The index of current
-binary packages is stored in `lib/prebuilt.txt` and this is currently
-manually updated by running `build_tools/scan_packages.py`.
-
-If the package version does not match the package will always be built
-from source.
-
-If you want to force a package to be built from source you can pass
-`--from-source` to the webports script.
-
-Emscripten Support
-------------------
-
-The build system contains very early alpha support for building packages
-with Emscripten. To do requires the Emscripten SDK to be installed and
-configured (with the Emscripten tools in the PATH). To build for
-Emscripten build with `TOOLCHAIN=emscripten`.
-
-Running the examples
---------------------
-
-Applications/Examples that build runnable web pages are published to
-`out/publish`. To run them in chrome you need to serve them with a web
-server. The easiest way to do this is to run:
-
-```
-$ make run
-```
-
-This will start a local web server serving the content of `out/publish`
-after which you can navigate to <http://localhost:5103> to view the
-content.
-
-Happy porting!
diff --git a/WATCHLISTS b/WATCHLISTS
deleted file mode 100644
index b00ae71..0000000
--- a/WATCHLISTS
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2014 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.
-
-# Watchlist Rules
-# Refer: http://dev.chromium.org/developers/contributing-code/watchlists
-
-# IMPORTANT: The regular expression filepath is tested against each path using
-# re.search, so it is not usually necessary to add .*.
-
-{
- 'WATCHLIST_DEFINITIONS': {
- 'all': {
- 'filepath': '.*',
- },
- },
- 'WATCHLISTS': {
- 'all': ['sbc@chromium.org'],
- }
-}
diff --git a/bin/coverage b/bin/coverage
deleted file mode 100755
index c4311bc..0000000
--- a/bin/coverage
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-SCRIPT_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
-
-exec ${SCRIPT_DIR}/../build_tools/python_wrapper -m coverage $*
diff --git a/bin/nosetests b/bin/nosetests
deleted file mode 100755
index 4871b5f..0000000
--- a/bin/nosetests
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-SCRIPT_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
-
-exec ${SCRIPT_DIR}/../build_tools/python_wrapper -m nose --rednose $*
diff --git a/bin/webports b/bin/webports
deleted file mode 100755
index fbb148b..0000000
--- a/bin/webports
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-SCRIPT_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
-
-exec ${SCRIPT_DIR}/../build_tools/python_wrapper -m webports $*
diff --git a/bin/webports-configure b/bin/webports-configure
deleted file mode 100755
index 7647999..0000000
--- a/bin/webports-configure
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-SCRIPT_DIR=$(dirname "$BASH_SOURCE")
-
-exec "$SCRIPT_DIR/../build_tools/webports-configure.sh" $*
diff --git a/bin/webports-env b/bin/webports-env
deleted file mode 100755
index 2ff21c2..0000000
--- a/bin/webports-env
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-SCRIPT_DIR=$(dirname "$BASH_SOURCE")
-
-exec "$SCRIPT_DIR/../build_tools/webports-env.sh" $*
diff --git a/bin/webports-make b/bin/webports-make
deleted file mode 100755
index d2fc28b..0000000
--- a/bin/webports-make
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-SCRIPT_DIR=$(dirname "$BASH_SOURCE")
-
-exec "$SCRIPT_DIR/../build_tools/webports-make.sh" $*
diff --git a/bin/yapf b/bin/yapf
deleted file mode 100755
index ac3b66c..0000000
--- a/bin/yapf
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-SCRIPT_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
-
-exec ${SCRIPT_DIR}/../build_tools/python_wrapper -m yapf "$@"
diff --git a/build_tools/README.txt b/build_tools/README.txt
deleted file mode 100644
index 96a5d2b..0000000
--- a/build_tools/README.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-== LINUX Additional buildbot setup. ==
-
-To run the i686 plumbing tests (running i686 chromium), these additional
-packages are required:
-
-libglib2.0-0:i386 libnss3:i386 libgconf-2-4:i386 libfontconfig:i386
-libpango1.0-0:i386 libxi6:i386 libxcursor1:i386 libxcomposite1:i386
-libasound2:i386 libxdamage1:i386 libxtst6:i386 libxrandr2:i386 libcap2:i386
-libudev0:i386 libgtk2.0-0:i386 libxss1:i386 libexif12:i386
-libgl1-mesa-glx:i386
-
-Additionally, on older Ubuntu system such as Precise, we currently need
-some symlinks to be manually created:
-$ cd /usr/lib/i386-linux-gnu/
-$ sudo ln -s libcrypto.so.1.0.0 libcrypto.so
-$ sudo ln -s libssl.so.1.0.0 libssl.so
-
-Additionally, if nacl tests are to be run, these packages are required:
-libgpm2:i386 libncurses5:i386
-
-This can be done en-masse to the buildbots via:
-for i in $(seq <start> <end>); do ssh -t slave${i}-c4 'sudo aptitude install libglib2.0-0:i386 libnss3:i386 libgconf-2-4:i386 libfontconfig:i386 libpango1.0-0:i386 libxi6:i386 libxcursor1:i386 libxcomposite1:i386 libasound2:i386 libxdamage1:i386 libxtst6:i386 libxrandr2:i386 libcap2:i386 libudev0:i386 libgtk2.0-0:i386 libxss1:i386 libexif12:i386 libgl1-mesa-glx:i386 libssl1.0.0:i386 lib32z1-dev libgpm2:i386 libncurses5:i386 && cd /usr/lib/i386-linux-gnu/ && sudo ln -s libcrypto.so.1.0.0 libcrypto.so && sudo ln -s libssl.so.1.0.0 libssl.so' ; done
diff --git a/build_tools/XCompile-nacl.cmake b/build_tools/XCompile-nacl.cmake
deleted file mode 100644
index 98dfa4b..0000000
--- a/build_tools/XCompile-nacl.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-# Cross-compiling requires CMake 2.6 or newer. To cross-compile, first modify
-# this file to set the proper settings and paths. Then use it from build/ like:
-# cmake .. -DCMAKE_TOOLCHAIN_FILE=../XCompile.txt \
-# -DCMAKE_INSTALL_PREFIX=/usr/mingw32/mingw
-# If you already have a toolchain file setup, you may use that instead of this
-# file.
-
-SET(NACL 1)
-
-# the name of the target operating system
-SET(CMAKE_SYSTEM_NAME Linux)
-SET(CMAKE_SYSTEM_VERSION 1)
-SET(CMAKE_SYSTEM_PROCESSOR ${NACL_ARCH})
-
-# which compilers to use for C and C++
-SET(CMAKE_C_COMPILER "${NACLCC}")
-SET(CMAKE_CXX_COMPILER "${NACLCXX}")
-SET(CMAKE_LINKER "${NACLLD}")
-SET(CMAKE_AR "${NACLAR}" CACHE FILEPATH "Archiver")
-SET(_CMAKE_TOOLCHAIN_PREFIX ${NACL_CROSS_PREFIX})
-
-SET(NACL_LIBC "${NACL_LIBC}")
-
-# here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH ${NACL_TOOLCHAIN_ROOT})
-
-# Reference CMAKE_TOOLCHAIN_FILE and CMAKE_PREFIX_PATH here to avoid
-# cmake warnings:
-# http://public.kitware.com/pipermail/cmake/2013-February/053476.html
-SET(DUMMY_VALUE ${CMAKE_TOOLCHAIN_FILE} ${CMAKE_PREFIX_PATH})
-
-# adjust the default behaviour of the FIND_XXX() commands:
-# search headers and libraries in the target environment, search
-# programs in the host environment
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-SET(CMAKE_REQUIRED_INCLUDES "${NACL_SDK_ROOT}/include")
-LINK_DIRECTORIES(${NACL_SDK_LIBDIR})
-
-# nacl abi says 32bits little endian
-SET(CMAKE_SIZEOF_VOID_P 4)
diff --git a/build_tools/build_emscripten.sh b/build_tools/build_emscripten.sh
deleted file mode 100755
index 469c14c..0000000
--- a/build_tools/build_emscripten.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-# Copyright 2015 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.
-
-set -o nounset
-set -o errexit
-set -x
-
-readonly EMSCRIPTEN_TAG='1.34.0'
-
-readonly BUILDTOOLS_DIR=$(cd "$(dirname "${BASH_SOURCE}")" ; pwd)
-readonly SRC_DIR=$(dirname "${BUILDTOOLS_DIR}")
-readonly OUT_DIR=${SRC_DIR}/out
-readonly EMSDK_DIR=${OUT_DIR}/emsdk
-
-if [[ -z ${CHROME_ROOT:-} ]]; then
- echo "Set CHROME_ROOT to your Chrome repo root"
- exit 1
-fi
-
-readonly LLVM_DIR=${CHROME_ROOT}/third_party/llvm-build/Release+Asserts/bin
-
-OS_JOBS=$(nproc)
-
-mkdir -p ${EMSDK_DIR}
-
-cd ${OUT_DIR}
-# Instructions from
-# https://kripken.github.io/emscripten-site/docs/building_from_source/building_fastcomp_manually_from_source.html#building-fastcomp-from-source
-mkdir -p fastcomp
-cd fastcomp
-git clone --depth 1 https://github.com/kripken/emscripten-fastcomp \
- --branch ${EMSCRIPTEN_TAG}
-cd emscripten-fastcomp
-git clone --depth 1 https://github.com/kripken/emscripten-fastcomp-clang \
- tools/clang --branch ${EMSCRIPTEN_TAG}
-mkdir -p build
-cd build
-# Build using Chrome's clang
-CC=${LLVM_DIR}/clang CXX=${LLVM_DIR}/clang++ cmake .. \
- -DCMAKE_INSTALL_PREFIX=${EMSDK_DIR}/fastcomp-install \
- -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;JSBackend" \
- -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF \
- -DCLANG_INCLUDE_EXAMPLES=OFF -DCLANG_INCLUDE_TESTS=OFF
-make -j${OS_JOBS}
-make install
-
-# Copy Chrome clang's libstdc++ into the lib dir
-cp ${LLVM_DIR}/../lib/libstdc++.so.6 ${EMSDK_DIR}/fastcomp-install/lib
-
-# Instructions from
-# https://kripken.github.io/emscripten-site/docs/building_from_source/building_emscripten_from_source_on_linux.html
-cd ${EMSDK_DIR}
-git clone --depth 1 https://github.com/kripken/emscripten.git \
- --branch ${EMSCRIPTEN_TAG}
-
-# Write .emscripten file. See
-# https://kripken.github.io/emscripten-site/docs/tools_reference/emsdk.html#compiler-configuration-file
-cat > ${EMSDK_DIR}/.emscripten <<HERE
-import os
-
-# Emscripten loads the contents of this file and runs it from tools/shared.py
-TOOLS_DIR=os.path.abspath(os.path.dirname(__file__))
-EMSCRIPTEN_ROOT=os.path.dirname(TOOLS_DIR)
-EMSDK_ROOT=os.path.dirname(EMSCRIPTEN_ROOT)
-LLVM_ROOT=os.path.join(EMSDK_ROOT, 'fastcomp-install', 'bin')
-
-SPIDERMONKEY_ENGINE = ''
-NODE_JS = 'node'
-V8_ENGINE = ''
-TEMP_DIR = '/tmp'
-COMPILER_ENGINE = NODE_JS
-JS_ENGINES = [NODE_JS]
-HERE
-
-# Write tarball
-cd ${OUT_DIR}
-tar czf emsdk-$(date +%Y%m%d).tar.gz emsdk
diff --git a/build_tools/build_port.sh b/build_tools/build_port.sh
deleted file mode 100755
index 42f3ae4..0000000
--- a/build_tools/build_port.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-#
-# Executable entry point for building nacl ports.
-# This script must be run from the indivdual port directory (containing
-# pkg_info and build.sh). Most of the code and heavy lifting is in
-# common.sh.
-
-readonly SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE}")" ; pwd)
-
-if [ ! -f ./pkg_info ]; then
- echo "No pkg_info found in current directory"
- exit 1
-fi
-source ./pkg_info
-
-source ${SCRIPT_DIR}/common.sh
-
-if [ -f ./build.sh ]; then
- source ./build.sh
-fi
-
-NaclportsMain "$@"
diff --git a/build_tools/build_repo.sh b/build_tools/build_repo.sh
deleted file mode 100755
index 9d266f9..0000000
--- a/build_tools/build_repo.sh
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 2015 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.
-
-set -o errexit
-set -o nounset
-
-SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
-NACLPORTS_ROOT="$(cd ${SCRIPT_DIR}/.. && pwd)"
-
-PKG=${NACLPORTS_ROOT}/out/build/pkg/build_host/src/pkg
-SDK_VERSION=${SDK_VERSION:-pepper_48}
-
-WriteMetaFile() {
- echo "version = 1;" > $1
- echo "packing_format = "tbz";" >> $1
- echo "digest_format = "sha256_base32";" >> $1
- echo "digests = "digests";" >> $1
- echo "manifests = "packagesite.yaml";" >> $1
- echo "filesite = "filesite.yaml";" >> $1
- echo "digests_archive = "digests";" >> $1
- echo "manifests_archive = "packagesite";" >> $1
- echo "filesite_archive = "filesite";" >> $1
-}
-
-RunPkg() {
- local pkg_dir=$1
- local out_dir=$2
- WriteMetaFile "${pkg_dir}/meta"
- mkdir -p "${out_dir}"
- local cmd="$PKG repo -m ${pkg_dir}/meta -o ${out_dir} ${pkg_dir}"
- echo $cmd
- $cmd
-}
-
-BuildRepo() {
- local revision=$1
- local gs_url="gs://webports/builds/${SDK_VERSION}/${revision}/publish"
- ${SCRIPT_DIR}/download_pkg.py ${revision}
- cd ${NACLPORTS_ROOT}
- local repo_dir=out/packages/prebuilt/repo
- for pkg_dir in out/packages/prebuilt/pkg/*/ ; do
- local out_dir=${repo_dir}/$(basename ${pkg_dir})
- RunPkg $pkg_dir $out_dir
- echo "Uploading to ${gs_url}/$(basename ${pkg_dir})"
- cd ${out_dir}
- gsutil cp -a public-read *.tbz ${gs_url}/$(basename ${pkg_dir})
- cd -
- done
-}
-
-BuildLocalRepo() {
- cd ${NACLPORTS_ROOT}/out/publish
- for pkg_dir in pkg_* ; do
- RunPkg $pkg_dir $pkg_dir
- done
-}
-
-UsageHelp() {
- echo "./build_repo.sh - Build pkg repository using \
-local/remote built packages"
- echo ""
- echo "./build_repo.sh [-l] [-r REVISION]"
- echo "Either provide a revision(-r) for remote built pakcages or \
-use -l for local built packages"
- echo ""
- echo "Description"
- echo "-h show help messages"
- echo "-l build pkg repository using local built packages"
- echo "-r build pkg repository using remote built packages"
-}
-
-if [[ $# -lt 1 ]]; then
- UsageHelp
- exit 1
-fi
-
-OPTIND=1
-
-while getopts "h?lr:" opt; do
- case "$opt" in
- h|\?)
- UsageHelp
- exit 0
- ;;
- l) local=1
- ;;
- r) local=0
- revision=$OPTARG
- ;;
- esac
-done
-
-shift $((OPTIND - 1))
-
-if [[ ! -f ${PKG} ]]; then
- TOOLCHAIN=clang-newlib make pkg F=1 V=1
-fi
-
-if [[ ${local} = 1 ]]; then
- BuildLocalRepo
-else
- BuildRepo $revision
-fi
diff --git a/build_tools/buildbot_build_shard.sh b/build_tools/buildbot_build_shard.sh
deleted file mode 100755
index 0b435c8..0000000
--- a/build_tools/buildbot_build_shard.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/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.
-
-######################################################################
-# Notes on directory layout:
-# makefile location (base_dir): webports/src
-# toolchain injection point: specified externally via NACL_SDK_ROOT.
-######################################################################
-
-SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
-source ${SCRIPT_DIR}/buildbot_common.sh
-
-set -o nounset
-set -o errexit
-
-readonly BNAME_REGEX="(nightly-|webports-)?(.+)-(.+)-(.+)"
-if [[ ${BUILDBOT_BUILDERNAME} =~ ${BNAME_REGEX} ]]; then
- readonly PREFIX=${BASH_REMATCH[1]}
- if [ "${PREFIX}" = "webports-" ]; then
- readonly TRYBOT=1
- else
- readonly TRYBOT=0
- fi
-fi
-
-readonly PARTCMD="${PYTHON} build_tools/partition.py"
-readonly SHARD_CMD="${PARTCMD} -t ${SHARD} -n ${SHARDS}"
-echo "Calculating targets for shard $((${SHARD} + 1)) of ${SHARDS}"
-PACKAGE_LIST=$(${SHARD_CMD})
-if [ -z "${PACKAGE_LIST}" ]; then
- echo "sharding command failed: ${SHARD_CMD}"
- exit 1
-fi
-
-echo "Shard contains following packages: ${PACKAGE_LIST}"
-if [ "${TRYBOT}" = "1" ]; then
- EFFECTED_FILES=$(git diff --cached --name-only origin/master)
- EFFECTED_PACKAGES=$(${PYTHON} build_tools/find_effected_packages.py \
- $EFFECTED_FILES)
- echo "Patch effects the following packages: ${EFFECTED_PACKAGES}"
- if [[ $EFFECTED_PACKAGES != "all" ]]; then
- # Run find_effected_packages again with --deps to include the dependecies
- # of the effected packages
-
- PACKAGE_LIST=$(${PYTHON} build_tools/find_effected_packages.py --deps \
- $EFFECTED_FILES <<< ${PACKAGE_LIST})
- echo "Building package subset: ${PACKAGE_LIST}"
- fi
-fi
-
-for PKG in ${PACKAGE_LIST}; do
- InstallPackageMultiArch ${PKG}
-done
-
-echo "@@@BUILD_STEP Summary@@@"
-if [[ ${RESULT} != 0 ]] ; then
- echo "@@@STEP_FAILURE@@@"
- echo -e "${MESSAGES}"
-fi
-
-exit ${RESULT}
diff --git a/build_tools/buildbot_build_toolchain.sh b/build_tools/buildbot_build_toolchain.sh
deleted file mode 100755
index 6df1a5b..0000000
--- a/build_tools/buildbot_build_toolchain.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2015 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.
-
-SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
-source ${SCRIPT_DIR}/buildbot_common.sh
-
-TOOLCHAINS="glibc clang-newlib pnacl emscripten"
-TOOLCHAIN_PACKAGES="pnacl"
-
-for TOOLCHAIN in ${TOOLCHAINS}; do
- CleanCurrentToolchain
-done
-
-for TOOLCHAIN in ${TOOLCHAINS}; do
- for pkg in ${TOOLCHAIN_PACKAGES}; do
- InstallPackageMultiArch ${pkg}
- done
-done
-
-echo "@@@BUILD_STEP Summary@@@"
-if [[ ${RESULT} != 0 ]] ; then
- echo "@@@STEP_FAILURE@@@"
- echo -e "${MESSAGES}"
-fi
-
-exit ${RESULT}
diff --git a/build_tools/buildbot_common.sh b/build_tools/buildbot_common.sh
deleted file mode 100644
index 31a08cd..0000000
--- a/build_tools/buildbot_common.sh
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-RESULT=0
-MESSAGES=
-
-# SCRIPT_DIR must be defined by the including script
-readonly BASE_DIR="$(dirname ${SCRIPT_DIR})"
-readonly PYTHON=${SCRIPT_DIR}/python_wrapper
-cd ${BASE_DIR}
-
-UPLOAD_PATH=webports/builds/${PEPPER_DIR}/
-if [ -d .git ]; then
- UPLOAD_PATH+=$(git describe)
-else
- UPLOAD_PATH+=${BUILDBOT_GOT_REVISION}
-fi
-
-#
-# Signal to buildbot that a step failed.
-# $1 - target or package name that failed.
-# $2 - architecure for which failure occured.
-#
-BuildSuccess() {
- local target=$1
- local arch=$2
- echo "webports: Build SUCCEEDED ${target} (${arch}/${TOOLCHAIN})"
-}
-
-#
-# Signal to buildbot that a step failed.
-# $1 - target or package name that failed.
-# $2 - architecure for which failure occured.
-#
-BuildFailure() {
- local target=$1
- local arch=$2
- MESSAGE="webports: Build FAILED for ${target} (${arch}/${TOOLCHAIN})"
- echo ${MESSAGE}
- echo "@@@STEP_FAILURE@@@"
- MESSAGES="${MESSAGES}\n${MESSAGE}"
- RESULT=1
- if [ "${TEST_BUILDBOT:-}" = "1" ]; then
- exit 1
- fi
-}
-
-RunCmd() {
- echo "$@"
- "$@"
-}
-
-NACLPORTS_ARGS="-v --ignore-disabled --from-source"
-export FORCE_MIRROR="yes"
-
-#
-# Build a single package for a single architecture
-# $1 - Name of package to build
-#
-BuildPackage() {
- local package=$1
- shift
- if RunCmd bin/webports ${NACLPORTS_ARGS} "$@" install ${package}; then
- BuildSuccess ${PACKAGE} ${NACL_ARCH}
- else
- BuildFailure ${PACKAGE} ${NACL_ARCH}
- fi
-}
-
-InstallPackageMultiArch() {
- echo "@@@BUILD_STEP ${TOOLCHAIN} $1@@@"
-
- if [ "${TOOLCHAIN}" = "pnacl" ]; then
- arch_list="pnacl"
- elif [ "${TOOLCHAIN}" = "emscripten" ]; then
- arch_list="emscripten"
- else
- arch_list="i686 x86_64 arm"
- fi
-
- export TOOLCHAIN
- for arch in ${arch_list}; do
- if ! RunCmd bin/webports -a ${arch} uninstall --all ; then
- BuildFailure $1 ${arch}
- return
- fi
- done
-
- for arch in ${arch_list}; do
- if ! RunCmd bin/webports -a ${arch} ${NACLPORTS_ARGS} install $1 ; then
- # Early exit if one of the architecures fails. This mean the
- # failure is always at the end of the build step.
- BuildFailure $1 ${arch}
- return
- fi
- done
- BuildSuccess $1 all
-}
-
-CleanToolchain() {
- # Don't use TOOLCHAIN and NACL_ARCH here as we don't want to
- # clobber the globals.
- TC=$1
-
- if [ "${TC}" = "pnacl" ]; then
- arch_list="pnacl"
- elif [ "${TC}" = "emscripten" ]; then
- arch_list="emscripten"
- elif [ "${TC}" = "glibc" ]; then
- arch_list="i686 x86_64"
- else
- arch_list="i686 x86_64 arm"
- fi
-
- for ARCH in ${arch_list}; do
- if ! RunCmd bin/webports -a ${ARCH} -t ${TC} clean --all; then
- TOOLCHAIN=${TC} BuildFailure clean ${ARCH}
- exit 1
- fi
- done
-}
-
-CleanCurrentToolchain() {
- echo "@@@BUILD_STEP clean@@@"
- CleanToolchain ${TOOLCHAIN}
-}
-
diff --git a/build_tools/buildbot_selector.sh b/build_tools/buildbot_selector.sh
deleted file mode 100755
index 659a1f8..0000000
--- a/build_tools/buildbot_selector.sh
+++ /dev/null
@@ -1,242 +0,0 @@
-#!/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.
-
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Main entry point for buildbots.
-# For local testing set BUILDBOT_BUILDERNAME and TEST_BUILDBOT, e.g:
-# TEST_BUILDBOT=1 BUILDBOT_BUILDERNAME=linux-pnacl-0 ./buildbot_selector.sh
-
-set -o errexit
-set -o nounset
-
-# Use this variable to pin the webports buildbots to a specific
-# SDK version. This does not apply to the nightly builders, and
-# should be left unset unless there is ongoing issue with the lastest
-# SDK build.
-PINNED_SDK_VERSION=
-
-SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
-NACLPORTS_SRC=$(dirname ${SCRIPT_DIR})
-DEFAULT_NACL_SDK_ROOT="${NACLPORTS_SRC}/out/nacl_sdk"
-NACL_SDK_ROOT=${NACL_SDK_ROOT:-${DEFAULT_NACL_SDK_ROOT}}
-export NACL_SDK_ROOT
-
-
-BOT_GSUTIL='/b/build/scripts/slave/gsutil'
-if [ -e ${BOT_GSUTIL} ]; then
- export GSUTIL=${BOT_GSUTIL}
-else
- export GSUTIL=gsutil
-fi
-
-# The bots set the BOTO_CONFIG environment variable to a different .boto file
-# (currently /b/build/site-config/.boto). override this to the gsutil default
-# which has access to gs://webports.
-# gsutil also looks for AWS_CREDENTIAL_FILE, so clear that too.
-unset AWS_CREDENTIAL_FILE
-unset BOTO_CONFIG
-
-RESULT=0
-
-# TODO: Eliminate this dependency if possible.
-# This is required on OSX so that the webports version of pkg-config can be
-# found.
-export PATH=${PATH}:/opt/local/bin
-
-if [ "${TEST_BUILDBOT:-}" = "1" -a -z "${BUILDBOT_BUILDERNAME:-}" ]; then
- export BUILDBOT_BUILDERNAME=linux-clang-0
-fi
-
-BuildShard() {
- # Select shard count
- if [ "${OS}" = "mac" ]; then
- SHARDS=2
- elif [ "${OS}" = "linux" ]; then
- if [ "${TOOLCHAIN}" = "emscripten" ]; then
- SHARDS=1
- else
- SHARDS=6
- fi
- else
- echo "Unspecified sharding for OS: ${OS}" 1>&2
- exit 1
- fi
-
- echo "@@@BUILD_STEP setup@@@"
- export TOOLCHAIN
- export SHARD
- export SHARDS
- if ! ./build_tools/buildbot_build_shard.sh ; then
- RESULT=1
- fi
-}
-
-Publish() {
- echo "@@@BUILD_STEP upload binaries@@@"
-
- if [ "$(ls out/publish)" != "" ]; then
- echo "Uploading publish directory to ${UPLOAD_PATH}"
- ${GSUTIL} cp -R -a public-read out/publish/* gs://${UPLOAD_PATH}/publish/
- else
- echo "Nothing to upload in publish directory."
- fi
-
- if [ "$(ls out/packages)" != "" ]; then
- echo "Uploading packages directory to ${UPLOAD_PATH}"
- ${GSUTIL} cp -R -a public-read out/packages/* gs://${UPLOAD_PATH}/packages/
- else
- echo "Nothing to upload in packages directory."
- fi
-
- local URL="http://gsdview.appspot.com/${UPLOAD_PATH}/"
- echo "@@@STEP_LINK@browse@${URL}@@@"
-}
-
-# Strip 'periodic-' prefix.
-BUILDBOT_BUILDERNAME=${BUILDBOT_BUILDERNAME#periodic-}
-PYTHON=${SCRIPT_DIR}/python_wrapper
-
-# Decode buildername.
-readonly BNAME_REGEX="(nightly-|webports-)?(.+)-(.+)-(.+)"
-if [[ ${BUILDBOT_BUILDERNAME} =~ ${BNAME_REGEX} ]]; then
- readonly PREFIX=${BASH_REMATCH[1]}
- if [ "${PREFIX}" = "webports-" ]; then
- readonly TRYBOT=1
- readonly NIGHTLY=0
- elif [ "${PREFIX}" = "nightly-" ]; then
- readonly TRYBOT=0
- readonly NIGHTLY=1
- else
- readonly TRYBOT=0
- readonly NIGHTLY=0
- fi
- readonly OS=${BASH_REMATCH[2]}
- readonly BOT_TYPE=${BASH_REMATCH[3]}
- readonly SHARD=${BASH_REMATCH[4]}
-else
- echo "Bad BUILDBOT_BUILDERNAME: ${BUILDBOT_BUILDERNAME}" 1>&2
- exit 1
-fi
-
-# Don't upload periodic or trybot builds.
-if [ "${TRYBOT}" = "1" -o "${NIGHTLY}" = "1" ]; then
- NACLPORTS_NO_UPLOAD=1
-fi
-
-# Select platform specific things.
-if [ "${OS}" = "win" ]; then
- PYTHON=python.bat
-fi
-
-# Convert toolchain contained in the bot name to valid TOOLCHAIN value
-# as expected by the SDK tools.
-if [ "${BOT_TYPE}" = "clang" ]; then
- TOOLCHAIN=clang-newlib
-elif [ "${BOT_TYPE}" != "toolchain" ]; then
- TOOLCHAIN=${BOT_TYPE}
-fi
-
-# Optional Clobber (if checked in the buildbot ui).
-if [ "${BUILDBOT_CLOBBER:-}" = "1" ]; then
- echo "@@@BUILD_STEP Clobber@@@"
- rm -rf out/
-fi
-
-# Install SDK.
-if [ -z "${TEST_BUILDBOT:-}" -o ! -d ${NACL_SDK_ROOT} ]; then
- echo "@@@BUILD_STEP Install Latest SDK@@@"
- ARGS=""
- if [ "${PINNED_SDK_VERSION:-}" != "" -a "${NIGHTLY}" != "1" ]; then
- ARGS+=" -v ${PINNED_SDK_VERSION}"
- fi
- echo ${PYTHON} ${SCRIPT_DIR}/download_sdk.py ${ARGS}
- ${PYTHON} ${SCRIPT_DIR}/download_sdk.py ${ARGS}
-fi
-
-InstallEmscripten() {
- echo "@@@BUILD_STEP Install Emscripten SDK@@@"
- # Download the Emscripten SDK and set the environment variables
- local DEFAULT_EMSCRIPTEN_ROOT="${NACLPORTS_SRC}/out/emsdk"
- local EMSDK_ROOT=${EMSDK_ROOT:-${DEFAULT_EMSCRIPTEN_ROOT}}
- local EMSCRIPTEN_ROOT=${EMSDK_ROOT}/emscripten
- echo ${PYTHON} ${SCRIPT_DIR}/download_emscripten.py
- ${PYTHON} ${SCRIPT_DIR}/download_emscripten.py
-
- # Mechanism by which emscripten patches can be tested on the trybots
- if [ -f "${NACLPORTS_SRC}/emscripten.patch" ]; then
- cd ${EMSCRIPTEN_ROOT}
- echo "Applying emscripten.patch"
- git apply "${NACLPORTS_SRC}/emscripten.patch"
- cd -
- fi
-}
-
-Unittests() {
- echo "@@@BUILD_STEP webports unittests@@@"
- CMD="make -C $(dirname ${SCRIPT_DIR}) check"
- echo "Running ${CMD}"
- if ! ${CMD}; then
- RESULT=1
- echo "@@@STEP_FAILURE@@@"
- fi
-}
-
-# Test browser testing harness.
-PlumbingTests() {
- echo "@@@BUILD_STEP plumbing_tests i686@@@"
- if ! ${PYTHON} ${SCRIPT_DIR}/../chrome_test/plumbing_test.py \
- -a i686 -x -vv; then
- RESULT=1
- echo "@@@STEP_FAILURE@@@"
- fi
- if [ "${OS}" = "linux" ]; then
- echo "@@@BUILD_STEP plumbing_tests x86_64@@@"
- if ! ${PYTHON} ${SCRIPT_DIR}/../chrome_test/plumbing_test.py \
- -a x86_64 -x -vv; then
- RESULT=1
- echo "@@@STEP_FAILURE@@@"
- fi
- fi
-}
-
-if [[ ${TOOLCHAIN:-} == emscripten || ${BOT_TYPE} == toolchain ]]; then
- InstallEmscripten
-fi
-
-Unittests
-
-if [ -z "${TEST_BUILDBOT:-}" ]; then
- PlumbingTests
-fi
-
-# PEPPER_DIR is the root direcotry name within the bundle. e.g. pepper_28
-export PEPPER_VERSION=$(${NACL_SDK_ROOT}/tools/getos.py --sdk-version)
-export PEPPER_DIR=pepper_${PEPPER_VERSION}
-export NACLPORTS_ANNOTATE=1
-. ${SCRIPT_DIR}/buildbot_common.sh
-
-
-if [[ ${BOT_TYPE} == toolchain ]]; then
- ./build_tools/buildbot_build_toolchain.sh
-else
- CleanCurrentToolchain
- BuildShard
-fi
-
-# Publish resulting builds to Google Storage, but only on the
-# linux bots.
-if [ -z "${NACLPORTS_NO_UPLOAD:-}" -a "${OS}" = "linux" ]; then
- Publish
-fi
-
-echo "@@@BUILD_STEP Summary@@@"
-if [ "${RESULT}" != "0" ] ; then
- echo "@@@STEP_FAILURE@@@"
- echo -e "${MESSAGES}"
-fi
-
-exit ${RESULT}
diff --git a/build_tools/buildbot_test.sh b/build_tools/buildbot_test.sh
deleted file mode 100755
index 40cb021..0000000
--- a/build_tools/buildbot_test.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2013 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.
-
-export TEST_BUILDBOT=1
-export NACLPORTS_NO_UPLOAD=1
-export BUILDBOT_BUILDERNAME=webports-linux-clang-0
-# BUILDBOT_REVISION is used in the foldername when
-# publishing data to Google Cloud Storage. Set to a unique
-# value for testing purposes.
-export BUILDBOT_REVISION=9111111
-
-SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
-${SCRIPT_DIR}/buildbot_selector.sh
diff --git a/build_tools/check_deps.py b/build_tools/check_deps.py
deleted file mode 100755
index 8a21ff1..0000000
--- a/build_tools/check_deps.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 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.
-"""Tool which checks the dependencies of all packages.
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(os.path.dirname(SCRIPT_DIR), 'lib'))
-
-import webports
-import webports.source_package
-
-
-def main(args):
- parser = argparse.ArgumentParser()
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Output extra information.')
- options = parser.parse_args(args)
- if options.verbose:
- webports.SetVerbose(True)
- count = 0
-
- package_names = [os.path.basename(p.root)
- for p in webports.source_package.SourcePackageIterator()]
-
- for package in webports.source_package.SourcePackageIterator():
- if not package.CheckDeps(package_names):
- return 1
- count += 1
- webports.Log("Verfied dependencies for %d packages" % count)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/check_licenses.py b/build_tools/check_licenses.py
deleted file mode 100755
index 279dbce..0000000
--- a/build_tools/check_licenses.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 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.
-"""Tool that checks the LICENSE field of all packages.
-
-Currently it preforms the following simple check:
- - LICENSE field exists
- - LICENSE field contains only known licenses
- - Where a custom files is specified check that the file
- exists in the archive
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(os.path.dirname(SCRIPT_DIR), 'lib'))
-
-import webports
-import webports.source_package
-
-VALID_LICENSES = ['GPL', 'GPL2', 'GPL3', 'LGPL', 'LGPL2', 'LGPL3', 'ISC', 'MPL',
- 'BSD', 'MIT', 'ZLIB', 'CUSTOM', 'APACHE']
-
-options = None
-
-
-def CheckLicense(package):
- if not package.LICENSE:
- print('%-27s: missing license field' % package.NAME)
- package.Download()
- package.Extract()
- return 1
-
- rtn = 0
- licenses = package.LICENSE.split(',')
- if options.verbose:
- print('%-27s: %s' % (package.NAME, licenses))
- licenses = [l.split(':') for l in licenses]
- for license_info in licenses:
- if license_info[0] not in VALID_LICENSES:
- print('%s: Invalid license: %s' % (package.root, license_info[0]))
- rtn = 1
- if len(license_info) > 1:
- package.Download()
- package.Extract()
- filename = os.path.join(package.GetBuildLocation(), license_info[1])
- if not os.path.exists(filename):
- print('Missing license file: %s' % filename)
- rtn = 1
-
- return rtn
-
-
-def main(args):
- global options
- parser = argparse.ArgumentParser()
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Output extra information.')
- options = parser.parse_args(args)
- if options.verbose:
- webports.SetVerbose(True)
- rtn = False
-
- count = 0
- for package in webports.source_package.SourcePackageIterator():
- rtn |= CheckLicense(package)
- count += 1
-
- if not rtn:
- print("Verfied licenses for %d packages" % count)
-
- return rtn
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/check_needed_order.py b/build_tools/check_needed_order.py
deleted file mode 100755
index 68a139e..0000000
--- a/build_tools/check_needed_order.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2015 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.
-
-"""Tool to check if a glibc binary has a valid NEEDED order."""
-
-import os
-import re
-import subprocess
-import sys
-
-
-def Check(filename):
- lines = subprocess.check_output(
- [os.environ.get('OBJDUMP', 'objdump'), '-p', filename]).splitlines()
- needed = [i for i in lines if 'NEEDED' in i]
- names = [re.match('[ ]+NEEDED[ ]+(.*)', i).group(1) for i in needed]
- pthread = -1
- nacl_io = -1
- nacl_spawn = -1
- for i, name in enumerate(names):
- if nacl_io < 0 and name == 'libnacl_io.so':
- nacl_io = i
- elif nacl_spawn < 0 and name == 'libnacl_spawn.so':
- nacl_spawn = i
- elif pthread < 0 and name.startswith('libpthread.so'):
- pthread = i
- if pthread != -1 and (pthread < nacl_io or pthread < nacl_spawn):
- print 'Executable %s has bad NEEDED order: %s' % (filename, ' '.join(names))
- return 1
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(Check(sys.argv[1]))
diff --git a/build_tools/check_sums.py b/build_tools/check_sums.py
deleted file mode 100755
index 98f0746..0000000
--- a/build_tools/check_sums.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 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.
-"""Tool which checks the sha1 sums of all packages.
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(os.path.dirname(SCRIPT_DIR), 'lib'))
-
-import webports
-import webports.source_package
-
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Output extra information.')
- options = parser.parse_args(args)
- if options.verbose:
- webports.SetVerbose(True)
- count = 0
-
- for package in webports.source_package.SourcePackageIterator():
- package.Download()
- count += 1
-
- webports.Log("Verfied checksums for %d packages" % count)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/clean_pyc.py b/build_tools/clean_pyc.py
deleted file mode 100755
index 77edf5a..0000000
--- a/build_tools/clean_pyc.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-"""Script to cleanup stale .pyc files.
-
-This script is run by gclient run-hooks (see DEPS)
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import sys
-
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('directories', metavar='DIR', nargs='+',
- help='directory to search for pyc files')
- args = parser.parse_args()
- for directory in args.directories:
- assert os.path.isdir(directory)
- for root, _, files in os.walk(directory):
- for filename in files:
- basename, ext = os.path.splitext(filename)
- if ext == '.pyc':
- py_file = os.path.join(root, basename + '.py')
- if not os.path.exists(py_file):
- pyc_file = os.path.join(root, filename)
- print('Removing stale pyc file: %s' % pyc_file)
- os.remove(pyc_file)
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/common.sh b/build_tools/common.sh
deleted file mode 100644
index 9203015..0000000
--- a/build_tools/common.sh
+++ /dev/null
@@ -1,1613 +0,0 @@
-# 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.
-#
-# Environment variable NACL_ARCH should be set to one of the following
-# values: i686 x86_64 pnacl arm
-
-
-# NAMING CONVENTION
-# =================
-#
-# This file is source'd by the build_port script. Functions and variables
-# defined here are available in the build script for individual ports. Only
-# variables beginning with "NACL_" are intended to be used by those scripts.
-
-set -o nounset
-set -o errexit
-
-unset MAKEFLAGS
-
-readonly TOOLS_DIR=$(cd "$(dirname "${BASH_SOURCE}")" ; pwd)
-START_DIR=${PWD}
-readonly NACL_SRC=$(dirname "${TOOLS_DIR}")
-readonly NACL_PACKAGES=${NACL_SRC}
-
-NACL_DEBUG=${NACL_DEBUG:-0}
-
-WEBPORTS_ENV_IMPORT=1
-. "${TOOLS_DIR}/webports-env.sh"
-
-# export tool names for direct use in patches.
-export NACLCC
-export NACLCXX
-export NACLAR
-export NACLRANLIB
-export NACLLD
-export NACLREADELF
-export NACLSTRINGS
-export NACLSTRIP
-export NACL_EXEEXT
-
-# sha1check python script
-readonly SHA1CHECK=${TOOLS_DIR}/sha1check.py
-
-readonly NACLPORTS_INCLUDE=${NACL_PREFIX}/include
-readonly NACLPORTS_LIBDIR=${NACL_PREFIX}/lib
-readonly NACLPORTS_BIN=${NACL_PREFIX}/bin
-
-readonly GTEST_SRC=$NACL_PREFIX/src/gtest
-
-# The prefix used when configuring packages. Since we want to build re-usable
-# re-locatable binary packages, we use a dummy value here and then modify
-# at install time certain parts of package (e.g. pkgconfig .pc files) that
-# embed this this information.
-readonly PREFIX=/webports-dummydir
-
-NACLPORTS_LIBS=""
-NACLPORTS_CFLAGS=""
-NACLPORTS_CXXFLAGS=""
-NACLPORTS_CPPFLAGS="${NACL_CPPFLAGS}"
-NACLPORTS_LDFLAGS="${NACL_LDFLAGS}"
-
-# i686-nacl-clang doesn't currently know about i686-nacl/usr/include
-# or i686-nacl/usr/lib. Instead it shared the headers with x86_64
-# and uses x86_64-nacl/usr/lib32.
-# TODO(sbc): remove this once we fix:
-# https://code.google.com/p/nativeclient/issues/detail?id=4108
-if [ "${TOOLCHAIN}" = "clang-newlib" -a "${NACL_ARCH}" = "i686" ]; then
- NACLPORTS_CPPFLAGS+=" -isystem ${NACLPORTS_INCLUDE}"
- NACLPORTS_LDFLAGS+=" -L${NACLPORTS_LIBDIR}"
-fi
-
-if [ "${TOOLCHAIN}" = "clang-newlib" -o "${TOOLCHAIN}" = "pnacl" -o \
- "${TOOLCHAIN}" = "emscripten" ]; then
- NACLPORTS_CLANG=1
-else
- NACLPORTS_CLANG=0
-fi
-
-# If stderr is a tty enable clang color compiler diagnostics
-if [ -t 1 -a "${NACLPORTS_CLANG}" = "1" ]; then
- NACLPORTS_CPPFLAGS+=" -fcolor-diagnostics"
- NACLPORTS_LDFLAGS+=" -fcolor-diagnostics"
-fi
-
-# TODO(sbc): Remove once the toolchainge gets fixed:
-# https://code.google.com/p/nativeclient/issues/detail?id=4333
-if [[ ${TOOLCHAIN} = pnacl ]]; then
- NACLPORTS_CPPFLAGS+=" -fgnu-inline-asm"
-fi
-
-# The new arm-nacl-gcc glibc toolchain supports color diagnostics, but older
-# x86 versions do not.
-if [ "${TOOLCHAIN}" = "glibc" -a "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -fdiagnostics-color=auto"
- NACLPORTS_LDFLAGS+=" -fdiagnostics-color=auto"
-fi
-
-if [ "${NACL_ARCH}" = "emscripten" ]; then
- NACLPORTS_CFLAGS+=" -Wno-warn-absolute-paths"
- NACLPORTS_CXXFLAGS+=" -Wno-warn-absolute-paths"
-fi
-
-# configure spec for if MMX/SSE/SSE2/Assembly should be enabled/disabled
-# TODO: Currently only x86-32 will encourage MMX, SSE & SSE2 intrinsics
-# and handcoded assembly.
-if [ "${NACL_ARCH}" = "i686" ]; then
- readonly NACL_OPTION="enable"
-else
- readonly NACL_OPTION="disable"
-fi
-
-# Set NACL_SHARED when we want to build shared libraries.
-if [ "${NACL_LIBC}" = "glibc" ]; then
- NACL_SHARED=1
-else
- NACL_SHARED=0
-fi
-
-# libcli_main.a has a circular dependency which makes static link fail
-# (cli_main => nacl_io => ppapi_cpp => cli_main). To break this loop,
-# you should use this instead of -lcli_main.
-NACL_CLI_MAIN_LDFLAGS="-Xlinker -uPSUserMainGet"
-NACL_CLI_MAIN_LIB="-lcli_main -lnacl_spawn -ltar -lppapi_simple \
--lnacl_io -lppapi -l${NACL_CXX_LIB}"
-NACL_CLI_MAIN_LIB_CPP="-lcli_main -lnacl_spawn -ltar -lppapi_simple_cpp \
--lnacl_io -lppapi_cpp -lppapi -l${NACL_CXX_LIB}"
-
-# Python variables
-NACL_PYSETUP_ARGS=""
-NACL_BUILD_SUBDIR=build
-NACL_INSTALL_SUBDIR=install
-
-# output directories
-readonly NACL_PACKAGES_OUT=${NACL_SRC}/out
-readonly NACL_PACKAGES_ROOT=${NACL_PACKAGES_OUT}/packages
-readonly NACL_PACKAGES_BUILD=${NACL_PACKAGES_OUT}/build
-readonly NACL_PACKAGES_PUBLISH=${NACL_PACKAGES_OUT}/publish
-readonly NACL_PACKAGES_CACHE=${NACL_PACKAGES_OUT}/cache
-readonly NACL_PACKAGES_STAMPDIR=${NACL_PACKAGES_OUT}/stamp
-readonly NACL_HOST_PYROOT=${NACL_PACKAGES_BUILD}/python-host/install_host
-readonly NACL_HOST_PYBUILD=${NACL_PACKAGES_BUILD}/python-host/build_host
-readonly NACL_HOST_PYTHON=${NACL_HOST_PYROOT}/bin/python2.7
-readonly NACL_DEST_PYROOT=${NACL_PREFIX}
-readonly SITE_PACKAGES="lib/python2.7/site-packages/"
-
-# The components of package names cannot contain underscore
-# characters so use x86-64 rather then x86_64 for arch component.
-if [ "${NACL_ARCH}" = "x86_64" ]; then
- PACKAGE_SUFFIX="_x86-64"
-else
- PACKAGE_SUFFIX="_${NACL_ARCH}"
-fi
-
-if [ "${NACL_ARCH}" != "pnacl" -a "${NACL_ARCH}" != "emscripten" ]; then
- PACKAGE_SUFFIX+=_${TOOLCHAIN}
-fi
-
-if [ "${NACL_DEBUG}" = "1" ]; then
- PACKAGE_SUFFIX+=_debug
-fi
-
-NACL_BUILD_SUBDIR+=${PACKAGE_SUFFIX}
-NACL_INSTALL_SUBDIR+=${PACKAGE_SUFFIX}
-readonly DEST_PYTHON_OBJS=${NACL_PACKAGES_BUILD}/python-modules/${NACL_BUILD_SUBDIR}
-PACKAGE_FILE=${NACL_PACKAGES_ROOT}/${NAME}_${VERSION}${PACKAGE_SUFFIX}.tar.bz2
-
-NACLPORTS_QUICKBUILD=${NACLPORTS_QUICKBUILD:-0}
-
-# Number of simultaneous jobs to run during parallel build.
-# Setting OS_JOBS=1 in the envrionment can be useful when debugging
-# build failures in building system that interleave the output of
-# of different jobs.
-if [ -z "${OS_JOBS:-}" ]; then
- if [ "${OS_NAME}" = "Darwin" ]; then
- OS_JOBS=4
- elif [ "${OS_NAME}" = "Linux" ]; then
- OS_JOBS=$(nproc)
- else
- OS_JOBS=1
- fi
-fi
-
-CONF_BUILD=$(/bin/sh "${SCRIPT_DIR}/config.guess")
-CONF_HOST=${NACL_CROSS_PREFIX}
-# TODO(gdeepti): Investigate whether emscripten accurately fits this case for
-# long term usage.
-if [[ ${NACL_ARCH} == pnacl ]]; then
- # The PNaCl tools use "pnacl-" as the prefix, but config.sub
- # does not know about "pnacl". It only knows about "le32-nacl".
- # Unfortunately, most of the config.subs here are so old that
- # it doesn't know about that "le32" either. So we just say "nacl".
- CONF_HOST="nacl"
-fi
-
-GomaTest() {
- # test the goma compiler
- if [ "${NACL_GOMA_FORCE:-}" = 1 ]; then
- return 0
- fi
- echo 'int foo = 4;' > goma_test.c
- GOMA_USE_LOCAL=false GOMA_FALLBACK=false gomacc "$1" -c \
- goma_test.c -o goma_test.o 2> /dev/null
- local RTN=$?
- rm -f goma_test.c
- rm -f goma_test.o
- return ${RTN}
-}
-
-# If NACL_GOMA is defined then we check for goma and use it if its found.
-if [ -n "${NACL_GOMA:-}" ]; then
- if [ "${NACL_ARCH}" != "pnacl" -a
- "${NACL_ARCH}" != "arm" -a
- "${NACL_ARCH}" != "emscripten"]; then
- # Assume that if CC is good then so is CXX since GomaTest is actually
- # quite slow
- if GomaTest "${NACLCC}"; then
- NACLCC="gomacc ${NACLCC}"
- NACLCXX="gomacc ${NACLCXX}"
- # There is a bug in goma right now where the i686 compiler wrapper script
- # is not correctly handled and gets confused with the x86_64 version.
- # We need to pass a redundant -m32, to force it to compiler for i686.
- if [ "${NACL_ARCH}" = "i686" ]; then
- NACLPORTS_CFLAGS+=" -m32"
- NACLPORTS_CXXFLAGS+=" -m32"
- fi
- OS_JOBS=100
- echo "Using GOMA!"
- fi
- fi
-fi
-
-if [ "${NACL_DEBUG}" = "1" ]; then
- NACL_CONFIG=Debug
-else
- NACL_CONFIG=Release
-fi
-
-# ARCHIVE_ROOT (the folder contained within that archive) defaults to
-# the NAME-VERSION. Packages with non-standard contents can override
-# this before including common.sh
-PACKAGE_NAME=${NAME}
-ARCHIVE_ROOT=${ARCHIVE_ROOT:-${NAME}-${VERSION}}
-WORK_DIR=${NACL_PACKAGES_BUILD}/${NAME}
-SRC_DIR=${WORK_DIR}/${ARCHIVE_ROOT}
-DEFAULT_BUILD_DIR=${WORK_DIR}/${NACL_BUILD_SUBDIR}
-BUILD_DIR=${NACL_BUILD_DIR:-${DEFAULT_BUILD_DIR}}
-INSTALL_DIR=${WORK_DIR}/${NACL_INSTALL_SUBDIR}
-NACL_CONFIGURE_PATH=${NACL_CONFIGURE_PATH:-${SRC_DIR}/configure}
-
-
-# DESTDIR is where the headers, libraries, etc. will be installed
-# Default to the usr folder within the SDK.
-if [ -z "${DESTDIR:-}" ]; then
- readonly DEFAULT_DESTDIR=1
- DESTDIR=${INSTALL_DIR}
-fi
-
-DESTDIR_LIB=${DESTDIR}/${PREFIX}/lib
-DESTDIR_BIN=${DESTDIR}/${PREFIX}/bin
-DESTDIR_INCLUDE=${DESTDIR}/${PREFIX}/include
-
-PUBLISH_DIR="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}/${TOOLCHAIN}"
-PUBLISH_CREATE_NMF_ARGS="-L ${DESTDIR_LIB}"
-
-if [[ ${OS_NAME} == Linux ]]; then
- SEL_LDR_SUPPORTS_ARM=1
-else
- SEL_LDR_SUPPORTS_ARM=0
-fi
-
-SKIP_SEL_LDR_TESTS=0
-
-# Skip sel_ldr tests on ARM, except on linux where we have qemu-arm available.
-if [[ ${NACL_ARCH} == arm && ${SEL_LDR_SUPPORTS_ARM} == 0 ]]; then
- SKIP_SEL_LDR_TESTS=1
-fi
-
-# Skip sel_ldr tests when building x86_64 targets on a 32-bit host
-if [ "${NACL_ARCH}" = "x86_64" -a "${HOST_IS_32BIT}" = "1" ]; then
- echo "WARNING: Building x86_64 targets on i686 host. Cannot run tests."
- SKIP_SEL_LDR_TESTS=1
-fi
-
-
-######################################################################
-# Always run
-######################################################################
-
-InstallConfigSite() {
- CONFIG_SITE=${NACL_PREFIX}/share/config.site
- MakeDir "${NACL_PREFIX}/share"
- echo "ac_cv_exeext=${NACL_EXEEXT}" > "${CONFIG_SITE}"
-}
-
-
-#
-# $1 - src
-# $2 - dest
-#
-InstallHeader() {
- local src=$1
- local dest=$2
- if [ -f "${dest}" ]; then
- if cmp "${src}" "${dest}" > /dev/null; then
- return
- fi
- fi
- MakeDir "$(dirname ${dest})"
- LogExecute install -m 644 "${src}" "${dest}"
-}
-
-#
-# When configure checks for system headers is doesn't pass CFLAGS
-# to the compiler. This means that any includes that live in paths added
-# with -I are not found. Here we push the additional newlib headers
-# into the toolchain itself from ${NACL_SDK_ROOT}/include/<toolchain>.
-#
-InjectSystemHeaders() {
- if [ ${TOOLCHAIN} = "clang-newlib" ]; then
- local TC_DIR=pnacl
- else
- local TC_DIR=${TOOLCHAIN}
- fi
-
- if [ ${TOOLCHAIN} = "glibc" ]; then
- InstallHeader "${TOOLS_DIR}/stubs.h" "${NACLPORTS_INCLUDE}/gnu/stubs.h"
- fi
-
- local TC_INCLUDES=${NACL_SDK_ROOT}/include/${TC_DIR}
- if [ ! -d "${TC_INCLUDES}" ]; then
- return
- fi
-
- MakeDir ${NACLPORTS_INCLUDE}
- for inc in $(find ${TC_INCLUDES} -type f); do
- inc="${inc#${TC_INCLUDES}}"
- inc="${inc#${TOOLS_DIR}}"
- src="${TC_INCLUDES}${inc}"
- dest="${NACLPORTS_INCLUDE}${inc}"
- InstallHeader $src $dest
- done
-}
-
-
-PatchSpecsFile() {
- if [ "${TOOLCHAIN}" = "pnacl" -o \
- "${TOOLCHAIN}" = "clang-newlib" -o \
- "${TOOLCHAIN}" = "emscripten" ]; then
- # The emscripten and PNaCl toolchains already include the required
- # include and library paths by default. No need to patch them.
- return
- fi
-
- # For the library path we always explicitly add to the link flags
- # otherwise 'libtool' won't find the libraries correctly. This
- # is because libtool uses 'gcc -print-search-dirs' which does
- # not honor the external specs file.
- NACLPORTS_LDFLAGS+=" -L${NACLPORTS_LIBDIR}"
- NACLPORTS_LDFLAGS+=" -Wl,-rpath-link=${NACLPORTS_LIBDIR}"
-
- # SPECS_FILE is where nacl-gcc 'specs' file will be installed
- local SPECS_DIR=
- if [ "${NACL_ARCH}" = "arm" ]; then
- SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/arm-nacl/4.8.3
- if [ ! -d "${SPECS_DIR}" ]; then
- SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/arm-nacl/4.9.2
- fi
- else
- SPECS_DIR=${NACL_TOOLCHAIN_ROOT}/lib/gcc/x86_64-nacl/4.4.3
- fi
- if [ ! -d "${SPECS_DIR}" ]; then
- echo "error: gcc directory not found: ${SPECS_DIR}"
- exit 1
- fi
- local SPECS_FILE=${SPECS_DIR}/specs
-
- # NACL_SDK_MULITARCH_USR is a version of NACL_TOOLCHAIN_ROOT that gets passed
- # into the gcc specs file. It has a gcc spec-file conditional for
- # ${NACL_ARCH}
- local NACL_SDK_MULTIARCH_USR="${NACL_TOOLCHAIN_ROOT}/\%\(nacl_arch\)/usr"
- local NACL_SDK_MULTIARCH_USR_INCLUDE="${NACL_SDK_MULTIARCH_USR}/include"
- local NACL_SDK_MULTIARCH_USR_LIB="${NACL_SDK_MULTIARCH_USR}/lib"
- local ERROR_MSG="Shared libraries are not supported by newlib toolchain"
-
- # fix up spaces so gcc sees entire path
- local SED_SAFE_SPACES_USR_INCLUDE=${NACL_SDK_MULTIARCH_USR_INCLUDE/ /\ /}
- local SED_SAFE_SPACES_USR_LIB=${NACL_SDK_MULTIARCH_USR_LIB/ /\ /}
-
- if [ -f ${SPECS_FILE} ]; then
- if grep -q nacl_arch ${SPECS_FILE}; then
- echo "Specs file already patched"
- return
- fi
- echo "Patching existing specs file"
- cp ${SPECS_FILE} ${SPECS_FILE}.current
- else
- echo "Creating new specs file"
- ${NACLCC} -dumpspecs > ${SPECS_FILE}.current
- fi
-
- # add include & lib search paths to specs file
- if [ "${NACL_ARCH}" = "arm" ]; then
- local ARCH_SUBST='/\*cpp:/ {
- printf("*nacl_arch:\narm-nacl\n\n", $1); }
- { print $0; }'
- else
- local ARCH_SUBST='/\*cpp:/ {
- printf("*nacl_arch:\n%%{m64:x86_64-nacl; m32:i686-nacl; :x86_64-nacl}\n\n", $1); }
- { print $0; }'
- fi
-
- awk "${ARCH_SUBST}" < ${SPECS_FILE}.current |\
- sed "/*cpp:/{
- N
- s|$| -isystem ${SED_SAFE_SPACES_USR_INCLUDE}|
- }" |\
- sed "/*link_libgcc:/{
- N
- s|$| -rpath-link=${SED_SAFE_SPACES_USR_LIB} -L${SED_SAFE_SPACES_USR_LIB}|
- }" > "${SPECS_FILE}"
-
- # For static-only toolchains (i.e. pnacl), modify the specs file to give an
- # error when attempting to create a shared object.
- if [ "${NACL_SHARED}" != "1" ]; then
- sed -i.bak "s/%{shared:-shared/%{shared:%e${ERROR_MSG}/" "${SPECS_FILE}"
- fi
-
-}
-
-
-######################################################################
-# Helper functions
-######################################################################
-
-Banner() {
- echo "######################################################################"
- echo "$@"
- echo "######################################################################"
-}
-
-
-#
-# echo a command to stdout and then execute it.
-#
-LogExecute() {
- echo "$@"
- "$@"
-}
-
-
-#
-# Return 0 if the current port's URL points to a git repo, 1 otherwise.
-#
-IsGitRepo() {
- if [ -z "${URL:-}" ]; then
- return 1
- fi
-
- local GIT_URL=${URL%@*}
-
- if [[ "${#GIT_URL}" -ge "4" ]] && [[ "${GIT_URL:(-4)}" == ".git" ]]; then
- return 0
- else
- return 1
- fi
-}
-
-
-#
-# Return 0 if the current port is autoconf-based, 1 otherwise.
-# This must be called after the source archive is expanded
-# as it inspects the contents of ${SRC_DIR}
-#
-IsAutoconfProject() {
- if [ -f "${NACL_CONFIGURE_PATH}" ]; then
- return 0
- else
- return 1
- fi
-}
-
-
-#
-# Return 0 if the current port is cmake-based, 1 otherwise.
-# This must be called after the source archive is expanded
-# as it inspects the contents of ${current}
-#
-IsCMakeProject() {
- if IsAutoconfProject; then
- return 1
- fi
- if [ -f "${SRC_DIR}/CMakeLists.txt" ]; then
- return 0
- else
- return 1
- fi
-}
-
-
-#
-# Add optimization flags for either debug or release configuration.
-# This is not done for cmake-based projects as cmake adds these
-# internally.
-#
-SetOptFlags() {
- if IsCMakeProject; then
- return
- fi
-
- if [ "${NACL_DEBUG}" = "1" ]; then
- NACLPORTS_CFLAGS+=" -g -O0"
- NACLPORTS_CXXFLAGS+=" -g -O0"
- else
- NACLPORTS_CFLAGS+=" -DNDEBUG -O2"
- NACLPORTS_CXXFLAGS+=" -DNDEBUG -O2"
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- NACLPORTS_LDFLAGS+=" -DNDEBUG -O2"
- fi
- fi
-}
-
-EnableCliMain() {
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- return
- fi
- NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
- NACLPORTS_LIBS+=" ${NACL_CLI_MAIN_LIB}"
-}
-
-EnableCliMainCxx() {
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- return
- fi
- NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
- NACLPORTS_LIBS+=" ${NACL_CLI_MAIN_LIB_CPP}"
-}
-
-EnableGlibcCompat() {
- if [ "${NACL_LIBC}" = "newlib" ]; then
- NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
- NACLPORTS_LIBS+=" -lglibc-compat"
- fi
-}
-
-#
-# Attempt to download a file from a given URL
-# $1 - URL to fetch
-# $2 - Filename to write to.
-#
-TryFetch() {
- local URL=$1
- local FILENAME=$2
- Banner "Fetching ${PACKAGE_NAME} (${FILENAME})"
- # Send curl's status messages to stdout rather then stderr
- CURL_ARGS="--fail --location --stderr -"
- if [ -t 1 ]; then
- # Add --progress-bar but only if stdout is a TTY device.
- CURL_ARGS+=" --progress-bar"
- else
- # otherwise suppress all status output, since curl always
- # assumes a TTY and writes \r and \b characters.
- CURL_ARGS+=" --silent"
- fi
- if which curl > /dev/null ; then
- curl ${CURL_ARGS} -o "${FILENAME}" "${URL}"
- else
- echo "error: could not find 'curl' in your PATH"
- exit 1
- fi
-}
-
-
-#
-# Download a file from a given URL
-# $1 - URL to fetch
-# $2 - Filename to write to.
-#
-Fetch() {
- local URL=$1
- local FILENAME=$2
- local MIRROR_URL=http://storage.googleapis.com/webports/mirror
- if echo ${URL} | grep -qv http://storage.googleapis.com &> /dev/null; then
- set +o errexit
- # Try mirrored version first
- local BASENAME=${URL_FILENAME:-$(basename ${URL})}
- TryFetch "${MIRROR_URL}/${BASENAME}" "${FILENAME}"
- if [ $? != 0 -a ${FORCE_MIRROR:-no} = "no" ]; then
- # Fall back to original URL
- TryFetch "${URL}" "${FILENAME}"
- fi
- set -o errexit
- else
- # The URL is already on Google Clound Storage do just download it
- TryFetch "${URL}" "${FILENAME}"
- fi
-
- if [ ! -s "${FILENAME}" ]; then
- echo "ERROR: failed to download ${FILENAME}"
- exit -1
- fi
-}
-
-
-#
-# verify the sha1 checksum of given file
-# $1 - filename
-# $2 - checksum (as hex string)
-#
-CheckHash() {
- if echo "$2 *$1" | "${SHA1CHECK}"; then
- return 0
- else
- return 1
- fi
-}
-
-
-VerifyPath() {
- # make sure path isn't all slashes (possibly from an unset variable)
- local PATH=$1
- local TRIM=${PATH##/}
- if [ ${#TRIM} -ne 0 ]; then
- return 0
- else
- return 1
- fi
-}
-
-
-ChangeDir() {
- local NAME="$1"
- if VerifyPath "${NAME}"; then
- echo "chdir ${NAME}"
- cd "${NAME}"
- else
- echo "ChangeDir called with bad path."
- exit -1
- fi
-}
-
-
-Remove() {
- for filename in $*; do
- if VerifyPath "${filename}"; then
- rm -rf "${filename}"
- else
- echo "Remove called with bad path: ${filename}"
- exit -1
- fi
- done
-}
-
-
-MakeDir() {
- local NAME="$1"
- if VerifyPath "${NAME}"; then
- mkdir -p "${NAME}"
- else
- echo "MakeDir called with bad path."
- exit -1
- fi
-}
-
-
-MakeDirs() {
- MakeDir "${NACL_PACKAGES_ROOT}"
- MakeDir "${NACL_PACKAGES_BUILD}"
- # If 'tarballs' directory exists then rename it to the new name: 'cache'.
- # TODO(sbc): remove this once the new name as been in existence for
- # a few months.
- if [ ! -d "${NACL_PACKAGES_CACHE}" -a -d "${NACL_PACKAGES_OUT}/tarballs" ]; then
- mv "${NACL_PACKAGES_OUT}/tarballs" "${NACL_PACKAGES_CACHE}"
- fi
- MakeDir "${NACL_PACKAGES_CACHE}"
- MakeDir "${NACL_PACKAGES_PUBLISH}"
- MakeDir "${WORK_DIR}"
-}
-
-
-#
-# Assemble a multi-arch version for use in the devenv packaged app.
-#
-#
-PublishMultiArch() {
- local binary=$1
- local target=$2
-
- if [ $# -gt 2 ]; then
- local assembly_dir="${PUBLISH_DIR}/$3"
- else
- local assembly_dir="${PUBLISH_DIR}"
- fi
-
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- LogExecute cp ${BUILD_DIR}/${binary} ${target}${NACL_EXEEXT}
- return
- fi
-
- local platform_dir="${assembly_dir}/_platform_specific/${NACL_ARCH}"
- MakeDir ${platform_dir}
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- # Add something to the per-arch directory there so the store will accept
- # the app even if nothing else ends up there. This currently happens in
- # the pnacl case, where there's nothing that's per architecture.
- touch ${platform_dir}/MARKER
-
- local exe="${assembly_dir}/${target}${NACL_EXEEXT}"
- LogExecute ${PNACLFINALIZE} ${BUILD_DIR}/${binary} -o ${exe}
- ChangeDir ${assembly_dir}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${exe} -s . -o ${target}.nmf
- else
- local exe="${platform_dir}/${target}${NACL_EXEEXT}"
- LogExecute cp ${BUILD_DIR}/${binary} ${exe}
- ChangeDir ${assembly_dir}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py --no-arch-prefix \
- _platform_specific/*/${target}*${NACL_EXEEXT} \
- -s . -o ${target}.nmf
- fi
-}
-
-
-#
-# CheckStamp: checks for the existence of a stamp file
-# $1 - Name of stamp file.
-#
-CheckStamp() {
- local STAMP_DIR="${NACL_PACKAGES_STAMPDIR}/${PACKAGE_NAME}"
- local STAMP_FILE="${STAMP_DIR}/$1"
- # check the stamp file exists and is newer and dependency
- if [ ! -f "${STAMP_FILE}" ]; then
- return 1
- fi
- return 0
-}
-
-
-TouchStamp() {
- local STAMP_DIR=${NACL_PACKAGES_STAMPDIR}/${PACKAGE_NAME}
- MakeDir "${STAMP_DIR}"
- touch "${STAMP_DIR}/$1"
-}
-
-
-InstallNaClTerm() {
- local INSTALL_DIR=$1
- local CHROMEAPPS=${NACL_SRC}/third_party/libapps/
- local LIB_DOT=${CHROMEAPPS}/libdot
- local HTERM=${CHROMEAPPS}/hterm
- LIBDOT_SEARCH_PATH=${CHROMEAPPS} LogExecute "${LIB_DOT}/bin/concat.sh" \
- -i "${HTERM}/concat/hterm_deps.concat" -o "${INSTALL_DIR}/hterm.concat.js"
- LIBDOT_SEARCH_PATH=${CHROMEAPPS} LogExecute ${LIB_DOT}/bin/concat.sh \
- -i "${HTERM}/concat/hterm.concat" -o "${INSTALL_DIR}/hterm2.js"
- chmod +w "${INSTALL_DIR}/hterm.concat.js" "${INSTALL_DIR}/hterm2.js"
- cat "${INSTALL_DIR}/hterm2.js" >> "${INSTALL_DIR}/hterm.concat.js"
- Remove "${INSTALL_DIR}/hterm2.js"
-
- LogExecute cp "${TOOLS_DIR}/naclterm.js" "${INSTALL_DIR}"
- LogExecute cp "${TOOLS_DIR}/pipeserver.js" "${INSTALL_DIR}"
- if [ "${NACL_ARCH}" = "pnacl" ] ; then
- sed 's/x-nacl/x-pnacl/' \
- "${TOOLS_DIR}/naclprocess.js" > "${INSTALL_DIR}/naclprocess.js"
- else
- LogExecute cp "${TOOLS_DIR}/naclprocess.js" "${INSTALL_DIR}"
- fi
-}
-
-
-#
-# Build step for projects based on the NaCl SDK build
-# system (common.mk).
-#
-SetupSDKBuildSystem() {
- # We override $(OUTBASE) to force the build system to put
- # all its artifacts in ${SRC_DIR} rather than alongside
- # the Makefile.
- export OUTBASE=${SRC_DIR}
- export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export CXXFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CXXFLAGS}"
- export LDFLAGS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}"
- export NACL_PREFIX
- export NACL_PACKAGES_PUBLISH
- export NACL_SRC
- export NACLPORTS_INCLUDE
- export NACLPORTS_REVISION=${REVISION}
- export PKG_CONFIG_LIBDIR="${NACLPORTS_LIBDIR}/pkgconfig"
- export ENABLE_BIONIC=1
- # By default PKG_CONFIG_PATH is set to <libdir>/pkgconfig:<datadir>/pkgconfig.
- # While PKG_CONFIG_LIBDIR overrides <libdir>, <datadir> (/usr/share/) can only
- # be overridden individually when pkg-config is built.
- # Setting PKG_CONFIG_PATH instead to compensate.
- export PKG_CONFIG_PATH="${NACLPORTS_LIBDIR}/pkgconfig"
- PKG_CONFIG_PATH+=":${NACLPORTS_LIBDIR}/../share/pkgconfig"
-
- MAKEFLAGS+=" TOOLCHAIN=${TOOLCHAIN}"
- MAKEFLAGS+=" NACL_ARCH=${NACL_ARCH_ALT}"
- if [ "${NACL_DEBUG}" = "1" ]; then
- MAKEFLAGS+=" CONFIG=Debug"
- else
- MAKEFLAGS+=" CONFIG=Release"
- fi
- if [ "${VERBOSE:-}" = "1" ]; then
- MAKEFLAGS+=" V=1"
- fi
- export MAKEFLAGS
-
- BUILD_DIR=${START_DIR}
- echo "LDFLAGS=${LDFLAGS}"
-}
-
-SetupCrossPaths() {
- export PKG_CONFIG_LIBDIR="${NACLPORTS_LIBDIR}/pkgconfig"
- # By default PKG_CONFIG_PATH is set to <libdir>/pkgconfig:<datadir>/pkgconfig.
- # While PKG_CONFIG_LIBDIR overrides <libdir>, <datadir> (/usr/share/) can only
- # be overridden individually when pkg-config is built.
- # Setting PKG_CONFIG_PATH instead to compensate.
- export PKG_CONFIG_PATH="${NACLPORTS_LIBDIR}/pkgconfig"
- PKG_CONFIG_PATH+=":${NACLPORTS_LIBDIR}/../share/pkgconfig"
- export SDL_CONFIG=${NACLPORTS_BIN}/sdl-config
- export FREETYPE_CONFIG=${NACLPORTS_BIN}/freetype-config
- export PATH=${NACL_BIN_PATH}:${NACLPORTS_BIN}:${PATH}
-}
-
-SetupCrossEnvironment() {
- SetupCrossPaths
-
- # export the nacl tools
- export CONFIG_SITE
- export EXEEXT=${NACL_EXEEXT}
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- export AR=${NACLAR}
- export RANLIB=${NACLRANLIB}
- export READELF=${NACLREADELF}
- export STRIP=${NACLSTRIP}
-
- export CFLAGS=${NACLPORTS_CFLAGS}
- export CPPFLAGS=${NACLPORTS_CPPFLAGS}
- export CXXFLAGS=${NACLPORTS_CXXFLAGS}
- export LDFLAGS=${NACLPORTS_LDFLAGS}
- export ARFLAGS=${NACL_ARFLAGS}
- export AR_FLAGS=${NACL_ARFLAGS}
- export LIBS=${LIBS:-${NACLPORTS_LIBS}}
-
- echo "CPPFLAGS=${CPPFLAGS}"
- echo "CFLAGS=${CFLAGS}"
- echo "CXXFLAGS=${CXXFLAGS}"
- echo "LDFLAGS=${LDFLAGS}"
- echo "LIBS=${LIBS}"
-}
-
-GetRevision() {
- cd ${NACL_SRC}
- FULL_REVISION=$(git describe)
- REVISION=$(echo "${FULL_REVISION}" | cut -f2 -d-)
- cd - > /dev/null
-}
-
-
-GenerateManifest() {
- local SOURCE_FILE=$1
- shift
- local TARGET_DIR=$1
- shift
- local TEMPLATE_EXPAND="${SCRIPT_DIR}/template_expand.py"
-
- # TODO(sbc): deal with versions greater than 16bit.
- if (( REVISION >= 65536 )); then
- echo "error: Version too great to store in revision field on manifest.json"
- exit 1
- fi
-
- echo "Expanding ${SOURCE_FILE} > ${TARGET_DIR}/manifest.json"
- # Generate a manifest.json
- "${TEMPLATE_EXPAND}" "${SOURCE_FILE}" \
- version=${REVISION} $* > ${TARGET_DIR}/manifest.json
-}
-
-
-FixupExecutablesList() {
- # Modify EXECUTABLES list for libtool case where actual executables
- # live within the ".libs" folder.
- local executables_modified=
- for nexe in ${EXECUTABLES:-}; do
- local basename=$(basename ${nexe})
- local dirname=$(dirname ${nexe})
- if [ -f "${dirname}/.libs/${basename}" ]; then
- executables_modified+=" ${dirname}/.libs/${basename}"
- else
- executables_modified+=" ${nexe}"
- fi
- done
- EXECUTABLES=${executables_modified}
-}
-
-
-VerifySharedLibraryOrder() {
- if [ "${NACL_LIBC}" != "glibc" ]; then
- return
- fi
- # Check that pthreads comes after nacl_io + nacl_spawn in the needed order.
- # Pthreads has interception hooks that forward directly into glibc.
- # If it gets loaded first, nacl_io doesn't get a chance to intercept.
- for nexe in ${EXECUTABLES:-}; do
- echo "Verifying shared library order for ${nexe}"
- if ! OBJDUMP=${NACLOBJDUMP} ${TOOLS_DIR}/check_needed_order.py ${nexe}; then
- echo "error: glibc shared library order check failed"
- exit 1
- fi
- done
-}
-
-
-######################################################################
-# Build Steps
-######################################################################
-
-PatchConfigSub() {
- # Replace the package's config.sub one with an up-do-date copy
- # that includes nacl support. We only do this if the string
- # 'nacl)' is not already contained in the file.
- CONFIG_SUB=${CONFIG_SUB:-config.sub}
- if [ ! -f "${CONFIG_SUB}" ]; then
- CONFIG_SUB=$(find "${SRC_DIR}" -name config.sub -print)
- fi
-
- for sub in ${CONFIG_SUB}; do
- if grep -q 'nacl)' "${sub}" /dev/null; then
- if grep -q 'emscripten)' "${sub}" /dev/null; then
- echo "${CONFIG_SUB} supports NaCl + emscripten"
- continue
- fi
- fi
- echo "Patching ${sub}"
- /bin/cp -f "${TOOLS_DIR}/config.sub" "${sub}"
- done
-}
-
-
-PatchConfigure() {
- if [ -f configure ]; then
- Banner "Patching configure"
- "${TOOLS_DIR}/patch_configure.py" configure
- fi
-}
-
-
-DefaultPatchStep() {
- # The applicaiton of the nacl.patch file is now done by
- # webports python code.
- # TODO(sbc): migrate auto patching of config sub and configure
- # and remove this function.
-
- if [ -z "${URL:-}" ] && ! IsGitRepo; then
- return
- fi
-
- ChangeDir "${SRC_DIR}"
-
- if CheckStamp patch ; then
- return
- fi
-
- PatchConfigure
- PatchConfigSub
- if [ -n "$(git diff --no-ext-diff)" ]; then
- git add -u
- git commit -m "Automatic patch generated by webports"
- fi
-
- TouchStamp patch
-}
-
-
-DefaultConfigureStep() {
- if [ "${NACLPORTS_QUICKBUILD}" = "1" ]; then
- CONFIGURE_SENTINEL=${CONFIGURE_SENTINEL:-Makefile}
- fi
-
- if [ -n "${CONFIGURE_SENTINEL:-}" -a -f "${CONFIGURE_SENTINEL:-}" ]; then
- return
- fi
-
- if [ "${TOOLCHAIN}" = "emscripten" ]; then
- # This is a variable the emconfigure sets, presumably to make configure
- # tests do the right thing.
- # TODO(sbc): We should probably call emconfigure instead of trying to
- # duplicate its functionality.
- export EMMAKEN_JUST_CONFIGURE=1
- fi
-
- if IsAutoconfProject; then
- ConfigureStep_Autoconf
- elif IsCMakeProject; then
- ConfigureStep_CMake
- else
- echo "No configure or CMakeLists.txt script found in ${SRC_DIR}"
- fi
-}
-
-
-ConfigureStep_Autoconf() {
- SetupCrossEnvironment
-
- # Without this autoconf builds will use the same CFLAGS/LDFLAGS for host
- # builds as NaCl builds and not all the flags we use are supported by the
- # host compiler, which could be an older version of gcc
- # (e.g. -fdiagnostics-color=auto).
- export CFLAGS_FOR_BUILD=""
- export LDFLAGS_FOR_BUILD=""
-
- # Inject a shim that speed up pnacl invocations for configure.
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- local PNACL_CONF_SHIM="${TOOLS_DIR}/pnacl-configure-shim.py"
- CC="${PNACL_CONF_SHIM} ${CC}"
- fi
-
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- echo "export EMMAKEN_JUST_CONFIGURE=1"
- export EMMAKEN_JUST_CONFIGURE=1
- fi
-
- # Specify both --build and --host options. This forces autoconf into cross
- # compile mode. This is useful since the autodection doesn't always works.
- # For example a trivial PNaCl binary can sometimes run on the linux host if
- # it has the correct LLVM bimfmt support. What is more, autoconf will
- # generate a warning if only --host is specified.
- LogExecute "${NACL_CONFIGURE_PATH}" \
- --build=${CONF_BUILD} \
- --host=${CONF_HOST} \
- --prefix=${PREFIX} \
- --with-http=no \
- --with-ftp=no \
- --${NACL_OPTION}-mmx \
- --${NACL_OPTION}-sse \
- --${NACL_OPTION}-sse2 \
- --${NACL_OPTION}-asm \
- --with-x=no \
- ${EXTRA_CONFIGURE_ARGS:-}
-}
-
-
-ConfigureStep_CMake() {
- if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
- EXTRA_CMAKE_ARGS+=" -GNinja"
- fi
-
- if [ $NACL_DEBUG = "1" ]; then
- BUILD_TYPE=DEBUG
- else
- BUILD_TYPE=RELEASE
- fi
-
- SetupCrossPaths
- export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export CXXFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CXXFLAGS}"
- export LDFLAGS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}"
- LogExecute cmake "${SRC_DIR}" \
- -DCMAKE_TOOLCHAIN_FILE=${TOOLS_DIR}/XCompile-nacl.cmake \
- -DNACLAR=${NACLAR} \
- -DNACLLD=${NACLLD} \
- -DNACLCC=${NACLCC} \
- -DNACLCXX=${NACLCXX} \
- -DNACL_CROSS_PREFIX=${NACL_CROSS_PREFIX} \
- -DNACL_ARCH=${NACL_ARCH} \
- -DNACL_SDK_ROOT=${NACL_SDK_ROOT} \
- -DNACL_SDK_LIBDIR=${NACL_SDK_LIBDIR} \
- -DNACL_TOOLCHAIN_ROOT=${NACL_TOOLCHAIN_ROOT} \
- -DNACL_LIBC=${NACL_LIBC} \
- -DCMAKE_PREFIX_PATH=${NACL_PREFIX} \
- -DCMAKE_INSTALL_PREFIX=${PREFIX} \
- -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${EXTRA_CMAKE_ARGS:-}
-}
-
-
-DefaultBuildStep() {
- if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
- if [ "${VERBOSE:-}" = "1" ]; then
- NINJA_ARGS="-v"
- fi
- LogExecute ninja ${NINJA_ARGS:-} ${MAKE_TARGETS:-}
- return
- fi
-
- # Build ${MAKE_TARGETS} or default target if it is not defined
- if [ -n "${MAKEFLAGS:-}" ]; then
- echo "MAKEFLAGS=${MAKEFLAGS}"
- export MAKEFLAGS
- fi
- if [ "${VERBOSE:-}" = "1" ]; then
- MAKE_TARGETS+=" VERBOSE=1 V=1"
- fi
- export PATH=${NACL_BIN_PATH}:${PATH}
- LogExecute make -j${OS_JOBS} ${MAKE_TARGETS:-}
-}
-
-
-DefaultPythonModuleBuildStep() {
- SetupCrossEnvironment
- Banner "Build ${PACKAGE_NAME} python module"
- ChangeDir "${SRC_DIR}"
- LogExecute rm -rf build dist
- MakeDir "${NACL_DEST_PYROOT}/${SITE_PACKAGES}"
- export PYTHONPATH="${NACL_HOST_PYROOT}/${SITE_PACKAGES}"
- export PYTHONPATH="${PYTHONPATH}:${NACL_DEST_PYROOT}/${SITE_PACKAGES}"
- export NACL_PORT_BUILD=${1:-dest}
- export NACL_BUILD_TREE=${NACL_DEST_PYROOT}
- export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export CXXFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CXXFLAGS}"
- export LDFLAGS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}"
- export LIBS="${NACLPORTS_LIBS}"
- LogExecute "${NACL_HOST_PYTHON}" setup.py ${NACL_PYSETUP_ARGS} \
- install "--prefix=${NACL_DEST_PYROOT}"
- MakeDir "${DEST_PYTHON_OBJS}/${PACKAGE_NAME}"
- LogExecute find build -name "*.o" -execdir cp -v {} \
- "${DEST_PYTHON_OBJS}/${PACKAGE_NAME}/"{} \;
-}
-
-
-DefaultTestStep() {
- echo "No TestStep defined for ${PACKAGE_NAME}"
-}
-
-
-DefaultPublishStep() {
- echo "No PublishStep defined for ${PACKAGE_NAME}"
-}
-
-
-DefaultPostInstallTestStep() {
- echo "No PostInstallTestStep defined for ${PACKAGE_NAME}"
-}
-
-
-DefaultInstallStep() {
- INSTALL_TARGETS=${INSTALL_TARGETS:-install}
-
- if [ "${CMAKE_USE_NINJA:-}" = "1" ]; then
- DESTDIR="${DESTDIR}" LogExecute ninja ${INSTALL_TARGETS}
- return
- fi
-
- # assumes pwd has makefile
- if [ -n "${MAKEFLAGS:-}" ]; then
- echo "MAKEFLAGS=${MAKEFLAGS}"
- export MAKEFLAGS
- fi
- export PATH="${NACL_BIN_PATH}:${PATH}"
- LogExecute make ${INSTALL_TARGETS} "DESTDIR=${DESTDIR}"
-}
-
-
-DefaultPythonModuleInstallStep() {
- Banner "Installing ${PACKAGE_NAME}"
- # We've installed already previously. We just need to collect our modules.
- MakeDir "${NACL_HOST_PYROOT}/python_modules/"
- if [ -e "${START_DIR}/modules.list" ] ; then
- LogExecute cp "${START_DIR}/modules.list" \
- "${DEST_PYTHON_OBJS}/${PACKAGE_NAME}.list"
- fi
- if [ -e "${START_DIR}/modules.libs" ] ; then
- LogExecute cp "${START_DIR}/modules.libs" \
- "${DEST_PYTHON_OBJS}/${PACKAGE_NAME}.libs"
- fi
-}
-
-
-#
-# Validate a given NaCl executable (.nexe file)
-# $1 - Execuatable file (.nexe)
-#
-Validate() {
- local binary=$1
-
- if [[ ${NACL_ARCH} = pnacl || ${NACL_ARCH} = emscripten ]]; then
- if [[ ! -f $binary ]]; then
- echo "error: missing binary: ${binary}"
- exit 1
- fi
- return
- fi
-
- LogExecute "${NACL_SDK_ROOT}/tools/ncval" "${binary}"
- if [[ $? != 0 ]]; then
- exit 1
- fi
-}
-
-
-#
-# PostBuildStep by default will validate (using ncval) any executables
-# specified in the ${EXECUTABLES} as well as create wrapper scripts
-# for running them in sel_ldr.
-#
-DefaultPostBuildStep() {
- if [ -z "${EXECUTABLES}" ]; then
- return
- fi
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- for pexe in ${EXECUTABLES}; do
- FinalizePexe "${pexe}"
- done
- if [ "${TRANSLATE_PEXES:-}" != "no" ]; then
- for pexe in ${EXECUTABLES}; do
- TranslatePexe "${pexe}"
- done
- fi
- fi
-
- for nexe in ${EXECUTABLES}; do
- Validate "${nexe}"
- # Create a script which will run the executable in sel_ldr. The name
- # of the script is the same as the name of the executable, either without
- # any extension or with the .sh extension.
-
- local script_name="${nexe}.sh"
- if [[ ${nexe} == *${NACL_EXEEXT} && ! -d ${nexe%%${NACL_EXEEXT}} ]]; then
- script_name="${nexe%%${NACL_EXEEXT}}"
- fi
-
- nexe="$(basename ${nexe})"
- if [[ ${NACL_ARCH} == pnacl ]]; then
- local basename="${nexe%.*}"
- nexe=${basename}.x86-64.nexe
- fi
- WriteLauncherScript "${script_name}" "${nexe}"
- done
-
- VerifySharedLibraryOrder
-}
-
-
-#
-# Run an executable with under sel_ldr.
-# $1 - Executable (.nexe) name
-#
-RunSelLdrCommand() {
- if [ "${SKIP_SEL_LDR_TESTS}" = "1" ]; then
- return
- fi
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- # For PNaCl we translate to each arch where we have sel_ldr, then run it.
- local PEXE=$1
- local NEXE_32=$1_32.nexe
- local NEXE_64=$1_64.nexe
- local SCRIPT_32=$1_32.sh
- local SCRIPT_64=$1_64.sh
- shift
- TranslateAndWriteLauncherScript "${PEXE}" x86-32 "${NEXE_32}" "${SCRIPT_32}"
- echo "[sel_ldr x86-32] ${SCRIPT_32} $*"
- "./${SCRIPT_32}" "$@"
- TranslateAndWriteLauncherScript "${PEXE}" x86-64 "${NEXE_64}" "${SCRIPT_64}"
- echo "[sel_ldr x86-64] ${SCRIPT_64} $*"
- "./${SCRIPT_64}" "$@"
- else
- # Normal NaCl.
- local nexe=$1
- local basename=$(basename ${nexe})
- local dirname=$(dirname ${nexe})
- if [ -f "${dirname}/.libs/${basename}" ]; then
- nexe=${dirname}/.libs/${basename}
- fi
-
- local SCRIPT=${nexe}.sh
- WriteLauncherScript "${SCRIPT}" ${basename}
- shift
- echo "[sel_ldr] ${SCRIPT} $*"
- "./${SCRIPT}" "$@"
- fi
-}
-
-
-#
-# Write a wrapper script that will run a nexe under sel_ldr
-# $1 - Script name
-# $2 - Nexe name
-#
-WriteLauncherScript() {
- local script=$1
- local binary=$2
- if [ "${SKIP_SEL_LDR_TESTS}" = "1" ]; then
- return
- fi
-
- if [ "${TOOLCHAIN}" = "emscripten" ]; then
- local node=node
- if ! which node > /dev/null ; then
- node=nodejs
- if ! which nodejs > /dev/null ; then
- echo "Failed to find 'node' or 'nodejs' in PATH"
- exit 1
- fi
- fi
- cat > "$script" <<HERE
-#!/bin/bash
-
-SCRIPT_DIR=\$(dirname "\${BASH_SOURCE[0]}")
-NODE=${node}
-
-exec \${NODE} "\${SCRIPT_DIR}/${binary}" "\$@"
-HERE
- chmod 750 "$script"
- echo "Wrote script $script -> $binary"
- return
- fi
-
- if [ "${OS_NAME}" = "Cygwin" ]; then
- local LOGFILE=nul
- else
- local LOGFILE=/dev/null
- fi
-
- if [ "${NACL_LIBC}" = "glibc" ]; then
- cat > "$script" <<HERE
-#!/bin/bash
-SCRIPT_DIR=\$(dirname "\${BASH_SOURCE[0]}")
-if [ \$(uname -s) = CYGWIN* ]; then
- SCRIPT_DIR=\$(cygpath -m \${SCRIPT_DIR})
-fi
-NACL_SDK_ROOT=${NACL_SDK_ROOT}
-
-NACL_SDK_LIB=${NACL_SDK_LIB}
-LIB_PATH_DEFAULT=${NACL_SDK_LIBDIR}:${NACLPORTS_LIBDIR}
-LIB_PATH_DEFAULT=\${LIB_PATH_DEFAULT}:\${NACL_SDK_LIB}:\${SCRIPT_DIR}
-SEL_LDR_LIB_PATH=\${SEL_LDR_LIB_PATH}:\${LIB_PATH_DEFAULT}
-
-exec "\${NACL_SDK_ROOT}/tools/sel_ldr.py" -p --library-path \
- "\${SEL_LDR_LIB_PATH}" -- "\${SCRIPT_DIR}/$binary" "\$@"
-HERE
- else
- cat > "$script" <<HERE
-#!/bin/bash
-SCRIPT_DIR=\$(dirname "\${BASH_SOURCE[0]}")
-if [ \$(uname -s) = CYGWIN* ]; then
- SCRIPT_DIR=\$(cygpath -m \${SCRIPT_DIR})
-fi
-NACL_SDK_ROOT=${NACL_SDK_ROOT}
-
-exec "\${NACL_SDK_ROOT}/tools/sel_ldr.py" -p -- "\${SCRIPT_DIR}/$binary" "\$@"
-HERE
- fi
-
- chmod 750 "$script"
- echo "Wrote script $script -> $binary"
-}
-
-
-TranslateAndWriteLauncherScript() {
- local PEXE=$1
- local PEXE_FINAL=$1_final.pexe
- local ARCH=$2
- local NEXE=$3
- local SCRIPT=$4
- # Finalize the pexe to make sure it is finalizeable.
- if [ "${PEXE}" -nt "${PEXE_FINAL}" ]; then
- "${PNACLFINALIZE}" "${PEXE}" -o "${PEXE_FINAL}"
- fi
- # Translate to the appropriate version.
- if [ "${PEXE_FINAL}" -nt "${NEXE}" ]; then
- "${TRANSLATOR}" "${PEXE_FINAL}" -arch "${ARCH}" -o "${NEXE}"
- fi
- WriteLauncherScript "${SCRIPT}" $(basename "${NEXE}")
-}
-
-
-FinalizePexe() {
- local pexe=$1
- Banner "Finalizing ${pexe}"
- "${PNACLFINALIZE}" "${pexe}"
-}
-
-
-#
-# Translate a PNaCl executable (.pexe) into one or more
-# native NaCl executables (.nexe).
-# $1 - pexe file
-#
-TranslatePexe() {
- local pexe=$1
- local basename="${pexe%.*}"
- local arches="arm x86-32 x86-64"
- if [ "${NACLPORTS_QUICKBUILD}" = "1" ]; then
- arches="x86-64"
- fi
-
- Banner "Translating ${pexe}"
-
- for a in ${arches} ; do
- echo "translating pexe -O0 [${a}]"
- nexe=${basename}.${a}.nexe
- if [ "${pexe}" -nt "${nexe}" ]; then
- "${TRANSLATOR}" -O0 -arch "${a}" "${pexe}" -o "${nexe}"
- fi
- done
-
- # Now the same spiel with -O2
-
- if [ "${NACLPORTS_QUICKBUILD}" != "1" ]; then
- for a in ${arches} ; do
- echo "translating pexe -O2 [${a}]"
- nexe=${basename}.opt.${a}.nexe
- if [ "${pexe}" -nt "${nexe}" ]; then
- "${TRANSLATOR}" -O2 -arch "${a}" "${pexe}" -o "${nexe}"
- fi
- done
- fi
-
- local dirname=$(dirname "${pexe}")
- ls -l ${pexe} ${basename}*.nexe
-}
-
-
-#
-# Create a zip file for uploading to the chrome web store.
-# $1 - zipfile to create
-# $2 - directory to zip
-#
-CreateWebStoreZip() {
- if [ "${NACLPORTS_QUICKBUILD}" = "1" ]; then
- echo "Skipping Web Store package create: $1"
- return
- fi
- Banner "Creating Web Store package: $1"
- Remove $1
- LogExecute zip -r $1 $2/
-}
-
-
-PackageStep() {
- local basename=$(basename "${PACKAGE_FILE}")
- Banner "Packaging ${basename}"
- if [ -d "${INSTALL_DIR}${PREFIX}" ]; then
- for item in "${INSTALL_DIR}"/*; do
- if [ "$item" != "${INSTALL_DIR}${PREFIX}" ]; then
- echo "INSTALL_DIR contains unexpected file or directory: $item"
- echo "INSTALL_DIR should contain only '${PREFIX}'"
- exit 1
- fi
- done
- mv "${INSTALL_DIR}${PREFIX}" "${INSTALL_DIR}/payload"
- fi
- local excludes="usr/doc share/man share/info info/
- share/doc lib/charset.alias"
- for exclude in ${excludes}; do
- if [ -e "${INSTALL_DIR}/payload/${exclude}" ]; then
- echo "Pruning ${exclude}"
- rm -rf "${INSTALL_DIR}/payload/${exclude}"
- fi
- done
- LogExecute cp "${START_DIR}/pkg_info" "${INSTALL_DIR}"
- if [ "${NACL_DEBUG}" = "1" ]; then
- echo "BUILD_CONFIG=debug" >> "${INSTALL_DIR}/pkg_info"
- else
- echo "BUILD_CONFIG=release" >> "${INSTALL_DIR}/pkg_info"
- fi
- echo "BUILD_ARCH=${NACL_ARCH}" >> "${INSTALL_DIR}/pkg_info"
- echo "BUILD_TOOLCHAIN=${TOOLCHAIN}" >> "${INSTALL_DIR}/pkg_info"
- echo "BUILD_SDK_VERSION=${NACL_SDK_VERSION}" >> "${INSTALL_DIR}/pkg_info"
- echo "BUILD_NACLPORTS_REVISION=${FULL_REVISION}" >> "${INSTALL_DIR}/pkg_info"
- if [ "${OS_NAME}" = "Darwin" ]; then
- # OSX likes to create files starting with ._. We don't want to package
- # these.
- local args="--exclude ._*"
- else
- local args=""
- fi
- args+=" pkg_info"
- if [[ -d ${INSTALL_DIR}/payload ]]; then
- args+=" payload"
- fi
- # Create packge in temporary location and move into place once
- # done. This prevents partially created packages from being
- # left lying around if this process is interrupted.
- LogExecute tar cjf "${PACKAGE_FILE}.tmp" -C "${INSTALL_DIR}" ${args}
- LogExecute mv -f "${PACKAGE_FILE}.tmp" "${PACKAGE_FILE}"
-}
-
-
-PackageInstall() {
- RunDownloadStep
- RunPatchStep
- RunConfigureStep
- RunBuildStep
- RunPostBuildStep
- RunTestStep
- RunInstallStep
- RunPublishStep
- RunPostInstallTestStep
- PackageStep
-}
-
-
-NaclportsMain() {
- local COMMAND=PackageInstall
- if [[ $# -gt 0 ]]; then
- COMMAND=Run$1
- fi
- if [ -d "${BUILD_DIR}" ]; then
- ChangeDir "${BUILD_DIR}"
- fi
- ${COMMAND}
-}
-
-
-RunStep() {
- local STEP_FUNCTION=$1
- local DIR=''
- shift
- if [ $# -gt 0 ]; then
- local TITLE=$1
- shift
- Banner "${TITLE} ${PACKAGE_NAME}"
- fi
- if [ $# -gt 0 ]; then
- DIR=$1
- shift
- fi
- if [ -n "${DIR}" ]; then
- if [ ! -d "${DIR}" ]; then
- MakeDir "${DIR}"
- fi
- ChangeDir "${DIR}"
- fi
- # Step functions are run in sub-shell so that they are independent
- # from each other.
- ( ${STEP_FUNCTION} )
-}
-
-
-# Function entry points that packages should override in order
-# to customize the build process.
-DownloadStep() { return; }
-PatchStep() { DefaultPatchStep; }
-ConfigureStep() { DefaultConfigureStep; }
-BuildStep() { DefaultBuildStep; }
-PostBuildStep() { DefaultPostBuildStep; }
-TestStep() { DefaultTestStep; }
-InstallStep() { DefaultInstallStep; }
-PublishStep() { DefaultPublishStep; }
-PostInstallTestStep() { DefaultPostInstallTestStep; }
-
-RunDownloadStep() { RunStep DownloadStep; }
-RunPatchStep() { RunStep PatchStep; }
-
-
-RunConfigureStep() {
- SetOptFlags
- RunStep ConfigureStep "Configuring" "${BUILD_DIR}"
-}
-
-
-RunBuildStep() {
- RunStep BuildStep "Building" "${BUILD_DIR}"
- FixupExecutablesList
-}
-
-
-RunPostBuildStep() {
- RunStep PostBuildStep "PostBuild" "${BUILD_DIR}"
-}
-
-
-RunTestStep() {
- if [[ ${SKIP_SEL_LDR_TESTS} == 1 ]]; then
- Banner "sel_ldr based tested disavled on this platform"
- return
- fi
- if [[ ${NACLPORTS_QUICKBUILD} == 1 ]]; then
- Banner "Tests disabled (\$NACLPORTS_QUICKBUILD is set)"
- return
- fi
- if [[ ${TESTS_DISABLED:-} == 1 && -n ${BUILDBOT_BUILDERNAME:-} ]]; then
- Banner "Tests for ${PACKAGE_NAME} are currently disabled on the bots"
- return
- fi
- RunStep TestStep "Testing" "${BUILD_DIR}"
-}
-
-
-RunPostInstallTestStep() {
- if [[ ${NACLPORTS_QUICKBUILD} == 1 ]]; then
- Banner "Post-install tests disabled (\$NACLPORTS_QUICKBUILD is set)"
- return
- fi
- RunStep PostInstallTestStep "Testing (post-install)"
-}
-
-
-RunInstallStep() {
- Remove "${INSTALL_DIR}"
- MakeDir "${INSTALL_DIR}"
- RunStep InstallStep "Installing" "${BUILD_DIR}"
-}
-
-
-RunPublishStep() {
- RunStep PublishStep "Publishing" "${BUILD_DIR}"
-}
-
-
-######################################################################
-# Always run
-# These functions are called when this script is imported to do
-# any essential checking/setup operations.
-######################################################################
-PatchSpecsFile
-InjectSystemHeaders
-InstallConfigSite
-GetRevision
-MakeDirs
diff --git a/build_tools/config.guess b/build_tools/config.guess
deleted file mode 100755
index b79252d..0000000
--- a/build_tools/config.guess
+++ /dev/null
@@ -1,1558 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-06-10'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- ;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[4567])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- aarch64_be:Linux:*:*)
- UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- else
- if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_PCS_VFP
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
- else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
- fi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- ;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
- esac
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
- x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
- x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
-esac
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/build_tools/config.sub b/build_tools/config.sub
deleted file mode 100755
index 1c6ef95..0000000
--- a/build_tools/config.sub
+++ /dev/null
@@ -1,1779 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-02-10'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 \
- | ns16k | ns32k \
- | open8 \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze)
- basic_machine=microblaze-xilinx
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i386-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- emscripten)
- basic_machine=asmjs-unknown
- os=-emscripten
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
- ;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -nacl*)
- ;;
- -emscripten*)
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -cnk*|-aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/build_tools/create_term.py b/build_tools/create_term.py
deleted file mode 100755
index fd3cc99..0000000
--- a/build_tools/create_term.py
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 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.
-"""Creates simple terminal for a NaCl module.
-
-This script is designed to make the process of porting terminal based
-Native Client executables simple by generating boilerplate .html and .js
-files for a given Native Client module (.nmf).
-"""
-
-from __future__ import print_function
-
-import argparse
-import logging
-import os
-import sys
-
-HTML_TEMPLATE = '''\
-<!DOCTYPE html>
-<html>
- <head>
- <title>%(title)s</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="%(module_name)s.js"></script>
- %(include)s
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%%;
- width: 100%%;
- overflow: hidden;
- }
-
- #terminal {
- display: block;
- position: static;
- width: 100%%;
- height: 100%%;
- }
- </style>
- %(style)s
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
-'''
-
-JS_TEMPLATE = '''\
-NaClTerm.nmf = '%(nmf)s'
-'''
-
-FORMAT = '%(filename)s: %(message)s'
-logging.basicConfig(format=FORMAT)
-
-
-def CreateTerm(filename, name=None, style=None, include=None):
- if not name:
- basename = os.path.basename(filename)
- name, _ = os.path.splitext(basename)
-
- style = style or []
- include = include or []
-
- htmlfile = name + '.html'
- logging.info('creating html: %s', htmlfile)
- with open(htmlfile, 'w') as outfile:
- args = {}
- args['title'] = name
- args['module_name'] = name
-
- styleHTML = ['<link rel="stylesheet" href="%s">' % css for css in style]
- args['style'] = '\n '.join(styleHTML)
-
- includeHTML = ['<script src="%s"></script>' % js for js in include]
- args['include'] = '\n '.join(includeHTML)
-
- outfile.write(HTML_TEMPLATE % args)
-
- jsfile = name + '.js'
- logging.info('creating js: %s', jsfile)
- with open(jsfile, 'w') as outfile:
- args = {}
- args['module_name'] = name
- args['nmf'] = os.path.basename(filename)
- outfile.write(JS_TEMPLATE % args)
-
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('nmf', help='nmf file to load')
- parser.add_argument('-n', '--name', help='name of the application')
- parser.add_argument('-v', '--verbose', action='store_true',
- help='be more verbose')
- parser.add_argument('-s', '--style', action='append', default=[],
- help='include a CSS file in the generated HTML')
- parser.add_argument('-i', '--include', action='append', default=[],
- help='include a JavaScript file in the generated HTML')
-
- options = parser.parse_args(args)
- if not options.verbose:
- logging.disable(logging.INFO)
-
- CreateTerm(options.nmf, options.name, options.style, options.include)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/download_chrome.py b/build_tools/download_chrome.py
deleted file mode 100755
index f8b1fc3..0000000
--- a/build_tools/download_chrome.py
+++ /dev/null
@@ -1,186 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 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.
-"""Download the a build of chrome from Google Clound Storage."""
-
-import argparse
-import logging
-import os
-import shutil
-import sys
-import zipfile
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-SRC_DIR = os.path.dirname(SCRIPT_DIR)
-sys.path.insert(0, os.path.join(SRC_DIR, 'lib'))
-
-import webports
-
-GS_URL = 'http://storage.googleapis.com'
-CHROME_URL_FORMAT = GS_URL + '/chromium-browser-continuous/%s/%s/%s'
-CHROME_DOWNLOAD_DIR = os.path.join(webports.paths.OUT_DIR, 'downloaded_chrome')
-
-def ChromeDir(arch):
- """Get the directory to download chrome to."""
- return os.path.join(CHROME_DOWNLOAD_DIR, arch)
-
-
-def ChromeArchiveRoot():
- if sys.platform == 'win32':
- return 'chrome-win32'
- elif sys.platform == 'darwin':
- return 'chrome-mac'
- elif sys.platform.startswith('linux'):
- return 'chrome-linux'
- else:
- raise webports.error.Error('Unknown platform: %s' % sys.platform)
-
-
-def ChromeUrl(arch, revision):
- """Get the URL to download chrome from.
-
- Args:
- arch: Chrome architecture to select i686/x86_64/pnacl.
- Returns:
- URL to download a zip file from.
- """
- if sys.platform == 'win32':
- filename = 'chrome-win32.zip'
- target = 'Win_x64'
- elif sys.platform == 'darwin':
- filename = 'chrome-mac.zip'
- target = 'Mac'
- elif sys.platform.startswith('linux'):
- filename = 'chrome-linux.zip'
- if arch == 'i686':
- target = 'Linux'
- elif arch == 'x86_64' or arch == 'pnacl':
- # Arbitrarily decide we will use 64-bit Linux for PNaCl.
- target = 'Linux_x64'
- else:
- logging.error('Bad architecture %s' % arch)
- sys.exit(1)
- else:
- logging.error('Unsupported platform %s' % sys.platform)
- sys.exit(1)
- return CHROME_URL_FORMAT % (target, revision, filename)
-
-
-def DoDownload(url, destination):
- """Download chrome.
-
- Download chrome to a particular destination, leaving a stamp containing the
- download URL. Download is skipped if the stamp matches the URL.
- Args:
- url: URL to download chrome from.
- destination: A directory to download chrome to.
- """
- stamp_filename = os.path.join(destination, 'STAMP')
- # Change this line each time the mods we make to the chrome checkout change
- # otherwise the modding code will be skipped.
- stamp_content = 'mods_v2:' + url
- if os.path.exists(stamp_filename):
- with open(stamp_filename) as f:
- if f.read() == stamp_content:
- logging.info('Skipping chrome download, '
- 'chrome in %s is up to date' % destination)
- return
- if os.path.exists(destination):
- logging.info('Deleting old chrome...')
- shutil.rmtree(destination)
-
- logging.info('Creating %s' % destination)
- os.makedirs(destination)
-
- logging.info('Downloading chrome from %s to %s...' % (url, destination))
- chrome_zip = os.path.join(webports.paths.CACHE_ROOT, os.path.basename(url))
- webports.util.Makedirs(os.path.dirname(chrome_zip))
- try:
- webports.util.DownloadFile(chrome_zip, url)
- except webports.error.Error as e:
- logging.error('Unable to download chrome: %s' % str(e))
- sys.exit(1)
-
- pnacl_url = os.path.join(os.path.dirname(url), 'pnacl.zip')
- pnacl_zip = os.path.join(webports.paths.CACHE_ROOT, 'pnacl.zip')
- logging.info('Downloading pnacl component from %s ...' % url)
- try:
- webports.util.DownloadFile(pnacl_zip, pnacl_url)
- except webports.error.Error as e:
- logging.error('Unable to download chrome: %s' % str(e))
- sys.exit(1)
-
- logging.info('Extracting %s' % chrome_zip)
- with zipfile.ZipFile(chrome_zip) as zip_archive:
- zip_archive.extractall(destination)
- # Change the executables to be executable.
- for root, _, files in os.walk(destination):
- for filename in files:
- if (filename.startswith('Chromium') or
- filename in ('chrome-wrapper', 'chrome', 'nacl_helper',
- 'nacl_helper_bootstrap')):
- path = os.path.join(root, filename)
- os.chmod(path, 0755)
-
- if sys.platform.startswith('linux'):
- if '64' in url:
- libudev0 = '/lib/x86_64-linux-gnu/libudev.so.0'
- libudev1 = '/lib/x86_64-linux-gnu/libudev.so.1'
- else:
- libudev0 = '/lib/i386-linux-gnu/libudev.so.0'
- libudev1 = '/lib/i386-linux-gnu/libudev.so.1'
- if os.path.exists(libudev1) and not os.path.exists(libudev0):
- link = os.path.join(destination, 'chrome-linux', 'libudev.so.0')
- logging.info('creating link %s' % link)
- os.symlink(libudev1, link)
-
- logging.info('Extracting %s' % pnacl_zip)
- with zipfile.ZipFile(pnacl_zip) as zip_archive:
- zip_archive.extractall(destination)
-
- chrome_root = os.path.join(destination, ChromeArchiveRoot())
- pnacl_root = os.path.join(destination, 'pnacl', 'pnacl')
- logging.info('Renaming pnacl directory %s -> %s' % (pnacl_root, chrome_root))
- os.rename(pnacl_root, os.path.join(chrome_root, 'pnacl'))
-
- logging.info('Writing stamp...')
- with open(stamp_filename, 'w') as fh:
- fh.write(stamp_content)
- logging.info('Done.')
-
-
-def DownloadChrome(arch, revision):
- target_dir = ChromeDir(arch)
- DoDownload(ChromeUrl(arch, revision), target_dir)
- return os.path.join(target_dir, ChromeArchiveRoot())
-
-
-def RunMain(argv):
- parser = argparse.ArgumentParser(prog='download_chrome', description=__doc__)
- parser.add_argument('-a', '--arch', default='x86_64',
- choices=['x86_64', 'i686'],
- help='Chrome architecture.')
- logging.basicConfig(format='%(message)s', level=logging.INFO)
- parser.add_argument('revision')
- options = parser.parse_args(argv)
- dirname = DownloadChrome(options.arch, options.revision)
- logging.info('Chrome %s downloaded to: %s' % (options.revision, dirname))
- return 0
-
-
-def main(argv):
- try:
- return RunMain(argv)
- except KeyboardInterrupt:
- sys.stderr.write('interrupted\n')
- return 1
- except webports.error.Error as e:
- if os.environ.get('DEBUG'):
- raise
- sys.stderr.write(str(e) + '\n')
- return 1
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/download_emscripten.py b/build_tools/download_emscripten.py
deleted file mode 100755
index 7d599b6..0000000
--- a/build_tools/download_emscripten.py
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 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.
-"""Download the Emscripten SDK for the current platform.
-
-This script downloads the emscripten tarball and expands it.
-It requires gsutil to be in the bin PATH and is currently
-supported on Linux and Mac OSX and not windows.
-"""
-
-import os
-import subprocess
-import sys
-import tarfile
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-NACLPORTS_ROOT = os.path.dirname(SCRIPT_DIR)
-sys.path.append(os.path.join(NACLPORTS_ROOT, 'lib'))
-
-import webports
-import webports.source_package
-import webports.util
-
-MIRROR_URL = '%s%s/prebuilt/emscripten' % (webports.util.GS_URL,
- webports.util.GS_BUCKET)
-
-EMSDK_SHA1 = '89c962d5f06c874f63b06917913e2071d45e3c2e'
-EMSDK_URL = MIRROR_URL + '/emsdk-20150817.tar.gz'
-
-NODEJS_SHA1 = '79880ff2bc95a674bd0701a6dd4ed38f8366db27'
-NODEJS_URL = MIRROR_URL + '/node-v0.12.1-linux-x64.tar.gz'
-
-SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
-SRC_DIR = os.path.dirname(SCRIPT_DIR)
-OUT_DIR = os.path.join(SRC_DIR, 'out')
-TARGET_DIR = os.path.join(OUT_DIR, 'emscripten_sdk')
-
-
-def DownloadToCache(url, sha1):
- filename = os.path.basename(url)
- download_dir = webports.paths.CACHE_ROOT
- if not os.path.exists(download_dir):
- os.makedirs(download_dir)
- full_name = os.path.join(download_dir, filename)
- if os.path.exists(full_name):
- try:
- webports.util.VerifyHash(full_name, sha1)
- webports.Log("Verified cached file: %s" % filename)
- return full_name
- except webports.util.HashVerificationError:
- webports.Log("Hash mistmatch on cached download: %s" % filename)
-
- webports.DownloadFile(full_name, url)
- webports.util.VerifyHash(full_name, sha1)
- return full_name
-
-
-def DownloadAndExtract(url, sha1, target_dir, link_name=None):
- tar_file = DownloadToCache(url, sha1)
-
- if not os.path.exists(OUT_DIR):
- os.makedirs(OUT_DIR)
-
- os.chdir(OUT_DIR)
-
- # Remove previously extracted archive
- if os.path.exists(target_dir):
- webports.Log('Cleaning up existing %s...' % target_dir)
- cmd = ['rm', '-rf']
- cmd.append(target_dir)
- subprocess.check_call(cmd)
-
- # Extract archive
- webports.Log('Exctacting %s...' % os.path.basename(tar_file))
- if subprocess.call(['tar', 'xf', tar_file]):
- raise webports.Error('Error unpacking Emscripten SDK')
-
- if link_name:
- if os.path.exists(link_name):
- os.remove(link_name)
- os.symlink(target_dir, link_name)
-
-
-def BuildOptimizer():
- emsdk_root = os.path.join(OUT_DIR, 'emsdk')
- node_bin = os.path.join(OUT_DIR, 'node', 'bin')
- emscripten_root = os.path.join(emsdk_root, 'emscripten')
- os.environ['EMSDK_ROOT'] = emscripten_root
- os.environ['EM_CONFIG'] = os.path.join(emsdk_root, '.emscripten')
- os.environ['PATH'] += ':' + node_bin
- os.environ['PATH'] += ':' + emscripten_root
-
- # Run using -O2 to compile the native js-optimizer
- open('test.c', 'w').close()
- subprocess.check_call(['emcc', '-O2', '-o', 'test.js', 'test.c'])
- os.remove('test.js')
- os.remove('test.c')
- return 0
-
-
-def main(argv):
- if sys.platform in ['win32', 'cygwin']:
- webports.Error('Emscripten support is currently not available on Windows.')
- return 1
-
- DownloadAndExtract(EMSDK_URL, EMSDK_SHA1, 'emsdk')
- DownloadAndExtract(NODEJS_URL, NODEJS_SHA1, 'node-v0.12.1-linux-x64', 'node')
- BuildOptimizer()
-
- webports.Log('Emscripten SDK Install complete')
- return 0
-
-
-if __name__ == '__main__':
- try:
- rtn = main(sys.argv[1:])
- except webports.Error as e:
- sys.stderr.write('error: %s\n' % str(e))
- rtn = 1
- sys.exit(rtn)
diff --git a/build_tools/download_pkg.py b/build_tools/download_pkg.py
deleted file mode 100755
index 16121b7..0000000
--- a/build_tools/download_pkg.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 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.
-"""Scan online pkg packages and download all files
-
-This script is intended to be run periodically and is called
-by build_repo.sh script to build repository.
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import re
-import subprocess
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(os.path.dirname(SCRIPT_DIR), 'lib'))
-
-import webports
-
-from scan_packages import FindGsutil, ParseGsUtilOutput, \
- FormatSize, CheckHash, GetHash
-from webports.util import Log, LogVerbose
-
-
-def DownloadFiles(pkg_dir, files, check_hashes=True, parallel=False):
- """Download one of more files to the local disk.
-
- Args:
- files: List of FileInfo objects to download.
- check_hashes: When False assume local files have the correct
- hash otherwise always check the hashes match the onces in the
- FileInfo ojects.
-
- Returns:
- List of (filename, url) tuples.
- """
- files_to_download = []
- filenames = []
- download_dir = os.path.join(webports.package_index.PREBUILT_ROOT,
- 'pkg', pkg_dir)
- if not os.path.exists(download_dir):
- os.makedirs(download_dir)
-
- for file_info in files:
- basename = os.path.basename(file_info.url)
- file_info.name = os.path.join(download_dir, basename)
- file_info.rel_name = file_info.name[len(webports.paths.NACLPORTS_ROOT)+1:]
- filenames.append((file_info.name, file_info.url))
- if os.path.exists(file_info.name):
- if not check_hashes or CheckHash(file_info.name, file_info.md5):
- Log('Up-to-date: %s' % file_info.rel_name)
- continue
- files_to_download.append(file_info)
-
- def Check(file_info):
- if check_hashes and not CheckHash(file_info.name, file_info.md5):
- raise webports.Error(
- 'Checksum failed: %s\nExpected=%s\nActual=%s' %
- (file_info.rel_name, file_info.md5, GetHash(file_info.name)))
-
- if not files_to_download:
- Log('All files up-to-date')
- else:
- total_size = sum(f.size for f in files_to_download)
- Log('Need to download %d/%d files [%s]' %
- (len(files_to_download), len(files), FormatSize(total_size)))
-
- gsutil = FindGsutil()
- if parallel:
- remaining_files = files_to_download
- num_files = 20
- while remaining_files:
- files = remaining_files[:num_files]
- remaining_files = remaining_files[num_files:]
- cmd = gsutil + ['-m', 'cp'] + [f.gsurl for f in files] + [download_dir]
- LogVerbose(cmd)
- subprocess.check_call(cmd)
- for file_info in files:
- Check(file_info)
- else:
- for file_info in files_to_download:
- webports.DownloadFile(file_info.name, file_info.url)
- Check(file_info)
-
- return filenames
-
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('revision', metavar='REVISION',
- help='webports revision to to scan for.')
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Output extra information.')
- parser.add_argument('-p', '--parallel', action='store_true',
- help='Download packages in parallel.')
- parser.add_argument('-l', '--cache-listing', action='store_true',
- help='Cached output of gsutil -L (for testing).')
- parser.add_argument('--skip-md5', action='store_true',
- help='Assume on-disk files are up-to-date (for testing).')
- args = parser.parse_args(args)
- if args.verbose:
- webports.SetVerbose(True)
-
- sdk_version = webports.util.GetSDKVersion()
- Log('Scanning packages built for pepper_%s at revsion %s' %
- (sdk_version, args.revision))
- base_path = '%s/builds/pepper_%s/%s/publish' % (webports.GS_BUCKET,
- sdk_version, args.revision)
- gs_base_url = 'gs://' + base_path
- cmd = FindGsutil() + ['ls', gs_base_url]
- LogVerbose('Running: %s' % str(cmd))
- try:
- all_published = subprocess.check_output(cmd)
- except subprocess.CalledProcessError as e:
- raise webports.Error("Command '%s' failed: %s" % (cmd, e))
-
- pkg_dir = re.findall(r'pkg_[\w-]+', all_published)
- for pkg in pkg_dir:
- listing_file = os.path.join(webports.NACLPORTS_ROOT, 'lib',
- pkg + '_' + 'listing.txt')
- if args.cache_listing and os.path.exists(listing_file):
- Log('Using pre-cached gs listing: %s' % listing_file)
- with open(listing_file) as f:
- listing = f.read()
- else:
- gs_url = gs_base_url + '/' + pkg + '/*'
- Log('Searching for packages at: %s' % gs_url)
- cmd = FindGsutil() + ['stat', gs_url]
- LogVerbose('Running: %s' % str(cmd))
- try:
- listing = subprocess.check_output(cmd)
- except subprocess.CalledProcessError as e:
- raise webports.Error("Command '%s' failed: %s" % (cmd, e))
- if args.cache_listing:
- with open(listing_file, 'w') as f:
- f.write(listing)
- all_files = ParseGsUtilOutput(listing)
- Log('Found %d packages [%s] for %s' % (len(all_files),
- FormatSize(sum(f.size for f in all_files)), pkg))
- DownloadFiles(pkg, all_files, not args.skip_md5, args.parallel)
- Log('Done')
- return 0
-
-if __name__ == '__main__':
- try:
- sys.exit(main(sys.argv[1:]))
- except webports.Error as e:
- sys.stderr.write('%s\n' % e)
- sys.exit(-1)
diff --git a/build_tools/download_sdk.py b/build_tools/download_sdk.py
deleted file mode 100755
index bb8b1e1..0000000
--- a/build_tools/download_sdk.py
+++ /dev/null
@@ -1,221 +0,0 @@
-#!/usr/bin/env python
-# 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.
-"""Download the very lastet version Native Client SDK.
-
-This script downloads toolchain bz2's and expands them.
-
-On Windows this script also required access to the cygtar python
-module which gets included by the gclient DEPS, and assumes
-that cygwin is installed in /cygwin.
-"""
-
-import argparse
-import os
-import subprocess
-import sys
-import tarfile
-import time
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-NACLPORTS_ROOT = os.path.dirname(SCRIPT_DIR)
-sys.path.append(os.path.join(NACLPORTS_ROOT, 'lib'))
-
-import webports
-import webports.source_package
-
-HISTORY_SIZE = 500
-
-if sys.version_info < (2, 6, 0):
- sys.stderr.write('python 2.6 or later is required run this script\n')
- sys.exit(1)
-
-if sys.version_info >= (3, 0, 0):
- sys.stderr.write('This script does not support python 3.\n')
- sys.exit(1)
-
-SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
-SRC_DIR = os.path.dirname(SCRIPT_DIR)
-OUT_DIR = os.path.join(SRC_DIR, 'out')
-TARGET_DIR = os.path.join(OUT_DIR, 'nacl_sdk')
-
-if sys.platform == 'win32':
- NACL_BUILD_DIR = os.path.join(SRC_DIR, 'native_client', 'build')
- sys.path.append(NACL_BUILD_DIR)
- import cygtar # pylint: disable=import-error
-
-BOT_GSUTIL = '/b/build/scripts/slave/gsutil'
-GS_URL_BASE = 'gs://nativeclient-mirror/nacl/nacl_sdk/'
-GSTORE = 'http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/'
-
-
-def DetermineSDKURL(flavor, base_url, version):
- """Download one Native Client toolchain and extract it.
-
- Arguments:
- flavor: flavor of the sdk to download
- base_url: base url to download toolchain tarballs from
- version: version directory to select tarballs from
-
- Returns:
- The URL of the SDK archive
- """
- # gsutil.py ships with depot_tools, which should be in PATH
- gsutil = [sys.executable, webports.util.FindInPath('gsutil.py')]
- path = flavor + '.tar.bz2'
-
- def GSList(path):
- """Run gsutil 'ls' on a path and return just the basenames of the
- elements within.
- """
- cmd = gsutil + ['ls', base_url + path]
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- p_stdout = p.communicate()[0]
- if p.returncode:
- raise webports.Error('gsutil command failed: %s' % str(cmd))
-
- elements = p_stdout.splitlines()
- return [os.path.basename(os.path.normpath(elem)) for elem in elements]
-
- if version == 'latest':
- webports.Log('Looking for latest SDK build...')
- # List the top level of the nacl_sdk folder
- versions = GSList('')
- # Find all trunk revision
- versions = [v for v in versions if v.startswith('trunk')]
-
- # Look backwards through all trunk revisions
- # Only look back HISTORY_SIZE revisions so this script doesn't take
- # forever.
- versions = list(reversed(sorted(versions)))
- for version_dir in versions[:HISTORY_SIZE]:
- contents = GSList(version_dir)
- if path in contents:
- version = version_dir.rsplit('.', 1)[1]
- break
- else:
- raise webports.Error('No SDK build (%s) found in last %d trunk builds' %
- (path, HISTORY_SIZE))
-
- return '%strunk.%s/%s' % (GSTORE, version, path)
-
-
-def Untar(bz2_filename):
- if sys.platform == 'win32':
- tar_file = None
- try:
- webports.Log('Unpacking tarball...')
- tar_file = cygtar.CygTar(bz2_filename, 'r:bz2')
- tar_file.Extract()
- except Exception, err:
- raise webports.Error('Error unpacking %s' % str(err))
- finally:
- if tar_file:
- tar_file.Close()
- else:
- if subprocess.call(['tar', 'jxf', bz2_filename]):
- raise webports.Error('Error unpacking')
-
-
-def FindCygwin():
- if os.path.exists(r'\cygwin'):
- return r'\cygwin'
- elif os.path.exists(r'C:\cygwin'):
- return r'C:\cygwin'
- else:
- raise webports.Error(r'failed to find cygwin in \cygwin or c:\cygwin')
-
-
-def DownloadAndInstallSDK(url, target_dir):
- bz2_dir = OUT_DIR
- if not os.path.exists(bz2_dir):
- os.makedirs(bz2_dir)
- bz2_filename = os.path.join(bz2_dir, url.split('/')[-1])
-
- if sys.platform in ['win32', 'cygwin']:
- cygbin = os.path.join(FindCygwin(), 'bin')
-
- # Download it.
- webports.DownloadFile(bz2_filename, url)
-
- # Extract toolchain.
- old_cwd = os.getcwd()
- os.chdir(bz2_dir)
- Untar(bz2_filename)
- os.chdir(old_cwd)
-
- # Calculate pepper_dir by taking common prefix of tar
- # file contents
- tar = tarfile.open(bz2_filename)
- names = tar.getnames()
- tar.close()
- pepper_dir = os.path.commonprefix(names)
-
- actual_dir = os.path.join(bz2_dir, pepper_dir)
-
- # Drop old versions.
- if os.path.exists(target_dir):
- webports.Log('Cleaning up old SDK...')
- if sys.platform in ['win32', 'cygwin']:
- cmd = [os.path.join(cygbin, 'bin', 'rm.exe'), '-rf']
- else:
- cmd = ['rm', '-rf']
- cmd.append(target_dir)
- returncode = subprocess.call(cmd)
- assert returncode == 0
-
- webports.Log('Renaming toolchain "%s" -> "%s"' % (actual_dir, target_dir))
- os.rename(actual_dir, target_dir)
-
- if sys.platform in ['win32', 'cygwin']:
- time.sleep(2) # Wait for windows.
-
- # Clean up: remove the sdk bz2.
- os.remove(bz2_filename)
-
- webports.Log('Install complete.')
-
-
-PLATFORM_COLLAPSE = {
- 'win32': 'win',
- 'cygwin': 'win',
- 'linux': 'linux',
- 'linux2': 'linux',
- 'darwin': 'mac',
-}
-
-
-def main(argv):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('-v', '--version', default='latest',
- help='which version of the SDK to download')
- options = parser.parse_args(argv)
-
- flavor = 'naclsdk_' + PLATFORM_COLLAPSE[sys.platform]
-
- url = DetermineSDKURL(flavor, base_url=GS_URL_BASE, version=options.version)
-
- stamp_file = os.path.join(TARGET_DIR, 'stamp')
- if os.path.exists(stamp_file):
- with open(stamp_file) as f:
- installed_url = f.read().strip()
- if installed_url == url:
- webports.Log('SDK already installed: %s' % url)
- return 0
- else:
- webports.Log('Ignoring currently installed SDK: %s' % installed_url)
-
- DownloadAndInstallSDK(url, TARGET_DIR)
- with open(stamp_file, 'w') as f:
- f.write(url + '\n')
- return 0
-
-
-if __name__ == '__main__':
- try:
- rtn = main(sys.argv[1:])
- except webports.Error as e:
- sys.stderr.write("error: %s\n" % str(e))
- rtn = 1
- sys.exit(rtn)
diff --git a/build_tools/find_effected_packages.py b/build_tools/find_effected_packages.py
deleted file mode 100755
index a30e27a..0000000
--- a/build_tools/find_effected_packages.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 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.
-"""Find which packages are effected by a given change.
-
-Accepts a list of changed files and outputs a list of effected
-packages. Outputs 'all' if any shared/non-package-specific
-file if changed."""
-
-import argparse
-import fnmatch
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-NACLPORTS_ROOT = os.path.dirname(SCRIPT_DIR)
-sys.path.append(os.path.join(NACLPORTS_ROOT, 'lib'))
-
-import webports
-import webports.source_package
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('-v', '--verbose', action='store_true')
- parser.add_argument('--deps', action='store_true',
- help='include dependencies of effected packages.')
- parser.add_argument('files', nargs='+', help='Changes files.')
- options = parser.parse_args(args)
- webports.SetVerbose(options.verbose)
-
- if options.deps:
- package_filter = sys.stdin.read().split()
- else:
- package_filter = None
-
- effected_packages = find_effected_packages(options.files, options.deps,
- package_filter)
- print '\n'.join(effected_packages)
- return 0
-
-# Normally when changins files outside of the 'ports' directory will
-# trigger the rebuilding of all packages. However certainly files are
-# known to not effect the building on packages and those are listed here.
-IGNORE_FILES = [
- 'build_tools/find_effected_packages.py',
- 'build_tools/partition*.txt',
- 'AUTHORS',
- '*/test_*.py',
- 'docs/*.md',
- '*.md',
-]
-
-def find_effected_packages(files, include_deps, package_filter):
- packages = []
- to_resolve = []
-
- def AddPackage(package):
- if package_filter and package.NAME not in package_filter:
- webports.LogVerbose('Filtered out package: %s' % package.NAME)
- return
- if package.NAME not in packages:
- if include_deps:
- for dep in package.TransitiveDependencies():
- if dep.NAME not in packages:
- packages.append(dep.NAME)
- packages.append(package.NAME)
- to_resolve.append(package)
-
- for filename in files:
- parts = filename.split(os.path.sep)
- if parts[0] != 'ports':
- webports.LogVerbose('effected file outside of ports tree: %s' % filename)
- if any(fnmatch.fnmatch(filename, ignore) for ignore in IGNORE_FILES):
- continue
- return ['all']
-
- package_name = parts[1]
- pkg = webports.source_package.CreatePackage(package_name)
- AddPackage(pkg)
-
- while to_resolve:
- pkg = to_resolve.pop()
- for r in pkg.ReverseDependencies():
- AddPackage(r)
-
- if package_filter:
- packages = [p for p in packages if p in package_filter]
- return packages
-
-
-if __name__ == '__main__':
- try:
- sys.exit(main(sys.argv[1:]))
- except webports.Error as e:
- sys.stderr.write('%s\n' % e)
- sys.exit(-1)
diff --git a/build_tools/generate_port_list.py b/build_tools/generate_port_list.py
deleted file mode 100755
index 33cd821..0000000
--- a/build_tools/generate_port_list.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 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.
-"""Tool for re-generating port list in markdown format
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-NACLPORTS_ROOT = os.path.dirname(SCRIPT_DIR)
-OUTPUT_FILE = os.path.join(NACLPORTS_ROOT, 'docs', 'port_list.md')
-
-sys.path.append(os.path.join(NACLPORTS_ROOT, 'lib'))
-
-import webports
-import webports.source_package
-
-SRC_URL = 'https://chromium.googlesource.com/webports/+/master'
-
-header = '''\
-# List of available ports
-
-Port are listed in alphabetical order, with links to the upstream
-source archive and the patch used when building for NaCl.
-This listing is auto-generated by
-[generate\_port\_list.py](%s/build_tools/generate_port_list.py).
-
-| **Name** | **Version** | **Upstream Archive** | **NaCl Patch** \
-| **Disabled Libc** | **Disabled Arch** |
-| :--- | :--- | :--- | :--- | :--- | :--- |
-''' % SRC_URL
-
-
-def MakeTableRow(package):
- patch = os.path.join(package.root, 'nacl.patch')
- if os.path.exists(patch):
- size = os.path.getsize(patch)
- if size < 1024:
- patch = '[%d B][%s]' % (size, package.NAME + '_patch')
- else:
- patch = '[%d KiB][%s]' % (size / 1024, package.NAME + '_patch')
- else:
- patch = ''
- url = '[%s][%s]' % (package.GetArchiveFilename(), package.NAME + '_upstream')
- package_url = '[%s]' % package.NAME
-
- disabled_libc = getattr(package, 'DISABLED_LIBC')
- if disabled_libc:
- disabled_libc = ', '.join(disabled_libc)
-
- disabled_arch = getattr(package, 'DISABLED_ARCH')
- if disabled_arch:
- disabled_arch = ', '.join(disabled_arch)
-
- host = package.BUILD_OS
- if host:
- host = host + '-only'
- else:
- host = ''
- cols = (package_url, package.VERSION, url, patch, disabled_libc,
- disabled_arch)
- return '| %-25s | %-15s | %-45s | %-20s | %s | %s |\n' % cols
-
-
-def MakePage():
- page = header
-
- total = 0
- for package in sorted(webports.source_package.SourcePackageIterator()):
- if package.URL:
- page += MakeTableRow(package)
- total += 1
-
- page += '\n_Total = %d_\n\n' % total
-
- page += '# Local Ports (not based on upstream sources) =\n\n'
- total = 0
- for package in webports.source_package.SourcePackageIterator():
- if package.URL:
- continue
- page += '- [%s][%s]\n' % (package.NAME, package.NAME)
- total += 1
- page += '\n_Total = %d_\n\n' % total
-
- # Generate up to tree links for each package at the base of the page
- for package in webports.source_package.SourcePackageIterator():
- relative_path = os.path.relpath(package.root, NACLPORTS_ROOT)
- page += '[%s]: %s/%s\n' % (package.NAME, SRC_URL, relative_path)
-
- patch = os.path.join(package.root, 'nacl.patch')
- if os.path.exists(patch):
- relative_path = os.path.relpath(patch, NACLPORTS_ROOT)
- page += '[%s_patch]: %s/%s\n' % (package.NAME, SRC_URL, relative_path)
-
- if package.URL:
- page += '[%s_upstream]: %s\n' % (package.NAME, package.URL)
-
-
- return page
-
-
-def main(argv):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Output extra information.')
- parser.add_argument('-o', '--output', default=OUTPUT_FILE,
- help='Output file.')
- args = parser.parse_args(argv)
- with open(args.output, 'w') as f:
- f.write(MakePage())
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/httpd.py b/build_tools/httpd.py
deleted file mode 100755
index e633335..0000000
--- a/build_tools/httpd.py
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 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.
-"""A tiny web server.
-
-This is intended to be used for testing.
-"""
-
-import BaseHTTPServer
-import logging
-import os
-import SimpleHTTPServer
-import SocketServer
-import sys
-import urlparse
-import shutil
-
-# Using 'localhost' means that we only accept connections
-# via the loop back interface.
-SERVER_PORT = 5103
-SERVER_HOST = ''
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-SRC_DIR = os.path.dirname(SCRIPT_DIR)
-
-
-class QuittableHTTPServer(SocketServer.ThreadingMixIn,
- BaseHTTPServer.HTTPServer):
- """An HTTP server that will quit when |is_running| is set to False.
-
- We also use SocketServer.ThreadingMixIn in order to handle requests
- asynchronously for faster responses."""
- pass
-
-
-def KeyValuePair(string, sep='='):
- """"Safely" split a string at |sep| into a [key, value] pair.
-
- If |sep| does not exist in |string|, then the entire |string| is the key and
- the value is set to an empty string."""
- if sep in string:
- return string.split(sep)
- else:
- return [string, '']
-
-
-class QuittableHTTPHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
- """A small handler that looks for '?quit=1' query in the path and shuts itself
- down if it finds that parameter."""
-
- def do_OPTIONS(self):
- self.send_response(200, 'OK')
- self.send_header('Access-Control-Allow-Methods', 'GET, OPTIONS, HEAD')
- self.send_header('Access-Control-Allow-Headers', 'target')
- self.end_headers()
-
- def do_GET(self):
- (_, _, _, query, _) = urlparse.urlsplit(self.path)
- url_params = dict([KeyValuePair(key_value)
- for key_value in query.split('&')])
- if 'quit' in url_params and '1' in url_params['quit']:
- self.send_response(200, 'OK')
- self.send_header('Content-type', 'text/html')
- self.send_header('Content-length', '0')
- self.end_headers()
- self.server.shutdown()
- return
-
- headers = str(self.headers)
- begin = headers.find('Range: ')
- if begin != -1:
- end = headers.find('\n', begin)
- if end != -1:
- line = headers[begin:end]
- ind = line.find('=')
- byte_range = line[ind + 1:].split('-')
- byte_begin = int(byte_range[0])
- byte_end = int(byte_range[1])
- length = byte_end - byte_begin + 1
- f = self.send_partial(byte_begin, length)
- if f:
- shutil.copyfileobj(f, self.wfile, length)
- f.seek(-byte_begin, os.SEEK_CUR)
- f.close()
- return
-
- SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
-
- def end_headers(self):
- self.send_header("Access-Control-Allow-Origin", "*")
- SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
-
- def send_partial(self, offset, length):
- """The following code is lifed from SimpleHTTPServer.send_head()
- The only change is that a 206 response is sent instead of 200.
- """
- path = self.translate_path(self.path)
- f = None
- if os.path.isdir(path):
- if not self.path.endswith('/'):
- # redirect browser - doing basically what apache does
- self.send_response(301)
- self.send_header("Location", self.path + "/")
- self.end_headers()
- return None
- for index in "index.html", "index.htm":
- index = os.path.join(path, index)
- if os.path.exists(index):
- path = index
- break
- else:
- return self.list_directory(path)
- ctype = self.guess_type(path)
- try:
- # Always read in binary mode. Opening files in text mode may cause
- # newline translations, making the actual size of the content
- # transmitted *less* than the content-length!
- f = open(path, 'rb')
- #f.seek(offset)
- except IOError:
- self.send_error(404, "File not found")
- return None
- fs = os.fstat(f.fileno())
- if offset + length > fs[6] or length < 0:
- self.send_error(416, 'Request range not satisfiable')
- return None
- self.send_response(206, 'Partial content')
- f.seek(offset, os.SEEK_CUR)
- self.send_header("Content-Range",
- str(offset) + '-' + str(length + offset - 1))
- self.send_header("Content-Length", str(length))
- self.send_header("Content-type", ctype)
- self.send_header("Last-Modified", self.date_time_string(fs.st_mtime))
- self.end_headers()
- return f
-
-
-def Run(server_address,
- server_class=QuittableHTTPServer,
- handler_class=QuittableHTTPHandler):
- httpd = server_class(server_address, handler_class)
- logging.info("Starting local server on port %d", server_address[1])
- logging.info("To shut down send http://localhost:%d?quit=1",
- server_address[1])
- httpd.serve_forever()
- logging.info("Shutting down local server on port %d", server_address[1])
-
-
-def main(args):
- logging.getLogger().setLevel(logging.INFO)
- os.chdir(os.path.join(SRC_DIR, 'out', 'publish'))
- if args:
- port = int(args[0])
- else:
- port = SERVER_PORT
- Run((SERVER_HOST, port))
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/ld b/build_tools/ld
deleted file mode 100755
index c9d6ac6..0000000
--- a/build_tools/ld
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-# This is ld substitution which makes possible to process all checks during
-# configuration process inside native client untrusted code. To use it you have
-# to make some changes in your environmentals:
-# 1) export CFLAGS+=" -B<path to the directory containing this file>".
-# 2) Put path to ld from native client toolchain in REAL_LD variable.
-# 3) Export NACL_LOADER variable to point to a Native Client loader (sel_ldr).
-
-$REAL_LD "$@"
-if [ "$?" = "0" ] ; then
- outfile=a.out
- W=0
- for out ; do
- if [ "$W" = "1" ] ; then
- W=0
- outfile="$out"
- elif [ "$out" = "-o" ] ; then
- W=1
- fi
- done
- if [ "${outfile:0:1}" != "/" ] ; then
- outfile="`pwd`/$outfile"
- fi
- /bin/mv -f "$outfile" "$outfile.nexe"
- echo "#!/bin/bash
-( NACL_DANGEROUS_ENABLE_FILE_ACCESS=1 "$NACL_LOADER " \"$outfile\".nexe \"\$@\" 3>&2 2>&1 1>&3- | grep -v '] BYPASSING ALL ACL CHECKS' | grep -v '] DANGER: ENABLED FILE ACCESS' ; exit \${PIPESTATUS[0]} ) 3>&2 2>&1 1>&3-" > "$outfile"
- chmod a+x "$outfile"
- exit 0
-fi
diff --git a/build_tools/naclprocess.js b/build_tools/naclprocess.js
deleted file mode 100644
index f522fff..0000000
--- a/build_tools/naclprocess.js
+++ /dev/null
@@ -1,1493 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* jshint evil: true */
-/* globals PipeServer */
-
-'use strict';
-
-// TODO(gdeepti): extend to multiple mounts.
-/**
- * Mount object contains the state of the local mount.
- */
-var g_mount = {
- // DirectoryEntry specified by the user
- entry: undefined,
-
- // Id of the entry object.
- entryId: undefined,
-
- // User's local file system
- filesystem: undefined,
-
- // Path of the directory on the local filesystem
- fullPath: undefined,
-
- // Local path to mount user directory
- mountPoint: undefined,
-
- // Mount is available
- available: false,
-
- // Mount has been mounted
- mounted: false
-};
-
-/**
- * This creates a popup that runs a NaCl process inside.
- *
- * @param {Object} process The NaCl process to be run.
- * @param {number} width
- * @param {number} height
- * @param {string} title
- */
-function GraphicalPopup(process, width, height, title) {
- this.process = process || null;
- this.width = width || GraphicalPopup.DEFAULT_WIDTH;
- this.height = height || GraphicalPopup.DEFAULT_HEIGHT;
- this.title = title || '';
- this.win = null;
- this.onClosed = null;
-}
-
-/**
- * The default width of the popup.
- * @type {number}
- */
-GraphicalPopup.DEFAULT_WIDTH = 600;
-
-/**
- * The default height of the popup.
- * @type {number}
- */
-GraphicalPopup.DEFAULT_HEIGHT = 400;
-
-/**
- * The (empty) HTML file to which the NaCl module is added.
- * @const
- */
-GraphicalPopup.HTML_FILE = 'graphical.html';
-
-/**
- * Focus the window in which this code is run.
- */
-GraphicalPopup.focusCurrentWindow = function () {
- chrome.app.window.current().focus();
-};
-
-/**
- * This callback is called when the popup is closed.
- * @callback closedCallback
- */
-
-/**
- * Set a function to be called as a callback when the popup is closed.
- * @param {closedCallback} listener
- */
-GraphicalPopup.prototype.setClosedListener = function (listener) {
- if (this.win) {
- throw new Error("Cannot set closed listener after creating window.");
- }
- this.onClosed = listener;
-};
-
-/**
- * Create the window.
- */
-GraphicalPopup.prototype.create = function () {
- var self = this;
- chrome.app.window.create('graphical.html', {
- 'bounds': {
- 'width': self.width,
- 'height': self.height
- },
- }, function (win) {
- var process = self.process;
- var popup = win.contentWindow;
-
- self.win = process.window = win;
-
- popup.document.title = self.title;
-
- popup.addEventListener('load', function () {
- process.style.position = 'absolute';
- process.style.top = '0';
- process.style.left = '0';
- process.style.width = '100%';
- process.style.height = '100%';
- popup.document.body.appendChild(process);
- });
-
- popup.focused = true;
- popup.addEventListener('focus', function () {
- this.focused = true;
- });
- popup.addEventListener('blur', function () {
- this.focused = false;
- });
-
- if (self.onClosed) {
- win.onClosed.addListener(self.onClosed);
- }
- });
-};
-
-/**
- * Close the popup.
- */
-GraphicalPopup.prototype.destroy = function () {
- if (this.win.contentWindow.focused) {
- GraphicalPopup.focusCurrentWindow();
- }
- if (this.onClosed) {
- this.win.onClosed.removeListener(this.onClosed);
- }
- this.win.close();
-
- this.process = null;
- this.win = null;
-};
-
-
-/**
- * NaClProcessManager provides a framework for NaCl executables to run within a
- * web-based terminal.
- */
-function NaClProcessManager() {
- var self = this;
- self.onError = null;
- self.onStdout = null;
- self.onRootProgress = null;
- self.onRootLoad = null;
-
- self.debug = false;
-
- // The process which gets the input from the user.
- self.foregroundProcess = null;
-
- // Process group information keyed by PGID. The value is an object consisting
- // of the fields: {
- // sid: the session ID of the process group
- // processes: an object keyed by the PIDs of processes in this group, used
- // as a set
- // }
- self.processGroups = {};
-
- // Process information keyed by PID. The value is an object consisting of the
- // fields: {
- // domElement: the <embed> element of the process,
- // exitCode: the exit code of the process, or null if the process has not
- // yet exited,
- // pgid: the process group ID of the process
- // ppid: the parent PID of the process
- // mounted: mount information for the process
- // }
- self.processes = {};
-
- // Waiter processes keyed by the PID of the waited process. The waiter
- // is represented by a hash like
- // { reply: a callback to call to report a process exit, options: the
- // options specfied for the wait (such as WNOHANG) }
- self.waiters = {};
-
- // Start process IDs at 2, as PIDs 0 and 1 are reserved on real systems.
- self.pid = 2;
-
- // Handles the set of pipes.
- self.pipeServer = new PipeServer();
-
- // Callback to be called each time a process responds with a mount status
- // update.
- self.mountUpdateCallback = null;
-
- // Size of the terminal, must be set before spawning.
- self.ttyWidth = null;
- self.ttyHeight = null;
-}
-
-/**
- * Constants that correspond to values in errno.h.
- * @namespace
- */
-var Errno = {
- /**
- * Operation not permitted.
- * @type {number}
- */
- EPERM: 1,
-
- /**
- * File or directory not found.
- * @type {number}
- */
- ENOENT: 2,
-
- /**
- * Process not found.
- * @type {number}
- */
- ESRCH: 3,
-
- /**
- * Executable format error.
- * @type {number}
- */
- ENOEXEC: 8,
-
- /**
- * No child processes.
- * @type {number}
- */
- ECHILD: 10,
-
- /**
- * Permission denied.
- * @type {number}
- */
- EACCES: 13,
-
- /**
- * Invalid argument.
- * @type {number}
- */
- EINVAL: 22,
-};
-
-/*
- * The PID of the "init" process. Processes directly spawned from JavaScript
- * have their parent PID set to this value.
- * @type {number}
- */
-NaClProcessManager.INIT_PID = 1;
-
-/**
- * The error thrown when the user tries to execute operations on the foreground
- * process when there is no such process.
- * @const
- */
-NaClProcessManager.NO_FG_ERROR = 'No foreground process running.';
-
-/**
- * The TTY prefix for communicating with NaCl processes.
- * @const
- */
-NaClProcessManager.prefix = 'tty_msg';
-
-/**
- * The "no hang" flag for waitpid().
- * @type {number}
- */
-NaClProcessManager.WNOHANG = 1;
-
-/*
- * Exit code when a process has an error.
- * @type {number}
- */
-NaClProcessManager.EX_NO_EXEC = 126;
-
-/*
- * Exit code when a process is ended with SIGKILL.
- * @type {number}
- */
-NaClProcessManager.EXIT_CODE_KILL = 128 + 9;
-
-/**
- * This environmnent variable should be set to 1 to enable Control+C quitting
- * of processes.
- * @const
- */
-NaClProcessManager.ENV_ABORT = 'ENABLE_CONTROL_C';
-
-/**
- * This is the value to which the ENV_ABORT environment variable should be set
- * in order to enable Control+C.
- * @const
- */
-NaClProcessManager.ENV_ABORT_VALUE = '1';
-
-
-/**
- * Environment variable that can be set to the value in ENV_SPAWN_MODE or
- * ENV_SPAWN_EMBED_VALUE to enable viewing of graphical output from programs.
- * @const
- */
-NaClProcessManager.ENV_SPAWN_MODE = 'NACL_SPAWN_MODE';
-
-/**
- * Value for ENV_SPAWN_MODE that makes programs open in a new window.
- * @const
- */
-NaClProcessManager.ENV_SPAWN_POPUP_VALUE = 'popup';
-
-/**
- * Value for ENV_SPAWN_MODE that makes the graphical output of programs appear
- * within the terminal window.
- * @const
- */
-NaClProcessManager.ENV_SPAWN_EMBED_VALUE = 'embed';
-
-/**
- * Environment variable that can be set to change the width of the popup when
- * ENV_SPAWN_MODE is set to ENV_SPAWN_POPUP_VALUE.
- * @const
- */
-NaClProcessManager.ENV_POPUP_WIDTH = 'NACL_POPUP_WIDTH';
-
-/**
- * Environment variable that can be set to change the height of the popup when
- * ENV_SPAWN_MODE is set to ENV_SPAWN_POPUP_VALUE.
- * @const
- */
-NaClProcessManager.ENV_POPUP_HEIGHT = 'NACL_POPUP_HEIGHT';
-
-/*
- * Default width for a popup, in pixels.
- * @type {number}
- */
-NaClProcessManager.POPUP_WIDTH_DEFAULT = 600;
-
-/*
- * Default height for a popup, in pixels.
- * @type {number}
- */
-NaClProcessManager.POPUP_HEIGHT_DEFAULT = 400;
-
-/**
- * Environment variable that can be set to change the width of the embedded
- * element when ENV_SPAWN_MODE is set to ENV_SPAWN_EMBED_VALUE.
- * @const
- */
-NaClProcessManager.ENV_EMBED_WIDTH = 'NACL_EMBED_WIDTH';
-
-/**
- * Environment variable that can be set to change the height of the embedded
- * element when ENV_SPAWN_MODE is set to ENV_SPAWN_EMBED_VALUE.
- * @const
- */
-NaClProcessManager.ENV_EMBED_HEIGHT = 'NACL_EMBED_HEIGHT';
-
-/*
- * Default width for a spawned embed, in any units recognized by CSS.
- * @const
- */
-NaClProcessManager.EMBED_WIDTH_DEFAULT = '100%';
-
-/*
- * Default height for a spawned embed, in any units recognized by CSS.
- * @const
- */
-NaClProcessManager.EMBED_HEIGHT_DEFAULT = '50%';
-
-/**
- * Handles an architecture gotten event.
- * @callback naclArchCallback
- */
-
-/**
- * Called to get the nacl architectgure.
- * @param {naclArchCallback} callback.
- */
-function getNaClArch(callback) {
- if (getNaClArch.naclArch === undefined) {
- if (chrome && chrome.runtime && chrome.runtime.getPlatformInfo) {
- chrome.runtime.getPlatformInfo(function (platformInfo) {
- getNaClArch.naclArch = {
- 'x86-32': 'i686',
- 'x86-64': 'x86_64',
- 'arm': 'arm',
- }[platformInfo.nacl_arch] || platformInfo.nacl_arch;
- callback(getNaClArch.naclArch);
- });
- return;
- }
- getNaClArch.naclArch = null;
- }
- setTimeout(function () {
- callback(getNaClArch.naclArch);
- }, 0);
-}
-
-/**
- * Handles a stdout event.
- * @callback stdoutCallback
- * @param {string} msg The string sent to stdout.
- */
-
-/**
- * Listen for stdout from the spawned processes.
- * @param {stdoutCallback} callback The callback to be called on a stdout write.
- */
-NaClProcessManager.prototype.setStdoutListener = function (callback) {
- this.onStdout = callback;
-};
-
-/**
- * Handles an error event.
- * @callback errorCallback
- * @param {string} cmd The name of the process with the error.
- * @param {string} err The error message.
- */
-
-/**
- * Listen for errors from the spawned processes.
- * @param {errorCallback} callback The callback to be called on error.
- */
-NaClProcessManager.prototype.setErrorListener = function (callback) {
- this.onError = callback;
-};
-
-/**
- * Handles a progress event from the root process.
- * @callback rootProgressCallback
- * @param {string} url The URL that is being loaded.
- * @param {boolean} lengthComputable Is our progress quantitatively measurable?
- * @param {number} loaded The number of bytes that have been loaded.
- * @param {number} total The total number of bytes to be loaded.
- */
-
-/**
- * Listen for a progress event from the root process.
- * @param {rootProgressCallback} callback The callback to be called on progress.
- */
-NaClProcessManager.prototype.setRootProgressListener = function (callback) {
- this.onRootProgress = callback;
-};
-
-/**
- * Handles a load event from the root process.
- * @callback rootLoadCallback
- */
-
-/**
- * Listen for a load event from the root process.
- * @param {rootLoadCallback} callback The callback to be called on load.
- */
-NaClProcessManager.prototype.setRootLoadListener = function (callback) {
- this.onRootLoad = callback;
-};
-
-/**
- * Is the given process the root process of this process manager? A root
- * process is the one created by NaClProcessManager and not spawned by
- * another process.
- * @param {HTMLObjectElement} process The element about which one is inquiring.
- */
-NaClProcessManager.prototype.isRootProcess = function (process) {
- return !process.parent;
-};
-
-/**
- * Broadcast message from javascript to all the processes.
- * @message the message to be broadcasted
- * @callback callback to be stashed away and called when
- * a process responds with a mount status update
- */
-NaClProcessManager.prototype.broadcastMessage = function (message, callback) {
- this.mountUpdateCallback = callback;
- Object.keys(this.processes).forEach(function (key) {
- this.processes[key].domElement.postMessage(message);
- });
-};
-
-NaClProcessManager.prototype.log = function (msg) {
- if (this.debug) {
- console.log(msg);
- }
-};
-
-/**
- * Sync Mount status every time a mount/unmount message
- * is recieved from a process.
- */
-NaClProcessManager.prototype.syncMountStatus_ = function () {
- var result = true;
-
- if (g_mount.available) {
- Object.keys(this.processes).forEach(function (p) {
- result = (result && this.processes[p].mounted);
- });
- } else {
- result = false;
- Object.keys(this.processes).forEach(function (p) {
- result = (result || this.processes[p].mounted);
- });
- }
-
- g_mount.mounted = result;
- if (this.mountUpdateCallback !== null) {
- this.mountUpdateCallback();
- }
- return result;
-};
-
-/**
- * Makes the path in a NMF entry to fully specified path.
- * @private
- */
-NaClProcessManager.prototype.adjustNmfEntry_ = function (entry) {
- Object.keys(entry).forEach(function (arch) {
- var path;
- if (arch === 'portable') {
- if (entry[arch]['pnacl-translate'] === undefined ||
- entry[arch]['pnacl-translate'].url === undefined) {
- return;
- }
- path = entry[arch]['pnacl-translate'].url;
- } else {
- if (entry[arch].url === undefined) {
- return;
- }
- path = entry[arch].url;
- }
-
- // Convert 'path' from the NaCl VFS into an HTML5 filesystem: URL
- var tmpMountPoint = '/tmp/';
- var httpMountPoint = '/mnt/http/';
- var fsname = '/persistent/';
- if (path.indexOf(tmpMountPoint) === 0) {
- // Strip the /tmp/ prefix
- path = path.replace(tmpMountPoint, '');
- fsname = '/temporary/';
- path = 'filesystem:' + location.origin + fsname + path;
- } else if (path.indexOf(httpMountPoint) === 0) {
- path = path.replace(httpMountPoint, '');
- var base = location.href.match('.*/')[0];
- path = base + path;
- } else {
- if (NaClProcessManager.fsroot !== undefined) {
- path = NaClProcessManager.fsroot + path;
- }
- path = 'filesystem:' + location.origin + fsname + path;
- }
-
- if (arch === 'portable') {
- entry[arch]['pnacl-translate'].url = path;
- } else {
- entry[arch].url = path;
- }
- });
-};
-
-/**
- * Handle messages sent to us from NaCl.
- * @private
- */
-NaClProcessManager.prototype.handleMessage_ = function (e) {
- var msg = e.data;
- var src = e.srcElement;
-
- // Set handlers for commands. Each handler is passed three arguments:
- // msg: the data sent from the NaCl module
- // reply: a callback to reply to the command
- // src: the DOM element from which the message was received
- var handlers = {
- nacl_spawn: [this, this.handleMessageSpawn_],
- nacl_wait: [this, this.handleMessageWait_],
- nacl_getpgid: [this, this.handleMessageGetPGID_],
- nacl_setpgid: [this, this.handleMessageSetPGID_],
- nacl_getsid: [this, this.handleMessageGetSID_],
- nacl_setsid: [this, this.handleMessageSetSID_],
- nacl_apipe: [this.pipeServer, this.pipeServer.handleMessageAPipe],
- nacl_apipe_write: [this.pipeServer,
- this.pipeServer.handleMessageAPipeWrite],
- nacl_apipe_read: [this.pipeServer,
- this.pipeServer.handleMessageAPipeRead],
- nacl_apipe_close: [this.pipeServer,
- this.pipeServer.handleMessageAPipeClose],
- nacl_jseval: [this, this.handleMessageJSEval_],
- nacl_deadpid: [this, this.handleMessageDeadPid_],
- nacl_mountfs: [this, this.handleMessageMountFs_],
- };
-
- // TODO(channingh): Once pinned applications support "result" instead of
- // "pid", change calls to reply() to set "result."
- function reply(contents) {
- var message = {};
- message[msg.id] = contents;
- // Enable to debug message stream (disabled for speed).
- // console.log(src.pid + '> reply: ' + JSON.stringify(reply));
- if (src.postMessage) {
- src.postMessage(message);
- }
- }
-
- if (msg.command && handlers[msg.command]) {
- // Enable to debug message stream (disabled for speed).
- //console.log(src.pid + '> ' + msg.command + ': ' + JSON.stringify(msg));
- var handler = handlers[msg.command];
- handler[1].call(handler[0], msg, reply, src);
- } else if (msg.mount_status === 'success') {
- // TODO(gdeepti): Remove monitoring mount status with strings.
- this.processes[src.pid].mounted = true;
- this.syncMountStatus_();
- } else if (msg.unmount_status === 'success') {
- this.processes[src.pid].mounted = false;
- this.syncMountStatus_();
- } else if (msg.mount_status === 'fail' || msg.unmount_status === 'fail') {
- this.log('mounter_status: ' + JSON.stringify(msg));
- } else if (typeof msg === 'string' &&
- msg.indexOf(NaClProcessManager.prefix) === 0) {
- var out = msg.substring(NaClProcessManager.prefix.length);
- if (this.onStdout) {
- this.onStdout(out);
- }
- } else if (typeof msg === 'string' &&
- msg.indexOf('exited') === 0) {
- var exitCode = parseInt(msg.split(':', 2)[1], 10);
- if (isNaN(exitCode)) {
- exitCode = 0;
- }
- this.exit(exitCode, src);
- } else {
- console.log('unexpected message: ' + JSON.stringify(msg));
- return;
- }
-};
-
-/**
- * Handle a nacl_spawn call.
- * @private
- */
-NaClProcessManager.prototype.handleMessageSpawn_ = function (msg, reply, src) {
- var self = this;
- var args = msg.args;
- var envs = msg.envs;
- var cwd = msg.cwd;
- var executable = args[0];
- var nmf = msg.nmf;
- var pid = -1;
- self.log('handleMessageSpawn mode=' + msg.mode);
- if (msg.mode === 'overlay') {
- pid = src.pid;
- }
- if (nmf) {
- if (nmf.files) {
- Object.keys(nmf.files).forEach(function (key) {
- self.adjustNmfEntry_(nmf.files[key]);
- });
- }
- self.adjustNmfEntry_(nmf.program);
- var blob = new Blob([JSON.stringify(nmf)], {type: 'text/plain'});
- var nmfUrl = window.URL.createObjectURL(blob);
- var naclType = self.checkNaClManifestType(nmf) || 'nacl';
- self.spawn(nmfUrl, args, envs, cwd, naclType, src, pid, function(new_pid) {
- reply({pid: new_pid});
- });
- } else {
- if (NaClProcessManager.nmfWhitelist !== undefined &&
- NaClProcessManager.nmfWhitelist.indexOf(executable) === -1) {
- var replyMsg = {
- pid: -Errno.ENOENT,
- };
- console.log('nacl_spawn(error): ' + executable + ' not in whitelist');
- reply(replyMsg);
- return;
- }
- nmf = executable + '.nmf';
- self.checkUrlNaClManifestType(nmf, function (naclType) {
- self.spawn(nmf, args, envs, cwd, naclType, src, pid, function (new_pid) {
- reply({pid: new_pid});
- });
- }, function (msg) {
- console.log('nacl_spawn(error): ' + msg);
- reply({pid: -Errno.ENOENT});
- });
- }
-};
-
-
-/**
- * Handle a waitpid call.
- * @private
- */
-NaClProcessManager.prototype.handleMessageWait_ = function (msg, reply, src) {
- this.waitpid(msg.pid, msg.options, function (pid, status) {
- reply({
- pid: pid,
- status: status
- });
- }, src.pid);
-};
-
-/**
- * Handle a getpgid call.
- * @private
- */
-NaClProcessManager.prototype.handleMessageGetPGID_ = function (msg, reply,
- src) {
- var pgid;
- var pid = parseInt(msg.pid, 10) || src.pid;
-
- if (pid < 0) {
- pgid = -Errno.EINVAL;
- } else if (!this.processes[pid] || this.processes[pid].exitCode !== null) {
- pgid = -Errno.ESRCH;
- } else {
- pgid = this.processes[pid].pgid;
- }
- reply({
- pgid: pgid,
- });
-};
-
-/**
- * Handle a setpgid call.
- * @private
- */
-NaClProcessManager.prototype.handleMessageSetPGID_ = function (msg, reply,
- src) {
- var self = this;
- function setpgid() {
- var pid = parseInt(msg.pid, 10) || src.pid;
- var newPgid = parseInt(msg.pgid, 10) || pid;
-
- if (newPgid < 0) {
- return -Errno.EINVAL;
- }
- if (!self.processes[pid] || self.processes[pid].exitCode !== null ||
- (src.pid !== pid && src.pid !== self.processes[pid].ppid)) {
- return -Errno.ESRCH;
- }
-
- var oldPgid = self.processes[pid].pgid;
- var sid = self.processGroups[oldPgid].sid;
-
- // The new process group is in a different session.
- if (self.processGroups[newPgid] &&
- self.processGroups[newPgid].sid !== sid) {
- return -Errno.EPERM;
- }
-
- var callerPgid = self.processes[src.pid].pgid;
- var callerSid = self.processGroups[callerPgid].sid;
-
- // The process we are trying to change is in a different session from the
- // calling process.
- if (sid !== callerSid) {
- return -Errno.EPERM;
- }
-
- // The target process is a session leader.
- if (sid === pid) {
- return -Errno.EPERM;
- }
-
- self.deleteProcessFromGroup(pid);
- if (self.processGroups[newPgid]) {
- self.processGroups[newPgid].processes[pid] = true;
- } else {
- self.createProcessGroup(newPgid, sid);
- }
- self.processes[pid].pgid = newPgid;
- return 0;
- }
- reply({
- result: setpgid(),
- });
-};
-
-/**
- * Handle a getsid call.
- * @private
- */
-NaClProcessManager.prototype.handleMessageGetSID_ = function (msg, reply, src) {
- var sid;
- var pid = parseInt(msg.pid, 10) || src.pid;
- var process = this.processes[pid];
-
- if (!process || process.exitCode !== null) {
- sid = -Errno.ESRCH;
- } else {
- sid = this.processGroups[process.pgid].sid;
- }
- reply({
- sid: sid
- });
-};
-
-/**
- * Handle a setsid call.
- * @private
- */
-NaClProcessManager.prototype.handleMessageSetSID_ = function (msg, reply, src) {
- var pid = src.pid;
- var sid;
-
- // Setsid() cannot be called on a group leader.
- if (this.processGroups[pid]) {
- sid = -Errno.EPERM;
- } else {
- this.deleteProcessFromGroup(pid);
- this.createProcessGroup(pid, pid);
- sid = this.processes[pid].pgid = pid;
- }
-
- reply({
- sid: sid
- });
-};
-
-/**
- * Handle a javascript invocation.
- * @private
- */
-NaClProcessManager.prototype.handleMessageJSEval_ = function (msg, reply) {
- // Using '' + so that undefined can be emitted as a string.
- reply({result: String(eval(msg.cmd))});
-};
-
-/**
- * Create a process that immediately exits with a given status.
- * Used to implement vfork calling _exit.
- * @private
- */
-NaClProcessManager.prototype.handleMessageDeadPid_ = function (msg, reply,
- src) {
- var self = this;
- // TODO(bradnelson): Avoid needing to frivolously manipulate the DOM to
- // generate a dead pid by separating the process data structure manipulation
- // parts of spawn + exit from the DOM / module ones.
- self.spawn(null, [], [], '/', 'pnacl', src, -1, function (new_pid, element) {
- self.exit(msg.status, element);
- reply({pid: new_pid});
- });
-};
-
-/**
- * Handle a mount filesystem call.
- */
-NaClProcessManager.prototype.handleMessageMountFs_ = function (msg, reply,
- src) {
- if (g_mount.available) {
- reply({
- filesystem: g_mount.filesystem,
- fullPath: g_mount.fullPath,
- available: g_mount.available,
- mountPoint: g_mount.mountPoint
- });
- } else {
- reply({
- available: g_mount.available
- });
- }
-};
-
-/**
- * Handle progress event from NaCl.
- * @private
- */
-NaClProcessManager.prototype.handleProgress_ = function (e) {
- e.srcElement.moduleResponded = true;
- if (this.onRootProgress && this.isRootProcess(e.srcElement)) {
- this.onRootProgress(e.url, e.lengthComputable, e.loaded, e.total);
- }
-};
-
-/**
- * Handle load event from NaCl.
- * @private
- */
-NaClProcessManager.prototype.handleLoad_ = function (e) {
- e.srcElement.moduleResponded = true;
- if (this.onRootLoad && this.isRootProcess(e.srcElement)) {
- this.onRootLoad();
- }
-};
-
-/**
- * Handle a timeout around module startup.
- * @private
- */
-NaClProcessManager.prototype.handleStartupTimeout_ = function (src) {
- if (!src.moduleResponded) {
- this.exit(NaClProcessManager.EX_NO_EXEC, src);
- }
-};
-
-/**
- * Handle abort event from NaCl.
- * @private
- */
-NaClProcessManager.prototype.handleLoadAbort_ = function (e) {
- e.srcElement.moduleResponded = true;
- this.exit(NaClProcessManager.EXIT_CODE_KILL, e.srcElement);
-};
-
-/**
- * Handle load error event from NaCl.
- * @private
- */
-NaClProcessManager.prototype.handleLoadError_ = function (e) {
- e.srcElement.moduleResponded = true;
- if (this.onError) {
- this.onError(e.srcElement.commandName, e.srcElement.lastError);
- }
- this.exit(NaClProcessManager.EX_NO_EXEC, e.srcElement);
-};
-
-/**
- * Handle crash event from NaCl.
- * @private
- */
-NaClProcessManager.prototype.handleCrash_ = function (e) {
- e.srcElement.moduleResponded = true;
- this.exit(e.srcElement.exitStatus, e.srcElement);
-};
-
-/**
- * Create a process group with the given process as the leader and add the
- * group to the table.
- * @private
- * @param {number} pid The process that will be the leader.
- * @param {number} sid The session ID of the session to which the process
- * group belongs.
- */
-NaClProcessManager.prototype.createProcessGroup = function (pid, sid) {
- if (this.processGroups[pid] !== undefined) {
- throw new Error('createProcessGroup(): process group already exists');
- }
- this.processGroups[pid] = {
- sid: sid,
- processes: {}
- };
- this.processGroups[pid].processes[pid] = true;
-};
-
-/**
- * Delete a process from the process group table. If a group has no more
- * processes, delete the group as well.
- * @private
- * @param {number} pid The process to be deleted.
- */
-NaClProcessManager.prototype.deleteProcessFromGroup = function (pid) {
- if (this.processes[pid] === undefined) {
- throw new Error('deleteProcessFromGroup(): process does not exist');
- }
- var pgid = this.processes[pid].pgid;
- if (this.processGroups[pgid] === undefined ||
- this.processGroups[pgid].processes[pid] === undefined) {
- throw new Error('deleteProcessFromGroup(): process group not found');
- }
- delete this.processGroups[pgid].processes[pid];
- if (Object.keys(this.processGroups[pgid].processes).length === 0) {
- delete this.processGroups[pgid];
- }
-};
-
-/**
- * Remove entries for a process from the process table.
- * @private
- */
-NaClProcessManager.prototype.deleteProcessEntry = function (pid) {
- delete this.processes[pid];
-};
-
-/**
- * Exit the command.
- * @param {number} code The exit code of the process.
- * @param {HTMLObjectElement} element The HTML element of the exited process.
- */
-NaClProcessManager.prototype.exit = function (code, element) {
- var pid = element.pid;
- var ppid = this.processes[pid].ppid;
- var pgid = this.processes[pid].pgid;
-
- this.pipeServer.deleteProcess(pid);
- this.deleteProcessFromGroup(pid);
-
- // Reply to processes waiting on the exited process.
- var reaped = false;
- var waiters = this.waiters;
- [pid, -1, -pgid].forEach(function (currPid) {
- if (waiters[currPid] === undefined) {
- return;
- }
- waiters[currPid].forEach(function (waiter) {
- if (waiter.srcPid === ppid) {
- waiter.reply(pid, code);
- reaped = true;
- }
- });
- waiters[currPid] = waiters[currPid].filter(function (waiter) {
- return waiter.srcPid !== ppid;
- });
- if (waiters[currPid].length === 0) {
- delete waiters[currPid];
- }
- });
- if (reaped) {
- this.deleteProcessEntry(pid);
- } else {
- this.processes[pid].exitCode = code;
- }
-
- this.log('proccess exit: ' + pid);
-
- // Mark as terminated.
- element.pid = -1;
-
- // Clean up HTML elements.
- if (element.parentNode === document.body) {
- document.body.removeChild(element);
- }
-
- if (element.popup) {
- element.popup.destroy();
- }
-
- var nextForegroundProcess = null;
- if (this.foregroundProcess === element) {
- nextForegroundProcess = element.parent;
- // When the parent has already finished, give the control to the
- // grand parent.
- while (nextForegroundProcess && nextForegroundProcess.pid === -1) {
- nextForegroundProcess = nextForegroundProcess.parent;
- }
-
- this.foregroundProcess = nextForegroundProcess;
- if (this.foregroundProcess) {
- this.log('foreground PID -> ' + this.foregroundProcess.pid);
- }
- }
-};
-
-/**
- * Determines if an object is a nacl or pnacl manifest.
- *
- * @param {object} manifest A manifest to examine.
- * @return {string} 'nacl' or 'pnacl' on success, or null on failure..
- */
-NaClProcessManager.prototype.checkNaClManifestType = function (manifest) {
- if (manifest.hasOwnProperty('program')) {
- if (manifest.program.hasOwnProperty('portable') &&
- manifest.program.portable.hasOwnProperty('pnacl-translate')) {
- return 'pnacl';
- }
- return 'nacl';
- }
- return null;
-};
-
-/**
- * Determines if an url points to a nacl or pnacl manifest.
- *
- * @param {string} url The url to download and parse.
- * @callback typeCallback Called with 'nacl' or 'pnacl' on success.
- * @callback errorCallback Called with error message on failure.
- */
-NaClProcessManager.prototype.checkUrlNaClManifestType = function (
- url, typeCallback, errorCallback) {
- var self = this;
- var request = new XMLHttpRequest();
- request.open('GET', url, true);
- request.onload = function () {
- var manifest;
- try {
- manifest = JSON.parse(request.responseText);
- } catch (e) {
- errorCallback('NaCl Manifest is not valid JSON at ' + url);
- return;
- }
- var kind = self.checkNaClManifestType(manifest);
- if (kind === null) {
- errorCallback('NaCl Manifest has bad format at ' + url);
- } else {
- typeCallback(kind);
- }
- };
- request.onerror = function () {
- errorCallback('NaCl Manifest is unreachable at ' + url);
- };
- request.send();
-};
-
-/**
- * Called once a pid / error code is known for a spawned process.
- * @callback spawnCallback
- * @param {pid} pid The pid of the spawned process or error code if negative.
- * @param {HTMLObjectElement} element DOM object corresponding to the spawned
- * process.
- */
-
-/**
- * This spawns a new NaCl process in the current window by creating an HTML
- * embed element.
- *
- * @param {string} nmf The path to the NaCl NMF file.
- * @param {Array.<string>} argv The command-line arguments to be given to the
- * spawned process.
- * @param {Array.<string>} envs The environment variables that the spawned
- * process can access. Each entry in the array should be of the format
- * "VARIABLE_NAME=value".
- * @param {string} cwd The current working directory.
- * @param {string} naclType 'nacl' or 'pnacl' to select the mime-type.
- * @param {HTMLObjectElement} parent The DOM object that corresponds to
- * the process that initiated the spawn. Set to null if there is no such
- * process.
- * @param {spawnCallback} callback.
- */
-NaClProcessManager.prototype.spawn = function (
- nmf, argv, envs, cwd, naclType, parent, pid, callback) {
- var self = this;
-
- getNaClArch(function (arch) {
- var mimetype = 'application/x-' + naclType;
- if (navigator.mimeTypes[mimetype] === undefined) {
- if (mimetype.indexOf('pnacl') !== -1) {
- console.log(
- 'Browser does not support PNaCl or PNaCl is disabled.'
- );
- } else {
- console.log(
- 'Browser does not support NaCl or NaCl is disabled.'
- );
- }
- callback(-Errno.ENOEXEC);
- return;
- }
-
- if (self.ttyWidth === null || self.ttyHeight === null) {
- console.log('tty size not set! Call onTerminalResize.');
- callback(-Errno.ENOEXEC);
- return;
- }
-
- var fg = document.createElement('object');
- self.foregroundProcess = fg;
-
- var ppid;
- if (pid === -1) {
- // Create new process
- pid = self.pid;
- self.pid += 1;
- self.log("creating new process: " + pid);
-
- var pgid = parent ? self.processes[parent.pid].pgid : pid;
- ppid = parent ? parent.pid : NaClProcessManager.INIT_PID;
- self.processes[pid] = {
- domElement: fg,
- exitCode: null,
- pgid: pgid,
- ppid: ppid,
- mounted: false,
- };
- if (!parent) {
- self.createProcessGroup(pid, pid);
- }
- self.processGroups[pgid].processes[pid] = true;
- fg.parent = parent;
- } else {
- // Replace existing process
- self.log("replacing existing pid: " + pid);
- var proc = self.processes[pid];
- // Remove existing DOM element
- fg.parent = proc.domElement.parent;
- ppid = proc.ppid;
- proc.domElement.parentNode.removeChild(proc.domElement);
- proc.domElement = fg;
- proc.mounted = false;
- }
-
- fg.pid = pid;
- fg.width = 0;
- fg.height = 0;
- fg.data = nmf;
- fg.type = mimetype;
- fg.commandName = argv[0];
-
- if (nmf !== null) {
- fg.addEventListener('abort', self.handleLoadAbort_.bind(self));
- fg.addEventListener('crash', self.handleCrash_.bind(self));
- fg.addEventListener('error', self.handleLoadError_.bind(self));
- fg.addEventListener('load', self.handleLoad_.bind(self));
- fg.addEventListener('message', self.handleMessage_.bind(self));
- fg.addEventListener('progress', self.handleProgress_.bind(self));
- }
-
- var params = {};
- // Default environment variables (can be overridden by envs)
- params.PS_VERBOSITY = '2';
- params.TERM = 'xterm-256color';
- params.PS_STDIN = '/dev/tty';
- params.PS_STDOUT = '/dev/tty';
- params.PS_STDERR = '/dev/tty';
-
- envs.forEach(function (env) {
- var index = env.indexOf('=');
- if (index < 0) {
- console.error('Broken env: ' + env);
- return;
- }
- var key = env.substring(0, index);
- if (key === 'SRC' || key === 'DATA' || key.match(/^ARG\d+$/i)) {
- return;
- }
- params[key] = env.substring(index + 1);
- });
-
- // Addition environment variables (these override the incoming env)
- params.PS_TTY_PREFIX = NaClProcessManager.prefix;
- params.PS_TTY_RESIZE = 'tty_resize';
- params.PS_TTY_COLS = self.ttyWidth;
- params.PS_TTY_ROWS = self.ttyHeight;
- params.PS_EXIT_MESSAGE = 'exited';
- params.LOCATION_ORIGIN = location.origin;
- params.PWD = cwd;
- params.NACL_PROCESS = '1';
- params.NACL_PID = fg.pid;
- params.NACL_PPID = ppid;
- if (NaClProcessManager.fsroot !== undefined) {
- params.NACL_HTML5_ROOT = NaClProcessManager.fsroot;
- }
-
- if (chrome && chrome.runtime && chrome.runtime.getPlatformInfo) {
- if (arch === null) {
- console.log(
- 'Browser does not support NaCl/PNaCl or is disabled.'
- );
- callback(-Errno.ENOEXEC, fg);
- return;
- }
- params.NACL_ARCH = arch;
- }
-
- function addParam(name, value) {
- // Don't set a 'type' field as self seems to confuse manifest parsing for
- // pnacl.
- if (name.toLowerCase() === 'type') {
- return;
- }
- var param = document.createElement('param');
- param.name = name;
- param.value = value;
- fg.appendChild(param);
- }
-
- Object.keys(params).forEach(function (key) {
- addParam(key, params[key]);
- });
-
- // Add ARGV arguments from query parameters.
- function parseQuery(query) {
- if (query.charAt(0) === '?') {
- query = query.substring(1);
- }
- var splitArgs = query.split('&');
- var args = {};
- splitArgs.forEach(function (value) {
- var keyValue = value.split('=');
- args[decodeURIComponent(keyValue[0])] =
- decodeURIComponent(keyValue[1]);
- });
- return args;
- }
-
- var args = parseQuery(document.location.search);
- Object.keys(args).forEach(function (argname) {
- addParam(argname, args[argname]);
- });
-
- // If the application has set NaClTerm.argv and there were
- // no arguments set in the query parameters then add the default
- // NaClTerm.argv arguments.
- // TODO(bradnelson): Consider dropping this method of passing in parameters.
- if (args.arg0 === undefined && args.arg1 === undefined && argv) {
- var argn = 0;
- argv.forEach(function (arg) {
- var argname = 'arg' + argn;
- addParam(argname, arg);
- argn = argn + 1;
- });
- }
-
- self.pipeServer.addProcessPipes(fg.pid, params);
-
- if (params[NaClProcessManager.ENV_SPAWN_MODE] ===
- NaClProcessManager.ENV_SPAWN_POPUP_VALUE) {
- var popup = new GraphicalPopup(
- fg,
- parseInt(params[NaClProcessManager.ENV_POPUP_WIDTH] ||
- NaClProcessManager.POPUP_WIDTH_DEFAULT, 10),
- parseInt(params[NaClProcessManager.ENV_POPUP_HEIGHT] ||
- NaClProcessManager.POPUP_HEIGHT_DEFAULT, 10),
- argv[0]
- );
- popup.setClosedListener(function () {
- self.exit(NaClProcessManager.EXIT_CODE_KILL, popup.process);
- GraphicalPopup.focusCurrentWindow();
- });
-
- fg.popup = popup;
-
- popup.create();
- } else {
- if (params[NaClProcessManager.ENV_SPAWN_MODE] ===
- NaClProcessManager.ENV_SPAWN_EMBED_VALUE) {
- var style = fg.style;
- style.position = 'absolute';
- style.top = 0;
- style.left = 0;
- style.width = params[NaClProcessManager.ENV_EMBED_WIDTH] ||
- NaClProcessManager.EMBED_WIDTH_DEFAULT;
- style.height = params[NaClProcessManager.ENV_EMBED_HEIGHT] ||
- NaClProcessManager.EMBED_HEIGHT_DEFAULT;
- }
- document.body.appendChild(fg);
- }
-
- // Work around crbug.com/350445
- window.junk = fg.offsetTop;
-
- // Set a startup timeout to detect the case when running a module
- // from html5 storage but nacl is not enabled.
- fg.moduleResponded = false;
- setTimeout(function () {
- self.handleStartupTimeout_(fg);
- }, 500);
-
- // yield result.
- callback(fg.pid, fg);
- });
-};
-
-/**
- * Handles the exiting of a process.
- * @callback waitCallback
- * @param {number} pid The PID of the process that exited or an error code on
- * error.
- * @param {number} status The exit code of the process.
- */
-
-/**
- * Waits for the process identified by pid to exit, and call a callback when
- * finished.
- * @param {number} pid The process ID of the process. If pid==-1, wait for any
- * child. If pid==0, wait for any child in the caller's process group. If
- * pid<-1, wait for any child in the process group with process group
- * id==|pid|.
- * @param {number} options The desired options, ORed together.
- * @param {waitCallback} reply The callback to be called when the process has
- * exited.
- * @param {number} [srcPid=1] The process PID of the calling process. Assume
- * the init process if omitted.
- */
-NaClProcessManager.prototype.waitpid = function (pid, options, reply, srcPid) {
- if (srcPid === undefined) {
- srcPid = NaClProcessManager.INIT_PID;
- }
-
- // The specified process does not exist or is not a child.
- if (pid > 0 && (this.processes[pid] === undefined ||
- this.processes[pid].ppid !== srcPid)) {
- reply(-Errno.ECHILD, 0);
- return;
- }
-
- // The specified process has already finished.
- if (pid > 0 && this.processes[pid].exitCode !== null) {
- var exitCode = this.processes[pid].exitCode;
- this.deleteProcessEntry(pid);
- reply(pid, exitCode);
- return;
- }
-
- // There should be no processes in the init process group.
- if (pid === 0 && srcPid === NaClProcessManager.INIT_PID) {
- reply(-Errno.ECHILD, 0);
- return;
- }
-
- // pid = 0 waits for processes in the calling process's group.
- if (pid === 0) {
- pid = -this.processes[srcPid].pgid;
- }
-
- if (pid < 0) {
- var finishedPid = null;
- var that = this;
- Object.keys(this.processes).some(function (processPid) {
- var process = that.processes[processPid];
- if (process.exitCode !== null &&
- process.ppid === srcPid &&
- (pid === -1 || process.pgid === -pid)) {
- finishedPid = parseInt(processPid, 10);
- return true;
- }
- return false;
- });
-
- if (finishedPid !== null) {
- reply(finishedPid, this.processes[finishedPid].exitCode);
- this.deleteProcessEntry(finishedPid);
- return;
- }
- }
-
- if ((options & NaClProcessManager.WNOHANG) !== 0) {
- reply(0, 0);
- return;
- }
-
- // Add the waitpid call to the waiter list.
- if (!this.waiters[pid]) {
- this.waiters[pid] = [];
- }
- this.waiters[pid].push({
- reply: reply,
- options: options,
- srcPid: srcPid
- });
-};
-
-/**
- * Update the dimensions of the terminal on terminal resize.
- * @param {number} width The width of the terminal.
- * @param {number} height The height of the terminal.
- */
-NaClProcessManager.prototype.onTerminalResize = function (width, height) {
- this.ttyWidth = width;
- this.ttyHeight = height;
- if (this.foregroundProcess) {
- this.foregroundProcess.postMessage({'tty_resize': [ width, height ]});
- }
-};
-
-/**
- * Handle a SIGINT signal.
- * @returns {boolean} Whether or not the interrupt succeeded.
- */
-NaClProcessManager.prototype.sigint = function () {
- if (!this.foregroundProcess) {
- throw new Error(NaClProcessManager.NO_FG_ERROR);
- }
-
- // TODO(bradnelson): Change this once we support signals.
- // Abort on Control+C, but don't quit bash.
- if (!this.isRootProcess(this.foregroundProcess)) {
- // Only exit if the appropriate environment variable is set.
- var query = 'param[name="' + NaClProcessManager.ENV_ABORT + '"]';
- var enabledEnv = this.foregroundProcess.querySelector(query);
- if (enabledEnv && enabledEnv.value === NaClProcessManager.ENV_ABORT_VALUE) {
- this.exit(NaClProcessManager.EXIT_CODE_KILL, this.foregroundProcess);
- return true;
- }
- }
- return false;
-};
-
-/**
- * Send standard input to the foreground process.
- * @param {string} str The string to be sent to as stdin.
- */
-NaClProcessManager.prototype.sendStdinForeground = function (str) {
- if (!this.foregroundProcess) {
- throw new Error(NaClProcessManager.NO_FG_ERROR);
- }
-
- var message = {};
- message[NaClProcessManager.prefix] = str;
- this.foregroundProcess.postMessage(message);
-};
diff --git a/build_tools/naclterm.js b/build_tools/naclterm.js
deleted file mode 100644
index a5a77c1..0000000
--- a/build_tools/naclterm.js
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals lib, NaClProcessManager, hterm */
-
-'use strict';
-
-lib.rtdep('lib.f',
- 'hterm',
- 'NaClProcessManager');
-
-/**
- * This class uses the NaClProcessManager to run NaCl executables within an
- * hterm.
- *
- * @param {Object} argv The argument object passed in from the Terminal.
- */
-function NaClTerm(argv) {
- this.argv = argv;
- this.io = argv.io.push();
- this.width = this.io.terminal_.screenSize.width;
-
- this.bufferedOutput = '';
-
- // Have we started spawning the initial process?
- this.started = false;
-
- // Has the initial process finished loading?
- this.loaded = false;
-
- this.print = this.io.print.bind(this.io);
-
- this.processManager = new NaClProcessManager();
- this.processManager.setStdoutListener(this.handleStdout_.bind(this));
- this.processManager.setErrorListener(this.handleError_.bind(this));
- this.processManager.setRootProgressListener(
- this.handleRootProgress_.bind(this));
- this.processManager.setRootLoadListener(this.handleRootLoad_.bind(this));
-}
-
-/**
- * Flag for cyan coloring in the terminal.
- * @const
- */
-NaClTerm.ANSI_CYAN = '\x1b[36m';
-
-/**
- * Flag for color reset in the terminal.
- * @const
- */
-NaClTerm.ANSI_RESET = '\x1b[0m';
-
-/*
- * Character code for Control+C in the terminal.
- * @type {number}
- */
-NaClTerm.CONTROL_C = 3;
-
-/**
- * Add the appropriate hooks to HTerm to start the session.
- */
-NaClTerm.prototype.run = function () {
- this.io.onVTKeystroke = this.onVTKeystroke_.bind(this);
- this.io.sendString = this.onVTKeystroke_.bind(this);
- this.io.onTerminalResize = this.onTerminalResize_.bind(this);
-
- this.print(NaClTerm.ANSI_CYAN);
-};
-
-/**
- * Static initializer called from index.html.
- *
- * This constructs a new Terminal instance and instructs it to run a NaClTerm.
- */
-NaClTerm.init = function () {
- var profileName = lib.f.parseQuery(document.location.search).profile;
- var terminal = new hterm.Terminal(profileName);
- terminal.decorate(document.querySelector('#terminal'));
-
- // Useful for console debugging.
- window.term_ = terminal;
-
- // We don't properly support the hterm bell sound, so we need to disable it.
- terminal.prefs_.definePreference('audible-bell-sound', '');
-
- // TODO(bradnelson/rginda): Drop when hterm auto-detects this.
- // Turn on open web friendly clipboard handling if we're not running
- // in a chrome app.
- if (!window.chrome || !chrome.runtime || !chrome.runtime.id) {
- terminal.prefs_.definePreference('use-default-window-copy', true);
- terminal.prefs_.definePreference('ctrl-c-copy', true);
- terminal.prefs_.definePreference('ctrl-v-paste', true);
- }
-
- terminal.setAutoCarriageReturn(true);
- terminal.setCursorPosition(0, 0);
- terminal.setCursorVisible(true);
- terminal.runCommandClass(NaClTerm, document.location.hash.substr(1));
-
- return true;
-};
-
-/**
- * Handle stdout event from NaClProcessManager.
- * @private
- * @param {string} msg The string sent to stdout.
- */
-NaClTerm.prototype.handleStdout_ = function (msg) {
- if (!this.loaded) {
- this.bufferedOutput += msg;
- } else {
- this.print(msg);
- }
-};
-
-/**
- * Handle error event from NaCl.
- * @private
- * @param {string} cmd The name of the process with the error.
- * @param {string} err The error message.
- */
-NaClTerm.prototype.handleError_ = function (cmd, err) {
- this.print(cmd + ': ' + err + '\n');
-};
-
-/**
- * Notify the user when we are done loading a URL.
- * @private
- */
-NaClTerm.prototype.doneLoadingUrl_ = function () {
- var width = this.width;
- this.print('\r' + ' '.repeat(width + 1));
- var message = '\rLoaded ' + this.lastUrl;
- if (this.lastTotal) {
- var kbsize = Math.round(this.lastTotal / 1024);
- message += ' [' + kbsize + ' KiB]';
- }
- this.print(message.slice(0, width) + '\n');
-};
-
-/**
- * Handle load progress event from NaCl for the root process.
- * @private
- * @param {string} url The URL that is being loaded.
- * @param {boolean} lengthComputable Is our progress quantitatively measurable?
- * @param {number} loaded The number of bytes that have been loaded.
- * @param {number} total The total number of bytes to be loaded.
- */
-NaClTerm.prototype.handleRootProgress_ = function (
- url, lengthComputable, loaded, total) {
- if (url !== undefined) {
- url = url.substring(url.lastIndexOf('/') + 1);
- }
-
- if (this.lastUrl && this.lastUrl !== url) {
- this.doneLoadingUrl_();
- }
-
- if (!url) {
- return;
- }
-
- this.lastUrl = url;
- this.lastTotal = total;
-
- var message = 'Loading ' + url;
- if (lengthComputable && total) {
- var percent = Math.round(loaded * 100 / total);
- var kbloaded = Math.round(loaded / 1024);
- var kbtotal = Math.round(total / 1024);
- message += ' [' + kbloaded + ' KiB/' + kbtotal + ' KiB ' + percent + '%]';
- }
-
- this.print('\r' + message.slice(-this.width));
-};
-
-/**
- * Handle load end event from NaCl for the root process.
- * @private
- */
-NaClTerm.prototype.handleRootLoad_ = function () {
- if (this.lastUrl) {
- this.doneLoadingUrl_();
- } else {
- this.print('Loaded.\n');
- }
-
- this.print(NaClTerm.ANSI_RESET);
-
- // Now that have completed loading and displaying
- // loading messages we output any messages from the
- // NaCl module that were buffered up unto this point
- this.loaded = true;
- this.print(this.bufferedOutput);
- this.bufferedOutput = '';
-};
-
-/**
- * Clean up once the root process exits.
- * @private
- * @param {number} pid The PID of the process that exited.
- * @param {number} status The exit code of the process.
- */
-NaClTerm.prototype.handleExit_ = function (pid, status) {
- this.print(NaClTerm.ANSI_CYAN);
-
- // The root process finished.
- if (status === -1) {
- this.print('Program (' + NaClTerm.nmf +
- ') crashed (exit status -1)\n');
- } else {
- this.print('Program (' + NaClTerm.nmf + ') exited ' +
- '(status=' + status + ')\n');
- }
- this.argv.io.pop();
- // Remove window close handler.
- window.onbeforeunload = function () { return null; };
- if (this.argv.onExit) {
- this.argv.onExit(status);
- }
-};
-
-/**
- * Spawn the root process (usually bash).
- * @private
- *
- * We delay this call until the first terminal resize event so that we start
- * with the correct size.
- */
-NaClTerm.prototype.spawnRootProcess_ = function () {
- var self = this;
- var argv = NaClTerm.argv || [];
- var env = NaClTerm.env || [];
- var cwd = NaClTerm.cwd || '/';
- argv = [NaClTerm.nmf].concat(argv);
-
- try {
- var handleSuccess = function (naclType) {
- self.print('Loading NaCl module.\n');
- self.processManager.spawn(
- NaClTerm.nmf, argv, env, cwd, naclType, null, -1, function(rootPid) {
- // Warn if we close while still running.
- window.onbeforeunload = function () {
- return 'Processes still running!';
- };
- self.processManager.waitpid(rootPid, 0, self.handleExit_.bind(self));
- });
- };
- var handleFailure = function (message) {
- self.print(message);
- };
- self.processManager.checkUrlNaClManifestType(
- NaClTerm.nmf, handleSuccess, handleFailure);
- } catch (e) {
- self.print(e.message);
- }
-
- self.started = true;
-};
-
-/**
- * Handle hterm terminal resize events.
- * @private
- * @param {number} width The width of the terminal.
- * @param {number} height The height of the terminal.
- */
-NaClTerm.prototype.onTerminalResize_ = function (width, height) {
- this.processManager.onTerminalResize(width, height);
- if (!this.started) {
- this.spawnRootProcess_();
- }
-};
-
-/**
- * Handle hterm keystroke events.
- * @private
- * @param {string} str The characters sent by hterm.
- */
-NaClTerm.prototype.onVTKeystroke_ = function (str) {
- try {
- if (str.charCodeAt(0) === NaClTerm.CONTROL_C) {
- if (this.processManager.sigint()) {
- this.print('\n');
- return;
- }
- }
- this.processManager.sendStdinForeground(str);
- } catch (e) {
- this.print(e.message);
- }
-};
-
-// CSP means that we can't kick off the initialization from the html file,
-// so we do it like this instead.
-window.onload = function () {
- lib.init(function () {
- NaClTerm.init();
- });
-};
diff --git a/build_tools/partition.py b/build_tools/partition.py
deleted file mode 100755
index f6cda77..0000000
--- a/build_tools/partition.py
+++ /dev/null
@@ -1,375 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 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.
-"""Manage partitioning of port builds.
-
-Download historical data from the webports builders, and use it to
-partition all of the projects onto the builder shards so each shard builds in
-about the same amount of time.
-
-Example use:
-
- $ ./partition.py -b linux-clang-
-
- builder 0 (total: 2786)
- bzip2
- zlib
- boost
- glibc-compat
- openssl
- libogg
- ...
- builder 1 (total: 2822)
- zlib
- libpng
- Regal
- glibc-compat
- ncurses
- ...
- builder 2 (total: 2790)
- zlib
- libpng
- bzip2
- jpeg
- ImageMagick
- glibc-compat
- ...
- Difference between total time of builders: 36
-
-
-Pipe the results above (with appropriate use of -n and -p) into partition*.txt
-so the partition can be used in the future.
-
-The script is also used by the buildbot to read canned partitions.
-
-Example use:
-
- $ ./partition.py -t <index> -n <number_of_shards>
-"""
-
-from __future__ import print_function
-
-import argparse
-import json
-import os
-import sys
-import urllib2
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-ROOT_DIR = os.path.dirname(SCRIPT_DIR)
-TOOLCHAINS = ('clang-newlib', 'glibc', 'pnacl')
-
-sys.path.append(os.path.join(ROOT_DIR, 'lib'))
-
-import webports
-import webports.source_package
-from webports.util import LogVerbose
-
-# Packages that the partitioned builders should never build. The 'pnacl'
-# toolchain package takes so long it has a dedicated builder.
-EXCLUDED_PACKAGES = ['pnacl']
-
-class Error(webports.Error):
- pass
-
-
-def GetBuildOrder(projects):
- rtn = []
- packages = [webports.source_package.CreatePackage(p) for p in projects]
- for package in packages:
- for dep in package.DEPENDS:
- for ordered_dep in GetBuildOrder([dep]):
- if ordered_dep not in rtn:
- rtn.append(ordered_dep)
- if package.NAME not in rtn:
- rtn.append(package.NAME)
- return rtn
-
-
-def GetDependencies(projects):
- deps = GetBuildOrder(projects)
- return set(deps) - set(projects)
-
-
-def DownloadDataFromBuilder(builder, build):
- max_tries = 30
-
- for _ in xrange(max_tries):
- url = 'http://build.chromium.org/p/client.nacl.ports/json'
- url += '/builders/%s/builds/%d' % (builder, build)
- LogVerbose('Downloading %s' % url)
- f = urllib2.urlopen(url)
- try:
- data = json.loads(f.read())
- text = data['text']
- if text == ['build', 'successful']:
- LogVerbose(' Success!')
- return data
- LogVerbose(' Not successful, trying previous build.')
- finally:
- f.close()
- build -= 1
-
- raise Error('Unable to find a successful build:\nBuilder: %s\nRange: [%d, %d]'
- % (builder, build - max_tries, build))
-
-
-class Project(object):
-
- def __init__(self, name):
- self.name = name
- self.time = 0
- self.dep_names = GetDependencies([name])
- self.dep_times = [0] * len(self.dep_names)
-
- def UpdateDepTimes(self, project_map):
- for i, dep_name in enumerate(self.dep_names):
- dep = project_map[dep_name]
- self.dep_times[i] = dep.time
-
- def GetTime(self, used_dep_names):
- time = self.time
- for i, dep_name in enumerate(self.dep_names):
- if dep_name not in used_dep_names:
- time += self.dep_times[i]
- return time
-
-
-class Projects(object):
-
- def __init__(self):
- self.projects = []
- self.project_map = {}
- self.dependencies = set()
-
- def AddProject(self, name):
- if name not in self.project_map:
- project = Project(name)
- self.projects.append(project)
- self.project_map[name] = project
- return self.project_map[name]
-
- def AddDataFromBuilder(self, builder, build):
- data = DownloadDataFromBuilder(builder, build)
- for step in data['steps']:
- text = step['text'][0]
- text_tuple = text.split()
- if len(text_tuple) != 2 or text_tuple[0] not in TOOLCHAINS:
- continue
- _, name = text_tuple
- project = self.AddProject(name)
- project.time = step['times'][1] - step['times'][0]
-
- def PostProcessDeps(self):
- for project in self.projects:
- project.UpdateDepTimes(self.project_map)
- for dep_name in project.dep_names:
- self.dependencies.add(dep_name)
-
- def __getitem__(self, name):
- return self.project_map[name]
-
-
-class ProjectTimes(object):
-
- def __init__(self):
- self.project_names = set()
- self.projects = []
- self.total_time = 0
-
- def GetTotalTimeWithProject(self, project):
- return self.total_time + project.GetTime(self.project_names)
-
- def AddProject(self, projects, project):
- self.AddDependencies(projects, project)
- self.project_names.add(project.name)
- self.projects.append(project)
- self.total_time = self.GetTotalTimeWithProject(project)
-
- def AddDependencies(self, projects, project):
- for dep_name in project.dep_names:
- if dep_name not in self.project_names:
- self.AddProject(projects, projects[dep_name])
-
- def HasProject(self, project):
- return project.name in self.project_names
-
- def TopologicallySortedProjectNames(self, projects):
- sorted_project_names = []
-
- def Helper(project):
- for dep_name in project.dep_names:
- if dep_name not in sorted_project_names:
- Helper(projects[dep_name])
- sorted_project_names.append(project.name)
-
- for project in self.projects:
- Helper(project)
-
- return sorted_project_names
-
-
-def Partition(projects, dims):
- # Greedy algorithm: sort the projects by slowest to fastest, then add the
- # projects, in order, to the shard that has the least work on it.
- #
- # Note that this takes into account the additional time necessary to build a
- # projects dependencies, if those dependencies have not already been built.
- parts = [ProjectTimes() for _ in xrange(dims)]
- sorted_projects = sorted(projects.projects, key=lambda p: -p.time)
- for project in sorted_projects:
- if any(part.HasProject(project) for part in parts):
- continue
-
- key = lambda p: p[1].GetTotalTimeWithProject(project)
- index, _ = min(enumerate(parts), key=key)
- parts[index].AddProject(projects, project)
- return parts
-
-
-def LoadCanned(parts):
- # Return an empty partition for the no-sharding case.
- if parts == 1:
- return [[]]
- partitions = []
- partition = []
- input_file = os.path.join(SCRIPT_DIR, 'partition%d.txt' % parts)
- LogVerbose("LoadCanned: %s" % input_file)
- with open(input_file) as fh:
- for line in fh:
- if line.strip()[0] == '#':
- continue
- if line.startswith(' '):
- partition.append(line[2:].strip())
- else:
- if partition:
- partitions.append(partition)
- partition = []
- assert not partition
- assert len(partitions) == parts, partitions
- # Return a small set of packages for testing.
- if os.environ.get('TEST_BUILDBOT'):
- partitions[0] = [
- 'corelibs',
- 'glibc-compat',
- 'nacl-spawn',
- 'ncurses',
- 'readline',
- 'libtar',
- 'zlib',
- 'lua',
- ]
- return partitions
-
-
-def FixupCanned(partitions):
- all_projects = [p for p in webports.source_package.SourcePackageIterator()]
- all_names = [p.NAME for p in all_projects if not p.DISABLED]
- disabled_names = [p.NAME for p in all_projects if p.DISABLED]
-
- # Blank the last partition and fill it with anything not in the first two.
- partitions[-1] = []
- covered = set()
- for partition in partitions[:-1]:
- for item in partition:
- covered.add(item)
-
- for item in all_names:
- if item not in covered and item not in EXCLUDED_PACKAGES:
- partitions[-1].append(item)
-
- # Order by dependencies.
- partitions[-1] = GetBuildOrder(partitions[-1])
-
- # Check that all the items still exist.
- for i, partition in enumerate(partitions):
- for item in partition:
- if item not in all_names and item not in disabled_names:
- raise Error('non-existent package in partition %d: %s' % (i, item))
-
- # Check that partitions include all of their dependencies.
- for i, partition in enumerate(partitions):
- deps = GetDependencies(partition)
- for dep in deps:
- if not dep in partition:
- raise Error('dependency missing from partition %d: %s' % (i, dep))
-
- return partitions
-
-
-def PrintCanned(index, parts):
- canned = GetCanned(index, parts)
- print(' '.join(canned))
-
-
-def GetCanned(index, parts):
- assert index >= 0 and index < parts, [index, parts]
- partitions = LoadCanned(parts)
- partitions = FixupCanned(partitions)
- LogVerbose("Found %d packages for shard %d" % (len(partitions[index]), index))
- return partitions[index]
-
-
-def main(args):
- parser = argparse.ArgumentParser()
- parser.add_argument('--check', action='store_true',
- help='check canned partition information is up-to-date.')
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Output extra information.')
- parser.add_argument('-t', '--print-canned', type=int,
- help='Print a the canned partition list and exit.')
- parser.add_argument('-b', '--bot-prefix', help='builder name prefix.',
- default='linux-clang-')
- parser.add_argument('-n', '--num-bots',
- help='Number of builders on the waterfall to collect '
- 'data from or to print a canned partition for.',
- type=int, default=5)
- parser.add_argument('-p', '--num-parts',
- help='Number of parts to partition things into '
- '(this will differ from --num-bots when changing the '
- 'number of shards).',
- type=int, default=5)
- parser.add_argument('--build-number', help='Builder number to look at for '
- 'historical data on build times.', type=int, default=-1)
- options = parser.parse_args(args)
- webports.SetVerbose(options.verbose)
-
- if options.check:
- for num_bots in xrange(1, 6):
- print('Checking partioning with %d bot(s)' % (num_bots))
- # GetCanned with raise an Error if the canned partition information is
- # bad, which in turn will trigger a non-zero return from this script.
- GetCanned(0, num_bots)
- return
-
- if options.print_canned is not None:
- PrintCanned(options.print_canned, options.num_bots)
- return
-
- projects = Projects()
- for bot in range(options.num_bots):
- bot_name = '%s%d' % (options.bot_prefix, bot)
- LogVerbose('Attempting to add data from "%s"' % bot_name)
- projects.AddDataFromBuilder(bot_name, options.build_number)
- projects.PostProcessDeps()
-
- parts = Partition(projects, options.num_parts)
- for i, project_times in enumerate(parts):
- print('builder %d (total: %d)' % (i, project_times.total_time))
- project_names = project_times.TopologicallySortedProjectNames(projects)
- print(' %s' % '\n '.join(project_names))
-
- times = list(sorted(part.total_time for part in parts))
- difference = 0
- for i in range(1, len(times)):
- difference += times[i] - times[i - 1]
- print('Difference between total time of builders: %d' % difference)
-
-
-if __name__ == '__main__':
- try:
- sys.exit(main(sys.argv[1:]))
- except Error as e:
- sys.stderr.write("%s\n" % e)
- sys.exit(1)
diff --git a/build_tools/partition2.txt b/build_tools/partition2.txt
deleted file mode 100644
index 375b9c5..0000000
--- a/build_tools/partition2.txt
+++ /dev/null
@@ -1,354 +0,0 @@
-builder 0 (total: 26264)
- gtest
- zlib
- libtar
- gmp
- mpfr
- mpc
- corelibs
- glibc-compat
- nacl-spawn
- binutils-2.25
- gcc-avr
- kbproto
- xextproto
- xproto
- xcb-proto
- xtrans
- libxau
- libxcb
- inputproto
- libx11
- tiff
- libice
- libsm
- libxt
- libxext
- libxmu
- jpeg8d
- libxpm
- libxaw
- giflib
- libpng
- ncurses
- emacs
- yajl
- python-host
- numpy
- gcc
- perl
- clapack
- icu
- openssl
- cython
- bzip2
- freetype
- readline
- pyppapi
- python-static
- sqlite
- expat
- apr
- apr-util
- subversion
- pyparsing
- setuptools
- distribute
- hdf5
- h5py
- six
- python-dateutil
- nose
- matplotlib
- sympy
- yt
- ruby
- python
- less
- vim
- xz
- geturl
- libarchive-dev
- libelf
- libbsd
- pkg
- curl
- pcre
- git
- nano
- unzip
- bash
- devenv
- make
- coreutils
- grep
- findutils
- devenv-latest
- libyuv
- texinfo
- libunistring
- jpeg6b
- opencv
- gdb
- gsl
- libogg
- libvorbis
- lame
- libav
- samba
- m4
- bison
- libmikmod
- regal
- sdl
- sdl-mixer
- metakit
- sdl-ttf
- drod
- snes9x
- mp4v2
- jsoncpp
- openssh
- binutils
- mingn
- nethack
- freeimage
- bullet
- libssh2
- libgit2
- flac
- gawk
- requests
- thingking
- darksky-catalog
- openscenegraph
- scummvm
- gzip
- nettle
- ruby-ppapi
- lua
- zeromq
- cups
- pyzmq
- agg
- bochs
- id3lib
- sdl-tests
- hello
- xcb-util
- sdl-image
- libebml
- libmatroska
- libgit2-demo
- busybox
- agg-demo
- httplib2
- speex
- sdl-net
- python-gflags
- libatomic-ops
- civetweb
- faad2
- google-api-python-client
- x264
- avrdude
- thttpd
- sdlquake
- faac
- gc
- protobuf-c
- clipper
- libuuid
- openjpeg
- libtommath
- box2d
- physfs
- ipython
- poly2tri
- markupsafe
- jinja2
- ipython-ppapi
- pytz
- pandas
-builder 1 (total: 26254)
- fftw-float
- fftw
- corelibs
- glibc-compat
- zlib
- libtar
- nacl-spawn
- bzip2
- expat
- libpng
- freetype
- fontconfig
- texlive
- eigen3
- leveldb
- ncurses
- gettext
- readline
- python3
- libffi
- glib
- font-util
- font-cronyx-cyrillic
- font-dec-misc
- json-glib
- tar
- font-isas-misc
- kbproto
- xextproto
- xproto
- xcb-proto
- xtrans
- libxau
- libxcb
- inputproto
- libx11
- renderproto
- libxext
- pixman
- libxrender
- cairo
- harfbuzz
- font-bitstream-75dpi
- jpeg8d
- font-mutt-misc
- font-alias
- font-misc-misc
- font-bh-ttf
- font-sony-misc
- font-bh-lucidatypewriter-75dpi
- font-bh-75dpi
- font-adobe-utopia-type1
- font-bh-100dpi
- tiff
- gdk-pixbuf
- font-screen-cyrillic
- regal
- font-cursor-misc
- font-daewoo-misc
- font-adobe-75dpi
- font-xfree86-type1
- font-bh-type1
- font-adobe-utopia-75dpi
- font-bh-lucidatypewriter-100dpi
- font-sun-misc
- font-schumacher-misc
- font-micro-misc
- font-misc-ethiopic
- font-jis-misc
- font-adobe-utopia-100dpi
- font-winitzki-cyrillic
- font-misc-cyrillic
- font-misc-meltho
- font-bitstream-100dpi
- font-ibm-type1
- font-adobe-100dpi
- font-bitstream-type1
- xfonts
- babl
- pango
- atk
- gtk+
- sdl
- jsoncpp
- gegl
- gimp
- protobuf
- lame
- libogg
- libvorbis
- libtheora
- ffmpeg
- boost
- gmp
- libtomcrypt
- xcmiscproto
- randrproto
- libpciaccess
- xkeyboard-config
- scrnsaverproto
- libfontenc
- bash
- fontsproto
- libxfont
- resourceproto
- libxkbfile
- videoproto
- glproto
- fixesproto
- damageproto
- xkbcomp
- compositeproto
- recordproto
- openssl
- bigreqsproto
- xineramaproto
- xorg-server
- imagemagick
- xbitmaps
- libice
- libsm
- libxt
- libxmu
- twm
- gimp-app
- giflib
- libxpm
- libxaw
- emacs
- emacs-x
- gtk-demo
- fvwm
- libiconv
- gforth
- libxml2
- libarchive
- dosbox
- tcl
- sdl2
- mesa
- ninja
- libsodium
- fuseiso
- tk
- blackbox
- sdl2-tests
- libtool
- libssh
- liboggz
- libmodplug
- libwebp
- sdl2-ttf
- lcms
- libmng
- devil
- netcat
- openal-soft
- mpg123
- quakespasm
- mongoose
- libxi
- libxtst
- toybox
- cfitsio
- libxinerama
- xaos
- xeyes
- libhangul
- libpng12
- tree
- bdftopcf
- freealut
- sdl2-image
- sdl2-gfx
- tinyxml
- openal-ogg-demo
- alut-demo
- dreadthread
- wireshark
- blis
-Difference between total time of builders: 10
diff --git a/build_tools/partition3.txt b/build_tools/partition3.txt
deleted file mode 100644
index cb224c6..0000000
--- a/build_tools/partition3.txt
+++ /dev/null
@@ -1,358 +0,0 @@
-builder 0 (total: 17327)
- gtest
- zlib
- libtar
- gmp
- mpfr
- mpc
- corelibs
- glibc-compat
- nacl-spawn
- binutils-2.25
- gcc-avr
- yajl
- python-host
- numpy
- gcc
- clapack
- openssl
- cython
- bzip2
- ncurses
- libpng
- freetype
- readline
- pyppapi
- python-static
- pyparsing
- setuptools
- distribute
- hdf5
- h5py
- six
- python-dateutil
- nose
- matplotlib
- sympy
- yt
- less
- vim
- xz
- geturl
- libarchive-dev
- libelf
- libbsd
- pkg
- curl
- pcre
- git
- nano
- unzip
- bash
- devenv
- make
- coreutils
- python
- grep
- findutils
- devenv-latest
- gsl
- samba
- libmikmod
- regal
- libogg
- sdl
- libvorbis
- sdl-mixer
- expat
- metakit
- sdl-ttf
- drod
- binutils
- mingn
- gawk
- requests
- thingking
- darksky-catalog
- scummvm
- ninja
- lua
- zeromq
- pyzmq
- bochs
- libtool
- libssh
- sdl-tests
- libmodplug
- jpeg8d
- sdl-image
- busybox
- netcat
- httplib2
- openal-soft
- mpg123
- quakespasm
- civetweb
- google-api-python-client
- x264
- avrdude
- sdlquake
- tree
- freealut
- clipper
- libuuid
- tinyxml
- openal-ogg-demo
- alut-demo
- ipython
- ipython-ppapi
- pytz
- pandas
-builder 1 (total: 17316)
- gtest
- fftw-float
- corelibs
- glibc-compat
- zlib
- libtar
- nacl-spawn
- bzip2
- expat
- libpng
- freetype
- fontconfig
- texlive
- eigen3
- ncurses
- gettext
- readline
- python3
- icu
- sqlite
- apr
- apr-util
- subversion
- ruby
- protobuf
- openssl
- python-host
- python
- lame
- libogg
- libvorbis
- libtheora
- libvpx
- ffmpeg
- boost
- gmp
- libtomcrypt
- jpeg8d
- libyuv
- imagemagick
- texinfo
- libunistring
- tiff
- jpeg6b
- opencv
- gdb
- libav
- m4
- bison
- snes9x
- mp4v2
- nethack
- bullet
- flac
- libiconv
- libxml2
- libarchive
- tcl
- sdl2
- nettle
- ruby-ppapi
- cups
- agg
- sdl2-tests
- id3lib
- liboggz
- hello
- libwebp
- sdl2-ttf
- libebml
- libmatroska
- agg-demo
- speex
- mongoose
- setuptools
- python-gflags
- libatomic-ops
- toybox
- cfitsio
- xaos
- libhangul
- libpng12
- gc
- sdl2-image
- sdl2-gfx
- libtommath
- physfs
- ipython
- markupsafe
- jinja2
-builder 2 (total: 17303)
- fftw
- kbproto
- xextproto
- corelibs
- glibc-compat
- xproto
- xcb-proto
- xtrans
- libxau
- libxcb
- inputproto
- libx11
- tiff
- libice
- libsm
- libxt
- libxext
- libxmu
- jpeg8d
- libxpm
- libxaw
- zlib
- libtar
- nacl-spawn
- giflib
- libpng
- ncurses
- emacs
- leveldb
- perl
- libffi
- gettext
- glib
- font-util
- font-cronyx-cyrillic
- font-dec-misc
- json-glib
- tar
- font-isas-misc
- expat
- bzip2
- renderproto
- freetype
- fontconfig
- pixman
- libxrender
- cairo
- harfbuzz
- font-bitstream-75dpi
- font-mutt-misc
- font-alias
- font-misc-misc
- font-bh-ttf
- font-sony-misc
- font-bh-lucidatypewriter-75dpi
- font-bh-75dpi
- font-adobe-utopia-type1
- font-bh-100dpi
- gdk-pixbuf
- font-screen-cyrillic
- regal
- font-cursor-misc
- font-daewoo-misc
- font-adobe-75dpi
- font-xfree86-type1
- font-bh-type1
- font-adobe-utopia-75dpi
- font-bh-lucidatypewriter-100dpi
- font-sun-misc
- font-schumacher-misc
- font-micro-misc
- font-misc-ethiopic
- font-jis-misc
- font-adobe-utopia-100dpi
- font-winitzki-cyrillic
- font-misc-cyrillic
- font-misc-meltho
- font-bitstream-100dpi
- font-ibm-type1
- font-adobe-100dpi
- font-bitstream-type1
- xfonts
- babl
- pango
- atk
- gtk+
- sdl
- jsoncpp
- gegl
- gimp
- xcmiscproto
- randrproto
- libpciaccess
- xkeyboard-config
- scrnsaverproto
- libfontenc
- readline
- bash
- fontsproto
- libxfont
- resourceproto
- libxkbfile
- videoproto
- glproto
- fixesproto
- damageproto
- xkbcomp
- compositeproto
- recordproto
- openssl
- bigreqsproto
- xineramaproto
- xorg-server
- xbitmaps
- twm
- gimp-app
- emacs-x
- gtk-demo
- openssh
- freeimage
- libssh2
- libgit2
- fvwm
- gforth
- dosbox
- openscenegraph
- gzip
- mesa
- libsodium
- fuseiso
- tcl
- tk
- libiconv
- blackbox
- xcb-util
- lcms
- libmng
- devil
- libgit2-demo
- sdl-net
- libxi
- libxtst
- faad2
- libxinerama
- xeyes
- thttpd
- faac
- bdftopcf
- protobuf-c
- openjpeg
- box2d
- poly2tri
- dreadthread
- wireshark
- blis
-Difference between total time of builders: 24
diff --git a/build_tools/partition4.txt b/build_tools/partition4.txt
deleted file mode 100644
index fd055f3..0000000
--- a/build_tools/partition4.txt
+++ /dev/null
@@ -1,401 +0,0 @@
-builder 0 (total: 13652)
- gtest
- zlib
- libtar
- gmp
- mpfr
- mpc
- corelibs
- glibc-compat
- nacl-spawn
- binutils-2.25
- gcc-avr
- python-host
- numpy
- perl
- icu
- cython
- bzip2
- ncurses
- openssl
- libpng
- freetype
- readline
- pyppapi
- python-static
- pyparsing
- setuptools
- distribute
- hdf5
- h5py
- six
- python-dateutil
- nose
- matplotlib
- sympy
- yt
- texinfo
- tiff
- jpeg6b
- opencv
- gsl
- samba
- libmikmod
- regal
- libogg
- sdl
- libvorbis
- sdl-mixer
- expat
- metakit
- sdl-ttf
- drod
- libssh2
- libgit2
- flac
- libiconv
- gawk
- requests
- thingking
- darksky-catalog
- gforth
- dosbox
- tcl
- scummvm
- ninja
- lua
- zeromq
- cups
- pyzmq
- agg
- bochs
- libtool
- libssh
- sdl-tests
- jpeg8d
- libwebp
- sdl-image
- libgit2-demo
- agg-demo
- openal-soft
- mpg123
- quakespasm
- x264
- jsoncpp
- thttpd
- tree
- freealut
- libuuid
- openjpeg
- openal-ogg-demo
- alut-demo
- ipython
- ipython-ppapi
- pytz
- pandas
-builder 1 (total: 13640)
- gtest
- fftw-float
- yajl
- leveldb
- clapack
- corelibs
- glibc-compat
- openssl
- ncurses
- zlib
- readline
- ruby
- libtar
- nacl-spawn
- bzip2
- python-host
- python
- less
- vim
- xz
- geturl
- libarchive-dev
- libelf
- libbsd
- pkg
- curl
- pcre
- git
- nano
- unzip
- bash
- devenv
- make
- coreutils
- grep
- findutils
- devenv-latest
- snes9x
- jsoncpp
- openssh
- nethack
- freeimage
- bullet
- expat
- xproto
- libxau
- xcb-proto
- libxcb
- xextproto
- libpng
- freetype
- fontconfig
- xtrans
- libice
- kbproto
- inputproto
- libx11
- libsm
- libxt
- libxext
- libxmu
- xbitmaps
- fvwm
- libxml2
- libarchive
- sdl2
- mesa
- ruby-ppapi
- tcl
- tk
- libiconv
- blackbox
- id3lib
- hello
- xcb-util
- libebml
- libmatroska
- busybox
- netcat
- httplib2
- mongoose
- setuptools
- python-gflags
- toybox
- google-api-python-client
- avrdude
- libhangul
- faac
- protobuf-c
- sdl2-gfx
- tinyxml
- box2d
- ipython
- markupsafe
- jinja2
-builder 2 (total: 13636)
- gtest
- fftw
- corelibs
- glibc-compat
- zlib
- libtar
- nacl-spawn
- bzip2
- expat
- libpng
- freetype
- fontconfig
- texlive
- ncurses
- gettext
- readline
- python3
- sqlite
- apr
- apr-util
- subversion
- protobuf
- lame
- libogg
- libvorbis
- libtheora
- libvpx
- ffmpeg
- boost
- gmp
- libtomcrypt
- jpeg8d
- libyuv
- imagemagick
- libunistring
- gdb
- libav
- m4
- bison
- mp4v2
- mpfr
- mpc
- gcc
- binutils
- mingn
- openscenegraph
- gzip
- nettle
- libsodium
- libffi
- glib
- fuseiso
- sdl2
- sdl2-tests
- liboggz
- libmodplug
- sdl2-ttf
- tiff
- lcms
- libmng
- devil
- libatomic-ops
- civetweb
- faad2
- cfitsio
- xaos
- libpng12
- gc
- libwebp
- sdl2-image
- wireshark
- blis
-builder 3 (total: 13637)
- gtest
- kbproto
- xextproto
- corelibs
- glibc-compat
- xproto
- xcb-proto
- xtrans
- libxau
- libxcb
- inputproto
- libx11
- tiff
- libice
- libsm
- libxt
- libxext
- libxmu
- jpeg8d
- libxpm
- libxaw
- zlib
- libtar
- nacl-spawn
- giflib
- libpng
- ncurses
- emacs
- eigen3
- gmp
- mpfr
- mpc
- gcc
- libffi
- gettext
- glib
- font-util
- font-cronyx-cyrillic
- font-dec-misc
- json-glib
- tar
- font-isas-misc
- expat
- bzip2
- renderproto
- freetype
- fontconfig
- pixman
- libxrender
- cairo
- harfbuzz
- font-bitstream-75dpi
- font-mutt-misc
- font-alias
- font-misc-misc
- font-bh-ttf
- font-sony-misc
- font-bh-lucidatypewriter-75dpi
- font-bh-75dpi
- font-adobe-utopia-type1
- font-bh-100dpi
- gdk-pixbuf
- font-screen-cyrillic
- regal
- font-cursor-misc
- font-daewoo-misc
- font-adobe-75dpi
- font-xfree86-type1
- font-bh-type1
- font-adobe-utopia-75dpi
- font-bh-lucidatypewriter-100dpi
- font-sun-misc
- font-schumacher-misc
- font-micro-misc
- font-misc-ethiopic
- font-jis-misc
- font-adobe-utopia-100dpi
- font-winitzki-cyrillic
- font-misc-cyrillic
- font-misc-meltho
- font-bitstream-100dpi
- font-ibm-type1
- font-adobe-100dpi
- font-bitstream-type1
- xfonts
- babl
- pango
- atk
- gtk+
- sdl
- jsoncpp
- gegl
- gimp
- xcmiscproto
- randrproto
- libpciaccess
- xkeyboard-config
- scrnsaverproto
- libfontenc
- readline
- bash
- fontsproto
- libxfont
- resourceproto
- libxkbfile
- videoproto
- glproto
- fixesproto
- damageproto
- xkbcomp
- compositeproto
- recordproto
- openssl
- bigreqsproto
- xineramaproto
- xorg-server
- xbitmaps
- twm
- gimp-app
- emacs-x
- gtk-demo
- libogg
- speex
- sdl-net
- libxi
- libxtst
- libxinerama
- xeyes
- sdlquake
- bdftopcf
- clipper
- libtommath
- physfs
- poly2tri
- dreadthread
-Difference between total time of builders: 15
diff --git a/build_tools/partition5.txt b/build_tools/partition5.txt
deleted file mode 100644
index 6cfe2aa..0000000
--- a/build_tools/partition5.txt
+++ /dev/null
@@ -1,502 +0,0 @@
-builder 0 (total: 11914)
- gtest
- zlib
- libtar
- gmp
- mpfr
- mpc
- corelibs
- glibc-compat
- nacl-spawn
- binutils-2.25
- gcc-avr
- perl
- python-host
- numpy
- cython
- bzip2
- pyparsing
- setuptools
- distribute
- hdf5
- h5py
- six
- libpng
- freetype
- python-dateutil
- nose
- matplotlib
- sympy
- yt
- tiff
- jpeg6b
- opencv
- gsl
- samba
- libmikmod
- regal
- libogg
- sdl
- libvorbis
- sdl-mixer
- expat
- metakit
- sdl-ttf
- drod
- ncurses
- nethack
- freeimage
- xproto
- libxau
- xcb-proto
- libxcb
- xextproto
- fontconfig
- xtrans
- libice
- kbproto
- inputproto
- libx11
- libsm
- libxt
- libxext
- libxmu
- xbitmaps
- fvwm
- openssl
- requests
- thingking
- darksky-catalog
- libiconv
- blackbox
- hello
- xcb-util
- jpeg8d
- libwebp
- lcms
- libmng
- devil
- python-gflags
- civetweb
- cfitsio
- xaos
- xeyes
- tree
- sdl2
- sdl2-image
- pytz
- pandas
-builder 1 (total: 12131)
- gtest
- fftw-float
- python-host
- numpy
- clapack
- corelibs
- glibc-compat
- openssl
- cython
- zlib
- libtar
- nacl-spawn
- bzip2
- ncurses
- libpng
- freetype
- readline
- pyppapi
- python-static
- python
- less
- vim
- xz
- geturl
- libarchive-dev
- libelf
- libbsd
- pkg
- curl
- pcre
- git
- nano
- unzip
- bash
- devenv
- make
- coreutils
- grep
- findutils
- devenv-latest
- bullet
- libssh2
- libgit2
- libiconv
- gforth
- regal
- sdl
- dosbox
- libogg
- libvorbis
- scummvm
- ninja
- lua
- zeromq
- cups
- pyzmq
- agg
- bochs
- libtool
- libssh
- sdl-tests
- jpeg8d
- sdl-image
- libgit2-demo
- netcat
- agg-demo
- httplib2
- sdl-net
- libatomic-ops
- faad2
- setuptools
- google-api-python-client
- avrdude
- faac
- protobuf-c
- clipper
- libtommath
- physfs
- ipython
- markupsafe
- jinja2
- pyparsing
- distribute
- six
- nose
- python-dateutil
- matplotlib
- ipython-ppapi
-builder 2 (total: 11877)
- gtest
- fftw
- eigen3
- icu
- corelibs
- glibc-compat
- ncurses
- zlib
- readline
- ruby
- protobuf
- libtar
- nacl-spawn
- bzip2
- boost
- font-util
- font-sony-misc
- font-cronyx-cyrillic
- font-dec-misc
- font-isas-misc
- xcmiscproto
- randrproto
- font-bitstream-75dpi
- font-xfree86-type1
- libpciaccess
- xkeyboard-config
- scrnsaverproto
- xproto
- libxau
- xcb-proto
- libxcb
- font-misc-misc
- font-bh-ttf
- xextproto
- font-bh-100dpi
- libfontenc
- font-bh-lucidatypewriter-75dpi
- bash
- font-bh-75dpi
- renderproto
- font-adobe-utopia-type1
- kbproto
- xtrans
- inputproto
- libx11
- expat
- libpng
- freetype
- fontconfig
- fontsproto
- libxfont
- font-screen-cyrillic
- resourceproto
- libxkbfile
- regal
- videoproto
- glproto
- font-cursor-misc
- font-daewoo-misc
- pixman
- font-adobe-75dpi
- font-mutt-misc
- font-bh-type1
- font-adobe-utopia-75dpi
- font-bh-lucidatypewriter-100dpi
- font-sun-misc
- font-schumacher-misc
- font-micro-misc
- font-misc-ethiopic
- font-jis-misc
- font-adobe-utopia-100dpi
- font-alias
- font-winitzki-cyrillic
- font-misc-cyrillic
- font-misc-meltho
- font-bitstream-100dpi
- font-ibm-type1
- font-adobe-100dpi
- font-bitstream-type1
- xfonts
- fixesproto
- damageproto
- xkbcomp
- sdl
- compositeproto
- recordproto
- libxext
- openssl
- bigreqsproto
- xineramaproto
- xorg-server
- mesa
- ruby-ppapi
- libffi
- gettext
- glib
- fuseiso
- busybox
- openal-soft
- mpg123
- libogg
- libvorbis
- quakespasm
- toybox
- libxinerama
- libhangul
- sdlquake
- bdftopcf
- freealut
- openjpeg
- box2d
- openal-ogg-demo
- alut-demo
- wireshark
-builder 3 (total: 12248)
- gtest
- kbproto
- xextproto
- corelibs
- glibc-compat
- xproto
- xcb-proto
- xtrans
- libxau
- libxcb
- inputproto
- libx11
- tiff
- libice
- libsm
- libxt
- libxext
- libxmu
- jpeg8d
- libxpm
- libxaw
- zlib
- libtar
- nacl-spawn
- giflib
- libpng
- ncurses
- emacs
- leveldb
- bzip2
- gettext
- readline
- python3
- libffi
- glib
- font-util
- font-cronyx-cyrillic
- font-dec-misc
- json-glib
- tar
- font-isas-misc
- expat
- renderproto
- freetype
- fontconfig
- pixman
- libxrender
- cairo
- harfbuzz
- font-bitstream-75dpi
- font-mutt-misc
- font-alias
- font-misc-misc
- font-bh-ttf
- font-sony-misc
- font-bh-lucidatypewriter-75dpi
- font-bh-75dpi
- font-adobe-utopia-type1
- font-bh-100dpi
- gdk-pixbuf
- font-screen-cyrillic
- regal
- font-cursor-misc
- font-daewoo-misc
- font-adobe-75dpi
- font-xfree86-type1
- font-bh-type1
- font-adobe-utopia-75dpi
- font-bh-lucidatypewriter-100dpi
- font-sun-misc
- font-schumacher-misc
- font-micro-misc
- font-misc-ethiopic
- font-jis-misc
- font-adobe-utopia-100dpi
- font-winitzki-cyrillic
- font-misc-cyrillic
- font-misc-meltho
- font-bitstream-100dpi
- font-ibm-type1
- font-adobe-100dpi
- font-bitstream-type1
- xfonts
- babl
- pango
- atk
- gtk+
- sdl
- jsoncpp
- gegl
- gimp
- randrproto
- fontsproto
- libfontenc
- libxfont
- damageproto
- xcmiscproto
- libpciaccess
- xkeyboard-config
- scrnsaverproto
- bash
- resourceproto
- libxkbfile
- videoproto
- glproto
- fixesproto
- xkbcomp
- compositeproto
- recordproto
- openssl
- bigreqsproto
- xineramaproto
- xorg-server
- xbitmaps
- twm
- gimp-app
- emacs-x
- gtk-demo
-builder 4 (total: 11864)
- gtest
- corelibs
- glibc-compat
- zlib
- libtar
- nacl-spawn
- bzip2
- expat
- libpng
- freetype
- fontconfig
- texlive
- yajl
- gmp
- mpfr
- mpc
- gcc
- ncurses
- readline
- sqlite
- apr
- apr-util
- subversion
- lame
- libogg
- libvorbis
- libtheora
- libvpx
- ffmpeg
- libtomcrypt
- jpeg8d
- libyuv
- imagemagick
- texinfo
- libunistring
- gdb
- libav
- m4
- bison
- snes9x
- mp4v2
- openssl
- jsoncpp
- openssh
- binutils
- mingn
- flac
- gawk
- libxml2
- libarchive
- openscenegraph
- tcl
- gzip
- sdl2
- nettle
- libsodium
- kbproto
- xextproto
- xproto
- xcb-proto
- xtrans
- libxau
- libxcb
- inputproto
- libx11
- tk
- sdl2-tests
- id3lib
- liboggz
- libmodplug
- sdl2-ttf
- libebml
- libmatroska
- speex
- mongoose
- libxext
- libxi
- recordproto
- libxtst
- x264
- thttpd
- libpng12
- gc
- sdl2-gfx
- libuuid
- tinyxml
- poly2tri
- dreadthread
- blis
-Difference between total time of builders: 383
diff --git a/build_tools/partition6.txt b/build_tools/partition6.txt
deleted file mode 100644
index 4441181..0000000
--- a/build_tools/partition6.txt
+++ /dev/null
@@ -1,501 +0,0 @@
-builder 0 (total: 9644)
- gtest
- zlib
- libtar
- gmp
- mpfr
- mpc
- corelibs
- glibc-compat
- nacl-spawn
- binutils-2.25
- gcc-avr
- ncurses
- readline
- sqlite
- expat
- apr
- apr-util
- subversion
- libtomcrypt
- bzip2
- jpeg8d
- libpng
- imagemagick
- libunistring
- gdb
- libogg
- libvorbis
- lame
- libav
- m4
- bison
- gcc
- binutils
- mingn
- gawk
- openscenegraph
- gzip
- nettle
- libsodium
- lua
- zeromq
- cups
- freetype
- agg
- regal
- sdl
- bochs
- sdl-tests
- sdl-image
- agg-demo
- sdl-net
- libatomic-ops
- cfitsio
- jsoncpp
- thttpd
- faac
- protobuf-c
- tinyxml
- physfs
- blis
-builder 1 (total: 9650)
- gtest
- fftw-float
- corelibs
- glibc-compat
- zlib
- libtar
- nacl-spawn
- perl
- openssl
- bzip2
- ncurses
- python-host
- readline
- python
- less
- vim
- xz
- geturl
- libarchive-dev
- libelf
- libbsd
- pkg
- curl
- pcre
- git
- nano
- unzip
- bash
- devenv
- make
- coreutils
- grep
- findutils
- devenv-latest
- libogg
- flac
- gforth
- libxml2
- libarchive
- tcl
- sdl2
- ruby
- ruby-ppapi
- sdl2-tests
- libssh
- libmodplug
- libpng
- freetype
- sdl2-ttf
- busybox
- netcat
- httplib2
- speex
- setuptools
- python-gflags
- toybox
- google-api-python-client
- avrdude
- gc
- sdl2-gfx
- libtommath
- ipython
- markupsafe
- jinja2
-builder 2 (total: 9714)
- gtest
- fftw
- leveldb
- icu
- protobuf
- lame
- corelibs
- glibc-compat
- libogg
- libvorbis
- libtheora
- libvpx
- ffmpeg
- jpeg8d
- libyuv
- zlib
- libtar
- nacl-spawn
- texinfo
- libpng
- tiff
- jpeg6b
- opencv
- gsl
- samba
- snes9x
- mp4v2
- ncurses
- nethack
- freeimage
- bullet
- expat
- xproto
- libxau
- xcb-proto
- libxcb
- xextproto
- bzip2
- freetype
- fontconfig
- xtrans
- libice
- kbproto
- inputproto
- libx11
- libsm
- libxt
- libxext
- libxmu
- xbitmaps
- fvwm
- ninja
- tcl
- tk
- libiconv
- blackbox
- libtool
- id3lib
- liboggz
- hello
- xcb-util
- libwebp
- libebml
- libmatroska
- lcms
- libmng
- devil
- libxi
- recordproto
- libxtst
- x264
- xeyes
- tree
- sdl2
- sdl2-image
-builder 3 (total: 11352)
- gtest
- kbproto
- xextproto
- corelibs
- glibc-compat
- xproto
- xcb-proto
- xtrans
- libxau
- libxcb
- inputproto
- libx11
- tiff
- libice
- libsm
- libxt
- libxext
- libxmu
- jpeg8d
- libxpm
- libxaw
- zlib
- libtar
- nacl-spawn
- giflib
- libpng
- ncurses
- emacs
- bzip2
- gettext
- readline
- python3
- libffi
- glib
- font-util
- font-cronyx-cyrillic
- font-dec-misc
- json-glib
- tar
- font-isas-misc
- expat
- renderproto
- freetype
- fontconfig
- pixman
- libxrender
- cairo
- harfbuzz
- font-bitstream-75dpi
- font-mutt-misc
- font-alias
- font-misc-misc
- font-bh-ttf
- font-sony-misc
- font-bh-lucidatypewriter-75dpi
- font-bh-75dpi
- font-adobe-utopia-type1
- font-bh-100dpi
- gdk-pixbuf
- font-screen-cyrillic
- regal
- font-cursor-misc
- font-daewoo-misc
- font-adobe-75dpi
- font-xfree86-type1
- font-bh-type1
- font-adobe-utopia-75dpi
- font-bh-lucidatypewriter-100dpi
- font-sun-misc
- font-schumacher-misc
- font-micro-misc
- font-misc-ethiopic
- font-jis-misc
- font-adobe-utopia-100dpi
- font-winitzki-cyrillic
- font-misc-cyrillic
- font-misc-meltho
- font-bitstream-100dpi
- font-ibm-type1
- font-adobe-100dpi
- font-bitstream-type1
- xfonts
- babl
- pango
- atk
- gtk+
- sdl
- jsoncpp
- gegl
- gimp
- randrproto
- fontsproto
- libfontenc
- libxfont
- damageproto
- xcmiscproto
- libpciaccess
- xkeyboard-config
- scrnsaverproto
- bash
- resourceproto
- libxkbfile
- videoproto
- glproto
- fixesproto
- xkbcomp
- compositeproto
- recordproto
- openssl
- bigreqsproto
- xineramaproto
- xorg-server
- xbitmaps
- twm
- gimp-app
- emacs-x
- gtk-demo
-builder 4 (total: 9669)
- gtest
- corelibs
- glibc-compat
- zlib
- libtar
- nacl-spawn
- bzip2
- expat
- libpng
- freetype
- fontconfig
- texlive
- python-host
- numpy
- clapack
- cython
- ncurses
- openssl
- readline
- pyppapi
- python-static
- pyparsing
- setuptools
- distribute
- hdf5
- h5py
- six
- python-dateutil
- nose
- matplotlib
- sympy
- yt
- libmikmod
- regal
- libogg
- sdl
- libvorbis
- sdl-mixer
- metakit
- sdl-ttf
- drod
- jsoncpp
- openssh
- libssh2
- libgit2
- libiconv
- requests
- thingking
- darksky-catalog
- dosbox
- scummvm
- mesa
- libffi
- gettext
- glib
- fuseiso
- zeromq
- pyzmq
- libgit2-demo
- openal-soft
- mpg123
- quakespasm
- faad2
- xaos
- sdlquake
- freealut
- clipper
- openjpeg
- openal-ogg-demo
- alut-demo
- ipython
- ipython-ppapi
- pytz
- pandas
- wireshark
-builder 5 (total: 9645)
- gtest
- yajl
- eigen3
- zlib
- libtar
- gmp
- mpfr
- mpc
- corelibs
- glibc-compat
- nacl-spawn
- gcc
- ncurses
- readline
- ruby
- bzip2
- boost
- font-util
- font-sony-misc
- font-cronyx-cyrillic
- font-dec-misc
- font-isas-misc
- xcmiscproto
- randrproto
- font-bitstream-75dpi
- font-xfree86-type1
- libpciaccess
- xkeyboard-config
- scrnsaverproto
- xproto
- libxau
- xcb-proto
- libxcb
- font-misc-misc
- font-bh-ttf
- xextproto
- font-bh-100dpi
- libfontenc
- font-bh-lucidatypewriter-75dpi
- bash
- font-bh-75dpi
- renderproto
- font-adobe-utopia-type1
- kbproto
- xtrans
- inputproto
- libx11
- expat
- libpng
- freetype
- fontconfig
- fontsproto
- libxfont
- font-screen-cyrillic
- resourceproto
- libxkbfile
- regal
- videoproto
- glproto
- font-cursor-misc
- font-daewoo-misc
- pixman
- font-adobe-75dpi
- font-mutt-misc
- font-bh-type1
- font-adobe-utopia-75dpi
- font-bh-lucidatypewriter-100dpi
- font-sun-misc
- font-schumacher-misc
- font-micro-misc
- font-misc-ethiopic
- font-jis-misc
- font-adobe-utopia-100dpi
- font-alias
- font-winitzki-cyrillic
- font-misc-cyrillic
- font-misc-meltho
- font-bitstream-100dpi
- font-ibm-type1
- font-adobe-100dpi
- font-bitstream-type1
- xfonts
- fixesproto
- damageproto
- xkbcomp
- sdl
- compositeproto
- recordproto
- libxext
- openssl
- bigreqsproto
- xineramaproto
- xorg-server
- mongoose
- civetweb
- libxinerama
- libhangul
- libpng12
- bdftopcf
- libuuid
- box2d
- poly2tri
- dreadthread
-Difference between total time of builders: 1708
diff --git a/build_tools/patch_configure.py b/build_tools/patch_configure.py
deleted file mode 100755
index aa8443c..0000000
--- a/build_tools/patch_configure.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 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.
-"""Script to patch a configure script in-place such that the libtool
-dynamic library detection works for NaCl.
-
-Once this patch makes it into upstream libtool it should eventually
-be possible to remove this completely.
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import re
-import sys
-
-# Shell fragment for detecting shared library support in the compiler.
-detect_so_support = \
- 'libc_so=`$CC -print-file-name=libc.so` && [ "$libc_so" != libc.so ]'
-
-# There are essentailly three patches here, which will make configure do
-# the right things for shared library support when used with the NaCl
-# GLIBC toolchain.
-CONFIGURE_PATCHS = [
-# Correct result for "dynamic linker characteristics"
-# pylint: disable=line-too-long
-['(\n\\*\\)\n dynamic_linker=no)',
-'''
-nacl)
- # Patched by naclports using patch_configure.py
- if %s; then
- dynamic_linker="GNU/NaCl ld.so"
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- else
- dynamic_linker=no
- fi
- ;;
-\\1''' % detect_so_support],
-# Correct result for "supports shared libraries"
-[r'''(
- netbsd\*\)
- if echo __ELF__ \| \$CC -E - \| grep __ELF__ >/dev/null; then
- archive_cmds_CXX='\$LD -Bshareable -o \$lib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$linker_flags')
-''',
-'''
- # Patched by naclports using patch_configure.py
- nacl)
- if %s; then
- ld_shlibs_CXX=yes
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
-\\1
-''' % detect_so_support],
-# Correct result for "how to recognize dependent libraries"
-[r'''
-(.*linux.*)\)
- lt_cv_deplibs_check_method=pass_all''',
-'''
-# Patched by naclports using patch_configure.py
-\\1 | nacl*)
- lt_cv_deplibs_check_method=pass_all''']
-]
-
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('configure', metavar='CONFIGURE_SCRIPT',
- help='configure script to patch')
- options = parser.parse_args(args)
-
- if not os.path.exists(options.configure):
- sys.stderr.write('configure script not found: %s\n' % options.configure)
- return 1
-
- # Read configure
- with open(options.configure) as input_file:
- filedata = input_file.read()
-
- if 'Patched by naclports' in filedata:
- sys.stderr.write('Configure script already patched\n')
- return 0
-
- # Check for patch location
- for i, (pattern, replacement) in enumerate(CONFIGURE_PATCHS):
- if not re.search(pattern, filedata):
- sys.stderr.write('Failed to find patch %s location in configure '
- 'script: %s\n' % (i, options.configure))
- continue
-
- # Apply patch
- filedata = re.sub(pattern, replacement, filedata)
-
- # Overwrite input file with patched file data
- with open(options.configure, 'w') as output_file:
- output_file.write(filedata)
-
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/pip_install.sh b/build_tools/pip_install.sh
deleted file mode 100755
index 6c39083..0000000
--- a/build_tools/pip_install.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-# Copyright 2014 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.
-
-# Installs required python modules using 'pip'.
-# Always use a locally installed version of pip rather than relying
-# on the system version since the behaviour and command line flags
-# for pip inself vary between versions.
-
-SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
-ARGS="--user --no-compile"
-
-cd "${SCRIPT_DIR}/.."
-
-export PYTHONUSERBASE=$PWD/out/pip
-pip_bin_dir=$PYTHONUSERBASE/bin
-pip_bin=$pip_bin_dir/pip
-export PATH=$pip_bin_dir:$PATH
-
-if [ ! -f "$pip_bin" ]; then
- # On first run install pip directly from the network
- echo "Installing pip.."
- # Use local file rather than pipeline so we can detect failure of the curl
- # command.
- curl --silent --show-error https://bootstrap.pypa.io/get-pip.py > get-pip.py
- python get-pip.py --force-reinstall --user
- rm -f get-pip.py
- hash -r
-fi
-
-set -x
-# Pin locally install pip to a specific version
-pip install --user "pip==6.0.6"
-
-# At this point we know we have good pip install in $PATH and we can use
-# it to install the requirements.
-pip install ${ARGS} -r requirements.txt
diff --git a/build_tools/pipeserver.js b/build_tools/pipeserver.js
deleted file mode 100644
index aa14795..0000000
--- a/build_tools/pipeserver.js
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-/**
- * PipeServer manages a set of anonymous pipes.
- */
-function PipeServer() {
- // Start id for anonymous pipes.
- this.anonymousPipeId = 1;
-
- // Status of anonymous pipes.
- this.anonymousPipes = {};
-}
-
-/**
- * Pipe error.
- * @type {number}
- */
-PipeServer.prototype.EPIPE = 32;
-
-/**
- * Handle an anonymous pipe creation call.
- */
-PipeServer.prototype.handleMessageAPipe = function(msg, reply, src) {
- var id = this.anonymousPipeId++;
- this.anonymousPipes[id] = {
- readers: {},
- writers: {},
- readsPending: [],
- writesPending: [],
- };
- var pipe = this.anonymousPipes[id];
- pipe.readers[src.pid] = null;
- pipe.writers[src.pid] = null;
- reply({
- pipe_id: id,
- });
-};
-
-/**
- * Handle an anonymous pipe write call.
- */
-PipeServer.prototype.handleMessageAPipeWrite = function(
- msg, reply, src) {
- var id = msg.pipe_id;
- var data = msg.data;
- var dataInitialSize = data.byteLength;
- if (!(id in this.anonymousPipes &&
- src.pid in this.anonymousPipes[id].writers)) {
- reply({
- count: this.EPIPE,
- });
- return;
- }
- var pipe = this.anonymousPipes[id];
- while (data.byteLength > 0 && pipe.readsPending.length > 0) {
- var item = pipe.readsPending.shift();
- var part = data.slice(0, item.count);
- item.reply({
- data: part,
- });
- data = data.slice(part.byteLength);
- }
- if (data.byteLength === 0) {
- reply({
- count: dataInitialSize,
- });
- } else {
- if (Object.keys(pipe.readers).length > 0) {
- // TODO(bradnelson): consider limiting slack on buffer here.
- // Using infinite slack for now as this helps git work.
- var replied = false;
- if (1) {
- replied = true;
- reply({
- count: dataInitialSize,
- });
- }
- pipe.writesPending.push({
- dataInitialSize: dataInitialSize,
- data: data,
- reply: reply,
- replied: replied,
- pid: src.pid,
- });
- } else {
- reply({
- count: this.EPIPE,
- });
- }
- }
-};
-
-/**
- * Handle an anonymous pipe read call.
- */
-PipeServer.prototype.handleMessageAPipeRead = function(
- msg, reply, src) {
- var id = msg.pipe_id;
- var count = msg.count;
- if (count === 0 ||
- !(id in this.anonymousPipes &&
- src.pid in this.anonymousPipes[id].readers)) {
- reply({
- data: new ArrayBuffer(0),
- });
- return;
- }
- var pipe = this.anonymousPipes[id];
- if (pipe.writesPending.length > 0) {
- var item = pipe.writesPending.shift();
- if (item.data.byteLength > count) {
- var part = item.data.slice(0, count);
- reply({
- data: part,
- });
- item.data = item.data.slice(part.byteLength);
- pipe.writesPending.unshift(item);
- } else {
- reply({
- data: item.data,
- });
- if (!item.replied) {
- item.reply({
- count: item.dataInitialSize,
- });
- }
- }
- } else {
- if (Object.keys(pipe.writers).length > 0) {
- pipe.readsPending.push({
- count: count,
- reply: reply,
- pid: src.pid,
- });
- } else {
- reply({
- data: new ArrayBuffer(0),
- });
- }
- }
-};
-
-/**
- * Close handle to an anonymous pipe for a process.
- */
-PipeServer.prototype.closeAPipe = function(pid, pipeId, writer) {
- if (pipeId in this.anonymousPipes) {
- var pipe = this.anonymousPipes[pipeId];
- if (writer) {
- delete pipe.writers[pid];
- } else {
- delete pipe.readers[pid];
- }
- if (Object.keys(pipe.writers).length === 0 &&
- Object.keys(pipe.readers).length === 0) {
- delete this.anonymousPipes[pipeId];
- } else if (Object.keys(pipe.writers).length === 0) {
- for (var i = 0; i < pipe.readsPending.length; i++) {
- var item = pipe.readsPending[i];
- item.reply({
- data: new ArrayBuffer(0),
- });
- }
- pipe.readsPending = [];
- } else if (Object.keys(pipe.readers).length === 0) {
- for (var i = 0; i < pipe.writesPending.length; i++) {
- var item = pipe.writesPending[i];
- item.reply({
- count: this.EPIPE,
- });
- }
- pipe.writesPending = [];
- }
- }
-};
-
-/**
- * Handle an anonymous pipe close call.
- */
-PipeServer.prototype.handleMessageAPipeClose = function(
- msg, reply, src) {
- this.closeAPipe(src.pid, msg.pipe_id, msg.writer);
- reply({
- result: 0,
- });
-};
-
-
-/**
- * Add spawned pipe entries.
- * @params {Object} Dictionary of environment variables passed to process.
- */
-PipeServer.prototype.addProcessPipes = function(pid, params) {
- var fdCount = 0;
- for (;;fdCount++) {
- var entry = 'NACL_SPAWN_FD_SETUP_' + fdCount;
- if (!(entry in params))
- break;
- // Pull out a a pipe spec of the form:
- // pipe:<fd number>:<pipe-id>:<is-writer>
- var m = params[entry].match(/pipe:([0-9]+):([0-9]+):([0-9]+)/);
- if (m) {
- var fd = parseInt(m[1]);
- var id = parseInt(m[2]);
- var isWriter = parseInt(m[3]);
- if (id in this.anonymousPipes) {
- var pipe = this.anonymousPipes[id];
- if (isWriter) {
- pipe.writers[pid] = null;
- } else {
- pipe.readers[pid] = null;
- }
- }
- }
- }
-};
-
-
-/**
- * Add spawned pipe entries.
- * @params {Object} Dictionary of environment variables passed to process.
- */
-PipeServer.prototype.deleteProcess = function(pid) {
- for (var pipeId in this.anonymousPipes) {
- var pipe = this.anonymousPipes[pipeId];
- if (pid in pipe.readers) {
- this.closeAPipe(pid, pipeId, false);
- }
- if (pid in pipe.writers) {
- this.closeAPipe(pid, pipeId, true);
- }
- }
-};
diff --git a/build_tools/pnacl-configure-shim.py b/build_tools/pnacl-configure-shim.py
deleted file mode 100755
index 0991d5c..0000000
--- a/build_tools/pnacl-configure-shim.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-"""Autoconf builds lots of small executables.
-This wreaks havock with pnacl's slow -O2 build time.
-Additionally linking nacl_io + ppapi_simple slows things down even more.
-
-This script is injected for CC to speed up configure by:
-- When configuring:
- - Drop -O2 and -O3
- - Add -O0
- - Drop nacl_spawn + nacl_io + cli_main and their dependencies.
-"""
-
-import subprocess
-import sys
-
-cmd = sys.argv[1:]
-configuring = 'conftest.c' in cmd or 'conftest.pexe' in cmd
-
-DROP_FLAGS = {
- '-O2',
- '-O3',
- '-Dmain=SDL_main',
- '-lnacl_io',
- '-lnacl_spawn',
- '-lppapi_simple',
- '-lppapi_cpp',
- '-lppapi',
- '-lcli_main',
- '-lSDLmain',
-}
-
-if configuring:
- cmd = [i for i in cmd if i not in DROP_FLAGS]
- cmd += ['-O0']
-
-sys.exit(subprocess.call(cmd))
diff --git a/build_tools/python_wrapper b/build_tools/python_wrapper
deleted file mode 100755
index 0af1c2d..0000000
--- a/build_tools/python_wrapper
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-# Wrapper for system python that first set PYTHONUSERBASE so that
-# the python modules installed via pip (during glclient runhooks)
-# are accessible.
-
-SCRIPT_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
-
-export PYTHONPATH="${PYTHONPATH}:${SCRIPT_DIR}:$(dirname ${SCRIPT_DIR})/lib"
-export PYTHONUSERBASE="$(dirname $SCRIPT_DIR)/out/pip"
-
-if [ ! -d "${PYTHONUSERBASE}" ]; then
- echo "error: pip installation not found (${PYTHONUSERBASE})"
- echo "Did you use gclient to fetch the webports repo?"
- echo "(See top level README to details)"
- exit 1
-fi
-
-exec python $*
diff --git a/build_tools/repo_sweep.py b/build_tools/repo_sweep.py
deleted file mode 100755
index 104b5d4..0000000
--- a/build_tools/repo_sweep.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2015 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.
-
-"""Generate repos for completed webports builds.
-
-Scan the GSD bucket associated with webports for builds which have
-been around for move than a few hours and which lack pkg repository
-metadata. Run build_repo.sh on each of them.
-"""
-
-import datetime
-import os
-import subprocess
-import sys
-
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-AGE_LIMIT = 8 * 60 * 60 # 8 hours
-
-
-def GetPepperVersions():
- output = subprocess.check_output(['gsutil', 'ls', 'gs://webports/builds'])
- names = [i.split('/')[-2] for i in output.splitlines()]
- picked = [i for i in names if int(i.split('_')[1]) >= 48]
- return picked
-
-
-def GetVersionRevisions(version):
- output = subprocess.check_output(
- ['gsutil', 'ls', 'gs://webports/builds/%s' % version])
- return [i.split('/')[-2] for i in output.splitlines()]
-
-
-def GetExistingVersionRevisions(version):
- try:
- output = subprocess.check_output(
- ['gsutil', 'ls',
- 'gs://webports/builds/%s/*/publish/pkg_pnacl/meta.*' % version],
- stderr=open(os.devnull, 'w'))
- return set([i.split('/')[-4] for i in output.splitlines()])
- except subprocess.CalledProcessError:
- return set()
-
-
-def GetExistingRevisions():
- revisions = []
- for version in GetPepperVersions():
- for revision in GetExistingVersionRevisions(version):
- revisions.append((version, revision))
- return revisions
-
-
-def GetAllMissingRevisions():
- picked = []
- for version in GetPepperVersions():
- revisions = GetVersionRevisions(version)
- existing = GetExistingVersionRevisions(version)
- picked.extend((version, i) for i in revisions if i not in existing)
- return picked
-
-
-def GetAge(version, revision):
- try:
- output = subprocess.check_output(
- ['gsutil', 'ls', '-l',
- 'gs://webports/builds/%s/%s/packages/devenv_*_pnacl.*' %
- (version, revision)],
- stderr=open(os.devnull, 'w'))
- stamp = output.splitlines()[0].split()[1]
- tm = datetime.datetime.strptime(stamp, '%Y-%m-%dT%H:%M:%SZ')
- return (datetime.datetime.utcnow() - tm).total_seconds()
- except subprocess.CalledProcessError:
- return None
-
-
-def BuildRepo(version, revision):
- age = GetAge(version, revision)
- if age is None:
- print 'Skipping %s/%s as it is a bad version' % (version, revision)
- return
- if age < AGE_LIMIT:
- print 'Skipping %s/%s as it is only %.1f hours old' % (
- version, revision, age / 60 / 60)
- return
- env = os.environ.copy()
- env['SDK_VERSION'] = version
- cmd = ['bash', os.path.join(SCRIPT_DIR, 'build_repo.sh'), '-r', revision]
- print 'Building %s/%s...' % (version, revision)
- subprocess.check_call(cmd, env=env)
-
-
-def main():
- missing = GetAllMissingRevisions()
- for version, revision in missing:
- BuildRepo(version, revision)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/build_tools/scan_packages.py b/build_tools/scan_packages.py
deleted file mode 100755
index 2bb3acf..0000000
--- a/build_tools/scan_packages.py
+++ /dev/null
@@ -1,237 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-"""Scan online binary packages to produce new package index.
-
-This script is indended to be run periodically and the
-results checked into source control.
-"""
-
-from __future__ import print_function
-
-import argparse
-import base64
-import collections
-import hashlib
-import os
-import subprocess
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(os.path.dirname(SCRIPT_DIR), 'lib'))
-
-import webports
-import webports.package
-import webports.package_index
-
-from webports.util import Log, LogVerbose
-
-
-def FormatSize(num_bytes):
- """Create a human readable string from a byte count."""
- for x in ('bytes', 'KB', 'MB', 'GB', 'TB'):
- if num_bytes < 1024.0:
- return "%3.1f %s" % (num_bytes, x)
- num_bytes /= 1024.0
-
-
-class FileInfo(object):
-
- def __init__(self, name, url, gsurl, size=0, md5=''):
- self.name = name
- self.url = url
- self.gsurl = gsurl
- self.size = size
- self.md5 = md5
-
- def __repr__(self):
- return '<FileInfo %s [%s]>' % (self.name, self.size)
-
-
-def ParseGsUtilOutput(output):
- """Parse the output of gsutil -L.
-
- Returns:
- List of FileInfo objects.
- """
- # gsutil stat outputs the name of each file starting in column zero followed
- # by zero or more fields indended with tab characters.
- # gs://webports/builds/pepper_44/..../agg-demo_0.1_x86-64_newlib.tar.bz2:
- # Creation time: Wed, 13 May 2015 18:52:05 GMT
- # Content-Length: 342
- # Content-Type: application/x-tar
- # Hash (crc32c): sf+mJQ==
- # Hash (md5): tXtj9ASElmzyncWl0k/PvA==
- # ETag: CIjv79uxv8UCEAE=
- # Generation: 1431543125637000
- # Metageneration: 1
- #
- # Note that some fields contiue onto more than one line.
- # The final line in the file starts with TOTAL
-
- result = []
- info = None
- for line in output.splitlines():
- if line[0] != '\t':
- if info is not None:
- assert info.size
- assert info.md5
- result.append(info)
- # Handle final line
- if line.startswith("TOTAL"):
- continue
- gsurl = line.strip()[:-1]
- filename = gsurl[len('gs://'):]
- url = webports.GS_URL + filename
- info = FileInfo(name=line.strip(), url=url, gsurl=gsurl)
- else:
- line = line.strip()
- prop_name, prop_value = line.split(':', 1)
- if prop_name == 'Content-Length':
- info.size = int(prop_value)
- elif prop_name == 'Hash (md5)':
- info.md5 = base64.b64decode(prop_value).encode('hex')
-
- result.append(info)
- return result
-
-
-def GetHash(filename):
- with open(filename) as f:
- return hashlib.md5(f.read()).hexdigest()
-
-
-def CheckHash(filename, md5sum):
- """Return True is filename has the given md5sum, False otherwise."""
- return md5sum == GetHash(filename)
-
-
-def DownloadFiles(files, check_hashes=True, parallel=False):
- """Download one of more files to the local disk.
-
- Args:
- files: List of FileInfo objects to download.
- check_hashes: When False assume local files have the correct
- hash otherwise always check the hashes match the onces in the
- FileInfo ojects.
-
- Returns:
- List of (filename, url) tuples.
- """
- files_to_download = []
- filenames = []
- download_dir = webports.package_index.PREBUILT_ROOT
- if not os.path.exists(download_dir):
- os.makedirs(download_dir)
-
- for file_info in files:
- basename = os.path.basename(file_info.url)
- file_info.name = os.path.join(download_dir, basename)
- filenames.append((file_info.name, file_info.url))
- if os.path.exists(file_info.name):
- if not check_hashes or CheckHash(file_info.name, file_info.md5):
- Log('Up-to-date: %s' % file_info.name)
- continue
- files_to_download.append(file_info)
-
- def Check(file_info):
- if check_hashes and not CheckHash(file_info.name, file_info.md5):
- raise webports.Error(
- 'Checksum failed: %s\nExpected=%s\nActual=%s' %
- (file_info.name, file_info.md5, GetHash(file_info.name)))
-
- if not files_to_download:
- Log('All files up-to-date')
- else:
- total_size = sum(f.size for f in files_to_download)
- Log('Need to download %d/%d files [%s]' %
- (len(files_to_download), len(files), FormatSize(total_size)))
-
- gsutil = FindGsutil()
- if parallel:
- remaining_files = files_to_download
- num_files = 20
- while remaining_files:
- files = remaining_files[:num_files]
- remaining_files = remaining_files[num_files:]
- cmd = gsutil + ['-m', 'cp'] + [f.gsurl for f in files] + [download_dir]
- LogVerbose(cmd)
- subprocess.check_call(cmd)
- for file_info in files:
- Check(file_info)
- else:
- for file_info in files_to_download:
- webports.DownloadFile(file_info.name, file_info.url)
- Check(file_info)
-
- return filenames
-
-
-def FindGsutil():
- # Ideally we would use the gsutil that comes with depot_tools since users
- # are much more likely to have that in thier PATH. However I found this
- # depot_tools version to be a lot slower.
- # return [sys.executable, webports.util.FindInPath('gsutil.py')]
- return ['gsutil']
-
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('revision', metavar='REVISION',
- help='webports revision to to scan for.')
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Output extra information.')
- parser.add_argument('-p', '--parallel', action='store_true',
- help='Download packages in parallel.')
- parser.add_argument('-l', '--cache-listing', action='store_true',
- help='Cached output of gsutil -L (for testing).')
- parser.add_argument('--skip-md5', action='store_true',
- help='Assume on-disk files are up-to-date (for testing).')
- args = parser.parse_args(args)
- if args.verbose:
- webports.SetVerbose(True)
-
- sdk_version = webports.util.GetSDKVersion()
- Log('Scanning packages built for pepper_%s at revsion %s' %
- (sdk_version, args.revision))
- base_path = '%s/builds/pepper_%s/%s/packages' % (webports.GS_BUCKET,
- sdk_version, args.revision)
- gs_url = 'gs://' + base_path + '/*'
- listing_file = os.path.join(webports.NACLPORTS_ROOT, 'lib', 'listing.txt')
-
- if args.cache_listing and os.path.exists(listing_file):
- Log('Using pre-cached gs listing: %s' % listing_file)
- with open(listing_file) as f:
- listing = f.read()
- else:
- Log('Searching for packages at: %s' % gs_url)
- cmd = FindGsutil() + ['stat', gs_url]
- LogVerbose('Running: %s' % str(cmd))
- try:
- listing = subprocess.check_output(cmd)
- except subprocess.CalledProcessError as e:
- raise webports.Error("Command '%s' failed: %s" % (cmd, e))
- if args.cache_listing:
- with open(listing_file, 'w') as f:
- f.write(listing)
-
- all_files = ParseGsUtilOutput(listing)
-
- Log('Found %d packages [%s]' % (len(all_files),
- FormatSize(sum(f.size for f in all_files))))
-
- binaries = DownloadFiles(all_files, not args.skip_md5, args.parallel)
- index_file = os.path.join(webports.NACLPORTS_ROOT, 'lib', 'prebuilt.txt')
- Log('Generating %s' % index_file)
- webports.package_index.WriteIndex(index_file, binaries)
- Log('Done')
- return 0
-
-
-if __name__ == '__main__':
- try:
- sys.exit(main(sys.argv[1:]))
- except webports.Error as e:
- sys.stderr.write('%s\n' % e)
- sys.exit(-1)
diff --git a/build_tools/sha1check.py b/build_tools/sha1check.py
deleted file mode 100755
index dce88d1..0000000
--- a/build_tools/sha1check.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/env python
-# 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.
-"""
-Usage:
- sha1check.py <hashfile
-
- where hashfile was generated by "sha1sum.py" (or the "sha1sum" utility)
- and has the format:
-
- da39a3ee5e6b4b0d3255bfef95601890afd80709 *filename
-
- sha1check.py will perform sha1 hash on filename (opened in
- binary mode) and compare the generated hash value with
- the hash value in the input hashfile. If the two hashes
- don't match or filename doesn't exist, sha1check.py will
- return an error.
-"""
-
-from __future__ import print_function
-
-import hashlib
-import sys
-
-
-class Error(Exception):
- pass
-
-
-def VerifyHash(filename, sha1sum):
- try:
- # open file in binary mode & sha1 hash it
- h = hashlib.sha1()
- with open(filename, "rb") as f:
- h.update(f.read())
- filehash = h.hexdigest()
-
- except IOError:
- raise Error("unable to open file " + filename)
- except:
- raise Error("encountered an unexpected error")
-
- # verify the generated hash and embedded hash match
- if sha1sum.lower() != filehash.lower():
- print("Filename: %s" % filename)
- print("Expected hash: %s" % sha1sum)
- print("Actual hash: %s" % filehash)
- raise Error("sha1 checksum failed on file: " + filename)
-
-
-def VerifyLine(line, verbose):
- # split the hash *filename into a pair
- parts = line.split()
- if len(parts) != 2:
- raise Error("Invalid sha1 line: '%s'" % line)
-
- sha1sum, name = parts
-
- # make sure filename started with '*' (binary mode)
- if not name or name[0] != '*':
- raise Error("input hash is not from a binary file")
-
- # remove leading '*' and any newlines from filename
- filename = name[1:]
- VerifyHash(filename, sha1sum)
- if verbose:
- print("sha1check.py: %s verified" % filename)
-
- return filename
-
-
-def VerifyFile(file_input, verbose):
- rtn = []
- for line in file_input:
- rtn.append(VerifyLine(line, verbose))
-
- if not rtn:
- raise Error("No file hashes given on input")
-
- return rtn
-
-
-def main():
- try:
- VerifyFile(sys.stdin, True)
- except Error as e:
- sys.stdout.write('sha1check.py: %s\n' % str(e))
- return 1
-
- return 0
-
-# all files hashed with success
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/build_tools/sha1sum.py b/build_tools/sha1sum.py
deleted file mode 100755
index 897fea5..0000000
--- a/build_tools/sha1sum.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 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.
-"""
-Usage:
- sha1sum.py <filename>
-
- will hash the filename in binary mode, generating a
- single line of output suitable for including in a
- pkg_info file. e.g.:
-
- SHA1=da39a3ee5e6b4b0d3255bfef95601890afd80709
-"""
-
-from __future__ import print_function
-
-import hashlib
-import os
-import sys
-
-
-def main(args):
- if len(args) != 1:
- sys.stderr.write("sha1sum.py: please specify a filename\n")
- sys.exit(-1)
-
- filename = args[0]
- if not os.path.exists(filename):
- sys.stderr.write("sha1sum.py: file not found: %s\n" % filename)
- sys.exit(-1)
-
- # open the file in binary mode & generate sha1 hash
- with open(filename, "rb") as f:
- h = hashlib.sha1()
- h.update(f.read())
- filehash = h.hexdigest()
- f.close()
-
- print("SHA1=%s" % filehash.lower())
-
-
-if __name__ == '__main__':
- # all files hashed with success
- sys.exit(main(sys.argv[1:]))
diff --git a/build_tools/stubs.h b/build_tools/stubs.h
deleted file mode 100644
index 1048561..0000000
--- a/build_tools/stubs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-/*
- * glibc's <gnu/stubs.h> declares which functions are stubs in glibc
- * but some of these are provided by nacl_io. autoconf tests will
- * often check for the __stub_XXX macros and so will incorrectly
- * determine that these functions are missing. This header modifies
- * the effect of the toolchain's stubs.h by undefining the macros
- * for functions that exist in nacl_io.
- */
-#include_next <gnu/stubs.h>
-
-#undef __stub_fcntl
-#undef __stub_fchown
-#undef __stub_pipe
-#undef __stub_select
-#undef __stub_socket
-#undef __stub_poll
-#undef __stub_statvfs
-#undef __stub_fstatvfs
-#undef __stub_fstatat
-#undef __stub_setsid
-#undef __stub_connect
-#undef __stub_tcgetattr
-#undef __stub_tcsetattr
-#undef __stub_getrusage
-#undef __stub_setrusage
-#undef __stub_setpgid
-#undef __stub_getpgid
-#undef __stub_getgroups
-#undef __stub_setgroups
diff --git a/build_tools/template_expand.py b/build_tools/template_expand.py
deleted file mode 100755
index 7511fa3..0000000
--- a/build_tools/template_expand.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-
-import sys
-
-
-def Main(argv):
- # Check the number of arguments.
- if len(argv) < 2:
- sys.stderr.write('Usage: %s <template> [KEY=VALUE]*\n' % argv[0])
- return 1
- # Decode substitutions.
- substitutions = {}
- for arg in argv[2:]:
- key, value = arg.split('=', 1)
- substitutions[key] = value
- # Load the template.
- with open(argv[1], 'rb') as fh:
- data = fh.read()
- # Emit template with substituions.
- sys.stdout.write(data % substitutions)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(Main(sys.argv))
diff --git a/build_tools/test_build_tools.py b/build_tools/test_build_tools.py
deleted file mode 100644
index 8ff9ae1..0000000
--- a/build_tools/test_build_tools.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# Copyright 2014 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.
-
-import mock
-from mock import Mock, patch
-import StringIO
-import unittest
-
-import webports
-import patch_configure
-import scan_packages
-import update_mirror
-from find_effected_packages import find_effected_packages
-
-
-def MockFileObject(contents):
- file_mock = Mock(name="file_mock", spec=file)
- file_mock.read.return_value = contents
- file_mock.__enter__ = lambda s: s
- file_mock.__exit__ = Mock(return_value=False)
- return file_mock
-
-
-class TestPatchConfigure(unittest.TestCase):
-
- @patch('sys.stderr', new_callable=StringIO.StringIO)
- def testMissingFile(self, stderr):
- rtn = patch_configure.main(['non-existent/configure-script'])
- self.assertEqual(rtn, 1)
- expected = '^configure script not found: non-existent/configure-script$'
- self.assertRegexpMatches(stderr.getvalue(), expected)
-
-
-class TestScanPackages(unittest.TestCase):
-
- def testCheckHash(self): # pylint: disable=no-self-use
- file_mock = MockFileObject('1234\n')
- md5 = Mock()
- md5.hexdigest.return_value('4321')
- with patch('__builtin__.open', Mock(return_value=file_mock), create=True):
- scan_packages.CheckHash('foo', '1234')
-
- @patch('webports.package_index.PREBUILT_ROOT', 'dummydir')
- @patch('scan_packages.Log', Mock())
- @patch('scan_packages.CheckHash')
- @patch('os.path.exists', Mock(return_value=True))
- def testDownloadFiles(self, check_hash_mock): # pylint: disable=no-self-use
- check_hash_mock.return_value = True
- file_info = scan_packages.FileInfo(name='foo', size=10, gsurl='gs://test',
- url='http://host/base', md5='hashval')
- scan_packages.DownloadFiles([file_info])
- check_hash_mock.assert_called_once_with('dummydir/base', 'hashval')
-
-
-class TestUpdateMirror(unittest.TestCase):
-
- @patch('webports.util.FindInPath', Mock())
- def testCheckMirror_CheckOnly(self):
- pkg = webports.source_package.CreatePackage('zlib')
- pkg.GetArchiveFilename = Mock(return_value='file.tar.gz')
- options = Mock()
- options.check = True
- update_mirror.CheckMirror(options, pkg, ['file.tar.gz'])
-
- with self.assertRaises(SystemExit):
- update_mirror.CheckMirror(options, pkg, [])
-
- @patch('webports.util.FindInPath', Mock())
- @patch('update_mirror.GsUpload')
- def testCheckMirror_WithDownload(self, upload_mock):
- mock_download = Mock()
- pkg = webports.source_package.CreatePackage('zlib')
- pkg.Download = mock_download
-
- pkg.GetArchiveFilename = Mock(return_value='file.tar.gz')
- options = Mock()
- options.check = False
- update_mirror.CheckMirror(options, pkg, ['file.tar.gz'])
- update_mirror.CheckMirror(options, pkg, [])
-
- upload_mock.assert_called_once_with(
- options, pkg.DownloadLocation(),
- update_mirror.MIRROR_GS + '/file.tar.gz')
-
- @patch('update_mirror.CheckMirror')
- def testCheckPackages(self, check_mirror):
- mirror_listing = ['foo']
- mock_options = Mock()
- update_mirror.CheckPackages(mock_options, ['a', 'b', 'c'], mirror_listing)
- check_mirror.assert_calls([mock.call(mock_options, 'a', mirror_listing),
- mock.call(mock_options, 'b', mirror_listing),
- mock.call(mock_options, 'c', mirror_listing)])
-
- @patch('webports.source_package.SourcePackageIterator')
- @patch('webports.util.FindInPath', Mock())
- @patch('update_mirror.GetMirrorListing', Mock(return_value=['foo']))
- @patch('update_mirror.CheckPackages')
- def testMain(self, check_packages, source_package_iter):
- mock_iter = Mock()
- source_package_iter.return_value = mock_iter
-
- update_mirror.main([])
- check_packages.assert_called_once_with(mock.ANY, mock_iter, ['foo'])
-
-
-class TestFindEffectedPackages(unittest.TestCase):
-
- def test_non_port_files(self):
- self.assertEqual(find_effected_packages(['foo/bar'], False, None), ['all'])
-
- def test_deps(self):
- self.assertEqual(
- find_effected_packages(['ports/hello', 'ports/ruby'], False, None),
- ['hello', 'ruby', 'ruby-ppapi'])
-
- # The common dependencies of vim and nano should only appear once in this
- # list.
- self.assertEqual(
- find_effected_packages(['ports/hello', 'ports/ruby'], True, None),
- ['hello', 'corelibs', 'gtest', 'glibc-compat', 'ncurses', 'readline',
- 'zlib', 'ruby', 'libtar', 'nacl-spawn', 'ruby-ppapi'])
-
- def test_filter(self):
- effected = find_effected_packages(['ports/corelibs'], True,
- ['corelibs', 'glibc-compat'])
- self.assertEqual(effected, ['corelibs', 'glibc-compat'])
diff --git a/build_tools/update_mirror.py b/build_tools/update_mirror.py
deleted file mode 100755
index d66f710..0000000
--- a/build_tools/update_mirror.py
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 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.
-"""Script to synchronise the webports mirror of upstream archives.
-
-This script verifies that the URL for every package is mirrored on
-Google Cloud Storage. If it finds missing URLs it downloads them to
-the local machine and then pushes them up using gsutil.
-
-If any mirroring operations are required then the correct gsutil
-credentials will be needed.
-"""
-
-from __future__ import print_function
-
-import argparse
-import os
-import subprocess
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-NACLPORTS_ROOT = os.path.dirname(SCRIPT_DIR)
-sys.path.append(os.path.join(NACLPORTS_ROOT, 'lib'))
-
-import webports
-import webports.source_package
-
-MIRROR_GS = 'gs://webports/mirror'
-
-
-def GsUpload(options, filename, url):
- """Upload a file to Google cloud storage using gsutil"""
- webports.Log("Uploading to mirror: %s" % url)
- cmd = options.gsutil + ['cp', '-a', 'public-read', filename, url]
- if options.dry_run:
- webports.Log(cmd)
- else:
- subprocess.check_call(cmd)
-
-
-def GetMirrorListing(options, url):
- """Get filename listing for a Google cloud storage URL"""
- listing = subprocess.check_output(options.gsutil + ['ls', url])
- listing = listing.splitlines()
- listing = [os.path.basename(l) for l in listing]
- return listing
-
-
-def CheckMirror(options, package, mirror_listing):
- """Check that is package has is archive mirrors on Google cloud storage"""
- webports.LogVerbose('Checking %s' % package.NAME)
- basename = package.GetArchiveFilename()
- if not basename:
- return
-
- if basename in mirror_listing:
- # already mirrored
- return
-
- if options.check:
- webports.Log('update_mirror: Archive missing from mirror: %s' % basename)
- sys.exit(1)
-
- # Download upstream URL
- package.Download(force_mirror=False)
-
- url = '%s/%s' % (MIRROR_GS, basename)
- GsUpload(options, package.DownloadLocation(), url)
-
-
-def CheckPackages(options, source_packages, mirror_listing):
- count = 0
- for package in source_packages:
- CheckMirror(options, package, mirror_listing)
- count += 1
-
- if options.check:
- webports.Log("Verfied mirroring for %d packages" % count)
-
- return 0
-
-
-def main(args):
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('-n', '--dry-run', action='store_true',
- help="Don't actually upload anything")
- parser.add_argument('--check', action='store_true',
- help='Verify that the mirror is up-to-date.')
- parser.add_argument('-v', '--verbose', action='store_true',
- help='Enable verbose output.')
- options = parser.parse_args(args)
- webports.SetVerbose(options.verbose)
-
- # gsutil.py should be in PATH since its part of depot_tools.
- options.gsutil = [sys.executable, webports.util.FindInPath('gsutil.py')]
-
- listing = GetMirrorListing(options, MIRROR_GS)
- source_packages = webports.source_package.SourcePackageIterator()
-
- return CheckPackages(options, source_packages, listing)
-
-
-if __name__ == '__main__':
- try:
- sys.exit(main(sys.argv[1:]))
- except webports.Error as e:
- sys.stderr.write('%s\n' % e)
- sys.exit(-1)
diff --git a/build_tools/webports-configure.sh b/build_tools/webports-configure.sh
deleted file mode 100755
index 207f4e4..0000000
--- a/build_tools/webports-configure.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-SCRIPT_DIR=$(dirname "${BASH_SOURCE}")
-CONFIGURE_SCRIPT=$1
-shift 1
-set -e
-
-"${SCRIPT_DIR}/patch_configure.py" "${CONFIGURE_SCRIPT}"
-
-if [ -z "${NACL_CROSS_PREFIX}" ]; then
- WEBPORTS_ENV_IMPORT=1
- . "${SCRIPT_DIR}/webports-env.sh"
-fi
-
-# TODO(sbc): this code is currently duplicated in common.sh.
-PatchConfigSub() {
- # Replace the package's config.sub one with an up-do-date copy
- # that includes nacl support. We only do this if the string
- # 'nacl)' is not already contained in the file.
- local DEFAULT_CONFIG_SUB="$(dirname ${CONFIGURE_SCRIPT})/config.sub"
- local CONFIG_SUB=${CONFIG_SUB:-${DEFAULT_CONFIG_SUB}}
- if [ ! -f ${CONFIG_SUB} ]; then
- if [ -n "${CONFIG_SUB_MISSING}" ]; then
- return
- fi
- echo "Failed to find config.sub (${CONFIG_SUB})."
- echo "Please specify using \$CONFIG_SUB."
- exit 1
- fi
- if grep -q 'nacl)' ${CONFIG_SUB} /dev/null; then
- echo "${CONFIG_SUB} supports NaCl"
- else
- echo "Patching config.sub"
- /bin/cp -f ${SCRIPT_DIR}/config.sub ${CONFIG_SUB}
- fi
-}
-
-PatchConfigSub
-
-CONF_HOST=${NACL_CROSS_PREFIX}
-if [ "${NACL_ARCH}" = "pnacl" -o "${NACL_ARCH}" = "emscripten" ]; then
- # The PNaCl tools use "pnacl-" as the prefix, but config.sub
- # does not know about "pnacl". It only knows about "le32-nacl".
- # Unfortunately, most of the config.subs here are so old that
- # it doesn't know about that "le32" either. So we just say "nacl".
- CONF_HOST="nacl"
-fi
-
-NaClEnvExport
-echo "${CONFIGURE_SCRIPT}" --host=${CONF_HOST} --prefix=${NACL_PREFIX} "$@"
-exec "${CONFIGURE_SCRIPT}" --host=${CONF_HOST} --prefix=${NACL_PREFIX} "$@"
diff --git a/build_tools/webports-env.sh b/build_tools/webports-env.sh
deleted file mode 100755
index aede006..0000000
--- a/build_tools/webports-env.sh
+++ /dev/null
@@ -1,348 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2013 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.
-
-# Echo the environment variables need to to build/configure standard
-# GNU make/automake/configure projects. e.g. CC, CXX, CFLAGS, etc.
-# The values for these variables are calculated based on the following
-# environment variables:
-#
-# $NACL_ARCH - i386, x86_64, arm or pnacl. Default: x86_64
-# $TOOLCHAIN - clang-newlib, glibc or pnacl. Default: pnacl
-#
-# You can run a command within the NaCl environment
-# by passing the command line. e.g:
-# ./webports-env.sh ./configure --host=nacl
-# ./webports-env.sh make
-#
-# Alternatively you can see just the essential environment
-# variables by passing --print. This can by used within
-# a script using:
-# eval `./webports-env.sh --print`
-
-
-if [ -z "${NACL_SDK_ROOT:-}" ]; then
- echo "-------------------------------------------------------------------"
- echo "NACL_SDK_ROOT is unset."
- echo "This environment variable needs to be pointed at some version of"
- echo "the Native Client SDK (the directory containing toolchain/)."
- echo "NOTE: set this to an absolute path."
- echo "-------------------------------------------------------------------"
- exit -1
-fi
-
-# Pick platform directory for compiler.
-OS_NAME=$(uname -s)
-if [ ${OS_NAME} = "Darwin" ]; then
- readonly OS_SUBDIR="mac"
-elif [ ${OS_NAME} = "Linux" ]; then
- readonly OS_SUBDIR="linux"
-else
- readonly OS_SUBDIR="win"
- if [ $(uname -o) = "Cygwin" ]; then
- OS_NAME="Cygwin"
- fi
-fi
-
-if [ ${OS_NAME} = "Cygwin" ]; then
- NACL_SDK_ROOT=$(cygpath ${NACL_SDK_ROOT})
- if [ -z "${CYGWIN:-}" ]; then
- export CYGWIN=nodosfilewarning
- fi
-fi
-
-HOST_IS_32BIT=0
-if [ "$(uname -m)" = "i686" ]; then
- HOST_IS_32BIT=1
-fi
-
-if [ "${TOOLCHAIN}" = "pnacl" ]; then
- DEFAULT_ARCH=pnacl
-elif [ "${TOOLCHAIN}" = "emscripten" ]; then
- DEFAULT_ARCH=emscripten
-else
- if [ "${HOST_IS_32BIT}" = "1" ]; then
- DEFAULT_ARCH=i686
- else
- DEFAULT_ARCH=x86_64
- fi
-fi
-
-# Default value for NACL_ARCH
-NACL_ARCH=${NACL_ARCH:-${DEFAULT_ARCH}}
-
-# Default Value for TOOLCHAIN
-TOOLCHAIN=${TOOLCHAIN:-pnacl}
-
-# Check NACL_ARCH
-if [ ${NACL_ARCH} != "i686" -a ${NACL_ARCH} != "x86_64" -a \
- ${NACL_ARCH} != "arm" -a ${NACL_ARCH} != "pnacl" -a \
- ${NACL_ARCH} != "emscripten" ]; then
- echo "Unknown value for NACL_ARCH: '${NACL_ARCH}'" 1>&2
- exit -1
-fi
-
-# Check TOOLCHAIN
-if [ ${TOOLCHAIN} != "pnacl" -a ${TOOLCHAIN} != "glibc" -a \
- ${TOOLCHAIN} != "clang-newlib" -a ${TOOLCHAIN} != "emscripten" ]; then
- echo "Unknown value for TOOLCHAIN: '${TOOLCHAIN}'" 1>&2
- exit -1
-fi
-
-if [ "${NACL_ARCH}" = "emscripten" -a -z "${EMSCRIPTEN:-}" ]; then
- echo "-------------------------------------------------------------------"
- echo "EMSCRIPTEN is unset."
- echo "This environment variable needs to be pointed at some version of"
- echo "the emscripten repository."
- echo "NOTE: set this to an absolute path."
- echo "-------------------------------------------------------------------"
- exit -1
-fi
-
-if [ "${TOOLCHAIN}" = "pnacl" ]; then
- if [ "${NACL_ARCH}" != "pnacl" ]; then
- echo "PNaCl does not support the selected architecture: ${NACL_ARCH}" 1>&2
- exit -1
- fi
-fi
-
-if [ "${TOOLCHAIN}" = "glibc" ]; then
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- echo "PNaCl is not supported by the glibc toolchain" 1>&2
- exit -1
- fi
- NACL_LIBC=glibc
-elif [ "${TOOLCHAIN}" = "emscripten" ]; then
- if [ "${NACL_ARCH}" != "emscripten" ]; then
- echo "emscripten does not support this architecture: ${NACL_ARCH}" 1>&2
- exit -1
- fi
- NACL_LIBC=emscripten
-else
- NACL_LIBC=newlib
-fi
-
-# In some places i686 is also known as x86_32 so we use
-# second variable to store this alternate architecture
-# name
-if [ "${NACL_ARCH}" = "i686" ]; then
- export NACL_ARCH_ALT=x86_32
-else
- export NACL_ARCH_ALT=${NACL_ARCH}
-fi
-
-# NACL_CROSS_PREFIX is the prefix of the executables in the
-# toolchain's "bin" directory. For example: i686-nacl-<toolname>.
-if [ ${NACL_ARCH} = "pnacl" ]; then
- NACL_CROSS_PREFIX=pnacl
-elif [ ${NACL_ARCH} = "emscripten" ]; then
- NACL_CROSS_PREFIX=emscripten
-else
- NACL_CROSS_PREFIX=${NACL_ARCH}-nacl
-fi
-
-export NACL_LIBC
-export NACL_ARCH
-export NACL_CROSS_PREFIX
-
-InitializeNaClGccToolchain() {
- if [ ${NACL_ARCH} = "arm" ]; then
- local TOOLCHAIN_ARCH="arm"
- else
- local TOOLCHAIN_ARCH="x86"
- fi
-
- local TOOLCHAIN_DIR=${OS_SUBDIR}_${TOOLCHAIN_ARCH}_${NACL_LIBC}
- readonly NACL_TOOLCHAIN_ROOT=${NACL_SDK_ROOT}/toolchain/${TOOLCHAIN_DIR}
- readonly NACL_BIN_PATH=${NACL_TOOLCHAIN_ROOT}/bin
-
- if [ ! -d "${NACL_TOOLCHAIN_ROOT}" ]; then
- echo "Toolchain not found: ${NACL_TOOLCHAIN_ROOT}"
- exit -1
- fi
-
- NACLCC=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-gcc
- NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-g++
- NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar
- NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib
- NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld
- NACLREADELF=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-readelf
- NACLSTRINGS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings
- NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip
- NACLOBJDUMP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-objdump
- NACL_EXEEXT=".nexe"
-
- if [ ${NACL_ARCH} = "arm" ]; then
- local NACL_LIBDIR=arm-nacl/lib
- elif [ ${NACL_ARCH} = "x86_64" ]; then
- local NACL_LIBDIR=x86_64-nacl/lib64
- else
- local NACL_LIBDIR=x86_64-nacl/lib32
- fi
-
- readonly NACL_SDK_LIB=${NACL_TOOLCHAIN_ROOT}/${NACL_LIBDIR}
-
- # There are a few .la files that ship with the SDK that
- # contain hardcoded paths that point to the build location
- # on the machine where the SDK itself was built.
- # TODO(sbc): remove this hack once these files are removed from the
- # SDK or fixed.
- LA_FILES=$(echo ${NACL_SDK_LIB}/*.la)
- if [ "${LA_FILES}" != "${NACL_SDK_LIB}/*.la" ]; then
- for LA_FILE in ${LA_FILES}; do
- mv ${LA_FILE} ${LA_FILE}.old
- done
- fi
-
- NACL_SDK_LIBDIR="${NACL_SDK_ROOT}/lib/${NACL_LIBC}_${NACL_ARCH_ALT}"
-}
-
-InitializeEmscriptenToolchain() {
- local EM_ROOT=${EMSCRIPTEN}
-
- readonly NACL_TOOLCHAIN_ROOT=${EM_ROOT}
- readonly NACL_BIN_PATH=${EM_ROOT}
-
- NACLCC=${EM_ROOT}/emcc
- NACLCXX=${EM_ROOT}/em++
- NACLAR=${EM_ROOT}/emar
- NACLRANLIB=${EM_ROOT}/emranlib
- NACLLD=${EM_ROOT}/em++
- NACLREADELF=/bin/true
- NACLSTRINGS=/bin/true
- NACLSTRIP=/bin/true
- NACL_EXEEXT=".js"
-
- NACL_SDK_LIBDIR="${NACL_SDK_ROOT}/lib/${TOOLCHAIN}"
-}
-
-InitializePNaClToolchain() {
- local TC_ROOT=${NACL_SDK_ROOT}/toolchain/${OS_SUBDIR}_pnacl
-
- readonly NACL_TOOLCHAIN_ROOT=${TC_ROOT}
- readonly NACL_BIN_PATH=${NACL_TOOLCHAIN_ROOT}/bin
-
- NACLCC=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-clang
- NACLCXX=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-clang++
- NACLAR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ar
- NACLRANLIB=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ranlib
- NACLREADELF=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-readelf
- NACLLD=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-ld
-
- if [ "$TOOLCHAIN" = "clang-newlib" ]; then
- NACLSTRINGS=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strings
- NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip
- NACL_EXEEXT=".nexe"
- NACL_SDK_LIBDIR="${NACL_SDK_ROOT}/lib/${TOOLCHAIN}_${NACL_ARCH_ALT}"
-
- if [ ${NACL_ARCH} = "arm" ]; then
- local NACL_LIBDIR=arm-nacl/lib
- elif [ ${NACL_ARCH} = "x86_64" ]; then
- local NACL_LIBDIR=x86_64-nacl/lib64
- else
- local NACL_LIBDIR=x86_64-nacl/lib32
- fi
- else
- # TODO(sbc): figure our why we do not have a pnacl-strings
- #NACLSTRINGS=${NACL_BIN_PATH}/pnacl-strings
- # until then use the host's strings tool
- # (used only by the cairo package)
- NACLSTRINGS="$(which strings)"
- NACLSTRIP=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-strip
- NACL_EXEEXT=".pexe"
-
- # pnacl's translator
- TRANSLATOR=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-translate
- PNACLFINALIZE=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-finalize
- # pnacl's pexe optimizer
- PNACL_OPT=${NACL_BIN_PATH}/${NACL_CROSS_PREFIX}-opt
-
- NACL_SDK_LIBDIR="${NACL_SDK_ROOT}/lib/${TOOLCHAIN}"
- local NACL_LIBDIR=le32-nacl/lib
- fi
-
- readonly NACL_SDK_LIB=${NACL_TOOLCHAIN_ROOT}/${NACL_LIBDIR}
-}
-
-NaClEnvExport() {
- export EXEEXT=${NACL_EXEEXT}
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- export AR=${NACLAR}
- export RANLIB=${NACLRANLIB}
- export STRIP=${NACLSTRIP}
- export PKG_CONFIG_PATH=${NACL_PREFIX}/lib/pkgconfig
- export PKG_CONFIG_LIBDIR=${NACL_PREFIX}/lib/pkgconfig
- export PATH=${NACL_PREFIX}/bin:${PATH}:${NACL_BIN_PATH}
- export CPPFLAGS=${NACL_CPPFLAGS}
- export ARFLAGS=${NACL_ARFLAGS}
- export LDFLAGS=${NACL_LDFLAGS}
-}
-
-if [ "${TOOLCHAIN}" = "pnacl" -o "${TOOLCHAIN}" = "clang-newlib" ]; then
- InitializePNaClToolchain
-elif [ "${TOOLCHAIN}" = "emscripten" ]; then
- InitializeEmscriptenToolchain
-else
- InitializeNaClGccToolchain
-fi
-
-NACL_SDK_VERSION=$(${NACL_SDK_ROOT}/tools/getos.py --sdk-version)
-
-# As of version 33 the PNaCl C++ standard library is LLVM's libc++,
-# others use GCC's libstdc++.
-if [ "${TOOLCHAIN}" = "pnacl" -o "${TOOLCHAIN}" = "clang-newlib" ]; then
- export NACL_CXX_LIB="c++"
-else
- export NACL_CXX_LIB="stdc++"
-fi
-
-if [ "${NACL_DEBUG:-}" = "1" ]; then
- NACL_SDK_LIBDIR+="/Debug"
-else
- NACL_SDK_LIBDIR+="/Release"
-fi
-
-NACL_ARFLAGS="cr"
-NACL_CPPFLAGS=""
-NACL_LDFLAGS=""
-
-if [[ $TOOLCHAIN != emscripten ]]; then
- NACL_LDFLAGS+=" -L${NACL_SDK_LIBDIR}"
- NACL_CPPFLAGS+=" -I${NACL_SDK_ROOT}/include"
-
- if [[ ${TOOLCHAIN} == glibc ]]; then
- NACL_LDFLAGS+=" -Wl,-rpath-link=${NACL_SDK_LIBDIR}"
- fi
-fi
-
-if [ "${NACL_ARCH}" = "pnacl" ]; then
- readonly NACL_PREFIX=${NACL_TOOLCHAIN_ROOT}/le32-nacl/usr
-elif [ "${NACL_ARCH}" = "emscripten" ]; then
- readonly NACL_PREFIX=${NACL_TOOLCHAIN_ROOT}/system/local
-else
- readonly NACL_PREFIX=${NACL_TOOLCHAIN_ROOT}/${NACL_CROSS_PREFIX}/usr
-fi
-
-if [ -z "${WEBPORTS_ENV_IMPORT:-}" ]; then
- if [ $# -gt 0 ]; then
- if [ "$1" = '--print' ]; then
- echo "export EXEEXT=${NACL_EXEEXT}"
- echo "export CC=${NACLCC}"
- echo "export CXX=${NACLCXX}"
- echo "export AR=${NACLAR}"
- echo "export RANLIB=${NACLRANLIB}"
- echo "export STRIP=${NACLSTRIP}"
- echo "export PKG_CONFIG_PATH=${NACL_PREFIX}/lib/pkgconfig"
- echo "export PKG_CONFIG_LIBDIR=${NACL_PREFIX}/lib/pkgconfig"
- echo "export PATH=${NACL_PREFIX}/bin:\${PATH}:${NACL_BIN_PATH}"
- echo "export CPPFLAGS=\"${NACL_CPPFLAGS}\""
- echo "export ARFLAGS=\"${NACL_ARFLAGS}\""
- echo "export LDFLAGS=\"${NACL_LDFLAGS}\""
- else
- NaClEnvExport
- exec "$@"
- fi
- fi
-fi
diff --git a/build_tools/webports-make.sh b/build_tools/webports-make.sh
deleted file mode 100755
index 40c3fa2..0000000
--- a/build_tools/webports-make.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-SCRIPT_DIR=$(dirname "$BASH_SOURCE")
-
-WEBPORTS_ENV_IMPORT=1
-. "$SCRIPT_DIR/webports-env.sh"
-NaClEnvExport
-
-exec make DESTDIR=$NACL_PREFIX "$@"
diff --git a/chrome_test/__init__.py b/chrome_test/__init__.py
deleted file mode 100644
index a28f814..0000000
--- a/chrome_test/__init__.py
+++ /dev/null
@@ -1,518 +0,0 @@
-# Copyright (c) 2014 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.
-"""Test harness for testing chrome apps / extensions."""
-
-import argparse
-import cStringIO
-import contextlib
-import hashlib
-import logging
-import os
-import shutil
-import subprocess
-import sys
-import tempfile
-import threading
-import urllib
-import urllib2
-import urlparse
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-SRC_DIR = os.path.dirname(SCRIPT_DIR)
-sys.path.insert(0, os.path.join(SRC_DIR, 'build_tools'))
-sys.path.insert(0, os.path.join(SRC_DIR, 'lib'))
-
-import httpd
-import download_chrome
-
-# Pinned chrome revision. Update this to pull in a new chrome.
-# Try to select a version that exists on all platforms.
-CHROME_REVISION = '344999'
-
-TESTING_LIB = os.path.join(SCRIPT_DIR, 'chrome_test.js')
-TESTING_EXTENSION = os.path.join(SCRIPT_DIR, 'extension')
-TESTING_TCP_APP = os.path.join(SCRIPT_DIR, 'tcpapp')
-
-RETURNCODE_KILL = -9
-
-LOG_LEVEL_MAP = {
- 'ERROR': logging.ERROR,
- 'WARNING': logging.WARNING,
- 'INFO': logging.INFO,
- 'DEBUG': logging.DEBUG,
-}
-
-
-def ChromeRunPath(chrome_dir, arch):
- """Get the path to the chrome exectuable.
-
- Args:
- chrome_dir: Root directory of chrome installation
- arch: Chrome architecture to select i686/x86_64.
- Returns:
- Path to the chrome executable.
- """
- if sys.platform == 'win32':
- path = 'chrome.exe'
- elif sys.platform == 'darwin':
- path = 'Chromium.app/Contents/MacOS/Chromium'
- elif sys.platform.startswith('linux'):
- path = 'chrome-wrapper'
- else:
- logging.error('Unknown platform: %s' % sys.platform)
- sys.exit(1)
- return os.path.join(chrome_dir, path)
-
-
-
-def KillSubprocessAndChildren(proc):
- """Kill a subprocess and all children.
-
- While this is trivial on Posix platforms, on Windows this requires some
- method for walking the process tree. Relying on this functionality in
- the taskkill.exe utility for now.
-
- Args:
- proc: A subprocess.Popen process.
- """
- if sys.platform == 'win32':
- # Do subprocess call as the process may terminate before we manage
- # to invoke taskkill.
- subprocess.call(
- [os.path.join(os.environ['SYSTEMROOT'], 'System32', 'taskkill.exe'),
- '/F', '/T', '/PID', str(proc.pid)])
- else:
- # Send SIGKILL=9 to the entire process group associated with the child.
- os.kill(-proc.pid, 9)
-
-
-def CommunicateWithTimeout(proc, timeout):
- """Wait for a subprocess.Popen to end, capturing output, with a timeout.
-
- Args:
- proc: A subprocess.Popen.
- timeout: A timeout in seconds.
- Returns:
- (stdout, stderr, returncode).
- """
- if timeout == 0:
- timeout = None
-
- result = []
-
- def Target():
- result.append(list(proc.communicate()))
-
- thread = threading.Thread(target=Target)
- thread.start()
- try:
- thread.join(timeout)
- if thread.is_alive():
- logging.error('Attempting to kill test due to timeout of %.1f seconds!' %
- timeout)
- # This will kill the process which should force communicate to return with
- # any partial output.
- KillSubprocessAndChildren(proc)
- # Thus result should ALWAYS contain something after this join.
- thread.join()
- logging.error('Killed test due to timeout of %.1f seconds!' % timeout)
- # Also append to stderr (or stdout).
- msg = '\n\nKilled test due to timeout of %.1f seconds!\n' % timeout
- if result[0][1] is not None:
- result[0][1] += msg
- else:
- result[0][0] += msg
- returncode = RETURNCODE_KILL
- else:
- returncode = proc.returncode
- finally:
- # In case something else goes wrong, be sure to bring down the child.
- if thread.is_alive():
- KillSubprocessAndChildren(proc)
- assert len(result) == 1
- return tuple(result[0]) + (returncode,)
-
-
-class ChromeTestServer(httpd.QuittableHTTPServer):
- """An HTTP server that keeps a count of test results."""
-
- def __init__(self, server_address, handler):
- self.tests = set()
- self.test_results = 0
- self.result = 0
- self.failed_tests = set()
- self.last_test = None
- self.expected_test_count = None
- self.roots = []
- self.filter_string = '*'
- httpd.QuittableHTTPServer.__init__(self, server_address, handler)
-
- def AddRoot(self, path):
- self.roots.append(os.path.abspath(path))
-
- def SetFilterString(self, filter_string):
- self.filter_string = filter_string
-
-
-class ChromeTestHandler(httpd.QuittableHTTPHandler):
- """An HTTP request handler that gathers test results."""
-
- def SendEmptyReply(self):
- self.send_response(200, 'OK')
- self.send_header('Content-type', 'text/html')
- self.send_header('Content-length', '0')
- self.end_headers()
-
- def translate_path(self, path):
- cwd = os.getcwd()
- tpath = httpd.QuittableHTTPHandler.translate_path(self, path)
- rpath = os.path.relpath(tpath, cwd)
- hit = []
- for root in self.server.roots:
- npath = os.path.join(root, rpath)
- if os.path.exists(npath):
- hit.append(npath)
- if len(hit) == 0:
- # Use first root if there is not match, to allow usual favicon.ico
- # handling.
- return os.path.join(self.server.roots[0], rpath)
- if len(hit) > 1:
- raise Exception('Duplicate resource at path: %s' % rpath)
- return hit[0]
-
- def do_GET(self):
- parts = self.path.rsplit('?')
- # Provide a js test library at a fixed location.
- if parts[0] == '/_chrome_test.js':
- test_lib = open(TESTING_LIB).read()
- self.send_response(200, 'OK')
- self.send_header('Content-type', 'text/html')
- self.send_header('Content-length', str(len(test_lib)))
- self.end_headers()
- self.wfile.write(test_lib)
- return
- # Check for a set of special command from the running tests.
- if len(parts) == 2 and parts[0] == '/_command':
- params = urlparse.parse_qs(parts[1])
- # Allow the tests to send out log messages.
- if ('log' in params and len(params['log']) == 1 and
- 'level' in params and len(params['level']) == 1):
- level = LOG_LEVEL_MAP.get(params['level'][0], logging.ERROR)
- message = params['log'][0]
- if message[-1] == '\n':
- message = message[:-1]
- logging.log(level, message)
- self.SendEmptyReply()
- return
- # Allow the tests to request the current test filter string.
- elif ('filter' in params and len(params['filter']) == 1 and
- params['filter'][0] == '1'):
- self.send_response(200, 'OK')
- self.send_header('Content-type', 'text/html')
- self.send_header('Content-length', str(len(self.server.filter_string)))
- self.end_headers()
- self.wfile.write(self.server.filter_string)
- return
- # Allow the tests to declare their name on start.
- elif ('start' in params and len(params['start']) == 1 and
- params['start'][0] == '1' and
- 'name' in params and len(params['name']) == 1):
- name = params['name'][0]
- if name in self.server.tests:
- result = 1
- print '[ DUP!!! ] Duplicate test: %s' % name
- else:
- self.server.tests.add(name)
- print '[ RUN ] %s' % name
- self.server.last_test = name
- self.SendEmptyReply()
- return
- # Allow the tests to post (pass/fail) results.
- elif ('result' in params and len(params['result']) == 1 and
- 'name' in params and len(params['name']) == 1 and
- 'duration' in params and len(params['duration']) == 1):
- name = params['name'][0]
- result = params['result'][0]
- duration = params['duration'][0]
- if self.server.last_test != name:
- self.server.result = 1
- print '[ ERR!!! ] Return from unexpected test: %s' % name
- if result == '1':
- print '[ OK ] %s (%s)' % (name, duration)
- else:
- self.server.result = 1
- self.server.failed_tests.add(name)
- print '[ FAILED ] %s (%s)' % (name, duration)
- self.server.last_test = None
- self.server.test_results += 1
- self.SendEmptyReply()
- return
- # Allow the test set to announce the number of tests it will run.
- elif 'test_count' in params and len(params['test_count']) == 1:
- assert self.server.expected_test_count is None
- self.server.expected_test_count = int(params['test_count'][0])
- self.SendEmptyReply()
- return
- # Fall back to a providing normal HTTP access.
- httpd.QuittableHTTPHandler.do_GET(self)
-
- def log_message(self, fmt, *args):
- if logging.getLogger().isEnabledFor(logging.DEBUG):
- httpd.QuittableHTTPHandler.log_message(self, fmt, *args)
-
-
-def Hex2Alpha(ch):
- """Convert a hexadecimal digit from 0-9 / a-f to a-p.
-
- Args:
- ch: a character in 0-9 / a-f.
- Returns:
- A character in a-p.
- """
- if ch >= '0' and ch <= '9':
- return chr(ord(ch) - ord('0') + ord('a'))
- else:
- return chr(ord(ch) + 10)
-
-
-def ChromeAppIdFromPath(path):
- """Converts a path to the corresponding chrome app id.
-
- A stable but semi-undocumented property of unpacked chrome extensions is
- that they are assigned an app-id based on the first 32 characters of the
- sha256 digest of the absolute symlink expanded path of the extension.
- Instead of hexadecimal digits, characters a-p.
- From discussion with webstore team + inspection of extensions code.
- Args:
- path: Path to an unpacked extension.
- Returns:
- A 32 character chrome extension app id.
- """
- hasher = hashlib.sha256(os.path.realpath(path))
- hexhash = hasher.hexdigest()[:32]
- return ''.join([Hex2Alpha(ch) for ch in hexhash])
-
-
-def RunChrome(chrome_path, timeout, filter_string, roots, use_xvfb,
- unlimited_storage, enable_nacl, enable_nacl_debug,
- load_extensions, load_apps, start_path):
- """Run Chrome with a timeout and several options.
-
- Args:
- chrome_path: Path to the chrome executable.
- timeout: Timeout in seconds.
- filter_string: Filter string to select which tests to run.
- roots: Directories to serve test from.
- use_xvfb: Boolean indicating if xvfb should be used.
- unlimited_storage: Boolean indicating if chrome should be run with
- unlimited storage.
- enable_nacl: Boolean indicating that NaCl should be enabled on regular
- pages.
- enable_nacl_debug: Boolean indicating that NaCl debugging should be
- enabled.
- load_extensions: A list of unpacked extensions paths to load on start.
- load_apps: A list of unpacked apps to load on start.
- start_path: The path relative to the current directory to point the browser
- at on startup.
- """
- # Ensure all extension / app paths are absolute.
- load_extensions = [os.path.abspath(os.path.expanduser(i))
- for i in load_extensions]
- load_apps = [os.path.abspath(os.path.expanduser(i)) for i in load_apps]
-
- # Add in the chrome_test extension and compute its id.
- load_extensions += [TESTING_EXTENSION, TESTING_TCP_APP]
- testing_id = ChromeAppIdFromPath(TESTING_EXTENSION)
-
- s = ChromeTestServer(('', 0), ChromeTestHandler)
- for root in roots:
- s.AddRoot(root)
- s.SetFilterString(filter_string)
-
- def Target():
- s.serve_forever(poll_interval=0.1)
-
- base_url = 'http://%s:%d' % (s.server_address[0], s.server_address[1])
- quit_url = '%s/?quit=1' % base_url
- start_url = '%s/%s' % (base_url, start_path)
-
- logging.info('Started web server at %s' % base_url)
-
- returncode = RETURNCODE_KILL
- try:
- work_dir = tempfile.mkdtemp(prefix='chrome_test_', suffix='.tmp')
- work_dir = os.path.abspath(work_dir)
- logging.info('Created work area in %s' % work_dir)
- try:
- thread = threading.Thread(target=Target)
- thread.start()
-
- cmd = []
- if sys.platform.startswith('linux') and use_xvfb:
- cmd += ['xvfb-run', '--auto-servernum', '-s',
- '-screen 0 1024x768x24 -ac']
- cmd += [chrome_path]
- cmd += ['--user-data-dir=' + work_dir]
- # We want to pin the pnacl component to the one that we downloaded.
- # This allows us to test features of the pnacl translator that are
- # not yet in the public component.
- cmd += ['--disable-component-update']
- # Pass testing extension id in user agent to make it widely available.
- # TODO(bradnelson): Drop this when hterm is fixed.
- # Hterm currently expects "Chrome/[0-9][0-9]" in the User Agent and
- # faults without it. Using "Chrome/34" so that it goes down one of the
- # more sensible of its version based code paths.
- cmd += ['--user-agent=ChromeTestAgent/' + testing_id + ' Chrome/34']
- if unlimited_storage:
- cmd += ['--unlimited-storage']
- if enable_nacl:
- cmd += ['--enable-nacl']
- if enable_nacl_debug:
- cmd += ['--enable-nacl-debug']
- if len(load_extensions) != 0:
- cmd += ['--load-extension=' + ','.join(load_extensions)]
- if len(load_apps) != 0:
- cmd += ['--load-and-launch-app=' + ','.join(load_apps)]
- cmd += [start_url]
-
- def ProcessGroup():
- if sys.platform != 'win32':
- # On non-windows platforms, start a new process group so that we can
- # be certain we bring down Chrome on a timeout.
- os.setpgid(0, 0)
-
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT, preexec_fn=ProcessGroup)
- logging.info('Started chrome with command line: %s' % (' '.join(cmd)))
- stdout, _, returncode = CommunicateWithTimeout(p, timeout=timeout)
- if logging.getLogger().isEnabledFor(logging.DEBUG):
- sys.stdout.write('\n[[[ STDOUT ]]]\n')
- sys.stdout.write('-' * 70 + '\n')
- sys.stdout.write(stdout)
- sys.stdout.write('\n' + '-' * 70 + '\n')
- logging.info('Chrome exited with return code %d' % returncode)
- finally:
- try:
- with contextlib.closing(urllib2.urlopen(quit_url)) as stream:
- stream.read()
- except Exception:
- pass
- thread.join()
- logging.info('Shutdown web server.')
- finally:
- shutil.rmtree(work_dir)
- logging.info('Removed %s' % work_dir)
- logging.info('Done.')
-
- if returncode == RETURNCODE_KILL:
- print '[ TIMEOUT ] Timed out, ran %d tests, %d failed.' % (
- len(s.tests), len(s.failed_tests)
- )
- sys.exit(1)
- elif s.expected_test_count is None:
- print('[ XXXXXXXX ] Expected test count never emitted.')
- sys.exit(1)
- elif s.test_results != s.expected_test_count:
- print('[ XXXXXXXX ] '
- 'Expected %d tests, but only %d had results, with %d failures.' % (
- s.expected_test_count, s.test_results, len(s.failed_tests)
- ))
- sys.exit(1)
- elif s.result != 0:
- print '[ Failures ] Ran %d tests, %d failed.' % (len(s.tests),
- len(s.failed_tests))
- sys.exit(1)
- else:
- print '[ Success! ] Ran %d tests.' % len(s.tests)
-
-
-def Main(argv):
- """Main method to invoke in test harness programs.
- Args:
- argv: Command line options controlling what to run.
- See --help.
- NOTE: Ends the process with sys.exit(1) on failure.
- """
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('start_path', metavar='START_PATH',
- help='location in which to run tests')
- parser.add_argument('-x', '--xvfb', action='store_true',
- help='Run Chrome thru xvfb on Linux.')
- parser.add_argument('-a', '--arch', default='x86_64',
- choices=['x86_64', 'i686'],
- help='Chrome architecture.')
- parser.add_argument('-v', '--verbose', default=0, action='count',
- help='Emit verbose output, use twice for more.')
- parser.add_argument('-t', '--timeout', default=30, type=float,
- help='Timeout for all tests (in seconds).')
- parser.add_argument('-C', '--chdir', default=[], action='append',
- help='Add a root directory.')
- parser.add_argument('--load-extension', default=[], action='append',
- help='Add an extension to load on start.')
- parser.add_argument('--load-and-launch-app', default=[], action='append',
- help='Add an app to load on start.')
- parser.add_argument('--unlimited-storage', default=False, action='store_true',
- help='Allow unlimited storage.')
- parser.add_argument('--enable-nacl', default=False, action='store_true',
- help='Enable NaCl generally.')
- parser.add_argument('--enable-nacl-debug', default=False, action='store_true',
- help='Enable NaCl debugging.')
- parser.add_argument('-f', '--filter', default='*', help='Filter on tests.')
- parser.add_argument(
- '-p', '--param', default=[], action='append',
- help='Add a parameter to the end of the url, = separated.')
- options = parser.parse_args(argv)
-
- if options.param:
- params = {}
- params['SYS_ARCH'] = options.arch
- for param in options.param:
- key, value = param.split('=', 1)
- params[key] = value
- options.start_path += '?' + urllib.urlencode(params)
-
- if options.verbose > 1:
- logging.getLogger().setLevel(logging.DEBUG)
- elif options.verbose > 0:
- logging.getLogger().setLevel(logging.INFO)
- else:
- logging.getLogger().setLevel(logging.WARNING)
- logging.basicConfig(format='%(asctime)-15s %(levelname)s: %(message)s',
- datefmt='%Y-%m-%d %H:%M:%S')
- if not options.chdir:
- options.chdir.append('.')
-
- if sys.platform.startswith('linux'):
- default_sandbox_locations = [
- '/usr/local/sbin/chrome-devel-sandbox',
- '/opt/chromium/chrome_sandbox',
- '/opt/google/chrome-beta/chrome-sandbox'
- ]
- if 'CHROME_DEVEL_SANDBOX' not in os.environ:
- for filename in default_sandbox_locations:
- if os.path.exists(filename):
- os.environ['CHROME_DEVEL_SANDBOX'] = filename
- break
- else:
- logging.error('chrome_test on linux requires CHROME_DEVEL_SANDBOX')
- sys.exit(1)
- if not os.path.exists(os.environ['CHROME_DEVEL_SANDBOX']):
- logging.error('chrome sandbox specified by CHROME_DEVEL_SANDBOX is '
- 'missing: %s' % os.environ['CHROME_DEVEL_SANDBOX'])
- sys.exit(1)
-
- chrome_dir = download_chrome.DownloadChrome(options.arch, CHROME_REVISION)
- RunChrome(
- chrome_path=ChromeRunPath(chrome_dir, options.arch),
- timeout=options.timeout,
- filter_string=options.filter,
- roots=options.chdir,
- use_xvfb=options.xvfb,
- unlimited_storage=options.unlimited_storage,
- enable_nacl=options.enable_nacl,
- enable_nacl_debug=options.enable_nacl_debug,
- load_extensions=options.load_extension,
- load_apps=options.load_and_launch_app,
- start_path=options.start_path)
- sys.exit(0)
diff --git a/chrome_test/chrome_test.js b/chrome_test/chrome_test.js
deleted file mode 100644
index 06fbd9a..0000000
--- a/chrome_test/chrome_test.js
+++ /dev/null
@@ -1,855 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-// Utilities to allow googletest style tests of apps / extensions.
-
-
-/**
- * @namespace.
- */
-var chrometest = {};
-
-/**
- * @private
- */
-chrometest.passed_ = null;
-chrometest.currentTest_ = null;
-chrometest.currentTestName_ = null;
-chrometest.startTime_ = null;
-chrometest.finishTest_ = null;
-chrometest.tests_ = [];
-
-/**
- * @private
- * @constant
- */
-chrometest.ERROR = 'ERROR';
-chrometest.WARNING = 'WARNING';
-chrometest.INFO = 'INFO';
-chrometest.DEBUG = 'DEBUG';
-
-
-/**
- * Get the decoded query parameters passed to the current page.
- * @return {Object.<string>}.
- */
-chrometest.getUrlParameters = function() {
- var items = {};
- if (window.location.search.length < 1) {
- return items;
- }
- var fields = window.location.search.slice(1).split('&');
- for (var i = 0; i < fields.length; i++) {
- var parts = fields[i].split('=');
- items[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);
- }
- return items;
-};
-
-/**
- * Create a new messaging port to communicate with the testing extension.
- * @return {PortWaiter} A new Port to the testing extension wrapped with
- * PortWaiter.
- */
-chrometest.newTestPort = function() {
- // Pull the id out of: 'ChromeUserAgent/<ID> Chrome/<Ver>'
- var extensionId = navigator.userAgent.split(' ')[0].split('/')[1];
- return new chrometest.PortWaiter(chrome.runtime.connect(extensionId));
-};
-
-/**
- * Kill the browser (to end the testing session).
- * @return {Promise} A promise to halt (which will never be resolved because
- * the browser will be halted by then).
- */
-chrometest.haltBrowser = function() {
- var port = chrometest.newTestPort();
- port.postMessage({'name': 'haltBrowser'});
- // Wait for a reply that will never come.
- return port.wait();
-};
-
-/**
- * Reset the connection in the testing extension.
- * @returns {Promise.integer} A promise for the number of connections killed.
- */
-chrometest.resetExtension = function() {
- var port = chrometest.newTestPort();
- var count = null;
- port.postMessage({'name': 'reset'});
- return port.wait().then(function(msg) {
- ASSERT_EQ('resetReply', msg.name);
- port.disconnect();
- return msg.count;
- });
-};
-
-/**
- * Get a list of all loaded extensions.
- *
- * This exposes the result of chrome.management.getAll for use by tests.
- * @returns {Promise.Array.<ExtensionInfo>}.
- */
-chrometest.getAllExtensions = function() {
- var port = chrometest.newTestPort();
- port.postMessage({'name': 'getAllExtensions'});
- return port.wait().then(function(msg) {
- ASSERT_EQ('getAllExtensionsResult', msg.name);
- port.disconnect();
- return msg.result;
- });
-};
-
-/**
- * Get a mapping of process id to process info for all processes running.
- *
- * This exposes the result of chrome.processes.getProcessInfo for use by tests.
- * @return {Promise.Object.<ProcessInfo>}.
- */
-chrometest.getAllProcesses = function() {
- var port = chrometest.newTestPort();
- port.postMessage({'name': 'getAllProcesses'});
- return port.wait().then(function(msg) {
- ASSERT_EQ('getAllProcessesResult', msg.name);
- port.disconnect();
- return msg.result;
- });
-};
-
-/**
- * Create a messaging port to communicate with an extension by name.
- *
- * Ordinarily web pages can only communicate with extensions that have
- * explicitly ask for permission in their manifests. However, extensions can
- * communicate with each other without this, but should endeavor to verify that
- * they only communicate with trusted peers. The testing extension should be
- * whitelisted by the extensions under test when in testing mode. This allows
- * the testing extension to offer web pages proxied access to extensions under
- * test without modification.
- * @returns {Promise.PortWaiter} A promise for a PortWaiter to communicate with
- * the extension on.
- */
-chrometest.proxyExtension = function(extensionName) {
- var port = chrometest.newTestPort();
- port.postMessage({'name': 'proxy', 'extension': extensionName});
- return port.wait().then(function(msg) {
- ASSERT_EQ('proxyReply', msg.name, 'expect proxy reply');
- ASSERT_TRUE(
- msg.success, 'should find one extension: ' + extensionName +
- ' found ' + msg.matchCount);
- return port;
- });
-};
-
-/**
- * Get an URL that references the test harness.
- * @param {string} path The relative path to a resource hosted by the harness.
- * @return {string} The absolute URL.
- */
-chrometest.harnessURL = function(path) {
- var baseURL = location.href.split('/').slice(0, -1).join('/');
- return baseURL + '/' + path;
-};
-
-/**
- * Log a message to the test harness.
- * @param {string} level The python logging level of the message.
- * @param {string} message The message to log.
- * @return {Promise} A promise to log it (or rejects with error code).
- */
-chrometest.log = function(level, message) {
- // Cap the log line limit.
- var logLimit = 1024;
- var rest = message.substr(logLimit);
- message = message.substr(0, logLimit);
- console.log(level + ': ' + message);
- return chrometest.httpGet(
- '/_command?log=' + encodeURIComponent(message) +
- '&level=' + encodeURIComponent(level)).then(function(result) {
- if (rest.length > 0) {
- // Log the rest if any.
- chrometest.log(level, rest);
- }
- });
-};
-
-/**
- * Log an error message.
- * @param {string} message The message to log.
- * @return {Promise} A promise to do it.
- */
-chrometest.error = function(message) {
- return chrometest.log(chrometest.ERROR, message);
-};
-
-/**
- * Log a warning message.
- * @param {string} message The message to log.
- * @return {Promise} A promise to do it.
- */
-chrometest.warning = function(message) {
- return chrometest.log(chrometest.WARNING, message);
-};
-
-/**
- * Log an info message.
- * @param {string} message The message to log.
- * @return {Promise} A promise to do it.
- */
-chrometest.info = function(message) {
- return chrometest.log(chrometest.INFO, message);
-};
-
-/**
- * Log a debug message.
- * @param {string} message The message to log.
- * @return {Promise} A promise to do it.
- */
-chrometest.debug = function(message) {
- return chrometest.log(chrometest.DEBUG, message);
-};
-
-/**
- * Perform an HTTP GET.
- * @param {string} url The URL to fetch.
- * @return {Promise.string,integer} A promise for the text at the url on
- * resolve or an integer with the error code on reject.
- */
-chrometest.httpGet = function(url) {
- return new Promise(function(resolve, reject) {
- var r = new XMLHttpRequest();
- r.open('GET', url, false);
- r.onload = function() {
- if (r.readyState == 4) {
- if (r.status == 200) {
- resolve(r.responseText);
- } else {
- reject(r.status);
- }
- }
- };
- r.send();
- });
-};
-
-/**
- * Sleep for a duration.
- * @param {float} ms Timeout in milliseconds.
- * @return {Promise} A promise to wait.
- */
-chrometest.sleep = function(ms) {
- return new Promise(function(resolve, reject) {
- setTimeout(function() {
- resolve();
- }, ms);
- });
-};
-
-/**
- * Format a time in milliseconds to XXms or YYs as appropriate.
- * @param {float} ms Time in milliseconds.
- * @return {string} A formatted time.
- */
-chrometest.formatDuration = function(ms) {
- if (ms < 1000.0) {
- return ms + 'ms';
- } else {
- return (ms / 1000.0).toFixed(1) + 's';
- }
-};
-
-/**
- * Tell the test harness how many test runs to expect.
- * @param {integer} testCount The number of tests to expect.
- * @return {Promise} A promise to do it.
- */
-chrometest.reportTestCount_ = function(testCount) {
- console.log('About to run ' + testCount + ' tests.');
- return chrometest.httpGet('/_command?test_count=' + testCount);
-};
-
-/**
- * Notify the test harness that a test has begun.
- * @param {string} name The full name of the test.
- * @return {Promise} A promise to do it.
- */
-chrometest.beginTest_ = function(name) {
- return chrometest.resetExtension().then(function(count) {
- if (count !== 0) {
- throw new Error(
- 'Test extension connections from the last test remain active!');
- }
- console.log('[ RUN ] ' + name);
- chrometest.passed_ = true;
- chrometest.currentTestName_ = name;
- return chrometest.httpGet(
- '/_command?name=' + encodeURIComponent(name) +
- '&start=1');
- }).then(function(result) {
- chrometest.startTime_ = new Date();
- });
-};
-
-/**
- * Notify the test harness that a test has ended.
- * @return {Promise} A promise to do it.
- */
-chrometest.endTest_ = function() {
- return chrometest.resetExtension().then(function(count) {
- EXPECT_EQ(0, count,
- 'all connection to the test extension should be closed');
- var endTime = new Date();
- var duration = endTime.getTime() - chrometest.startTime_.getTime();
- duration = chrometest.formatDuration(duration);
- var name = chrometest.currentTestName_;
- var resultMsg;
- var result;
- if (chrometest.passed_) {
- resultMsg = ' OK';
- result = 1;
- } else {
- resultMsg = ' FAILED ';
- result = 0;
- }
- console.log('[ ' + resultMsg + ' ] ' + name + ' (' + duration + ')');
- chrometest.startTime_ = null;
- chrometest.currentTest_ = null;
- chrometest.currentTestName_ = null;
- return chrometest.httpGet(
- '/_command?name=' + encodeURIComponent(name) + '&' +
- 'duration=' + encodeURIComponent(duration) + '&' +
- 'result=' + result);
- });
-};
-
-/**
- * Mark current test as failed.
- */
-chrometest.fail = function() {
- chrometest.passed_ = false;
-};
-
-/**
- * Format an error object as a string.
- * Error objects use their stack trace.
- * @param {?} error A thrown value.
- */
-chrometest.formatError = function(error) {
- if (error === undefined || error.stack === undefined) {
- return '' + error;
- } else {
- return error.stack;
- }
-};
-
-
-/**
- * Assert that something must be true to continue the current test.
- *
- * This halts the current test by throwing an exception.
- * Unfortunately, this has the danger that it may not actually halt the test.
- * Ideally, any exception handling in the test itself should be done very
- * carefully to ensure it passes along 'assert' exceptions.
- * If the code under test eats the exception, at least the test will be marked
- * as failed. If the exception causes the code under test to wait indefinitely,
- * the timeout in the testing harness will eventually bring everything down.
- *
- * Halts the current test if the condition is not true.
- * @param {boolean} condition A condition to check.
- * @param {string} description A description of the context in which the
- * condition is being checked (to help
- * label / find it).
- */
-chrometest.assert = function(condition, description) {
- if (!condition) {
- chrometest.fail();
- if (description === undefined) {
- description = 'no description';
- }
- var error = new Error('ASSERT FAILED! - ' + description);
- chrometest.error(chrometest.formatError(error)).then(function() {
- throw 'assert';
- });
- }
-};
-
-/**
- * Declare that something must be true for the current test to pass.
- *
- * Does not halt the current test if the condition is false, but does emit
- * information on the failure location and mark the test as failed.
- * @param {boolean} condition A condition to check.
- * @param {string} description A description of the context in which the
- * condition is being checked (to help
- * label / find it).
- */
-chrometest.expect = function(condition, description) {
- if (!condition) {
- chrometest.fail();
- if (description === undefined) {
- description = 'no description';
- }
- var error = new Error('EXPECT FAILED! - ' + description);
- chrometest.error(chrometest.formatError(error));
- }
-};
-
-/**
- * Run a list of tests.
- * param {Array.<Test>} testList The list of tests to run.
- * @return {Promise} A promise to do it.
- */
-chrometest.runTests_ = function(testList) {
- var p = Promise.resolve();
- testList.forEach(function(test) {
- p = p.then(function() {
- return test.call();
- });
- });
- return p;
-};
-
-/**
- * Check if a string matches a wildcard string.
- * @param string filter A wildcard string (* - any string, ? - one char).
- * @param string s A string to match.
- */
-chrometest.wildcardMatch = function(filter, s) {
- filter = filter.replace(/[.]/g, '[.]');
- filter = filter.replace(/\*/g, '.*');
- filter = filter.replace(/\?/g, '.');
- filter = '^' + filter + '$';
- var re = new RegExp(filter);
- return re.test(s);
-};
-
-/**
- * Check if a string matches a googletest style filter.
- * A filter consists of zero or more ':' separated positive wildcard
- * strings, followed optionally by a '-' and zero or more ':' separated
- * negative wildcard strings.
- * @param string filter A googletest style filter string.
- * @param string s A string to match.
- */
-chrometest.filterMatch = function(filter, s) {
- var parts = filter.split('-');
- var positive;
- var negative;
- if (parts.length == 1) {
- positive = parts[0].split(':');
- negative = [];
- } else if (parts.length == 2) {
- positive = parts[0].split(':');
- negative = parts[1].split(':');
- } else {
- // Treat ill-formated filters as non-matches.
- return false;
- }
- if (positive.length == 1 && positive[0] === '') {
- positive = ['*'];
- }
- if (negative.length == 1 && negative[0] === '') {
- negative = [];
- }
- for (var i = 0; i < positive.length; i++) {
- if (!chrometest.wildcardMatch(positive[i], s)) {
- return false;
- }
- }
- for (var i = 0; i < negative.length; i++) {
- if (chrometest.wildcardMatch(negative[i], s)) {
- return false;
- }
- }
- return true;
-};
-
-/**
- * Filter tests based on harness filter.
- * @returns {Promose} A promise to do it.
- */
-chrometest.filterTests_ = function() {
- return chrometest.httpGet('/_command?filter=1').then(function(filter) {
- var keep = [];
- var tests = chrometest.tests_;
- for (var i = 0; i < tests.length; i++) {
- if (chrometest.filterMatch(filter, tests[i].name)) {
- keep.push(tests[i]);
- }
- }
- chrometest.tests_ = keep;
- }).catch(function(responseCode) {
- throw new Error(
- 'Requesting filter from test harness failed! (code: ' +
- responseCode + ')');
- });
-};
-
-/**
- * Report the test count and run all register tests and halt the browser.
- * @return {Promise} A promise to do it.
- */
-chrometest.runAllTests_ = function() {
- return Promise.resolve().then(function() {
- return chrometest.filterTests_();
- }).then(function() {
- // Sleep 100ms before starting the tests as extensions may not load
- // simultaneously.
- return chrometest.sleep(100);
- }).then(function() {
- return chrometest.reportTestCount_(chrometest.tests_.length);
- }).then(function() {
- return chrometest.runTests_(chrometest.tests_);
- }).catch(function(error) {
- chrometest.fail();
- return chrometest.error(chrometest.formatError(error));
- }).then(function() {
- return chrometest.haltBrowser();
- });
-};
-
-/**
- * Load a javascript module.
- * @param {string} filename Filename to load.
- * @return {Promise} A promise to load the module.
- */
-chrometest.load = function(filename) {
- return new Promise(function(resolve, reject) {
- // Register a window wide handler just in case (things leak thru).
- window.onerror = function(
- errorMsg, url, lineNumber, columnNumber, error) {
- chrometest.fail();
- chrometest.error(
- errorMsg + ' in ' + url + ' at ' +
- lineNumber + ':' + columnNumber + '\n' +
- chrometest.formatError(error)).then(function() {
- reject(chrometest.haltBrowser());
- });
- };
-
- var script = document.createElement('script');
- script.src = filename;
- script.onerror = function(e) {
- chrometest.error(
- 'Error loading ' + e.target.src + '\n').then(function() {
- reject(chrometest.haltBrowser());
- });
- };
- script.onload = function() {
- resolve();
- };
- document.body.appendChild(script);
- });
-};
-
-/**
- * Load a list of javascript files into script tags.
- * @param {Array.<string>} sources A list of javascript files to load tests
- * from.
- */
-chrometest.run = function(sources) {
- var p = Promise.resolve();
- sources.forEach(function(filename) {
- p = p.then(function() {
- return chrometest.load(filename);
- });
- });
- return p.then(function() {
- return chrometest.runAllTests_();
- });
-};
-
-
-/**
- * An class that monitors an object that behaves like a messaging Port or an
- * event listener, allowing Promise yielding waits.
- * Descendants or wrappers will want to perform port type specific setup and
- * tear down.
- * @constructor
- * @param {function()} tearDown A function called to detach any handles
- * associated with the port.
- * @param {Object} port An object that implements postMessage.
- */
-chrometest.PortlikeWaiter = function(tearDown, port) {
- var self = this;
- self.port_ = port;
- self.messages_ = [];
- self.waiter_ = null;
- self.tearDown_ = tearDown;
-};
-
-/**
- * Enqueue a message to any waiter.
- * @param {Promise.Object} A Promise for a message.
- */
-chrometest.PortlikeWaiter.prototype.enqueue = function(msg) {
- var self = this;
- if (self.waiter_ !== null) {
- self.waiter_(msg);
- } else {
- self.messages_.push(msg);
- }
-};
-
-/**
- * Wait a message.
- * @return {Promise.Object} A promise for a message.
- */
-chrometest.PortlikeWaiter.prototype.wait = function() {
- var self = this;
- return new Promise(function(resolve) {
- if (self.messages_.length > 0) {
- var msg = self.messages_.shift();
- resolve(msg);
- } else {
- if (self.waiter_ !== null) {
- throw new Error('Multiple waiters on a PortlikeWaiter!');
- }
- self.waiter_ = function(msg) {
- self.waiter_ = null;
- resolve(msg);
- };
- }
- });
-};
-
-/**
- * Post a message to the port object associated with this waiter.
- */
-chrometest.PortlikeWaiter.prototype.postMessage = function() {
- this.port_.postMessage.apply(this.port_, arguments);
-};
-
-/**
- * Detach the port object wrapper by this waiter for use.
- * @return {Object} The port like object managed by this object.
- */
-chrometest.PortlikeWaiter.prototype.detach = function() {
- var self = this;
- var port = self.port_;
- self.port_ = null;
- self.messages_ = null;
- self.waiter_ = null;
- if (self.tearDown_) {
- var tearDown = self.tearDown_;
- self.tearDown_ = null;
- tearDown();
- }
- return port;
-};
-
-
-/**
- * An object that monitors a messaging port and doles out promises.
- * Takes ownership of the port. Calls to postMessage and disconnect on the port
- * should be down to the waiter instead.
- * Detach can be used to release the underlying Port.
- * @constructor
- * @param {Port} port The port to monitor.
- */
-chrometest.PortWaiter = function(port) {
- var self = this;
- function handleMessage(msg) {
- self.enqueue(Promise.resolve(msg));
- }
- function handleDisconnect() {
- self.enqueue(Promise.reject());
- self.detach();
- }
- chrometest.PortlikeWaiter.call(self, function() {
- port.onMessage.removeListener(handleMessage);
- port.onDisconnect.removeListener(handleDisconnect);
- }, port);
- self.port_.onMessage.addListener(handleMessage);
- self.port_.onDisconnect.addListener(handleDisconnect);
-};
-chrometest.PortWaiter.prototype = new chrometest.PortlikeWaiter();
-
-/**
- * Disconnect the Port object wrapped by this waiter.
- * @param {Object} msg Message to send.
- */
-chrometest.PortWaiter.prototype.disconnect = function() {
- var self = this;
- var port = self.detach();
- if (port !== null) {
- port.disconnect();
- }
-};
-
-
-/**
- * A test case.
- * @constructor
- */
-chrometest.Test = function() {
-};
-
-/**
- * The default setUp method for a test case (does nothing).
- * @return {Promise/void} Optionally return a promise to set up.
- */
-chrometest.Test.prototype.setUp = function() {
-};
-
-/**
- * The default tearDown method for a test case (does nothing).
- * @return {Promise/void} Optionally return a promise to tear down.
- */
-chrometest.Test.prototype.tearDown = function() {
-};
-
-
-// Below this point functions are declare at global scope and use a naming
-// convention that matches googletest. This done for several reasons:
-// - A global name makes use through multiple tests convenient.
-// - Using an existing naming convention makes use and intent clear.
-// - ALL CAPS highlights the testing constructs visually.
-
-
-// TEST Types
-// ----------
-
-/**
- * Register a test case using a fixture class.
- * @param {string} FixtureClass The test fixture class object.
- * @param {string} testName The name of the test.
- * @param {function()} testFunc Called to run the test, may return
- * a Promise.
- * @param {string} opt_caseName Optional name for the case, otherwise the
- * FixtureClass class name is used.
- */
-function TEST_F(FixtureClass, testName, testFunc, opt_caseName) {
- if (opt_caseName === undefined) {
- opt_caseName = FixtureClass.name;
- }
- var fullName = opt_caseName + '.' + testName;
- chrometest.tests_.push({
- 'name': fullName,
- 'call': function() {
- return Promise.resolve().then(function() {
- return chrometest.beginTest_(fullName);
- }).then(function() {
- chrometest.currentTest_ = new FixtureClass();
- return Promise.resolve().then(function() {
- return chrometest.currentTest_.setUp();
- }).then(function() {
- return Promise.resolve().then(function() {
- return testFunc.call(chrometest.currentTest_);
- }).catch(function(error) {
- chrometest.fail();
- return chrometest.error(chrometest.formatError(error));
- });
- }).then(function() {
- return chrometest.currentTest_.tearDown();
- }).catch(function(error) {
- chrometest.fail();
- return chrometest.error(chrometest.formatError(error));
- });
- }).then(function() {
- return chrometest.endTest_();
- });
- },
- });
-}
-
-/**
- * Register a single test.
- * @param {string} testCase A test case name in lieu of a fixture.
- * @param {string} testName The name of the test.
- * @param {function()} testFunc Called to run the test, may return
- * a Promise.
- */
-function TEST(testCase, testName, testFunc) {
- TEST_F(chrometest.Test, testName, testFunc, testCase);
-}
-
-
-// ASSERT VARIANTS
-// ---------------
-
-function ASSERT_EQ(expected, actual, context) {
- expected = JSON.stringify(expected);
- actual = JSON.stringify(actual);
- chrometest.assert(expected == actual, 'Expected ' + expected + ' but got ' +
- JSON.stringify(actual) + ' when ' +
- JSON.stringify(context));
-}
-
-function ASSERT_NE(expected, actual, context) {
- expected = JSON.stringify(expected);
- actual = JSON.stringify(actual);
- chrometest.assert(expected != actual, 'Did not expect ' + expected +
- ' but got ' + actual + ' when ' + context);
-}
-
-function ASSERT_TRUE(value, context) {
- ASSERT_EQ(true, value, context);
-}
-
-function ASSERT_FALSE(value, context) {
- ASSERT_EQ(false, value, context);
-}
-
-function ASSERT_LT(a, b, context) {
- chrometest.assert(a < b, 'Expected ' + a + ' < ' + b + ' when ' + context);
-}
-
-function ASSERT_GT(a, b, context) {
- chrometest.assert(a > b, 'Expected ' + a + ' > ' + b + ' when ' + context);
-}
-
-function ASSERT_LE(a, b, context) {
- chrometest.assert(a <= b, 'Expected ' + a + ' <= ' + b + ' when ' + context);
-}
-
-function ASSERT_GE(a, b, context) {
- chrometest.assert(a >= b, 'Expected ' + a + ' >= ' + b + ' when ' + context);
-}
-
-
-// EXPECT VARIANTS
-// ---------------
-
-function EXPECT_EQ(expected, actual, context) {
- expected = JSON.stringify(expected);
- actual = JSON.stringify(actual);
- chrometest.expect(expected == actual, 'Expected ' + expected + ' but got ' +
- JSON.stringify(actual) + ' when ' + context);
-}
-
-function EXPECT_NE(expected, actual, context) {
- expected = JSON.stringify(expected);
- actual = JSON.stringify(actual);
- chrometest.expect(expected != actual, 'Did not expect ' + expected +
- ' but got ' + actual + ' when ' + context);
-}
-
-function EXPECT_TRUE(value, context) {
- EXPECT_EQ(true, value, context);
-}
-
-function EXPECT_FALSE(value, context) {
- EXPECT_EQ(false, value, context);
-}
-
-function EXPECT_LT(a, b, context) {
- chrometest.expect(a < b, 'Expected ' + a + ' < ' + b + ' when ' + context);
-}
-
-function EXPECT_GT(a, b, context) {
- chrometest.expect(a > b, 'Expected ' + a + ' > ' + b + ' when ' + context);
-}
-
-function EXPECT_LE(a, b, context) {
- chrometest.expect(a <= b, 'Expected ' + a + ' <= ' + b + ' when ' + context);
-}
-
-function EXPECT_GE(a, b, context) {
- chrometest.expect(a >= b, 'Expected ' + a + ' >= ' + b + ' when ' + context);
-}
diff --git a/chrome_test/extension/background.js b/chrome_test/extension/background.js
deleted file mode 100644
index fa0610f..0000000
--- a/chrome_test/extension/background.js
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-// A testing extension that grants ordinary pages access to extension specific
-// functionality when run in test mode.
-
-
-/**
- * The list of all current connections.
- * @private
- */
-var g_connections_ = [];
-
-
-/**
- * Kill the browser.
- */
-function haltBrowser() {
- chrome.processes.getProcessInfo([], false, function(processes) {
- for (var p in processes) {
- if (processes[p].type === 'browser') {
- chrome.processes.terminate(processes[p].id);
- }
- }
- });
- // This seems to be needed in practice sometimes.
- chrome.processes.terminate(0);
-}
-
-
-/**
- * A connection.
- * @constructor
- * @param {Port} port for the connection.
- */
-function Connection(port) {
- this.proxied_ = null;
- this.port_ = port;
- this.port_.onMessage.addListener(this.handleMessage_.bind(this));
- this.port_.onDisconnect.addListener(this.handleDisconnect_.bind(this));
- g_connections_.push(this);
-}
-
-/**
- * Disconnect all ports related to the connection.
- */
-Connection.prototype.disconnect = function() {
- try {
- this.port_.disconnect();
- } catch (e) {
- }
- if (this.proxied_ !== null) {
- try {
- this.proxied_.disconnect();
- } catch (e) {
- }
- }
- for (var i = 0; i < g_connections_.length; i++) {
- if (g_connections_[i] === this) {
- g_connections_.splice(i, 1);
- break;
- }
- }
-};
-
-/**
- * Handle a message from the primary connection port.
- * @param {Message} msg The inbound message.
- */
-Connection.prototype.handleMessage_ = function(msg) {
- var self = this;
- // When in proxy mode, route all messages.
- if (self.proxied_ !== null) {
- self.proxied_.postMessage(msg);
-
- // Expose a means to halt the entire browser.
- } else if (msg.name == 'haltBrowser') {
- haltBrowser();
-
- // Expose chrome.management.getAll.
- } else if (msg.name == 'getAllExtensions') {
- chrome.management.getAll(function(result) {
- self.port_.postMessage({'name': 'getAllExtensionsResult',
- 'result': result});
- });
-
- // Expose chrome.processes.getProcessInfo.
- } else if (msg.name == 'getAllProcesses') {
- // TODO(bradnelson): Remove this when chrome is fixed.
- // Currently the task manager does not pump out notification of updates to
- // the chrome.processes api when there are no pending listeners.
- // Oddly the listeners seem to need to be started after a getProcessInfo
- // request.
- var doNothing = function(processes) {};
- chrome.processes.getProcessInfo([], false, function(processes) {
- self.port_.postMessage({'name': 'getAllProcessesResult',
- 'result': processes});
- // TODO(bradnelson): Remove this when chrome is fixed. See above.
- chrome.processes.onUpdated.removeListener(doNothing);
- });
- // TODO(bradnelson): Remove this when chrome is fixed. See above.
- chrome.processes.onUpdated.addListener(doNothing);
-
- // Allow proxied access to all extensions / apps for testing.
- // NOTE: Once you switch to proxy mode, all messages are routed to the
- // proxied extension. A new connection is required for further access to
- // other functionality.
- } else if (msg.name == 'proxy') {
- chrome.management.getAll(function(extensions) {
- // Find all extensions with this name.
- var picks = [];
- for (var i = 0; i < extensions.length; i++) {
- if (extensions[i].name == msg.extension) {
- picks.push(extensions[i]);
- }
- }
- var success = false;
- if (picks.length == 1) {
- self.proxied_ = chrome.runtime.connect(picks[0].id);
- self.proxied_.onMessage.addListener(function(msg) {
- self.port_.postMessage(msg);
- });
- self.proxied_.onDisconnect.addListener(function(msg) {
- self.disconnect();
- });
- success = true;
- }
- // Reply in any event.
- self.port_.postMessage({'name': 'proxyReply', 'success': success,
- 'matchCount': picks.length});
- });
-
- // Provide a simple echo for testing of this extension.
- } else if (msg.name == 'ping') {
- msg.name = 'pong';
- self.port_.postMessage(msg);
-
- // Disconnect all connections except the current one.
- } else if (msg.name == 'reset') {
- var snapshot = g_connections_.slice();
- var killCount = 0;
- for (var i = 0; i < snapshot.length; i++) {
- // Disconnect everything other than the current connection.
- if (snapshot[i] !== self) {
- snapshot[i].disconnect();
- killCount++;
- }
- }
- self.port_.postMessage({'name': 'resetReply', 'count': killCount});
- }
-};
-
-/**
- * Handle disconnect from the primary connection prot.
- */
-Connection.prototype.handleDisconnect_ = function() {
- this.disconnect();
-};
-
-
-/**
- * Listen for a number of message types from tests.
- */
-chrome.runtime.onConnectExternal.addListener(function(port) {
- var connection = new Connection(port);
-});
diff --git a/chrome_test/extension/manifest.json b/chrome_test/extension/manifest.json
deleted file mode 100644
index 6b3692d..0000000
--- a/chrome_test/extension/manifest.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "Chrome Testing Extension",
- "description": "Extension used to make testing with Chrome easier",
- "version": "0.0.0.0",
- "manifest_version": 2,
- "background": {
- "scripts": ["background.js"],
- "persistent": true
- },
- "permissions": [
- "*://*/*",
- "management",
- "processes"
- ],
- "externally_connectable": {
- "ids": [
- "*"
- ],
- "matches": [
- "*://localhost/*",
- "*://127.0.0.1/*",
- "*://0.0.0.0/*"
- ]
- }
-}
diff --git a/chrome_test/pinger/background.js b/chrome_test/pinger/background.js
deleted file mode 100644
index 9971038..0000000
--- a/chrome_test/pinger/background.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-// A simple echo extension used to test extension proxying.
-
-
-chrome.runtime.onConnectExternal.addListener(function(port) {
- port.onMessage.addListener(function(msg) {
- if (msg.name == 'ping') {
- msg.name = 'pong';
- port.postMessage(msg);
- }
- });
-});
diff --git a/chrome_test/pinger/manifest.json b/chrome_test/pinger/manifest.json
deleted file mode 100644
index 3a6e9e9..0000000
--- a/chrome_test/pinger/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "Ping Test Extension",
- "description": "Replies to a ping",
- "version": "0.0.0.0",
- "manifest_version": 2,
- "background": {
- "scripts": ["background.js"],
- "persistent": true
- }
-}
diff --git a/chrome_test/plumbing_test.py b/chrome_test/plumbing_test.py
deleted file mode 100755
index 6944a58..0000000
--- a/chrome_test/plumbing_test.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-
-"""A test of the extension testing system itself."""
-
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-SRC_DIR = os.path.dirname(SCRIPT_DIR)
-sys.path.insert(0, SRC_DIR)
-
-import chrome_test
-
-if __name__ == '__main__':
- chrome_test.Main(
- ['-C', os.path.join(SCRIPT_DIR, 'tests'),
- '--load-extension', os.path.join(SCRIPT_DIR, 'pinger'),
- 'plumbing_test.html'] + sys.argv[1:])
diff --git a/chrome_test/tcpapp/manifest.json b/chrome_test/tcpapp/manifest.json
deleted file mode 100644
index 1ecf288..0000000
--- a/chrome_test/tcpapp/manifest.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "TCP Interface",
- "description": "Exposes a TCP API to web pages used in Chrome tests.",
- "version": "0.1",
- "manifest_version": 2,
- "sockets": {
- "tcp" : {
- "connect": ["127.0.0.1:*"]
- }
- },
- "externally_connectable": {
- "ids": ["*"],
- "matches": [
- "*://webports.storage.googleapis.com/*",
- "*://nacltools.storage.googleapis.com/*",
- "*://*.chrome.com/*",
- "*://localhost/*",
- "*://127.0.0.1/*",
- "*://0.0.0.0/*"
- ]
- },
- "app": {
- "background": {
- "scripts": ["tcp.js"]
- }
- }
-}
diff --git a/chrome_test/tcpapp/tcp.js b/chrome_test/tcpapp/tcp.js
deleted file mode 100644
index d735624..0000000
--- a/chrome_test/tcpapp/tcp.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-// This is the PPAPI code for TCP FIN (disconnected).
-var ERROR_CODE_FIN = -100;
-
-// Map sockets to onConnectExternal ports, to remember where we route incoming
-// TCP messages.
-var portMap = {};
-
-/*
- * The following functions convert between ArrayBuffer and Array, as TCP
- * requires ArrayBuffers while postMessage requires Arrays.
- */
-
-// Convert an ArrayBuffer to an Array.
-function ab2Array(buf) {
- return Array.apply(null, new Uint8Array(buf));
-}
-
-// Convert an Array to an ArrayBuffer.
-function array2Ab(arr) {
- return new Uint8Array(arr).buffer;
-}
-
-// Route incoming TCP messages.
-chrome.sockets.tcp.onReceive.addListener(function(info) {
- if (portMap[info.socketId] === undefined) {
- chrome.sockets.tcp.close(info.socketId, function() {});
- return;
- }
- portMap[info.socketId].postMessage({
- name: 'tcp_message',
- socket: info.socketId,
- data: ab2Array(info.data)
- });
-});
-
-// Handle TCP disconnects.
-chrome.sockets.tcp.onReceiveError.addListener(function(info) {
- if (info.resultCode !== ERROR_CODE_FIN) {
- console.log('unhandled error: ' + info.resultCode);
- }
- if (portMap[info.socketId] === undefined) {
- return;
- }
- portMap[info.socketId].postMessage({
- name: 'tcp_disconnect',
- socket: info.socketId
- });
-});
-
-chrome.runtime.onConnectExternal.addListener(function(port) {
- var tcp = chrome.sockets.tcp;
-
- port.onMessage.addListener(function(msg) {
- function resolve(data) {
- var response = {
- name: msg.name + '_reply',
- data: data || null
- };
- port.postMessage(response);
- }
- function reject(err) {
- var response = {
- name: msg.name + '_error',
- error: err || null
- };
- port.postMessage(response);
- }
-
- switch (msg.name) {
- case 'tcp_connect':
- if (msg.addr === undefined || msg.port === undefined) {
- reject('"addr" and "port" fields expected');
- break;
- }
- tcp.create({}, function(createInfo) {
- var socketId = createInfo.socketId;
- tcp.connect(socketId, msg.addr, parseInt(msg.port), function(result) {
- if (result < 0) {
- tcp.close(socketId, function() {
- reject(result);
- });
- } else {
- portMap[socketId] = port;
- resolve(socketId);
- }
- });
- });
- break;
- case 'tcp_send':
- if (msg.socket === undefined || msg.data === undefined) {
- reject('"socket" and "data" fields expected');
- break;
- }
- var data = array2Ab(msg.data);
- tcp.send(msg.socket, data, function(info) {
- if (info.resultCode < 0) {
- reject('received error code ' + info.resultCode);
- } else {
- resolve(info.bytesSent);
- }
- });
- break;
- case 'tcp_close':
- if (msg.socket === undefined || portMap[msg.socket] === undefined) {
- reject('socket not found');
- break;
- }
- delete portMap[msg.socket];
- tcp.close(msg.socket, function() {
- resolve();
- });
- break;
- default:
- port.postMessage({name: 'unknown_error', error: 'unknown message'});
- }
- });
-
- port.onDisconnect.addListener(function() {
- // O(N) time, but there's something wrong if there are enough TCP
- // connections that the performance of this loop matters.
- for (var socket in portMap) {
- if (portMap[socket] === port) {
- delete portMap[socket];
- tcp.close(parseInt(socket), function() {});
- }
- }
- });
-});
diff --git a/chrome_test/tests/extension_test.js b/chrome_test/tests/extension_test.js
deleted file mode 100644
index b44af56..0000000
--- a/chrome_test/tests/extension_test.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals TEST, EXPECT_EQ, ASSERT_EQ, chrometest */
-
-'use strict';
-
-TEST('ExtensionTest', 'testGetAllExtensions', function() {
- return chrometest.getAllExtensions().then(function(extensions) {
- ASSERT_EQ(3, extensions.length, 'there should be three extensions');
- var expected = [
- 'Chrome Testing Extension',
- 'Ping Test Extension',
- 'TCP Interface',
- ];
- expected.sort();
- var actual = [];
- for (var i = 0; i < extensions.length; i++) {
- actual.push(extensions[i].name);
- }
- actual.sort();
- EXPECT_EQ(expected, actual, 'extensions should have the right names');
- });
-});
-
-TEST('ExtensionTest', 'testBuiltInPingPong', function() {
- var port = chrometest.newTestPort();
- var data = 'hickory dickory dock';
- port.postMessage({'name': 'ping', 'data': data});
- return port.wait().then(function(msg) {
- EXPECT_EQ('pong', msg.name, 'we should have gotten a pong');
- EXPECT_EQ(data, msg.data, 'we should get back what we sent');
- port.disconnect();
- });
-});
-
-TEST('ExtensionTest', 'testExtensionProxy', function() {
- var data = 'fee fi fo fum';
- var keptPort;
- return Promise.resolve().then(function() {
- return chrometest.proxyExtension('Ping Test Extension');
- }).then(function(port) {
- keptPort = port;
- keptPort.postMessage({'name': 'ping', 'data': data});
- return port.wait();
- }).then(function(msg) {
- EXPECT_EQ('pong', msg.name, 'we should have gotten a pong');
- EXPECT_EQ(data, msg.data, 'we should get back what we sent');
- keptPort.disconnect();
- });
-});
diff --git a/chrome_test/tests/plumbing_test.html b/chrome_test/tests/plumbing_test.html
deleted file mode 100644
index 2fb05e1..0000000
--- a/chrome_test/tests/plumbing_test.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<html>
-<!--
-Copyright (c) 2014 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.
--->
-<body onload="init();">
-<script src="/_chrome_test.js"></script>
-<script>
-function init() {
- chrometest.run([
- 'user_agent_test.js', // First as the others will hang if they cannot find
- // the test extension.
- 'extension_test.js',
- 'processes_test.js',
- ]);
-}
-</script>
-</body>
-</html>
diff --git a/chrome_test/tests/processes_test.js b/chrome_test/tests/processes_test.js
deleted file mode 100644
index 6d2cc5c..0000000
--- a/chrome_test/tests/processes_test.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals TEST_F, TEST, EXPECT_EQ, EXPECT_TRUE, EXPECT_GE, chrometest */
-
-'use strict';
-
-function ProcessesTest() {
- this.processes = null;
-}
-ProcessesTest.prototype = new chrometest.Test();
-
-ProcessesTest.prototype.setUp = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return chrometest.Test.prototype.setUp.call(self);
- }).then(function() {
- return chrometest.getAllProcesses();
- }).then(function(processes) {
- self.processes = processes;
- });
-};
-
-
-TEST_F(ProcessesTest, 'testProcessTypes', function() {
- var browserCount = 0;
- var rendererCount = 0;
- var gpuCount = 0;
- var extensionCount = 0;
- for (var id in this.processes) {
- var process = this.processes[id];
- var type = process.type;
- if (type == 'browser') {
- browserCount++;
- } else if (type == 'renderer') {
- rendererCount++;
- } else if (type == 'gpu') {
- gpuCount++;
- } else if (type == 'extension') {
- extensionCount++;
- } else if (type == 'utility') {
- // There may be utility processes, ignore them.
- } else {
- EXPECT_TRUE(false, 'There should only be ' +
- 'browser, renderer, gpu, and extension, but got ' + type);
- }
- }
- EXPECT_EQ(1, browserCount, 'there should be one browser');
- EXPECT_EQ(1, gpuCount, 'there should be one gpu');
- EXPECT_GE(rendererCount, 1, 'there should be one or more renderers');
- EXPECT_GE(extensionCount, 2, 'there should be two or more extensions');
-});
-
-TEST_F(ProcessesTest, 'testExtensionTitles', function() {
- var hasChromeTest = false;
- var hasPingTest = false;
- for (var id in this.processes) {
- var process = this.processes[id];
- if (process.type == 'extension') {
- if (process.title == 'Extension: Chrome Testing Extension') {
- hasChromeTest = true;
- } else if (process.title == 'Extension: Ping Test Extension') {
- hasPingTest = true;
- }
- }
- }
- EXPECT_TRUE(hasChromeTest, 'the chrometest extension should be present');
- EXPECT_TRUE(hasPingTest, 'the ping test extension should be present');
-});
diff --git a/chrome_test/tests/user_agent_test.js b/chrome_test/tests/user_agent_test.js
deleted file mode 100644
index 4a5f620..0000000
--- a/chrome_test/tests/user_agent_test.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals TEST, EXPECT_EQ, ASSERT_EQ, EXPECT_TRUE */
-
-'use strict';
-
-TEST('UserAgentTest', 'testInTestMode', function() {
- var parts = navigator.userAgent.split(' ');
- ASSERT_EQ(2, parts.length, 'agent has 2 sections');
- EXPECT_EQ('ChromeTestAgent', parts[0].split('/')[0],
- 'should have test agent string');
- EXPECT_EQ(32, parts[0].split('/')[1].length,
- 'should be a 32 digit extension id');
- EXPECT_EQ('Chrome', parts[1].split('/')[0],
- 'must have chrome agent string');
- EXPECT_TRUE(/^\d+$/.test(parts[1].split('/')[1]),
- 'must have a version number (for hterm)');
-});
diff --git a/codereview.settings b/codereview.settings
deleted file mode 100644
index 1ee31c7..0000000
--- a/codereview.settings
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file is used by git-cl (or gcl) to get repository specific information.
-CODE_REVIEW_SERVER: codereview.chromium.org
-CC_LIST: native-client-reviews@googlegroups.com
-VIEW_VC: https://chromium.googlesource.com/webports/+/
-STATUS: http://naclports-status.appspot.com/status
-TRY_ON_UPLOAD: False
-TRYSERVER_PROJECT: webports
-TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl
-PROJECT: webports
diff --git a/docs/port_list.md b/docs/port_list.md
deleted file mode 100644
index f46ce6c..0000000
--- a/docs/port_list.md
+++ /dev/null
@@ -1,1138 +0,0 @@
-# List of available ports
-
-Port are listed in alphabetical order, with links to the upstream
-source archive and the patch used when building for NaCl.
-This listing is auto-generated by
-[generate\_port\_list.py](https://chromium.googlesource.com/webports/+/master/build_tools/generate_port_list.py).
-
-| **Name** | **Version** | **Upstream Archive** | **NaCl Patch** | **Disabled Libc** | **Disabled Arch** |
-| :--- | :--- | :--- | :--- | :--- | :--- |
-| [agg] | 2.5 | [agg-2.5.tar.gz][agg_upstream] | [1 KiB][agg_patch] | [] | [] |
-| [apr] | 1.5.0 | [apr-1.5.0.tar.bz2][apr_upstream] | [5 KiB][apr_patch] | [] | [] |
-| [apr-util] | 1.5.3 | [apr-util-1.5.3.tar.bz2][apr-util_upstream] | | [] | [] |
-| [atk] | 2.16.0 | [atk-2.16.0.tar.xz][atk_upstream] | | [] | [] |
-| [avrdude] | 6.1 | [avrdude-6.1.tar.gz][avrdude_upstream] | [6 KiB][avrdude_patch] | newlib | [] |
-| [babl] | 0.1.12 | [babl-0.1.12.tar.bz2][babl_upstream] | | newlib | [] |
-| [bash] | 4.3 | [bash-4.3.tar.gz][bash_upstream] | [7 KiB][bash_patch] | [] | [] |
-| [bdftopcf] | 1.0.3 | [bdftopcf-1.0.3.tar.bz2][bdftopcf_upstream] | | [] | [] |
-| [bigreqsproto] | 1.1.2 | [bigreqsproto-1.1.2.tar.bz2][bigreqsproto_upstream] | | [] | [] |
-| [binutils] | 7dc2f2590 | [None][binutils_upstream] | [1 KiB][binutils_patch] | [] | pnacl |
-| [binutils-2.25] | 2.25 | [binutils-2.25.tar.bz2][binutils-2.25_upstream] | [2 KiB][binutils-2.25_patch] | [] | pnacl |
-| [bison] | 3.0.4 | [bison-3.0.4.tar.xz][bison_upstream] | [3 KiB][bison_patch] | [] | [] |
-| [blackbox] | 0.70.1 | [blackbox-0.70.1.tar.bz2][blackbox_upstream] | [8 KiB][blackbox_patch] | [] | [] |
-| [blis] | 0.1.5 | [blis-0.1.5.tar.gz][blis_upstream] | [951 B][blis_patch] | [] | [] |
-| [bochs] | 2.6.2 | [bochs-2.6.2.tar.gz][bochs_upstream] | [2 KiB][bochs_patch] | [] | [] |
-| [boost] | 1.55.0 | [boost_1_55_0.tar.bz2][boost_upstream] | [5 KiB][boost_patch] | [] | [] |
-| [boringssl] | git | [None][boringssl_upstream] | [10 KiB][boringssl_patch] | [] | [] |
-| [box2d] | 2.2.1 | [Box2D_v2.2.1.zip][box2d_upstream] | [693 B][box2d_patch] | [] | [] |
-| [bullet] | 2.81-rev2613 | [bullet-2.81-rev2613.zip][bullet_upstream] | [7 KiB][bullet_patch] | [] | [] |
-| [busybox] | 1.22.0 | [busybox-1.22.0.tar.bz2][busybox_upstream] | | newlib | [] |
-| [bzip2] | 1.0.6 | [bzip2-1.0.6.tar.gz][bzip2_upstream] | [420 B][bzip2_patch] | [] | [] |
-| [cairo] | 1.12.14 | [cairo-1.12.14.tar.xz][cairo_upstream] | [5 KiB][cairo_patch] | [] | [] |
-| [cfitsio] | 3260 | [cfitsio3260.tar.gz][cfitsio_upstream] | [1 KiB][cfitsio_patch] | [] | [] |
-| [civetweb] | 1.5 | [civetweb-1.5.tar.gz][civetweb_upstream] | [2 KiB][civetweb_patch] | [] | [] |
-| [clapack] | 3.2.1 | [clapack.tgz][clapack_upstream] | [4 KiB][clapack_patch] | [] | [] |
-| [clipper] | 6.2.1 | [clipper_ver6.2.1.zip][clipper_upstream] | [1 KiB][clipper_patch] | [] | [] |
-| [compositeproto] | 0.4.2 | [compositeproto-0.4.2.tar.bz2][compositeproto_upstream] | | [] | [] |
-| [coreutils] | 8.24 | [coreutils-8.24.tar.xz][coreutils_upstream] | [7 KiB][coreutils_patch] | [] | [] |
-| [cups] | 2.1.0 | [cups-2.1.0-source.tar.bz2][cups_upstream] | [1 KiB][cups_patch] | [] | [] |
-| [curl] | 7.44.0 | [curl-7.44.0.tar.bz2][curl_upstream] | [912 B][curl_patch] | [] | [] |
-| [cython] | 0.19.1 | [Cython-0.19.1.tar.gz][cython_upstream] | | [] | [] |
-| [damageproto] | 1.2.1 | [damageproto-1.2.1.tar.bz2][damageproto_upstream] | | [] | [] |
-| [darksky-catalog] | 0.1.3 | [darksky_catalog-0.1.3.tar.gz][darksky-catalog_upstream] | | [] | [] |
-| [devil] | 1.7.8 | [DevIL-1.7.8.tar.gz][devil_upstream] | [4 KiB][devil_patch] | [] | [] |
-| [distribute] | 0.6.28 | [distribute-0.6.28.tar.gz][distribute_upstream] | | [] | [] |
-| [dosbox] | 0.74 | [dosbox-0.74.tar.gz][dosbox_upstream] | [5 KiB][dosbox_patch] | [] | [] |
-| [drod] | 213fa47 | [drod-213fa47.tar.gz][drod_upstream] | [722 B][drod_patch] | [] | [] |
-| [eigen3] | 3.2.7 | [eigen-3.2.7.tar.bz2][eigen3_upstream] | [900 B][eigen3_patch] | [] | [] |
-| [emacs] | 24.3 | [emacs-24.3.tar.gz][emacs_upstream] | [32 KiB][emacs_patch] | [] | [] |
-| [emacs-x] | 24.3 | [emacs-24.3.tar.gz][emacs-x_upstream] | | [] | [] |
-| [expat] | 2.0.1 | [expat-2.0.1.tar.gz][expat_upstream] | [569 B][expat_patch] | [] | [] |
-| [faac] | 1.28 | [faac-1.28.tar.gz][faac_upstream] | [1 KiB][faac_patch] | [] | [] |
-| [faad2] | 2.7 | [faad2-2.7.tar.gz][faad2_upstream] | [500 B][faad2_patch] | [] | [] |
-| [ffmpeg] | 2.6.1 | [ffmpeg-2.6.1.tar.bz2][ffmpeg_upstream] | [1 KiB][ffmpeg_patch] | [] | arm |
-| [fftw] | 3.3.4 | [fftw-3.3.4.tar.gz][fftw_upstream] | [2 KiB][fftw_patch] | [] | [] |
-| [fftw-float] | 3.3.4 | [fftw-3.3.4.tar.gz][fftw-float_upstream] | [2 KiB][fftw-float_patch] | [] | [] |
-| [findutils] | 4.4.2 | [findutils-4.4.2.tar.gz][findutils_upstream] | [41 KiB][findutils_patch] | [] | [] |
-| [fixesproto] | 5.0 | [fixesproto-5.0.tar.bz2][fixesproto_upstream] | | [] | [] |
-| [flac] | 1.2.1 | [flac-1.2.1.tar.gz][flac_upstream] | [858 B][flac_patch] | [] | [] |
-| [font-adobe-100dpi] | 1.0.3 | [font-adobe-100dpi-1.0.3.tar.bz2][font-adobe-100dpi_upstream] | | [] | [] |
-| [font-adobe-75dpi] | 1.0.3 | [font-adobe-75dpi-1.0.3.tar.bz2][font-adobe-75dpi_upstream] | | [] | [] |
-| [font-adobe-utopia-100dpi] | 1.0.4 | [font-adobe-utopia-100dpi-1.0.4.tar.bz2][font-adobe-utopia-100dpi_upstream] | | [] | [] |
-| [font-adobe-utopia-75dpi] | 1.0.4 | [font-adobe-utopia-75dpi-1.0.4.tar.bz2][font-adobe-utopia-75dpi_upstream] | | [] | [] |
-| [font-adobe-utopia-type1] | 1.0.4 | [font-adobe-utopia-type1-1.0.4.tar.bz2][font-adobe-utopia-type1_upstream] | | [] | [] |
-| [font-alias] | 1.0.3 | [font-alias-1.0.3.tar.bz2][font-alias_upstream] | | [] | [] |
-| [font-bh-100dpi] | 1.0.3 | [font-bh-100dpi-1.0.3.tar.bz2][font-bh-100dpi_upstream] | | [] | [] |
-| [font-bh-75dpi] | 1.0.3 | [font-bh-75dpi-1.0.3.tar.bz2][font-bh-75dpi_upstream] | | [] | [] |
-| [font-bh-lucidatypewriter-100dpi] | 1.0.3 | [font-bh-lucidatypewriter-100dpi-1.0.3.tar.bz2][font-bh-lucidatypewriter-100dpi_upstream] | | [] | [] |
-| [font-bh-lucidatypewriter-75dpi] | 1.0.3 | [font-bh-lucidatypewriter-75dpi-1.0.3.tar.bz2][font-bh-lucidatypewriter-75dpi_upstream] | | [] | [] |
-| [font-bh-ttf] | 1.0.3 | [font-bh-ttf-1.0.3.tar.bz2][font-bh-ttf_upstream] | | [] | [] |
-| [font-bh-type1] | 1.0.3 | [font-bh-type1-1.0.3.tar.bz2][font-bh-type1_upstream] | | [] | [] |
-| [font-bitstream-100dpi] | 1.0.3 | [font-bitstream-100dpi-1.0.3.tar.bz2][font-bitstream-100dpi_upstream] | | [] | [] |
-| [font-bitstream-75dpi] | 1.0.3 | [font-bitstream-75dpi-1.0.3.tar.bz2][font-bitstream-75dpi_upstream] | | [] | [] |
-| [font-bitstream-type1] | 1.0.3 | [font-bitstream-type1-1.0.3.tar.bz2][font-bitstream-type1_upstream] | | [] | [] |
-| [font-cronyx-cyrillic] | 1.0.3 | [font-cronyx-cyrillic-1.0.3.tar.bz2][font-cronyx-cyrillic_upstream] | | [] | [] |
-| [font-cursor-misc] | 1.0.3 | [font-cursor-misc-1.0.3.tar.bz2][font-cursor-misc_upstream] | | [] | [] |
-| [font-daewoo-misc] | 1.0.3 | [font-daewoo-misc-1.0.3.tar.bz2][font-daewoo-misc_upstream] | | [] | [] |
-| [font-dec-misc] | 1.0.3 | [font-dec-misc-1.0.3.tar.bz2][font-dec-misc_upstream] | | [] | [] |
-| [font-ibm-type1] | 1.0.3 | [font-ibm-type1-1.0.3.tar.bz2][font-ibm-type1_upstream] | | [] | [] |
-| [font-isas-misc] | 1.0.3 | [font-isas-misc-1.0.3.tar.bz2][font-isas-misc_upstream] | | [] | [] |
-| [font-jis-misc] | 1.0.3 | [font-jis-misc-1.0.3.tar.bz2][font-jis-misc_upstream] | | [] | [] |
-| [font-micro-misc] | 1.0.3 | [font-micro-misc-1.0.3.tar.bz2][font-micro-misc_upstream] | | [] | [] |
-| [font-misc-cyrillic] | 1.0.3 | [font-misc-cyrillic-1.0.3.tar.bz2][font-misc-cyrillic_upstream] | | [] | [] |
-| [font-misc-ethiopic] | 1.0.3 | [font-misc-ethiopic-1.0.3.tar.bz2][font-misc-ethiopic_upstream] | | [] | [] |
-| [font-misc-meltho] | 1.0.3 | [font-misc-meltho-1.0.3.tar.bz2][font-misc-meltho_upstream] | | [] | [] |
-| [font-misc-misc] | 1.1.2 | [font-misc-misc-1.1.2.tar.bz2][font-misc-misc_upstream] | | [] | [] |
-| [font-mutt-misc] | 1.0.3 | [font-mutt-misc-1.0.3.tar.bz2][font-mutt-misc_upstream] | | [] | [] |
-| [font-schumacher-misc] | 1.1.2 | [font-schumacher-misc-1.1.2.tar.bz2][font-schumacher-misc_upstream] | | [] | [] |
-| [font-screen-cyrillic] | 1.0.4 | [font-screen-cyrillic-1.0.4.tar.bz2][font-screen-cyrillic_upstream] | | [] | [] |
-| [font-sony-misc] | 1.0.3 | [font-sony-misc-1.0.3.tar.bz2][font-sony-misc_upstream] | | [] | [] |
-| [font-sun-misc] | 1.0.3 | [font-sun-misc-1.0.3.tar.bz2][font-sun-misc_upstream] | | [] | [] |
-| [font-util] | 1.3.0 | [font-util-1.3.0.tar.bz2][font-util_upstream] | | [] | [] |
-| [font-winitzki-cyrillic] | 1.0.3 | [font-winitzki-cyrillic-1.0.3.tar.bz2][font-winitzki-cyrillic_upstream] | | [] | [] |
-| [font-xfree86-type1] | 1.0.4 | [font-xfree86-type1-1.0.4.tar.bz2][font-xfree86-type1_upstream] | | [] | [] |
-| [fontconfig] | 2.11.1 | [fontconfig-2.11.1.tar.bz2][fontconfig_upstream] | [1 KiB][fontconfig_patch] | [] | [] |
-| [fontsproto] | 2.1.2 | [fontsproto-2.1.2.tar.bz2][fontsproto_upstream] | | [] | [] |
-| [freealut] | 1.1.0 | [freealut-1.1.0.tar.gz][freealut_upstream] | [888 B][freealut_patch] | [] | [] |
-| [freeimage] | 3.17.0 | [FreeImage3170.zip][freeimage_upstream] | [1 KiB][freeimage_patch] | [] | [] |
-| [freetype] | 2.5.5 | [freetype-2.5.5.tar.bz2][freetype_upstream] | | [] | [] |
-| [fuseiso] | 20070708 | [fuseiso-20070708.tar.bz2][fuseiso_upstream] | [22 KiB][fuseiso_patch] | [] | [] |
-| [fvwm] | 2.6.5 | [fvwm-2.6.5.tar.bz2][fvwm_upstream] | [7 KiB][fvwm_patch] | [] | [] |
-| [gawk] | 4.1.1 | [gawk-4.1.1.tar.gz][gawk_upstream] | [1 KiB][gawk_patch] | [] | [] |
-| [gc] | 6.8 | [gc6.8.tar.gz][gc_upstream] | [21 KiB][gc_patch] | [] | [] |
-| [gcc] | 396037926 | [None][gcc_upstream] | [4 KiB][gcc_patch] | newlib | [] |
-| [gcc-avr] | 5.1.0 | [gcc-5.1.0.tar.bz2][gcc-avr_upstream] | [7 KiB][gcc-avr_patch] | [] | arm |
-| [gdb] | 7.7 | [None][gdb_upstream] | [7 KiB][gdb_patch] | [] | [] |
-| [gdk-pixbuf] | 2.30.8 | [gdk-pixbuf-2.30.8.tar.xz][gdk-pixbuf_upstream] | | [] | [] |
-| [gegl] | 0.2.0 | [gegl-0.2.0.tar.bz2][gegl_upstream] | | [] | [] |
-| [gettext] | 0.19.2 | [gettext-0.19.2.tar.xz][gettext_upstream] | [4 KiB][gettext_patch] | [] | [] |
-| [gflags] | 2.1.2 | [gflags-2.1.2.tar.gz][gflags_upstream] | [583 B][gflags_patch] | [] | [] |
-| [gforth] | 0.7.2 | [gforth-0.7.2.tar.gz][gforth_upstream] | [9 KiB][gforth_patch] | [] | [] |
-| [giflib] | 4.2.1 | [giflib-4.2.1.tar.bz2][giflib_upstream] | | [] | [] |
-| [gimp] | 2.8.14 | [gimp-2.8.14.tar.bz2][gimp_upstream] | [937 B][gimp_patch] | [] | [] |
-| [git] | 2.3.0 | [git-2.3.0.tar.gz][git_upstream] | [18 KiB][git_patch] | [] | [] |
-| [glib] | 2.45.2 | [glib-2.45.2.tar.xz][glib_upstream] | [3 KiB][glib_patch] | [] | [] |
-| [glproto] | 1.4.15 | [glproto-1.4.15.tar.bz2][glproto_upstream] | | [] | [] |
-| [gmock] | 1.5.0 | [gmock-1.5.0.tar.gz][gmock_upstream] | [657 B][gmock_patch] | [] | [] |
-| [gmp] | 5.0.2 | [gmp-5.0.2.tar.bz2][gmp_upstream] | | [] | [] |
-| [google-api-python-client] | 1.2 | [google-api-python-client-1.2.tar.gz][google-api-python-client_upstream] | | [] | [] |
-| [grep] | 2.21 | [grep-2.21.tar.xz][grep_upstream] | [5 KiB][grep_patch] | [] | [] |
-| [grpc] | 0.12.0 | [None][grpc_upstream] | [36 KiB][grpc_patch] | [] | [] |
-| [gsl] | 1.16 | [gsl-1.16.tar.gz][gsl_upstream] | | [] | [] |
-| [gtest] | 1.7.0+ | [None][gtest_upstream] | [6 KiB][gtest_patch] | [] | [] |
-| [gtk+] | 2.24.28 | [gtk+-2.24.28.tar.xz][gtk+_upstream] | [1 KiB][gtk+_patch] | newlib | [] |
-| [gzip] | 1.6 | [gzip-1.6.tar.gz][gzip_upstream] | [8 KiB][gzip_patch] | [] | [] |
-| [h5py] | 2.2.1 | [h5py-2.2.1.tar.gz][h5py_upstream] | | [] | [] |
-| [harfbuzz] | 0.9.41 | [harfbuzz-0.9.41.tar.bz2][harfbuzz_upstream] | | [] | [] |
-| [hdf5] | 1.8.12 | [hdf5-1.8.12.tar.gz][hdf5_upstream] | [7 KiB][hdf5_patch] | [] | [] |
-| [hello] | 2.10 | [hello-2.10.tar.gz][hello_upstream] | | [] | [] |
-| [httplib2] | 0.9 | [httplib2-0.9.tar.gz][httplib2_upstream] | | [] | [] |
-| [icu] | 53.1 | [icu4c-53_1-src.tgz][icu_upstream] | [2 KiB][icu_patch] | [] | [] |
-| [id3lib] | 3.8.3 | [id3lib-3.8.3.tar.gz][id3lib_upstream] | [2 KiB][id3lib_patch] | [] | [] |
-| [imagemagick] | 6.9.0-2 | [ImageMagick-6.9.0-2.tar.bz2][imagemagick_upstream] | | [] | [] |
-| [inputproto] | 2.2 | [inputproto-2.2.tar.bz2][inputproto_upstream] | | [] | [] |
-| [ipython] | 2.1.0 | [ipython-2.1.0.tar.gz][ipython_upstream] | [2 KiB][ipython_patch] | [] | [] |
-| [jinja2] | 2.7.2 | [Jinja2-2.7.2.tar.gz][jinja2_upstream] | | [] | [] |
-| [jpeg6b] | 6b | [jpegsrc.v6b.tar.gz][jpeg6b_upstream] | [315 B][jpeg6b_patch] | [] | [] |
-| [jpeg8d] | 8d | [jpegsrc.v8d.tar.gz][jpeg8d_upstream] | | [] | [] |
-| [json-glib] | 1.0.4 | [json-glib-1.0.4.tar.xz][json-glib_upstream] | | [] | [] |
-| [jsoncpp] | 1.6.1 | [jsoncpp-1.6.1.tar.gz][jsoncpp_upstream] | [1 KiB][jsoncpp_patch] | [] | [] |
-| [kbproto] | 1.0.6 | [kbproto-1.0.6.tar.bz2][kbproto_upstream] | | [] | [] |
-| [lame] | 3.99.5 | [lame-3.99.5.tar.gz][lame_upstream] | | [] | [] |
-| [lcms] | 2.4 | [lcms2-2.4.tar.gz][lcms_upstream] | | [] | [] |
-| [less] | 451 | [less-451.tar.gz][less_upstream] | [315 B][less_patch] | [] | [] |
-| [leveldb] | 1.18 | [leveldb-1.18.tar.gz][leveldb_upstream] | [3 KiB][leveldb_patch] | [] | [] |
-| [libarchive] | 3.1.2 | [libarchive-3.1.2.tar.gz][libarchive_upstream] | [634 B][libarchive_patch] | [] | [] |
-| [libarchive-dev] | 0.1 | [None][libarchive-dev_upstream] | [3 KiB][libarchive-dev_patch] | [] | [] |
-| [libatomic-ops] | 7.4.0 | [libatomic_ops-7.4.0.tar.gz][libatomic-ops_upstream] | | [] | pnacl |
-| [libav] | 9.6 | [libav-9.6.tar.xz][libav_upstream] | [1 KiB][libav_patch] | [] | arm |
-| [libbsd] | 0.7.0 | [libbsd-0.7.0.tar.xz][libbsd_upstream] | [4 KiB][libbsd_patch] | [] | [] |
-| [libebml] | 1.3.1 | [libebml-1.3.1.tar.bz2][libebml_upstream] | [268 B][libebml_patch] | [] | [] |
-| [libelf] | 0.8.13 | [libelf-0.8.13.tar.gz][libelf_upstream] | | [] | [] |
-| [libevent] | 2.0.22-stable | [libevent-2.0.22-stable.tar.gz][libevent_upstream] | [1 KiB][libevent_patch] | [] | [] |
-| [libffi] | 3.2.1 | [libffi-3.2.1.tar.gz][libffi_upstream] | [1 KiB][libffi_patch] | [] | [] |
-| [libfontenc] | 1.1.1 | [libfontenc-1.1.1.tar.bz2][libfontenc_upstream] | | [] | [] |
-| [libgit2] | 0.21.2 | [libgit2-0.21.2.tar.gz][libgit2_upstream] | [31 KiB][libgit2_patch] | [] | [] |
-| [libhangul] | 0.1.0 | [libhangul-0.1.0.tar.gz][libhangul_upstream] | [230 B][libhangul_patch] | [] | [] |
-| [libice] | 1.0.8 | [libICE-1.0.8.tar.bz2][libice_upstream] | [316 B][libice_patch] | [] | [] |
-| [libiconv] | 1.14 | [libiconv-1.14.tar.gz][libiconv_upstream] | [530 B][libiconv_patch] | [] | [] |
-| [libmatroska] | 1.4.2 | [libmatroska-1.4.2.tar.bz2][libmatroska_upstream] | | [] | [] |
-| [libmikmod] | 3.1.11 | [libmikmod-3.1.11.tar.gz][libmikmod_upstream] | | [] | [] |
-| [libmng] | 1.0.10 | [libmng-1.0.10.tar.gz][libmng_upstream] | [301 B][libmng_patch] | [] | [] |
-| [libmodplug] | 0.8.7 | [libmodplug-0.8.7.tar.gz][libmodplug_upstream] | | [] | [] |
-| [libogg] | 1.3.0 | [libogg-1.3.0.tar.gz][libogg_upstream] | | [] | [] |
-| [liboggz] | 1.1.1 | [liboggz-1.1.1.tar.gz][liboggz_upstream] | [727 B][liboggz_patch] | [] | [] |
-| [libpciaccess] | 0.13.1 | [libpciaccess-0.13.1.tar.bz2][libpciaccess_upstream] | | [] | [] |
-| [libpng] | 1.6.20 | [libpng-1.6.20.tar.gz][libpng_upstream] | [325 B][libpng_patch] | [] | [] |
-| [libpng12] | 1.2.51 | [libpng-1.2.51.tar.gz][libpng12_upstream] | | [] | [] |
-| [libsm] | 1.2.1 | [libSM-1.2.1.tar.bz2][libsm_upstream] | | [] | [] |
-| [libsodium] | 1.0.3 | [libsodium-1.0.3.tar.gz][libsodium_upstream] | | [] | [] |
-| [libssh] | 0.6.0 | [libssh-0.6.0.tar.xz][libssh_upstream] | [3 KiB][libssh_patch] | [] | [] |
-| [libssh2] | 1.4.3 | [libssh2-1.4.3.tar.gz][libssh2_upstream] | [267 B][libssh2_patch] | [] | [] |
-| [libtar] | 1.2.11 | [libtar-1.2.11.tar.gz][libtar_upstream] | [4 KiB][libtar_patch] | [] | [] |
-| [libtheora] | 1.1.1 | [libtheora-1.1.1.tar.bz2][libtheora_upstream] | [1 KiB][libtheora_patch] | [] | [] |
-| [libtomcrypt] | 1.17 | [crypt-1.17.tar.bz2][libtomcrypt_upstream] | [2 KiB][libtomcrypt_patch] | [] | [] |
-| [libtommath] | 0.41 | [ltm-0.41.tar.bz2][libtommath_upstream] | [2 KiB][libtommath_patch] | [] | [] |
-| [libtool] | 2.4 | [libtool-2.4.tar.xz][libtool_upstream] | | [] | [] |
-| [libunistring] | 0.9.3 | [libunistring-0.9.3.tar.gz][libunistring_upstream] | | [] | [] |
-| [libuuid] | 1.0.3 | [libuuid-1.0.3.tar.gz][libuuid_upstream] | [228 B][libuuid_patch] | [] | [] |
-| [libvorbis] | 1.3.3 | [libvorbis-1.3.3.tar.gz][libvorbis_upstream] | | [] | [] |
-| [libvpx] | 1.4.0 | [libvpx-1.4.0.tar.bz2][libvpx_upstream] | | [] | [] |
-| [libwebp] | 0.4.3 | [libwebp-0.4.3.tar.gz][libwebp_upstream] | | [] | [] |
-| [libx11] | 1.5.0 | [libX11-1.5.0.tar.bz2][libx11_upstream] | [3 KiB][libx11_patch] | [] | [] |
-| [libxau] | 1.0.7 | [libXau-1.0.7.tar.bz2][libxau_upstream] | | [] | [] |
-| [libxaw] | 1.0.11 | [libXaw-1.0.11.tar.bz2][libxaw_upstream] | [2 KiB][libxaw_patch] | [] | [] |
-| [libxcb] | 1.8.1 | [libxcb-1.8.1.tar.bz2][libxcb_upstream] | [1 KiB][libxcb_patch] | [] | [] |
-| [libxext] | 1.3.1 | [libXext-1.3.1.tar.bz2][libxext_upstream] | | [] | [] |
-| [libxfont] | 1.4.5 | [libXfont-1.4.5.tar.bz2][libxfont_upstream] | | [] | [] |
-| [libxi] | 1.6.1 | [libXi-1.6.1.tar.bz2][libxi_upstream] | | [] | [] |
-| [libxinerama] | 1.1.2 | [libXinerama-1.1.2.tar.bz2][libxinerama_upstream] | | [] | [] |
-| [libxkbfile] | 1.0.8 | [libxkbfile-1.0.8.tar.bz2][libxkbfile_upstream] | [355 B][libxkbfile_patch] | [] | [] |
-| [libxml2] | 2.7.8 | [libxml2-2.7.8.tar.gz][libxml2_upstream] | [367 B][libxml2_patch] | [] | [] |
-| [libxmu] | 1.1.1 | [libXmu-1.1.1.tar.bz2][libxmu_upstream] | [451 B][libxmu_patch] | [] | [] |
-| [libxpm] | 3.5.10 | [libXpm-3.5.10.tar.bz2][libxpm_upstream] | | [] | [] |
-| [libxrender] | 0.9.7 | [libXrender-0.9.7.tar.bz2][libxrender_upstream] | | [] | [] |
-| [libxt] | 1.1.3 | [libXt-1.1.3.tar.bz2][libxt_upstream] | [1 KiB][libxt_patch] | [] | [] |
-| [libxtst] | 1.2.1 | [libXtst-1.2.1.tar.bz2][libxtst_upstream] | | [] | [] |
-| [libyuv] | 632c50f | [None][libyuv_upstream] | [788 B][libyuv_patch] | [] | [] |
-| [lua] | 5.3.0 | [lua-5.3.0.tar.gz][lua_upstream] | [1 KiB][lua_patch] | [] | [] |
-| [m4] | 1.4.17 | [m4-1.4.17.tar.xz][m4_upstream] | [5 KiB][m4_patch] | [] | [] |
-| [make] | 3.82 | [make-3.82.tar.gz][make_upstream] | [1 KiB][make_patch] | [] | [] |
-| [markupsafe] | 0.19 | [MarkupSafe-0.19.tar.gz][markupsafe_upstream] | | [] | [] |
-| [matplotlib] | 1.3.1 | [matplotlib-1.3.1.tar.gz][matplotlib_upstream] | [5 KiB][matplotlib_patch] | [] | [] |
-| [mesa] | 7.6 | [MesaLib-7.6.tar.gz][mesa_upstream] | [7 KiB][mesa_patch] | [] | [] |
-| [metakit] | 2.4.9.7 | [metakit-2.4.9.7.tar.gz][metakit_upstream] | [3 KiB][metakit_patch] | [] | [] |
-| [mongoose] | 3.8 | [mongoose-3.8.tgz][mongoose_upstream] | [2 KiB][mongoose_patch] | newlib | [] |
-| [mp4v2] | 2.0.0 | [mp4v2-2.0.0.tar.bz2][mp4v2_upstream] | | [] | [] |
-| [mpc] | 1.0.1 | [mpc-1.0.1.tar.gz][mpc_upstream] | | [] | [] |
-| [mpfr] | 3.1.2 | [mpfr-3.1.2.tar.bz2][mpfr_upstream] | | [] | [] |
-| [mpg123] | 1.20.0 | [mpg123-1.20.0.tar.bz2][mpg123_upstream] | | [] | [] |
-| [nano] | 2.2.6 | [nano-2.2.6.tar.gz][nano_upstream] | [1 KiB][nano_patch] | [] | [] |
-| [ncurses] | 5.9 | [ncurses-5.9.tar.gz][ncurses_upstream] | [5 KiB][ncurses_patch] | [] | [] |
-| [netcat] | 0.7.1 | [netcat-0.7.1.tar.bz2][netcat_upstream] | [2 KiB][netcat_patch] | [] | [] |
-| [nethack] | 3.4.3 | [nethack-343-src.tgz][nethack_upstream] | [9 KiB][nethack_patch] | [] | [] |
-| [nettle] | 2.7 | [nettle-2.7.tar.gz][nettle_upstream] | [640 B][nettle_patch] | [] | [] |
-| [ninja] | 1.5.3 | [ninja-v1.5.3.tar.gz][ninja_upstream] | [12 KiB][ninja_patch] | [] | [] |
-| [nose] | 1.3.0 | [nose-1.3.0.tar.gz][nose_upstream] | | [] | [] |
-| [numpy] | 1.8.0 | [numpy-1.8.0.tar.gz][numpy_upstream] | [6 KiB][numpy_patch] | [] | [] |
-| [openal-soft] | 1.16.0 | [openal-soft-1.16.0.tar.bz2][openal-soft_upstream] | [18 KiB][openal-soft_patch] | [] | [] |
-| [opencv] | 2.4.9 | [opencv-2.4.9.tar.gz][opencv_upstream] | [9 KiB][opencv_patch] | [] | arm |
-| [openjpeg] | 2.1.0 | [openjpeg-2.1.0.tar.gz][openjpeg_upstream] | | [] | [] |
-| [openscenegraph] | 2.9.7 | [OpenSceneGraph-2.9.7.zip][openscenegraph_upstream] | [40 KiB][openscenegraph_patch] | [] | arm |
-| [openssh] | 5.9p1 | [openssh-5.9p1.tar.gz][openssh_upstream] | [3 KiB][openssh_patch] | newlib | [] |
-| [openssl] | 1.0.2e | [openssl-1.0.2e.tar.gz][openssl_upstream] | [3 KiB][openssl_patch] | [] | [] |
-| [pandas] | 0.13.1 | [pandas-0.13.1.tar.gz][pandas_upstream] | [26 KiB][pandas_patch] | glibc | [] |
-| [pango] | 1.36.8 | [pango-1.36.8.tar.xz][pango_upstream] | | [] | [] |
-| [pcre] | 8.36 | [pcre-8.36.tar.bz2][pcre_upstream] | [546 B][pcre_patch] | [] | [] |
-| [perl] | 5.20.2 | [perl-5.20.2.tar.gz][perl_upstream] | [10 KiB][perl_patch] | [] | [] |
-| [physfs] | 2.0.3 | [physfs-2.0.3.tar.bz2][physfs_upstream] | [1 KiB][physfs_patch] | [] | [] |
-| [pixman] | 0.32.4 | [pixman-0.32.4.tar.gz][pixman_upstream] | [633 B][pixman_patch] | [] | [] |
-| [pkg] | 1.6.1 | [pkg-1.6.1.tar.gz][pkg_upstream] | [58 KiB][pkg_patch] | [] | [] |
-| [pnacl] | 0.0.1 | [None][pnacl_upstream] | [4 KiB][pnacl_patch] | [] | [] |
-| [pnacl-binutils-src] | 0.0.1 | [None][pnacl-binutils-src_upstream] | [11 KiB][pnacl-binutils-src_patch] | [] | [] |
-| [pnacl-binutils-x86-src] | 0.0.1 | [None][pnacl-binutils-x86-src_upstream] | | [] | [] |
-| [pnacl-clang-src] | 0.0.1 | [None][pnacl-clang-src_upstream] | [1 KiB][pnacl-clang-src_patch] | [] | [] |
-| [pnacl-llvm-src] | 0.0.1 | [None][pnacl-llvm-src_upstream] | [13 KiB][pnacl-llvm-src_patch] | [] | [] |
-| [poly2tri] | 26242d0aa7b8 | [26242d0aa7b8.tar.gz][poly2tri_upstream] | | [] | [] |
-| [protobuf] | 3.0.0-beta-2 | [protobuf-cpp-3.0.0-beta-2.tar.gz][protobuf_upstream] | [7 KiB][protobuf_patch] | [] | [] |
-| [protobuf-c] | 1.0.2 | [protobuf-c-1.0.2.tar.gz][protobuf-c_upstream] | | [] | [] |
-| [pyparsing] | 2.0.1 | [pyparsing-2.0.1.tar.gz][pyparsing_upstream] | | [] | [] |
-| [pyppapi] | 0.4 | [pyppapi-0.4.tar.gz][pyppapi_upstream] | | [] | [] |
-| [python] | 2.7.10 | [Python-2.7.10.tgz][python_upstream] | [29 KiB][python_patch] | [] | [] |
-| [python-dateutil] | 2.2 | [python-dateutil-2.2.tar.gz][python-dateutil_upstream] | | [] | [] |
-| [python-gflags] | 2.0 | [python-gflags-2.0.tar.gz][python-gflags_upstream] | | [] | [] |
-| [python-host] | 2.7.10 | [Python-2.7.10.tgz][python-host_upstream] | [3 KiB][python-host_patch] | [] | [] |
-| [python-static] | 2.7.10 | [Python-2.7.10.tgz][python-static_upstream] | [30 KiB][python-static_patch] | [] | [] |
-| [python3] | 3.4.2 | [Python-3.4.2.tar.xz][python3_upstream] | [14 KiB][python3_patch] | [] | [] |
-| [pytz] | 2014.2 | [pytz-2014.2.tar.gz][pytz_upstream] | | glibc | [] |
-| [pyzmq] | 13.1.0 | [pyzmq-13.1.0.tar.gz][pyzmq_upstream] | [168 KiB][pyzmq_patch] | [] | [] |
-| [quakespasm] | 0.85.9 | [quakespasm-0.85.9.tgz][quakespasm_upstream] | [6 KiB][quakespasm_patch] | [] | [] |
-| [randrproto] | 1.3.2 | [randrproto-1.3.2.tar.bz2][randrproto_upstream] | | [] | [] |
-| [readline] | 6.3 | [readline-6.3.tar.gz][readline_upstream] | [838 B][readline_patch] | [] | [] |
-| [recordproto] | 1.14.2 | [recordproto-1.14.2.tar.bz2][recordproto_upstream] | | [] | [] |
-| [regal] | 5e14ae7 | [Regal-5e14ae7.tar.gz][regal_upstream] | [18 KiB][regal_patch] | [] | [] |
-| [renderproto] | 0.11.1 | [renderproto-0.11.1.tar.bz2][renderproto_upstream] | | [] | [] |
-| [requests] | 2.3.0 | [requests-2.3.0.tar.gz][requests_upstream] | | [] | [] |
-| [resourceproto] | 1.2.0 | [resourceproto-1.2.0.tar.bz2][resourceproto_upstream] | | [] | [] |
-| [ruby] | 2.0.0-p247 | [ruby-2.0.0-p247.tar.gz][ruby_upstream] | [14 KiB][ruby_patch] | [] | [] |
-| [samba] | 4.1.16 | [samba-4.1.16.tar.gz][samba_upstream] | [17 KiB][samba_patch] | newlib | i686 |
-| [scrnsaverproto] | 1.2.2 | [scrnsaverproto-1.2.2.tar.bz2][scrnsaverproto_upstream] | | [] | [] |
-| [scummvm] | 1.7.0 | [scummvm-1.7.0.tar.gz][scummvm_upstream] | [11 KiB][scummvm_patch] | [] | [] |
-| [sdl] | 1.2.15 | [None][sdl_upstream] | | [] | [] |
-| [sdl-image] | 1.2.12 | [SDL_image-1.2.12.tar.gz][sdl-image_upstream] | | [] | [] |
-| [sdl-mixer] | 1.2.11 | [SDL_mixer-1.2.11.tar.gz][sdl-mixer_upstream] | | [] | [] |
-| [sdl-net] | 1.2.7 | [SDL_net-1.2.7.tar.gz][sdl-net_upstream] | | [] | [] |
-| [sdl-tests] | 1.2.14 | [SDL-1.2.14.tar.gz][sdl-tests_upstream] | [789 B][sdl-tests_patch] | [] | [] |
-| [sdl-ttf] | 2.0.10 | [SDL_ttf-2.0.10.tar.gz][sdl-ttf_upstream] | [345 B][sdl-ttf_patch] | [] | [] |
-| [sdl2] | 2.0.3 | [None][sdl2_upstream] | [635 B][sdl2_patch] | [] | [] |
-| [sdl2-gfx] | 1.0.0 | [SDL2_gfx-1.0.0.tar.gz][sdl2-gfx_upstream] | | [] | [] |
-| [sdl2-image] | 2.0.0 | [SDL2_image-2.0.0.tar.gz][sdl2-image_upstream] | | [] | [] |
-| [sdl2-tests] | 2.0.3 | [None][sdl2-tests_upstream] | [889 B][sdl2-tests_patch] | [] | [] |
-| [sdl2-ttf] | 2.0.12 | [SDL2_ttf-2.0.12.tar.gz][sdl2-ttf_upstream] | [537 B][sdl2-ttf_patch] | [] | [] |
-| [sdlquake] | 1.0.9 | [sdlquake-1.0.9.tar.gz][sdlquake_upstream] | [5 KiB][sdlquake_patch] | [] | [] |
-| [setuptools] | 2.0.1 | [setuptools-2.0.1.tar.gz][setuptools_upstream] | | [] | [] |
-| [six] | 1.5.2 | [six-1.5.2.tar.gz][six_upstream] | | [] | [] |
-| [snes9x] | 1.53 | [snes9x-1.53-src.tar.bz2][snes9x_upstream] | [35 KiB][snes9x_patch] | [] | [] |
-| [speex] | 1.2rc1 | [speex-1.2rc1.tar.gz][speex_upstream] | | [] | [] |
-| [sqlite] | 3071601 | [sqlite-autoconf-3071601.tar.gz][sqlite_upstream] | [1 KiB][sqlite_patch] | [] | [] |
-| [stoken] | 0.90 | [stoken-0.90.tar.gz][stoken_upstream] | | [] | [] |
-| [subversion] | 1.8.11 | [subversion-1.8.11.tar.bz2][subversion_upstream] | [894 B][subversion_patch] | [] | [] |
-| [sympy] | 0.7.4.1 | [sympy-0.7.4.1.tar.gz][sympy_upstream] | | [] | [] |
-| [tar] | 1.28 | [tar-1.28.tar.bz2][tar_upstream] | [1 KiB][tar_patch] | [] | [] |
-| [tcl] | 8.6.1 | [tcl8.6.1-src.tar.gz][tcl_upstream] | [2 KiB][tcl_patch] | [] | [] |
-| [texinfo] | 6.0 | [texinfo-6.0.tar.gz][texinfo_upstream] | | [] | [] |
-| [texlive] | 2015 | [texlive-20150521-source.tar.xz][texlive_upstream] | [31 KiB][texlive_patch] | [] | arm, pnacl |
-| [thingking] | 1.0.2 | [thingking-1.0.2.tar.gz][thingking_upstream] | [413 B][thingking_patch] | [] | [] |
-| [thttpd] | 2.25b | [thttpd-2.25b.tar.gz][thttpd_upstream] | [27 KiB][thttpd_patch] | newlib | [] |
-| [tiff] | 4.0.3 | [tiff-4.0.3.tar.gz][tiff_upstream] | | [] | [] |
-| [tinyxml] | 2.6.2 | [tinyxml_2_6_2.tar.gz][tinyxml_upstream] | [2 KiB][tinyxml_patch] | [] | [] |
-| [tk] | 8.6.1 | [tk8.6.1-src.tar.gz][tk_upstream] | [441 B][tk_patch] | [] | [] |
-| [toybox] | 0.4.7 | [toybox-0.4.7.tar.bz2][toybox_upstream] | [20 KiB][toybox_patch] | [] | [] |
-| [tree] | 1.7.0 | [tree-1.7.0.tgz][tree_upstream] | [290 B][tree_patch] | [] | [] |
-| [twm] | X11R6-xc-fix13 | [twm-X11R6-xc-fix13.tar.gz][twm_upstream] | | [] | [] |
-| [unzip] | 6.0 | [unzip60.zip][unzip_upstream] | [2 KiB][unzip_patch] | [] | [] |
-| [videoproto] | 2.3.1 | [videoproto-2.3.1.tar.bz2][videoproto_upstream] | | [] | [] |
-| [vim] | 7.4 | [vim-7.4.tar.bz2][vim_upstream] | [3 KiB][vim_patch] | [] | [] |
-| [wireshark] | 1.10.11 | [wireshark-1.10.11.tar.bz2][wireshark_upstream] | [7 KiB][wireshark_patch] | glibc | [] |
-| [x264] | snapshot-20140829-2245-stable | [x264-snapshot-20140829-2245-stable.tar.bz2][x264_upstream] | [1 KiB][x264_patch] | [] | [] |
-| [xaos] | 3.6 | [xaos-3.6.tar.gz][xaos_upstream] | [2 KiB][xaos_patch] | [] | [] |
-| [xbitmaps] | 1.1.1 | [xbitmaps-1.1.1.tar.bz2][xbitmaps_upstream] | | [] | [] |
-| [xcb-proto] | 1.7.1 | [xcb-proto-1.7.1.tar.bz2][xcb-proto_upstream] | | [] | [] |
-| [xcb-util] | 0.3.9 | [xcb-util-0.3.9.tar.bz2][xcb-util_upstream] | | [] | [] |
-| [xcmiscproto] | 1.2.2 | [xcmiscproto-1.2.2.tar.bz2][xcmiscproto_upstream] | | [] | [] |
-| [xextproto] | 7.2.1 | [xextproto-7.2.1.tar.bz2][xextproto_upstream] | | [] | [] |
-| [xeyes] | 1.0.1 | [xeyes-1.0.1.tar.bz2][xeyes_upstream] | | [] | [] |
-| [xineramaproto] | 1.2.1 | [xineramaproto-1.2.1.tar.bz2][xineramaproto_upstream] | | [] | [] |
-| [xkbcomp] | 1.2.4 | [xkbcomp-1.2.4.tar.bz2][xkbcomp_upstream] | [595 B][xkbcomp_patch] | [] | [] |
-| [xkeyboard-config] | 2.6 | [xkeyboard-config-2.6.tar.bz2][xkeyboard-config_upstream] | [10 KiB][xkeyboard-config_patch] | [] | [] |
-| [xorg-server] | 1.12.2 | [xorg-server-1.12.2.tar.bz2][xorg-server_upstream] | [9 KiB][xorg-server_patch] | [] | [] |
-| [xproto] | 7.0.23 | [xproto-7.0.23.tar.bz2][xproto_upstream] | [902 B][xproto_patch] | [] | [] |
-| [xtrans] | 1.2.7 | [xtrans-1.2.7.tar.bz2][xtrans_upstream] | [2 KiB][xtrans_patch] | [] | [] |
-| [xz] | 5.2.0 | [xz-5.2.0.tar.xz][xz_upstream] | | [] | [] |
-| [yajl] | 2.0.4 | [yajl-2.0.4.zip][yajl_upstream] | [2 KiB][yajl_patch] | [] | [] |
-| [yt] | 3.0 | [yt-3.0.tar.gz][yt_upstream] | | [] | [] |
-| [zeromq] | 4.0.3 | [zeromq-4.0.3.tar.gz][zeromq_upstream] | [4 KiB][zeromq_patch] | [] | [] |
-| [zlib] | 1.2.8 | [zlib-1.2.8.tar.gz][zlib_upstream] | [592 B][zlib_patch] | [] | [] |
-
-_Total = 324_
-
-# Local Ports (not based on upstream sources) =
-
-- [agg-demo][agg-demo]
-- [alut-demo][alut-demo]
-- [corelibs][corelibs]
-- [devenv][devenv]
-- [devenv-latest][devenv-latest]
-- [dreadthread][dreadthread]
-- [geturl][geturl]
-- [gimp-app][gimp-app]
-- [glibc-compat][glibc-compat]
-- [gtk-demo][gtk-demo]
-- [ipython-ppapi][ipython-ppapi]
-- [libgit2-demo][libgit2-demo]
-- [mesa-demo][mesa-demo]
-- [mingn][mingn]
-- [nacl-spawn][nacl-spawn]
-- [openal-ogg-demo][openal-ogg-demo]
-- [ruby-ppapi][ruby-ppapi]
-- [xfonts][xfonts]
-
-_Total = 18_
-
-[agg]: https://chromium.googlesource.com/webports/+/master/ports/agg
-[agg_patch]: https://chromium.googlesource.com/webports/+/master/ports/agg/nacl.patch
-[agg_upstream]: http://www.antigrain.com/agg-2.5.tar.gz
-[agg-demo]: https://chromium.googlesource.com/webports/+/master/ports/agg-demo
-[alut-demo]: https://chromium.googlesource.com/webports/+/master/ports/alut-demo
-[apr]: https://chromium.googlesource.com/webports/+/master/ports/apr
-[apr_patch]: https://chromium.googlesource.com/webports/+/master/ports/apr/nacl.patch
-[apr_upstream]: http://apache.mirrors.pair.com/apr/apr-1.5.0.tar.bz2
-[apr-util]: https://chromium.googlesource.com/webports/+/master/ports/apr-util
-[apr-util_upstream]: http://apache.mirrors.pair.com/apr/apr-util-1.5.3.tar.bz2
-[atk]: https://chromium.googlesource.com/webports/+/master/ports/atk
-[atk_upstream]: ftp://ftp.gnome.org/pub/gnome/sources/atk/2.16/atk-2.16.0.tar.xz
-[avrdude]: https://chromium.googlesource.com/webports/+/master/ports/avrdude
-[avrdude_patch]: https://chromium.googlesource.com/webports/+/master/ports/avrdude/nacl.patch
-[avrdude_upstream]: http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz
-[babl]: https://chromium.googlesource.com/webports/+/master/ports/babl
-[babl_upstream]: http://download.gimp.org/pub/babl/0.1/babl-0.1.12.tar.bz2
-[bash]: https://chromium.googlesource.com/webports/+/master/ports/bash
-[bash_patch]: https://chromium.googlesource.com/webports/+/master/ports/bash/nacl.patch
-[bash_upstream]: http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
-[bdftopcf]: https://chromium.googlesource.com/webports/+/master/ports/bdftopcf
-[bdftopcf_upstream]: http://www.x.org/releases/X11R7.7/src/everything/bdftopcf-1.0.3.tar.bz2
-[bigreqsproto]: https://chromium.googlesource.com/webports/+/master/ports/bigreqsproto
-[bigreqsproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/bigreqsproto-1.1.2.tar.bz2
-[binutils]: https://chromium.googlesource.com/webports/+/master/ports/binutils
-[binutils_patch]: https://chromium.googlesource.com/webports/+/master/ports/binutils/nacl.patch
-[binutils_upstream]: https://chromium.googlesource.com/native_client/nacl-binutils.git@7dc2f2590
-[binutils-2.25]: https://chromium.googlesource.com/webports/+/master/ports/binutils-2.25
-[binutils-2.25_patch]: https://chromium.googlesource.com/webports/+/master/ports/binutils-2.25/nacl.patch
-[binutils-2.25_upstream]: http://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.bz2
-[bison]: https://chromium.googlesource.com/webports/+/master/ports/bison
-[bison_patch]: https://chromium.googlesource.com/webports/+/master/ports/bison/nacl.patch
-[bison_upstream]: http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.xz
-[blackbox]: https://chromium.googlesource.com/webports/+/master/ports/blackbox
-[blackbox_patch]: https://chromium.googlesource.com/webports/+/master/ports/blackbox/nacl.patch
-[blackbox_upstream]: http://download.sf.net/blackboxwm/blackboxwm/Blackbox%200.70.1/blackbox-0.70.1.tar.bz2
-[blis]: https://chromium.googlesource.com/webports/+/master/ports/blis
-[blis_patch]: https://chromium.googlesource.com/webports/+/master/ports/blis/nacl.patch
-[blis_upstream]: http://github.com/flame/blis/archive/0.1.5/blis-0.1.5.tar.gz
-[bochs]: https://chromium.googlesource.com/webports/+/master/ports/bochs
-[bochs_patch]: https://chromium.googlesource.com/webports/+/master/ports/bochs/nacl.patch
-[bochs_upstream]: http://downloads.sf.net/bochs/bochs/2.6.2/bochs-2.6.2.tar.gz
-[boost]: https://chromium.googlesource.com/webports/+/master/ports/boost
-[boost_patch]: https://chromium.googlesource.com/webports/+/master/ports/boost/nacl.patch
-[boost_upstream]: http://downloads.sf.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2
-[boringssl]: https://chromium.googlesource.com/webports/+/master/ports/boringssl
-[boringssl_patch]: https://chromium.googlesource.com/webports/+/master/ports/boringssl/nacl.patch
-[boringssl_upstream]: https://boringssl.googlesource.com/boringssl.git@e8fe07f
-[box2d]: https://chromium.googlesource.com/webports/+/master/ports/box2d
-[box2d_patch]: https://chromium.googlesource.com/webports/+/master/ports/box2d/nacl.patch
-[box2d_upstream]: http://box2d.googlecode.com/files/Box2D_v2.2.1.zip
-[bullet]: https://chromium.googlesource.com/webports/+/master/ports/bullet
-[bullet_patch]: https://chromium.googlesource.com/webports/+/master/ports/bullet/nacl.patch
-[bullet_upstream]: https://bullet.googlecode.com/files/bullet-2.81-rev2613.zip
-[busybox]: https://chromium.googlesource.com/webports/+/master/ports/busybox
-[busybox_upstream]: http://busybox.net/downloads/busybox-1.22.0.tar.bz2
-[bzip2]: https://chromium.googlesource.com/webports/+/master/ports/bzip2
-[bzip2_patch]: https://chromium.googlesource.com/webports/+/master/ports/bzip2/nacl.patch
-[bzip2_upstream]: http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
-[cairo]: https://chromium.googlesource.com/webports/+/master/ports/cairo
-[cairo_patch]: https://chromium.googlesource.com/webports/+/master/ports/cairo/nacl.patch
-[cairo_upstream]: http://cairographics.org/releases/cairo-1.12.14.tar.xz
-[cfitsio]: https://chromium.googlesource.com/webports/+/master/ports/cfitsio
-[cfitsio_patch]: https://chromium.googlesource.com/webports/+/master/ports/cfitsio/nacl.patch
-[cfitsio_upstream]: ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3260.tar.gz
-[civetweb]: https://chromium.googlesource.com/webports/+/master/ports/civetweb
-[civetweb_patch]: https://chromium.googlesource.com/webports/+/master/ports/civetweb/nacl.patch
-[civetweb_upstream]: http://downloads.sf.net/project/civetweb/1.5/civetweb-1.5.tar.gz
-[clapack]: https://chromium.googlesource.com/webports/+/master/ports/clapack
-[clapack_patch]: https://chromium.googlesource.com/webports/+/master/ports/clapack/nacl.patch
-[clapack_upstream]: http://www.netlib.org/clapack/clapack.tgz
-[clipper]: https://chromium.googlesource.com/webports/+/master/ports/clipper
-[clipper_patch]: https://chromium.googlesource.com/webports/+/master/ports/clipper/nacl.patch
-[clipper_upstream]: http://download.sf.net/polyclipping/files/clipper_ver6.2.1.zip
-[compositeproto]: https://chromium.googlesource.com/webports/+/master/ports/compositeproto
-[compositeproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/compositeproto-0.4.2.tar.bz2
-[corelibs]: https://chromium.googlesource.com/webports/+/master/ports/corelibs
-[coreutils]: https://chromium.googlesource.com/webports/+/master/ports/coreutils
-[coreutils_patch]: https://chromium.googlesource.com/webports/+/master/ports/coreutils/nacl.patch
-[coreutils_upstream]: http://ftp.gnu.org/gnu/coreutils/coreutils-8.24.tar.xz
-[cups]: https://chromium.googlesource.com/webports/+/master/ports/cups
-[cups_patch]: https://chromium.googlesource.com/webports/+/master/ports/cups/nacl.patch
-[cups_upstream]: https://www.cups.org/software/2.1.0/cups-2.1.0-source.tar.bz2
-[curl]: https://chromium.googlesource.com/webports/+/master/ports/curl
-[curl_patch]: https://chromium.googlesource.com/webports/+/master/ports/curl/nacl.patch
-[curl_upstream]: http://curl.haxx.se/download/curl-7.44.0.tar.bz2
-[damageproto]: https://chromium.googlesource.com/webports/+/master/ports/damageproto
-[damageproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/damageproto-1.2.1.tar.bz2
-[devenv]: https://chromium.googlesource.com/webports/+/master/ports/devenv
-[devenv-latest]: https://chromium.googlesource.com/webports/+/master/ports/devenv-latest
-[devil]: https://chromium.googlesource.com/webports/+/master/ports/devil
-[devil_patch]: https://chromium.googlesource.com/webports/+/master/ports/devil/nacl.patch
-[devil_upstream]: http://downloads.sf.net/openil/DevIL-1.7.8.tar.gz
-[dosbox]: https://chromium.googlesource.com/webports/+/master/ports/dosbox
-[dosbox_patch]: https://chromium.googlesource.com/webports/+/master/ports/dosbox/nacl.patch
-[dosbox_upstream]: http://download.sf.net/dosbox/dosbox/0.74/dosbox-0.74.tar.gz
-[dreadthread]: https://chromium.googlesource.com/webports/+/master/ports/dreadthread
-[drod]: https://chromium.googlesource.com/webports/+/master/ports/drod
-[drod_patch]: https://chromium.googlesource.com/webports/+/master/ports/drod/nacl.patch
-[drod_upstream]: https://github.com/binji/drod/archive/213fa47/drod-213fa47.tar.gz
-[eigen3]: https://chromium.googlesource.com/webports/+/master/ports/eigen3
-[eigen3_patch]: https://chromium.googlesource.com/webports/+/master/ports/eigen3/nacl.patch
-[eigen3_upstream]: http://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2
-[emacs]: https://chromium.googlesource.com/webports/+/master/ports/emacs
-[emacs_patch]: https://chromium.googlesource.com/webports/+/master/ports/emacs/nacl.patch
-[emacs_upstream]: http://mirrors.kernel.org/gnu/emacs/emacs-24.3.tar.gz
-[emacs-x]: https://chromium.googlesource.com/webports/+/master/ports/emacs-x
-[emacs-x_upstream]: http://mirrors.kernel.org/gnu/emacs/emacs-24.3.tar.gz
-[expat]: https://chromium.googlesource.com/webports/+/master/ports/expat
-[expat_patch]: https://chromium.googlesource.com/webports/+/master/ports/expat/nacl.patch
-[expat_upstream]: http://download.sf.net/expat/expat/2.0.1/expat-2.0.1.tar.gz
-[faac]: https://chromium.googlesource.com/webports/+/master/ports/faac
-[faac_patch]: https://chromium.googlesource.com/webports/+/master/ports/faac/nacl.patch
-[faac_upstream]: http://download.sf.net/faac/faac-src/faac-1.28/faac-1.28.tar.gz
-[faad2]: https://chromium.googlesource.com/webports/+/master/ports/faad2
-[faad2_patch]: https://chromium.googlesource.com/webports/+/master/ports/faad2/nacl.patch
-[faad2_upstream]: http://sf.net/projects/faac/files/faad2-src/faad2-2.7/faad2-2.7.tar.gz
-[ffmpeg]: https://chromium.googlesource.com/webports/+/master/ports/ffmpeg
-[ffmpeg_patch]: https://chromium.googlesource.com/webports/+/master/ports/ffmpeg/nacl.patch
-[ffmpeg_upstream]: http://ffmpeg.org/releases/ffmpeg-2.6.1.tar.bz2
-[fftw]: https://chromium.googlesource.com/webports/+/master/ports/fftw
-[fftw_patch]: https://chromium.googlesource.com/webports/+/master/ports/fftw/nacl.patch
-[fftw_upstream]: http://www.fftw.org/fftw-3.3.4.tar.gz
-[fftw-float]: https://chromium.googlesource.com/webports/+/master/ports/fftw-float
-[fftw-float_patch]: https://chromium.googlesource.com/webports/+/master/ports/fftw-float/nacl.patch
-[fftw-float_upstream]: http://www.fftw.org/fftw-3.3.4.tar.gz
-[findutils]: https://chromium.googlesource.com/webports/+/master/ports/findutils
-[findutils_patch]: https://chromium.googlesource.com/webports/+/master/ports/findutils/nacl.patch
-[findutils_upstream]: http://ftp.gnu.org/gnu/findutils/findutils-4.4.2.tar.gz
-[fixesproto]: https://chromium.googlesource.com/webports/+/master/ports/fixesproto
-[fixesproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/fixesproto-5.0.tar.bz2
-[flac]: https://chromium.googlesource.com/webports/+/master/ports/flac
-[flac_patch]: https://chromium.googlesource.com/webports/+/master/ports/flac/nacl.patch
-[flac_upstream]: http://download.sf.net/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz
-[font-adobe-100dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-adobe-100dpi
-[font-adobe-100dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-adobe-100dpi-1.0.3.tar.bz2
-[font-adobe-75dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-adobe-75dpi
-[font-adobe-75dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-adobe-75dpi-1.0.3.tar.bz2
-[font-adobe-utopia-100dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-adobe-utopia-100dpi
-[font-adobe-utopia-100dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-adobe-utopia-100dpi-1.0.4.tar.bz2
-[font-adobe-utopia-75dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-adobe-utopia-75dpi
-[font-adobe-utopia-75dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-adobe-utopia-75dpi-1.0.4.tar.bz2
-[font-adobe-utopia-type1]: https://chromium.googlesource.com/webports/+/master/ports/font-adobe-utopia-type1
-[font-adobe-utopia-type1_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-adobe-utopia-type1-1.0.4.tar.bz2
-[font-alias]: https://chromium.googlesource.com/webports/+/master/ports/font-alias
-[font-alias_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-alias-1.0.3.tar.bz2
-[font-bh-100dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-bh-100dpi
-[font-bh-100dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bh-100dpi-1.0.3.tar.bz2
-[font-bh-75dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-bh-75dpi
-[font-bh-75dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bh-75dpi-1.0.3.tar.bz2
-[font-bh-lucidatypewriter-100dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-bh-lucidatypewriter-100dpi
-[font-bh-lucidatypewriter-100dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bh-lucidatypewriter-100dpi-1.0.3.tar.bz2
-[font-bh-lucidatypewriter-75dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-bh-lucidatypewriter-75dpi
-[font-bh-lucidatypewriter-75dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bh-lucidatypewriter-75dpi-1.0.3.tar.bz2
-[font-bh-ttf]: https://chromium.googlesource.com/webports/+/master/ports/font-bh-ttf
-[font-bh-ttf_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bh-ttf-1.0.3.tar.bz2
-[font-bh-type1]: https://chromium.googlesource.com/webports/+/master/ports/font-bh-type1
-[font-bh-type1_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bh-type1-1.0.3.tar.bz2
-[font-bitstream-100dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-bitstream-100dpi
-[font-bitstream-100dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bitstream-100dpi-1.0.3.tar.bz2
-[font-bitstream-75dpi]: https://chromium.googlesource.com/webports/+/master/ports/font-bitstream-75dpi
-[font-bitstream-75dpi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bitstream-75dpi-1.0.3.tar.bz2
-[font-bitstream-type1]: https://chromium.googlesource.com/webports/+/master/ports/font-bitstream-type1
-[font-bitstream-type1_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-bitstream-type1-1.0.3.tar.bz2
-[font-cronyx-cyrillic]: https://chromium.googlesource.com/webports/+/master/ports/font-cronyx-cyrillic
-[font-cronyx-cyrillic_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-cronyx-cyrillic-1.0.3.tar.bz2
-[font-cursor-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-cursor-misc
-[font-cursor-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-cursor-misc-1.0.3.tar.bz2
-[font-daewoo-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-daewoo-misc
-[font-daewoo-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-daewoo-misc-1.0.3.tar.bz2
-[font-dec-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-dec-misc
-[font-dec-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-dec-misc-1.0.3.tar.bz2
-[font-ibm-type1]: https://chromium.googlesource.com/webports/+/master/ports/font-ibm-type1
-[font-ibm-type1_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-ibm-type1-1.0.3.tar.bz2
-[font-isas-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-isas-misc
-[font-isas-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-isas-misc-1.0.3.tar.bz2
-[font-jis-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-jis-misc
-[font-jis-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-jis-misc-1.0.3.tar.bz2
-[font-micro-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-micro-misc
-[font-micro-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-micro-misc-1.0.3.tar.bz2
-[font-misc-cyrillic]: https://chromium.googlesource.com/webports/+/master/ports/font-misc-cyrillic
-[font-misc-cyrillic_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-misc-cyrillic-1.0.3.tar.bz2
-[font-misc-ethiopic]: https://chromium.googlesource.com/webports/+/master/ports/font-misc-ethiopic
-[font-misc-ethiopic_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-misc-ethiopic-1.0.3.tar.bz2
-[font-misc-meltho]: https://chromium.googlesource.com/webports/+/master/ports/font-misc-meltho
-[font-misc-meltho_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-misc-meltho-1.0.3.tar.bz2
-[font-misc-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-misc-misc
-[font-misc-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-misc-misc-1.1.2.tar.bz2
-[font-mutt-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-mutt-misc
-[font-mutt-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-mutt-misc-1.0.3.tar.bz2
-[font-schumacher-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-schumacher-misc
-[font-schumacher-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-schumacher-misc-1.1.2.tar.bz2
-[font-screen-cyrillic]: https://chromium.googlesource.com/webports/+/master/ports/font-screen-cyrillic
-[font-screen-cyrillic_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-screen-cyrillic-1.0.4.tar.bz2
-[font-sony-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-sony-misc
-[font-sony-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-sony-misc-1.0.3.tar.bz2
-[font-sun-misc]: https://chromium.googlesource.com/webports/+/master/ports/font-sun-misc
-[font-sun-misc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-sun-misc-1.0.3.tar.bz2
-[font-util]: https://chromium.googlesource.com/webports/+/master/ports/font-util
-[font-util_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-util-1.3.0.tar.bz2
-[font-winitzki-cyrillic]: https://chromium.googlesource.com/webports/+/master/ports/font-winitzki-cyrillic
-[font-winitzki-cyrillic_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-winitzki-cyrillic-1.0.3.tar.bz2
-[font-xfree86-type1]: https://chromium.googlesource.com/webports/+/master/ports/font-xfree86-type1
-[font-xfree86-type1_upstream]: http://www.x.org/releases/X11R7.7/src/everything/font-xfree86-type1-1.0.4.tar.bz2
-[fontconfig]: https://chromium.googlesource.com/webports/+/master/ports/fontconfig
-[fontconfig_patch]: https://chromium.googlesource.com/webports/+/master/ports/fontconfig/nacl.patch
-[fontconfig_upstream]: http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.1.tar.bz2
-[fontsproto]: https://chromium.googlesource.com/webports/+/master/ports/fontsproto
-[fontsproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/fontsproto-2.1.2.tar.bz2
-[freealut]: https://chromium.googlesource.com/webports/+/master/ports/freealut
-[freealut_patch]: https://chromium.googlesource.com/webports/+/master/ports/freealut/nacl.patch
-[freealut_upstream]: http://connect.creativelabs.com/openal/Downloads/ALUT/freealut-1.1.0.tar.gz
-[freeimage]: https://chromium.googlesource.com/webports/+/master/ports/freeimage
-[freeimage_patch]: https://chromium.googlesource.com/webports/+/master/ports/freeimage/nacl.patch
-[freeimage_upstream]: http://downloads.sf.net/freeimage/FreeImage3170.zip
-[freetype]: https://chromium.googlesource.com/webports/+/master/ports/freetype
-[freetype_upstream]: http://download.savannah.gnu.org/releases/freetype/freetype-2.5.5.tar.bz2
-[fuseiso]: https://chromium.googlesource.com/webports/+/master/ports/fuseiso
-[fuseiso_patch]: https://chromium.googlesource.com/webports/+/master/ports/fuseiso/nacl.patch
-[fuseiso_upstream]: http://download.sf.net/project/fuseiso/fuseiso/20070708/fuseiso-20070708.tar.bz2
-[fvwm]: https://chromium.googlesource.com/webports/+/master/ports/fvwm
-[fvwm_patch]: https://chromium.googlesource.com/webports/+/master/ports/fvwm/nacl.patch
-[fvwm_upstream]: ftp://ftp.fvwm.org/pub/fvwm/version-2/fvwm-2.6.5.tar.bz2
-[gawk]: https://chromium.googlesource.com/webports/+/master/ports/gawk
-[gawk_patch]: https://chromium.googlesource.com/webports/+/master/ports/gawk/nacl.patch
-[gawk_upstream]: http://ftp.gnu.org/gnu/gawk/gawk-4.1.1.tar.gz
-[gc]: https://chromium.googlesource.com/webports/+/master/ports/gc
-[gc_patch]: https://chromium.googlesource.com/webports/+/master/ports/gc/nacl.patch
-[gc_upstream]: http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.8.tar.gz
-[gcc]: https://chromium.googlesource.com/webports/+/master/ports/gcc
-[gcc_patch]: https://chromium.googlesource.com/webports/+/master/ports/gcc/nacl.patch
-[gcc_upstream]: https://chromium.googlesource.com/native_client/nacl-gcc.git@396037926
-[gcc-avr]: https://chromium.googlesource.com/webports/+/master/ports/gcc-avr
-[gcc-avr_patch]: https://chromium.googlesource.com/webports/+/master/ports/gcc-avr/nacl.patch
-[gcc-avr_upstream]: http://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.bz2
-[gdb]: https://chromium.googlesource.com/webports/+/master/ports/gdb
-[gdb_patch]: https://chromium.googlesource.com/webports/+/master/ports/gdb/nacl.patch
-[gdb_upstream]: https://chromium.googlesource.com/native_client/nacl-binutils.git@5deb479
-[gdk-pixbuf]: https://chromium.googlesource.com/webports/+/master/ports/gdk-pixbuf
-[gdk-pixbuf_upstream]: https://download.gnome.org/sources/gdk-pixbuf/2.30/gdk-pixbuf-2.30.8.tar.xz
-[gegl]: https://chromium.googlesource.com/webports/+/master/ports/gegl
-[gegl_upstream]: http://download.gimp.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2
-[gettext]: https://chromium.googlesource.com/webports/+/master/ports/gettext
-[gettext_patch]: https://chromium.googlesource.com/webports/+/master/ports/gettext/nacl.patch
-[gettext_upstream]: http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.2.tar.xz
-[geturl]: https://chromium.googlesource.com/webports/+/master/ports/geturl
-[gflags]: https://chromium.googlesource.com/webports/+/master/ports/gflags
-[gflags_patch]: https://chromium.googlesource.com/webports/+/master/ports/gflags/nacl.patch
-[gflags_upstream]: https://github.com/gflags/gflags/archive/v2.1.2/gflags-2.1.2.tar.gz
-[gforth]: https://chromium.googlesource.com/webports/+/master/ports/gforth
-[gforth_patch]: https://chromium.googlesource.com/webports/+/master/ports/gforth/nacl.patch
-[gforth_upstream]: http://www.complang.tuwien.ac.at/forth/gforth/gforth-0.7.2.tar.gz
-[giflib]: https://chromium.googlesource.com/webports/+/master/ports/giflib
-[giflib_upstream]: http://downloads.sf.net/project/giflib/giflib-4.x/giflib-4.2.1.tar.bz2
-[gimp]: https://chromium.googlesource.com/webports/+/master/ports/gimp
-[gimp_patch]: https://chromium.googlesource.com/webports/+/master/ports/gimp/nacl.patch
-[gimp_upstream]: http://download.gimp.org/pub/gimp/v2.8/gimp-2.8.14.tar.bz2
-[gimp-app]: https://chromium.googlesource.com/webports/+/master/ports/gimp-app
-[git]: https://chromium.googlesource.com/webports/+/master/ports/git
-[git_patch]: https://chromium.googlesource.com/webports/+/master/ports/git/nacl.patch
-[git_upstream]: https://github.com/git/git/archive/v2.3.0/git-2.3.0.tar.gz
-[glib]: https://chromium.googlesource.com/webports/+/master/ports/glib
-[glib_patch]: https://chromium.googlesource.com/webports/+/master/ports/glib/nacl.patch
-[glib_upstream]: http://ftp.gnome.org/pub/gnome/sources/glib/2.45/glib-2.45.2.tar.xz
-[glibc-compat]: https://chromium.googlesource.com/webports/+/master/ports/glibc-compat
-[glproto]: https://chromium.googlesource.com/webports/+/master/ports/glproto
-[glproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/glproto-1.4.15.tar.bz2
-[gmock]: https://chromium.googlesource.com/webports/+/master/ports/gmock
-[gmock_patch]: https://chromium.googlesource.com/webports/+/master/ports/gmock/nacl.patch
-[gmock_upstream]: http://googlemock.googlecode.com/files/gmock-1.5.0.tar.gz
-[gmp]: https://chromium.googlesource.com/webports/+/master/ports/gmp
-[gmp_upstream]: ftp://ftp.gmplib.org/pub/gmp/gmp-5.0.2.tar.bz2
-[grep]: https://chromium.googlesource.com/webports/+/master/ports/grep
-[grep_patch]: https://chromium.googlesource.com/webports/+/master/ports/grep/nacl.patch
-[grep_upstream]: http://ftp.gnu.org/gnu/grep/grep-2.21.tar.xz
-[grpc]: https://chromium.googlesource.com/webports/+/master/ports/grpc
-[grpc_patch]: https://chromium.googlesource.com/webports/+/master/ports/grpc/nacl.patch
-[grpc_upstream]: https://github.com/grpc/grpc.git@9fad88fe
-[gsl]: https://chromium.googlesource.com/webports/+/master/ports/gsl
-[gsl_upstream]: http://ftpmirror.gnu.org/gsl/gsl-1.16.tar.gz
-[gtest]: https://chromium.googlesource.com/webports/+/master/ports/gtest
-[gtest_patch]: https://chromium.googlesource.com/webports/+/master/ports/gtest/nacl.patch
-[gtest_upstream]: https://github.com/google/googletest.git@6f8a664
-[gtk+]: https://chromium.googlesource.com/webports/+/master/ports/gtk+
-[gtk+_patch]: https://chromium.googlesource.com/webports/+/master/ports/gtk+/nacl.patch
-[gtk+_upstream]: http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.28.tar.xz
-[gtk-demo]: https://chromium.googlesource.com/webports/+/master/ports/gtk-demo
-[gzip]: https://chromium.googlesource.com/webports/+/master/ports/gzip
-[gzip_patch]: https://chromium.googlesource.com/webports/+/master/ports/gzip/nacl.patch
-[gzip_upstream]: ftp://ftp.gnu.org/gnu/gzip/gzip-1.6.tar.gz
-[harfbuzz]: https://chromium.googlesource.com/webports/+/master/ports/harfbuzz
-[harfbuzz_upstream]: http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.41.tar.bz2
-[hdf5]: https://chromium.googlesource.com/webports/+/master/ports/hdf5
-[hdf5_patch]: https://chromium.googlesource.com/webports/+/master/ports/hdf5/nacl.patch
-[hdf5_upstream]: http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.12.tar.gz
-[hello]: https://chromium.googlesource.com/webports/+/master/ports/hello
-[hello_upstream]: http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
-[icu]: https://chromium.googlesource.com/webports/+/master/ports/icu
-[icu_patch]: https://chromium.googlesource.com/webports/+/master/ports/icu/nacl.patch
-[icu_upstream]: http://download.icu-project.org/files/icu4c/53.1/icu4c-53_1-src.tgz
-[id3lib]: https://chromium.googlesource.com/webports/+/master/ports/id3lib
-[id3lib_patch]: https://chromium.googlesource.com/webports/+/master/ports/id3lib/nacl.patch
-[id3lib_upstream]: http://downloads.sf.net/id3lib/3.8.3/id3lib-3.8.3.tar.gz
-[imagemagick]: https://chromium.googlesource.com/webports/+/master/ports/imagemagick
-[imagemagick_upstream]: http://www.imagemagick.org/download/ImageMagick-6.9.0-2.tar.bz2
-[inputproto]: https://chromium.googlesource.com/webports/+/master/ports/inputproto
-[inputproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/inputproto-2.2.tar.bz2
-[ipython-ppapi]: https://chromium.googlesource.com/webports/+/master/ports/ipython-ppapi
-[jpeg6b]: https://chromium.googlesource.com/webports/+/master/ports/jpeg6b
-[jpeg6b_patch]: https://chromium.googlesource.com/webports/+/master/ports/jpeg6b/nacl.patch
-[jpeg6b_upstream]: http://www.ijg.org/files/jpegsrc.v6b.tar.gz
-[jpeg8d]: https://chromium.googlesource.com/webports/+/master/ports/jpeg8d
-[jpeg8d_upstream]: http://www.ijg.org/files/jpegsrc.v8d.tar.gz
-[json-glib]: https://chromium.googlesource.com/webports/+/master/ports/json-glib
-[json-glib_upstream]: http://ftp.gnome.org/pub/gnome/sources/json-glib/1.0/json-glib-1.0.4.tar.xz
-[jsoncpp]: https://chromium.googlesource.com/webports/+/master/ports/jsoncpp
-[jsoncpp_patch]: https://chromium.googlesource.com/webports/+/master/ports/jsoncpp/nacl.patch
-[jsoncpp_upstream]: https://github.com/open-source-parsers/jsoncpp/archive/1.6.1/jsoncpp-1.6.1.tar.gz
-[kbproto]: https://chromium.googlesource.com/webports/+/master/ports/kbproto
-[kbproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/kbproto-1.0.6.tar.bz2
-[lame]: https://chromium.googlesource.com/webports/+/master/ports/lame
-[lame_upstream]: http://download.sf.net/lame/lame/3.99/lame-3.99.5.tar.gz
-[lcms]: https://chromium.googlesource.com/webports/+/master/ports/lcms
-[lcms_upstream]: http://downloads.sf.net/project/lcms/lcms/2.4/lcms2-2.4.tar.gz
-[less]: https://chromium.googlesource.com/webports/+/master/ports/less
-[less_patch]: https://chromium.googlesource.com/webports/+/master/ports/less/nacl.patch
-[less_upstream]: http://ftp.gnu.org/gnu/less/less-451.tar.gz
-[leveldb]: https://chromium.googlesource.com/webports/+/master/ports/leveldb
-[leveldb_patch]: https://chromium.googlesource.com/webports/+/master/ports/leveldb/nacl.patch
-[leveldb_upstream]: https://github.com/google/leveldb/archive/v1.18/leveldb-1.18.tar.gz
-[libarchive]: https://chromium.googlesource.com/webports/+/master/ports/libarchive
-[libarchive_patch]: https://chromium.googlesource.com/webports/+/master/ports/libarchive/nacl.patch
-[libarchive_upstream]: http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz
-[libarchive-dev]: https://chromium.googlesource.com/webports/+/master/ports/libarchive-dev
-[libarchive-dev_patch]: https://chromium.googlesource.com/webports/+/master/ports/libarchive-dev/nacl.patch
-[libarchive-dev_upstream]: https://github.com/libarchive/libarchive.git@d094dc
-[libatomic-ops]: https://chromium.googlesource.com/webports/+/master/ports/libatomic-ops
-[libatomic-ops_upstream]: http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-7.4.0.tar.gz
-[libav]: https://chromium.googlesource.com/webports/+/master/ports/libav
-[libav_patch]: https://chromium.googlesource.com/webports/+/master/ports/libav/nacl.patch
-[libav_upstream]: http://libav.org/releases/libav-9.6.tar.xz
-[libbsd]: https://chromium.googlesource.com/webports/+/master/ports/libbsd
-[libbsd_patch]: https://chromium.googlesource.com/webports/+/master/ports/libbsd/nacl.patch
-[libbsd_upstream]: http://libbsd.freedesktop.org/releases/libbsd-0.7.0.tar.xz
-[libebml]: https://chromium.googlesource.com/webports/+/master/ports/libebml
-[libebml_patch]: https://chromium.googlesource.com/webports/+/master/ports/libebml/nacl.patch
-[libebml_upstream]: http://dl.matroska.org/downloads/libebml/libebml-1.3.1.tar.bz2
-[libelf]: https://chromium.googlesource.com/webports/+/master/ports/libelf
-[libelf_upstream]: http://www.mr511.de/software/libelf-0.8.13.tar.gz
-[libevent]: https://chromium.googlesource.com/webports/+/master/ports/libevent
-[libevent_patch]: https://chromium.googlesource.com/webports/+/master/ports/libevent/nacl.patch
-[libevent_upstream]: http://download.sf.net/project/levent/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz
-[libffi]: https://chromium.googlesource.com/webports/+/master/ports/libffi
-[libffi_patch]: https://chromium.googlesource.com/webports/+/master/ports/libffi/nacl.patch
-[libffi_upstream]: ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz
-[libfontenc]: https://chromium.googlesource.com/webports/+/master/ports/libfontenc
-[libfontenc_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libfontenc-1.1.1.tar.bz2
-[libgit2]: https://chromium.googlesource.com/webports/+/master/ports/libgit2
-[libgit2_patch]: https://chromium.googlesource.com/webports/+/master/ports/libgit2/nacl.patch
-[libgit2_upstream]: https://github.com/libgit2/libgit2/archive/v0.21.2/libgit2-0.21.2.tar.gz
-[libgit2-demo]: https://chromium.googlesource.com/webports/+/master/ports/libgit2-demo
-[libhangul]: https://chromium.googlesource.com/webports/+/master/ports/libhangul
-[libhangul_patch]: https://chromium.googlesource.com/webports/+/master/ports/libhangul/nacl.patch
-[libhangul_upstream]: http://libhangul.googlecode.com/files/libhangul-0.1.0.tar.gz
-[libice]: https://chromium.googlesource.com/webports/+/master/ports/libice
-[libice_patch]: https://chromium.googlesource.com/webports/+/master/ports/libice/nacl.patch
-[libice_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libICE-1.0.8.tar.bz2
-[libiconv]: https://chromium.googlesource.com/webports/+/master/ports/libiconv
-[libiconv_patch]: https://chromium.googlesource.com/webports/+/master/ports/libiconv/nacl.patch
-[libiconv_upstream]: http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
-[libmatroska]: https://chromium.googlesource.com/webports/+/master/ports/libmatroska
-[libmatroska_upstream]: http://dl.matroska.org/downloads/libmatroska/libmatroska-1.4.2.tar.bz2
-[libmikmod]: https://chromium.googlesource.com/webports/+/master/ports/libmikmod
-[libmikmod_upstream]: http://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz
-[libmng]: https://chromium.googlesource.com/webports/+/master/ports/libmng
-[libmng_patch]: https://chromium.googlesource.com/webports/+/master/ports/libmng/nacl.patch
-[libmng_upstream]: http://downloads.sf.net/project/libmng/libmng-devel/1.0.10/libmng-1.0.10.tar.gz
-[libmodplug]: https://chromium.googlesource.com/webports/+/master/ports/libmodplug
-[libmodplug_upstream]: http://download.sf.net/modplug-xmms/libmodplug/0.8.7/libmodplug-0.8.7.tar.gz
-[libogg]: https://chromium.googlesource.com/webports/+/master/ports/libogg
-[libogg_upstream]: http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
-[liboggz]: https://chromium.googlesource.com/webports/+/master/ports/liboggz
-[liboggz_patch]: https://chromium.googlesource.com/webports/+/master/ports/liboggz/nacl.patch
-[liboggz_upstream]: http://downloads.xiph.org/releases/liboggz/liboggz-1.1.1.tar.gz
-[libpciaccess]: https://chromium.googlesource.com/webports/+/master/ports/libpciaccess
-[libpciaccess_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libpciaccess-0.13.1.tar.bz2
-[libpng]: https://chromium.googlesource.com/webports/+/master/ports/libpng
-[libpng_patch]: https://chromium.googlesource.com/webports/+/master/ports/libpng/nacl.patch
-[libpng_upstream]: http://download.sf.net/libpng/libpng-1.6.20.tar.gz
-[libpng12]: https://chromium.googlesource.com/webports/+/master/ports/libpng12
-[libpng12_upstream]: http://download.sf.net/libpng/libpng-1.2.51.tar.gz
-[libsm]: https://chromium.googlesource.com/webports/+/master/ports/libsm
-[libsm_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libSM-1.2.1.tar.bz2
-[libsodium]: https://chromium.googlesource.com/webports/+/master/ports/libsodium
-[libsodium_upstream]: https://github.com/jedisct1/libsodium/releases/download/1.0.3/libsodium-1.0.3.tar.gz
-[libssh]: https://chromium.googlesource.com/webports/+/master/ports/libssh
-[libssh_patch]: https://chromium.googlesource.com/webports/+/master/ports/libssh/nacl.patch
-[libssh_upstream]: https://red.libssh.org/attachments/download/71/libssh-0.6.0.tar.xz
-[libssh2]: https://chromium.googlesource.com/webports/+/master/ports/libssh2
-[libssh2_patch]: https://chromium.googlesource.com/webports/+/master/ports/libssh2/nacl.patch
-[libssh2_upstream]: http://www.libssh2.org/download/libssh2-1.4.3.tar.gz
-[libtar]: https://chromium.googlesource.com/webports/+/master/ports/libtar
-[libtar_patch]: https://chromium.googlesource.com/webports/+/master/ports/libtar/nacl.patch
-[libtar_upstream]: ftp://ftp.feep.net/pub/software/libtar/libtar-1.2.11.tar.gz
-[libtheora]: https://chromium.googlesource.com/webports/+/master/ports/libtheora
-[libtheora_patch]: https://chromium.googlesource.com/webports/+/master/ports/libtheora/nacl.patch
-[libtheora_upstream]: http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
-[libtomcrypt]: https://chromium.googlesource.com/webports/+/master/ports/libtomcrypt
-[libtomcrypt_patch]: https://chromium.googlesource.com/webports/+/master/ports/libtomcrypt/nacl.patch
-[libtomcrypt_upstream]: http://libtomcrypt.googlecode.com/files/crypt-1.17.tar.bz2
-[libtommath]: https://chromium.googlesource.com/webports/+/master/ports/libtommath
-[libtommath_patch]: https://chromium.googlesource.com/webports/+/master/ports/libtommath/nacl.patch
-[libtommath_upstream]: http://download.sf.net/tommath/libtommath/0.41/ltm-0.41.tar.bz2
-[libtool]: https://chromium.googlesource.com/webports/+/master/ports/libtool
-[libtool_upstream]: http://ftp.kaist.ac.kr/gnu/gnu/libtool/libtool-2.4.tar.xz
-[libunistring]: https://chromium.googlesource.com/webports/+/master/ports/libunistring
-[libunistring_upstream]: http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.3.tar.gz
-[libuuid]: https://chromium.googlesource.com/webports/+/master/ports/libuuid
-[libuuid_patch]: https://chromium.googlesource.com/webports/+/master/ports/libuuid/nacl.patch
-[libuuid_upstream]: http://downloads.sf.net/project/libuuid/libuuid-1.0.3.tar.gz
-[libvorbis]: https://chromium.googlesource.com/webports/+/master/ports/libvorbis
-[libvorbis_upstream]: http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
-[libvpx]: https://chromium.googlesource.com/webports/+/master/ports/libvpx
-[libvpx_upstream]: https://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.4.0.tar.bz2
-[libwebp]: https://chromium.googlesource.com/webports/+/master/ports/libwebp
-[libwebp_upstream]: http://downloads.webmproject.org/releases/webp/libwebp-0.4.3.tar.gz
-[libx11]: https://chromium.googlesource.com/webports/+/master/ports/libx11
-[libx11_patch]: https://chromium.googlesource.com/webports/+/master/ports/libx11/nacl.patch
-[libx11_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libX11-1.5.0.tar.bz2
-[libxau]: https://chromium.googlesource.com/webports/+/master/ports/libxau
-[libxau_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXau-1.0.7.tar.bz2
-[libxaw]: https://chromium.googlesource.com/webports/+/master/ports/libxaw
-[libxaw_patch]: https://chromium.googlesource.com/webports/+/master/ports/libxaw/nacl.patch
-[libxaw_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXaw-1.0.11.tar.bz2
-[libxcb]: https://chromium.googlesource.com/webports/+/master/ports/libxcb
-[libxcb_patch]: https://chromium.googlesource.com/webports/+/master/ports/libxcb/nacl.patch
-[libxcb_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libxcb-1.8.1.tar.bz2
-[libxext]: https://chromium.googlesource.com/webports/+/master/ports/libxext
-[libxext_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXext-1.3.1.tar.bz2
-[libxfont]: https://chromium.googlesource.com/webports/+/master/ports/libxfont
-[libxfont_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXfont-1.4.5.tar.bz2
-[libxi]: https://chromium.googlesource.com/webports/+/master/ports/libxi
-[libxi_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXi-1.6.1.tar.bz2
-[libxinerama]: https://chromium.googlesource.com/webports/+/master/ports/libxinerama
-[libxinerama_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXinerama-1.1.2.tar.bz2
-[libxkbfile]: https://chromium.googlesource.com/webports/+/master/ports/libxkbfile
-[libxkbfile_patch]: https://chromium.googlesource.com/webports/+/master/ports/libxkbfile/nacl.patch
-[libxkbfile_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libxkbfile-1.0.8.tar.bz2
-[libxml2]: https://chromium.googlesource.com/webports/+/master/ports/libxml2
-[libxml2_patch]: https://chromium.googlesource.com/webports/+/master/ports/libxml2/nacl.patch
-[libxml2_upstream]: ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
-[libxmu]: https://chromium.googlesource.com/webports/+/master/ports/libxmu
-[libxmu_patch]: https://chromium.googlesource.com/webports/+/master/ports/libxmu/nacl.patch
-[libxmu_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXmu-1.1.1.tar.bz2
-[libxpm]: https://chromium.googlesource.com/webports/+/master/ports/libxpm
-[libxpm_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXpm-3.5.10.tar.bz2
-[libxrender]: https://chromium.googlesource.com/webports/+/master/ports/libxrender
-[libxrender_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXrender-0.9.7.tar.bz2
-[libxt]: https://chromium.googlesource.com/webports/+/master/ports/libxt
-[libxt_patch]: https://chromium.googlesource.com/webports/+/master/ports/libxt/nacl.patch
-[libxt_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXt-1.1.3.tar.bz2
-[libxtst]: https://chromium.googlesource.com/webports/+/master/ports/libxtst
-[libxtst_upstream]: http://www.x.org/releases/X11R7.7/src/everything/libXtst-1.2.1.tar.bz2
-[libyuv]: https://chromium.googlesource.com/webports/+/master/ports/libyuv
-[libyuv_patch]: https://chromium.googlesource.com/webports/+/master/ports/libyuv/nacl.patch
-[libyuv_upstream]: https://chromium.googlesource.com/external/libyuv.git@632c50f
-[lua]: https://chromium.googlesource.com/webports/+/master/ports/lua
-[lua_patch]: https://chromium.googlesource.com/webports/+/master/ports/lua/nacl.patch
-[lua_upstream]: http://www.lua.org/ftp/lua-5.3.0.tar.gz
-[m4]: https://chromium.googlesource.com/webports/+/master/ports/m4
-[m4_patch]: https://chromium.googlesource.com/webports/+/master/ports/m4/nacl.patch
-[m4_upstream]: http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.xz
-[make]: https://chromium.googlesource.com/webports/+/master/ports/make
-[make_patch]: https://chromium.googlesource.com/webports/+/master/ports/make/nacl.patch
-[make_upstream]: http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
-[mesa]: https://chromium.googlesource.com/webports/+/master/ports/mesa
-[mesa_patch]: https://chromium.googlesource.com/webports/+/master/ports/mesa/nacl.patch
-[mesa_upstream]: http://www.sfr-fresh.com/unix/misc/MesaLib-7.6.tar.gz
-[mesa-demo]: https://chromium.googlesource.com/webports/+/master/ports/mesa-demo
-[metakit]: https://chromium.googlesource.com/webports/+/master/ports/metakit
-[metakit_patch]: https://chromium.googlesource.com/webports/+/master/ports/metakit/nacl.patch
-[metakit_upstream]: http://equi4.com/pub/mk/metakit-2.4.9.7.tar.gz
-[mingn]: https://chromium.googlesource.com/webports/+/master/ports/mingn
-[mongoose]: https://chromium.googlesource.com/webports/+/master/ports/mongoose
-[mongoose_patch]: https://chromium.googlesource.com/webports/+/master/ports/mongoose/nacl.patch
-[mongoose_upstream]: https://mongoose.googlecode.com/files/mongoose-3.8.tgz
-[mp4v2]: https://chromium.googlesource.com/webports/+/master/ports/mp4v2
-[mp4v2_upstream]: https://mp4v2.googlecode.com/files/mp4v2-2.0.0.tar.bz2
-[mpc]: https://chromium.googlesource.com/webports/+/master/ports/mpc
-[mpc_upstream]: http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz
-[mpfr]: https://chromium.googlesource.com/webports/+/master/ports/mpfr
-[mpfr_upstream]: http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.bz2
-[mpg123]: https://chromium.googlesource.com/webports/+/master/ports/mpg123
-[mpg123_upstream]: http://www.mpg123.de/download/mpg123-1.20.0.tar.bz2
-[nacl-spawn]: https://chromium.googlesource.com/webports/+/master/ports/nacl-spawn
-[nano]: https://chromium.googlesource.com/webports/+/master/ports/nano
-[nano_patch]: https://chromium.googlesource.com/webports/+/master/ports/nano/nacl.patch
-[nano_upstream]: http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz
-[ncurses]: https://chromium.googlesource.com/webports/+/master/ports/ncurses
-[ncurses_patch]: https://chromium.googlesource.com/webports/+/master/ports/ncurses/nacl.patch
-[ncurses_upstream]: ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
-[netcat]: https://chromium.googlesource.com/webports/+/master/ports/netcat
-[netcat_patch]: https://chromium.googlesource.com/webports/+/master/ports/netcat/nacl.patch
-[netcat_upstream]: http://sf.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.bz2
-[nethack]: https://chromium.googlesource.com/webports/+/master/ports/nethack
-[nethack_patch]: https://chromium.googlesource.com/webports/+/master/ports/nethack/nacl.patch
-[nethack_upstream]: http://storage.googleapis.com/webports/mirror/nethack-343-src.tgz
-[nettle]: https://chromium.googlesource.com/webports/+/master/ports/nettle
-[nettle_patch]: https://chromium.googlesource.com/webports/+/master/ports/nettle/nacl.patch
-[nettle_upstream]: ftp://ftp.gnu.org/gnu/nettle/nettle-2.7.tar.gz
-[ninja]: https://chromium.googlesource.com/webports/+/master/ports/ninja
-[ninja_patch]: https://chromium.googlesource.com/webports/+/master/ports/ninja/nacl.patch
-[ninja_upstream]: https://github.com/martine/ninja/archive/v1.5.3/ninja-v1.5.3.tar.gz
-[openal-ogg-demo]: https://chromium.googlesource.com/webports/+/master/ports/openal-ogg-demo
-[openal-soft]: https://chromium.googlesource.com/webports/+/master/ports/openal-soft
-[openal-soft_patch]: https://chromium.googlesource.com/webports/+/master/ports/openal-soft/nacl.patch
-[openal-soft_upstream]: http://kcat.strangesoft.net/openal-releases/openal-soft-1.16.0.tar.bz2
-[opencv]: https://chromium.googlesource.com/webports/+/master/ports/opencv
-[opencv_patch]: https://chromium.googlesource.com/webports/+/master/ports/opencv/nacl.patch
-[opencv_upstream]: https://github.com/Itseez/opencv/archive/2.4.9/opencv-2.4.9.tar.gz
-[openjpeg]: https://chromium.googlesource.com/webports/+/master/ports/openjpeg
-[openjpeg_upstream]: http://download.sf.net/openjpeg.mirror/2.1.0/openjpeg-2.1.0.tar.gz
-[openscenegraph]: https://chromium.googlesource.com/webports/+/master/ports/openscenegraph
-[openscenegraph_patch]: https://chromium.googlesource.com/webports/+/master/ports/openscenegraph/nacl.patch
-[openscenegraph_upstream]: http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-2.9.7.zip
-[openssh]: https://chromium.googlesource.com/webports/+/master/ports/openssh
-[openssh_patch]: https://chromium.googlesource.com/webports/+/master/ports/openssh/nacl.patch
-[openssh_upstream]: http://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.9p1.tar.gz
-[openssl]: https://chromium.googlesource.com/webports/+/master/ports/openssl
-[openssl_patch]: https://chromium.googlesource.com/webports/+/master/ports/openssl/nacl.patch
-[openssl_upstream]: http://www.openssl.org/source/openssl-1.0.2e.tar.gz
-[pango]: https://chromium.googlesource.com/webports/+/master/ports/pango
-[pango_upstream]: http://ftp.gnome.org/pub/GNOME/sources/pango/1.36/pango-1.36.8.tar.xz
-[pcre]: https://chromium.googlesource.com/webports/+/master/ports/pcre
-[pcre_patch]: https://chromium.googlesource.com/webports/+/master/ports/pcre/nacl.patch
-[pcre_upstream]: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2
-[perl]: https://chromium.googlesource.com/webports/+/master/ports/perl
-[perl_patch]: https://chromium.googlesource.com/webports/+/master/ports/perl/nacl.patch
-[perl_upstream]: http://www.cpan.org/src/5.0/perl-5.20.2.tar.gz
-[physfs]: https://chromium.googlesource.com/webports/+/master/ports/physfs
-[physfs_patch]: https://chromium.googlesource.com/webports/+/master/ports/physfs/nacl.patch
-[physfs_upstream]: http://icculus.org/physfs/downloads/physfs-2.0.3.tar.bz2
-[pixman]: https://chromium.googlesource.com/webports/+/master/ports/pixman
-[pixman_patch]: https://chromium.googlesource.com/webports/+/master/ports/pixman/nacl.patch
-[pixman_upstream]: http://cairographics.org/releases/pixman-0.32.4.tar.gz
-[pkg]: https://chromium.googlesource.com/webports/+/master/ports/pkg
-[pkg_patch]: https://chromium.googlesource.com/webports/+/master/ports/pkg/nacl.patch
-[pkg_upstream]: https://github.com/freebsd/pkg/archive/1.6.1/pkg-1.6.1.tar.gz
-[pnacl]: https://chromium.googlesource.com/webports/+/master/ports/pnacl
-[pnacl_patch]: https://chromium.googlesource.com/webports/+/master/ports/pnacl/nacl.patch
-[pnacl_upstream]: https://chromium.googlesource.com/native_client/src/native_client.git@642939f
-[pnacl-binutils-src]: https://chromium.googlesource.com/webports/+/master/ports/pnacl-binutils-src
-[pnacl-binutils-src_patch]: https://chromium.googlesource.com/webports/+/master/ports/pnacl-binutils-src/nacl.patch
-[pnacl-binutils-src_upstream]: https://chromium.googlesource.com/native_client/nacl-binutils.git@d5a23a3
-[pnacl-binutils-x86-src]: https://chromium.googlesource.com/webports/+/master/ports/pnacl-binutils-x86-src
-[pnacl-binutils-x86-src_upstream]: https://chromium.googlesource.com/native_client/nacl-binutils.git@1d8592c
-[pnacl-clang-src]: https://chromium.googlesource.com/webports/+/master/ports/pnacl-clang-src
-[pnacl-clang-src_patch]: https://chromium.googlesource.com/webports/+/master/ports/pnacl-clang-src/nacl.patch
-[pnacl-clang-src_upstream]: https://chromium.googlesource.com/native_client/pnacl-clang.git@cf0dc7f
-[pnacl-llvm-src]: https://chromium.googlesource.com/webports/+/master/ports/pnacl-llvm-src
-[pnacl-llvm-src_patch]: https://chromium.googlesource.com/webports/+/master/ports/pnacl-llvm-src/nacl.patch
-[pnacl-llvm-src_upstream]: https://chromium.googlesource.com/native_client/pnacl-llvm.git@1ac309a
-[poly2tri]: https://chromium.googlesource.com/webports/+/master/ports/poly2tri
-[poly2tri_upstream]: https://poly2tri.googlecode.com/archive/26242d0aa7b8.tar.gz
-[protobuf]: https://chromium.googlesource.com/webports/+/master/ports/protobuf
-[protobuf_patch]: https://chromium.googlesource.com/webports/+/master/ports/protobuf/nacl.patch
-[protobuf_upstream]: https://github.com/google/protobuf/releases/download/v3.0.0-beta-2/protobuf-cpp-3.0.0-beta-2.tar.gz
-[protobuf-c]: https://chromium.googlesource.com/webports/+/master/ports/protobuf-c
-[protobuf-c_upstream]: http://github.com/protobuf-c/protobuf-c/releases/download/v1.0.2/protobuf-c-1.0.2.tar.gz
-[python]: https://chromium.googlesource.com/webports/+/master/ports/python
-[python_patch]: https://chromium.googlesource.com/webports/+/master/ports/python/nacl.patch
-[python_upstream]: http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
-[python-host]: https://chromium.googlesource.com/webports/+/master/ports/python-host
-[python-host_patch]: https://chromium.googlesource.com/webports/+/master/ports/python-host/nacl.patch
-[python-host_upstream]: http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
-[python-static]: https://chromium.googlesource.com/webports/+/master/ports/python-static
-[python-static_patch]: https://chromium.googlesource.com/webports/+/master/ports/python-static/nacl.patch
-[python-static_upstream]: http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
-[python3]: https://chromium.googlesource.com/webports/+/master/ports/python3
-[python3_patch]: https://chromium.googlesource.com/webports/+/master/ports/python3/nacl.patch
-[python3_upstream]: http://python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
-[cython]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/cython
-[cython_upstream]: http://cython.org/release/Cython-0.19.1.tar.gz
-[darksky-catalog]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/darksky-catalog
-[darksky-catalog_upstream]: https://pypi.python.org/packages/source/d/darksky_catalog/darksky_catalog-0.1.3.tar.gz
-[distribute]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/distribute
-[distribute_upstream]: http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
-[google-api-python-client]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/google-api-python-client
-[google-api-python-client_upstream]: https://pypi.python.org/packages/source/g/google-api-python-client/google-api-python-client-1.2.tar.gz
-[h5py]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/h5py
-[h5py_upstream]: http://h5py.googlecode.com/files/h5py-2.2.1.tar.gz
-[httplib2]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/httplib2
-[httplib2_upstream]: https://pypi.python.org/packages/source/h/httplib2/httplib2-0.9.tar.gz
-[ipython]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/ipython
-[ipython_patch]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/ipython/nacl.patch
-[ipython_upstream]: http://archive.ipython.org/release/2.1.0/ipython-2.1.0.tar.gz
-[jinja2]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/jinja2
-[jinja2_upstream]: https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.2.tar.gz
-[markupsafe]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/markupsafe
-[markupsafe_upstream]: https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.19.tar.gz
-[matplotlib]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/matplotlib
-[matplotlib_patch]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/matplotlib/nacl.patch
-[matplotlib_upstream]: http://sf.net/projects/matplotlib/files/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz
-[nose]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/nose
-[nose_upstream]: https://pypi.python.org/packages/source/n/nose/nose-1.3.0.tar.gz
-[numpy]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/numpy
-[numpy_patch]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/numpy/nacl.patch
-[numpy_upstream]: http://sf.net/projects/numpy/files/NumPy/1.8.0/numpy-1.8.0.tar.gz
-[pandas]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/pandas
-[pandas_patch]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/pandas/nacl.patch
-[pandas_upstream]: https://pypi.python.org/packages/source/p/pandas/pandas-0.13.1.tar.gz
-[pyparsing]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/pyparsing
-[pyparsing_upstream]: https://pypi.python.org/packages/source/p/pyparsing/pyparsing-2.0.1.tar.gz
-[pyppapi]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/pyppapi
-[pyppapi_upstream]: https://pypi.python.org/packages/source/p/pyppapi/pyppapi-0.4.tar.gz
-[python-dateutil]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/python-dateutil
-[python-dateutil_upstream]: https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz
-[python-gflags]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/python-gflags
-[python-gflags_upstream]: https://pypi.python.org/packages/source/p/python-gflags/python-gflags-2.0.tar.gz
-[pytz]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/pytz
-[pytz_upstream]: https://pypi.python.org/packages/source/p/pytz/pytz-2014.2.tar.gz
-[pyzmq]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/pyzmq
-[pyzmq_patch]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/pyzmq/nacl.patch
-[pyzmq_upstream]: https://pypi.python.org/packages/source/p/pyzmq/pyzmq-13.1.0.tar.gz
-[requests]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/requests
-[requests_upstream]: https://pypi.python.org/packages/source/r/requests/requests-2.3.0.tar.gz
-[setuptools]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/setuptools
-[setuptools_upstream]: https://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.1.tar.gz
-[six]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/six
-[six_upstream]: https://pypi.python.org/packages/source/s/six/six-1.5.2.tar.gz
-[sympy]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/sympy
-[sympy_upstream]: https://github.com/sympy/sympy/releases/download/sympy-0.7.4.1/sympy-0.7.4.1.tar.gz
-[thingking]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/thingking
-[thingking_patch]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/thingking/nacl.patch
-[thingking_upstream]: https://pypi.python.org/packages/source/t/thingking/thingking-1.0.2.tar.gz
-[yt]: https://chromium.googlesource.com/webports/+/master/ports/python_modules/yt
-[yt_upstream]: https://pypi.python.org/packages/source/y/yt/yt-3.0.tar.gz
-[quakespasm]: https://chromium.googlesource.com/webports/+/master/ports/quakespasm
-[quakespasm_patch]: https://chromium.googlesource.com/webports/+/master/ports/quakespasm/nacl.patch
-[quakespasm_upstream]: http://downloads.sf.net/project/quakespasm/Source/quakespasm-0.85.9.tgz
-[randrproto]: https://chromium.googlesource.com/webports/+/master/ports/randrproto
-[randrproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/randrproto-1.3.2.tar.bz2
-[readline]: https://chromium.googlesource.com/webports/+/master/ports/readline
-[readline_patch]: https://chromium.googlesource.com/webports/+/master/ports/readline/nacl.patch
-[readline_upstream]: ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz
-[recordproto]: https://chromium.googlesource.com/webports/+/master/ports/recordproto
-[recordproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/recordproto-1.14.2.tar.bz2
-[regal]: https://chromium.googlesource.com/webports/+/master/ports/regal
-[regal_patch]: https://chromium.googlesource.com/webports/+/master/ports/regal/nacl.patch
-[regal_upstream]: https://github.com/p3/regal/archive/5e14ae7/Regal-5e14ae7.tar.gz
-[renderproto]: https://chromium.googlesource.com/webports/+/master/ports/renderproto
-[renderproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/renderproto-0.11.1.tar.bz2
-[resourceproto]: https://chromium.googlesource.com/webports/+/master/ports/resourceproto
-[resourceproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/resourceproto-1.2.0.tar.bz2
-[ruby]: https://chromium.googlesource.com/webports/+/master/ports/ruby
-[ruby_patch]: https://chromium.googlesource.com/webports/+/master/ports/ruby/nacl.patch
-[ruby_upstream]: ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
-[ruby-ppapi]: https://chromium.googlesource.com/webports/+/master/ports/ruby-ppapi
-[samba]: https://chromium.googlesource.com/webports/+/master/ports/samba
-[samba_patch]: https://chromium.googlesource.com/webports/+/master/ports/samba/nacl.patch
-[samba_upstream]: http://ftp.samba.org/pub/samba/samba-4.1.16.tar.gz
-[scrnsaverproto]: https://chromium.googlesource.com/webports/+/master/ports/scrnsaverproto
-[scrnsaverproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/scrnsaverproto-1.2.2.tar.bz2
-[scummvm]: https://chromium.googlesource.com/webports/+/master/ports/scummvm
-[scummvm_patch]: https://chromium.googlesource.com/webports/+/master/ports/scummvm/nacl.patch
-[scummvm_upstream]: http://downloads.sf.net/scummvm/scummvm/1.7.0/scummvm-1.7.0.tar.gz
-[sdl]: https://chromium.googlesource.com/webports/+/master/ports/sdl
-[sdl_upstream]: https://github.com/sbc100/SDL-mirror.git@1c6f2d0
-[sdl-image]: https://chromium.googlesource.com/webports/+/master/ports/sdl-image
-[sdl-image_upstream]: http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.tar.gz
-[sdl-mixer]: https://chromium.googlesource.com/webports/+/master/ports/sdl-mixer
-[sdl-mixer_upstream]: http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.tar.gz
-[sdl-net]: https://chromium.googlesource.com/webports/+/master/ports/sdl-net
-[sdl-net_upstream]: http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.7.tar.gz
-[sdl-tests]: https://chromium.googlesource.com/webports/+/master/ports/sdl-tests
-[sdl-tests_patch]: https://chromium.googlesource.com/webports/+/master/ports/sdl-tests/nacl.patch
-[sdl-tests_upstream]: http://www.libsdl.org/release/SDL-1.2.14.tar.gz
-[sdl-ttf]: https://chromium.googlesource.com/webports/+/master/ports/sdl-ttf
-[sdl-ttf_patch]: https://chromium.googlesource.com/webports/+/master/ports/sdl-ttf/nacl.patch
-[sdl-ttf_upstream]: http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.10.tar.gz
-[sdl2]: https://chromium.googlesource.com/webports/+/master/ports/sdl2
-[sdl2_patch]: https://chromium.googlesource.com/webports/+/master/ports/sdl2/nacl.patch
-[sdl2_upstream]: https://github.com/sbc100/SDL-mirror.git@b406d6b
-[sdl2-gfx]: https://chromium.googlesource.com/webports/+/master/ports/sdl2-gfx
-[sdl2-gfx_upstream]: http://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.0.tar.gz
-[sdl2-image]: https://chromium.googlesource.com/webports/+/master/ports/sdl2-image
-[sdl2-image_upstream]: http://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.tar.gz
-[sdl2-tests]: https://chromium.googlesource.com/webports/+/master/ports/sdl2-tests
-[sdl2-tests_patch]: https://chromium.googlesource.com/webports/+/master/ports/sdl2-tests/nacl.patch
-[sdl2-tests_upstream]: https://github.com/sbc100/SDL-mirror.git@b406d6b
-[sdl2-ttf]: https://chromium.googlesource.com/webports/+/master/ports/sdl2-ttf
-[sdl2-ttf_patch]: https://chromium.googlesource.com/webports/+/master/ports/sdl2-ttf/nacl.patch
-[sdl2-ttf_upstream]: http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.12.tar.gz
-[sdlquake]: https://chromium.googlesource.com/webports/+/master/ports/sdlquake
-[sdlquake_patch]: https://chromium.googlesource.com/webports/+/master/ports/sdlquake/nacl.patch
-[sdlquake_upstream]: http://www.libsdl.org/projects/quake/src/sdlquake-1.0.9.tar.gz
-[snes9x]: https://chromium.googlesource.com/webports/+/master/ports/snes9x
-[snes9x_patch]: https://chromium.googlesource.com/webports/+/master/ports/snes9x/nacl.patch
-[snes9x_upstream]: https://sites.google.com/site/bearoso/snes9x/snes9x-1.53-src.tar.bz2
-[speex]: https://chromium.googlesource.com/webports/+/master/ports/speex
-[speex_upstream]: http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
-[sqlite]: https://chromium.googlesource.com/webports/+/master/ports/sqlite
-[sqlite_patch]: https://chromium.googlesource.com/webports/+/master/ports/sqlite/nacl.patch
-[sqlite_upstream]: http://www.sqlite.org/2013/sqlite-autoconf-3071601.tar.gz
-[stoken]: https://chromium.googlesource.com/webports/+/master/ports/stoken
-[stoken_upstream]: http://downloads.sf.net/stoken/stoken-0.90.tar.gz
-[subversion]: https://chromium.googlesource.com/webports/+/master/ports/subversion
-[subversion_patch]: https://chromium.googlesource.com/webports/+/master/ports/subversion/nacl.patch
-[subversion_upstream]: http://apache.mirrors.pair.com/subversion/subversion-1.8.11.tar.bz2
-[tar]: https://chromium.googlesource.com/webports/+/master/ports/tar
-[tar_patch]: https://chromium.googlesource.com/webports/+/master/ports/tar/nacl.patch
-[tar_upstream]: http://ftp.gnu.org/gnu/tar/tar-1.28.tar.bz2
-[tcl]: https://chromium.googlesource.com/webports/+/master/ports/tcl
-[tcl_patch]: https://chromium.googlesource.com/webports/+/master/ports/tcl/nacl.patch
-[tcl_upstream]: http://prdownloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
-[texinfo]: https://chromium.googlesource.com/webports/+/master/ports/texinfo
-[texinfo_upstream]: http://ftp.gnu.org/gnu/texinfo/texinfo-6.0.tar.gz
-[texlive]: https://chromium.googlesource.com/webports/+/master/ports/texlive
-[texlive_patch]: https://chromium.googlesource.com/webports/+/master/ports/texlive/nacl.patch
-[texlive_upstream]: ftp://tug.org/texlive/historic/2015/texlive-20150521-source.tar.xz
-[thttpd]: https://chromium.googlesource.com/webports/+/master/ports/thttpd
-[thttpd_patch]: https://chromium.googlesource.com/webports/+/master/ports/thttpd/nacl.patch
-[thttpd_upstream]: http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
-[tiff]: https://chromium.googlesource.com/webports/+/master/ports/tiff
-[tiff_upstream]: http://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz
-[tinyxml]: https://chromium.googlesource.com/webports/+/master/ports/tinyxml
-[tinyxml_patch]: https://chromium.googlesource.com/webports/+/master/ports/tinyxml/nacl.patch
-[tinyxml_upstream]: http://download.sf.net/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz
-[tk]: https://chromium.googlesource.com/webports/+/master/ports/tk
-[tk_patch]: https://chromium.googlesource.com/webports/+/master/ports/tk/nacl.patch
-[tk_upstream]: http://prdownloads.sourceforge.net/tcl/tk8.6.1-src.tar.gz
-[toybox]: https://chromium.googlesource.com/webports/+/master/ports/toybox
-[toybox_patch]: https://chromium.googlesource.com/webports/+/master/ports/toybox/nacl.patch
-[toybox_upstream]: http://www.landley.net/toybox/downloads/toybox-0.4.7.tar.bz2
-[tree]: https://chromium.googlesource.com/webports/+/master/ports/tree
-[tree_patch]: https://chromium.googlesource.com/webports/+/master/ports/tree/nacl.patch
-[tree_upstream]: ftp://mama.indstate.edu/linux/tree/tree-1.7.0.tgz
-[twm]: https://chromium.googlesource.com/webports/+/master/ports/twm
-[twm_upstream]: http://xwinman.org/archive/twm/twm-X11R6-xc-fix13.tar.gz
-[unzip]: https://chromium.googlesource.com/webports/+/master/ports/unzip
-[unzip_patch]: https://chromium.googlesource.com/webports/+/master/ports/unzip/nacl.patch
-[unzip_upstream]: http://download.sf.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.zip
-[videoproto]: https://chromium.googlesource.com/webports/+/master/ports/videoproto
-[videoproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/videoproto-2.3.1.tar.bz2
-[vim]: https://chromium.googlesource.com/webports/+/master/ports/vim
-[vim_patch]: https://chromium.googlesource.com/webports/+/master/ports/vim/nacl.patch
-[vim_upstream]: http://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
-[wireshark]: https://chromium.googlesource.com/webports/+/master/ports/wireshark
-[wireshark_patch]: https://chromium.googlesource.com/webports/+/master/ports/wireshark/nacl.patch
-[wireshark_upstream]: https://www.wireshark.org/download/src/all-versions/wireshark-1.10.11.tar.bz2
-[x264]: https://chromium.googlesource.com/webports/+/master/ports/x264
-[x264_patch]: https://chromium.googlesource.com/webports/+/master/ports/x264/nacl.patch
-[x264_upstream]: http://downloads.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20140829-2245-stable.tar.bz2
-[xaos]: https://chromium.googlesource.com/webports/+/master/ports/xaos
-[xaos_patch]: https://chromium.googlesource.com/webports/+/master/ports/xaos/nacl.patch
-[xaos_upstream]: http://downloads.sf.net/xaos/xaos-3.6.tar.gz
-[xbitmaps]: https://chromium.googlesource.com/webports/+/master/ports/xbitmaps
-[xbitmaps_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xbitmaps-1.1.1.tar.bz2
-[xcb-proto]: https://chromium.googlesource.com/webports/+/master/ports/xcb-proto
-[xcb-proto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xcb-proto-1.7.1.tar.bz2
-[xcb-util]: https://chromium.googlesource.com/webports/+/master/ports/xcb-util
-[xcb-util_upstream]: http://xcb.freedesktop.org/dist/xcb-util-0.3.9.tar.bz2
-[xcmiscproto]: https://chromium.googlesource.com/webports/+/master/ports/xcmiscproto
-[xcmiscproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xcmiscproto-1.2.2.tar.bz2
-[xextproto]: https://chromium.googlesource.com/webports/+/master/ports/xextproto
-[xextproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xextproto-7.2.1.tar.bz2
-[xeyes]: https://chromium.googlesource.com/webports/+/master/ports/xeyes
-[xeyes_upstream]: http://xorg.freedesktop.org/releases/individual/app/xeyes-1.0.1.tar.bz2
-[xfonts]: https://chromium.googlesource.com/webports/+/master/ports/xfonts
-[xineramaproto]: https://chromium.googlesource.com/webports/+/master/ports/xineramaproto
-[xineramaproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xineramaproto-1.2.1.tar.bz2
-[xkbcomp]: https://chromium.googlesource.com/webports/+/master/ports/xkbcomp
-[xkbcomp_patch]: https://chromium.googlesource.com/webports/+/master/ports/xkbcomp/nacl.patch
-[xkbcomp_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xkbcomp-1.2.4.tar.bz2
-[xkeyboard-config]: https://chromium.googlesource.com/webports/+/master/ports/xkeyboard-config
-[xkeyboard-config_patch]: https://chromium.googlesource.com/webports/+/master/ports/xkeyboard-config/nacl.patch
-[xkeyboard-config_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xkeyboard-config-2.6.tar.bz2
-[xorg-server]: https://chromium.googlesource.com/webports/+/master/ports/xorg-server
-[xorg-server_patch]: https://chromium.googlesource.com/webports/+/master/ports/xorg-server/nacl.patch
-[xorg-server_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2
-[xproto]: https://chromium.googlesource.com/webports/+/master/ports/xproto
-[xproto_patch]: https://chromium.googlesource.com/webports/+/master/ports/xproto/nacl.patch
-[xproto_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xproto-7.0.23.tar.bz2
-[xtrans]: https://chromium.googlesource.com/webports/+/master/ports/xtrans
-[xtrans_patch]: https://chromium.googlesource.com/webports/+/master/ports/xtrans/nacl.patch
-[xtrans_upstream]: http://www.x.org/releases/X11R7.7/src/everything/xtrans-1.2.7.tar.bz2
-[xz]: https://chromium.googlesource.com/webports/+/master/ports/xz
-[xz_upstream]: http://tukaani.org/xz/xz-5.2.0.tar.xz
-[yajl]: https://chromium.googlesource.com/webports/+/master/ports/yajl
-[yajl_patch]: https://chromium.googlesource.com/webports/+/master/ports/yajl/nacl.patch
-[yajl_upstream]: http://github.com/lloyd/yajl/archive/2.0.4/yajl-2.0.4.zip
-[zeromq]: https://chromium.googlesource.com/webports/+/master/ports/zeromq
-[zeromq_patch]: https://chromium.googlesource.com/webports/+/master/ports/zeromq/nacl.patch
-[zeromq_upstream]: http://download.zeromq.org/zeromq-4.0.3.tar.gz
-[zlib]: https://chromium.googlesource.com/webports/+/master/ports/zlib
-[zlib_patch]: https://chromium.googlesource.com/webports/+/master/ports/zlib/nacl.patch
-[zlib_upstream]: http://www.zlib.net/zlib-1.2.8.tar.gz
diff --git a/infra/README.md b/infra/README.md
deleted file mode 100644
index 5788e8a..0000000
--- a/infra/README.md
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains infra-specific files.
diff --git a/infra/config/OWNERS b/infra/config/OWNERS
deleted file mode 100644
index 1c98c40..0000000
--- a/infra/config/OWNERS
+++ /dev/null
@@ -1,5 +0,0 @@
-set noparent
-binji@chromium.org
-bradnelson@chromium.org
-sbc@chromium.org
-sergiyb@chromium.org
diff --git a/infra/config/README.md b/infra/config/README.md
deleted file mode 100644
index c036d61..0000000
--- a/infra/config/README.md
+++ /dev/null
@@ -1 +0,0 @@
-This directory contains configuration files for infra services.
diff --git a/infra/config/cq.cfg b/infra/config/cq.cfg
deleted file mode 100644
index 58d6367..0000000
--- a/infra/config/cq.cfg
+++ /dev/null
@@ -1,49 +0,0 @@
-# Commit Queue configuration file. The documentation of the format can be found
-# at http://luci-config.appspot.com/schemas/projects/refs:cq.cfg.
-
-version: 1
-cq_name: "webports"
-cq_status_url: "https://chromium-cq-status.appspot.com"
-
-rietveld {
- url: "https://codereview.chromium.org"
-}
-
-
-verifiers {
- reviewer_lgtm {
- committer_list: "external/project-chromium-committers"
- }
-
- tree_status {
- tree_status_url: "https://naclports-status.appspot.com"
- }
-
- try_job {
- buckets {
- name: "tryserver.nacl"
- builders { name: "webports-linux-clang-0" }
- builders { name: "webports-linux-clang-1" }
- builders { name: "webports-linux-clang-2" }
- builders { name: "webports-linux-clang-3" }
- builders { name: "webports-linux-clang-4" }
- builders { name: "webports-linux-clang-5" }
- builders { name: "webports-linux-emscripten-0" }
- builders { name: "webports-linux-glibc-0" }
- builders { name: "webports-linux-glibc-1" }
- builders { name: "webports-linux-glibc-2" }
- builders { name: "webports-linux-glibc-3" }
- builders { name: "webports-linux-glibc-4" }
- builders { name: "webports-linux-glibc-5" }
- builders { name: "webports-linux-pnacl-0" }
- builders { name: "webports-linux-pnacl-1" }
- builders { name: "webports-linux-pnacl-2" }
- builders { name: "webports-linux-pnacl-3" }
- builders { name: "webports-linux-pnacl-4" }
- builders { name: "webports-linux-pnacl-5" }
- # toolchain bot its too slow the CQ right now
- #builders { name: "webports-linux-toolchain-0" }
- builders { name: "webports-presubmit" }
- }
- }
-}
diff --git a/lib/webports/__init__.py b/lib/webports/__init__.py
deleted file mode 100644
index d11e163..0000000
--- a/lib/webports/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2013 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.
-
-from webports.error import Error, PkgFormatError, DisabledError
-from webports.pkg_info import ParsePkgInfoFile, ParsePkgInfo
-from webports.util import Log, LogVerbose, Warn, DownloadFile, SetVerbose
-from webports.util import GetInstallRoot, InstallLock, BuildLock, IsInstalled
-from webports.util import GS_BUCKET, GS_URL
-from webports.paths import NACLPORTS_ROOT, OUT_DIR, TOOLS_DIR, PACKAGES_ROOT
-from webports.paths import BUILD_ROOT, STAMP_DIR, PUBLISH_ROOT
-
-import colorama
-colorama.init()
diff --git a/lib/webports/__main__.py b/lib/webports/__main__.py
deleted file mode 100644
index 431d7fd..0000000
--- a/lib/webports/__main__.py
+++ /dev/null
@@ -1,383 +0,0 @@
-# Copyright (c) 2013 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.
-"""Tool for manipulating webports packages in python.
-
-This tool can be used to for working with webports packages.
-It can also be incorporated into other tools that need to
-work with packages (e.g. 'update_mirror.py' uses it to iterate
-through all packages and mirror them on Google Cloud Storage).
-"""
-
-from __future__ import print_function
-import os
-import subprocess
-import sys
-import tempfile
-
-if sys.version_info < (2, 7, 0):
- sys.stderr.write("python 2.7 or later is required run this script\n")
- sys.exit(1)
-
-import argparse
-
-sys.path.append(os.path.dirname(os.path.dirname(__file__)))
-
-from webports import configuration, error, source_package, util, paths
-from webports import installed_package
-
-
-def PrintError(msg):
- sys.stderr.write('webports: %s\n' % util.Color(str(msg), 'red'))
-
-
-def CmdList(config, options, args):
- """List installed packages"""
- if len(args):
- raise error.Error('list command takes no arguments')
- if options.all:
- iterator = source_package.SourcePackageIterator()
- else:
- iterator = installed_package.InstalledPackageIterator(config)
- for package in iterator:
- if options.verbosity:
- sys.stdout.write('%-15s %s\n' % (package.NAME, package.VERSION))
- else:
- sys.stdout.write(package.NAME + '\n')
- return 0
-
-
-def CmdInfo(config, options, args):
- """Print infomation on installed package(s)"""
- if len(args) != 1:
- raise error.Error('info command takes a single package name')
- package_name = args[0]
- pkg = installed_package.CreateInstalledPackage(package_name, config)
- info_file = pkg.GetInstallStamp()
- print('Install receipt: %s' % info_file)
- with open(info_file) as f:
- sys.stdout.write(f.read())
-
-
-def CmdPkgListDeps(package, options):
- """Print complete list of package dependencies."""
- for pkg in package.TransitiveDependencies():
- print(pkg.NAME)
-
-
-def CmdPkgContents(package, options):
- """List contents of an installed package"""
- install_root = util.GetInstallRoot(package.config)
- for filename in package.Files():
- if util.log_level > util.LOG_INFO:
- filename = os.path.join(install_root, filename)
- if options.all:
- filename = package.NAME + ': ' + filename
- sys.stdout.write(filename + '\n')
-
-
-def CmdPkgDownload(package, options):
- """Download sources for given package(s)"""
- package.Download()
-
-
-def CmdPkgUscan(package, options):
- """Use Debian's 'uscan' to check for upstream versions."""
- if not package.URL:
- return 0
-
- if package.VERSION not in package.URL:
- PrintError('%s: uscan only works if VERSION is embedded in URL' %
- package.NAME)
- return 0
-
- temp_fd, temp_file = tempfile.mkstemp('webports_watchfile')
- try:
- with os.fdopen(temp_fd, 'w') as f:
- uscan_url = package.URL.replace(package.VERSION, '(.+)')
- uscan_url = uscan_url.replace('download.sf.net', 'sf.net')
- util.LogVerbose('uscan pattern: %s' % uscan_url)
- f.write("version = 3\n")
- f.write("%s\n" % uscan_url)
-
- cmd = ['uscan', '--upstream-version', package.VERSION, '--package',
- package.NAME, '--watchfile', temp_file]
- util.LogVerbose(' '.join(cmd))
- rtn = subprocess.call(cmd)
- finally:
- os.remove(temp_file)
-
- return rtn
-
-
-def CmdCheck(config, options, args):
- """Verify the dependecies of all install packages are also installed."""
- if len(args):
- raise error.Error('check command takes no arguments')
-
- installed_packages = installed_package.InstalledPackageIterator(config)
- installed_map = {pkg.NAME: pkg for pkg in installed_packages}
-
- checked = set()
- def CheckDeps(pkg_name, required_by):
- if pkg_name in checked:
- return
- checked.add(pkg_name)
- pkg = installed_map.get(pkg_name)
- if not pkg:
- raise error.Error("missing package '%s' required by '%s'" % (pkg_name,
- required_by))
- for dep in pkg.DEPENDS:
- CheckDeps(dep, pkg.NAME)
-
- for pkg in installed_map.itervalues():
- CheckDeps(pkg.NAME, None)
-
-
-def CmdPkgCheck(package, options):
- """Verify dependency information for given package(s)"""
- # The fact that we got this far means the pkg_info is basically valid.
- # This final check verifies the dependencies are valid.
- # Cache the list of all packages names since this function could be called
- # a lot in the case of "webports check --all".
- packages = source_package.SourcePackageIterator()
- if not CmdPkgCheck.all_package_names:
- CmdPkgCheck.all_package_names = [os.path.basename(p.root) for p in packages]
- util.Log("Checking deps for %s .." % package.NAME)
- package.CheckDeps(CmdPkgCheck.all_package_names)
-
-
-CmdPkgCheck.all_package_names = None
-
-
-def CmdPkgBuild(package, options):
- """Build package(s)"""
- package.Build(options.build_deps, force=options.force)
-
-
-def PerformUninstall(package):
- for dep in package.ReverseDependencies():
- PerformUninstall(dep)
- package.Uninstall()
-
-
-def CmdPkgInstall(package, options):
- """Install package(s)"""
- if options.all:
- for conflict in package.TransitiveConflicts():
- if conflict.IsInstalled():
- PerformUninstall(conflict)
-
- package.Install(options.build_deps, force=options.force,
- from_source=options.from_source)
-
-
-def CmdPkgUninstall(package, options):
- """Uninstall package(s)"""
- for dep in package.ReverseDependencies():
- if options.force or options.all:
- PerformUninstall(dep)
- else:
- raise error.Error("unable to uninstall '%s'. another package is "
- "installed which depends on it: '%s'" % (package.NAME, dep.NAME))
-
- package.Uninstall()
-
-
-def CmdPkgClean(package, options):
- """Clean package build artifacts."""
- package.Clean()
-
-
-def CmdPkgUpdatePatch(package, options):
- """Update patch file for package(s)"""
- package.UpdatePatch()
-
-
-def CmdPkgExtract(package, options):
- """Extact source archive for package(s)"""
- package.Download()
- package.Extract()
-
-
-def CmdPkgPatch(package, options):
- """Apply webports patch for package(s)"""
- package.Patch()
-
-
-def CleanAll(config):
- """Remove all build directories and all pre-built packages as well
- as all installed packages for the given configuration."""
-
- def rmtree(path):
- util.Log('removing %s' % path)
- util.RemoveTree(path)
-
- rmtree(paths.STAMP_DIR)
- rmtree(paths.BUILD_ROOT)
- rmtree(paths.PUBLISH_ROOT)
- rmtree(paths.PACKAGES_ROOT)
- rmtree(util.GetInstallStampRoot(config))
- rmtree(util.GetInstallRoot(config))
-
-
-def RunMain(args):
- base_commands = {
- 'list': CmdList,
- 'info': CmdInfo,
- 'check': CmdCheck,
- }
-
- pkg_commands = {
- 'download': CmdPkgDownload,
- 'uscan': CmdPkgUscan,
- 'check': CmdPkgCheck,
- 'build': CmdPkgBuild,
- 'install': CmdPkgInstall,
- 'clean': CmdPkgClean,
- 'uninstall': CmdPkgUninstall,
- 'contents': CmdPkgContents,
- 'depends': CmdPkgListDeps,
- 'updatepatch': CmdPkgUpdatePatch,
- 'extract': CmdPkgExtract,
- 'patch': CmdPkgPatch
- }
-
- installed_pkg_commands = ['contents', 'uninstall']
-
- all_commands = dict(base_commands.items() + pkg_commands.items())
-
- epilog = "The following commands are available:\n"
- for name, function in all_commands.iteritems():
- epilog += ' %-12s - %s\n' % (name, function.__doc__)
-
- parser = argparse.ArgumentParser(prog='webports', description=__doc__,
- formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog)
- parser.add_argument('-v', '--verbose', dest='verbosity', action='count',
- default=0, help='Output extra information.')
- parser.add_argument('-V', '--verbose-build', action='store_true',
- help='Make builds verbose (e.g. pass V=1 to make')
- parser.add_argument('--skip-sdk-version-check', action='store_true',
- help="Disable the NaCl SDK version check on startup.")
- parser.add_argument('--all', action='store_true',
- help='Perform action on all known ports.')
- parser.add_argument('--color', choices=('always', 'never', 'auto'),
- help='Enabled color terminal output', default='auto')
- parser.add_argument('-f', '--force', action='store_const', const='build',
- help='Force building specified targets, '
- 'even if timestamps would otherwise skip it.')
- parser.add_argument('--from-source', action='store_true',
- help='Always build from source rather than downloading '
- 'prebuilt packages.')
- parser.add_argument('-F', '--force-all', action='store_const', const='all',
- dest='force', help='Force building target and all '
- 'dependencies, even if timestamps would otherwise skip '
- 'them.')
- parser.add_argument('--no-deps', dest='build_deps', action='store_false',
- default=True,
- help='Disable automatic building of dependencies.')
- parser.add_argument('--ignore-disabled', action='store_true',
- help='Ignore attempts to build disabled packages.\n'
- 'Normally attempts to build such packages will result\n'
- 'in an error being returned.')
- parser.add_argument('-t', '--toolchain',
- help='Set toolchain to use when building (newlib, glibc, '
- 'or pnacl)')
- # use store_const rather than store_true since we want to default for
- # debug to be None (which then falls back to checking the NACL_DEBUG
- # environment variable.
- parser.add_argument('-d', '--debug', action='store_const', const=True,
- help='Build debug configuration (release is the default)')
- parser.add_argument('-a', '--arch',
- help='Set architecture to use when building (x86_64,'
- ' x86_32, arm, pnacl)')
- parser.add_argument('command', help="sub-command to run")
- parser.add_argument('pkg', nargs='*', help="package name or directory")
- args = parser.parse_args(args)
-
- if not args.verbosity and os.environ.get('VERBOSE') == '1':
- args.verbosity = 1
-
- util.SetLogLevel(util.LOG_INFO + args.verbosity)
-
- if args.verbose_build:
- os.environ['VERBOSE'] = '1'
- else:
- if 'VERBOSE' in os.environ:
- del os.environ['VERBOSE']
- if 'V' in os.environ:
- del os.environ['V']
-
- if args.skip_sdk_version_check:
- util.MIN_SDK_VERSION = -1
-
- util.CheckSDKRoot()
- config = configuration.Configuration(args.arch, args.toolchain, args.debug)
- util.color_mode = args.color
- if args.color == 'never':
- util.Color.enabled = False
- elif args.color == 'always':
- util.Color.enabled = True
-
- if args.command in base_commands:
- base_commands[args.command](config, args, args.pkg)
- return 0
-
- if args.command not in pkg_commands:
- parser.error("Unknown subcommand: '%s'\n"
- 'See --help for available commands.' % args.command)
-
- if len(args.pkg) and args.all:
- parser.error('Package name(s) and --all cannot be specified together')
-
- if args.pkg:
- package_names = args.pkg
- else:
- package_names = [os.getcwd()]
-
- def DoCmd(package):
- try:
- pkg_commands[args.command](package, args)
- except error.DisabledError as e:
- if args.ignore_disabled:
- util.Log('webports: %s' % e)
- else:
- raise e
-
- if args.all:
- args.ignore_disabled = True
- if args.command == 'clean':
- CleanAll(config)
- else:
- if args.command in installed_pkg_commands:
- package_iterator = installed_package.InstalledPackageIterator(config)
- else:
- package_iterator = source_package.SourcePackageIterator()
- for p in package_iterator:
- DoCmd(p)
- else:
- for package_name in package_names:
- if args.command in installed_pkg_commands:
- p = installed_package.CreateInstalledPackage(package_name, config)
- else:
- p = source_package.CreatePackage(package_name, config)
- DoCmd(p)
-
-
-def main(args):
- try:
- RunMain(args)
- except KeyboardInterrupt:
- PrintError('interrupted')
- return 1
- except error.Error as e:
- if os.environ.get('DEBUG'):
- raise
- PrintError(str(e))
- return 1
-
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
diff --git a/lib/webports/binary_package.py b/lib/webports/binary_package.py
deleted file mode 100644
index 1e1bc7c..0000000
--- a/lib/webports/binary_package.py
+++ /dev/null
@@ -1,238 +0,0 @@
-# Copyright (c) 2014 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.
-
-import os
-import posixpath
-import shutil
-import stat
-import tarfile
-
-from webports import configuration, package, util, error
-
-PAYLOAD_DIR = 'payload'
-INSTALL_PREFIX = '/webports-dummydir'
-
-def MakeDirIfNeeded(filename):
- dirname = os.path.dirname(filename)
- if not os.path.isdir(dirname):
- util.Makedirs(dirname)
-
-
-def FilterOutExecutables(filenames, root):
- """Filter out ELF binaries in the bin directory.
-
- We don't want NaCl exectuables installed in the toolchain's bin directory
- since we add this to the PATH during the build process, and NaCl executables
- can't be run on the host system (not without sel_ldr anyway).
- """
- rtn = []
- for name in filenames:
- full_name = os.path.join(root, name)
- if os.path.split(name)[0] == 'bin':
- if not os.path.splitext(name)[1] and util.IsElfFile(full_name):
- continue
- rtn.append(name)
-
- return rtn
-
-
-def InstallFile(filename, old_root, new_root):
- """Install a single file by moving it into a new location.
-
- Args:
- filename: Relative name of file to install.
- old_root: The current location of the file.
- new_root: The new desired root for the file.
- """
- oldname = os.path.join(old_root, filename)
-
- util.LogVerbose('install: %s' % filename)
-
- newname = os.path.join(new_root, filename)
- dirname = os.path.dirname(newname)
- if not os.path.isdir(dirname):
- util.Makedirs(dirname)
- os.rename(oldname, newname)
-
- # When install binaries ELF files into the toolchain direcoties, remove
- # the X bit so that they do not found when searching the PATH.
- if util.IsElfFile(newname) or util.IsPexeFile(newname):
- mode = os.stat(newname).st_mode
- mode = mode & ~(stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
- os.chmod(newname, mode)
-
-
-
-def RelocateFile(filename, dest):
- """Perform in-place mutations on file contents to handle new location.
-
- There are a few file types that have absolute pathnames embedded
- and need to be modified in some way when being installed to
- a particular location. For most file types this method does nothing.
- """
- # Only relocate certain file types.
- modify = False
-
- # boost build scripts
- # TODO(sbc): move this to the boost package metadata
- if filename.startswith('build-1'):
- modify = True
- # pkg_config (.pc) files
- if filename.startswith('lib/pkgconfig'):
- modify = True
- if filename.startswith('share/pkgconfig'):
- modify = True
- # <foo>-config scripts that live in usr/bin
- if filename.startswith('bin') and filename.endswith('-config'):
- modify = True
- # libtool's .la files which can contain absolute paths to
- # dependencies.
- if filename.endswith('.la'):
- modify = True
- # headers can sometimes also contain absolute paths.
- if filename.startswith('include/') and filename.endswith('.h'):
- modify = True
-
- filename = os.path.join(dest, filename)
-
- if modify:
- with open(filename) as f:
- data = f.read()
- mode = os.stat(filename).st_mode
- os.chmod(filename, 0777)
- with open(filename, 'r+') as f:
- f.write(data.replace(INSTALL_PREFIX, dest))
- os.chmod(filename, mode)
-
-
-class BinaryPackage(package.Package):
- """Representation of binary package packge file.
-
- This class is initialised with the filename of a binary package
- and its attributes are set according the file name and contents.
-
- Operations such as installation can be performed on the package.
- """
- extra_keys = package.EXTRA_KEYS
-
- def __init__(self, filename):
- util.Trace('BinaryPackage: %s' % filename)
- super(BinaryPackage, self).__init__()
- self.filename = filename
- self.info = filename
- self.VerifyArchiveFormat()
-
- info = self.GetPkgInfo()
- self.ParseInfo(info)
- self.config = configuration.Configuration(self.BUILD_ARCH,
- self.BUILD_TOOLCHAIN,
- self.BUILD_CONFIG == 'debug')
-
- def VerifyArchiveFormat(self):
- if not os.path.exists(self.filename):
- raise error.Error('package archive not found: %s' % self.filename)
- basename, extension = os.path.splitext(os.path.basename(self.filename))
- basename = os.path.splitext(basename)[0]
- if extension != '.bz2':
- raise error.Error('invalid file extension: %s' % extension)
-
- try:
- with tarfile.open(self.filename):
- pass
- except tarfile.TarError as e:
- raise error.PkgFormatError(e)
-
- def IsInstallable(self):
- """Determine if a binary package can be installed in the
- currently configured SDK.
-
- Currently only packages built with the same SDK major version
- are installable.
- """
- return self.BUILD_SDK_VERSION == util.GetSDKVersion()
-
- def GetPkgInfo(self):
- """Extract the contents of the pkg_info file from the binary package."""
- with tarfile.open(self.filename) as tar:
- for member in tar:
- if member.name != 'pkg_info':
- raise error.PkgFormatError('pkg_info not first member in archive')
- return tar.extractfile(member).read()
-
- def Install(self, force):
- """Install binary package into toolchain directory."""
- util.Trace('Installing %s' % self.filename)
- with util.InstallLock(self.config):
- self._Install(force)
-
- def _Install(self, force):
- if self.TOOLCHAIN_INSTALL != '0':
- self._InstallFiles(force)
- self.WriteStamp()
-
- def _InstallFiles(self, force):
- dest = util.GetInstallRoot(self.config)
- dest_tmp = os.path.join(dest, 'install_tmp')
- if os.path.exists(dest_tmp):
- shutil.rmtree(dest_tmp)
-
- if self.IsAnyVersionInstalled():
- raise error.Error('package already installed: %s' % self.InfoString())
-
- self.LogStatus('Installing')
- util.LogVerbose('installing from: %s' % self.filename)
- util.Makedirs(dest_tmp)
-
- names = []
- try:
- with tarfile.open(self.filename) as tar:
- for info in tar:
- if info.isdir():
- continue
- name = posixpath.normpath(info.name)
- if name == 'pkg_info':
- continue
- if not name.startswith(PAYLOAD_DIR + '/'):
- raise error.PkgFormatError('invalid file in package: %s' % name)
-
- name = name[len(PAYLOAD_DIR) + 1:]
- names.append(name)
-
- if not force:
- for name in names:
- full_name = os.path.join(dest, name)
- if os.path.exists(full_name):
- raise error.Error('file already exists: %s' % full_name)
-
- tar.extractall(dest_tmp)
- payload_tree = os.path.join(dest_tmp, PAYLOAD_DIR)
-
- names = FilterOutExecutables(names, payload_tree)
-
- for name in names:
- InstallFile(name, payload_tree, dest)
- finally:
- shutil.rmtree(dest_tmp)
-
- for name in names:
- RelocateFile(name, dest)
-
- self.WriteFileList(names)
-
- def WriteStamp(self):
- """Write stamp file containing pkg_info."""
- filename = util.GetInstallStamp(self.NAME, self.config)
- MakeDirIfNeeded(filename)
- util.LogVerbose('stamp: %s' % filename)
- pkg_info = self.GetPkgInfo()
- with open(filename, 'w') as f:
- f.write(pkg_info)
-
- def WriteFileList(self, file_names):
- """Write the file list for this package."""
- filename = self.GetListFile()
- MakeDirIfNeeded(filename)
- with open(filename, 'w') as f:
- for name in file_names:
- f.write(name + '\n')
diff --git a/lib/webports/bsd_pkg.py b/lib/webports/bsd_pkg.py
deleted file mode 100644
index 21e4a65..0000000
--- a/lib/webports/bsd_pkg.py
+++ /dev/null
@@ -1,195 +0,0 @@
-# Copyright 2015 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.
-
-"""Basic implemenation of FreeBSD pkg file format.
-
-This is just enough to allow us to create archive files
-that pkg will then be able to install.
-
-See https://github.com/freebsd/pkg#pkgfmt for information
-on this package format.
-"""
-
-import collections
-import hashlib
-import os
-import shutil
-import tarfile
-
-from webports import binary_package, package, paths, util
-from webports.error import Error
-
-INSTALL_PREFIX = 'usr'
-
-def WriteUCL(outfile, ucl_dict):
- """Write a dictionary to file in UCL format"""
-
- # See: https://github.com/vstakhov/libucl
- with open(outfile, 'w') as f:
- f.write('{\n')
- for key, value in ucl_dict.iteritems():
- if key == 'files':
- f.write(' "%s": \n {\n' % key)
- for file_name, file_hash in value.iteritems():
- f.write(' "%s": "%s",\n' % (file_name, file_hash))
- f.write(' }\n')
- elif key == 'deps':
- f.write(' "%s": \n {\n' % key)
- for dep_name, dep_dict in value.iteritems():
- f.write(' "%s": \n {\n' % dep_name)
- for dep_dict_key, dep_dict_value in dep_dict.iteritems():
- f.write(' "%s": "%s",\n' % (dep_dict_key, dep_dict_value))
- f.write(' },\n')
- f.write(' }\n')
- else:
- f.write(' "%s": "%s",\n' % (key, value))
- f.write('}\n')
-
-
-def ParseDir(payload_dir, file_dict, prefix):
- for filename in os.listdir(payload_dir):
- if not filename.startswith('+'):
- fullname = os.path.join(payload_dir, filename)
- if os.path.isdir(fullname):
- ParseDir(fullname, file_dict, prefix + filename + '/')
- elif os.path.islink(fullname):
- continue
- else:
- with open(fullname, 'rb') as f:
- # TODO(sbc): These extensions should probably be stripped out earlier
- # or never generated.
- basename, ext = os.path.splitext(filename)
- if ext in ('.nexe', '.pexe'):
- filename = basename
- file_dict[prefix + filename] = hashlib.sha256(f.read()).hexdigest()
-
-
-def AddFilesInDir(content_dir, tar, prefix):
- for filename in os.listdir(content_dir):
- fullname = os.path.join(content_dir, filename)
- arcname = fullname.replace(prefix, '')
-
- # Resolve symbolic link by duplicating the target file
- # TODO(sbc): remove this once devenv (nacl_io) supports symlinks.
- if os.path.islink(fullname):
- link_target = os.path.realpath(fullname)
- if os.path.isabs(link_target):
- link_target = link_target.replace(binary_package.INSTALL_PREFIX, prefix
- + '/' + INSTALL_PREFIX)
- if not os.path.exists(link_target):
- raise Exception('Package contains dangling link: %s' % fullname)
- if os.path.isdir(link_target):
- continue
- os.remove(fullname)
- shutil.copyfile(link_target, fullname)
-
- if os.path.isdir(fullname):
- AddFilesInDir(fullname, tar, prefix)
- elif os.path.islink(fullname):
- info = tar.gettarinfo(fullname)
- info.name = arcname
- tar.addfile(info)
- else:
- # Rather convoluted way to add files to a tar archive that are
- # abolute (i.e. start with /). pkg requires this, but python's
- # tar.py calls lstrip('/') on arcname in the tar.add() method.
- with open(fullname, 'r') as f:
- info = tar.gettarinfo(fileobj=f)
- info.name = arcname
- # TODO(sbc): These extensions should probably be stripped out earlier
- # or never generated.
- basename, ext = os.path.splitext(info.name)
- if ext in ('.nexe', '.pexe'):
- info.name = basename
- tar.addfile(info, fileobj=f)
-
-
-DEFAULT_LOCATIONS = ('ports', 'ports/python_modules')
-
-
-def AddPackageDep(dep_dict, dep):
- dep_dict['origin'] = dep
-
- if os.path.isdir(dep):
- pkg = package.Package(info_file=os.path.join(dep, 'pkg_info'))
- dep_dict['version'] = pkg.VERSION
- return
-
- for subdir in DEFAULT_LOCATIONS:
- pkg_info_file = os.path.join(paths.NACLPORTS_ROOT,
- subdir, dep, 'pkg_info')
-
- if os.path.exists(pkg_info_file):
- dep_dict['version'] = package.Package(info_file=pkg_info_file).VERSION
- return
-
- raise Error("Package not found: %s" % dep)
-
-
-# These packages are are built-time only depednecies and we won't want
-# encode them into the pkg file deps.
-BUILD_ONLY_DEPS = [
- 'glibc-compat',
- 'libtar',
- 'python-host',
- 'gmp',
- 'mpfr',
- 'mpc',
-]
-
-def CreateDependencies(depends_dict, depends):
- for dep in depends:
- if dep in BUILD_ONLY_DEPS:
- continue
- dep_dict = collections.OrderedDict()
- AddPackageDep(dep_dict, dep)
- depends_dict[dep] = dep_dict
-
-
-def CreatePkgFile(name, version, arch, payload_dir, outfile, depends):
- """Create an archive file in FreeBSD's pkg file format"""
- util.Log('Creating pkg package: %s' % outfile)
- manifest = collections.OrderedDict()
- manifest['name'] = name
- manifest['version'] = version
- manifest['arch'] = 'nacl:0:%s' % arch
-
- # The following fields are required by 'pkg' but we don't have
- # meaningful values for them yet
- manifest['origin'] = name,
- manifest['comment'] = 'comment not available'
- manifest['desc'] = 'desc not available'
- manifest['maintainer'] = 'native-client-discuss@googlegroups.com'
- manifest['www'] = 'https://chromium.googlesource.com/webports'
- manifest['prefix'] = INSTALL_PREFIX
-
- if depends:
- depends_dict = collections.OrderedDict()
- CreateDependencies(depends_dict, depends)
- manifest['deps'] = depends_dict
-
- temp_dir = os.path.splitext(outfile)[0] + '.tmp'
- if os.path.exists(temp_dir):
- shutil.rmtree(temp_dir)
- os.mkdir(temp_dir)
-
- content_dir = os.path.join(temp_dir, INSTALL_PREFIX)
- shutil.copytree(payload_dir, content_dir, symlinks=True)
- WriteUCL(os.path.join(temp_dir, '+COMPACT_MANIFEST'), manifest)
- file_dict = collections.OrderedDict()
- ParseDir(temp_dir, file_dict, '/')
- manifest['files'] = file_dict
- WriteUCL(os.path.join(temp_dir, '+MANIFEST'), manifest)
-
- with tarfile.open(outfile, 'w:bz2') as tar:
- for filename in os.listdir(temp_dir):
- if filename.startswith('+'):
- fullname = os.path.join(temp_dir, filename)
- tar.add(fullname, arcname=filename)
-
- for filename in os.listdir(temp_dir):
- if not filename.startswith('+'):
- fullname = os.path.join(temp_dir, filename)
- AddFilesInDir(fullname, tar, temp_dir)
- shutil.rmtree(temp_dir)
diff --git a/lib/webports/configuration.py b/lib/webports/configuration.py
deleted file mode 100644
index 2275807..0000000
--- a/lib/webports/configuration.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright (c) 2014 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.
-
-import os
-import platform
-
-from webports import error, util
-
-VALID_TOOLCHAINS = ['glibc', 'pnacl', 'clang-newlib', 'emscripten']
-VALID_LIBC = ['newlib', 'glibc']
-
-
-class Configuration(object):
- """Class representing the build configuration for webports packages.
-
- This consists of the following attributes:
- toolchain - clang-newlib, glibc, pnacl
- arch - x86_64, x86_32, arm, pnacl
- debug - True/False
- config_name - 'debug' or 'release'
-
- If not specified in the constructor these are read from the
- environment variables (TOOLCHAIN, NACL_ARCH, NACL_DEBUG).
- """
- default_toolchain = 'pnacl'
-
- def __init__(self, arch=None, toolchain=None, debug=None):
- self.debug = None
- self.libc = None
- self.config_name = None
-
- self.SetConfig(debug)
-
- if arch is None:
- arch = os.environ.get('NACL_ARCH')
-
- if toolchain is None:
- toolchain = os.environ.get('TOOLCHAIN')
-
- if not toolchain:
- if arch == 'pnacl':
- toolchain = 'pnacl'
- elif arch == 'emscripten':
- toolchain = 'emscripten'
- else:
- toolchain = self.default_toolchain
-
- self.toolchain = toolchain
- if self.toolchain not in VALID_TOOLCHAINS:
- raise error.Error("Invalid toolchain: %s" % self.toolchain)
-
- if not arch:
- if self.toolchain == 'pnacl':
- arch = 'pnacl'
- elif self.toolchain == 'emscripten':
- arch = 'emscripten'
- elif platform.machine() == 'i686':
- arch = 'i686'
- else:
- arch = 'x86_64'
-
- self.arch = arch
- if self.arch not in util.arch_to_pkgarch:
- raise error.Error("Invalid arch: %s" % arch)
-
- self.SetLibc()
-
- def SetConfig(self, debug):
- if debug is None:
- if os.environ.get('NACL_DEBUG') == '1':
- debug = True
- else:
- debug = False
- self.debug = debug
- if self.debug:
- self.config_name = 'debug'
- else:
- self.config_name = 'release'
-
- def SetLibc(self):
- if self.toolchain in ('pnacl', 'clang-newlib'):
- self.libc = 'newlib'
- elif self.toolchain == 'emscripten':
- self.libc = 'emscripten'
- else:
- self.libc = self.toolchain
-
- def __hash__(self):
- return hash(str(self))
-
- def __cmp__(self, other):
- return cmp((self.libc, self.toolchain, self.debug),
- (other.libc, other.toolchain, other.debug))
-
- def __str__(self):
- if self.arch == self.toolchain:
- # For some toolchains (emscripten and pnacl), arch will always match the
- # toolchain name is redundant to report it twice.
- return '%s/%s' % (self.toolchain, self.config_name)
- else:
- return '%s/%s/%s' % (self.arch, self.toolchain, self.config_name)
-
- def __repr__(self):
- return '<Configuration %s>' % str(self)
diff --git a/lib/webports/error.py b/lib/webports/error.py
deleted file mode 100644
index 8756dd7..0000000
--- a/lib/webports/error.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2014 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.
-
-
-class Error(Exception):
- """General error used for all webports-specific errors."""
- pass
-
-
-class PkgFormatError(Error):
- """Error raised when package file is not valid."""
- pass
-
-
-class DisabledError(Error):
- """Error raised when a package is cannot be built because it is disabled
- for the current configuration.
- """
- pass
diff --git a/lib/webports/installed_package.py b/lib/webports/installed_package.py
deleted file mode 100644
index 80901eb..0000000
--- a/lib/webports/installed_package.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright 2015 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.
-
-import os
-
-from webports import package, configuration, util, error
-
-
-def RemoveEmptyDirs(dirname):
- """Recursively remove a directoy and its parents if they are empty."""
- while not os.listdir(dirname):
- os.rmdir(dirname)
- dirname = os.path.dirname(dirname)
-
-
-def RemoveFile(filename):
- os.remove(filename)
- RemoveEmptyDirs(os.path.dirname(filename))
-
-
-class InstalledPackage(package.Package):
- extra_keys = package.EXTRA_KEYS
-
- def __init__(self, info_file):
- super(InstalledPackage, self).__init__(info_file)
- self.config = configuration.Configuration(self.BUILD_ARCH,
- self.BUILD_TOOLCHAIN,
- self.BUILD_CONFIG == 'debug')
-
- def Uninstall(self):
- self.LogStatus('Uninstalling')
- self.DoUninstall(force=False)
-
- def Files(self):
- """Yields the list of files currently installed by this package."""
- file_list = self.GetListFile()
- if not os.path.exists(file_list):
- return
- with open(self.GetListFile()) as f:
- for line in f:
- yield line.strip()
-
- def DoUninstall(self, force):
- with util.InstallLock(self.config):
- if not force:
- for pkg in InstalledPackageIterator(self.config):
- if self.NAME in pkg.DEPENDS:
- raise error.Error("Unable to uninstall '%s' (depended on by '%s')" %
- (self.NAME, pkg.NAME))
- RemoveFile(self.GetInstallStamp())
-
- root = util.GetInstallRoot(self.config)
- for filename in self.Files():
- fullname = os.path.join(root, filename)
- if not os.path.lexists(fullname):
- util.Warn('File not found while uninstalling: %s' % fullname)
- continue
- util.LogVerbose('uninstall: %s' % filename)
- RemoveFile(fullname)
-
- if os.path.exists(self.GetListFile()):
- RemoveFile(self.GetListFile())
-
- def ReverseDependencies(self):
- """Yields the set of packages that depend directly on this one"""
- for pkg in InstalledPackageIterator(self.config):
- if self.NAME in pkg.DEPENDS:
- yield pkg
-
-
-def InstalledPackageIterator(config):
- stamp_root = util.GetInstallStampRoot(config)
- if not os.path.exists(stamp_root):
- return
-
- for filename in os.listdir(stamp_root):
- if os.path.splitext(filename)[1] != '.info':
- continue
- info_file = os.path.join(stamp_root, filename)
- if os.path.exists(info_file):
- yield InstalledPackage(info_file)
-
-
-def CreateInstalledPackage(package_name, config=None):
- stamp_root = util.GetInstallStampRoot(config)
- info_file = os.path.join(stamp_root, package_name + '.info')
- if not os.path.exists(info_file):
- raise error.Error('package not installed: %s [%s]' % (package_name, config))
- return InstalledPackage(info_file)
diff --git a/lib/webports/package.py b/lib/webports/package.py
deleted file mode 100644
index 23ef4b8..0000000
--- a/lib/webports/package.py
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright (c) 2014 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.
-
-from webports.error import Error
-from webports import configuration, pkg_info, util
-
-EXTRA_KEYS = ['BUILD_CONFIG', 'BUILD_ARCH', 'BUILD_TOOLCHAIN',
- 'BUILD_SDK_VERSION', 'BUILD_NACLPORTS_REVISION']
-
-class Package(object):
- extra_keys = []
- list_props = (
- 'DEPENDS',
- 'CONFLICTS',
- 'DISABLED_ARCH',
- 'DISABLED_LIBC',
- 'DISABLED_TOOLCHAIN'
- )
-
- def __init__(self, info_file=None):
- self.info = info_file
- if self.info:
- with open(self.info) as f:
- self.ParseInfo(f.read())
-
- def ParseInfo(self, info_string):
- valid_keys = pkg_info.VALID_KEYS + self.extra_keys
- required_keys = pkg_info.REQUIRED_KEYS + self.extra_keys
-
- for key in valid_keys:
- if key in self.list_props:
- setattr(self, key, [])
- else:
- setattr(self, key, None)
-
- # Parse pkg_info file
- info = pkg_info.ParsePkgInfo(info_string, self.info, valid_keys,
- required_keys)
-
- # Set attributres based on pkg_info setttings.
- for key, value in info.items():
- setattr(self, key, value)
-
- self.Validate()
-
- def Validate(self):
- for libc in self.DISABLED_LIBC:
- if libc not in configuration.VALID_LIBC:
- raise Error('%s: invalid libc: %s' % (self.info, libc))
-
- for toolchain in self.DISABLED_TOOLCHAIN:
- if '/' in toolchain:
- toolchain, arch = toolchain.split('/')
- if arch not in util.arch_to_pkgarch:
- raise Error('%s: invalid architecture: %s' % (self.info, arch))
- if toolchain not in configuration.VALID_TOOLCHAINS:
- raise Error('%s: invalid toolchain: %s' % (self.info, toolchain))
-
- for arch in self.DISABLED_ARCH:
- if arch not in util.arch_to_pkgarch:
- raise Error('%s: invalid architecture: %s' % (self.info, arch))
-
- if '_' in self.NAME:
- raise Error('%s: package NAME cannot contain underscores' % self.info)
-
- if self.NAME != self.NAME.lower():
- raise Error('%s: package NAME cannot contain uppercase characters' %
- self.info)
-
- if '_' in self.VERSION:
- raise Error('%s: package VERSION cannot contain underscores' % self.info)
-
- if self.DISABLED_ARCH and self.ARCH is not None:
- raise Error('%s: contains both ARCH and DISABLED_ARCH' % self.info)
-
- def __cmp__(self, other):
- return cmp((self.NAME, self.VERSION, self.config),
- (other.NAME, other.VERSION, other.config))
-
- def __hash__(self):
- return hash((self.NAME, self.VERSION, self.config))
-
- def __str__(self):
- return '<Package %s %s %s>' % (self.NAME, self.VERSION, self.config)
-
- def InfoString(self):
- return "'%s' [%s]" % (self.NAME, self.config)
-
- def LogStatus(self, message, suffix=''):
- util.LogHeading(message, " '%s' [%s] %s" %
- (util.Color(self.NAME, 'yellow'),
- util.Color(self.config, 'blue'), suffix))
-
- def CheckDeps(self, valid_packages):
- for package in self.DEPENDS:
- if package not in valid_packages:
- util.Log('%s: Invalid dependency: %s' % (self.info, package))
- return False
-
- for package in self.CONFLICTS:
- if package not in valid_packages:
- util.Log('%s: Invalid conflict: %s' % (self.info, package))
- return False
-
- return True
-
- def IsAnyVersionInstalled(self):
- return util.IsInstalled(self.NAME, self.config)
-
- def GetInstallStamp(self):
- """Returns the name of install stamp for this package."""
- return util.GetInstallStamp(self.NAME, self.config)
-
- def GetListFile(self):
- """Returns the name of the installed file list for this package."""
- return util.GetListFile(self.NAME, self.config)
-
diff --git a/lib/webports/package_index.py b/lib/webports/package_index.py
deleted file mode 100644
index 1e8762f..0000000
--- a/lib/webports/package_index.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# Copyright (c) 2014 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.
-
-import os
-
-from webports import configuration, binary_package, package, util, paths
-from webports import pkg_info, error
-
-DEFAULT_INDEX = os.path.join(paths.NACLPORTS_ROOT, 'lib', 'prebuilt.txt')
-EXTRA_KEYS = package.EXTRA_KEYS + ['BIN_URL', 'BIN_SIZE', 'BIN_SHA1']
-PREBUILT_ROOT = os.path.join(paths.PACKAGES_ROOT, 'prebuilt')
-
-
-def ExtractPkgInfo(filename):
- """Return the pkg_info contents from a binary package."""
- pkg = binary_package.BinaryPackage(filename)
- return pkg.GetPkgInfo()
-
-
-def WriteIndex(index_filename, binaries):
- """Create a package index file from set of binaries on disk.
-
- Args:
- index_filename: The name of the file to write create.
- binaries: List of (filename, url) pairs containing packages to include.
-
- Returns:
- A PackageIndex object based on the contents of the newly written file.
- """
- # Write index to a temporary file and then rename it, to avoid
- # leaving a partial index file on disk.
- tmp_name = index_filename + '.tmp'
- with open(tmp_name, 'w') as output_file:
- for i, (filename, url) in enumerate(binaries):
- sha1 = util.HashFile(filename)
- if i != 0:
- output_file.write('\n')
- output_file.write(ExtractPkgInfo(filename))
- output_file.write('BIN_URL=%s\n' % url)
- output_file.write('BIN_SIZE=%s\n' % os.path.getsize(filename))
- output_file.write('BIN_SHA1=%s\n' % sha1)
-
- os.rename(tmp_name, index_filename)
-
- return IndexFromFile(index_filename)
-
-
-def IndexFromFile(filename):
- with open(filename) as f:
- contents = f.read()
- return PackageIndex(filename, contents)
-
-
-def GetCurrentIndex():
- if not os.path.exists(DEFAULT_INDEX):
- return PackageIndex('', '')
- return IndexFromFile(DEFAULT_INDEX)
-
-
-class PackageIndex(object):
- """In memory representation of a package index file.
-
- This class is used to read a package index of disk and stores
- it in memory as dictionary keys on package name + configuration.
- """
- valid_keys = pkg_info.VALID_KEYS + EXTRA_KEYS
- required_keys = pkg_info.REQUIRED_KEYS + EXTRA_KEYS
-
- def __init__(self, filename, index_data):
- self.filename = filename
- self.packages = {}
- self.ParseIndex(index_data)
-
- def Contains(self, package_name, config):
- """Returns True if the index contains the given package in the given
- configuration, False otherwise."""
- return (package_name, config) in self.packages
-
- def Installable(self, package_name, config):
- """Returns True if the index contains the given package and it is
- installable in the currently configured SDK."""
- info = self.packages.get((package_name, config))
- if not info:
- return False
- version = util.GetSDKVersion()
- if info['BUILD_SDK_VERSION'] != version:
- util.LogVerbose('Prebuilt package was built with different SDK version: '
- '%s vs %s' % (info['BUILD_SDK_VERSION'], version))
- return False
- return True
-
- def Download(self, package_name, config):
- if not os.path.exists(PREBUILT_ROOT):
- util.Makedirs(PREBUILT_ROOT)
- info = self.packages[(package_name, config)]
- filename = os.path.join(PREBUILT_ROOT, os.path.basename(info['BIN_URL']))
- if os.path.exists(filename):
- try:
- util.VerifyHash(filename, info['BIN_SHA1'])
- return filename
- except util.HashVerificationError:
- pass
- util.Log('Downloading prebuilt binary ...')
- util.DownloadFile(filename, info['BIN_URL'])
- util.VerifyHash(filename, info['BIN_SHA1'])
- return filename
-
- def ParseIndex(self, index_data):
- if not index_data:
- return
-
- for info_files in index_data.split('\n\n'):
- info = pkg_info.ParsePkgInfo(info_files, self.filename, self.valid_keys,
- self.required_keys)
- debug = info['BUILD_CONFIG'] == 'debug'
- config = configuration.Configuration(info['BUILD_ARCH'],
- info['BUILD_TOOLCHAIN'], debug)
- key = (info['NAME'], config)
- if key in self.packages:
- error.Error('package index contains duplicate: %s' % str(key))
- self.packages[key] = info
diff --git a/lib/webports/paths.py b/lib/webports/paths.py
deleted file mode 100644
index baf9873..0000000
--- a/lib/webports/paths.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013 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.
-
-import os
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-NACLPORTS_ROOT = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-
-OUT_DIR = os.path.join(NACLPORTS_ROOT, 'out')
-STAMP_DIR = os.path.join(OUT_DIR, 'stamp')
-BUILD_ROOT = os.path.join(OUT_DIR, 'build')
-PUBLISH_ROOT = os.path.join(OUT_DIR, 'publish')
-TOOLS_DIR = os.path.join(NACLPORTS_ROOT, 'build_tools')
-PACKAGES_ROOT = os.path.join(OUT_DIR, 'packages')
-CACHE_ROOT = os.path.join(OUT_DIR, 'cache')
diff --git a/lib/webports/pkg_info.py b/lib/webports/pkg_info.py
deleted file mode 100644
index 44175cc..0000000
--- a/lib/webports/pkg_info.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright 2014 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.
-
-import shlex
-import string
-
-from webports.error import PkgFormatError
-
-VALID_KEYS = ['NAME', 'VERSION', 'URL', 'ARCHIVE_ROOT', 'LICENSE', 'DEPENDS',
- 'MIN_SDK_VERSION', 'DISABLED_LIBC', 'ARCH', 'CONFLICTS',
- 'DISABLED_ARCH', 'URL_FILENAME', 'BUILD_OS', 'SHA1', 'DISABLED',
- 'DISABLED_TOOLCHAIN', 'TOOLCHAIN_INSTALL', 'PATCH_NAME']
-REQUIRED_KEYS = ['NAME', 'VERSION']
-
-
-def ParsePkgInfo(contents, filename, valid_keys=None, required_keys=None):
- """Parse a string contains the contents of a pkg_info file.
-
- Args:
- contents: pkg_info contents as a string.
- filename: name of file to use in error messages.
- valid_keys: list of keys that are valid in the file.
- required_keys: list of keys that are required in the file.
-
- Returns:
- A dictionary of the key, value pairs contained in the pkg_info file.
-
- Raises:
- PkgFormatError: if file is malformed, contains invalid keys, or does not
- contain all required keys.
- """
- rtn = {}
- if valid_keys is None:
- valid_keys = VALID_KEYS
- if required_keys is None:
- required_keys = REQUIRED_KEYS
-
- def ParsePkgInfoLine(line, line_no):
- if '=' not in line:
- raise PkgFormatError('Invalid info line %s:%d' % (filename, line_no))
- key, value = line.split('=', 1)
- key = key.strip()
- if key not in valid_keys:
- raise PkgFormatError("Invalid key '%s' in info file %s:%d" %
- (key, filename, line_no))
- value = value.strip()
- if value[0] == '(':
- if value[-1] != ')':
- raise PkgFormatError('Error parsing %s:%d: %s (%s)' %
- (filename, line_no, key, value))
- value = value[1:-1].split()
- else:
- value = shlex.split(value)[0]
- return (key, value)
-
- def ExpandVars(value, substitutions):
- if isinstance(value, str):
- return string.Template(value).substitute(substitutions)
- else:
- return [string.Template(v).substitute(substitutions) for v in value]
-
- for i, line in enumerate(contents.splitlines()):
- if not line or line[0] == '#':
- continue
- key, raw_value = ParsePkgInfoLine(line, i + 1)
- if key in rtn:
- raise PkgFormatError('Error parsing %s:%d: duplicate key (%s)' %
- (filename, i + 1, key))
- rtn[key] = ExpandVars(raw_value, rtn)
-
- for required_key in required_keys:
- if required_key not in rtn:
- raise PkgFormatError("Required key '%s' missing from info file: '%s'" %
- (required_key, filename))
-
- return rtn
-
-
-def ParsePkgInfoFile(filename, valid_keys=None, required_keys=None):
- """Parse pkg_info from a file on disk."""
- with open(filename) as f:
- return ParsePkgInfo(f.read(), filename, valid_keys, required_keys)
diff --git a/lib/webports/source_package.py b/lib/webports/source_package.py
deleted file mode 100644
index 08f0809..0000000
--- a/lib/webports/source_package.py
+++ /dev/null
@@ -1,801 +0,0 @@
-# Copyright (c) 2014 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.
-
-import contextlib
-import fnmatch
-import os
-import re
-import subprocess
-import sys
-import tempfile
-import time
-import urlparse
-
-from webports import binary_package
-from webports import configuration
-from webports import package
-from webports import package_index
-from webports import installed_package
-from webports import util
-from webports import paths
-from webports import bsd_pkg
-from webports.util import Log, Trace, LogVerbose
-from webports.error import Error, DisabledError, PkgFormatError
-
-
-class PkgConflictError(Error):
- pass
-
-
-@contextlib.contextmanager
-def RedirectStdoutStderr(filename):
- """Context manager that replaces stdout and stderr streams."""
- if filename is None:
- yield
- return
-
- with open(filename, 'a') as stream:
- old_stdout = sys.stdout
- old_stderr = sys.stderr
- sys.stdout = stream
- sys.stderr = stream
- util.CheckStdoutForColorSupport()
- try:
- yield
- finally:
- sys.stdout = old_stdout
- sys.stderr = old_stderr
- util.CheckStdoutForColorSupport()
-
-
-def FormatTimeDelta(delta):
- """Converts a duration in seconds to a human readable string.
-
- Args:
- delta: the amount of time in seconds.
-
- Returns: A string describing the amount of time passed in.
- """
- rtn = ''
- if delta >= 60:
- mins = delta / 60
- rtn += '%dm' % mins
- delta -= mins * 60
-
- if delta:
- rtn += '%.0fs' % delta
- return rtn
-
-
-def ExtractArchive(archive, destination):
- ext = os.path.splitext(archive)[1]
- if ext in ('.gz', '.tgz', '.bz2', '.xz'):
- cmd = ['tar', 'xf', archive, '-C', destination]
- elif ext in ('.zip',):
- cmd = ['unzip', '-q', '-d', destination, archive]
- else:
- raise Error('unhandled extension: %s' % ext)
- LogVerbose(cmd)
- subprocess.check_call(cmd)
-
-
-def RunGitCmd(directory, cmd, error_ok=False):
- cmd = ['git'] + cmd
- LogVerbose('%s' % ' '.join(cmd))
- p = subprocess.Popen(cmd,
- cwd=directory,
- stderr=subprocess.PIPE,
- stdout=subprocess.PIPE)
- stdout, stderr = p.communicate()
- if not error_ok and p.returncode != 0:
- if stdout:
- Log(stdout)
- if stderr:
- Log(stderr)
- raise Error('git command failed: %s' % cmd)
- Trace('git exited with %d' % p.returncode)
- return p.returncode
-
-
-def InitGitRepo(directory):
- """Initialize the source git repository for a given package directory.
-
- This function works for unpacked tar files as well as cloned git
- repositories. It sets up an 'upstream' branch pointing and the
- pristine upstream sources and a 'master' branch will contain changes
- specific to webports (normally the result of applying nacl.patch).
-
- Args:
- directory: Directory containing unpacked package sources.
- """
- git_dir = os.path.join(directory, '.git')
-
- # If the upstream ref exists then we've already initialized this repo
- if os.path.exists(os.path.join(git_dir, 'refs', 'heads', 'upstream')):
- return
-
- if os.path.exists(git_dir):
- Log('Init existing git repo: %s' % directory)
- RunGitCmd(directory, ['checkout', '-b', 'placeholder'])
- RunGitCmd(directory, ['branch', '-D', 'upstream'], error_ok=True)
- RunGitCmd(directory, ['branch', '-D', 'master'], error_ok=True)
- RunGitCmd(directory, ['checkout', '-b', 'upstream'])
- RunGitCmd(directory, ['checkout', '-b', 'master'])
- RunGitCmd(directory, ['branch', '-D', 'placeholder'])
- else:
- Log('Init new git repo: %s' % directory)
- RunGitCmd(directory, ['init'])
- try:
- # Setup a bogus identity on the buildbots.
- if os.environ.get('BUILDBOT_BUILDERNAME'):
- RunGitCmd(directory, ['config', 'user.name', 'Naclports'])
- RunGitCmd(directory, ['config', 'user.email', 'nobody@example.com'])
- RunGitCmd(directory, ['add', '-f', '.'])
- RunGitCmd(directory, ['commit', '-m', 'Upstream version'])
- RunGitCmd(directory, ['checkout', '-b', 'upstream'])
- RunGitCmd(directory, ['checkout', 'master'])
- except: # pylint: disable=bare-except
- # If git setup fails or is interrupted then remove the partially
- # initialized repository.
- util.RemoveTree(os.path.join(git_dir))
-
-
-def WriteStamp(stamp_file, stamp_contents):
- """Write a stamp file to disk with the given file contents."""
- stamp_dir = os.path.dirname(stamp_file)
- util.Makedirs(stamp_dir)
-
- with open(stamp_file, 'w') as f:
- f.write(stamp_contents)
- Log('Wrote stamp: %s' % stamp_file)
-
-
-def StampContentsMatch(stamp_file, stamp_contents):
- """Return True is stamp_file exists and contains the given contents."""
- if not os.path.exists(stamp_file):
- return False
- with open(stamp_file) as f:
- return f.read() == stamp_contents
-
-
-class SourcePackage(package.Package):
- """Representation of a single webports source package.
-
- Package objects correspond to folders on disk which
- contain a 'pkg_info' file.
- """
-
- def __init__(self, pkg_root, config=None):
- super(SourcePackage, self).__init__()
- if config is None:
- config = configuration.Configuration()
- self.config = config
-
- self.root = os.path.abspath(pkg_root)
- info_file = os.path.join(self.root, 'pkg_info')
- if not os.path.isdir(self.root) or not os.path.exists(info_file):
- raise Error('Invalid package folder: %s' % pkg_root)
-
- super(SourcePackage, self).__init__(info_file)
- if self.NAME != os.path.basename(self.root):
- raise Error('%s: package NAME must match directory name' % self.info)
-
- def GetInstallLocation(self):
- install_dir = 'install_%s' % util.arch_to_pkgarch[self.config.arch]
- if self.config.arch != self.config.toolchain:
- install_dir += '_' + self.config.toolchain
- if self.config.config_name == 'debug':
- install_dir += '_debug'
- return os.path.join(paths.BUILD_ROOT, self.NAME, install_dir, 'payload')
-
- def GetBuildLocation(self):
- package_dir = self.ARCHIVE_ROOT or '%s-%s' % (self.NAME, self.VERSION)
- return os.path.join(paths.BUILD_ROOT, self.NAME, package_dir)
-
- def GetPatchFile(self):
- patch_name = self.PATCH_NAME or 'nacl.patch'
- return os.path.join(self.root, patch_name)
-
- def GetArchiveFilename(self):
- if self.URL_FILENAME:
- return self.URL_FILENAME
-
- if self.IsGitUpstream() or self.URL is None:
- return None
-
- return os.path.basename(urlparse.urlparse(self.URL)[2])
-
- def DownloadLocation(self):
- archive = self.GetArchiveFilename()
- if not archive:
- return
- return os.path.join(paths.CACHE_ROOT, archive)
-
- def IsInstalled(self):
- return util.IsInstalled(self.NAME, self.config,
- self.InstalledInfoContents())
-
- def IsGitUpstream(self):
- return self.URL and self.URL.split('@')[0].endswith('.git')
-
- def InstallDeps(self, force, from_source=False):
- for dep in self.Dependencies():
- if not dep.IsAnyVersionInstalled() or force == 'all':
- dep.Install(True, force, from_source)
-
- def PackageFile(self):
- fullname = [os.path.join(paths.PACKAGES_ROOT, self.NAME)]
- fullname.append(self.VERSION)
- fullname.append(util.arch_to_pkgarch[self.config.arch])
- # for pnacl toolchain and arch are the same
- if self.config.toolchain != self.config.arch:
- fullname.append(self.config.toolchain)
- if self.config.debug:
- fullname.append('debug')
- return '_'.join(fullname) + '.tar.bz2'
-
- def InstalledInfoContents(self):
- """Generate content of the .info file to install based on source
- pkg_info file and current build configuration."""
- with open(self.info) as f:
- info_content = f.read()
- info_content += 'BUILD_CONFIG=%s\n' % self.config.config_name
- info_content += 'BUILD_ARCH=%s\n' % self.config.arch
- info_content += 'BUILD_TOOLCHAIN=%s\n' % self.config.toolchain
- info_content += 'BUILD_SDK_VERSION=%s\n' % util.GetSDKVersion()
- return info_content
-
- def IsBuilt(self):
- package_file = self.PackageFile()
- if not os.path.exists(package_file):
- return False
- try:
- pkg = binary_package.BinaryPackage(package_file)
- except PkgFormatError:
- # If the package is malformed in some way or in some old format
- # then treat it as not built.
- return False
- return pkg.IsInstallable()
-
- def Install(self, build_deps, force=None, from_source=False):
- self.CheckInstallable()
-
- if force is None and self.IsInstalled():
- self.LogStatus('Already installed')
- return
-
- if build_deps:
- self.InstallDeps(force, from_source)
-
- if force:
- from_source = True
-
- package_file = self.PackageFile()
- if not self.IsBuilt() and not from_source:
- index = package_index.GetCurrentIndex()
- if index.Installable(self.NAME, self.config):
- package_file = index.Download(self.NAME, self.config)
- else:
- from_source = True
-
- if from_source:
- self.Build(build_deps, force)
-
- if self.IsAnyVersionInstalled():
- installed_pkg = self.GetInstalledPackage()
- installed_pkg.LogStatus('Uninstalling existing')
- installed_pkg.DoUninstall(force=True)
-
- binary_package.BinaryPackage(package_file).Install(force)
-
- def GetInstalledPackage(self):
- return installed_package.CreateInstalledPackage(self.NAME, self.config)
-
- def CreatePkgFile(self):
- """Create and pkg file for use with the FreeBSD pkg tool.
-
- Create a package from the result of the package's InstallStep.
- """
- install_dir = self.GetInstallLocation()
- if not os.path.exists(install_dir):
- Log('Skiping pkg creation. Install dir not found: %s' % install_dir)
- return
-
- # Strip all elf or pexe files in the install directory (except .o files
- # since we don't want to strip, for example, crt1.o)
- if not self.config.debug and self.config.toolchain != 'emscripten':
- strip = util.GetStrip(self.config)
- for root, _, files in os.walk(install_dir):
- for filename in files:
- fullname = os.path.join(root, filename)
- if (os.path.isfile(fullname) and util.IsElfFile(fullname)
- and os.path.splitext(fullname)[1] != '.o'):
- Log('stripping: %s %s' % (strip, fullname))
- subprocess.check_call([strip, fullname])
-
- abi = 'pkg_' + self.config.toolchain
- if self.config.arch != self.config.toolchain:
- abi += "_" + util.arch_to_pkgarch[self.config.arch]
- abi_dir = os.path.join(paths.PUBLISH_ROOT, abi)
- pkg_file = os.path.join(abi_dir, '%s-%s.tbz' % (self.NAME,
- self.VERSION))
- util.Makedirs(abi_dir)
- deps = self.DEPENDS
- if self.config.toolchain != 'glibc':
- deps = []
- bsd_pkg.CreatePkgFile(self.NAME, self.VERSION, self.config.arch,
- self.GetInstallLocation(), pkg_file, deps)
-
- def Build(self, build_deps, force=None):
- self.CheckBuildable()
-
- if build_deps:
- self.InstallDeps(force)
-
- if not force and self.IsBuilt():
- self.LogStatus('Already built')
- return
-
- log_root = os.path.join(paths.OUT_DIR, 'logs')
- util.Makedirs(log_root)
-
- self.LogStatus('Building')
-
- if util.log_level > util.LOG_INFO:
- log_filename = None
- else:
- log_filename = os.path.join(log_root, '%s_%s.log' %
- (self.NAME,
- str(self.config).replace('/', '_')))
- if os.path.exists(log_filename):
- os.remove(log_filename)
-
- start = time.time()
- with util.DirLock(self.root):
- try:
- with RedirectStdoutStderr(log_filename):
- old_log_level = util.log_level
- util.log_level = util.LOG_VERBOSE
- try:
- self.Download()
- self.Extract()
- self.Patch()
- self.RunBuildSh()
- self.CreatePkgFile()
- finally:
- util.log_level = old_log_level
- except KeyboardInterrupt:
- # Treat KeyboardInterrupt as special, and not an actual failure. This
- # avoid log spew to stdout when they user interupts a quit build.
- raise
- except:
- if log_filename:
- with open(log_filename) as log_file:
- sys.stdout.write(log_file.read())
- raise
-
- duration = FormatTimeDelta(time.time() - start)
- util.LogHeading('Build complete', ' [took %s]' % duration)
-
- def RunBuildSh(self):
- build_port = os.path.join(paths.TOOLS_DIR, 'build_port.sh')
- cmd = [build_port]
-
- if self.config.toolchain == 'emscripten':
- util.SetupEmscripten()
- env = os.environ.copy()
- env['TOOLCHAIN'] = self.config.toolchain
- env['NACL_ARCH'] = self.config.arch
- env['NACL_DEBUG'] = self.config.debug and '1' or '0'
- env['NACL_SDK_ROOT'] = util.GetSDKRoot()
- rtn = subprocess.call(cmd,
- stdout=sys.stdout,
- stderr=sys.stderr,
- cwd=self.root,
- env=env)
- if rtn != 0:
- raise Error("Building %s: failed." % (self.NAME))
-
- def Download(self, force_mirror=None):
- """Download upstream sources and verify integrity."""
- if self.IsGitUpstream():
- self.GitCloneToMirror()
- return
-
- archive = self.DownloadLocation()
- if not archive:
- return
-
- if force_mirror is None:
- force_mirror = os.environ.get('FORCE_MIRROR', False)
- self.DownloadArchive(force_mirror=force_mirror)
-
- if self.SHA1 is None:
- raise PkgFormatError('missing SHA1 attribute: %s' % self.info)
-
- util.VerifyHash(archive, self.SHA1)
- Log('verified: %s' % util.RelPath(archive))
-
- def Clean(self):
- pkg = self.PackageFile()
- Log('removing %s' % pkg)
- if os.path.exists(pkg):
- os.remove(pkg)
-
- stamp_dir = os.path.join(paths.STAMP_DIR, self.NAME)
- Log('removing %s' % stamp_dir)
- util.RemoveTree(stamp_dir)
-
- def Extract(self):
- """Extract the package archive into its build location.
-
- This method assumes the package has already been downloaded.
- """
- if self.IsGitUpstream():
- self.GitClone()
- return
-
- archive = self.DownloadLocation()
- if not archive:
- self.Log('Skipping extract; No upstream archive')
- return
-
- dest = self.GetBuildLocation()
- output_path, new_foldername = os.path.split(dest)
- util.Makedirs(output_path)
-
- # Check existing stamp file contents
- stamp_file = self.GetExtractStamp()
- stamp_contents = self.GetExtractStampContent()
- if os.path.exists(dest):
- if StampContentsMatch(stamp_file, stamp_contents):
- Log('Already up-to-date: %s' % util.RelPath(dest))
- return
-
- raise Error("Upstream archive or patch has changed.\n" +
- "Please remove existing checkout and try again: '%s'" % dest)
-
- util.LogHeading('Extracting')
- util.Makedirs(paths.OUT_DIR)
- tmp_output_path = tempfile.mkdtemp(dir=paths.OUT_DIR)
- try:
- ExtractArchive(archive, tmp_output_path)
- src = os.path.join(tmp_output_path, new_foldername)
- if not os.path.isdir(src):
- raise Error('Archive contents not found: %s' % src)
- LogVerbose("renaming '%s' -> '%s'" % (src, dest))
- os.rename(src, dest)
- finally:
- util.RemoveTree(tmp_output_path)
-
- self.RemoveStamps()
- WriteStamp(stamp_file, stamp_contents)
-
- def RunCmd(self, cmd, **args):
- try:
- subprocess.check_call(cmd,
- stdout=sys.stdout,
- stderr=sys.stderr,
- cwd=self.GetBuildLocation(), **args)
- except subprocess.CalledProcessError as e:
- raise Error(e)
-
- def Log(self, message):
- Log('%s: %s' % (message, self.InfoString()))
-
- def GetStampDir(self):
- return os.path.join(paths.STAMP_DIR, self.NAME)
-
- def RemoveStamps(self):
- util.RemoveTree(self.GetStampDir())
-
- def Patch(self):
- stamp_file = os.path.join(self.GetStampDir(), 'nacl_patch')
- src_dir = self.GetBuildLocation()
- if self.URL is None:
- return
-
- if os.path.exists(stamp_file):
- self.Log('Skipping patch step (cleaning source tree)')
- cmd = ['git', 'clean', '-f', '-d']
- if not util.log_level > util.LOG_INFO:
- cmd.append('-q')
- self.RunCmd(cmd)
- return
-
- util.LogHeading('Patching')
- InitGitRepo(src_dir)
- if os.path.exists(self.GetPatchFile()):
- LogVerbose('applying patch to: %s' % src_dir)
- cmd = ['patch', '-p1', '-g0', '--no-backup-if-mismatch']
- with open(self.GetPatchFile()) as f:
- self.RunCmd(cmd, stdin=f)
- self.RunCmd(['git', 'add', '.'])
- self.RunCmd(['git', 'commit', '-m', 'Apply webports patch'])
-
- WriteStamp(stamp_file, '')
-
- def GetExtractStamp(self):
- return os.path.join(self.GetStampDir(), 'extract')
-
- def GetExtractStampContent(self):
- patch_file = self.GetPatchFile()
- if os.path.exists(patch_file):
- patch_sha = util.HashFile(self.GetPatchFile())
- return 'ARCHIVE_SHA1=%s PATCH_SHA1=%s\n' % (self.SHA1, patch_sha)
- else:
- return 'ARCHIVE_SHA1=%s\n' % self.SHA1
-
- def GetMirrorURL(self):
- return util.GS_MIRROR_URL + '/' + self.GetArchiveFilename()
-
- def CheckInstallable(self):
- if self.DISABLED:
- raise DisabledError('%s: package is disabled' % self.NAME)
-
- if self.config.libc in self.DISABLED_LIBC:
- raise DisabledError('%s: cannot be built with %s' %
- (self.NAME, self.config.libc))
-
- for disabled_toolchain in self.DISABLED_TOOLCHAIN:
- if '/' in disabled_toolchain:
- disabled_toolchain, arch = disabled_toolchain.split('/')
- if (self.config.arch == arch and
- self.config.toolchain == disabled_toolchain):
- raise DisabledError('%s: cannot be built with %s for %s' %
- (self.NAME, self.config.toolchain, arch))
- else:
- if self.config.toolchain == disabled_toolchain:
- raise DisabledError('%s: cannot be built with %s' %
- (self.NAME, self.config.toolchain))
-
- if self.config.arch in self.DISABLED_ARCH:
- raise DisabledError('%s: disabled for architecture: %s' %
- (self.NAME, self.config.arch))
-
- if self.MIN_SDK_VERSION is not None:
- if not util.CheckSDKVersion(self.MIN_SDK_VERSION):
- raise DisabledError('%s: requires SDK version %s or above' %
- (self.NAME, self.MIN_SDK_VERSION))
-
- if self.ARCH is not None:
- if self.config.arch not in self.ARCH:
- raise DisabledError('%s: disabled for architecture: %s' %
- (self.NAME, self.config.arch))
-
- for conflicting_package in self.CONFLICTS:
- if util.IsInstalled(conflicting_package, self.config):
- raise PkgConflictError("%s: conflicts with installed package: %s" %
- (self.NAME, conflicting_package))
-
- for dep in self.Dependencies():
- try:
- dep.CheckInstallable()
- except DisabledError as e:
- raise DisabledError('%s depends on %s; %s' % (self.NAME, dep.NAME, e))
-
- def Conflicts(self):
- """Yields the set of SourcePackages that directly conflict with this one"""
- for dep_name in self.CONFLICTS:
- yield CreatePackage(dep_name, self.config)
-
- def TransitiveConflicts(self):
- rtn = set(self.Conflicts())
- for dep in self.TransitiveDependencies():
- rtn |= set(dep.Conflicts())
- return rtn
-
- def Dependencies(self):
- """Yields the set of SourcePackages that this package directly depends on"""
- for dep_name in self.DEPENDS:
- yield CreatePackage(dep_name, self.config)
-
- def ReverseDependencies(self):
- """Yields the set of packages that depend directly on this one"""
- for pkg in SourcePackageIterator():
- if self.NAME in pkg.DEPENDS:
- yield pkg
-
- def TransitiveDependencies(self):
- """Yields the set of packages that this package transitively depends on"""
- deps = []
- for dep in self.Dependencies():
- for d in dep.TransitiveDependencies():
- if d not in deps:
- deps.append(d)
- if dep not in deps:
- deps.append(dep)
- return deps
-
- def CheckBuildable(self):
- self.CheckInstallable()
-
- if self.BUILD_OS is not None:
- if util.GetPlatform() != self.BUILD_OS:
- raise DisabledError('%s: can only be built on %s' %
- (self.NAME, self.BUILD_OS))
-
- def GitCloneToMirror(self):
- """Clone the upstream git repo into a local mirror. """
- git_url, git_commit = self.URL.split('@', 2)
-
- # Clone upstream git repo into local mirror, or update the existing
- # mirror.
- git_mirror = git_url.split('://', 2)[1]
- git_mirror = git_mirror.replace('/', '_')
- mirror_dir = os.path.join(paths.CACHE_ROOT, git_mirror)
- if os.path.exists(mirror_dir):
- if RunGitCmd(mirror_dir, ['rev-parse', git_commit + '^{commit}'],
- error_ok=True) != 0:
- Log('Updating git mirror: %s' % util.RelPath(mirror_dir))
- RunGitCmd(mirror_dir, ['remote', 'update', '--prune'])
- else:
- Log('Mirroring upstream git repo: %s' % self.URL)
- RunGitCmd(paths.CACHE_ROOT, ['clone', '--mirror', git_url, git_mirror])
- Log('git mirror up-to-date: %s' % util.RelPath(mirror_dir))
- return mirror_dir, git_commit
-
- def GitClone(self):
- """Create a clone of the upstream repo in the build directory.
-
- This operation will only require a network connection if the
- local git mirror is out-of-date."""
- stamp_file = self.GetExtractStamp()
- stamp_content = 'GITURL=%s' % self.URL
- patch_file = self.GetPatchFile()
- if os.path.exists(patch_file):
- patch_checksum = util.HashFile(patch_file)
- stamp_content += ' PATCH=%s' % patch_checksum
-
- stamp_content += '\n'
-
- dest = self.GetBuildLocation()
- if os.path.exists(self.GetBuildLocation()):
- if StampContentsMatch(stamp_file, stamp_content):
- return
-
- raise Error('Upstream archive or patch has changed.\n' +
- "Please remove existing checkout and try again: '%s'" % dest)
-
- util.LogHeading('Cloning')
- # Ensure local mirror is up-to-date
- git_mirror, git_commit = self.GitCloneToMirror()
- # Clone from the local mirror.
- RunGitCmd(None, ['clone', git_mirror, dest])
- RunGitCmd(dest, ['reset', '--hard', git_commit])
-
- # Set the origing to the original URL so it is possible to push directly
- # from the build tree.
- RunGitCmd(dest, ['remote', 'set-url', 'origin', self.URL.split('@')[0]])
-
- self.RemoveStamps()
- WriteStamp(stamp_file, stamp_content)
-
- def DownloadArchive(self, force_mirror):
- """Download the archive to the local cache directory.
-
- Args:
- force_mirror: force downloading from mirror only.
- """
- filename = self.DownloadLocation()
- if not filename or os.path.exists(filename):
- return
- util.Makedirs(os.path.dirname(filename))
-
- # Always try the mirror URL first
- mirror_url = self.GetMirrorURL()
- try:
- util.DownloadFile(filename, mirror_url)
- except Error as e:
- if not force_mirror:
- # Fall back to the original upstream URL
- util.DownloadFile(filename, self.URL)
- else:
- raise e
-
- def UpdatePatch(self):
- if self.URL is None:
- return
-
- git_dir = self.GetBuildLocation()
- if not os.path.exists(git_dir):
- raise Error('Source directory not found: %s' % git_dir)
-
- try:
- diff = subprocess.check_output(['git', 'diff', 'upstream',
- '--no-ext-diff'],
- cwd=git_dir)
- except subprocess.CalledProcessError as e:
- raise Error('error running git in %s: %s' % (git_dir, str(e)))
-
- # Drop index lines for a more stable diff.
- diff = re.sub('\nindex [^\n]+\n', '\n', diff)
-
- # Drop binary files, as they don't work anyhow.
- diff = re.sub('diff [^\n]+\n'
- '(new file [^\n]+\n)?'
- '(deleted file mode [^\n]+\n)?'
- 'Binary files [^\n]+ differ\n', '', diff)
-
- # Always filter out config.sub changes
- diff_skip = ['*config.sub']
-
- # Add optional per-port skip list.
- diff_skip_file = os.path.join(self.root, 'diff_skip.txt')
- if os.path.exists(diff_skip_file):
- with open(diff_skip_file) as f:
- diff_skip += f.read().splitlines()
-
- new_diff = ''
- skipping = False
- for line in diff.splitlines():
- if line.startswith('diff --git a/'):
- filename = line[len('diff --git a/'):].split()[0]
- skipping = False
- for skip in diff_skip:
- if fnmatch.fnmatch(filename, skip):
- skipping = True
- break
- if not skipping:
- new_diff += line + '\n'
- diff = new_diff
-
- # Write back out the diff.
- patch_path = self.GetPatchFile()
- preexisting = os.path.exists(patch_path)
-
- if not diff:
- if preexisting:
- Log('removing patch file: %s' % util.RelPath(patch_path))
- os.remove(patch_path)
- else:
- Log('no patch required: %s' % util.RelPath(git_dir))
- return
-
- if preexisting:
- with open(patch_path) as f:
- if diff == f.read():
- Log('patch unchanged: %s' % util.RelPath(patch_path))
- return
-
- with open(patch_path, 'w') as f:
- f.write(diff)
-
- if preexisting:
- Log('created patch: %s' % util.RelPath(patch_path))
- else:
- Log('updated patch: %s' % util.RelPath(patch_path))
-
-
-def SourcePackageIterator():
- """Iterator which yields a Package object for each webports package."""
- ports_root = os.path.join(paths.NACLPORTS_ROOT, 'ports')
- for root, dirs, files in os.walk(ports_root):
- # Sort files and dirs so that the iterator reports packages in a
- # consistent order.
- dirs.sort()
- files.sort()
- if 'pkg_info' in files:
- yield SourcePackage(root)
-
-
-DEFAULT_LOCATIONS = ('ports', 'ports/python_modules')
-
-
-def CreatePackage(package_name, config=None):
- """Create a Package object given a package name or path.
-
- Returns:
- Package object
- """
- if os.path.isdir(package_name):
- return SourcePackage(package_name, config)
-
- for subdir in DEFAULT_LOCATIONS:
- pkg_root = os.path.join(paths.NACLPORTS_ROOT, subdir, package_name)
- info = os.path.join(pkg_root, 'pkg_info')
- if os.path.exists(info):
- return SourcePackage(pkg_root, config)
-
- raise Error("Package not found: %s" % package_name)
diff --git a/lib/webports/tests/common.py b/lib/webports/tests/common.py
deleted file mode 100644
index 2ee5e0b..0000000
--- a/lib/webports/tests/common.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2014 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.
-
-from mock import Mock, patch
-import unittest
-
-
-def MockFileObject(contents=''):
- file_mock = Mock(name="file_mock", spec=file)
- file_mock.read.return_value = contents
- file_mock.__enter__ = lambda s: s
- file_mock.__exit__ = Mock(return_value=False)
- return file_mock
-
-
-def AddPatch(testcase, patcher):
- patcher.start()
- testcase.addCleanup(patcher.stop)
-
-
-class NaclportsTest(unittest.TestCase):
- """Class that sets up core mocks common to all test cases."""
-
- AddPatch = AddPatch
-
- def setUp(self):
- AddPatch(self, patch.dict('os.environ', {'NACL_SDK_ROOT': '/sdk/root'}))
- AddPatch(self, patch('webports.util.GetPlatform',
- Mock(return_value='linux')))
- AddPatch(self, patch('webports.util.GetInstallRoot',
- Mock(return_value='/package/install/path')))
- AddPatch(self, patch('webports.util.GetSDKRoot',
- Mock(return_value='/sdk/root')))
-
- mock_lock = Mock()
- mock_lock.__enter__ = lambda s: s
- mock_lock.__exit__ = Mock(return_value=False)
- AddPatch(self, patch('webports.util.InstallLock',
- Mock(return_value=mock_lock)))
-
- mock_lock = Mock()
- mock_lock.__enter__ = lambda s: s
- mock_lock.__exit__ = Mock(return_value=False)
- AddPatch(self, patch('webports.util.BuildLock',
- Mock(return_value=mock_lock)))
diff --git a/lib/webports/tests/test_binary_package.py b/lib/webports/tests/test_binary_package.py
deleted file mode 100644
index 28ca422..0000000
--- a/lib/webports/tests/test_binary_package.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2014 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.
-
-from mock import Mock, patch, call
-import textwrap
-
-import common
-from webports import binary_package
-
-
-# pylint: disable=no-self-use
-class TestBinaryPackage(common.NaclportsTest):
-
- @patch('os.rename')
- @patch('os.makedirs')
- @patch('os.path.isdir', Mock(return_value=False))
- def testInstallFile(self, makedirs_mock, rename_mock):
- mock_file = common.MockFileObject()
- with patch('__builtin__.open', Mock(return_value=mock_file)):
- binary_package.InstallFile('fname', 'location1', 'location2')
- makedirs_mock.assert_called_once_with('location2')
- rename_mock.assert_has_calls([call('location1/fname', 'location2/fname')])
-
- def testRelocateFile(self):
- # Only certain files should be relocated. A file called 'testfile'
- # for example, should not be touched.
- with patch('__builtin__.open', Mock(), create=True) as open_mock:
- binary_package.RelocateFile('testfile', 'newroot')
- open_mock.assert_not_called()
-
- @patch('webports.binary_package.BinaryPackage.VerifyArchiveFormat', Mock())
- @patch('webports.binary_package.BinaryPackage.GetPkgInfo')
- @patch('webports.util.GetInstallStamp',
- Mock(return_value='stamp_dir/stamp_file'))
- def testWriteStamp(self, mock_get_info):
- fake_binary_pkg_info = textwrap.dedent('''\
- NAME=foo
- VERSION=1.0
- BUILD_CONFIG=release
- BUILD_ARCH=arm
- BUILD_TOOLCHAIN=glibc
- BUILD_SDK_VERSION=38
- BUILD_NACLPORTS_REVISION=1414
- ''')
- mock_get_info.return_value = fake_binary_pkg_info
- pkg = binary_package.BinaryPackage('foo')
- mock_stamp_file = common.MockFileObject()
- with patch('__builtin__.open', Mock(return_value=mock_stamp_file),
- create=True):
- pkg.WriteStamp()
- mock_stamp_file.write.assert_called_once_with(fake_binary_pkg_info)
diff --git a/lib/webports/tests/test_configuration.py b/lib/webports/tests/test_configuration.py
deleted file mode 100644
index b11b151..0000000
--- a/lib/webports/tests/test_configuration.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2014 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.
-
-from mock import patch, Mock
-
-import common
-from webports import error
-from webports.configuration import Configuration
-
-
-class TestConfiguration(common.NaclportsTest):
-
- def testDefaults(self):
- config = Configuration()
- self.assertEqual(config.toolchain, 'pnacl')
- self.assertEqual(config.arch, 'pnacl')
- self.assertEqual(config.debug, False)
- self.assertEqual(config.config_name, 'release')
- self.assertEqual(config.libc, 'newlib')
-
- def testDefaultArch(self):
- # We default to x86_64 except in the special case where the build
- # machine is i686 hardware, in which case we default to i686.
- with patch('platform.machine', Mock(return_value='i686')):
- self.assertEqual(Configuration().arch, 'pnacl')
- with patch('platform.machine', Mock(return_value='dummy')):
- self.assertEqual(Configuration().arch, 'pnacl')
- with patch('platform.machine', Mock(return_value='i686')):
- self.assertEqual(Configuration(toolchain='clang-newlib').arch, 'i686')
- with patch('platform.machine', Mock(return_value='dummy')):
- self.assertEqual(Configuration(toolchain='clang-newlib').arch, 'x86_64')
-
- def testEnvironmentVariables(self):
- with patch.dict('os.environ', {'NACL_ARCH': 'arm'}):
- self.assertEqual(Configuration().arch, 'arm')
-
- with patch.dict('os.environ', {'NACL_DEBUG': '1'}):
- self.assertEqual(Configuration().debug, True)
-
- def testDefaultToolchain(self):
- self.assertEqual(Configuration(arch='pnacl').toolchain, 'pnacl')
- self.assertEqual(Configuration(arch='arm').libc, 'newlib')
-
- def testDefaultLibc(self):
- self.assertEqual(Configuration(toolchain='pnacl').libc, 'newlib')
- self.assertEqual(Configuration(toolchain='clang-newlib').libc, 'newlib')
- self.assertEqual(Configuration(toolchain='glibc').libc, 'glibc')
-
- def testConfigStringForm(self):
- config = Configuration('arm', 'glibc', True)
- self.assertEqual(str(config), 'arm/glibc/debug')
- self.assertRegexpMatches(repr(config), '<Configuration .*>')
-
- def testConfigEquality(self):
- config1 = Configuration('arm', 'glibc', True)
- config2 = Configuration('arm', 'glibc', True)
- config3 = Configuration('arm', 'glibc', False)
- self.assertEqual(config1, config2)
- self.assertNotEqual(config1, config3)
-
- def testInvalidArch(self):
- expected_error = 'Invalid arch: not_arch'
- with self.assertRaisesRegexp(error.Error, expected_error):
- Configuration('not_arch')
diff --git a/lib/webports/tests/test_installed_package.py b/lib/webports/tests/test_installed_package.py
deleted file mode 100644
index aa787e0..0000000
--- a/lib/webports/tests/test_installed_package.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2014 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.
-
-from mock import call, patch, Mock
-
-import common
-from webports import installed_package
-
-test_info = '''\
-NAME=foo
-VERSION=bar
-BUILD_ARCH=arm
-BUILD_CONFIG=debug
-BUILD_TOOLCHAIN=glibc
-BUILD_SDK_VERSION=123
-BUILD_NACLPORTS_REVISION=98765
-'''
-
-
-def CreateMockInstalledPackage():
- file_mock = common.MockFileObject(test_info)
- with patch('__builtin__.open', Mock(return_value=file_mock), create=True):
- return installed_package.InstalledPackage('dummy_file')
-
-
-class TestInstalledPackage(common.NaclportsTest):
-
- @patch('webports.util.Log', Mock())
- @patch('webports.installed_package.RemoveFile')
- @patch('webports.installed_package.InstalledPackageIterator',
- Mock(return_value=[]))
- @patch('os.path.lexists', Mock(return_value=True))
- @patch('os.path.exists', Mock(return_value=True))
- def testUninstall(self, remove_patch): # pylint: disable=no-self-use
- pkg = CreateMockInstalledPackage()
- pkg.Files = Mock(return_value=['f1', 'f2'])
- pkg.Uninstall()
-
- # Assert that exactly 4 files we removed using RemoveFile
- calls = [call('/package/install/path/var/lib/npkg/foo.info'),
- call('/package/install/path/f1'),
- call('/package/install/path/f2'),
- call('/package/install/path/var/lib/npkg/foo.list')]
- remove_patch.assert_has_calls(calls)
diff --git a/lib/webports/tests/test_main.py b/lib/webports/tests/test_main.py
deleted file mode 100644
index f483455..0000000
--- a/lib/webports/tests/test_main.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright 2014 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.
-
-import os
-import mock
-from mock import patch, Mock
-import StringIO
-
-import common
-import webports.__main__
-from webports import error
-from webports.configuration import Configuration
-
-
-# pylint: disable=no-self-use
-class TestMain(common.NaclportsTest):
-
- def setUp(self):
- super(TestMain, self).setUp()
- self.AddPatch(patch('webports.util.CheckSDKRoot'))
-
- @patch('webports.util.Log', Mock())
- @patch('webports.util.RemoveTree')
- def testCleanAll(self, mock_rmtree):
- config = Configuration()
- webports.__main__.CleanAll(config)
- mock_rmtree.assert_any_call('/package/install/path')
-
- @patch('webports.__main__.RunMain', Mock(side_effect=error.Error('oops')))
- def testErrorReport(self):
- # Verify that exceptions of the type error.Error are printed
- # to stderr and result in a return code of 1
- with patch('sys.stderr', new_callable=StringIO.StringIO) as stderr:
- self.assertEqual(webports.__main__.main(None), 1)
- self.assertRegexpMatches(stderr.getvalue(), '^webports: oops')
-
- @patch('webports.__main__.CmdPkgClean')
- def testMainCommandDispatch(self, cmd_pkg_clean):
- mock_pkg = Mock()
- with patch('webports.source_package.CreatePackage',
- Mock(return_value=mock_pkg)):
- webports.__main__.RunMain(['clean', 'foo'])
- cmd_pkg_clean.assert_called_once_with(mock_pkg, mock.ANY)
-
- @patch('webports.__main__.CmdPkgClean',
- Mock(side_effect=error.DisabledError()))
- def testMainHandlePackageDisabled(self):
- mock_pkg = Mock()
- with patch('webports.source_package.CreatePackage',
- Mock(return_value=mock_pkg)):
- with self.assertRaises(error.DisabledError):
- webports.__main__.RunMain(['clean', 'foo'])
-
- @patch('webports.__main__.CleanAll')
- def testMainCleanAll(self, clean_all_mock):
- webports.__main__.RunMain(['clean', '--all'])
- clean_all_mock.assert_called_once_with(Configuration())
-
-
-class TestCommands(common.NaclportsTest):
-
- def testListCommand(self):
- config = Configuration()
- pkg = Mock(NAME='foo', VERSION='0.1')
- with patch('webports.installed_package.InstalledPackageIterator',
- Mock(return_value=[pkg])):
- with patch('sys.stdout', new_callable=StringIO.StringIO) as stdout:
- options = Mock(all=False)
- webports.__main__.CmdList(config, options, [])
- lines = stdout.getvalue().splitlines()
- self.assertRegexpMatches(lines[0], '^foo\\s+0.1$')
- self.assertEqual(len(lines), 1)
-
- def testListCommandVerbose(self):
- config = Configuration()
- pkg = Mock(NAME='foo', VERSION='0.1')
- with patch('webports.installed_package.InstalledPackageIterator',
- Mock(return_value=[pkg])):
- with patch('sys.stdout', new_callable=StringIO.StringIO) as stdout:
- options = Mock(verbosity=0, all=False)
- webports.__main__.CmdList(config, options, [])
- lines = stdout.getvalue().splitlines()
- self.assertRegexpMatches(lines[0], "^foo$")
- self.assertEqual(len(lines), 1)
-
- @patch('webports.installed_package.CreateInstalledPackage', Mock())
- def testInfoCommand(self):
- config = Configuration()
- options = Mock()
- file_mock = common.MockFileObject('FOO=bar\n')
-
- with patch('sys.stdout', new_callable=StringIO.StringIO) as stdout:
- with patch('__builtin__.open', Mock(return_value=file_mock), create=True):
- webports.__main__.CmdInfo(config, options, ['foo'])
- self.assertRegexpMatches(stdout.getvalue(), "FOO=bar")
-
- def testContentsCommand(self):
- file_list = ['foo', 'bar']
-
- options = Mock(verbosity=0, all=False)
- package = Mock(NAME='test', Files=Mock(return_value=file_list))
-
- expected_output = '\n'.join(file_list) + '\n'
- with patch('sys.stdout', new_callable=StringIO.StringIO) as stdout:
- webports.__main__.CmdPkgContents(package, options)
- self.assertEqual(stdout.getvalue(), expected_output)
-
- # when the verbose option is set expect CmdContents to output full paths.
- webports.util.log_level = webports.util.LOG_VERBOSE
- expected_output = [os.path.join('/package/install/path', f)
- for f in file_list]
- expected_output = '\n'.join(expected_output) + '\n'
- with patch('sys.stdout', new_callable=StringIO.StringIO) as stdout:
- webports.__main__.CmdPkgContents(package, options)
- self.assertEqual(stdout.getvalue(), expected_output)
diff --git a/lib/webports/tests/test_package.py b/lib/webports/tests/test_package.py
deleted file mode 100644
index a3f187e..0000000
--- a/lib/webports/tests/test_package.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2015 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.
-
-import unittest
-
-from webports import error
-from webports import package
-
-test_info = '''\
-NAME=foo
-VERSION=0.1
-'''
-
-
-class TestPackage(unittest.TestCase):
-
- def testValidLibcDisabled(self): # pylint: disable=no-self-use
- pkg = package.Package()
- pkg.ParseInfo(test_info + 'DISABLED_LIBC=(newlib glibc)')
-
- def testInvalidLibcDisabled(self):
- pkg = package.Package()
- # clang-newlib is a toolchain, not a libc
- with self.assertRaisesRegexp(error.Error, 'invalid libc: clang-newlib'):
- pkg.ParseInfo(test_info + 'DISABLED_LIBC=(clang-newlib)')
-
- def testValidToolchainDisabled(self): # pylint: disable=no-self-use
- pkg = package.Package()
- pkg.ParseInfo(test_info + 'DISABLED_TOOLCHAIN=(pnacl glibc clang-newlib)')
-
- def testInvalidToolchainDisabled(self):
- pkg = package.Package()
- with self.assertRaisesRegexp(error.Error, 'invalid toolchain: foo'):
- pkg.ParseInfo(test_info + 'DISABLED_TOOLCHAIN=(foo)')
-
- def testValidArchDisabled(self): # pylint: disable=no-self-use
- pkg = package.Package()
- pkg.ParseInfo(test_info + 'DISABLED_ARCH=(arm i686 x86_64)')
-
- def testInvalidArchDisabled(self):
- pkg = package.Package()
- with self.assertRaisesRegexp(error.Error, 'invalid architecture: foo'):
- pkg.ParseInfo(test_info + 'DISABLED_ARCH=(foo)')
diff --git a/lib/webports/tests/test_package_index.py b/lib/webports/tests/test_package_index.py
deleted file mode 100644
index 176920e..0000000
--- a/lib/webports/tests/test_package_index.py
+++ /dev/null
@@ -1,113 +0,0 @@
-# Copyright 2014 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.
-
-from mock import patch, Mock
-import os
-import tempfile
-
-import common
-from webports import error
-from webports import package_index
-from webports.configuration import Configuration
-
-test_index = '''\
-NAME=agg-demo
-VERSION=0.1
-LICENSE=BSD
-DEPENDS=(agg)
-BUILD_CONFIG=release
-BUILD_ARCH=arm
-BUILD_TOOLCHAIN=glibc
-BUILD_SDK_VERSION=38
-BUILD_NACLPORTS_REVISION=98765
-BIN_URL=http://storage.googleapis.com/webports/builds/pepper_38/1414/packages/agg-demo_0.1_arm_glibc.tar.bz2
-BIN_SIZE=10240
-BIN_SHA1=f300618f52188a291804dd60d6a5e04361c0ffe6
-
-NAME=agg-demo
-VERSION=0.1
-LICENSE=BSD
-DEPENDS=(agg)
-BUILD_CONFIG=release
-BUILD_ARCH=i686
-BUILD_TOOLCHAIN=glibc
-BUILD_SDK_VERSION=38
-BUILD_NACLPORTS_REVISION=98765
-BIN_URL=http://storage.googleapis.com/webports/builds/pepper_38/1414/packages/agg-demo_0.1_i686_glibc.tar.bz2
-BIN_SIZE=10240
-BIN_SHA1=0cb0d2d1380831b38c2b8461528836aa7992435f
-'''
-
-test_info = '''\
-NAME=foo
-VERSION=bar
-BUILD_ARCH=arm
-BUILD_CONFIG=debug
-BUILD_TOOLCHAIN=glibc
-BUILD_SDK_VERSION=123
-BUILD_NACLPORTS_REVISION=98765
-'''
-
-
-class TestPackageIndex(common.NaclportsTest):
-
- def testParsingInvalid(self):
- contents = 'FOO=bar\nBAR=baz\n'
- expected_error = "Invalid key 'FOO' in info file dummy_file:1"
- with self.assertRaisesRegexp(error.Error, expected_error):
- package_index.PackageIndex('dummy_file', contents)
-
- def testParsingValid(self):
- index = package_index.PackageIndex('dummy_file', test_index)
- arm_config = Configuration('arm', 'glibc', False)
- i686_config = Configuration('i686', 'glibc', False)
- self.assertEqual(len(index.packages), 2)
- self.assertTrue(index.Contains('agg-demo', arm_config))
- self.assertTrue(index.Contains('agg-demo', i686_config))
-
- def testContains(self):
- # Create an empty package index and add a single entry to it
- index = package_index.PackageIndex('dummy_file', '')
- config_debug = Configuration('arm', 'glibc', True)
- config_release = Configuration('arm', 'glibc', False)
- self.assertFalse(index.Contains('foo', config_release))
- index.packages[('foo', config_release)] = {
- 'NAME': 'dummy',
- 'BUILD_SDK_VERSION': 123
- }
- with patch('webports.util.GetSDKVersion') as mock_version:
- # Setting the mock SDK version to 123 should mean that the
- # index contains the 'foo' package and it is installable'
- mock_version.return_value = 123
- self.assertTrue(index.Contains('foo', config_release))
- self.assertTrue(index.Installable('foo', config_release))
-
- # Setting the mock SDK version to some other version should
- # mean the index contains that package but it is not installable.
- mock_version.return_value = 124
- self.assertTrue(index.Contains('foo', config_release))
- self.assertFalse(index.Installable('foo', config_release))
-
- self.assertFalse(index.Contains('foo', config_debug))
- self.assertFalse(index.Contains('bar', config_release))
-
- @patch('webports.util.Log', Mock())
- @patch('webports.package_index.PREBUILT_ROOT', os.getcwd())
- @patch('webports.util.VerifyHash', Mock())
- @patch('webports.util.DownloadFile')
- def testDownload(self, download_file_mock):
- index = package_index.PackageIndex('dummy_file', test_index)
- arm_config = Configuration('arm', 'glibc', False)
- index.Download('agg-demo', arm_config)
- self.assertEqual(download_file_mock.call_count, 1)
-
- @patch('webports.util.HashFile', Mock(return_value='sha1'))
- @patch('os.path.getsize', Mock(return_value=100))
- def testWriteIndex(self):
- temp_file = tempfile.mkstemp('webports_test')[1]
- self.addCleanup(os.remove, temp_file)
-
- with patch('webports.package_index.ExtractPkgInfo',
- Mock(return_value=test_info)):
- package_index.WriteIndex(temp_file, (('pkg1', 'url1'), ('pkg2', 'url2')))
diff --git a/lib/webports/tests/test_pkg_info.py b/lib/webports/tests/test_pkg_info.py
deleted file mode 100644
index 95672b5..0000000
--- a/lib/webports/tests/test_pkg_info.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2014 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.
-
-from webports import pkg_info
-from webports import error
-
-import common
-
-
-class TestParsePkgInfo(common.NaclportsTest):
-
- def testInvalidLine(self):
- expected_error = 'Invalid info line dummy_file:1'
- with self.assertRaisesRegexp(error.Error, expected_error):
- pkg_info.ParsePkgInfo('line without equals sign', 'dummy_file')
-
- def testBalnkLine(self):
- result = pkg_info.ParsePkgInfo('NAME=foo\n\nVERSION=bar', 'dummy_file')
- self.assertEqual(result, {'NAME': 'foo', 'VERSION': 'bar'})
-
- def testComments(self):
- result = pkg_info.ParsePkgInfo('NAME=foo # tail\n# line\nVERSION=bar',
- 'dummy_file')
- self.assertEqual(result, {'NAME': 'foo', 'VERSION': 'bar'})
-
- def testValidKeys(self):
- expected_error = "Invalid key 'BAR' in info file dummy_file:2"
- contents = 'FOO=bar\nBAR=baz\n'
- valid = ['FOO']
- required = []
- with self.assertRaisesRegexp(error.Error, expected_error):
- pkg_info.ParsePkgInfo(contents, 'dummy_file', valid, required)
-
- def testRequiredKeys(self):
- expected_error = "Required key 'BAR' missing from info file: 'dummy_file'"
- contents = 'FOO=bar\n'
- valid = ['FOO']
- required = ['BAR']
- with self.assertRaisesRegexp(error.Error, expected_error):
- pkg_info.ParsePkgInfo(contents, 'dummy_file', valid, required)
diff --git a/lib/webports/tests/test_source_package.py b/lib/webports/tests/test_source_package.py
deleted file mode 100644
index 0720931..0000000
--- a/lib/webports/tests/test_source_package.py
+++ /dev/null
@@ -1,284 +0,0 @@
-# Copyright 2014 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.
-
-from mock import patch, Mock
-import mock
-import tempfile
-import textwrap
-import shutil
-import os
-
-import common
-from webports import source_package
-from webports import error
-from webports import paths
-from webports.configuration import Configuration
-
-
-class TestSourcePackage(common.NaclportsTest):
-
- def setUp(self):
- super(TestSourcePackage, self).setUp()
- self.tempdir = tempfile.mkdtemp(prefix='webports_test_')
- self.addCleanup(shutil.rmtree, self.tempdir)
- self.temp_ports = os.path.join(self.tempdir, 'ports')
-
- self.AddPatch(patch('webports.paths.NACLPORTS_ROOT', self.tempdir))
- self.AddPatch(patch('webports.paths.BUILD_ROOT',
- os.path.join(self.tempdir, 'build_root')))
- self.AddPatch(patch('webports.paths.CACHE_ROOT',
- os.path.join(self.tempdir, 'cache')))
- self.AddPatch(patch('webports.paths.OUT_DIR',
- os.path.join(self.tempdir, 'out_dir')))
- self.AddPatch(patch('webports.paths.STAMP_DIR',
- os.path.join(self.tempdir, 'stamp_dir')))
-
- def CreateTestPackage(self, name, extra_info=''):
- """Creates a source package directory in a temporary directory.
-
- Args:
- name: The name of the temporary package.
- extra_info: extra information to append to the pkg_info file.
-
- Returns:
- The new package source directory
- """
- pkg_root = os.path.join(self.temp_ports, name)
- os.makedirs(pkg_root)
- with open(os.path.join(pkg_root, 'pkg_info'), 'w') as info:
- info.write("NAME=%s\nVERSION=1.0\n%s" % (name, extra_info))
- return pkg_root
-
- def testStampContentsMatch(self):
- stamp_file = os.path.join(self.tempdir, 'test_stamp')
- # stamp does not exist
- self.assertFalse(source_package.StampContentsMatch(stamp_file, ''))
-
- open(stamp_file, 'w').close()
- self.assertTrue(source_package.StampContentsMatch(stamp_file, ''))
- self.assertFalse(source_package.StampContentsMatch(stamp_file, 'foo'))
-
- def testInvalidSourceDir(self):
- """test that invalid source directory generates an error."""
- path = '/bad/path'
- expected_error = 'Invalid package folder: ' + path
- with self.assertRaisesRegexp(error.Error, expected_error):
- source_package.SourcePackage(path)
-
- def testValidSourceDir(self):
- """test that valid source directory is loaded correctly."""
- root = self.CreateTestPackage('foo')
- pkg = source_package.SourcePackage(root)
- self.assertEqual(pkg.NAME, 'foo')
- self.assertEqual(pkg.root, root)
-
- def testIsBuiltMalformedBinary(self):
- """test that IsBuilt() can handle malformed package files."""
- root = self.CreateTestPackage('foo')
- pkg = source_package.SourcePackage(root)
- invalid_binary = os.path.join(self.tempdir, 'package.tar.bz2')
- with open(invalid_binary, 'w') as f:
- f.write('this is not valid package file\n')
- pkg.PackageFile = Mock(return_value=invalid_binary)
- self.assertFalse(pkg.IsBuilt())
-
- @patch('webports.source_package.SourcePackage.RunBuildSh',
- Mock(return_value=True))
- @patch('webports.source_package.Log', Mock())
- def testBuildPackage(self):
- root = self.CreateTestPackage('foo')
- pkg = source_package.SourcePackage(root)
- pkg.Build(True)
-
- def testSourcePackageIterator(self):
- self.CreateTestPackage('foo')
- pkgs = [p for p in source_package.SourcePackageIterator()]
- self.assertEqual(len(pkgs), 1)
- self.assertEqual(pkgs[0].NAME, 'foo')
-
- def testGetInstalledPackage(self):
- root = self.CreateTestPackage('foo')
- pkg = source_package.SourcePackage(root)
- with self.assertRaisesRegexp(error.Error, 'package not installed: foo'):
- pkg.GetInstalledPackage()
-
- def testGetBuildLocation(self):
- root = self.CreateTestPackage('foo')
- pkg = source_package.SourcePackage(root)
- location = pkg.GetBuildLocation()
- self.assertTrue(location.startswith(paths.BUILD_ROOT))
- self.assertEqual(os.path.basename(location), '%s-%s' %
- (pkg.NAME, pkg.VERSION))
-
- @patch('webports.util.Log', Mock())
- def testExtract(self):
- root = self.CreateTestPackage('foo', 'URL=someurl.tar.gz\nSHA1=123')
- pkg = source_package.SourcePackage(root)
-
- def fake_extract(archive, dest):
- os.mkdir(os.path.join(dest, '%s-%s' % (pkg.NAME, pkg.VERSION)))
-
- with patch('webports.source_package.ExtractArchive', fake_extract):
- pkg.Extract()
-
- def testCreatePackageInvalid(self):
- with self.assertRaisesRegexp(error.Error, 'Package not found: foo'):
- source_package.CreatePackage('foo')
-
- def testFormatTimeDelta(self):
- expectations = (
- (1, '1s'),
- (60, '1m'),
- (70, '1m10s'),
- )
-
- for secs, expected_result in expectations:
- self.assertEqual(expected_result, source_package.FormatTimeDelta(secs))
-
- def testConflicts(self):
- root = self.CreateTestPackage('foo', 'CONFLICTS=(bar)')
- pkg = source_package.SourcePackage(root)
-
- # with no other packages installed
- with patch('webports.util.IsInstalled', Mock(return_value=False)):
- pkg.CheckInstallable()
-
- # with all possible packages installed
- with patch('webports.util.IsInstalled') as is_installed:
- is_installed.return_value = True
- with self.assertRaises(source_package.PkgConflictError):
- pkg.CheckInstallable()
- is_installed.assert_called_once_with('bar', pkg.config)
-
- def testDisabled(self):
- root = self.CreateTestPackage('foo', 'DISABLED=1')
- pkg = source_package.SourcePackage(root)
- with self.assertRaisesRegexp(error.DisabledError, 'package is disabled'):
- pkg.CheckInstallable()
-
- def testDisabledArch(self):
- self.CreateTestPackage('bar', 'DISABLED_ARCH=(x86_64)')
-
- pkg = source_package.CreatePackage(
- 'bar', config=Configuration(toolchain='clang-newlib'))
- with self.assertRaisesRegexp(error.DisabledError,
- 'disabled for architecture: x86_64'):
- pkg.CheckInstallable()
-
- def testSingleArch(self):
- self.CreateTestPackage('bar', 'ARCH=(arm)')
-
- pkg = source_package.CreatePackage('bar')
- with self.assertRaisesRegexp(error.DisabledError,
- 'disabled for architecture: pnacl$'):
- pkg.CheckInstallable()
-
- def testDisabledLibc(self):
- self.CreateTestPackage('bar', 'DISABLED_LIBC=(newlib)')
-
- pkg = source_package.CreatePackage('bar')
- with self.assertRaisesRegexp(error.DisabledError,
- 'cannot be built with newlib$'):
- pkg.CheckInstallable()
-
- def testDisabledToolchain(self):
- self.CreateTestPackage('bar', 'DISABLED_TOOLCHAIN=(pnacl)')
-
- pkg = source_package.CreatePackage('bar')
- with self.assertRaisesRegexp(error.DisabledError,
- 'cannot be built with pnacl$'):
- pkg.CheckInstallable()
-
- def testDisabledToolchainArch(self):
- self.CreateTestPackage('bar', 'DISABLED_TOOLCHAIN=(glibc/x86_64)')
-
- pkg = source_package.CreatePackage(
- 'bar', config=Configuration(toolchain='glibc'))
- with self.assertRaisesRegexp(
- error.DisabledError, 'cannot be built with glibc for x86_64$'):
- pkg.CheckInstallable()
-
- self.CreateTestPackage('bar2', 'DISABLED_TOOLCHAIN=(pnacl/arm)')
-
- pkg = source_package.CreatePackage('bar2')
- pkg.CheckInstallable()
-
- def testCheckInstallableDepends(self):
- self.CreateTestPackage('foo', 'DEPENDS=(bar)')
- self.CreateTestPackage('bar', 'DISABLED=1')
-
- pkg = source_package.CreatePackage('foo')
- with self.assertRaisesRegexp(error.DisabledError,
- 'bar: package is disabled$'):
- pkg.CheckInstallable()
-
- def testCheckBuildable(self):
- self.CreateTestPackage('foo', 'BUILD_OS=solaris')
-
- pkg = source_package.CreatePackage('foo')
- with self.assertRaisesRegexp(error.DisabledError,
- 'can only be built on solaris$'):
- pkg.CheckBuildable()
-
- @patch('webports.util.GetSDKVersion', Mock(return_value=123))
- def testMinSDKVersion(self):
- self.CreateTestPackage('foo', 'MIN_SDK_VERSION=123')
- pkg = source_package.CreatePackage('foo')
- pkg.CheckBuildable()
-
- self.CreateTestPackage('foo2', 'MIN_SDK_VERSION=121')
- pkg = source_package.CreatePackage('foo2')
- pkg.CheckBuildable()
-
- self.CreateTestPackage('foo3', 'MIN_SDK_VERSION=124')
- pkg = source_package.CreatePackage('foo3')
- with self.assertRaisesRegexp(error.DisabledError,
- 'requires SDK version 124 or above'):
- pkg.CheckBuildable()
-
- @patch('webports.util.GetSDKVersion', Mock(return_value=1234))
- def testInstalledInfoContents(self):
- root = self.CreateTestPackage('foo')
- pkg = source_package.SourcePackage(root)
- expected_contents = textwrap.dedent('''\
- NAME=foo
- VERSION=1.0
- BUILD_CONFIG=release
- BUILD_ARCH=pnacl
- BUILD_TOOLCHAIN=pnacl
- BUILD_SDK_VERSION=1234
- ''')
- self.assertRegexpMatches(pkg.InstalledInfoContents(), expected_contents)
-
- def testRunGitCmd_BadRepo(self):
- os.mkdir(os.path.join(self.tempdir, '.git'))
- with self.assertRaisesRegexp(error.Error, 'git command failed'):
- source_package.InitGitRepo(self.tempdir)
-
- def testInitGitRepo(self):
- # init a git repo containing a single dummy file
- with open(os.path.join(self.tempdir, 'file'), 'w') as f:
- f.write('bar')
- source_package.InitGitRepo(self.tempdir)
- self.assertTrue(os.path.isdir(os.path.join(self.tempdir, '.git')))
-
- # InitGitRepo should work on existing git repositories too.
- source_package.InitGitRepo(self.tempdir)
-
- @patch('webports.util.DownloadFile')
- @patch('webports.util.VerifyHash')
- def testDownload(self, mock_verify, mock_download):
- self.CreateTestPackage('foo', 'URL=foo/bar.tar.gz\nSHA1=X123')
- pkg = source_package.CreatePackage('foo')
- pkg.Download()
- expected_filename = os.path.join(paths.CACHE_ROOT, 'bar.tar.gz')
- mock_download.assert_called_once_with(expected_filename, mock.ANY)
- mock_verify.assert_called_once_with(expected_filename, 'X123')
-
- @patch('webports.util.DownloadFile')
- def testDownloadMissingSHA1(self, mock_download):
- self.CreateTestPackage('foo', 'URL=foo/bar')
- pkg = source_package.CreatePackage('foo')
- with self.assertRaisesRegexp(error.Error, 'missing SHA1 attribute'):
- pkg.Download()
diff --git a/lib/webports/tests/test_util.py b/lib/webports/tests/test_util.py
deleted file mode 100644
index 0384b6c..0000000
--- a/lib/webports/tests/test_util.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 2014 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.
-
-from mock import patch, Mock
-import os
-import tempfile
-import unittest
-
-import common
-from webports.configuration import Configuration
-from webports import util
-from webports import error
-
-
-class TestUtil(unittest.TestCase):
-
- def setUp(self):
- common.AddPatch(self, patch('webports.util.GetSDKRoot',
- Mock(return_value='/sdk/root')))
- common.AddPatch(self, patch('webports.util.GetEmscriptenRoot',
- Mock(return_value='/emscripten/root')))
- common.AddPatch(self, patch('webports.util.GetPlatform',
- Mock(return_value='linux')))
-
- @patch('webports.util.HashFile', Mock(return_value='sha1'))
- def testVerifyHash(self):
- util.VerifyHash('foo', 'sha1')
- with self.assertRaises(util.HashVerificationError):
- util.VerifyHash('foo', 'sha1x')
-
- @patch.dict('os.environ', {'PATH': '/x/y/z'})
- def testFindInPath(self):
- with self.assertRaisesRegexp(error.Error, "command not found: foo"):
- util.FindInPath('foo')
-
- with patch('os.path.exists') as mock_exists:
- with patch('os.path.isfile') as mock_isfile:
- executable = os.path.join('/x/y/z', 'somefile')
- self.assertEqual(util.FindInPath('somefile'), executable)
- mock_exists.assert_called_once_with(executable)
- mock_isfile.assert_called_once_with(executable)
-
- def testCheckStamp_Missing(self):
- with patch('os.path.exists', Mock(return_value=False)):
- self.assertFalse(util.CheckStamp('foo.stamp', ''))
-
- def testCheckStamp_Contents(self):
- temp_fd, temp_name = tempfile.mkstemp('webports_test')
- self.addCleanup(os.remove, temp_name)
-
- stamp_contents = 'stamp file contents'
- with os.fdopen(temp_fd, 'w') as f:
- f.write(stamp_contents)
-
- self.assertTrue(util.CheckStamp(temp_name, stamp_contents))
- self.assertFalse(util.CheckStamp(temp_name, stamp_contents + 'x'))
-
- def testGetInstallRoot(self):
- expected = '/sdk/root/toolchain/linux_pnacl/le32-nacl/usr'
- self.assertEqual(util.GetInstallRoot(Configuration()), expected)
-
- expected = '/sdk/root/toolchain/linux_x86_glibc/x86_64-nacl/usr'
- self.assertEqual(
- util.GetInstallRoot(Configuration(toolchain='glibc')), expected)
-
- expected = '/sdk/root/toolchain/linux_pnacl/le32-nacl/usr'
- self.assertEqual(util.GetInstallRoot(Configuration('pnacl')), expected)
-
- expected = '/emscripten/root/system/local'
- self.assertEqual(util.GetInstallRoot(Configuration('emscripten')), expected)
-
- expected = '/sdk/root/toolchain/linux_pnacl/x86_64-nacl/usr'
- self.assertEqual(
- util.GetInstallRoot(Configuration(toolchain='clang-newlib')), expected)
-
- def testHashFile(self):
- temp_name = tempfile.mkstemp('webports_test')[1]
- self.addCleanup(os.remove, temp_name)
-
- with self.assertRaises(IOError):
- util.HashFile('/does/not/exist')
-
- sha1_empty_string = 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
- self.assertEqual(util.HashFile(temp_name), sha1_empty_string)
-
- @patch('webports.paths.NACLPORTS_ROOT', '/foo')
- def testRelPath(self):
- self.assertEqual('bar', util.RelPath('/foo/bar'))
- self.assertEqual('../baz/bar', util.RelPath('/baz/bar'))
-
-
-class TestCheckSDKRoot(TestUtil):
-
- def testMissingSDKROOT(self):
- with self.assertRaisesRegexp(error.Error, 'NACL_SDK_ROOT does not exist'):
- util.CheckSDKRoot()
-
- @patch('os.path.exists', Mock())
- @patch('os.path.isdir', Mock())
- @patch('webports.util.GetSDKVersion', Mock(return_value=10))
- def testSDKVersionCheck(self):
- with patch('webports.util.MIN_SDK_VERSION', 9):
- util.CheckSDKRoot()
-
- with patch('webports.util.MIN_SDK_VERSION', 10):
- util.CheckSDKRoot()
-
- with patch('webports.util.MIN_SDK_VERSION', 11):
- with self.assertRaisesRegexp(error.Error, 'requires at least version 11'):
- util.CheckSDKRoot()
diff --git a/lib/webports/util.py b/lib/webports/util.py
deleted file mode 100644
index c52d0c8..0000000
--- a/lib/webports/util.py
+++ /dev/null
@@ -1,489 +0,0 @@
-# Copyright 2014 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.
-
-import fcntl
-import hashlib
-import os
-import shutil
-import subprocess
-import sys
-
-# Allow use of this module even if termcolor is missing. There are many
-# standalone python scripts in build_tools that can be run directly without
-# PYTHONPATH set (i.e. not via build/python_wrapper that adds this path.
-# TODO(sbc): we should probably just assume that all the module dependencies
-# are present.
-try:
- import termcolor
-except ImportError:
- termcolor = None
-
-from webports import error, paths
-
-GS_URL = 'http://storage.googleapis.com/'
-GS_BUCKET = 'webports'
-GS_MIRROR_URL = '%s%s/mirror' % (GS_URL, GS_BUCKET)
-
-# Require the latest version of the NaCl SDK. webports is built
-# and tested against the pepper_canary release. To build aginst older
-# versions of the SDK use the one of the pepper_XX branches (or use
-# --skip-sdk-version-check).
-MIN_SDK_VERSION = 49
-
-arch_to_pkgarch = {
- 'x86_64': 'x86-64',
- 'i686': 'i686',
- 'arm': 'arm',
- 'pnacl': 'pnacl',
- 'emscripten': 'emscripten',
-}
-
-# Inverse of arch_to_pkgarch
-pkgarch_to_arch = {v: k for k, v in arch_to_pkgarch.items()}
-
-LOG_ERROR = 0
-LOG_WARN = 1
-LOG_INFO = 2
-LOG_VERBOSE = 3
-LOG_TRACE = 4
-
-ELF_MAGIC = '\x7fELF'
-PEXE_MAGIC = 'PEXE'
-
-log_level = LOG_INFO
-color_mode = 'auto'
-
-
-def Color(message, color):
- if termcolor and Color.enabled:
- return termcolor.colored(message, color)
- else:
- return message
-
-
-def CheckStdoutForColorSupport():
- if color_mode == 'auto':
- Color.enabled = sys.stdout.isatty()
-
-
-def IsElfFile(filename):
- if os.path.islink(filename):
- return False
- with open(filename) as f:
- header = f.read(4)
- return header == ELF_MAGIC
-
-
-def IsPexeFile(filename):
- if os.path.islink(filename):
- return False
- with open(filename) as f:
- header = f.read(4)
- return header == PEXE_MAGIC
-
-
-def Memoize(f):
- """Memoization decorator for functions taking one or more arguments."""
-
- class Memo(dict):
-
- def __init__(self, f):
- super(Memo, self).__init__()
- self.f = f
-
- def __call__(self, *args):
- return self[args]
-
- def __missing__(self, key):
- ret = self[key] = self.f(*key)
- return ret
-
- return Memo(f)
-
-
-def SetVerbose(enabled):
- if enabled:
- SetLogLevel(LOG_VERBOSE)
- else:
- SetLogLevel(LOG_INFO)
-
-
-def SetLogLevel(verbosity):
- global log_level
- log_level = verbosity
-
-
-def Log(message, verbosity=LOG_INFO):
- """Log a message to the console (stdout)."""
- if log_level < verbosity:
- return
- sys.stdout.write(str(message) + '\n')
- sys.stdout.flush()
-
-
-def LogHeading(message, suffix=''):
- """Log a colored/highlighted message with optional suffix."""
- if Color.enabled:
- Log(Color(message, 'green') + suffix)
- else:
- if log_level > LOG_WARN:
- # When running in verbose mode make sure heading standout
- Log('###################################################################')
- Log(message + suffix)
- Log('###################################################################')
- else:
- Log(message + suffix)
-
-
-def Warn(message):
- Log('warning: ' + message, LOG_WARN)
-
-
-def Trace(message):
- Log(message, LOG_TRACE)
-
-
-def LogVerbose(message):
- Log(message, LOG_VERBOSE)
-
-
-def FindInPath(command_name):
- """Search user's PATH for a given executable.
-
- Returns:
- Full path to executable.
- """
- extensions = ('',)
- if not os.path.splitext(command_name)[1] and os.name == 'nt':
- extensions = ('.bat', '.com', '.exe')
-
- for path in os.environ.get('PATH', '').split(os.pathsep):
- for ext in extensions:
- full_name = os.path.join(path, command_name + ext)
- if os.path.exists(full_name) and os.path.isfile(full_name):
- return full_name
-
- raise error.Error('command not found: %s' % command_name)
-
-
-def DownloadFile(filename, url):
- """Download a file from a given URL.
-
- Args:
- filename: the name of the file to download the URL to.
- url: then URL to fetch.
- """
- temp_filename = filename + '.partial'
- # Ensure curl is in user's PATH
- FindInPath('curl')
- curl_cmd = ['curl', '--fail', '--location', '--stderr', '-', '-o',
- temp_filename]
- if hasattr(sys.stdout, 'fileno') and os.isatty(sys.stdout.fileno()):
- # Add --progress-bar but only if stdout is a TTY device.
- curl_cmd.append('--progress-bar')
- else:
- # otherwise suppress status output, since curl always assumes its
- # talking to a TTY and writes \r and \b characters. But add
- # --show-error so that when curl fails it at least prints something.
- curl_cmd += ['--silent', '--show-error']
- curl_cmd.append(url)
-
- if log_level > LOG_WARN:
- Log('Downloading: %s [%s]' % (url, filename))
- else:
- Log('Downloading: %s' % url.replace(GS_URL, ''))
- try:
- subprocess.check_call(curl_cmd)
- except subprocess.CalledProcessError as e:
- raise error.Error('Error downloading file: %s' % str(e))
-
- os.rename(temp_filename, filename)
-
-
-def CheckStamp(filename, contents=None):
- """Check that a given stamp file is up-to-date.
-
- Returns: False is the file does not exists or is older that that given
- comparison file, or does not contain the given contents. True otherwise.
- """
- if not os.path.exists(filename):
- return False
-
- if contents is not None:
- with open(filename) as f:
- if not f.read().startswith(contents):
- return False
-
- return True
-
-
-@Memoize
-def GetSDKRoot():
- """Returns the root of the currently configured Native Client SDK."""
- root = os.environ.get('NACL_SDK_ROOT')
- if root is None:
- local_sdk_root = os.path.join(paths.OUT_DIR, 'nacl_sdk')
- if os.path.exists(local_sdk_root):
- root = local_sdk_root
- else:
- raise error.Error('$NACL_SDK_ROOT not set')
- if sys.platform == "cygwin":
- root = root.replace('\\', '/')
- return root
-
-
-@Memoize
-def GetEmscriptenRoot():
- emscripten = os.environ.get('EMSCRIPTEN')
- if emscripten is None:
- local_root = os.path.join(paths.OUT_DIR, 'emsdk', 'emscripten')
- if os.path.exists(local_root):
- emscripten = local_root
- else:
- raise error.Error('$EMSCRIPTEN not set and %s does not exist.' %
- local_root)
-
- if not os.path.isdir(emscripten):
- raise error.Error('$EMSCRIPTEN environment variable does not point'
- ' to a directory: %s' % emscripten)
- return emscripten
-
-
-def SetupEmscripten():
- if 'EMSCRIPTEN' in os.environ:
- return
-
- local_root = GetEmscriptenRoot()
- os.environ['EMSCRIPTEN'] = local_root
- os.environ['EM_CONFIG'] = os.path.join(os.path.dirname(local_root),
- '.emscripten')
- try:
- FindInPath('node')
- except error.Error:
- node_bin = os.path.join(paths.OUT_DIR, 'node', 'bin')
- if not os.path.isdir(node_bin):
- raise error.Error('node not found in path and default path not found: %s'
- % node_bin)
-
- os.environ['PATH'] += ':' + node_bin
- FindInPath('node')
-
-
-@Memoize
-def GetSDKVersion():
- """Returns the version (as a string) of the current SDK."""
- getos = os.path.join(GetSDKRoot(), 'tools', 'getos.py')
- version = subprocess.check_output([getos, '--sdk-version']).strip()
- return version
-
-
-def CheckSDKVersion(version):
- """Returns True if the currently configured SDK is 'version' or above."""
- return int(GetSDKVersion()) >= int(version)
-
-
-@Memoize
-def GetSDKRevision():
- """Returns the revision of the currently configured Native Client SDK."""
- getos = os.path.join(GetSDKRoot(), 'tools', 'getos.py')
- version = subprocess.check_output([getos, '--sdk-revision']).strip()
- return int(version)
-
-
-@Memoize
-def GetPlatform():
- """Returns the current platform name according getos.py."""
- getos = os.path.join(GetSDKRoot(), 'tools', 'getos.py')
- platform = subprocess.check_output([getos]).strip()
- return platform
-
-@Memoize
-def GetToolchainRoot(config):
- """Returns the toolchain folder for a given NaCl toolchain."""
- if config.toolchain == 'emscripten':
- return GetEmscriptenRoot()
-
- platform = GetPlatform()
- if config.toolchain in ('pnacl', 'clang-newlib'):
- tc_dir = os.path.join('%s_pnacl' % platform)
- else:
- tc_arch = {'arm': 'arm', 'i686': 'x86', 'x86_64': 'x86'}[config.arch]
- tc_dir = '%s_%s_%s' % (platform, tc_arch, config.libc)
-
- return os.path.join(GetSDKRoot(), 'toolchain', tc_dir)
-
-
-@Memoize
-def GetInstallRoot(config):
- """Returns the install location given a build configuration."""
- tc_dir = GetToolchainRoot(config)
-
- if config.toolchain == 'emscripten':
- return os.path.join(tc_dir, 'system', 'local')
-
- if config.toolchain == 'pnacl':
- tc_dir = os.path.join(tc_dir, 'le32-nacl')
- else:
- tc_dir = os.path.join(tc_dir, '%s-nacl' % config.arch)
- return os.path.join(tc_dir, 'usr')
-
-
-@Memoize
-def GetInstallStampRoot(config):
- """Returns the installation metadata folder for the give configuration."""
- tc_root = GetInstallRoot(config)
- return os.path.join(tc_root, 'var', 'lib', 'npkg')
-
-
-@Memoize
-def GetStrip(config):
- tc_dir = GetToolchainRoot(config)
- if config.toolchain == 'pnacl':
- strip = os.path.join(tc_dir, 'bin', 'pnacl-strip')
- else:
- strip = os.path.join(tc_dir, 'bin', '%s-nacl-strip' % config.arch)
- assert os.path.exists(strip), 'strip executable not found: %s' % strip
- return strip
-
-
-def GetInstallStamp(package_name, config):
- """Returns the filename of the install stamp for for a given package.
-
- This file is written at install time and contains metadata
- about the installed package.
- """
- root = GetInstallStampRoot(config)
- return os.path.join(root, package_name + '.info')
-
-
-def GetListFile(package_name, config):
- """Returns the filename of the list of installed files for a given package.
-
- This file is written at install time.
- """
- root = GetInstallStampRoot(config)
- return os.path.join(root, package_name + '.list')
-
-
-def IsInstalled(package_name, config, stamp_content=None):
- """Returns True if the given package is installed."""
- stamp = GetInstallStamp(package_name, config)
- result = CheckStamp(stamp, stamp_content)
- return result
-
-
-def CheckSDKRoot():
- """Check validity of NACL_SDK_ROOT."""
- root = GetSDKRoot()
-
- if not os.path.isdir(root):
- raise error.Error('$NACL_SDK_ROOT does not exist: %s' % root)
-
- landmark = os.path.join(root, 'tools', 'getos.py')
- if not os.path.exists(landmark):
- raise error.Error("$NACL_SDK_ROOT (%s) doesn't look right. "
- "Couldn't find landmark file (%s)" % (root, landmark))
-
- if not CheckSDKVersion(MIN_SDK_VERSION):
- raise error.Error(
- 'This version of webports requires at least version %s of\n'
- 'the NaCl SDK. The version in $NACL_SDK_ROOT is %s. If you want\n'
- 'to use webports with an older version of the SDK please checkout\n'
- 'one of the pepper_XX branches (or run with\n'
- '--skip-sdk-version-check).' % (MIN_SDK_VERSION, GetSDKVersion()))
-
-
-def HashFile(filename):
- """Return the SHA1 (in hex format) of the contents of the given file."""
- block_size = 100 * 1024
- sha1 = hashlib.sha1()
- with open(filename) as f:
- while True:
- data = f.read(block_size)
- if not data:
- break
- sha1.update(data)
- return sha1.hexdigest()
-
-
-class HashVerificationError(error.Error):
- pass
-
-
-def VerifyHash(filename, sha1):
- """Return True if the sha1 of the given file match the sha1 passed in."""
- file_sha1 = HashFile(filename)
- if sha1 != file_sha1:
- raise HashVerificationError(
- 'verification failed: %s\nExpected: %s\nActual: %s' %
- (filename, sha1, file_sha1))
-
-
-def RemoveTree(directory):
- """Recursively remove a directory and its contents."""
- if not os.path.exists(directory):
- return
- if not os.path.isdir(directory):
- raise error.Error('RemoveTree: not a directory: %s', directory)
- shutil.rmtree(directory)
-
-
-def RelPath(filename):
- """Return a pathname relative to the root the webports src tree.
-
- This is used mostly to make output more readable when printing filenames."""
- return os.path.relpath(filename, paths.NACLPORTS_ROOT)
-
-
-def Makedirs(directory):
- if os.path.isdir(directory):
- return
- if os.path.exists(directory):
- raise error.Error('mkdir: File exists and is not a directory: %s' %
- directory)
- Trace("mkdir: %s" % directory)
- os.makedirs(directory)
-
-
-class DirLock(object):
- """Per-directory flock()-based context manager
-
- This class will raise an exception if another process already holds the
- lock for the given directory.
- """
-
- def __init__(self, lock_dir):
- if not os.path.exists(lock_dir):
- Makedirs(lock_dir)
- self.file_name = os.path.join(lock_dir, 'webports.lock')
- self.fd = open(self.file_name, 'w')
-
- def __enter__(self):
- try:
- fcntl.flock(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
- except Exception:
- raise error.Error("Unable to acquire lock (%s): Is webports already "
- "running?" % self.file_name)
-
- def __exit__(self, exc_type, exc_val, exc_tb):
- os.remove(self.file_name)
- self.fd.close()
-
-
-class BuildLock(DirLock):
- """Lock used when building a package (essentially a lock on OUT_DIR)"""
-
- def __init__(self):
- super(BuildLock, self).__init__(paths.OUT_DIR)
-
-
-class InstallLock(DirLock):
- """Lock used when installing/uninstalling package"""
-
- def __init__(self, config):
- root = GetInstallRoot(config)
- super(InstallLock, self).__init__(root)
-
-
-CheckStdoutForColorSupport()
diff --git a/make_all.sh b/make_all.sh
deleted file mode 100755
index cd8a5ad..0000000
--- a/make_all.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-# 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.
-#
-# This script builds all ports in all possible configurations.
-# If you want to be sure your change won't break anythign this is
-# a good place to start.
-
-set -x
-set -e
-
-TARGETS="$*"
-TARGETS=${TARGETS:-all}
-BUILD_FLAGS=--ignore-disabled
-
-export BUILD_FLAGS
-
-# x86_64 NaCl
-NACL_ARCH=x86_64 TOOLCHAIN=clang-newlib make ${TARGETS}
-NACL_ARCH=x86_64 TOOLCHAIN=glibc make ${TARGETS}
-
-# i686 NaCl
-NACL_ARCH=i686 TOOLCHAIN=clang-newlib make ${TARGETS}
-NACL_ARCH=i686 TOOLCHAIN=glibc make ${TARGETS}
-
-# ARM NaCl
-NACL_ARCH=arm TOOLCHAIN=clang-newlib make ${TARGETS}
-NACL_ARCH=arm TOOLCHAIN=glibc make ${TARGETS}
-
-# PNaCl
-NACL_ARCH=pnacl TOOLCHAIN=pnacl make ${TARGETS}
-
-# Emscripten
-if [ -n "${EMSCRIPTEN:-}" ]; then
- NACL_ARCH=emscripten TOOLCHAIN=emscripten make ${TARGETS}
-fi
diff --git a/package.json b/package.json
deleted file mode 100644
index d7161f6..0000000
--- a/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "dependencies": {
- "jshint": "~2.8.0",
- "jslint": "~0.9.5"
- }
-}
diff --git a/ports/agg-demo/Makefile b/ports/agg-demo/Makefile
deleted file mode 100644
index 2068584..0000000
--- a/ports/agg-demo/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright (c) 2014 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.
-
-include $(NACL_SDK_ROOT)/tools/common.mk
-
-TARGET = agg-demo
-LIBS = agg ppapi_simple nacl_io ppapi ppapi_cpp
-SOURCES = drawing.cc
-INSTALL_DIR = $(NACL_PACKAGES_PUBLISH)/$(TARGET)/$(TOOLCHAIN)
-
-ifeq ($(TOOLCHAIN),pnacl)
-EXEEXT=.pexe
-else
-EXEEXT=.nexe
-endif
-
-ifneq ($(TOOLCHAIN),pnacl)
-# We want the nmf to contain all the .nexe we have previously
-# built as well as the one currently being built, so we modify
-# the list of executables that we pass to create_nmf.
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_64$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_32$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_arm$(EXEEXT))
-endif
-
-# Build rules generated by macros from common.mk:
-
-$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
-
-ifeq ($(CONFIG),Release)
-$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
-$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
-else
-$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
-endif
-
-$(eval $(call NMF_RULE,$(TARGET),))
-
-install:
- mkdir -p $(INSTALL_DIR)
- cp $(OUTDIR)/$(TARGET)*$(EXEEXT) $(INSTALL_DIR)
- rm -f $(INSTALL_DIR)/*_unstripped*$(EXEEXT)
- cp $(OUTDIR)/$(TARGET).nmf $(INSTALL_DIR)
- cp index.html $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),glibc)
- cp -r $(OUTDIR)/lib* $(INSTALL_DIR)
-endif
-ifeq ($(TOOLCHAIN),pnacl)
- sed -i.bak 's/x-nacl/x-pnacl/g' $(INSTALL_DIR)/index.html
-endif
diff --git a/ports/agg-demo/README.nacl b/ports/agg-demo/README.nacl
deleted file mode 100644
index 97a05b7..0000000
--- a/ports/agg-demo/README.nacl
+++ /dev/null
@@ -1,5 +0,0 @@
-A drawing demo for Native Client using the open source Anti-Grain Geometry
-project. Anti-Grain Geometry is a software rendering engine with many
-capabilities. For more information, please see the Anti-Grain website:
-
- http://www.antigrain.com/
diff --git a/ports/agg-demo/build.sh b/ports/agg-demo/build.sh
deleted file mode 100644
index 5709f1b..0000000
--- a/ports/agg-demo/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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.
-
-SetupSDKBuildSystem
diff --git a/ports/agg-demo/drawing.cc b/ports/agg-demo/drawing.cc
deleted file mode 100755
index a300c52..0000000
--- a/ports/agg-demo/drawing.cc
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright (c) 2009 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 Drawing demo
-// Uses Anti-Grain Geometry open source rendering library to render using
-// the Pepper Graphics2D interface and ppapi_simple.
-//
-// See http://www.antigrain.com for more information on Anti-Grain Geometry
-
-#include <errno.h>
-#include <stdio.h>
-
-#include <agg-2.5/agg_basics.h>
-#include <agg-2.5/agg_conv_stroke.h>
-#include <agg-2.5/agg_conv_transform.h>
-#include <agg-2.5/agg_ellipse.h>
-#include <agg-2.5/agg_path_storage.h>
-#include <agg-2.5/agg_pixfmt_rgba.h>
-#include <agg-2.5/agg_rendering_buffer.h>
-#include <agg-2.5/agg_rasterizer_outline_aa.h>
-#include <agg-2.5/agg_rasterizer_scanline_aa.h>
-#include <agg-2.5/agg_renderer_scanline.h>
-#include <agg-2.5/agg_scanline_u.h>
-
-#include "ppapi_simple/ps_context_2d.h"
-
-
-// Drawing class holds information and functionality needed to render
-class DrawingDemo {
- public:
- DrawingDemo(); ~DrawingDemo();
- void Display();
- void Update();
- bool PumpEvents();
- void Run();
-
- private:
- PSContext2D_t* ps_context_;
-};
-
-
-// This update loop is run once per frame.
-// All of the Anti-Grain Geometry (AGG) rendering is done in this function.
-// AGG renders straight into the DrawingDemo's ps_context_.
-void DrawingDemo::Update() {
- unsigned int i;
- agg::rendering_buffer rbuf((unsigned char *)ps_context_->data,
- ps_context_->width,
- ps_context_->height,
- ps_context_->stride);
- // Setup agg and clear the framebuffer.
- // Use Native Client's bgra pixel format.
- agg::pixfmt_bgra32 pixf(rbuf);
- typedef agg::renderer_base<agg::pixfmt_bgra32> ren_base;
- ren_base ren(pixf);
- ren.clear(agg::rgba(0, 0, 0));
- agg::rasterizer_scanline_aa<> ras;
- agg::scanline_u8 sl;
- ras.reset();
- ras.gamma(agg::gamma_none());
-
- // Draw an array of filled circles with a cycling color spectrum.
- const double spectrum_violet = 380.0;
- const double spectrum_red = 780.0;
- static double outer_cycle = spectrum_violet;
- static double delta_outer_cycle = 0.4;
- double inner_cycle = outer_cycle;
- double delta_inner_cycle = 0.75;
- for (double y = 0.0; y <= ps_context_->height; y += 32.0) {
- for (double x = 0.0; x <= ps_context_->width; x += 32.0) {
- // Draw a small filled circle at x, y with radius 16
- // using inner_cycle as the fill color.
- agg::rgba color(inner_cycle, 1.0);
- agg::ellipse elp;
- elp.init(x, y, 16, 16, 80);
- ras.add_path(elp);
- agg::render_scanlines_aa_solid(ras, sl, ren, color);
- // Bounce color cycle between red & violet.
- inner_cycle += delta_inner_cycle;
- if ((inner_cycle > spectrum_red) || (inner_cycle < spectrum_violet)) {
- delta_inner_cycle = -delta_inner_cycle;
- inner_cycle += delta_inner_cycle;
- }
- }
- }
- // Bounce outer starting color between red & violet.
- outer_cycle += delta_outer_cycle;
- if ((outer_cycle > spectrum_red) || (outer_cycle < spectrum_violet)) {
- delta_outer_cycle = -delta_outer_cycle;
- outer_cycle += delta_outer_cycle;
- }
-
- // Draw a semi-translucent triangle over the background.
- // The triangle is drawn as an outline, using a pen width
- // of 24 pixels. The call to close_polygon() ensures that
- // all three corners are cleanly mitered.
- agg::path_storage ps;
- agg::conv_stroke<agg::path_storage> pg(ps);
- pg.width(24.0);
- ps.remove_all();
- ps.move_to(96, 160);
- ps.line_to(384, 256);
- ps.line_to(192, 352);
- ps.line_to(96, 160);
- ps.close_polygon();
- ras.add_path(pg);
- agg::render_scanlines_aa_solid(ras, sl, ren, agg::rgba8(255, 255, 255, 160));
-}
-
-
-// Displays software rendered image on the screen
-void DrawingDemo::Display() {
-}
-
-
-// Pumps events and services them.
-bool DrawingDemo::PumpEvents() {
- PSEvent* ps_event;
- while ((ps_event = PSEventTryAcquire()) != NULL) {
- PSContext2DHandleEvent(ps_context_, ps_event);
- PSEventRelease(ps_event);
- }
- return true;
-}
-
-
-// Sets up and initializes DrawingDemo.
-DrawingDemo::DrawingDemo() {
- PSEventSetFilter(PSE_ALL);
- ps_context_ = PSContext2DAllocate(PP_IMAGEDATAFORMAT_BGRA_PREMUL);
-
- // Wait for context to be bound
- PSEvent* ps_event;
- while ((ps_event = PSEventWaitAcquire()) != NULL) {
- PSContext2DHandleEvent(ps_context_, ps_event);
- if (ps_context_->bound)
- break;
- }
-}
-
-
-// Frees up resources.
-DrawingDemo::~DrawingDemo() {
- PSContext2DFree(ps_context_);
-}
-
-
-// Runs the demo by looping forever and rendering frames.
-void DrawingDemo::Run() {
- for (int i = 0; ; i++) {
- if (!PumpEvents())
- break;
- PSContext2DGetBuffer(ps_context_);
- Update();
- PSContext2DSwapBuffer(ps_context_);
- printf("Frame: %04d\b\b\b\b\b\b\b\b\b\b\b", i);
- fflush(stdout);
- }
-
- printf("\nDone\n");
-}
-
-
-int main(int argc, char **argv) {
- DrawingDemo demo;
- demo.Run();
- return 0;
-}
diff --git a/ports/agg-demo/index.html b/ports/agg-demo/index.html
deleted file mode 100644
index ff1c926..0000000
--- a/ports/agg-demo/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-<head>
-<title>Drawing Demo</title>
-</head>
-<body id="bodyId">
-
-<h1>Drawing Demo using Anti-Grain Geometry</h1>
- <p>
- You should see below many circles drawn with a scrolling color spectrum, and
- a semi-translucent triangle rendered in the foreground.
- </p>
- <p>
- This demo uses an open source library called Anti-Grain Geometry, which
- provides high quality anti-aliased rendering. Please see
- <a href="http://www.antigrain.com/">http://www.antigrain.com/</a>
- for more information about Anti-Grain Geometry.
- </p>
- <embed id="embed1" src="agg-demo.nmf" type="application/x-nacl" width=512 height=512>
-<br>
-</body>
-</html>
diff --git a/ports/agg-demo/pkg_info b/ports/agg-demo/pkg_info
deleted file mode 100644
index 88db95e..0000000
--- a/ports/agg-demo/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=agg-demo
-VERSION=0.1
-LICENSE=BSD
-DEPENDS=(agg)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/agg/build.sh b/ports/agg/build.sh
deleted file mode 100644
index 5479f33..0000000
--- a/ports/agg/build.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2011 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.
-
-
-BuildStep() {
- ChangeDir ${SRC_DIR}
- local cflags="${NACLPORTS_CFLAGS} -I${NACLPORTS_INCLUDE}/freetype2"
- if [ ${NACL_ARCH} != "pnacl" ]; then
- cflags+=" -O3 -fomit-frame-pointer"
- fi
- if [ ${NACL_ARCH} = "i686" -o ${NACL_ARCH} = "x86_64" ]; then
- cflags+=" -mfpmath=sse -msse"
- fi
- # Workaround for arm-gcc bug:
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- # TODO(sbc): remove this once the issue is fixed
- if [ "${NACL_ARCH}" = "arm" ]; then
- cflags+=" -mfpu=vfp"
- fi
- MAKEFLAGS="-j${OS_JOBS}" AGGCXXFLAGS="${cflags}" LogExecute make -j${OS_JOBS}
-}
-
-
-InstallStep() {
- # copy libs and headers manually
- MakeDir ${DESTDIR_LIB}
- INCDIR=${DESTDIR_INCLUDE}/${NAME}-${VERSION}
- MakeDir ${INCDIR}
- LogExecute cp -R ${SRC_DIR}/include/*.h ${INCDIR}/
- LogExecute cp ${SRC_DIR}/font_freetype/*.h ${INCDIR}/
- LogExecute cp ${SRC_DIR}/src/libagg.a ${DESTDIR_LIB}
- LogExecute cp ${SRC_DIR}/font_freetype/libaggfontfreetype.a ${DESTDIR_LIB}/
-}
diff --git a/ports/agg/nacl.patch b/ports/agg/nacl.patch
deleted file mode 100644
index 5b3f2ad..0000000
--- a/ports/agg/nacl.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -3,7 +3,12 @@ all: lib
- src/libagg.a:
- cd src; make
-
--lib: src/libagg.a
-+font_freetype/libaggfontfreetype.a:
-+ cd font_freetype; make
-+
-+lib: src/libagg.a font_freetype/libaggfontfreetype.a
-
- clean:
- cd src; make clean
-+ cd font_freetype; make clean
-+
-diff --git a/Makefile.in.NativeClient b/Makefile.in.NativeClient
-new file mode 100644
---- /dev/null
-+++ b/Makefile.in.NativeClient
-@@ -0,0 +1,7 @@
-+AGGLIBS= -lagg
-+CXX = $(NACLCXX)
-+C = $(NACLCC)
-+LIB = $(NACLAR) cr
-+
-+.PHONY : clean
-+
-diff --git a/font_freetype/Makefile b/font_freetype/Makefile
-new file mode 100644
---- /dev/null
-+++ b/font_freetype/Makefile
-@@ -0,0 +1,21 @@
-+include ../Makefile.in.NativeClient
-+
-+CXXFLAGS= $(AGGCXXFLAGS) -I../include -L./ \
-+ -DFT_FREETYPE_H="<freetype/freetype.h>"
-+
-+SRC_CXX=\
-+agg_font_freetype.cpp
-+
-+OBJ=$(SRC_CXX:.cpp=.o)
-+
-+all: $(OBJ)
-+ $(LIB) libaggfontfreetype.a $(OBJ)
-+
-+clean:
-+ rm -f *.o *.a
-+
-+%.o: %.cpp
-+ $(CXX) -c $(CXXFLAGS) $*.cpp -o $@
-+
-+%.o: %.c
-+ $(C) -c $(CXXFLAGS) $*.c -o $@
-diff --git a/include/agg_renderer_outline_aa.h b/include/agg_renderer_outline_aa.h
---- a/include/agg_renderer_outline_aa.h
-+++ b/include/agg_renderer_outline_aa.h
-@@ -1375,7 +1375,6 @@ namespace agg
- //---------------------------------------------------------------------
- void profile(const line_profile_aa& prof) { m_profile = &prof; }
- const line_profile_aa& profile() const { return *m_profile; }
-- line_profile_aa& profile() { return *m_profile; }
-
- //---------------------------------------------------------------------
- int subpixel_width() const { return m_profile->subpixel_width(); }
-diff --git a/src/Makefile b/src/Makefile
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -1,4 +1,4 @@
--include ../Makefile.in.$(shell uname)
-+include ../Makefile.in.NativeClient
-
- CXXFLAGS= $(AGGCXXFLAGS) -I../include -L./
-
diff --git a/ports/agg/pkg_info b/ports/agg/pkg_info
deleted file mode 100644
index 888976e..0000000
--- a/ports/agg/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=agg
-VERSION=2.5
-URL=http://www.antigrain.com/agg-2.5.tar.gz
-LICENSE=GPL
-DEPENDS=(freetype)
-SHA1=08f23da64da40b90184a0414369f450115cdb328
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/alut-demo/Makefile b/ports/alut-demo/Makefile
deleted file mode 100644
index fe33a0c..0000000
--- a/ports/alut-demo/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (c) 2014 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.
-
-include $(NACL_SDK_ROOT)/tools/common.mk
-
-TARGET = alut-demo
-LIBS = alut openal
-SOURCES = alut_hello_world.c
-INSTALL_DIR = $(NACL_PACKAGES_PUBLISH)/$(TARGET)/$(TOOLCHAIN)
-CFLAGS += -Wall -Werror
-
-ifeq ($(TOOLCHAIN),pnacl)
-EXEEXT=.pexe
-else
-EXEEXT=.nexe
-endif
-
-ifneq ($(TOOLCHAIN),pnacl)
-# We want the nmf to contain all the .nexe we have previously
-# built as well as the one currently being built, so we modify
-# the list of executables that we pass to create_nmf.
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_64$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_32$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_arm$(EXEEXT))
-endif
-
-# Build rules generated by macros from common.mk:
-
-$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
-
-ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG))))
-$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
-$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
-else
-$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
-endif
-
-$(eval $(call NMF_RULE,$(TARGET),))
-
-install:
- mkdir -p $(INSTALL_DIR)
- cp $(OUTDIR)/$(TARGET)*$(EXEEXT) $(INSTALL_DIR)
- cp $(OUTDIR)/$(TARGET).nmf $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),glibc)
- cp -r $(OUTDIR)/lib* $(INSTALL_DIR)
-endif
- cp index.html $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),pnacl)
- cp $(OUTDIR)/$(TARGET)*.bc $(INSTALL_DIR)
- sed -i.bak 's/x-nacl/x-pnacl/g' $(INSTALL_DIR)/index.html
-endif
diff --git a/ports/alut-demo/alut_hello_world.c b/ports/alut-demo/alut_hello_world.c
deleted file mode 100644
index 9733793..0000000
--- a/ports/alut-demo/alut_hello_world.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <AL/alut.h>
-
-#include <ppapi/c/ppb.h>
-#include <ppapi_simple/ps.h>
-
-/*
- This is the 'Hello World' program from the ALUT
- reference manual.
-
- Link using '-lalut -lopenal -lpthread'.
-*/
-
-void alSetPpapiInfo(PP_Instance instance, PPB_GetInterface get_interface);
-
-int main(int argc, char** argv) {
- ALuint helloBuffer, helloSource;
-
- /*
- * This extra line is required by the underlying openAl
- * NaCl port.
- */
- alSetPpapiInfo(PSGetInstanceId(), PSGetInterface);
-
- alutInit(&argc, argv);
- helloBuffer = alutCreateBufferHelloWorld();
- alGenSources(1, &helloSource);
- alSourcei(helloSource, AL_BUFFER, helloBuffer);
- alSourcePlay(helloSource);
- alutSleep(1);
- alutExit();
- return EXIT_SUCCESS;
-}
diff --git a/ports/alut-demo/alut_hello_world.sh b/ports/alut-demo/alut_hello_world.sh
deleted file mode 100755
index f7d47a2..0000000
--- a/ports/alut-demo/alut_hello_world.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/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.
-
-source ../../build_tools/common.sh
-
-# Always 'make clean' because there could be artifacts from a previous build
-# in this sub-folder, 'make clean' from the top-level only clears 'out'.
-export CFLAGS=${NACLPORTS_CFLAGS}
-export LDFLAGS=${NACLPORTS_LDFLAGS}
-make clean
-make
diff --git a/ports/alut-demo/build.sh b/ports/alut-demo/build.sh
deleted file mode 100644
index fa5782a..0000000
--- a/ports/alut-demo/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# 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.
-
-EnableCliMain
-SetupSDKBuildSystem
diff --git a/ports/alut-demo/index.html b/ports/alut-demo/index.html
deleted file mode 100644
index 8ec8ca2..0000000
--- a/ports/alut-demo/index.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
- <!-- Copyright (c) 2013 Native Client Authors. All rights reserved. -->
- <head>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <title>Native Client OpenAL Utility Library (ALUT) Example</title>
-</head>
-
-<body>
-
-<h1>Native Client OpenAL Utility Library (ALUT) Example</h1>
-
-<p>This simple example should play the built in "Hello World" sample from the OpenAL UT library.</p>
-
-<embed name="nacl_module"
- id="alut-demo"
- src="alut-demo.nmf"
- type="application/x-nacl">
-
-</body>
-</html>
diff --git a/ports/alut-demo/pkg_info b/ports/alut-demo/pkg_info
deleted file mode 100644
index dfa1c6d..0000000
--- a/ports/alut-demo/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=alut-demo
-VERSION=0.1
-DEPENDS=(freealut nacl-spawn)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/apr-util/build.sh b/ports/apr-util/build.sh
deleted file mode 100644
index e7d3911..0000000
--- a/ports/apr-util/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXTRA_CONFIGURE_ARGS="--with-apr=${NACL_PREFIX}"
-EXTRA_CONFIGURE_ARGS+=" --with-expat=${NACL_PREFIX}"
diff --git a/ports/apr-util/pkg_info b/ports/apr-util/pkg_info
deleted file mode 100644
index a66591a..0000000
--- a/ports/apr-util/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=apr-util
-VERSION=1.5.3
-URL=http://apache.mirrors.pair.com/apr/apr-util-1.5.3.tar.bz2
-LICENSE=APACHE
-DEPENDS=(apr expat)
-SHA1=de0184ee03dfdc6dec4d013970d1862251e86925
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/apr/build.sh b/ports/apr/build.sh
deleted file mode 100644
index 49ac23b..0000000
--- a/ports/apr/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
-
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CONFIGURE_ARGS="--disable-dso"
-fi
diff --git a/ports/apr/nacl.patch b/ports/apr/nacl.patch
deleted file mode 100644
index da7431b..0000000
--- a/ports/apr/nacl.patch
+++ /dev/null
@@ -1,152 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -18,7 +18,7 @@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
- INCDIR=./include
- OSDIR=$(top_srcdir)/include/arch/@OSDIR@
- DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
--INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include -I$(top_srcdir)/include/private
-+INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include -I$(top_srcdir)/include/private -Iinclude/private
-
- #
- # Macros for target determination
-@@ -45,8 +45,8 @@ LT_VERSION = @LT_VERSION@
- @INCLUDE_OUTPUTS@
-
- CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
-- build/apr_rules.out tools/gen_test_char@EXEEXT@ \
-- tools/gen_test_char.o tools/gen_test_char.lo \
-+ build/apr_rules.out tools/gen_test_char \
-+ tools/gen_test_char.o \
- include/private/apr_escape_test_char.h
- DISTCLEAN_TARGETS = config.cache config.log config.status \
- include/apr.h include/arch/unix/apr_private.h \
-@@ -129,12 +129,18 @@ check: $(TARGET_LIB)
- etags:
- etags `find . -name '*.[ch]'`
-
--OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
--tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
-- $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
-+tools/gen_test_char.o: tools/gen_test_char.c
-+ mkdir -p tools
-+ gcc -c $< -o $@
-
--include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
-- tools/gen_test_char@EXEEXT@ > $@
-+
-+OBJECTS_gen_test_char = tools/gen_test_char.o
-+tools/gen_test_char: $(OBJECTS_gen_test_char)
-+ gcc $(OBJECTS_gen_test_char) -o $@
-+
-+include/private/apr_escape_test_char.h: tools/gen_test_char
-+ mkdir -p include/private
-+ tools/gen_test_char > $@
-
- LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \
- @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -20959,7 +20959,8 @@ if ${ac_cv_file__dev_zero+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- test "$cross_compiling" = yes &&
-- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-+ ac_cv_file__dev_zero=no
-+ #as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
- if test -r "/dev/zero"; then
- ac_cv_file__dev_zero=yes
- else
-@@ -23051,7 +23052,8 @@ if ${ac_cv_func_setpgrp_void+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-- as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5
-+ ac_cv_func_setpgrp_void=no
-+ #as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-@@ -24262,7 +24264,7 @@ if ${ac_cv_sizeof_struct_iovec+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-- ac_cv_sizeof_struct_iovec=0
-+ ac_cv_sizeof_struct_iovec=1
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-@@ -27355,10 +27357,11 @@ if ${apr_cv_tcp_nodelay_with_cork+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "cannot run test program while cross compiling
--See \`config.log' for more details" "$LINENO" 5; }
-+ apr_cv_tcp_nodelay_with_cork=no
-+ #{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+#as_fn_error $? "cannot run test program while cross compiling
-+#See \`config.log' for more details" "$LINENO" 5; }
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
---- a/file_io/unix/pipe.c
-+++ b/file_io/unix/pipe.c
-@@ -252,12 +252,16 @@ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in,
- APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename,
- apr_fileperms_t perm, apr_pool_t *pool)
- {
-+#if defined(__native_client__)
-+ return ENOSYS;
-+#else
- mode_t mode = apr_unix_perms2mode(perm);
-
- if (mkfifo(filename, mode) == -1) {
- return errno;
- }
- return APR_SUCCESS;
-+#endif
- }
-
-
-diff --git a/include/apr.h.in b/include/apr.h.in
---- a/include/apr.h.in
-+++ b/include/apr.h.in
-@@ -189,6 +189,9 @@
- #endif
-
- /* header files for PATH_MAX, _POSIX_PATH_MAX */
-+#if defined(__native_client__) && defined(__GLIBC__)
-+#include <linux/limits.h>
-+#endif
- #if APR_HAVE_LIMITS_H
- #include <limits.h>
- #else
-diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
---- a/network_io/unix/sockopt.c
-+++ b/network_io/unix/sockopt.c
-@@ -358,7 +358,7 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock,
-
- apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
- {
--#ifndef BEOS_R5
-+#if !defined(BEOS_R5) && (!defined(__native_client__) || defined(__GLIBC__))
- int oobmark;
-
- if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
-diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c
---- a/threadproc/unix/procsup.c
-+++ b/threadproc/unix/procsup.c
-@@ -52,7 +52,7 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize)
- if (setpgrp(0, getpid()) == -1) {
- return errno;
- }
--#elif defined(OS2) || defined(TPF) || defined(MPE)
-+#elif defined(OS2) || defined(TPF) || defined(MPE) || defined(__native_client__)
- /* do nothing */
- #else
- if (setpgid(0, 0) == -1) {
diff --git a/ports/apr/pkg_info b/ports/apr/pkg_info
deleted file mode 100644
index 4d7c0f3..0000000
--- a/ports/apr/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=apr
-VERSION=1.5.0
-URL=http://apache.mirrors.pair.com/apr/apr-1.5.0.tar.bz2
-LICENSE=APACHE
-DEPENDS=(glibc-compat)
-SHA1=cae122be79070645a7ab36a53148487c84ce8bf0
-# missing MCAST_JOIN_SOURCE_GROUP in netinet/in.h
-# https://code.google.com/p/nativeclient/issues/detail?id=4245
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
diff --git a/ports/atk/pkg_info b/ports/atk/pkg_info
deleted file mode 100644
index ae557f9..0000000
--- a/ports/atk/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=atk
-VERSION=2.16.0
-URL=ftp://ftp.gnome.org/pub/gnome/sources/atk/2.16/atk-2.16.0.tar.xz
-LICENSE=LGPL
-DEPENDS=(glib)
-SHA1=d097c6cec71ffede77be9f13f4ceee9880c0a5d7
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/avrdude/build.sh b/ports/avrdude/build.sh
deleted file mode 100644
index 73431db..0000000
--- a/ports/avrdude/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2015 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.
-
-EXECUTABLES=avrdude${NACL_EXEEXT}
-
-EnableCliMain
-EnableGlibcCompat
diff --git a/ports/avrdude/nacl.patch b/ports/avrdude/nacl.patch
deleted file mode 100644
index 6835354..0000000
--- a/ports/avrdude/nacl.patch
+++ /dev/null
@@ -1,260 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -708,7 +708,7 @@ clean-binPROGRAMS:
-
- avrdude$(EXEEXT): $(avrdude_OBJECTS) $(avrdude_DEPENDENCIES) $(EXTRA_avrdude_DEPENDENCIES)
- @rm -f avrdude$(EXEEXT)
-- $(AM_V_CCLD)$(avrdude_LINK) $(avrdude_OBJECTS) $(avrdude_LDADD) $(LIBS)
-+ $(AM_V_CCLD)$(avrdude_LINK) $(avrdude_OBJECTS) $(LIBS) $(avrdude_LDADD)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-diff --git a/dfu.c b/dfu.c
---- a/dfu.c
-+++ b/dfu.c
-@@ -36,13 +36,13 @@
-
- #ifndef HAVE_LIBUSB
-
--int dfu_open(struct dfu_dev *dfu, char *port_name) {
-+struct dfu_dev *dfu_open(char *port_name) {
- fprintf(stderr, "%s: Error: No USB support in this compile of avrdude\n",
- progname);
-- return -1;
-+ return 0;
- }
-
--int dfu_init(struct dfu_dev *dfu, unsigned short usb_pid) {
-+int dfu_init(struct dfu_dev *dfu, unsigned short vid, unsigned short usb_pid) {
- return -1;
- }
-
-diff --git a/flip1.c b/flip1.c
---- a/flip1.c
-+++ b/flip1.c
-@@ -260,7 +260,7 @@ int flip1_initialize(PROGRAMMER* pgm, AVRPART *part)
- goto flip1_initialize_fail;
-
- /* Check if descriptor values are what we expect. */
--
-+#if HAVE_USB
- if (dfu->dev_desc.idVendor != vid)
- fprintf( stderr, "%s: Warning: USB idVendor = 0x%04X (expected 0x%04X)\n",
- progname, dfu->dev_desc.idVendor, vid);
-@@ -318,6 +318,7 @@ int flip1_initialize(PROGRAMMER* pgm, AVRPART *part)
-
- dfu_abort(dfu);
-
-+#endif
- return 0;
-
- flip1_initialize_fail:
-@@ -361,6 +362,7 @@ int flip1_program_enable(PROGRAMMER* pgm, AVRPART *part)
-
- int flip1_chip_erase(PROGRAMMER* pgm, AVRPART *part)
- {
-+#if HAVE_USB
- struct dfu_status status;
- int cmd_result = 0;
- int aux_result;
-@@ -388,6 +390,7 @@ int flip1_chip_erase(PROGRAMMER* pgm, AVRPART *part)
- dfu_clrstatus(FLIP1(pgm)->dfu);
- return -1;
- }
-+#endif
-
- return 0;
- }
-@@ -509,6 +512,7 @@ int flip1_paged_write(PROGRAMMER* pgm, AVRPART *part, AVRMEM *mem,
-
- int flip1_read_sig_bytes(PROGRAMMER* pgm, AVRPART *part, AVRMEM *mem)
- {
-+#if HAVE_USB
- if (verbose > 1)
- fprintf(stderr, "%s: flip1_read_sig_bytes(): ", progname);
-
-@@ -583,6 +587,7 @@ int flip1_read_sig_bytes(PROGRAMMER* pgm, AVRPART *part, AVRMEM *mem)
-
- memcpy(mem->buf, FLIP1(pgm)->part_sig, sizeof(FLIP1(pgm)->part_sig));
-
-+#endif
- return 0;
- }
-
-@@ -608,14 +613,17 @@ void flip1_teardown(PROGRAMMER * pgm)
-
- void flip1_show_info(struct flip1 *flip1)
- {
-+#if HAVE_USB
- dfu_show_info(flip1->dfu);
- fprintf(stderr, " USB max packet size : %hu\n",
- (unsigned short) flip1->dfu->dev_desc.bMaxPacketSize0);
-+#endif
- }
-
- int flip1_read_memory(PROGRAMMER * pgm,
- enum flip1_mem_unit mem_unit, uint32_t addr, void *ptr, int size)
- {
-+#if HAVE_USB
- struct dfu_dev *dfu = FLIP1(pgm)->dfu;
- unsigned short page_addr;
- struct dfu_status status;
-@@ -696,6 +704,7 @@ int flip1_read_memory(PROGRAMMER * pgm,
- dfu_clrstatus(dfu);
- return -1;
- }
-+#endif
-
- return 0;
- }
-@@ -703,6 +712,7 @@ int flip1_read_memory(PROGRAMMER * pgm,
- int flip1_write_memory(struct dfu_dev *dfu,
- enum flip1_mem_unit mem_unit, uint32_t addr, const void *ptr, int size)
- {
-+#if HAVE_USB
- unsigned short page_addr;
- int write_size;
- struct dfu_status status;
-@@ -800,6 +810,7 @@ int flip1_write_memory(struct dfu_dev *dfu,
- dfu_clrstatus(dfu);
- return -1;
- }
-+#endif
-
- return 0;
- }
-@@ -807,6 +818,7 @@ int flip1_write_memory(struct dfu_dev *dfu,
- int flip1_set_mem_page(struct dfu_dev *dfu,
- unsigned short page_addr)
- {
-+#if HAVE_USB
- struct dfu_status status;
- int cmd_result = 0;
- int aux_result;
-@@ -831,6 +843,7 @@ int flip1_set_mem_page(struct dfu_dev *dfu,
- return -1;
- }
-
-+#endif
- return 0;
- }
-
-diff --git a/flip2.c b/flip2.c
---- a/flip2.c
-+++ b/flip2.c
-@@ -255,6 +255,7 @@ int flip2_initialize(PROGRAMMER* pgm, AVRPART *part)
- goto flip2_initialize_fail;
-
- /* Check if descriptor values are what we expect. */
-+#if HAVE_USB
-
- if (dfu->dev_desc.idVendor != vid)
- fprintf( stderr, "%s: Warning: USB idVendor = 0x%04X (expected 0x%04X)\n",
-@@ -311,6 +312,8 @@ int flip2_initialize(PROGRAMMER* pgm, AVRPART *part)
- if (verbose)
- flip2_show_info(FLIP2(pgm));
-
-+#endif
-+
- return 0;
-
- flip2_initialize_fail:
-@@ -357,6 +360,7 @@ int flip2_chip_erase(PROGRAMMER* pgm, AVRPART *part)
- struct dfu_status status;
- int cmd_result = 0;
- int aux_result;
-+#if HAVE_USB
-
- if (verbose > 1)
- fprintf(stderr, "%s: flip_chip_erase()\n", progname);
-@@ -384,6 +388,7 @@ int flip2_chip_erase(PROGRAMMER* pgm, AVRPART *part)
- } else
- break;
- }
-+#endif
-
- return cmd_result;
- }
-@@ -539,6 +544,7 @@ void flip2_teardown(PROGRAMMER * pgm)
-
- void flip2_show_info(struct flip2 *flip2)
- {
-+#if HAVE_USB
- dfu_show_info(flip2->dfu);
-
- fprintf(stderr, " Part signature : 0x%02X%02X%02X\n",
-@@ -560,6 +566,7 @@ void flip2_show_info(struct flip2 *flip2)
-
- fprintf(stderr, " USB max packet size : %hu\n",
- (unsigned short) flip2->dfu->dev_desc.bMaxPacketSize0);
-+#endif
- }
-
- int flip2_read_memory(struct dfu_dev *dfu,
-@@ -697,6 +704,7 @@ int flip2_set_mem_unit(struct dfu_dev *dfu, enum flip2_mem_unit mem_unit)
- struct dfu_status status;
- int cmd_result = 0;
- int aux_result;
-+#if HAVE_USB
-
- struct flip2_cmd cmd = {
- FLIP2_CMD_GROUP_SELECT, FLIP2_CMD_SELECT_MEMORY, { 0, 0, 0, 0 }
-@@ -723,6 +731,7 @@ int flip2_set_mem_unit(struct dfu_dev *dfu, enum flip2_mem_unit mem_unit)
- flip2_status_str(&status));
- dfu_clrstatus(dfu);
- }
-+#endif
-
- return cmd_result;
- }
-@@ -733,7 +742,7 @@ int flip2_set_mem_page(struct dfu_dev *dfu,
- struct dfu_status status;
- int cmd_result = 0;
- int aux_result;
--
-+#if HAVE_USB
- struct flip2_cmd cmd = {
- FLIP2_CMD_GROUP_SELECT, FLIP2_CMD_SELECT_MEMORY, { 0, 0, 0, 0 }
- };
-@@ -761,6 +770,8 @@ int flip2_set_mem_page(struct dfu_dev *dfu,
- dfu_clrstatus(dfu);
- }
-
-+#endif
-+
- return cmd_result;
- }
-
-@@ -770,6 +781,7 @@ int flip2_read_max1k(struct dfu_dev *dfu,
- struct dfu_status status;
- int cmd_result = 0;
- int aux_result;
-+#if HAVE_USB
-
- struct flip2_cmd cmd = {
- FLIP2_CMD_GROUP_UPLOAD, FLIP2_CMD_READ_MEMORY, { 0, 0, 0, 0 }
-@@ -805,6 +817,7 @@ flip2_read_max1k_status:
- flip2_status_str(&status));
- dfu_clrstatus(dfu);
- }
-+#endif
-
- return cmd_result;
- }
-@@ -817,6 +830,7 @@ int flip2_write_max1k(struct dfu_dev *dfu,
- struct dfu_status status;
- int cmd_result = 0;
- int aux_result;
-+#if HAVE_USB
-
- struct flip2_cmd cmd = {
- FLIP2_CMD_GROUP_DOWNLOAD, FLIP2_CMD_PROG_START, { 0, 0, 0, 0 }
-@@ -866,6 +880,7 @@ int flip2_write_max1k(struct dfu_dev *dfu,
- flip2_status_str(&status));
- dfu_clrstatus(dfu);
- }
-+#endif
-
- return cmd_result;
- }
diff --git a/ports/avrdude/pkg_info b/ports/avrdude/pkg_info
deleted file mode 100644
index e7d77f1..0000000
--- a/ports/avrdude/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=avrdude
-VERSION=6.1
-URL=http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz
-LICENSE=GPL
-DEPENDS=(glibc-compat nacl-spawn libelf)
-DISABLED_LIBC=(newlib)
-BUILD_OS=linux
-SHA1=15525cbff5918568ef3955d871dbb94feaf83c79
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
diff --git a/ports/babl/build.sh b/ports/babl/build.sh
deleted file mode 100644
index 99e3da5..0000000
--- a/ports/babl/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2015 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.
-
-EnableGlibcCompat
-EnableCliMain
diff --git a/ports/babl/pkg_info b/ports/babl/pkg_info
deleted file mode 100644
index d81e203..0000000
--- a/ports/babl/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=babl
-VERSION=0.1.12
-URL=http://download.gimp.org/pub/babl/0.1/babl-0.1.12.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat tar)
-SHA1=b9a811d9d05717d66bc107a18447fbd74cff7eea
-DISABLED_LIBC=(newlib)
diff --git a/ports/bash/build.sh b/ports/bash/build.sh
deleted file mode 100644
index accce4e..0000000
--- a/ports/bash/build.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2013 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.
-
-EnableGlibcCompat
-EnableCliMain
-
-EXTRA_CONFIGURE_ARGS+=" --with-curses"
-EXTRA_CONFIGURE_ARGS+=" --with-installed-readline"
-EXTRA_CONFIGURE_ARGS+=" --enable-readline"
-NACLPORTS_CPPFLAGS+=" -DNO_MAIN_ENV_ARG"
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-
-EXECUTABLES="bash${NACL_EXEEXT}"
-
-# Configure requires this variable to be pre-set when cross compiling.
-export bash_cv_getcwd_malloc=yes
-
-if [[ ${TOOLCHAIN} == glibc ]]; then
- # Avoid conflicting gethostname declaration
- export ac_cv_func_gethostname=yes
-fi
-
-BuildStep() {
- # There is a missing dependency in the bash build system which means
- # that parallel build will sometimes fail due to lib/intl/libintl.h
- # not being generated before files that use it are compiled.
- # For example pathexp.c indirectly depends on libintl.h but compilation
- # of this file doesn't depend on the rule that generates it.
- # The fix is to explicitly build lib/intl before we build everything else.
- LogExecute make -C lib/intl
- DefaultBuildStep
-}
-
-PublishStep() {
- PublishMultiArch bash${NACL_EXEEXT} bash
-}
diff --git a/ports/bash/nacl.patch b/ports/bash/nacl.patch
deleted file mode 100644
index 88a5b42..0000000
--- a/ports/bash/nacl.patch
+++ /dev/null
@@ -1,259 +0,0 @@
-diff --git a/bashline.c b/bashline.c
---- a/bashline.c
-+++ b/bashline.c
-@@ -2379,7 +2379,7 @@ bash_groupname_completion_function (text, state)
- const char *text;
- int state;
- {
--#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H)
-+#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H) || (defined(__native_client__) && defined(_NEWLIB_VERSION))
- return ((char *)NULL);
- #else
- static char *gname = (char *)NULL;
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -2867,6 +2867,7 @@ sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
- *-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
- *-beos*) opt_bash_malloc=no ;; # they say it's suitable
- *-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
-+*nacl*) opt_bash_malloc=no ;; # Native Client
- *-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft
- *-nsk*) opt_bash_malloc=no ;; # HP NonStop
- *-haiku*) opt_bash_malloc=no ;; # Haiku OS
-@@ -5278,7 +5279,7 @@ if ${ac_cv_rl_version+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-- ac_cv_rl_version='4.2'
-+ ac_cv_rl_version='6.2'
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-diff --git a/eval.c b/eval.c
---- a/eval.c
-+++ b/eval.c
-@@ -271,7 +271,10 @@ read_command ()
- if (tmout_len > 0)
- {
- old_alrm = set_signal_handler (SIGALRM, alrm_catcher);
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
-+ /* TODO(bradnelson): Drop once we emulate signals. */
- alarm (tmout_len);
-+#endif
- }
- }
- }
-@@ -283,7 +286,10 @@ read_command ()
-
- if (interactive && tmout_var && (tmout_len > 0))
- {
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
-+ /* TODO(bradnelson): Drop once we emulate signals. */
- alarm(0);
-+#endif
- set_signal_handler (SIGALRM, old_alrm);
- }
-
-diff --git a/execute_cmd.c b/execute_cmd.c
---- a/execute_cmd.c
-+++ b/execute_cmd.c
-@@ -98,6 +98,10 @@ extern int errno;
- # include "bashhist.h"
- #endif
-
-+#if defined(__native_client__)
-+# include <spawn.h>
-+#endif
-+
- extern int dollar_dollar_pid;
- extern int posixly_correct;
- extern int expand_aliases;
-@@ -2369,7 +2373,11 @@ execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close)
- /* If the `lastpipe' option is set with shopt, and job control is not
- enabled, execute the last element of non-async pipelines in the
- current shell environment. */
-+#if defined(JOB_CONTROL)
- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
-+#else
-+ if (lastpipe_opt && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
-+#endif
- {
- lstdin = move_to_high_fd (0, 1, -1);
- if (lstdin > 0)
-@@ -4873,6 +4881,33 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
- SHELL_VAR *hookf;
- WORD_LIST *wl;
-
-+#if defined(__native_client__)
-+ // Update environ.
-+ maybe_make_export_env ();
-+ args = strvec_from_word_list (words, 0, 0, (int *)NULL);
-+ pathname = words->word->word;
-+ pid = spawnve(P_NOWAIT, args[0], args, NULL);
-+ free(args);
-+ if (pid < 0) {
-+ /* Make sure filenames are displayed using printable characters */
-+ if (ansic_shouldquote (pathname))
-+ pathname = ansic_quote (pathname, 0, NULL);
-+ if (errno == ENOENT) {
-+ internal_error (_("%s: command not found"), pathname);
-+ } else {
-+ internal_error (_("%s: nacl_spawn failed (errno %d)"), pathname, errno);
-+ }
-+ return EX_NOTFOUND; /* Posix.2 says the exit status is 127 */
-+ }
-+ if (waitpid(pid, &result, 0) < 0) {
-+ if (ansic_shouldquote (pathname))
-+ pathname = ansic_quote (pathname, 0, NULL);
-+ internal_error (_("%s: waitpid failed (errno %d)"), pathname, errno);
-+ return EXECUTION_FAILURE;
-+ }
-+ /* TODO(bradnelson): Make this more general once we support signals. */
-+ return WEXITSTATUS(result);
-+#else
- nofork = (cmdflags & CMD_NO_FORK); /* Don't fork, just exec, if no pipes */
- pathname = words->word->word;
-
-@@ -5005,6 +5040,7 @@ parent_return:
- FREE (command);
- return (result);
- }
-+#endif
- }
-
- /* CPP defines to decide whether a particular index into the #! line
-diff --git a/jobs.h b/jobs.h
---- a/jobs.h
-+++ b/jobs.h
-@@ -56,7 +56,11 @@
- typedef struct process {
- struct process *next; /* Next process in the pipeline. A circular chain. */
- pid_t pid; /* Process ID. */
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ int status; /* The status of this command as returned by wait. */
-+#else
- WAIT status; /* The status of this command as returned by wait. */
-+#endif
- int running; /* Non-zero if this process is running. */
- char *command; /* The particular program that is running. */
- } PROCESS;
-diff --git a/lib/sh/ufuncs.c b/lib/sh/ufuncs.c
---- a/lib/sh/ufuncs.c
-+++ b/lib/sh/ufuncs.c
-@@ -65,6 +65,10 @@ int
- falarm (secs, usecs)
- unsigned int secs, usecs;
- {
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ /* TODO(bradnelson): Remove this once we emulate signals. */
-+ return 0;
-+#else
- if (secs == 0 && usecs == 0)
- return (alarm (0));
-
-@@ -74,6 +78,7 @@ falarm (secs, usecs)
- usecs = 0;
- }
- return (alarm (secs));
-+#endif
- }
- #endif /* !HAVE_SETITIMER */
-
-diff --git a/nojobs.c b/nojobs.c
---- a/nojobs.c
-+++ b/nojobs.c
-@@ -65,6 +65,10 @@
- # define WAITPID(pid, statusp, options) wait (statusp)
- #endif /* !HAVE_WAITPID */
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+# define WAIT int
-+#endif
-+
- /* Return the fd from which we are actually getting input. */
- #define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr)
-
-@@ -775,7 +779,7 @@ wait_for (pid)
- CHECK_WAIT_INTR;
- if (got_pid < 0 && errno == ECHILD)
- {
--#if !defined (_POSIX_VERSION)
-+#if !defined (_POSIX_VERSION) && (!defined(__native_client__) || !defined(_NEWLIB_VERSION))
- status.w_termsig = status.w_retcode = 0;
- #else
- status = 0;
-@@ -839,8 +843,10 @@ wait_for (pid)
- if ((WIFSTOPPED (status) == 0) && WIFSIGNALED (status) && REPORTSIG(WTERMSIG (status)))
- {
- fprintf (stderr, "%s", j_strsignal (WTERMSIG (status)));
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- if (WIFCORED (status))
- fprintf (stderr, _(" (core dumped)"));
-+#endif
- fprintf (stderr, "\n");
- }
-
-diff --git a/shell.c b/shell.c
---- a/shell.c
-+++ b/shell.c
-@@ -83,6 +83,22 @@
- # include <opennt/opennt.h>
- #endif
-
-+#ifdef __native_client__
-+#include <nacl_main.h>
-+#ifdef __arm__
-+#define DATA_FILE "_platform_specific/arm/bash_data.tar"
-+#elif defined __i386__
-+#define DATA_FILE "_platform_specific/i686/bash_data.tar"
-+#elif defined __x86_64__
-+#define DATA_FILE "_platform_specific/x86_64/bash_data.tar"
-+#elif defined __pnacl__
-+#define DATA_FILE "bash_data.tar"
-+#else
-+#error "Unknown arch"
-+#endif
-+#endif
-+
-+
- #if !defined (HAVE_GETPW_DECLS)
- extern struct passwd *getpwuid ();
- #endif /* !HAVE_GETPW_DECLS */
-@@ -365,7 +381,7 @@ main (argc, argv, env)
- #endif
- volatile int locally_skip_execution;
- volatile int arg_index, top_level_arg_index;
--#ifdef __OPENNT
-+#if defined(__OPENNT) || defined(__native_client__)
- char **env;
-
- env = environ;
-@@ -380,6 +396,12 @@ main (argc, argv, env)
- USE_VAR(saverst);
- #endif
-
-+#ifdef __native_client__
-+ code = nacl_startup_untar(argv[0], DATA_FILE, "/");
-+ if (code)
-+ exit (2);
-+#endif
-+
- /* Catch early SIGINTs. */
- code = setjmp_nosigs (top_level);
- if (code)
-@@ -1717,10 +1739,14 @@ shell_initialize ()
- if (current_host_name == 0)
- {
- /* Initialize current_host_name. */
-+#if defined(__native_client__) && defined(__GLIBC__)
-+ current_host_name = "mingn";
-+#else
- if (gethostname (hostname, 255) < 0)
- current_host_name = "??host??";
- else
- current_host_name = savestring (hostname);
-+#endif
- }
-
- /* Initialize the stuff in current_user that comes from the password
diff --git a/ports/bash/pkg_info b/ports/bash/pkg_info
deleted file mode 100644
index ad2633a..0000000
--- a/ports/bash/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=bash
-VERSION=4.3
-URL=http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
-LICENSE=GPL
-DEPENDS=(nacl-spawn readline)
-SHA1=45ac3c5727e7262334f4dfadecdf601b39434e84
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/bdftopcf/build.sh b/ports/bdftopcf/build.sh
deleted file mode 100644
index 89b47a2..0000000
--- a/ports/bdftopcf/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXECUTABLES="bdftopcf${NACL_EXEEXT}"
-
-EnableCliMain
-EnableGlibcCompat
-
-NACLPORTS_LIBS+=" -lz"
-
diff --git a/ports/bdftopcf/pkg_info b/ports/bdftopcf/pkg_info
deleted file mode 100644
index fcd9162..0000000
--- a/ports/bdftopcf/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=bdftopcf
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/bdftopcf-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat nacl-spawn libxfont)
-SHA1=146b4ece2867479045c3b4593b22c9f1d21da14a
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/bigreqsproto/pkg_info b/ports/bigreqsproto/pkg_info
deleted file mode 100644
index 5f11535..0000000
--- a/ports/bigreqsproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=bigreqsproto
-VERSION=1.1.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/bigreqsproto-1.1.2.tar.bz2
-LICENSE=GPL
-SHA1=ef1765eeb5e9e38d080225fe6a64ed7cd2984b46
diff --git a/ports/binutils-2.25/build.sh b/ports/binutils-2.25/build.sh
deleted file mode 100644
index 1a88f35..0000000
--- a/ports/binutils-2.25/build.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2015 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.
-
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-HOST_INSTALL_DIR=${WORK_DIR}/install_host
-
-export ac_cv_func_getrlimit=no
-
-EnableCliMain
-
-BuildHostBinutils() {
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- LogExecute ${SRC_DIR}/configure --prefix=${HOST_INSTALL_DIR} \
- --target=avr \
- --disable-nls
- LogExecute make
- LogExecute make install
-}
-
-ConfigureStep() {
- BuildHostBinutils
-
- export PATH="${HOST_INSTALL_DIR}/bin:${PATH}"
- ChangeDir ${BUILD_DIR}
- EXTRA_CONFIGURE_ARGS="\
- --target=avr \
- --disable-nls \
- --disable-werror \
- --enable-deterministic-archives \
- --without-zlib"
-
- DefaultConfigureStep
-}
diff --git a/ports/binutils-2.25/nacl.patch b/ports/binutils-2.25/nacl.patch
deleted file mode 100644
index ec6dd63..0000000
--- a/ports/binutils-2.25/nacl.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/binutils/Makefile.in b/binutils/Makefile.in
---- a/binutils/Makefile.in
-+++ b/binutils/Makefile.in
-@@ -333,7 +333,7 @@ LIBICONV = @LIBICONV@
- LIBINTL = @LIBINTL@
- LIBINTL_DEP = @LIBINTL_DEP@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LIBTOOL = @LIBTOOL@
- LIPO = @LIPO@
- LN_S = @LN_S@
-@@ -485,7 +485,7 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
- @HDEFINES@ \
- @INCINTL@ \
- -DLOCALEDIR="\"$(datadir)/locale\"" \
-- -Dbin_dummy_emulation=$(EMULATION_VECTOR)
-+ -Dbin_dummy_emulation=$(EMULATION_VECTOR) $(EXTRA_AM_CPPFLAGS)
-
- HFILES = \
- arsup.h binemul.h bucomm.h budbg.h \
-diff --git a/gas/Makefile.in b/gas/Makefile.in
---- a/gas/Makefile.in
-+++ b/gas/Makefile.in
-@@ -197,7 +197,7 @@ LIBINTL = @LIBINTL@
- LIBINTL_DEP = @LIBINTL_DEP@
- LIBM = @LIBM@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LIBTOOL = @LIBTOOL@
- LIPO = @LIPO@
- LN_S = @LN_S@
-@@ -642,7 +642,7 @@ INCDIR = $(BASEDIR)/include
- # subdirectory rather than in the source directory.
- AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
- -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
-- -DLOCALEDIR="\"$(datadir)/locale\""
-+ -DLOCALEDIR="\"$(datadir)/locale\"" $(EXTRA_AM_CPPFLAGS)
-
-
- # How to link with both our special library facilities
-diff --git a/ld/Makefile.in b/ld/Makefile.in
---- a/ld/Makefile.in
-+++ b/ld/Makefile.in
-@@ -450,7 +450,7 @@ TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \
-
- AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
- @INCINTL@ $(HDEFINES) $(CFLAGS) $(PLUGIN_CFLAGS) \
-- -DLOCALEDIR="\"$(datadir)/locale\""
-+ -DLOCALEDIR="\"$(datadir)/locale\"" $(EXTRA_AM_CPPFLAGS)
-
- BFDLIB = ../bfd/libbfd.la
- LIBIBERTY = ../libiberty/libiberty.a
-@@ -851,7 +851,7 @@ ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmai
- ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \
- $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
-
--ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-+ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) $(EXTRA_LIBS)
-
- # A test program for C++ constructors and destructors.
- # This test is now in the testsuite.
diff --git a/ports/binutils-2.25/pkg_info b/ports/binutils-2.25/pkg_info
deleted file mode 100644
index 0e2bce4..0000000
--- a/ports/binutils-2.25/pkg_info
+++ /dev/null
@@ -1,12 +0,0 @@
-NAME=binutils-2.25
-VERSION=2.25
-URL=http://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.bz2
-LICENSE=GPL
-DEPENDS=(nacl-spawn)
-DISABLED_ARCH=(pnacl)
-BUILD_OS=linux
-SHA1=b46cc90ebaba7ffcf6c6d996d60738881b14e50d
-ARCHIVE_ROOT=binutils-2.25
-# arm-nacl-clang asserts in llvm::ARMInstPrinter::printInstruction:
-# https://code.google.com/p/nativeclient/issues/detail?id=4114
-DISABLED_TOOLCHAIN=(clang-newlib/arm emscripten)
diff --git a/ports/binutils/build.sh b/ports/binutils/build.sh
deleted file mode 100644
index 5639c24..0000000
--- a/ports/binutils/build.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2014 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.
-
-export ac_cv_func_getrlimit=no
-
-EnableCliMain
-
-EXTRA_CONFIGURE_ARGS="\
- --enable-targets=x86_64-nacl,arm-nacl,avr \
- --disable-werror \
- --enable-deterministic-archives \
- --without-zlib"
-
-BuildStep() {
- export CONFIG_SITE
- DefaultBuildStep
-}
-
-InstallStep() {
- DefaultInstallStep
-
- # The ldscripts that ship with this verion of binutils doesn't seem to
- # work with the glibc toolchain devenv. Instead we copy the linker scripts
- # out of the SDK root.
- rm -rf ${DESTDIR}${PREFIX}/${NACL_ARCH}-nacl/lib/ldscripts
- LogExecute cp -r \
- ${NACL_SDK_ROOT}/toolchain/${OS_SUBDIR}_x86_glibc/x86_64-nacl/lib/ldscripts \
- ${DESTDIR}${PREFIX}/${NACL_ARCH}-nacl/lib/
-}
diff --git a/ports/binutils/nacl.patch b/ports/binutils/nacl.patch
deleted file mode 100644
index b5bcd7d..0000000
--- a/ports/binutils/nacl.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
---- a/bfd/elf32-i386.c
-+++ b/bfd/elf32-i386.c
-@@ -3807,7 +3807,7 @@ elf_i386_relocate_section (bfd *output_bfd,
- if (ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD)
- {
- unsigned int type;
-- bfd_vma roff;
-+ bfd_vma roff = 0;
-
- /* GD->LE transition. */
- type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
-@@ -4163,7 +4163,7 @@ elf_i386_relocate_section (bfd *output_bfd,
- else if (ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD)
- {
- unsigned int val, type;
-- bfd_vma roff;
-+ bfd_vma roff = 0;
-
- /* GD->IE transition. */
- type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
-diff --git a/ld/Makefile.in b/ld/Makefile.in
---- a/ld/Makefile.in
-+++ b/ld/Makefile.in
-@@ -1072,7 +1072,10 @@ deffilep.h: deffilep.c
- else :; fi
- ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES)
- @rm -f ld-new$(EXEEXT)
-- $(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
-+ # ./ldscripts/* will be read during this link and it messes up the
-+ # link result because ./ldscripts contains the linker script for
-+ # statically linked binaries. So, we temporary rename it.
-+ mv ldscripts ldscripts.tmp && ($(LINK) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS) || (mv bar foo && false)) && mv ldscripts.tmp ldscripts
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT)
diff --git a/ports/binutils/pkg_info b/ports/binutils/pkg_info
deleted file mode 100644
index 14ba035..0000000
--- a/ports/binutils/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=binutils
-VERSION=7dc2f2590
-URL=https://chromium.googlesource.com/native_client/nacl-binutils.git@7dc2f2590
-LICENSE=GPL
-DEPENDS=(nacl-spawn)
-DISABLED_ARCH=(pnacl)
-# arm-nacl-clang asserts in llvm::ARMInstPrinter::printInstruction:
-# https://code.google.com/p/nativeclient/issues/detail?id=4114
-DISABLED_TOOLCHAIN=(clang-newlib/arm emscripten)
-TOOLCHAIN_INSTALL=0
diff --git a/ports/bison/build.sh b/ports/bison/build.sh
deleted file mode 100644
index 2b11a34..0000000
--- a/ports/bison/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2015 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.
-
-EnableCliMain
-EnableGlibcCompat
-
-NACLPORTS_CPPFLAGS+=" -DGNULIB_defined_struct_sigaction"
diff --git a/ports/bison/nacl.patch b/ports/bison/nacl.patch
deleted file mode 100644
index 3166bd7..0000000
--- a/ports/bison/nacl.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -18677,12 +18677,12 @@ _ACEOF
- HAVE_POSIX_SPAWNATTR_T=1;
- HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1;
-
-- REPLACE_POSIX_SPAWN=0;
-- REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0;
-+ REPLACE_POSIX_SPAWN=1;
-+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1;
-
-- REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
-+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1;
-
-- REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
-+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1;
-
-
-
-diff --git a/lib/fpending.c b/lib/fpending.c
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -23,8 +23,10 @@
-
- /* Return the number of pending (aka buffered, unflushed)
- bytes on the stream, FP, that is open for writing. */
-+#if !defined(__native_client__)
- size_t
- __fpending (FILE *fp)
- {
- return PENDING_OUTPUT_N_BYTES;
- }
-+#endif
-diff --git a/lib/sigaction.c b/lib/sigaction.c
---- a/lib/sigaction.c
-+++ b/lib/sigaction.c
-@@ -51,7 +51,7 @@
- with this module should stick with only sigaction(). */
-
- /* Check some of our assumptions. */
--#if defined SIGCHLD || defined HAVE_SIGALTSTACK || defined HAVE_SIGINTERRUPT
-+#if !defined(__native_client__) && (defined SIGCHLD || defined HAVE_SIGALTSTACK || defined HAVE_SIGINTERRUPT)
- # error "Revisit the assumptions made in the sigaction module"
- #endif
-
-@@ -103,10 +103,13 @@ sigaction_handler (int sig)
- asynchronous instance of the same signal occurring before we
- reinstall the handler will trigger the default handler; oh
- well. */
-+
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- handler = action_array[sig].sa_handler;
- if ((action_array[sig].sa_flags & SA_RESETHAND) == 0)
- signal (sig, sigaction_handler);
- else
-+#endif
- action_array[sig].sa_handler = NULL;
-
- /* Block appropriate signals. */
-@@ -171,7 +174,11 @@ sigaction (int sig, const struct sigaction *restrict act,
- if (oact->sa_handler == SIG_ERR)
- goto failure;
- signal (sig, oact->sa_handler);
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ oact->sa_flags = SA_NODEFER;
-+#else
- oact->sa_flags = SA_RESETHAND | SA_NODEFER;
-+#endif
- sigemptyset (&oact->sa_mask);
- }
- }
-diff --git a/lib/spawni.c b/lib/spawni.c
---- a/lib/spawni.c
-+++ b/lib/spawni.c
-@@ -80,6 +80,9 @@
- # define internal_function /* empty */
- #endif
-
-+#if defined(__native_client__)
-+#include <spawn.h>
-+#endif
-
- /* The Unix standard contains a long explanation of the way to signal
- an error after the fork() was successful. Since no new wait status
-@@ -141,6 +144,13 @@ __spawni (pid_t *pid, const char *file,
- const posix_spawnattr_t *attrp, char *const argv[],
- char *const envp[], int use_path)
- {
-+#if defined(__native_client__)
-+ *pid = spawnve(P_NOWAIT, argv[0], argv, envp);
-+ if (*pid < 0) {
-+ return errno;
-+ }
-+ return 0;
-+#else
- pid_t new_pid;
- char *path, *p, *name;
- size_t len;
-@@ -203,7 +213,6 @@ __spawni (pid_t *pid, const char *file,
- if (sigismember (&attrp->_sd, sig) != 0
- && sigaction (sig, &sa, NULL) != 0)
- _exit (SPAWN_ERROR);
--
- }
-
- #if (_LIBC ? defined _POSIX_PRIORITY_SCHEDULING : HAVE_SCHED_SETPARAM && HAVE_SCHED_SETSCHEDULER)
-@@ -369,6 +378,7 @@ __spawni (pid_t *pid, const char *file,
-
- /* Return with an error. */
- _exit (SPAWN_ERROR);
-+#endif
- }
-
- #endif
diff --git a/ports/bison/pkg_info b/ports/bison/pkg_info
deleted file mode 100644
index c1187a9..0000000
--- a/ports/bison/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=bison
-VERSION=3.0.4
-URL=http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.xz
-LICENSE=GPL
-DEPENDS=(m4)
-SHA1=8270497aad88c7dd4f2c317298c50513fb0c3c8e
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/blackbox/build.sh b/ports/blackbox/build.sh
deleted file mode 100644
index ef0d6a5..0000000
--- a/ports/blackbox/build.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXTRA_CONFIGURE_ARGS+=" --with-x"
-EXTRA_CONFIGURE_ARGS+=" --x-includes=${NACLPORTS_INCLUDE}"
-EXTRA_CONFIGURE_ARGS+=" --x-libraries=${NACLPORTS_LIBDIR}"
-
-EXECUTABLES="src/blackbox util/bsetroot util/bstyleconvert"
-
-NACLPORTS_LIBS+=" -liconv -lXext -lXmu -lSM -lICE -lXt -lX11 -lxcb -lXau"
-
-if [[ ${NACL_LIBC} == newlib ]]; then
- # Due to missing sys/ipc.h header
- EXTRA_CONFIGURE_ARGS+=" --disable-mitshm"
-fi
-
-EnableCliMain
-EnableGlibcCompat
diff --git a/ports/blackbox/nacl.patch b/ports/blackbox/nacl.patch
deleted file mode 100644
index 0f88060..0000000
--- a/ports/blackbox/nacl.patch
+++ /dev/null
@@ -1,318 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -20734,7 +20734,7 @@ if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lX11 $LIBS"
-+LIBS="-lX11 -lxcb -lXau $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-diff --git a/lib/Application.cc b/lib/Application.cc
---- a/lib/Application.cc
-+++ b/lib/Application.cc
-@@ -36,7 +36,7 @@
- #endif // SHAPE
-
- #include <sys/types.h>
--#if defined(__EMX__)
-+#if defined(__EMX__) || defined(__native_client__)
- # include <sys/select.h>
- #endif
- #include <sys/time.h>
-diff --git a/lib/Display.cc b/lib/Display.cc
---- a/lib/Display.cc
-+++ b/lib/Display.cc
-@@ -32,6 +32,9 @@
- #include <fcntl.h>
- #include <stdio.h>
-
-+#include <unistd.h>
-+#include <stdlib.h>
-+
-
- namespace bt {
-
-diff --git a/lib/Image.cc b/lib/Image.cc
---- a/lib/Image.cc
-+++ b/lib/Image.cc
-@@ -44,6 +44,7 @@
- #include <math.h>
- #include <stdio.h>
- #include <stdlib.h>
-+#include <string.h>
-
- // #define COLORTABLE_DEBUG
- // #define MITSHM_DEBUG
-diff --git a/lib/Menu.cc b/lib/Menu.cc
---- a/lib/Menu.cc
-+++ b/lib/Menu.cc
-@@ -35,6 +35,7 @@
-
- #include <stdio.h>
- #include <assert.h>
-+#include <stdlib.h>
-
-
- bt::MenuStyle **bt::MenuStyle::styles = 0;
-@@ -363,7 +364,7 @@ unsigned int bt::Menu::insertItem(const MenuItem &item,
- } else {
- index = std::min(static_cast<size_t>(index), _items.size());
- it = _items.begin();
-- std::advance<ItemList::iterator, signed>(it, index);
-+ std::advance(it, index);
- }
-
- it = _items.insert(it, item);
-@@ -514,7 +515,7 @@ void bt::Menu::removeItem(unsigned int id) {
-
- void bt::Menu::removeIndex(unsigned int index) {
- ItemList::iterator it = _items.begin();
-- std::advance<ItemList::iterator, signed>(it, index);
-+ std::advance(it, index);
- if (it == _items.end())
- return; // item not found
- removeItemByIterator(it);
-@@ -1035,7 +1036,7 @@ void bt::Menu::keyPressEvent(const XKeyEvent * const event) {
- const ItemList::const_iterator &end = _items.end();
- ItemList::const_iterator anchor = _items.begin();
- if (_active_index != ~0u) {
-- std::advance<ItemList::const_iterator, signed>(anchor, _active_index);
-+ std::advance(anchor, _active_index);
-
- // go one paste the current active index
- if (anchor != end && !anchor->separator)
-@@ -1055,8 +1056,7 @@ void bt::Menu::keyPressEvent(const XKeyEvent * const event) {
- ItemList::const_reverse_iterator anchor = _items.rbegin();
- const ItemList::const_reverse_iterator &end = _items.rend();
- if (_active_index != ~0u) {
-- std::advance<ItemList::const_reverse_iterator, signed>
-- (anchor, _items.size() - _active_index - 1);
-+ std::advance(anchor, _items.size() - _active_index - 1);
-
- // go one item past the current active index
- if (anchor != end && !anchor->separator)
-diff --git a/lib/Pen.cc b/lib/Pen.cc
---- a/lib/Pen.cc
-+++ b/lib/Pen.cc
-@@ -36,6 +36,7 @@
-
- #include <assert.h>
- #include <stdio.h>
-+#include <stdlib.h>
-
- // #define PENCACHE_DEBUG
-
-diff --git a/lib/Resource.cc b/lib/Resource.cc
---- a/lib/Resource.cc
-+++ b/lib/Resource.cc
-@@ -29,6 +29,7 @@
- #include <X11/Xresource.h>
-
- #include <stdio.h>
-+#include <strings.h>
-
-
- bt::Resource::Resource(void)
-diff --git a/lib/Texture.cc b/lib/Texture.cc
---- a/lib/Texture.cc
-+++ b/lib/Texture.cc
-@@ -31,6 +31,7 @@
-
- #include <X11/Xlib.h>
- #include <ctype.h>
-+#include <stdlib.h>
-
-
- void bt::Texture::setColor1(const bt::Color &new_color) {
-diff --git a/lib/Util.cc b/lib/Util.cc
---- a/lib/Util.cc
-+++ b/lib/Util.cc
-@@ -86,10 +86,12 @@ bool bt::mkdirhier(const std::string &path, int mode)
- before returning.
- */
- // save umask
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- mode_t save_umask = umask(0);
- mode_t tmp_umask = save_umask & ~(S_IWUSR | S_IXUSR);
- bool umask_restored = false;
- (void) umask(tmp_umask);
-+#endif
-
- bool success = true;
- const std::string::const_iterator begin = path.begin();
-@@ -101,8 +103,10 @@ bool bt::mkdirhier(const std::string &path, int mode)
- }
- it = std::find(it + 1, end, '/');
- if (it == end || (it + 1) == end) {
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- (void) umask(save_umask);
- umask_restored = true;
-+#endif
- // make sure we use the right mode to mkdir(2)
- it = end;
- }
-@@ -123,9 +127,11 @@ bool bt::mkdirhier(const std::string &path, int mode)
- }
- }
-
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- // restore umask
- if (!umask_restored)
- (void) umask(save_umask);
-+#endif
-
- return success;
- }
-diff --git a/lib/Util.hh b/lib/Util.hh
---- a/lib/Util.hh
-+++ b/lib/Util.hh
-@@ -25,6 +25,8 @@
- #ifndef __Util_hh
- #define __Util_hh
-
-+#include <X11/Xlib.h>
-+#include <X11/Xutil.h>
- #include <limits.h>
- #include <string>
-
-@@ -94,10 +96,10 @@ namespace bt {
-
- std::string tolower(const std::string &string);
-
--#ifdef _XUTIL_H_
-+//#ifdef _XUTIL_H_
- std::string textPropertyToString(::Display *display,
- ::XTextProperty& text_prop);
--#endif
-+//#endif
-
- } // namespace bt
-
-diff --git a/lib/XDG.cc b/lib/XDG.cc
---- a/lib/XDG.cc
-+++ b/lib/XDG.cc
-@@ -26,6 +26,7 @@
- #include "XDG.hh"
-
- #include <stdlib.h>
-+#include <algorithm>
-
-
- // make sure directory names end with a slash
-diff --git a/src/BlackboxResource.cc b/src/BlackboxResource.cc
---- a/src/BlackboxResource.cc
-+++ b/src/BlackboxResource.cc
-@@ -33,6 +33,7 @@
- #include <X11/Xutil.h>
- #include <X11/cursorfont.h>
-
-+#include <strings.h>
-
- BlackboxResource::BlackboxResource(const std::string& rc): rc_file(rc) {
- screen_resources = 0;
-diff --git a/src/Screen.cc b/src/Screen.cc
---- a/src/Screen.cc
-+++ b/src/Screen.cc
-@@ -47,6 +47,7 @@
- #include <assert.h>
- #include <ctype.h>
- #include <dirent.h>
-+#include <string.h>
-
-
- static bool running = true;
-diff --git a/src/ScreenResource.cc b/src/ScreenResource.cc
---- a/src/ScreenResource.cc
-+++ b/src/ScreenResource.cc
-@@ -32,6 +32,7 @@
- #include <Resource.hh>
-
- #include <assert.h>
-+#include <strings.h>
-
-
- static const int iconify_width = 9;
-diff --git a/src/Toolbar.cc b/src/Toolbar.cc
---- a/src/Toolbar.cc
-+++ b/src/Toolbar.cc
-@@ -39,12 +39,15 @@
- #include <sys/time.h>
- #include <assert.h>
-
-+#include <time.h>
-+#include <algorithm>
-+
-
- long nextTimeout(int resolution)
- {
- timeval now;
- gettimeofday(&now, 0);
-- return (std::max(1000l, ((((resolution - (now.tv_sec % resolution)) * 1000l))
-+ return (std::max((time_t)1000l, ((((resolution - (now.tv_sec % resolution)) * 1000l))
- - (now.tv_usec / 1000l))));
- }
-
-diff --git a/src/Window.cc b/src/Window.cc
---- a/src/Window.cc
-+++ b/src/Window.cc
-@@ -43,6 +43,7 @@
- #endif
-
- #include <assert.h>
-+#include <stdlib.h>
-
- /*
- sometimes C++ is a pain in the ass... it gives us stuff like the
-@@ -3519,11 +3520,11 @@ void BlackboxWindow::motionNotifyEvent(const XMotionEvent * const event) {
- else
- continueMove(event->x_root, event->y_root);
- } else if (hasWindowFunction(WindowFunctionResize)
-- && (event->state & Button1Mask
-+ && ((event->state & Button1Mask)
- && (event->window == frame.right_grip
- || event->window == frame.left_grip))
-- || (event->state & Button3Mask
-- && event->state & Mod1Mask
-+ || ((event->state & Button3Mask)
-+ && (event->state & Mod1Mask)
- && event->window == frame.window)) {
- if (!client.state.resizing)
- startResize(event->window);
-diff --git a/src/blackbox.cc b/src/blackbox.cc
---- a/src/blackbox.cc
-+++ b/src/blackbox.cc
-@@ -37,6 +37,7 @@
- #include <assert.h>
- #include <signal.h>
- #include <unistd.h>
-+#include <stdlib.h>
-
- // #define FOCUS_DEBUG
- #ifdef FOCUS_DEBUG
-diff --git a/src/main.cc b/src/main.cc
---- a/src/main.cc
-+++ b/src/main.cc
-@@ -35,6 +35,8 @@
- #include "../version.h"
-
- #include <stdio.h>
-+#include <string.h>
-+#include <stdlib.h>
-
-
- static void showHelp(int exitval) {
-diff --git a/util/bsetroot.cc b/util/bsetroot.cc
---- a/util/bsetroot.cc
-+++ b/util/bsetroot.cc
-@@ -31,6 +31,8 @@
-
- #include <X11/Xatom.h>
- #include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-
-
- // ignore all X errors
diff --git a/ports/blackbox/pkg_info b/ports/blackbox/pkg_info
deleted file mode 100644
index e893d91..0000000
--- a/ports/blackbox/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=blackbox
-VERSION=0.70.1
-URL=http://download.sf.net/blackboxwm/blackboxwm/Blackbox%200.70.1/blackbox-0.70.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat xbitmaps libx11 libxcb libxmu libxext libxau libxt libice libsm nacl-spawn libiconv)
-SHA1=66455b8400d6659b5681c290a5ced3697d199955
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/blis/build.sh b/ports/blis/build.sh
deleted file mode 100644
index 0955d6a..0000000
--- a/ports/blis/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2014 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.
-
-ConfigureStep() {
- SetupCrossEnvironment
- LogExecute ${SRC_DIR}/configure -p ${INSTALL_DIR}/payload pnacl
-}
-
-InstallStep() {
- LogExecute make install
-}
-
-TestStep() {
- SetupCrossEnvironment
- LogExecute make test
-}
diff --git a/ports/blis/nacl.patch b/ports/blis/nacl.patch
deleted file mode 100644
index 500cc79..0000000
--- a/ports/blis/nacl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/testsuite/input.general b/testsuite/input.general
---- a/testsuite/input.general
-+++ b/testsuite/input.general
-@@ -25,7 +25,7 @@ sdcz # Datatype(s) to test:
- 100 # Problem size: increment between experiments
- 1 # Error-checking level:
- # '0' = disable error checking; '1' = full error checking
--i # Reaction to test failure:
-+a # Reaction to test failure:
- # 'i' = ignore; 's' = sleep() and continue; 'a' = abort
- 0 # Output results in matlab/octave format? ('1' = yes; '0' = no)
- 0 # Output results to stdout AND files? ('1' = yes; '0' = no)
-diff --git a/testsuite/input.operations b/testsuite/input.operations
---- a/testsuite/input.operations
-+++ b/testsuite/input.operations
-@@ -198,7 +198,7 @@
-
- 1 # dotaxpyv
- 1 # test sequential front-end
---1 # dimensions: m
-+100 # dimensions: m
- ??? # parameters: conjxt conjx conjy
-
- 1 # axpyf
diff --git a/ports/blis/pkg_info b/ports/blis/pkg_info
deleted file mode 100644
index c01eae6..0000000
--- a/ports/blis/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=blis
-VERSION=0.1.5
-URL=http://github.com/flame/blis/archive/0.1.5/blis-0.1.5.tar.gz
-LICENSE=BSD:LICENSE
-ARCH=pnacl
-SHA1=b11010ece9f1fdd1625b6e62edd2c927fa8a265c
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/bochs/bochs.html b/ports/bochs/bochs.html
deleted file mode 100644
index 84aa620..0000000
--- a/ports/bochs/bochs.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-
- <!--
- Copyright 2011 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.
- -->
-
- <head>
- <title>Bochs NaCl Demo</title>
- </head>
-
- <body id="bodyId" >
-
- <h1>Bochs Native Client Demo</h1>
-
- <center>
- <embed name="nacl_module"
- sdl_mount_http=".:/mnt/http"
- sdl_tar_extract="/mnt/http/img.tar:/img"
- id="bochs"
- width=720 height=720
- src="bochs.nmf"
- type="application/x-nacl" />
- </center>
-
- <br />
-
- </body>
-
-</html>
diff --git a/ports/bochs/bochsrc b/ports/bochs/bochsrc
deleted file mode 100644
index 53b23f9..0000000
--- a/ports/bochs/bochsrc
+++ /dev/null
@@ -1,11 +0,0 @@
-megs: 32
-romimage: file=BIOS-bochs-latest
-vgaromimage: file=VGABIOS-lgpl-latest
-vga: extension=vbe
-floppya: 1_44=a.img, status=inserted
-floppyb: 1_44=b.img, status=inserted
-ata0-master: type=disk, path=linux-img/minibootable.img, cylinders=900, heads=15, spt=17
-boot: c
-log: bochsout.txt
-mouse: enabled=1
-clock: sync=slowdown
diff --git a/ports/bochs/build.sh b/ports/bochs/build.sh
deleted file mode 100644
index 1762c66..0000000
--- a/ports/bochs/build.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-# 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.
-
-# Linux disk image
-readonly LINUX_IMG_URL=http://storage.googleapis.com/nativeclient-mirror/nacl/bochs-linux-img.tar.gz
-readonly LINUX_IMG_NAME=linux-img
-readonly LINUX_IMG_SHA1=70131438bd90534fa045c737017a2ca9a437bf5d
-
-BOCHS_EXAMPLE_DIR=${NACL_SRC}/ports/bochs
-EXECUTABLES=bochs
-
-ConfigureStep() {
- SetupCrossEnvironment
-
- EXE=${NACL_EXEEXT} LogExecute ${SRC_DIR}/configure \
- --host=nacl \
- --prefix=${PREFIX} \
- --with-x=no \
- --with-x11=no \
- --with-sdl=yes \
- --with-gnu-ld
-}
-
-# $1 - filename
-# $2 - root directory of archive
-ImageExtractStep() {
- Banner "Untaring $1 to $2"
- ChangeDir ${WORK_DIR}
- Remove $2
- if [ $OS_SUBDIR = "windows" ]; then
- tar --no-same-owner -zxf ${NACL_PACKAGES_CACHE}/$1
- else
- tar zxf ${NACL_PACKAGES_CACHE}/$1
- fi
-}
-
-BuildStep() {
- # boch's Makefile runs sdl-config so we need to cross envrionment setup
- # during build as well as configure.
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-InstallStep() {
- ChangeDir ${SRC_DIR}
- mkdir -p img/usr/local/share/bochs/
- cp -r ${WORK_DIR}/${LINUX_IMG_NAME} img/
- mv img/linux-img/bochsrc old-bochsrc
- cp ${START_DIR}/bochsrc img/linux-img/bochsrc
- cp -r ${SRC_DIR}/bios/VGABIOS-lgpl-latest img/
- cp -r ${SRC_DIR}/bios/BIOS-bochs-latest img/
- cp -r ${SRC_DIR}/msrs.def img/
-
- MakeDir ${PUBLISH_DIR}
-
- cd img
- tar cf ${PUBLISH_DIR}/img.tar .
- cd ..
-
- LogExecute cp ${START_DIR}/bochs.html ${PUBLISH_DIR}
- LogExecute cp ${BUILD_DIR}/bochs ${PUBLISH_DIR}/bochs_${NACL_ARCH}${NACL_EXEEXT}
-
- if [ ${NACL_ARCH} = pnacl ]; then
- sed -i.bak 's/x-nacl/x-pnacl/g' ${PUBLISH_DIR}/bochs.html
- fi
-
- pushd ${PUBLISH_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- bochs*${NACL_EXEEXT} \
- -s . \
- -o bochs.nmf
- popd
-}
-
-# $1 - url
-# $2 - filename
-# $3 - sha1
-ImageDownloadStep() {
- cd ${NACL_PACKAGES_CACHE}
- # if matching tarball already exists, don't download again
- if ! CheckHash $2 $3; then
- Fetch $1 $2
- if ! CheckHash $2 $3 ; then
- Banner "$2 failed checksum!"
- exit -1
- fi
- fi
-}
-
-DownloadStep() {
- ImageDownloadStep ${LINUX_IMG_URL} ${LINUX_IMG_NAME}.tar.gz ${LINUX_IMG_SHA1}
- ImageExtractStep ${LINUX_IMG_NAME}.tar.gz ${LINUX_IMG_NAME}
-}
diff --git a/ports/bochs/nacl.patch b/ports/bochs/nacl.patch
deleted file mode 100644
index d637943..0000000
--- a/ports/bochs/nacl.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -83,6 +83,7 @@ SHELL = @SHELL@
-
- @SET_MAKE@
-
-+AR = @AR@
- CC = @CC@
- CXX = @CXX@
- CFLAGS = @CFLAGS@ @GUI_CFLAGS@ $(MCH_CFLAGS) $(FLA_FLAGS) @DEFINE_PLUGIN_PATH@ -DBX_SHARE_PATH='"$(sharedir)"'
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -24619,6 +24619,9 @@ fi
- DIALOG_OBJS=""
- EXPORT_DYNAMIC="-export-dynamic"
- case $target in
-+ *nacl*)
-+ EXPORT_DYNAMIC=""
-+ ;;
- *-pc-windows* | *-pc-winnt*)
- if test "$bx_plugins" = 1; then
- # set variables for building DLL plugins
-diff --git a/cpu/init.cc b/cpu/init.cc
---- a/cpu/init.cc
-+++ b/cpu/init.cc
-@@ -111,6 +111,7 @@ void BX_CPU_C::initialize(void)
- BX_CPU_THIS_PTR msrs[n] = 0;
- }
- const char *msrs_filename = SIM->get_param_string(BXPN_CONFIGURABLE_MSRS_PATH)->getptr();
-+ msrs_filename = "/img/msrs.def";
- load_MSRs(msrs_filename);
- #endif
-
-diff --git a/iodev/hdimage/vvfat.cc b/iodev/hdimage/vvfat.cc
---- a/iodev/hdimage/vvfat.cc
-+++ b/iodev/hdimage/vvfat.cc
-@@ -1554,7 +1554,9 @@ bx_bool vvfat_image_t::write_file(const char *path, direntry_t *entry, bx_bool c
- } else {
- ut.actime = ut.modtime;
- }
-+# if !defined(__native_client__)
- utime(path, &ut);
-+# endif
- #else
- hFile = CreateFile(path, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (hFile != INVALID_HANDLE_VALUE) {
-diff --git a/main.cc b/main.cc
---- a/main.cc
-+++ b/main.cc
-@@ -473,6 +473,12 @@ int WINAPI WinMain(
- // wxWidgets under win32.
- int CDECL main(int argc, char *argv[])
- {
-+#if defined(__native_client__)
-+ chdir("/img");
-+ const char* fake_argv[] = {"bochs", "-qf", "linux-img/bochsrc", NULL};
-+ argv = (char**)fake_argv;
-+ argc = 3;
-+#endif
- bx_startup_flags.argc = argc;
- bx_startup_flags.argv = argv;
- #ifdef WIN32
-@@ -1341,7 +1347,7 @@ void bx_init_hardware()
- #endif
-
- #if BX_SHOW_IPS
--#if !defined(WIN32)
-+#if !defined(WIN32) && !defined(__native_client__)
- if (!SIM->is_wx_selected()) {
- signal(SIGALRM, bx_signal_handler);
- alarm(1);
-@@ -1387,7 +1393,7 @@ int bx_atexit(void)
- #endif
-
- #if BX_SHOW_IPS
--#if !defined(__MINGW32__) && !defined(_MSC_VER)
-+#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__native_client__)
- if (!SIM->is_wx_selected()) {
- alarm(0);
- signal(SIGALRM, SIG_DFL);
-@@ -1448,7 +1454,7 @@ void CDECL bx_signal_handler(int signum)
- #if BX_SHOW_IPS
- if (signum == SIGALRM) {
- bx_show_ips_handler();
--#if !defined(WIN32)
-+#if !defined(WIN32) && !defined(__native_client__)
- if (!SIM->is_wx_selected()) {
- signal(SIGALRM, bx_signal_handler);
- alarm(1);
diff --git a/ports/bochs/pkg_info b/ports/bochs/pkg_info
deleted file mode 100644
index ee4e4da..0000000
--- a/ports/bochs/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=bochs
-VERSION=2.6.2
-URL=http://downloads.sf.net/bochs/bochs/2.6.2/bochs-2.6.2.tar.gz
-LICENSE=LGPL
-DEPENDS=(sdl)
-# Disabled on mac because build system tries to use system 'ar'
-BUILD_OS=linux
-SHA1=f82ee01a52367d2a6daffa2774a1297b978f6821
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/boost/build.sh b/ports/boost/build.sh
deleted file mode 100644
index f72b2e1..0000000
--- a/ports/boost/build.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright (c) 2011 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.
-
-BUILD_DIR=${SRC_DIR}
-
-EnableGlibcCompat
-
-if [ "${TOOLCHAIN}" = "pnacl" -o "${TOOLCHAIN}" = "clang-newlib" ]; then
- # TODO(sbc): Should probably use clang here
- COMPILER=gcc
-else
- COMPILER=gcc
-fi
-
-if [ "${TOOLCHAIN}" = "pnacl" -o "${TOOLCHAIN}" = "clang-newlib" ]; then
- COMPILER_VERSION=3.6
-elif [ "${NACL_ARCH}" = "arm" ]; then
- COMPILER_VERSION=4.8
-else
- COMPILER_VERSION=4.4.3
-fi
-
-# TODO(eugenis): build dynamic libraries, too
-BUILD_ARGS="
- toolset=${COMPILER}
- target-os=unix
- --build-dir=../${NACL_BUILD_SUBDIR}
- --stagedir=../${NACL_BUILD_SUBDIR}
- link=static"
-
-BUILD_ARGS+=" --without-python"
-BUILD_ARGS+=" --without-signals"
-BUILD_ARGS+=" --without-mpi"
-BUILD_ARGS+=" --without-context"
-BUILD_ARGS+=" --without-coroutine"
-
-if [ "${NACL_LIBC}" != "glibc" ] ; then
- BUILD_ARGS+=" --without-locale"
- BUILD_ARGS+=" --without-log"
- BUILD_ARGS+=" --without-test"
- BUILD_ARGS+=" --without-timer"
-
-fi
-
-if [ "${NACL_ARCH}" = "arm" -o "${NACL_ARCH}" = "pnacl" ]; then
- # The ARM toolchains are not currently built with full C++ threading support
- # (_GLIBCXX_HAS_GTHREADS is not defined)
- # PNaCl currently doesn't support -x c++-header which threading library
- # tries to use during the build.
- BUILD_ARGS+=" --without-math"
- BUILD_ARGS+=" --without-thread"
- BUILD_ARGS+=" --without-wave"
-fi
-
-ConfigureStep() {
- flags=
- for flag in ${NACLPORTS_CPPFLAGS}; do
- flags+=" <compileflags>${flag}"
- done
- conf="using ${COMPILER} : ${COMPILER_VERSION} : ${NACLCXX} :${flags} ;"
- echo $conf > tools/build/v2/user-config.jam
- LogExecute ./bootstrap.sh --prefix=${NACL_PREFIX}
-}
-
-BuildStep() {
- LogExecute ./b2 stage -j ${OS_JOBS} ${BUILD_ARGS}
-}
-
-InstallStep() {
- LogExecute ./b2 install -d0 --prefix=${DESTDIR}/${PREFIX} ${BUILD_ARGS}
-}
diff --git a/ports/boost/nacl.patch b/ports/boost/nacl.patch
deleted file mode 100644
index 1f659b6..0000000
--- a/ports/boost/nacl.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-diff --git a/boost/config/platform/nacl.hpp b/boost/config/platform/nacl.hpp
-new file mode 100644
---- /dev/null
-+++ b/boost/config/platform/nacl.hpp
-@@ -0,0 +1,82 @@
-+// Copyright (c) 2013 The Native Client Authors.
-+// Use, modification and distribution are subject to the
-+// Boost Software License, Version 1.0. (See accompanying file
-+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-+
-+// See http://www.boost.org for most recent version.
-+
-+// Native Client specific config options:
-+
-+#define BOOST_PLATFORM "nacl"
-+
-+// make sure we have __GLIBC_PREREQ if available at all
-+#ifdef __cplusplus
-+#include <cstdlib>
-+#else
-+#include <stdlib.h>
-+#endif
-+
-+#define BOOST_HAS_STDINT_H
-+#define BOOST_HAS_GETTIMEOFDAY
-+#define BOOST_HAS_NANOSLEEP
-+
-+#if defined(__LIBCOMO__)
-+ //
-+ // como on linux doesn't have std:: c functions:
-+ // NOTE: versions of libcomo prior to beta28 have octal version numbering,
-+ // e.g. version 25 is 21 (dec)
-+ //
-+# if __LIBCOMO_VERSION__ <= 20
-+# define BOOST_NO_STDC_NAMESPACE
-+# endif
-+
-+# if __LIBCOMO_VERSION__ <= 21
-+# define BOOST_NO_SWPRINTF
-+# endif
-+
-+#endif
-+
-+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-+// __GLIBC_PREREQ is available since 2.1.2
-+
-+ // swprintf is available since glibc 2.2.0
-+# if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98))
-+# define BOOST_NO_SWPRINTF
-+# endif
-+#else
-+# define BOOST_NO_SWPRINTF
-+#endif
-+
-+// boilerplate code:
-+#define BOOST_HAS_UNISTD_H
-+#include <boost/config/posix_features.hpp>
-+#ifdef _NEWLIB_VERSION
-+ #define BOOST_HAS_SCHED_YIELD
-+ #define BOOST_HAS_PTHREADS
-+#endif
-+
-+#ifndef __GNUC__
-+//
-+// if the compiler is not gcc we still need to be able to parse
-+// the GNU system headers, some of which (mainly <stdint.h>)
-+// use GNU specific extensions:
-+//
-+# ifndef __extension__
-+# define __extension__
-+# endif
-+# ifndef __const__
-+# define __const__ const
-+# endif
-+# ifndef __volatile__
-+# define __volatile__ volatile
-+# endif
-+# ifndef __signed__
-+# define __signed__ signed
-+# endif
-+# ifndef __typeof__
-+# define __typeof__ typeof
-+# endif
-+# ifndef __inline__
-+# define __inline__ inline
-+# endif
-+#endif
-diff --git a/boost/config/select_platform_config.hpp b/boost/config/select_platform_config.hpp
---- a/boost/config/select_platform_config.hpp
-+++ b/boost/config/select_platform_config.hpp
-@@ -76,6 +76,10 @@
- #elif defined(__VMS)
- // VMS:
- # define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp"
-+
-+#elif defined(__native_client__)
-+// Native Client:
-+# define BOOST_PLATFORM_CONFIG "boost/config/platform/nacl.hpp"
- #else
-
- # if defined(unix) \
-diff --git a/boost/log/detail/light_rw_mutex.hpp b/boost/log/detail/light_rw_mutex.hpp
---- a/boost/log/detail/light_rw_mutex.hpp
-+++ b/boost/log/detail/light_rw_mutex.hpp
-@@ -26,6 +26,7 @@
-
- #include <boost/log/detail/header.hpp>
-
-+#ifndef _NEWLIB_VERSION
- #if defined(BOOST_THREAD_POSIX) // This one can be defined by users, so it should go first
- #define BOOST_LOG_LWRWMUTEX_USE_PTHREAD
- #elif defined(BOOST_WINDOWS) && defined(BOOST_LOG_USE_WINNT6_API)
-@@ -33,6 +34,7 @@
- #elif defined(BOOST_HAS_PTHREADS)
- #define BOOST_LOG_LWRWMUTEX_USE_PTHREAD
- #endif
-+#endif
-
- #if defined(BOOST_LOG_LWRWMUTEX_USE_SRWLOCK)
-
-diff --git a/libs/system/src/error_code.cpp b/libs/system/src/error_code.cpp
---- a/libs/system/src/error_code.cpp
-+++ b/libs/system/src/error_code.cpp
-@@ -101,7 +101,7 @@ namespace
- char buf[64];
- char * bp = buf;
- std::size_t sz = sizeof(buf);
-- # if defined(__CYGWIN__) || defined(__USE_GNU)
-+ # if defined(__CYGWIN__) || defined(__USE_GNU) || defined _NEWLIB_VERSION
- // Oddball version of strerror_r
- const char * c_str = strerror_r( ev, bp, sz );
- return c_str
-@@ -251,7 +251,9 @@ namespace
- case ENOTEMPTY: return make_error_condition( directory_not_empty );
- # endif // ENOTEMPTY != EEXIST
- # if ENOTRECOVERABLE != ECONNRESET // the same on some Broadcom chips
-+ # ifndef __pnacl__
- case ENOTRECOVERABLE: return make_error_condition( state_not_recoverable );
-+ # endif
- # endif // ENOTRECOVERABLE != ECONNRESET
- case ENOTSOCK: return make_error_condition( not_a_socket );
- case ENOTSUP: return make_error_condition( not_supported );
-@@ -262,7 +264,9 @@ namespace
- # endif // EOPNOTSUPP != ENOTSUP
- case EOVERFLOW: return make_error_condition( value_too_large );
- # if EOWNERDEAD != ECONNABORTED // the same on some Broadcom chips
-+ # ifndef __pnacl__
- case EOWNERDEAD: return make_error_condition( owner_dead );
-+ # endif
- # endif // EOWNERDEAD != ECONNABORTED
- case EPERM: return make_error_condition( operation_not_permitted );
- case EPIPE: return make_error_condition( broken_pipe );
-diff --git a/tools/build/v2/tools/gcc.jam b/tools/build/v2/tools/gcc.jam
---- a/tools/build/v2/tools/gcc.jam
-+++ b/tools/build/v2/tools/gcc.jam
-@@ -1032,7 +1032,7 @@ rule setup-threading ( targets * : sources * : properties * )
- case *bsd : option = -pthread ; # There is no -lrt on BSD.
- case sgi : # gcc on IRIX does not support multi-threading.
- case darwin : # No threading options.
-- case * : option = -pthread ; libs = rt ;
-+ case * : option = -pthread ;
- }
-
- if $(option)
diff --git a/ports/boost/pkg_info b/ports/boost/pkg_info
deleted file mode 100644
index 3571949..0000000
--- a/ports/boost/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=boost
-VERSION=1.55.0
-URL=http://downloads.sf.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2
-ARCHIVE_ROOT=boost_1_55_0
-LICENSE=CUSTOM:LICENSE_1_0.txt
-DEPENDS=(glibc-compat zlib bzip2)
-BUILD_OS=linux
-# ICE in glibc/arm toolchain:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
-SHA1=cef9a0cc7084b1d639e06cd3bc34e4251524c840
diff --git a/ports/boringssl/build.sh b/ports/boringssl/build.sh
deleted file mode 100644
index 5b05c8f..0000000
--- a/ports/boringssl/build.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="
-crypto/base64/base64_test
-crypto/bio/bio_test
-crypto/bn/bn_test
-crypto/bytestring/bytestring_test
-crypto/cipher/aead_test
-crypto/cipher/aead_test
-crypto/cipher/aead_test
-crypto/cipher/aead_test
-crypto/cipher/aead_test
-crypto/cipher/aead_test
-crypto/cipher/cipher_test
-crypto/dh/dh_test
-crypto/digest/digest_test
-crypto/dsa/dsa_test
-crypto/ec/example_mul
-crypto/ecdsa/ecdsa_test
-crypto/err/err_test
-crypto/evp/evp_test
-crypto/hmac/hmac_test
-crypto/lhash/lhash_test
-crypto/modes/gcm_test
-crypto/pkcs8/pkcs12_test
-crypto/rsa/rsa_test
-crypto/x509/pkcs7_test
-crypto/x509v3/tab_test
-crypto/x509v3/v3name_test
-ssl/pqueue/pqueue_test
-ssl/ssl_test
-"
-
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}/openssl
- LogExecute install crypto/libcrypto.a ${DESTDIR_LIB}/
- LogExecute install ${SRC_DIR}/include/openssl/* -t ${DESTDIR_INCLUDE}/openssl
-}
-
-TestStep() {
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- return
- fi
- LogExecute ssl/ssl_test.sh
- # TODO(sbc): Investigate test failure in digest_test
- #LogExecute crypto/digest/digest_test.sh
-
- # all_tests was converted to go, and we don't have the go toolchain
- # as a prerequiste.
- #bash ../boringssl-git/util/all_tests.sh ../boringssl-git/ .sh
-}
diff --git a/ports/boringssl/nacl.patch b/ports/boringssl/nacl.patch
deleted file mode 100644
index 2c4b143..0000000
--- a/ports/boringssl/nacl.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -16,9 +16,9 @@ if (NOT GO_EXECUTABLE)
- message(FATAL_ERROR "Could not find Go")
- endif()
-
--if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_SYSTEM_PROCESSOR MATCHES "pnacl")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden")
-- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wsign-compare -Wmissing-field-initializers -ggdb -std=c++0x -fvisibility=hidden")
-+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wsign-compare -Wmissing-field-initializers -ggdb -std=gnu++0x -fvisibility=hidden")
- elseif(MSVC)
- set(MSVC_DISABLED_WARNINGS_LIST
- "C4100" # 'exarg' : unreferenced formal parameter
-@@ -91,6 +91,15 @@ if(FUZZ)
- link_directories(.)
- endif()
-
-+if (NACL)
-+ add_definitions(-DOPENSSL_NO_ASM)
-+ if (NACL_LIBC STREQUAL newlib)
-+ link_libraries(glibc-compat)
-+ endif()
-+ SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
-+ SET(CMAKE_C_FLAGS_RELEASE "-O2")
-+endif()
-+
- add_definitions(-DBORINGSSL_IMPLEMENTATION)
-
- if (BUILD_SHARED_LIBS)
-@@ -125,6 +134,8 @@ elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7-a")
- set(ARCH "arm")
- elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
- set(ARCH "aarch64")
-+elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "pnacl")
-+ set(ARCH "pnacl")
- else()
- message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
- endif()
-@@ -155,7 +166,9 @@ add_custom_target(all_tests)
- add_subdirectory(crypto)
- add_subdirectory(ssl)
- add_subdirectory(ssl/test)
--add_subdirectory(tool)
-+if (NOT NACL)
-+ add_subdirectory(tool)
-+endif()
- add_subdirectory(decrepit)
-
- if(FUZZ)
-diff --git a/crypto/bio/printf.c b/crypto/bio/printf.c
---- a/crypto/bio/printf.c
-+++ b/crypto/bio/printf.c
-@@ -58,6 +58,12 @@
- #define _POSIX_C_SOURCE 201410L /* for snprintf, vprintf etc */
- #endif
-
-+#if defined(__native_client__) && !defined(__pnacl__)
-+/* native client toolchains fail to define vsnprintf/strdup/etc if only
-+ * _POSIX_C_SOURCE is defined */
-+#define _GNU_SOURCE 1
-+#endif
-+
- #include <openssl/bio.h>
-
- #include <assert.h>
-diff --git a/crypto/lhash/lhash_test.c b/crypto/lhash/lhash_test.c
---- a/crypto/lhash/lhash_test.c
-+++ b/crypto/lhash/lhash_test.c
-@@ -16,6 +16,12 @@
- #define _POSIX_C_SOURCE 201410L
- #endif
-
-+#if defined(__native_client__) && !defined(__pnacl__)
-+/* native client toolchains fail to define vsnprintf/strdup/etc if only
-+ * _POSIX_C_SOURCE is defined */
-+#define _GNU_SOURCE 1
-+#endif
-+
- #include <openssl/crypto.h>
- #include <openssl/lhash.h>
-
-diff --git a/crypto/mem.c b/crypto/mem.c
---- a/crypto/mem.c
-+++ b/crypto/mem.c
-@@ -58,6 +58,12 @@
- #define _POSIX_C_SOURCE 201410L /* needed for strdup, snprintf, vprintf etc */
- #endif
-
-+#if defined(__native_client__) && !defined(__pnacl__)
-+/* native client toolchains fail to define vsnprintf/strdup/etc if only
-+ * _POSIX_C_SOURCE is defined */
-+#define _GNU_SOURCE 1
-+#endif
-+
- #include <openssl/mem.h>
-
- #include <assert.h>
-diff --git a/crypto/poly1305/poly1305.c b/crypto/poly1305/poly1305.c
---- a/crypto/poly1305/poly1305.c
-+++ b/crypto/poly1305/poly1305.c
-@@ -23,7 +23,7 @@
- #include <openssl/cpu.h>
-
-
--#if defined(OPENSSL_WINDOWS) || !defined(OPENSSL_X86_64)
-+#if defined(OPENSSL_WINDOWS) || !defined(OPENSSL_X86_64) || defined(OPENSSL_NO_ASM)
-
- #if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || defined(OPENSSL_ARM)
- /* We can assume little-endian. */
-diff --git a/crypto/poly1305/poly1305_vec.c b/crypto/poly1305/poly1305_vec.c
---- a/crypto/poly1305/poly1305_vec.c
-+++ b/crypto/poly1305/poly1305_vec.c
-@@ -21,7 +21,7 @@
- #include <openssl/poly1305.h>
-
-
--#if !defined(OPENSSL_WINDOWS) && defined(OPENSSL_X86_64)
-+#if !defined(OPENSSL_WINDOWS) && !defined(__native_client__) && defined(OPENSSL_X86_64)
-
- #include <emmintrin.h>
-
-diff --git a/crypto/rand/urandom.c b/crypto/rand/urandom.c
---- a/crypto/rand/urandom.c
-+++ b/crypto/rand/urandom.c
-@@ -81,6 +81,7 @@ static void init_once(void) {
- abort();
- }
-
-+#ifndef __native_client__
- int flags = fcntl(fd, F_GETFD);
- if (flags == -1) {
- abort();
-@@ -89,6 +90,7 @@ static void init_once(void) {
- if (fcntl(fd, F_SETFD, flags) == -1) {
- abort();
- }
-+#endif
- urandom_fd = fd;
- }
-
-diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c
---- a/crypto/sha/sha512.c
-+++ b/crypto/sha/sha512.c
-@@ -241,7 +241,7 @@ int SHA512_Final(uint8_t *md, SHA512_CTX *sha) {
- p[n] = 0x80; /* There always is a room for one */
- n++;
- if (n > (sizeof(sha->u) - 16)) {
-- memset(p + n, 0, sizeof(sha->u) - n);
-+ /*memset(p + n, 0, sizeof(sha->u) - n);*/
- n = 0;
- sha512_block_data_order(sha->h, (uint64_t *)p, 1);
- }
-@@ -314,33 +314,46 @@ int SHA512_Final(uint8_t *md, SHA512_CTX *sha) {
-
- #ifndef SHA512_ASM
- static const uint64_t K512[80] = {
-- 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f,
-- 0xe9b5dba58189dbbc, 0x3956c25bf348b538, 0x59f111f1b605d019,
-- 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, 0xd807aa98a3030242,
-- 0x12835b0145706fbe, 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2,
-- 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235,
-- 0xc19bf174cf692694, 0xe49b69c19ef14ad2, 0xefbe4786384f25e3,
-- 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, 0x2de92c6f592b0275,
-- 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5,
-- 0x983e5152ee66dfab, 0xa831c66d2db43210, 0xb00327c898fb213f,
-- 0xbf597fc7beef0ee4, 0xc6e00bf33da88fc2, 0xd5a79147930aa725,
-- 0x06ca6351e003826f, 0x142929670a0e6e70, 0x27b70a8546d22ffc,
-- 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df,
-- 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6,
-- 0x92722c851482353b, 0xa2bfe8a14cf10364, 0xa81a664bbc423001,
-- 0xc24b8b70d0f89791, 0xc76c51a30654be30, 0xd192e819d6ef5218,
-- 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8,
-- 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 0x2748774cdf8eeb99,
-- 0x34b0bcb5e19b48a8, 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb,
-- 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3, 0x748f82ee5defb2fc,
-- 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec,
-- 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915,
-- 0xc67178f2e372532b, 0xca273eceea26619c, 0xd186b8c721c0c207,
-- 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, 0x06f067aa72176fba,
-- 0x0a637dc5a2c898a6, 0x113f9804bef90dae, 0x1b710b35131c471b,
-- 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc,
-- 0x431d67c49c100d4c, 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a,
-- 0x5fcb6fab3ad6faec, 0x6c44198c4a475817};
-+ UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd),
-+ UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc),
-+ UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019),
-+ UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118),
-+ UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe),
-+ UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2),
-+ UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1),
-+ UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694),
-+ UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3),
-+ UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65),
-+ UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483),
-+ UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5),
-+ UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210),
-+ UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4),
-+ UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725),
-+ UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70),
-+ UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926),
-+ UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df),
-+ UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8),
-+ UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b),
-+ UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001),
-+ UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30),
-+ UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910),
-+ UINT64_C(0xf40e35855771202a), UINT64_C(0x106aa07032bbd1b8),
-+ UINT64_C(0x19a4c116b8d2d0c8), UINT64_C(0x1e376c085141ab53),
-+ UINT64_C(0x2748774cdf8eeb99), UINT64_C(0x34b0bcb5e19b48a8),
-+ UINT64_C(0x391c0cb3c5c95a63), UINT64_C(0x4ed8aa4ae3418acb),
-+ UINT64_C(0x5b9cca4f7763e373), UINT64_C(0x682e6ff3d6b2b8a3),
-+ UINT64_C(0x748f82ee5defb2fc), UINT64_C(0x78a5636f43172f60),
-+ UINT64_C(0x84c87814a1f0ab72), UINT64_C(0x8cc702081a6439ec),
-+ UINT64_C(0x90befffa23631e28), UINT64_C(0xa4506cebde82bde9),
-+ UINT64_C(0xbef9a3f7b2c67915), UINT64_C(0xc67178f2e372532b),
-+ UINT64_C(0xca273eceea26619c), UINT64_C(0xd186b8c721c0c207),
-+ UINT64_C(0xeada7dd6cde0eb1e), UINT64_C(0xf57d4f7fee6ed178),
-+ UINT64_C(0x06f067aa72176fba), UINT64_C(0x0a637dc5a2c898a6),
-+ UINT64_C(0x113f9804bef90dae), UINT64_C(0x1b710b35131c471b),
-+ UINT64_C(0x28db77f523047d84), UINT64_C(0x32caab7b40c72493),
-+ UINT64_C(0x3c9ebe0a15c9bebc), UINT64_C(0x431d67c49c100d4c),
-+ UINT64_C(0x4cc5d4becb3e42b6), UINT64_C(0x597f299cfc657e2a),
-+ UINT64_C(0x5fcb6fab3ad6faec), UINT64_C(0x6c44198c4a475817)};
-
- #if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM)
- #if defined(__x86_64) || defined(__x86_64__)
-diff --git a/crypto/x509/x509_trs.c b/crypto/x509/x509_trs.c
---- a/crypto/x509/x509_trs.c
-+++ b/crypto/x509/x509_trs.c
-@@ -236,8 +236,8 @@ static void trtable_free(X509_TRUST *p)
-
- void X509_TRUST_cleanup(void)
- {
-- unsigned int i;
-- for(i = 0; i < X509_TRUST_COUNT; i++) trtable_free(trstandard + i);
-+ /* unsigned int i; */
-+ /* for(i = 0; i < X509_TRUST_COUNT; i++) trtable_free(trstandard + i); */
- sk_X509_TRUST_pop_free(trtable, trtable_free);
- trtable = NULL;
- }
-diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c
---- a/crypto/x509v3/v3_purp.c
-+++ b/crypto/x509v3/v3_purp.c
-@@ -268,9 +268,9 @@ static void xptable_free(X509_PURPOSE *p)
-
- void X509_PURPOSE_cleanup(void)
- {
-- unsigned int i;
-+ /* unsigned int i; */
- sk_X509_PURPOSE_pop_free(xptable, xptable_free);
-- for(i = 0; i < X509_PURPOSE_COUNT; i++) xptable_free(xstandard + i);
-+ /*for(i = 0; i < X509_PURPOSE_COUNT; i++) xptable_free(&xstandard[i]); */
- xptable = NULL;
- }
-
-diff --git a/include/openssl/base.h b/include/openssl/base.h
---- a/include/openssl/base.h
-+++ b/include/openssl/base.h
-@@ -68,8 +68,12 @@ extern "C" {
-
-
- #if defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64)
--#define OPENSSL_64_BIT
- #define OPENSSL_X86_64
-+#ifndef __LP64__
-+#define OPENSSL_32_BIT
-+#else
-+#define OPENSSL_64_BIT
-+#endif
- #elif defined(__x86) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
- #define OPENSSL_32_BIT
- #define OPENSSL_X86
-diff --git a/ssl/test/packeted_bio.h b/ssl/test/packeted_bio.h
---- a/ssl/test/packeted_bio.h
-+++ b/ssl/test/packeted_bio.h
-@@ -25,7 +25,7 @@
- #include <winsock2.h>
- #pragma warning(pop)
- #else
--#include <sys/types.h>
-+#include <sys/time.h>
- #endif
-
-
diff --git a/ports/boringssl/pkg_info b/ports/boringssl/pkg_info
deleted file mode 100644
index 2972470..0000000
--- a/ports/boringssl/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=boringssl
-VERSION=git
-URL=https://boringssl.googlesource.com/boringssl.git@e8fe07f
-DEPENDS=(glibc-compat)
-# Disabled for now as it requires a recent cmake version.
-DISABLED=1
-CONFLICTS=(openssl)
-# x86 glibc toolchain doesn't support C++11 which is required by boringssl
-DISABLED_TOOLCHAIN=(emscripten glibc/i686 glibc/x86_64)
diff --git a/ports/box2d/build.sh b/ports/box2d/build.sh
deleted file mode 100644
index 95eba2b..0000000
--- a/ports/box2d/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXTRA_CMAKE_ARGS="-DBOX2D_BUILD_EXAMPLES=OFF"
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-TestStep() {
- ChangeDir HelloWorld
- RunSelLdrCommand HelloWorld
-}
diff --git a/ports/box2d/nacl.patch b/ports/box2d/nacl.patch
deleted file mode 100644
index ac65310..0000000
--- a/ports/box2d/nacl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -19,10 +19,10 @@ set(BOX2D_VERSION 2.1.0)
- # The Box2D library.
- add_subdirectory(Box2D)
-
--if(BOX2D_BUILD_EXAMPLES)
-- # HelloWorld console example.
-- add_subdirectory(HelloWorld)
-+# HelloWorld console example.
-+add_subdirectory(HelloWorld)
-
-+if(BOX2D_BUILD_EXAMPLES)
- # Testbed and dependencies.
- find_package(OpenGL REQUIRED)
- add_subdirectory(freeglut)
-@@ -32,4 +32,4 @@ endif(BOX2D_BUILD_EXAMPLES)
-
- if(BOX2D_INSTALL_DOC)
- install(DIRECTORY Documentation DESTINATION share/doc/Box2D PATTERN ".svn" EXCLUDE)
--endif(BOX2D_INSTALL_DOC)
-\ No newline at end of file
-+endif(BOX2D_INSTALL_DOC)
diff --git a/ports/box2d/pkg_info b/ports/box2d/pkg_info
deleted file mode 100644
index 321c581..0000000
--- a/ports/box2d/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=box2d
-VERSION=2.2.1
-URL=http://box2d.googlecode.com/files/Box2D_v2.2.1.zip
-ARCHIVE_ROOT=Box2D_v2.2.1
-LICENSE=CUSTOM:License.txt
-SHA1=f97e75227a19b01858b1431e5f3eb6b8827bed12
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/bullet/build.sh b/ports/bullet/build.sh
deleted file mode 100644
index 7d26db9..0000000
--- a/ports/bullet/build.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2011 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.
-
-
-TestStep() {
- if [ "${NACL_SHARED}" = "1" ]; then
- exe_dir=.libs
- else
- exe_dir=
- fi
-
- export SEL_LDR_LIB_PATH=$PWD/src/${exe_dir}
- pushd UnitTests/BulletUnitTests/${exe_dir}
- RunSelLdrCommand AppBulletUnitTests${NACL_EXEEXT}
- popd
-
- pushd Demos/HelloWorld/${exe_dir}
- RunSelLdrCommand AppHelloWorld${NACL_EXEEXT}
- popd
-}
-
-
-AutogenStep() {
- # Remove \r\n from the shell script.
- # The default sed on Mac is broken. Work around it by using $'...' to have
- # bash convert \r to a carriage return.
- sed -i.bak $'s/\r//g' ./autogen.sh
- /bin/sh ./autogen.sh
- # install-sh is extracted without the execute bit set; for some reason this
- # works OK on Linux, but fails on Mac.
- chmod +x install-sh
- PatchConfigure
- PatchConfigSub
-}
-
-
-ConfigureStep() {
- ChangeDir ${SRC_DIR}
- AutogenStep
- ChangeDir ${BUILD_DIR}
- DefaultConfigureStep
-}
diff --git a/ports/bullet/nacl.patch b/ports/bullet/nacl.patch
deleted file mode 100644
index a2e3388..0000000
--- a/ports/bullet/nacl.patch
+++ /dev/null
@@ -1,197 +0,0 @@
-diff --git a/Demos/HelloWorld/Makefile.am b/Demos/HelloWorld/Makefile.am
-new file mode 100644
---- /dev/null
-+++ b/Demos/HelloWorld/Makefile.am
-@@ -0,0 +1,5 @@
-+noinst_PROGRAMS=AppHelloWorld
-+
-+AppHelloWorld_SOURCES=HelloWorld.cpp
-+AppHelloWorld_CXXFLAGS=-I@top_srcdir@/src $(CXXFLAGS)
-+AppHelloWorld_LDADD=-L../../src -lBulletDynamics -lBulletCollision -lLinearMath
-diff --git a/Demos/Makefile.am b/Demos/Makefile.am
---- a/Demos/Makefile.am
-+++ b/Demos/Makefile.am
-@@ -1,5 +1,7 @@
-+SUBDIRS=HelloWorld
-+if CONDITIONAL_BUILD_DEMOS
-+SUBDIRS+=OpenGL BasicDemo TerrainDemo VehicleDemo CcdPhysicsDemo SoftDemo AllBulletDemos
-+endif
- if CONDITIONAL_BUILD_MULTITHREADED
--SUBDIRS=OpenGL BasicDemo TerrainDemo VehicleDemo CcdPhysicsDemo MultiThreadedDemo SoftDemo AllBulletDemos
--else
--SUBDIRS=OpenGL BasicDemo TerrainDemo VehicleDemo CcdPhysicsDemo SoftDemo AllBulletDemos
-+SUBDIRS+=MultiThreadedDemo
- endif
-diff --git a/Makefile.am b/Makefile.am
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,7 +1,6 @@
-+SUBDIRS=src Demos UnitTests
- if CONDITIONAL_BUILD_DEMOS
--SUBDIRS=src Extras Demos
--else
--SUBDIRS=src
-+SUBDIRS+=Extras
- endif
- pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = bullet.pc
-diff --git a/UnitTests/BulletUnitTests/CMakeLists.txt b/UnitTests/BulletUnitTests/CMakeLists.txt
---- a/UnitTests/BulletUnitTests/CMakeLists.txt
-+++ b/UnitTests/BulletUnitTests/CMakeLists.txt
-@@ -9,7 +9,7 @@ INCLUDE_DIRECTORIES(
-
- LINK_LIBRARIES(
- cppunit
-- BulletMultiThreaded
-+# BulletMultiThreaded
- BulletSoftBody
- BulletDynamics
- BulletCollision
-diff --git a/UnitTests/BulletUnitTests/Main.cpp b/UnitTests/BulletUnitTests/Main.cpp
---- a/UnitTests/BulletUnitTests/Main.cpp
-+++ b/UnitTests/BulletUnitTests/Main.cpp
-@@ -40,7 +40,7 @@ int main(int argc, char* argv[])
- CPPUNIT_NS::CompilerOutputter outputter( &result, CPPUNIT_NS::stdCOut() );
- outputter.write();
-
-- getchar();
-+ // getchar();
-
- return result.wasSuccessful() ? 0 : 1;
- }
-diff --git a/UnitTests/BulletUnitTests/Makefile.am b/UnitTests/BulletUnitTests/Makefile.am
-new file mode 100644
---- /dev/null
-+++ b/UnitTests/BulletUnitTests/Makefile.am
-@@ -0,0 +1,11 @@
-+noinst_PROGRAMS=AppBulletUnitTests
-+
-+AppBulletUnitTests_SOURCES= Main.cpp TestBulletOnly.h TestLinearMath.h \
-+ TestCholeskyDecomposition.cpp TestCholeskyDecomposition.h \
-+ TestPolarDecomposition.cpp TestPolarDecomposition.h \
-+ btCholeskyDecomposition.cpp btCholeskyDecomposition.h
-+AppBulletUnitTests_CXXFLAGS=-I@top_srcdir@/src \
-+ -I@top_srcdir@/UnitTests/cppunit/include $(CXXFLAGS)
-+AppBulletUnitTests_LDADD=-L@top_builddir@/src \
-+ -L@top_builddir@/UnitTests/cppunit -lcppunit -lBulletSoftBody \
-+ -lBulletDynamics -lBulletCollision -lLinearMath
-diff --git a/UnitTests/Makefile.am b/UnitTests/Makefile.am
-new file mode 100644
---- /dev/null
-+++ b/UnitTests/Makefile.am
-@@ -0,0 +1 @@
-+SUBDIRS=cppunit BulletUnitTests
-diff --git a/UnitTests/cppunit/CMakeLists.txt b/UnitTests/cppunit/CMakeLists.txt
---- a/UnitTests/cppunit/CMakeLists.txt
-+++ b/UnitTests/cppunit/CMakeLists.txt
-@@ -48,15 +48,15 @@ ADD_LIBRARY(cppunit
- src/cppunit/XmlOutputterHook.cpp
-
- #plugin
-- src/cppunit/BeOsDynamicLibraryManager.cpp
-- src/cppunit/DynamicLibraryManager.cpp
-- src/cppunit/DynamicLibraryManagerException.cpp
-- src/cppunit/PlugInManager.cpp
-- src/cppunit/PlugInParameters.cpp
-- src/cppunit/ShlDynamicLibraryManager.cpp
-- src/cppunit/TestPlugInDefaultImpl.cpp
-- src/cppunit/UnixDynamicLibraryManager.cpp
-- src/cppunit/Win32DynamicLibraryManager.cpp
-+# src/cppunit/BeOsDynamicLibraryManager.cpp
-+# src/cppunit/DynamicLibraryManager.cpp
-+# src/cppunit/DynamicLibraryManagerException.cpp
-+# src/cppunit/PlugInManager.cpp
-+# src/cppunit/PlugInParameters.cpp
-+# src/cppunit/ShlDynamicLibraryManager.cpp
-+# src/cppunit/TestPlugInDefaultImpl.cpp
-+# src/cppunit/UnixDynamicLibraryManager.cpp
-+# src/cppunit/Win32DynamicLibraryManager.cpp
-
- #protector
- src/cppunit/DefaultProtector.cpp
-@@ -71,4 +71,4 @@ ADD_LIBRARY(cppunit
- src/cppunit/XmlDocument.cpp
- src/cppunit/XmlElement.cpp
-
--)
-\ No newline at end of file
-+)
-diff --git a/UnitTests/cppunit/Makefile.am b/UnitTests/cppunit/Makefile.am
-new file mode 100644
---- /dev/null
-+++ b/UnitTests/cppunit/Makefile.am
-@@ -0,0 +1,45 @@
-+noinst_LIBRARIES = libcppunit.a
-+
-+libcppunit_a_CXXFLAGS = ${CXXFLAGS} -I@top_srcdir@/UnitTests/cppunit/include
-+
-+libcppunit_a_SOURCES =\
-+ src/cppunit/AdditionalMessage.cpp \
-+ src/cppunit/Asserter.cpp \
-+ src/cppunit/Exception.cpp \
-+ src/cppunit/Message.cpp \
-+ src/cppunit/SourceLine.cpp \
-+ src/cppunit/SynchronizedObject.cpp \
-+ src/cppunit/Test.cpp \
-+ src/cppunit/TestAssert.cpp \
-+ src/cppunit/TestCase.cpp \
-+ src/cppunit/TestComposite.cpp \
-+ src/cppunit/TestFailure.cpp \
-+ src/cppunit/TestLeaf.cpp \
-+ src/cppunit/TestPath.cpp \
-+ src/cppunit/TestResult.cpp \
-+ src/cppunit/TestRunner.cpp \
-+ src/cppunit/TestSuite.cpp \
-+ src/cppunit/RepeatedTest.cpp \
-+ src/cppunit/TestCaseDecorator.cpp \
-+ src/cppunit/TestDecorator.cpp \
-+ src/cppunit/TestSetUp.cpp \
-+ src/cppunit/TestFactoryRegistry.cpp \
-+ src/cppunit/TestNamer.cpp \
-+ src/cppunit/TestSuiteBuilderContext.cpp \
-+ src/cppunit/TypeInfoHelper.cpp \
-+ src/cppunit/BriefTestProgressListener.cpp \
-+ src/cppunit/TestResultCollector.cpp \
-+ src/cppunit/TestSuccessListener.cpp \
-+ src/cppunit/TextTestProgressListener.cpp \
-+ src/cppunit/TextTestResult.cpp \
-+ src/cppunit/CompilerOutputter.cpp \
-+ src/cppunit/TextOutputter.cpp \
-+ src/cppunit/XmlOutputter.cpp \
-+ src/cppunit/XmlOutputterHook.cpp \
-+ src/cppunit/DefaultProtector.cpp \
-+ src/cppunit/Protector.cpp \
-+ src/cppunit/ProtectorChain.cpp \
-+ src/cppunit/TextTestRunner.cpp \
-+ src/cppunit/StringTools.cpp \
-+ src/cppunit/XmlDocument.cpp \
-+ src/cppunit/XmlElement.cpp
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -58,6 +58,16 @@ case "$host" in
- ARCH_SPECIFIC_CFLAGS=""
- ARCH_STRING="PowerPC"
- ;;
-+ arm-*)
-+ AC_DEFINE(ARCH_ARM, 1, [Architecture is ARM])
-+ ARCH_SPECIFIC_CFLAGS=""
-+ ARCH_STIRNG="ARM"
-+ ;;
-+ le32-unknown-nacl*)
-+ AC_DEFINE(ARCH_PNACL, 1, [Architecture is PNaCl])
-+ ARCH_SPECIFIC_CFLAGS=""
-+ ARCH_STIRNG="PNaCl"
-+ ;;
- *)
- AC_MSG_ERROR([Unknown Architecture])
- ;;
-@@ -163,7 +173,7 @@ CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
- #----------------------------------------------------------------------------
- # Emit generated files.
- #----------------------------------------------------------------------------
--AC_CONFIG_FILES([bullet.pc Makefile Demos/Makefile Demos/SoftDemo/Makefile Demos/AllBulletDemos/Makefile Demos/MultiThreadedDemo/Makefile Demos/OpenGL/Makefile Demos/BasicDemo/Makefile Demos/CcdPhysicsDemo/Makefile Demos/VehicleDemo/Makefile Demos/TerrainDemo/Makefile src/Makefile Extras/Makefile])
-+AC_CONFIG_FILES([bullet.pc Makefile Demos/Makefile Demos/SoftDemo/Makefile Demos/AllBulletDemos/Makefile Demos/MultiThreadedDemo/Makefile Demos/OpenGL/Makefile Demos/BasicDemo/Makefile Demos/CcdPhysicsDemo/Makefile Demos/VehicleDemo/Makefile Demos/TerrainDemo/Makefile Demos/HelloWorld/Makefile src/Makefile Extras/Makefile UnitTests/Makefile UnitTests/cppunit/Makefile UnitTests/BulletUnitTests/Makefile])
- AC_OUTPUT
-
- AC_MSG_NOTICE([
diff --git a/ports/bullet/pkg_info b/ports/bullet/pkg_info
deleted file mode 100644
index d4b2d92..0000000
--- a/ports/bullet/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=bullet
-VERSION=2.81-rev2613
-URL=https://bullet.googlecode.com/files/bullet-2.81-rev2613.zip
-LICENSE=CUSTOM:COPYING
-SHA1=da04abea176cd0986108181582e29e725e58c69c
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/busybox/build.sh b/ports/busybox/build.sh
deleted file mode 100644
index 53685a0..0000000
--- a/ports/busybox/build.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES="busybox"
-
-EnableCliMain
-
-ConfigureStep() {
- cp "${START_DIR}/defconfig" .
-
- if [ "${TOOLCHAIN}" = "glibc" -a "${NACL_ARCH}" = "arm" ]; then
- echo "CONFIG_INIT=n" >> defconfig
- echo "CONFIG_LINEEDIT=n" >> defconfig
- echo "CONFIG_FEATURE_UTMP=n" >> defconfig
- echo "CONFIG_FEATURE_VI_USE_SIGNALS=n" >> defconfig
- fi
-
- echo "CONFIG_EXTRA_CFLAGS=\"${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}\"" \
- >> defconfig
- echo "CONFIG_EXTRA_LDFLAGS=\"${NACLPORTS_LDFLAGS}\"" >> defconfig
- echo "CONFIG_EXTRA_LDLIBS=\"${NACLPORTS_LIBS}\"" >> defconfig
- echo "CONFIG_CROSS_COMPILER_PREFIX=\"${NACL_CROSS_PREFIX}-\"" >> defconfig
-
- SetupCrossEnvironment
- LogExecute make -f ${SRC_DIR}/Makefile defconfig BUILD_LIBBUSYBOX=y \
- KBUILD_SRC=${SRC_DIR} KBUILD_DEFCONFIG=defconfig
-}
-
-InstallStep() {
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/busybox"
- MakeDir ${ASSEMBLY_DIR}
-
- cp busybox ${ASSEMBLY_DIR}/busybox_${NACL_ARCH}${NACL_EXEEXT}
-
- ChangeDir ${ASSEMBLY_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${ASSEMBLY_DIR}/busybox_*${NACL_EXEEXT} \
- -s . \
- -o busybox.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py busybox.nmf
-
- InstallNaClTerm ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR}
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip busybox-${VERSION}.zip busybox
-}
-
-TestStep() {
- if [[ ${TOOLCHAIN} = pnacl ]]; then
- return
- fi
-
- # Simple test of "cat" command to ensure basic functionality
- # TODO(sbc): run the full test suite
- echo "Running ./busybox.sh cat busybox.sh > test.out"
- $(./busybox.sh cat busybox.sh > test.out)
- LogExecute diff -u busybox.sh test.out
-}
diff --git a/ports/busybox/defconfig b/ports/busybox/defconfig
deleted file mode 100644
index 8b6b776..0000000
--- a/ports/busybox/defconfig
+++ /dev/null
@@ -1,45 +0,0 @@
-CONFIG_ACPID=n
-CONFIG_ARP=n
-CONFIG_ARPING=n
-CONFIG_BLOCKDEV=n
-CONFIG_BRCTL=n
-CONFIG_EJECT=n
-CONFIG_ETHER_WAKE=n
-CONFIG_FBSPLASH=n
-CONFIG_FDFLUSH=n
-CONFIG_FDISK=n
-CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=n
-CONFIG_FEATURE_INETD_RPC=n
-CONFIG_FEATURE_IP_LINK=n
-CONFIG_FEATURE_MOUNT_LOOP=n
-CONFIG_FEATURE_SUID=n
-CONFIG_FREE=n
-CONFIG_FREERAMDISK=n
-CONFIG_FSTRIM=n
-CONFIG_HDPARM=n
-CONFIG_IFCONFIG=n
-CONFIG_IFENSLAVE=n
-CONFIG_IFPLUGD=n
-CONFIG_IP=n
-CONFIG_LOSETUP=n
-CONFIG_MKFS_EXT2=n
-CONFIG_MKFS_VFAT=n
-CONFIG_MOUNT=n
-CONFIG_NANDDUMP=n
-CONFIG_NANDWRITE=n
-CONFIG_NBDCLIENT=n
-CONFIG_RAIDAUTORUN=n
-CONFIG_ROUTE=n
-CONFIG_SLATTACH=n
-CONFIG_TUNCTL=n
-CONFIG_UBIATTACH=n
-CONFIG_UBIDETACH=n
-CONFIG_UBIMKVOL=n
-CONFIG_UBIRMVOL=n
-CONFIG_UBIRSVOL=n
-CONFIG_UBIUPDATEVOL=n
-CONFIG_UDHCPC=n
-CONFIG_UDHCPD=n
-CONFIG_UMOUNT=n
-CONFIG_UPTIME=n
-CONFIG_WATCHDOG=n
diff --git a/ports/busybox/icon_128.png b/ports/busybox/icon_128.png
deleted file mode 100644
index 3d64fe2..0000000
--- a/ports/busybox/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/busybox/icon_16.png b/ports/busybox/icon_16.png
deleted file mode 100644
index 18a9194..0000000
--- a/ports/busybox/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/busybox/icon_48.png b/ports/busybox/icon_48.png
deleted file mode 100644
index 4e09775..0000000
--- a/ports/busybox/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/busybox/manifest.json b/ports/busybox/manifest.json
deleted file mode 100644
index 420ed7d..0000000
--- a/ports/busybox/manifest.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "BusyBox",
- "description": "BusyBox console application running using NativeClient",
- "version": "0.0.0.1",
- "manifest_version": 2,
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "launch": {
- "local_path": "busybox.html"
- }
- }
-}
diff --git a/ports/busybox/pkg_info b/ports/busybox/pkg_info
deleted file mode 100644
index c795542..0000000
--- a/ports/busybox/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=busybox
-VERSION=1.22.0
-URL=http://busybox.net/downloads/busybox-1.22.0.tar.bz2
-LICENSE=GPL
-BUILD_OS=linux
-DISABLED_LIBC=(newlib)
-SHA1=486fb55c3efa71148fe07895fd713ea3a5ae343a
-DEPENDS=(nacl-spawn)
-# glibc/arm: SIGWINCH missing
-# https://code.google.com/p/nativeclient/issues/detail?id=4240
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
diff --git a/ports/bzip2/build.sh b/ports/bzip2/build.sh
deleted file mode 100644
index e1d5c8c..0000000
--- a/ports/bzip2/build.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (c) 2011 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.
-
-BUILD_DIR=${SRC_DIR}
-EXECUTABLES="bzip2"
-
-EnableCliMain
-NACLPORTS_CFLAGS+=" -fPIC"
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- SetupCrossEnvironment
- LogExecute make clean
- LogExecute make \
- CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" \
- CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
- -j${OS_JOBS} libbz2.a bzip2
- if [ "${NACL_SHARED}" = "1" ]; then
- LogExecute make -f Makefile-libbz2_so clean
- LogExecute make -f Makefile-libbz2_so \
- CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" \
- CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
- -j${OS_JOBS}
- fi
-}
-
-InstallStep() {
- # Don't rely on make install, as it implicitly builds executables
- # that need things not available in newlib.
- MakeDir ${DESTDIR_INCLUDE}
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR}${PREFIX}/bin
- LogExecute cp -f bzlib.h ${DESTDIR_INCLUDE}
- LogExecute cp -f bzip2 ${DESTDIR}${PREFIX}/bin
- LogExecute chmod a+r ${DESTDIR_INCLUDE}/bzlib.h
-
- LogExecute cp -f libbz2.a ${DESTDIR_LIB}
- if [ -f libbz2.so.1.0 ]; then
- LogExecute ln -s libbz2.so.1.0 libbz2.so
- LogExecute cp -af libbz2.so* ${DESTDIR_LIB}
- fi
- LogExecute chmod a+r ${DESTDIR_LIB}/libbz2.*
-}
diff --git a/ports/bzip2/nacl.patch b/ports/bzip2/nacl.patch
deleted file mode 100644
index 549dc76..0000000
--- a/ports/bzip2/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/Makefile-libbz2_so b/Makefile-libbz2_so
---- a/Makefile-libbz2_so
-+++ b/Makefile-libbz2_so
-@@ -36,7 +36,7 @@ OBJS= blocksort.o \
-
- all: $(OBJS)
- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
-- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
-+ $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 $(LDFLAGS)
- rm -f libbz2.so.1.0
- ln -s libbz2.so.1.0.6 libbz2.so.1.0
-
diff --git a/ports/bzip2/pkg_info b/ports/bzip2/pkg_info
deleted file mode 100644
index 69cfa4b..0000000
--- a/ports/bzip2/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=bzip2
-VERSION=1.0.6
-URL=http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
-LICENSE=BSD:LICENSE
-SHA1=3f89f861209ce81a6bab1fd1998c0ef311712002
-DEPENDS=(nacl-spawn)
diff --git a/ports/cairo/build.sh b/ports/cairo/build.sh
deleted file mode 100644
index 6d56ec9..0000000
--- a/ports/cairo/build.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2011 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.
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-EnableCliMain
-
-EXECUTABLES="test/cairo-test-suite${NACL_EXEEXT}"
-
-# This is only necessary for pnacl
-export ax_cv_c_float_words_bigendian=no
-
-# Enable the x backend
-EXTRA_CONFIGURE_ARGS+=" --with-x"
-EXTRA_CONFIGURE_ARGS+=" --enable-xlib=yes"
-EXTRA_CONFIGURE_ARGS+=" --enable-xlib-xrender=yes"
-# disable xcb
-EXTRA_CONFIGURE_ARGS+=" --disable-xcb"
-EXTRA_CONFIGURE_ARGS+=" --disable-xlib-xcb"
-EXTRA_CONFIGURE_ARGS+=" --disable-xcb-shm"
-# gobjects required for gdk-pixbuf -> gtk+
-EXTRA_CONFIGURE_ARGS+=" --enable-gobject=yes"
-EXTRA_CONFIGURE_ARGS+=" --enable-ft"
-
-export ac_cv_func_XRenderCreateLinearGradient=yes
-export ac_cv_func_XRenderCreateRadialGradient=yes
-export ac_cv_func_XRenderCreateConicalGradient=yes
diff --git a/ports/cairo/nacl.patch b/ports/cairo/nacl.patch
deleted file mode 100644
index 6105ac4..0000000
--- a/ports/cairo/nacl.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -18159,32 +18190,9 @@ NO_WARN="unused-but-set-variable"
- MAYBE_WARN="$MAYBE_WARN -erroff=E_ENUM_TYPE_MISMATCH_ARG \
- -erroff=E_ENUM_TYPE_MISMATCH_OP"
-
--
--
--safe_MAYBE_WARN="$MAYBE_WARN"
--MAYBE_WARN="$MAYBE_WARN -flto"
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--
--int
--main ()
--{
--
-- int main(int argc, char **argv) { return 0; }
--
-- ;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_link "$LINENO"; then :
--
--else
--
-- MAYBE_WARN="$safe_MAYBE_WARN"
--
--fi
--rm -f core conftest.err conftest.$ac_objext \
-- conftest$ac_exeext conftest.$ac_ext
-+# Removed -flto flag as it seems to cause problems with the latest
-+# version of our arm compiler:
-+# https://code.google.com/p/nativeclient/issues/detail?id=3995
-
- MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"
-
-@@ -18805,10 +18813,10 @@ _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
-
-
--if strings - conftest.$ac_objext | grep noonsees >/dev/null ; then
-+if ${NACLSTRINGS} - conftest.$ac_objext | grep noonsees >/dev/null ; then
- ax_cv_c_float_words_bigendian=yes
- fi
--if strings - conftest.$ac_objext | grep seesnoon >/dev/null ; then
-+if ${NACLSTRINGS} - conftest.$ac_objext | grep seesnoon >/dev/null ; then
- if test "$ax_cv_c_float_words_bigendian" = unknown; then
- ax_cv_c_float_words_bigendian=no
- else
-diff --git a/src/cairo-wideint-type-private.h b/src/cairo-wideint-type-private.h
---- a/src/cairo-wideint-type-private.h
-+++ b/src/cairo-wideint-type-private.h
-@@ -124,12 +124,20 @@ typedef struct _cairo_quorem64 {
- cairo_int64_t rem;
- } cairo_quorem64_t;
-
-+/*
-+ * TODO(phosek): nacl-clang declares __uint128_t (but not uint128_t), which
-+ * is a gcc extension. However, it does not provide a runtime support for
-+ * neither __uint128_t nor uint128_t in compiler-rt which causes an error
-+ * during linking. The following check is a temporary workaround.
-+ */
-+#if !defined(__native_client__) || !defined(__clang__)
- /* gcc has a non-standard name. */
- #if HAVE___UINT128_T && !HAVE_UINT128_T
- typedef __uint128_t uint128_t;
- typedef __int128_t int128_t;
- #define HAVE_UINT128_T 1
- #endif
-+#endif
-
- #if !HAVE_UINT128_T
-
-diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
---- a/src/cairo-xlib-surface-shm.c
-+++ b/src/cairo-xlib-surface-shm.c
-@@ -149,8 +149,10 @@ void _cairo_xlib_display_fini_shm (cairo_xlib_display_t *display) {}
- #elif HAVE_X11_EXTENSIONS_SHMSTR_H
- #include <X11/extensions/shmstr.h>
- #endif
-+#ifndef __native_client__
- #include <sys/ipc.h>
- #include <sys/shm.h>
-+#endif
-
- #define MIN_PIXMAP_SIZE 4096
-
-@@ -362,6 +364,12 @@ _check_error_handler (Display *display,
- static cairo_bool_t
- can_use_shm (Display *dpy, int *has_pixmap)
- {
-+ // to avoid sys/ipo and sys/uio requiring functions
-+ // not using the shm requires cairo to copy the buffer everytime
-+ // instead of using shared memory, but should still work
-+ #ifdef __native_client__
-+ return FALSE;
-+ #else
- XShmSegmentInfo shm;
- int (*old_handler) (Display *display, XErrorEvent *event);
- Status success;
-@@ -402,6 +410,7 @@ can_use_shm (Display *dpy, int *has_pixmap)
- shmdt (shm.shmaddr);
-
- return success && ! _x_error_occurred;
-+ #endif
- }
-
- static inline Display *
-@@ -420,7 +429,7 @@ static void
- _cairo_xlib_display_shm_pool_destroy (cairo_xlib_display_t *display,
- cairo_xlib_shm_t *pool)
- {
-- shmdt (pool->shm.shmaddr);
-+ // shmdt (pool->shm.shmaddr);
- if (display->display) /* may be called after CloseDisplay */
- XShmDetach (display->display, &pool->shm);
-
-@@ -568,6 +577,9 @@ static cairo_xlib_shm_t *
- _cairo_xlib_shm_pool_create(cairo_xlib_display_t *display,
- size_t size, void **ptr)
- {
-+ // again disabling the shm here because the shared memory is done through
-+ // sys/ipo and sys/uio should work without the shm just slower
-+ #ifndef __native_client__
- Display *dpy = display->display;
- cairo_xlib_shm_t *pool;
- size_t bytes, maxbits = 16, minbits = MIN_BITS;
-@@ -625,6 +637,7 @@ cleanup_shm:
- shmdt (pool->shm.shmaddr);
- cleanup:
- free (pool);
-+ #endif
- return NULL;
- }
-
-@@ -1301,6 +1314,10 @@ static cairo_bool_t
- has_broken_send_shm_event (cairo_xlib_display_t *display,
- cairo_xlib_shm_display_t *shm)
- {
-+ // never use xlib shm and always fall back on the buffer copy
-+ #ifdef __native_client__
-+ return TRUE;
-+ #else
- Display *dpy = display->display;
- int (*old_handler) (Display *display, XErrorEvent *event);
- XShmCompletionEvent ev;
-@@ -1346,6 +1363,7 @@ has_broken_send_shm_event (cairo_xlib_display_t *display,
- shmdt (info.shmaddr);
-
- return _x_error_occurred;
-+ #endif
- }
-
- static cairo_bool_t
-diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
---- a/src/cairo-xlib-surface.c
-+++ b/src/cairo-xlib-surface.c
-@@ -68,8 +68,10 @@
- #include <X11/Xutil.h> /* for XDestroyImage */
-
- #include <X11/extensions/XShm.h>
-+#ifndef __native_client__
- #include <sys/ipc.h>
- #include <sys/shm.h>
-+#endif
-
- #define XLIB_COORD_MAX 32767
-
-diff --git a/test/Makefile.am b/test/Makefile.am
---- a/test/Makefile.am
-+++ b/test/Makefile.am
-@@ -85,7 +85,6 @@ cairo_test_suite_SOURCES = \
- cairo-test-constructors.c
- cairo_test_suite_CFLAGS = $(AM_CFLAGS) $(real_pthread_CFLAGS)
- cairo_test_suite_LDADD = \
-- $(real_pthread_LIBS) \
- $(top_builddir)/test/pdiff/libpdiff.la \
- $(top_builddir)/boilerplate/libcairoboilerplate.la \
- $(top_builddir)/src/libcairo.la \
-diff --git a/test/Makefile.in b/test/Makefile.in
---- a/test/Makefile.in
-+++ b/test/Makefile.in
-@@ -1283,7 +1283,6 @@ cairo_test_suite_SOURCES = \
-
- cairo_test_suite_CFLAGS = $(AM_CFLAGS) $(real_pthread_CFLAGS)
- cairo_test_suite_LDADD = \
-- $(real_pthread_LIBS) \
- $(top_builddir)/test/pdiff/libpdiff.la \
- $(top_builddir)/boilerplate/libcairoboilerplate.la \
- $(top_builddir)/src/libcairo.la \
diff --git a/ports/cairo/pkg_info b/ports/cairo/pkg_info
deleted file mode 100644
index 5bee5fa..0000000
--- a/ports/cairo/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=cairo
-VERSION=1.12.14
-URL=http://cairographics.org/releases/cairo-1.12.14.tar.xz
-LICENSE=GPL,MPL
-DEPENDS=(pixman fontconfig libpng libx11 libxext libxrender glib)
-SHA1=9106ab09b2e7b9f90521b18dd4a7e9577eba6c15
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/cfitsio/nacl.patch b/ports/cfitsio/nacl.patch
deleted file mode 100644
index 69bf511..0000000
--- a/ports/cfitsio/nacl.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -18,6 +18,7 @@
- # testprog targets. See also changes and comments in configure.in
- #
-
-+srcdir = @srcdir@
- prefix = @prefix@
- exec_prefix = @exec_prefix@
- DESTDIR =
-@@ -41,7 +42,7 @@ BISON = bison
- SHLIB_LD = @SHLIB_LD@
- SHLIB_SUFFIX = @SHLIB_SUFFIX@
-
--.c.o:
-+%.o: $(srcdir)/%.c
- $(CC) -c $(CFLAGS) $(DEFS) $<
-
-
-@@ -84,7 +85,7 @@ all-nofitsio:
- stand_alone: libcfitsio.a
-
- libcfitsio.a: ${OBJECTS}
-- ar rv libcfitsio.a ${OBJECTS}; \
-+ ${AR} rv libcfitsio.a ${OBJECTS}; \
- ${RANLIB} libcfitsio.a;
-
- shared: libcfitsio${SHLIB_SUFFIX}
-@@ -99,7 +100,7 @@ install: libcfitsio.a $(INSTALL_DIRS)
- if [ -f libcfitsio${SHLIB_SUFFIX} ]; then \
- /bin/mv libcfitsio${SHLIB_SUFFIX} ${CFITSIO_LIB}; \
- fi; \
-- /bin/cp fitsio.h fitsio2.h longnam.h drvrsmem.h ${CFITSIO_INCLUDE}/; \
-+ /bin/cp $(srcdir)/fitsio.h $(srcdir)/fitsio2.h $(srcdir)/longnam.h $(srcdir)/drvrsmem.h ${CFITSIO_INCLUDE}/; \
- /bin/cp cfitsio.pc ${CFITSIO_LIB}/pkgconfig
-
- smem: smem.o libcfitsio.a ${OBJECTS}
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -3771,7 +3771,7 @@ case $EXT in
- darwin)
- SHLIB_LD="$CC -dynamiclib"
- SHLIB_SUFFIX=".dylib"
-- lhea_shlib_cflags="-fPIC -fno-common"
-+ lhea_shlib_cflags="-fno-common"
- ;;
- hpu)
- SHLIB_LD="ld -b"
-@@ -3800,7 +3800,6 @@ esac
- # if test "x$GCC" = xyes; then
- if test "x$GCC" = xyes && test "x$EXT" != xdarwin && test "x$EXT" != xcygwin; then
- SHLIB_LD="$CC -shared"
-- lhea_shlib_cflags='-fPIC'
- fi
- if test "x$lhea_shlib_cflags" != x; then
- CFLAGS="$CFLAGS $lhea_shlib_cflags"
diff --git a/ports/cfitsio/pkg_info b/ports/cfitsio/pkg_info
deleted file mode 100644
index acc3156..0000000
--- a/ports/cfitsio/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=cfitsio
-VERSION=3260
-URL=ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3260.tar.gz
-ARCHIVE_ROOT=cfitsio
-LICENSE=LGPL
-SHA1=42b199dafae359473cf733f1197ad303053e072b
diff --git a/ports/civetweb/README.nacl b/ports/civetweb/README.nacl
deleted file mode 100644
index 4c167a9..0000000
--- a/ports/civetweb/README.nacl
+++ /dev/null
@@ -1,9 +0,0 @@
-Civetweb Webserver
-==================
-
-This example shows the civetweb webserver built for Native
-Client. It is setup to serve the contents of /tmp where
-the HTML5 temporary filesystem is mounted.
-
-By default a single files called 'index.html' is created
-in the filesystem and the server will listen on port 8080.
diff --git a/ports/civetweb/background.js b/ports/civetweb/background.js
deleted file mode 100644
index 326479b..0000000
--- a/ports/civetweb/background.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('gdb.html', {
- 'bounds': {
- 'width': 400,
- 'height': 500
- }
- });
-});
diff --git a/ports/civetweb/build.sh b/ports/civetweb/build.sh
deleted file mode 100644
index 96cc264..0000000
--- a/ports/civetweb/build.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXECUTABLES=civetweb
-BUILD_DIR=${SRC_DIR}
-
-EnableCliMain
-
-BuildStep() {
- export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export LDFLAGS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}"
-
- CFLAGS+=" -DNO_SSL -DNO_CGI"
- if [ "${NACL_LIBC}" = "glibc" ]; then
- LDFLAGS+=" -ldl"
- fi
-
- CC=${NACLCC} CXX=${NACLCXX} LogExecute make clean
- CC=${NACLCC} CXX=${NACLCXX} LogExecute make WITH_DEBUG=${NACL_DEBUG} \
- TARGET_OS=NACL WITH_CPP=1 all lib
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/civetweb"
- MakeDir ${ASSEMBLY_DIR}
- LogExecute cp civetweb \
- ${ASSEMBLY_DIR}/civetweb_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute cp ${START_DIR}/index.html ${ASSEMBLY_DIR}
-
- pushd ${ASSEMBLY_DIR}
- python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- civetweb_*${NACL_EXEEXT} \
- -s . \
- -o civetweb.nmf
- popd
-
- InstallNaClTerm ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/background.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/civetweb.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
-}
-
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}
- LogExecute cp libcivetweb.a ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}/civetweb
- LogExecute cp include/civetweb.h ${DESTDIR_INCLUDE}/civetweb
- LogExecute cp include/CivetServer.h ${DESTDIR_INCLUDE}/civetweb
-}
diff --git a/ports/civetweb/civetweb.js b/ports/civetweb/civetweb.js
deleted file mode 100644
index 33843e2..0000000
--- a/ports/civetweb/civetweb.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-/* globals NaClTerm, lib */
-
-'use strict';
-
-NaClTerm.nmf = 'civetweb.nmf';
-
-lib.rtdep('lib.f');
-
-window.onload = function() {
- lib.init(function() {
- navigator.webkitPersistentStorage.requestQuota(
- 1024*1024,
- function(grantedBytes) {
- NaClTerm.init();
- },
- function(e) { console.log('Error', e); }
- );
- });
-};
diff --git a/ports/civetweb/index.html b/ports/civetweb/index.html
deleted file mode 100644
index ace92d6..0000000
--- a/ports/civetweb/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Civetweb</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="civetweb.js"></script>
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- overflow: hidden;
- }
-
- #terminal {
- display: block;
- position: static;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/civetweb/manifest.json b/ports/civetweb/manifest.json
deleted file mode 100644
index d87d40e..0000000
--- a/ports/civetweb/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "Civetweb Webserver",
- "description": "Civetweb Webserver built using Native Client",
- "version": "1.5.0.1",
- "manifest_version": 2,
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "permissions": [
- "storage",
- {"socket": [
- "resolve-host",
- "tcp-listen:*:*",
- "tcp-connect"
- ]}
- ]
-}
diff --git a/ports/civetweb/nacl.patch b/ports/civetweb/nacl.patch
deleted file mode 100644
index 4e67886..0000000
--- a/ports/civetweb/nacl.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -9,8 +9,8 @@
-
- include resources/Makefile.in-os
-
--CPROG = civetweb
- #CXXPROG = civetweb
-+CPROG = civetweb
-
- BUILD_DIR = out
-
-@@ -92,7 +92,11 @@ LIB_OBJECTS = $(filter-out $(MAIN_OBJECTS), $(BUILD_OBJECTS))
-
- LIBS = -lpthread -lm
-
--ifeq ($(TARGET_OS),LINUX)
-+ifeq ($(TARGET_OS),NACL)
-+ LIBS += -Wl,-uPSUserMainGet -lcli_main -lppapi_simple -lnacl_io -lppapi
-+endif
-+
-+ifeq ($(TARGET_OS),LINUX)
- LIBS += -ldl
- endif
-
-diff --git a/src/civetweb.c b/src/civetweb.c
---- a/src/civetweb.c
-+++ b/src/civetweb.c
-@@ -222,7 +222,7 @@ struct pollfd {
- #else /* UNIX specific */
- #include <sys/wait.h>
- #include <sys/socket.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <sys/time.h>
-@@ -330,6 +330,13 @@ typedef int socklen_t;
- #define MGSQLEN 20
- #endif
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+// Newlib doesn't currently implemnt flockfile/funlockfile.
-+// TODO(sbc): remove this once newlib is fixed.
-+#define flockfile(x)
-+#define funlockfile(x)
-+#endif
-+
- static const char *http_500_error = "Internal Server Error";
-
- #if defined(NO_SSL_DL)
-diff --git a/src/main.c b/src/main.c
---- a/src/main.c
-+++ b/src/main.c
-@@ -69,9 +69,17 @@ extern char *_getcwd(char *buf, size_t size);
- #include <unistd.h>
- #define DIRSEP '/'
- #define WINCDECL
-+#ifdef __native_client__
-+// realpath is currently broken under glibc at least:
-+// TODO(sbc): remove once this gets fixed:
-+// https://code.google.com/p/nativeclient/issues/detail?id=3717
-+#define abs_path(rel, abs, abs_size) strncpy((abs), (rel), (abs_size))
-+#else
- #define abs_path(rel, abs, abs_size) realpath((rel), (abs))
-+#endif
- #endif /* _WIN32 */
-
-+
- #define MAX_OPTIONS 100
- #define MAX_CONF_FILE_LINE_SIZE (8 * 1024)
-
-@@ -1049,8 +1057,28 @@ int main(int argc, char *argv[])
- return EXIT_SUCCESS;
- }
- #else
-+
-+#ifdef __native_client__
-+#include <assert.h>
-+#include <sys/mount.h>
-+#define main nacl_main
-+#endif
-+
- int main(int argc, char *argv[])
- {
-+#ifdef __native_client__
-+ // Write index.html to HTML5 filesystem
-+ int result = chdir("/tmp");
-+ assert(result == 0);
-+
-+ struct stat buf;
-+ if (stat("index.html", &buf) != 0) {
-+ const char* index_html = "<h1>Civetweb is working!</h1>\n";
-+ FILE* f = fopen("index.html", "w+");
-+ fwrite(index_html, strlen(index_html), 1, f);
-+ fclose(f);
-+ }
-+#endif
- init_server_name();
- start_civetweb(argc, argv);
- printf("%s started on port(s) %s with web root [%s]\n",
-@@ -1067,4 +1095,5 @@ int main(int argc, char *argv[])
-
- return EXIT_SUCCESS;
- }
-+
- #endif /* _WIN32 */
diff --git a/ports/civetweb/pkg_info b/ports/civetweb/pkg_info
deleted file mode 100644
index f6a7b3b..0000000
--- a/ports/civetweb/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=civetweb
-VERSION=1.5
-URL=http://downloads.sf.net/project/civetweb/1.5/civetweb-1.5.tar.gz
-LICENSE=MIT
-DEPENDS=(nacl-spawn)
-# getpwnam undefined
-SHA1=39c18053152f01448047f504f0867251e2c67b06
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/clapack/build.sh b/ports/clapack/build.sh
deleted file mode 100644
index 82f4180..0000000
--- a/ports/clapack/build.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (c) 2011 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.
-
-# parallel build usually fails (at least for me)
-OS_JOBS=1
-MAKE_TARGETS="f2clib blaslib lib"
-
-ConfigureStep() {
- if [ $OS_NAME != "Darwin" ]; then
- # -u: do not rewrite newer with older files
- UPDATE=-u
- else
- UPDATE=
- fi
-
- MakeDir ${BUILD_DIR}
- ChangeDir ${BUILD_DIR}
- LogExecute cp ${UPDATE} -R ${SRC_DIR}/BLAS ${SRC_DIR}/F2CLIBS \
- ${SRC_DIR}/INSTALL ${SRC_DIR}/TESTING ${SRC_DIR}/INCLUDE ${SRC_DIR}/SRC ./
- LogExecute cp ${UPDATE} ${SRC_DIR}/Makefile ${SRC_DIR}/make.inc ./
-
- # make does not create it, but build relays on it being there
- LogExecute install -d SRC/VARIANTS/LIB
-}
-
-BuildStep() {
- # Without the -m option the x86_64 and arm builds break with (x86_64)
- # at build-nacl-x86_64-glibc/F2CLIBS/f2clibs
- #
- # …/nacl_sdk/pepper_canary/toolchain/linux_x86_glibc/bin/x86_64-nacl-ld -r
- # -o main.xxx main.o
- #
- # Relocatable linking with relocations from format elf64-x86-64-nacl (main.o)
- # to format elf32-x86-64-nacl (main.xxx) is not supported.
- # TODO: Investigate/remove this and a later date
- LDEMULATION=
- if [ "${NACL_ARCH}" == "x86_64" ]; then
- LDEMULATION=-melf_x86_64_nacl
- fi
- if [ "${NACL_ARCH}" == "arm" ]; then
- LDEMULATION=-marmelf_nacl
- # Workaround for arm-gcc bug:
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- # TODO(sbc): remove this once the issue is fixed
- export CFLAGS=-mfpu=vfp
- fi
- export LDEMULATION
- export BUILD_CC=cc
- DefaultBuildStep
-}
-
-TestStep() {
- ChangeDir ${BUILD_DIR}/INSTALL
- RunSelLdrCommand ./testlsame
- RunSelLdrCommand ./testslamch
- RunSelLdrCommand ./testdlamch
- RunSelLdrCommand ./testsecond
- RunSelLdrCommand ./testdsecnd
- RunSelLdrCommand ./testversion
-}
-
-# the Makefile does not contain install target
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- LogExecute install libblas.a ${DESTDIR_LIB}/
- LogExecute install liblapack.a ${DESTDIR_LIB}/
- LogExecute install tmglib.a ${DESTDIR_LIB}/
- LogExecute install F2CLIBS/libf2c.a ${DESTDIR_LIB}/
-}
diff --git a/ports/clapack/nacl.patch b/ports/clapack/nacl.patch
deleted file mode 100644
index 8e353f9..0000000
--- a/ports/clapack/nacl.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-diff --git a/F2CLIBS/libf2c/Makefile b/F2CLIBS/libf2c/Makefile
---- a/F2CLIBS/libf2c/Makefile
-+++ b/F2CLIBS/libf2c/Makefile
-@@ -20,7 +20,7 @@ include $(TOPDIR)/make.inc
- # compile, then strip unnecessary symbols
- .c.o:
- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
-- ld -r -x -o $*.xxx $*.o
-+ $(LOADER) ${LDEMULATION} -r -o $*.xxx $*.o
- mv $*.xxx $*.o
- ## Under Solaris (and other systems that do not understand ld -x),
- ## omit -x in the ld line above.
-@@ -72,8 +72,8 @@ OFILES = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
- all: f2c.h signal1.h sysdep1.h libf2c.a clapack_install
-
- libf2c.a: $(OFILES)
-- ar r libf2c.a $?
-- -ranlib libf2c.a
-+ $(ARCH) r libf2c.a $?
-+ -$(RANLIB) libf2c.a
-
- ## Shared-library variant: the following rule works on Linux
- ## systems. Details are system-dependent. Under Linux, -fPIC
-@@ -119,7 +119,7 @@ sysdep1.h: sysdep1.h0
-
- install: libf2c.a
- cp libf2c.a $(LIBDIR)
-- -ranlib $(LIBDIR)/libf2c.a
-+ -$(RANLIB) $(LIBDIR)/libf2c.a
-
- clapack_install: libf2c.a
- mv libf2c.a ..
-@@ -181,9 +181,11 @@ xwsne.o: fio.h
- xwsne.o: lio.h
- xwsne.o: fmt.h
-
-+BUILD_CC ?= $(CC)
-+
- arith.h: arithchk.c
-- $(CC) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\
-- $(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT arithchk.c -lm
-+ $(BUILD_CC) $(BUILD_CFLAGS) -DNO_FPINIT arithchk.c -lm ||\
-+ $(BUILD_CC) -DNO_LONG_LONG $(BUILD_CFLAGS) -DNO_FPINIT arithchk.c -lm
- ./a.out >arith.h
- rm -f a.out arithchk.o
-
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -16,8 +16,8 @@ lib: f2clib blaslib variants lapacklib tmglib
- clean: cleanlib cleantesting cleanblas_testing
-
- lapack_install:
-- ( cd INSTALL; $(MAKE); ./testlsame; ./testslamch; \
-- ./testdlamch; ./testsecond; ./testdsecnd; ./testversion )
-+ # only build it here, test binaries are executed from build.sh
-+ ( cd INSTALL; $(MAKE) )
-
- blaslib:
- ( cd BLAS/SRC; $(MAKE) )
-diff --git a/make.inc b/make.inc
-new file mode 100644
---- /dev/null
-+++ b/make.inc
-@@ -0,0 +1,78 @@
-+# -*- Makefile -*-
-+####################################################################
-+# LAPACK make include file. #
-+# LAPACK, Version 3.2.1 #
-+# June 2009 #
-+####################################################################
-+#
-+# See the INSTALL/ directory for more examples.
-+#
-+SHELL = /bin/sh
-+#
-+# The machine (platform) identifier to append to the library names
-+#
-+PLAT =
-+#
-+# Modify the FORTRAN and OPTS definitions to refer to the
-+# compiler and desired compiler options for your machine. NOOPT
-+# refers to the compiler options desired when NO OPTIMIZATION is
-+# selected. Define LOADER and LOADOPTS to refer to the loader
-+# and desired load options for your machine.
-+#
-+#######################################################
-+# This is used to compile C libary
-+#CC = gcc
-+# if no wrapping of the blas library is needed, uncomment next line
-+CC = ${NACLCC} -DNO_BLAS_WRAP
-+CFLAGS += -O3 -I$(TOPDIR)/INCLUDE
-+LOADER = ${NACLLD}
-+LOADOPTS =
-+NOOPT = -O0 -I$(TOPDIR)/INCLUDE
-+DRVCFLAGS = $(CFLAGS)
-+F2CCFLAGS = $(CFLAGS)
-+#######################################################################
-+
-+#
-+# Timer for the SECOND and DSECND routines
-+#
-+# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
-+# TIMER = EXT_ETIME
-+# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_
-+# TIMER = EXT_ETIME_
-+# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME
-+# TIMER = INT_ETIME
-+# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...)
-+# SECOND and DSECND will use a call to the Fortran standard INTERNAL FUNCTION CPU_TIME
-+TIMER = INT_CPU_TIME
-+# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0
-+# TIMER = NONE
-+#
-+# The archiver and the flag(s) to use when building archive (library)
-+# If you system has no ranlib, set RANLIB = echo.
-+#
-+ARCH = ${NACLAR}
-+ARCHFLAGS= cr
-+RANLIB = ${NACLRANLIB}
-+#
-+# The location of BLAS library for linking the testing programs.
-+# The target's machine-specific, optimized BLAS library should be
-+# used whenever possible.
-+#
-+BLASLIB = ../../libblas$(PLAT).a
-+#
-+# Location of the extended-precision BLAS (XBLAS) Fortran library
-+# used for building and testing extended-precision routines. The
-+# relevant routines will be compiled and XBLAS will be linked only if
-+# USEXBLAS is defined.
-+#
-+# USEXBLAS = Yes
-+XBLASLIB =
-+# XBLASLIB = -lxblas
-+#
-+# Names of generated libraries.
-+#
-+LAPACKLIB = liblapack$(PLAT).a
-+F2CLIB = ../../F2CLIBS/libf2c.a
-+TMGLIB = tmglib$(PLAT).a
-+EIGSRCLIB = eigsrc$(PLAT).a
-+LINSRCLIB = linsrc$(PLAT).a
diff --git a/ports/clapack/pkg_info b/ports/clapack/pkg_info
deleted file mode 100644
index 0de0e16..0000000
--- a/ports/clapack/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=clapack
-VERSION=3.2.1
-ARCHIVE_ROOT=CLAPACK-3.2.1
-URL=http://www.netlib.org/clapack/clapack.tgz
-LICENSE=CUSTOM:COPYING
-# ICE in x86_64-nacl-clang:
-# https://code.google.com/p/nativeclient/issues/detail?id=4113
-DISABLED_TOOLCHAIN=(emscripten)
-SHA1=8b284658999d1eb71adb6ad521c6118e2db57a99
diff --git a/ports/clipper/build.sh b/ports/clipper/build.sh
deleted file mode 100644
index 6c7e885..0000000
--- a/ports/clipper/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 2015 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.
-
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CMAKE_ARGS="-DBUILD_SHARED_LIBS=OFF"
-fi
diff --git a/ports/clipper/nacl.patch b/ports/clipper/nacl.patch
deleted file mode 100644
index d490e7a..0000000
--- a/ports/clipper/nacl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -10,12 +10,21 @@ SET(PCFILE "${CMAKE_CURRENT_BINARY_DIR}/polyclipping.pc")
-
- SET(BUILD_SHARED_LIBS ON CACHE BOOL
- "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)")
--ADD_LIBRARY(polyclipping clipper.cpp)
-+ADD_LIBRARY(polyclipping_static STATIC clipper.cpp)
-+SET_TARGET_PROPERTIES(polyclipping_static PROPERTIES OUTPUT_NAME polyclipping)
-+IF(BUILD_SHARED_LIBS)
-+ ADD_LIBRARY(polyclipping SHARED clipper.cpp)
-+ENDIF(BUILD_SHARED_LIBS)
-
- CONFIGURE_FILE (polyclipping.pc.cmakein "${PCFILE}" @ONLY)
-
- INSTALL (FILES clipper.hpp DESTINATION "${CMAKE_INSTALL_INCDIR}")
--INSTALL (TARGETS polyclipping LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-+INSTALL (TARGETS polyclipping_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-+IF(BUILD_SHARED_LIBS)
-+ INSTALL (TARGETS polyclipping LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-+ENDIF(BUILD_SHARED_LIBS)
- INSTALL (FILES "${PCFILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}")
-
-+IF(BUILD_SHARED_LIBS)
- SET_TARGET_PROPERTIES(polyclipping PROPERTIES VERSION 19.0.0 SOVERSION 19 )
-+ENDIF(BUILD_SHARED_LIBS)
-\ No newline at end of file
diff --git a/ports/clipper/pkg_info b/ports/clipper/pkg_info
deleted file mode 100644
index 0e6de02..0000000
--- a/ports/clipper/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=clipper
-VERSION=6.2.1
-URL=http://download.sf.net/polyclipping/files/clipper_ver6.2.1.zip
-ARCHIVE_ROOT=cpp
-LICENSE=Boost Software License
-SHA1=0555254020aee67f4f9643962b8c5e994e07e85a
-# The cmake version seems to fails when using with emcc
-# https://bugs.chromium.org/p/naclports/issues/detail?id=243
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/compositeproto/pkg_info b/ports/compositeproto/pkg_info
deleted file mode 100644
index 0804556..0000000
--- a/ports/compositeproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=compositeproto
-VERSION=0.4.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/compositeproto-0.4.2.tar.bz2
-LICENSE=GPL
-SHA1=aa7b5abcfd5bbfad7cb681ce89dc1d6e381e3044
diff --git a/ports/corelibs/build.sh b/ports/corelibs/build.sh
deleted file mode 100644
index 0530c86..0000000
--- a/ports/corelibs/build.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2015 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.
-
-BuildStep() {
- return
-}
-
-InstallStep() {
- MakeDir ${INSTALL_DIR}${PREFIX}
- ChangeDir ${INSTALL_DIR}${PREFIX}
-
- if [ "${NACL_SHARED}" = "1" ]; then
- MakeDir lib
- # Copy core libraries
- LogExecute cp -r ${NACL_SDK_LIB}/*.so* lib/
-
- # Copy SDK libs
- LogExecute cp -r ${NACL_SDK_LIBDIR}/lib*.so* lib/
- fi
-}
diff --git a/ports/corelibs/pkg_info b/ports/corelibs/pkg_info
deleted file mode 100644
index dbac649..0000000
--- a/ports/corelibs/pkg_info
+++ /dev/null
@@ -1,3 +0,0 @@
-NAME=corelibs
-VERSION=0.2
-TOOLCHAIN_INSTALL=0
diff --git a/ports/coreutils/build.sh b/ports/coreutils/build.sh
deleted file mode 100644
index 1f7870c..0000000
--- a/ports/coreutils/build.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2014 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.
-
-BARE_EXECUTABLES="\
-[ basename cat chgrp chmod chown cksum comm cp csplit cut date dd df dir
-dircolors dirname du echo env expand expr factor false fmt fold ginstall head
-id join kill link ln logname ls md5sum mkdir mkfifo mknod mv nl
-nohup od paste pathchk pr printenv printf ptx pwd readlink rm rmdir seq
-sha1sum shred sleep sort split stat stty sum sync tac tail tee
-test touch tr true tsort tty unexpand uniq unlink uname vdir wc whoami yes"
-
-EXECUTABLES=""
-for exe in ${BARE_EXECUTABLES}; do
- EXECUTABLES+=" src/${exe}${NACL_EXEEXT}"
-done
-
-TRANSLATE_PEXES=no
-
-EnableCliMain
-EnableGlibcCompat
-
-ConfigureStep() {
- if [ "${TOOLCHAIN}" = "glibc" ]; then
- NACLPORTS_CPPFLAGS+=" -D_FORTIFY_SOURCE=0"
-
- # Glibc's *at functions don't work correctly since they rely on
- # /proc/self/fd/X. This ensure thats gnulib's replacements are used
- # instead.
- export ac_cv_func_faccessat=no
- export ac_cv_func_fchdir=no
- # Force replacement fstatat to be used
- export gl_cv_func_fstatat_zero_flag=no
-
- # sigaction is provided by nacl_io but configure mis-detects it as missing
- export ac_cv_func_sigaction=yes
-
- # configure guesses this wrong since we are cross compiling
- export gl_cv_func_open_directory_works=yes
- fi
-
- export ac_list_mounted_fs=found
-
- # Ensure that configure know that we have a working getcwd() implementation
- export gl_cv_func_getcwd_null=yes
- export gl_cv_func_getcwd_path_max=yes
- export gl_cv_func_getcwd_abort_bug=no
-
- # Without this coreutils will link with -Wl,--as-needed which causes
- # incorrect link order with nacl_io and pthead.
- export gl_cv_prog_c_ignore_unused_libraries=none
-
- # Perl is used to generate man pages by running commands with --help, but
- # we are cross compiling so this doesn't work. Telling configure that perl
- # is missing sovles this issues as the expense of missing man pages.
- export PERL=missing
-
- # TODO(bradnelson): Re-enable when bots have a newer texinfo.
- # Disabling texinfo, as the version on the bots is too old.
- export MAKEINFO=true
-
- DefaultConfigureStep
-}
diff --git a/ports/coreutils/nacl.patch b/ports/coreutils/nacl.patch
deleted file mode 100644
index bcad3d8..0000000
--- a/ports/coreutils/nacl.patch
+++ /dev/null
@@ -1,277 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -39821,7 +39821,7 @@ fi
-
-
- # Determine how to get the list of mounted file systems.
--ac_list_mounted_fs=
-+ac_list_mounted_fs:=
-
- # If the getmntent function is available but not in the standard library,
- # make sure LIBS contains the appropriate -l option.
-diff --git a/lib/cycle-check.c b/lib/cycle-check.c
---- a/lib/cycle-check.c
-+++ b/lib/cycle-check.c
-@@ -58,7 +58,12 @@ bool
- cycle_check (struct cycle_check_state *state, struct stat const *sb)
- {
- assure (state->magic == CC_MAGIC);
--
-+ /*
-+ * TODO(bradnelson): Drop this once we have real looking inodes.
-+ * nacl_io doesn't provide sufficiently real inodes to allow this
-+ * cycle check to work.
-+ */
-+#if !defined(__native_client__)
- /* If the current directory ever happens to be the same
- as the one we last recorded for the cycle detection,
- then it's obviously part of a cycle. */
-@@ -80,6 +85,7 @@ cycle_check (struct cycle_check_state *state, struct stat const *sb)
- state->dev_ino.st_dev = sb->st_dev;
- state->dev_ino.st_ino = sb->st_ino;
- }
-+#endif
-
- return false;
- }
-diff --git a/lib/getpass.c b/lib/getpass.c
---- a/lib/getpass.c
-+++ b/lib/getpass.c
-@@ -105,7 +105,9 @@ getpass (const char *prompt)
- else
- {
- /* We do the locking ourselves. */
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- __fsetlocking (tty, FSETLOCKING_BYCALLER);
-+#endif
-
- out = in = tty;
- }
-diff --git a/lib/same-inode.h b/lib/same-inode.h
---- a/lib/same-inode.h
-+++ b/lib/same-inode.h
-@@ -18,6 +18,12 @@
- #ifndef SAME_INODE_H
- # define SAME_INODE_H 1
-
-+/*
-+ * TODO(bradnelson): Drop this once nacl_io inode support is better.
-+ */
-+#if defined(__native_client__)
-+# define SAME_INODE(Stat_buf_1, Stat_buf_2) 1
-+#else
- # ifdef __VMS
- # define SAME_INODE(a, b) \
- ((a).st_ino[0] == (b).st_ino[0] \
-@@ -29,5 +35,6 @@
- ((a).st_ino == (b).st_ino \
- && (a).st_dev == (b).st_dev)
- # endif
-+#endif
-
- #endif
-diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
---- a/lib/sys_types.in.h
-+++ b/lib/sys_types.in.h
-@@ -20,6 +20,18 @@
- #endif
- @PRAGMA_COLUMNS@
-
-+/*
-+ * Workaround for old newlib toolchain incompatability with gnulib
-+ * This was fixed in the native_client repo but the newlib toolchain
-+ * is not longer being updated:
-+ * https://codereview.chromium.org/1163893003
-+ */
-+#ifndef __nlink_t_defined
-+#define __nlink_t_defined
-+typedef unsigned int __nlink_t;
-+typedef __nlink_t nlink_t;
-+#endif
-+
- #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
-
- /* The include_next requires a split double-inclusion guard. */
-diff --git a/src/chroot.c b/src/chroot.c
---- a/src/chroot.c
-+++ b/src/chroot.c
-@@ -325,7 +325,11 @@ main (int argc, char **argv)
- #endif
- }
-
-+#if defined(__native_client__)
-+ errno = ENOSYS;
-+#else
- if (chroot (newroot) != 0)
-+#endif
- error (EXIT_CANCELED, errno, _("cannot change root directory to %s"),
- quote (newroot));
-
-diff --git a/src/copy.c b/src/copy.c
---- a/src/copy.c
-+++ b/src/copy.c
-@@ -2632,6 +2632,10 @@ copy_internal (char const *src_name, char const *dst_name,
- }
- else if (S_ISBLK (src_mode) || S_ISCHR (src_mode) || S_ISSOCK (src_mode))
- {
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ error (0, ENOSYS, _("cannot create special file %s"), quote (dst_name));
-+ goto un_backup;
-+#else
- if (mknod (dst_name, src_mode & ~omitted_permissions, src_sb.st_rdev)
- != 0)
- {
-@@ -2639,6 +2643,7 @@ copy_internal (char const *src_name, char const *dst_name,
- quote (dst_name));
- goto un_backup;
- }
-+#endif
- }
- else if (S_ISLNK (src_mode))
- {
-diff --git a/src/df.c b/src/df.c
---- a/src/df.c
-+++ b/src/df.c
-@@ -1669,12 +1669,16 @@ main (int argc, char **argv)
- }
- }
-
-+#if defined(__native_client__)
-+ mount_list = NULL;
-+#else
- mount_list =
- read_file_system_list ((fs_select_list != NULL
- || fs_exclude_list != NULL
- || print_type
- || field_data[FSTYPE_FIELD].used
- || show_local_fs));
-+#endif
-
- if (mount_list == NULL)
- {
-@@ -1696,8 +1700,10 @@ main (int argc, char **argv)
- _("cannot read table of mounted file systems"));
- }
-
-+#if !defined(__native_client__)
- if (require_sync)
- sync ();
-+#endif
-
- get_field_list ();
- get_header ();
-diff --git a/src/fs.h b/src/fs.h
---- a/src/fs.h
-+++ b/src/fs.h
-@@ -2,7 +2,10 @@
- Please send additions to bug-coreutils@gnu.org and meskes@debian.org.
- This file is generated automatically from ./src/stat.c. */
-
--#if defined __linux__
-+/* nacl_io does not have statfs so the following magic numbers which
-+ specify the type of a filesystem is useless, but we need their
-+ definitions to compile everything in coreutils. */
-+#if defined __linux__ || defined __native_client__
- # define S_MAGIC_ADFS 0xADF5
- # define S_MAGIC_AFFS 0xADFF
- # define S_MAGIC_AFS 0x5346414F
-diff --git a/src/hostid.c b/src/hostid.c
---- a/src/hostid.c
-+++ b/src/hostid.c
-@@ -75,7 +75,11 @@ main (int argc, char **argv)
- usage (EXIT_FAILURE);
- }
-
-+#if defined(__native_client__)
-+ id = 0x12345678;
-+#else
- id = gethostid ();
-+#endif
-
- /* POSIX says gethostid returns a "32-bit identifier" but is silent
- whether it's sign-extended. Turn off any sign-extension. This
-diff --git a/src/mknod.c b/src/mknod.c
---- a/src/mknod.c
-+++ b/src/mknod.c
-@@ -248,8 +248,12 @@ main (int argc, char **argv)
- if (set_security_context)
- defaultcon (argv[optind], node_type);
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ error (EXIT_FAILURE, ENOSYS, "%s", quote (argv[optind]));
-+#else
- if (mknod (argv[optind], newmode | node_type, device) != 0)
- error (EXIT_FAILURE, errno, "%s", quote (argv[optind]));
-+#endif
- }
- break;
-
-diff --git a/src/shred.c b/src/shred.c
---- a/src/shred.c
-+++ b/src/shred.c
-@@ -355,7 +355,9 @@ dosync (int fd, char const *qname)
- return -1;
- }
-
-+#if !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- sync ();
-+#endif
- return 0;
- }
-
-diff --git a/src/stat.c b/src/stat.c
---- a/src/stat.c
-+++ b/src/stat.c
-@@ -210,6 +210,7 @@ static char const *trailing_delim = "";
- static char const *decimal_point;
- static size_t decimal_point_len;
-
-+#if !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- /* Return the type of the specified file system.
- Some systems have statfvs.f_basetype[FSTYPSZ] (AIX, HP-UX, and Solaris).
- Others have statvfs.f_fstypename[_VFS_NAMELEN] (NetBSD 3.0).
-@@ -530,6 +531,7 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
- }
- #endif
- }
-+#endif
-
- static char * ATTRIBUTE_WARN_UNUSED_RESULT
- human_access (struct stat const *statbuf)
-@@ -742,6 +744,7 @@ out_file_context (char *pformat, size_t prefix_len, char const *filename)
- return fail;
- }
-
-+#if !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- /* Print statfs info. Return zero upon success, nonzero upon failure. */
- static bool ATTRIBUTE_WARN_UNUSED_RESULT
- print_statfs (char *pformat, size_t prefix_len, unsigned int m,
-@@ -828,6 +831,7 @@ print_statfs (char *pformat, size_t prefix_len, unsigned int m,
- }
- return fail;
- }
-+#endif
-
- /* Return any bind mounted source for a path.
- The caller should not free the returned buffer.
-@@ -1258,6 +1262,7 @@ print_it (char const *format, int fd, char const *filename,
- static bool ATTRIBUTE_WARN_UNUSED_RESULT
- do_statfs (char const *filename, char const *format)
- {
-+#if !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- STRUCT_STATVFS statfsbuf;
-
- if (STREQ (filename, "-"))
-@@ -1276,6 +1281,11 @@ do_statfs (char const *filename, char const *format)
-
- bool fail = print_it (format, -1, filename, print_statfs, &statfsbuf);
- return ! fail;
-+#else
-+ error (0, ENOSYS, _("cannot read file system information for %s"),
-+ quote (filename));
-+ return false;
-+#endif
- }
-
- /* stat the file and print what we find */
diff --git a/ports/coreutils/pkg_info b/ports/coreutils/pkg_info
deleted file mode 100644
index 9539c84..0000000
--- a/ports/coreutils/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=coreutils
-VERSION=8.24
-URL=http://ftp.gnu.org/gnu/coreutils/coreutils-8.24.tar.xz
-LICENSE=GPL
-DEPENDS=(nacl-spawn)
-SHA1=cf3d9983461c2b0c074a76804c18464e9a474883
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/cups/README.nacl b/ports/cups/README.nacl
deleted file mode 100644
index d2de1bd..0000000
--- a/ports/cups/README.nacl
+++ /dev/null
@@ -1,3 +0,0 @@
-This is only a partial port of cups. Its goal is to provide libcups and
-libcups-image libraries that printer drivers can link against. Network
-functionality is untested. The cups spooler is explicitly not part of this port.
\ No newline at end of file
diff --git a/ports/cups/build.sh b/ports/cups/build.sh
deleted file mode 100644
index abb838a..0000000
--- a/ports/cups/build.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-# Copyright 2015 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_CONFIGURE_PATH=${BUILD_DIR}/configure
-
-EXTRA_CONFIGURE_ARGS="--prefix=${DESTDIR}/payload"
-EXTRA_CONFIGURE_ARGS+=" --with-components=core-and-image"
-EXTRA_CONFIGURE_ARGS+=" --disable-gssapi --disable-threads"
-
-
-ConfigureStep() {
- EnableGlibcCompat
-
- if [ "${NACL_LIBC}" = "newlib" ]; then
- EXTRA_CONFIGURE_ARGS+=" --disable-shared --enable-static"
- export LSB_BUILD="y"
- fi
-
- # Copy all sources to the build directory because cups does not support
- # out-of-tree builds.
- LogExecute cp -R ${SRC_DIR}/* .
-
- DefaultConfigureStep
-}
diff --git a/ports/cups/nacl.patch b/ports/cups/nacl.patch
deleted file mode 100644
index 102c4b0..0000000
--- a/ports/cups/nacl.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/Makedefs.in b/Makedefs.in
---- a/Makedefs.in
-+++ b/Makedefs.in
-@@ -40,14 +40,14 @@ SHELL = /bin/sh
- # Installation programs...
- #
-
--INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
-+INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
- INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
- INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
- INSTALL_DATA = $(INSTALL) -c -m 444
- INSTALL_DIR = $(INSTALL) -d
--INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
-+INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
- INSTALL_MAN = $(INSTALL) -c -m 444
--INSTALL_SCRIPT = $(INSTALL) -c -m 555
-+INSTALL_SCRIPT = $(INSTALL) -c -m 755
-
- #
- # Default user, group, and system groups for the scheduler...
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -20,7 +20,7 @@ include Makedefs
- # Directories to make...
- #
-
--DIRS = cups test $(BUILDDIRS)
-+DIRS = cups $(BUILDDIRS)
-
-
- #
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -5928,6 +5928,10 @@ case "$COMPONENTS" in
- BUILDDIRS="data locale"
- ;;
-
-+ core-and-image)
-+ BUILDDIRS="data filter locale"
-+ ;;
-+
- *)
- as_fn_error $? "Bad build component \"$COMPONENT\" specified!" "$LINENO" 5
- ;;
-diff --git a/cups/backchannel.c b/cups/backchannel.c
---- a/cups/backchannel.c
-+++ b/cups/backchannel.c
-@@ -28,6 +28,7 @@
- # include <sys/time.h>
- #endif /* WIN32 */
-
-+#include <sys/select.h>
-
- /*
- * Local functions...
diff --git a/ports/cups/pkg_info b/ports/cups/pkg_info
deleted file mode 100644
index ad9c7d1..0000000
--- a/ports/cups/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=cups
-VERSION=2.1.0
-URL=https://www.cups.org/software/2.1.0/cups-2.1.0-source.tar.bz2
-LICENSE=CUSTOM:LICENSE.txt
-SHA1=92332b6785471b388929913be780d557ac00b7d0
-DEPENDS=(glibc-compat)
-BUILD_OS=linux
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/curl/README.nacl b/ports/curl/README.nacl
deleted file mode 100644
index 3ad40f5..0000000
--- a/ports/curl/README.nacl
+++ /dev/null
@@ -1,10 +0,0 @@
-libcurl port to Native Client
-=============================
-
-This package builds both libcurl and the curl executable.
-
-The sel_ldr build of curl doesn't work because there is no
-socket support.
-
-The ppapi (chrome) version of curl is published to
-out/publish/curl.
diff --git a/ports/curl/build.sh b/ports/curl/build.sh
deleted file mode 100644
index 8b24a57..0000000
--- a/ports/curl/build.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 2013 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.
-
-export ac_cv_func_gethostbyname=yes
-export ac_cv_func_getaddrinfo=no
-export ac_cv_func_connect=yes
-
-# Can't use LIBS here otherwise nacl-spawn gets linked into the libcurl.so
-# which we don't ever want.
-export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
-NACLPORTS_LDFLAGS+=" ${NACL_CLI_MAIN_LDFLAGS}"
-
-EnableGlibcCompat
-
-EXECUTABLES="src/curl${NACL_EXEEXT}"
-
-EXTRA_CONFIGURE_ARGS+=" --without-libssh2"
-if [ "${NACL_DEBUG}" = "1" ]; then
- NACLPORTS_CPPFLAGS+=" -DDEBUGBUILD"
- EXTRA_CONFIGURE_ARGS+=" --enable-debug --disable-curldebug"
-fi
-
-InstallStep() {
- DefaultInstallStep
- MakeDir ${DESTDIR}${PREFIX}/share/curl
- LogExecute ${SRC_DIR}/lib/mk-ca-bundle.pl \
- ${DESTDIR}${PREFIX}/share/curl/ca-bundle.crt
-}
-
-PublishStep() {
- if [ "${NACL_SHARED}" = "1" ]; then
- EXECUTABLE_DIR=.libs
- else
- EXECUTABLE_DIR=.
- fi
-
- MakeDir ${PUBLISH_DIR}
-
- local exe=${PUBLISH_DIR}/curl_${NACL_ARCH}${NACL_EXEEXT}
-
- LogExecute cp ${DESTDIR}${PREFIX}/share/curl/ca-bundle.crt ${PUBLISH_DIR}
- LogExecute cp src/${EXECUTABLE_DIR}/curl${NACL_EXEEXT} ${exe}
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- LogExecute ${PNACLFINALIZE} ${exe}
- fi
-
- pushd ${PUBLISH_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${PUBLISH_DIR}/curl*${NACL_EXEEXT} \
- -L${DESTDIR_LIB} \
- -s . \
- -o curl.nmf
- popd
-
- InstallNaClTerm ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/index.html ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/curl.js ${PUBLISH_DIR}
-}
diff --git a/ports/curl/curl.js b/ports/curl/curl.js
deleted file mode 100644
index 2134035..0000000
--- a/ports/curl/curl.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-NaClTerm.nmf = 'curl.nmf';
diff --git a/ports/curl/diff_skip.txt b/ports/curl/diff_skip.txt
deleted file mode 100644
index 1c0d86a..0000000
--- a/ports/curl/diff_skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-include/curl/curlbuild.h
diff --git a/ports/curl/index.html b/ports/curl/index.html
deleted file mode 100644
index f250816..0000000
--- a/ports/curl/index.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>curl</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="curl.js"></script>
-
- <style type="text/css">
- #terminal {
- width: 90%;
- height: 500px;
- position: relative;
- }
- </style>
- </head>
- <body>
- <h1>curl example application</h1>
- <p>This page embeds the curl executable (command line interface to libcurl)
- built with NaCl. Because it needs to use the chrome socket API, chrome
- must be lunched with --allow-nacl-socket-api=localhost (or whatever host
- you are loading this page from).</p>
- Arguments can be passed to curl using the following form, or by adding
- "arg1", "arg2", etc to the URL query paramaters.
- <form>
- Arg1: <input type="text" name="arg1" value="--verbose">
- Arg2: <input type="text" name="arg2" value="--insecure">
- Arg4: <input type="text" name="arg3" value="https://www.google.com">
- <input type="submit" value="Run">
- </form>
- <p>The terminal window below shows the output of curl.</p>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/curl/nacl.patch b/ports/curl/nacl.patch
deleted file mode 100644
index 8dc2e8b..0000000
--- a/ports/curl/nacl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/lib/hostip4.c b/lib/hostip4.c
---- a/lib/hostip4.c
-+++ b/lib/hostip4.c
-@@ -115,6 +115,12 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
-
- #if defined(CURLRES_IPV4) && !defined(CURLRES_ARES)
-
-+#ifdef __native_client__
-+// nacl_io does not yet support gethostbyname_r().
-+// TODO(sbc): remove this once it is added to nacl_io: http://crbug.com/387474
-+#undef HAVE_GETHOSTBYNAME_R
-+#endif
-+
- /*
- * Curl_ipv4_resolve_r() - ipv4 threadsafe resolver function.
- *
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -749,7 +749,7 @@ clean-binPROGRAMS:
-
- curl$(EXEEXT): $(curl_OBJECTS) $(curl_DEPENDENCIES) $(EXTRA_curl_DEPENDENCIES)
- @rm -f curl$(EXEEXT)
-- $(AM_V_CCLD)$(curl_LINK) $(curl_OBJECTS) $(curl_LDADD) $(LIBS)
-+ $(AM_V_CCLD)$(curl_LINK) $(curl_OBJECTS) $(curl_LDADD) $(LIBS) $(EXTRA_LIBS)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT)
diff --git a/ports/curl/pkg_info b/ports/curl/pkg_info
deleted file mode 100644
index 6d1803e..0000000
--- a/ports/curl/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=curl
-VERSION=7.44.0
-URL=http://curl.haxx.se/download/curl-7.44.0.tar.bz2
-LICENSE=CUSTOM:README
-SHA1=879a186944e7b06e619a2eb07cef729b5702345c
-DEPENDS=(openssl nacl-spawn)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/damageproto/pkg_info b/ports/damageproto/pkg_info
deleted file mode 100644
index dad24b5..0000000
--- a/ports/damageproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=damageproto
-VERSION=1.2.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/damageproto-1.2.1.tar.bz2
-LICENSE=GPL
-SHA1=bd0f0f4dc8f37eaabd9279d10fe2889710507358
diff --git a/ports/devenv-latest/build.sh b/ports/devenv-latest/build.sh
deleted file mode 100644
index c48a987..0000000
--- a/ports/devenv-latest/build.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- # Build a local package index of pkg files
- Banner "Building pkg for host"
- ${NACL_SRC}/build_tools/build_repo.sh -l
-}
-
-InstallStep() {
- # Meta package, no install.
- return
-}
-
-PostInstallTestStep() {
- local arches=
- if [[ ${OS_NAME} == Darwin && ${NACL_ARCH} == x86_64 ]]; then
- echo "Skipping devenv tests on unsupported mac + x86_64 configuration."
- elif [[ ${NACL_ARCH} == arm ]]; then
- echo "Skipping devenv tests on arm for now."
- elif [[ ${NACL_ARCH} == pnacl ]]; then
- arches="i686 x86_64"
- else
- arches="${NACL_ARCH}"
- fi
- for arch in ${arches}; do
- LogExecute python ${START_DIR}/../devenv/devenv_large_test.py \
- -p latest=1 \
- -C ${NACL_SRC}/out/publish \
- -x -v -a ${arch}
- # TODO(bradnelson): Enable this when dependencies are right.
- #LogExecute python ${START_DIR}/../devenv/io2014_test.py \
- # -p latest=1 \
- # -C ${NACL_SRC}/out \
- # -x -v -a ${arch}
- done
-}
diff --git a/ports/devenv-latest/pkg_info b/ports/devenv-latest/pkg_info
deleted file mode 100644
index 5fbce8b..0000000
--- a/ports/devenv-latest/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=devenv-latest
-VERSION=0.1
-# Currently only builds on linux (due to dependency on openssl)
-BUILD_OS=linux
-DEPENDS=(grep corelibs devenv coreutils git make python curl nano vim findutils less)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/devenv/README.nacl b/ports/devenv/README.nacl
deleted file mode 100644
index 028f287..0000000
--- a/ports/devenv/README.nacl
+++ /dev/null
@@ -1,9 +0,0 @@
-NaCl Development Environment
-=============================
-
-An in-browser command line development environment for Native
-Client with support for various editor, compilers and scripting
-languages.
-
-The included `which` script was taken from the debianutils
-package which in Ubuntu.
diff --git a/ports/devenv/background.js b/ports/devenv/background.js
deleted file mode 100644
index 1373119..0000000
--- a/ports/devenv/background.js
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals NaClProcessManager, makeRootDir */
-
-'use strict';
-
-function newWindow() {
- chrome.app.window.create('bash.html', {
- 'bounds': {
- 'width': 800,
- 'height': 600,
- },
- });
-}
-
-chrome.app.runtime.onLaunched.addListener(function() {
- newWindow();
-});
-
-chrome.runtime.onMessage.addListener(
- function(request, sender, sendResponse) {
- if (request.name === 'new_window') {
- newWindow();
- }
- }
-);
-
-chrome.runtime.onMessageExternal.addListener(
- function(request, sender, sendResponse) {
- if (request.name === 'ping') {
- sendResponse({name: 'pong'});
- }
- }
-);
-
-chrome.runtime.onConnectExternal.addListener(function(port) {
- var files = new FileManager();
- var manager = new NaClProcessManager();
- // Assume a default terminal size for headless processes.
- manager.onTerminalResize(80, 24);
- manager.setStdoutListener(function(output) {
- port.postMessage({name: 'nacl_stdout', output: output});
- });
-
- function fileReply(name, data) {
- return function() {
- port.postMessage({name: name, data: data});
- };
- }
- function fileError(name) {
- return function(error) {
- port.postMessage({name: name, error: error.message});
- };
- }
-
- port.onMessage.addListener(function(msg) {
- switch (msg.name) {
- case 'nacl_spawn':
- var handleSuccess = function(naclType) {
- manager.spawn(
- msg.nmf, msg.argv, msg.envs, msg.cwd, naclType, null, -1,
- function(pid) {
- port.postMessage({name: 'nacl_spawn_reply', pid: pid});
- });
- };
- var handleFailure = function(message) {
- port.postMessage({name: 'nacl_spawn_reply', pid: -1,
- message: message});
- };
- if ('naclType' in msg) {
- handleSuccess(msg.naclType);
- } else {
- manager.checkUrlNaClManifestType(
- msg.nmf, handleSuccess, handleFailure);
- }
- break;
- case 'nacl_waitpid':
- manager.waitpid(msg.pid, msg.options, function(pid, status) {
- port.postMessage({
- name: 'nacl_waitpid_reply',
- pid: pid,
- status: status
- });
- });
- break;
- case 'nacl_sigint':
- manager.sigint();
- break;
- case 'set_local_repo':
- /*
- * Modify /usr/etc/pkg/repos/Local.conf, updating the URL and
- * enabling the repo.
- * Also, disable /usr/etc/pkg/repos/NaCl.conf.
- */
- console.log('set_local_repo');
- var local_repo_file = '/usr/etc/pkg/repos/Local.conf';
- files.readText(local_repo_file).then(function(data) {
- data = data.replace('http://localhost:5103', msg.data);
- data = data.replace('ENABLED: NO', 'ENABLED: YES', data);
- return files.writeText(local_repo_file, data);
- }).then(function() {
- var repo_file = '/usr/etc/pkg/repos/NaCl.conf';
- files.readText(repo_file).then(function(data) {
- data = data.replace('ENABLED: YES', 'ENABLED: NO', data);
- return files.writeText(repo_file, data);
- });
- }).then(
- fileReply('set_local_repo_reply'),
- fileError('set_local_repo_error')
- );
- break;
- case 'file_init':
- files.init().then(
- fileReply('file_init_reply'), fileError('file_init_error'));
- break;
- case 'file_read':
- files.readText(msg.file).then(function(data) {
- port.postMessage({
- name: 'file_read_reply',
- data: data
- });
- }, fileError('file_read_error'));
- break;
- case 'file_write':
- files.writeText(msg.file, msg.data).then(
- fileReply('file_write_reply'), fileError('file_write_error'));
- break;
- case 'file_remove':
- files.remove(msg.file).then(
- fileReply('file_remove_reply'), fileError('file_remove_error'));
- break;
- case 'file_mkdir':
- files.makeDirectory(msg.file).then(
- fileReply('file_mkdir_reply'), fileError('file_mkdir_error'));
- break;
- case 'file_rm_rf':
- files.removeDirectory(msg.file).then(
- fileReply('file_rm_rf_reply'), fileError('file_rm_rf_error'));
- break;
-
- default:
- port.postMessage({name: 'unknown_error', error: 'unknown message'});
- }
- });
-});
-
-/**
- * Access the HTML5 Filesystem.
- */
-function FileManager() {
- this.persistentFs = null;
- this.temporaryFs = null;
- this.isInitialized = false;
-}
-
-/**
- * The size of the requested HTML5 file system, in bytes.
- * @type {number}
- */
-FileManager.FS_SIZE = 1024*1024;
-
-/**
- * The path to the tmp directory.
- * @const
- */
-FileManager.TMP_MOUNT_POINT = '/tmp';
-
-/**
- * The error thrown when the user tries to perform file operations before the
- * file system has been initialized.
- * @const
- */
-FileManager.FS_NOT_INITIALIZED = 'File system not initialized.';
-
-/**
- * Translate a path from the point of view of NaCl to an HTML5 file system and
- * a path within that file system.
- * @param {string} path The path to be translated.
- * @returns {Object} pathInfo An object containing the filesystem and path.
- * @returns {FileSystem} pathInfo.fs The HTML5 filesystem.
- * @returns {string} pathInfo.path The translated path.
- */
-FileManager.prototype.translatePath = function(path) {
- if (path.indexOf(FileManager.TMP_MOUNT_POINT) === 0) {
- return {
- fs: this.temporaryFs,
- path: path.replace(FileManager.TMP_MOUNT_POINT, '')
- };
- } else {
- return {
- fs: this.persistentFs,
- path: NaClProcessManager.fsroot + path
- };
- }
-};
-
-/**
- * Initialize the file systems. This must be called before any file operations
- * can be performed.
- */
-FileManager.prototype.init = function() {
- var self = this;
-
- function requestFs(type) {
- return new Promise(function(resolve, reject) {
- window.webkitRequestFileSystem(type, FileManager.FS_SIZE,
- resolve, reject);
- });
- }
-
- return Promise.all([
- requestFs(window.PERSISTENT),
- requestFs(window.TEMPORARY),
- ]).then(function(filesystems) {
- self.persistentFs = filesystems[0];
- self.temporaryFs = filesystems[1];
- self.isInitialized = true;
- }).then(makeRootDir);
-};
-
-/**
- * Read the contents of a text file.
- * @param {string} fileName The name of the file to be read.
- */
-FileManager.prototype.readText = function(fileName) {
- var self = this;
- return new Promise(function(resolve, reject) {
- if (!self.isInitialized) {
- reject(new Error(FileManager.FS_NOT_INITIALIZED));
- return;
- }
-
- var pathInfo = self.translatePath(fileName);
- pathInfo.fs.root.getFile(pathInfo.path, {}, function(fe) {
- fe.file(function(file) {
- var reader = new FileReader();
- reader.onload = function(e) {
- resolve(this.result);
- };
- reader.onerror = function(e) {
- reject(new Error(e.message));
- };
- reader.readAsText(file);
- }, reject);
- }, reject);
- });
-};
-
-/**
- * Write a string to a text file.
- * @param {string} fileName The name of the destination file.
- * @param {string} fileName The text to be written.
- */
-FileManager.prototype.writeText = function(fileName, content) {
- var self = this;
- return new Promise(function(resolve, reject) {
- if (!self.isInitialized) {
- reject(new Error(FileManager.FS_NOT_INITIALIZED));
- return;
- }
-
- var pathInfo = self.translatePath(fileName);
- pathInfo.fs.root.getFile(pathInfo.path, {create: true}, function(fe) {
- fe.createWriter(onCreateWriter, reject);
- }, reject);
-
- function onCreateWriter(writer) {
- var blob = new Blob([content], {type:'text/plain'});
- // Discard arguments.
- writer.onwriteend = function() {
- // truncate done, write data
- if (writer.length === 0)
- writer.write(blob);
- else
- resolve();
- };
- writer.onerror = reject;
- writer.truncate(0);
- }
- });
-};
-
-/**
- * Remove a file from the filesystem. This does not work on directories.
- * @param {string} fileName The name of the file.
- */
-FileManager.prototype.remove = function(fileName) {
- var self = this;
- return new Promise(function(resolve, reject) {
- if (!self.isInitialized) {
- reject(new Error(FileManager.FS_NOT_INITIALIZED));
- return;
- }
-
- var pathInfo = self.translatePath(fileName);
- pathInfo.fs.root.getFile(pathInfo.path, {}, function(fe) {
- fe.remove(resolve, reject);
- }, reject);
- });
-};
-
-/**
- * Create a directory.
- * @param {string} fileName The name of the directory.
- */
-FileManager.prototype.makeDirectory = function(fileName) {
- var self = this;
- return new Promise(function(resolve, reject) {
- if (!self.isInitialized) {
- reject(new Error(FileManager.FS_NOT_INITIALIZED));
- return;
- }
-
- var pathInfo = self.translatePath(fileName);
- pathInfo.fs.root.getDirectory(pathInfo.path, {create: true}, function() {
- resolve();
- }, reject);
- });
-};
-
-/**
- * Remove a directory and its contents.
- * @param {string} fileName The name of the directory.
- */
-FileManager.prototype.removeDirectory = function(fileName) {
- var self = this;
- return new Promise(function(resolve, reject) {
- if (!self.isInitialized) {
- reject(new Error(FileManager.FS_NOT_INITIALIZED));
- return;
- }
-
- var pathInfo = self.translatePath(fileName);
- pathInfo.fs.root.getDirectory(pathInfo.path, {}, function(dir) {
- dir.removeRecursively(function() {
- resolve();
- }, reject);
- }, reject);
- });
-};
diff --git a/ports/devenv/bash.js b/ports/devenv/bash.js
deleted file mode 100644
index 6e04d09..0000000
--- a/ports/devenv/bash.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-/* globals g_mount, lib, hterm, NaClTerm, makeRootDir, initMounter */
-/* globals mounter: true, mounterHeader: true, mounterBackground: true */
-/* globals mounterThumb: true, MounterClient */
-
-'use strict';
-
-function addMount(mountPoint, entry, localPath, mounted) {
- g_mount.mountPoint = mountPoint;
- g_mount.entry = entry;
- g_mount.localPath = localPath;
- g_mount.mounted = mounted;
- g_mount.entryId = '';
-}
-
-function handleChooseFolder(mount, callback) {
- chrome.fileSystem.chooseEntry({'type': 'openDirectory'}, function(entry) {
- chrome.fileSystem.getDisplayPath(entry, function(path) {
- mount.entry = entry;
- mount.filesystem = entry.filesystem;
- mount.fullPath = entry.fullPath;
- mount.entryId = chrome.fileSystem.retainEntry(entry);
- mount.localPath = path;
- chrome.storage.local.set({oldMounts: [mount.entryId]}, callback);
- });
- });
-}
-
-function restoreMount(mount, callback) {
- // Skip restore mount if running in a page, so we don't get stuck.
- if (chrome.storage === undefined) {
- callback();
- return;
- }
- chrome.storage.local.get('oldMounts', function(items) {
- var oldMounts = items['oldMounts'];
- if (oldMounts === undefined || oldMounts.length === 0) {
- callback();
- return;
- }
- // TODO(gdeepti): Support multiple mounts.
- chrome.fileSystem.restoreEntry(oldMounts[0], function(entry) {
- chrome.fileSystem.getDisplayPath(entry, function(path) {
- mount.entry = entry;
- mount.filesystem = entry.filesystem;
- mount.fullPath = entry.fullPath;
- mount.entryId = chrome.fileSystem.retainEntry(entry);
- mount.localPath = path;
- callback();
- });
- });
- });
-}
-
-function handleMount(mount, callback) {
- mount.operationId = 'mount';
- mount.available = true;
- mount.mounted = false;
- var message = {};
- message.mount = mount;
- window.term_.command.processManager.broadcastMessage(message, callback);
-}
-
-function handleUnmount(mount, callback) {
- mount.operationId = 'unmount';
- mount.available = false;
- var message = {};
- message.unmount = mount;
- window.term_.command.processManager.broadcastMessage(message, callback);
- addMount('/mnt/local/', null, '', false);
- chrome.storage.local.remove('oldMounts', function() {});
-}
-
-function initMountSystem() {
- var terminal = document.getElementById('terminal');
- var mounterClient = new MounterClient(g_mount, handleChooseFolder,
- handleMount, handleUnmount, terminal);
- addMount('/mnt/local/', null, '', false);
- restoreMount(g_mount, function() {
- initMounter(false, mounterClient, function(update) {
- // Mount any restore mount.
- if (g_mount.entryId !== '') {
- handleMount(g_mount, update);
- }
- });
- });
-}
-
-NaClTerm.nmf = 'bash.nmf';
-NaClTerm.argv = ['--login'];
-NaClTerm.env = [
- 'NACL_DATA_MOUNT_FLAGS=manifest=/manifest.txt',
- // Signals to /etc/profile to install the base packages on first
- // use. By default (for testing) no packages are installed.
- 'INSTALL_BASE_PACKAGES=1',
-];
-
-// Uncomment this line to use only locally built packages
-//NaClTerm.env.push('NACL_DEVENV_LOCAL=1')
-// Uncomment this line to enable pepper_simple logging
-//NaClTerm.env.push('PS_VERBOSITY=3')
-
-function allocateStorage() {
- // Request 10GB storage.
- return new Promise(function(resolve, reject) {
- navigator.webkitPersistentStorage.requestQuota(
- 10 * 1024 * 1024 * 1024,
- function(grantedBytes) {
- resolve();
- },
- function() {
- console.log("Failed to allocate space!\n");
- reject();
- }
- );
- });
-}
-
-window.onload = function() {
- mounterBackground = document.createElement('div');
- mounterBackground.id = 'mounterBackground';
- mounter = document.createElement('div');
- mounter.id = 'mounter';
- mounterHeader = document.createElement('div');
- mounterHeader.id = 'mounterHeader';
- var text = document.createTextNode('Folders Mounted');
- mounterHeader.appendChild(text);
- mounter.appendChild(mounterHeader);
- mounterBackground.appendChild(mounter);
- var mounterSpacer = document.createElement('div');
- mounterSpacer.id = 'mounterSpacer';
-
- mounterBackground.appendChild(mounterSpacer);
- mounterThumb = document.createElement('div');
- mounterThumb.id = 'mounterThumb';
- var sp = document.createElement("span");
- var spText = document.createTextNode('. . .');
- sp.appendChild(spText);
- mounterThumb.appendChild(sp);
- mounterBackground.appendChild(mounterThumb);
- document.body.appendChild(mounterBackground);
-
- lib.init(function() {
- allocateStorage()
- .then(initMountSystem)
- .then(makeRootDir)
- .then(NaClTerm.init);
- });
-};
-
-// Patch hterm to intercept Ctrl-Shift-N to create new windows.
-hterm.Keyboard.KeyMap.prototype.onCtrlN_ = function(e, keyDef) {
- if (e.shiftKey) {
- chrome.runtime.sendMessage({'name': 'new_window'});
- }
- return '\x0e';
-};
diff --git a/ports/devenv/bash_profile b/ports/devenv/bash_profile
deleted file mode 100755
index 6413269..0000000
--- a/ports/devenv/bash_profile
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-# This is for bash on NaCl. Note that you cannot use external commands
-# until the installation is completed. Also, you cannot use features
-# which nacl_io does not support yet (e.g., pipes and sub-shells).
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-
-# PACKAGE_LIB_DIR is still used by the devenv tests
-# TODO(sbc): remove this and move it into devenv test code somehow
-if [[ ${NACL_ARCH} == x86_64 ]]; then
- PACKAGE_LIB_DIR=lib64
-else
- PACKAGE_LIB_DIR=lib32
-fi
-
-LD_LIBRARY_PATH=/lib:/usr/lib:/usr/${NACL_ARCH}-nacl/usr/lib
-LD_LIBRARY_PATH+=:/mnt/http/_platform_specific/${NACL_ARCH}
-LIBRARY_PATH=${LD_LIBRARY_PATH}
-PATH+=:/mnt/http
-
-# Allow cross development by exporting alternate library paths.
-LIBRARY_PATH32=/usr/x86_64-nacl/lib32
-LIBRARY_PATH32+=:/usr/i686-nacl/usr/lib
-LIBRARY_PATH64=/usr/x86_64-nacl/lib
-LIBRARY_PATH64+=:/usr/x86_64-nacl/usr/lib
-
-export RUBYLIB=/usr/lib/ruby/2.0.0
-export RUBYLIB=${RUBYLIB}:${RUBYLIB}/${NACL_ARCH}-nacl
-
-# Allow ctrl-c to work.
-export ENABLE_CONTROL_C=1
-
-# TODO(bradnelson): Remove when we can install in a more normal location.
-# Usually this is in /etc/ssl/certs/, but we don't mount persistent storage
-# there yet.
-# Point git and curl at root certificates inside the curl package.
-export GIT_SSL_CAINFO=/usr/share/curl/ca-bundle.crt
-export CURL_CA_BUNDLE=/usr/share/curl/ca-bundle.crt
-
-export TOOLCHAIN=@TOOLCHAIN@
-export NACL_DEVENV=1
-export LIBRARY_PATH32
-export LIBRARY_PATH64
-export LD_LIBRARY_PATH
-export LIBRARY_PATH
-export PATH
-
-if [[ -n $INSTALL_BASE_PACKAGES ]]; then
- marker=/var/lib/devenv_setup_complete
- if [[ ! -e $marker ]]; then
- echo "Performing initial devenv setup"
- if /mnt/http/install-base-packages.sh; then
- mkdir -p /var/lib
- touch $marker
- else
- echo "*** devenv setup failed ***"
- fi
- fi
-fi
-
-cd ${HOME}
-
-if [[ -f ~/.bashrc ]]; then
- . ~/.bashrc
-fi
diff --git a/ports/devenv/bashrc b/ports/devenv/bashrc
deleted file mode 100644
index 41c0ddf..0000000
--- a/ports/devenv/bashrc
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2015 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.
-
-# Default user bashrc file for NaCl DevEnv. This gets executed by bash
-# for each interative shell.
-
-# some aliases
-alias ll='ls -alF'
-alias la='ls -A'
-alias l='ls -CF'
-alias vi='vim'
-alias ruby='ruby /bin/irb'
-alias emacs='ENABLE_CONTROL_C=0 emacs'
-
-# TODO(bradnelson): Drop this when we can install things in a more
-# normal location and when we include the git templates in the normal
-# location.
-# Disabling templatedir as our git package lacks a default template set.
-# Setting up a default git identity, since we lack /etc/passwd as
-# a fallback.
-# Setup default .gitconfig if it doesn't already exist.
-# Explictly use [[ ]] conditional here in case coreutils is missing.
-gitdirs=(/stamps/git*)
-if [[ ${#dirdirs[@]} -gt 0 && ! -e /home/user/.gitconfig ]]; then
- git config --global init.templatedir ""
- git config --global user.name "John Doe"
- git config --global user.email "john.doe@foo.com"
-fi
diff --git a/ports/devenv/build.sh b/ports/devenv/build.sh
deleted file mode 100644
index c618575..0000000
--- a/ports/devenv/build.sh
+++ /dev/null
@@ -1,201 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableCliMain
-NACLPORTS_CPPFLAGS+=" -Wall -Werror -Dpipe=nacl_spawn_pipe"
-NACLPORTS_CPPFLAGS+=" -isystem ${GTEST_SRC}/include"
-
-EXECUTABLES="tests/devenv_small_test_${NACL_ARCH}${NACL_EXEEXT} \
- jseval/jseval_${NACL_ARCH}${NACL_EXEEXT}"
-
-STORAGE_URL=https://naclports.storage.googleapis.com/builds
-SDK_VERSION=pepper_48
-BUILT_REVISION=trunk-703-gdb4edd8
-DEFAULT_SOURCE=${STORAGE_URL}/${SDK_VERSION}/${BUILT_REVISION}/publish
-LOCAL_SOURCE=http://localhost:5103
-
-BuildStep() {
- SetupCrossEnvironment
-
- # Build jseval module.
- MakeDir ${BUILD_DIR}/jseval
- LogExecute ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} \
- ${START_DIR}/jseval.c \
- -o ${BUILD_DIR}/jseval/jseval_${NACL_ARCH}${NACL_EXEEXT} \
- ${LIBS}
-
- # Build test module.
- MakeDir tests
- LogExecute ${CXX} ${CPPFLAGS} ${CXXFLAGS} -o tests/devenv_small_test.o \
- -c ${START_DIR}/tests/devenv_small_test.cc
- LogExecute ${CXX} ${CPPFLAGS} ${CXXFLAGS} -o tests/gtest-all.o \
- -c ${GTEST_SRC}/src/gtest-all.cc -I${GTEST_SRC}
- LogExecute ${CXX} ${LDFLAGS} tests/devenv_small_test.o tests/gtest-all.o \
- -o tests/devenv_small_test_${NACL_ARCH}${NACL_EXEEXT} ${LIBS}
-}
-
-InstallStep() {
- return
-}
-
-#
-# $1: Name name of the repo
-# $2: Name of directory in which to create the conf file.
-# $3: The http address of repo.
-# $4: The priority of the repo (higher number means higher priority).
-# $5: enabled
-#
-CreateRepoConfFile() {
- local name=$1
- local outdir=$2
- local priority=$4
- local enabled=$5
- local PKG_ARCH=${NACL_ARCH}
- if [[ ${PKG_ARCH} == x86_64 ]]; then
- PKG_ARCH=x86-64
- fi
- if [[ ${NACL_ARCH} == ${TOOLCHAIN} ]]; then
- local url="$3/pkg_${PKG_ARCH}"
- else
- local url="$3/pkg_${TOOLCHAIN}_${PKG_ARCH}"
- fi
-
- MakeDir ${outdir}
- cat > ${outdir}/${name}.conf <<EOF
-$name: {
- URL: $url,
- MIRROR_TYPE: HTTP,
- ENABLED: $enabled,
- PRIORITY: $priority,
-}
-EOF
-}
-
-CreateRootFS() {
- local tar_file=$1
- MakeDir root/usr/etc/pkg/repos/
- MakeDir root/etc
- MakeDir root/home/user
- sed "s/@TOOLCHAIN@/${TOOLCHAIN}/g" \
- ${START_DIR}/bash_profile > root/etc/profile
- LogExecute cp ${START_DIR}/bashrc root/home/user/.bashrc
- # Create Nacl.conf file
- CreateRepoConfFile Local root/usr/etc/pkg/repos "${LOCAL_SOURCE}" 1 NO
- CreateRepoConfFile NaCl root/usr/etc/pkg/repos "${DEFAULT_SOURCE}" 0 YES
- LogExecute tar cf ${tar_file} -C root etc usr home
- LogExecute shasum ${tar_file} > ${tar_file}.hash
- rm -rf root
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
-
- local APP_DIR=${PUBLISH_DIR}/app
- MakeDir ${APP_DIR}
-
- # Set up files for bootstrap.
- local BASH_DIR=${NACL_PACKAGES_PUBLISH}/bash/${TOOLCHAIN}
- local PKG_DIR=${NACL_PACKAGES_PUBLISH}/pkg/${TOOLCHAIN}
- local GETURL_DIR=${NACL_PACKAGES_PUBLISH}/geturl/${TOOLCHAIN}
- local UNZIP_DIR=${NACL_PACKAGES_PUBLISH}/unzip/${TOOLCHAIN}
-
- LogExecute cp -fR ${BASH_DIR}/* ${APP_DIR}
- LogExecute cp -fR ${PKG_DIR}/* ${APP_DIR}
- LogExecute cp -fR ${GETURL_DIR}/* ${APP_DIR}
- LogExecute cp -fR ${UNZIP_DIR}/* ${APP_DIR}
-
- # Install jseval only for pnacl (as it can't really work otherwise).
- if [[ ${NACL_ARCH} == pnacl ]]; then
- LogExecute ${PNACLFINALIZE} \
- ${BUILD_DIR}/jseval/jseval_${NACL_ARCH}${NACL_EXEEXT} \
- -o ${APP_DIR}/jseval_${NACL_ARCH}${NACL_EXEEXT}
- cd ${APP_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- jseval_${NACL_ARCH}${NACL_EXEEXT} \
- -s . \
- -o jseval.nmf
- fi
-
- # Install the HTML/JS for the terminal.
- # TODO(gdeepti): Extend mounter to the other create_term.py apps.
- ChangeDir ${APP_DIR}
- LogExecute python ${TOOLS_DIR}/create_term.py -i whitelist.js \
- -i devenv.js -i mounter.js -s mounter.css bash.nmf
- LogExecute cp bash.nmf sh.nmf
- InstallNaClTerm ${APP_DIR}
-
- RESOURCES="background.js mounter.css mounter.js bash.js which
- install-base-packages.sh graphical.html devenv.js whitelist.js
- devenv_16.png devenv_48.png devenv_128.png"
- for resource in ${RESOURCES}; do
- LogExecute install -m 644 ${START_DIR}/${resource} ${APP_DIR}/
- done
-
- # Generate manifest.txt so that nacl_io can list the directory
- rm -f manifest.txt
- (cd ${APP_DIR} && ${NACL_SDK_ROOT}/tools/genhttpfs.py . -r > ../manifest.txt)
- mv ../manifest.txt .
-
- if [[ $TOOLCHAIN == pnacl ]]; then
- CreateRootFS bash_data.tar
- else
- CreateRootFS _platform_specific/${NACL_ARCH}/bash_data.tar
- fi
-
- # Generate a manifest.json.
- GenerateManifest ${START_DIR}/manifest.json.template ${APP_DIR} \
- key=$(cat ${START_DIR}/key.txt)
-
- # Create uploadable version (key not included).
- local APP_UPLOAD_DIR="${PUBLISH_DIR}/devenv_app_upload"
- rm -rf ${APP_UPLOAD_DIR}
- LogExecute cp -r ${APP_DIR} ${APP_UPLOAD_DIR}
- GenerateManifest ${START_DIR}/manifest.json.template \
- ${APP_UPLOAD_DIR} key=
-
- # Zip the full app for upload.
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip devenv_app_upload.zip devenv_app_upload
-
- # Copy the files for DevEnvWidget.
- local WIDGET_DIR=${PUBLISH_DIR}/devenvwidget
- MakeDir ${WIDGET_DIR}
- LogExecute cp -r ${START_DIR}/devenvwidget/* ${WIDGET_DIR}
-
- # Install tests.
- MakeDir tests
- ChangeDir tests
- LogExecute cp -r ${BUILD_DIR}/tests/*${NACL_EXEEXT} .
- LogExecute mv devenv_small_test_${NACL_ARCH}${NACL_EXEEXT} \
- devenv_small_test_${NACL_ARCH}
-
- Remove devenv_small_test.zip
- LogExecute zip -r devenv_small_test.zip *
-}
-
-PostInstallTestStep() {
- local arches=
- if [[ ${OS_NAME} == Darwin && ${NACL_ARCH} == x86_64 ]]; then
- echo "Skipping devenv tests on unsupported mac + x86_64 configuration."
- elif [[ ${NACL_ARCH} == arm ]]; then
- echo "Skipping devenv tests on arm for now."
- elif [[ ${NACL_ARCH} == pnacl ]]; then
- arches="i686 x86_64"
- else
- arches="${NACL_ARCH}"
- fi
- for arch in ${arches}; do
- LogExecute python ${START_DIR}/devenv_small_test.py -x -v -a ${arch}
- if [[ ${NACL_ARCH} == pnacl ]]; then
- LogExecute python ${START_DIR}/jseval_test.py -x -v -a ${arch}
- fi
- # Run large and io2014 tests only on the buildbots (against pinned revs).
- if [[ -n ${BUILDBOT_BUILDERNAME:-} ]]; then
- LogExecute python ${START_DIR}/../devenv/devenv_large_test.py \
- -x -v -a ${arch}
- #LogExecute python ${START_DIR}/../devenv/io2014_test.py \
- #-x -v -a ${arch}
- fi
- done
-}
diff --git a/ports/devenv/devenv.js b/ports/devenv/devenv.js
deleted file mode 100644
index 1a77219..0000000
--- a/ports/devenv/devenv.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-/* globals NaClProcessManager */
-
-'use strict';
-
-NaClProcessManager.fsroot = '/devenv';
-
-// TODO(sbc): This should be handled by nacl_io or perhaps by NaClProcessManager
-function makeRootDir() {
- return new Promise(function(accept, reject) {
- function createDir(rootDirEntry, dirname) {
- rootDirEntry.getDirectory(dirname, {create: true},
- function(dirEntry) {
- accept();
- },
- function() {
- console.log('rootDirEntry.getDirectory failed');
- reject();
- }
- );
- }
-
- window.requestFileSystem = (window.requestFileSystem ||
- window.webkitRequestFileSystem);
- window.requestFileSystem(
- window.PERSISTENT,
- 0,
- function(fs) { createDir(fs.root, NaClProcessManager.fsroot); },
- function() {
- console.log('requestFileSystem failed!');
- reject();
- }
- );
- });
-}
diff --git a/ports/devenv/devenv_128.png b/ports/devenv/devenv_128.png
deleted file mode 100644
index 2470fdc..0000000
--- a/ports/devenv/devenv_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/devenv/devenv_16.png b/ports/devenv/devenv_16.png
deleted file mode 100644
index 4b97c68..0000000
--- a/ports/devenv/devenv_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/devenv/devenv_48.png b/ports/devenv/devenv_48.png
deleted file mode 100644
index 9cb2cc9..0000000
--- a/ports/devenv/devenv_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/devenv/devenv_large_test.py b/ports/devenv/devenv_large_test.py
deleted file mode 100755
index 3e880ca..0000000
--- a/ports/devenv/devenv_large_test.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-"""Large tests of the devenv app."""
-
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-sys.path.append(SRC_DIR)
-TOOLCHAIN = os.environ.get('TOOLCHAIN', 'newlib')
-DEVENV_OUT_DIR = os.path.join(SRC_DIR, 'out', 'publish', 'devenv', TOOLCHAIN)
-
-import chrome_test
-
-
-app = os.path.join(DEVENV_OUT_DIR, 'app')
-test_dir = os.path.join(SCRIPT_DIR, 'tests')
-
-chrome_test.Main([
- '-C', test_dir,
- '-p', 'TOOLCHAIN=' + TOOLCHAIN,
- '-t', '210',
- '--enable-nacl',
- '--load-extension', app,
- 'devenv_large_test.html'] + sys.argv[1:])
diff --git a/ports/devenv/devenv_small_test.py b/ports/devenv/devenv_small_test.py
deleted file mode 100755
index 0667b07..0000000
--- a/ports/devenv/devenv_small_test.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-"""Tests of the devenv app."""
-
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(SCRIPT_DIR, '../..'))
-SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-TOOLCHAIN = os.environ.get('TOOLCHAIN', 'newlib')
-DEVENV_OUT_DIR = os.path.join(SRC_DIR, 'out/publish/devenv', TOOLCHAIN)
-
-import chrome_test
-
-
-app = os.path.join(DEVENV_OUT_DIR, 'app')
-test_dir = os.path.join(SCRIPT_DIR, 'tests')
-test_out_dir = os.path.join(DEVENV_OUT_DIR, 'tests')
-
-chrome_test.Main([
- '-C', test_dir,
- '-C', test_out_dir,
- '-t', '60',
- '--enable-nacl',
- '--load-extension', app,
- 'devenv_small_test.html'] + sys.argv[1:])
diff --git a/ports/devenv/devenvwidget/demo.css b/ports/devenv/devenvwidget/demo.css
deleted file mode 100644
index 460692c..0000000
--- a/ports/devenv/devenvwidget/demo.css
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* This provides styles for the demo of devenvwidget.js. */
-
-#source {
- height: 300px;
- width: 800px;
-}
-
-#run {
- margin-left: 100px;
- width: 600px;
-}
-
-#status {
- font-style: italic;
-}
-
-#output {
- border: 1px solid #ccc;
- font-family: monospace;
- height: 300px;
- padding: 10px;
- white-space: pre;
- width: 780px;
-}
diff --git a/ports/devenv/devenvwidget/demo.html b/ports/devenv/devenvwidget/demo.html
deleted file mode 100644
index ca13c80..0000000
--- a/ports/devenv/devenvwidget/demo.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
- <!--
- Copyright (c) 2014 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.
- -->
- <head>
- <title>DevEnvWidget Demo</title>
- <script src="./devenvwidget.js"></script>
- <link rel="stylesheet" href="./devenvwidget.css" />
- <script src="./demo.js"></script>
- <link rel="stylesheet" href="./demo.css" />
- </head>
- <body>
- <p><textarea id="source" autofocus></textarea></p>
- <p><input type="button" id="run" class="action" value="Run!" /></p>
- <p><strong>Status: </strong><span id="status"></span></p>
- <p><div id="output"></div></p>
- </body>
-</html>
diff --git a/ports/devenv/devenvwidget/demo.js b/ports/devenv/devenvwidget/demo.js
deleted file mode 100644
index 0f839ec..0000000
--- a/ports/devenv/devenvwidget/demo.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals DevEnvWidget */
-
-'use strict';
-
-// This is an example use of devenvwidget.js.
-function $(i) {
- return document.querySelector(i);
-}
-document.addEventListener('DOMContentLoaded', function() {
- var devenv = new DevEnvWidget({
- source: $('#source'),
- run: $('#run'),
- status: $('#status'),
- output: $('#output')
- });
-});
diff --git a/ports/devenv/devenvwidget/devenvwidget.css b/ports/devenv/devenvwidget/devenvwidget.css
deleted file mode 100644
index 9b2ee05..0000000
--- a/ports/devenv/devenvwidget/devenvwidget.css
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* This provides styles for a DevEnvWidget. */
-.dew-status-noerror {
- background-color: #ffd;
-}
-
-.dew-status-error {
- background-color: #fdd;
-}
diff --git a/ports/devenv/devenvwidget/devenvwidget.js b/ports/devenv/devenvwidget/devenvwidget.js
deleted file mode 100644
index c8bb3e9..0000000
--- a/ports/devenv/devenvwidget/devenvwidget.js
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-/*
- * This plugin allows clients to include a DevEnvWidget in a web page, which
- * uses GCC in the NaCl Development Environment extension to compile and run
- * the contents of a text input.
- *
- * Example usage:
- * var widget = new DevEnvWidget({
- * source: document.getElementById('source'), // <textarea>
- * run: document.getElementById('run'), // <button> or other clickable
- * status: document.getElementById('status'), // <div> or other output area
- * output: document.getElementById('output') // <div> or other output area
- * });
- */
-
-(function(global) {
- /*
- * Create a new Widget. This is the constructor called by clients.
- */
- function Widget(args) {
- var self = this;
-
- this.input = args.source;
-
- var extensionID = args.extension || Widget.DEFAULT_EXTENSION_ID;
- this.model = new DevEnv(extensionID);
- this.running = false;
-
- this.view = new WidgetView(args);
- this.view.setRunAction(this.run.bind(this));
- this.view.setStatus(WidgetView.STATUS_IDLE);
-
- this.model.setStdoutListener(function(output) {
- self.view.appendOutput(output);
- });
-
- this.ready = false;
- this.model.checkExtension().then(function() {
- self.ready = true;
- }, function(e) {
- self.view.setStatus(WidgetView.STATUS_ERROR);
- self.view.appendHTMLOutput(e.message);
- });
- }
-
- Widget.WORKING_DIR = '/tmp';
- Widget.C_FILE = Widget.WORKING_DIR + '/widget.c';
- Widget.COMPILE_COMMAND = 'gcc ' + Widget.WORKING_DIR + '/widget.c' +
- ' -o ' + Widget.WORKING_DIR + '/widget -lmingn';
- Widget.RUN_COMMAND = Widget.WORKING_DIR + '/widget';
-
- // The extension ID of the NaCl Development Environment extension.
- Widget.DEFAULT_EXTENSION_ID = 'aljpgkjeipgnmdpikaajmnepbcfkglfa';
-
- // Helper function to check that a program executed successfully.
- Widget.checkExitStatus = function(msg, error) {
- return new Promise(function(resolve, reject) {
- if (msg.status !== 0) {
- if (!error)
- error = 'program returned exit code ' + msg.status;
- reject(new Error(error));
- return;
- }
- resolve(msg);
- });
- };
-
- // Compile and run the contents of the Widget textarea.
- Widget.prototype.run = function() {
- var self = this;
- if (this.running || !this.ready) {
- return;
- }
- this.running = true;
- self.view.setStatus(WidgetView.STATUS_COMPILING);
- self.view.clearOutput();
- self.model.connect();
- self.model.post({
- name: 'file_init'
- }).then(function() {
- return self.model.post({
- name: 'file_remove',
- file: Widget.C_FILE
- }).catch(function() {
- // Ignore the error that will be thrown if the file is not there to be
- // removed.
- });
- }).then(function() {
- return self.model.post({
- name: 'file_write',
- file: Widget.C_FILE,
- data: self.input.value
- });
- }).then(function() {
- return self.model.post(DevEnv.makeSpawn(Widget.COMPILE_COMMAND));
- }).then(function(msg) {
- return self.model.post(DevEnv.makeWaitpid(msg.pid));
- }).then(function(msg) {
- return Widget.checkExitStatus(msg, 'compilation failed');
- }).then(function() {
- self.view.setStatus(WidgetView.STATUS_RUNNING);
- return self.model.post(DevEnv.makeSpawn(Widget.RUN_COMMAND));
- }).then(function(msg) {
- return self.model.post(DevEnv.makeWaitpid(msg.pid));
- }).then(function(msg) {
- return Widget.checkExitStatus(msg);
- }).then(function() {
- self.running = false;
- self.view.setStatus(WidgetView.STATUS_IDLE);
- self.mode.disconnect();
- }, function(e) {
- self.running = false;
- self.view.setStatus(WidgetView.STATUS_ERROR);
- self.view.appendOutput('Error: ' + e.message + '.\n');
- });
- };
-
-
- // Communicate with the NaCl DevEnv extension to run GCC and the compiled
- // program.
- function DevEnv(extensionID) {
- this.port = null;
- this.extensionID = extensionID;
- this.stdoutListener = function() { };
- }
-
- // This is the Chrome Web Store URL of the NaCl Development Environment
- // extension.
- DevEnv.CHROME_STORE_URL = 'https://chrome.google.com/webstore/detail/' +
- 'aljpgkjeipgnmdpikaajmnepbcfkglfa';
-
- // This error is thrown when the extension cannot be found.
- DevEnv.ERROR_NO_EXTENSION = 'Cannot find the NaCl Development Environment' +
- ' extension. <a href="' + DevEnv.CHROME_STORE_URL + '" target="_blank">' +
- 'Download it from the Chrome Web Store.</a>';
-
- // This error is thrown when commands are run before the connection is made
- // to the NaCl DevEnv extension.
- DevEnv.ERROR_NOT_CONNECTED = 'not connected to Chrome extension';
-
- // Helper function to make a spawn command to the extension.
- DevEnv.makeSpawn = function(cmd) {
- return {
- name: 'nacl_spawn',
- nmf: 'bash.nmf',
- argv: ['bash', '--login', '-c', cmd],
- cwd: '/home/user',
- envs: []
- };
- };
-
- // Helper function to make a waitpid command to the extension.
- DevEnv.makeWaitpid = function(pid) {
- return {
- name: 'nacl_waitpid',
- pid: pid,
- options: 0
- };
- };
-
- // Check existence of the NaCl DevEnv extension.
- DevEnv.prototype.checkExtension = function() {
- var self = this;
- return new Promise(function(resolve, reject) {
- chrome.runtime.sendMessage(
- self.extensionID,
- {name: 'ping'},
- {},
- function (response) {
- if (!response || response.name !== 'pong') {
- reject(new Error(DevEnv.ERROR_NO_EXTENSION));
- } else {
- resolve();
- }
- }
- );
- });
- };
-
- // Connect to the NaCl DevEnv extension.
- DevEnv.prototype.connect = function() {
- this.port = chrome.runtime.connect(this.extensionID);
- this.port.onMessage.addListener(this.stdoutListener);
- };
-
- // Disconnect from the NaCl DevEnv extension.
- DevEnv.prototype.disconnect = function() {
- if (!this.port) {
- throw new Error(DevEnv.ERROR_NOT_CONNECTED);
- }
- this.port.disconnect();
- this.port = null;
- };
-
- // Set a callback to be called when called programs write to stdout.
- DevEnv.prototype.setStdoutListener = function(listener) {
- var oldListener = this.stdoutListener;
- var newListener = function(response) {
- if (response && response.name === 'nacl_stdout') {
- listener(response.output);
- }
- };
- if (this.port) {
- this.port.onMessage.removeListener(oldListener);
- this.port.onMessage.addListener(newListener);
- }
- this.stdoutListener = newListener;
- };
-
- // Send a message to the NaCl DevEnv extension.
- DevEnv.prototype.post = function(msg) {
- var self = this;
- return new Promise(function(resolve, reject) {
- if (!msg.name) {
- reject(new Error('name field not set'));
- }
- var replyName = msg.name + '_reply';
- var errorName = msg.name + '_error';
- var handleMessage = function(response) {
- if (!response) {
- return;
- } else if (response.name === replyName) {
- self.port.onMessage.removeListener(handleMessage);
- resolve(response);
- } else if (response.name === errorName) {
- self.port.onMessage.removeListener(handleMessage);
- reject(new Error(response.error));
- }
- };
- self.port.postMessage(msg);
- self.port.onMessage.addListener(handleMessage);
- });
- };
-
- // WidgetView controls the HTML elements that comprise the Widget.
- function WidgetView(args) {
- this.source = args.source;
- this.run = args.run;
- this.status = args.status;
- this.output = args.output;
-
- this.runAction = null;
- }
-
- // This error is thrown when setStatus() is called with an unknown status.
- WidgetView.ERROR_UNKNOWN_STATUS = 'unknown status';
-
- // Define the states of the widget.
- WidgetView.STATUS_IDLE = 0;
- WidgetView.STATUS_COMPILING = 1;
- WidgetView.STATUS_RUNNING = 2;
- WidgetView.STATUS_ERROR = 3;
-
- // These define how the interface looks for each status (e.g. red
- // background on error).
- WidgetView.STATUS_CSS_PREFIX = 'dew-status-';
- WidgetView.STATUS_CSS_NOERROR = WidgetView.STATUS_CSS_PREFIX + 'noerror';
- WidgetView.STATUS_CSS_ERROR = WidgetView.STATUS_CSS_PREFIX + 'error';
- WidgetView.STATUS_VIEWS_ = {};
- WidgetView.STATUS_VIEWS_[WidgetView.STATUS_IDLE] = {
- cssClass: WidgetView.STATUS_CSS_NOERROR,
- text: 'Idle',
- runEnabled: true
- };
- WidgetView.STATUS_VIEWS_[WidgetView.STATUS_COMPILING] = {
- cssClass: WidgetView.STATUS_CSS_NOERROR,
- text: 'Compiling',
- runEnabled: false
- };
- WidgetView.STATUS_VIEWS_[WidgetView.STATUS_RUNNING] = {
- cssClass: WidgetView.STATUS_CSS_NOERROR,
- text: 'Running',
- runEnabled: false
- };
- WidgetView.STATUS_VIEWS_[WidgetView.STATUS_ERROR] = {
- cssClass: WidgetView.STATUS_CSS_ERROR,
- text: 'Error',
- runEnabled: true
- };
-
- // Append a string to the output box.
- WidgetView.prototype.appendOutput = function(output) {
- if (this.output) {
- var node = document.createTextNode(output);
- this.output.appendChild(node);
- }
- };
-
- // Append an HTML string to the output box. Do not use on unsanitized input.
- WidgetView.prototype.appendHTMLOutput = function(output) {
- if (this.output) {
- var node = document.createElement('span');
- node.innerHTML = output;
- this.output.appendChild(node);
- }
- };
-
- // Clear the output box.
- WidgetView.prototype.clearOutput = function() {
- if (this.output)
- this.output.innerText = '';
- };
-
- // Add a listener to be run when the Run button is clicked.
- WidgetView.prototype.setRunAction = function(action) {
- if (this.runAction) {
- this.run.removeEventListener('click', this.runAction);
- }
- this.runAction = action;
- this.run.addEventListener('click', this.runAction);
- };
-
- // Change the status and update the view accordingly.
- WidgetView.prototype.setStatus = function(status) {
- if (!WidgetView.STATUS_VIEWS_[status]) {
- throw new Error(WidgetView.ERROR_UNKNOWN_STATUS);
- }
- var view = WidgetView.STATUS_VIEWS_[status];
- if (this.run)
- this.run.disabled = !view.runEnabled;
- if (this.status)
- this.status.innerText = view.text;
- if (this.output) {
- this.output.classList.remove(WidgetView.STATUS_CSS_NOERROR);
- this.output.classList.remove(WidgetView.STATUS_CSS_ERROR);
- this.output.classList.add(view.cssClass);
- }
- };
-
- // Expose Widget to the outside.
- global['DevEnvWidget'] = Widget;
-})(window);
diff --git a/ports/devenv/graphical.html b/ports/devenv/graphical.html
deleted file mode 100644
index 10d3620..0000000
--- a/ports/devenv/graphical.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!--
-Copyright (c) 2014 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.
--->
-<html>
- <head>
- </head>
- <body>
- </body>
-</html>
diff --git a/ports/devenv/install-base-packages.sh b/ports/devenv/install-base-packages.sh
deleted file mode 100755
index 92cff51..0000000
--- a/ports/devenv/install-base-packages.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-# This is for bash on NaCl. Note that you cannot use external commands
-# until the installation is completed. Also, you cannot use features
-# which nacl_io does not support yet (e.g., pipes and sub-shells).
-
-set -e
-
-CheckNaClEnabled() {
- # Skip check on if this isn't newlib.
- if [[ ${TOOLCHAIN} != newlib ]]; then
- return
- fi
- TMP_CHECK_FILE="/tmp/.enable_nacl_check.nexe"
- # Assume we can reuse the test file if present.
- if [[ ! -e ${TMP_CHECK_FILE} ]]; then
- geturl -q _platform_specific/${NACL_ARCH}/bash.nexe \
- ${TMP_CHECK_FILE} || exit 1
- fi
- set +e
- ${TMP_CHECK_FILE} -c 'exit 42'
- if [[ $? != 42 ]]; then
- echo "*********************** ERROR ***********************"
- echo
- echo "In order to use the NaCl Dev Environment, you must"
- echo "currently enable 'Native Client' at the url:"
- echo " chrome://flags"
- echo "You must then restart your browser."
- echo
- echo "Eventually this should not be required."
- echo "Follow this issue: https://crbug.com/477808"
- echo
- echo "*********************** ERROR ***********************"
- # TODO: A more proper way to handle error would be "exit 1" here
- # and keep window open so that error message could be shown.
- while [[ 1 == 1 ]]; do
- read
- done
- fi
- set -e
-}
-
-InstallBasePackages() {
- echo "===> Installing core packages"
- local core_packages="
- coreutils \
- bash \
- curl \
- git \
- make"
-
- pkg install -y $core_packages
-
- # Some programs (noteabley make) expect /bin/sh and /bin/bash to exist and use
- # this to run command (even if SHELL is set)
- # TODO(sbc): This should be a symlink, or at least install via a post
- # install script.
- cp /usr/bin/bash /bin/sh
- cp /usr/bin/bash /bin/bash
-
- echo "===> Installing extra packages"
- local extra_packages="
- findutils \
- grep \
- less \
- nano \
- python \
- emacs \
- vim"
- pkg install -y -U $extra_packages
-
- local have_gcc=0
- if [[ ${TOOLCHAIN} == glibc ]]; then
- if [[ ${NACL_ARCH} == i686 || ${NACL_ARCH} == x86_64 ]]; then
- echo "===> Installing compiler packages"
- dev_packages+=" \
- binutils \
- gcc \
- mingn"
- have_gcc=1
- pkg install -y -U $dev_packages
- fi
- fi
-
- if [[ ${have_gcc} == 0 ]]; then
- echo "WARNING: \
-emacs and gcc not yet available for your platform (coming soon)."
- fi
-}
-
-CheckNaClEnabled
-InstallBasePackages $@
diff --git a/ports/devenv/io2014_test.py b/ports/devenv/io2014_test.py
deleted file mode 100755
index 7ccb9d2..0000000
--- a/ports/devenv/io2014_test.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-"""Test of Google I/O 2014 tutorial."""
-
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(SCRIPT_DIR, '../..'))
-SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-TOOLCHAIN = os.environ.get('TOOLCHAIN', 'newlib')
-DEVENV_OUT_DIR = os.path.join(SRC_DIR, 'out/publish/devenv', TOOLCHAIN)
-
-import chrome_test
-
-
-app = os.path.join(DEVENV_OUT_DIR, 'app')
-test_dir = os.path.join(SCRIPT_DIR, 'tests')
-
-chrome_test.Main([
- '-C', test_dir,
- '-p', 'TOOLCHAIN=' + TOOLCHAIN,
- '-t', '400',
- '--enable-nacl',
- '--load-extension', app,
- 'io2014_test.html'] + sys.argv[1:])
diff --git a/ports/devenv/jseval.c b/ports/devenv/jseval.c
deleted file mode 100644
index 0b68ea1..0000000
--- a/ports/devenv/jseval.c
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2014 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.
-
-#include <assert.h>
-#include <spawn.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-static void usage(void) {
- fprintf(stderr, "USAGE: jseval -e <cmd> [<outfile>]\n");
- fprintf(stderr, " (eval a string)\n");
- fprintf(stderr, "\n");
- fprintf(stderr, " jseval -f <cmd> [<outfile>]\n");
- fprintf(stderr, " (eval contents of a file)\n");
- exit(1);
-}
-
-static char* read_file_z(const char* filename) {
- FILE* file;
- char* data;
- size_t len;
- size_t read_len;
-
- file = fopen(filename, "rb");
- if (!file) {
- fprintf(stderr, "ERROR: Can't read: %s\n", filename);
- exit(1);
- }
- fseek(file, 0, SEEK_END);
- len = ftell(file);
- data = malloc(len + 1);
- if (!data) {
- fprintf(stderr, "ERROR: Allocation failed reading: %s\n", filename);
- fclose(file);
- exit(1);
- }
- data[len] = '\0';
- fseek(file, 0, SEEK_SET);
- read_len = fread(data, 1, len, file);
- if (read_len != len) {
- fprintf(stderr, "ERROR: Failed reading: %s\n", filename);
- fclose(file);
- exit(1);
- }
- return data;
-}
-
-static void write_file(const void* data, size_t len, const char* filename) {
- FILE* file;
- size_t wrote_len;
-
- file = fopen(filename, "wb");
- if (!file) {
- fprintf(stderr, "ERROR: Can't write to: %s\n", filename);
- exit(1);
- }
- wrote_len = fwrite(data, 1, len, file);
- if (wrote_len != len) {
- fprintf(stderr, "ERROR: Failed writting to: %s\n", filename);
- fclose(file);
- exit(1);
- }
- fclose(file);
-}
-
-int main(int argc, char** argv) {
- char* indata = 0;
- const char* cmd;
- char* outdata;
- size_t outdata_len;
-
- if ((argc != 3 && argc != 4) ||
- (strcmp(argv[1], "-f") != 0 && strcmp(argv[1], "-e") != 0)) {
- usage();
- return 1;
- }
-
- if (strcmp(argv[1], "-f") == 0) {
- indata = read_file_z(argv[2]);
- cmd = indata;
- } else {
- cmd = argv[2];
- }
-
- if (argc == 4) {
- jseval(cmd, &outdata, &outdata_len);
- write_file(outdata, outdata_len, argv[3]);
- } else {
- jseval(cmd, NULL, NULL);
- }
-
- if (strcmp(argv[1], "-f") == 0) {
- free(indata);
- }
-
- return 0;
-}
diff --git a/ports/devenv/jseval_test.py b/ports/devenv/jseval_test.py
deleted file mode 100755
index 14e0960..0000000
--- a/ports/devenv/jseval_test.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-"""Tests of the jseval utility."""
-
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(SCRIPT_DIR, '../..'))
-SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-TOOLCHAIN = os.environ.get('TOOLCHAIN', 'newlib')
-DEVENV_OUT_DIR = os.path.join(SRC_DIR, 'out/publish/devenv', TOOLCHAIN)
-
-import chrome_test
-
-
-test_dir = os.path.join(SCRIPT_DIR, 'tests')
-app = os.path.join(DEVENV_OUT_DIR, 'app')
-
-chrome_test.Main([
- '-C', test_dir,
- '-C', app,
- '-t', '60',
- '--unlimited-storage',
- 'jseval_test.html'] + sys.argv[1:])
diff --git a/ports/devenv/key.txt b/ports/devenv/key.txt
deleted file mode 100644
index 698431d..0000000
--- a/ports/devenv/key.txt
+++ /dev/null
@@ -1 +0,0 @@
-"key":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm+Ha3x02PsUcWCvqY7Z18uH4T4ckh6e7K63eDxkF8xHm16R1MqLI3vOlb2Dvuf9kKFXyno+K496CGiUVbFfLQPixVocZCJKN3nWtUVLMqH3UiCyy7+vVGoJ96uNkDDGBANiwjHcVhdDbykTnbn1yyuCuwAnrYn9oubrZkjgEdBlsVIoXgI4ON4VQviG0zCBvPjDu3y3/1qIO96xmXGtd2nlQ9QeMUTlO8JROsrIpYMLwJ5cB1KO2tNCK+GfllOSmt7+OQ44p/XfZiOt+42ywek3cCbUJxwCaP4/mK1+1OqvV7rLDdykbpBr692ewz5BvGejNfwDCJ/FJB5hOHXpJlQIDAQAB",
diff --git a/ports/devenv/manifest.json.template b/ports/devenv/manifest.json.template
deleted file mode 100644
index 594f295..0000000
--- a/ports/devenv/manifest.json.template
+++ /dev/null
@@ -1,81 +0,0 @@
-{
- "name": "NaCl Development Environment",
- "short_name": "NaCl DevEnv",
- "description": "In-browser development environment for Native Client",
- "version": "0.1.2.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "36",
- "icons": {
- "16": "devenv_16.png",
- "48": "devenv_48.png",
- "128": "devenv_128.png"
- },
- %(key)s
- "externally_connectable": {
- "ids": ["*"],
- "matches": [
- "*://webports.storage.googleapis.com/*",
- "*://nacltools.storage.googleapis.com/*",
- "*://*.chrome.com/*",
- "*://localhost/*",
- "*://127.0.0.1/*",
- "*://0.0.0.0/*"
- ]
- },
- "sockets": {
- "tcpServer": {
- "listen": "127.0.0.1:*"
- }
- },
- "permissions": [
- "storage",
- "clipboardRead",
- "clipboardWrite",
- "unlimitedStorage",
- {
- "fileSystem": [
- "write",
- "retainEntries",
- "directory"
- ]
- },
- "*://webports.storage.googleapis.com/*",
- "*://nacltools.storage.googleapis.com/*",
- "*://0.0.0.0/*",
- "*://localhost/*",
- {
- "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ],
- "app": {
- "background": {
- "scripts": [
- "background.js",
- "pipeserver.js",
- "naclprocess.js",
- "whitelist.js",
- "devenv.js"
- ]
- }
- },
- "platforms": [
- {
- "nacl_arch": "arm",
- "sub_package_path": "_platform_specific/arm/"
- },
- {
- "nacl_arch": "x86-32",
- "sub_package_path": "_platform_specific/i686/"
- },
- {
- "nacl_arch": "x86-64",
- "sub_package_path": "_platform_specific/x86_64/"
- }
- ]
-}
diff --git a/ports/devenv/mounter.css b/ports/devenv/mounter.css
deleted file mode 100644
index a6e09ed..0000000
--- a/ports/devenv/mounter.css
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#terminal {
- display: block;
- position: fixed;
- top: 10px;
- width: 100%;
- height: calc(100% - 10px);
-}
-
-#spacer {
- height: 10px;
-}
-
-#mounterBackground {
- position: fixed;
- width: 100%;
- background-color: rgba(50, 50, 50, 0.7);
- -webkit-transition: top 0.2s cubic-bezier(1, 0, 0, 1);
- display: flex;
- flex-direction: column;
- z-index: 100;
- font-family: sans-serif;
- font-size: medium;
- top: 0px;
-}
-
-#mounter {
- padding: 5px;
- padding-top: 0px;
- padding-bottom: 10px;
- background-color: #d8d8d8;
- flex: 0 0 auto;
-}
-
-#mounterHeader {
- padding: 5px;
- padding-bottom: 5px;
- font-weight: bold;
-}
-
-.mountControl {
- display: flex;
- width: 100%;
- padding-top: 5px;
- flex-direction: row;
-}
-
-.mountControl * {
- margin-right: 5px;
- margin-left: 5px;
- font-size: small;
- flex: 0 0 auto;
-}
-
-.mountControl input {
- flex: 1 1 auto;
- padding-left: 5px;
- padding-right: 5px;
-}
-
-.mountControl span {
- margin-right: 0px;
- position: relative;
- top: 3px;
-}
-
-.mountControl .spacer {
- flex: 1 1 auto;
-}
-
-.addOrRemoveButton {
- width: 24px;
-}
-
-#mounterSpacer {
- flex: 1 1 auto;
-}
-
-#mounterThumb {
- background-color: #d8d8d8;
- height: 10px;
- width: 100%;
- text-align: center;
- flex: 0 0 auto;
- overflow: hidden;
-}
-
-#mounterThumb span {
- position: relative;
- top: -8px;
- cursor: default;
diff --git a/ports/devenv/mounter.js b/ports/devenv/mounter.js
deleted file mode 100644
index e601d53..0000000
--- a/ports/devenv/mounter.js
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-/* globals g_mount */
-
-'use strict';
-
-// TODO(gdeepti): Clean up global variables.
-var mounterBackground = null;
-var mounterThumb = null;
-var mounterHeader = null;
-var mounter = null;
-var isVisible = false;
-var mounterClient = null;
-
-function intToPixels(int) {
- return int + 'px';
-}
-
-function walkDom(callback) {
- var body = document.body;
- var loop = function(element) {
- do {
- var recurse = true;
- if(element.nodeType == 1)
- recurse = callback(element);
- if (recurse && element.hasChildNodes() && !element.hidden)
- loop(element.firstChild);
- element = element.nextSibling;
- }
- while (element);
- };
- loop(body);
-}
-
-function grabFocus() {
- walkDom(function(element) {
- if (element == mounterBackground)
- return false;
-
- if (element.hasAttribute('tabIndex')) {
- element.oldTabIndex = element.getAttribute('tabIndex');
- }
- element.setAttribute('tabIndex', '-1');
- return true;
- });
-}
-
-function releaseFocus() {
- walkDom(function(element) {
- if (element == mounterBackground)
- return false;
-
- if (element.oldTabIndex) {
- element.setAttribute('tabIndex', element.oldTabIndex);
- delete element.oldTabIndex;
- } else {
- element.removeAttribute('tabIndex');
- }
- return true;
- });
- mounterClient.terminal.focus();
-}
-
-function sizeBackground() {
- mounterBackground.style.height = intToPixels(window.innerHeight);
- var bgTop = 0;
- if (!isVisible)
- bgTop = 10 - window.innerHeight;
- mounterBackground.style.top = intToPixels(bgTop);
-}
-
-function changeVisibility(visible) {
- isVisible = visible;
-
- sizeBackground();
- if (!mounterClient)
- return;
-
- if (isVisible)
- grabFocus();
- else
- releaseFocus();
-}
-
-function backgroundClicked() {
- if (isVisible)
- changeVisibility(false);
-}
-
-function thumbClicked(event) {
- if (!isVisible)
- changeVisibility(true);
- event.stopPropagation();
-}
-
-function mounterClicked(event) {
- event.stopPropagation();
-}
-
-function MounterClient(mount, chooseFolder,
- mountHandler, unmountHandler, terminal) {
- this.mount = mount;
- this.onChooseFolder = chooseFolder;
- this.onMount = mountHandler;
- this.onUnmount = unmountHandler;
- this.terminal = terminal;
-}
-
-function addMountControlItem(item, mountControl) {
- mountControl.appendChild(item);
- item.mountControl = mountControl;
-}
-
-function populateMountControl(mountControl) {
- mountControl.pathEdit.value = g_mount.mountPoint;
- // TODO(gdeepti): Enable this to accept mountPoint specified by th user.
- // Temporarily disabled to fix sync issues.
- mountControl.pathEdit.disabled = g_mount.mounted;
- mountControl.localPathEdit.value = g_mount.localPath;
- mountControl.localPathEdit.disabled = g_mount.mounted;
- mountControl.selectButton.disabled = g_mount.mounted;
- mountControl.mountButton.disabled =
- (g_mount.mounted ||
- (g_mount.entry === null));
- mountControl.unmountButton.disabled = !g_mount.mounted;
-}
-
-function mountPointChanged(event) {
- var mountControl = event.target.mountControl;
- mountControl.mount.mountPoint = event.target.value;
- populateMountControl(mountControl);
-}
-
-function chooseFolderClicked(event) {
- var mountControl = event.target.mountControl;
- mounterClient.onChooseFolder(mountControl.mount, function() {
- populateMountControl(mountControl);
- });
-}
-
-function mountClicked(event) {
- var mountControl = event.target.mountControl;
- mounterClient.onMount(mountControl.mount, function() {
- populateMountControl(mountControl);
- });
-}
-
-function unmountClicked(event) {
- var mountControl = event.target.mountControl;
- mounterClient.onUnmount(mountControl.mount, function() {
- populateMountControl(mountControl);
- });
-}
-
-function removeMountClicked(event) {
- var mountControl = event.target.mountControl;
- mounterClient.onRemoveMount(mountControl.mount);
-}
-
-function addMountControl(mount, init) {
- var mountControl = document.createElement('div');
- mountControl.classList.add('mountControl');
-
- var selectButton = document.createElement('button');
- selectButton.textContent = 'Choose Folder';
- addMountControlItem(selectButton, mountControl);
- mountControl.selectButton = selectButton;
- selectButton.onclick = chooseFolderClicked;
-
- var localPathLabel = document.createElement('span');
- localPathLabel.textContent = 'Local path:';
- mountControl.appendChild(localPathLabel);
-
- var localPathEdit = document.createElement('input');
- localPathEdit.textContent = '';
- localPathEdit.readOnly = true;
- addMountControlItem(localPathEdit, mountControl);
- mountControl.localPathEdit = localPathEdit;
-
- var pathEditLabel = document.createElement('span');
- pathEditLabel.textContent = 'Mount point:';
- mountControl.appendChild(pathEditLabel);
-
- var pathEdit = document.createElement('input');
- pathEdit.value = mount.mountPoint;
- addMountControlItem(pathEdit, mountControl);
- mountControl.pathEdit = pathEdit;
- pathEdit.oninput = mountPointChanged;
-
- var mountButton = document.createElement('button');
- mountButton.textContent = 'Mount';
- addMountControlItem(mountButton, mountControl);
- mountControl.mountButton = mountButton;
- mountButton.onclick = mountClicked;
-
- var unmountButton = document.createElement('button');
- unmountButton.textContent = 'Unmount';
- addMountControlItem(unmountButton, mountControl);
- mountControl.unmountButton = unmountButton;
- unmountButton.onclick = unmountClicked;
-
- mountControl.mount = mount;
-
- init(function() {
- populateMountControl(mountControl);
- });
- window.mounter.appendChild(mountControl);
-
- return mountControl;
-}
-
-function initMounter(makeVisible, aMounterClient, init) {
- mounterBackground.onclick = backgroundClicked;
- mounter.onclick = mounterClicked;
- mounterThumb.onclick = thumbClicked;
-
- mounterClient = aMounterClient;
-
- addMountControl(g_mount, init);
- changeVisibility(makeVisible);
-
- window.onresize = sizeBackground;
-}
diff --git a/ports/devenv/pkg_info b/ports/devenv/pkg_info
deleted file mode 100644
index c8983c2..0000000
--- a/ports/devenv/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=devenv
-VERSION=0.1
-# Currently only builds on linux (due to dependency on openssl)
-BUILD_OS=linux
-DEPENDS=(bash unzip geturl pkg gtest)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/devenv/tests/common.js b/ports/devenv/tests/common.js
deleted file mode 100644
index e2cf7da..0000000
--- a/ports/devenv/tests/common.js
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals ASSERT_EQ, EXPECT_EQ, EXPECT_TRUE, chrometest */
-
-'use strict';
-
-function DevEnvTest() {
- chrometest.Test.call(this);
- this.devEnv = null;
- this.tcp = null;
- this.params = chrometest.getUrlParameters();
-
- // Buffer incoming TCP messages.
- this.tcpBuffer = {};
- this.tcpDisconnected = {};
-}
-
-DevEnvTest.prototype = new chrometest.Test();
-DevEnvTest.prototype.constructor = DevEnvTest;
-
-DevEnvTest.prototype.setUp = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return chrometest.Test.prototype.setUp.call(self);
- }).then(function() {
- return chrometest.proxyExtension('NaCl Development Environment');
- }).then(function(ext) {
- self.devEnv = ext;
- }).then(function() {
- return chrometest.proxyExtension('TCP Interface');
- }).then(function(ext) {
- self.tcp = ext;
- return self.initFileSystem();
- }).then(function() {
- return self.mkdir('/home');
- }).then(function() {
- return self.mkdir('/home/user');
- }).then(function() {
- return self.checkCommand('bash -c exit 0', 0);
- }).then(function() {
- if (self.params['latest'] === '1')
- return self.setLocalRepo(window.location.origin);
- });
-};
-
-DevEnvTest.prototype.tearDown = function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.disconnect();
- self.tcp.disconnect();
- return chrometest.Test.prototype.tearDown.call(self);
- });
-};
-
-DevEnvTest.prototype.waitWhile = function(ext, condition, body) {
- function loop(arg) {
- if (!condition(arg)) {
- return arg;
- } else {
- body(arg);
- return ext.wait().then(loop);
- }
- }
- return ext.wait().then(loop);
-};
-
-DevEnvTest.prototype.gatherStdoutUntil = function(name) {
- var self = this;
- var output = '';
-
- return Promise.resolve().then(function() {
- return self.waitWhile(self.devEnv,
- function condition(msg) { return msg.name !== name; },
- function body(msg) {
- ASSERT_EQ('nacl_stdout', msg.name);
- output += msg.output;
- chrometest.info('stdout: ' + msg.output);
- });
- }).then(function(msg) {
- ASSERT_EQ(name, msg.name, 'expected message');
- msg.output = output;
- return msg;
- });
-};
-
-DevEnvTest.prototype.spawnCommand = function(cmd) {
- var self = this;
-
- var env = ['HOME=/home/user', 'NACL_DATA_MOUNT_FLAGS=manifest=/manifest.txt'];
- if (this.params['latest'] === '1') {
- env.push('NACL_DEVENV_LOCAL=1');
- }
-
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({
- 'name': 'nacl_spawn',
- 'nmf': 'bash.nmf',
- 'argv': ['bash', '--login', '-c', cmd],
- 'cwd': '/home/user',
- 'envs': env,
- });
- return self.gatherStdoutUntil('nacl_spawn_reply');
- }).then(function(msg) {
- ASSERT_EQ('nacl_spawn_reply', msg.name);
- return {pid: msg.pid, output: msg.output};
- });
-};
-
-DevEnvTest.prototype.waitCommand = function(pid) {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({
- 'name': 'nacl_waitpid',
- 'pid': pid,
- 'options': 0,
- });
- return self.gatherStdoutUntil('nacl_waitpid_reply');
- }).then(function(msg) {
- ASSERT_EQ('nacl_waitpid_reply', msg.name);
- ASSERT_EQ(pid, msg.pid);
- return {status: msg.status, output: msg.output};
- });
-};
-
-DevEnvTest.prototype.runCommand = function(cmd) {
- var self = this;
- var earlyOutput;
- chrometest.info('runCommand: ' + cmd);
- return Promise.resolve().then(function() {
- return self.spawnCommand(cmd);
- }).then(function(msg) {
- earlyOutput = msg.output;
- return self.waitCommand(msg.pid);
- }).then(function(msg) {
- msg.output = earlyOutput + msg.output;
- return msg;
- });
-};
-
-DevEnvTest.prototype.checkCommand = function(
- cmd, expectedStatus, expectedOutput) {
- if (expectedStatus === undefined) {
- expectedStatus = 0;
- }
- var self = this;
- return Promise.resolve().then(function() {
- return self.runCommand(cmd);
- }).then(function(result) {
- ASSERT_EQ(expectedStatus, result.status, result.output);
- if (expectedOutput !== undefined) {
- ASSERT_EQ(expectedOutput, result.output);
- }
- });
-};
-
-DevEnvTest.prototype.sigint = function(pid) {
- this.devEnv.postMessage({
- 'name': 'nacl_sigint',
- });
-};
-
-DevEnvTest.prototype.installPackage = function(name) {
- var cmd = 'pkg install -f -y ' + name;
- chrometest.info(cmd);
- return this.checkCommand(cmd, 0);
-};
-
-DevEnvTest.prototype.installDefaultPackages = function(name) {
- var cmd = 'bash /mnt/http/install-base-packages.sh';
- chrometest.info(cmd);
- return this.checkCommand(cmd, 0);
-};
-
-
-DevEnvTest.prototype.checkCommandReLines = function(
- cmd, expectedStatus, expectedOutput) {
- var self = this;
- return Promise.resolve().then(function() {
- return self.runCommand(cmd);
- }).then(function(result) {
- ASSERT_EQ(expectedStatus, result.status, result.output);
- var resultLines = result.output.split('\n');
- // Trim the last line if empty to reduce boilerplate.
- if (resultLines[resultLines.length - 1] === '') {
- resultLines = resultLines.slice(0, resultLines.length -1);
- }
- for (var i = 0; i < resultLines.length && i < expectedOutput.length; i++) {
- if (typeof expectedOutput[i] === 'string') {
- EXPECT_EQ(expectedOutput[i], resultLines[i],
- 'match on line ' + i);
- } else {
- EXPECT_TRUE(resultLines[i].match(expectedOutput[i]) !== null,
- 'match on line ' + i + ' with: ' + resultLines[i]);
- }
- }
- ASSERT_EQ(expectedOutput.length, resultLines.length, 'line count match');
- });
-};
-
-DevEnvTest.prototype.initFileSystem = function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({name: 'file_init'});
- return self.devEnv.wait();
- }).then(function(msg) {
- ASSERT_EQ('file_init_reply', msg.name);
- });
-};
-
-DevEnvTest.prototype.writeFile = function(fileName, data) {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({
- 'name': 'file_write',
- 'file': fileName,
- 'data': data
- });
- return self.devEnv.wait();
- }).then(function(msg) {
- ASSERT_EQ('file_write_reply', msg.name);
- });
-};
-
-DevEnvTest.prototype.setLocalRepo = function(data) {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({
- 'name': 'set_local_repo',
- 'data': data
- });
- return self.devEnv.wait();
- }).then(function(msg) {
- ASSERT_EQ('set_local_repo_reply', msg.name);
- });
-};
-
-DevEnvTest.prototype.readFile = function(fileName) {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({
- 'name': 'file_read',
- 'file': fileName,
- });
- return self.devEnv.wait();
- }).then(function(msg) {
- ASSERT_EQ('file_read_reply', msg.name);
- return msg.data;
- });
-};
-
-DevEnvTest.prototype.mkdir = function(fileName) {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({
- 'name': 'file_mkdir',
- 'file': fileName
- });
- return self.devEnv.wait();
- }).then(function(msg) {
- ASSERT_EQ('file_mkdir_reply', msg.name);
- });
-};
-
-DevEnvTest.prototype.rmRf = function(fileName) {
- var self = this;
- return Promise.resolve().then(function() {
- self.devEnv.postMessage({
- 'name': 'file_rm_rf',
- 'file': fileName
- });
- return self.devEnv.wait();
- }).then(function(msg) {
- ASSERT_EQ('file_rm_rf_reply', msg.name);
- });
-};
-
-/**
- * Convert an Array to a string.
- * @param {Array} arr The Array to be converted.
- * @returns {string}
- */
-DevEnvTest.array2Str = function(arr) {
- return String.fromCharCode.apply(null, arr);
-};
-
-/**
- * Convert a string to an Array.
- * @param {string} str The String to be converted.
- * @returns {Array} Bytes sent.
- */
-DevEnvTest.str2Array = function(str) {
- var arr = [];
- for (var i = 0; i < str.length; i++) {
- arr.push(str.charCodeAt(i));
- }
- return arr;
-};
-
-/**
- * Execute a TCP command, and listen for the reply. Buffer incoming TCP
- * messages, and resolve when we receive the reply to the command.
- * @private
- * @param {object} msg The message to send.
- * @returns {Promise}
- */
-DevEnvTest.prototype.tcpExec_ = function(msg) {
- var self = this;
- var reply = msg.name + '_reply';
- var error = msg.name + '_error';
- return Promise.resolve().then(function() {
- self.tcp.postMessage(msg);
- return self.waitWhile(self.tcp,
- function condition(msg) {
- return msg.name !== reply && msg.name !== error;
- },
- function body(msg) {
- if (msg.name === 'tcp_message') {
- if (self.tcpBuffer[msg.socket] === undefined) {
- self.tcpBuffer[msg.socket] = '';
- }
- self.tcpBuffer[msg.socket] += DevEnvTest.array2Str(msg.data);
- } else if (msg.name === 'tcp_disconnect') {
- self.tcpDisconnected[msg.socket] = true;
- } else {
- // Is there a better way to do this?
- chrometest.assert(false, 'unexpected message ' + msg.name +
- ' from tcpapp');
- }
- });
- }).then(function(msg) {
- ASSERT_EQ(reply, msg.name, 'Error is: ' + msg.error);
- return msg;
- });
-};
-
-/**
- * Initiate a TCP connection.
- * @param {string} addr The address of the remote host.
- * @param {number} port The port to connect to.
- * @returns {Promise}
- */
-DevEnvTest.prototype.tcpConnect = function(addr, port) {
- return this.tcpExec_({
- name: 'tcp_connect',
- addr: addr,
- port: port
- });
-};
-
-/**
- * Send a string over TCP.
- * @param {number} socket The TCP socket.
- * @param {string} msg The string to be sent.
- * @returns {Promise}
- */
-DevEnvTest.prototype.tcpSend = function(socket, msg) {
- var self = this;
- return self.tcpExec_({
- name: 'tcp_send',
- socket: socket,
- data: DevEnvTest.str2Array(msg)
- }).then(function(msg) {
- return msg.data;
- });
-};
-
-/**
- * Receive a TCP message. Resolves with a String of the received data, or null
- * if the TCP connection has been closed.
- * @param {number} socket The TCP socket.
- * @returns {Promise}
- */
-DevEnvTest.prototype.tcpRecv = function(socket) {
- var self = this;
- return new Promise(function(resolve, reject) {
- if (self.tcpBuffer[socket] !== undefined) {
- var buffer = self.tcpBuffer[socket];
- delete self.tcpBuffer[socket];
- resolve(buffer);
- } else if (self.tcpDisconnected[socket]) {
- delete self.tcpDisconnected[socket];
- resolve(null);
- } else {
- self.tcp.wait().then(function(msg) {
- if (msg.name === 'tcp_message') {
- resolve(DevEnvTest.array2Str(msg.data));
- } else if (msg.name === 'tcp_disconnect') {
- resolve(null);
- } else {
- chrometest.assert(false, 'unexpected message ' + msg.name +
- ' from tcpapp');
- }
- });
- }
- });
-};
-
-/**
- * Close a TCP connection.
- * @param {number} socket The TCP socket.
- * @returns {Promise}
- */
-DevEnvTest.prototype.tcpClose = function(socket) {
- return this.tcpExec_({
- name: 'tcp_close',
- socket: socket
- });
-};
diff --git a/ports/devenv/tests/devenv_large_test.html b/ports/devenv/tests/devenv_large_test.html
deleted file mode 100644
index 0febe63..0000000
--- a/ports/devenv/tests/devenv_large_test.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<!--
-Copyright (c) 2014 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.
--->
-<body onload="init();">
-<script src="/_chrome_test.js"></script>
-<script>
-function init() {
- chrometest.run([
- 'common.js',
- 'devenv_large_test.js',
- ]);
-}
-</script>
-</body>
-</html>
diff --git a/ports/devenv/tests/devenv_large_test.js b/ports/devenv/tests/devenv_large_test.js
deleted file mode 100644
index e1a4534..0000000
--- a/ports/devenv/tests/devenv_large_test.js
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals TEST_F, ASSERT_EQ, ASSERT_GT, chrometest, DevEnvTest */
-
-'use strict';
-
-// Install several packages.
-// This test must be run before any tests that use these packages.
-TEST_F(DevEnvTest, 'testPackageInstall', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.installPackage('coreutils');
- }).then(function() {
- return self.installPackage('zlib');
- }).then(function() {
- return self.installPackage('curl');
- }).then(function() {
- return self.installPackage('make');
- }).then(function() {
- return self.installPackage('python');
- }).then(function() {
- return self.installPackage('git');
- });
-});
-
-// Run a test on devenv, and clean the home directory afterwards. This allows
-// for tests that touch files. Coreutils must be installed before this kind of
-// test can be run.
-function DevEnvFileTest() {
- DevEnvTest.call(this);
-}
-DevEnvFileTest.prototype = new DevEnvTest();
-DevEnvFileTest.prototype.constructor = DevEnvFileTest;
-
-DevEnvFileTest.prototype.setUp = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return DevEnvTest.prototype.setUp.call(self);
- });
-};
-
-DevEnvFileTest.prototype.tearDown = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.rmRf('/home/user');
- }).then(function() {
- return DevEnvTest.prototype.tearDown.call(self);
- });
-};
-
-TEST_F(DevEnvFileTest, 'testDirs', function() {
- // Test mkdir, ls, and rmdir.
- var self = this;
- return Promise.resolve().then(function() {
- return self.checkCommand('mkdir foo', 0, '');
- }).then(function() {
- return self.checkCommand('ls', 0, 'foo\n');
- }).then(function() {
- return self.checkCommand('rmdir foo', 0, '');
- });
-});
-
-TEST_F(DevEnvFileTest, 'testCatRm', function() {
- // Test cat and rm.
- var self = this;
- var str = 'Hello, world!\n';
- return Promise.resolve().then(function() {
- return self.writeFile('/home/user/foo.txt', str);
- }).then(function() {
- return self.checkCommand('cat foo.txt', 0, str);
- }).then(function() {
- return self.checkCommand('rm foo.txt', 0, '');
- });
-});
-
-TEST_F(DevEnvFileTest, 'testGit', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.checkCommand('git config --global user.name "John Doe"');
- }).then(function() {
- return self.checkCommand(
- 'git config --global user.email johndoe@example.com');
- }).then(function() {
- return self.checkCommand('git config --global color.ui false');
- }).then(function() {
- return self.checkCommand('mkdir foo');
- }).then(function() {
- return self.checkCommandReLines(
- 'cd foo && git init', 0,
- [/^warning: templates not found \/.*\/share\/git-core\/templates/,
- 'Initialized empty Git repository in /home/user/foo/.git/']);
- }).then(function() {
- return self.checkCommand('mkdir foo/bar', 0, '');
- }).then(function() {
- return self.writeFile(
- '/home/user/foo/bar/README', 'hello there\n');
- }).then(function() {
- return self.checkCommand('cd foo && git add .', 0, '');
- }).then(function() {
- return self.checkCommandReLines(
- 'cd foo && git commit -am initial', 0,
- [/^\[master \(root-commit\) [0-9a-f]{7}\] initial$/,
- ' 1 file changed, 1 insertion(+)',
- ' create mode 100644 bar/README']);
- }).then(function() {
- return self.writeFile(
- '/home/user/foo/bar/README', 'hello there\ntesting\n');
- }).then(function() {
- return self.writeFile(
- '/home/user/foo/test.txt', 'more stuff\n');
- }).then(function() {
- return self.checkCommand('cd foo && git add test.txt', 0, '');
- }).then(function() {
- return self.checkCommandReLines(
- 'cd foo && git commit -am change2', 0,
- [/^\[master [0-9a-f]{7}\] change2$/,
- ' 2 files changed, 2 insertions(+)',
- ' create mode 100644 test.txt']);
- }).then(function() {
- return self.checkCommand('rm foo/test.txt', 0, '');
- }).then(function() {
- return self.checkCommandReLines(
- 'cd foo && git commit -am "change number 3"', 0,
- [/^\[master [0-9a-f]{7}\] change number 3$/,
- ' 1 file changed, 1 deletion(-)',
- ' delete mode 100644 test.txt']);
- }).then(function() {
- return self.checkCommandReLines(
- 'cd foo && PAGER=cat git log --full-diff -p .', 0,
- [/^commit [0-9a-f]{40}$/,
- 'Author: John Doe <johndoe@example.com>',
- /^Date: .+$/,
- '',
- ' change number 3',
- '',
- 'diff --git a/test.txt b/test.txt',
- 'deleted file mode 100644',
- /^index [0-9a-f]{7}\.\.0000000$/,
- '--- a/test.txt',
- '+++ /dev/null',
- '@@ -1 +0,0 @@',
- '-more stuff',
- '',
- /^commit [0-9a-f]{40}$/,
- 'Author: John Doe <johndoe@example.com>',
- /^Date: .+$/,
- '',
- ' change2',
- '',
- 'diff --git a/bar/README b/bar/README',
- /^index [0-9a-f]{7}\.\.[0-9a-f]{7} 100644$/,
- '--- a/bar/README',
- '+++ b/bar/README',
- '@@ -1 +1,2 @@',
- ' hello there',
- '+testing',
- 'diff --git a/test.txt b/test.txt',
- 'new file mode 100644',
- /^index 0000000..[0-9a-f]{7}$/,
- '--- /dev/null',
- '+++ b/test.txt',
- '@@ -0,0 +1 @@',
- '+more stuff',
- '',
- /^commit [0-9a-f]{40}$/,
- 'Author: John Doe <johndoe@example.com>',
- /^Date: .+$/,
- '',
- ' initial',
- '',
- 'diff --git a/bar/README b/bar/README',
- 'new file mode 100644',
- /^index 0000000..[0-9a-f]{7}$/,
- '--- /dev/null',
- '+++ b/bar/README',
- '@@ -0,0 +1 @@',
- '+hello there']);
- });
-});
-
-TEST_F(DevEnvFileTest, 'testMake', function() {
- var self = this;
- var i = 0;
- var makefile = [
- '.SUFFIXES:',
- 'all: part0.z part1.z part2.z part3.z part4.z part5.z part6.z part7.z',
- '%.z: %.y',
- '\tcp $< $@',
- '%.y: %.x',
- '\tcp $< $@',
- '%.x: foo.txt',
- '\tcp $< $@',
- ].join('\n') + '\n';
- var foo = 'This is a test!\nTesting!\n';
- return Promise.resolve().then(function() {
- return self.writeFile('/home/user/Makefile', makefile);
- }).then(function() {
- return self.writeFile('/home/user/foo.txt', foo);
- }).then(function() {
- return self.checkCommand('make -j10');
- }).then(function() {
- function checkOne() {
- return Promise.resolve().then(function() {
- return self.readFile('/home/user/part' + i + '.z');
- }).then(function(data) {
- ASSERT_EQ(foo, data);
- i++;
- if (i < 8) {
- return checkOne();
- }
- });
- }
- return checkOne();
- });
-});
-
-TEST_F(DevEnvFileTest, 'testPythonBasic', function() {
- var self = this;
- var script = [
- '#!/usr/bin/python',
- '',
- 'import sys',
- '',
- 'sys.exit(42)',
- ].join('\n') + '\n';
- return Promise.resolve().then(function() {
- return self.writeFile('/home/user/test.py', script);
- }).then(function() {
- return self.checkCommand('./test.py', 42);
- });
-});
-
-TEST_F(DevEnvFileTest, 'testPythonSubprocess', function() {
- var self = this;
- // TODO(bradnelson): Drop this once subprocess works on glibc.
- if (self.params['TOOLCHAIN'] === 'glibc') {
- // Skip on glibc.
- return;
- }
- var script = [
- '#!/usr/bin/python',
- '',
- 'import subprocess',
- 'import sys',
- '',
- 'n = int(sys.argv[1])',
- 'if n > 3:',
- ' sys.exit(n)',
- 'else:',
- ' a = subprocess.Popen([sys.executable, "test.py", str(n * 2)])',
- ' b = subprocess.Popen([sys.executable, "test.py", str(n * 2 + 1)])',
- ' a.wait()',
- ' b.wait()',
- ' sys.exit(a.returncode + b.returncode + n)',
- ].join('\n') + '\n';
- return Promise.resolve().then(function() {
- return self.writeFile('/home/user/test.py', script);
- }).then(function() {
- function test(n) {
- if (n > 3) {
- return n;
- } else {
- return test(n * 2) + test(n * 2 + 1) + n;
- }
- }
- return self.checkCommand('./test.py 1', test(1));
- });
-});
-
-TEST_F(DevEnvFileTest, 'testGetUrlAndUnzip', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.checkCommand(
- 'geturl http://nacltools.storage.googleapis.com/io2014/voronoi.zip ' +
- 'voronoi.zip');
- }).then(function() {
- return self.checkCommand('unzip voronoi.zip');
- }).then(function() {
- return self.readFile('/home/user/voronoi/Makefile');
- }).then(function(data) {
- // Check there's something in the makefile.
- ASSERT_GT(data.length, 100);
- });
-});
-
-TEST_F(DevEnvFileTest, 'testCurlAndUnzip', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.checkCommand(
- 'curl https://nacltools.storage.googleapis.com/io2014/voronoi.zip -O');
- }).then(function() {
- return self.checkCommand('unzip voronoi.zip');
- }).then(function() {
- return self.readFile('/home/user/voronoi/Makefile');
- }).then(function(data) {
- // Check there's something in the makefile.
- ASSERT_GT(data.length, 100);
- });
-});
diff --git a/ports/devenv/tests/devenv_small_test.cc b/ports/devenv/tests/devenv_small_test.cc
deleted file mode 100644
index f2bf049..0000000
--- a/ports/devenv/tests/devenv_small_test.cc
+++ /dev/null
@@ -1,513 +0,0 @@
-// Copyright (c) 2014 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.
-
-#include "gtest/gtest.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <spawn.h>
-#include <unistd.h>
-
-static char *argv0;
-
-// Make sure that the plumbing works.
-TEST(Plumbing, Identity) {
- EXPECT_EQ(0, 0);
-}
-
-// Test process functions.
-TEST(Plumbing, ProcessTests) {
- int pid = getpid();
- EXPECT_GT(pid, 1);
- EXPECT_GT(getppid(), 0);
- EXPECT_EQ(setpgrp(), 0);
- EXPECT_EQ(getpgid(0), pid);
- EXPECT_EQ(getpgrp(), pid);
- EXPECT_EQ(setsid(), -1);
-}
-
-// Used in main to allow the test exectuable to be started
-// as a subprocess.
-// Child takes args:
-// ./test return <return-code> <expected-foo-env>
-// It will return 55 as a bad return value in the case
-// that the FOO environment variable isn't the expected
-// value.
-static int return_child(int argc, char **argv) {
- if (strcmp(argv[3], getenv("FOO")) != 0) {
- return 55;
- }
- return atoi(argv[2]);
-}
-
-#define ARGV_FOR_CHILD(x) \
- char *argv[5]; \
- argv[0] = argv0; \
- argv[1] = const_cast<char*>("return"); \
- argv[2] = const_cast<char*>("111"); \
- argv[3] = const_cast<char*>(x); \
- argv[4] = NULL;
-
-#define ENVP_FOR_CHILD(x) \
- char *envp[2]; \
- envp[0] = const_cast<char*>(x); \
- envp[1] = NULL;
-
-TEST(Spawn, spawnve) {
- int status;
- ARGV_FOR_CHILD("spawnve");
- ENVP_FOR_CHILD("FOO=spawnve");
- pid_t pid = spawnve(P_NOWAIT, argv0, argv, envp);
- ASSERT_GE(pid, 0);
- pid_t npid = waitpid(pid, &status, 0);
- EXPECT_EQ(pid, npid);
- EXPECT_TRUE(WIFEXITED(status));
- EXPECT_EQ(111, WEXITSTATUS(status));
-}
-
-TEST(Spawn, execv) {
- int status;
- // Spawn a child process that will then call execv and verify the PID of
- // the child matches the PID of the grandchild.
- char *argv[3];
- argv[0] = argv0;
- argv[1] = const_cast<char*>("execv_test");
- argv[2] = NULL;
- pid_t pid = spawnv(P_NOWAIT, argv0, argv);
- ASSERT_GE(pid, 0);
- pid_t npid = waitpid(pid, &status, 0);
- EXPECT_EQ(pid, npid);
- EXPECT_TRUE(WIFEXITED(status));
- EXPECT_EQ(0, WEXITSTATUS(status));
-}
-
-#define VFORK_SETUP_SPAWN \
- int status; \
- pid_t pid = vfork(); \
- ASSERT_GE(pid, 0); \
- if (pid) { \
- pid_t npid = waitpid(pid, &status, 0); \
- EXPECT_EQ(pid, npid); \
- EXPECT_TRUE(WIFEXITED(status)); \
- EXPECT_EQ(111, WEXITSTATUS(status)); \
- } else
-
-TEST(Vfork, execve) {
- VFORK_SETUP_SPAWN {
- ARGV_FOR_CHILD("execve");
- ENVP_FOR_CHILD("FOO=execve");
- execve(argv0, argv, envp);
- }
-}
-
-TEST(Vfork, execv) {
- setenv("FOO", "execv", 1);
- VFORK_SETUP_SPAWN {
- ARGV_FOR_CHILD("execv");
- execv(argv0, argv);
- }
-}
-
-TEST(Vfork, execvp) {
- setenv("FOO", "execvp", 1);
- VFORK_SETUP_SPAWN {
- ARGV_FOR_CHILD("execvp");
- execvp(argv0, argv);
- }
-}
-
-TEST(Vfork, execvpe) {
- VFORK_SETUP_SPAWN {
- ARGV_FOR_CHILD("execvpe");
- ENVP_FOR_CHILD("FOO=execvpe");
- execvpe(argv0, argv, envp);
- }
-}
-
-TEST(Vfork, execl) {
- setenv("FOO", "execl", 1);
- VFORK_SETUP_SPAWN {
- execl(argv0, argv0, "return", "111", "execl", NULL);
- }
-}
-
-TEST(Vfork, execlp) {
- setenv("FOO", "execlp", 1);
- VFORK_SETUP_SPAWN {
- execlp(argv0, argv0, "return", "111", "execlp", NULL);
- }
-}
-
-TEST(Vfork, execle) {
- VFORK_SETUP_SPAWN {
- ENVP_FOR_CHILD("FOO=execle");
- execle(argv0, argv0, "return", "111", "execle", NULL, envp);
- }
-}
-
-TEST(Vfork, execlpe) {
- VFORK_SETUP_SPAWN {
- ENVP_FOR_CHILD("FOO=execlpe");
- execlpe(argv0, argv0, "return", "111", "execlpe", NULL, envp);
- }
-}
-
-// Used in main to allow the test exectuable to be started
-// as a subprocess.
-// Child takes args:
-// ./test _exit <return-code> <expected-foo-env>
-// It will return 55 as a bad return value in the case
-// that the FOO environment variable isn't the expected
-// value.
-static int exit_child(int argc, char **argv) {
- if (strcmp(argv[3], getenv("FOO")) != 0) {
- return 55;
- }
- _exit(atoi(argv[2]));
- // Shouldn't get here.
- return 55;
-}
-
-TEST(Vfork, exit) {
- int status;
- pid_t pid = vfork();
- ASSERT_GE(pid, 0);
- if (pid) {
- pid_t npid = waitpid(pid, &status, 0);
- EXPECT_EQ(pid, npid);
- EXPECT_TRUE(WIFEXITED(status));
- EXPECT_EQ(123, WEXITSTATUS(status));
- } else {
- _exit(123);
- }
-}
-
-TEST(Vfork, RegularExit) {
- VFORK_SETUP_SPAWN {
- ENVP_FOR_CHILD("FOO=RegularExit");
- execlpe(argv0, argv0, "_exit", "111", "RegularExit", NULL, envp);
- }
-}
-
-// Used in main to allow the test exectuable to be started
-// as an echo server.
-// Child takes args:
-// ./test pipes
-static int pipes_child(int argc, char **argv) {
- char buffer[200];
- for (;;) {
- int len = read(0, buffer, sizeof(buffer));
- if (len <= 0) {
- break;
- }
- write(1, buffer, len);
- }
- close(1);
- close(0);
- return 0;
-}
-
-// Write to an echo process, get reply then close pipes.
-TEST(Pipes, Echo) {
- int pipe_a[2];
- int pipe_b[2];
- // Create two pipe pairs pipe_a[1] -> pipe_a[0]
- // pipe_b[1] -> pipe_b[0]
- ASSERT_EQ(0, pipe(pipe_a));
- ASSERT_EQ(0, pipe(pipe_b));
- pid_t pid = vfork();
- ASSERT_GE(pid, 0);
- if (!pid) {
- // Dup two ends of the pipes into stdin + stdout of the echo process.
- ASSERT_EQ(0, dup2(pipe_a[0], 0));
- EXPECT_EQ(0, close(pipe_a[0]));
- EXPECT_EQ(0, close(pipe_a[1]));
- EXPECT_EQ(1, dup2(pipe_b[1], 1));
- EXPECT_EQ(0, close(pipe_b[0]));
- EXPECT_EQ(0, close(pipe_b[1]));
- execlp(argv0, argv0, "pipes", NULL);
- // Don't get here.
- ASSERT_TRUE(false);
- }
-
- EXPECT_EQ(0, close(pipe_a[0]));
- EXPECT_EQ(0, close(pipe_b[1]));
-
- const char test_message[] = "test message";
-
- // Write to pipe_a.
- ssize_t len = write(pipe_a[1], test_message, strlen(test_message));
- EXPECT_EQ(static_cast<ssize_t>(strlen(test_message)), len);
- char buffer[100];
- // Wait for an echo back on pipe_b.
- size_t total = 0;
- while (total < strlen(test_message)) {
- len = read(pipe_b[0], buffer + total, sizeof(buffer));
- ASSERT_GE(len, 0);
- if (len == 0) break;
- total += len;
- }
- EXPECT_EQ(strlen(test_message), total);
- EXPECT_TRUE(memcmp(buffer, test_message, total) == 0);
-
- EXPECT_EQ(0, close(pipe_a[1]));
- EXPECT_EQ(0, close(pipe_b[0]));
-}
-
-// Try stdout with pipes.
-TEST(Pipes, StdoutEcho) {
- int pipes[2];
-
- // Create pipe pair pipes[1] -> pipe[0]
- ASSERT_EQ(0, pipe(pipes));
-
- // Do a vfork, and do an echo from child.
- pid_t pid = vfork();
- ASSERT_GE(pid, 0);
- if (!pid) {
- // Tie child's stdout with pipe's write end.
- ASSERT_EQ(1, dup2(pipes[1], 1));
- EXPECT_EQ(0, close(pipes[0]));
- execlp(argv0, argv0, "echo", NULL);
- }
-
- EXPECT_EQ(0, close(pipes[1]));
- char check_msg[] = "test";
- char buffer[100];
- size_t total = 0;
- while (total < strlen(check_msg)) {
- ssize_t len = read(pipes[0], buffer+total, sizeof(buffer));
- ASSERT_GE(len, 0);
- if (len == 0) break;
- total += len;
- }
- ASSERT_EQ(0, memcmp(buffer, check_msg, total));
- EXPECT_EQ(0, close(pipes[0]));
-}
-
-// Write to an echo process, close immediately, then wait for reply.
-TEST(Pipes, PipeFastClose) {
- int pipe_a[2];
- int pipe_b[2];
- // Create two pipe pairs pipe_a[1] -> pipe_a[0]
- // pipe_b[1] -> pipe_b[0]
- ASSERT_EQ(0, pipe(pipe_a));
- ASSERT_EQ(0, pipe(pipe_b));
- pid_t pid = vfork();
- ASSERT_GE(pid, 0);
- if (!pid) {
- // Dup two ends of the pipes into stdin + stdout of the echo process.
- ASSERT_EQ(0, dup2(pipe_a[0], 0));
- EXPECT_EQ(0, close(pipe_a[0]));
- EXPECT_EQ(0, close(pipe_a[1]));
- EXPECT_EQ(1, dup2(pipe_b[1], 1));
- EXPECT_EQ(0, close(pipe_b[0]));
- EXPECT_EQ(0, close(pipe_b[1]));
- execlp(argv0, argv0, "pipes", NULL);
- // Don't get here.
- ASSERT_TRUE(false);
- }
-
- EXPECT_EQ(0, close(pipe_a[0]));
- EXPECT_EQ(0, close(pipe_b[1]));
-
- const char test_message[] = "test message";
-
- // Write to pipe_a.
- ssize_t wrote = write(pipe_a[1], test_message, strlen(test_message));
- EXPECT_EQ(static_cast<ssize_t>(strlen(test_message)), wrote);
- EXPECT_EQ(0, close(pipe_a[1]));
-
- char buffer[100];
- // Wait for an echo back on pipe_b.
- size_t total = 0;
- while (total < strlen(test_message)) {
- ssize_t len = read(pipe_b[0], buffer + total, sizeof(buffer));
- ASSERT_GE(len, 0);
- if (len == 0) break;
- total += len;
- }
- EXPECT_EQ(strlen(test_message), total);
- EXPECT_TRUE(memcmp(buffer, test_message, total) == 0);
-
- EXPECT_EQ(0, close(pipe_b[0]));
-}
-
-// Write to a chain of echo process, get reply then close pipes.
-TEST(Pipes, EchoChain) {
- int pipe_a[2];
- ASSERT_EQ(0, pipe(pipe_a));
- int pipe_b[2];
- ASSERT_EQ(0, pipe(pipe_b));
-
- pid_t pid = vfork();
- ASSERT_GE(pid, 0);
- if (!pid) {
- // Dup two ends of the pipes into stdin + stdout of the echo process.
- ASSERT_EQ(0, dup2(pipe_a[0], 0));
- EXPECT_EQ(0, close(pipe_a[0]));
- EXPECT_EQ(0, close(pipe_a[1]));
- EXPECT_EQ(1, dup2(pipe_b[1], 1));
- EXPECT_EQ(0, close(pipe_b[0]));
- EXPECT_EQ(0, close(pipe_b[1]));
- execlp(argv0, argv0, "pipes", NULL);
- // Don't get here.
- ASSERT_TRUE(false);
- }
- EXPECT_EQ(0, close(pipe_a[0]));
- EXPECT_EQ(0, close(pipe_b[1]));
-
- int pipe_c[2];
- ASSERT_EQ(0, pipe(pipe_c));
-
- pid_t pid2 = vfork();
- ASSERT_GE(pid2, 0);
- if (!pid2) {
- // Dup two ends of the pipes into stdin + stdout of the echo process.
- EXPECT_EQ(0, close(pipe_a[1]));
- ASSERT_EQ(0, dup2(pipe_b[0], 0));
- EXPECT_EQ(0, close(pipe_b[0]));
- EXPECT_EQ(1, dup2(pipe_c[1], 1));
- EXPECT_EQ(0, close(pipe_c[0]));
- EXPECT_EQ(0, close(pipe_c[1]));
- execlp(argv0, argv0, "pipes", NULL);
- // Don't get here.
- ASSERT_TRUE(false);
- }
- EXPECT_EQ(0, close(pipe_b[0]));
- EXPECT_EQ(0, close(pipe_c[1]));
-
- const char test_message[] = "test message";
-
- // Write to pipe_a.
- ssize_t wrote = write(pipe_a[1], test_message, strlen(test_message));
- EXPECT_EQ(static_cast<ssize_t>(strlen(test_message)), wrote);
- char buffer[100];
- // Wait for an echo back on pipe_c.
- size_t total = 0;
- while (total < strlen(test_message)) {
- ssize_t len = read(pipe_c[0], buffer + total, sizeof(buffer));
- ASSERT_GE(len, 0);
- if (len == 0) break;
- total += len;
- }
- EXPECT_EQ(strlen(test_message), total);
- EXPECT_TRUE(memcmp(buffer, test_message, total) == 0);
-
- EXPECT_EQ(0, close(pipe_a[1]));
- EXPECT_EQ(0, close(pipe_c[0]));
-}
-
-TEST(Pipes, NullFeof) {
- int p[2];
- ASSERT_EQ(0, pipe(p));
- ASSERT_EQ(0, close(p[1]));
- ASSERT_EQ(0, dup2(p[0], 0));
- while (!feof(stdin)) {
- fgetc(stdin);
- }
-}
-
-TEST(Pipes, Null) {
- int p[2];
- ASSERT_EQ(0, pipe(p));
- ASSERT_EQ(0, close(p[1]));
- char buffer[100];
- ssize_t len = read(p[0], buffer, sizeof(buffer));
- EXPECT_EQ(0, len);
- ASSERT_EQ(0, close(p[0]));
-}
-
-static int cloexec_check_child(int argc, char *argv[]) {
- int fd1;
- int fd2;
- struct stat st;
-
- if (sscanf(argv[2], "%d", &fd1) != 1)
- return 1;
- if (sscanf(argv[3], "%d", &fd2) != 1)
- return 1;
- if (fstat(fd1, &st) != 0)
- return 1;
- if (fcntl(fd1, F_GETFD) & FD_CLOEXEC)
- return 1;
- if (fstat(fd2, &st) != -1)
- return 1;
- if (errno != EBADF)
- return 1;
- return 42;
-}
-
-// Confirm FD_CLOEXEC works for pipes.
-TEST(Pipes, CloseExec) {
- int p[2];
- ASSERT_EQ(0, pipe(p));
-
- char fd1[20];
- sprintf(fd1, "%d", p[0]);
- char fd2[20];
- sprintf(fd2, "%d", p[1]);
-
- fcntl(p[1], F_SETFD, fcntl(p[1], F_GETFD) | FD_CLOEXEC);
-
- pid_t pid = vfork();
- ASSERT_GE(pid, 0);
- if (!pid) {
- // When running in the child.
- execlp(argv0, argv0, "cloexec_check", fd1, fd2, NULL);
- // Don't get here.
- ASSERT_TRUE(false);
- }
-
- EXPECT_EQ(0, close(p[0]));
- EXPECT_EQ(0, close(p[1]));
-
- int status;
- pid_t npid = waitpid(pid, &status, 0);
- EXPECT_EQ(pid, npid);
- EXPECT_TRUE(WIFEXITED(status));
- EXPECT_EQ(42, WEXITSTATUS(status));
-}
-
-int main(int argc, char **argv) {
- if (argc > 1) {
- const char* child_command = argv[1];
- if (argc == 4 && strcmp(child_command, "return") == 0) {
- return return_child(argc, argv);
- } else if (argc == 4 && strcmp(child_command, "_exit") == 0) {
- return exit_child(argc, argv);
- } else if (argc == 2 && strcmp(child_command, "pipes") == 0) {
- return pipes_child(argc, argv);
- } else if (argc == 4 && strcmp(child_command, "cloexec_check") == 0) {
- return cloexec_check_child(argc, argv);
- } else if (argc == 2 && strcmp(child_command, "echo") == 0) {
- char msg[] = "test";
- write(1, msg, sizeof(msg));
- return 0;
- } else if (strcmp(child_command, "execv_test") == 0) {
- char pid_string[128];
- sprintf(pid_string, "%d", getpid());
- char *args[4];
- args[0] = argv[0];
- args[1] = const_cast<char*>("check_pid");
- args[2] = pid_string;
- args[3] = NULL;
- printf("calling execv (pid=%d)\n", getpid());
- execv(args[0], args);
- } else if (strcmp(child_command, "check_pid") == 0) {
- printf("check_pid '%d' '%s'\n", getpid(), argv[2]);
- if (getpid() != atoi(argv[2])) {
- return 1;
- }
- return 0;
- }
- printf("unknown child_command: %s\n", child_command);
- return 1;
- }
-
- // Preserve argv[0] for use in some tests.
- argv0 = argv[0];
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/ports/devenv/tests/devenv_small_test.html b/ports/devenv/tests/devenv_small_test.html
deleted file mode 100644
index 4e4ac5b..0000000
--- a/ports/devenv/tests/devenv_small_test.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<!--
-Copyright (c) 2014 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.
--->
-<body onload="init();">
-<script src="/_chrome_test.js"></script>
-<script>
-function init() {
- chrometest.run([
- 'common.js',
- 'devenv_small_test.js',
- ]);
-}
-</script>
-</body>
-</html>
diff --git a/ports/devenv/tests/devenv_small_test.js b/ports/devenv/tests/devenv_small_test.js
deleted file mode 100644
index 35ae25e..0000000
--- a/ports/devenv/tests/devenv_small_test.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals TEST_F, chrometest, DevEnvTest */
-
-'use strict';
-
-// Run the command "bash -c 'exit 42'" and check the exit code.
-TEST_F(DevEnvTest, 'testExit', function() {
- return this.checkCommand('exit 42', 42, '');
-});
-
-// Run the command "bash -c 'echo hello'" and check the exit code.
-TEST_F(DevEnvTest, 'testEcho', function() {
- return this.checkCommand('echo hello', 0, 'hello\n');
-});
-
-// Confirm that sh works as an alias for bash.
-// Run the command "bash -c 'sh -c "foo"'" and check the exit code.
-TEST_F(DevEnvTest, 'testSh', function() {
- return this.checkCommand('sh -c "echo foo"', 0, 'foo\n');
-});
-
-// Confirm that a shell script with /bin/bash works.
-TEST_F(DevEnvTest, 'testSheeBangBash', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.writeFile(
- '/home/user/foo.sh',
- '#!/bin/bash\necho "red leather, yellow leather"\n');
- }).then(function() {
- return self.checkCommand(
- '/home/user/foo.sh', 0, 'red leather, yellow leather\n');
- });
-});
-
-// Confirm that a shell script with /bin/sh works.
-TEST_F(DevEnvTest, 'testSheeBangSh', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.writeFile(
- '/home/user/bar.sh',
- '#!/bin/sh\necho "resolute urgency"\n');
- }).then(function() {
- return self.checkCommand(
- '/home/user/bar.sh', 0, 'resolute urgency\n');
- });
-});
-
-// Run a NaCl executable to make sure syscalls are working.
-TEST_F(DevEnvTest, 'testCTests', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.checkCommand('geturl ' +
- chrometest.harnessURL('devenv_small_test.zip') +
- ' devenv_small_test.zip', 0);
- }).then(function() {
- return self.checkCommand('unzip devenv_small_test.zip', 0);
- }).then(function() {
- return self.checkCommand(
- 'LD_LIBRARY_PATH=${PWD}/${PACKAGE_LIB_DIR}:$LD_LIBRARY_PATH ' +
- './devenv_small_test_${NACL_BOOT_ARCH}', 0);
- });
-});
diff --git a/ports/devenv/tests/io2014_test.html b/ports/devenv/tests/io2014_test.html
deleted file mode 100644
index ca3effc..0000000
--- a/ports/devenv/tests/io2014_test.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<!--
-Copyright (c) 2014 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.
--->
-<body onload="init();">
-<script src="/_chrome_test.js"></script>
-<script>
-function init() {
- chrometest.run([
- 'common.js',
- 'io2014_test.js',
- ]);
-}
-</script>
-</body>
-</html>
diff --git a/ports/devenv/tests/io2014_test.js b/ports/devenv/tests/io2014_test.js
deleted file mode 100644
index 519d498..0000000
--- a/ports/devenv/tests/io2014_test.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals TEST_F, ASSERT_EQ, ASSERT_TRUE, chrometest, DevEnvTest */
-
-'use strict';
-
-// Tests of the Google I/O 2014 tutorial at:
-// https://developer.chrome.com/native-client/io2014
-
-// Install the default packages.
-// This test must be run before any tests that use these packages.
-TEST_F(DevEnvTest, 'testDefaultPackageInstall', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.installDefaultPackages();
- });
-});
-
-TEST_F(DevEnvTest, 'testDemo', function() {
- // Test cat and rm.
- var self = this;
- var pid;
- var bashrc = 'git config --global user.name "John Doe"\n' +
- 'git config --global user.email johndoe@example.com\n';
- var patch =
- 'diff --git a/voronoi.cc b/voronoi.cc\n' +
- 'index 897ec35..6e0b080 100644\n' +
- '--- a/voronoi.cc\n' +
- '+++ b/voronoi.cc\n' +
- '@@ -503,7 +503,7 @@ void Voronoi::Update() {\n' +
- ' if (NULL == ps_context_->data)\n' +
- ' return;\n' +
- ' assert(is_pow2(ps_context_->width));\n' +
- '- assert(is_pow2(ps_context_->hieght));\n' +
- '+ assert(is_pow2(ps_context_->height));\n' +
- ' \n' +
- " // When benchmarking is running, don't update display via\n" +
- ' // PSContext2DSwapBuffer() - vsync is enabled by default,' +
- ' and will throttle\n';
- return Promise.resolve().then(function() {
- return self.initFileSystem();
- }).then(function() {
- return self.writeFile('/home/user/.bashrc', bashrc);
- }).then(function() {
- return self.checkCommand('source ~/.bashrc');
- }).then(function() {
- return self.checkCommand('mkdir work');
- }).then(function() {
- return self.checkCommand(
- 'cd work && ' +
- 'curl http://nacltools.storage.googleapis.com/io2014/voronoi.zip -O');
- }).then(function() {
- return self.checkCommand('cd work && ls', 0, 'voronoi.zip\n');
- }).then(function() {
- return self.checkCommand('cd work && unzip voronoi.zip');
- }).then(function() {
- return self.checkCommand('cd work/voronoi && ls Makefile', 0, 'Makefile\n');
- }).then(function() {
- return self.checkCommand('cd work/voronoi && git init');
- }).then(function() {
- return self.checkCommand('cd work/voronoi && git add .');
- }).then(function() {
- return self.checkCommand(
- 'cd work/voronoi && git commit -m "imported voronoi demo"');
- }).then(function() {
- return self.checkCommand('cd work/voronoi && make', 2);
- }).then(function() {
- return self.writeFile('/home/user/patch1', patch);
- }).then(function() {
- return self.checkCommand('cd work/voronoi && git apply ~/patch1');
- }).then(function() {
- return self.checkCommand('cd work/voronoi && make -j10');
- }).then(function() {
- return self.checkCommand(
- 'cd work/voronoi && git commit -am "fixed build error"');
- }).then(function() {
- var sysArch = self.params['SYS_ARCH'];
- var libDir;
- var suffix;
- if (sysArch === 'i686') {
- libDir = 'lib32';
- suffix = 'x86_32';
- } else if (sysArch === 'x86_64') {
- libDir = 'lib64';
- suffix = 'x86_64';
- } else {
- ASSERT_TRUE(false, 'unknown arch: ' + sysArch);
- }
- return self.spawnCommand(
- 'cd work/voronoi && ' +
- 'LD_LIBRARY_PATH=' + libDir + ' ' +
- 'NACL_SPAWN_MODE=popup ' +
- 'NACL_POPUP_WIDTH=512 ' +
- 'NACL_POPUP_HEIGHT=512 ' +
- './voronoi_' + suffix + '.nexe');
- }).then(function(msg) {
- pid = msg.pid;
- return chrometest.sleep(1000);
- }).then(function(msg) {
- self.sigint();
- return self.waitCommand(pid);
- }).then(function(msg) {
- ASSERT_EQ(128 + 9, msg.status, 'Expect kill status');
- });
-});
diff --git a/ports/devenv/tests/jseval_test.html b/ports/devenv/tests/jseval_test.html
deleted file mode 100644
index 8478be4..0000000
--- a/ports/devenv/tests/jseval_test.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<html>
-<!--
-Copyright (c) 2014 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.
--->
-<body onload="init();">
-<script src="/_chrome_test.js"></script>
-<script src="/pipeserver.js"></script>
-<script src="/naclprocess.js"></script>
-<script>
-function init() {
- chrometest.run([
- 'jseval_test.js',
- ]);
-}
-</script>
-</body>
-</html>
diff --git a/ports/devenv/tests/jseval_test.js b/ports/devenv/tests/jseval_test.js
deleted file mode 100644
index 9f19bc3..0000000
--- a/ports/devenv/tests/jseval_test.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals TEST_F, ASSERT_EQ, chrometest, NaClProcessManager */
-
-'use strict';
-
-// TODO(sbc): Remove this once html5f becomes the default for nacl-spawn
-NaClProcessManager.fsroot = '/';
-
-function run(nmf, cmd) {
- var mgr = new NaClProcessManager();
- // Assume a default terminal size for headless processes.
- mgr.onTerminalResize(80, 24);
- return new Promise(function(resolve, reject) {
- mgr.spawn(
- nmf, cmd, [], '/tmp', 'pnacl', null, -1,
- function(pid) {
- mgr.waitpid(pid, 0, function(pid, code) { resolve(code); });
- });
- });
-}
-
-function runOk(nmf, cmd) {
- return run(nmf, cmd).then(function(result) {
- ASSERT_EQ(0, result);
- });
-}
-
-function getFile(filename) {
- return chrometest.httpGet(
- 'filesystem:' + location.origin + '/temporary/' + filename);
-}
-
-TEST_F(chrometest.Test, 'testJSEvalString', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return runOk('jseval.nmf', ['jseval', '-e', '6 * 7', 'foo.txt']);
- }).then(function(result) {
- return getFile('foo.txt');
- }).then(function(data) {
- ASSERT_EQ('42', data);
- });
-});
-
-TEST_F(chrometest.Test, 'testJSEvalFile', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return runOk('jseval.nmf', ['jseval', '-e', '"9 * 9"', 'foo.txt']);
- }).then(function() {
- return runOk('jseval.nmf', ['jseval', '-f', 'foo.txt', 'bar.txt']);
- }).then(function() {
- return getFile('bar.txt');
- }).then(function(data) {
- ASSERT_EQ('81', data);
- });
-});
diff --git a/ports/devenv/which b/ports/devenv/which
deleted file mode 100755
index 5b2329d..0000000
--- a/ports/devenv/which
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /bin/sh
-set -ef
-
-if test -n "$KSH_VERSION"; then
- puts() {
- print -r -- "$*"
- }
-else
- puts() {
- printf '%s\n' "$*"
- }
-fi
-
-ALLMATCHES=0
-
-while getopts a whichopts
-do
- case "$whichopts" in
- a) ALLMATCHES=1 ;;
- ?) puts "Usage: $0 [-a] args"; exit 2 ;;
- esac
-done
-shift $(($OPTIND - 1))
-
-if [ "$#" -eq 0 ]; then
- ALLRET=1
-else
- ALLRET=0
-fi
-case $PATH in
- (*[!:]:) PATH="$PATH:" ;;
-esac
-for PROGRAM in "$@"; do
- RET=1
- IFS_SAVE="$IFS"
- IFS=:
- case $PROGRAM in
- */*)
- if [ -f "$PROGRAM" ] && [ -x "$PROGRAM" ]; then
- puts "$PROGRAM"
- RET=0
- fi
- ;;
- *)
- for ELEMENT in $PATH; do
- if [ -z "$ELEMENT" ]; then
- ELEMENT=.
- fi
- if [ -f "$ELEMENT/$PROGRAM" ] && [ -x "$ELEMENT/$PROGRAM" ]; then
- puts "$ELEMENT/$PROGRAM"
- RET=0
- [ "$ALLMATCHES" -eq 1 ] || break
- fi
- done
- ;;
- esac
- IFS="$IFS_SAVE"
- if [ "$RET" -ne 0 ]; then
- ALLRET=1
- fi
-done
-
-exit "$ALLRET"
diff --git a/ports/devenv/whitelist.js b/ports/devenv/whitelist.js
deleted file mode 100644
index d892ffe..0000000
--- a/ports/devenv/whitelist.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-NaClProcessManager.nmfWhitelist = [
- 'bash',
- 'funzip',
- 'geturl',
- 'jseval',
- 'sh',
- 'pkg',
- 'unzip',
- 'unzipsfx',
-];
diff --git a/ports/devil/build.sh b/ports/devil/build.sh
deleted file mode 100644
index 51ce2e7..0000000
--- a/ports/devil/build.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2013 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.
-
-if [ "${NACL_ARCH}" = "pnacl" ]; then
- NACLPORTS_CFLAGS+=" -std=gnu89"
-fi
-
-TestStep() {
- return 0
-
- if [ ${NACL_ARCH} == "pnacl" ]; then
- # Run once for each architecture.
-
- WriteLauncherScript test/testil testil.x86-32.nexe
- (cd test && make check)
-
- WriteLauncherScript test/testil testil.x86-64.nexe
- (cd test && make check)
- else
- (cd test && make check)
- fi
-}
diff --git a/ports/devil/nacl.patch b/ports/devil/nacl.patch
deleted file mode 100644
index 8cfbb94..0000000
--- a/ports/devil/nacl.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-diff --git a/m4/devil-definitions.m4 b/m4/devil-definitions.m4
---- a/m4/devil-definitions.m4
-+++ b/m4/devil-definitions.m4
-@@ -273,15 +273,19 @@ AC_DEFUN([TEST_API],
- [enable_$1="yes"]) ])
-
- dnl Test for restrict c/c++ keyword
-+dnl TODO(binji): Turn back on restrict. On clang, this fails below because it
-+dnl adds --std=gnu99 to CFLAGS. This works fine with clang, but clang++
-+dnl complains that the flag is incompatible. g++ doesn't seem to mind, however.
- AC_DEFUN([DEVIL_CHECK_RESTRICT],
- [AC_MSG_CHECKING([restrict keyword])
-- AC_COMPILE_IFELSE([[void foo(void * restrict test){}]],
-- [AC_DEFINE([RESTRICT_KEYWORD],
-- [],
-- [restric keyword available])
-- restrict_keyword="found"
-- AC_MSG_RESULT([yes]) ],
-- [AC_MSG_RESULT([no]) ]) ])
-+ AC_MSG_RESULT([no])])
-+dnl AC_COMPILE_IFELSE([[void foo(void * restrict test){}]],
-+dnl [AC_DEFINE([RESTRICT_KEYWORD],
-+dnl [],
-+dnl [restric keyword available])
-+dnl restrict_keyword="found"
-+dnl AC_MSG_RESULT([yes]) ],
-+dnl [AC_MSG_RESULT([no]) ]) ])
-
- AC_DEFUN([DEVIL_CHECK_RESTRICT_GNU99],
- [TMP_CFLAGS="$CFLAGS"
-diff --git a/src-IL/include/il_endian.h b/src-IL/include/il_endian.h
---- a/src-IL/include/il_endian.h
-+++ b/src-IL/include/il_endian.h
-@@ -40,7 +40,7 @@
- #else
- #undef __BIG_ENDIAN__
- #undef __LITTLE_ENDIAN__ // Not sure if it's defined by any compiler...
-- #define __LITTLE_ENDIAN__
-+ #define __LITTLE_ENDIAN__ 1
- #define Short(s)
- #define UShort(s)
- #define Int(i)
-diff --git a/src-IL/src/il_alloc.c b/src-IL/src/il_alloc.c
---- a/src-IL/src/il_alloc.c
-+++ b/src-IL/src/il_alloc.c
-@@ -123,6 +123,7 @@ static void ILAPIENTRY DefaultFreeFunc(const void * CONST_RESTRICT ptr)
- {
- if (ptr)
- {
-+#ifdef VECTORMEM
- #ifdef MM_MALLOC
- _mm_free((void*)ptr);
- #else
-@@ -132,6 +133,9 @@ static void ILAPIENTRY DefaultFreeFunc(const void * CONST_RESTRICT ptr)
- free((void*)ptr);
- #endif //OTHERS...
- #endif //MM_MALLOC
-+#else //VECTORMEM
-+ free((void*)ptr);
-+#endif
- }
- }
-
-diff --git a/src-IL/src/il_icon.c b/src-IL/src/il_icon.c
---- a/src-IL/src/il_icon.c
-+++ b/src-IL/src/il_icon.c
-@@ -525,7 +525,7 @@ ILboolean ico_readpng_get_image(ICOIMAGE *Icon, ILdouble display_exponent)
-
- // Expand low-bit-depth grayscale images to 8 bits
- if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
-- png_set_gray_1_2_4_to_8(ico_png_ptr);
-+ png_set_expand_gray_1_2_4_to_8(ico_png_ptr);
- }
-
- // Expand RGB images with transparency to full alpha channels
-diff --git a/src-IL/src/il_internal.c b/src-IL/src/il_internal.c
---- a/src-IL/src/il_internal.c
-+++ b/src-IL/src/il_internal.c
-@@ -21,7 +21,12 @@ ILimage *iCurImage = NULL;
-
- /* Siigron: added this for Linux... a #define should work, but for some reason
- it doesn't (anyone who knows why?) */
--#if !_WIN32 || (_WIN32 && __GNUC__) // Cygwin
-+#if defined(__native_client__) && defined(__GLIBC__)
-+ #define stricmp strcasecmp
-+ #define strnicmp strncasecmp
-+#elif defined(__native_client__) && !defined(__GLIBC__)
-+ // Already defined in string.h
-+#elif !_WIN32 || (_WIN32 && __GNUC__) // Cygwin
- int stricmp(const char *src1, const char *src2)
- {
- return strcasecmp(src1, src2);
-diff --git a/src-IL/src/il_png.c b/src-IL/src/il_png.c
---- a/src-IL/src/il_png.c
-+++ b/src-IL/src/il_png.c
-@@ -278,7 +278,7 @@ ILboolean readpng_get_image(ILdouble display_exponent)
-
- // Expand low-bit-depth grayscale images to 8 bits
- if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
-- png_set_gray_1_2_4_to_8(png_ptr);
-+ png_set_expand_gray_1_2_4_to_8(png_ptr);
- }
-
- // Expand RGB images with transparency to full alpha channels
-diff --git a/test/format_test/format_checks.sh.in b/test/format_test/format_checks.sh.in
---- a/test/format_test/format_checks.sh.in
-+++ b/test/format_test/format_checks.sh.in
-@@ -30,9 +30,9 @@ do
- then # This extension is not considered as supported...
- continue;
- fi
-- test -n "$VERBOSE" && echo $WINE ./testil@EXEEXT@ -e $EXTENSION
-+ test -n "$VERBOSE" && echo $WINE ./testil.sh -e $EXTENSION
- # EXEEXT comes in when one compiles on platforms that append extensions to executables (testil.exe)
-- $WINE ./testil@EXEEXT@ -e$VERBOSE $EXTENSION
-+ $WINE ./testil.sh -e$VERBOSE $EXTENSION
-
- # We have to capture whether the test has failed or not
- if [ ! $? -eq 0 ]
diff --git a/ports/devil/pkg_info b/ports/devil/pkg_info
deleted file mode 100644
index 978e9f6..0000000
--- a/ports/devil/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=devil
-VERSION=1.7.8
-URL=http://downloads.sf.net/openil/DevIL-1.7.8.tar.gz
-LICENSE=LGPL:COPYING
-DEPENDS=(libpng jpeg8d libmng tiff lcms)
-SHA1=bc27e3e830ba666a3af03548789700d10561fcb1
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/dosbox/README.nacl b/ports/dosbox/README.nacl
deleted file mode 100644
index d6d0e50..0000000
--- a/ports/dosbox/README.nacl
+++ /dev/null
@@ -1,29 +0,0 @@
-DOSBox for NaCl
-===============
-
-This port of DOSBox to NaCl enables running on legacy DOS
-application withing chrome. Its is based on the NaCl SDL
-port.
-
-In order to load applications into the system the dosbox
-'mount' command must be used to export part of the NaCl
-virtual filesystem to dosbox. e.g::
-
- $ mount c /path/to/app
-
-This command will mount the contents of /path/to/app as
-the DOS C: drive.
-
-Tar files can be extract into the NaCl VFS by setting the
-sdl_mount_http attribute on the NaCl embed tag. e.g::
-
- sdl_tar_extract="/mnt/http/myapp.tar:/myapp"
-
-This attribute tells SDL to extra the file app.tar (which
-should live alongside the html file on the web server) to
-/app in the NaCl virtual filesystem. Then the following
-commands can be entered to run the app within dosbox:
-
- $ mount c /myapp
- $ c:
- $ myapp.exe
diff --git a/ports/dosbox/build.sh b/ports/dosbox/build.sh
deleted file mode 100644
index 4ba337d..0000000
--- a/ports/dosbox/build.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-# 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.
-
-EXECUTABLES=src/dosbox${NACL_EXEEXT}
-MAKE_TARGETS="AR=${NACLAR}"
-
-ConfigureStep() {
- SetupCrossEnvironment
-
- CONFIG_FLAGS="--host=${CONF_HOST} --build=${CONF_BUILD} \
- --prefix=${PREFIX} \
- --with-sdl-prefix=${NACL_TOOLCHAIN_ROOT} \
- --disable-shared \
- --with-sdl-exec-prefix=${NACL_TOOLCHAIN_ROOT}"
-
- # TODO(clchiou): Sadly we cannot export LIBS and LDFLAGS to configure, which
- # would fail due to multiple definitions of main and missing pp::CreateModule.
- # So we patch auto-generated Makefile after running configure.
- export PPAPI_LIBS=""
- export LIBS="-lnacl_io"
- LogExecute ${SRC_DIR}/configure ${CONFIG_FLAGS}
-
- SED_PREPEND_LIBS="s|^LIBS = \(.*$\)|LIBS = ${PPAPI_LIBS} \1|"
- SED_REPLACE_LDFLAGS="s|^LDFLAGS = .*$|LDFLAGS = ${NACLPORTS_LDFLAGS}|"
-
- find . -name Makefile -exec cp {} {}.bak \; \
- -exec sed -i.bak "${SED_PREPEND_LIBS}" {} \; \
- -exec sed -i.bak "${SED_REPLACE_LDFLAGS}" {} \;
-}
-
-InstallStep(){
- MakeDir ${PUBLISH_DIR}
- LogExecute install ${START_DIR}/dosbox.html ${PUBLISH_DIR}
- LogExecute install src/dosbox${NACL_EXEEXT} \
- ${PUBLISH_DIR}/dosbox_${NACL_ARCH}${NACL_EXEEXT}
- local CREATE_NMF="${NACL_SDK_ROOT}/tools/create_nmf.py"
- LogExecute ${CREATE_NMF} -s ${PUBLISH_DIR} ${PUBLISH_DIR}/dosbox_*${NACL_EXEEXT} -o ${PUBLISH_DIR}/dosbox.nmf
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- sed -i.bak 's/x-nacl/x-pnacl/' ${PUBLISH_DIR}/dosbox.html
- fi
-}
diff --git a/ports/dosbox/dosbox.html b/ports/dosbox/dosbox.html
deleted file mode 100644
index 0240426..0000000
--- a/ports/dosbox/dosbox.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-
- <!--
- Copyright 2011 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.
- -->
-
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Dosbox Native Client Demo</title>
- </head>
- <body>
- <embed name="nacl_module" id="dosbox" width=700 height=500
- sdl_mount_http=".:/mnt/http" src="dosbox.nmf" type="application/x-nacl" />
- </body>
-</html>
diff --git a/ports/dosbox/nacl.patch b/ports/dosbox/nacl.patch
deleted file mode 100644
index fd515a7..0000000
--- a/ports/dosbox/nacl.patch
+++ /dev/null
@@ -1,197 +0,0 @@
-diff --git a/include/dos_inc.h b/include/dos_inc.h
---- a/include/dos_inc.h
-+++ b/include/dos_inc.h
-@@ -28,6 +28,8 @@
- #include "mem.h"
- #endif
-
-+#include <cstddef>
-+
- #ifdef _MSC_VER
- #pragma pack (1)
- #endif
-diff --git a/include/setup.h b/include/setup.h
---- a/include/setup.h
-+++ b/include/setup.h
-@@ -21,6 +21,8 @@
- #ifndef DOSBOX_SETUP_H
- #define DOSBOX_SETUP_H
-
-+#include <stdio.h>
-+
- #ifdef _MSC_VER
- #pragma warning ( disable : 4786 )
- #pragma warning ( disable : 4290 )
-diff --git a/src/cpu/core_dyn_x86/risc_x86.h b/src/cpu/core_dyn_x86/risc_x86.h
---- a/src/cpu/core_dyn_x86/risc_x86.h
-+++ b/src/cpu/core_dyn_x86/risc_x86.h
-@@ -134,7 +134,11 @@ return_address:
- "pushl %%ebp \n"
- "pushl $(run_return_adress) \n"
- "pushl %2 \n"
-+#ifndef __native_client__
- "jmp *%3 \n"
-+#else
-+ "nacljmp %3 \n"
-+#endif
- "run_return_adress: \n"
- "popl %%ebp \n"
- :"=a" (retval), "=c" (tempflags)
-@@ -1068,5 +1072,3 @@ static void gen_init(void) {
- x86gen.regs[X86_REG_ESI]=new GenReg(6);
- x86gen.regs[X86_REG_EDI]=new GenReg(7);
- }
--
--
-diff --git a/src/gui/sdl_mapper.cpp b/src/gui/sdl_mapper.cpp
---- a/src/gui/sdl_mapper.cpp
-+++ b/src/gui/sdl_mapper.cpp
-@@ -360,7 +360,91 @@ static SDLKey sdlkey_map[]={
- expression will raise a compiler error if the condition is false. */
- typedef char assert_right_size [MAX_SCANCODES == (sizeof(sdlkey_map)/sizeof(sdlkey_map[0])) ? 1 : -1];
-
--#else // !MACOSX
-+#elif defined(__native_client__)
-+
-+#define MAX_SCANCODES 256
-+static SDLKey sdlkey_map[MAX_SCANCODES] = {
-+/* 0 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, SDLK_BACKSPACE, SDLK_TAB,
-+/* 10 */
-+Z, Z, Z, SDLK_RETURN, Z,
-+Z, SDLK_LSHIFT, SDLK_LCTRL, SDLK_LALT, SDLK_PAUSE,
-+/* 20 */
-+SDLK_CAPSLOCK, Z, Z, Z, Z,
-+Z, Z, SDLK_ESCAPE, Z, Z,
-+/* 30 */
-+Z, Z, SDLK_SPACE, SDLK_PAGEUP, SDLK_PAGEDOWN,
-+SDLK_END, SDLK_HOME, SDLK_LEFT, SDLK_UP, SDLK_RIGHT,
-+/* 40 */
-+SDLK_DOWN, Z, SDLK_PRINT, Z, Z,
-+SDLK_INSERT, SDLK_DELETE, Z, SDLK_0, SDLK_1,
-+/* 50 */
-+SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6,
-+SDLK_7, SDLK_8, SDLK_9, Z, Z,
-+/* 60 */
-+Z, Z, Z, Z, Z,
-+SDLK_a, SDLK_b, SDLK_c, SDLK_d, SDLK_e,
-+/* 70 */
-+SDLK_f, SDLK_g, SDLK_h, SDLK_i, SDLK_j,
-+SDLK_k, SDLK_l, SDLK_m, SDLK_n, SDLK_o,
-+/* 80 */
-+SDLK_p, SDLK_q, SDLK_r, SDLK_s, SDLK_t,
-+SDLK_u, SDLK_v, SDLK_w, SDLK_x, SDLK_y,
-+/* 90 */
-+SDLK_z, SDLK_LSUPER, SDLK_RSUPER, SDLK_MENU, Z,
-+Z, SDLK_KP0, SDLK_KP1, SDLK_KP2, SDLK_KP3,
-+/* 100 */
-+SDLK_KP4, SDLK_KP5, SDLK_KP6, SDLK_KP7, SDLK_KP8,
-+SDLK_KP9, SDLK_KP_MULTIPLY, SDLK_KP_PLUS, Z, SDLK_KP_MINUS,
-+/* 110 */
-+SDLK_KP_PERIOD, SDLK_KP_DIVIDE, SDLK_F1, SDLK_F2, SDLK_F3,
-+SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8,
-+/* 120 */
-+SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12, Z,
-+Z, Z, Z, Z, Z,
-+/* 130 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 140 */
-+Z, Z, Z, Z, SDLK_NUMLOCK,
-+SDLK_SCROLLOCK, Z, Z, Z, Z,
-+/* 150 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 160 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 170 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 180 */
-+Z, Z, Z, Z, Z,
-+Z, SDLK_SEMICOLON, SDLK_EQUALS, SDLK_COMMA, SDLK_MINUS,
-+/* 190 */
-+SDLK_PERIOD, SDLK_SLASH, SDLK_BACKQUOTE, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 200 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 210 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, SDLK_LEFTBRACKET,
-+/* 220 */
-+SDLK_BACKSLASH, SDLK_RIGHTBRACKET, SDLK_QUOTE, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 230 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 240 */
-+Z, Z, Z, Z, Z,
-+Z, Z, Z, Z, Z,
-+/* 250 */
-+Z, Z, Z, Z, Z,
-+Z
-+};
-+
-+#else // !MACOSX && !__native_client__
-
- #define MAX_SCANCODES 212
- static SDLKey sdlkey_map[MAX_SCANCODES]={SDLK_UNKNOWN,SDLK_ESCAPE,
-@@ -415,7 +499,7 @@ Bitu GetKeyCode(SDL_keysym keysym) {
- /* try to retrieve key from symbolic key as scancode is zero */
- if (keysym.sym<MAX_SDLKEYS) key=scancode_map[(Bitu)keysym.sym];
- }
--#if !defined (WIN32) && !defined (MACOSX) && !defined(OS2)
-+#if !defined (WIN32) && !defined (MACOSX) && !defined(OS2) && !defined (__native_client__)
- /* Linux adds 8 to all scancodes */
- else key-=8;
- #endif
-@@ -2401,7 +2485,7 @@ void MAPPER_StartUp(Section * sec) {
- usescancodes=true;
-
- /* Note: table has to be tested/updated for various OSs */
--#if defined (MACOSX)
-+#if defined (MACOSX) || defined(__native_client__)
- /* nothing */
- #elif defined(OS2)
- sdlkey_map[0x61]=SDLK_UP;
-diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp
---- a/src/gui/sdlmain.cpp
-+++ b/src/gui/sdlmain.cpp
-@@ -1743,7 +1743,10 @@ int main(int argc, char* argv[]) {
- #if SDL_VERSION_ATLEAST(1, 2, 14)
- putenv(const_cast<char*>("SDL_DISABLE_LOCK_KEYS=1"));
- #endif
-- if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM
-+ if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER
-+#ifndef __native_client__
-+ |SDL_INIT_CDROM /* nacl-SDL is not built with CDROM */
-+#endif /* __native_client__ */
- |SDL_INIT_NOPARACHUTE
- ) < 0 ) E_Exit("Can't init SDL %s",SDL_GetError());
- sdl.inited = true;
-@@ -1899,6 +1902,22 @@ int main(int argc, char* argv[]) {
- return 0;
- }
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#include <libgen.h>
-+#include <assert.h>
-+
-+// Horrible hack to ensure that _execve is pulled out of libnosys.a
-+// TODO(sbc): Remove this once libnosys is rolled in libnacl
-+extern "C" void* _execve;
-+void* foo = (void*)_execve;
-+
-+char *dirname(char *path) {
-+ fprintf(stderr, "ERROR: %s is not implemented\n", __func__);
-+ assert(0);
-+ return NULL;
-+}
-+#endif
-+
- void GFX_GetSize(int &width, int &height, bool &fullscreen) {
- width = sdl.draw.width;
- height = sdl.draw.height;
diff --git a/ports/dosbox/pkg_info b/ports/dosbox/pkg_info
deleted file mode 100644
index 54e6acb..0000000
--- a/ports/dosbox/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=dosbox
-VERSION=0.74
-URL=http://download.sf.net/dosbox/dosbox/0.74/dosbox-0.74.tar.gz
-LICENSE=GPL
-DEPENDS=(sdl zlib libpng)
-SHA1=2d99f0013350efb29b769ff19ddc8e4d86f4e77e
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/dreadthread/LICENSE b/ports/dreadthread/LICENSE
deleted file mode 100644
index 3791f75..0000000
--- a/ports/dreadthread/LICENSE
+++ /dev/null
@@ -1,46 +0,0 @@
-Copyright (c) 2011 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.
-
-Copyright (c) 1994, 1996 by Bennet Yee.
-
-This material was developed by the author. Permission to copy this
-software, to redistribute it, and to use it for any purpose is hereby
-granted, subject to the following five restrictions.
-
-1. Any copy made of this software must include this copyright notice in
-full.
-
-2. All materials containing this software or derivatives thereof must
-provide this software in source form or provide a means of obtaining
-this software in source form; no fees may be charged for this software
-except those for covering media costs and handling.
-
-3. All materials developed as a consequence of the use of this software
-shall duly acknowledge such use, in accordance with the usual standards
-of acknowledging credit in academic research.
-
-4. The author makes no warranty or representation that the operation
-of this software will be error-free, and the author is under no
-obligation to provide any services, by way of maintenance, update, or
-otherwise.
-
-5. In conjunction with products arising from the use of this material,
-there shall be no use of the names of the author, of Carnegie-Mellon
-University or University of California, nor of any adaptation thereof
-in any advertising, promotional, or sales literature without prior
-written consent from the author, Carnegie-Mellon University, and
-University of California in each case.
-
-If you have questions, you can contact the author at bsy@cs.ucsd.edu
-
-Users of this software is requested to make their best efforts (a) to
-return to the author any improvements or extensions that they make, so
-that these may be included in future releases; (b) to document clearly
-any improvements or extensions made to this software; and (c) to inform
-the author of noteworthy uses of this software. Any improvements or
-extensions to this software may be placed under different copyright
-restrictions by the author of those improvements or extensions. That
-those improvements or extensions be placed under the same copyright as
-this software is encouraged.
-
diff --git a/ports/dreadthread/Makefile b/ports/dreadthread/Makefile
deleted file mode 100644
index 40d0ff9..0000000
--- a/ports/dreadthread/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-CC=gcc
-CFLAGS=-g -Wall -Dposix_signals
-SRCS=dread.c dread_chain.c
-OBJS=$(SRCS:c=o)
-HDRS=dreadthread.h dreadthread_ctxt.h dreadthread_chain.h
-TEST_PROGS=test test2 stack_est test4
-# test3 used pico_select, not avail in NaCl
-TEST_PROG_OBJS=$(TEST_PROGS:%=%.o)
-
-all: libdreadthread.a
-
-test_progs: $(TEST_PROGS)
-
-$(TEST_PROG_OBJS): $(HDRS)
-
-install: libdreadthread.a $(HDRS)
- rm -f $(LIBDIR)/libdreadthread.a
- cp -p libdreadthread.a $(LIBDIR)/libdreadthread.a
- ranlib $(LIBDIR)/libdreadthread.a
- for i in $(HDRS); do bn=`basename $$i`; rm -f $(INCDIR)/$$bn; cp -p $$i $(INCDIR)/$$bn; done
-
-$(OBJS): $(HDRS)
-
-libdreadthread.a: $(OBJS) $(MD_OBJS)
- ar ru libdreadthread.a $(OBJS) $(MD_OBJS)
- ranlib libdreadthread.a
-
-%: %.o libdreadthread.a
- $(CC) $(LDFLAGS) $(CFLAGS) -o $* $*.o libdreadthread.a -lm $(LIBES)
-
-clean:
- rm -f *.o stack_est test test2 test3 test4 libdreadthread.a *~ core
diff --git a/ports/dreadthread/README b/ports/dreadthread/README
deleted file mode 100644
index e8a1292..0000000
--- a/ports/dreadthread/README
+++ /dev/null
@@ -1,34 +0,0 @@
- pico_thread
-
- bsy@cs.ucsd.edu
- Mar, 1996
-
-This is a portable, machine independent coroutine threads package. It
-was written in 1994 while I was a graduate student at Carnegie Mellon.
-In 1996, I added the pico_select interface to integrate in I/O
-operations because I wanted to build a coroutine based Web server.
-
-The portability of this coroutine package stems from its design around
-the ubiquitious setjmp/longjmp primitives, which suffices for the
-basic context-switching needed by coroutine threads. The only machine
-(operating system, really) dependency is whether POSIX style signals
-are supported, or whether pre-4.4 Berkeley style signals are provided;
-and whether POSIX style setjmp (vs sigsetjmp) are provided, or whether
-Berkeley _setjmp (vs setjmp) are to be used. Knowledge about signals
-is needed since pico_thread blocks signals while it is doing its
-bookkeeping and while it is context switching between threads to hide
-the threading details from user-supplied signal handlers.
-
-TO DO
-
-A complete, transparent, and stackable syscall emulation library (as
-an separate layer, not integrated into pico_thread since it may not be
-desired) to make writing coroutine threads easier.
-
-Preemption via interval timer clocks.
-
-Stack usage estimates; stack overflow panics.
-
-Complete the pico_io interface to provide stdio-like I/O which uses
-pico_select internally to permit threads to perform (disjoint) I/O
-operations.
diff --git a/ports/dreadthread/README.NaCl b/ports/dreadthread/README.NaCl
deleted file mode 100644
index 70fe6bb..0000000
--- a/ports/dreadthread/README.NaCl
+++ /dev/null
@@ -1,6 +0,0 @@
-Renamed from pico to dreadthread due to project name collision.
-
-pico thread library's support for non-blocking I/O via pico_select was
-removed, since NaCl does not provide a select, poll, or epoll system
-calls. Signal blocking/unblocking code was similarly removed, since
-NaCl doesn't have signals.
diff --git a/ports/dreadthread/build.sh b/ports/dreadthread/build.sh
deleted file mode 100644
index 4d17e74..0000000
--- a/ports/dreadthread/build.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2011 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.
-
-BuildStep() {
- MakeDir ${SRC_DIR}
- ChangeDir ${SRC_DIR}
- ${NACLCC} -c ${START_DIR}/dread.c -o dread.o
- ${NACLCC} -c ${START_DIR}/dread_chain.c -o dread_chain.o
- ${NACLAR} rcs libdreadthread.a \
- dread.o \
- dread_chain.o
- ${NACLRANLIB} libdreadthread.a
-}
-
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}
- LogExecute cp ${SRC_DIR}/libdreadthread.a ${DESTDIR_LIB}/
- LogExecute cp ${START_DIR}/dreadthread.h ${DESTDIR_INCLUDE}/
- LogExecute cp ${START_DIR}/dreadthread_ctxt.h ${DESTDIR_INCLUDE}/
- LogExecute cp ${START_DIR}/dreadthread_chain.h ${DESTDIR_INCLUDE}/
-}
diff --git a/ports/dreadthread/design b/ports/dreadthread/design
deleted file mode 100644
index d2aaef3..0000000
--- a/ports/dreadthread/design
+++ /dev/null
@@ -1,24 +0,0 @@
-
-Stacks go on a free list after they are allocated.
-
-User may allocate thread descriptors, which then is given a stack when
-the function bound to the thread first runs. When it exits, the stack
-is freed and returned to the free list. Stack areas above the topmost
-thread are simply discarded.
-
-Thread descriptors persist even after the bound function returns or
-invokes thread exit routine, since return code is saved there.
-
-mips require simplified context switch longjmp because Mach on mips
-(aka pmax) had code to prevent longjmp to a greater stack address.
-
-stack_est marks the stack with values, call printf while multithreaded
-and also force a few context switches, and then looks at the stack to
-see how much was modified. The parameter -s specifies how much stack
-space to -allocate- for the threads. The program will mark half of
-that space (leaving the rest alone just in case) and test for usage.
-If the output is approximately half of the -s value, re-run the
-program with a larger value. The output is a reasonable baseline for
-stack usage for the architecture on which stack_est was compiled. The
-programmer will still have to raise that per-thread value as his code
-requires (call depth + automatic variable usage).
diff --git a/ports/dreadthread/dread.c b/ports/dreadthread/dread.c
deleted file mode 100644
index f542752..0000000
--- a/ports/dreadthread/dread.c
+++ /dev/null
@@ -1,1136 +0,0 @@
-/*
- * Copyright (c) 1994, 1996 by Bennet Yee.
- *
- * This material was developed by the author. Permission to copy this
- * software, to redistribute it, and to use it for any purpose is hereby
- * granted, subject to the following five restrictions.
- *
- * 1. Any copy made of this software must include this copyright notice in
- * full.
- *
- * 2. All materials containing this software or derivatives thereof must
- * provide this software in source form or provide a means of obtaining
- * this software in source form; no fees may be charged for this software
- * except those for covering media costs and handling.
- *
- * 3. All materials developed as a consequence of the use of this software
- * shall duly acknowledge such use, in accordance with the usual standards
- * of acknowledging credit in academic research.
- *
- * 4. The author makes no warranty or representation that the operation
- * of this software will be error-free, and the author is under no
- * obligation to provide any services, by way of maintenance, update, or
- * otherwise.
- *
- * 5. In conjunction with products arising from the use of this material,
- * there shall be no use of the names of the author, of Carnegie-Mellon
- * University or University of California, nor of any adaptation thereof
- * in any advertising, promotional, or sales literature without prior
- * written consent from the author, Carnegie-Mellon University, and
- * University of California in each case.
- *
- * If you have questions, you can contact the author at bsy@cs.ucsd.edu
- *
- * Users of this software is requested to make their best efforts (a) to
- * return to the author any improvements or extensions that they make, so
- * that these may be included in future releases; (b) to document clearly
- * any improvements or extensions made to this software; and (c) to inform
- * the author of noteworthy uses of this software. Any improvements or
- * extensions to this software may be placed under different copyright
- * restrictions by the author of those improvements or extensions. That
- * those improvements or extensions be placed under the same copyright as
- * this software is encouraged.
- */
-
-/*
- * dread thread -- portable mostly machine independent coroutine threads.
- *
- * Created, bsy@cs.cmu.edu, 1994.
- * Added stack overflow checks, bsy@cs.ucsd.edu, 1996.
- *
- * To do:
- *
- * I/O thread wait.
- * Preemption via timers / signals.
- */
-#include <stdio.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "dreadthread.h"
-
-#define MAGIC_TEST 1
-
-#define DEBUG 0
-#define DEBUG_QUEUES 0
-#define DEBUG_SIGBLOCK 0
-#define SIG_DISABLE 0
-#if DEBUG
-# if 1
-# define DBOUT(args) do { printf args; fflush(stdout); } while (0)
-# else
-# include <stdarg.h>
-char dboutbuf[4096];
-# define DBOUT(args) do { dbprint args; } while (0)
-void dbprint(char *fmt, ...)
-{
- va_list alist;
- int nch;
- va_start(alist,fmt);
- nch = vsprintf(dboutbuf,fmt,alist);
- write(1,dboutbuf,nch);
- va_end(alist);
-}
-# endif
-# define SHOWTHREAD do { \
- printf("Th: %p\n", (void *) dthr_cur_thread); \
- } while (0)
-# if !defined(SIG_DISABLE)
-# define SIG_DISABLE 1
-# endif
-#else
-# define DBOUT(args)
-# define SHOWTHREAD
-#endif
-
-#define DREAD_THREAD_CSW_CSW 0
-#define DREAD_THREAD_CSW_NORM 1
-#define DREAD_THREAD_CSW_CREATE 2
-#define DREAD_THREAD_CSW_EXIT 3
-#define DREAD_THREAD_CSW_MAX 4
-
-struct dthr_thread *dthr_cur_thread = 0;
-
-static struct dthr_stack dthr_topmost_stack;
-static struct dthr_thread dthr_topmost_thread;
-static struct dthr_chain dthr_free_stacks, dthr_active_stacks,
- dthr_runq, dthr_newq;
-static struct dthr_semaphore dthr_newq_sema;
-static struct dthr_event dthr_newq_event;
-static dthr_ctxt_t dthr_deadlock;
-int (*dthr_on_deadlock)() = 0;
-
-#if DEBUG_QUEUES
-void dthr_show_queues(void)
-{
-#define SHOW(var) fprintf(stderr,"\n" #var ":\n"); dthr_chain_show(stderr,&var);
- SHOW(dthr_free_stacks);
- SHOW(dthr_active_stacks);
- SHOW(dthr_runq);
- SHOW(dthr_newq);
- SHOW(dthr_newq_event.threadq);
- SHOW(dthr_newq_sema.threadq);
-}
-#else
-# define dthr_show_queues() do { ;} while (0)
-#endif
-
-
-/* may eventually want to sort stacks by addresses */
-struct dthr_thread *dthr_this_thread(void)
-{
- int stack_var;
- register caddr_t stack_addr = (caddr_t) &stack_var;
- register struct dthr_chain *p;
-
- DBOUT(("dthr_this_thread: scanning for stack addr %p\n",
- (void *) stack_addr));
- for (p = dthr_active_stacks.next; p != &dthr_active_stacks; p = p->next) {
-#if MAGIC_TEST
- if (((struct dthr_stack *) p)->magic != DREAD_THREAD_STACK_MAGIC) {
- fprintf(stderr,
- "dthr_thread: stack descriptor corruption"
- " detected by dthr_this_thread()\n");
- abort();
- }
-#endif
-#if DREAD_THREAD_STACK_GROWS_DOWN
- if (((struct dthr_stack *) p)->stack_top <= stack_addr
- && stack_addr <= ((struct dthr_stack *) p)->stack_base)
- break;
-#else
- if (((struct dthr_stack *) p)->stack_base <= stack_addr
- && stack_addr <= ((struct dthr_stack *) p)->stack_top)
- break;
-#endif
- }
- if (DEBUG) { /* DCE */
- if (p == &dthr_active_stacks) {
- printf("dthr_this_thread: NOT FOUND, assuming TOPMOST (%p)\n",
- (void *) &dthr_topmost_thread);
- } else {
- printf("dthr_this_thread: thread %p",
- (void *) ((struct dthr_stack *) p)->thread);
- }
- }
- return (p == &dthr_active_stacks) ?
- &dthr_topmost_thread : ((struct dthr_stack *) p)->thread;
-}
-
-static void dthr_csw(struct dthr_stack *target, int op);
-
-void dthr_thread_yield(void)
-{
- struct dthr_thread *next_runnable;
-
- SHOWTHREAD;
- DBOUT(("dthr_thread_yield\n"));
- next_runnable = (struct dthr_thread *) DREAD_THREAD_CHAIN_DEQUEUE(&dthr_runq);
- if (next_runnable) {
-#if MAGIC_TEST
- if (next_runnable->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_yield()\n");
- abort();
- }
-#endif
- DBOUT((" found runnable thread %p\n",(void *) next_runnable));
- (void) dthr_chain_enqueue(&dthr_runq,&dthr_cur_thread->link);
- dthr_csw(next_runnable->stack,DREAD_THREAD_CSW_NORM);
- }
- SHOWTHREAD;
- DBOUT(("LV dthr_thread_yield\n"));
-}
-
-struct dthr_semaphore *dthr_semaphore_init(struct dthr_semaphore *sema,
- int init)
-{
- sema->value = init;
- (void) dthr_chain_init(&sema->threadq);
- sema->magic = DREAD_THREAD_SEMA_MAGIC;
- return sema;
-}
-
-/* current thread must already be enqueued somewhere */
-static void dthr_thread_sleep(int leave)
-{
- struct dthr_thread *next_thread;
-
- SHOWTHREAD;
- DBOUT(("dthr_thread_sleep(%d):",leave));
- dthr_show_queues();
-
- do {
- next_thread = (struct dthr_thread *) DREAD_THREAD_CHAIN_DEQUEUE(&dthr_runq);
- DBOUT((" %sthread found %p\n",next_thread?"":"NO ",(void *) next_thread));
-
- } while (!next_thread && dthr_on_deadlock && (*dthr_on_deadlock)());
-
- if (!next_thread) {
- dthr_load_ctxt(&dthr_deadlock,1);
- fprintf(stderr,"dthr_thread: DEADLOCK load context returned\n");
- abort();
- }
-#if MAGIC_TEST
- if (next_thread->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_sleep(%d)\n",
- leave);
- abort();
- }
-#endif
- dthr_csw(next_thread->stack,leave ? DREAD_THREAD_CSW_EXIT
- : DREAD_THREAD_CSW_NORM);
- SHOWTHREAD;
- DBOUT(("LV dthr_thread_sleep\n"));
-}
-
-int dthr_semaphore_try(struct dthr_semaphore *sema)
-{
- register int rv;
-
- SHOWTHREAD;
- DBOUT(("dthr_semaphore_try(%p):",(void *) sema));
-#if MAGIC_TEST
- if (sema->magic != DREAD_THREAD_SEMA_MAGIC) {
- fprintf(stderr,
- "dthr_thread: semaphore structure corruption detected"
- " in dthr_semaphore_try(%p)\n",
- (void *) sema);
- abort();
- }
-#endif
- if (sema->value == 0) {
- rv = 0;
- } else {
- sema->value--;
- rv = 1;
- }
- DBOUT(("\n"));
- return rv;
-}
-
-static void dthr_semaphore_take_no_yield(struct dthr_semaphore *sema)
-{
- SHOWTHREAD;
- DBOUT(("dthr_semaphore_take_no_yield(%p)\n",(void *) sema));
-#if MAGIC_TEST
- if (sema->magic != DREAD_THREAD_SEMA_MAGIC) {
- fprintf(stderr,
- "dthr_thread: semaphore structure corruption detected"
- " in dthr_semaphore_take_no_yield(%p),1\n",
- (void *) sema);
- abort();
- }
-#endif
- while (sema->value == 0) {
- DBOUT(("dthr_semaphore_take_no_yield: not available\n"));
- dthr_chain_enqueue(&sema->threadq,&dthr_cur_thread->link);
- dthr_cur_thread->state = DREAD_THREAD_TH_SEMA_WAIT;
- dthr_thread_sleep(0);
-#if MAGIC_TEST
- if (sema->magic != DREAD_THREAD_SEMA_MAGIC) {
- fprintf(stderr,
- "dthr_thread: semaphore structure corruption detected"
- " in dthr_semaphore_take_no_yield(%p),2\n",
- (void *) sema);
- abort();
- }
-#endif
- }
- sema->value--;
- SHOWTHREAD;
- DBOUT(("LV dthr_semaphore_take_no_yield\n"));
-}
-
-void dthr_semaphore_take(struct dthr_semaphore *sema)
-{
- SHOWTHREAD;
- DBOUT(("dthr_semaphore_take(%p)\n",(void *) sema));
- /* yield -before- taking the semaphore! */
- dthr_thread_yield();
- dthr_semaphore_take_no_yield(sema);
- SHOWTHREAD;
- DBOUT(("LV dthr_semaphore_take\n"));
-}
-
-static void dthr_semaphore_drop_no_yield(struct dthr_semaphore *sema)
-{
- struct dthr_thread *waker;
-
- SHOWTHREAD;
- DBOUT(("dthr_semaphore_drop_no_yield(%p)\n",(void *) sema));
-#if MAGIC_TEST
- if (sema->magic != DREAD_THREAD_SEMA_MAGIC) {
- fprintf(stderr,
- "dthr_thread: semaphore structure corruption detected"
- " in dthr_semaphore_drop_no_yield(%p)\n",
- (void *) sema);
- abort();
- }
-#endif
- ++sema->value;
- waker = (struct dthr_thread *) DREAD_THREAD_CHAIN_DEQUEUE(&sema->threadq);
- if (waker) {
- waker->state = DREAD_THREAD_TH_RUNNABLE;
- dthr_chain_enqueue(&dthr_runq,&waker->link);
- }
- SHOWTHREAD;
- DBOUT(("LV dthr_semaphore_drop_no_yield\n"));
-}
-
-void dthr_semaphore_drop(struct dthr_semaphore *sema)
-{
- SHOWTHREAD;
- DBOUT(("dthr_semaphore_drop(%p)\n",(void *) sema));
- dthr_semaphore_drop_no_yield(sema);
- dthr_thread_yield();
- SHOWTHREAD;
- DBOUT(("LV dthr_semaphore_drop\n"));
-}
-
-void dthr_event_wait(struct dthr_event *event,
- struct dthr_semaphore *lock)
-{
- SHOWTHREAD;
- DBOUT(("dthr_event_wait(%p,%p)\n",(void *) event,(void *) lock));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
-
- DBOUT(("p_e_w: enqueuing current thread %p\n",(void *) dthr_cur_thread));
-#if MAGIC_TEST
- if (event->magic != DREAD_THREAD_EV_MAGIC) {
- fprintf(stderr,
- "dthr_thread: event structure corruption detected"
- " in dthr_event_wait(%p,%p)\n",
- (void *) event,(void *) lock);
- abort();
- }
-#endif
- DBOUT(("p_e_w: about to enqueue this thread onto event\n"));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
- dthr_chain_enqueue(&event->threadq,&dthr_cur_thread->link);
- dthr_cur_thread->state = DREAD_THREAD_TH_EVENT_WAIT;
- DBOUT(("p_e_w: dropping lock %p\n",(void *) lock));
- dthr_semaphore_drop_no_yield(lock);
-
- DBOUT(("p_e_w: about to go sleeping\n"));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
- DBOUT(("p_e_w: sleeping\n"));
- dthr_thread_sleep(0);
- DBOUT(("p_e_w: awaken, retaking lock %p\n",(void *) lock));
- dthr_semaphore_take_no_yield(lock);
-
- DBOUT(("about to lv dthr_event_wait, SHOWTHREAD/chain_show first\n"));
- SHOWTHREAD;
- DBOUT(("about to lv dthr_event_wait, calling chain show prior to exiting\n"));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
- DBOUT(("LV dthr_event_wait\n"));
-}
-
-static void dthr_eventq_to_runq(struct dthr_event *event,
- unsigned int max)
-{
- struct dthr_thread *th;
-
-#if MAGIC_TEST
- if (event->magic != DREAD_THREAD_EV_MAGIC) {
- fprintf(stderr,
- "dthr_thread: event structure corruption detected"
- " in dthr_eventq_to_runq(%p,%d)\n",
- (void *) event,max);
- abort();
- }
-#endif
- while (max > 0 &&
- NULL != (th = (struct dthr_thread *)
- DREAD_THREAD_CHAIN_DEQUEUE(&event->threadq))) {
-#if MAGIC_TEST
- if (th->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_eventq_to_runq(%p,%d)\n",
- (void *) event,max);
- abort();
- }
-#endif
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
- th->state = DREAD_THREAD_TH_RUNNABLE;
- dthr_chain_enqueue(&dthr_runq,&th->link);
- DBOUT(("dthr_eventq_move: %p is now runnable\n",(void *) th));
- --max;
- }
-}
-
-void dthr_event_broadcast_no_yield(struct dthr_event *event)
-{
- SHOWTHREAD;
- DBOUT(("dthr_event_broadcast_no_yield(%p)\n",(void *) event));
-
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
- dthr_eventq_to_runq(event,UINT_MAX);
- SHOWTHREAD;
- DBOUT(("LV dthr_event_broadcast\n"));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
-}
-
-void dthr_event_broadcast(struct dthr_event *event)
-{
- SHOWTHREAD;
- DBOUT(("dthr_event_broadcast(%p)\n",(void *) event));
-
- dthr_eventq_to_runq(event,UINT_MAX);
- dthr_thread_yield();
- SHOWTHREAD;
- DBOUT(("LV dthr_event_broadcast\n"));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
-}
-
-void dthr_event_signal_no_yield(struct dthr_event *event)
-{
- SHOWTHREAD;
- DBOUT(("dthr_event_signal_no_yield(%p)\n",(void *) event));
-
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
- dthr_eventq_to_runq(event,1);
- SHOWTHREAD;
- DBOUT(("LV dthr_event_signal_no_yield\n"));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
-}
-
-void dthr_event_signal(struct dthr_event *event)
-{
- SHOWTHREAD;
- DBOUT(("dthr_event_signal(%p)\n",(void *) event));
-
- dthr_eventq_to_runq(event,1);
- dthr_thread_yield();
- SHOWTHREAD;
- DBOUT(("LV dthr_event_signal\n"));
-#if DEBUG
- dthr_chain_show(stderr,&event->threadq);
-#endif
-}
-
-struct dthr_event *dthr_event_init(struct dthr_event *ev)
-{
- (void) dthr_chain_init(&ev->threadq);
- ev->magic = DREAD_THREAD_EV_MAGIC;
- return ev;
-}
-
-/*
- * Should be first dthr_* routine to be called.
- */
-void dthr_init(void)
-{
-#if DEBUG
- setbuf(stdout,0);
-#endif
- (void) dthr_chain_init(&dthr_free_stacks);
- (void) dthr_chain_init(&dthr_active_stacks);
- (void) dthr_chain_init(&dthr_runq);
- (void) dthr_chain_init(&dthr_newq);
- dthr_topmost_thread.stack = 0;
- dthr_topmost_thread.magic = DREAD_THREAD_TH_MAGIC;
- (void) dthr_semaphore_init(&dthr_newq_sema,1);
- (void) dthr_event_init(&dthr_newq_event);
-}
-
-void dthr_thread_exit(void *status)
-{
- struct dthr_thread_exit *x;
-
- SHOWTHREAD;
- DBOUT(("dthr_thread_exit\n"));
- while ((x = dthr_cur_thread->on_exit) != 0) {
- dthr_cur_thread->on_exit = x->next;
- (*x->fn)(dthr_cur_thread,x->arg);
- free(x);
- }
-#if MAGIC_TEST
- if (dthr_cur_thread->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_exit(%p)\n",
- status);
- abort();
- }
-#endif
- dthr_cur_thread->exit_value = status;
- dthr_cur_thread->state = DREAD_THREAD_TH_EXITED;
-
- SHOWTHREAD;
- DBOUT(("dthr_thread_exit -> sleep"));
- dthr_thread_sleep(1);
-
- fprintf(stderr,"dthr_thread_exit: exited thread still running\n");
- abort();
-}
-
-struct dthr_thread *dthr_thread_init(struct dthr_thread *th,
- void *(*fn)(void *),
- void *fn_arg,
- size_t requested_stack_size)
-{
- DBOUT(("dthr_thread_init(%p,%p,%p,%p)\n",
- (void *) th,(void *) fn,(void *) fn_arg,
- (void *) requested_stack_size));
- th->fn = fn;
- th->fn_arg = fn_arg;
- th->stack_size = requested_stack_size;
-
- th->exit_value = (void *) 0;
- th->state = DREAD_THREAD_TH_RUNNABLE;
- th->stack = 0;
- (void) dthr_semaphore_init(&th->exit_sema,0);
- th->on_exit = 0;
- th->magic = DREAD_THREAD_TH_MAGIC;
- /*
- * no stack bound to this thread yet
- */
- return th;
-}
-
-int dthr_thread_on_exit(struct dthr_thread *th,
- void (*fn)(struct dthr_thread *,void *),
- void *arg)
-{
- struct dthr_thread_exit *x;
-
- DBOUT(("on exit thread %p, fn %p\n",(void *) th,(void *) fn));
- if (!(x = (struct dthr_thread_exit *) malloc(sizeof *x))) return 0;
-#if MAGIC_TEST
- if (th->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_on_exit(%p,%p,%p)\n",
- (void *) th,(void *) fn,(void *) arg);
- abort();
- }
-#endif
-
- x->next = th->on_exit;
- x->fn = fn;
- x->arg = arg;
- th->on_exit = x;
- return 1;
-}
-
-/*
- * Place onto new thread queue. Topmost thread creates stack space and
- * moves thread from new queue to run queue.
- */
-struct dthr_thread *dthr_thread_run(struct dthr_thread *th)
-{
-#if MAGIC_TEST
- if (th->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_run(%p)\n",
- (void *) th);
- abort();
- }
-#endif
- SHOWTHREAD;
- DBOUT(("dthr_thread_run(%p)\n",(void *) th));
- dthr_semaphore_take_no_yield(&dthr_newq_sema);
- dthr_chain_enqueue(&dthr_newq,&th->link);
- dthr_event_signal_no_yield(&dthr_newq_event);
- dthr_semaphore_drop_no_yield(&dthr_newq_sema);
- dthr_thread_yield();
- SHOWTHREAD;
- DBOUT(("LV dthr_thread_run\n"));
- return th;
-}
-
-struct dthr_thread *dthr_thread_wait(struct dthr_thread *th)
-{
-#if MAGIC_TEST
- if (th->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_wait(%p)\n",
- (void *) th);
- abort();
- }
-#endif
- dthr_semaphore_take(&th->exit_sema);
- dthr_semaphore_drop(&th->exit_sema);
- return th;
-}
-
-struct dthr_thread *dthr_thread_detach(struct dthr_thread *th)
-{
-#if MAGIC_TEST
- if (th->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_detach(%p)\n",
- (void *) th);
- abort();
- }
-#endif
- dthr_semaphore_drop(&th->exit_sema);
- /* self cleanup? */
- return th;
-}
-
-/*
- * Returns a stack descriptor from free list -- best fit.
- */
-static struct dthr_stack *dthr_find_free_stack(int size)
-{
- struct dthr_stack *stk, *best_so_far;
- int best_size_diff = INT_MAX, size_diff;
-
- DBOUT(("dthr_find_free_stack\n"));
- for (best_so_far = 0, stk = (struct dthr_stack *) dthr_free_stacks.next;
- (struct dthr_chain *) stk != &dthr_free_stacks;
- stk = (struct dthr_stack *) stk->link.next) {
-#if MAGIC_TEST
- if (stk->magic != DREAD_THREAD_STACK_MAGIC) {
- fprintf(stderr,
- "dthr_thread: stack descriptor corruption detected"
- " by dthr_find_free_stack(0x%08x)\n",
- size);
- abort();
- }
-#endif
- if ((size_diff = stk->stack_size - size) > 0
- && size_diff < best_size_diff) {
- best_size_diff = size_diff;
- best_so_far = stk;
- }
- }
- DBOUT(("dthr_find_free_stack -> %p\n",(void *) best_so_far));
- return best_so_far;
-}
-
-static void dthr_thread_launcher(void);
-
-static void dthr_new_topmost_thread(struct dthr_stack *stk,
- size_t size_wanted,
- int first_time,
- dthr_ctxt_t *continuation)
-{
- int base_candidate;
- caddr_t stack_pos;
- int sofar;
-#if DEBUG
- static int counter;
-#endif
-
-#if MAGIC_TEST
- if (stk->magic != DREAD_THREAD_STACK_MAGIC) {
- fprintf(stderr,
- "dthr_thread: stack descriptor corruption detected"
- " by dthr_new_topmost_thread(%p,0x%08lx,%d,%p)\n",
- (void *) stk,(unsigned long) size_wanted,
- first_time,(void *) continuation);
- abort();
- }
-#endif
- /*
- * The new thread is on the run queue, and when the
- * topmost launcher thread finishes, the new thread
- * will context switch normally and be run.
- */
- if (first_time) {
-#if DEBUG
- DBOUT(("dthr_new_topmost_thread(%p,0x%08x,%d)\n",
- (void *) stk,size_wanted,first_time));
- DBOUT(("dthr_new_topmost_thread: stack at %p, prev stack_base at %p\n",
- (void *) &base_candidate,(void *) stk->stack_base));
- counter = 0;
-#endif
- DBOUT(("dthr_new_topmost_thread.save_ctxt(%p)\n",(void *) &stk->regs));
- if (dthr_save_ctxt(&stk->regs)) {
- DBOUT(("dthr_new_topmost_thread: topmost split, thread %p on the way\n",
- (void *) stk->thread));
- DBOUT(("dthr_new_topmost_thread.load_ctxt(%p,1)\n",
- (void *) continuation));
- dthr_load_ctxt(continuation,1);
- }
- }
-
- stack_pos = (void *) &base_candidate;
-#if DREAD_THREAD_STACK_GROWS_DOWN
- sofar = stk->stack_base - stack_pos;
-#else
- sofar = stack_pos - stk->stack_base;
-#endif
-
-#if DEBUG
- ++counter;
- if (!(counter % 0x10)) {
- printf("dthr_new_topmost_thread: stack 0x%08x so far\n",sofar);
- }
-#endif
- if (sofar < size_wanted + DREAD_THREAD_STACK_EXTRA) {
- dthr_new_topmost_thread(stk,size_wanted,0,continuation);
- /* compiler should not tail recurse here! */
- }
- DBOUT(("dthr_new_topmost_thread: enough stack!\n"));
- /*
- * Actual thread_fork happens here. The stack has grown to the
- * appropriate size, and now we can reset the topmost-stack descriptor
- * to updated values.
- */
- DBOUT(("dthr_new_topmost_thread: marking thread %p as runnable\n",
- (void *) stk->thread));
- dthr_chain_enqueue(&dthr_runq,&stk->thread->link);
-
- DBOUT(("dthr_new_topmost_thread -> launcher\n"));
- dthr_thread_launcher();
-}
-
-static void dthr_thread_launcher(void)
-{
- unsigned long magic = DREAD_THREAD_MAGIC2;
- struct dthr_thread *new_th;
- struct dthr_stack *new_stk;
- dthr_ctxt_t continuation;
- struct dthr_thread_exit *x;
-
- DBOUT(("dthr_thread_launcher\n"));
-
- dthr_topmost_stack.stack_size = 0;
- dthr_topmost_stack.stack_base = (void *) &magic;
- dthr_topmost_stack.stack_top = 0;
- dthr_topmost_stack.thread = &dthr_topmost_thread;
- dthr_topmost_stack.magic = DREAD_THREAD_STACK_MAGIC;
-
- dthr_topmost_thread.stack = &dthr_topmost_stack;
-
- DBOUT(("p_t_l: grabbing new thread queue lock\n"));
- dthr_semaphore_take_no_yield(&dthr_newq_sema);
- for (;;) {
- DBOUT(("p_t_l: getting thread\n"));
- dthr_show_queues();
- while ((new_th = (struct dthr_thread *)
- DREAD_THREAD_CHAIN_DEQUEUE(&dthr_newq)) != 0) {
-#if MAGIC_TEST
- if (new_th->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_launcher(), thread scan\n");
- abort();
- }
-#endif
- DBOUT(("p_t_l: launching thread %p\n",(void *) new_th));
- /* dthr_find_free_stack does magic test */
- if (0 != (new_stk = dthr_find_free_stack(new_th->stack_size))) {
- /*
- * Found a stack for this thread,
- * so now we can just bind them together
- * and context switch to the base of
- * the stack to launch the thread.
- */
- DBOUT(("p_t_l: free stack available on free list %p\n",
- (void *) new_stk));
- DBOUT(("p_t_l: reverting regs\n"));
- memcpy((void *) &new_stk->regs,(void *) &new_stk->base,
- sizeof new_stk->regs);
- new_stk->thread = new_th;
- new_th->stack = new_stk;
- new_th->state = DREAD_THREAD_TH_RUNNABLE;
- dthr_chain_enqueue(&dthr_runq,&new_th->link);
- } else {
- DBOUT(("p_t_l: no sufficiently large stack on free list,"
- " allocating new stack descriptor\n"));
- new_stk = (struct dthr_stack *) malloc(sizeof *new_stk);
- if (!new_stk) {
- fprintf(stderr,
- "dthr_thread: top_thread: No space for stack descriptor\n");
- abort();
- }
- /* copy and correct */
- new_stk->stack_base = dthr_topmost_stack.stack_base;
- new_stk->stack_size = new_th->stack_size;
-#if DREAD_THREAD_STACK_GROWS_DOWN
- new_stk->stack_top = new_stk->stack_base - new_stk->stack_size;
-#else
- new_stk->stack_top = new_stk->stack_base + new_stk->stack_size;
-#endif
- new_stk->magic = DREAD_THREAD_STACK_MAGIC;
-
- /*
- * Turn into new thread; note that temporarily
- * a stack will reference a thread that is not
- * in the run/sema/event queues and is not the
- * current thread.
- */
- new_stk->thread = new_th;
- new_th->stack = new_stk;
- new_th->state = DREAD_THREAD_TH_RUNNABLE;
- /*
- * Ensure that dthr_this_thread will make sense
- */
- dthr_chain_push(&dthr_active_stacks,&new_stk->link);
- /*
- * Grow stack; dthr_topmost_stack is updated
- * as a side effect.
- */
- DBOUT(("p_t_l: dropping new thread queue lock\n"));
- dthr_semaphore_drop_no_yield(&dthr_newq_sema);
- DBOUT(("p_t_l: growing stack\n"));
- DBOUT(("p_t_l.save_ctxt(%p) [cont]\n",(void *) &continuation));
- if (!dthr_save_ctxt(&continuation))
- dthr_new_topmost_thread(new_stk,new_th->stack_size,1,&continuation);
- for (;;) {
- /* base, allowing for stack reuse */
- DBOUT(("p_t_l.dthr_save_ctxt(%p) [base]\n",(void *) &new_stk->base));
- (void) dthr_save_ctxt(&new_stk->base);
-
- /* launch the thread */
- new_th = new_stk->thread;
- dthr_cur_thread = new_th;
-#if MAGIC_TEST
- if (new_th->magic != DREAD_THREAD_TH_MAGIC) {
- fprintf(stderr,
- "dthr_thread: thread structure corruption detected"
- " in dthr_thread_launcher(), base launch\n");
- abort();
- }
-#endif
- new_th->exit_value = (*new_th->fn)(new_th->fn_arg);
-
- while ((x = new_th->on_exit) != 0) {
- new_th->on_exit = x->next;
- (*x->fn)(new_th,x->arg);
- free(x);
- }
-
- DBOUT(("p_t_l: thread %p exited\n",(void *) dthr_cur_thread));
- /* same as dthr_thread_exit here */
- new_th->state = DREAD_THREAD_TH_EXITED;
-
- dthr_thread_sleep(1);
- fprintf(stderr,"dthr_thread_launcher: exited thread still runs\n");
- abort();
- }
- }
- }
- /*
- * wait for more threads to launch
- */
- DBOUT(("p_t_l: waiting for a new thread to launch\n"));
- dthr_event_wait(&dthr_newq_event,&dthr_newq_sema);
- DBOUT(("p_t_l: event wait returned\n"));
- }
-}
-
-/*
- * We force user to pass us a runnable thread directly
- * rather than just placing it on the run queue
- * in order to programmatically enforce that there must
- * be at least one runnable thread when the process
- * goes multithreaded.
- */
-void dthr_thread_multithread(struct dthr_thread *th)
-{
- DBOUT(("dthr_thread_multithread\n"));
-
- dthr_show_queues();
-
- /* no need to lock it yet, since we are only thread running */
- dthr_chain_enqueue(&dthr_newq,&th->link);
- dthr_cur_thread = &dthr_topmost_thread;
-
- dthr_show_queues();
- DBOUT(("dthr_thread_multithread -> launch\n"));
- if (!dthr_save_ctxt(&dthr_deadlock))
- dthr_thread_launcher();
-}
-
-
-
-/*
- * Context switch to thread th_next, doing op to current thread.
- * Interrupts are masked.
- */
-static void dthr_csw(struct dthr_stack *target, int op)
-{
- register struct dthr_stack *this_stack;
- register int rv;
-
- unsigned long magic = DREAD_THREAD_MAGIC;
-
- dthr_show_queues();
- DBOUT(("dthr_csw(%p,%d)\n",(void *) target,op));
- this_stack = dthr_cur_thread->stack;
- DBOUT((" old stack = %p\n",(void *) this_stack));
- if (!this_stack) {
- fprintf(stderr,"dthr_csw: no current stack\n");
- abort();
- }
- if (op == DREAD_THREAD_CSW_EXIT) {
- DBOUT((" leaving exited thread\n"));
-
- dthr_cur_thread->stack = 0;
-
- memset(&this_stack->regs,0,sizeof this_stack->regs);
- dthr_show_queues();
- (void) dthr_chain_delete(&this_stack->link);
- dthr_show_queues();
- dthr_chain_enqueue(&dthr_free_stacks,&this_stack->link);
- dthr_show_queues();
-
- dthr_cur_thread->fn = 0;
- dthr_cur_thread->fn_arg = 0;
- dthr_cur_thread->stack_size = 0;
-
- DBOUT(("dthr_csw.long(%p,DREAD_THREAD_CSW_NORM)\n",(void *) &target->regs));
- dthr_load_ctxt(&target->regs,DREAD_THREAD_CSW_NORM);
- fprintf(stderr,"dthr_csw: exit load context returned\n");
- abort();
- }
-
- DBOUT(("dthr_csw.save_ctxt(%p)\n",(void *) &this_stack->regs));
- switch (rv = dthr_save_ctxt(&this_stack->regs)) {
- case DREAD_THREAD_CSW_CSW:
- DBOUT(("dthr_csw.load_ctxt(%p,%d)\n",(void *) &target->regs,op));
- dthr_load_ctxt(&target->regs,op);
- fprintf(stderr,"dthr_csw: csw failed\n");
- abort();
- break;
- case DREAD_THREAD_CSW_CREATE:
- if (magic != DREAD_THREAD_MAGIC) {
- fprintf(stderr,
- "dthr_csw: stack corruption detected, thread ID %p (tomost)\n",
- (void *) dthr_cur_thread);
- abort();
- }
- if ((dthr_cur_thread = this_stack->thread) != &dthr_topmost_thread) {
- fprintf(stderr,"dthr_csw: create csw, am not topmost\n");
- abort();
- }
- DBOUT(("dthr_csw/ret: cur thread %p\n",(void *) dthr_cur_thread));
- return;
- case DREAD_THREAD_CSW_NORM:
- if (magic != DREAD_THREAD_MAGIC) {
- fprintf(stderr,
- "dthr_csw: stack corruption detected, thread %p\n",
- (void *) dthr_cur_thread);
- abort();
- }
- dthr_cur_thread = this_stack->thread;
- DBOUT(("dthr_csw/ret: cur thread %p\n",(void *) dthr_cur_thread));
- return;
- default:
- fprintf(stderr,"dthr_csw: Unexpected op code %d\n",rv);
- abort();
- }
-}
-
-/*
- * A simpler, higher level threads interface: one function,
- * DThr_Thread_Run, which queues threads to be run before going
- * multithreaded, uses NULL pointers in arglist to go multithreaded,
- * and once multithreaded may be called to spawn additional
- * threads. The threads are automatically garbage collected.
- *
- * This has to be inside of the abstraction barrier to permit reuse of
- * the dthr_thread data structure. Otherwise we would declare a union...
- * We also stomp on the user data field. We assume that that field is
- * needed by the user only for the duration of the thread function but
- * not during on-exit routines.
- */
-
-static struct dthr_thread *dthr_thread_q = 0;
-static int DThr_Thread_State = 0;
-static struct dthr_semaphore to_be_freed_sema, numDThr_Threads;
-static struct dthr_event to_be_freed_ev;
-static struct dthr_thread *to_be_freed = 0;
-
-/*
- * Things break horribly if we yield here, since the malloc'ed thread
- * descriptor could get free'd prior to actually finishing up with
- * the thread. In particular, we do not wish the reaper thread to
- * run until we have csw'd out of the exiting thread.
- */
-static void mark_of_death(struct dthr_thread *th, void *arg)
-{
- DBOUT(("thread %p, going to the guillotine\n", (void *) th));
- dthr_semaphore_take_no_yield(&to_be_freed_sema);
- th->data = (void *) to_be_freed;
- to_be_freed = th;
- dthr_semaphore_drop_no_yield(&to_be_freed_sema);
- dthr_event_signal_no_yield(&to_be_freed_ev);
-}
-
-static void reaper(void)
-{
- struct dthr_thread *th;
-
- dthr_semaphore_take(&to_be_freed_sema);
- for (;;) {
- while ((th = to_be_freed) != 0) {
- to_be_freed = (struct dthr_thread *) th->data;
- DBOUT(("Grim reaper: got thread %p\n",(void *) th));
- free(th);
- dthr_semaphore_drop(&numDThr_Threads);
- }
- if (!dthr_semaphore_try(&numDThr_Threads)) break; /* thread exits */
- DBOUT(("reaper event wait\n"));
- dthr_event_wait(&to_be_freed_ev,&to_be_freed_sema);
- DBOUT(("reaper event occurred\n"));
- }
- dthr_semaphore_drop(&to_be_freed_sema);
-}
-
-static void *DThr_MultiThread(void *arg)
-{
- struct dthr_thread *th;
-
- DBOUT(("Entered DThr_MultiThread\n"));
- while ((th = dthr_thread_q) != 0) {
- dthr_thread_q = (struct dthr_thread *) th->data;
- dthr_thread_init(th,th->fn,th->fn_arg,th->stack_size);
- if (!dthr_thread_on_exit(th,mark_of_death,0)) {
- perror("DThr_Thread");
- fprintf(stderr,
- "DThr_Thread: startup failure while setting up on-exit fn\n");
- abort();
- }
- (void) dthr_thread_run(th);
- (void) dthr_thread_detach(th);
- }
- reaper();
- DBOUT(("Leaving DThr_MultiThread\n"));
- return 0;
-}
-
-int DThr_Thread_Run(void *(*fn)(void *),
- void *fn_arg,
- size_t req_stack_size)
-{
- struct dthr_thread main_th, *th;
-
- DBOUT(("Entered DThr_Thread_Run\n"));
- switch (DThr_Thread_State) {
- case 0:
- dthr_init();
- (void) dthr_semaphore_init(&to_be_freed_sema,0);
- (void) dthr_semaphore_init(&numDThr_Threads,0);
- (void) dthr_event_init(&to_be_freed_ev);
- DThr_Thread_State = 1;
- /* fall thru */
- case 1:
- if (!fn) {
- /* begin multithreading */
- dthr_thread_init(&main_th,DThr_MultiThread,fn_arg, 0x1000);
- DThr_Thread_State = 2;
- dthr_thread_multithread(&main_th);
- return 1;
- }
- th = (struct dthr_thread *) malloc(sizeof *th);
- if (!th) return 0;
- th->fn = fn;
- th->fn_arg = fn_arg;
- th->stack_size = req_stack_size;
-
- th->data = (void *) dthr_thread_q;
- dthr_thread_q = th;
-
- dthr_semaphore_drop(&numDThr_Threads);
-
- DBOUT(("Leaving DThr_Thread_Run\n"));
- return 1;
- case 2:
- th = (struct dthr_thread *) malloc(sizeof *th);
- if (!th) return 0;
- th->fn = fn;
- th->fn_arg = fn_arg;
- th->stack_size = req_stack_size;
-
- dthr_semaphore_drop(&numDThr_Threads);
-
- if (!dthr_thread_on_exit(th,mark_of_death,0)) {
- perror("DThr_Thread");
- fprintf(stderr,
- "DThr_Thread: runtime failure while setting up on-exit fn\n");
- abort();
- }
- (void) dthr_thread_run(th);
- (void) dthr_thread_detach(th);
-
- DBOUT(("Leaving DThr_Thread_Run\n"));
- return 1;
- }
- /* NOTREACHED -- make lint happy */
- return 1;
-}
diff --git a/ports/dreadthread/dread_chain.c b/ports/dreadthread/dread_chain.c
deleted file mode 100644
index fd7488a..0000000
--- a/ports/dreadthread/dread_chain.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1994 by Bennet Yee.
- *
- * This material was developed by the author. Permission to copy this
- * software, to redistribute it, and to use it for any purpose is hereby
- * granted, subject to the following five restrictions.
- *
- * 1. Any copy made of this software must include this copyright notice in
- * full.
- *
- * 2. All materials containing this software or derivatives thereof must
- * provide this software in source form or provide a means of obtaining
- * this software in source form; no fees may be charged for this software
- * except those for covering media costs and handling.
- *
- * 3. All materials developed as a consequence of the use of this software
- * shall duly acknowledge such use, in accordance with the usual standards
- * of acknowledging credit in academic research.
- *
- * 4. The author makes no warranty or representation that the operation
- * of this software will be error-free, and the author is under no
- * obligation to provide any services, by way of maintenance, update, or
- * otherwise.
- *
- * 5. In conjunction with products arising from the use of this material,
- * there shall be no use of the names of the author, of Carnegie-Mellon
- * University, nor of any adaptation thereof in any advertising,
- * promotional, or sales literature without prior written consent from the
- * author and Carnegie-Mellon University in each case.
- *
- * If you have questions, you can contact the author at bsy@cs.cmu.edu
- *
- * Users of this software is requested to make their best efforts (a) to
- * return to the author any improvements or extensions that they make, so
- * that these may be included in future releases; (b) to document clearly
- * any improvements or extensions made to this software; and (c) to inform
- * the author of noteworthy uses of this software. Any improvements or
- * extensions to this software may be placed under different copyright
- * restrictions by the author of those improvements or extensions. That
- * those improvements or extensions be placed under the same copyright as
- * this software is encouraged.
- */
-
-/* doubly linked object chain */
-
-#if !defined(DREAD_THREAD_CHAIN_REAL_CODE)
-# define DREAD_THREAD_CHAIN_REAL_CODE 1
-#endif
-#if !defined(DREAD_THREAD_CHAIN_EXTINLINE)
-# include "dreadthread_chain.h"
-#endif
-
-#include <stdio.h>
-
-#define DREAD_THREAD_CHAIN_DEBUG 0
-#if DREAD_THREAD_CHAIN_DEBUG
-# define DREAD_THREAD_CHAIN_DBOUT(args) do { \
- printf args; \
- fflush(stdout); \
- } while (0)
-#else
-# define DREAD_THREAD_CHAIN_DBOUT(args)
-#endif
-
-DREAD_THREAD_CHAIN_EXTINLINE
-int dthr_chain_empty(struct dthr_chain *anchor)
-{
- DREAD_THREAD_CHAIN_DBOUT(("dthr_chain_empty(0x%08lx) -> %d\n",
- (long) anchor,anchor->prev==anchor->next));
- return anchor->next == anchor;
-}
-
-DREAD_THREAD_CHAIN_EXTINLINE
-struct dthr_chain *dthr_chain_delete(struct dthr_chain *link)
-{
- DREAD_THREAD_CHAIN_DBOUT(("dthr_chain_delete(0x%08lx)\n",(long) link));
- link->prev->next = link->next;
- link->next->prev = link->prev;
-
- link->prev = link->next = link; /* not necy */
- return link;
-}
-
-DREAD_THREAD_CHAIN_EXTINLINE
-struct dthr_chain *dthr_chain_dequeue(struct dthr_chain *anchor)
-{
- struct dthr_chain *rv;
-
- rv = DREAD_THREAD_CHAIN_EMPTY(anchor) ?
- (struct dthr_chain *) 0 : dthr_chain_delete(anchor->next);
- DREAD_THREAD_CHAIN_DBOUT(("dthr_chain_dequeue(0x%08lx) -> 0x%08lx\n",
- anchor,rv));
- return rv;
-}
-
-DREAD_THREAD_CHAIN_EXTINLINE
-struct dthr_chain *dthr_chain_init(struct dthr_chain *anchor)
-{
- anchor->prev = anchor->next = anchor;
- return anchor;
-}
-
-DREAD_THREAD_CHAIN_EXTINLINE
-struct dthr_chain *dthr_chain_insert_after(struct dthr_chain *link,
- struct dthr_chain *new_link)
-{
- DREAD_THREAD_CHAIN_DBOUT(("dthr_chain_insert_after(0x%08lx,0x%08lx)\n",
- (long) link,(long) new_link));
- new_link->next = link->next;
- new_link->prev = link;
- link->next->prev = new_link;
- link->next = new_link;
-
- return link;
-}
-
-DREAD_THREAD_CHAIN_EXTINLINE
-struct dthr_chain *dthr_chain_insert_before(struct dthr_chain *link,
- struct dthr_chain *new_link)
-{
- DREAD_THREAD_CHAIN_DBOUT(("dthr_chain_insert_before(0x%08lx,0x%08lx)\n",
- (long) link,(long) new_link));
- new_link->prev = link->prev;
- new_link->next = link;
- link->prev->next = new_link;
- link->prev = new_link;
-
- return link;
-}
-
-#if /* CHAIN_DEBUG && */ CHAIN_REAL_CODE
-void dthr_chain_show(FILE *iop,
- struct dthr_chain *anchor)
-{
- struct dthr_chain *p;
-
- fprintf(iop,"Anchor(0x%08lx)\n",(long) anchor);
- for (p = anchor->next; p != anchor; p = p->next)
- fprintf(iop," 0x%08lx\n",(long) p);
- /* Anchor( */
- fprintf(iop," End(0x%08lx)\n",(long) anchor);
- fprintf(iop,"REV Anchor(0x%08lx)\n",(long) anchor);
- for (p = anchor->prev; p != anchor; p = p->prev)
- fprintf(iop," 0x%08lx\n",(long) p);
- /* Anchor( */
- fprintf(iop,"REV End(0x%08lx)\n",(long) anchor);
-}
-#endif
diff --git a/ports/dreadthread/dreadthread.h b/ports/dreadthread/dreadthread.h
deleted file mode 100644
index 9023d98..0000000
--- a/ports/dreadthread/dreadthread.h
+++ /dev/null
@@ -1,187 +0,0 @@
-#if !defined(DREAD_THREAD_STACK_EXTRA)
-/*
- * Copyright (c) 1994, 1996 by Bennet Yee.
- *
- * This material was developed by the author. Permission to copy this
- * software, to redistribute it, and to use it for any purpose is hereby
- * granted, subject to the following five restrictions.
- *
- * 1. Any copy made of this software must include this copyright notice in
- * full.
- *
- * 2. All materials containing this software or derivatives thereof must
- * provide this software in source form or provide a means of obtaining
- * this software in source form; no fees may be charged for this software
- * except those for covering media costs and handling.
- *
- * 3. All materials developed as a consequence of the use of this software
- * shall duly acknowledge such use, in accordance with the usual standards
- * of acknowledging credit in academic research.
- *
- * 4. The author makes no warranty or representation that the operation
- * of this software will be error-free, and the author is under no
- * obligation to provide any services, by way of maintenance, update, or
- * otherwise.
- *
- * 5. In conjunction with products arising from the use of this material,
- * there shall be no use of the names of the author, of Carnegie-Mellon
- * University or University of California, nor of any adaptation thereof
- * in any advertising, promotional, or sales literature without prior
- * written consent from the author, Carnegie-Mellon University, and
- * University of California in each case.
- *
- * If you have questions, you can contact the author at bsy@cs.ucsd.edu
- *
- * Users of this software is requested to make their best efforts (a) to
- * return to the author any improvements or extensions that they make, so
- * that these may be included in future releases; (b) to document clearly
- * any improvements or extensions made to this software; and (c) to inform
- * the author of noteworthy uses of this software. Any improvements or
- * extensions to this software may be placed under different copyright
- * restrictions by the author of those improvements or extensions. That
- * those improvements or extensions be placed under the same copyright as
- * this software is encouraged.
- */
-
-/*
- * Portable C-only coroutine threads.
- */
-
-#include "dreadthread_chain.h"
-#include "dreadthread_ctxt.h"
-
-/* select(2) req'mt, and caddr_t */
-#include <sys/time.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <unistd.h>
-
-#define DREAD_THREAD_MAGIC 0x31415926ul
- /* for stack corruption test dthr_csw */
-#define DREAD_THREAD_MAGIC2 0x27182818ul
-
-#define DREAD_THREAD_STACK_GROWS_DOWN 1
-#define DREAD_THREAD_STACK_EXTRA (6*1024)
-/*
- * see stack_est.c -- it can be used to determine pico's overhead by first
- * providing a very generous value here, building stack_est, and see what
- * it outputs. Beware of limit stacksize / ulimit -s.
- */
-
-/*
- * Private data.
- *
- * Describes stack allocation.
- * Stacks are never fragmented. First fit.
- *
- * Each thread has signal state determining which signals are blocked.
- * This information is not available here -- list of blocked signals
- * are implicitly stored on the stack as part of the pico thread code
- * execution state.
- *
- * Signal handlers are still global.
- */
-struct dthr_stack {
- struct dthr_chain link; /* free/active lists */
- unsigned long magic;
-#define DREAD_THREAD_STACK_MAGIC 0x62737920ul
- size_t stack_size;
- caddr_t stack_base, /* approximate */
- stack_top;
- struct dthr_thread *thread;
- dthr_ctxt_t regs, /* user thread regs */
- base; /* stack reuse */
-};
-
-struct dthr_semaphore {
- unsigned long magic;
-#define DREAD_THREAD_SEMA_MAGIC 0x68657265ul
- int value; /* binary for lock */
- struct dthr_chain threadq;
-};
-
-struct dthr_event {
- unsigned long magic;
-#define DREAD_THREAD_EV_MAGIC 0x83651fc2ul
- struct dthr_chain threadq;
-};
-
-struct dthr_thread_exit {
- struct dthr_thread_exit *next;
- void (*fn)(struct dthr_thread *,void *);
- void *arg;
-};
-
-struct dthr_thread {
- /* Private stuff */
- struct dthr_chain link; /* runq, runq_sema, runq_event */
- unsigned long magic;
-#define DREAD_THREAD_TH_MAGIC 0xe32f8c27ul
- void *(*fn)(void *);
- void *fn_arg;
- int stack_size;
- int state;
-#define DREAD_THREAD_TH_EXITED -1 /* stack undefined */
-#define DREAD_THREAD_TH_RUNNABLE 0
-#define DREAD_THREAD_TH_SEMA_WAIT 1
-#define DREAD_THREAD_TH_EVENT_WAIT 2
- struct dthr_stack *stack;
- struct dthr_semaphore exit_sema;
- struct dthr_thread_exit *on_exit;
- jmp_buf io_timeout;
- /* Public stuff */
- void *exit_value;
- void *data;
- /*
- * For implementing mailboxes etc --
- * NOT avaiable for use during on-exit processing
- * User may also use an extended dthr_thread structure
- * with more data at the end to hold more per-thread
- * info; if this is made into a DLL, the magic number
- * will be used for version control to avoid stepping
- * on any such user data.
- */
-};
-
-extern struct dthr_thread *dthr_cur_thread;
-struct dthr_thread *dthr_this_thread(void);
-/* signal handlers? who needs it? */
-void dthr_thread_yield(void);
-struct dthr_semaphore *dthr_semaphore_init(struct dthr_semaphore *sema,
- int init);
-int dthr_semaphore_try(struct dthr_semaphore *sema);
-void dthr_semaphore_take(struct dthr_semaphore *sema);
-void dthr_semaphore_drop(struct dthr_semaphore *sema);
-
-void dthr_event_wait(struct dthr_event *event,
- struct dthr_semaphore *lock);
-void dthr_event_broadcast_no_yield(struct dthr_event *event);
-void dthr_event_broadcast(struct dthr_event *event);
-void dthr_event_signal_no_yield(struct dthr_event *event);
-void dthr_event_signal(struct dthr_event *event);
-
-struct dthr_event *dthr_event_init(struct dthr_event *ev);
-
-void dthr_init(void);
-void dthr_thread_exit(void *status);
-struct dthr_thread *dthr_thread_init(struct dthr_thread *th,
- void *(*fn)(void *),
- void *fn_arg,
- size_t requested_stack_size);
-int dthr_thread_on_exit(struct dthr_thread *th,
- void (*fn)(struct dthr_thread *,void *),
- void *arg);
-
-struct dthr_thread *dthr_thread_run(struct dthr_thread *th);
-struct dthr_thread *dthr_thread_wait(struct dthr_thread *th);
-struct dthr_thread *dthr_thread_detach(struct dthr_thread *th);
-
-void dthr_thread_multithread(struct dthr_thread *th);
-
-int DThr_Thread_Run(void *(*fn)(void *),
- void *fn_arg,
- size_t req_stack_size);
-
-extern int (*dthr_on_deadlock)();
-
-#endif
diff --git a/ports/dreadthread/dreadthread_chain.h b/ports/dreadthread/dreadthread_chain.h
deleted file mode 100644
index 31ff8b6..0000000
--- a/ports/dreadthread/dreadthread_chain.h
+++ /dev/null
@@ -1,98 +0,0 @@
-#if !defined(DREAD_THREAD_CHAIN_EMPTY)
-/*
- * Copyright (c) 1994 by Bennet Yee.
- *
- * This material was developed by the author. Permission to copy this
- * software, to redistribute it, and to use it for any purpose is hereby
- * granted, subject to the following five restrictions.
- *
- * 1. Any copy made of this software must include this copyright notice in
- * full.
- *
- * 2. All materials containing this software or derivatives thereof must
- * provide this software in source form or provide a means of obtaining
- * this software in source form; no fees may be charged for this software
- * except those for covering media costs and handling.
- *
- * 3. All materials developed as a consequence of the use of this software
- * shall duly acknowledge such use, in accordance with the usual standards
- * of acknowledging credit in academic research.
- *
- * 4. The author makes no warranty or representation that the operation
- * of this software will be error-free, and the author is under no
- * obligation to provide any services, by way of maintenance, update, or
- * otherwise.
- *
- * 5. In conjunction with products arising from the use of this material,
- * there shall be no use of the names of the author, of Carnegie-Mellon
- * University, nor of any adaptation thereof in any advertising,
- * promotional, or sales literature without prior written consent from the
- * author and Carnegie-Mellon University in each case.
- *
- * If you have questions, you can contact the author at bsy@cs.cmu.edu
- *
- * Users of this software is requested to make their best efforts (a) to
- * return to the author any improvements or extensions that they make, so
- * that these may be included in future releases; (b) to document clearly
- * any improvements or extensions made to this software; and (c) to inform
- * the author of noteworthy uses of this software. Any improvements or
- * extensions to this software may be placed under different copyright
- * restrictions by the author of those improvements or extensions. That
- * those improvements or extensions be placed under the same copyright as
- * * this software is encouraged.
- */
-
-/*
- * User must keep track of offset from chain structure to base of actual
- * structure. Usually the struct chain is first in the derived class, so
- * the offset is zero.
- */
-struct dthr_chain {
- struct dthr_chain *prev,*next;
-};
-
-#define DREAD_THREAD_CHAIN_EMPTY(chainp) ((chainp)->next == (chainp))
-
-struct dthr_chain *dthr_chain_init(struct dthr_chain *anchor);
-struct dthr_chain *dthr_chain_insert_after(struct dthr_chain *link,
- struct dthr_chain *new_link);
-struct dthr_chain *dthr_chain_insert_before(struct dthr_chain *link,
- struct dthr_chain *new_link);
-struct dthr_chain *dthr_chain_delete(struct dthr_chain *link);
-
-#define dthr_chain_insert(anchor,link) dthr_chain_insert_after(anchor,link)
-#define dthr_chain_push(anchor,link) dthr_chain_insert_after(anchor,link)
-#define dthr_chain_enqueue(anchor,link) dthr_chain_insert_before(anchor,link)
-#define DREAD_THREAD_CHAIN_DEQUEUE(anchor) \
- (DREAD_THREAD_CHAIN_EMPTY(anchor) ? \
- (struct dthr_chain *) 0 : \
- dthr_chain_delete((anchor)->next))
-#include <stdio.h>
-void dthr_chain_show(FILE *iop,
- struct dthr_chain *anchor);
-
-#if defined(__GNUC__)
-# if defined(DREAD_THREAD_CHAIN_REAL_CODE)
-# define DREAD_THREAD_CHAIN_EXTINLINE
-# else
-# define DREAD_THREAD_CHAIN_EXTINLINE extern inline
-# define DREAD_THREAD_CHAIN_REAL_CODE 0
- /*
- * For inlined functions. For make, this also means that anything that
- * depends on chain.h will also depend on chain.c, but that's not easily
- * expressible (if at all) in most make languages.
- */
-# include "dread_chain.c"
-# endif
-#else
-# define DREAD_THREAD_CHAIN_EXTINLINE
-#endif
-
-/*
- * chain loops:
- *
- * for (p = anchor.next; p != &anchor; p = p->next) {
- * ...
- * }
- */
-#endif
diff --git a/ports/dreadthread/dreadthread_ctxt.h b/ports/dreadthread/dreadthread_ctxt.h
deleted file mode 100644
index f28ce08..0000000
--- a/ports/dreadthread/dreadthread_ctxt.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#if !defined(DREAD_THREAD_CTXT_MAGIC)
-/*
- * Context switch routine.
- */
-
-#define DREAD_THREAD_CTXT_MAGIC 1
-
-#if i386 || sparc || __x86_64__ || __x86_32__ || __native_client__
-# include <setjmp.h>
-# if posix_signals
-# define DREAD_THREAD_MD_SAVE(regs) setjmp((regs)->r)
-# define DREAD_THREAD_MD_LOAD(regs,val) longjmp((regs)->r,val)
-# else
-# define DREAD_THREAD_MD_SAVE(regs) _setjmp((regs)->r)
-# define DREAD_THREAD_MD_LOAD(regs,val) _longjmp((regs)->r,val)
-# endif
-#elif mips
-# include <setjmp.h>
-/*
- * With Mach on pmax/mips (which may have incorporated DEC's Ultrix md libc
- * code), the default longjmp incorporated error checking to prevent context
- * switching to stack frames with higher addresses.
- */
-# define DREAD_THREAD_MD_SAVE(regs) setjmp((regs)->r)
-# define DREAD_THREAD_MD_LOAD(regs,val) mylongjmp((regs)->r,val)
-#else
-# error "What kind of machine am I being compiled on?"
-#endif
-
-#if DREAD_THREAD_CTXT_MAGIC
-typedef struct {
- unsigned long magic1;
-# define DREAD_THREAD_CTXT_MAGIC_1 0x38127483ul
- jmp_buf r;
- unsigned long magic2;
-# define DREAD_THREAD_CTXT_MAGIC_2 0xc843fa73ul
-} dthr_ctxt_t;
-# define dthr_save_ctxt(regs) \
- ((regs)->magic1 = DREAD_THREAD_CTXT_MAGIC_1, \
- (regs)->magic2 = DREAD_THREAD_CTXT_MAGIC_2, \
- DREAD_THREAD_MD_SAVE((regs)))
-# define dthr_load_ctxt(regs,val) do { \
- if ((regs)->magic1 != DREAD_THREAD_CTXT_MAGIC_1 || \
- (regs)->magic2 != DREAD_THREAD_CTXT_MAGIC_2) { \
- fprintf(stderr,"dthr_load_ctxt detected context corruption\n"); \
- abort(); \
- /*segv blocked?*/ \
- exit(1); \
- } \
- DREAD_THREAD_MD_LOAD((regs),val); \
- } while (0)
-
-#else
-
-typedef struct {
- jmp_buf r;
-} dthr_ctxt_t;
-# define dthr_save_ctxt(regs) DREAD_THREAD_MD_SAVE((regs))
-# define dthr_load_ctxt(regs,val) DREAD_THREAD_MD_LOAD((regs),val)
-#endif
-
-#endif
diff --git a/ports/dreadthread/pkg_info b/ports/dreadthread/pkg_info
deleted file mode 100644
index 23780ff..0000000
--- a/ports/dreadthread/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=dreadthread
-VERSION=0.1
-ARCHIVE_ROOT=dreadthread
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/dreadthread/stack_est.c b/ports/dreadthread/stack_est.c
deleted file mode 100644
index 37d9a47..0000000
--- a/ports/dreadthread/stack_est.c
+++ /dev/null
@@ -1,164 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "dreadthread.h"
-
-#define NTHREADS 10
-#define STACKSIZE (32 * 1024)
-
-#define MAGIC 0x8e7646c3ul
-
-int nthreads = NTHREADS;
-int stacksize = STACKSIZE;
-int count = NTHREADS * 4;
-
-int all_at_once = 0;
-int all_go = 0;
-struct dthr_event go_eva;
-struct dthr_semaphore go_sema;
-
-struct thread_specifics {
- unsigned long stack_use;
- int id;
-};
-
-void myThread_work(void *arg)
-{
- unsigned int barrier[10];
- struct thread_specifics *info;
- int i;
-
- for (i = 0; i < sizeof barrier/sizeof barrier[0]; i++)
- barrier[i] = MAGIC + i;
- if (all_at_once) {
- dthr_semaphore_take(&go_sema);
- while (!all_go) {
- dthr_event_wait(&go_eva,&go_sema);
- dthr_semaphore_take(&go_sema);
- }
- dthr_semaphore_drop(&go_sema);
- }
-
- info = (struct thread_specifics *) arg;
- printf(" Hello world from thread %d, info %p\n",info->id,info);
- for (i = count; --i >= 0; ) {
- dthr_thread_yield();
- printf(" %d",i); fflush(stdout);
- }
- for (i = 0; i < sizeof barrier/sizeof barrier[0]; i++) {
- if (barrier[i] != MAGIC + i) {
- fprintf(stderr,
- "BARRIER BREACHED!"
- " Increase stack_est's per-thread stack size!\n");
- /* following may fail if info ptr is trashed */
- fprintf(stderr,"Thread %d\n",info->id);
- exit(1);
- }
- }
- putchar('\n');
-}
-
-void mark_stack(void *arg)
-{
- register int i;
- char stack[1];
- /* stack is the only on-stack automatic */
-
- printf("mark_stack: %p\n",(void *) stack);
-#if DREAD_THREAD_STACK_GROWS_DOWN
- for (i = stacksize/2; --i >= 0; )
- stack[-i] = i;
-#else
- for (i = stacksize/2; --i >= 0; )
- stack[i] = i;
-#endif
-}
-
-void examine_stack(void *arg)
-{
- register int i;
- register struct thread_specifics *info = (struct thread_specifics *) arg;
- char stack[1];
-
- printf("examine_stack: %p\n",(void *) stack);
-#if DREAD_THREAD_STACK_GROWS_DOWN
- for (i = stacksize/2; --i >= 0; ) {
- if (stack[-i] != (char) i) {
- info->stack_use = i;
- return;
- }
- }
- info->stack_use = 0;
-#else
- for (i = stacksize/2; --i >= 0; ) {
- if (stack[i] != (char) i) {
- info->stack_use = i;
- return;
- }
- }
- info->stack_use = 0;
-#endif
-}
-
-void *myThread(void *arg)
-{
- mark_stack(arg); /* same number of params */
- myThread_work(arg);
- examine_stack(arg); /* same number of params */
- return 0;
-}
-
-struct thread_specifics *priv;
-
-extern int getopt();
-extern char *optarg, *rindex();
-
-char *me;
-
-void usage()
-{
- fprintf(stderr,
- "Usage: %s [-aA] [-s stackbytes] [-t nthreads] [-c count]\n",
- me);
-}
-
-int main(int ac, char **av)
-{
- int opt;
- int i;
- unsigned long offset;
-
- if (!(me = rindex(*av,'/'))) me = *av;
- else ++me;
-
- while ((opt = getopt(ac,av,"aAc:s:t:")) != EOF) switch (opt) {
- case 'a': all_at_once = 1; break;
- case 'A': all_at_once = 0; break;
- case 'c': count = atoi(optarg); break;
- case 's': stacksize = atoi(optarg); break;
- case 't': nthreads = atoi(optarg); break;
- default: usage(); exit(1);
- }
-
- priv = (struct thread_specifics *) malloc(nthreads * sizeof *priv);
- if (!priv) {
- perror(me);
- fprintf(stderr,"%s: insufficient space for thread private data\n", me);
- exit(1);
- }
-
- for (i = 0; i < nthreads; i++) {
- priv[i].id = i;
- (void) DThr_Thread_Run(myThread,(void *) &priv[i],stacksize);
- }
-
- printf("main: DThr_Thread_Run(0,0,0) ***\n");
-
- (void) DThr_Thread_Run(0,0,0);
- fprintf(stderr,"All threads exited!\n");
-
- for (i = 0; i < nthreads; i++) {
- offset = priv[i].stack_use;
- printf("%d: %lu 0x%08lx\n",i,offset,offset);
- }
- return 0;
-}
diff --git a/ports/dreadthread/test.c b/ports/dreadthread/test.c
deleted file mode 100644
index b7950c9..0000000
--- a/ports/dreadthread/test.c
+++ /dev/null
@@ -1,140 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include "dreadthread.h"
-
-#define NTHREADS 1000
-#define STACKSIZE (8 * 1024)
-#define COUNT 100
-
-int count = COUNT;
-int nthreads = NTHREADS;
-int stacksize = STACKSIZE;
-
-int all_at_once = 0;
-int all_go = 0;
-struct dthr_event go_eva;
-struct dthr_semaphore go_sema;
-
-struct thread_specifics {
- int thread_num;
- int counter;
- double val;
-};
-
-void *myThread(void *arg)
-{
- int index = (uintptr_t) arg;
- struct thread_specifics *info;
- int th_num;
- double v;
-
- if (all_at_once) {
- dthr_semaphore_take(&go_sema);
- while (!all_go) {
- dthr_event_wait(&go_eva,&go_sema);
- }
- dthr_semaphore_drop(&go_sema);
- }
-
- info = (struct thread_specifics *) dthr_cur_thread->data;
- th_num = info->thread_num;
- if (index != th_num) {
- fprintf(stderr,"Thread %d: arg %d != thread data\n",th_num,index);
- }
- v = info->val;
- while (info->counter < count) {
- dthr_thread_yield();
- printf("Thread %d: count %d, val-1.0=%g\n",th_num,info->counter,v-1.0);
- v = sqrt(v);
- info->counter++;
- }
- return 0;
-}
-
-struct dthr_thread *th, main_th;
-struct thread_specifics *priv;
-
-void *goForIt(void *unused)
-{
- int i;
-
- if (all_at_once) {
- dthr_semaphore_init(&go_sema,1);
- dthr_event_init(&go_eva);
- }
- for (i = 0; i < nthreads; i++)
- (void) dthr_thread_detach(dthr_thread_run(&th[i]));
- (void) dthr_thread_detach(dthr_cur_thread);
- if (all_at_once) {
- dthr_semaphore_take(&go_sema);
- all_go = 1;
- dthr_semaphore_drop(&go_sema);
- dthr_event_broadcast(&go_eva);
- }
- return 0;
-}
-
-extern int getopt();
-extern char *optarg, *rindex();
-
-char *me;
-
-void usage()
-{
- fprintf(stderr,
- "Usage: %s [-aA] [-s stackbytes] [-c count] [-t nthreads]\n",
- me);
-}
-
-int main(int ac, char **av)
-{
- int opt;
- int i;
-
- if (!(me = strrchr(*av,'/'))) me = *av;
- else ++me;
-
- while ((opt = getopt(ac,av,"aAc:s:t:")) != EOF) switch (opt) {
- case 'a': all_at_once = 1; break;
- case 'A': all_at_once = 0; break;
- case 'c': count = atoi(optarg); break;
- case 's': stacksize = atoi(optarg); break;
- case 't': nthreads = atoi(optarg); break;
- default: usage(); exit(1);
- }
-
- th = (struct dthr_thread *) malloc(nthreads * sizeof *th);
- if (!th) {
- perror(me);
- fprintf(stderr,"%s: insufficient space for thread descriptors\n", me);
- exit(1);
- }
- priv = (struct thread_specifics *) malloc(nthreads * sizeof *priv);
- if (!priv) {
- perror(me);
- fprintf(stderr,"%s: insufficient space for thread private data\n", me);
- exit(1);
- }
-
- dthr_init();
-
- for (i = 0; i < nthreads; i++) {
- (void) dthr_thread_init(&th[i],myThread,(void *) (uintptr_t) i,stacksize);
-
- th[i].data = (void *) &priv[i];
- priv[i].thread_num = i;
- priv[i].counter = 0;
- priv[i].val = 100.0 * i;
- }
-
- printf("main: dthr_thread_init (main thread)\n");
- dthr_thread_init(&main_th, goForIt, (void *) 0, stacksize);
- printf("main: dthr_thread_multithread ***\n");
-
- dthr_thread_multithread(&main_th);
- fprintf(stderr,"All threads exited, all done!\n");
- return 0;
-}
diff --git a/ports/dreadthread/test2.c b/ports/dreadthread/test2.c
deleted file mode 100644
index 1067c80..0000000
--- a/ports/dreadthread/test2.c
+++ /dev/null
@@ -1,100 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include "dreadthread.h"
-
-#define NTHREADS 1000
-#define STACKSIZE (8 * 1024)
-#define COUNT 100
-
-int count = COUNT;
-int nthreads = NTHREADS;
-int stacksize = STACKSIZE;
-
-int all_at_once = 0;
-int all_go = 0;
-struct dthr_event go_eva;
-struct dthr_semaphore go_sema;
-
-struct thread_specifics {
- int thread_num;
- int counter;
- double val;
-};
-
-void *myThread(void *arg)
-{
- struct thread_specifics *info;
- int th_num;
- double v;
-
- if (all_at_once) {
- dthr_semaphore_take(&go_sema);
- while (!all_go) {
- dthr_event_wait(&go_eva,&go_sema);
- }
- dthr_semaphore_drop(&go_sema);
- }
-
- info = (struct thread_specifics *) arg;
- th_num = info->thread_num;
-
- v = info->val;
- while (info->counter < count) {
- dthr_thread_yield();
- printf("Thread %d: count %d, val-1.0=%g\n",th_num,info->counter,v-1.0);
- v = sqrt(v);
- info->counter++;
- }
- return 0;
-}
-
-struct thread_specifics *priv;
-char *me;
-
-void usage()
-{
- fprintf(stderr,
- "Usage: %s [-aA] [-s stackbytes] [-c count] [-t nthreads]\n",
- me);
-}
-
-int main(int ac, char **av)
-{
- int opt;
- int i;
-
- if (!(me = strrchr(*av,'/'))) me = *av;
- else ++me;
-
- while ((opt = getopt(ac,av,"aAc:s:t:")) != EOF) switch (opt) {
- case 'a': all_at_once = 1; break;
- case 'A': all_at_once = 0; break;
- case 'c': count = atoi(optarg); break;
- case 's': stacksize = atoi(optarg); break;
- case 't': nthreads = atoi(optarg); break;
- default: usage(); exit(1);
- }
-
- priv = (struct thread_specifics *) malloc(nthreads * sizeof *priv);
- if (!priv) {
- perror(me);
- fprintf(stderr,"%s: insufficient space for thread private data\n", me);
- exit(1);
- }
-
- for (i = 0; i < nthreads; i++) {
- priv[i].thread_num = i;
- priv[i].counter = 0;
- priv[i].val = 100.0 * i;
-
- (void) DThr_Thread_Run(myThread,(void *) &priv[i],stacksize);
- }
-
- printf("main: DThr_Thread_Run(0,0,0) ***\n");
-
- (void) DThr_Thread_Run(0,0,0);
- fprintf(stderr,"All threads exited, all done!\n");
- return 0;
-}
diff --git a/ports/dreadthread/test4.c b/ports/dreadthread/test4.c
deleted file mode 100644
index 951a418..0000000
--- a/ports/dreadthread/test4.c
+++ /dev/null
@@ -1,147 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include "dreadthread.h"
-
-#define NTHREADS 1000
-#define STACKSIZE (8 * 1024)
-#define COUNT 100
-
-int count = COUNT;
-int nthreads = NTHREADS;
-size_t stacksize = STACKSIZE;
-
-int all_at_once = 0;
-int all_go = 0;
-struct dthr_event go_eva;
-struct dthr_semaphore go_sema;
-
-struct thread_specifics {
- int thread_num;
- int counter;
- double val;
-};
-
-void *myThread(void *arg)
-{
- int index = (uintptr_t) arg;
- struct thread_specifics *info;
- int th_num;
- double v;
-
- if (all_at_once) {
- dthr_semaphore_take(&go_sema);
- while (!all_go) {
- dthr_event_wait(&go_eva,&go_sema);
- }
- dthr_semaphore_drop(&go_sema);
- }
-
- info = (struct thread_specifics *) dthr_cur_thread->data;
- th_num = info->thread_num;
- if (index != th_num) {
- fprintf(stderr,"Thread %d: arg %d != thread data\n",th_num,index);
- }
- v = info->val;
- while (info->counter < count) {
- dthr_thread_yield();
- printf("Thread 0x%lx, 0x%lx\n",
- (unsigned long) (uintptr_t) dthr_cur_thread,
- (unsigned long) (uintptr_t) dthr_this_thread());
- printf("Thread %d: count %d, val-1.0=%g\n",th_num,info->counter,v-1.0);
- v = sqrt(v);
- info->counter++;
- }
- return 0;
-}
-
-struct dthr_thread *th, main_th;
-struct thread_specifics *priv;
-
-void *goForIt()
-{
- int i;
-
- if (all_at_once) {
- dthr_semaphore_init(&go_sema,1);
- dthr_event_init(&go_eva);
- }
- for (i = 0; i < nthreads; i++)
- (void) dthr_thread_detach(dthr_thread_run(&th[i]));
- (void) dthr_thread_detach(dthr_cur_thread);
- if (all_at_once) {
- dthr_semaphore_take(&go_sema);
- all_go = 1;
- dthr_semaphore_drop(&go_sema);
- dthr_event_broadcast(&go_eva);
- }
- return 0;
-}
-
-char *me;
-
-void usage()
-{
- fprintf(stderr,
- "Usage: %s [-aA] [-s stackbytes] [-c count] [-t nthreads]\n",
- me);
-}
-
-int main(int ac, char **av)
-{
- int opt;
- int i;
-
- if (!(me = strrchr(*av,'/'))) me = *av;
- else ++me;
-
- while ((opt = getopt(ac,av,"aAc:s:t:")) != EOF) {
- switch (opt) {
- case 'a': all_at_once = 1;
- break;
- case 'A': all_at_once = 0;
- break;
- case 'c': count = atoi(optarg);
- break;
- case 's': stacksize = strtoull(optarg, (char **) 0, 0);
- break;
- case 't': nthreads = atoi(optarg);
- break;
- default: usage(); exit(1);
- }
- }
-
- th = (struct dthr_thread *) malloc(nthreads * sizeof *th);
- if (!th) {
- perror(me);
- fprintf(stderr,"%s: insufficient space for thread descriptors\n",me);
- exit(1);
- }
- priv = (struct thread_specifics *) malloc(nthreads * sizeof *priv);
- if (!priv) {
- perror(me);
- fprintf(stderr,"%s: insufficient space for thread private data\n",me);
- exit(1);
- }
-
- dthr_init();
-
- for (i = 0; i < nthreads; i++) {
- (void) dthr_thread_init(&th[i],myThread,(void *) (uintptr_t) i,stacksize);
-
- th[i].data = (void *) &priv[i];
- priv[i].thread_num = i;
- priv[i].counter = 0;
- priv[i].val = 100.0 * i;
- }
-
- printf("main: dthr_thread_init (main thread)\n");
- dthr_thread_init(&main_th, goForIt, (void *) 0, stacksize);
- printf("main: dthr_thread_multithread ***\n");
-
- dthr_thread_multithread(&main_th);
- fprintf(stderr,"All threads exited, all done!\n");
- return 0;
-}
diff --git a/ports/drod/build.sh b/ports/drod/build.sh
deleted file mode 100644
index 5c96a3a..0000000
--- a/ports/drod/build.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXECUTABLES=custom/bin/drod
-BUILD_DIR=${SRC_DIR}/Caravel/Master/Linux
-MAKE_TARGETS="drod-custom"
-OS_JOBS=1
-
-BuildStep() {
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- export AR="${NACLAR} cr"
- export RANLIB=${NACLRANLIB}
- export CXXFLAGS="${NACLPORTS_CXXFLAGS} -Wno-write-strings"
- export LDFLAGS_common=${NACLPORTS_LDFLAGS}
- export EXTRA_LIBS="-lSDL_mixer -lSDL -lmikmod -lvorbisfile -lvorbisenc \
- -lvorbis -logg -lfreetype -lpng -lbz2 -lSDLmain -ltar \
- -lnacl_io"
- # So sdl-config can be found
- export PATH=${NACLPORTS_BIN}:${PATH}
- DefaultBuildStep
-}
-
-InstallStep() {
- return
-}
-
-PublishStep() {
- # TODO(sbc): avoid duplicating the install step here.
- DESTDIR=${PUBLISH_DIR}/.data
- DefaultInstallStep
-
- ChangeDir ${DESTDIR}
- mv usr/local/games/drod ${PUBLISH_DIR}/drod_${NACL_ARCH}${NACL_EXEEXT}
- tar cf ${PUBLISH_DIR}/drod_usr.tar usr
- tar cf ${PUBLISH_DIR}/drod_var.tar var
- rm -rf ${DESTDIR}
- cp ${START_DIR}/drod.html ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- drod_*${NACL_EXEEXT} \
- -s . \
- -o drod.nmf
- if [ ${NACL_ARCH} = pnacl ]; then
- sed -i.bak 's/x-nacl/x-pnacl/g' ${PUBLISH_DIR}/drod.html
- fi
-}
diff --git a/ports/drod/drod.html b/ports/drod/drod.html
deleted file mode 100644
index 7326254..0000000
--- a/ports/drod/drod.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>DROD</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script>
- function createModule() {
- var listenerEl = document.getElementById('listener');
- listenerEl.addEventListener('load', function() {
- document.getElementById('message').hidden = true;
- }, true);
-
- var embedEl = document.createElement('embed');
- embedEl.setAttribute('type', 'application/x-nacl');
- embedEl.setAttribute('src', 'drod.nmf');
- embedEl.setAttribute('width', '800');
- embedEl.setAttribute('height', '600');
- listenerEl.appendChild(embedEl);
- }
-
- function requestQuota(size, onSuccess, onError) {
- if (navigator.webkitPersistentStorage) {
- return navigator.webkitPersistentStorage.requestQuota(
- size, onSuccess, onError);
- } else {
- return window.webkitStorageInfo.requestQuota(
- window.PERSISTENT, size, onSuccess, onError);
- }
- }
-
- document.addEventListener('DOMContentLoaded', function() {
- var onSuccess = function(size) {
- if (size == 0) {
- onError();
- return;
- }
-
- createModule();
- };
-
- var onError = function() {
- document.getElementById('message').textContent = 'Cancelled by user'
- };
-
- requestQuota(5*1024*1024, onSuccess, onError);
- });
- </script>
- </head>
- <body>
- <h1>DROD</h1>
- <div id="message">Loading...</div>
- <div id="listener"></div>
- </body>
-</html>
-
diff --git a/ports/drod/nacl.patch b/ports/drod/nacl.patch
deleted file mode 100644
index ab8008a..0000000
--- a/ports/drod/nacl.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-This patch fixes the build for case insensitive filesystems.
-Since there is a Wchar.h file in BackEndLib, we never want to
-add it to the include path, otherwise the system headers will
-see it when searching for <wchar.h>
-
-diff --git a/Caravel/Master/Linux/Makefile b/Caravel/Master/Linux/Makefile
---- a/Caravel/Master/Linux/Makefile
-+++ b/Caravel/Master/Linux/Makefile
-@@ -77,7 +77,7 @@ SOURCES = $(shell $(GREP) "SOURCE=.*\.cpp" $(MODSDIR)/$(MODULE).dsp |\
- #endif
- OBJECTS = $(SOURCES:$(MODSDIR)/%.cpp=$(MODODIR)/%.o)
- DEPFILES = $(OBJECTS:%.o=%.dep)
--INCLUDE = -I$(MODSDIR) -I$(SRCDIR) $(INCLUDE_$(MODULE))
-+INCLUDE = -I$(SRCDIR) $(INCLUDE_$(MODULE))
- endif
-
- DRODLIBS = $(TOBJDIR)/DROD/NaClMain.o $(TLIBDIR)/DROD.a \
diff --git a/ports/drod/pkg_info b/ports/drod/pkg_info
deleted file mode 100644
index 395b023..0000000
--- a/ports/drod/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=drod
-VERSION=213fa47
-URL=https://github.com/binji/drod/archive/213fa47/drod-213fa47.tar.gz
-ARCHIVE_ROOT=drod-213fa477000429fb9a5f4a77673394d47cadbfac
-LICENSE=MPL
-DEPENDS=(sdl sdl-mixer sdl-ttf zlib metakit libtar libpng expat)
-SHA1=33b465c4d8fcb09523b97d14833591e1eb5343f2
-# Generates abigous references at compile time
-DISABLED_TOOLCHAIN=(emscripten pnacl clang-newlib)
diff --git a/ports/eigen3/build.sh b/ports/eigen3/build.sh
deleted file mode 100644
index 67faa84..0000000
--- a/ports/eigen3/build.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2015 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.
-
-CTEST_EXECUTABLES="
- basicstuff
- cholesky
- determinant
- geo_transformations
- inverse
-"
-
-EXECUTABLES="
- test/basicstuff
- test/cholesky
- test/determinant
- test/geo_transformations
- test/inverse
-"
-
-EXTRA_CMAKE_ARGS="-DEIGEN_BUILD_PKGCONFIG=OFF -DEIGEN_SPLIT_LARGE_TESTS=OFF"
-MAKE_TARGETS="$CTEST_EXECUTABLES"
-
-# Eigen tests are flakey on the bots:
-# https://bugs.chromium.org/p/naclports/issues/detail?id=223
-# TODO(sbc): re-enable if we can de-flake the tests
-TESTS_DISABLED=1
-
-TestStep() {
- # Eigen has ~600 tests, we only build a few
- ChangeDir ${BUILD_DIR}
- if [ ${NACL_ARCH} = "pnacl" ]; then
- return
- fi
- for exe in ${CTEST_EXECUTABLES}; do
- LogExecute test/$exe.sh
- done
-}
diff --git a/ports/eigen3/nacl.patch b/ports/eigen3/nacl.patch
deleted file mode 100644
index 7c73088..0000000
--- a/ports/eigen3/nacl.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -161,7 +161,9 @@ if(NOT MSVC)
- if(COMPILER_SUPPORT_STRICTANSI)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -strict-ansi")
- else()
-- ei_add_cxx_compiler_flag("-ansi")
-+ if(NOT NACL)
-+ ei_add_cxx_compiler_flag("-ansi")
-+ endif()
- endif()
-
- set(CMAKE_REQUIRED_FLAGS "")
-diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
---- a/cmake/EigenTesting.cmake
-+++ b/cmake/EigenTesting.cmake
-@@ -324,7 +324,7 @@ macro(ei_get_compilerver VAR)
- # on all other system we rely on ${CMAKE_CXX_COMPILER}
- # supporting a "--version" or "/version" flag
-
-- if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} EQUAL "Intel")
-+ if(WIN32 AND "${CMAKE_CXX_COMPILER_ID}" EQUAL "Intel")
- set(EIGEN_CXX_FLAG_VERSION "/version")
- else()
- set(EIGEN_CXX_FLAG_VERSION "--version")
diff --git a/ports/eigen3/pkg_info b/ports/eigen3/pkg_info
deleted file mode 100644
index 8bede9f..0000000
--- a/ports/eigen3/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=eigen3
-VERSION=3.2.7
-URL=http://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2
-URL_FILENAME=eigen-3.2.7.tar.bz2
-LICENSE=MPL2
-SHA1=6e22013ada087bc8ac07bcc0805c3dbb55f8e544
-ARCHIVE_ROOT=eigen-eigen-b30b87236a1b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/emacs-x/Xsdl.js b/ports/emacs-x/Xsdl.js
deleted file mode 100644
index 41103ca..0000000
--- a/ports/emacs-x/Xsdl.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals NaClTerm, NaClProcessManager */
-
-'use strict';
-
-NaClTerm.nmf = 'Xsdl.nmf';
-NaClTerm.argv = [
- '-screen', '1024x768x32', '-ac', '-br', '-noreset', ':42'
-];
-NaClTerm.env = [
- 'NACL_SPAWN_MODE=embed',
- 'NACL_EMBED_WIDTH=100%',
- 'NACL_EMBED_HEIGHT=100%',
-];
-
-// TODO(bradnelson): Do something more robust than racing emacs + xserver.
-function startEmacs() {
- var mgr = new NaClProcessManager();
- // Assume a default terminal size for headless processes.
- mgr.onTerminalResize(80, 24);
- var env = [
- 'DISPLAY=:42',
- ];
- mgr.spawn(
- 'emacs.nmf', ['-g', '140x53'], env,
- '/home/user', 'nacl', null, function(pid) {
- mgr.waitpid(pid, 0, function() {
- window.close();
- });
- });
-}
-startEmacs();
-
-document.title = 'GNU Emacs';
diff --git a/ports/emacs-x/build.sh b/ports/emacs-x/build.sh
deleted file mode 100644
index 710de32..0000000
--- a/ports/emacs-x/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2014 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.
-
-export EMACS_X=1
-START_DIR=${START_DIR}/../emacs
-cd ${START_DIR}
-. build.sh
diff --git a/ports/emacs-x/pkg_info b/ports/emacs-x/pkg_info
deleted file mode 100644
index 54f54c8..0000000
--- a/ports/emacs-x/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=emacs-x
-VERSION=24.3
-ARCHIVE_ROOT=emacs-24.3
-URL=http://mirrors.kernel.org/gnu/emacs/emacs-24.3.tar.gz
-LICENSE=GPL
-BUILD_OS=linux
-DEPENDS=(ncurses libtar nacl-spawn xorg-server libx11 libxaw jpeg8d libpng giflib tiff fontconfig)
-PATCH_NAME=../emacs/nacl.patch
-SHA1=3c672a176df06e20d2661058ad49893f184b4956
-DISABLED_TOOLCHAIN=(emscripten pnacl)
-CONFLICTS=(emacs)
diff --git a/ports/emacs/README.nacl b/ports/emacs/README.nacl
deleted file mode 100644
index c5014b6..0000000
--- a/ports/emacs/README.nacl
+++ /dev/null
@@ -1,37 +0,0 @@
-This is a port of emacs to NaCl.
-
-This is a work in progress, and builds but has not been tested yet. We are
-using it to share progress on getting emacs up and running.
-
-Current issues with this patch:
-
-While compiling ECDIT.el, we run out of memory on an attempted realloc.
-It may be that using gnu alloc is wrong, we should try system_malloc=yes in the
-configure file. If that works, we can recomment in the compile-main target in
-leim/Makefile.in.
-
-file-writable-p, file-exectuable-p, and others are failing because sel-ldr is
-not yet implemented. There is a changelist to fix this, but it is still going
-through review. Once that is fixed, we should remove the workarounds for
-file-writable-p and friends.
-
-All NaCl executables use the .nexe extension. The Emacs makefiles sometimes use
-a ${EXEEXT} variable to name their executables, and sometimes they don't. I've
-added it if a few places, we should upstream this change back to the emacs
-maintainers.
-
-NaCl's getenv call seems to return "" instead of NULL if an environment variable
-is not set, but emacs exepcts a NULL, so I have patched the code in one place to
-accept "" instead while the NaCl team investigates.
-
-We are currently building with TOOLCHAIN=glibc make emacs to use glibc. We
-should eventually move to newlib so this will work with pNaCl.
-
-We have to build twice, the first build sometimes fails but makes something
-that the second build needs. The build script is set up to do the double build
-already, but we should remove this.
-
-While looking for the leim files, the code was trying to recursively expand
-".". To eliminate the infinite recursion, I added a check for "." and ".."
-before allowing the code to recurse. We should also consider upstreaming this
-change.
diff --git a/ports/emacs/background.js b/ports/emacs/background.js
deleted file mode 100644
index f3ddc26..0000000
--- a/ports/emacs/background.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function(launchData) {
- chrome.app.window.create('emacs.html', {
- 'id': 'main',
- 'bounds': {
- 'width': 800,
- 'height': 800
- }
- });
-});
diff --git a/ports/emacs/build.sh b/ports/emacs/build.sh
deleted file mode 100644
index 3a0e7c0..0000000
--- a/ports/emacs/build.sh
+++ /dev/null
@@ -1,146 +0,0 @@
-# Copyright (c) 2014 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.
-
-OS_JOBS=1
-
-export RUNPROGRAM="${NACL_SDK_ROOT}/tools/sel_ldr.py"
-
-EXTRA_CONFIGURE_ARGS+=" --prefix=/usr --exec-prefix=/usr"
-
-if [ ${EMACS_X:-0} = 1 ]; then
- EXTRA_CONFIGURE_ARGS+=" --with-x"
- EXTRA_CONFIGURE_ARGS+=" --with-x-toolkit=athena"
- EXTRA_CONFIGURE_ARGS+=" --with-xpm=no"
- EXTRA_CONFIGURE_ARGS+=" --with-jpeg=yes"
- EXTRA_CONFIGURE_ARGS+=" --with-png=yes"
- EXTRA_CONFIGURE_ARGS+=" --with-gif=yes"
- EXTRA_CONFIGURE_ARGS+=" --with-tiff=yes"
-else
- EXTRA_CONFIGURE_ARGS+=" --with-x=no"
- EXTRA_CONFIGURE_ARGS+=" --with-xpm=no"
- EXTRA_CONFIGURE_ARGS+=" --with-jpeg=no"
- EXTRA_CONFIGURE_ARGS+=" --with-png=no"
- EXTRA_CONFIGURE_ARGS+=" --with-gif=no"
- EXTRA_CONFIGURE_ARGS+=" --with-tiff=no"
-fi
-
-export COMPAT_LIBS="-l${NACL_CXX_LIB}"
-
-export EXTRA_LIBS="-ltar ${NACL_CLI_MAIN_LIB}"
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- export emacs_cv_func__setjmp=no
- # Additional transitive dependencies not usually on the link line,
- # but required for static linking.
- COMPAT_LIBS="-pthread ${COMPAT_LIBS}"
- if [ ${EMACS_X:-0} = 1 ]; then
- COMPAT_LIBS="-lxcb -lXau -lXpm ${COMPAT_LIBS}"
- fi
- COMPAT_LIBS="-lnacl_io ${COMPAT_LIBS}"
- COMPAT_LIBS+=" -lglibc-compat"
- NACLPORTS_LIBS+=" ${COMPAT_LIBS}"
-fi
-
-EnableCliMain
-EnableGlibcCompat
-
-ConfigureStep() {
- export CFLAGS="${NACLPORTS_CFLAGS} -I${NACL_SDK_ROOT}/include"
- DefaultConfigureStep
-}
-
-# Build twice to workaround a problem in the build script that builds something
-# partially the first time that makes the second time succeed.
-# TODO(petewil): Find and fix the problem that makes us build twice.
-BuildStep() {
- # Since we can't detect that a rebuild file hasn't changed, delete them all.
- # Rebuild a second time on the buildbots only.
- if [ "${BUILDBOT_BUILDERNAME:-}" != "" ]; then
- DefaultBuildStep || DefaultBuildStep
- else
- DefaultBuildStep
- fi
-}
-
-PatchStep() {
- DefaultPatchStep
-
- ChangeDir ${SRC_DIR}
- rm -f lisp/emacs-lisp/bytecomp.elc
- rm -f lisp/files.elc
- rm -f lisp/international/quail.elc
- rm -f lisp/startup.elc
- rm -f lisp/loaddefs.el
- rm -f lisp/loaddefs.elc
- rm -f lisp/vc/vc-git.elc
- LogExecute cp ${START_DIR}/emacs_pepper.c ${SRC_DIR}/src/emacs_pepper.c
-}
-
-InstallStep() {
- # Today the install step copies emacs_x86_64.nexe to the publish dir, but we
- # need nacl_temacs.nexe instead. Change to copy that here.
- DefaultInstallStep
- LogExecute mv ${INSTALL_DIR}/usr ${INSTALL_DIR}${PREFIX}
- LogExecute cp ${BUILD_DIR}/src/nacl_temacs${NACL_EXEEXT} \
- ${DESTDIR}${PREFIX}/bin/emacs${NACL_EXEEXT}
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/emacs"
-
- if [ ${EMACS_X:-0} = 1 ]; then
- EMACS_NAME="EmacsXWindows"
- else
- EMACS_NAME="Emacs"
- fi
-
- # Copy all installed files into tarball
- MakeDir ${ASSEMBLY_DIR}/emacstar/usr
- ChangeDir ${ASSEMBLY_DIR}/emacstar
- LogExecute cp -a ${DESTDIR}${PREFIX}/* ./usr
- LogExecute cp usr/bin/emacs${NACL_EXEEXT} \
- ../emacs_${NACL_ARCH}${NACL_EXEEXT}
- rm -rf usr/bin
- rm -rf usr/share/man
- find . -iname "*.nexe" -delete
- mkdir -p ${ASSEMBLY_DIR}/emacstar/home/user/.emacs.d
- tar cf ${ASSEMBLY_DIR}/emacs.tar .
- rm -rf ${ASSEMBLY_DIR}/emacstar
- shasum ${ASSEMBLY_DIR}/emacs.tar > ${ASSEMBLY_DIR}/emacs.tar.hash
- cd ${ASSEMBLY_DIR}
- # TODO(petewil) this is expecting an exe, but we give it a shell script
- # since we have emacs running "unpacked", so it fails. Give it
- # nacl_temacs.nexe instead.
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- emacs_*${NACL_EXEEXT} \
- -s . \
- -o emacs.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py emacs.nmf
- InstallNaClTerm ${ASSEMBLY_DIR}
- GenerateManifest ${START_DIR}/manifest.json \
- ${ASSEMBLY_DIR} "TITLE"="${EMACS_NAME}"
-
- LogExecute cp ${START_DIR}/background.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/emacs.js ${ASSEMBLY_DIR}
- if [ ${EMACS_X:-0} = 1 ]; then
- local XORG_DIR=${NACL_PACKAGES_PUBLISH}/xorg-server/${TOOLCHAIN}/xorg-server
- LogExecute cp -r ${XORG_DIR}/_platform_specific ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.nmf ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.nexe ${ASSEMBLY_DIR}/
- if [[ ${NACL_SHARED} == 1 ]]; then
- LogExecute cp -r ${XORG_DIR}/lib* ${ASSEMBLY_DIR}/
- fi
- LogExecute cp ${XORG_DIR}/*.tar ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.js ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.html ${ASSEMBLY_DIR}/
-
- LogExecute cp ${START_DIR}/../emacs-x/Xsdl.js ${ASSEMBLY_DIR}/
- fi
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip emacs-${VERSION}.zip emacs
-}
diff --git a/ports/emacs/diff_skip.txt b/ports/emacs/diff_skip.txt
deleted file mode 100644
index 983a8b9..0000000
--- a/ports/emacs/diff_skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-lisp/loaddefs.el
diff --git a/ports/emacs/emacs.js b/ports/emacs/emacs.js
deleted file mode 100644
index 70e80d6..0000000
--- a/ports/emacs/emacs.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-NaClTerm.nmf = 'emacs.nmf';
-NaClTerm.cwd = '/home/user';
-NaClTerm.argv = ['-nw'];
-NaClTerm.env = [
- 'DISPLAY=:42',
-];
diff --git a/ports/emacs/emacs_pepper.c b/ports/emacs/emacs_pepper.c
deleted file mode 100644
index 6f2efcc..0000000
--- a/ports/emacs/emacs_pepper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-// TODO(bradnelson): Find a better workaround.
-#define NACL_SKIP_GETOPT
-
-#include "nacl_main.h"
-
-// Some things that Lisp.h needs:
-#include <config.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/file.h>
-#include <sys/time.h>
-
-#include "lisp.h"
-
-// Add some functions for use in the debugger to print out the value
-// of a lisp object.
-
-// Print a human readable type for a Lisp object to the debug console.
-char debug_print_buf[81];
-char* whatis(Lisp_Object object) {
- debug_print_buf[0] = '\0';
- debug_print_buf[80] = '\0';
-
- if (STRINGP(object)) {
- snprintf(debug_print_buf, 80, "String %s", SSDATA(object));
- return debug_print_buf;
- } else if (INTEGERP(object)) {
- int x = XINT(object);
- snprintf(debug_print_buf, 80, "Number %d", x);
- return debug_print_buf;
- } else if (FLOATP(object)) {
- struct Lisp_Float* floater = XFLOAT(object);
- return "It's a float number!";
- } else if (Qnil == object)
- return "It's a lisp null";
- else if (Qt == object)
- return "It's a lisp 't'";
- else if (SYMBOLP(object)) {
- snprintf(debug_print_buf, 80, "Symbol named %s", SYMBOL_NAME(object));
- return debug_print_buf;
- } else if (CONSP(object))
- return "It's a list!";
- else if (MISCP(object))
- return "It's a lisp misc!";
- else if (VECTORLIKEP(object))
- return "It's some kind of vector like thingie!";
- else
- return "I don't know what it is.";
-}
-
-// The special NaCl entry point into emacs.
-extern int nacl_emacs_main(int argc, char* argv[]);
-
-int main(int argc, char* argv[]) {
- if (nacl_startup_untar(argv[0], "emacs.tar", "/"))
- return 1;
- return nacl_emacs_main(argc, argv);
-}
diff --git a/ports/emacs/icon_128.png b/ports/emacs/icon_128.png
deleted file mode 100644
index 56b04dc..0000000
--- a/ports/emacs/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/emacs/icon_16.png b/ports/emacs/icon_16.png
deleted file mode 100644
index bd97cbd..0000000
--- a/ports/emacs/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/emacs/icon_24.png b/ports/emacs/icon_24.png
deleted file mode 100644
index 9098253..0000000
--- a/ports/emacs/icon_24.png
+++ /dev/null
Binary files differ
diff --git a/ports/emacs/icon_32.png b/ports/emacs/icon_32.png
deleted file mode 100644
index 3840be5..0000000
--- a/ports/emacs/icon_32.png
+++ /dev/null
Binary files differ
diff --git a/ports/emacs/icon_48.png b/ports/emacs/icon_48.png
deleted file mode 100644
index 7bdc7b7..0000000
--- a/ports/emacs/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/emacs/init.el b/ports/emacs/init.el
deleted file mode 100644
index 6789ee1..0000000
--- a/ports/emacs/init.el
+++ /dev/null
@@ -1,10 +0,0 @@
-;; This is a test init.el to vet the process.
-(show-paren-mode 1)
-
-;; automatically save the bookmark file whenever I add a bookmark
-(setq bookmark-save-flag 1)
-
-;; Turn off mouse wheel speedup
-(setq mouse-wheel-progressive-speed nil)
-
-(defvar *session-enabled* t)
diff --git a/ports/emacs/manifest.json b/ports/emacs/manifest.json
deleted file mode 100644
index f6845c1..0000000
--- a/ports/emacs/manifest.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "%(TITLE)s",
- "description": "Emacs console application running using NativeClient",
- "version": "24.3.0.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "file_handlers": {
- "edit": {
- "types": [
- "text/*"
- ],
- "extensions": [
- "json",
- "txt",
- "js",
- "html",
- "h",
- "c",
- "cc",
- "cpp",
- "java"
- ]
- }
- },
- "permissions": [
- "fileSystem",
- "storage",
- "unlimitedStorage",
- {
- "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/emacs/nacl.patch b/ports/emacs/nacl.patch
deleted file mode 100644
index ef6b391..0000000
--- a/ports/emacs/nacl.patch
+++ /dev/null
@@ -1,971 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -280,7 +280,8 @@ COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}/ja-dic
-
- all: ${SUBDIR}
-
--.PHONY: all ${SUBDIR} blessmail epaths-force FRC
-+#.PHONY: all ${SUBDIR} blessmail epaths-force FRC
-+.PHONY: all ${SUBDIR} epaths-force FRC
-
- removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
-
-@@ -415,7 +416,8 @@ $(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
- ## don't have to duplicate the list of utilities to install in
- ## this Makefile as well.
-
--install: all install-arch-indep install-doc install-arch-dep blessmail
-+#install: all install-arch-indep install-doc install-arch-dep blessmail
-+install: all install-arch-indep install-doc install-arch-dep
- @true
-
- ## Ensure that $subdir contains a subdirs.el file.
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -4631,6 +4631,10 @@ case "${canonical}" in
- esac
- ;;
-
-+ *-nacl )
-+ opsys=nacl
-+ ;;
-+
- ## Intel 386 machines where we don't care about the manufacturer.
- i[3456]86-*-* )
- case "${canonical}" in
-@@ -8206,6 +8210,7 @@ rm -f core conftest.err conftest.$ac_objext \
-
- test "x$CANNOT_DUMP" = "x" && CANNOT_DUMP=no
- case "$opsys" in
-+ nacl) CANNOT_DUMP=yes ;;
- your-opsys-here) CANNOT_DUMP=yes ;;
- esac
-
-@@ -9828,6 +9833,7 @@ system_malloc=no
- case "$opsys" in
- ## darwin ld insists on the use of malloc routines in the System framework.
- darwin|sol2-10) system_malloc=yes ;;
-+ nacl) system_malloc=yes ;;
- esac
-
- if test "${system_malloc}" = "yes"; then
-@@ -15169,7 +15175,7 @@ esac
- emacs_broken_SIGIO=no
-
- case $opsys in
-- hpux* | irix6-5 | openbsd | sol2* | unixware )
-+ hpux* | irix6-5 | openbsd | sol2* | unixware)
- emacs_broken_SIGIO=yes
- ;;
-
-@@ -15179,6 +15185,13 @@ $as_echo "#define BROKEN_GET_CURRENT_DIR_NAME 1" >>confdefs.h
-
- ;;
-
-+ nacl)
-+
-+ emacs_broken_SIGIO=yes
-+$as_echo "#define BROKEN_GET_CURRENT_DIR_NAME 1" >>confdefs.h
-+
-+ ;;
-+
- freebsd)
-
- $as_echo "#define BROKEN_PTY_READ_AFTER_EAGAIN 1" >>confdefs.h
-@@ -15277,7 +15290,7 @@ case $opsys in
-
- ;;
-
-- gnu-linux | gnu-kfreebsd | freebsd | netbsd )
-+ nacl | gnu-linux | gnu-kfreebsd | freebsd | netbsd )
- if test "x$ac_cv_func_grantpt" = xyes; then
-
- $as_echo "#define UNIX98_PTYS 1" >>confdefs.h
-@@ -15430,7 +15443,7 @@ if test $emacs_glibc = yes; then
- emacs_pending_output=unknown
-
- case $opsys in
-- gnu | gnu-linux | gnu-kfreebsd )
-+ nacl | gnu | gnu-linux | gnu-kfreebsd )
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of pending output formalism" >&5
- $as_echo_n "checking for style of pending output formalism... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -15929,7 +15942,7 @@ if ${emacs_cv_usable_FIONREAD+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $opsys in
-- aix4-2)
-+ aix4-2 | nacl)
- emacs_cv_usable_FIONREAD=no
- ;;
-
-@@ -24659,7 +24672,7 @@ LD_FIRSTFLAG=
- ORDINARY_LINK=
- case "$opsys" in
- ## gnu: GNU needs its own crt0.
-- aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
-+ nacl|aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
-
- ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the
- ## library search parth, i.e. it won't search /usr/lib for libc and
-diff --git a/leim/Makefile.in b/leim/Makefile.in
---- a/leim/Makefile.in
-+++ b/leim/Makefile.in
-@@ -28,10 +28,13 @@ SHELL = /bin/sh
-
- # Here are the things that we expect ../configure to edit.
- srcdir=@srcdir@
-+top_srcdir = @top_srcdir@
-+abs_top_builddir = @abs_top_builddir@
-+EXEEXT = @EXEEXT@
-
- # Which Emacs to use to convert TIT files to Emacs Lisp files,
- # byte-compile Emacs Lisp files, and generate the file leim-list.el.
--EMACS = ../src/emacs
-+EMACS = ${abs_top_builddir}/src/emacs${EXEEXT}
-
- buildlisppath=${srcdir}/../lisp
-
-diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
---- a/lib-src/Makefile.in
-+++ b/lib-src/Makefile.in
-@@ -23,7 +23,7 @@
- SHELL = /bin/sh
-
- # Following ../lisp/Makefile.in.
--EMACS = ../src/emacs
-+EMACS = ../src/emacs${EXEEXT}
- EMACSOPT = -batch --no-site-file --no-site-lisp
-
- # ==================== Things `configure' will edit ====================
-@@ -183,7 +183,8 @@ config_h = ../src/config.h $(srcdir)/../src/conf_post.h
-
- all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
-
--.PHONY: all need-blessmail maybe-blessmail
-+#.PHONY: all need-blessmail maybe-blessmail
-+.PHONY: all
-
- LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM)
- $(EXE_FILES): ../lib/libgnu.a
-@@ -290,8 +291,8 @@ TAGS: etags${EXEEXT}
- ## distribute Emacs. If they were clobbered, all the .elc files were
- ## clobbered too.
- test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
-- $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
-- ./test-distrib ${srcdir}/testfile
-+ $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c
-+ $(RUNPROGRAM) -- ./test-distrib${EXEEXT} ${srcdir}/testfile
-
- ../lib/libgnu.a: $(config_h)
- cd ../lib && $(MAKE) libgnu.a
-@@ -303,30 +304,30 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
- etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h)
- $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
- -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-- regex.o $(LOADLIBES) -o etags
-+ regex.o $(LOADLIBES) -o etags${EXEEXT}
-
- ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h)
- $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
-- ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse
-+ ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse${EXEEXT}
-
- ## We depend on etags to assure that parallel makes do not write two
- ## etags.o files on top of each other.
- ctags${EXEEXT}: etags${EXEEXT}
- $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
- -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-- regex.o $(LOADLIBES) -o ctags
-+ regex.o $(LOADLIBES) -o ctags${EXEEXT}
-
- profile${EXEEXT}: ${srcdir}/profile.c $(config_h)
- $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
-- $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile
-+ $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT}
-
- make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h)
- $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
-- -o make-docfile
-+ -o make-docfile${EXEEXT}
-
- movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(config_h)
- $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
-- $(LOADLIBES) $(LIBS_MOVE) -o movemail
-+ $(LOADLIBES) $(LIBS_MOVE) -o movemail${EXEEXT} ${COMPAT_LIBS}
-
- pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h)
- $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
-@@ -334,13 +335,13 @@ pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h)
- emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h)
- $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
- -DVERSION="\"${version}\"" \
-- $(LOADLIBES) -o emacsclient
-+ $(LOADLIBES) -o emacsclient${EXEEXT} ${COMPAT_LIBS}
-
- hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h)
-- $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
-+ $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
-
- update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(config_h)
- $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
-- ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
-+ ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score${EXEEXT}
-
- ## Makefile ends here.
-diff --git a/lib-src/profile.c b/lib-src/profile.c
---- a/lib-src/profile.c
-+++ b/lib-src/profile.c
-@@ -37,7 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
- #include <stdio.h>
-
- #include <intprops.h>
--#include <systime.h>
-+#include "systime.h"
-
- static EMACS_TIME TV1;
- static int watch_not_started = 1; /* flag */
-diff --git a/lib/getopt.in.h b/lib/getopt.in.h
---- a/lib/getopt.in.h
-+++ b/lib/getopt.in.h
-@@ -16,6 +16,7 @@
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-+#if !defined(NACL_SKIP_GETOPT)
- #ifndef _@GUARD_PREFIX@_GETOPT_H
-
- #if __GNUC__ >= 3
-@@ -251,3 +252,4 @@ extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
-
- #endif /* _@GUARD_PREFIX@_GETOPT_H */
- #endif /* _@GUARD_PREFIX@_GETOPT_H */
-+#endif
-diff --git a/lib/symlink.c b/lib/symlink.c
---- a/lib/symlink.c
-+++ b/lib/symlink.c
-@@ -24,6 +24,7 @@
- #include <sys/stat.h>
-
-
-+#undef HAVE_SYMLINK
- #if HAVE_SYMLINK
-
- # undef symlink
-diff --git a/lisp/Makefile.in b/lisp/Makefile.in
---- a/lisp/Makefile.in
-+++ b/lisp/Makefile.in
-@@ -21,6 +21,7 @@ SHELL = /bin/sh
- srcdir = @srcdir@
- top_srcdir = @top_srcdir@
- abs_top_builddir = @abs_top_builddir@
-+EXEEXT = @EXEEXT@
- lisp = $(srcdir)
- VPATH = $(srcdir)
-
-@@ -30,7 +31,7 @@ VPATH = $(srcdir)
- # We sometimes change directory before running Emacs (typically when
- # building out-of-tree, we chdir to the source directory), so we need
- # to use an absolute file name.
--EMACS = ${abs_top_builddir}/src/emacs
-+EMACS = ${abs_top_builddir}/src/emacs${EXEEXT}
-
- # Command line flags for Emacs.
-
-diff --git a/lisp/files.el b/lisp/files.el
---- a/lisp/files.el
-+++ b/lisp/files.el
-@@ -1098,7 +1098,8 @@ containing it, until no links are left at any level.
- (while (not done)
- (setcar counter (1- (car counter)))
- (if (< (car counter) 0)
-- (error "Apparent cycle of symbolic links for %s" filename))
-+ ;;(error "Apparent cycle of symbolic links for %s" filename))
-+ (setq done t))
- (let ((handler (find-file-name-handler filename 'file-truename)))
- ;; For file name that has a special handler, call handler.
- ;; This is so that ange-ftp can save time by doing a no-op.
-@@ -1117,10 +1118,14 @@ containing it, until no links are left at any level.
- ;; save time--don't recalculate.
- (if (assoc dir (car prev-dirs))
- (setq dir (cdr (assoc dir (car prev-dirs))))
-- (let ((old dir)
-- (new (file-name-as-directory (file-truename dirfile counter prev-dirs))))
-- (setcar prev-dirs (cons (cons old new) (car prev-dirs)))
-- (setq dir new))))
-+ ;; Otherwise, we don't have a cached dir, check for . and ..
-+ ;; then recurse we don't have . or ..
-+ (if (not (or (equal ".." (file-name-nondirectory filename))
-+ (equal "." (file-name-nondirectory filename))))
-+ (let ((old dir)
-+ (new (file-name-as-directory (file-truename dirfile counter prev-dirs))))
-+ (setcar prev-dirs (cons (cons old new) (car prev-dirs)))
-+ (setq dir new)))))
- (if (equal ".." (file-name-nondirectory filename))
- (setq filename
- (directory-file-name (file-name-directory (directory-file-name dir)))
-diff --git a/lisp/loadup.el b/lisp/loadup.el
---- a/lisp/loadup.el
-+++ b/lisp/loadup.el
-@@ -68,7 +68,7 @@
- ;; Hash consing saved around 11% of pure space in my tests.
- (setq purify-flag (make-hash-table :test 'equal :size 70000)))
-
--(message "Using load-path %s" load-path)
-+;; (message "Using load-path %s" load-path)
-
- (if (or (member (nth 3 command-line-args) '("dump" "bootstrap"))
- (member (nth 4 command-line-args) '("dump" "bootstrap")))
-diff --git a/lisp/shell.el b/lisp/shell.el
---- a/lisp/shell.el
-+++ b/lisp/shell.el
-@@ -292,10 +292,11 @@ Value is a list of strings, which may be nil."
- (if (and (not purify-flag)
- (equal name "bash")
- (file-executable-p prog)
-- (string-match "bad option"
-+ (and (not (equal system-type 'nacl))
-+ (string-match "bad option"
- (shell-command-to-string
- (concat (shell-quote-argument prog)
-- " --noediting"))))
-+ " --noediting")))))
- '("-i")
- '("--noediting" "-i")))
- "Args passed to inferior shell by \\[shell], if the shell is bash.
-diff --git a/lisp/startup.el b/lisp/startup.el
---- a/lisp/startup.el
-+++ b/lisp/startup.el
-@@ -1004,7 +1004,7 @@ Amongst another things, it parses the command-line arguments."
- ;; even if invoked with "-u USER", or
- ;; if $USER or $LOGNAME are set to
- ;; something different.
-- (if (memq system-type '(windows-nt ms-dos))
-+ (if (memq system-type '(windows-nt ms-dos nacl))
- "~"
- (concat "~" init-file-user))))
- nil
-@@ -1031,6 +1031,7 @@ Amongst another things, it parses the command-line arguments."
- (cond
- ((eq system-type 'ms-dos)
- (concat "~" init-file-user "/_emacs"))
-+ ((eq system-type 'nacl) "~/.emacs")
- ((not (eq system-type 'windows-nt))
- (concat "~" init-file-user "/.emacs"))
- ;; Else deal with the Windows situation
-@@ -1052,13 +1053,20 @@ Amongst another things, it parses the command-line arguments."
-
- (when (eq user-init-file t)
- ;; If we did not find ~/.emacs, try
-- ;; ~/.emacs.d/init.el.
-+ ;; ~<user>/.emacs.d/init.el.
- (let ((otherfile
- (expand-file-name
- "init"
- (file-name-as-directory
-- (concat "~" init-file-user "/.emacs.d")))))
-- (load otherfile t t)
-+ (concat "~" init-file-user "/.emacs.d"))))
-+ ;; NaCl cannot expand ~<user>, just use '~'
-+ (otherfile-nacl
-+ (expand-file-name
-+ "init"
-+ (file-name-as-directory "~/.emacs.d"))))
-+ (if (eq system-type 'nacl)
-+ (load otherfile-nacl t t)
-+ (load otherfile t t))
-
- ;; If we did not find the user's init file,
- ;; set user-init-file conclusively.
-diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
---- a/lisp/vc/vc-git.el
-+++ b/lisp/vc/vc-git.el
-@@ -164,12 +164,12 @@ matching the resulting Git log output, and KEYWORDS is a list of
-
- ;;; STATE-QUERYING FUNCTIONS
-
--;;;###autoload (defun vc-git-registered (file)
--;;;###autoload "Return non-nil if FILE is registered with git."
--;;;###autoload (if (vc-find-root file ".git") ; Short cut.
--;;;###autoload (progn
--;;;###autoload (load "vc-git")
--;;;###autoload (vc-git-registered file))))
-+;;;###autonotload (defun vc-git-registered (file)
-+;;;###autonotload "Return non-nil if FILE is registered with git."
-+;;;###autonotload (if (vc-find-root file ".git") ; Short cut.
-+;;;###autonotload (progn
-+;;;###autonotload (load "vc-git")
-+;;;###autonotload (vc-git-registered file))))
-
- (defun vc-git-registered (file)
- "Check whether FILE is registered with git."
-diff --git a/lisp/window.el b/lisp/window.el
---- a/lisp/window.el
-+++ b/lisp/window.el
-@@ -4001,7 +4001,10 @@ right, if any."
- (let ((quit-restore (window-parameter old-window 'quit-restore)))
- (when quit-restore
- (set-window-parameter new-window 'quit-restore quit-restore)))
-- new-window))
-+ new-window)
-+ ;; To workaround drawing issues with NaCl terminals, redraw now.
-+ (if (equal system-type 'nacl)
-+ (redraw-display)))
-
- (defalias 'split-window-horizontally 'split-window-right)
-
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -284,11 +284,13 @@ LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
-
- LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
-
-+NACL_LIBS = ${EXTRA_LIBS}
-+
- INTERVALS_H = dispextern.h intervals.h composite.h
-
- GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
-
--RUN_TEMACS = `/bin/pwd`/temacs
-+RUN_TEMACS = $(RUNPROGRAM) -- `/bin/pwd`/temacs
-
- UNEXEC_OBJ = @UNEXEC_OBJ@
-
-@@ -328,6 +330,22 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
- @$(MKDEPDIR)
- $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
-
-+nacl_emacs.o: emacs.c
-+ @$(MKDEPDIR)
-+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -DNACL_EMACS -o $@
-+
-+nacl_process.o: process.c
-+ @$(MKDEPDIR)
-+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -DNACL_EMACS -o $@
-+
-+nacl_callproc.o: callproc.c
-+ @$(MKDEPDIR)
-+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -DNACL_EMACS -o $@
-+
-+nacl_sysdep.o: sysdep.c
-+ @$(MKDEPDIR)
-+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< -DNACL_EMACS -o $@
-+
-
- ## lastfile must follow all files whose initialized data areas should
- ## be dumped as pure by dump-emacs.
-@@ -346,9 +364,29 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
- doprnt.o intervals.o textprop.o composite.o xml.o \
- profiler.o \
- $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
-- $(W32_OBJ) $(WINDOW_SYSTEM_OBJ)
-+ $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) -lnacl_io
- obj = $(base_obj) $(NS_OBJC_OBJ)
-
-+## Just like $(obj), but includes nacl_emacs.o (built with NACL_EMACS) instead
-+## of emacs.o, and also includes emacs_pepper.o
-+nacl_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
-+ charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
-+ cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
-+ nacl_emacs.o keyboard.o macros.o keymap.o nacl_sysdep.o \
-+ buffer.o filelock.o insdel.o marker.o \
-+ minibuf.o fileio.o dired.o \
-+ cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
-+ alloc.o data.o doc.o editfns.o callint.o \
-+ eval.o floatfns.o fns.o font.o print.o lread.o \
-+ syntax.o $(UNEXEC_OBJ) bytecode.o \
-+ nacl_process.o gnutls.o nacl_callproc.o \
-+ region-cache.o sound.o atimer.o \
-+ doprnt.o intervals.o textprop.o composite.o xml.o \
-+ profiler.o \
-+ emacs_pepper.o \
-+ $(WINDOW_SYSTEM_OBJ) $(FONT_OBJ) \
-+ $(NS_OBJC_OBJ)
-+
- ## Object files used on some machine or other.
- ## These go in the DOC file on all machines in case they are needed.
- ## Some of them have no DOC entries, but it does no harm to have them
-@@ -400,9 +438,10 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
- $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
- $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
-
--all: emacs$(EXEEXT) $(OTHER_FILES)
-+all: emacs$(EXEEXT) $(OTHER_FILES) nacl_temacs$(EXEEXT)
- .PHONY: all
-
-+#$(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT) temacs$(EXEEXT)
- $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
- cd $(leimdir) && $(MAKE) $(MFLAGS) leim-list.el EMACS=$(bootstrap_exe)
-
-@@ -414,7 +453,12 @@ $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
- emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
- if test "$(CANNOT_DUMP)" = "yes"; then \
- rm -f emacs$(EXEEXT); \
-- ln temacs$(EXEEXT) emacs$(EXEEXT); \
-+ echo "#!/bin/bash" > emacs$(EXEEXT); \
-+ echo 'EMACSLOADPATH=$${EMACSLOADPATH} \\' >> emacs$(EXEEXT); \
-+ echo "$(RUNPROGRAM) -p \\" >> emacs$(EXEEXT); \
-+ echo "$(RUNPROGRAM_ARGS) -- $(PWD)/temacs$(EXEEXT) \\" >> emacs$(EXEEXT); \
-+ echo ' "$$@"' >> emacs$(EXEEXT); \
-+ chmod a+x emacs$(EXEEXT); \
- else \
- LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \
- test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
-@@ -438,8 +482,8 @@ emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
- ##
- $(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
- -rm -f $(etc)/DOC
-- $(libsrc)/make-docfile -d $(srcdir) $(SOME_MACHINE_OBJECTS) $(obj) > $(etc)/DOC
-- $(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) `sed -n -e 's| \\\\||' -e 's|^[ ]*$$(lispsource)/||p' $(srcdir)/lisp.mk`
-+ cd $(srcdir) $(RUNPROGRAM) -- ${PWD}/$(libsrc)/make-docfile$(EXEEXT) $(SOME_MACHINE_OBJECTS) ${PWD}/$(obj) > ${PWD}/$(etc)/DOC
-+ cd $(libspsource) && $(RUNPROGRAM) -- ${PWD}/$(libsrc)/make-docfile$(EXEEXT) -a ${PWD}/$(etc)/DOC `sed -n -e 's| \\\\||' -e 's|^[ ]*$$(lispsource)/||p' ${PWD}/$(srcdir)/lisp.mk`
-
- $(libsrc)/make-docfile$(EXEEXT):
- cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)
-@@ -453,7 +497,7 @@ GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
-
- gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
- @rm -f gl-tmp
-- $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl-tmp
-+ cd $(srcdir) && $(RUNPROGRAM) -- ${PWD}/$(libsrc)/make-docfile$(EXEEXT) -g $(obj) > ${PWD}/gl-tmp
- $(srcdir)/../build-aux/move-if-change gl-tmp globals.h
- echo timestamp > $@
-
-@@ -464,7 +508,15 @@ $(lib)/libgnu.a: $(config_h)
-
- temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.a
- $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
-- -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES)
-+ -o temacs$(EXEEXT) $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) ${COMPAT_LIBS}
-+ test "$(CANNOT_DUMP)" = "yes" || \
-+ test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
-+
-+## A special build of temacs with a different entry point, and including
-+## emacs_pepper
-+nacl_temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(nacl_obj) $(otherobj) $(lib)/libgnu.a
-+ $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
-+ -o nacl_temacs$(EXEEXT) $(START_FILES) $(nacl_obj) $(otherobj) $(lib)/libgnu.a $(NACL_LIBS) $(LIBES) ${COMPAT_LIBS}
- test "$(CANNOT_DUMP)" = "yes" || \
- test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
-
-@@ -613,8 +665,12 @@ $(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS)
- bootstrap-emacs$(EXEEXT): temacs$(EXEEXT)
- cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
- if test "$(CANNOT_DUMP)" = "yes"; then \
-- rm -f bootstrap-emacs$(EXEEXT); \
-- ln temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
-+ echo "#!/bin/bash" > bootstrap-emacs$(EXEEXT); \
-+ echo 'EMACSLOADPATH=$${EMACSLOADPATH} \' >> bootstrap-emacs$(EXEEXT); \
-+ echo "$(RUNPROGRAM) -p \\" >> bootstrap-emacs$(EXEEXT); \
-+ echo "$(RUNPROGRAM_ARGS) -- $(PWD)/temacs$(EXEEXT) \\" >> bootstrap-emacs$(EXEEXT); \
-+ echo ' "$$@"' >> bootstrap-emacs$(EXEEXT); \
-+ chmod a+x bootstrap-emacs$(EXEEXT); \
- else \
- $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \
- test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
-diff --git a/src/alloc.c b/src/alloc.c
---- a/src/alloc.c
-+++ b/src/alloc.c
-@@ -47,6 +47,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
- #include <verify.h>
-
-+#ifdef NACL_EMACS
-+#include <spawn.h>
-+#define pipe nacl_spawn_pipe
-+#endif
-+
- /* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
- Doable only if GC_MARK_STACK. */
- #if ! GC_MARK_STACK
-diff --git a/src/callproc.c b/src/callproc.c
---- a/src/callproc.c
-+++ b/src/callproc.c
-@@ -29,6 +29,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
- #include "lisp.h"
-
-+#ifdef NACL_EMACS
-+#include <spawn.h>
-+#define pipe nacl_spawn_pipe
-+#endif
-+
- #ifdef WINDOWSNT
- #define NOMINMAX
- #include <windows.h>
-@@ -655,6 +660,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
- {
- if (fd[0] >= 0)
- emacs_close (fd[0]);
-+ message("Errno was %d", errno);
- report_file_error ("Doing vfork", Qnil);
- }
-
-@@ -1610,7 +1616,11 @@ init_callproc (void)
- Vdata_directory);
-
- sh = (char *) getenv ("SHELL");
-+#ifndef NACL_EMACS
- Vshell_file_name = build_string (sh ? sh : "/bin/sh");
-+#else
-+ Vshell_file_name = build_string (sh ? sh : "/bin/bash");
-+#endif
-
- #ifdef DOS_NT
- Vshared_game_score_directory = Qnil;
-diff --git a/src/emacs.c b/src/emacs.c
---- a/src/emacs.c
-+++ b/src/emacs.c
-@@ -31,6 +31,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
- #include "lisp.h"
-
-+#ifdef NACL_EMACS
-+#include <spawn.h>
-+#define pipe nacl_spawn_pipe
-+#endif
-+
- #ifdef WINDOWSNT
- #include <fcntl.h>
- #include "w32.h"
-@@ -656,11 +661,27 @@ void (*__malloc_initialize_hook) (void) EXTERNALLY_VISIBLE = malloc_initialize_h
-
- #endif /* DOUG_LEA_MALLOC */
-
-+int real_main (int argc, char **argv);
-
--/* ARGSUSED */
-+#ifndef NACL_EMACS
- int
- main (int argc, char **argv)
- {
-+ return real_main(argc, argv);
-+}
-+
-+#else // NACL_EMACS
-+int
-+nacl_emacs_main (int argc, char **argv)
-+{
-+ return real_main(argc, argv);
-+}
-+#endif // NACL_EMACS
-+
-+/* ARGSUSED */
-+int
-+real_main (int argc, char **argv)
-+{
- #if GC_MARK_STACK
- Lisp_Object dummy;
- #endif
-@@ -2113,7 +2134,7 @@ decode_env_path (const char *evarname, const char *defalt)
- path = getenv (evarname);
- else
- path = 0;
-- if (!path)
-+ if (!path || strlen(path) == 0)
- {
- path = defalt;
- #ifdef WINDOWSNT
-diff --git a/src/fileio.c b/src/fileio.c
---- a/src/fileio.c
-+++ b/src/fileio.c
-@@ -2131,8 +2131,10 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
- mode_mask |= 02000;
- }
- }
-+#if !defined(__native_client__)
- if (fchmod (ofd, st.st_mode & mode_mask) != 0)
- report_file_error ("Doing chmod", Fcons (newname, Qnil));
-+#endif
- }
- #endif /* not MSDOS */
-
-@@ -2149,6 +2151,7 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
- }
- #endif
-
-+#if !defined(__native_client__)
- if (input_file_statable_p)
- {
- if (!NILP (keep_time))
-@@ -2160,6 +2163,7 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
- build_string ("Cannot set file date"), newname);
- }
- }
-+#endif
-
- if (emacs_close (ofd) < 0)
- report_file_error ("I/O error", Fcons (newname, Qnil));
-@@ -2272,8 +2276,10 @@ With a prefix argument, TRASH is nil. */)
-
- encoded_file = ENCODE_FILE (filename);
-
-+#if !defined(__native_client__)
- if (unlink (SSDATA (encoded_file)) < 0)
- report_file_error ("Removing old name", list1 (filename));
-+#endif
- return Qnil;
- }
-
-@@ -2352,7 +2358,8 @@ This is what happens in interactive use with M-x. */)
- INTEGERP (ok_if_already_exists), 0, 0);
- if (rename (SSDATA (encoded_file), SSDATA (encoded_newname)) < 0)
- {
-- if (errno == EXDEV)
-+ //if (errno == EXDEV)
-+ if (1)
- {
- ptrdiff_t count;
- symlink_target = Ffile_symlink_p (file);
-@@ -2630,6 +2637,8 @@ For a directory, this means you can access files in that directory. */)
- Lisp_Object absname;
- Lisp_Object handler;
-
-+ return Qt;
-+
- CHECK_STRING (filename);
- absname = Fexpand_file_name (filename, Qnil);
-
-@@ -2698,6 +2707,9 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
- doc: /* Return t if file FILENAME can be written or created by you. */)
- (Lisp_Object filename)
- {
-+ return Qt;
-+
-+#if 0 // PETEWIL - bypass this until sel_ldr is working
- Lisp_Object absname, dir, encoded;
- Lisp_Object handler;
-
-@@ -2731,6 +2743,8 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
- return (check_writable (!NILP (dir) ? SSDATA (dir) : "")
- ? Qt : Qnil);
- #endif
-+
-+#endif // 0
- }
-
- DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0,
-@@ -4848,6 +4862,7 @@ This calls `write-region-annotate-functions' at the start, and
-
- immediate_quit = 0;
-
-+#if !defined(__native_client__)
- #ifdef HAVE_FSYNC
- /* Note fsync appears to change the modtime on BSD4.2 (both vax and sun).
- Disk full in NFS may be reported here. */
-@@ -4862,6 +4877,7 @@ This calls `write-region-annotate-functions' at the start, and
- ok = 0, save_errno = errno;
- }
- #endif
-+#endif
-
- modtime = invalid_emacs_time ();
- if (visiting)
-diff --git a/src/keyboard.c b/src/keyboard.c
---- a/src/keyboard.c
-+++ b/src/keyboard.c
-@@ -6858,6 +6858,26 @@ decode_keyboard_code (struct tty_display_info *tty,
- and so this function is called once for each individual termcap
- terminal. The first parameter indicates which terminal to read from. */
-
-+#if defined(__native_client__)
-+#include "nacl_io/kernel_intercept.h"
-+#include "nacl_io/kernel_wrap.h"
-+#include <stdarg.h>
-+
-+/*
-+ * TODO(bradnelson): Drop this when fcntl is sorted out in nacl_io.
-+ * Explicitly use nacl_fcntl.
-+ * When built as a shared library, without this emacs seems to hit stubs.
-+ */
-+int nacl_fcntl(int fd, int cmd, ...) {
-+ va_list ap;
-+ va_start(ap, cmd);
-+ int rtn = ki_fcntl(fd, cmd, ap);
-+ va_end(ap);
-+ return rtn;
-+}
-+#define fcntl nacl_fcntl
-+#endif
-+
- int
- tty_read_avail_input (struct terminal *terminal,
- struct input_event *hold_quit)
-@@ -6946,10 +6966,10 @@ tty_read_avail_input (struct terminal *terminal,
- return 0;
- if (n_to_read > sizeof cbuf)
- n_to_read = sizeof cbuf;
--#elif defined USG || defined CYGWIN
-+#elif defined USG || defined CYGWIN || defined __native_client__
- /* Read some input if available, but don't wait. */
- n_to_read = sizeof cbuf;
-- fcntl (fileno (tty->input), F_SETFL, O_NDELAY);
-+ fcntl (fileno (tty->input), F_SETFL, O_NONBLOCK);
- #else
- # error "Cannot read without possibly delaying"
- #endif
-diff --git a/src/lisp.h b/src/lisp.h
---- a/src/lisp.h
-+++ b/src/lisp.h
-@@ -190,7 +190,8 @@ enum Lisp_Bits
- #ifndef USE_LSB_TAG
- /* 1. We know malloc returns a multiple of 8. */
- # if (defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ \
-- || defined DARWIN_OS || defined __sun)
-+ || defined DARWIN_OS || defined __sun \
-+ || (defined __native_client__ && defined _NEWLIB_VERSION))
- /* 2. We can specify multiple-of-8 alignment on static variables. */
- # ifdef alignas
- /* 3. Pointers-as-ints exceed VAL_MAX.
-diff --git a/src/process.c b/src/process.c
---- a/src/process.c
-+++ b/src/process.c
-@@ -33,6 +33,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
- #include "lisp.h"
-
-+#ifdef NACL_EMACS
-+#include <spawn.h>
-+#define pipe nacl_spawn_pipe
-+#endif
-+
- /* Only MS-DOS does not define `subprocesses'. */
- #ifdef subprocesses
-
-@@ -1588,6 +1593,22 @@ create_process_1 (struct atimer *timer)
- /* Nothing to do. */
- }
-
-+#ifdef NACL_EMACS
-+/*
-+ * TODO(bradnelson): Drop this when fcntl is sorted out in nacl_io.
-+ * Explicitly use nacl_fcntl.
-+ * When built as a shared library, without this emacs seems to hit stubs.
-+ */
-+static int nacl_fcntl(int fd, int cmd, ...) {
-+ va_list ap;
-+ va_start(ap, cmd);
-+ int rtn = ki_fcntl(fd, cmd, ap);
-+ va_end(ap);
-+ return rtn;
-+}
-+#define fcntl nacl_fcntl
-+#endif
-+
-
- static void
- create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
-@@ -1663,9 +1684,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
- tem = pipe (wait_child_setup);
- if (tem < 0)
- report_file_error ("Creating pipe", Qnil);
-+ message("About to get file descriptor flags");
- tem = fcntl (wait_child_setup[1], F_GETFD, 0);
- if (tem >= 0)
-+ {
-+ message("About to set file descriptor flags");
- tem = fcntl (wait_child_setup[1], F_SETFD, tem | FD_CLOEXEC);
-+ }
- if (tem < 0)
- {
- emacs_close (wait_child_setup[0]);
-@@ -4633,13 +4658,23 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
- nfds = xg_select
- #elif defined (HAVE_NS)
- nfds = ns_select
-+#elif defined (NACL_EMACS)
-+ // NACL doesn't support pselect yet, so use select instead.
-+ // (glibc stubs out pselect in terms of select).
-+ // Select takes a different kind of time, and one fewer argument.
-+ struct timeval timevalue = {0,0};
-+ nfds = select
- #else
- nfds = pselect
- #endif
- (max (max_process_desc, max_input_desc) + 1,
- &Available,
- (check_write ? &Writeok : (SELECT_TYPE *)0),
-+#if defined (NACL_EMACS)
-+ NULL, &timevalue);
-+#else
- NULL, &timeout, NULL);
-+#endif
-
- #ifdef HAVE_GNUTLS
- /* GnuTLS buffers data internally. In lowat mode it leaves
-diff --git a/src/sysdep.c b/src/sysdep.c
---- a/src/sysdep.c
-+++ b/src/sysdep.c
-@@ -40,6 +40,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
- #include "sysselect.h"
- #include "blockinput.h"
-
-+#ifdef NACL_EMACS
-+# include <spawn.h>
-+# define pipe nacl_spawn_pipe
-+#endif
-+
- #ifdef BSD_SYSTEM
- #include <sys/param.h>
- #include <sys/sysctl.h>
-@@ -2438,7 +2443,7 @@ cfmakeraw (struct termios *termios_p)
- }
- #endif /* !defined (HAVE_CFMAKERAW */
-
--#if !defined (HAVE_CFSETSPEED)
-+#if !defined (HAVE_CFSETSPEED) && !defined(__native_client__)
- /* Workaround for targets which are missing cfsetspeed. */
- static int
- cfsetspeed (struct termios *termios_p, speed_t vitesse)
-diff --git a/src/term.c b/src/term.c
---- a/src/term.c
-+++ b/src/term.c
-@@ -2918,6 +2918,7 @@ set_tty_hooks (struct terminal *terminal)
- static void
- dissociate_if_controlling_tty (int fd)
- {
-+#ifndef __native_client__
- #ifndef DOS_NT
- pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */
- if (pgid != -1)
-@@ -2948,6 +2949,7 @@ dissociate_if_controlling_tty (int fd)
- #endif /* ! USG */
- }
- #endif /* !DOS_NT */
-+#endif
- }
-
- /* Create a termcap display on the tty device with the given name and
-diff --git a/src/unexelf.c b/src/unexelf.c
---- a/src/unexelf.c
-+++ b/src/unexelf.c
-@@ -616,6 +616,7 @@ find_section (const char *name, const char *section_names, const char *file_name
- void
- unexec (const char *new_name, const char *old_name)
- {
-+#if !defined(__native_client__)
- int new_file, old_file, new_file_size;
-
- #if defined (emacs) || !defined (DEBUG)
-@@ -1318,4 +1319,5 @@ temacs:
- stat_buf.st_mode |= 0111 & ~n;
- if (chmod (new_name, stat_buf.st_mode) == -1)
- fatal ("Can't chmod (%s): errno %d\n", new_name, errno);
-+#endif
- }
-diff --git a/src/vm-limit.c b/src/vm-limit.c
---- a/src/vm-limit.c
-+++ b/src/vm-limit.c
-@@ -139,7 +139,9 @@ ret_lim_data (void)
- static void
- get_lim_data (void)
- {
-+#ifndef __native_client__
- lim_data = vlimit (LIM_DATA, -1);
-+#endif
- }
- #endif /* not MSDOS */
-
diff --git a/ports/emacs/pkg_info b/ports/emacs/pkg_info
deleted file mode 100644
index c70ddc1..0000000
--- a/ports/emacs/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=emacs
-VERSION=24.3
-URL=http://mirrors.kernel.org/gnu/emacs/emacs-24.3.tar.gz
-LICENSE=GPL
-BUILD_OS=linux
-DEPENDS=(ncurses libtar nacl-spawn)
-SHA1=3c672a176df06e20d2661058ad49893f184b4956
-DISABLED_TOOLCHAIN=(emscripten pnacl)
-CONFLICTS=(emacs)
diff --git a/ports/expat/nacl.patch b/ports/expat/nacl.patch
deleted file mode 100644
index 887b1c5..0000000
--- a/ports/expat/nacl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -103,6 +103,7 @@ mkdir-init:
- CC = @CC@
- CXX = @CXX@
- LIBTOOL = @LIBTOOL@
-+LIBS = @LIBS@
-
- INCLUDES = -I$(srcdir)/lib -I.
- LDFLAGS = @LDFLAGS@
-@@ -143,7 +144,7 @@ xmlwf/xmlfile.o: xmlwf/xmlfile.c
- xmlwf/codepage.o: xmlwf/codepage.c
- xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c
- xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY)
-- $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY)
-+ $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) $(LIBS)
-
- examples/elements.o: examples/elements.c
- examples/elements: examples/elements.o $(LIBRARY)
diff --git a/ports/expat/pkg_info b/ports/expat/pkg_info
deleted file mode 100644
index 4c6158a..0000000
--- a/ports/expat/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=expat
-VERSION=2.0.1
-URL=http://download.sf.net/expat/expat/2.0.1/expat-2.0.1.tar.gz
-LICENSE=CUSTOM:COPYING
-SHA1=663548c37b996082db1f2f2c32af060d7aa15c2d
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/faac/build.sh b/ports/faac/build.sh
deleted file mode 100644
index bc4d4e5..0000000
--- a/ports/faac/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXTRA_CONFIGURE_ARGS="--with-mp4v2=no"
diff --git a/ports/faac/nacl.patch b/ports/faac/nacl.patch
deleted file mode 100644
index 64e0819..0000000
--- a/ports/faac/nacl.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/frontend/main.c b/frontend/main.c
---- a/frontend/main.c
-+++ b/frontend/main.c
-@@ -43,7 +43,7 @@
- #endif
-
- /* the BSD derivatives don't define __unix__ */
--#if defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
-+#if defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__native_client__)
- #define __unix__
- #endif
-
-@@ -1048,14 +1048,14 @@ int main(int argc, char *argv[])
- if ((showcnt <= 0) || !bytesWritten)
- {
- double timeused;
--#ifdef __unix__
-+#if defined(__unix__) && defined(HAVE_GETRUSAGE)
- struct rusage usage;
- #endif
- #ifdef _WIN32
- char percent[MAX_PATH + 20];
- timeused = (GetTickCount() - begin) * 1e-3;
- #else
--#ifdef __unix__
-+#if defined(__unix__) && defined(HAVE_GETRUSAGE)
- if (getrusage(RUSAGE_SELF, &usage) == 0) {
- timeused = (double)usage.ru_utime.tv_sec +
- (double)usage.ru_utime.tv_usec * 1e-6;
diff --git a/ports/faac/pkg_info b/ports/faac/pkg_info
deleted file mode 100644
index d1bafea..0000000
--- a/ports/faac/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=faac
-VERSION=1.28
-URL=http://download.sf.net/faac/faac-src/faac-1.28/faac-1.28.tar.gz
-LICENSE=CUSTOM:README
-SHA1=d00b023a3642f81bb1fb13d962a65079121396ee
diff --git a/ports/faad2/build.sh b/ports/faad2/build.sh
deleted file mode 100644
index 47287a7..0000000
--- a/ports/faad2/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2011 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.
-
-ConfigureStep() {
- # TODO: Remove when this is fixed.
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- if [ "$NACL_ARCH" = "arm" ]; then
- export NACLPORTS_CFLAGS="${NACLPORTS_CFLAGS/-O2/-O1}"
- fi
- DefaultConfigureStep
-}
diff --git a/ports/faad2/nacl.patch b/ports/faad2/nacl.patch
deleted file mode 100644
index aef83b8..0000000
--- a/ports/faad2/nacl.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -22755,7 +22755,9 @@ if test "${ac_cv_c99_lrintf+set}" = set; then
- else
-
- lrintf_save_CFLAGS=$CFLAGS
--CFLAGS="-O -lm"
-+lrintf_save_LIBS=$LIBS
-+CFLAGS="-O"
-+LIBS="-lm"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -22807,6 +22809,7 @@ fi
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-
-+LIBS=$lrintf_save_LIBS
- CFLAGS=$lrintf_save_CFLAGS
-
-
diff --git a/ports/faad2/pkg_info b/ports/faad2/pkg_info
deleted file mode 100644
index 0cbb60c..0000000
--- a/ports/faad2/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=faad2
-VERSION=2.7
-URL=http://sf.net/projects/faac/files/faad2-src/faad2-2.7/faad2-2.7.tar.gz
-LICENSE=GPL
-SHA1=80eaaa5cc576c35dd28863767b795c50cbcc0511
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/ffmpeg/build.sh b/ports/ffmpeg/build.sh
deleted file mode 100644
index d2f3c3f..0000000
--- a/ports/ffmpeg/build.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-# 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.
-
-EXECUTABLES="ffmpeg ffmpeg_g ffprobe ffprobe_g"
-
-# needed for RLIMIT_CPU
-EnableGlibcCompat
-
-ConfigureStep() {
-
- SetupCrossEnvironment
-
- local extra_args=""
- if [ "${TOOLCHAIN}" = "pnacl" ]; then
- extra_args="--cc=pnacl-clang"
- elif [ "${TOOLCHAIN}" = "clang-newlib" ]; then
- extra_args="--cc=${CC}"
- fi
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- extra_args+=" --arch=pnacl"
- elif [ "${NACL_ARCH}" = "arm" ]; then
- extra_args+=" --arch=arm"
- else
- extra_args+=" --arch=x86"
- fi
-
- LogExecute ${SRC_DIR}/configure \
- --cross-prefix=${NACL_CROSS_PREFIX}- \
- --target-os=linux \
- --enable-gpl \
- --enable-static \
- --enable-cross-compile \
- --disable-inline-asm \
- --disable-ssse3 \
- --disable-mmx \
- --disable-amd3dnow \
- --disable-amd3dnowext \
- --disable-indevs \
- --enable-libmp3lame \
- --enable-libvorbis \
- --enable-libtheora \
- --enable-libvpx \
- --disable-ffplay \
- --disable-ffserver \
- --disable-demuxer=rtsp \
- --disable-demuxer=image2 \
- --prefix=${PREFIX} \
- ${extra_args}
-}
-
-TestStep() {
- SetupCrossPaths
- LogExecute make testprogs
-}
diff --git a/ports/ffmpeg/nacl.patch b/ports/ffmpeg/nacl.patch
deleted file mode 100644
index d11c7ba..0000000
--- a/ports/ffmpeg/nacl.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -4761,7 +4761,13 @@ if ! disabled network; then
- fi
-
- check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
--check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
-+# Check for both __atomic_compare_exchange_n and __atomic_add_fetch since
-+# HAVE_ATOMIC_COMPARE_EXCHANGE should only be defined if both are present.
-+# Currently PNaCl supports __atomic_compare_exchange_n but not
-+# __atomic_add_fetch so testing for __atomic_compare_exchange_n was not
-+# enough.
-+# https://code.google.com/p/nativeclient/issues/detail?id=3941
-+check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); __atomic_add_fetch(ptr, 1, __ATOMIC_SEQ_CST)"
- check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
- check_builtin MemoryBarrier windows.h "MemoryBarrier()"
- check_builtin sarestart signal.h "SA_RESTART"
-diff --git a/ffmpeg.c b/ffmpeg.c
---- a/ffmpeg.c
-+++ b/ffmpeg.c
-@@ -3937,7 +3937,7 @@ static int transcode(void)
-
- static int64_t getutime(void)
- {
--#if HAVE_GETRUSAGE
-+#if HAVE_GETRUSAGE && !defined(__native_client__)
- struct rusage rusage;
-
- getrusage(RUSAGE_SELF, &rusage);
-@@ -3955,7 +3955,7 @@ static int64_t getutime(void)
-
- static int64_t getmaxrss(void)
- {
--#if HAVE_GETRUSAGE && HAVE_STRUCT_RUSAGE_RU_MAXRSS
-+#if HAVE_GETRUSAGE && HAVE_STRUCT_RUSAGE_RU_MAXRSS && !defined(__native_client__)
- struct rusage rusage;
- getrusage(RUSAGE_SELF, &rusage);
- return (int64_t)rusage.ru_maxrss * 1024;
diff --git a/ports/ffmpeg/pkg_info b/ports/ffmpeg/pkg_info
deleted file mode 100644
index 70d4816..0000000
--- a/ports/ffmpeg/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=ffmpeg
-VERSION=2.6.1
-URL=http://ffmpeg.org/releases/ffmpeg-2.6.1.tar.bz2
-LICENSE=GPL,LGPL
-CONFLICTS=(libav)
-# Disabled on arm due to non-optional arm in .S files.
-DISABLED_ARCH=(arm)
-DEPENDS=(lame libvorbis libtheora glibc-compat libvpx)
-SHA1=dfcd13e7c3e65a59cbe4cab85718ae84da824c5b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/fftw-float/build.sh b/ports/fftw-float/build.sh
deleted file mode 100644
index da33c72..0000000
--- a/ports/fftw-float/build.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2015 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.
-
-EXECUTABLES="tools/fftwf-wisdom${NACL_EXEEXT} tests/bench${NACL_EXEEXT}"
-
-EXTRA_CONFIGURE_ARGS="--enable-float"
-
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -fomit-frame-pointer -fstrict-aliasing \
- -fno-schedule-insns -ffast-math"
-
- # Workaround for arm-gcc bug:
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- # TODO(sbc): remove this once the issue is fixed
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-ConfigureStep() {
- SetupCrossEnvironment
-
- if [ ${NACL_ARCH} = "x86_64" -o ${NACL_ARCH} = "i686" ]; then
- EXTRA_CONFIGURE_ARGS+=" --enable-sse2"
- fi
-
- LogExecute ${SRC_DIR}/configure \
- --host=nacl \
- --prefix=${PREFIX} \
- --enable-threads \
- ${EXTRA_CONFIGURE_ARGS:-}
-}
-
-TestStep() {
- LogExecute make check EXEEXT=
-}
diff --git a/ports/fftw-float/nacl.patch b/ports/fftw-float/nacl.patch
deleted file mode 100644
index 1bd75ca..0000000
--- a/ports/fftw-float/nacl.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff --git a/simd-support/sse2.c b/simd-support/sse2.c
---- a/simd-support/sse2.c
-+++ b/simd-support/sse2.c
-@@ -52,6 +52,11 @@
-
- static int sse2_works(void)
- {
-+#ifdef __native_client__
-+ /* NaCl doesn't support signal() to test whether SSE2 works, so we
-+ * just trust cpuid when it says that SSE2 is supported */
-+ return 1;
-+#else
- void (*oldsig)(int);
- oldsig = signal(SIGILL, sighandler);
- if (setjmp(jb)) {
-@@ -68,6 +73,7 @@
- signal(SIGILL, oldsig);
- return 1;
- }
-+#endif
- }
-
- extern void X(check_alignment_of_sse2_pm)(void);
-diff --git a/simd-support/x86-cpuid.h b/simd-support/x86-cpuid.h
---- a/simd-support/x86-cpuid.h
-+++ b/simd-support/x86-cpuid.h
-@@ -29,6 +29,13 @@
-
- static inline int is_386()
- {
-+#ifdef __native_client__
-+ /* NaCl is not supported on 386 or any system that does not have the cpuid
-+ instruction. Furthermore, pushf/popf are illegal instructions. So we
-+ short-circuit these functions, returning false for is_386 and true for
-+ has_cpuid */
-+ return 0;
-+#else
- #ifdef _MSC_VER
- unsigned int result,tst;
- _asm {
-@@ -63,10 +70,14 @@ static inline int is_386()
- );
- #endif
- return (result == tst);
-+#endif
- }
-
- static inline int has_cpuid()
- {
-+#ifdef __native_client__
-+ return 1;
-+#else
- #ifdef _MSC_VER
- unsigned int result,tst;
- _asm {
-@@ -101,6 +112,7 @@ static inline int has_cpuid()
- );
- #endif
- return (result != tst);
-+#endif
- }
-
- static inline int cpuid_edx(int op)
-diff --git a/threads/threads.c b/threads/threads.c
---- a/threads/threads.c
-+++ b/threads/threads.c
-@@ -137,7 +137,11 @@ static void os_create_thread(FFTW_WORKER (*worker)(void *arg),
- pthread_t tid;
-
- pthread_attr_init(&attr);
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ // NaCl newlib doesn't define PTHREAD_SCOPE_SYSTEM.
-+ // See https://code.google.com/p/nativeclient/issues/detail?id=3721
- pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
-+#endif
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
- pthread_create(&tid, &attr, worker, (void *)arg);
diff --git a/ports/fftw-float/pkg_info b/ports/fftw-float/pkg_info
deleted file mode 100644
index aec8c88..0000000
--- a/ports/fftw-float/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=fftw-float
-VERSION=3.3.4
-ARCHIVE_ROOT=fftw-3.3.4
-URL=http://www.fftw.org/fftw-3.3.4.tar.gz
-CONFLICTS=(fftw)
-LICENSE=GPL
-DISABLED_TOOLCHAIN=(emscripten)
-SHA1=fd508bac8ac13b3a46152c54b7ac885b69734262
diff --git a/ports/fftw/build.sh b/ports/fftw/build.sh
deleted file mode 100644
index f92ca2c..0000000
--- a/ports/fftw/build.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="tools/fftw-wisdom${NACL_EXEEXT} tests/bench${NACL_EXEEXT}"
-
-# Without these CFLAGS fftw fails to build for ARM
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -fomit-frame-pointer -fstrict-aliasing \
- -fno-schedule-insns -ffast-math"
-
- # Workaround for arm-gcc bug:
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- # TODO(sbc): remove this once the issue is fixed
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-ConfigureStep() {
- SetupCrossEnvironment
-
- if [ ${NACL_ARCH} = "x86_64" -o ${NACL_ARCH} = "i686" ]; then
- EXTRA_CONFIGURE_ARGS+=" --enable-sse2"
- fi
-
- LogExecute ${SRC_DIR}/configure \
- --host=nacl \
- --prefix=${PREFIX} \
- --enable-threads \
- ${EXTRA_CONFIGURE_ARGS:-}
-}
-
-TestStep() {
- LogExecute make check EXEEXT=
-}
diff --git a/ports/fftw/nacl.patch b/ports/fftw/nacl.patch
deleted file mode 100644
index 1bd75ca..0000000
--- a/ports/fftw/nacl.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff --git a/simd-support/sse2.c b/simd-support/sse2.c
---- a/simd-support/sse2.c
-+++ b/simd-support/sse2.c
-@@ -52,6 +52,11 @@
-
- static int sse2_works(void)
- {
-+#ifdef __native_client__
-+ /* NaCl doesn't support signal() to test whether SSE2 works, so we
-+ * just trust cpuid when it says that SSE2 is supported */
-+ return 1;
-+#else
- void (*oldsig)(int);
- oldsig = signal(SIGILL, sighandler);
- if (setjmp(jb)) {
-@@ -68,6 +73,7 @@
- signal(SIGILL, oldsig);
- return 1;
- }
-+#endif
- }
-
- extern void X(check_alignment_of_sse2_pm)(void);
-diff --git a/simd-support/x86-cpuid.h b/simd-support/x86-cpuid.h
---- a/simd-support/x86-cpuid.h
-+++ b/simd-support/x86-cpuid.h
-@@ -29,6 +29,13 @@
-
- static inline int is_386()
- {
-+#ifdef __native_client__
-+ /* NaCl is not supported on 386 or any system that does not have the cpuid
-+ instruction. Furthermore, pushf/popf are illegal instructions. So we
-+ short-circuit these functions, returning false for is_386 and true for
-+ has_cpuid */
-+ return 0;
-+#else
- #ifdef _MSC_VER
- unsigned int result,tst;
- _asm {
-@@ -63,10 +70,14 @@ static inline int is_386()
- );
- #endif
- return (result == tst);
-+#endif
- }
-
- static inline int has_cpuid()
- {
-+#ifdef __native_client__
-+ return 1;
-+#else
- #ifdef _MSC_VER
- unsigned int result,tst;
- _asm {
-@@ -101,6 +112,7 @@ static inline int has_cpuid()
- );
- #endif
- return (result != tst);
-+#endif
- }
-
- static inline int cpuid_edx(int op)
-diff --git a/threads/threads.c b/threads/threads.c
---- a/threads/threads.c
-+++ b/threads/threads.c
-@@ -137,7 +137,11 @@ static void os_create_thread(FFTW_WORKER (*worker)(void *arg),
- pthread_t tid;
-
- pthread_attr_init(&attr);
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ // NaCl newlib doesn't define PTHREAD_SCOPE_SYSTEM.
-+ // See https://code.google.com/p/nativeclient/issues/detail?id=3721
- pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
-+#endif
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
- pthread_create(&tid, &attr, worker, (void *)arg);
diff --git a/ports/fftw/pkg_info b/ports/fftw/pkg_info
deleted file mode 100644
index 078ad7c..0000000
--- a/ports/fftw/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=fftw
-VERSION=3.3.4
-URL=http://www.fftw.org/fftw-3.3.4.tar.gz
-CONFLICTS=(fftw-float)
-LICENSE=GPL
-DISABLED_TOOLCHAIN=(emscripten)
-SHA1=fd508bac8ac13b3a46152c54b7ac885b69734262
diff --git a/ports/findutils/README.nacl b/ports/findutils/README.nacl
deleted file mode 100644
index d6d0991..0000000
--- a/ports/findutils/README.nacl
+++ /dev/null
@@ -1,36 +0,0 @@
-Major Changes for port findutils:
-1. disabled the check for mnttab
- changed gnulib/m4/ls-mntd-fs.m4
-
-2. fixed time_t related issue
-
- had an complie issue like this:
- >>getdate.y:118: negative width in bit-field
- >>`verify_error_if_negative_size__'
- >>The line in question is
- >>verify (LONG_MIN <= TYPE_MINIMUM (time_t)
- && TYPE_MAXIMUM (time_t) <= LONG_MAX);
- disabled this verify.
-
- also there is an complie error in gnulib/lib/mktime.c,
- fixed by getting the following files from the gnulib repo:
-
- http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=tree;f=lib; \
- h=c30852beffcfcdd47da3cfbd7af8cae7c950ad94; \
- hb=233419c39c6d13d84439b95766328a238ffb6518
-
- gnulib/lib/mktime.c
- gnulib/lib/mktime-internal.h gnulib/m4/mktime.m4
- Todo: We might need port gnulib in the future
-
-3. a few macro to make findutils include the header file in nacl include
- instead of header file in gnulib
-
-4. changed the link line in the make file
-
-5. find.c ftsfind.c added "nalc_main"
-
-6. comment out the mount logic in gnulib/lib/mountlist.c
-
-7. lib/buildcmd.c
- added macro _POSIX_ARG_MAX
diff --git a/ports/findutils/build.sh b/ports/findutils/build.sh
deleted file mode 100644
index 2d9ddf7..0000000
--- a/ports/findutils/build.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2015 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.
-
-export fu_cv_sys_mounted_fread=yes
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-EnableCliMain
-
-BuildStep() {
- export AR=${NACLAR}
- export RANLIB=${NACLRANLIB}
- DefaultBuildStep
-}
diff --git a/ports/findutils/nacl.patch b/ports/findutils/nacl.patch
deleted file mode 100644
index 6027e45..0000000
--- a/ports/findutils/nacl.patch
+++ /dev/null
@@ -1,1253 +0,0 @@
-diff --git a/find/Makefile.in b/find/Makefile.in
---- a/find/Makefile.in
-+++ b/find/Makefile.in
-@@ -198,7 +198,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
- CONFIG_HEADER = $(top_builddir)/config.h
- CONFIG_CLEAN_FILES =
- LIBRARIES = $(noinst_LIBRARIES)
--AR = ar
-+AR ?= ar
- ARFLAGS = cru
- libfindtools_a_AR = $(AR) $(ARFLAGS)
- libfindtools_a_LIBADD =
-diff --git a/find/ftsfind.c b/find/ftsfind.c
---- a/find/ftsfind.c
-+++ b/find/ftsfind.c
-@@ -74,7 +74,6 @@
- # define N_(String) String
- #endif
-
--
- static void set_close_on_exec(int fd)
- {
- #if defined F_GETFD && defined FD_CLOEXEC
-@@ -89,6 +88,75 @@ static void set_close_on_exec(int fd)
- }
-
-
-+#if defined (__native_client__) && defined(__GLIBC__) && !defined(__arm__)
-+// xgetcwd is pulled from toybox lib/xwrap.c
-+char *xgetcwd(void) {
-+ char *buf = (char*)malloc(sizeof(char) * (PATH_MAX+1));
-+ if (buf == NULL) {
-+ fprintf(stderr, "malloc failed\n");
-+ exit(1);
-+ }
-+ buf = getwd(buf);
-+ if (!buf) {
-+ perror("xgetcwd");
-+ exit(1);
-+ }
-+ return buf;
-+}
-+
-+// The following functions are pulled from toybox nacl.patch
-+#define _AT_WRAP_START(A) \
-+ int fchdir_err = 0; \
-+ char *save = xgetcwd(); \
-+ if (!save) { \
-+ perror("fd_wrapper_"A); \
-+ exit(1); \
-+ } \
-+ if (dirfd != AT_FDCWD) { \
-+ fchdir_err = fchdir(dirfd); \
-+ if (fchdir_err == -1) \
-+ perror("fchdir"); \
-+ }
-+
-+#define _AT_WRAP_END(A) \
-+ if (dirfd != AT_FDCWD) chdir(save); \
-+ free(save);
-+
-+int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags) {
-+ // We are going to ignore flags here.
-+ //if (flags) perror_exit("fstatat_flags");
-+ _AT_WRAP_START("fstatat")
-+ int result;
-+ if (flags & AT_SYMLINK_NOFOLLOW)
-+ result = lstat(pathname, buf);
-+ else
-+ result = stat(pathname, buf);
-+ _AT_WRAP_END("fstatat")
-+ return result;
-+}
-+
-+int openat(int dirfd, const char *pathname, int flags, ...) {
-+ _AT_WRAP_START("openat")
-+ int fd = open(pathname, flags);
-+ _AT_WRAP_END("openat")
-+ return fd;
-+}
-+
-+int unlinkat(int dirfd, const char *pathname, int flags) {
-+ // We are going to ignore flags here.
-+ //if (flags) perror_exit("unlinkat_flags");
-+ _AT_WRAP_START("unlinkat")
-+ int result;
-+ if(flags & AT_REMOVEDIR) {
-+ result = rmdir(pathname);
-+ } else {
-+ result = unlink(pathname);
-+ }
-+ _AT_WRAP_END("unlinkat")
-+ return result;
-+}
-+#endif
-+
-
- /* FTS_TIGHT_CYCLE_CHECK tries to work around Savannah bug #17877
- * (but actually using it doesn't fix the bug).
-diff --git a/find/pred.c b/find/pred.c
---- a/find/pred.c
-+++ b/find/pred.c
-@@ -24,6 +24,7 @@
- #include <math.h>
- #include <pwd.h>
- #include <grp.h>
-+#include <spawn.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <errno.h>
-@@ -1948,7 +1949,7 @@ launch (const struct buildcmd_control *ctl,
- signal (SIGCHLD, SIG_DFL);
- }
-
-- child_pid = fork ();
-+ child_pid = vfork ();
- if (child_pid == -1)
- error (1, errno, _("cannot fork"));
- if (child_pid == 0)
-diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
---- a/gnulib/lib/Makefile.am
-+++ b/gnulib/lib/Makefile.am
-@@ -858,7 +858,7 @@ EXTRA_libgnulib_a_SOURCES += memset.c
- ## begin gnulib module mktime
-
-
--EXTRA_DIST += mktime.c
-+EXTRA_DIST += mktime-internal.h mktime.c
-
- EXTRA_libgnulib_a_SOURCES += mktime.c
-
-diff --git a/gnulib/lib/Makefile.in b/gnulib/lib/Makefile.in
---- a/gnulib/lib/Makefile.in
-+++ b/gnulib/lib/Makefile.in
-@@ -209,7 +209,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
- CONFIG_HEADER = $(top_builddir)/config.h
- CONFIG_CLEAN_FILES =
- LIBRARIES = $(noinst_LIBRARIES)
--AR = ar
-+AR ?= ar
- ARFLAGS = cru
- libgnulib_a_AR = $(AR) $(ARFLAGS)
- am__DEPENDENCIES_1 =
-@@ -609,7 +609,7 @@ EXTRA_DIST = alloca.c alloca.in.h areadlink.h argmatch.c argmatch.h \
- $(top_srcdir)/build-aux/link-warning.h config.charset \
- ref-add.sin ref-del.sin lseek.c lstat.c lstat.h malloc.c \
- malloc.c malloca.h malloca.valgrind mbchar.h memchr.c memcmp.c \
-- mempcpy.c memrchr.c memset.c mktime.c modechange.c \
-+ mempcpy.c memrchr.c memset.c mktime-internal.h mktime.c modechange.c \
- modechange.h mountlist.c mountlist.h at-func.c fchmodat.c \
- fchownat.c fstatat.c mkdirat.c openat-priv.h openat-proc.c \
- openat.c openat.h pathmax.h quote.c quote.h quotearg.c \
-diff --git a/gnulib/lib/fpending.c b/gnulib/lib/fpending.c
---- a/gnulib/lib/fpending.c
-+++ b/gnulib/lib/fpending.c
-@@ -22,8 +22,14 @@
-
- /* Return the number of pending (aka buffered, unflushed)
- bytes on the stream, FP, that is open for writing. */
-+
-+/* we already have __fpending x86_64-nacl/include/stdio_ext.h
-+ Add thess two macro, otherwise we will get
-+ redefinition of ‘__fpending’ error */
-+#if !defined(__native_client__)
- size_t
- __fpending (FILE *fp)
- {
- return PENDING_OUTPUT_N_BYTES;
- }
-+#endif
-\ No newline at end of file
-diff --git a/gnulib/lib/getdate.y b/gnulib/lib/getdate.y
---- a/gnulib/lib/getdate.y
-+++ b/gnulib/lib/getdate.y
-@@ -114,7 +114,9 @@
- wraps around, but there's no portable way to check for that at
- compile-time. */
- verify (TYPE_IS_INTEGER (time_t));
-+#if !defined(__native_client__)
- verify (LONG_MIN <= TYPE_MINIMUM (time_t) && TYPE_MAXIMUM (time_t) <= LONG_MAX);
-+#endif
-
- /* An integer value, and the number of digits in its textual
- representation. */
-diff --git a/gnulib/lib/mktime-internal.h b/gnulib/lib/mktime-internal.h
-new file mode 100644
---- /dev/null
-+++ b/gnulib/lib/mktime-internal.h
-@@ -0,0 +1,4 @@
-+#include <time.h>
-+time_t mktime_internal (struct tm *,
-+ struct tm * (*) (time_t const *, struct tm *),
-+ time_t *);
-\ No newline at end of file
-diff --git a/gnulib/lib/mktime.c b/gnulib/lib/mktime.c
---- a/gnulib/lib/mktime.c
-+++ b/gnulib/lib/mktime.c
-@@ -1,21 +1,21 @@
--/* Convert a `struct tm' to a time_t value.
-- Copyright (C) 1993-1999, 2002-2005, 2006, 2007 Free Software Foundation, Inc.
-+/* Convert a 'struct tm' to a time_t value.
-+ Copyright (C) 1993-2015 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Eggert <eggert@twinsun.com>.
-
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3, or (at your option)
-- any later version.
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-
-- This program is distributed in the hope that it will be useful,
-+ The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-
-- You should have received a copy of the GNU General Public License along
-- with this program; if not, write to the Free Software Foundation,
-- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, see
-+ <http://www.gnu.org/licenses/>. */
-
- /* Define this to have a standalone program to test this implementation of
- mktime. */
-@@ -26,7 +26,7 @@
- #endif
-
- /* Assume that leap seconds are possible, unless told otherwise.
-- If the host has a `zic' command with a `-L leapsecondfilename' option,
-+ If the host has a 'zic' command with a '-L leapsecondfilename' option,
- then it supports leap seconds; otherwise it probably doesn't. */
- #ifndef LEAP_SECONDS_POSSIBLE
- # define LEAP_SECONDS_POSSIBLE 1
-@@ -36,15 +36,49 @@
-
- #include <limits.h>
-
--#include <string.h> /* For the real memcpy prototype. */
-+#include <string.h> /* For the real memcpy prototype. */
-
--#if DEBUG
-+#if defined DEBUG && DEBUG
- # include <stdio.h>
- # include <stdlib.h>
- /* Make it work even if the system's libc has its own mktime routine. */
-+# undef mktime
- # define mktime my_mktime
- #endif /* DEBUG */
-
-+/* Some of the code in this file assumes that signed integer overflow
-+ silently wraps around. This assumption can't easily be programmed
-+ around, nor can it be checked for portably at compile-time or
-+ easily eliminated at run-time.
-+
-+ Define WRAPV to 1 if the assumption is valid and if
-+ #pragma GCC optimize ("wrapv")
-+ does not trigger GCC bug 51793
-+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51793>.
-+ Otherwise, define it to 0; this forces the use of slower code that,
-+ while not guaranteed by the C Standard, works on all production
-+ platforms that we know about. */
-+#ifndef WRAPV
-+# if (((__GNUC__ == 4 && 4 <= __GNUC_MINOR__) || 4 < __GNUC__) \
-+ && defined __GLIBC__)
-+# pragma GCC optimize ("wrapv")
-+# define WRAPV 1
-+# else
-+# define WRAPV 0
-+# endif
-+#endif
-+
-+/* Verify a requirement at compile-time (unlike assert, which is runtime). */
-+#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
-+
-+/* A signed type that is at least one bit wider than int. */
-+#if INT_MAX <= LONG_MAX / 2
-+typedef long int long_int;
-+#else
-+typedef long long int long_int;
-+#endif
-+verify (long_int_is_wide_enough, INT_MAX == INT_MAX * (long_int) 2 / 2);
-+
- /* Shift A right by B bits portably, by dividing A by 2**B and
- truncating towards minus infinity. A and B should be free of side
- effects, and B should be in the range 0 <= B <= INT_BITS - 2, where
-@@ -55,9 +89,11 @@
- implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift
- right in the usual way when A < 0, so SHR falls back on division if
- ordinary A >> B doesn't seem to be the usual signed shift. */
--#define SHR(a, b) \
-- (-1 >> 1 == -1 \
-- ? (a) >> (b) \
-+#define SHR(a, b) \
-+ ((-1 >> 1 == -1 \
-+ && (long_int) -1 >> 1 == -1 \
-+ && ((time_t) -1 >> 1 == -1 || ! TYPE_SIGNED (time_t))) \
-+ ? (a) >> (b) \
- : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0))
-
- /* The extra casts in the following macros work around compiler bugs,
-@@ -68,12 +104,8 @@
- #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
-
- /* True if negative values of the signed integer type T use two's
-- complement, ones' complement, or signed magnitude representation,
-- respectively. Much GNU code assumes two's complement, but some
-- people like to be portable to all possible C hosts. */
-+ complement, or if T is an unsigned integer type. */
- #define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
--#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
--#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
-
- /* True if the arithmetic type T is signed. */
- #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
-@@ -84,14 +116,12 @@
- your host. */
- #define TYPE_MINIMUM(t) \
- ((t) (! TYPE_SIGNED (t) \
-- ? (t) 0 \
-- : TYPE_SIGNED_MAGNITUDE (t) \
-- ? ~ (t) 0 \
-- : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
-+ ? (t) 0 \
-+ : ~ TYPE_MAXIMUM (t)))
- #define TYPE_MAXIMUM(t) \
- ((t) (! TYPE_SIGNED (t) \
-- ? (t) -1 \
-- : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
-+ ? (t) -1 \
-+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
-
- #ifndef TIME_T_MIN
- # define TIME_T_MIN TYPE_MINIMUM (time_t)
-@@ -101,29 +131,26 @@
- #endif
- #define TIME_T_MIDPOINT (SHR (TIME_T_MIN + TIME_T_MAX, 1) + 1)
-
--/* Verify a requirement at compile-time (unlike assert, which is runtime). */
--#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
--
- verify (time_t_is_integer, TYPE_IS_INTEGER (time_t));
--verify (twos_complement_arithmetic, TYPE_TWOS_COMPLEMENT (int));
--/* The code also assumes that signed integer overflow silently wraps
-- around, but this assumption can't be stated without causing a
-- diagnostic on some hosts. */
-+verify (twos_complement_arithmetic,
-+ (TYPE_TWOS_COMPLEMENT (int)
-+ && TYPE_TWOS_COMPLEMENT (long_int)
-+ && TYPE_TWOS_COMPLEMENT (time_t)));
-
- #define EPOCH_YEAR 1970
- #define TM_YEAR_BASE 1900
- verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0);
-
- /* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */
--static inline int
--leapyear (long int year)
-+static int
-+leapyear (long_int year)
- {
- /* Don't add YEAR to TM_YEAR_BASE, as that might overflow.
- Also, work even if YEAR is negative. */
- return
- ((year & 3) == 0
- && (year % 100 != 0
-- || ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3)));
-+ || ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3)));
- }
-
- /* How many days come before each month (0-12). */
-@@ -147,8 +174,17 @@ const unsigned short int __mon_yday[2][13] =
- # undef __localtime_r
- # define __localtime_r localtime_r
- # define __mktime_internal mktime_internal
-+# include "mktime-internal.h"
- #endif
-
-+/* Return 1 if the values A and B differ according to the rules for
-+ tm_isdst: A and B differ if one is zero and the other positive. */
-+static int
-+isdst_differ (int a, int b)
-+{
-+ return (!a != !b) && (0 <= a) && (0 <= b);
-+}
-+
- /* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
- (YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks
- were not adjusted between the time stamps.
-@@ -160,13 +196,11 @@ const unsigned short int __mon_yday[2][13] =
- The result may overflow. It is the caller's responsibility to
- detect overflow. */
-
--static inline time_t
--ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1,
-- int year0, int yday0, int hour0, int min0, int sec0)
-+static time_t
-+ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
-+ int year0, int yday0, int hour0, int min0, int sec0)
- {
- verify (C99_integer_division, -1 / 2 == 0);
-- verify (long_int_year_and_yday_are_wide_enough,
-- INT_MAX <= LONG_MAX / 2 || TIME_T_MAX <= UINT_MAX);
-
- /* Compute intervening leap days correctly even if year is negative.
- Take care to avoid integer overflow here. */
-@@ -189,6 +223,53 @@ ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1,
- return seconds;
- }
-
-+/* Return the average of A and B, even if A + B would overflow. */
-+static time_t
-+time_t_avg (time_t a, time_t b)
-+{
-+ return SHR (a, 1) + SHR (b, 1) + (a & b & 1);
-+}
-+
-+/* Return 1 if A + B does not overflow. If time_t is unsigned and if
-+ B's top bit is set, assume that the sum represents A - -B, and
-+ return 1 if the subtraction does not wrap around. */
-+static int
-+time_t_add_ok (time_t a, time_t b)
-+{
-+ if (! TYPE_SIGNED (time_t))
-+ {
-+ time_t sum = a + b;
-+ return (sum < a) == (TIME_T_MIDPOINT <= b);
-+ }
-+ else if (WRAPV)
-+ {
-+ time_t sum = a + b;
-+ return (sum < a) == (b < 0);
-+ }
-+ else
-+ {
-+ time_t avg = time_t_avg (a, b);
-+ return TIME_T_MIN / 2 <= avg && avg <= TIME_T_MAX / 2;
-+ }
-+}
-+
-+/* Return 1 if A + B does not overflow. */
-+static int
-+time_t_int_add_ok (time_t a, int b)
-+{
-+ verify (int_no_wider_than_time_t, INT_MAX <= TIME_T_MAX);
-+ if (WRAPV)
-+ {
-+ time_t sum = a + b;
-+ return (sum < a) == (b < 0);
-+ }
-+ else
-+ {
-+ int a_odd = a & 1;
-+ time_t avg = SHR (a, 1) + (SHR (b, 1) + (a_odd & b));
-+ return TIME_T_MIN / 2 <= avg && avg <= TIME_T_MAX / 2;
-+ }
-+}
-
- /* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC),
- assuming that *T corresponds to *TP and that no clock adjustments
-@@ -197,17 +278,16 @@ ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1,
- If overflow occurs, yield the minimal or maximal value, except do not
- yield a value equal to *T. */
- static time_t
--guess_time_tm (long int year, long int yday, int hour, int min, int sec,
-- const time_t *t, const struct tm *tp)
-+guess_time_tm (long_int year, long_int yday, int hour, int min, int sec,
-+ const time_t *t, const struct tm *tp)
- {
- if (tp)
- {
- time_t d = ydhms_diff (year, yday, hour, min, sec,
-- tp->tm_year, tp->tm_yday,
-- tp->tm_hour, tp->tm_min, tp->tm_sec);
-- time_t t1 = *t + d;
-- if ((t1 < *t) == (TYPE_SIGNED (time_t) ? d < 0 : TIME_T_MAX / 2 < d))
-- return t1;
-+ tp->tm_year, tp->tm_yday,
-+ tp->tm_hour, tp->tm_min, tp->tm_sec);
-+ if (time_t_add_ok (*t, d))
-+ return *t + d;
- }
-
- /* Overflow occurred one way or another. Return the nearest result
-@@ -216,8 +296,8 @@ guess_time_tm (long int year, long int yday, int hour, int min, int sec,
- match; and don't oscillate between two values, as that would
- confuse the spring-forward gap detector. */
- return (*t < TIME_T_MIDPOINT
-- ? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN)
-- : (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX));
-+ ? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN)
-+ : (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX));
- }
-
- /* Use CONVERT to convert *T to a broken down time in *TP.
-@@ -225,7 +305,7 @@ guess_time_tm (long int year, long int yday, int hour, int min, int sec,
- it is the nearest in-range value and then convert that. */
- static struct tm *
- ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
-- time_t *t, struct tm *tp)
-+ time_t *t, struct tm *tp)
- {
- struct tm *r = convert (t, tp);
-
-@@ -235,27 +315,25 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
- time_t ok = 0;
-
- /* BAD is a known unconvertible time_t, and OK is a known good one.
-- Use binary search to narrow the range between BAD and OK until
-- they differ by 1. */
-+ Use binary search to narrow the range between BAD and OK until
-+ they differ by 1. */
- while (bad != ok + (bad < 0 ? -1 : 1))
-- {
-- time_t mid = *t = (bad < 0
-- ? bad + ((ok - bad) >> 1)
-- : ok + ((bad - ok) >> 1));
-- r = convert (t, tp);
-- if (r)
-- ok = mid;
-- else
-- bad = mid;
-- }
-+ {
-+ time_t mid = *t = time_t_avg (ok, bad);
-+ r = convert (t, tp);
-+ if (r)
-+ ok = mid;
-+ else
-+ bad = mid;
-+ }
-
- if (!r && ok)
-- {
-- /* The last conversion attempt failed;
-- revert to the most recent successful attempt. */
-- *t = ok;
-- r = convert (t, tp);
-- }
-+ {
-+ /* The last conversion attempt failed;
-+ revert to the most recent successful attempt. */
-+ *t = ok;
-+ r = convert (t, tp);
-+ }
- }
-
- return r;
-@@ -270,8 +348,8 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
- This function is external because it is used also by timegm.c. */
- time_t
- __mktime_internal (struct tm *tp,
-- struct tm *(*convert) (const time_t *, struct tm *),
-- time_t *offset)
-+ struct tm *(*convert) (const time_t *, struct tm *),
-+ time_t *offset)
- {
- time_t t, gt, t0, t1, t2;
- struct tm tm;
-@@ -299,8 +377,8 @@ __mktime_internal (struct tm *tp,
- int mon_remainder = mon % 12;
- int negative_mon_remainder = mon_remainder < 0;
- int mon_years = mon / 12 - negative_mon_remainder;
-- long int lyear_requested = year_requested;
-- long int year = lyear_requested + mon_years;
-+ long_int lyear_requested = year_requested;
-+ long_int year = lyear_requested + mon_years;
-
- /* The other values need not be in range:
- the remaining code handles minor overflows correctly,
-@@ -310,10 +388,10 @@ __mktime_internal (struct tm *tp,
- /* Calculate day of year from year, month, and day of month.
- The result need not be in range. */
- int mon_yday = ((__mon_yday[leapyear (year)]
-- [mon_remainder + 12 * negative_mon_remainder])
-- - 1);
-- long int lmday = mday;
-- long int yday = mon_yday + lmday;
-+ [mon_remainder + 12 * negative_mon_remainder])
-+ - 1);
-+ long_int lmday = mday;
-+ long_int yday = mon_yday + lmday;
-
- time_t guessed_offset = *offset;
-
-@@ -322,33 +400,33 @@ __mktime_internal (struct tm *tp,
- if (LEAP_SECONDS_POSSIBLE)
- {
- /* Handle out-of-range seconds specially,
-- since ydhms_tm_diff assumes every minute has 60 seconds. */
-+ since ydhms_tm_diff assumes every minute has 60 seconds. */
- if (sec < 0)
-- sec = 0;
-+ sec = 0;
- if (59 < sec)
-- sec = 59;
-+ sec = 59;
- }
-
- /* Invert CONVERT by probing. First assume the same offset as last
- time. */
-
- t0 = ydhms_diff (year, yday, hour, min, sec,
-- EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, - guessed_offset);
-+ EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, - guessed_offset);
-
- if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3)
- {
- /* time_t isn't large enough to rule out overflows, so check
-- for major overflows. A gross check suffices, since if t0
-- has overflowed, it is off by a multiple of TIME_T_MAX -
-- TIME_T_MIN + 1. So ignore any component of the difference
-- that is bounded by a small value. */
-+ for major overflows. A gross check suffices, since if t0
-+ has overflowed, it is off by a multiple of TIME_T_MAX -
-+ TIME_T_MIN + 1. So ignore any component of the difference
-+ that is bounded by a small value. */
-
- /* Approximate log base 2 of the number of time units per
-- biennium. A biennium is 2 years; use this unit instead of
-- years to avoid integer overflow. For example, 2 average
-- Gregorian years are 2 * 365.2425 * 24 * 60 * 60 seconds,
-- which is 63113904 seconds, and rint (log2 (63113904)) is
-- 26. */
-+ biennium. A biennium is 2 years; use this unit instead of
-+ years to avoid integer overflow. For example, 2 average
-+ Gregorian years are 2 * 365.2425 * 24 * 60 * 60 seconds,
-+ which is 63113904 seconds, and rint (log2 (63113904)) is
-+ 26. */
- int ALOG2_SECONDS_PER_BIENNIUM = 26;
- int ALOG2_MINUTES_PER_BIENNIUM = 20;
- int ALOG2_HOURS_PER_BIENNIUM = 14;
-@@ -356,119 +434,117 @@ __mktime_internal (struct tm *tp,
- int LOG2_YEARS_PER_BIENNIUM = 1;
-
- int approx_requested_biennia =
-- (SHR (year_requested, LOG2_YEARS_PER_BIENNIUM)
-- - SHR (EPOCH_YEAR - TM_YEAR_BASE, LOG2_YEARS_PER_BIENNIUM)
-- + SHR (mday, ALOG2_DAYS_PER_BIENNIUM)
-- + SHR (hour, ALOG2_HOURS_PER_BIENNIUM)
-- + SHR (min, ALOG2_MINUTES_PER_BIENNIUM)
-- + (LEAP_SECONDS_POSSIBLE
-- ? 0
-- : SHR (sec, ALOG2_SECONDS_PER_BIENNIUM)));
-+ (SHR (year_requested, LOG2_YEARS_PER_BIENNIUM)
-+ - SHR (EPOCH_YEAR - TM_YEAR_BASE, LOG2_YEARS_PER_BIENNIUM)
-+ + SHR (mday, ALOG2_DAYS_PER_BIENNIUM)
-+ + SHR (hour, ALOG2_HOURS_PER_BIENNIUM)
-+ + SHR (min, ALOG2_MINUTES_PER_BIENNIUM)
-+ + (LEAP_SECONDS_POSSIBLE
-+ ? 0
-+ : SHR (sec, ALOG2_SECONDS_PER_BIENNIUM)));
-
- int approx_biennia = SHR (t0, ALOG2_SECONDS_PER_BIENNIUM);
- int diff = approx_biennia - approx_requested_biennia;
-- int abs_diff = diff < 0 ? - diff : diff;
-+ int approx_abs_diff = diff < 0 ? -1 - diff : diff;
-
-- /* IRIX 4.0.5 cc miscaculates TIME_T_MIN / 3: it erroneously
-- gives a positive value of 715827882. Setting a variable
-- first then doing math on it seems to work.
-- (ghazi@caip.rutgers.edu) */
-+ /* IRIX 4.0.5 cc miscalculates TIME_T_MIN / 3: it erroneously
-+ gives a positive value of 715827882. Setting a variable
-+ first then doing math on it seems to work.
-+ (ghazi@caip.rutgers.edu) */
- time_t time_t_max = TIME_T_MAX;
- time_t time_t_min = TIME_T_MIN;
- time_t overflow_threshold =
-- (time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM;
--
-- if (overflow_threshold < abs_diff)
-- {
-- /* Overflow occurred. Try repairing it; this might work if
-- the time zone offset is enough to undo the overflow. */
-- time_t repaired_t0 = -1 - t0;
-- approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM);
-- diff = approx_biennia - approx_requested_biennia;
-- abs_diff = diff < 0 ? - diff : diff;
-- if (overflow_threshold < abs_diff)
-- return -1;
-- guessed_offset += repaired_t0 - t0;
-- t0 = repaired_t0;
-- }
-+ (time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM;
-+
-+ if (overflow_threshold < approx_abs_diff)
-+ {
-+ /* Overflow occurred. Try repairing it; this might work if
-+ the time zone offset is enough to undo the overflow. */
-+ time_t repaired_t0 = -1 - t0;
-+ approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM);
-+ diff = approx_biennia - approx_requested_biennia;
-+ approx_abs_diff = diff < 0 ? -1 - diff : diff;
-+ if (overflow_threshold < approx_abs_diff)
-+ return -1;
-+ guessed_offset += repaired_t0 - t0;
-+ t0 = repaired_t0;
-+ }
- }
-
- /* Repeatedly use the error to improve the guess. */
-
- for (t = t1 = t2 = t0, dst2 = 0;
- (gt = guess_time_tm (year, yday, hour, min, sec, &t,
-- ranged_convert (convert, &t, &tm)),
-- t != gt);
-+ ranged_convert (convert, &t, &tm)),
-+ t != gt);
- t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0)
- if (t == t1 && t != t2
-- && (tm.tm_isdst < 0
-- || (isdst < 0
-- ? dst2 <= (tm.tm_isdst != 0)
-- : (isdst != 0) != (tm.tm_isdst != 0))))
-+ && (tm.tm_isdst < 0
-+ || (isdst < 0
-+ ? dst2 <= (tm.tm_isdst != 0)
-+ : (isdst != 0) != (tm.tm_isdst != 0))))
- /* We can't possibly find a match, as we are oscillating
-- between two values. The requested time probably falls
-- within a spring-forward gap of size GT - T. Follow the common
-- practice in this case, which is to return a time that is GT - T
-- away from the requested time, preferring a time whose
-- tm_isdst differs from the requested value. (If no tm_isdst
-- was requested and only one of the two values has a nonzero
-- tm_isdst, prefer that value.) In practice, this is more
-- useful than returning -1. */
-+ between two values. The requested time probably falls
-+ within a spring-forward gap of size GT - T. Follow the common
-+ practice in this case, which is to return a time that is GT - T
-+ away from the requested time, preferring a time whose
-+ tm_isdst differs from the requested value. (If no tm_isdst
-+ was requested and only one of the two values has a nonzero
-+ tm_isdst, prefer that value.) In practice, this is more
-+ useful than returning -1. */
- goto offset_found;
- else if (--remaining_probes == 0)
- return -1;
-
- /* We have a match. Check whether tm.tm_isdst has the requested
- value, if any. */
-- if (isdst != tm.tm_isdst && 0 <= isdst && 0 <= tm.tm_isdst)
-+ if (isdst_differ (isdst, tm.tm_isdst))
- {
- /* tm.tm_isdst has the wrong value. Look for a neighboring
-- time with the right value, and use its UTC offset.
-+ time with the right value, and use its UTC offset.
-
-- Heuristic: probe the adjacent timestamps in both directions,
-- looking for the desired isdst. This should work for all real
-- time zone histories in the tz database. */
-+ Heuristic: probe the adjacent timestamps in both directions,
-+ looking for the desired isdst. This should work for all real
-+ time zone histories in the tz database. */
-
- /* Distance between probes when looking for a DST boundary. In
-- tzdata2003a, the shortest period of DST is 601200 seconds
-- (e.g., America/Recife starting 2000-10-08 01:00), and the
-- shortest period of non-DST surrounded by DST is 694800
-- seconds (Africa/Tunis starting 1943-04-17 01:00). Use the
-- minimum of these two values, so we don't miss these short
-- periods when probing. */
-+ tzdata2003a, the shortest period of DST is 601200 seconds
-+ (e.g., America/Recife starting 2000-10-08 01:00), and the
-+ shortest period of non-DST surrounded by DST is 694800
-+ seconds (Africa/Tunis starting 1943-04-17 01:00). Use the
-+ minimum of these two values, so we don't miss these short
-+ periods when probing. */
- int stride = 601200;
-
- /* The longest period of DST in tzdata2003a is 536454000 seconds
-- (e.g., America/Jujuy starting 1946-10-01 01:00). The longest
-- period of non-DST is much longer, but it makes no real sense
-- to search for more than a year of non-DST, so use the DST
-- max. */
-+ (e.g., America/Jujuy starting 1946-10-01 01:00). The longest
-+ period of non-DST is much longer, but it makes no real sense
-+ to search for more than a year of non-DST, so use the DST
-+ max. */
- int duration_max = 536454000;
-
- /* Search in both directions, so the maximum distance is half
-- the duration; add the stride to avoid off-by-1 problems. */
-+ the duration; add the stride to avoid off-by-1 problems. */
- int delta_bound = duration_max / 2 + stride;
-
- int delta, direction;
-
- for (delta = stride; delta < delta_bound; delta += stride)
-- for (direction = -1; direction <= 1; direction += 2)
-- {
-- time_t ot = t + delta * direction;
-- if ((ot < t) == (direction < 0))
-- {
-- struct tm otm;
-- ranged_convert (convert, &ot, &otm);
-- if (otm.tm_isdst == isdst)
-- {
-- /* We found the desired tm_isdst.
-- Extrapolate back to the desired time. */
-- t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm);
-- ranged_convert (convert, &t, &tm);
-- goto offset_found;
-- }
-- }
-- }
-+ for (direction = -1; direction <= 1; direction += 2)
-+ if (time_t_int_add_ok (t, delta * direction))
-+ {
-+ time_t ot = t + delta * direction;
-+ struct tm otm;
-+ ranged_convert (convert, &ot, &otm);
-+ if (! isdst_differ (isdst, otm.tm_isdst))
-+ {
-+ /* We found the desired tm_isdst.
-+ Extrapolate back to the desired time. */
-+ t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm);
-+ ranged_convert (convert, &t, &tm);
-+ goto offset_found;
-+ }
-+ }
- }
-
- offset_found:
-@@ -477,14 +553,16 @@ __mktime_internal (struct tm *tp,
- if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec)
- {
- /* Adjust time to reflect the tm_sec requested, not the normalized value.
-- Also, repair any damage from a false match due to a leap second. */
-+ Also, repair any damage from a false match due to a leap second. */
- int sec_adjustment = (sec == 0 && tm.tm_sec == 60) - sec;
-+ if (! time_t_int_add_ok (t, sec_requested))
-+ return -1;
- t1 = t + sec_requested;
-+ if (! time_t_int_add_ok (t1, sec_adjustment))
-+ return -1;
- t2 = t1 + sec_adjustment;
-- if (((t1 < t) != (sec_requested < 0))
-- | ((t2 < t1) != (sec_adjustment < 0))
-- | ! convert (&t2, &tm))
-- return -1;
-+ if (! convert (&t2, &tm))
-+ return -1;
- t = t2;
- }
-
-@@ -505,7 +583,7 @@ mktime (struct tm *tp)
- {
- #ifdef _LIBC
- /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
-- time zone names contained in the external variable `tzname' shall
-+ time zone names contained in the external variable 'tzname' shall
- be set as if the tzset() function had been called. */
- __tzset ();
- #endif
-@@ -522,19 +600,19 @@ libc_hidden_def (mktime)
- libc_hidden_weak (timelocal)
- #endif
-
--#if DEBUG
-+#if defined DEBUG && DEBUG
-
- static int
- not_equal_tm (const struct tm *a, const struct tm *b)
- {
- return ((a->tm_sec ^ b->tm_sec)
-- | (a->tm_min ^ b->tm_min)
-- | (a->tm_hour ^ b->tm_hour)
-- | (a->tm_mday ^ b->tm_mday)
-- | (a->tm_mon ^ b->tm_mon)
-- | (a->tm_year ^ b->tm_year)
-- | (a->tm_yday ^ b->tm_yday)
-- | (a->tm_isdst ^ b->tm_isdst));
-+ | (a->tm_min ^ b->tm_min)
-+ | (a->tm_hour ^ b->tm_hour)
-+ | (a->tm_mday ^ b->tm_mday)
-+ | (a->tm_mon ^ b->tm_mon)
-+ | (a->tm_year ^ b->tm_year)
-+ | (a->tm_yday ^ b->tm_yday)
-+ | isdst_differ (a->tm_isdst, b->tm_isdst));
- }
-
- static void
-@@ -542,9 +620,9 @@ print_tm (const struct tm *tp)
- {
- if (tp)
- printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d",
-- tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
-- tp->tm_hour, tp->tm_min, tp->tm_sec,
-- tp->tm_yday, tp->tm_wday, tp->tm_isdst);
-+ tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
-+ tp->tm_hour, tp->tm_min, tp->tm_sec,
-+ tp->tm_yday, tp->tm_wday, tp->tm_isdst);
- else
- printf ("0");
- }
-@@ -576,11 +654,11 @@ main (int argc, char **argv)
-
- if ((argc == 3 || argc == 4)
- && (sscanf (argv[1], "%d-%d-%d%c",
-- &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
-- == 3)
-+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
-+ == 3)
- && (sscanf (argv[2], "%d:%d:%d%c",
-- &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
-- == 3))
-+ &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
-+ == 3))
- {
- tm.tm_year -= TM_YEAR_BASE;
- tm.tm_mon--;
-@@ -589,10 +667,10 @@ main (int argc, char **argv)
- tl = mktime (&tmk);
- lt = localtime (&tl);
- if (lt)
-- {
-- tml = *lt;
-- lt = &tml;
-- }
-+ {
-+ tml = *lt;
-+ lt = &tml;
-+ }
- printf ("mktime returns %ld == ", (long int) tl);
- print_tm (&tmk);
- printf ("\n");
-@@ -605,51 +683,51 @@ main (int argc, char **argv)
- time_t to = atol (argv[3]);
-
- if (argc == 4)
-- for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
-- {
-- lt = localtime (&tl);
-- if (lt)
-- {
-- tmk = tml = *lt;
-- tk = mktime (&tmk);
-- status |= check_result (tk, tmk, tl, &tml);
-- }
-- else
-- {
-- printf ("localtime (%ld) yields 0\n", (long int) tl);
-- status = 1;
-- }
-- tl1 = tl + by;
-- if ((tl1 < tl) != (by < 0))
-- break;
-- }
-+ for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
-+ {
-+ lt = localtime (&tl);
-+ if (lt)
-+ {
-+ tmk = tml = *lt;
-+ tk = mktime (&tmk);
-+ status |= check_result (tk, tmk, tl, &tml);
-+ }
- else
-- for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
-- {
-- /* Null benchmark. */
-- lt = localtime (&tl);
-- if (lt)
-- {
-- tmk = tml = *lt;
-- tk = tl;
-- status |= check_result (tk, tmk, tl, &tml);
-- }
-- else
-- {
-- printf ("localtime (%ld) yields 0\n", (long int) tl);
-- status = 1;
-- }
-- tl1 = tl + by;
-- if ((tl1 < tl) != (by < 0))
-- break;
-- }
-+ {
-+ printf ("localtime (%ld) yields 0\n", (long int) tl);
-+ status = 1;
-+ }
-+ tl1 = tl + by;
-+ if ((tl1 < tl) != (by < 0))
-+ break;
-+ }
-+ else
-+ for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
-+ {
-+ /* Null benchmark. */
-+ lt = localtime (&tl);
-+ if (lt)
-+ {
-+ tmk = tml = *lt;
-+ tk = tl;
-+ status |= check_result (tk, tmk, tl, &tml);
-+ }
-+ else
-+ {
-+ printf ("localtime (%ld) yields 0\n", (long int) tl);
-+ status = 1;
-+ }
-+ tl1 = tl + by;
-+ if ((tl1 < tl) != (by < 0))
-+ break;
-+ }
- }
- else
- printf ("Usage:\
- \t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\
- \t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\
- \t%s FROM BY TO - # Do not test those values (for benchmark).\n",
-- argv[0], argv[0], argv[0]);
-+ argv[0], argv[0], argv[0]);
-
- return status;
- }
-@@ -658,6 +736,6 @@ main (int argc, char **argv)
-
- /*
- Local Variables:
--compile-command: "gcc -DDEBUG -Wall -W -O -g mktime.c -o mktime"
-+compile-command: "gcc -DDEBUG -I. -Wall -W -O2 -g mktime.c -o mktime"
- End:
--*/
-+*/
-\ No newline at end of file
-diff --git a/gnulib/lib/mountlist.c b/gnulib/lib/mountlist.c
---- a/gnulib/lib/mountlist.c
-+++ b/gnulib/lib/mountlist.c
-@@ -89,7 +89,7 @@
- # include <dirent.h>
- #endif
-
--#ifdef MOUNTED_FREAD /* SVR2. */
-+#if !defined __native_client__ && defined MOUNTED_FREAD /* SVR2. */
- # include <mnttab.h>
- #endif
-
-@@ -103,9 +103,7 @@
- # include <mntent.h>
- #endif
-
--#ifdef MOUNTED_GETMNTENT2 /* SVR4. */
--# include <sys/mnttab.h>
--#endif
-+
-
- #ifdef MOUNTED_VMOUNT /* AIX. */
- # include <fshelp.h>
-@@ -634,10 +632,12 @@ read_file_system_list (bool need_fs_type)
- }
- #endif /* MOUNTED_GETFSSTAT */
-
--#if defined MOUNTED_FREAD || defined MOUNTED_FREAD_FSTYP /* SVR[23]. */
-+/* disable mount logic in nacl */
-+#if !defined __native_client__ && (defined MOUNTED_FREAD \
-+ || defined MOUNTED_FREAD_FSTYP) /* SVR[23]. */
- {
- struct mnttab mnt;
-- char *table = "/etc/mnttab";
-+ char *table = "/etc/mtab";
- FILE *fp;
-
- fp = fopen (table, "r");
-@@ -716,7 +716,8 @@ read_file_system_list (bool need_fs_type)
- }
- #endif
-
--#ifdef MOUNTED_GETMNTENT2 /* SVR4. */
-+/* disable mount logic in nacl */
-+#if !defined __native_client__ && defined MOUNTED_GETMNTENT2 /* SVR4. */
- {
- struct mnttab mnt;
- char *table = MNTTAB;
-diff --git a/gnulib/lib/stdint.in.h b/gnulib/lib/stdint.in.h
---- a/gnulib/lib/stdint.in.h
-+++ b/gnulib/lib/stdint.in.h
-@@ -61,7 +61,7 @@
- MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
- relies on the system <stdint.h> definitions, so include
- <sys/types.h> after @NEXT_STDINT_H@. */
--#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
-+#if @HAVE_SYS_TYPES_H@ && ! defined _AIX && !defined __native_client__
- # include <sys/types.h>
- #endif
-
-@@ -79,7 +79,7 @@
- # include <sys/inttypes.h>
- #endif
-
--#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
-+#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ && !defined __native_client__
- /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
- int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
- included by <sys/types.h>. */
-diff --git a/gnulib/lib/stdio.in.h b/gnulib/lib/stdio.in.h
---- a/gnulib/lib/stdio.in.h
-+++ b/gnulib/lib/stdio.in.h
-@@ -35,10 +35,12 @@
- #include <stdarg.h>
- #include <stddef.h>
-
--#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
-+#if ((@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
- || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
- || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
-- || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))
-+ || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))) \
-+ && !defined __native_client_
-+
- /* Get off_t and ssize_t. */
- # include <sys/types.h>
- #endif
-@@ -238,7 +240,7 @@ extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
- freopen (f, m, s))
- #endif
-
--#if @GNULIB_FSEEKO@
-+#if !defined __native_client__ && @GNULIB_FSEEKO@
- # if @REPLACE_FSEEKO@
- /* Provide fseek, fseeko functions that are aware of a preceding
- fflush(), and which detect pipes. */
-diff --git a/gnulib/lib/wchar.in.h b/gnulib/lib/wchar.in.h
---- a/gnulib/lib/wchar.in.h
-+++ b/gnulib/lib/wchar.in.h
-@@ -26,7 +26,12 @@
- * the declaration of wcwidth().
- */
-
--#ifndef _GL_WCHAR_H
-+/* when we set toolchain as glibc(newlib works fine),
-+ somehow _GL_WCHAR_H is 1,
-+ the following code won't get included, however we still
-+ need the code to include the origianl wchar.h
-+ in the nalc include folder*/
-+#if !defined _GL_WCHAR_H || defined __native_client__
-
- /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
-diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
---- a/gnulib/m4/gnulib-comp.m4
-+++ b/gnulib/m4/gnulib-comp.m4
-@@ -470,6 +470,7 @@ AC_DEFUN([gl_FILE_LIST], [
- lib/memset.c
- lib/mkdirat.c
- lib/mktime.c
-+ lib/mktime-internal.h
- lib/modechange.c
- lib/modechange.h
- lib/mountlist.c
-diff --git a/gnulib/m4/mktime.m4 b/gnulib/m4/mktime.m4
---- a/gnulib/m4/mktime.m4
-+++ b/gnulib/m4/mktime.m4
-@@ -220,6 +220,26 @@ AC_DEFUN([gl_FUNC_MKTIME],
- fi
- ])
-
-+########## add mktime-internal.h ###################################
-+##########(copied this part from latest gnulib) ####################
-+########## see more details in the ports/findutils/README ##########
-+AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [
-+ AC_REQUIRE([gl_FUNC_MKTIME])
-+ if test $REPLACE_MKTIME = 0; then
-+ dnl BeOS has __mktime_internal in libc, but other platforms don't.
-+ AC_CHECK_FUNC([__mktime_internal],
-+ [AC_DEFINE([mktime_internal], [__mktime_internal],
-+ [Define to the real name of the mktime_internal function.])
-+ ],
-+ [dnl mktime works but it doesn't export __mktime_internal,
-+ dnl so we need to substitute our own mktime implementation.
-+ REPLACE_MKTIME=1
-+ AC_LIBOBJ([mktime])
-+ gl_PREREQ_MKTIME
-+ ])
-+ fi
-+])
-+
- # Prerequisites of lib/mktime.c.
- AC_DEFUN([gl_PREREQ_MKTIME],
- [
-diff --git a/lib/Makefile.in b/lib/Makefile.in
---- a/lib/Makefile.in
-+++ b/lib/Makefile.in
-@@ -197,7 +197,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
- CONFIG_HEADER = $(top_builddir)/config.h
- CONFIG_CLEAN_FILES =
- LIBRARIES = $(noinst_LIBRARIES)
--AR = ar
-+AR ?= ar
- ARFLAGS = cru
- libfind_a_AR = $(AR) $(ARFLAGS)
- am_libfind_a_OBJECTS = gnulib-version.$(OBJEXT) \
-diff --git a/lib/buildcmd.c b/lib/buildcmd.c
---- a/lib/buildcmd.c
-+++ b/lib/buildcmd.c
-@@ -103,7 +103,9 @@
- #define ARG_MAX NCARGS
- #endif
-
--
-+#ifndef _POSIX_ARG_MAX
-+#define _POSIX_ARG_MAX 4096
-+#endif
-
- #include <xalloc.h>
- #include <error.h>
-diff --git a/tests/Makefile.in b/tests/Makefile.in
---- a/tests/Makefile.in
-+++ b/tests/Makefile.in
-@@ -253,7 +253,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
- CONFIG_HEADER = $(top_builddir)/config.h
- CONFIG_CLEAN_FILES =
- LIBRARIES = $(noinst_LIBRARIES)
--AR = ar
-+AR ?= ar
- ARFLAGS = cru
- libtests_a_AR = $(AR) $(ARFLAGS)
- am__DEPENDENCIES_1 =
-diff --git a/xargs/xargs.c b/xargs/xargs.c
---- a/xargs/xargs.c
-+++ b/xargs/xargs.c
-@@ -51,6 +51,7 @@
- #define ISSPACE(c) (ISBLANK (c) || (c) == '\n' || (c) == '\r' \
- || (c) == '\f' || (c) == '\v')
-
-+#include <spawn.h>
- #include <sys/types.h>
- #include <stdio.h>
- #include <errno.h>
-@@ -1128,13 +1129,13 @@ xargs_do_exec (const struct buildcmd_control *ctl, struct buildcmd_state *state)
-
- /* If we run out of processes, wait for a child to return and
- try again. */
-- while ((child = fork ()) < 0 && errno == EAGAIN && procs_executing)
-+ while ((child = vfork ()) < 0 && errno == EAGAIN && procs_executing)
- wait_for_proc (false, 1u);
-
- switch (child)
- {
- case -1:
-- error (1, errno, _("cannot fork"));
-+ error (1, errno, _("cannot vfork"));
-
- case 0: /* Child. */
- prep_child_for_exec();
diff --git a/ports/findutils/pkg_info b/ports/findutils/pkg_info
deleted file mode 100644
index 31a499e..0000000
--- a/ports/findutils/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=findutils
-VERSION=4.4.2
-URL=http://ftp.gnu.org/gnu/findutils/findutils-4.4.2.tar.gz
-DEPENDS=(ncurses nacl-spawn)
-SHA1=e8dd88fa2cc58abffd0bfc1eddab9020231bb024
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/fixesproto/pkg_info b/ports/fixesproto/pkg_info
deleted file mode 100644
index 0e50d63..0000000
--- a/ports/fixesproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=fixesproto
-VERSION=5.0
-URL=http://www.x.org/releases/X11R7.7/src/everything/fixesproto-5.0.tar.bz2
-LICENSE=GPL
-SHA1=ab605af5da8c98c0c2f8b2c578fed7c864ee996a
diff --git a/ports/flac/build.sh b/ports/flac/build.sh
deleted file mode 100644
index 0d48f40..0000000
--- a/ports/flac/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXTRA_CONFIGURE_ARGS+=" --disable-oggtest"
-EXTRA_CONFIGURE_ARGS+=" --disable-xmms-plugin"
-EXTRA_CONFIGURE_ARGS+=" --without-metaflac-test-files"
-
-EnableGlibcCompat
-
-InstallStep() {
- # assumes pwd has makefile
- LogExecute make install-exec DESTDIR=${DESTDIR}
- ChangeDir include
- LogExecute make install DESTDIR=${DESTDIR}
-}
diff --git a/ports/flac/nacl.patch b/ports/flac/nacl.patch
deleted file mode 100644
index 003fe42..0000000
--- a/ports/flac/nacl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/examples/cpp/encode/file/main.cpp b/examples/cpp/encode/file/main.cpp
---- a/examples/cpp/encode/file/main.cpp
-+++ b/examples/cpp/encode/file/main.cpp
-@@ -29,6 +29,7 @@
- #endif
-
- #include <stdio.h>
-+#include <string.h>
- #include <stdlib.h>
- #include "FLAC++/metadata.h"
- #include "FLAC++/encoder.h"
-diff --git a/src/test_libFLAC++/metadata_manip.cpp b/src/test_libFLAC++/metadata_manip.cpp
---- a/src/test_libFLAC++/metadata_manip.cpp
-+++ b/src/test_libFLAC++/metadata_manip.cpp
-@@ -44,6 +44,9 @@ extern "C" {
- #include "test_libs_common/file_utils_flac.h"
- }
-
-+/* utime is unimplemented */
-+#define utime(path, times) (0)
-+
- /******************************************************************************
- The general strategy of these tests (for interface levels 1 and 2) is
- to create a dummy FLAC file with a known set of initial metadata
diff --git a/ports/flac/pkg_info b/ports/flac/pkg_info
deleted file mode 100644
index ee36158..0000000
--- a/ports/flac/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=flac
-VERSION=1.2.1
-URL=http://download.sf.net/flac/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz
-LICENSE=GPL,LGPL,BSD:COPYING.Xiph
-BUILD_OS=linux
-DISABLED_TOOLCHAIN=(emscripten)
-DEPENDS=(libogg glibc-compat)
-SHA1=bd54354900181b59db3089347cc84ad81e410b38
diff --git a/ports/font-adobe-100dpi/build.sh b/ports/font-adobe-100dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-adobe-100dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-adobe-100dpi/pkg_info b/ports/font-adobe-100dpi/pkg_info
deleted file mode 100644
index 2cfb250..0000000
--- a/ports/font-adobe-100dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-adobe-100dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-adobe-100dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=53311cbd604f18bd9570727105a4222473d363e3
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-adobe-75dpi/build.sh b/ports/font-adobe-75dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-adobe-75dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-adobe-75dpi/pkg_info b/ports/font-adobe-75dpi/pkg_info
deleted file mode 100644
index 81b147e..0000000
--- a/ports/font-adobe-75dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-adobe-75dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-adobe-75dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=6a2ec569336b5646682a14eee3c7790274beffd1
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-adobe-utopia-100dpi/build.sh b/ports/font-adobe-utopia-100dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-adobe-utopia-100dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-adobe-utopia-100dpi/pkg_info b/ports/font-adobe-utopia-100dpi/pkg_info
deleted file mode 100644
index 46e032f..0000000
--- a/ports/font-adobe-utopia-100dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-adobe-utopia-100dpi
-VERSION=1.0.4
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-adobe-utopia-100dpi-1.0.4.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=9e80cf5bbd5522a5cfad2a9f8f8fce86de0f0226
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-adobe-utopia-75dpi/build.sh b/ports/font-adobe-utopia-75dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-adobe-utopia-75dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-adobe-utopia-75dpi/pkg_info b/ports/font-adobe-utopia-75dpi/pkg_info
deleted file mode 100644
index 60fa8ad..0000000
--- a/ports/font-adobe-utopia-75dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-adobe-utopia-75dpi
-VERSION=1.0.4
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-adobe-utopia-75dpi-1.0.4.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=50e837322a09f1a7c40fb78fc6aad1a157284507
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-adobe-utopia-type1/build.sh b/ports/font-adobe-utopia-type1/build.sh
deleted file mode 100644
index 245a0f1..0000000
--- a/ports/font-adobe-utopia-type1/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir/mkfontscale on install.
-export ac_cv_path_MKFONTDIR=echo
-export ac_cv_path_MKFONTSCALE=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-adobe-utopia-type1/pkg_info b/ports/font-adobe-utopia-type1/pkg_info
deleted file mode 100644
index 5bf64ad..0000000
--- a/ports/font-adobe-utopia-type1/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-adobe-utopia-type1
-VERSION=1.0.4
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-adobe-utopia-type1-1.0.4.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=3113cfafb91c2c53df6a1fae57dca6c50fb8ce20
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-alias/build.sh b/ports/font-alias/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-alias/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-alias/pkg_info b/ports/font-alias/pkg_info
deleted file mode 100644
index 06465ce..0000000
--- a/ports/font-alias/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=font-alias
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-alias-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=96b0aa38f88a54ef32ab85d3eef6f29b0437f70d
diff --git a/ports/font-bh-100dpi/build.sh b/ports/font-bh-100dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-bh-100dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bh-100dpi/pkg_info b/ports/font-bh-100dpi/pkg_info
deleted file mode 100644
index 5b7ec47..0000000
--- a/ports/font-bh-100dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bh-100dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bh-100dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=47d5e50be9e78695017650a088da52bfcf1eeb40
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bh-75dpi/build.sh b/ports/font-bh-75dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-bh-75dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bh-75dpi/pkg_info b/ports/font-bh-75dpi/pkg_info
deleted file mode 100644
index a2faa07..0000000
--- a/ports/font-bh-75dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bh-75dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bh-75dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=7290567d42a0f5adb6a3ad170524bb7ed59871d7
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bh-lucidatypewriter-100dpi/build.sh b/ports/font-bh-lucidatypewriter-100dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-bh-lucidatypewriter-100dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bh-lucidatypewriter-100dpi/pkg_info b/ports/font-bh-lucidatypewriter-100dpi/pkg_info
deleted file mode 100644
index 2155382..0000000
--- a/ports/font-bh-lucidatypewriter-100dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bh-lucidatypewriter-100dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bh-lucidatypewriter-100dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=bc4f804e49db8c6add04f52ffb1c0cd63e714b2c
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bh-lucidatypewriter-75dpi/build.sh b/ports/font-bh-lucidatypewriter-75dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-bh-lucidatypewriter-75dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bh-lucidatypewriter-75dpi/pkg_info b/ports/font-bh-lucidatypewriter-75dpi/pkg_info
deleted file mode 100644
index bd03d04..0000000
--- a/ports/font-bh-lucidatypewriter-75dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bh-lucidatypewriter-75dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bh-lucidatypewriter-75dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=3c6678e6bbb2bd352baaf610a8f6aac9c5140c85
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bh-ttf/build.sh b/ports/font-bh-ttf/build.sh
deleted file mode 100644
index 91ae498..0000000
--- a/ports/font-bh-ttf/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS+=" --with-fontrootdir=${PREFIX}/share/fonts/X11"
-EXTRA_CONFIGURE_ARGS+=" --with-fc-confdir=${PREFIX}/etc/fonts"
diff --git a/ports/font-bh-ttf/pkg_info b/ports/font-bh-ttf/pkg_info
deleted file mode 100644
index ec55e66..0000000
--- a/ports/font-bh-ttf/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bh-ttf
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bh-ttf-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=f42ebd527096011040a312e0f9cdf78d64177419
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bh-type1/build.sh b/ports/font-bh-type1/build.sh
deleted file mode 100644
index 699ac41..0000000
--- a/ports/font-bh-type1/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-export ac_cv_path_MKFONTSCALE=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bh-type1/pkg_info b/ports/font-bh-type1/pkg_info
deleted file mode 100644
index 5a98241..0000000
--- a/ports/font-bh-type1/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bh-type1
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bh-type1-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=69ff038d38015cd305a4cd4d1a921fe3bd08bbde
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bitstream-100dpi/build.sh b/ports/font-bitstream-100dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-bitstream-100dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bitstream-100dpi/pkg_info b/ports/font-bitstream-100dpi/pkg_info
deleted file mode 100644
index 29cd40b..0000000
--- a/ports/font-bitstream-100dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bitstream-100dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bitstream-100dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=138376f8683c09b9068c7c124842a7af9f0fcc2e
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bitstream-75dpi/build.sh b/ports/font-bitstream-75dpi/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-bitstream-75dpi/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bitstream-75dpi/pkg_info b/ports/font-bitstream-75dpi/pkg_info
deleted file mode 100644
index b63ad00..0000000
--- a/ports/font-bitstream-75dpi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bitstream-75dpi
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bitstream-75dpi-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=975e9f7872483394ebd87610f8bbc924d99bea34
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-bitstream-type1/build.sh b/ports/font-bitstream-type1/build.sh
deleted file mode 100644
index 699ac41..0000000
--- a/ports/font-bitstream-type1/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-export ac_cv_path_MKFONTSCALE=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-bitstream-type1/pkg_info b/ports/font-bitstream-type1/pkg_info
deleted file mode 100644
index 08f5892..0000000
--- a/ports/font-bitstream-type1/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-bitstream-type1
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-bitstream-type1-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=7633551be3525c501278e81259b22ad9a893de4d
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-cronyx-cyrillic/build.sh b/ports/font-cronyx-cyrillic/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-cronyx-cyrillic/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-cronyx-cyrillic/pkg_info b/ports/font-cronyx-cyrillic/pkg_info
deleted file mode 100644
index cf3e2dc..0000000
--- a/ports/font-cronyx-cyrillic/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-cronyx-cyrillic
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-cronyx-cyrillic-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=e5af8c2e8fb23955808a08bd38728ab3ad284d61
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-cursor-misc/build.sh b/ports/font-cursor-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-cursor-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-cursor-misc/pkg_info b/ports/font-cursor-misc/pkg_info
deleted file mode 100644
index 644cc95..0000000
--- a/ports/font-cursor-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-cursor-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-cursor-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=1649271129bbeff3aeee70a9da87a8e5e59162c1
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-daewoo-misc/build.sh b/ports/font-daewoo-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-daewoo-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-daewoo-misc/pkg_info b/ports/font-daewoo-misc/pkg_info
deleted file mode 100644
index ea928fb..0000000
--- a/ports/font-daewoo-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-daewoo-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-daewoo-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=0c7b24e08e6d42eb006d79ae7ab4bbf446d59f7a
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-dec-misc/build.sh b/ports/font-dec-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-dec-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-dec-misc/pkg_info b/ports/font-dec-misc/pkg_info
deleted file mode 100644
index f0005e2..0000000
--- a/ports/font-dec-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-dec-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-dec-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=a748d35b8b0241abd3e1d85f80da318b529a74d0
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-ibm-type1/build.sh b/ports/font-ibm-type1/build.sh
deleted file mode 100644
index 699ac41..0000000
--- a/ports/font-ibm-type1/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-export ac_cv_path_MKFONTSCALE=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-ibm-type1/pkg_info b/ports/font-ibm-type1/pkg_info
deleted file mode 100644
index 977d3bd..0000000
--- a/ports/font-ibm-type1/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-ibm-type1
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-ibm-type1-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=bfc7d0a3aa0f96bf61ea26d6b3f5afbbdd0f35f6
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-isas-misc/build.sh b/ports/font-isas-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-isas-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-isas-misc/pkg_info b/ports/font-isas-misc/pkg_info
deleted file mode 100644
index 7e6180f..0000000
--- a/ports/font-isas-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-isas-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-isas-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=cbd9bf441b25362123c817b1aa7a7be1ee4a9321
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-jis-misc/build.sh b/ports/font-jis-misc/build.sh
deleted file mode 100644
index 8d12155..0000000
--- a/ports/font-jis-misc/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-jis-misc/pkg_info b/ports/font-jis-misc/pkg_info
deleted file mode 100644
index 2480924..0000000
--- a/ports/font-jis-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-jis-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-jis-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=8c08c5fe01d4605f2886822cb3655548a6535e58
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-micro-misc/build.sh b/ports/font-micro-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-micro-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-micro-misc/pkg_info b/ports/font-micro-misc/pkg_info
deleted file mode 100644
index e5b6c5c..0000000
--- a/ports/font-micro-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-micro-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-micro-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=db3e912d41bda20f60b520c19e65bd7134ee1224
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-misc-cyrillic/build.sh b/ports/font-misc-cyrillic/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-misc-cyrillic/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-misc-cyrillic/pkg_info b/ports/font-misc-cyrillic/pkg_info
deleted file mode 100644
index 2985e9e..0000000
--- a/ports/font-misc-cyrillic/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-misc-cyrillic
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-misc-cyrillic-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=9c0e283ae59e7b05c0798fe0645cc822d22dcb0c
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-misc-ethiopic/build.sh b/ports/font-misc-ethiopic/build.sh
deleted file mode 100644
index 699ac41..0000000
--- a/ports/font-misc-ethiopic/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-export ac_cv_path_MKFONTSCALE=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-misc-ethiopic/pkg_info b/ports/font-misc-ethiopic/pkg_info
deleted file mode 100644
index 59d4a48..0000000
--- a/ports/font-misc-ethiopic/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-misc-ethiopic
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-misc-ethiopic-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=3f6af53047cb1206d737e8e8fbbbbb315c5419bb
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-misc-meltho/build.sh b/ports/font-misc-meltho/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-misc-meltho/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-misc-meltho/pkg_info b/ports/font-misc-meltho/pkg_info
deleted file mode 100644
index f9c4475..0000000
--- a/ports/font-misc-meltho/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-misc-meltho
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-misc-meltho-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=f0693ea8fbc1d43177014155a0ecd2516348b51b
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-misc-misc/build.sh b/ports/font-misc-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-misc-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-misc-misc/pkg_info b/ports/font-misc-misc/pkg_info
deleted file mode 100644
index fb4a713..0000000
--- a/ports/font-misc-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-misc-misc
-VERSION=1.1.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-misc-misc-1.1.2.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=c6d28c56880807963175cbbd682fb6f75a35f77d
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-mutt-misc/build.sh b/ports/font-mutt-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-mutt-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-mutt-misc/pkg_info b/ports/font-mutt-misc/pkg_info
deleted file mode 100644
index ddfddbd..0000000
--- a/ports/font-mutt-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-mutt-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-mutt-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=245d3041d9138b7e4a00858228adad2de304043b
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-schumacher-misc/build.sh b/ports/font-schumacher-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-schumacher-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-schumacher-misc/pkg_info b/ports/font-schumacher-misc/pkg_info
deleted file mode 100644
index dc6f72f..0000000
--- a/ports/font-schumacher-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-schumacher-misc
-VERSION=1.1.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-schumacher-misc-1.1.2.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=fbe3629e9dcc03d12300d4ebab64fd038ea98952
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-screen-cyrillic/build.sh b/ports/font-screen-cyrillic/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-screen-cyrillic/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-screen-cyrillic/pkg_info b/ports/font-screen-cyrillic/pkg_info
deleted file mode 100644
index 7de4c25..0000000
--- a/ports/font-screen-cyrillic/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-screen-cyrillic
-VERSION=1.0.4
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-screen-cyrillic-1.0.4.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=de1f0226f74d7e4d3ee9ab0b9c87478ab2a7db30
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-sony-misc/build.sh b/ports/font-sony-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-sony-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-sony-misc/pkg_info b/ports/font-sony-misc/pkg_info
deleted file mode 100644
index 729e8f6..0000000
--- a/ports/font-sony-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-sony-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-sony-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=8d0dd87148283c8ac8c5ac37906b12fab5ddb1d8
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-sun-misc/build.sh b/ports/font-sun-misc/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-sun-misc/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-sun-misc/pkg_info b/ports/font-sun-misc/pkg_info
deleted file mode 100644
index dbb5d00..0000000
--- a/ports/font-sun-misc/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-sun-misc
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-sun-misc-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=6a72602557bb5dfe46c1ee3b56658aeed1e04f9d
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-util/build.sh b/ports/font-util/build.sh
deleted file mode 100644
index 5d3a771..0000000
--- a/ports/font-util/build.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2013 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.
-
-# The host build of this tool is needed by its dependents.
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-HOST_INSTALL_DIR=${WORK_DIR}/install_host
-
-EXECUTABLES="bdftruncate${NACL_EXEEXT} ucs2any${NACL_EXEEXT}"
-
-EnableCliMain
-
-EnableGlibcCompat
-
-BuildForHost() {
- Banner "Building for Host"
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- CFLAGS="" LDFLAGS="" LIBS="" CC="gcc -m32" \
- LogExecute ${SRC_DIR}/configure --prefix=${HOST_INSTALL_DIR}
- LogExecute make -j${OS_JOBS}
- LogExecute make install
-}
-
-ConfigureStep() {
- BuildForHost
- Banner "Building for NaCl"
- ChangeDir ${BUILD_DIR}
- DefaultConfigureStep
-}
diff --git a/ports/font-util/pkg_info b/ports/font-util/pkg_info
deleted file mode 100644
index 32f4827..0000000
--- a/ports/font-util/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=font-util
-VERSION=1.3.0
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-util-1.3.0.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat nacl-spawn)
-SHA1=a015f4c5a35d98af72835797293697e0eb9cd506
diff --git a/ports/font-winitzki-cyrillic/build.sh b/ports/font-winitzki-cyrillic/build.sh
deleted file mode 100644
index 725746d..0000000
--- a/ports/font-winitzki-cyrillic/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-winitzki-cyrillic/pkg_info b/ports/font-winitzki-cyrillic/pkg_info
deleted file mode 100644
index 7424d23..0000000
--- a/ports/font-winitzki-cyrillic/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-winitzki-cyrillic
-VERSION=1.0.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-winitzki-cyrillic-1.0.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=29249b49eac7e3f32d7a1a93808fcfd9d399011c
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/font-xfree86-type1/build.sh b/ports/font-xfree86-type1/build.sh
deleted file mode 100644
index 699ac41..0000000
--- a/ports/font-xfree86-type1/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-PATH="${BUILD_DIR}/../../font-util/install_host/bin:${PATH}"
-
-# Disable running on mkfontdir on install.
-export ac_cv_path_MKFONTDIR=echo
-export ac_cv_path_MKFONTSCALE=echo
-
-# Setting this as the fonts don't seem to honor --prefix for everything.
-EXTRA_CONFIGURE_ARGS="--with-fontrootdir=${PREFIX}/share/fonts/X11"
diff --git a/ports/font-xfree86-type1/pkg_info b/ports/font-xfree86-type1/pkg_info
deleted file mode 100644
index 7fb98f6..0000000
--- a/ports/font-xfree86-type1/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=font-xfree86-type1
-VERSION=1.0.4
-URL=http://www.x.org/releases/X11R7.7/src/everything/font-xfree86-type1-1.0.4.tar.bz2
-LICENSE=GPL
-DEPENDS=(font-util)
-SHA1=1381f274a178cbd08627560e17a4a8f6653be3f7
-# Disabled on OSX due to lack of mkfontdir.
-BUILD_OS=linux
diff --git a/ports/fontconfig/README.nacl b/ports/fontconfig/README.nacl
deleted file mode 100644
index 8e920de..0000000
--- a/ports/fontconfig/README.nacl
+++ /dev/null
@@ -1,4 +0,0 @@
-Fontconfig
-==========
-
-fonts/fonts.conf is a config file to make the fonts look better on nacl.
diff --git a/ports/fontconfig/build.sh b/ports/fontconfig/build.sh
deleted file mode 100644
index 7495d29..0000000
--- a/ports/fontconfig/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="fc-cache/fc-cache${NACL_EXEEXT}"
-EXTRA_CONFIGURE_ARGS="--disable-docs --with-arch=x86"
-
-# TODO(sbc): Disable use of random(), because it creates the expectation
-# that initstate(), setstate() are implemented too.
-# Remove if initstate() and setstate() are added to libnacl.
-if [ ${NACL_LIBC} = "newlib" ]; then
- export ac_cv_func_random=no
-fi
-
-EnableCliMain
diff --git a/ports/fontconfig/fonts/fonts.conf b/ports/fontconfig/fonts/fonts.conf
deleted file mode 100644
index 61e5418..0000000
--- a/ports/fontconfig/fonts/fonts.conf
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
-<!-- /etc/fonts/fonts.conf file to configure system font access -->
-<fontconfig>
-
-<!-- Font directory list -->
-
- <dir>/usr/share/fonts</dir>
-
- <dir prefix="xdg">fonts</dir>
- <!-- the following element will be removed in the future -->
- <dir>~/.fonts</dir>
-
-<!--
- Accept deprecated 'mono' alias, replacing it with 'monospace'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>mono</string>
- </test>
- <edit name="family" mode="assign" binding="same">
- <string>monospace</string>
- </edit>
- </match>
-
-<!--
- Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>sans serif</string>
- </test>
- <edit name="family" mode="assign" binding="same">
- <string>sans-serif</string>
- </edit>
- </match>
-
-<!--
- Accept deprecated 'sans' alias, replacing it with 'sans-serif'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>sans</string>
- </test>
- <edit name="family" mode="assign" binding="same">
- <string>sans-serif</string>
- </edit>
- </match>
-<!-- Set preferred serif, sans serif, and monospace fonts. -->
- <alias>
- <family>serif</family>
- <prefer>
- <family>Luxi Sans Bold</family>
- </prefer>
- </alias>
- <alias>
- <family>sans-serif</family>
- <prefer>
- <family>Luxi Sans Bold</family>
- </prefer>
- </alias>
- <alias>
- <family>sans</family>
- <prefer>
- <family>Luxi Sans Bold</family>
- </prefer>
- </alias>
- <alias>
- <family>monospace</family>
- <prefer><family>Luxi Sans Bold</family></prefer>
- </alias>
-<!--
- Load local system customization file
--->
- <include ignore_missing="yes">conf.d</include>
-
-<!-- Font cache directory list -->
-
- <cachedir>/webports-dummydir/var/cache/fontconfig</cachedir>
- <cachedir prefix="xdg">fontconfig</cachedir>
- <!-- the following element will be removed in the future -->
- <cachedir>~/.fontconfig</cachedir>
-
- <config>
-<!--
- These are the default Unicode chars that are expected to be blank
- in fonts. All other blank chars are assumed to be broken and
- won't appear in the resulting charsets
- -->
- <blank>
- <int>0x0020</int> <!-- SPACE -->
- <int>0x00A0</int> <!-- NO-BREAK SPACE -->
- <int>0x00AD</int> <!-- SOFT HYPHEN -->
- <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
- <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
- <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
- <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
- <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
- <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
- <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
- <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
- <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
- <int>0x1680</int> <!-- OGHAM SPACE MARK -->
- <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
- <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
- <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
- <int>0x2000</int> <!-- EN QUAD -->
- <int>0x2001</int> <!-- EM QUAD -->
- <int>0x2002</int> <!-- EN SPACE -->
- <int>0x2003</int> <!-- EM SPACE -->
- <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
- <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
- <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
- <int>0x2007</int> <!-- FIGURE SPACE -->
- <int>0x2008</int> <!-- PUNCTUATION SPACE -->
- <int>0x2009</int> <!-- THIN SPACE -->
- <int>0x200A</int> <!-- HAIR SPACE -->
- <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
- <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
- <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
- <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
- <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
- <int>0x2028</int> <!-- LINE SEPARATOR -->
- <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
- <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
- <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
- <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
- <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
- <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
- <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
- <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
- <int>0x2060</int> <!-- WORD JOINER -->
- <int>0x2061</int> <!-- FUNCTION APPLICATION -->
- <int>0x2062</int> <!-- INVISIBLE TIMES -->
- <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
- <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
- <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
- <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
- <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
- <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
- <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
- <int>0x2800</int> <!-- BRAILLE PATTERN BLANK -->
- <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
- <int>0x3164</int> <!-- HANGUL FILLER -->
- <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
- <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
- <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
- <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
- <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
- </blank>
-<!--
- Rescan configuration every 30 seconds when FcFontSetList is called
- -->
- <rescan>
- <int>30</int>
- </rescan>
- </config>
-
-</fontconfig>
diff --git a/ports/fontconfig/nacl.patch b/ports/fontconfig/nacl.patch
deleted file mode 100644
index 7261259..0000000
--- a/ports/fontconfig/nacl.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -13976,6 +13976,15 @@ $as_echo_n "checking for scandir... " >&6; }
- /* end confdefs.h. */
-
- #include <dirent.h>
-+ /*
-+ * TODO(phosek): This declaration should be removed once the newlib
-+ * version of dirent.h is updated to declare.
-+ * See https://code.google.com/p/nativeclient/issues/detail?id=3916
-+ */
-+ int scandir(const char *__dir,
-+ struct dirent ***__namelist,
-+ int (*select)(const struct dirent *),
-+ int (*compar)(const struct dirent **, const struct dirent **));
- int main(void);
-
- int
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -542,7 +542,7 @@ clean-libLTLIBRARIES:
- }
-
- libfontconfig.la: $(libfontconfig_la_OBJECTS) $(libfontconfig_la_DEPENDENCIES) $(EXTRA_libfontconfig_la_DEPENDENCIES)
-- $(AM_V_CCLD)$(libfontconfig_la_LINK) -rpath $(libdir) $(libfontconfig_la_OBJECTS) $(libfontconfig_la_LIBADD) $(LIBS)
-+ $(AM_V_CCLD)$(libfontconfig_la_LINK) -rpath $(libdir) $(libfontconfig_la_OBJECTS) $(libfontconfig_la_LIBADD)
-
- clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
-diff --git a/src/fcatomic.c b/src/fcatomic.c
---- a/src/fcatomic.c
-+++ b/src/fcatomic.c
-@@ -101,7 +101,7 @@ FcAtomicLock (FcAtomic *atomic)
- int ret;
- struct stat lck_stat;
-
--#ifdef HAVE_LINK
-+#if defined(HAVE_LINK) && !defined(__native_client__)
- int fd = -1;
- FILE *f = 0;
- FcBool no_link = FcFalse;
-@@ -156,7 +156,7 @@ FcAtomicLock (FcAtomic *atomic)
- time_t now = time (0);
- if ((long int) (now - lck_stat.st_mtime) > 10 * 60)
- {
--#ifdef HAVE_LINK
-+#if defined(HAVE_LINK) && !defined(__native_client__)
- if (no_link)
- {
- if (rmdir ((char *) atomic->lck) == 0)
-@@ -211,7 +211,7 @@ FcAtomicDeleteNew (FcAtomic *atomic)
- void
- FcAtomicUnlock (FcAtomic *atomic)
- {
--#ifdef HAVE_LINK
-+#if defined(HAVE_LINK) && !defined(__native_client__)
- if (unlink ((char *) atomic->lck) == -1)
- rmdir ((char *) atomic->lck);
- #else
diff --git a/ports/fontconfig/pkg_info b/ports/fontconfig/pkg_info
deleted file mode 100644
index 90d0dd2..0000000
--- a/ports/fontconfig/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=fontconfig
-VERSION=2.11.1
-URL=http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.1.tar.bz2
-LICENSE=CUSTOM:COPYING
-DEPENDS=(expat freetype libpng)
-SHA1=08565feea5a4e6375f9d8a7435dac04e52620ff2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/fontsproto/pkg_info b/ports/fontsproto/pkg_info
deleted file mode 100644
index 642ef11..0000000
--- a/ports/fontsproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=fontsproto
-VERSION=2.1.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/fontsproto-2.1.2.tar.bz2
-LICENSE=GPL
-SHA1=538f0880faa6981cb1a348ced93dc715c42840f7
diff --git a/ports/freealut/build.sh b/ports/freealut/build.sh
deleted file mode 100644
index e4be55f..0000000
--- a/ports/freealut/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="examples/playfile examples/hello_world"
-
-# Without this openal is not detected
-export LIBS="-lm"
diff --git a/ports/freealut/nacl.patch b/ports/freealut/nacl.patch
deleted file mode 100644
index 383cfcd..0000000
--- a/ports/freealut/nacl.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/src/alutWaveform.c b/src/alutWaveform.c
---- a/src/alutWaveform.c
-+++ b/src/alutWaveform.c
-@@ -35,12 +35,14 @@ waveformSawtooth (double UNUSED (lastPhase), double phase)
- return 2 * phase - 1;
- }
-
-+#if !defined __native_client__ || defined __GLIBC__
- static double
- waveformWhitenoise (double UNUSED (lastPhase), double UNUSED (phase))
- {
- static const long prime = 67867967L;
- return 2 * (double) (random () % prime) / prime - 1;
- }
-+#endif
-
- static double
- waveformImpulse (double lastPhase, double phase)
-@@ -59,8 +61,10 @@ getWaveformFunction (ALenum waveshape)
- return &waveformSquare;
- case ALUT_WAVEFORM_SAWTOOTH:
- return &waveformSawtooth;
-+#if !defined __native_client__ || defined __GLIBC__
- case ALUT_WAVEFORM_WHITENOISE:
- return &waveformWhitenoise;
-+#endif
- case ALUT_WAVEFORM_IMPULSE:
- return &waveformImpulse;
- }
diff --git a/ports/freealut/pkg_info b/ports/freealut/pkg_info
deleted file mode 100644
index 32ac9b0..0000000
--- a/ports/freealut/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=freealut
-VERSION=1.1.0
-URL=http://connect.creativelabs.com/openal/Downloads/ALUT/freealut-1.1.0.tar.gz
-LICENSE=LGPL2
-DEPENDS=(openal-soft)
-SHA1=b2c04d2b5e0896b3164c01deda39f58933c8055f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/freeimage/build.sh b/ports/freeimage/build.sh
deleted file mode 100644
index 14ea41a..0000000
--- a/ports/freeimage/build.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (c) 2011 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.
-
-if [ "${NACL_SHARED}" = "1" ]; then
- EXECUTABLES+=" libfreeimage-3.17.0.so"
-fi
-
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-BUILD_DIR=${SRC_DIR}
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- # export the nacl tools
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- export AR=${NACLAR}
- export RANLIB=${NACLRANLIB}
- export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export CXXFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CXXFLAGS}"
- export PATH=${NACL_BIN_PATH}:${PATH}
- CFLAGS="${CFLAGS/-O2/-O1}"
- CXXFLAGS="${CXXFLAGS/-O2/-O1}"
-
- # assumes pwd has makefile
- LogExecute make -f Makefile.gnu clean
- LogExecute make -f Makefile.gnu -j${OS_JOBS} ENABLE_SHARED=${NACL_SHARED}
-}
-
-InstallStep() {
- export INCDIR=${DESTDIR_INCLUDE}
- export INSTALLDIR=${DESTDIR_LIB}
- LogExecute make -f Makefile.gnu install ENABLE_SHARED=${NACL_SHARED}
-}
diff --git a/ports/freeimage/nacl.patch b/ports/freeimage/nacl.patch
deleted file mode 100644
index 6293261..0000000
--- a/ports/freeimage/nacl.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff --git a/Makefile.gnu b/Makefile.gnu
---- a/Makefile.gnu
-+++ b/Makefile.gnu
-@@ -13,6 +13,8 @@ DOS2UNIX = dos2unix
-
- LIBRARIES = -lstdc++
-
-+ENABLE_SHARED ?= 1
-+
- MODULES = $(SRCS:.c=.o)
- MODULES := $(MODULES:.cpp=.o)
- CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden
-@@ -49,13 +51,19 @@ all: dist
- dist: FreeImage
- mkdir -p Dist
- cp *.a Dist/
-+ifeq ($(ENABLE_SHARED),1)
- cp *.so Dist/
-+endif
- cp Source/FreeImage.h Dist/
-
- dos2unix:
- @$(DOS2UNIX) $(SRCS) $(INCLS)
-
-+ifeq ($(ENABLE_SHARED),1)
- FreeImage: $(STATICLIB) $(SHAREDLIB)
-+else
-+FreeImage: $(STATICLIB)
-+endif
-
- .c.o:
- $(CC) $(CFLAGS) -c $< -o $@
-@@ -71,11 +79,13 @@ $(SHAREDLIB): $(MODULES)
-
- install:
- install -d $(INCDIR) $(INSTALLDIR)
-- install -m 644 -o root -g root $(HEADER) $(INCDIR)
-- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
-- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
-+ install -m 644 $(HEADER) $(INCDIR)
-+ install -m 644 $(STATICLIB) $(INSTALLDIR)
-+ifeq ($(ENABLE_SHARED),1)
-+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
- ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
- ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
-+endif
- # ldconfig
-
- clean:
diff --git a/ports/freeimage/pkg_info b/ports/freeimage/pkg_info
deleted file mode 100644
index 1da4b1e..0000000
--- a/ports/freeimage/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=freeimage
-VERSION=3.17.0
-URL=http://downloads.sf.net/freeimage/FreeImage3170.zip
-ARCHIVE_ROOT=FreeImage
-LICENSE=CUSTOM
-SHA1=6752c83798c2f81dee71a2e8bb11657068672669
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/freetype/build.sh b/ports/freetype/build.sh
deleted file mode 100644
index 6e16d58..0000000
--- a/ports/freetype/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2014 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.
-
-if [ "${NACL_SHARED}" = "1" ]; then
- NACLPORTS_CFLAGS+=" -fPIC"
-fi
diff --git a/ports/freetype/pkg_info b/ports/freetype/pkg_info
deleted file mode 100644
index 8053f94..0000000
--- a/ports/freetype/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=freetype
-VERSION=2.5.5
-URL=http://download.savannah.gnu.org/releases/freetype/freetype-2.5.5.tar.bz2
-LICENSE=CUSTOM:docs/LICENSE.TXT
-DEPENDS=(bzip2 libpng zlib)
-SHA1=7b7460ef51a8fdb17baae53c6658fc1ad000a1c2
diff --git a/ports/fuseiso/README.nacl b/ports/fuseiso/README.nacl
deleted file mode 100644
index a86f041..0000000
--- a/ports/fuseiso/README.nacl
+++ /dev/null
@@ -1,63 +0,0 @@
-Original fuseiso is a standalone app, however for naclport,
-we chagned it to a library so that we can use it in other app.
-
-Major Changes for port fuseiso:
-1. added 'nacl_fuseiso_lib_init' and removed 'main' function in fuseiso.c.
-
-2. disabled the check for mnttab(fuseiso.c).
-
-3. disabled isofs_real_statfs, the parameters we have in nacl_io is statvfs,
- but in fuseiso, it requires statfs, also since we nacl_io currently
- doesn't support statfs(more details see nacl_io/fuse.h in nacl_sdk).
-
-4. in currenl newlib, we don't have "bswap_16", using "__byte_swap_16"
- from sys/endian.h instead.
-
-5. created a seperate Makefile.in for fuseisolib.
-
-Some sample code to test this lib(newlib version):
-
-//fusefoo.c
-
-#include <fuseiso_lib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-int main(int argc, char* argv[]) {
- char* path = "<YOUR ISO PATH>";
- char* mount_point = "/foo";
- char* fs_name = "fuseiso_fs";
- mkdir(mount_point, 0777);
- nacl_fuseiso_lib_init(path, mount_point, fs_name);
-
- char buffer[1024];
- int fd = open("/foo/<PATH_IN_ISO>", O_RDONLY);
-
- read(fd, &buffer,1024);
- printf("%s\n", buffer);
- close(fd);
- return 0;
-}
-
-// copy and paste following command to complie and link,
-// you might need install (ncurses nacl-spawn glib glibc-compat) first.
-
-NACLSDKPATH= <nacl_sdk home path e.g. /home/foo/nacl_sdk/pepper_canary>
-
-$NACLSDKPATH/toolchain/linux_x86_newlib/bin/x86_64-nacl-gcc fusefoo.c \
- -DHAVE_CONFIG_H -I. -I. -I.. -I$NACLSDKPATH/include/nacl_io \
- -I$NACLSDKPATH/include -I$NACLSDKPATH/ports/include \
- -I$NACLSDKPATH/toolchain/linux_x86_newlib/x86_64-nacl/usr/include \
- -Wall -DNDEBUG -O2 -c
-
-$NACLSDKPATH/toolchain/linux_x86_newlib/bin/x86_64-nacl-gcc \
- -I$NACLSDKPATH/include -L$NACLSDKPATH/lib/newlib_x86_64/Release \
- -L$NACLSDKPATH/toolchain/linux_x86_newlib/x86_64-nacl/usr/lib \
- -L$NACLSDKPATH/toolchain/linux_x86_glibc/x86_64-nacl/usr/lib \
- -o fusefoo_newlib.nexe fusefoo.o -Wl,--undefined=PSUserMainGet \
- -Xlinker -uPSUserMainGet -lcli_main -lnacl_spawn -lppapi_simple \
- -lnacl_io -lppapi -lfuseiso -lstdc++ -lncurses -lglib-2.0 -lz -lintl
-
-Should be able to get a fusefoo_newlib.nexe after complie and link.
-Copy fusefoo_newlib.nexe and the iso file to devenv to test it.
diff --git a/ports/fuseiso/build.sh b/ports/fuseiso/build.sh
deleted file mode 100644
index 5feb887..0000000
--- a/ports/fuseiso/build.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 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.
-
-BUILD_DIR=${SRC_DIR}
-NACLPORTS_CFLAGS+=" -I${NACL_SDK_ROOT}/include \
- -I${NACLPORTS_INCLUDE}/glib-2.0 \
- -I${NACL_PREFIX}/lib/glib-2.0/include \
- -I${NACLPORTS_INCLUDE}"
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- NACLPORTS_CFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
-fi
-
-ConfigureStep() {
- LogExecute rm -f configure
- LogExecute autoconf
- DefaultConfigureStep
-}
-
-InstallStep() {
- # copy header manually
- DefaultInstallStep
- MakeDir ${DESTDIR_INCLUDE}
- LogExecute cp ${START_DIR}/fuseiso_lib.h ${DESTDIR_INCLUDE}/
-}
\ No newline at end of file
diff --git a/ports/fuseiso/diff_skip.txt b/ports/fuseiso/diff_skip.txt
deleted file mode 100644
index 396adcc..0000000
--- a/ports/fuseiso/diff_skip.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile.in
-aclocal.m4
-config.h.in
-configure
-zAppRun/Makefile.in
diff --git a/ports/fuseiso/fuseiso_lib.h b/ports/fuseiso/fuseiso_lib.h
deleted file mode 100644
index 52b5eb9..0000000
--- a/ports/fuseiso/fuseiso_lib.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Copyright 2015 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.
- */
-
-#ifndef _FUSEISO_LIB_H
-#define _FUSEISO_LIB_H
-
-int nacl_fuseiso_lib_init(char *iso_path, char *mount_point, char *fs_name);
-
-#endif // _FUSEISO_LIB_H
\ No newline at end of file
diff --git a/ports/fuseiso/nacl.patch b/ports/fuseiso/nacl.patch
deleted file mode 100644
index 72bd1d5..0000000
--- a/ports/fuseiso/nacl.patch
+++ /dev/null
@@ -1,782 +0,0 @@
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -7,13 +7,8 @@ AC_LANG_C
- AC_PROG_CC
- AM_PROG_LIBTOOL
-
--AC_CHECK_HEADERS(fuse.h, AC_CHECK_LIB(fuse, fuse_main, [],
-- [ AC_MSG_ERROR([libfuse is required]) ]),
-- [ AC_MSG_ERROR([libfuse is required]) ],
--[
- #ifndef _FILE_OFFSET_BITS
- #define _FILE_OFFSET_BITS 64
- #endif
--])
-
- AC_OUTPUT(Makefile src/Makefile zAppRun/Makefile)
-diff --git a/linux/iso_fs.h b/linux/iso_fs.h
---- a/linux/iso_fs.h
-+++ b/linux/iso_fs.h
-@@ -11,7 +11,10 @@
- #ifndef _ISOFS_FS_H
- #define _ISOFS_FS_H
-
-+#if !defined(__native_client__)
- #include <linux/types.h>
-+#endif
-+
- /*
- * The isofs filesystem constants/structures
- */
-diff --git a/src/Makefile.am b/src/Makefile.am
-deleted file mode 100644
---- a/src/Makefile.am
-+++ /dev/null
-@@ -1,12 +0,0 @@
--bin_PROGRAMS = fuseiso
--fuseiso_SOURCES = fuseiso.c isofs.c
--
--# set the include path found by configure
--INCLUDES= $(all_includes)
--
--# the library search path.
--fuseiso_LDFLAGS = $(all_libraries)
--noinst_HEADERS = isofs.h
--
--AM_CFLAGS = -D_FILE_OFFSET_BITS=64 `pkg-config --cflags fuse glib-2.0` -Wall
--AM_LDFLAGS = `pkg-config --libs fuse glib-2.0` -lz
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -1,461 +1,65 @@
--# Makefile.in generated by automake 1.9.6 from Makefile.am.
--# @configure_input@
--
--# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
--# 2003, 2004, 2005 Free Software Foundation, Inc.
--# This Makefile.in is free software; the Free Software Foundation
--# gives unlimited permission to copy and/or distribute it,
--# with or without modifications, as long as this notice is preserved.
--
--# This program is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
--# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
--# PARTICULAR PURPOSE.
--
--@SET_MAKE@
--
--
--srcdir = @srcdir@
--top_srcdir = @top_srcdir@
--VPATH = @srcdir@
--pkgdatadir = $(datadir)/@PACKAGE@
--pkglibdir = $(libdir)/@PACKAGE@
--pkgincludedir = $(includedir)/@PACKAGE@
--top_builddir = ..
--am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
--INSTALL = @INSTALL@
--install_sh_DATA = $(install_sh) -c -m 644
--install_sh_PROGRAM = $(install_sh) -c
--install_sh_SCRIPT = $(install_sh) -c
--INSTALL_HEADER = $(INSTALL_DATA)
--transform = $(program_transform_name)
--NORMAL_INSTALL = :
--PRE_INSTALL = :
--POST_INSTALL = :
--NORMAL_UNINSTALL = :
--PRE_UNINSTALL = :
--POST_UNINSTALL = :
--build_triplet = @build@
--host_triplet = @host@
--bin_PROGRAMS = fuseiso$(EXEEXT)
--subdir = src
--DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-- $(srcdir)/Makefile.in
--ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
--am__aclocal_m4_deps = $(top_srcdir)/configure.in
--am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-- $(ACLOCAL_M4)
--mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
--CONFIG_HEADER = $(top_builddir)/config.h
--CONFIG_CLEAN_FILES =
--am__installdirs = "$(DESTDIR)$(bindir)"
--binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
--PROGRAMS = $(bin_PROGRAMS)
--am_fuseiso_OBJECTS = fuseiso.$(OBJEXT) isofs.$(OBJEXT)
--fuseiso_OBJECTS = $(am_fuseiso_OBJECTS)
--fuseiso_LDADD = $(LDADD)
--DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
--depcomp = $(SHELL) $(top_srcdir)/depcomp
--am__depfiles_maybe = depfiles
--COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
--LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-- $(AM_CFLAGS) $(CFLAGS)
--CCLD = $(CC)
--LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-- $(AM_LDFLAGS) $(LDFLAGS) -o $@
--SOURCES = $(fuseiso_SOURCES)
--DIST_SOURCES = $(fuseiso_SOURCES)
--HEADERS = $(noinst_HEADERS)
--ETAGS = etags
--CTAGS = ctags
--DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
--ACLOCAL = @ACLOCAL@
--AMDEP_FALSE = @AMDEP_FALSE@
--AMDEP_TRUE = @AMDEP_TRUE@
--AMTAR = @AMTAR@
--AR = @AR@
--AUTOCONF = @AUTOCONF@
--AUTOHEADER = @AUTOHEADER@
--AUTOMAKE = @AUTOMAKE@
--AWK = @AWK@
-+prefix = /webports-dummydir
-+exec_prefix = ${prefix}
-+bindir = ${exec_prefix}/bin
-+libdir = ${exec_prefix}/lib
-+includedir = ${prefix}/include
-+
-+# source files.
-+SRC = fuseiso.c isofs.c
-+
-+OBJ = fuseiso.o isofs.o
-+
-+OUT = libfuseiso.a
-+
-+# include directories
-+INCLUDES = -I. -I.. @CFLAGS@
-+
-+# CCFLAGS
-+CCFLAGS = -DHAVE_CONFIG_H -Wall -DNDEBUG
-+
-+# compiler
- CC = @CC@
--CCDEPMODE = @CCDEPMODE@
--CFLAGS = @CFLAGS@
--CPP = @CPP@
--CPPFLAGS = @CPPFLAGS@
--CXX = @CXX@
--CXXCPP = @CXXCPP@
--CXXDEPMODE = @CXXDEPMODE@
--CXXFLAGS = @CXXFLAGS@
--CYGPATH_W = @CYGPATH_W@
--DEFS = @DEFS@
--DEPDIR = @DEPDIR@
--ECHO = @ECHO@
--ECHO_C = @ECHO_C@
--ECHO_N = @ECHO_N@
--ECHO_T = @ECHO_T@
--EGREP = @EGREP@
--EXEEXT = @EXEEXT@
--F77 = @F77@
--FFLAGS = @FFLAGS@
--GREP = @GREP@
--INSTALL_DATA = @INSTALL_DATA@
--INSTALL_PROGRAM = @INSTALL_PROGRAM@
--INSTALL_SCRIPT = @INSTALL_SCRIPT@
--INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+
-+# library paths
-+LIBS =
-+
-+# compile flags
- LDFLAGS = @LDFLAGS@
--LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
--LIBTOOL = @LIBTOOL@
--LN_S = @LN_S@
--LTLIBOBJS = @LTLIBOBJS@
--MAKEINFO = @MAKEINFO@
--OBJEXT = @OBJEXT@
--PACKAGE = @PACKAGE@
--PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
--PACKAGE_NAME = @PACKAGE_NAME@
--PACKAGE_STRING = @PACKAGE_STRING@
--PACKAGE_TARNAME = @PACKAGE_TARNAME@
--PACKAGE_VERSION = @PACKAGE_VERSION@
--PATH_SEPARATOR = @PATH_SEPARATOR@
--RANLIB = @RANLIB@
--SED = @SED@
--SET_MAKE = @SET_MAKE@
--SHELL = @SHELL@
--STRIP = @STRIP@
--VERSION = @VERSION@
--ac_ct_CC = @ac_ct_CC@
--ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
--am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
--am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
--am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
--am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
--am__include = @am__include@
--am__leading_dot = @am__leading_dot@
--am__quote = @am__quote@
--am__tar = @am__tar@
--am__untar = @am__untar@
--bindir = @bindir@
--build = @build@
--build_alias = @build_alias@
--build_cpu = @build_cpu@
--build_os = @build_os@
--build_vendor = @build_vendor@
--datadir = @datadir@
--datarootdir = @datarootdir@
--docdir = @docdir@
--dvidir = @dvidir@
--exec_prefix = @exec_prefix@
--host = @host@
--host_alias = @host_alias@
--host_cpu = @host_cpu@
--host_os = @host_os@
--host_vendor = @host_vendor@
--htmldir = @htmldir@
--includedir = @includedir@
--infodir = @infodir@
--install_sh = @install_sh@
--libdir = @libdir@
--libexecdir = @libexecdir@
--localedir = @localedir@
--localstatedir = @localstatedir@
--mandir = @mandir@
--mkdir_p = @mkdir_p@
--oldincludedir = @oldincludedir@
--pdfdir = @pdfdir@
--prefix = @prefix@
--program_transform_name = @program_transform_name@
--psdir = @psdir@
--sbindir = @sbindir@
--sharedstatedir = @sharedstatedir@
--sysconfdir = @sysconfdir@
--target_alias = @target_alias@
--fuseiso_SOURCES = fuseiso.c isofs.c
--
--# set the include path found by configure
--INCLUDES = $(all_includes)
-+
-+RANLIB = @RANLIB@
-
--# the library search path.
--fuseiso_LDFLAGS = $(all_libraries)
--noinst_HEADERS = isofs.h
--AM_CFLAGS = -D_FILE_OFFSET_BITS=64 `pkg-config --cflags fuse glib-2.0` -Wall
--AM_LDFLAGS = `pkg-config --libs fuse glib-2.0` -lz
--all: all-am
-+### Installation programs and flags
-+INSTALL = /usr/bin/install -c
-+INSTALL_PROGRAM = ${INSTALL}
-+INSTALL_DATA = ${INSTALL} -m 644
-+LN_S = ln -s
-+MKDIR = mkdir -p -m 755
-
--.SUFFIXES:
--.SUFFIXES: .c .lo .o .obj
--$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
-- @for dep in $?; do \
-- case '$(am__configure_deps)' in \
-- *$$dep*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-- && exit 0; \
-- exit 1;; \
-- esac; \
-- done; \
-- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
-- cd $(top_srcdir) && \
-- $(AUTOMAKE) --gnu src/Makefile
--.PRECIOUS: Makefile
--Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-- @case '$?' in \
-- *config.status*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-- *) \
-- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-- esac;
-
--$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-+LIBFUSEISO_OBJS = fuseiso.o isofs.o
-
--$(top_srcdir)/configure: $(am__configure_deps)
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
--$(ACLOCAL_M4): $(am__aclocal_m4_deps)
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
--install-binPROGRAMS: $(bin_PROGRAMS)
-- @$(NORMAL_INSTALL)
-- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
-- @list='$(bin_PROGRAMS)'; for p in $$list; do \
-- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-- if test -f $$p \
-- || test -f $$p1 \
-- ; then \
-- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
-- else :; fi; \
-- done
-+LIBFUSEISO_HDRS =
-
--uninstall-binPROGRAMS:
-- @$(NORMAL_UNINSTALL)
-- @list='$(bin_PROGRAMS)'; for p in $$list; do \
-- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-- rm -f "$(DESTDIR)$(bindir)/$$f"; \
-- done
-+LIBFUSEISO_LIBS = libfuseiso.a
-
--clean-binPROGRAMS:
-- @list='$(bin_PROGRAMS)'; for p in $$list; do \
-- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-- echo " rm -f $$p $$f"; \
-- rm -f $$p $$f ; \
-- done
--fuseiso$(EXEEXT): $(fuseiso_OBJECTS) $(fuseiso_DEPENDENCIES)
-- @rm -f fuseiso$(EXEEXT)
-- $(LINK) $(fuseiso_LDFLAGS) $(fuseiso_OBJECTS) $(fuseiso_LDADD) $(LIBS)
-+ALL = libfuseiso.a
-
--mostlyclean-compile:
-- -rm -f *.$(OBJEXT)
-+all: $(ALL)
-+default: $(OUT)
-+
-+.PHONY: clean distclean install
-
--distclean-compile:
-- -rm -f *.tab.c
-+libfuseiso.a: ${LIBFUSEISO_OBJS} ${LIBFUSEISO_OBJS}
-+ ${AR} rc libfuseiso.a ${LIBFUSEISO_OBJS}
-+ ${RANLIB} libfuseiso.a
-
--@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuseiso.Po@am__quote@
--@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isofs.Po@am__quote@
-
- .c.o:
--@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
--@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
--@am__fastdepCC_FALSE@ $(COMPILE) -c $<
--
--.c.obj:
--@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
--@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
--@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
--
--.c.lo:
--@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
--@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
--@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
--@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
--
--mostlyclean-libtool:
-- -rm -f *.lo
--
--clean-libtool:
-- -rm -rf .libs _libs
--
--distclean-libtool:
-- -rm -f libtool
--uninstall-info-am:
--
--ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-- unique=`for i in $$list; do \
-- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-- done | \
-- $(AWK) ' { files[$$0] = 1; } \
-- END { for (i in files) print i; }'`; \
-- mkid -fID $$unique
--tags: TAGS
--
--TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
-- $(TAGS_FILES) $(LISP)
-- tags=; \
-- here=`pwd`; \
-- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-- unique=`for i in $$list; do \
-- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-- done | \
-- $(AWK) ' { files[$$0] = 1; } \
-- END { for (i in files) print i; }'`; \
-- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-- test -n "$$unique" || unique=$$empty_fix; \
-- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-- $$tags $$unique; \
-- fi
--ctags: CTAGS
--CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
-- $(TAGS_FILES) $(LISP)
-- tags=; \
-- here=`pwd`; \
-- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-- unique=`for i in $$list; do \
-- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-- done | \
-- $(AWK) ' { files[$$0] = 1; } \
-- END { for (i in files) print i; }'`; \
-- test -z "$(CTAGS_ARGS)$$tags$$unique" \
-- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-- $$tags $$unique
--
--GTAGS:
-- here=`$(am__cd) $(top_builddir) && pwd` \
-- && cd $(top_srcdir) \
-- && gtags -i $(GTAGS_ARGS) $$here
--
--distclean-tags:
-- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
--
--distdir: $(DISTFILES)
-- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-- list='$(DISTFILES)'; for file in $$list; do \
-- case $$file in \
-- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-- esac; \
-- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-- dir="/$$dir"; \
-- $(mkdir_p) "$(distdir)$$dir"; \
-- else \
-- dir=''; \
-- fi; \
-- if test -d $$d/$$file; then \
-- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
-- fi; \
-- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
-- else \
-- test -f $(distdir)/$$file \
-- || cp -p $$d/$$file $(distdir)/$$file \
-- || exit 1; \
-- fi; \
-- done
--check-am: all-am
--check: check-am
--all-am: Makefile $(PROGRAMS) $(HEADERS)
--installdirs:
-- for dir in "$(DESTDIR)$(bindir)"; do \
-- test -z "$$dir" || $(mkdir_p) "$$dir"; \
-- done
--install: install-am
--install-exec: install-exec-am
--install-data: install-data-am
--uninstall: uninstall-am
--
--install-am: all-am
-- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
--
--installcheck: installcheck-am
--install-strip:
-- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-- `test -z '$(STRIP)' || \
-- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
--mostlyclean-generic:
--
--clean-generic:
--
--distclean-generic:
-- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
--
--maintainer-clean-generic:
-- @echo "This command is intended for maintainers to use"
-- @echo "it deletes files that may require special tools to rebuild."
--clean: clean-am
--
--clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
--
--distclean: distclean-am
-- -rm -rf ./$(DEPDIR)
-- -rm -f Makefile
--distclean-am: clean-am distclean-compile distclean-generic \
-- distclean-libtool distclean-tags
--
--dvi: dvi-am
--
--dvi-am:
--
--html: html-am
--
--info: info-am
--
--info-am:
--
--install-data-am:
--
--install-exec-am: install-binPROGRAMS
--
--install-info: install-info-am
--
--install-man:
--
--installcheck-am:
--
--maintainer-clean: maintainer-clean-am
-- -rm -rf ./$(DEPDIR)
-- -rm -f Makefile
--maintainer-clean-am: distclean-am maintainer-clean-generic
--
--mostlyclean: mostlyclean-am
--
--mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-- mostlyclean-libtool
--
--pdf: pdf-am
--
--pdf-am:
--
--ps: ps-am
--
--ps-am:
--
--uninstall-am: uninstall-binPROGRAMS uninstall-info-am
--
--.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-- clean-generic clean-libtool ctags distclean distclean-compile \
-- distclean-generic distclean-libtool distclean-tags distdir dvi \
-- dvi-am html html-am info info-am install install-am \
-- install-binPROGRAMS install-data install-data-am install-exec \
-- install-exec-am install-info install-info-am install-man \
-- install-strip installcheck installcheck-am installdirs \
-- maintainer-clean maintainer-clean-generic mostlyclean \
-- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-- pdf pdf-am ps ps-am tags uninstall uninstall-am \
-- uninstall-binPROGRAMS uninstall-info-am
--
--# Tell versions [3.59,3.63) of GNU make to not export all variables.
--# Otherwise a system limit (for SysV at least) may be exceeded.
--.NOEXPORT:
-+ $(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@
-+
-+clean:
-+ rm -f $(OBJ) $(ALL)
-+
-+install: ${ALL}
-+ ${MKDIR} ${DESTDIR}${libdir}
-+ ${INSTALL_DATA} libfuseiso.a ${DESTDIR}${libdir}
-\ No newline at end of file
-diff --git a/src/fuseiso.c b/src/fuseiso.c
---- a/src/fuseiso.c
-+++ b/src/fuseiso.c
-@@ -18,7 +18,7 @@
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
--
-+#if !defined(__native_client__)
- #ifdef HAVE_CONFIG_H
- #include <config.h>
- #endif
-@@ -46,6 +46,17 @@
- #include <langinfo.h>
-
- #include "isofs.h"
-+#endif
-+
-+#if defined(__native_client__)
-+#define FUSE_USE_VERSION 26
-+
-+#include <fcntl.h>
-+#include "isofs.h"
-+#include "nacl_io/fuse.h"
-+#include "nacl_io/nacl_io.h"
-+#include <stdio.h>
-+#endif
-
- #ifdef __GNUC__
- # define UNUSED(x) x __attribute__((unused))
-@@ -53,6 +64,7 @@
- # define UNUSED(x) x
- #endif
-
-+#if !defined(__native_client__)
- static char *imagefile = NULL;
- static char *mount_point = NULL;
- static int image_fd = -1;
-@@ -213,6 +225,7 @@ int del_mtab_record() {
- free(mtab_path);
- return 0;
- };
-+#endif
-
- static int isofs_getattr(const char *path, struct stat *stbuf)
- {
-@@ -239,6 +252,7 @@ static int isofs_flush(const char *UNUSED(path), struct fuse_file_info *UNUSED(f
- };
-
- static void* isofs_init() {
-+#if !defined(__native_client__)
- int rc;
- if(maintain_mtab) {
- rc = add_mtab_record();
-@@ -246,13 +260,16 @@ static void* isofs_init() {
- exit(EXIT_FAILURE);
- };
- };
-+#endif
- return isofs_real_init();
- };
-
- static void isofs_destroy(void* param) {
-+#if !defined(__native_client__)
- if(maintain_mtab) {
- del_mtab_record();
- };
-+#endif
- return;
- };
-
-@@ -267,7 +284,12 @@ static int isofs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, of
-
- static int isofs_statfs(const char *UNUSED(path), struct statfs *stbuf)
- {
-+// TODO change statfs to statvfs in isofs.c
-+#if !defined(__native_client__)
- return isofs_real_statfs(stbuf);
-+#else
-+ return 0;
-+#endif
- }
-
- static struct fuse_operations isofs_oper = {
-@@ -283,6 +305,7 @@ static struct fuse_operations isofs_oper = {
- .statfs = isofs_statfs,
- };
-
-+#if !defined(__native_client__)
- void usage(const char* prog) {
- printf("Version: %s\nUsage: %s [-n] [-p] [-c <iocharset>] [-h] <isofs_image_file> <mount_point> [<FUSE library options>]\n"
- "Where options are:\n"
-@@ -419,3 +442,13 @@ int main(int argc, char *argv[])
-
- return fuse_main(nargc, nargv, &isofs_oper);
- };
-+#endif
-+
-+#if defined(__native_client__)
-+int nacl_fuseiso_lib_init(char *iso_path, char *mount_point, char *fs_name) {
-+ nacl_io_register_fs_type(fs_name, &isofs_oper);
-+ int iso_fd = open(iso_path, O_RDONLY);
-+ isofs_real_preinit(iso_path, iso_fd);
-+ return mount("", mount_point, fs_name, 0, NULL);
-+};
-+#endif
-\ No newline at end of file
-diff --git a/src/isofs.c b/src/isofs.c
---- a/src/isofs.c
-+++ b/src/isofs.c
-@@ -20,6 +20,9 @@
-
- // for struct tm->tm_gmtoff
- #define _BSD_SOURCE
-+#if defined(__native_client__)
-+#define __TM_GMTOFF tm_gmtoff
-+#endif
-
- #include <stdio.h>
- #include <fcntl.h>
-@@ -32,11 +35,19 @@
- #include <zlib.h>
- #include <dirent.h>
- #include <pthread.h>
-+
-+#if !defined(__native_client__)
- #include <sys/statfs.h>
-+#endif
-+
- #include <iconv.h>
-
- #include "isofs.h"
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#include <bits/limits.h>
-+#endif
-+
- static isofs_context context;
- static GHashTable *lookup_table;
- static GHashTable *negative_lookup_table;
-@@ -46,7 +57,12 @@ static pthread_mutex_t fd_mutex = PTHREAD_MUTEX_INITIALIZER;
- static int isofs_check_rr(struct iso_directory_record *root_record);
- static int isofs_read_raw_block(int block, char *buf);
-
-+// leave the charset as NULL for now
-+#if defined(__native_client__)
-+static char* iocharset = NULL;
-+#else
- extern char* iocharset;
-+#endif
-
- // locally implement g_strv_length, this is missing in glib2 for rhel3/rhel4
- // -- Chandan Dutta Chowdhury 2007-07-06
-@@ -1806,6 +1822,7 @@ int isofs_real_read(const char *path, char *out_buf, size_t size, off_t offset)
- return total_size;
- };
-
-+#if !defined(__native_client__)
- int isofs_real_statfs(struct statfs *stbuf) {
- stbuf->f_type = ISOFS_SUPER_MAGIC;
- stbuf->f_bsize = context.data_size; // or PAGE_CACHE_SIZE?
-@@ -1817,3 +1834,4 @@ int isofs_real_statfs(struct statfs *stbuf) {
- stbuf->f_namelen = NAME_MAX - 1; // ? not sure..
- return 0;
- };
-+#endif
-diff --git a/src/isofs.h b/src/isofs.h
---- a/src/isofs.h
-+++ b/src/isofs.h
-@@ -25,6 +25,18 @@
- #include <linux/iso_fs.h>
- #include <linux/rock.h>
-
-+#if defined(__native_client__)
-+#include <sys/types.h>
-+#endif
-+
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#include <sys/endian.h>
-+#endif
-+
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
-+#include <byteswap.h>
-+#endif
-+
- typedef int (*isofs_dir_fill_t) (void *buf, const char *name,
- const struct stat *stat, off_t off);
-
-@@ -97,7 +109,9 @@ typedef struct _zf_file_header {
- /* Number conversion inlines, named after the section in ISO 9660
- they correspond to. */
-
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- #include <byteswap.h>
-+#endif
-
- static inline int isonum_711(unsigned char *p)
- {
-@@ -111,6 +125,8 @@ static inline unsigned int isonum_721(char *p)
- {
- #if defined(WORDS_BIGENDIAN)
- return *(unsigned short *)p;
-+#elif defined(__native_client__)
-+ return __byte_swap_16(*(unsigned short *)p);
- #else
- return bswap_16(*(unsigned short *)p);
- #endif
-@@ -159,6 +175,8 @@ int isofs_real_getattr(const char *path, struct stat *stbuf);
- int isofs_real_readlink(const char *path, char *target, size_t size);
- int isofs_real_open(const char *path);
- int isofs_real_read(const char *path, char *out_buf, size_t size, off_t offset);
-+#if !defined(__native_client__)
- int isofs_real_statfs(struct statfs *stbuf);
-+#endif
-
- #endif // _ISOFS_H
diff --git a/ports/fuseiso/pkg_info b/ports/fuseiso/pkg_info
deleted file mode 100644
index 873052f..0000000
--- a/ports/fuseiso/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=fuseiso
-VERSION=20070708
-URL=http://download.sf.net/project/fuseiso/fuseiso/20070708/fuseiso-20070708.tar.bz2
-LICENSE=BSD
-DEPENDS=(ncurses nacl-spawn glib glibc-compat zlib)
-SHA1=fe142556ad35dd7e5dc31a16183232a6e2da7692
diff --git a/ports/fvwm/build.sh b/ports/fvwm/build.sh
deleted file mode 100644
index 15ebe77..0000000
--- a/ports/fvwm/build.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXTRA_CONFIGURE_ARGS+=" --with-x"
-EXTRA_CONFIGURE_ARGS+=" --x-includes=${NACLPORTS_INCLUDE}"
-EXTRA_CONFIGURE_ARGS+=" --x-libraries=${NACLPORTS_LIBDIR}"
-EXTRA_CONFIGURE_ARGS+=" --with-bidi=no"
-EXTRA_CONFIGURE_ARGS+=" --with-gnome=no"
-EXTRA_CONFIGURE_ARGS+=" --disable-shm"
-
-export ac_cv_func_setpgrp_void=no
-
-EXECUTABLES="\
- modules/FvwmIconMan/FvwmIconMan${NACL_EXEEXT} \
- modules/FvwmDragWell/FvwmDragWell${NACL_EXEEXT} \
- modules/FvwmScroll/FvwmScroll${NACL_EXEEXT} \
- modules/FvwmBacker/FvwmBacker${NACL_EXEEXT} \
- modules/FvwmSaveDesk/FvwmSaveDesk${NACL_EXEEXT} \
- modules/FvwmBanner/FvwmBanner${NACL_EXEEXT} \
- modules/FvwmAuto/FvwmAuto${NACL_EXEEXT} \
- modules/FvwmCpp/FvwmCpp${NACL_EXEEXT} \
- modules/FvwmProxy/FvwmProxy${NACL_EXEEXT} \
- modules/FvwmButtons/FvwmButtons${NACL_EXEEXT} \
- modules/FvwmConsole/FvwmConsole${NACL_EXEEXT} \
- modules/FvwmConsole/FvwmConsoleC${NACL_EXEEXT} \
- modules/FvwmSave/FvwmSave${NACL_EXEEXT} \
- modules/FvwmIdent/FvwmIdent${NACL_EXEEXT} \
- modules/FvwmIconBox/FvwmIconBox${NACL_EXEEXT} \
- modules/FvwmForm/FvwmForm${NACL_EXEEXT} \
- modules/FvwmPager/FvwmPager${NACL_EXEEXT} \
- modules/FvwmRearrange/FvwmRearrange${NACL_EXEEXT} \
- modules/FvwmCommand/FvwmCommandS${NACL_EXEEXT} \
- modules/FvwmCommand/FvwmCommand${NACL_EXEEXT} \
- modules/FvwmTaskBar/FvwmTaskBar${NACL_EXEEXT} \
- modules/FvwmWinList/FvwmWinList${NACL_EXEEXT} \
- modules/FvwmScript/FvwmScript${NACL_EXEEXT} \
- modules/FvwmWharf/FvwmWharf${NACL_EXEEXT} \
- modules/FvwmAnimate/FvwmAnimate${NACL_EXEEXT} \
- modules/FvwmEvent/FvwmEvent${NACL_EXEEXT} \
- modules/FvwmTheme/FvwmTheme${NACL_EXEEXT} \
- modules/FvwmM4/FvwmM4${NACL_EXEEXT} \
- fvwm/fvwm${NACL_EXEEXT} \
- bin/fvwm-root${NACL_EXEEXT}"
-
-NACLPORTS_LIBS+="\
- -lXext -lXmu -lSM -lICE -lXt -lX11 -lxcb -lXau -lm"
-
-EnableCliMain
-EnableGlibcCompat
-
-if [ "${TOOLCHAIN}" = "pnacl" ]; then
- NACLPORTS_CPPFLAGS+=" -Wno-return-type"
-fi
-
-InstallStep() {
- DefaultInstallStep
- # Remove dangling symlinks
- Remove ${DESTDIR}${PREFIX}/bin/fvwm2 ${DESTDIR}${PREFIX}/bin/xpmroot
-}
diff --git a/ports/fvwm/nacl.patch b/ports/fvwm/nacl.patch
deleted file mode 100644
index 1749cf6..0000000
--- a/ports/fvwm/nacl.patch
+++ /dev/null
@@ -1,261 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -6492,7 +6492,7 @@ int i; static j; int *p; char *c;
- switch (*p = p = *c) { case 0: printf("%Q", c, p); }
- *c = &i; c = p;
- while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
-- return;
-+ return 0;
- ;
- return 0;
- }
-@@ -12610,10 +12610,10 @@ done
- $as_echo_n "checking if mkstemp is safe... " >&6; }
- if test x$ac_cv_func_mkstemp != xno; then
- if test "$cross_compiling" = yes; then :
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "cannot run test program while cross compiling
--See \`config.log' for more details" "$LINENO" 5; }
-+# { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+#as_fn_error $? "cannot run test program while cross compiling
-+#See \`config.log' for more details" "$LINENO" 5; }
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-@@ -13461,10 +13461,10 @@ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-
-
- if test "$cross_compiling" = yes; then :
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "cannot run test program while cross compiling
--See \`config.log' for more details" "$LINENO" 5; }
-+# { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+#as_fn_error $? "cannot run test program while cross compiling
-+#See \`config.log' for more details" "$LINENO" 5; }
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-diff --git a/fvwm/fvwm.h b/fvwm/fvwm.h
---- a/fvwm/fvwm.h
-+++ b/fvwm/fvwm.h
-@@ -201,7 +201,21 @@ typedef struct
- unsigned has_no_border : 1;
- unsigned has_window_font : 1;
- unsigned title_dir : 2;
-+
-+#if defined(__pnacl__)
-+ // PNaCl can't handle bit fields that are >64 bits, break it up.
-+ // https://code.google.com/p/nativeclient/issues/detail?id=3714
-+ char pad1;
-+#endif
-+
- unsigned user_states : 32;
-+
-+#if defined(__pnacl__)
-+ // PNaCl can't handle bit fields that are >64 bits, break it up.
-+ // https://code.google.com/p/nativeclient/issues/detail?id=3714
-+ char pad2;
-+#endif
-+
- /* static flags that do not change dynamically after the window has
- * been created */
- struct
-@@ -237,6 +251,13 @@ typedef struct
- unsigned has_override_size : 1;
- unsigned has_stippled_title : 1;
- unsigned has_stippled_icon_title : 1;
-+
-+#if defined(__pnacl__)
-+ // PNaCl can't handle bit fields that are >64 bits, break it up.
-+ // https://code.google.com/p/nativeclient/issues/detail?id=3714
-+ char pad3;
-+#endif
-+
- /* default has to be 0, therefore no_, not in macros */
- unsigned has_no_sticky_stippled_title : 1;
- unsigned has_no_sticky_stippled_icon_title : 1;
-@@ -346,6 +367,13 @@ typedef struct
- unsigned is_pixmap_ours : 1;
- /* fvwm places the window itself */
- unsigned is_placed_by_fvwm : 1;
-+
-+#if defined(__pnacl__)
-+ // PNaCl can't handle bit fields that are >64 bits, break it up.
-+ // https://code.google.com/p/nativeclient/issues/detail?id=3714
-+ char pad;
-+#endif
-+
- /* mark window to be destroyed after last complex func has finished. */
- unsigned is_scheduled_for_destroy : 1;
- /* mark window to be raised after function execution. */
-@@ -382,6 +410,13 @@ typedef struct
- * icon in its list of icons */
- unsigned has_ewmh_mini_icon : 1;
- unsigned has_ewmh_wm_pid : 1;
-+
-+#if defined(__pnacl__)
-+ // PNaCl can't handle bit fields that are >64 bits, break it up.
-+ // https://code.google.com/p/nativeclient/issues/detail?id=3714
-+ char pad2;
-+#endif
-+
- /* the ewmh icon is used as icon pixmap */
- unsigned use_ewmh_icon : 1;
- unsigned is_ewmh_modal : 1;
-@@ -540,6 +575,13 @@ typedef struct style_flags
- unsigned has_color_fore : 1;
- unsigned has_color_back_hi : 1;
- unsigned has_color_fore_hi : 1;
-+
-+#if defined(__pnacl__)
-+ // PNaCl can't handle bit fields that are >64 bits, break it up.
-+ // https://code.google.com/p/nativeclient/issues/detail?id=3714
-+ char pad1;
-+#endif
-+
- unsigned has_decor : 1;
- unsigned has_edge_delay_ms_move : 1;
- unsigned has_edge_delay_ms_resize : 1;
-@@ -572,6 +614,13 @@ typedef struct style_flags
- #define BACKINGSTORE_ON 1
- #define BACKINGSTORE_OFF 2
- #define BACKINGSTORE_MASK 0x3
-+
-+#if defined(__pnacl__)
-+ // PNaCl can't handle bit fields that are >64 bits, break it up.
-+ // https://code.google.com/p/nativeclient/issues/detail?id=3714
-+ char pad2;
-+#endif
-+
- unsigned use_backing_store : 2;
- unsigned use_parent_relative : 1;
- unsigned use_colorset : 1;
-diff --git a/libs/System.c b/libs/System.c
---- a/libs/System.c
-+++ b/libs/System.c
-@@ -46,11 +46,15 @@ fd_set_size_t fvwmlib_max_fd = (fd_set_size_t)-9999999;
-
- fd_set_size_t GetFdWidth(void)
- {
-+#if defined(__native_client__)
-+ return 10000;
-+#else
- #if HAVE_SYSCONF
- return min(sysconf(_SC_OPEN_MAX),FD_SETSIZE);
- #else
- return min(getdtablesize(),FD_SETSIZE);
- #endif
-+#endif
- }
-
- void fvwmlib_init_max_fd(void)
-diff --git a/libs/fvwmlib.h b/libs/fvwmlib.h
---- a/libs/fvwmlib.h
-+++ b/libs/fvwmlib.h
-@@ -24,7 +24,7 @@ int atexit(void(*func)());
- #endif
-
- #ifndef HAVE_GETHOSTNAME
--int gethostname(char* name, int len);
-+int gethostname(char* name, size_t len);
- #endif
-
- #ifndef HAVE_STRCASECMP
-diff --git a/libs/gethostname.c b/libs/gethostname.c
---- a/libs/gethostname.c
-+++ b/libs/gethostname.c
-@@ -27,7 +27,7 @@
- Null terminate it if the name is shorter than LEN.
- Return 0 if ok, -1 if error. */
-
--int gethostname(char *name, int len)
-+int gethostname(char *name, size_t len)
- {
- #ifdef HAVE_UNAME
- struct utsname uts;
-diff --git a/modules/FvwmConsole/FvwmConsole.c b/modules/FvwmConsole/FvwmConsole.c
---- a/modules/FvwmConsole/FvwmConsole.c
-+++ b/modules/FvwmConsole/FvwmConsole.c
-@@ -223,11 +223,15 @@ void server(void)
- }
- else
- {
-+#if !defined(__native_client__)
- /* don't wait forever for connections */
- alarm(FVWMCONSOLE_CONNECTION_TO_SECS);
-+#endif
- /* listen to the socket */
- rc = listen(s, 5);
-+#if !defined(__native_client__)
- alarm(0);
-+#endif
- if (rc < 0)
- {
- ErrMsg("listen");
-diff --git a/modules/FvwmForm/FvwmForm.c b/modules/FvwmForm/FvwmForm.c
---- a/modules/FvwmForm/FvwmForm.c
-+++ b/modules/FvwmForm/FvwmForm.c
-@@ -134,7 +134,9 @@ static void SetupTimer(void)
- #endif
- #endif
-
-+#if !defined(__native_client__)
- alarm(1);
-+#endif
- }
-
- /* copy a string until '"', or '\n', or '\0' */
-@@ -2585,7 +2587,9 @@ TimerHandler(int sig)
- }
- else {
- RedrawTimeout(timer);
-+#if !defined(__native_client__)
- alarm(1);
-+#endif
- }
-
- SIGNAL_RETURN;
-diff --git a/modules/FvwmScroll/GrabWindow.c b/modules/FvwmScroll/GrabWindow.c
---- a/modules/FvwmScroll/GrabWindow.c
-+++ b/modules/FvwmScroll/GrabWindow.c
-@@ -80,7 +80,7 @@ extern char *BackColor;
- ButtonPressMask | ButtonMotionMask | FocusChangeMask)
-
- Atom wm_del_win;
--Atom _XA_WM_PROTOCOLS;
-+extern Atom _XA_WM_PROTOCOLS;
- Atom _XA_WM_COLORMAP_WINDOWS;
-
- /*
-diff --git a/modules/FvwmTaskBar/FvwmTaskBar.c b/modules/FvwmTaskBar/FvwmTaskBar.c
---- a/modules/FvwmTaskBar/FvwmTaskBar.c
-+++ b/modules/FvwmTaskBar/FvwmTaskBar.c
-@@ -2528,9 +2528,13 @@ void HideTaskBar(void)
- static void
- SetAlarm(tb_alarm_t event)
- {
-+#if !defined(__native_client__)
- alarm(0); /* remove a race-condition */
-+#endif
- AlarmSet |= event;
-+#if !defined(__native_client__)
- alarm(1);
-+#endif
- }
-
- /*
-@@ -2542,7 +2546,9 @@ ClearAlarm(tb_alarm_t event)
- AlarmSet &= ~event;
- if (AlarmSet == 0)
- {
-+#if !defined(__native_client__)
- alarm(0);
-+#endif
- }
- }
-
diff --git a/ports/fvwm/pkg_info b/ports/fvwm/pkg_info
deleted file mode 100644
index 3d296ee..0000000
--- a/ports/fvwm/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=fvwm
-VERSION=2.6.5
-URL=ftp://ftp.fvwm.org/pub/fvwm/version-2/fvwm-2.6.5.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat libpng fontconfig xbitmaps libx11 libxcb libxmu libxext libxau libxt libice libsm nacl-spawn)
-DISABLED_TOOLCHAIN=(emscripten)
-SHA1=c4cf96df65817d501b41c6fd79cf22658dd516a8
diff --git a/ports/gawk/build.sh b/ports/gawk/build.sh
deleted file mode 100644
index 96be38e..0000000
--- a/ports/gawk/build.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2015 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.
-
-# getopt.c and getopt1.c have been commented for build
-if [ ${TOOLCHAIN} != "glibc" ]; then
- NACLPORTS_CFLAGS+=" -D__GNU_LIBRARY__ "
-fi
-
-EnableCliMain
diff --git a/ports/gawk/nacl.patch b/ports/gawk/nacl.patch
deleted file mode 100644
index 25fa942..0000000
--- a/ports/gawk/nacl.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -472,7 +472,6 @@ SUBDIRS = \
- awklib \
- doc \
- po \
-- extension \
- test
-
- include_HEADERS = gawkapi.h
-diff --git a/dfa.c b/dfa.c
---- a/dfa.c
-+++ b/dfa.c
-@@ -25,6 +25,7 @@
- #include <assert.h>
- #include <ctype.h>
- #include <stdio.h>
-+#include <stddef.h>
-
- #ifndef VMS
- #include <sys/types.h>
-diff --git a/getopt.c b/getopt.c
---- a/getopt.c
-+++ b/getopt.c
-@@ -21,6 +21,7 @@
-
- /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
- Ditto for AIX 3.2 and <stdlib.h>. */
-+#ifndef __native_client__
- #ifndef _NO_PROTO
- # define _NO_PROTO
- #endif
-@@ -1291,3 +1292,4 @@ main (int argc, char **argv)
- }
-
- #endif /* TEST */
-+#endif
-diff --git a/getopt1.c b/getopt1.c
---- a/getopt1.c
-+++ b/getopt1.c
-@@ -16,6 +16,7 @@
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-+#ifndef __native_client__
- #ifdef HAVE_CONFIG_H
- #include <config.h>
- #endif
-@@ -193,3 +194,4 @@ main (int argc, char **argv)
- }
-
- #endif /* TEST */
-+#endif
-diff --git a/io.c b/io.c
---- a/io.c
-+++ b/io.c
-@@ -29,6 +29,7 @@
- #endif
-
- #include "awk.h"
-+#include <sys/time.h>
-
- #ifdef HAVE_SYS_PARAM_H
- #undef RE_DUP_MAX /* avoid spurious conflict w/regex.h */
-diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
---- a/posix/gawkmisc.c
-+++ b/posix/gawkmisc.c
-@@ -24,6 +24,27 @@
- #include <io.h>
- #endif
-
-+// fix for fcntl not implemented problems
-+#if defined(__native_client__)
-+#include "nacl_io/kernel_intercept.h"
-+#include "nacl_io/kernel_wrap.h"
-+#include <stdarg.h>
-+
-+/*
-+ * TODO(bradnelson): Drop this when fcntl is sorted out in nacl_io.
-+ * Explicitly use nacl_fcntl.
-+ * When built as a shared library, without this emacs seems to hit stubs.
-+ */
-+int nacl_fcntl(int fd, int cmd, ...) {
-+ va_list ap;
-+ va_start(ap, cmd);
-+ int rtn = ki_fcntl(fd, cmd, ap);
-+ va_end(ap);
-+ return rtn;
-+}
-+#define fcntl nacl_fcntl
-+#endif
-+
- char quote = '\'';
- char *defpath = DEFPATH;
- char *deflibpath = DEFLIBPATH;
diff --git a/ports/gawk/pkg_info b/ports/gawk/pkg_info
deleted file mode 100644
index f04fc07..0000000
--- a/ports/gawk/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=gawk
-VERSION=4.1.1
-URL=http://ftp.gnu.org/gnu/gawk/gawk-4.1.1.tar.gz
-LICENSE=GPL
-DEPENDS=(nacl-spawn readline mpfr gmp ncurses)
-SHA1=0480d23fffbf04bfd0d4ede4c1c3d57eb81cc771
diff --git a/ports/gc/README b/ports/gc/README
deleted file mode 100644
index 181d0ee..0000000
--- a/ports/gc/README
+++ /dev/null
@@ -1,6 +0,0 @@
-NOTE: libgc for Native Client has been modified to support cooperative
- thread parking for multi-threaded programs. If you plan on using
- more than one thread with this implementation of libgc, make sure
- to pass -finstrument-for-thread-suspension to nacl-gcc or your
- program will probably hang on the first garbage collection.
-
diff --git a/ports/gc/build.sh b/ports/gc/build.sh
deleted file mode 100644
index d1639c8..0000000
--- a/ports/gc/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXTRA_CONFIGURE_ARGS="--enable-threads=pthreads"
diff --git a/ports/gc/nacl.patch b/ports/gc/nacl.patch
deleted file mode 100644
index 7015e4e..0000000
--- a/ports/gc/nacl.patch
+++ /dev/null
@@ -1,751 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -3988,7 +3988,7 @@ _ACEOF
- _ACEOF
-
- ;;
-- *-*-linux*)
-+ *-*-linux* | *-*-nacl*)
- cat >>confdefs.h <<\_ACEOF
- #define GC_LINUX_THREADS 1
- _ACEOF
-@@ -4512,6 +4512,12 @@ _ACEOF
- ia64-*-*)
- machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
- ;;
-+ *-*-nacl*)
-+ cat >>confdefs.h <<\_ACEOF
-+#define NO_EXECUTE_PERMISSION 1
-+_ACEOF
-+
-+ ;;
- esac
- if test x"$machdep" = x; then
- echo "$as_me:$LINENO: result: $machdep" >&5
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -86,7 +86,7 @@ case "$THREADS" in
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
- ;;
-- *-*-linux*)
-+ *-*-linux* | *-*-nacl*)
- AC_DEFINE(GC_LINUX_THREADS)
- AC_DEFINE(_REENTRANT)
- ;;
-@@ -332,6 +332,9 @@ case "$host" in
- ia64-*-*)
- machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
- ;;
-+ *-*-nacl*)
-+ AC_DEFINE(NO_EXECUTE_PERMISSION)
-+ ;;
- esac
- if test x"$machdep" = x; then
- AC_MSG_RESULT($machdep)
-diff --git a/gc_dlopen.c b/gc_dlopen.c
---- a/gc_dlopen.c
-+++ b/gc_dlopen.c
-@@ -25,7 +25,7 @@
-
- #include "private/gc_priv.h"
-
--# if (defined(GC_PTHREADS) && !defined(GC_DARWIN_THREADS)) \
-+# if defined(DYNAMIC_LOADING) && (defined(GC_PTHREADS) && !defined(GC_DARWIN_THREADS)) \
- || defined(GC_SOLARIS_THREADS)
-
- # if defined(dlopen) && !defined(GC_USE_LD_WRAP)
-diff --git a/include/gc_pthread_redirects.h b/include/gc_pthread_redirects.h
---- a/include/gc_pthread_redirects.h
-+++ b/include/gc_pthread_redirects.h
-@@ -57,6 +57,12 @@
- #endif
- int GC_pthread_join(pthread_t thread, void **retval);
- int GC_pthread_detach(pthread_t thread);
-+#if defined(__native_client__) || defined(NACL)
-+ void GC_pthread_exit(void *status);
-+# undef pthread_exit
-+# define pthread_exit GC_pthread_exit
-+#endif
-+
-
- #if defined(GC_OSF1_THREADS) \
- && defined(_PTHREAD_USE_MANGLED_NAMES_) && !defined(_PTHREAD_USE_PTDNAM_)
-diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
---- a/include/private/gc_priv.h
-+++ b/include/private/gc_priv.h
-@@ -1942,6 +1942,8 @@ void GC_err_puts GC_PROTO((GC_CONST char *s));
- /* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
- * It is aliased to SIGLOST in asm/signal.h, though. */
- # define SIG_SUSPEND SIGLOST
-+# elif defined(NACL)
-+# define SIG_SUSPEND 0
- # else
- /* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */
- # define SIG_SUSPEND SIGPWR
-diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
---- a/include/private/gcconfig.h
-+++ b/include/private/gcconfig.h
-@@ -61,9 +61,16 @@
- # endif
-
- /* Determine the machine type: */
-+# if defined(__native_client__)
-+# define NACL
-+# if !defined(__arm__) && !defined(__thumb__)
-+# define I386
-+# endif
-+# define mach_type_known
-+# endif
- # if defined(__arm__) || defined(__thumb__)
- # define ARM32
--# if !defined(LINUX) && !defined(NETBSD)
-+# if !defined(LINUX) && !defined(NETBSD) && !defined(NACL)
- # define NOSYS
- # define mach_type_known
- # endif
-@@ -1029,17 +1036,23 @@
- # endif
-
- # ifdef I386
--# define MACH_TYPE "I386"
--# if defined(__LP64__) || defined(_WIN64)
--# define CPP_WORDSZ 64
--# define ALIGNMENT 8
--# else
-+# if defined(NACL)
-+# define MACH_TYPE "NACL"
- # define CPP_WORDSZ 32
- # define ALIGNMENT 4
-+# else
-+# define MACH_TYPE "I386"
-+# if defined(__LP64__) || defined(_WIN64)
-+# define CPP_WORDSZ 64
-+# define ALIGNMENT 8
-+# else
-+# define CPP_WORDSZ 32
-+# define ALIGNMENT 4
- /* Appears to hold for all "32 bit" compilers */
- /* except Borland. The -a4 option fixes */
- /* Borland. */
- /* Ivan Demakov: For Watcom the option is -zp4. */
-+# endif
- # endif
- # ifndef SMALL_CONFIG
- # define ALIGN_DOUBLE /* Not strictly necessary, but may give speed */
-@@ -1131,6 +1144,33 @@
- # endif /* USE_MMAP */
- # endif /* DGUX */
-
-+# ifdef NACL
-+# define OS_TYPE "NACL"
-+ extern int etext[];
-+# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
-+ extern int _end[];
-+# define DATAEND (_end)
-+# ifdef STACK_GRAN
-+# undef STACK_GRAN
-+# endif /* STACK_GRAN */
-+# define STACK_GRAN 0x10000
-+# define HEURISTIC1
-+# ifdef USE_MMAP
-+# undef USE_MMAP
-+# endif
-+# ifdef USE_MUNMAP
-+# undef USE_MUNMAP
-+# endif
-+# ifdef USE_MMAP_ANON
-+# undef USE_MMAP_ANON
-+# endif
-+# ifdef USE_MMAP_FIXED
-+# undef USE_MMAP_FIXED
-+# endif
-+# define GETPAGESIZE() 65536
-+# define MAX_NACL_GC_THREADS 1024
-+# endif
-+
- # ifdef LINUX
- # ifndef __GNUC__
- /* The Intel compiler doesn't like inline assembly */
-@@ -1862,6 +1902,33 @@
- # endif
- # define USE_GENERIC_PUSH_REGS
- # endif
-+# ifdef NACL
-+ /* Copied from NACL x86 block above */
-+# define OS_TYPE "NACL"
-+ extern int etext[];
-+# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
-+ extern int _end[];
-+# define DATAEND (_end)
-+# ifdef STACK_GRAN
-+# undef STACK_GRAN
-+# endif /* STACK_GRAN */
-+# define STACK_GRAN 0x10000
-+# define HEURISTIC1
-+# ifdef USE_MMAP
-+# undef USE_MMAP
-+# endif
-+# ifdef USE_MUNMAP
-+# undef USE_MUNMAP
-+# endif
-+# ifdef USE_MMAP_ANON
-+# undef USE_MMAP_ANON
-+# endif
-+# ifdef USE_MMAP_FIXED
-+# undef USE_MMAP_FIXED
-+# endif
-+# define GETPAGESIZE() 65536
-+# define MAX_NACL_GC_THREADS 1024
-+# endif
- # ifdef LINUX
- # define OS_TYPE "LINUX"
- # define LINUX_STACKBOTTOM
-@@ -2238,7 +2305,7 @@
- # if defined(GC_IRIX_THREADS) && !defined(IRIX5)
- --> inconsistent configuration
- # endif
--# if defined(GC_LINUX_THREADS) && !defined(LINUX)
-+# if defined(GC_LINUX_THREADS) && !(defined(LINUX) || defined(NACL))
- --> inconsistent configuration
- # endif
- # if defined(GC_NETBSD_THREADS) && !defined(NETBSD)
-diff --git a/include/private/pthread_stop_world.h b/include/private/pthread_stop_world.h
---- a/include/private/pthread_stop_world.h
-+++ b/include/private/pthread_stop_world.h
-@@ -6,6 +6,15 @@ struct thread_stop_info {
- /* last successfully handled a suspend */
- /* signal. */
- ptr_t stack_ptr; /* Valid only when stopped. */
-+#ifdef NACL
-+/* Grab NACL_GC_REG_STORAGE_SIZE pointers off the stack when going into */
-+/* a syscall. 20 is more than we need, but it's an overestimate in case*/
-+/* the instrumented function uses any callee saved registers, they may */
-+/* be pushed to the stack much earlier. Also, on amd64 'push' puts 8 */
-+/* bytes on the stack even though our pointers are 4 bytes. */
-+#define NACL_GC_REG_STORAGE_SIZE 20
-+ ptr_t reg_storage[NACL_GC_REG_STORAGE_SIZE];
-+#endif
- };
-
- #endif
-diff --git a/include/private/pthread_support.h b/include/private/pthread_support.h
---- a/include/private/pthread_support.h
-+++ b/include/private/pthread_support.h
-@@ -86,6 +86,9 @@ typedef struct GC_Thread_Rep {
-
- # define THREAD_TABLE_SZ 128 /* Must be power of 2 */
- extern volatile GC_thread GC_threads[THREAD_TABLE_SZ];
-+#ifdef NACL
-+extern __thread GC_thread gc_thread_self;
-+#endif
-
- extern GC_bool GC_thr_initialized;
-
-diff --git a/os_dep.c b/os_dep.c
---- a/os_dep.c
-+++ b/os_dep.c
-@@ -131,7 +131,7 @@
- # include <errno.h>
- #endif
-
--#ifdef UNIX_LIKE
-+#if defined(UNIX_LIKE) || defined(NACL)
- # include <fcntl.h>
- # if defined(SUNOS5SIGS) && !defined(FREEBSD)
- # include <sys/siginfo.h>
-@@ -510,6 +510,12 @@ void GC_enable_signals(void)
- /* longjmp implementations. Most systems appear not to have */
- /* a signal 32. */
- # define SIGSETMASK(old, new) (old) = sigsetmask(new)
-+# elif defined(NACL)
-+ /* We don't use signals in NaCl. */
-+# define SIGSET_T int
-+# define SIG_DEL(set, signal)
-+# define SIG_FILL(set)
-+# define SIGSETMASK(old, new)
- # else
- /* Use POSIX/SYSV interface */
- # define SIGSET_T sigset_t
-@@ -1014,8 +1020,8 @@ ptr_t GC_get_stack_base()
- # if defined(HEURISTIC1) || defined(HEURISTIC2) || \
- defined(LINUX_STACKBOTTOM) || defined(FREEBSD_STACKBOTTOM)
- word dummy;
-- ptr_t result;
- # endif
-+ ptr_t result;
-
- # define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1)
-
-@@ -1904,8 +1910,21 @@ void GC_remap(ptr_t start, word bytes)
- int result;
-
- if (0 == start_addr) return;
-+#ifdef NACL
-+ {
-+ /* NaCl doesn't expose mprotect, but mmap should work fine */
-+ void * mmap_result;
-+ mmap_result = mmap(start_addr, len, PROT_READ | PROT_WRITE | OPT_PROT_EXEC,
-+ MAP_PRIVATE | MAP_FIXED | OPT_MAP_ANON,
-+ zero_fd, 0/* offset */);
-+ if (mmap_result != (void *)start_addr) ABORT("mmap as mprotect failed");
-+ /* Fake the return value as if mprotect succeeded. */
-+ result = 0;
-+ }
-+#else /* NACL */
- result = mprotect(start_addr, len,
- PROT_READ | PROT_WRITE | OPT_PROT_EXEC);
-+#endif /* NACL */
- if (result != 0) {
- GC_err_printf3(
- "Mprotect failed at 0x%lx (length %ld) with errno %ld\n",
-diff --git a/pthread_stop_world.c b/pthread_stop_world.c
---- a/pthread_stop_world.c
-+++ b/pthread_stop_world.c
-@@ -8,11 +8,24 @@
- #include <errno.h>
- #include <unistd.h>
- #include <sys/time.h>
--#ifndef HPUX
-+#if !defined(HPUX) && !defined(NACL)
- # include <sys/select.h>
- /* Doesn't exist on HP/UX 11.11. */
- #endif
-
-+#ifdef NACL
-+int nacl_park_threads_now = 0;
-+pthread_t nacl_thread_parker = -1;
-+
-+int nacl_thread_parked[MAX_NACL_GC_THREADS];
-+int nacl_thread_used[MAX_NACL_GC_THREADS];
-+int nacl_thread_parking_inited = 0;
-+int nacl_num_gc_threads = 0;
-+pthread_mutex_t nacl_thread_alloc_lock = PTHREAD_MUTEX_INITIALIZER;
-+__thread int nacl_thread_idx = -1;
-+__thread GC_thread nacl_gc_thread_self = NULL;
-+#endif
-+
- #if DEBUG_THREADS
-
- #ifndef NSIG
-@@ -27,6 +40,7 @@
- # endif
- #endif
-
-+#ifndef NACL
- void GC_print_sig_mask()
- {
- sigset_t blocked;
-@@ -40,6 +54,7 @@ void GC_print_sig_mask()
- }
- GC_printf0("\n");
- }
-+#endif /* NACL */
-
- #endif
-
-@@ -85,7 +100,11 @@ void GC_brief_async_signal_safe_sleep()
- struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = 1000 * TIME_LIMIT / 2;
-+#ifndef NACL
- select(0, 0, 0, 0, &tv);
-+#else
-+ nanosleep(&tv, 0);
-+#endif
- }
-
- #ifdef GC_OSF1_THREADS
-@@ -152,6 +171,7 @@ void GC_suspend_handler(int sig)
-
- void GC_suspend_handler_inner(ptr_t sig_arg)
- {
-+#ifndef NACL
- int sig = (int)(word)sig_arg;
- int dummy;
- pthread_t my_thread = pthread_self();
-@@ -226,6 +246,8 @@ void GC_suspend_handler_inner(ptr_t sig_arg)
- #if DEBUG_THREADS
- GC_printf1("Continuing 0x%lx\n", my_thread);
- #endif
-+
-+#endif /* NACL */
- }
-
- void GC_restart_handler(int sig)
-@@ -307,6 +329,10 @@ void GC_push_all_stacks()
- # else
- GC_push_all_stack(lo, hi);
- # endif
-+# ifdef NACL
-+ /* Push reg_storage as roots, this will cover the reg context */
-+ GC_push_all_stack(p -> stop_info.reg_storage, p -> stop_info.reg_storage + NACL_GC_REG_STORAGE_SIZE);
-+# endif
- # ifdef IA64
- # if DEBUG_THREADS
- GC_printf3("Reg stack for thread 0x%lx = [%lx,%lx)\n",
-@@ -337,6 +363,7 @@ int GC_stopping_pid;
- /* were sent. */
- int GC_suspend_all()
- {
-+#ifndef NACL
- int n_live_threads = 0;
- int i;
- GC_thread p;
-@@ -371,6 +398,9 @@ int GC_suspend_all()
- }
- }
- return n_live_threads;
-+#else /* NACL */
-+ return 0;
-+#endif
- }
-
- /* Caller holds allocation lock. */
-@@ -395,6 +425,8 @@ void GC_stop_world()
- # endif /* PARALLEL_MARK */
- ++GC_stop_count;
- GC_world_is_stopped = TRUE;
-+
-+# ifndef NACL
- n_live_threads = GC_suspend_all();
-
- if (GC_retry_signals) {
-@@ -434,19 +466,143 @@ void GC_stop_world()
- }
- }
- }
--# ifdef PARALLEL_MARK
-- GC_release_mark_lock();
--# endif
- #if DEBUG_THREADS
- GC_printf1("World stopped from 0x%lx\n", pthread_self());
- #endif
- GC_stopping_thread = 0; /* debugging only */
-+# else /* NACL */
-+ {
-+ GC_thread p;
-+ int i;
-+
-+ #if DEBUG_THREADS
-+ GC_printf1("pthread_stop_world: num_threads %d\n", nacl_num_gc_threads - 1);
-+ #endif
-+ nacl_thread_parker = pthread_self();
-+ nacl_park_threads_now = 1;
-+
-+ while (1) {
-+ #define NACL_PARK_WAIT_NANOSECONDS 100000
-+ int num_threads_parked = 0;
-+ struct timespec ts;
-+ int num_used = 0;
-+ /* Check the 'parked' flag for each thread the GC knows about */
-+ for (i = 0; i < MAX_NACL_GC_THREADS && num_used < nacl_num_gc_threads; i++) {
-+ if (nacl_thread_used[i] == 1) {
-+ num_used++;
-+ if (nacl_thread_parked[i] == 1) {
-+ num_threads_parked++;
-+ }
-+ }
-+ }
-+ /* -1 for the current thread */
-+ if (num_threads_parked >= nacl_num_gc_threads - 1)
-+ break;
-+ ts.tv_sec = 0;
-+ ts.tv_nsec = NACL_PARK_WAIT_NANOSECONDS;
-+ #if DEBUG_THREADS
-+ GC_printf1("sleeping waiting for %d threads to park...\n", nacl_num_gc_threads - num_threads_parked - 1);
-+ #endif
-+ nanosleep(&ts, 0);
-+ }
-+ }
-+# endif /* NACL */
-+
-+# ifdef PARALLEL_MARK
-+ GC_release_mark_lock();
-+# endif
- }
-
-+#ifdef NACL
-+
-+#if __x86_64__
-+
-+#define NACL_STORE_REGS() \
-+ do { \
-+ asm("push %rbx");\
-+ asm("push %rbp");\
-+ asm("push %r12");\
-+ asm("push %r13");\
-+ asm("push %r14");\
-+ asm("push %r15");\
-+ asm("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\
-+ memcpy(nacl_gc_thread_self->stop_info.reg_storage, nacl_gc_thread_self->stop_info.stack_ptr, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));\
-+ asm("naclasp $48, %r15");\
-+ } while (0)
-+
-+#elif __i386__
-+
-+#define NACL_STORE_REGS() \
-+ do { \
-+ asm("push %ebx");\
-+ asm("push %ebp");\
-+ asm("push %esi");\
-+ asm("push %edi");\
-+ asm("mov %%esp, %0" : "=m" (nacl_gc_thread_self->stop_info.stack_ptr));\
-+ memcpy(nacl_gc_thread_self->stop_info.reg_storage, nacl_gc_thread_self->stop_info.stack_ptr, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));\
-+ asm("add $16, %esp");\
-+ } while (0)
-+
-+#endif
-+
-+void nacl_pre_syscall_hook()
-+{
-+ int local_dummy = 0;
-+ if (nacl_thread_idx != -1) {
-+ NACL_STORE_REGS();
-+ nacl_gc_thread_self->stop_info.stack_ptr = (ptr_t)(&local_dummy);
-+ nacl_thread_parked[nacl_thread_idx] = 1;
-+ }
-+}
-+
-+void __nacl_suspend_thread_if_needed();
-+
-+void nacl_post_syscall_hook()
-+{
-+ /* Calling __nacl_suspend_thread_if_needed() right away should guarantee we don't mutate the GC set. */
-+ __nacl_suspend_thread_if_needed();
-+ if (nacl_thread_idx != -1) {
-+ nacl_thread_parked[nacl_thread_idx] = 0;
-+ }
-+}
-+
-+void __nacl_suspend_thread_if_needed() {
-+ if (nacl_park_threads_now) {
-+ pthread_t self = pthread_self();
-+ int local_dummy = 0;
-+ /* Don't try to park the thread parker. */
-+ if (nacl_thread_parker == self)
-+ return;
-+
-+ /* This can happen when a thread is created */
-+ /* outside of the GC system (wthread mostly). */
-+ if (nacl_thread_idx < 0)
-+ return;
-+
-+ /* If it was already 'parked', we're returning from a syscall, */
-+ /* so don't bother storing registers again, the GC has a set. */
-+ if (!nacl_thread_parked[nacl_thread_idx]) {
-+ NACL_STORE_REGS();
-+ nacl_gc_thread_self->stop_info.stack_ptr = (ptr_t)(&local_dummy);
-+ }
-+ nacl_thread_parked[nacl_thread_idx] = 1;
-+ while (nacl_park_threads_now)
-+ ; /* spin */
-+ nacl_thread_parked[nacl_thread_idx] = 0;
-+
-+ /* Clear out the reg storage for next suspend. */
-+ memset(nacl_gc_thread_self->stop_info.reg_storage, 0, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));
-+ }
-+}
-+
-+#endif /* NACL */
-+
-+
- /* Caller holds allocation lock, and has held it continuously since */
- /* the world stopped. */
- void GC_start_world()
- {
-+#ifndef NACL
- pthread_t my_thread = pthread_self();
- register int i;
- register GC_thread p;
-@@ -495,9 +651,16 @@ void GC_start_world()
- #if DEBUG_THREADS
- GC_printf0("World started\n");
- #endif
-+#else /* NACL */
-+# if DEBUG_THREADS
-+ GC_printf0("World starting\n");
-+# endif
-+ nacl_park_threads_now = 0;
-+#endif /* NACL */
- }
-
- void GC_stop_init() {
-+#ifndef NACL
- struct sigaction act;
-
- if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
-@@ -542,6 +705,7 @@ void GC_stop_init() {
- GC_printf0("Will retry suspend signal if necessary.\n");
- }
- # endif
-+#endif /* NACL */
- }
-
- #endif
-diff --git a/pthread_support.c b/pthread_support.c
---- a/pthread_support.c
-+++ b/pthread_support.c
-@@ -153,6 +153,9 @@
- # endif
- # undef pthread_join
- # undef pthread_detach
-+# if defined(NACL)
-+# undef pthread_exit
-+# endif
- # if defined(GC_OSF1_THREADS) && defined(_PTHREAD_USE_MANGLED_NAMES_) \
- && !defined(_PTHREAD_USE_PTDNAM_)
- /* Restore the original mangled names on Tru64 UNIX. */
-@@ -557,6 +560,53 @@ void GC_mark_thread_local_free_lists(void)
-
- static struct GC_Thread_Rep first_thread;
-
-+#ifdef NACL
-+extern int nacl_thread_parked[MAX_NACL_GC_THREADS];
-+extern int nacl_thread_used[MAX_NACL_GC_THREADS];
-+extern int nacl_thread_parking_inited;
-+extern int nacl_num_gc_threads;
-+extern pthread_mutex_t nacl_thread_alloc_lock;
-+extern __thread int nacl_thread_idx;
-+extern __thread GC_thread nacl_gc_thread_self;
-+
-+void nacl_initialize_gc_thread()
-+{
-+ int i;
-+ pthread_mutex_lock(&nacl_thread_alloc_lock);
-+ if (!nacl_thread_parking_inited)
-+ {
-+ for (i = 0; i < MAX_NACL_GC_THREADS; i++) {
-+ nacl_thread_used[i] = 0;
-+ nacl_thread_parked[i] = 0;
-+ }
-+ nacl_thread_parking_inited = 1;
-+ }
-+ GC_ASSERT(nacl_num_gc_threads <= MAX_NACL_GC_THREADS);
-+ for (i = 0; i < MAX_NACL_GC_THREADS; i++) {
-+ if (nacl_thread_used[i] == 0) {
-+ nacl_thread_used[i] = 1;
-+ nacl_thread_idx = i;
-+ nacl_num_gc_threads++;
-+ break;
-+ }
-+ }
-+ pthread_mutex_unlock(&nacl_thread_alloc_lock);
-+}
-+
-+void nacl_shutdown_gc_thread()
-+{
-+ pthread_mutex_lock(&nacl_thread_alloc_lock);
-+ GC_ASSERT(nacl_thread_idx >= 0 && nacl_thread_idx < MAX_NACL_GC_THREADS);
-+ GC_ASSERT(nacl_thread_used[nacl_thread_idx] != 0);
-+ nacl_thread_used[nacl_thread_idx] = 0;
-+ nacl_thread_idx = -1;
-+ nacl_num_gc_threads--;
-+ pthread_mutex_unlock(&nacl_thread_alloc_lock);
-+}
-+
-+#endif /* NACL */
-+
-+
- /* Add a thread to GC_threads. We assume it wasn't already there. */
- /* Caller holds allocation lock. */
- GC_thread GC_new_thread(pthread_t id)
-@@ -576,6 +626,10 @@ GC_thread GC_new_thread(pthread_t id)
- result -> id = id;
- result -> next = GC_threads[hv];
- GC_threads[hv] = result;
-+#ifdef NACL
-+ nacl_gc_thread_self = result;
-+ nacl_initialize_gc_thread();
-+#endif
- GC_ASSERT(result -> flags == 0 && result -> thread_blocked == 0);
- return(result);
- }
-@@ -616,6 +670,11 @@ void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
- register GC_thread p = GC_threads[hv];
- register GC_thread prev = 0;
-
-+#ifdef NACL
-+ nacl_shutdown_gc_thread();
-+ nacl_gc_thread_self = NULL;
-+#endif
-+
- while (p != gc_id) {
- prev = p;
- p = p -> next;
-@@ -710,6 +769,7 @@ int GC_segment_is_thread_stack(ptr_t lo, ptr_t hi)
- /* Return the number of processors, or i<= 0 if it can't be determined. */
- int GC_get_nprocs()
- {
-+#ifndef NACL
- /* Should be "return sysconf(_SC_NPROCESSORS_ONLN);" but that */
- /* appears to be buggy in many cases. */
- /* We look for lines "cpu<n>" in /proc/stat. */
-@@ -739,6 +799,9 @@ int GC_get_nprocs()
- }
- close(f);
- return result;
-+#else /* NACL */
-+ return sysconf(_SC_NPROCESSORS_ONLN);
-+#endif /* NACL */
- }
- #endif /* GC_LINUX_THREADS */
-
-@@ -984,7 +1047,7 @@ void GC_init_parallel()
- }
-
-
--#if !defined(GC_DARWIN_THREADS)
-+#if !defined(GC_DARWIN_THREADS) && !defined(NACL)
- int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
- {
- sigset_t fudged_set;
-@@ -996,7 +1059,7 @@ int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset)
- }
- return(REAL_FUNC(pthread_sigmask)(how, set, oset));
- }
--#endif /* !GC_DARWIN_THREADS */
-+#endif /* !GC_DARWIN_THREADS && !defined(NACL) */
-
- /* Wrappers for functions that are likely to block for an appreciable */
- /* length of time. Must be called in pairs, if at all. */
-@@ -1121,6 +1184,17 @@ int WRAP_FUNC(pthread_join)(pthread_t thread, void **retval)
- return result;
- }
-
-+#ifdef NACL
-+/* Native Client doesn't support pthread cleanup functions, */
-+/* so wrap pthread_exit and manually cleanup the thread. */
-+void
-+WRAP_FUNC(pthread_exit)(void *status)
-+{
-+ GC_thread_exit_proc(0);
-+ REAL_FUNC(pthread_exit)(status);
-+}
-+#endif
-+
- int
- WRAP_FUNC(pthread_detach)(pthread_t thread)
- {
-@@ -1203,7 +1277,9 @@ void * GC_start_routine(void * arg)
- start_arg = si -> arg;
- sem_post(&(si -> registered)); /* Last action on si. */
- /* OK to deallocate. */
-+#ifndef NACL
- pthread_cleanup_push(GC_thread_exit_proc, 0);
-+#endif
- # if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL)
- LOCK();
- GC_init_thread_local(me);
-@@ -1214,7 +1290,9 @@ void * GC_start_routine(void * arg)
- GC_printf1("Finishing thread 0x%x\n", pthread_self());
- #endif
- me -> status = result;
-+#ifndef NACL
- pthread_cleanup_pop(1);
-+#endif
- /* Cleanup acquires lock, ensuring that we can't exit */
- /* while a collection that thinks we're alive is trying to stop */
- /* us. */
diff --git a/ports/gc/pkg_info b/ports/gc/pkg_info
deleted file mode 100644
index 75bbcbf..0000000
--- a/ports/gc/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gc
-VERSION=6.8
-URL=http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.8.tar.gz
-ARCHIVE_ROOT=gc6.8
-LICENSE=CUSTOM
-SHA1=6d5def5ba5d29292ba9c76f04df3ec06d3ab3278
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gcc-avr/build.sh b/ports/gcc-avr/build.sh
deleted file mode 100644
index fee898c..0000000
--- a/ports/gcc-avr/build.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright 2015 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.
-
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-HOST_BIN_INSTALL_DIR=${NACL_PACKAGES_BUILD}/binutils-2.25/install_host
-
-AVR_LIBC_URL=http://storage.googleapis.com/webports/mirror/avr-libc-1.8.1.tar.bz2
-AVR_LIBC_SHA=b56fe21b30341869aa768689b0f6a07d896b17fa
-AVR_LIBC_VERSION=avr-libc-1.8.1
-
-export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
-export PATH="${PATH}:${NACL_PACKAGES_BUILD}/binutils-2.25/install_host/bin"
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- export EXTRA_INCLUDES=" -I${NACLPORTS_INCLUDE}/glibc-compat"
-fi
-
-BuildHostGccAvr() {
- # Host avr-gcc already installed, skip install.
- if [ -e ${HOST_BIN_INSTALL_DIR}/bin/avr-gcc ]; then
- return
- fi
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- CC="gcc" EXTRA_LIBS="" LIBS="" \
- LogExecute ${SRC_DIR}/configure \
- --prefix=${HOST_BIN_INSTALL_DIR} \
- --target=avr \
- --enable-languages=c,c++ \
- --disable-nls --disable-libssp \
- --with-gmp=${NACL_PACKAGES_BUILD}/gmp/install_host \
- --with-mpfr=${NACL_PACKAGES_BUILD}/mpfr/install_host \
- --with-mpc=${NACL_PACKAGES_BUILD}/mpc/install_host
- EXTRA_INCLUDES="" EXTRA_LIBS="" LIBS="" LogExecute make
- EXTRA_INCLUDES="" EXTRA_LIBS="" LIBS="" LogExecute make install
-}
-
-EXTRA_CONFIGURE_ARGS="\
- --enable-languages=c,c++ --disable-nls \
- --disable-libssp --host=x86_64-nacl --target=avr"
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- EXTRA_CONFIGURE_ARGS+=" --with-newlib"
-fi
-
-ConfigureStep() {
- for cache_file in $(find . -name config.cache); do
- Remove $cache_file
- done
- ChangeDir ${SRC_DIR}
- BuildHostGccAvr
- ChangeDir ${BUILD_DIR}
- DefaultConfigureStep
-}
-
-AvrLibcDownload() {
- cd ${NACL_PACKAGES_CACHE}
- # If matching tarball already exists, don't download again
- if ! CheckHash ${AVR_LIBC_VERSION}.tar.bz2 ${AVR_LIBC_SHA}; then
- Fetch ${AVR_LIBC_URL} ${AVR_LIBC_VERSION}.tar.bz2
- if ! CheckHash ${AVR_LIBC_VERSION}.tar.bz2 ${AVR_LIBC_SHA} ; then
- Banner "${AVR_LIBC_VERSION}.tar.bz2 failed checksum!"
- exit -1
- fi
- fi
-}
-
-AvrLibcExtractAndInstall() {
- # Return is avr-libc is already installed.
- if [ -d ${WORK_DIR}/avr_libc_install ]; then
- cp -r ${WORK_DIR}/avr_libc_install/* ${INSTALL_DIR}/webports-dummydir
- return
- fi
-
- # Install avr-libc
- Banner "Untarring ${AVR_LIBC_VERSION}"
- tar jxf ${NACL_PACKAGES_CACHE}/${AVR_LIBC_VERSION}.tar.bz2
- ChangeDir ${AVR_LIBC_VERSION}
- CC="avr-gcc"
- LogExecute ./configure \
- --prefix=${WORK_DIR}/avr_libc_install \
- --host=avr \
- --with-http=no \
- --with-html=no \
- --with-ftp=no \
- --with-x=no
- LogExecute make
- LogExecute make install
-
- # avr-libc needs to be in the same directory as the gcc-avr install
- cp -r ${WORK_DIR}/avr_libc_install/* ${INSTALL_DIR}/webports-dummydir
-}
-
-InstallStep() {
- DefaultInstallStep
- AvrLibcDownload
- AvrLibcExtractAndInstall
-}
diff --git a/ports/gcc-avr/nacl.patch b/ports/gcc-avr/nacl.patch
deleted file mode 100644
index 5938cc2..0000000
--- a/ports/gcc-avr/nacl.patch
+++ /dev/null
@@ -1,217 +0,0 @@
-diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in
---- a/fixincludes/Makefile.in
-+++ b/fixincludes/Makefile.in
-@@ -33,6 +33,13 @@ LDFLAGS = @LDFLAGS@
- INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include
- FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
-
-+# When building for NaCl, link glibc-compat headers
-+ifeq ($(NACL_LIBC),newlib)
-+ifneq ($(CC),gcc)
-+ EXTRA_LINK = -lglibc-compat
-+endif
-+endif
-+
- # Directory where sources are, from where we are.
- srcdir = @srcdir@
- VPATH = $(srcdir)
-@@ -106,8 +113,10 @@ gen : $(srcdir)/fixincl.x
- oneprocess : full-stamp
- twoprocess : test-stamp $(AF)
-
-+FULLSTAMP_LIBS = $(FI) $(ALLOBJ) $(LIBIBERTY) $(EXTRA_LINK)
-+
- full-stamp : $(ALLOBJ) $(LIBIBERTY)
-- $(CC) $(CFLAGS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBIBERTY)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -o $(FULLSTAMP_LIBS)
- $(STAMP) $@
-
- test-stamp : $(TESTOBJ) $(LIBIBERTY)
-diff --git a/gcc/Makefile.in b/gcc/Makefile.in
---- a/gcc/Makefile.in
-+++ b/gcc/Makefile.in
-@@ -1005,7 +1005,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
- # How to link with both our special library facilities
- # and the system's installed libraries.
- LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
-- $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
-+ $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) $(EXTRA_LIBS)
- BACKENDLIBS = $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
- $(ZLIB)
- # Any system libraries needed just for GNAT.
-@@ -1040,7 +1040,7 @@ INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
- $(CPPINC) $(GMPINC) $(DECNUMINC) $(BACKTRACEINC) \
- $(ISLINC)
-
--COMPILE.base = $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) -o $@
-+COMPILE.base = $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(EXTRA_INCLUDES) -o $@
- ifeq ($(CXXDEPMODE),depmode=gcc3)
- # Note a subtlety here: we use $(@D) for the directory part, to make
- # things like the go/%.o rule work properly; but we use $(*F) for the
-diff --git a/gcc/collect2.c b/gcc/collect2.c
---- a/gcc/collect2.c
-+++ b/gcc/collect2.c
-@@ -50,6 +50,15 @@ along with GCC; see the file COPYING3. If not see
- #include "intl.h"
- #include "version.h"
-
-+
-+#if defined(__native_client__) && defined(CROSS_DIRECTORY_STRUCTURE)
-+/* ./configure of GCC thinks we should find i686-nacl-ld instead of
-+ ld on i686 because --target is different from --host. As we always
-+ use plain "ld", we undefine the macro which indicates we are
-+ cross-compiling. */
-+#undef CROSS_DIRECTORY_STRUCTURE
-+#endif
-+
- /* On certain systems, we have code that works by scanning the object file
- directly. But this code uses system-specific header files and library
- functions, so turn it off in a cross-compiler. Likewise, the names of
-diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
---- a/gcc/config/i386/cpuid.h
-+++ b/gcc/config/i386/cpuid.h
-@@ -176,6 +176,10 @@
- static __inline unsigned int
- __get_cpuid_max (unsigned int __ext, unsigned int *__sig)
- {
-+ /* NaCl verifier does not allow cpuid. */
-+#if defined(__native_client__)
-+ return 0;
-+#else
- unsigned int __eax, __ebx, __ecx, __edx;
-
- #ifndef __x86_64__
-@@ -221,6 +225,7 @@ __get_cpuid_max (unsigned int __ext, unsigned int *__sig)
- *__sig = __ebx;
-
- return __eax;
-+#endif
- }
-
- /* Return cpuid data for requested cpuid level, as found in returned
-diff --git a/gcc/configure b/gcc/configure
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -10754,13 +10754,14 @@ rlim_t l = 0;
- return 0;
- }
- _ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
--
--else
--
--$as_echo "#define rlim_t long" >>confdefs.h
--
--fi
-+# Messes up newlib.
-+#if ac_fn_c_try_compile "$LINENO"; then :
-+#
-+#else
-+#
-+#$as_echo "#define rlim_t long" >>confdefs.h
-+#
-+#fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
- # On AIX 5.2, <ldfcn.h> conflicts with <fcntl.h>, as both define incompatible
-diff --git a/libcpp/lex.c b/libcpp/lex.c
---- a/libcpp/lex.c
-+++ b/libcpp/lex.c
-@@ -1502,7 +1502,7 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base,
- const uchar *orig_base;
- unsigned int raw_prefix_len = 0, raw_suffix_len = 0;
- enum raw_str_phase { RAW_STR_PREFIX, RAW_STR, RAW_STR_SUFFIX };
-- raw_str_phase phase = RAW_STR_PREFIX;
-+ enum raw_str_phase phase = RAW_STR_PREFIX;
- enum cpp_ttype type;
- size_t total_len = 0;
- /* Index into temp_buffer during phases other than RAW_STR,
-diff --git a/libcpp/macro.c b/libcpp/macro.c
---- a/libcpp/macro.c
-+++ b/libcpp/macro.c
-@@ -453,7 +453,7 @@ builtin_macro (cpp_reader *pfile, cpp_hashnode *node, source_location loc)
- macro. */
- source_location *virt_locs = NULL;
- _cpp_buff *token_buf = tokens_buff_new (pfile, 1, &virt_locs);
-- const line_map * map =
-+ const struct line_map * map =
- linemap_enter_macro (pfile->line_table, node,
- token->src_loc, 1);
- tokens_buff_add_token (token_buf, virt_locs, token,
-diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
---- a/libiberty/pex-unix.c
-+++ b/libiberty/pex-unix.c
-@@ -59,6 +59,18 @@ extern int errno;
- #include <process.h>
- #endif
-
-+/*
-+ * Declared inline rather than by including spawn.h because this portion
-+ * of the build may build for x86-64 without nacl-spawn having been built for
-+ * that architecture (ie when building for i686).
-+ */
-+#if defined(__native_client__)
-+#define P_NOWAIT 1
-+extern int spawnve(int mode, const char* path,
-+ char *const argv[], char *const envp[]);
-+#endif
-+
-+
- #ifdef vfork /* Autoconf may define this to fork for us. */
- # define VFORK_STRING "fork"
- #else
-@@ -392,7 +404,7 @@ pex_child_error (struct pex_obj *obj, const char *executable,
-
- extern char **environ;
-
--#if defined(HAVE_SPAWNVE) && defined(HAVE_SPAWNVPE)
-+#if (defined(HAVE_SPAWNVE) && defined(HAVE_SPAWNVPE)) || defined(__native_client__)
- /* Implementation of pex->exec_child using the Cygwin spawn operation. */
-
- /* Subroutine of pex_unix_exec_child. Move OLD_FD to a new file descriptor
-@@ -496,6 +508,12 @@ pex_unix_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED,
- int in, int out, int errdes, int toclose,
- const char **errmsg, int *err)
- {
-+ /* Use spawnve to spawn a child process.
-+ TODO(hamaji): Add support of pipes to nacl-spawn and handle
-+ arguments for file descriptors to support -pipe option. */
-+#if defined(__native_client__)
-+ return spawnve(P_NOWAIT, argv[0], argv, NULL);
-+#else
- int fl_in = 0, fl_out = 0, fl_err = 0, fl_tc = 0;
- int save_in = -1, save_out = -1, save_err = -1;
- int max, retries;
-@@ -583,6 +601,7 @@ pex_unix_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED,
- *err = errno;
- *errmsg = "dup2";
- return (pid_t) -1;
-+#endif
- }
-
- #else
-@@ -731,6 +750,16 @@ pex_unix_wait (struct pex_obj *obj, pid_t pid, int *status,
- struct pex_time *time, int done, const char **errmsg,
- int *err)
- {
-+#if defined(__native_client__)
-+ if (waitpid(pid, status, 0) < 0)
-+ {
-+ *err = errno;
-+ *errmsg = "wait";
-+ return -1;
-+ }
-+ return 0;
-+#else
-+
- /* If we are cleaning up when the caller didn't retrieve process
- status for some reason, encourage the process to go away. */
- if (done)
-@@ -744,6 +773,7 @@ pex_unix_wait (struct pex_obj *obj, pid_t pid, int *status,
- }
-
- return 0;
-+#endif
- }
-
- /* Create a pipe. */
diff --git a/ports/gcc-avr/pkg_info b/ports/gcc-avr/pkg_info
deleted file mode 100644
index 7217fe8..0000000
--- a/ports/gcc-avr/pkg_info
+++ /dev/null
@@ -1,15 +0,0 @@
-NAME=gcc-avr
-VERSION=5.1.0
-URL=http://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.bz2
-ARCHIVE_ROOT=gcc-5.1.0
-LICENSE=GPL
-DEPENDS=(glibc-compat nacl-spawn gmp mpfr mpc binutils-2.25)
-BUILD_OS=linux
-SHA1=b6c947b09adf780fe02065d0c48bfd7b4bdddfa3
-# clang builds currently disabled due to some inconsistencies in the
-# way clang++ compiles the *.c files that include headers with c++ content
-# TODO(gdeepti): Enable gcc-avr for pnacl, newlib-clang
-# ICE in glibc/arm toolchain:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-DISABLED_TOOLCHAIN=(clang-newlib emscripten pnacl glibc/arm)
-DISABLED_ARCH=(arm)
diff --git a/ports/gcc/build.sh b/ports/gcc/build.sh
deleted file mode 100644
index 1585ab4..0000000
--- a/ports/gcc/build.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (c) 2014 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.
-
-export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
-
-# --with-build-sysroot is necessary to run "fixincl"
-# properly. Without this option, GCC's build system tries to create
-# "include-fixed" based on the host's include directory, which is
-# not compatible with nacl-gcc.
-EXTRA_CONFIGURE_ARGS="\
- --enable-languages=c,c++ --disable-nls \
- --target=x86_64-nacl \
- --disable-libstdcxx-pch --enable-threads=nacl"
-
-# Force gcc to think that makeinfo is old so it won't build documentation.
-# Actually the issue is that its too new on most installs these days
-# (Ubunut/Trusty for example) and causes the build to break.
-export gcc_cv_prog_makeinfo_modern=no
-
-ConfigureStep() {
- DefaultConfigureStep
- for cache_file in $(find . -name config.cache); do
- Remove $cache_file
- done
-}
diff --git a/ports/gcc/nacl.patch b/ports/gcc/nacl.patch
deleted file mode 100644
index 158c463..0000000
--- a/ports/gcc/nacl.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-diff --git a/gcc/Makefile.in b/gcc/Makefile.in
---- a/gcc/Makefile.in
-+++ b/gcc/Makefile.in
-@@ -913,7 +913,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
-
- # How to link with both our special library facilities
- # and the system's installed libraries.
--LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
-+LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) $(EXTRA_LIBS)
- BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
- # Any system libraries needed just for GNAT.
- SYSLIBS = @GNAT_LIBEXC@
-@@ -3654,6 +3654,11 @@ s-fixinc_list : $(GCC_PASSES)
- else \
- echo ";"; \
- fi > tmp-fixinc_list
-+# It seems GCC tries to fix the host system include files as we are
-+# using same values (x86_64-nacl) for --host and --target. There seems
-+# to be no way to skip this step by adjusting ./configure flags. We
-+# disable this step by providing empty fixinc targets.
-+ echo > tmp-fixinc_list
- $(SHELL) $(srcdir)/../move-if-change tmp-fixinc_list fixinc_list
- $(STAMP) s-fixinc_list
-
-diff --git a/gcc/collect2.c b/gcc/collect2.c
---- a/gcc/collect2.c
-+++ b/gcc/collect2.c
-@@ -47,6 +47,14 @@ along with GCC; see the file COPYING3. If not see
- #include "intl.h"
- #include "version.h"
-
-+#if defined(__native_client__) && defined(CROSS_DIRECTORY_STRUCTURE)
-+/* ./configure of GCC thinks we should find i686-nacl-ld instead of
-+ ld on i686 because --target is different from --host. As we always
-+ use plain "ld", we undefine the macro which indicates we are
-+ cross-compiling. */
-+#undef CROSS_DIRECTORY_STRUCTURE
-+#endif
-+
- /* On certain systems, we have code that works by scanning the object file
- directly. But this code uses system-specific header files and library
- functions, so turn it off in a cross-compiler. Likewise, the names of
-diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
---- a/gcc/config/i386/cpuid.h
-+++ b/gcc/config/i386/cpuid.h
-@@ -110,6 +110,10 @@
- static __inline unsigned int
- __get_cpuid_max (unsigned int __ext, unsigned int *__sig)
- {
-+ /* NaCl verifier does not allow cpuid. */
-+#if defined(__native_client__)
-+ return 0;
-+#else
- unsigned int __eax, __ebx, __ecx, __edx;
-
- #ifndef __x86_64__
-@@ -155,6 +159,7 @@ __get_cpuid_max (unsigned int __ext, unsigned int *__sig)
- *__sig = __ebx;
-
- return __eax;
-+#endif
- }
-
- /* Return cpuid data for requested cpuid level, as found in returned
-diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
---- a/libiberty/pex-unix.c
-+++ b/libiberty/pex-unix.c
-@@ -56,6 +56,16 @@ extern int errno;
- #include <sys/stat.h>
- #endif
-
-+/*
-+ * Declared inline rather than by including spawn.h because this portion
-+ * of the build may build for x86-64 without nacl-spawn having been built for
-+ * that architecture (ie when building for i686).
-+ */
-+#if defined(__native_client__)
-+#define P_NOWAIT 1
-+extern int spawnve(int mode, const char* path,
-+ char *const argv[], char *const envp[]);
-+#endif
-
- #ifdef vfork /* Autoconf may define this to fork for us. */
- # define VFORK_STRING "fork"
-@@ -361,6 +371,12 @@ pex_unix_exec_child (struct pex_obj *obj, int flags, const char *executable,
- int in, int out, int errdes,
- int toclose, const char **errmsg, int *err)
- {
-+ /* Use spawnve to spawn a child process.
-+ TODO(hamaji): Add support of pipes to nacl-spawn and handle
-+ arguments for file descriptors to support -pipe option. */
-+#if defined(__native_client__)
-+ return spawnve(P_NOWAIT, argv[0], argv, NULL);
-+#else
- pid_t pid;
-
- /* We declare these to be volatile to avoid warnings from gcc about
-@@ -469,6 +485,7 @@ pex_unix_exec_child (struct pex_obj *obj, int flags, const char *executable,
-
- return pid;
- }
-+#endif
- }
-
- /* Wait for a child process to complete. */
-@@ -478,6 +495,15 @@ pex_unix_wait (struct pex_obj *obj, pid_t pid, int *status,
- struct pex_time *time, int done, const char **errmsg,
- int *err)
- {
-+#if defined(__native_client__)
-+ if (waitpid(pid, status, 0) < 0)
-+ {
-+ *err = errno;
-+ *errmsg = "wait";
-+ return -1;
-+ }
-+ return 0;
-+#else
- /* If we are cleaning up when the caller didn't retrieve process
- status for some reason, encourage the process to go away. */
- if (done)
-@@ -491,6 +517,7 @@ pex_unix_wait (struct pex_obj *obj, pid_t pid, int *status,
- }
-
- return 0;
-+#endif
- }
-
- /* Create a pipe. */
diff --git a/ports/gcc/pkg_info b/ports/gcc/pkg_info
deleted file mode 100644
index f5b7799..0000000
--- a/ports/gcc/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=gcc
-VERSION=396037926
-URL=https://chromium.googlesource.com/native_client/nacl-gcc.git@396037926
-LICENSE=GPL
-DISABLED_LIBC=(newlib)
-DEPENDS=(nacl-spawn gmp mpfr mpc)
-# glibc/arm build fails with:
-# /bin/sh: x86_64-nacl-gcc: command not found
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
-TOOLCHAIN_INSTALL=0
diff --git a/ports/gdb/background.js b/ports/gdb/background.js
deleted file mode 100644
index 600df1d..0000000
--- a/ports/gdb/background.js
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-// The background page of the gdb chrome packaged app exists solely to
-// manage the set of operations that can only be performed in a v2 chrome app,
-// namely those requiring sockets access.
-//
-// runGdb - Create a nacl module for gdb and marshall its messages.
-// rspContinue - Allow a nacl module to run, waiting for it to exit or fault.
-// rspDetach - Allow a nacl module to run without monitoring it.
-// rspKill - Kill a nacl module by way of its debug port.
-
-
-/**
- * Compute the checksum of a remote stub command.
- * @param {string} cmd Command to checksum.
- * @return {string} Two digit hex checksum of command.
- */
-function rspChecksum_(cmd) {
- var checksum = 0;
- var i;
- for (i = 0; i < cmd.length; i++) {
- checksum = (checksum + cmd.charCodeAt(i)) & 0xff;
- }
- var checksumStr = '0' + checksum.toString(16);
- checksumStr = checksumStr.substr(checksumStr.length - 2);
- return checksumStr;
-}
-
-/**
- * Convert a string to an ArrayBuffer.
- * @param {string} str.
- * @return {ArrayBuffer}.
- */
-function stringToArrayBuffer_(str) {
- var buf = new ArrayBuffer(str.length);
- var view = new Uint8Array(buf);
- var i;
- for (i = 0; i < str.length; i++) {
- view[i] = str.charCodeAt(i);
- }
- return buf;
-}
-
-/**
- * Add markers and checksum to a remote stub command.
- * @param {string} cmd Command to checksum.
- * @return {string} A ready to send checksumed remote stub message string.
- */
-function rspChecksumMessage_(cmd) {
- return '$' + cmd + '#' + rspChecksum_(cmd);
-}
-
-/**
- * Add markers and checksum to a remote stub command.
- * @param {string} cmd Command to checksum.
- * @return {string} A ready to send checksumed remote stub message ArrayBuffer.
- */
-function rspMessage_(cmd) {
- return stringToArrayBuffer_(rspChecksumMessage_(cmd));
-}
-
-/**
- * Decode a remote stub message.
- * @param {string} msg Message to decode.
- * @return {string} The decoded text.
- */
-function rspDecode_(msg) {
- var view = new Uint8Array(msg);
- var result = '';
- var i;
- for (i = 0; i < msg.byteLength; i++) {
- result += String.fromCharCode(view[i]);
- }
- return result;
-}
-
-/**
- * Manage a single debug connection.
- * @private
- * @constructor
- */
-function DebugConnection_(port) {
- this.port_ = port;
- this.debugTcpPort_ = null;
- this.socketId_ = null;
- this.gdbEmbed_ = null;
-
- port.onMessage.addListener(this.handleMessage_.bind(this));
- port.onDisconnect.addListener(this.handleDisconnect_.bind(this));
-}
-
-/**
- * Remove the gdb embed if any.
- */
-DebugConnection_.prototype.removeEmbed_ = function() {
- if (this.gdbEmbed_ !== null) {
- var p = this.gdbEmbed_.parentNode;
- // Remove the embed from the parent if there is any.
- if (p !== null) {
- p.removeChild(this.gdbEmbed_);
- }
- this.gdbEmbed_ = null;
- }
-};
-
-/**
- * Disconnect connection to the debug stub if any.
- */
-DebugConnection_.prototype.rspDisconnect_ = function() {
- if (this.socketId_ !== null) {
- chrome.socket.disconnect(this.socketId_);
- chrome.socket.destroy(this.socketId_);
- this.socketId_ = null;
- }
- this.removeEmbed_();
-};
-
-/**
- * Set the debug stub port.
- * @param {integer} debugTcpPort.
- */
-DebugConnection_.prototype.setDebugTcpPort_ = function(debugTcpPort) {
- this.debugTcpPort_ = debugTcpPort;
-};
-
-/**
- * Connect to the debug stub.
- * @param {function()} callback.
- */
-DebugConnection_.prototype.rspConnect_ = function(callback) {
- var self = this;
- self.rspDisconnect_();
- chrome.socket.create('tcp', function(createInfo) {
- self.socketId_ = createInfo.socketId;
- chrome.socket.connect(
- self.socketId_, '0.0.0.0', self.debugTcpPort_, function(result) {
- callback();
- });
- });
-};
-
-/**
- * Write a command to the debug stub.
- * @param {string} cmd Command to send.
- * @param {function()} callback.
- */
-DebugConnection_.prototype.rspSendMessage_ = function(cmd, callback) {
- var msg = rspMessage_(cmd);
- chrome.socket.write(this.socketId_, msg, function(writeInfo) {
- callback();
- });
-};
-
-/**
- * Send gdb an interrupt.
- * @param {function()} callback.
- */
-DebugConnection_.prototype.rspSendInterrupt_ = function(callback) {
- chrome.socket.write(
- this.socketId_, stringToArrayBuffer_('\x03'), function(writeInfo) {
- callback();
- });
-};
-
-/**
- * Connect and send a single command to the debug stub and hangup.
- * @param {string} cmd Command to send.
- * @param {function()} callback.
- */
-DebugConnection_.prototype.rspOneCommand_ = function(cmd, callback) {
- var self = this;
- self.rspConnect_(function() {
- self.rspSendMessage_(cmd, function() {
- setTimeout(function() {
- self.rspDisconnect_();
- callback();
- }, 100);
- });
- });
-};
-
-/**
- * Wait for a the reply from the debug stub.
- * @param {function(Object)} callback Called on completion with an object
- * containing the decoded and raw message.
- */
-DebugConnection_.prototype.rspWait_ = function(callback) {
- var self = this;
- chrome.socket.read(self.socketId_, 1024, function(readInfo) {
- if (readInfo.resultCode > 0) {
- var rawReply = rspDecode_(readInfo.data);
- // The stub sends '+' signs to ack packets.
- // Ignore them as we're relying on TCP to ensure valid transmission.
- if (rawReply === '+') {
- self.rspWait_(callback);
- } else {
- // Messages are sent in the form '$' + message + '#' + checksum.
- // decode the message by slicing out just the message portion.
- var decoded = rawReply.slice(1, rawReply.length - 3);
- // Re-encode the message (adding '$' and '#' + checksum).
- var recoded = rspChecksumMessage_(decoded);
- // Verify the the message is still matches.
- if (recoded !== rawReply) {
- // Since there is a mismatch the message in invalid.
- // Sent a null for the decodedMessage.
- decoded = null;
- }
- callback({
- 'reply': decoded,
- 'rawReply': rawReply,
- });
- }
- } else {
- self.rspWait_(callback);
- }
- });
-};
-
-/**
- * Issue a continue command and wait for a fault.
- * @param {function(Object)} callback Called on completion with a partial
- * decoding of the reply in an
- * rspContinueReply message.
- */
-DebugConnection_.prototype.rspContinue_ = function(callback) {
- var self = this;
- self.rspConnect_(function() {
- self.rspSendMessage_('vCont;c', function() {
- self.rspWait_(function(msg) {
- self.rspDisconnect_();
- msg ['name'] = 'rspContinueReply';
- if (msg.reply === null) {
- msg['type'] = 'invalid';
- msg['reply'] = 'INVALID: ' + msg.rawReply;
- callback(msg);
- return;
- }
- var first = msg.reply.slice(0, 1);
- if (['S', 'T', 'W', 'X'].indexOf(first) >= 0) {
- try {
- msg['number'] = parseInt(msg.reply.slice(1, 3), 16);
- msg['type'] = {
- 'S': 'signal',
- 'T': 'signal',
- 'W': 'exited',
- 'X': 'terminated',
- }[first];
- } catch (e) {
- msg['type'] = 'invalid';
- }
- } else {
- msg['type'] = 'unexpected';
- }
- callback(msg);
- });
- });
- });
-};
-
-/**
- * Issue a kill command.
- * @param {function()} callback.
- */
-DebugConnection_.prototype.rspKill_ = function(callback) {
- this.rspOneCommand_('k', callback);
-};
-
-/**
- * Issue a detach command.
- * @param {function()} callback.
- */
-DebugConnection_.prototype.rspDetach_ = function(callback) {
- this.rspOneCommand_('D', callback);
-};
-
-/**
- * Create a new GDB embed.
- */
-DebugConnection_.prototype.createGdb_ = function() {
- var self = this;
-
- // TODO(bradnelson): Figured out why this does not work with an embed an
- // switch it.
- var gdb = document.createElement('object');
- self.gdbEmbed_ = gdb;
- gdb.width = 0;
- gdb.height = 0;
- gdb.type = 'application/x-nacl';
- gdb.data = 'gdb.nmf';
-
- gdb.addEventListener('message', function(e) {
- if (!self.port_) {
- return;
- }
- if (e.data.indexOf('exited:') === 0) {
- self.port_.postMessage(
- {'name': 'exited',
- 'returncode': parseInt(e.data.split(':')[1])});
- gdb.removeEmbed_();
- return;
- }
- self.port_.postMessage({'name': 'message', 'data': e.data});
- });
- gdb.addEventListener('load', function(e) {
- if (!self.port_) {
- return;
- }
- self.port_.postMessage({'name': 'load'});
- });
- gdb.addEventListener('error', function(e) {
- if (!self.port_) {
- return;
- }
- self.port_.postMessage({'name': 'error'});
- });
- gdb.addEventListener('abort', function(e) {
- if (!self.port_) {
- return;
- }
- self.port_.postMessage({'name': 'abort'});
- });
- gdb.addEventListener('crash', function(e) {
- if (!self.port_) {
- return;
- }
- self.port_.postMessage({'name': 'crash'});
- });
-
- var params = {};
- params['PS_TTY_PREFIX'] = 'gdb';
- params['PS_TTY_RESIZE'] = 'tty_resize';
- params['PS_STDIN'] = '/dev/tty';
- params['PS_STDOUT'] = '/dev/tty';
- params['PS_STDERR'] = '/dev/tty';
- // TODO(bradnelson): Sort out how to cope with higher verbosity here.
- params['PS_VERBOSITY'] = '0';
- params['PS_EXIT_MESSAGE'] = 'exited';
- params['TERM'] = 'xterm-256color';
- params['PWD'] = '/';
-
- function addParam(name, value) {
- var param = document.createElement('param');
- param.name = name;
- param.value = value;
- gdb.appendChild(param);
- }
-
- for (var key in params) {
- addParam(key, params[key]);
- }
-
- var argv = [
- '-ex', 'target remote :' + self.debugTcpPort_,
- ];
- argv = ['gdb.nmf'].concat(argv);
-
- var argn = 0;
- argv.forEach(function(arg) {
- var argname = 'arg' + argn;
- addParam(argname, arg);
- argn = argn + 1;
- });
-
- document.body.appendChild(gdb);
- // Work around crbug.com/350445
- var junk = gdb.offsetTop;
-};
-
- /**
- * Suspend with javascript, then attach a GDB instance.
- */
-DebugConnection_.prototype.runGdb_ = function() {
- var self = this;
- if (self.socketId_ === null) {
- // If we're not connected currently. Connect now.
- self.rspConnect_(function() {
- self.runGdb_();
- });
- return;
- }
- // Break the connection so GDB can attach.
- self.rspSendInterrupt_(function() {
- self.rspDisconnect_();
- self.createGdb_();
- });
-};
-
-/**
- * Handle a message from port.
- * @param msg
- */
-DebugConnection_.prototype.handleMessage_ = function(msg) {
- var self = this;
- if (msg.name === 'input') {
- if (self.gdbEmbed_ !== null) {
- self.gdbEmbed_.postMessage(msg.msg);
- }
- } else if (msg.name === 'setDebugTcpPort') {
- self.setDebugTcpPort_(msg.debugTcpPort);
- self.port_.postMessage({'name': 'setDebugTcpPortReply'});
- } else if (msg.name === 'runGdb') {
- self.runGdb_();
- } else if (msg.name === 'rspKill') {
- self.rspKill_(function() {
- self.port_.postMessage({'name': 'rspKillReply'});
- });
- } else if (msg.name === 'rspDetach') {
- self.rspDetach_(function() {
- self.port_.postMessage({'name': 'rspDetachReply'});
- });
- } else if (msg.name === 'rspContinue') {
- self.rspContinue_(function(reply) {
- self.port_.postMessage(reply);
- });
- } else if (msg.name === 'installCheck') {
- self.port_.postMessage({'name': 'installCheckReply'});
- }
-};
-
-/**
- * Handle a disconnect from port.
- */
-DebugConnection_.prototype.handleDisconnect_ = function() {
- this.rspDisconnect_();
- this.port_ = null;
-};
-
-/**
- * Create a new DebugConnection for each external connection.
- */
-chrome.runtime.onConnectExternal.addListener(function(port) {
- // Check the sender only when not in testing mode.
- if (navigator.userAgent.indexOf('ChromeTestAgent/') < 0) {
- // TODO(bradnelson): Enable this check once a production extension id is
- // known for the debugger extension.
- //if (port.sender.id !== 'blessed-id') {
- // port.disconnect();
- // return;
- //}
- }
- var dc = new DebugConnection_(port);
-});
diff --git a/ports/gdb/build.sh b/ports/gdb/build.sh
deleted file mode 100644
index 53b150b..0000000
--- a/ports/gdb/build.sh
+++ /dev/null
@@ -1,135 +0,0 @@
-# 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.
-
-EnableCliMain
-EnableGlibcCompat
-
-NACLPORTS_LIBS+=" -lncurses -lm"
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- # Since the final link is done with -lnacl_io and not -lglibc-compat
- # we disable getrlimit and setrlimit. TODO(sbc): add these back if/when
- # nacl_io evolves to include these functions.
- export ac_cv_func_getrlimit=no
- export ac_cv_func_setrlimit=no
-fi
-
-ConfigureStep() {
- SetupCrossEnvironment
-
- LogExecute ${SRC_DIR}/configure --with-curses --with-expat \
- --disable-werror \
- --with-system-readline \
- --disable-libmcheck \
- --prefix=${PREFIX} \
- --enable-targets=arm-none-eabi-nacl \
- --host=${NACL_CROSS_PREFIX} \
- --target=x86_64-nacl \
- ${EXTRA_CONFIGURE_ARGS:-}
-
- # If the .info files don't exist, "make all" will try to recreate it with the
- # "makeinfo" tool, which isn't normally installed.
- # Just copy the ones from the repo to the build directory.
- MakeDir ${BUILD_DIR}/{gdb,bfd}/doc
- ChangeDir ${SRC_DIR}
- find gdb bfd -name '*.info' -exec cp {} ${BUILD_DIR}/{} \;
-}
-
-BuildStep() {
- # gdb configures its submodules at build time so we need to setup
- # the cross enrionment here. Without this CPPFLAGS doesn't get set
- # in gdb/Makefile.
- SetupCrossEnvironment
- DefaultBuildStep
-
- # Build test module.
- LogExecute ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${NACLPORTS_LDFLAGS} -g \
- ${START_DIR}/test_module.cc \
- -o ${BUILD_DIR}/test_module_${NACL_ARCH}.nexe -lppapi_cpp -lppapi
-}
-
-InstallStep() {
- cd gdb
- DefaultInstallStep
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
-
- # Tests
- local TEST_OUT_DIR="${PUBLISH_DIR}/tests"
- MakeDir ${TEST_OUT_DIR}
- LogExecute cp ${BUILD_DIR}/test_module_*.nexe ${TEST_OUT_DIR}
- pushd ${TEST_OUT_DIR}
- python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- test_module_*${NACL_EXEEXT} \
- -s . \
- -o test_module.nmf
- popd
-
- # GDB App
- PublishMultiArch gdb/gdb${NACL_EXEEXT} gdb gdb_app
-
- local GDB_APP_DIR="${PUBLISH_DIR}/gdb_app"
- pushd ${GDB_APP_DIR}
- LogExecute python ${TOOLS_DIR}/create_term.py gdb.nmf
- popd
- InstallNaClTerm ${GDB_APP_DIR}
- LogExecute cp ${START_DIR}/background.js ${GDB_APP_DIR}
- LogExecute cp ${START_DIR}/ladybug_16.png ${GDB_APP_DIR}
- LogExecute cp ${START_DIR}/ladybug_48.png ${GDB_APP_DIR}
- LogExecute cp ${START_DIR}/ladybug_128.png ${GDB_APP_DIR}
-
- # Generate a manifest.json (with key included).
- GenerateManifest ${START_DIR}/manifest.json.template \
- ${GDB_APP_DIR} key=$(cat ${START_DIR}/key.txt)
-
- # Create uploadable version (key not included).
- local GDB_APP_UPLOAD_DIR="${PUBLISH_DIR}/gdb_app_upload"
- rm -rf ${GDB_APP_UPLOAD_DIR}
- LogExecute cp -r ${GDB_APP_DIR} ${GDB_APP_UPLOAD_DIR}
- GenerateManifest ${START_DIR}/manifest.json.template \
- ${GDB_APP_UPLOAD_DIR} key=
- # Zip for upload to the web store.
- pushd ${PUBLISH_DIR}
- rm -f gdb_app_upload.zip
- zip -r gdb_app_upload.zip gdb_app_upload/
- popd
-
- # Debug Extension
- local DEBUG_EXT_DIR="${PUBLISH_DIR}/debug_extension"
- MakeDir ${DEBUG_EXT_DIR}
- InstallNaClTerm ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/background.js ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/devtools.html ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/devtools.js ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/ladybug_gear_128.png ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/ladybug_gear_16.png ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/ladybug_gear_48.png ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/main.css ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/main.html ${DEBUG_EXT_DIR}
- LogExecute cp ${START_DIR}/extension/main.js ${DEBUG_EXT_DIR}
- GenerateManifest ${START_DIR}/extension/manifest.json.template \
- ${DEBUG_EXT_DIR} key=
-
- # Zip for upload to the web store.
- pushd ${PUBLISH_DIR}
- rm -f debug_extension.zip
- zip -r debug_extension.zip debug_extension/
- popd
-}
-
-PostInstallTestStep() {
- # Temporartily disabled until this gets fixed:
- # https://code.google.com/p/naclports/issues/detail?id=187
- return
- if [[ ${OS_NAME} == Darwin && ${NACL_ARCH} == x86_64 ]]; then
- echo "Skipping gdb/debug tests on unsupported mac + x86_64 configuration."
- elif [[ ${NACL_ARCH} == arm ]]; then
- echo "Skipping gdb/debug tests on arm for now."
- else
- LogExecute python ${START_DIR}/gdb_test.py -x -vv -a ${NACL_ARCH}
- LogExecute python ${START_DIR}/debugger_test.py -x -vv -a ${NACL_ARCH}
- fi
-}
diff --git a/ports/gdb/debugger_test.py b/ports/gdb/debugger_test.py
deleted file mode 100755
index cd661df..0000000
--- a/ports/gdb/debugger_test.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-
-"""Tests of gdb and debugger."""
-
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(SCRIPT_DIR, '../..'))
-SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-LIBC = os.environ.get('TOOLCHAIN', 'newlib')
-GDB_OUT_DIR = os.path.join(SRC_DIR, 'out/publish/gdb', LIBC)
-
-import chrome_test
-
-
-gdb_app = os.path.join(GDB_OUT_DIR, 'gdb_app')
-debug_extension = os.path.join(GDB_OUT_DIR, 'debug_extension')
-test_dir = os.path.join(SCRIPT_DIR, 'tests')
-test_out_dir = os.path.join(GDB_OUT_DIR, 'tests')
-
-if __name__ == '__main__':
- chrome_test.Main([
- '-C', test_dir,
- '-C', test_out_dir,
- '-t', '60',
- '--enable-nacl',
- '--enable-nacl-debug',
- '--load-and-launch-app', gdb_app,
- '--load-extension', debug_extension,
- 'debugger_test.html'] + sys.argv[1:])
diff --git a/ports/gdb/extension/archer.jpg b/ports/gdb/extension/archer.jpg
deleted file mode 100644
index c90eb01..0000000
--- a/ports/gdb/extension/archer.jpg
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/extension/background.js b/ports/gdb/extension/background.js
deleted file mode 100644
index df55c59..0000000
--- a/ports/gdb/extension/background.js
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-// The background page of the debugger extension has a few purposes:
-// - Track and react to nacl process create / exit / suspend.
-// - Store and update global g_settings choices.
-
-/**
- * ID of GDB app (used to establish contact).
- * @const
- */
-var GDB_EXTENSION_ID = 'gkjoooooiaohiceibmdleokniplmbahe';
-
-/**
- * Keep a run running snapshot of running NaCl modules.
- * Mapping of process id to object detailing process.
- */
-var g_naclModules = {};
-
-/**
- * Keep a mapping of listener id to an object for each process with these
- * fields:
- * {chrome.processes.ProcessInfo} process Process Info for the process.
- * {string] debugState String describing debug status.
- * {Port} debugConnection A messaging port to the gdb app for this process.
- */
-var g_listeners = {};
-
-/**
- * Keep a counter to dole out unique ids for each listener.
- */
-var g_listenerId = 0;
-
-/**
- * Default user settings values.
- * @const
- */
-var DEFAULT_SETTINGS = {
- onStartRun: true, // Run (as opposed to attach) on module start.
- onFaultAttach: true, // Attach on fault (as opposed to halting).
- showGdb: false, // Show GDB modules in the list of NaCl apps.
-};
-
-/**
- * Keep user settings in the background page to retain them across ui stop
- * start.
- * TODO(bradnelson): Keep this between sessions in localStorage?
- */
-var g_settings = JSON.parse(JSON.stringify(DEFAULT_SETTINGS));
-
-
-/**
- * Broadcast a message to all open listeners (or a tuned subset).
- * @param msg Message to broadcast.
- * @param opt_tuned Optionally restrict broadcast to listeners tuned to a given
- * process id (interacting with the gdb console).
- */
-function broadcast(msg, opt_tuned) {
- for (var i in g_listeners) {
- try {
- if (opt_tuned === undefined || opt_tuned === g_listeners[i].tune) {
- g_listeners[i].port.postMessage(msg);
- }
- } catch(e) {
- }
- }
-}
-
-/**
- * Send a complete state update to all listeners.
- * @param {string} cause String describing why an update is needed.
- * @param {string} opt_addedProcessId Optional process id that was involved in
- * the cause (ex process started).
- */
-function notifyListeners(cause, opt_addedProcessId) {
- broadcast({
- 'name': 'change',
- 'cause': cause,
- 'addedProcessId': opt_addedProcessId,
- 'naclModules': g_naclModules,
- 'settings': g_settings,
- });
-}
-
-/**
- * Create a new connect to the GDB app for a particular debug port.
- * @param {integer} debugTcpPort The port to debug on.
- * @param {function(Port)} callback Called with a setup port to the GDB app.
- */
-function newGdbConnection(debugTcpPort, callback) {
- var port = chrome.runtime.connect(GDB_EXTENSION_ID);
- var handleMessage = function(msg) {
- port.onMessage.removeListener(handleMessage);
- callback(port);
- };
- port.onMessage.addListener(handleMessage);
- port.postMessage({'name': 'setDebugTcpPort', 'debugTcpPort': debugTcpPort});
-}
-
-/**
- * Add process to the monitored set if appropriate.
- * @param {chrome.processes.ProcessInfo} process.
- * @return {boolean} Was there a need to add the process
- * (ie send out an update).
- */
-function addProcess(process) {
- // Only monitor NaCl modules.
- if (process.type !== 'nacl') {
- return false;
- }
- // Ignore NaCl modules until they have a stable debug port.
- if (process.naclDebugPort < 0) {
- return false;
- }
- // Ignore process ids that are already present.
- var processId = process.id.toString();
- if (processId in g_naclModules) {
- return false;
- }
-
- // Add the module to the active set.
- var entry = {
- 'process': process,
- 'debugConnection': null,
- 'debugState': 'setup',
- };
- g_naclModules[processId] = entry;
-
- // Create a new connection to the debug app.
- newGdbConnection(process.naclDebugPort, function(debugConnection) {
- entry.debugConnection = debugConnection;
- debugConnection.onMessage.addListener(function(msg) {
- if (msg.name === 'rspContinueReply') {
- if (msg.type === 'signal') {
- if (g_settings.onFaultAttach) {
- entry.debugConnection.postMessage({'name': 'runGdb'});
- entry.debugState = 'gdb';
- notifyListeners('faulted');
- } else {
- entry.debugConnection.postMessage({'name': 'rspKill'});
- entry.debugState = 'killing';
- notifyListeners('killed');
- }
- }
- } else if (msg.name === 'message') {
- broadcast(msg, processId);
- }
- });
- debugConnection.onDisconnect.addListener(function() {
- entry.debugState = 'disconnecting';
- notifyListeners('disconnect');
- });
-
- if (process.title.match(/^Native Client module:.*gdb.nmf$/)) {
- // For now, detach from GDB processes.
- // TODO(bradnelson): Add an infinite regress check and switch this to
- // rspContinue so we can catch GDB crashes.
- entry.debugConnection.postMessage({'name': 'rspDetach'});
- entry.debugState = 'detached';
- } else if (g_settings.onStartRun) {
- entry.debugConnection.postMessage({'name': 'rspContinue'});
- entry.debugState = 'running';
- } else {
- entry.debugConnection.postMessage({'name': 'runGdb'});
- entry.debugState = 'gdb';
- }
- notifyListeners('setup');
- });
-
- return true;
-}
-
-
-/**
- * Make an initial request of the process list to prime g_naclModules.
- */
-chrome.processes.getProcessInfo([], false, function(processes) {
- for (var rawProcessId in processes) {
- var process = processes[rawProcessId];
- if (addProcess(process)) {
- notifyListeners('init');
- }
- }
-});
-
-/**
- * Listen to process update events.
- * This is done in addition to listening to creation events because in practice
- * not registering an onUpdated handler seems to result in slow / missed
- * process events.
- * NOTE: This is only used to detect modules to add.
- * TODO(bradnelson): Look into if this is really needed.
- */
-chrome.processes.onUpdated.addListener(function(processes) {
- for (var rawProcessId in processes) {
- var process = processes[rawProcessId];
- if (addProcess(process)) {
- notifyListeners('updated');
- }
- }
-});
-
-/**
- * Listen to process creation events.
- */
-chrome.processes.onCreated.addListener(function(process) {
- if (addProcess(process)) {
- notifyListeners('create', process.id.toString());
- }
-});
-
-/**
- * Listen to process exit events.
- */
-chrome.processes.onExited.addListener(function(processId, exitType, exitCode) {
- var processIdStr = processId.toString();
- if (processIdStr in g_naclModules) {
- if (g_naclModules[processIdStr].debugConnection !== null) {
- g_naclModules[processIdStr].debugConnection.disconnect();
- }
- delete g_naclModules[processIdStr];
- notifyListeners('exit');
- }
-});
-
-/**
- * Handle a newly connected port (internal from main.js or external for
- * testing).
- */
-function handleConnect(port) {
- var id = g_listenerId++;
- g_listeners[id] = {
- 'port': port,
- 'tune': null,
- };
- port.onMessage.addListener(function(msg) {
- // Respond to a settings change from the UI.
- if (msg.name === 'settingsChange') {
- g_settings = msg.settings;
- notifyListeners('settingsChange');
-
- // Respond to a require to restore default settings (for testing).
- } else if (msg.name === 'defaultSettings') {
- g_settings = JSON.parse(JSON.stringify(DEFAULT_SETTINGS));
- notifyListeners('settingsChange');
-
- // Respond to an attach request from the UI.
- } else if (msg.name === 'attach') {
- if (msg.processId in g_naclModules) {
- g_naclModules[msg.processId].debugState = 'gdb';
- if (g_naclModules[msg.processId].debugConnection !== null) {
- g_naclModules[msg.processId].debugConnection.postMessage(
- {'name': 'runGdb'});
- }
- }
-
- // Respond to a kill request from the UI.
- } else if (msg.name === 'kill') {
- g_naclModules[msg.processId].debugState = 'killing';
- chrome.processes.terminate(
- parseInt(msg.processId), function(didTerminate) {
- });
-
- // Respond to a request to view the GDB console from the UI.
- } else if (msg.name === 'tune') {
- g_listeners[id].tune = msg.processId;
-
- // Route user input to the proper GDB module.
- } else if (msg.name === 'input') {
- var tune = g_listeners[id].tune;
- if (tune !== null && (tune in g_naclModules)) {
- if (g_naclModules[tune].debugConnection !== null) {
- g_naclModules[tune].debugConnection.postMessage(msg);
- }
- }
-
- // Respond to an install check message.
- } else if (msg.name === 'installCheck') {
- port.postMessage({'name': 'installCheckReply'});
- }
- });
-
- // Drop the listener on disconnect.
- port.onDisconnect.addListener(function() {
- delete g_listeners[id];
- });
-
- // Announce the new module.
- notifyListeners('join');
-}
-
-/**
- * Listen for internal connection events (from main.js).
- */
-chrome.runtime.onConnect.addListener(handleConnect);
-
-/**
- * Allow an external connection only for testing and install check.
- */
-chrome.runtime.onConnectExternal.addListener(function(port) {
- // Check the sender only when not in testing mode.
- if (navigator.userAgent.indexOf('ChromeTestAgent/') < 0) {
- // Reject if the sender is an extension (unsupported for now).
- // Allow urls (as we're only whitelisting the install page).
- if (port.sender.id !== undefined) {
- port.disconnect();
- return;
- }
- }
- handleConnect(port);
-});
diff --git a/ports/gdb/extension/devtools.html b/ports/gdb/extension/devtools.html
deleted file mode 100644
index ede6d44..0000000
--- a/ports/gdb/extension/devtools.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="devtools.js"></script>
-</body>
-</html>
diff --git a/ports/gdb/extension/devtools.js b/ports/gdb/extension/devtools.js
deleted file mode 100644
index 12c0e4f..0000000
--- a/ports/gdb/extension/devtools.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-
-chrome.devtools.panels.create(
- 'NaCl Debugger', 'archer.png', 'main.html', function(sidebar) {});
diff --git a/ports/gdb/extension/icon_128.png b/ports/gdb/extension/icon_128.png
deleted file mode 100644
index 3d64fe2..0000000
--- a/ports/gdb/extension/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/extension/icon_16.png b/ports/gdb/extension/icon_16.png
deleted file mode 100644
index 18a9194..0000000
--- a/ports/gdb/extension/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/extension/icon_48.png b/ports/gdb/extension/icon_48.png
deleted file mode 100644
index 4e09775..0000000
--- a/ports/gdb/extension/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/extension/ladybug_gear_128.png b/ports/gdb/extension/ladybug_gear_128.png
deleted file mode 100644
index 9a4e39b..0000000
--- a/ports/gdb/extension/ladybug_gear_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/extension/ladybug_gear_16.png b/ports/gdb/extension/ladybug_gear_16.png
deleted file mode 100644
index ce2385a..0000000
--- a/ports/gdb/extension/ladybug_gear_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/extension/ladybug_gear_48.png b/ports/gdb/extension/ladybug_gear_48.png
deleted file mode 100644
index 6b392b1..0000000
--- a/ports/gdb/extension/ladybug_gear_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/extension/main.css b/ports/gdb/extension/main.css
deleted file mode 100644
index 8ab1972..0000000
--- a/ports/gdb/extension/main.css
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-body {
- padding: 0;
- margin: 0;
- border: 0;
- height: 100%;
- width: 100%;
- position: absolute;
- overflow: hidden;
-}
-
-#terminal {
- position: relative;
- height: 100%;
-}
-
-fieldset {
- border: 0;
- margin: 1em 0;
- display: inline-block;
-}
-
-.vertical {
- display: block;
-}
-
-legend {
- border: none;
- font-weight: bold;
-}
-
-select {
- width: 100%;
- display: block;
-}
-
-form {
- height: 100%;
-}
-
-.sizer {
- width: 10px;
- background-color: #eee;
- border-style: none;
- border-right: 1px solid #999;
- cursor: ew-resize;
- display: table-cell;
-}
-
-.options {
- background-color: #eee;
- display: table-cell;
- height: 100%;
-}
-
-.table {
- display: table;
- height: 100%;
-}
-
-.row {
- display: table-row;
- height: 100%;
-}
-
-.cell {
- display: table-cell;
- height: 100%;
-}
diff --git a/ports/gdb/extension/main.html b/ports/gdb/extension/main.html
deleted file mode 100644
index 2742ece..0000000
--- a/ports/gdb/extension/main.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Native Client Debugger</title>
-<script type="text/javascript" src="hterm.concat.js"></script>
-<script type="text/javascript" src="main.js"></script>
-<link rel="stylesheet" type="text/css" href="main.css">
-</head>
-
-<body>
- <div class="table">
- <div class="row">
- <div class="options" id="sized">
- <form>
- <fieldset class="vertical">
- <legend>Native Client Modules</legend>
- <select id="modules" size="10"></select>
- <button id="kill">Kill</button>
- <button id="attach">Attach...</button>
- <span id="moduleInfo"></span>
- </fieldset>
- <fieldset class="vertical">
- <button id="manual">Setup GDB Manually...</button>
- </fieldset>
- <div>
- <fieldset>
- <legend>Action on fault</legend>
- <label> <input type="radio" name="onFault" value="attach"
- id="onFaultAttach">attach</label>
- <label><input type="radio" name="onFault" value="terminate"
- id="onFaultTerminate">terminate</label>
- </fieldset>
- <fieldset>
- <legend>Action on start</legend>
- <label><input type="radio" name="onStart" value="run"
- id="onStartRun">run</label>
- <label><input type="radio" name="onStart" value="attach"
- id="onStartAttach">attach</label>
- </fieldset>
- <fieldset>
- <legend>GDB modules</legend>
- <label><input type="checkbox" name="showGdb"
- id="showGdb">visible</label>
- </fieldset>
- </div>
- </form>
- </div>
- <div class="sizer" id="sizer"></div>
- <div class="cell">
- <div id="terminal"></div>
- </div>
- </div>
- </div>
-</body>
-</html>
diff --git a/ports/gdb/extension/main.js b/ports/gdb/extension/main.js
deleted file mode 100644
index 31ebd7d..0000000
--- a/ports/gdb/extension/main.js
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals lib, hterm */
-
-'use strict';
-
-// The devtools page for the debugger.
-
-lib.rtdep('lib.f',
- 'hterm');
-
-
-/**
- * Keep a global reference to the message port used to talk to the background
- * page.
- */
-var g_backgroundPort;
-
-
-/**
- * A Gdb Terminal.
- * @constructor.
- */
-function GdbTerm(argv) {
- this.io_ = argv.io.push();
- window.io_ = this.io_;
- this.argv_ = argv;
-}
-
-/**
- * Handle a terminal resize.
- * @param {integer} width Width of the terminal in characters.
- * @param {integer} height Height of the terminal in characters.
- */
-GdbTerm.prototype.onTerminalResize_ = function(width, height) {
- g_backgroundPort.postMessage({
- 'name': 'input',
- 'msg': {'tty_resize': [ width, height ]},
- });
- var moduleList = document.getElementById('modules');
- if (moduleList.hasChildNodes() && moduleList.selectedIndex < 0) {
- moduleList.firstChild.selected = true;
- updateSelection();
- }
-};
-
-/**
- * Handle a keystroke from the user.
- * @param {string} str The keystroke.
- */
-GdbTerm.prototype.onVTKeystroke_ = function(str) {
- g_backgroundPort.postMessage({
- 'name': 'input',
- 'msg': {'gdb': str},
- });
-};
-
-/**
- * Setup handlers after terminal start.
- */
-GdbTerm.prototype.run = function() {
- this.io_.onVTKeystroke = this.onVTKeystroke_.bind(this);
- this.io_.onTerminalResize = this.onTerminalResize_.bind(this);
-};
-
-
-/**
- * Resize the config area to a given size.
- * @param {integer} sz The width in pixels.
- */
-function setWidth(sz) {
- var sized = document.getElementById('sized');
- var terminal = document.getElementById('terminal');
- var sizer = document.getElementById('sizer');
- var rowWidth = document.body.clientWidth;
- sz = Math.max(Math.min(sz, rowWidth - 100), 200);
- var newTerminalWidth = rowWidth - sz - sizer.clientWidth - 1;
- sized.style.width = sz + 'px';
- terminal.style.width = newTerminalWidth + 'px';
-}
-
-/**
- * Fixup the config area in the event of a reflow.
- */
-function fixupWidth() {
- var sized = document.getElementById('sized');
- setWidth(sized.clientWidth);
-}
-
-/**
- * Enable resizing by installing event handlers.
- */
-function enableSizer() {
- var sizer = document.getElementById('sizer');
- var sized = document.getElementById('sized');
- var terminal = document.getElementById('terminal');
- var baseX;
- var startWidth;
-
- function move(e) {
- setWidth(startWidth + e.clientX - baseX);
- }
-
- function up(e) {
- window.removeEventListener('mousemove', move, true);
- window.removeEventListener('mouseup', up, true);
- terminal.style.pointerEvents = 'auto';
- }
-
- sizer.addEventListener('mousedown', function(e) {
- e.preventDefault();
- baseX = e.clientX;
- startWidth = sized.clientWidth;
- document.body.focus();
- window.addEventListener('mousemove', move, true);
- window.addEventListener('mouseup', up, true);
- terminal.style.pointerEvents = 'none';
- }, true);
-}
-
-/**
- * Handle load events by creating an hterm.
- */
-window.onload = function() {
- lib.init(function() {
- var profileName = lib.f.parseQuery(document.location.search)['profile'];
- var terminal = new hterm.Terminal(profileName);
- terminal.decorate(document.querySelector('#terminal'));
-
- // Useful for console debugging.
- window.term_ = terminal;
-
- // We don't properly support the hterm bell sound, so we need to disable it.
- terminal.prefs_.definePreference('audible-bell-sound', '');
-
- terminal.setAutoCarriageReturn(true);
- terminal.setCursorPosition(0, 0);
- terminal.setCursorVisible(true);
- terminal.prefs_.set('foreground-color', 'black');
- terminal.prefs_.set('background-color', 'white');
- terminal.runCommandClass(GdbTerm, document.location.hash.substr(1));
- });
- enableSizer();
- fixupWidth();
- setupBackgroundPort();
-};
-
-/**
- * Handle window resizes by ensuring the config terminal split stays self
- * consistent.
- */
-window.addEventListener('resize', function(e) {
- fixupWidth();
-});
-
-/**
- * Check if a module title indicates it's GDB.
- * @param {string} title The title string of a module.
- * @return {boolean} True if it's GDB.
- */
-function isGdb(title) {
- return title.match(/^Native Client module:.*gdb.nmf$/);
-}
-
-/**
- * Given a module, return its title.
- * @param {Object} module An object containing info on one module.
- * @return {string} The title of the module.
- */
-function taskTitle(module) {
- var title = module.process.title;
- var m = title.match(/^Native Client module: (.*)$/);
- if (isGdb(title)) {
- title = '[GDB]';
- } else if (!m || m.length !== 2) {
- title = module.title;
- } else {
- title = m[1];
- }
- title += ' (' + module.debugState + ')';
- return title;
-}
-
-/**
- * Given a module, return a detailed string about it.
- * @param {Object} module An object containing info on one module.
- * @return {string} A string describing details about the module.
- */
-function taskInfo(module) {
- return 'id: ' + module.process.id + ', pid: ' + module.process.osProcessId +
- ', port: ' + module.process.naclDebugPort;
-}
-
-/**
- * Attempt to attach to the current module.
- */
-function attach(e) {
- // Halt events here to prevent a bad interaction with hterm.
- e.stopPropagation();
- e.preventDefault();
- var modules = document.getElementById('modules');
- g_backgroundPort.postMessage({
- 'name': 'attach',
- 'processId': modules.options[modules.selectedIndex].id,
- });
-}
-
-/**
- * Attempt to kill the current module.
- */
-function kill(e) {
- // Halt events here to prevent a bad interaction with hterm.
- e.stopPropagation();
- e.preventDefault();
- var modules = document.getElementById('modules');
- g_backgroundPort.postMessage({
- 'name': 'kill',
- 'processId': modules.options[modules.selectedIndex].id,
- });
-}
-
-/**
- * Attempt manual setup of GDB.
- */
-function attachManual(e) {
- // Halt events here to prevent a bad interaction with hterm.
- e.stopPropagation();
- e.preventDefault();
- g_backgroundPort.postMessage({
- 'name': 'attachManual',
- });
-}
-
-/**
- * Broadcast a change in configuration.
- */
-function configChanged() {
- g_backgroundPort.postMessage({
- 'name': 'settingsChange',
- 'settings': {
- 'onStartRun': document.getElementById('onStartRun').checked,
- 'onFaultAttach': document.getElementById('onFaultAttach').checked,
- 'showGdb': document.getElementById('showGdb').checked,
- },
- });
-}
-
-/**
- * React to a change in the selected module.
- */
-function updateSelection() {
- var modules = document.getElementById('modules');
- var moduleInfo = document.getElementById('moduleInfo');
- // Clear the terminal screen.
- window.io_.print('\x1b[H\x1b[2J');
- if (modules.selectedIndex >= 0) {
- var pick = modules.options[modules.selectedIndex];
- moduleInfo.innerText = pick.title;
- g_backgroundPort.postMessage({name: 'tune', 'processId': pick.id});
- // Send Ctrl-L
- g_backgroundPort.postMessage({
- 'name': 'input',
- 'msg': {'gdb': '\x0c'},
- });
- } else {
- moduleInfo.innerText = '';
- g_backgroundPort.postMessage({name: 'tune', 'processId': null});
- }
-}
-
-/**
- * Register a bunch of ui handlers on load.
- */
-window.addEventListener('load', function() {
- document.getElementById('onStartRun').addEventListener(
- 'click', configChanged);
- document.getElementById('onStartAttach').addEventListener(
- 'click', configChanged);
- document.getElementById('onFaultAttach').addEventListener(
- 'click', configChanged);
- document.getElementById('onFaultTerminate').addEventListener(
- 'click', configChanged);
- document.getElementById('showGdb').addEventListener(
- 'click', configChanged);
- var attachElement = document.getElementById('attach');
- var killElement = document.getElementById('kill');
- var modules = document.getElementById('modules');
- attachElement.disabled = true;
- killElement.disabled = true;
- attachElement.addEventListener('click', attach);
- killElement.addEventListener('click', kill);
- modules.addEventListener('click', function() {
- attachElement.disabled = false;
- killElement.disabled = false;
- updateSelection();
- });
- modules.addEventListener('dblclick', attach);
- document.getElementById('manual').addEventListener('click', attachManual);
-});
-
-/**
- * Update the UI with a change in settings or modules from elsewhere.
- * @param {Object} msg A dict capturing debugger state.
- */
-function handleChange(msg) {
- var settings = msg.settings;
- var modules = msg.naclModules;
-
- var moduleList = document.getElementById('modules');
- document.getElementById('onStartRun').checked = settings.onStartRun;
- document.getElementById('onStartAttach').checked = !settings.onStartRun;
- document.getElementById('onFaultAttach').checked = settings.onFaultAttach;
- document.getElementById('onFaultTerminate').checked =
- !settings.onFaultAttach;
- document.getElementById('showGdb').checked = settings.showGdb;
-
- function isVisible(processId) {
- if (!(processId in modules)) {
- return false;
- }
- return msg.settings.showGdb || !isGdb(modules[processId].process.title);
- }
-
- for (var i = 0; i < moduleList.childNodes.length; i++) {
- var child = moduleList.childNodes[i];
- if (!isVisible(child.id)) {
- moduleList.removeChild(child);
- --i;
- }
- }
- for (var processId in modules) {
- var module = modules[processId];
- if (!isVisible(processId))
- continue;
- var item = document.getElementById(processId);
- if (item === null) {
- item = document.createElement('option');
- item.setAttribute('id', processId);
- moduleList.appendChild(item);
- } else {
- item.removeChild(item.firstChild);
- }
- item.appendChild(document.createTextNode(taskTitle(module)));
- item.setAttribute('title', taskInfo(module));
- }
-}
-
-/**
- * Setup communication with the background page.
- */
-function setupBackgroundPort() {
- g_backgroundPort = chrome.runtime.connect({name: 'join'});
-
- g_backgroundPort.onDisconnect.addListener(function(msg) {
- // reconnect.
- g_backgroundPort = chrome.runtime.connect({name: 'join'});
- });
-
- g_backgroundPort.onMessage.addListener(function(msg) {
- if (msg.name === 'change') {
- handleChange(msg);
- } else if (msg.name === 'message') {
- if (msg.data.substr(0, 3) === 'gdb') {
- window.io_.print(msg.data.substr(3));
- }
- }
- });
-}
diff --git a/ports/gdb/extension/manifest.json.template b/ports/gdb/extension/manifest.json.template
deleted file mode 100644
index 90dee0b..0000000
--- a/ports/gdb/extension/manifest.json.template
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "Native Client Debugger",
- "short_name": "NaCl Debug",
- "description": "Debugger for Native Client Modules",
- "version": "7.7.0.%(version)s",
- "manifest_version": 2,
- "icons": {
- "16": "ladybug_gear_16.png",
- "48": "ladybug_gear_48.png",
- "128": "ladybug_gear_128.png"
- },
- "devtools_page": "devtools.html",
- "background": {
- "scripts": ["background.js"],
- "persistent": true
- },
- "externally_connectable": {
- "ids": ["*"],
- "matches": [
- "*://nacltools.storage.googleapis.com/*",
- "*://*.chrome.com/*",
- "*://localhost/*",
- "*://127.0.0.1/*",
- "*://0.0.0.0/*"
- ]
- },
- "permissions": [
- "processes"
- ]
-}
diff --git a/ports/gdb/gdb_test.py b/ports/gdb/gdb_test.py
deleted file mode 100755
index c44b22f..0000000
--- a/ports/gdb/gdb_test.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 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.
-
-"""Tests of gdb app component."""
-
-import os
-import sys
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(SCRIPT_DIR, '../..'))
-SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
-TOOLCHAIN = os.environ.get('TOOLCHAIN', 'newlib')
-GDB_OUT_DIR = os.path.join(SRC_DIR, 'out/publish/gdb', TOOLCHAIN)
-
-import chrome_test
-
-
-gdb_app = os.path.join(GDB_OUT_DIR, 'gdb_app')
-test_dir = os.path.join(SCRIPT_DIR, 'tests')
-test_out_dir = os.path.join(GDB_OUT_DIR, 'tests')
-
-if __name__ == '__main__':
- chrome_test.Main([
- '-C', test_dir,
- '-C', test_out_dir,
- '-t', '60',
- '--enable-nacl',
- '--enable-nacl-debug',
- '--load-and-launch-app', gdb_app,
- 'gdb_test.html'] + sys.argv[1:])
diff --git a/ports/gdb/key.txt b/ports/gdb/key.txt
deleted file mode 100644
index 673fa9e..0000000
--- a/ports/gdb/key.txt
+++ /dev/null
@@ -1 +0,0 @@
-"key":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAocLhY9ZTe6fmd+PQguSXe00nZ+/rN/ibaWvTDt8Ja09bmfiagxk0zjYJ0E+Yg30fm8Hd3qOEcyugbVDsKQEa5RtH3Eo/PLuHOKAUF5Lv19tNjHbFQN0YAw8nMzjpnPBspwRYVLAjDfxwonRWtPKWVDaLhpw5acs1LMiwhJz3z82oJCBp74bnxwXNstUjUmdEoSlRXckqQucvtAdyr+XSLTqhs2gGrJMhML1fQjG+PJYWGJloe2fLtmP+IfJKB+s/7U0GEPeXum+WFPlheyMemn5sS29EGPKd0De1nF2qF47hjT57s3CWWShSqlRAuxEC6HoEIGDpK7AnwyTeYMTnCwIDAQAB",
diff --git a/ports/gdb/ladybug_128.png b/ports/gdb/ladybug_128.png
deleted file mode 100644
index 7d0b0de..0000000
--- a/ports/gdb/ladybug_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/ladybug_16.png b/ports/gdb/ladybug_16.png
deleted file mode 100644
index bb392f3..0000000
--- a/ports/gdb/ladybug_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/ladybug_48.png b/ports/gdb/ladybug_48.png
deleted file mode 100644
index f06fb2d..0000000
--- a/ports/gdb/ladybug_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/gdb/manifest.json.template b/ports/gdb/manifest.json.template
deleted file mode 100644
index 916b80c..0000000
--- a/ports/gdb/manifest.json.template
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "Native Client GDB",
- "short_name": "NaCl GDB",
- "description": "GDB running using NativeClient",
- "version": "7.7.0.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "28",
- "icons": {
- "16": "ladybug_16.png",
- "48": "ladybug_48.png",
- "128": "ladybug_128.png"
- },
- %(key)s
- "app": {
- "background": {
- "scripts": ["background.js"],
- "persistent": true
- }
- },
- "externally_connectable": {
- "ids": ["*"],
- "matches": [
- "*://nacltools.storage.googleapis.com/*",
- "*://*.chrome.com/*",
- "*://localhost/*",
- "*://127.0.0.1/*",
- "*://0.0.0.0/*"
- ]
- },
- "permissions": [
- "storage",
- {"socket": [
- "resolve-host",
- "tcp-connect"
- ]}
- ],
- "platforms": [
- {
- "nacl_arch": "arm",
- "sub_package_path": "_platform_specific/arm/"
- },
- {
- "nacl_arch": "x86-32",
- "sub_package_path": "_platform_specific/i686/"
- },
- {
- "nacl_arch": "x86-64",
- "sub_package_path": "_platform_specific/x86_64/"
- }
- ]
-}
diff --git a/ports/gdb/nacl.patch b/ports/gdb/nacl.patch
deleted file mode 100644
index 128bddb..0000000
--- a/ports/gdb/nacl.patch
+++ /dev/null
@@ -1,257 +0,0 @@
-diff --git a/bfd/opncls.c b/bfd/opncls.c
---- a/bfd/opncls.c
-+++ b/bfd/opncls.c
-@@ -673,6 +673,10 @@ bfd_openw (const char *filename, const char *target)
- static inline void
- _maybe_make_executable (bfd * abfd)
- {
-+#if defined(__native_client__)
-+ /* TODO(bradnelson): Fix nacl_io and remove. */
-+ (void) abfd;
-+#else
- /* If the file was open for writing and is now executable,
- make it so. */
- if (abfd->direction == write_direction
-@@ -694,6 +698,7 @@ _maybe_make_executable (bfd * abfd)
- & (buf.st_mode | ((S_IXUSR | S_IXGRP | S_IXOTH) &~ mask))));
- }
- }
-+#endif
- }
-
- /*
-diff --git a/config/dfp.m4 b/config/dfp.m4
---- a/config/dfp.m4
-+++ b/config/dfp.m4
-@@ -23,7 +23,7 @@ Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
- powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
- i?86*-*-gnu* | \
- i?86*-*-mingw* | x86_64*-*-mingw* | \
-- i?86*-*-cygwin* | x86_64*-*-cygwin*)
-+ i?86*-*-cygwin* | x86_64*-*-cygwin* | *nacl*)
- enable_decimal_float=yes
- ;;
- *)
-diff --git a/gdb/charset.c b/gdb/charset.c
---- a/gdb/charset.c
-+++ b/gdb/charset.c
-@@ -767,6 +767,7 @@ find_charset_names (void)
- introduction even when stdout is not a tty. Newer versions omit
- the intro if stdout is not a tty. */
-
-+#if !defined(__native_client__)
- static int
- ignore_line_p (const char *line)
- {
-@@ -790,10 +791,14 @@ ignore_line_p (const char *line)
-
- return 0;
- }
-+#endif
-
- static void
- find_charset_names (void)
- {
-+#if defined(__native_client__)
-+ charsets = NULL;
-+#else
- struct pex_obj *child;
- char *args[3];
- int err, status;
-@@ -915,6 +920,7 @@ find_charset_names (void)
- }
- else
- VEC_safe_push (char_ptr, charsets, NULL);
-+#endif
- }
-
- #endif /* HAVE_ICONVLIST || HAVE_LIBICONVLIST */
-diff --git a/gdb/configure b/gdb/configure
---- a/gdb/configure
-+++ b/gdb/configure
-@@ -5188,7 +5188,7 @@ fi
- gdb_host_obs=posix-hdep.o
-
- if test "${target}" = "${host}"; then
-- gdb_native=yes
-+ gdb_native=no
- else
- gdb_native=no
- fi
-diff --git a/gdb/inflow.c b/gdb/inflow.c
---- a/gdb/inflow.c
-+++ b/gdb/inflow.c
-@@ -121,6 +121,7 @@ gdb_getpgrp (void)
- {
- int process_group = -1;
-
-+#if !defined(__native_client__)
- #ifdef HAVE_TERMIOS
- process_group = tcgetpgrp (0);
- #endif
-@@ -130,6 +131,7 @@ gdb_getpgrp (void)
- #ifdef HAVE_SGTTY
- ioctl (0, TIOCGPGRP, &process_group);
- #endif
-+#endif
- return process_group;
- }
- #endif
-@@ -327,11 +329,13 @@ terminal_inferior (void)
-
- if (job_control)
- {
-+#if !defined(__native_client__)
- #ifdef HAVE_TERMIOS
- result = tcsetpgrp (0, tinfo->process_group);
- if (!inf->attach_flag)
- OOPSY ("tcsetpgrp");
- #endif
-+#endif
-
- #ifdef HAVE_SGTTY
- result = ioctl (0, TIOCSPGRP, &tinfo->process_group);
-@@ -437,6 +441,7 @@ terminal_ours_1 (int output_only)
-
- if (job_control)
- {
-+#if !defined(__native_client__)
- #ifdef HAVE_TERMIOS
- result = tcsetpgrp (0, our_terminal_info.process_group);
- #if 0
-@@ -450,6 +455,7 @@ terminal_ours_1 (int output_only)
- safe_strerror (errno));
- #endif
- #endif /* termios */
-+#endif
-
- #ifdef HAVE_SGTTY
- result = ioctl (0, TIOCSPGRP, &our_terminal_info.process_group);
-@@ -808,7 +814,8 @@ clear_sigint_trap (void)
- pid_t
- create_tty_session (void)
- {
--#ifdef HAVE_SETSID
-+ /* TODO(bradnelson): Remove once nacl_io has a setsid implementation. */
-+#if defined(HAVE_SETSID) && !defined(__native_client__)
- pid_t ret;
-
- if (!job_control || inferior_thisrun_terminal == 0)
-diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
---- a/gdb/ser-pipe.c
-+++ b/gdb/ser-pipe.c
-@@ -100,7 +100,8 @@ pipe_open (struct serial *scb, const char *name)
- if (pid == 0)
- {
- /* We don't want ^c to kill the connection. */
--#ifdef HAVE_SETSID
-+ /* TODO(bradnelson): Remove once nacl_io has a setsid implementation. */
-+#if defined(HAVE_SETSID) && !defined(__native_client__)
- pid_t sid = setsid ();
- if (sid == -1)
- signal (SIGINT, SIG_IGN);
-diff --git a/gdb/utils.c b/gdb/utils.c
---- a/gdb/utils.c
-+++ b/gdb/utils.c
-@@ -3168,7 +3168,8 @@ gdb_realpath (const char *filename)
- path. Use that and realpath() to canonicalize the name. This is
- the most common case. Note that, if there isn't a compile time
- upper bound, you want to avoid realpath() at all costs. */
--#if defined (HAVE_REALPATH) && defined (PATH_MAX)
-+ /* TODO(bradnelson): Drop this once nacl_io has realpath. */
-+#if defined (HAVE_REALPATH) && defined (PATH_MAX) && !defined(__native_client__)
- {
- char buf[PATH_MAX];
- const char *rp = realpath (filename, buf);
-@@ -3209,7 +3210,8 @@ gdb_realpath (const char *filename)
- pathconf()) making it impossible to pass a correctly sized buffer
- to realpath() (it could always overflow). On those systems, we
- skip this. */
--#if defined (HAVE_REALPATH) && defined (_PC_PATH_MAX) && defined(HAVE_ALLOCA)
-+ /* TODO(bradnelson): Drop this once nacl_io has realpath. */
-+#if defined (HAVE_REALPATH) && defined (_PC_PATH_MAX) && defined(HAVE_ALLOCA) && !defined(__native_client__)
- {
- /* Find out the max path size. */
- long path_max = pathconf ("/", _PC_PATH_MAX);
-@@ -3770,6 +3772,7 @@ substitute_path_component (char **stringp, const char *from, const char *to)
-
- #ifdef HAVE_WAITPID
-
-+#if !defined(__native_client__)
- #ifdef SIGALRM
-
- /* SIGALRM handler for waitpid_with_timeout. */
-@@ -3781,6 +3784,7 @@ sigalrm_handler (int signo)
- }
-
- #endif
-+#endif
-
- /* Wrapper to wait for child PID to die with TIMEOUT.
- TIMEOUT is the time to stop waiting in seconds.
-@@ -3801,6 +3805,9 @@ wait_to_die_with_timeout (pid_t pid, int *status, int timeout)
-
- if (timeout > 0)
- {
-+#ifdef __native_client__
-+#undef SIGALRM
-+#endif
- #ifdef SIGALRM
- #if defined (HAVE_SIGACTION) && defined (SA_RESTART)
- struct sigaction sa, old_sa;
-diff --git a/libdecnumber/configure b/libdecnumber/configure
---- a/libdecnumber/configure
-+++ b/libdecnumber/configure
-@@ -4616,7 +4616,7 @@ else
- powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
- i?86*-*-gnu* | \
- i?86*-*-mingw* | x86_64*-*-mingw* | \
-- i?86*-*-cygwin* | x86_64*-*-cygwin*)
-+ i?86*-*-cygwin* | x86_64*-*-cygwin* | *nacl*)
- enable_decimal_float=yes
- ;;
- *)
-diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c
---- a/libiberty/lrealpath.c
-+++ b/libiberty/lrealpath.c
-@@ -79,7 +79,8 @@ lrealpath (const char *filename)
- path. Use that and realpath() to canonicalize the name. This is
- the most common case. Note that, if there isn't a compile time
- upper bound, you want to avoid realpath() at all costs. */
--#if defined(REALPATH_LIMIT)
-+ /* TODO(bradnelson): Drop this once nacl_io supports realpath. */
-+#if defined(REALPATH_LIMIT) && !defined(__native_client__)
- {
- char buf[REALPATH_LIMIT];
- const char *rp = realpath (filename, buf);
-@@ -109,7 +110,8 @@ lrealpath (const char *filename)
- pathconf()) making it impossible to pass a correctly sized buffer
- to realpath() (it could always overflow). On those systems, we
- skip this. */
--#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H)
-+ /* TODO(bradnelson): Drop this once nacl_io supports realpath. */
-+#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H) && !defined(__native_client__)
- {
- /* Find out the max path size. */
- long path_max = pathconf ("/", _PC_PATH_MAX);
-diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
---- a/libiberty/pex-unix.c
-+++ b/libiberty/pex-unix.c
-@@ -593,6 +593,9 @@ pex_unix_exec_child (struct pex_obj *obj, int flags, const char *executable,
- int in, int out, int errdes,
- int toclose, const char **errmsg, int *err)
- {
-+#if defined(__native_client__)
-+ return -1;
-+#else
- pid_t pid;
-
- /* We declare these to be volatile to avoid warnings from gcc about
-@@ -720,6 +723,7 @@ pex_unix_exec_child (struct pex_obj *obj, int flags, const char *executable,
-
- return pid;
- }
-+#endif
- }
- #endif /* SPAWN */
-
diff --git a/ports/gdb/pkg_info b/ports/gdb/pkg_info
deleted file mode 100644
index 41b7c58..0000000
--- a/ports/gdb/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=gdb
-VERSION=7.7
-URL=https://chromium.googlesource.com/native_client/nacl-binutils.git@5deb479
-LICENSE=CUSTOM
-# arm-nacl-clang crashes
-# https://code.google.com/p/nativeclient/issues/detail?id=4114
-# glibc/arm: missing FIONBIO ioctl
-# https://code.google.com/p/nativeclient/issues/detail?id=4233
-DISABLED_TOOLCHAIN=(glibc/arm clang-newlib/arm pnacl emscripten)
-BUILD_OS=linux
-DEPENDS=(ncurses expat readline zlib glibc-compat nacl-spawn)
diff --git a/ports/gdb/test_module.cc b/ports/gdb/test_module.cc
deleted file mode 100644
index 7682807..0000000
--- a/ports/gdb/test_module.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2014 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.
-
-#include <stdlib.h>
-
-#include "ppapi/cpp/instance.h"
-#include "ppapi/cpp/module.h"
-#include "ppapi/cpp/var.h"
-#include "ppapi/utility/completion_callback_factory.h"
-
-
-class TestModuleInstance : public pp::Instance {
- public:
- explicit TestModuleInstance(PP_Instance instance)
- : pp::Instance(instance), callback_factory_(this) {}
-
- private:
- virtual void HandleMessage(const pp::Var& var_message) {
- std::string msg = var_message.AsString();
- if (msg == "exit") {
- exit(0);
- } else if (msg == "ping") {
- pp::Module::Get()->core()->CallOnMainThread(
- 0, callback_factory_.NewCallback(&TestModuleInstance::Pong), 0);
- } else if (msg == "fault") {
- __builtin_trap();
- }
- }
-
- void Pong(int32_t) {
- PostMessage("pong");
- }
-
- private:
- pp::CompletionCallbackFactory<TestModuleInstance> callback_factory_;
-};
-
-class TestModuleModule : public pp::Module {
- public:
- TestModuleModule() : pp::Module() {}
- virtual ~TestModuleModule() {}
-
- virtual pp::Instance* CreateInstance(PP_Instance instance) {
- return new TestModuleInstance(instance);
- }
-};
-
-namespace pp {
-Module* CreateModule() { return new TestModuleModule(); }
-} // namespace pp
diff --git a/ports/gdb/tests/common.js b/ports/gdb/tests/common.js
deleted file mode 100644
index 7034468..0000000
--- a/ports/gdb/tests/common.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals chrometest, ASSERT_NE, ASSERT_FALSE */
-
-'use strict';
-
-/**
- * Wait until a certain number of NaCl modules start/stop.
- * Waits until the number of extra modules vs a snapshot equals a certain
- * number. Also, waits until the debug port is known.
- * @param {integer} count Number of modules in addition to the snapshot to
- * wait for.
- * @param {Object.<integer, ProcessInfo>} snapshot A snapshot of the the
- * process set from getAllProcesses.
- * @return {Promise.Array.<ProcesssInfo>} Promise to wait until
- * the module count matches with a list of extra modules.
- */
-function waitForExtraModuleCount(count, snapshot) {
- return chrometest.getAllProcesses().then(function(processes) {
- var extraModules = [];
- for (var i in processes) {
- if (processes[i].type != 'nacl') {
- continue;
- }
- // Ignore modules until they have a known debug port.
- if (processes[i].naclDebugPort < 0) {
- continue;
- }
- if (!(i in snapshot)) {
- extraModules.push(processes[i]);
- }
- }
- if (extraModules.length == count) {
- return Promise.resolve(extraModules);
- } else {
- // Try again in 100ms.
- return chrometest.sleep(100).then(function() {
- return waitForExtraModuleCount(count, snapshot);
- });
- }
- });
-}
-
-/**
- * Create a new test module.
- * @return {Promise.[ProcessInfo, Element]} Promise to create element.
- */
-function createModule() {
- var object = null;
- return chrometest.getAllProcesses().then(function(oldProcesses) {
- object = document.createElement('embed');
- object.setAttribute('src', 'test_module.nmf');
- object.setAttribute('type', 'application/x-nacl');
- object.setAttribute('width', '0');
- object.setAttribute('height', '0');
- document.body.appendChild(object);
- return waitForExtraModuleCount(1, oldProcesses);
- }).then(function(newModules) {
- return Promise.resolve([newModules[0], object]);
- });
-}
-
-/**
- * Create a waiter wrapper around a NaCl module.
- * @param {Element} module The module to wrap.
- * @return {chrometest.PortlikeWaiter} A promise based waiter.
- */
-function moduleMessageWaiter(module) {
- var waiter;
- function handleMessage(msg) {
- waiter.enqueue(Promise.resolve(msg));
- }
- waiter = new chrometest.PortlikeWaiter(function() {
- module.removeEventListener(handleMessage);
- }, module);
- module.addEventListener('message', handleMessage, true);
- return waiter;
-}
-
-
-/**
- * Wait for a message other the name 'message' (from terminal).
- * @param {Port} portLike a port like waiter object to wait on.
- * @return {Promise} Promise to wait for a message.
- */
-function waitIgnoringTerminal(portLike) {
- function waitForReply(msg) {
- // Ignore terminal messages.
- if (msg.name == 'message') {
- return portLike.wait().then(waitForReply);
- }
- return msg;
- }
- return portLike.wait().then(waitForReply);
-}
-
-
-function TestModuleTest() {
- chrometest.Test.call(this);
- this.process = null;
- this.object = null;
-}
-TestModuleTest.prototype = new chrometest.Test();
-
-TestModuleTest.prototype.setUp = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return chrometest.Test.prototype.setUp.call(self);
- }).then(function() {
- // Snapshot the processes that are running before the test begins for later
- // use.
- return chrometest.getAllProcesses();
- }).then(function(initialProcesses) {
- self.initialProcesses = initialProcesses;
- return createModule();
- }).then(function(args) {
- self.process = args[0];
- self.rawObject = args[1];
- self.object = moduleMessageWaiter(args[1]);
- ASSERT_NE(null, self.process, 'there must be a process');
- // Done with ASSERT_FALSE because otherwise self.rawObject will attempt to
- // jsonify the DOM element.
- ASSERT_FALSE(null === self.rawObject, 'there must be a DOM element');
- });
-};
-
-TestModuleTest.prototype.tearDown = function() {
- var self = this;
- // Wait for the test module to exit.
- return waitForExtraModuleCount(0, self.initialProcesses).then(function() {
- // Remove node.
- if (self.object !== null) {
- var object = self.object.detach();
- self.object = null;
- self.rawObject = null;
- var p = object.parentNode;
- p.removeChild(object);
- }
- return chrometest.Test.prototype.tearDown.call(self);
- });
-};
diff --git a/ports/gdb/tests/debugger_test.html b/ports/gdb/tests/debugger_test.html
deleted file mode 100644
index 79d7f8d..0000000
--- a/ports/gdb/tests/debugger_test.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<!--
-Copyright (c) 2014 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.
--->
-<body onload="init();">
-<script src="/_chrome_test.js"></script>
-<script>
-function init() {
- chrometest.run([
- 'common.js',
- 'debugger_test.js',
- ]);
-}
-</script>
-</body>
-</html>
diff --git a/ports/gdb/tests/debugger_test.js b/ports/gdb/tests/debugger_test.js
deleted file mode 100644
index df02791..0000000
--- a/ports/gdb/tests/debugger_test.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals ASSERT_EQ, ASSERT_LE, ASSERT_GE, EXPECT_EQ, TEST_F, TEST */
-/* globals chrometest, TestModuleTest, waitForExtraModuleCount */
-/* globals waitIgnoringTerminal, ASSERT_TRUE, ASSERT_FALSE */
-
-'use strict';
-
-function DebugExtensionTest() {
- this.debugExt = null;
- this.moduleId = null;
- this.change = null;
-}
-DebugExtensionTest.prototype = new TestModuleTest();
-
-DebugExtensionTest.prototype.setUp = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return TestModuleTest.prototype.setUp.call(self);
- }).then(function() {
- // Wait for test module to be run by extensions.
- return chrometest.sleep(500);
- }).then(function() {
- return chrometest.proxyExtension('Native Client Debugger');
- }).then(function(debugExt) {
- self.debugExt = debugExt;
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('join', msg.cause);
- var ids = Object.keys(msg.naclModules);
- ASSERT_EQ(1, ids.length);
- self.moduleId = ids[0];
- self.change = msg;
- self.initialSettings = JSON.parse(JSON.stringify(msg.settings));
- ASSERT_TRUE(msg.naclModules[self.moduleId].process.title.indexOf(
- 'test_module.nmf') >= 0);
- });
-};
-
-DebugExtensionTest.prototype.tearDown = function() {
- var self = this;
- return Promise.resolve().then(function() {
- // Put extension back in default state.
- self.debugExt.postMessage({'name': 'defaultSettings'});
- // Also skip over remaining terminal messages.
- return waitIgnoringTerminal(self.debugExt);
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('settingsChange', msg.cause);
- // Confirm extension has been put back in default state.
- for (var key in self.initialSettings) {
- ASSERT_EQ(self.initialSettings[key], msg.settings[key],
- 'check key: ' + key);
- }
- // Then disconnect from extension.
- self.debugExt.disconnect();
- return TestModuleTest.prototype.tearDown.call(self);
- });
-};
-
-DebugExtensionTest.prototype.checkAttach = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('faulted', msg.cause);
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- // In cases where the debug port is not immediately known,
- // a later 'updated' event may trigger attach instead of the initial
- // 'create'.
- ASSERT_TRUE('create' == msg.cause || 'updated' == msg.cause);
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('setup', msg.cause);
- self.debugExt.postMessage({name: 'tune', 'processId': self.moduleId});
- // Wait for output from gdb before interacting with it.
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('message', msg.name);
- });
-};
-
-DebugExtensionTest.prototype.checkQuitGdb = function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.debugExt.postMessage(
- {'name': 'input', 'msg': {'gdb': 'kill\ny\n'}});
- return waitIgnoringTerminal(self.debugExt);
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('exit', msg.cause);
- var ids = Object.keys(msg.naclModules);
- ASSERT_EQ(1, ids.length);
- self.debugExt.postMessage(
- {'name': 'input', 'msg': {'gdb': 'quit\n'}});
- return waitIgnoringTerminal(self.debugExt);
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('exit', msg.cause);
- var ids = Object.keys(msg.naclModules);
- ASSERT_EQ(0, ids.length);
- });
-};
-
-
-TEST_F(DebugExtensionTest, 'testExit', function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.object.postMessage('exit');
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('exit', msg.cause);
- var ids = Object.keys(msg.naclModules);
- ASSERT_EQ(0, ids.length);
- });
-});
-
-
-TEST_F(DebugExtensionTest, 'testFaultKilled', function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.change.settings.onFaultAttach = false;
- self.debugExt.postMessage(
- {'name': 'settingsChange', 'settings': self.change.settings});
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('settingsChange', msg.cause);
- ASSERT_FALSE(msg.settings.onFaultAttach);
- self.object.postMessage('fault');
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('killed', msg.cause);
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('exit', msg.cause);
- var ids = Object.keys(msg.naclModules);
- ASSERT_EQ(0, ids.length);
- });
-});
-
-
-TEST_F(DebugExtensionTest, 'testFaultAttach', function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.change.settings.onFaultAttach = true;
- self.debugExt.postMessage(
- {'name': 'settingsChange', 'settings': self.change.settings});
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('settingsChange', msg.cause);
- ASSERT_TRUE(msg.settings.onFaultAttach);
- self.object.postMessage('fault');
- return self.checkAttach();
- }).then(function() {
- return self.checkQuitGdb();
- });
-});
-
-
-TEST_F(DebugExtensionTest, 'testRunningKill', function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.debugExt.postMessage({name: 'kill', 'processId': self.moduleId});
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('exit', msg.cause);
- var ids = Object.keys(msg.naclModules);
- ASSERT_EQ(0, ids.length);
- });
-});
-
-
-TEST_F(DebugExtensionTest, 'testRunningAttach', function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.debugExt.postMessage({name: 'attach', 'processId': self.moduleId});
- self.debugExt.postMessage({name: 'tune', 'processId': self.moduleId});
- return self.checkAttach();
- }).then(function() {
- return self.checkQuitGdb();
- });
-});
-
-
-TEST('DebugExtensionTest', 'testInstallCheck', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return chrometest.proxyExtension('Native Client Debugger');
- }).then(function(debugExt) {
- self.debugExt = debugExt;
- return self.debugExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('change', msg.name);
- ASSERT_EQ('join', msg.cause);
- self.debugExt.postMessage({name: 'installCheck'});
- return self.debugExt.wait();
- }).then(function(msg) {
- EXPECT_EQ('installCheckReply', msg.name, 'we are installed');
- self.debugExt.disconnect();
- });
-});
diff --git a/ports/gdb/tests/gdb_background_test.js b/ports/gdb/tests/gdb_background_test.js
deleted file mode 100644
index 75d1753..0000000
--- a/ports/gdb/tests/gdb_background_test.js
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals ASSERT_EQ, ASSERT_LE, ASSERT_GE, EXPECT_EQ, TEST_F, TEST */
-/* globals chrometest, TestModuleTest, waitForExtraModuleCount */
-/* globals waitIgnoringTerminal */
-
-'use strict';
-
-function GdbExtensionTestModuleTest() {
- TestModuleTest.call(this);
- this.gdbExt = null;
-}
-GdbExtensionTestModuleTest.prototype = new TestModuleTest();
-
-GdbExtensionTestModuleTest.prototype.setUp = function() {
- var self = this;
- return Promise.resolve().then(function() {
- return TestModuleTest.prototype.setUp.call(self);
- }).then(function() {
- return self.newGdbExtPort(self.process.naclDebugPort);
- }).then(function(gdbExt) {
- self.gdbExt = gdbExt;
- });
-};
-
-GdbExtensionTestModuleTest.prototype.tearDown = function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.gdbExt.disconnect();
- return TestModuleTest.prototype.tearDown.call(self);
- });
-};
-
-/**
- * Create a new port to the GDB extension.
- * @param {integer} debugTcpPort Tcp port of the module to manage.
- * @return {Promise.Port} Promise a port to the GDB extension.
- */
-GdbExtensionTestModuleTest.prototype.newGdbExtPort = function(debugTcpPort) {
- var keepPort = null;
- return Promise.resolve().then(function() {
- return chrometest.proxyExtension('Native Client GDB');
- }).then(function(gdbExtPort) {
- keepPort = gdbExtPort;
- keepPort.postMessage({'name': 'setDebugTcpPort',
- 'debugTcpPort': debugTcpPort});
- return keepPort.wait();
- }).then(function(msg) {
- ASSERT_EQ('setDebugTcpPortReply', msg.name,
- 'expect debug extension port reply');
- return Promise.resolve(keepPort);
- });
-};
-
-/**
- * Start up GDB and detach.
- * @return {Promise} A promise to wait.
- */
-GdbExtensionTestModuleTest.prototype.runGdb = function() {
- var self = this;
- var keepPort = null;
- return Promise.resolve().then(function() {
- return chrometest.getAllProcesses();
- }).then(function(oldProcesses) {
- // Start gdb on the target process.
- self.gdbExt.postMessage({'name': 'runGdb'});
- return waitForExtraModuleCount(1, oldProcesses);
- }).then(function(newModules) {
- var gdbProcess = newModules[0];
- return self.newGdbExtPort(gdbProcess.naclDebugPort);
- }).then(function(gdbExtForGdb) {
- keepPort = gdbExtForGdb;
- keepPort.postMessage({'name': 'rspDetach'});
- return keepPort.wait();
- }).then(function(msg) {
- ASSERT_EQ('rspDetachReply', msg.name, 'expect successful detach');
- keepPort.disconnect();
- // Wait for load.
- return self.gdbExt.wait();
- }).then(function(msg) {
- EXPECT_EQ('load', msg.name, 'expecting a load');
- // Expecting 16-19 lines out.
- return self.waitForGdbPrompt(16, 19);
- });
-};
-
-/**
- * Wait for the gdb prompt.
- *
- * Expect variable (within a range) amount of output from GDB prior to the
- * "(gdb)" prompt returning.
- * @param {integer} min Minimum number of writes (lines plus echo) expected
- * from GDB.
- * @param {integer} max Maximum number of writes (lines plus echo) expected
- * from GDB.
- * @return {Promise} A promise to wait.
- */
-GdbExtensionTestModuleTest.prototype.waitForGdbPrompt = function(min, max) {
- var self = this;
- var lineCount = 0;
- function checkLine(msg) {
- ASSERT_EQ('message', msg.name, 'expecting a message');
- var prefix = msg.data.slice(0, 3);
- var data = msg.data.slice(3);
- EXPECT_EQ('gdb', prefix, 'expected gdb term message');
- if (data == '(gdb) ') {
- ASSERT_GE(lineCount, min, 'expect gdb to emit more lines first');
- // Done.
- return;
- } else {
- lineCount++;
- ASSERT_LE(lineCount, max, 'expect limited text, got extra: ' + data);
- // Recurse.
- return self.gdbExt.wait().then(checkLine);
- }
- }
- return self.gdbExt.wait().then(checkLine);
-};
-
-/**
- * Wait for expected writes from gdb.
- * @param {Array.String} writes A list of writes to expect from GDB.
- * @return {Promise} A promise to wait.
- */
-GdbExtensionTestModuleTest.prototype.waitForGdbReply = function(lines) {
- var self = this;
- function checkLine() {
- if (lines.length === 0) {
- return;
- }
- return Promise.resolve().then(function() {
- return self.gdbExt.wait();
- }).then(function(msg) {
- ASSERT_EQ('message', msg.name, 'expecting a message');
- var prefix = msg.data.slice(0, 3);
- var data = msg.data.slice(3);
- EXPECT_EQ('gdb', prefix, 'expected gdb term message');
- EXPECT_EQ(lines[0], data, 'expect matching line');
- lines = lines.slice(1);
- return checkLine();
- });
- }
- return checkLine();
-};
-
-/**
- * Send a command to gdb (as keystrokes).
- * @param {String} cmd.
- */
-GdbExtensionTestModuleTest.prototype.sendGdbCommand = function(cmd) {
- var self = this;
- self.gdbExt.postMessage(
- {'name': 'input', 'msg': {'gdb': cmd}});
-};
-
-/**
- * Send a command to gdb and wait for echo followed by a reply.
- *
- * Checks for (gdb) prompt after the command.
- * @param {String} cmd The command to send.
- * @param {Array.String} expected A list of expected write back from gdb.
- * @return {Promise} A promise to do it.
- */
-GdbExtensionTestModuleTest.prototype.gdbCommand = function(cmd, expected) {
- var self = this;
- return Promise.resolve().then(function() {
- self.sendGdbCommand(cmd);
- var response = [];
- for (var i = 0; i < cmd.length; i++) {
- response.push(cmd[i]);
- }
- response = response.concat(expected);
- response.push('(gdb) ');
- return self.waitForGdbReply(response);
- });
-};
-
-/**
- * Exit GDB and check for expected behavior.
- * @return {Promise} A promise to do it.
- */
-GdbExtensionTestModuleTest.prototype.exitGdb = function() {
- var self = this;
- return Promise.resolve().then(function() {
- var msg = 'kill\ny\n';
- self.sendGdbCommand(msg);
- // The kill y/n prompt comes back with one less write than the number of
- // character for some reason.
- var len = msg.length - 1;
- return self.waitForGdbPrompt(len, len);
- }).then(function() {
- self.sendGdbCommand('quit\n');
- return waitIgnoringTerminal(self.gdbExt);
- }).then(function(msg) {
- EXPECT_EQ('exited', msg.name, 'expect exit');
- EXPECT_EQ(0, msg.returncode, 'expect 0');
- });
-};
-
-
-TEST_F(GdbExtensionTestModuleTest, 'testRspKill', function() {
- var self = this;
- self.gdbExt.postMessage({'name': 'rspKill'});
- return self.gdbExt.wait().then(function(msg) {
- EXPECT_EQ('rspKillReply', msg.name, 'reply should be right');
- });
-});
-
-
-TEST_F(GdbExtensionTestModuleTest, 'testRspDetach', function() {
- var self = this;
- self.gdbExt.postMessage({'name': 'rspDetach'});
- return self.gdbExt.wait().then(function(msg) {
- EXPECT_EQ('rspDetachReply', msg.name, 'reply should be right');
- // Wait a bit for the module to start.
- return chrometest.sleep(500);
- }).then(function() {
- self.object.postMessage('ping');
- return self.object.wait();
- }).then(function(msg) {
- EXPECT_EQ('pong', msg.data);
- self.object.postMessage('exit');
- });
-});
-
-
-TEST_F(GdbExtensionTestModuleTest, 'testRspContinueOk', function() {
- var self = this;
- self.gdbExt.postMessage({'name': 'rspContinue'});
- // Wait a bit for the module to start.
- return chrometest.sleep(500).then(function() {
- self.object.postMessage('ping');
- return self.object.wait();
- }).then(function(msg) {
- EXPECT_EQ('pong', msg.data);
- self.object.postMessage('exit');
- return self.gdbExt.wait();
- }).then(function(msg) {
- EXPECT_EQ('rspContinueReply', msg.name);
- EXPECT_EQ('exited', msg.type,
- 'expected module exit but got: ' + msg.reply);
- EXPECT_EQ(0, msg.number, 'expected 0 exit code');
- });
-});
-
-
-TEST_F(GdbExtensionTestModuleTest, 'testRspContinueFault', function() {
- var self = this;
- self.gdbExt.postMessage({'name': 'rspContinue'});
- // Wait a bit for the module to start.
- return chrometest.sleep(500).then(function() {
- self.object.postMessage('ping');
- return self.object.wait();
- }).then(function(msg) {
- EXPECT_EQ('pong', msg.data);
- self.object.postMessage('fault');
- return self.gdbExt.wait();
- }).then(function(msg) {
- EXPECT_EQ('rspContinueReply', msg.name);
- EXPECT_EQ('signal', msg.type,
- 'expected module signal but got: ' + msg.reply);
- self.gdbExt.postMessage({'name': 'rspKill'});
- return self.gdbExt.wait();
- }).then(function(msg) {
- EXPECT_EQ('rspKillReply', msg.name, 'reply should be right');
- });
-});
-
-
-TEST_F(GdbExtensionTestModuleTest, 'testRspContinueTwice', function() {
- var self = this;
- return Promise.resolve().then(function() {
- self.gdbExt.postMessage({'name': 'rspContinue'});
- // Wait a bit for the module to start.
- return chrometest.sleep(500);
- }).then(function() {
- self.object.postMessage('ping');
- return self.object.wait();
- }).then(function(msg) {
- EXPECT_EQ('pong', msg.data);
- // Continue a second time (should disconnect and reconnect).
- self.gdbExt.postMessage({'name': 'rspContinue'});
- // Wait for it to start.
- return chrometest.sleep(500);
- }).then(function() {
- self.object.postMessage('ping');
- return self.object.wait();
- }).then(function(msg) {
- EXPECT_EQ('pong', msg.data);
- self.object.postMessage('exit');
- return self.gdbExt.wait();
- }).then(function(msg) {
- EXPECT_EQ('rspContinueReply', msg.name);
- EXPECT_EQ('exited', msg.type,
- 'expected module exit but got: ' + msg.reply);
- EXPECT_EQ(0, msg.number, 'expected 0 exit code');
- });
-});
-
-
-TEST_F(GdbExtensionTestModuleTest, 'testGdbStart', function() {
- var self = this;
- return self.runGdb().then(function() {
- return self.exitGdb();
- });
-});
-
-
-TEST_F(GdbExtensionTestModuleTest, 'testGdbLoadSymbols', function() {
- var self = this;
- return self.runGdb().then(function() {
- return self.gdbCommand('remote get irt irt\n', [
- 'Successfully fetched file "irt".\n',
- ]);
- }).then(function() {
- return self.gdbCommand('nacl-irt irt\n', [
- 'Reading symbols from irt...',
- '(no debugging symbols found)...done.\n',
- ]);
- }).then(function() {
- return self.gdbCommand('remote get nexe nexe\n', [
- 'Successfully fetched file "nexe".\n',
- ]);
- }).then(function() {
- // Loads symbols from nexe without prompting.
- return self.gdbCommand('nacl-irt nexe\n', [
- 'Reading symbols from nexe...',
- 'done.\n',
- ]);
- }).then(function() {
- return self.exitGdb();
- });
-});
-
-
-TEST('GdbTest', 'testInstallCheck', function() {
- var self = this;
- return Promise.resolve().then(function() {
- return chrometest.proxyExtension('Native Client GDB');
- }).then(function(gdbExt) {
- self.gdbExt = gdbExt;
- self.gdbExt.postMessage({name: 'installCheck'});
- return self.gdbExt.wait();
- }).then(function(msg) {
- EXPECT_EQ('installCheckReply', msg.name, 'we are installed');
- self.gdbExt.disconnect();
- });
-});
diff --git a/ports/gdb/tests/gdb_test.html b/ports/gdb/tests/gdb_test.html
deleted file mode 100644
index 856f00e..0000000
--- a/ports/gdb/tests/gdb_test.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<!--
-Copyright (c) 2014 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.
--->
-<body onload="init();">
-<script src="/_chrome_test.js"></script>
-<script>
-function init() {
- chrometest.run([
- 'common.js',
- 'gdb_background_test.js',
- ]);
-}
-</script>
-</body>
-</html>
diff --git a/ports/gdk-pixbuf/build.sh b/ports/gdk-pixbuf/build.sh
deleted file mode 100644
index 7f14604..0000000
--- a/ports/gdk-pixbuf/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2015 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.
-
-ConfigureStep() {
- EnableCliMain
- EXTRA_CONFIGURE_ARGS+=" --with-x11"
-
- export gio_can_sniff=no
- DefaultConfigureStep
-}
diff --git a/ports/gdk-pixbuf/pkg_info b/ports/gdk-pixbuf/pkg_info
deleted file mode 100644
index aa23114..0000000
--- a/ports/gdk-pixbuf/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gdk-pixbuf
-VERSION=2.30.8
-URL=https://download.gnome.org/sources/gdk-pixbuf/2.30/gdk-pixbuf-2.30.8.tar.xz
-LICENSE=GPL
-DEPENDS=(glib jpeg8d tiff libpng tar libx11)
-SHA1=6277b4e5b5e334b3669f15ae0376e184be9e8cd8
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gegl/build.sh b/ports/gegl/build.sh
deleted file mode 100644
index e19f223..0000000
--- a/ports/gegl/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2015 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.
-
-ConfigureStep() {
- EnableGlibcCompat
- EXTRA_CONFIGURE_ARGS+=" --disable-docs"
- NACLPORTS_CFLAGS+=" -std=gnu99"
- EnableCliMain
- DefaultConfigureStep
-}
diff --git a/ports/gegl/pkg_info b/ports/gegl/pkg_info
deleted file mode 100644
index a484d12..0000000
--- a/ports/gegl/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gegl
-VERSION=0.2.0
-URL=http://download.gimp.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2
-LICENSE=GPL
-DEPENDS=(babl gtk+ jsoncpp json-glib sdl)
-SHA1=764cc66cb3c7b261b8fc18a6268a0e264a91d573
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gettext/build.sh b/ports/gettext/build.sh
deleted file mode 100644
index a3c53e4..0000000
--- a/ports/gettext/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES="gettext-tools/src/msgfmt${NACL_EXEEXT}"
-
-EnableGlibcCompat
-
-if [ "${NACL_LIBC}" = "glibc" ]; then
- # The configure test for sigaction detects the fact
- # that glibc contains only stubs for sigation. We
- # want to ignore this and assume a working sigaction.
- export ac_cv_func_sigaction=yes
-fi
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- export lt_cv_archive_cmds_need_lc=no
-fi
diff --git a/ports/gettext/nacl.patch b/ports/gettext/nacl.patch
deleted file mode 100644
index 28c64ce..0000000
--- a/ports/gettext/nacl.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-diff --git a/gettext-runtime/gnulib-lib/stdint.in.h b/gettext-runtime/gnulib-lib/stdint.in.h
---- a/gettext-runtime/gnulib-lib/stdint.in.h
-+++ b/gettext-runtime/gnulib-lib/stdint.in.h
-@@ -85,7 +85,7 @@
- Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
- relies on the system <stdint.h> definitions, so include
- <sys/types.h> after @NEXT_STDINT_H@. */
--#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
-+#if @HAVE_SYS_TYPES_H@ && ! defined _AIX && ! defined __native_client__
- # include <sys/types.h>
- #endif
-
-diff --git a/gettext-tools/configure b/gettext-tools/configure
---- a/gettext-tools/configure
-+++ b/gettext-tools/configure
-@@ -3041,16 +3041,16 @@ $4
- int
- main ()
- {
--if (sizeof (($2)))
-+if (sizeof ($2))
- return 0;
- ;
- return 0;
- }
- _ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
--
--else
-+if ac_fn_c_try_compile "$LINENO"; then
- eval "$3=yes"
-+else
-+ :
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-@@ -20938,7 +20938,7 @@ fi
-
- case "$host_os" in
- hpux*) LTLIBC="" ;;
-- *) LTLIBC="-lc" ;;
-+ *) LTLIBC="" ;;
- esac
-
-
-diff --git a/gettext-tools/gnulib-lib/stdint.in.h b/gettext-tools/gnulib-lib/stdint.in.h
---- a/gettext-tools/gnulib-lib/stdint.in.h
-+++ b/gettext-tools/gnulib-lib/stdint.in.h
-@@ -82,10 +82,11 @@
- /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
- IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
- AIX 5.2 <sys/types.h> isn't needed and causes troubles.
-+ NaCl <sys/types.h> isn't needed and causes troubles.
- Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
- relies on the system <stdint.h> definitions, so include
- <sys/types.h> after @NEXT_STDINT_H@. */
--#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
-+#if @HAVE_SYS_TYPES_H@ && ! defined _AIX && ! defined __native_client__
- # include <sys/types.h>
- #endif
-
-diff --git a/gettext-tools/libgettextpo/stdint.in.h b/gettext-tools/libgettextpo/stdint.in.h
---- a/gettext-tools/libgettextpo/stdint.in.h
-+++ b/gettext-tools/libgettextpo/stdint.in.h
-@@ -82,10 +82,11 @@
- /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
- IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
- AIX 5.2 <sys/types.h> isn't needed and causes troubles.
-+ NaCl <sys/types.h> isn't needed and causes troubles.
- Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
- relies on the system <stdint.h> definitions, so include
- <sys/types.h> after @NEXT_STDINT_H@. */
--#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
-+#if @HAVE_SYS_TYPES_H@ && ! defined _AIX && !defined __native_client__
- # include <sys/types.h>
- #endif
-
-diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am
---- a/gettext-tools/src/Makefile.am
-+++ b/gettext-tools/src/Makefile.am
-@@ -247,7 +247,7 @@ urlget_SOURCES = urlget.c
- # use iconv().
- libgettextsrc_la_LDFLAGS = \
- -release @VERSION@ \
-- ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
-+ ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ -no-undefined
-
- libgettextsrc_la_CPPFLAGS = $(AM_CPPFLAGS)
-
-diff --git a/gettext-tools/src/Makefile.in b/gettext-tools/src/Makefile.in
---- a/gettext-tools/src/Makefile.in
-+++ b/gettext-tools/src/Makefile.in
-@@ -2006,7 +2006,7 @@ urlget_SOURCES = urlget.c
- # use iconv().
- libgettextsrc_la_LDFLAGS = -release @VERSION@ \
- ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) @LTLIBINTL@ \
-- @LTLIBICONV@ -lc -no-undefined $(am__append_2)
-+ @LTLIBICONV@ -no-undefined $(am__append_2)
- libgettextsrc_la_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_3)
-
- # Compile-time flags for particular source files.
-diff --git a/gettext-tools/tests/setlocale.c b/gettext-tools/tests/setlocale.c
---- a/gettext-tools/tests/setlocale.c
-+++ b/gettext-tools/tests/setlocale.c
-@@ -22,6 +22,15 @@
- #include <locale.h>
- #include <string.h>
-
-+/*
-+ * It not possible of override just the setlocale symbol with newlib
-+ * as its in the same object file as a lot of other symbols that are
-+ * also needed at link time.
-+ * TODO(sbc): fix newlib upstream by moving setlocale to its own
-+ * compilation unit.
-+ */
-+#ifndef _NEWLIB_VERSION
-+
- /* Return string representation of locale CATEGORY. */
- static const char *
- category_to_name (int category)
-@@ -161,3 +170,5 @@ setlocale (int category, SETLOCALE_CONST char *locale)
- }
- return retval;
- }
-+
-+#endif
diff --git a/ports/gettext/pkg_info b/ports/gettext/pkg_info
deleted file mode 100644
index 74e4054..0000000
--- a/ports/gettext/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gettext
-VERSION=0.19.2
-URL=http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.2.tar.xz
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-SHA1=81b6ee521412b8042085342ab4df19f11b280e41
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/geturl/Makefile b/ports/geturl/Makefile
deleted file mode 100644
index 37f6cb0..0000000
--- a/ports/geturl/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2014 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.
-
-GETURL = geturl_$(NACL_ARCH)$(NACL_EXEEXT)
-
-CPPFLAGS += -Wall -Werror
-
-all: $(GETURL)
-
-$(GETURL): geturl.cc
- $(NACLCXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
-
-clean:
- rm -f $(GETURL)
-
-.PHONY: clean all
diff --git a/ports/geturl/build.sh b/ports/geturl/build.sh
deleted file mode 100644
index ad8d502..0000000
--- a/ports/geturl/build.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableCliMainCxx
-
-ConfigureStep() {
- MakeDir ${BUILD_DIR}
- cp -rf ${START_DIR}/* ${BUILD_DIR}
-}
-
-BuildStep() {
- MAKEFLAGS+=" NACL_ARCH=${NACL_ARCH_ALT}"
- export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export CXXFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CXXFLAGS}"
- export LDFLAGS="${NACLPORTS_LDFLAGS}"
- export LIBS="${NACLPORTS_LIBS}"
- DefaultBuildStep
-}
-
-InstallStep() {
- PublishMultiArch geturl_${NACL_ARCH_ALT}${NACL_EXEEXT} geturl
-}
diff --git a/ports/geturl/geturl.cc b/ports/geturl/geturl.cc
deleted file mode 100644
index f9b4ace..0000000
--- a/ports/geturl/geturl.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-#define __STDC_FORMAT_MACROS
-
-#include <errno.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "ppapi_simple/ps.h"
-
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/cpp/completion_callback.h"
-#include "ppapi/cpp/instance_handle.h"
-#include "ppapi/cpp/module.h"
-#include "ppapi/cpp/url_loader.h"
-#include "ppapi/cpp/url_request_info.h"
-#include "ppapi/cpp/url_response_info.h"
-
-static bool IsTTY() {
- if (getenv("NO_TTY") != NULL)
- return false;
- return isatty(STDOUT_FILENO) != 0;
-}
-
-static int Download(int quiet, const char* url, const char* dst) {
- int32_t result;
- int percent_recieved = 0;
- int percent_recieved_previous = 0;
-
- pp::InstanceHandle instance(PSGetInstanceId());
-
- pp::URLRequestInfo url_request(instance);
- url_request.SetURL(url);
- url_request.SetMethod("GET");
- url_request.SetAllowCrossOriginRequests(true);
- url_request.SetRecordDownloadProgress(true);
-
- pp::URLLoader url_loader(instance);
- result = url_loader.Open(url_request, pp::BlockUntilComplete());
- if (result != PP_OK) {
- fprintf(stderr, "ERROR: Can't open url (%d): %s\n", result, url);
- return 1;
- }
-
- int fh = open(dst, O_WRONLY | O_CREAT);
- if (fh < 0) {
- fprintf(stderr, "ERROR: Can't open file (%d): %s\n", errno, dst);
- return 1;
- }
-
- char buffer[0x10000];
- ssize_t len;
- int64_t received = 0;
- int64_t total = 0;
- pp::URLResponseInfo info = url_loader.GetResponseInfo();
- if (info.GetStatusCode() != 200) {
- fprintf(stderr, "ERROR: got http error code %d for: %s\n",
- info.GetStatusCode(), url);
- close(fh);
- goto fail;
- }
-
- for (;;) {
- result = url_loader.ReadResponseBody(
- buffer, sizeof buffer, pp::BlockUntilComplete());
- if (result <= 0)
- break;
- len = write(fh, buffer, result);
- if (len != result) {
- fprintf(stderr, "ERROR: Failed writing to file (%d): %s\n", errno, dst);
- close(fh);
- goto fail;
- }
- url_loader.GetDownloadProgress(&received, &total);
- if (!quiet) {
- percent_recieved = received * 100 / total;
- if (IsTTY()) {
- printf("[%"PRId64"/%"PRId64" KiB %d%%]\r",
- received / 1024, total / 1024, percent_recieved);
- fflush(stdout);
- } else {
- if (percent_recieved / 10 > percent_recieved_previous / 10) {
- printf(".");
- percent_recieved_previous = percent_recieved;
- }
- }
- }
- } while (result > 0);
- if (!quiet) {
- if (IsTTY()) {
- printf(" \r");
- printf("[%"PRId64"/%"PRId64" KiB 100%%] Done.\n",
- received / 1024, total / 1024);
- } else {
- printf(" Done.\n");
- }
- }
-
- if (result != PP_OK) {
- fprintf(stderr, "ERROR: Failed downloading url (%d): %s\n", result, url);
- close(fh);
- goto fail;
- }
-
- if (close(fh) < 0) {
- fprintf(stderr, "ERROR: Failed closing file (%d): %s\n", errno, dst);
- goto fail;
- }
-
- return 0;
-
-fail:
- result = remove(dst);
- if (result < 0) {
- fprintf(stderr, "ERROR: Failed removing file (%d): %s\n", errno, dst);
- }
- return 1;
-}
-
-int main(int argc, char *argv[]) {
- if (argc == 4 && strcmp(argv[1], "-q") == 0) {
- return Download(1, argv[2], argv[3]);
- } else if (argc == 3) {
- return Download(0, argv[1], argv[2]);
- }
- fprintf(stderr, "USAGE: %s [-q] <url> <dst>\n", argv[0]);
- fprintf(stderr, "\n");
- fprintf(stderr, "-q = quiet mode\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "NOTE: This utility can only be used to download URLs\n");
- fprintf(stderr, "from the same origin or that have been whitelisted\n");
- fprintf(stderr, "in an extension manifest\n");
- return 1;
-}
diff --git a/ports/geturl/pkg_info b/ports/geturl/pkg_info
deleted file mode 100644
index 4ab6298..0000000
--- a/ports/geturl/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=geturl
-VERSION=0.1
-LICENSE=BSD
-DEPENDS=(nacl-spawn)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gflags/build.sh b/ports/gflags/build.sh
deleted file mode 100644
index ae8247f..0000000
--- a/ports/gflags/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 2016 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.
-
-if [[ $TOOLCHAIN == emscripten ]]; then
- EXTRA_CMAKE_ARGS+=" -DBUILD_gflags_LIB=OFF"
-fi
diff --git a/ports/gflags/nacl.patch b/ports/gflags/nacl.patch
deleted file mode 100644
index e40f93f..0000000
--- a/ports/gflags/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -293,7 +293,7 @@ foreach (TYPE IN ITEMS STATIC SHARED)
- if (BUILD_gflags${opts}_LIB)
- add_library (gflags${opts}-${type} ${TYPE} ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
- if (opts MATCHES "nothreads")
-- set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL};NOTHREADS")
-+ set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL};NO_THREADS")
- else ()
- set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL}")
- if (CMAKE_USE_PTHREADS_INIT)
diff --git a/ports/gflags/pkg_info b/ports/gflags/pkg_info
deleted file mode 100644
index b13a56b..0000000
--- a/ports/gflags/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gflags
-VERSION=2.1.2
-URL=https://github.com/gflags/gflags/archive/v2.1.2/gflags-2.1.2.tar.gz
-LICENSE=BSD
-SHA1=8bdbade9d041339dc14b4ab426e2354a5af38478
-# https://bugs.chromium.org/p/naclports/issues/detail?id=243
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gforth/build.sh b/ports/gforth/build.sh
deleted file mode 100644
index 39deb19..0000000
--- a/ports/gforth/build.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright (c) 2014 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.
-
-# NOTE: This build doesn't work in parallel.
-OS_JOBS=1
-
-# This build relies on certain host binaries.
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-HOST_INSTALL_DIR=${WORK_DIR}/install_host
-
-EXECUTABLE="gforth-ditc${NACL_EXEEXT}"
-EXECUTABLES="${EXECUTABLE}"
-MAKE_TARGETS="${EXECUTABLE}"
-
-EnableCliMain
-
-BuildHostGforth() {
- if [[ -f "${HOST_INSTALL_DIR}/bin/gforth" ]]; then
- return
- fi
- Banner "Building ${PACKAGE_NAME} for host"
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- CC="gcc -m32" LogExecute ${SRC_DIR}/configure --prefix=${HOST_INSTALL_DIR}
- LogExecute make -j${OS_JOBS}
- LogExecute make install
-}
-
-ConfigureStep() {
- ChangeDir ${SRC_DIR}
- LogExecute ./autogen.sh
- if ! grep '# NOTE: Disabling this, as it prevents sharing' configure; then
- echo "Autoconf failed to properly update configure"
- exit 1
- fi
- BuildHostGforth
- Banner "Building ${PACKAGE_NAME} for NaCl"
- export PATH="${HOST_INSTALL_DIR}/bin:${PATH}"
- host_gforth=$(which gforth)
- if [[ -z $host_gforth ]]; then
- echo "Failed to find host version of gforth"
- exit 1
- else
- echo "Host gforth found at: $(which gforth)"
- fi
- export skipcode=no
- EnableGlibcCompat
- ChangeDir ${BUILD_DIR}
- EXTRA_CONFIGURE_ARGS="--without-check"
- DefaultConfigureStep
-}
-
-InstallStep() {
- return
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
-
- LogExecute cp ${BUILD_DIR}/${EXECUTABLE} gforth_${NACL_ARCH}${NACL_EXEEXT}
-
- # TODO(bradnelson): Make this nicer.
- local TAR_DIR=${PUBLISH_DIR}/webports-dummydir
- MakeDir ${TAR_DIR}
-
- cp -r ${HOST_INSTALL_DIR}/* ${TAR_DIR}/
- rm -rf ${TAR_DIR}/bin
- rm -rf ${TAR_DIR}/share/info
- rm -rf ${TAR_DIR}/share/man
- rm -rf ${TAR_DIR}/include
- rm -f ${TAR_DIR}/lib/gforth/0.7.2/gforth-ditc
- tar cf ${PUBLISH_DIR}/gforth.tar webports-dummydir
- rm -rf ${TAR_DIR}
- shasum ${PUBLISH_DIR}/gforth.tar > ${PUBLISH_DIR}/gforth.tar.hash
-
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- gforth_*${NACL_EXEEXT} \
- -s . \
- -o gforth.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py gforth.nmf
-
- InstallNaClTerm ${PUBLISH_DIR}
-
- cp ${START_DIR}/gforth.js ${PUBLISH_DIR}/
-
- ChangeDir ${PUBLISH_DIR}
- Remove gforth.zip
- LogExecute zip -r gforth.zip .
-}
diff --git a/ports/gforth/diff_skip.txt b/ports/gforth/diff_skip.txt
deleted file mode 100644
index f453279..0000000
--- a/ports/gforth/diff_skip.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-aclocal.m4
-configure
diff --git a/ports/gforth/gforth.js b/ports/gforth/gforth.js
deleted file mode 100644
index 488283a..0000000
--- a/ports/gforth/gforth.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals NaClTerm, lib */
-
-'use strict';
-
-NaClTerm.nmf = 'gforth.nmf';
-
-function onFailure() {
- console.log('Failed to allocate space!\n');
- NaClTerm.init();
-}
-
-function requestTemporary(amount, success, failure) {
- navigator.webkitTemporaryStorage.requestQuota(amount, function(bytes) {
- window.webkitRequestFileSystem(
- window.TEMPORARY, bytes, success, failure);
- }, failure);
-}
-
-function requestPersistent(amount, success, failure) {
- navigator.webkitPersistentStorage.requestQuota(amount, function(bytes) {
- window.webkitRequestFileSystem(
- window.PERSISTENT, bytes, success, failure);
- }, failure);
-}
-
-function requestStorage(success, failure) {
- requestTemporary(1024 * 1024, function() {
- requestPersistent(1024 * 1024, success, failure);
- }, failure);
-}
-
-function onInit() {
- requestStorage(NaClTerm.init, onFailure);
-}
-
-window.onload = function() {
- lib.init(function() {
- onInit();
- });
-};
diff --git a/ports/gforth/nacl.patch b/ports/gforth/nacl.patch
deleted file mode 100644
index 60a1d4b..0000000
--- a/ports/gforth/nacl.patch
+++ /dev/null
@@ -1,266 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -262,7 +262,10 @@ LIBCC_SRC = cstr.fs unix/socket.fs
-
- LIBCC_DIST_SRC = libffi.fs fflib.fs $(LIBCC_SRC)
-
--LIBCC_BUILD_SRC = @LIBCC_BUILD_SRC@ $(LIBCC_SRC)
-+# Disable socket, cstr, fflib and libffi bindings as they have trouble
-+# building.
-+#LIBCC_BUILD_SRC = @LIBCC_BUILD_SRC@ $(LIBCC_SRC)
-+LIBCC_BUILD_SRC =
-
- FORTH_SRC = $(KERN_SRC) $(GFORTH_FI_SRC) $(EC_SRC) $(LIBCC_DIST_SRC) \
- ans-report.fs ansi.fs answords.fs \
-@@ -788,14 +791,14 @@ $(FORTH_GEN_ENGINE): prim.b prims2x.fs
- engine/prim-s.i: engine/prim.i
- grep -v '^#line ' $(srcdir)/engine/prim.i >$@
-
--kernel/aliases.fs: prim.b prims2x.fs kernel/aliases0.fs
-- $(CP) kernel/aliases0.fs $@-
-+kernel/aliases.fs: prim.b prims2x.fs $(srcdir)/kernel/aliases0.fs
-+ $(CP) $(srcdir)/kernel/aliases0.fs $@-
- $(PREFORTH) prims2x.fs -e "forth-flag on s\" prim.b\" ' output-alias ' noop process-file bye" >>$@-
- $(CP) $@- $@
- $(RM) $@-
-
--kernel/prim.fs: prim.b prims2x.fs kernel/prim0.fs
-- $(CP) kernel/prim0.fs kernel/prim.fs-
-+kernel/prim.fs: prim.b prims2x.fs $(srcdir)/kernel/prim0.fs
-+ $(CP) $(srcdir)/kernel/prim0.fs kernel/prim.fs-
- $(PREFORTH) prims2x.fs -e "forth-flag on s\" prim.b\" ' output-forth ' output-forth-combined process-file bye" >>$@-
- $(CP) $@- $@
- $(RM) $@-
-@@ -1001,18 +1004,22 @@ stamp-h: engine/config.h.in config.status stamp-h.in
- Makefile Makedist engine/Makefile gforthmi vmgen preforth machpc.fs doc/version.texi envos.fs build-ec: Makefile.in Makedist.in engine/Makefile.in gforthmi.in vmgen.in preforth.in machpc.fs.in doc/version.texi.in config.status configure.in envos.fs.in build-ec.in engine/libcc.h.in
- ./config.status
-
--config.status: configure
-+config.status: $(srcdir)/configure
- ./config.status --recheck
-
-+# NOTE: Redone to work correctly with VPATH.
- #create files for DOS, because DOS cannot do it itself
--makefile.dos engine/makefile.dos: mkdosmf.sed Makefile.in engine/Makefile.in
-- sed -f mkdosmf.sed <Makefile.in >makefile.dos
-- sed -f mkdosmf.sed <engine/Makefile.in >engine/makefile.dos
--
--makefile.os2 engine/makefile.os2: mkos2mf.sed Makefile.in engine/Makefile.in
-- sed -f mkos2mf.sed <Makefile.in >makefile.os2
-- sed -f mkos2mf.sed <engine/Makefile.in >engine/makefile.os2
-- echo '%.o: %.c' >>makefile.os2
-- echo ' $$(GCC) $$(CFLAGS) $$(CPPFLAGS) -c $$<' >>makefile.os2
-- echo '%.o: %.c' >>engine/makefile.os2
-- echo ' $$(GCC) $$(CFLAGS) $$(CPPFLAGS) -c $$<' >>engine/makefile.os2
-+makefile.dos: mkdosmf.sed Makefile.in
-+ sed -f $< <$(word 2,$^) >$@
-+engine/makefile.dos: mkdosmf.sed engine/Makefile.in
-+ sed -f $< <$(word 2,$^) >$@
-+
-+makefile.os2: mkos2mf.sed Makefile.in
-+ sed -f $< <$(word 2,$^) >$@
-+ echo '%.o: %.c' >>$@
-+ echo ' $$(GCC) $$(CFLAGS) $$(CPPFLAGS) -c $$<' >>$@
-+
-+engine/makefile.os2: mkos2mf.sed engine/Makefile.in
-+ sed -f $< <$(word 2,$^) >$@
-+ echo '%.o: %.c' >>$@
-+ echo ' $$(GCC) $$(CFLAGS) $$(CPPFLAGS) -c $$<' >>$@
-diff --git a/arch/386/machine.h b/arch/386/machine.h
---- a/arch/386/machine.h
-+++ b/arch/386/machine.h
-@@ -39,11 +39,13 @@
- #endif
- #endif
-
-+#if !defined(__native_client__)
- #define ASM_SM_SLASH_REM(d1lo, d1hi, n1, n2, n3) \
- asm("idivl %4": "=a"(n3),"=d"(n2) : "a"(d1lo),"d"(d1hi),"g"(n1):"cc");
-
- #define ASM_UM_SLASH_MOD(d1lo, d1hi, n1, n2, n3) \
- asm("divl %4": "=a"(n3),"=d"(n2) : "a"(d1lo),"d"(d1hi),"g"(n1):"cc");
-+#endif
-
- #include "../generic/machine.h"
-
-diff --git a/arch/amd64/machine.h b/arch/amd64/machine.h
---- a/arch/amd64/machine.h
-+++ b/arch/amd64/machine.h
-@@ -42,11 +42,13 @@
-
- #endif
-
-+#if !defined(__native_client__)
- #define ASM_SM_SLASH_REM(d1lo, d1hi, n1, n2, n3) \
- asm("idivq %4": "=a"(n3),"=d"(n2) : "a"(d1lo),"d"(d1hi),"g"(n1):"cc");
-
- #define ASM_UM_SLASH_MOD(d1lo, d1hi, n1, n2, n3) \
- asm("divq %4": "=a"(n3),"=d"(n2) : "a"(d1lo),"d"(d1hi),"g"(n1):"cc");
-+#endif
-
- #include "../generic/machine.h"
-
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -241,15 +241,15 @@ case "$host_cpu" in
- ;;
- i386)
- machine=386
-- CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr"
-+ CFLAGS="$CFLAGS -fomit-frame-pointer"
- ;;
- i486)
- machine=386
-- CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr"
-+ CFLAGS="$CFLAGS -fomit-frame-pointer"
- ;;
- i*86)
- machine=386
-- CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr"
-+ CFLAGS="$CFLAGS -fomit-frame-pointer"
- CFLAGS_1="$CFLAGS"
- CFLAGS="$CFLAGS -march=pentium"
- AC_TRY_COMPILE(,,,CFLAGS="$CFLAGS_1 -m486")
-@@ -259,7 +259,7 @@ case "$host_cpu" in
- in
- *-m32*)
- machine=386
-- CFLAGS="$CFLAGS -fomit-frame-pointer -fforce-addr"
-+ CFLAGS="$CFLAGS -fomit-frame-pointer"
- CFLAGS_1="$CFLAGS"
- CFLAGS="$CFLAGS -march=athlon64"
- ;;
-@@ -637,7 +637,9 @@ AC_MSG_RESULT($M4)
- AC_MSG_CHECKING([for gforth])
- GFORTH="`cd / && which gforth 2>/dev/null`"
- #the "$srcdir" = "." test defends agains the "../" bug in gforth-0.6.2
--(cd / && $GFORTH -e bye >/dev/null 2>/dev/null && test "$srcdir" = ".") || GFORTH=""
-+# NOTE: Disabling this, as it prevents sharing $srcdir with the host build and
-+# is not a problem in this version.
-+#(cd / && $GFORTH -e bye >/dev/null 2>/dev/null && test "$srcdir" = ".") || GFORTH=""
- if test -z "$GFORTH"; then
- PREFORTH='echo "You need to configure with a gforth in \$PATH to build this part" && false'
- kernel_anti_dependence=''
-@@ -651,12 +653,22 @@ AC_MSG_RESULT($PREFORTH)
-
- #echo "machine='$machine'"
-
--dnl AC_CHECK_PROG(asm_fs,asm.fs,arch/$machine/asm.fs,,$srcdir/arch/$machine)
--AC_CHECK_FILE($srcdir/arch/$machine/asm.fs,[asm_fs=arch/$machine/asm.fs],)
-+# NOTE: Switched to unconditional test, as these files are relevant even for a
-+# cross compiled build.
-+if test -e "$srcdir/arch/$machine/asm.fs"; then
-+ asm_fs="arch/$machine/asm.fs"
-+else
-+ asm_fs=''
-+fi
- AC_SUBST(asm_fs)
-
--dnl AC_CHECK_PROG(disasm_fs,disasm.fs,arch/$machine/disasm.fs,,$srcdir/arch/$machine)
--AC_CHECK_FILE($srcdir/arch/$machine/disasm.fs,[disasm_fs=arch/$machine/disasm.fs],)
-+# NOTE: Switched to unconditional test, as these files are relevant even for a
-+# cross compiled build.
-+if test -e "$srcdir/arch/$machine/disasm.fs"; then
-+ disasm_fs="arch/$machine/disasm.fs"
-+else
-+ disasm_fs=''
-+fi
- AC_SUBST(disasm_fs)
-
- AC_PATH_PROG(INSTALL_INFO,install-info,[echo '>>>>Please make info dir entry:'],$PATH:/sbin:/usr/sbin:/usr/local/sbin)
-diff --git a/engine/Makefile.in b/engine/Makefile.in
---- a/engine/Makefile.in
-+++ b/engine/Makefile.in
-@@ -89,7 +89,8 @@ XCFLAGS = @CFLAGS@
- XDEFINES = @DEFS@
- SWITCHES = $(XCFLAGS) $(XDEFINES) $(OPTDEFINES)
- #use -fno-inline to avoid register problems with asinh, atanh on gcc-3.3 on 386
--ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves -fno-inline -fno-reorder-blocks
-+#ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-defer-pop -fcaller-saves -fno-inline -fno-reorder-blocks
-+ENGINE_FLAGS = @ENGINE_FLAGS@ -fno-inline
- DEBUGFLAG = @DEBUGFLAG@
- CFLAGS = $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -Wall $(SWITCHES) -DDEFAULTPATH='"$(FORTHPATH)"' $(LTDLINCL)
- CFLAGS2 = $(DEBUGFLAG) -I$(srcdir)/../arch/$(machine) -I. -Wall $(SWITCHES) -DDEFAULTPATH='"$(FORTHPATH)"' $(LTDLINCL)
-diff --git a/engine/engine.c b/engine/engine.c
---- a/engine/engine.c
-+++ b/engine/engine.c
-@@ -221,6 +221,14 @@ extern int gforth_memcmp(const char * s1, const char * s2, size_t n);
- #endif
- #define SUPER_CONTINUE
-
-+/*
-+ * Redefined asm to nothing as even empty asm("") blocks won't build with
-+ * pnacl.
-+ */
-+#if defined(__pnacl__)
-+#define asm(x)
-+#endif
-+
- #ifdef ASMCOMMENT
- /* an individualized asm statement so that (hopefully) gcc's optimizer
- does not do cross-jumping */
-diff --git a/engine/io.c b/engine/io.c
---- a/engine/io.c
-+++ b/engine/io.c
-@@ -79,7 +79,7 @@ typedef unsigned int uint32_t;
-
- /* System V machines use termio. */
- #if !defined (_POSIX_VERSION)
--# if defined (USG) || defined (hpux) || defined (Xenix) || defined (sgi) || defined (DGUX) || defined (ultrix) || defined (Solaris) || defined(_WIN32)
-+# if defined (USG) || defined (hpux) || defined (Xenix) || defined (sgi) || defined (DGUX) || defined (ultrix) || defined (Solaris) || defined(_WIN32) || (defined(__native_client__) && defined(_NEWLIB_VERSION))
- # undef NEW_TTY_DRIVER
- # define TERMIO_TTY_DRIVER
- # include <termio.h>
-diff --git a/engine/longlong.h b/engine/longlong.h
---- a/engine/longlong.h
-+++ b/engine/longlong.h
-@@ -335,8 +335,8 @@ UDItype __umulsidi3 (USItype, USItype);
- "rm" ((USItype) (v)))
- #define udiv_qrnnd(q, r, n1, n0, dv) \
- __asm__ ("divl %4" \
-- : "=a" ((USItype) (q)), \
-- "=d" ((USItype) (r)) \
-+ : "=a" (q), \
-+ "=d" (r) \
- : "0" ((USItype) (n0)), \
- "1" ((USItype) (n1)), \
- "rm" ((USItype) (dv)))
-diff --git a/engine/main.c b/engine/main.c
---- a/engine/main.c
-+++ b/engine/main.c
-@@ -49,6 +49,10 @@
- /* #include <systypes.h> */
- #endif
-
-+#if defined(__native_client__)
-+# include "nacl_main.h"
-+#endif
-+
- /* output rules etc. for burg with --debug and --print-sequences */
- /* #define BURG_FORMAT*/
-
-@@ -2263,7 +2267,11 @@ void data_abort_C(void)
- }
- #endif
-
-+#if defined(__native_client__)
-+int main(int argc, char **argv)
-+#else
- int main(int argc, char **argv, char **env)
-+#endif
- {
- #ifdef HAS_OS
- char *path = getenv("GFORTHPATH") ? : DEFAULTPATH;
-@@ -2276,6 +2284,10 @@ int main(int argc, char **argv, char **env)
- Address image;
- #endif
- int retvalue;
-+
-+#if defined(__native_client__)
-+ nacl_startup_untar(argv[0], "gforth.tar", "/");
-+#endif
-
- code_here = ((void *)0)+CODE_BLOCK_SIZE; /* llvm-gcc does not like this as
- initializer, so we do it here */
diff --git a/ports/gforth/pkg_info b/ports/gforth/pkg_info
deleted file mode 100644
index e3159bc..0000000
--- a/ports/gforth/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=gforth
-VERSION=0.7.2
-URL=http://www.complang.tuwien.ac.at/forth/gforth/gforth-0.7.2.tar.gz
-LICENSE=gpl3
-DEPENDS=(glibc-compat nacl-spawn libtar)
-# arm-nacl-clang crashes
-# https://code.google.com/p/nativeclient/issues/detail?id=4114
-DISABLED_TOOLCHAIN=(clang-newlib/arm emscripten)
-SHA1=fe662c60b74290b08b6245816b68faed2a1e5c20
diff --git a/ports/giflib/build.sh b/ports/giflib/build.sh
deleted file mode 100644
index cc53387..0000000
--- a/ports/giflib/build.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXTRA_CONFIGURE_ARGS="--enable-x11=no"
-EXECUTABLES="util/rgb2gif${NACL_EXEEXT}"
-
-RunTest() {
- echo "Running util/rgb2gif on porsche.rgb"
- util/rgb2gif -s 320 200 < ${SRC_DIR}/tests/porsche.rgb > porsche.gif
- # TODO(sbc): do some basic checks on the resulting porsche.gif
-}
-
-TestStep() {
- if [[ ${NACL_LIBC} == glibc ]]; then
- # TODO(sbc): find out why glibc version of rgb2gif is crashing
- return
- fi
-
- RunTest
-
- if [[ ${NACL_ARCH} == pnacl ]]; then
- # Re-run tests with arm and x86-32 translations
- WriteLauncherScript util/rgb2gif rgb2gif.x86-32.nexe
- RunTest
- if [[ ${SEL_LDR_SUPPORTS_ARM} == 1 ]]; then
- WriteLauncherScript util/rgb2gif rgb2gif.arm.nexe
- RunTest
- fi
- fi
-}
-
-
-BuildStep() {
- # Limit the subdirecorties that get built by make. This is to
- # avoid the 'doc' directory which has a dependency on 'xmlto'.
- # If 'xmlto' were added to the host build dependencies this could
- # be removed.
- export PATH=${NACL_BIN_PATH}:${PATH}
- make -j${OS_JOBS} SUBDIRS="lib util"
-}
diff --git a/ports/giflib/pkg_info b/ports/giflib/pkg_info
deleted file mode 100644
index 704088c..0000000
--- a/ports/giflib/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=giflib
-VERSION=4.2.1
-URL=http://downloads.sf.net/project/giflib/giflib-4.x/giflib-4.2.1.tar.bz2
-LICENSE=CUSTOM:COPYING
-DEPENDS=(nacl-spawn)
-SHA1=82d5db53cf2cd19f09f511d40ff45ce80ab3ba8f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gimp-app/Xsdl.js b/ports/gimp-app/Xsdl.js
deleted file mode 100644
index f14ce84..0000000
--- a/ports/gimp-app/Xsdl.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-/* globals NaClTerm, NaClProcessManager */
-
-'use strict';
-
-NaClTerm.nmf = 'Xsdl.nmf';
-NaClTerm.argv = [
- '-screen', '1140x810x32', '-ac', '-br', '-noreset', ':42'
-];
-NaClTerm.env = [
- 'NACL_SPAWN_MODE=embed',
- 'NACL_EMBED_WIDTH=100%',
- 'NACL_EMBED_HEIGHT=100%',
-];
-document.title = 'Loading ... (this may take a while)';
-
-var mgr = new NaClProcessManager();
-mgr.onTerminalResize(80, 24);
-var env = [
- 'DISPLAY=:42',
-];
-
-// TODO(bradnelson): Do something more robust than racing gtk + xserver.
-function startDemo() {
- // Assume a default terminal size for headless processes.
- mgr.spawn(
- 'gimp.nmf', [ '-f','--no-shm', '--display=:42','--no-cpu-accel',
- '--new-instance',], env, '/', 'nacl', null, function(pid) {
- mgr.waitpid(pid, 0, function() {
- window.close();
- });
- });
- window.setTimeout(function() { document.title = 'Gimp'; }, 25000);
-}
-
-function startWindowManager() {
- mgr.spawn(
- 'twm.nmf', [""], env,
- '/', 'nacl', null, function(pid) {
- mgr.waitpid(pid, 0, function() {
- window.close();
- });
- });
-}
-
-startDemo();
-window.setTimeout(startWindowManager, 5000);
diff --git a/ports/gimp-app/background.js b/ports/gimp-app/background.js
deleted file mode 100644
index c2047ec..0000000
--- a/ports/gimp-app/background.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-var width = 1140;
-var height = 810;
-
-function onLaunched(launchData) {
- chrome.app.window.create('Xsdl.html', {
- width: width,
- height: height,
- minWidth: width,
- minHeight: height,
- maxWidth: width,
- maxHeight: height,
- id: 'Xsdl',
- });
-}
-
-chrome.app.runtime.onLaunched.addListener(onLaunched);
diff --git a/ports/gimp-app/build.sh b/ports/gimp-app/build.sh
deleted file mode 100644
index 396f10d..0000000
--- a/ports/gimp-app/build.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2015 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.
-
-BuildStep() {
- # Meta package, no build.
- return
-}
-
-InstallStep() {
- local ASSEMBLY_DIR=${PUBLISH_DIR}/app
- MakeDir ${ASSEMBLY_DIR}
-
- local GIMP_DIR=${NACL_PACKAGES_PUBLISH}/gimp/${TOOLCHAIN}/${NACL_ARCH}
- local XORG_DIR=${NACL_PACKAGES_PUBLISH}/xorg-server/${TOOLCHAIN}/xorg-server
- local TWM_DIR=${NACL_PACKAGES_PUBLISH}/twm/${TOOLCHAIN}
-
- LogExecute cp ${GIMP_DIR}/*.nmf ${ASSEMBLY_DIR}/
- LogExecute cp ${GIMP_DIR}/*.nexe ${ASSEMBLY_DIR}/
- LogExecute cp -r ${GIMP_DIR}/lib* ${ASSEMBLY_DIR}/
-
- MakeDir ${PUBLISH_DIR}/root
- ChangeDir ${PUBLISH_DIR}/root
- LogExecute cp ${GIMP_DIR}/*.tar .
- LogExecute tar -xvf *.tar
- LogExecute rm -f *.tar
- # make gimp fit the x screen in single-window-mode on startup
- LogExecute cp -f ${START_DIR}/sessionrc\
- ./webports-dummydir/etc/gimp/2.0/sessionrc
- ChangeDir ${PUBLISH_DIR}/root
- LogExecute tar -cvf ${ASSEMBLY_DIR}/gimp.tar *
- LogExecute rm -Rf ${PUBLISH_DIR}/root
- ChangeDir ${ASSEMBLY_DIR}/
-
- LogExecute cp ${TWM_DIR}/*.nmf ${ASSEMBLY_DIR}/
- LogExecute cp ${TWM_DIR}/*.nexe ${ASSEMBLY_DIR}/
- LogExecute cp -r ${TWM_DIR}/lib* ${ASSEMBLY_DIR}/
-
- LogExecute cp -r ${XORG_DIR}/_platform_specific ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.nmf ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.nexe ${ASSEMBLY_DIR}/
- LogExecute cp -r ${XORG_DIR}/lib* ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.tar ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.js ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.html ${ASSEMBLY_DIR}/
-
- LogExecute cp ${START_DIR}/*.js ${ASSEMBLY_DIR}/
- LogExecute cp ${START_DIR}/*.png ${ASSEMBLY_DIR}/
-
- LogExecute python ${TOOLS_DIR}/create_term.py -n gimp gimp.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py -n twm twm.nmf
- GenerateManifest ${START_DIR}/manifest.json ${ASSEMBLY_DIR} \
- "TITLE"="Gimp"
-}
diff --git a/ports/gimp-app/gimp-logo_128.png b/ports/gimp-app/gimp-logo_128.png
deleted file mode 100644
index 6104120..0000000
--- a/ports/gimp-app/gimp-logo_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/gimp-app/gimp-logo_48.png b/ports/gimp-app/gimp-logo_48.png
deleted file mode 100644
index c566756..0000000
--- a/ports/gimp-app/gimp-logo_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/gimp-app/gimp-logo_64.png b/ports/gimp-app/gimp-logo_64.png
deleted file mode 100644
index bb43c27..0000000
--- a/ports/gimp-app/gimp-logo_64.png
+++ /dev/null
Binary files differ
diff --git a/ports/gimp-app/manifest.json b/ports/gimp-app/manifest.json
deleted file mode 100644
index 03aecf1..0000000
--- a/ports/gimp-app/manifest.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "Gimp",
- "description": "Gimp (Gnu Image Manipulation Program) in an app running using NativeClient",
- "version": "2.8.14",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "48": "gimp-logo_48.png",
- "64": "gimp-logo_64.png",
- "128": "gimp-logo_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "file_handlers": {
- "edit": {
- "types": [
- "text/*"
- ],
- "extensions": [
- "json",
- "txt",
- "js",
- "html",
- "h",
- "c",
- "cc",
- "cpp",
- "java"
- ]
- }
- },
- "permissions": [
- "fileSystem",
- "storage",
- "unlimitedStorage",
- {
- "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/gimp-app/pkg_info b/ports/gimp-app/pkg_info
deleted file mode 100644
index 6689277..0000000
--- a/ports/gimp-app/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=gimp-app
-VERSION=0.1
-DEPENDS=(xorg-server gimp twm)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gimp-app/sessionrc b/ports/gimp-app/sessionrc
deleted file mode 100644
index cb255e4..0000000
--- a/ports/gimp-app/sessionrc
+++ /dev/null
@@ -1,76 +0,0 @@
-# GIMP sessionrc
-#
-# This file takes session-specific info (that is info, you want to keep
-# between two GIMP sessions). You are not supposed to edit it manually, but
-# of course you can do. The sessionrc will be entirely rewritten every time
-# you quit GIMP.
-
-# NACL README:
-# Here are some starter settings to make it look good in single-window-mode
-
-(session-info "toplevel"
- (factory-entry "gimp-empty-image-window")
- (position 0 0)
- (size 620 200)
- (open-on-exit))
-(session-info "toplevel"
- (factory-entry "gimp-single-image-window")
- (position 0 0)
- (size 1140 780)
- (open-on-exit)
- (aux-info
- (left-docks-width "118")
- (right-docks-width "206")
- (maximized "no"))
- (gimp-toolbox
- (side left)
- (book
- (current-page 0)
- (dockable "gimp-tool-options"
- (tab-style automatic)
- (aux-info
- (show-button-bar "true")))))
- (gimp-dock
- (side right)
- (book
- (current-page 0)
- (dockable "gimp-layer-list"
- (tab-style automatic)
- (preview-size 32)
- (aux-info
- (show-button-bar "true")))
- (dockable "gimp-channel-list"
- (tab-style automatic)
- (preview-size 32)
- (aux-info
- (show-button-bar "true")))
- (dockable "gimp-vectors-list"
- (tab-style automatic)
- (preview-size 32)
- (aux-info
- (show-button-bar "true")))
- (dockable "gimp-undo-history"
- (tab-style automatic)
- (aux-info
- (show-button-bar "true"))))
- (book
- (position 786)
- (current-page 0)
- (dockable "gimp-brush-grid"
- (tab-style automatic)
- (aux-info
- (show-button-bar "true")))
- (dockable "gimp-pattern-grid"
- (tab-style automatic)
- (aux-info
- (show-button-bar "true")))
- (dockable "gimp-gradient-list"
- (tab-style automatic)
- (aux-info
- (show-button-bar "true"))))))
-
-(hide-docks no)
-(single-window-mode yes)
-(last-tip-shown 0)
-
-# end of sessionrc
diff --git a/ports/gimp/build.sh b/ports/gimp/build.sh
deleted file mode 100644
index df3eaec..0000000
--- a/ports/gimp/build.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (c) 2015 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.
-
-ConfigureStep() {
- EXTRA_CONFIGURE_ARGS+=" --disable-python --without-dbus --without-webkit"
- EXTRA_CONFIGURE_ARGS+=" --with-gnu-ld"
- EnableCliMain
- DefaultConfigureStep
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- local APP_DIR="${PUBLISH_DIR}/${NACL_ARCH}"
- local TAR_ROOT="${APP_DIR}/root"
- MakeDir ${TAR_ROOT}
- MakeDir ${APP_DIR}
- ChangeDir ${APP_DIR}
- local exe="${APP_DIR}/gimp${NACL_EXEEXT}"
- LogExecute cp ${INSTALL_DIR}/webports-dummydir/bin/gimp-2.8${NACL_EXEEXT} \
- ${exe}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${exe} -s . -L ${INSTALL_DIR}/webports-dummydir/lib \
- -o gimp.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py -n gimp gimp.nmf
- InstallNaClTerm ${APP_DIR}
- LogExecute cp -f ${START_DIR}/*.js ${APP_DIR}
-
- # take the gtk+ fonts and add some additional rc files that gimp requires
- LogExecute cp -f \
- ${NACL_PACKAGES_PUBLISH}/gtk+/${TOOLCHAIN}/${NACL_ARCH}/gtk-demo.tar\
- ${TAR_ROOT}/gtk-demo.tar
- ChangeDir ${TAR_ROOT}
- LogExecute tar -xvf gtk-demo.tar
- LogExecute rm -f gtk-demo.tar
- LogExecute cp -rf ${INSTALL_DIR}/webports-dummydir/etc/*\
- ./webports-dummydir/etc
- LogExecute cp -rf ${INSTALL_DIR}/webports-dummydir/share/*\
- ./webports-dummydir/share
- LogExecute rm -Rf ./webports-dummydir/share/man
-
- LogExecute tar -cvf gimp.tar *
- LogExecute cp gimp.tar ${APP_DIR}/gimp.tar
- shasum ${APP_DIR}/gimp.tar > ${APP_DIR}/gimp.tar.hash
- LogExecute rm -rf ${TAR_ROOT}
-}
diff --git a/ports/gimp/gimp.js b/ports/gimp/gimp.js
deleted file mode 100644
index 5b25138..0000000
--- a/ports/gimp/gimp.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-NaClTerm.nmf = 'gimp.nmf';
-NaClTerm.env = [
- 'NACL_SPAWN_MODE=embed',
- 'NACL_EMBED_WIDTH=100%',
- 'NACL_EMBED_HEIGHT=100%',
- 'DISPLAY=:42',
-];
-NaClTerm.argv = [
- '-f',
- '--no-shm',
- '--display=:42',
- '--no-cpu-accel',
- '--new-instance',
-];
-document.title = 'Gimp';
diff --git a/ports/gimp/nacl.patch b/ports/gimp/nacl.patch
deleted file mode 100644
index 5ffbcd0..0000000
--- a/ports/gimp/nacl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/app/main.c b/app/main.c
---- a/app/main.c
-+++ b/app/main.c
-@@ -288,6 +288,8 @@ main (int argc,
- gchar *basename;
- gint i;
-
-+ if (nacl_startup_untar(argv[0], "gimp.tar", "/"))
-+ return -1;
- #if defined (__GNUC__) && defined (_WIN64)
- /* mingw-w64, at least the unstable build from late July 2008,
- * starts subsystem:windows programs in main(), but passes them
-diff --git a/app/signals.c b/app/signals.c
---- a/app/signals.c
-+++ b/app/signals.c
-@@ -37,7 +37,7 @@ static void gimp_sigfatal_handler (gint sig_num) G_GNUC_NORETURN;
- void
- gimp_init_signal_handlers (GimpStackTraceMode stack_trace_mode)
- {
--#ifndef G_OS_WIN32
-+#if !defined(G_OS_WIN32) && !defined(__native_client__)
- /* No use catching these on Win32, the user won't get any stack
- * trace from glib anyhow. It's better to let Windows inform about
- * the program error, and offer debugging (if the user has installed
diff --git a/ports/gimp/pkg_info b/ports/gimp/pkg_info
deleted file mode 100644
index e16bd30..0000000
--- a/ports/gimp/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gimp
-VERSION=2.8.14
-URL=http://download.gimp.org/pub/gimp/v2.8/gimp-2.8.14.tar.bz2
-LICENSE=GPL
-DEPENDS=(gtk+ gegl)
-SHA1=380a8e2887e1a161056444921807e338c3d31653
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/git/NOTES b/ports/git/NOTES
deleted file mode 100644
index ab65be5..0000000
--- a/ports/git/NOTES
+++ /dev/null
@@ -1,151 +0,0 @@
-BINARIES TO INCLUDE
--------------------
-
-Git consists of many binaries most of which are the same, hardlinked.
-There are a few clusters, documented here.
-To reduce packing size, including only one from each cluster.
-For now, we will only use a limited subset, listed in git_binaries.txt.
-
-git-remote-http
-git-remote-https
-git-remote-ftp
-git-remote-ftps
-
-git
-git-add
-git-annotate
-git-apply
-git-archive
-git-bisect--helper
-git-blame
-git-branch
-git-bundle
-git-cat-file
-git-check-attr
-git-check-ignore
-git-checkout
-git-checkout-index
-git-check-ref-format
-git-cherry
-git-cherry-pick
-git-clean
-git-clone
-git-column
-git-commit
-git-commit-tree
-git-config
-git-count-objects
-git-credential
-git-credential-cache
-git-credential-cache--daemon
-git-credential-store
-git-describe
-git-diff
-git-diff-files
-git-diff-index
-git-diff-tree
-git-fast-export
-git-fast-import
-git-fetch
-git-fetch-pack
-git-fmt-merge-msg
-git-for-each-ref
-git-format-patch
-git-fsck
-git-fsck-objects
-git-gc
-git-get-tar-commit-id
-git-grep
-git-hash-object
-git-help
-git-http-backend
-git-http-fetch
-git-imap-send
-git-index-pack
-git-init
-git-init-db
-git-log
-git-ls-files
-git-ls-remote
-git-ls-tree
-git-mailinfo
-git-mailsplit
-git-merge
-git-merge-base
-git-merge-file
-git-merge-index
-git-merge-ours
-git-merge-recursive
-git-merge-subtree
-git-merge-tree
-git-mktag
-git-mktree
-git-mv
-git-name-rev
-git-notes
-git-pack-objects
-git-pack-redundant
-git-pack-refs
-git-patch-id
-git-peek-remote
-git-prune
-git-prune-packed
-git-push
-git-read-tree
-git-receive-pack
-git-reflog
-git-remote
-git-remote-ext
-git-remote-fd
-git-replace
-git-repo-config
-git-rerere
-git-reset
-git-revert
-git-rev-list
-git-rev-parse
-git-rm
-git-send-pack
-git-shortlog
-git-show
-git-show-branch
-git-show-ref
-git-stage
-git-status
-git-stripspace
-git-symbolic-ref
-git-tag
-git-tar-tree
-git-unpack-file
-git-unpack-objects
-git-update-index
-git-update-ref
-git-update-server-info
-git-upload-archive
-git-var
-git-verify-pack
-git-verify-tag
-git-whatchanged
-git-write-tree
-
-git-shell
-
-git-sh-i18n--envsubst
-
-git-show-index
-
-git-upload-pack
-
-git-credential-cache--daemon
-
-git-credential-cache
-
-git-credential-store
-
-git-daemon
-
-git-fast-import
-
-git-http-fetch
-
-git-imap-send
diff --git a/ports/git/build.sh b/ports/git/build.sh
deleted file mode 100644
index c86682e..0000000
--- a/ports/git/build.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXECUTABLES="git git-remote-http git-remote-https"
-
-BUILD_DIR=${SRC_DIR}
-
-if [ "${NACL_SHARED}" != "1" ]; then
- # These are needed so that the configure can detect libcurl when statically
- # linked.
- NACLPORTS_LIBS+=" -lcurl -lssl -lcrypto -lz"
-fi
-
-if [ ${OS_NAME} = "Darwin" ]; then
- # gettext (msgfmt) doesn't exist on darwin by default. homebrew installs
- # it to /usr/local/opt/gettext, and we need it to be in the PATH when
- # building git
- export PATH=${PATH}:/usr/local/opt/gettext/bin
-fi
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- export NO_RT_LIBRARY=1
-fi
-export CROSS_COMPILE=1
-export NEEDS_CRYPTO_WITH_SSL=YesPlease
-
-EnableCliMain
-EnableGlibcCompat
-
-ConfigureStep() {
- NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
- autoconf
-
- if [ "${NACL_LIBC}" = "glibc" ]; then
- # Because libcrypto.a needs dlsym we need to add this explicitly.
- # This is not normally needed when libcyrpto is a shared library.
- NACLPORTS_LIBS+=" -ldl"
- fi
-
- DefaultConfigureStep
-}
-
-BuildStep() {
- SetupCrossEnvironment
- export CCLD=${CXX}
- export EXTLIBS=${LIBS}
- # Git's build doesn't support building outside the source tree.
- # Do a clean to make rebuild after failure predictable.
- LogExecute make clean
- DefaultBuildStep
-}
-
-InstallStep() {
- SetupCrossEnvironment
- export CCLD=${CXX}
- export EXTLIBS=${LIBS}
- DefaultInstallStep
- # Remove some of the git symlinks to save some space (since symlinks are
- # currnely only supported via file copying).
- for f in ${DESTDIR}${PREFIX}/libexec/git-core/*; do
- if [ -L $f ]; then
- Remove $f
- fi
- done
-}
diff --git a/ports/git/nacl.patch b/ports/git/nacl.patch
deleted file mode 100644
index c83fa9b..0000000
--- a/ports/git/nacl.patch
+++ /dev/null
@@ -1,637 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -898,14 +898,22 @@ BUILTIN_OBJS += builtin/verify-tag.o
- BUILTIN_OBJS += builtin/write-tree.o
-
- GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
--EXTLIBS =
-+EXTLIBS ?=
-
- GIT_USER_AGENT = git/$(GIT_VERSION)
-
-+ifdef CROSS_COMPILE
-+HAVE_DEV_TTY = YesPlease
-+NEEDS_SSL_WITH_CRYPTO = YesPlease
-+NEEDS_SSL_WITH_CURL = YesPlease
-+else
- include config.mak.uname
-+endif
- -include config.mak.autogen
- -include config.mak
-
-+CCLD = $(CC)
-+
- ifndef sysconfdir
- ifeq ($(prefix),/usr)
- sysconfdir = /etc
-@@ -1407,8 +1415,10 @@ endif
-
- ifdef HAVE_CLOCK_GETTIME
- BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
-+ifndef NO_RT_LIBRARY
- EXTLIBS += -lrt
- endif
-+endif
-
- ifdef HAVE_CLOCK_MONOTONIC
- BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC
-@@ -1642,7 +1652,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \
- '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
-
- git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) git.o \
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) git.o \
- $(BUILTIN_OBJS) $(LIBS)
-
- help.sp help.s help.o: common-cmds.h
-@@ -1660,7 +1670,6 @@ version.sp version.s version.o: EXTRA_CPPFLAGS = \
-
- $(BUILT_INS): git$X
- $(QUIET_BUILT_IN)$(RM) $@ && \
-- ln $< $@ 2>/dev/null || \
- ln -s $< $@ 2>/dev/null || \
- cp $< $@
-
-@@ -1931,32 +1940,31 @@ compat/nedmalloc/nedmalloc.sp: SPARSE_FLAGS += -Wno-non-pointer-null
- endif
-
- git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
-
- git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-- $(LIBS) $(IMAP_SEND_LDFLAGS)
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-+ $(IMAP_SEND_LDFLAGS) $(LIBS)
-
- git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-- $(LIBS) $(CURL_LIBCURL)
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-+ $(CURL_LIBCURL) $(LIBS)
- git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-- $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-+ $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
-
- git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \
- $(VCSSVN_LIB)
-
- $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
- $(QUIET_LNCP)$(RM) $@ && \
-- ln $< $@ 2>/dev/null || \
- ln -s $< $@ 2>/dev/null || \
- cp $< $@
-
- $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-- $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-+ $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(EXTLIBS)
-
- $(LIB_FILE): $(LIB_OBJS)
- $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^
-@@ -2169,7 +2177,7 @@ test-svn-fe$X: vcs-svn/lib.a
- .PRECIOUS: $(TEST_OBJS)
-
- test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
-+ $(QUIET_LINK)$(CCLD) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
-
- check-sha1:: test-sha1$X
- ./test-sha1.sh
-@@ -2264,14 +2272,12 @@ endif
- for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
- $(RM) "$$bindir/$$p" && \
- test -z "$(NO_INSTALL_HARDLINKS)" && \
-- ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
- ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
- cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
- done && \
- for p in $(BUILT_INS); do \
- $(RM) "$$execdir/$$p" && \
- test -z "$(NO_INSTALL_HARDLINKS)" && \
-- ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
- ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
- cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
- done && \
-@@ -2279,7 +2285,6 @@ endif
- for p in $$remote_curl_aliases; do \
- $(RM) "$$execdir/$$p" && \
- test -z "$(NO_INSTALL_HARDLINKS)" && \
-- ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
- ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
- cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
- done && \
-diff --git a/builtin/log.c b/builtin/log.c
---- a/builtin/log.c
-+++ b/builtin/log.c
-@@ -229,7 +229,9 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)
- printf(_("Final output: %d %s\n"), nr, stage);
- }
-
-+#if !defined(__native_client__) || defined(__GLIBC__)
- static struct itimerval early_output_timer;
-+#endif
-
- static void log_show_early(struct rev_info *revs, struct commit_list *list)
- {
-@@ -271,9 +273,12 @@ static void log_show_early(struct rev_info *revs, struct commit_list *list)
- * trigger every second even if we're blocked on a
- * reader!
- */
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ /* TODO(bradnelson): Turn this back on once nacl_io supports it. */
- early_output_timer.it_value.tv_sec = 0;
- early_output_timer.it_value.tv_usec = 500000;
- setitimer(ITIMER_REAL, &early_output_timer, NULL);
-+#endif
- }
-
- static void early_output(int signal)
-@@ -292,11 +297,14 @@ static void setup_early_output(struct rev_info *rev)
- * system dependencies and headers), and using
- * SA_RESTART.
- */
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ /* TODO(bradnelson): Turn this back on once nacl_io supports it. */
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = early_output;
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = SA_RESTART;
- sigaction(SIGALRM, &sa, NULL);
-+#endif
-
- /*
- * If we can get the whole output in less than a
-@@ -305,9 +313,12 @@ static void setup_early_output(struct rev_info *rev)
- *
- * This is a one-time-only trigger.
- */
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ /* TODO(bradnelson): Turn this back on once nacl_io supports it. */
- early_output_timer.it_value.tv_sec = 0;
- early_output_timer.it_value.tv_usec = 100000;
- setitimer(ITIMER_REAL, &early_output_timer, NULL);
-+#endif
- }
-
- static void finish_early_output(struct rev_info *rev)
-diff --git a/compat/nacl.c b/compat/nacl.c
-new file mode 100644
---- /dev/null
-+++ b/compat/nacl.c
-@@ -0,0 +1,73 @@
-+static char **copy_environ(void)
-+{
-+ char **env;
-+ int i = 0;
-+ while (environ[i])
-+ i++;
-+ env = xmalloc((i+1)*sizeof(*env));
-+ for (i = 0; environ[i]; i++)
-+ env[i] = xstrdup(environ[i]);
-+ env[i] = NULL;
-+ return env;
-+}
-+
-+void free_environ(char **env)
-+{
-+ int i;
-+ for (i = 0; env[i]; i++)
-+ free(env[i]);
-+ free(env);
-+}
-+
-+static int lookup_env(char **env, const char *name, size_t nmln)
-+{
-+ int i;
-+
-+ for (i = 0; env[i]; i++) {
-+ if (0 == strncmp(env[i], name, nmln)
-+ && '=' == env[i][nmln])
-+ /* matches */
-+ return i;
-+ }
-+ return -1;
-+}
-+
-+/*
-+ * If name contains '=', then sets the variable, otherwise it unsets it
-+ */
-+static char **env_setenv(char **env, const char *name)
-+{
-+ char *eq = strchrnul(name, '=');
-+ int i = lookup_env(env, name, eq-name);
-+
-+ if (i < 0) {
-+ if (*eq) {
-+ for (i = 0; env[i]; i++)
-+ ;
-+ env = xrealloc(env, (i+2)*sizeof(*env));
-+ env[i] = xstrdup(name);
-+ env[i+1] = NULL;
-+ }
-+ }
-+ else {
-+ free(env[i]);
-+ if (*eq)
-+ env[i] = xstrdup(name);
-+ else
-+ for (; env[i]; i++)
-+ env[i] = env[i+1];
-+ }
-+ return env;
-+}
-+
-+/*
-+ * Copies global environ and adjusts variables as specified by vars.
-+ */
-+char **make_augmented_environ(const char *const *vars)
-+{
-+ char **env = copy_environ();
-+
-+ while (*vars)
-+ env = env_setenv(env, *vars++);
-+ return env;
-+}
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -616,11 +616,13 @@ GIT_CONF_SUBST([NO_DEFLATE_BOUND])
- #
- # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
- # Patrick Mauritz).
--AC_CHECK_LIB([c], [socket],
--[NEEDS_SOCKET=],
--[NEEDS_SOCKET=YesPlease])
--GIT_CONF_SUBST([NEEDS_SOCKET])
--test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
-+# TODO(bradnelson): Do this just for NaCl newlib.
-+#AC_CHECK_LIB([c], [socket],
-+#[NEEDS_SOCKET=],
-+#[NEEDS_SOCKET=YesPlease])
-+#GIT_CONF_SUBST([NEEDS_SOCKET])
-+#test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
-+NEEDS_SOCKET=
-
- #
- # The next few tests will define NEEDS_RESOLV if linking with
-@@ -673,7 +675,8 @@ AC_CHECK_LIB([c], [basename],
- [NEEDS_LIBGEN=],
- [NEEDS_LIBGEN=YesPlease])
- GIT_CONF_SUBST([NEEDS_LIBGEN])
--test -n "$NEEDS_LIBGEN" && LIBS="$LIBS -lgen"
-+# TODO(bradnelson): Do this just for NaCl newlib.
-+#test -n "$NEEDS_LIBGEN" && LIBS="$LIBS -lgen"
-
- AC_CHECK_LIB([c], [gettext],
- [LIBC_CONTAINS_LIBINTL=YesPlease],
-@@ -844,7 +847,8 @@ AC_RUN_IFELSE(
- FILE *f = fopen(".", "r");
- return f && fread(&c, 1, 1, f)]])],
- [ac_cv_fread_reads_directories=no],
-- [ac_cv_fread_reads_directories=yes])
-+ [ac_cv_fread_reads_directories=yes],
-+ [ac_cv_fread_reads_directories=no])
- ])
- if test $ac_cv_fread_reads_directories = yes; then
- FREAD_READS_DIRECTORIES=UnfortunatelyYes
-@@ -878,7 +882,8 @@ AC_RUN_IFELSE(
- if (snprintf(buf, 3, "%s", "12345") != 5
- || strcmp(buf, "12")) return 1]])],
- [ac_cv_snprintf_returns_bogus=no],
-- [ac_cv_snprintf_returns_bogus=yes])
-+ [ac_cv_snprintf_returns_bogus=yes],
-+ [ac_cv_snprintf_returns_bogus=no])
- ])
- if test $ac_cv_snprintf_returns_bogus = yes; then
- SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes
-diff --git a/daemon.c b/daemon.c
---- a/daemon.c
-+++ b/daemon.c
-@@ -66,7 +66,9 @@ static void logreport(int priority, const char *err, va_list params)
- if (log_syslog) {
- char buf[1024];
- vsnprintf(buf, sizeof(buf), err, params);
-+#if !defined(__native_client__) || defined(__GLIBC__)
- syslog(priority, "%s", buf);
-+#endif
- } else {
- /*
- * Since stderr is set to buffered mode, the
-@@ -1247,7 +1253,9 @@ int main(int argc, char **argv)
- }
-
- if (log_syslog) {
-+#if !defined(__native_client__) || defined(__GLIBC__)
- openlog("git-daemon", LOG_PID, LOG_DAEMON);
-+#endif
- set_die_routine(daemon_die);
- } else
- /* avoid splitting a message in the middle */
-diff --git a/fast-import.c b/fast-import.c
---- a/fast-import.c
-+++ b/fast-import.c
-@@ -527,6 +527,8 @@ static void checkpoint_signal(int signo)
-
- static void set_checkpoint_signal(void)
- {
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ /* TODO(bradnelson): Reenable when nacl_io can do this. */
- struct sigaction sa;
-
- memset(&sa, 0, sizeof(sa));
-@@ -534,6 +536,7 @@ static void set_checkpoint_signal(void)
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = SA_RESTART;
- sigaction(SIGUSR1, &sa, NULL);
-+#endif
- }
-
- #endif
-diff --git a/fetch-pack.c b/fetch-pack.c
---- a/fetch-pack.c
-+++ b/fetch-pack.c
-@@ -649,11 +649,23 @@ static int everything_local(struct fetch_pack_args *args,
- return retval;
- }
-
-+/*
-+ * TODO(bradnelson): Remove when corruption figured out.
-+ * Adding synchronization to backgroun demuxer.
-+ */
-+#include <semaphore.h>
-+static sem_t holdup;
-+
- static int sideband_demux(int in, int out, void *data)
- {
- int *xd = data;
-
- int ret = recv_sideband("fetch-pack", xd[0], out);
-+ /*
-+ * TODO(bradnelson): Remove when corruption figured out.
-+ * Adding synchronization to backgroun demuxer.
-+ */
-+ sem_post(&holdup);
- close(out);
- return ret;
- }
-@@ -670,6 +682,11 @@ static int get_pack(struct fetch_pack_args *args,
- struct child_process cmd = CHILD_PROCESS_INIT;
- int ret;
-
-+ /*
-+ * TODO(bradnelson): Remove when corruption figured out.
-+ * Adding synchronization to backgroun demuxer.
-+ */
-+ sem_init(&holdup, 0, 0);
- memset(&demux, 0, sizeof(demux));
- if (use_sideband) {
- /* xd[] is talking with upload-pack; subprocess reads from
-@@ -682,6 +699,11 @@ static int get_pack(struct fetch_pack_args *args,
- if (start_async(&demux))
- die("fetch-pack: unable to fork off sideband"
- " demultiplexer");
-+ /*
-+ * TODO(bradnelson): Remove when corruption figured out.
-+ * Adding synchronization to backgroun demuxer.
-+ */
-+ sem_wait(&holdup);
- }
- else
- demux.out = xd[0];
-diff --git a/git-compat-util.h b/git-compat-util.h
---- a/git-compat-util.h
-+++ b/git-compat-util.h
-@@ -796,8 +796,8 @@ void git_qsort(void *base, size_t nmemb, size_t size,
- #define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctimespec.tv_nsec))
- #define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtimespec.tv_nsec))
- #else
--#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctim.tv_nsec))
--#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))
-+#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctime))
-+#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtime))
- #endif
- #endif
-
-@@ -870,4 +870,12 @@ struct tm *git_gmtime_r(const time_t *, struct tm *);
- #define gmtime_r git_gmtime_r
- #endif
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+#define gethostname(dst, len) strcpy(dst, "localhost")
-+#define getservbyname(dst, len) 0
-+#define setsid(n) 0
-+#define alarm(n) 0
-+#define getgrnam(n) 0
-+#endif
-+
- #endif
-diff --git a/progress.c b/progress.c
---- a/progress.c
-+++ b/progress.c
-@@ -47,6 +47,8 @@ static void progress_interval(int signum)
-
- static void set_progress_signal(void)
- {
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ /* TODO(bradnelson): Renable when nacl_io can do this. */
- struct sigaction sa;
- struct itimerval v;
-
-@@ -62,14 +64,18 @@ static void set_progress_signal(void)
- v.it_interval.tv_usec = 0;
- v.it_value = v.it_interval;
- setitimer(ITIMER_REAL, &v, NULL);
-+#endif
- }
-
- static void clear_progress_signal(void)
- {
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+ /* TODO(bradnelson): Renable when nacl_io can do this. */
- struct itimerval v = {{0,},};
- setitimer(ITIMER_REAL, &v, NULL);
- signal(SIGALRM, SIG_IGN);
- progress_update = 0;
-+#endif
- }
-
- static int display(struct progress *progress, unsigned n, const char *done)
-diff --git a/run-command.c b/run-command.c
---- a/run-command.c
-+++ b/run-command.c
-@@ -4,6 +4,11 @@
- #include "sigchain.h"
- #include "argv-array.h"
-
-+#if defined(__native_client__)
-+# include <spawn.h>
-+# include "compat/nacl.c"
-+#endif
-+
- #ifndef SHELL_PATH
- # define SHELL_PATH "/bin/sh"
- #endif
-@@ -91,6 +96,36 @@ static inline void dup_devnull(int to)
- }
- #endif
-
-+#ifdef GIT_WINDOWS_NATIVE
-+static int open_devnull(int write)
-+{
-+ if (write) {
-+ return open("/dev/null", O_WRONLY);
-+ } else {
-+ return open("/dev/null", O_RDONLY);
-+ }
-+}
-+#endif
-+
-+#if defined(__native_client__)
-+static int open_devnull(int write)
-+{
-+ int p[2];
-+ if (pipe(p) < 0) {
-+ die_errno(_("create null pipe"));
-+ }
-+ if (write) {
-+ // NOTE: Don't close read side of write pipe,
-+ // as it will error out with EPIPE.
-+ // This leaks data into the pipe for the life of the process.
-+ return p[1];
-+ } else {
-+ close(p[1]);
-+ return p[0];
-+ }
-+}
-+#endif
-+
- static char *locate_in_PATH(const char *file)
- {
- const char *p = getenv("PATH");
-@@ -241,7 +276,6 @@ static int wait_or_whine(pid_t pid, const char *argv0)
- int status, code = -1;
- pid_t waiting;
- int failed_errno = 0;
--
- while ((waiting = waitpid(pid, &status, 0)) < 0 && errno == EINTR)
- ; /* nothing */
-
-@@ -351,7 +385,7 @@ fail_pipe:
- trace_argv_printf(cmd->argv, "trace: run_command:");
- fflush(NULL);
-
--#ifndef GIT_WINDOWS_NATIVE
-+#if !defined(GIT_WINDOWS_NATIVE) && !defined(__native_client__)
- {
- int notify_pipe[2];
- if (pipe(notify_pipe))
-@@ -466,21 +500,21 @@ fail_pipe:
- const char **sargv = cmd->argv;
-
- if (cmd->no_stdin)
-- fhin = open("/dev/null", O_RDWR);
-+ fhin = open_devnull(0);
- else if (need_in)
- fhin = dup(fdin[0]);
- else if (cmd->in)
- fhin = dup(cmd->in);
-
- if (cmd->no_stderr)
-- fherr = open("/dev/null", O_RDWR);
-+ fherr = open_devnull(1);
- else if (need_err)
- fherr = dup(fderr[1]);
- else if (cmd->err > 2)
- fherr = dup(cmd->err);
-
- if (cmd->no_stdout)
-- fhout = open("/dev/null", O_RDWR);
-+ fhout = open_devnull(1);
- else if (cmd->stdout_to_stderr)
- fhout = dup(fherr);
- else if (need_out)
-@@ -493,8 +527,39 @@ fail_pipe:
- else if (cmd->use_shell)
- cmd->argv = prepare_shell_cmd(cmd->argv);
-
-+#if defined(__native_client__)
-+ char **alt_env = make_augmented_environ(cmd->env);
-+ cmd->pid = vfork();
-+ if (cmd->pid == 0) {
-+ if (fhin != 0) {
-+ if (dup2(fhin, 0) < 0) {
-+ error("cannot dup2 fhin");
-+ }
-+ close(fhin);
-+ }
-+ if (fhout != 1) {
-+ if (dup2(fhout, 1) < 0) {
-+ error("cannot dup2 fhout");
-+ }
-+ close(fhout);
-+ }
-+ if (fherr != 2) {
-+ if (dup2(fherr, 2) < 0) {
-+ error("cannot dup2 fherr");
-+ }
-+ close(fherr);
-+ }
-+ int i;
-+ for (i = 3; i < 100; ++i) close(i);
-+ if (execve(cmd->argv[0], cmd->argv, alt_env) < 0) {
-+ error("execv failed");
-+ }
-+ }
-+ free_environ(alt_env);
-+#else
- cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, (char**) cmd->env,
- cmd->dir, fhin, fhout, fherr);
-+#endif
- failed_errno = errno;
- if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
- error("cannot spawn %s: %s", cmd->argv[0], strerror(errno));
-@@ -697,6 +762,7 @@ int start_async(struct async *async)
-
- if (need_in)
- proc_in = fdin[0];
-+ // TODO(bradnelson): Figure out of this is might be a bug?
- else if (async->in)
- proc_in = async->in;
- else
-@@ -704,6 +770,7 @@ int start_async(struct async *async)
-
- if (need_out)
- proc_out = fdout[1];
-+ // TODO(bradnelson): Figure out of this is might be a bug?
- else if (async->out)
- proc_out = async->out;
- else
-@@ -751,7 +818,6 @@ int start_async(struct async *async)
- set_die_routine(die_async);
- set_die_is_recursing_routine(async_die_is_recursing);
- }
--
- if (proc_in >= 0)
- set_cloexec(proc_in);
- if (proc_out >= 0)
-diff --git a/sha1_file.c b/sha1_file.c
---- a/sha1_file.c
-+++ b/sha1_file.c
-@@ -872,6 +872,9 @@ void free_pack_by_name(const char *pack_name)
-
- static unsigned int get_max_fd_limit(void)
- {
-+#if defined(__native_client__)
-+ return 100;
-+#endif
- #ifdef RLIMIT_NOFILE
- {
- struct rlimit lim;
diff --git a/ports/git/pkg_info b/ports/git/pkg_info
deleted file mode 100644
index 029590d..0000000
--- a/ports/git/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=git
-VERSION=2.3.0
-URL=https://github.com/git/git/archive/v2.3.0/git-2.3.0.tar.gz
-LICENSE=GPL
-DEPENDS=(zlib nacl-spawn glibc-compat openssl curl)
-SHA1=ae668cef3b9a4955f496ce41fefb058b5368d52f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/glib/build.sh b/ports/glib/build.sh
deleted file mode 100644
index e1a99b6..0000000
--- a/ports/glib/build.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="
- gio/gapplication${NACL_EXEEXT}
- glib/gtester${NACL_EXEEXT}
- gobject/gobject-query${NACL_EXEEXT}
-"
-
-EnableGlibcCompat
-
-ConfigureStep() {
- NACL_BIT_ARCH_ID=64
- if [ "${NACL_ARCH}" = "i686" ]; then
- NACL_BIT_ARCH_ID=32
- fi
-
- if [ "${NACL_LIBC}" = "newlib" ]; then
- if ! [ -e "${NACLPORTS_LIBDIR}/libffi.a" ]; then
- ln ${NACLPORTS_LIBDIR}/../lib${NACL_BIT_ARCH_ID}/libffi.a \
- ${NACLPORTS_LIBDIR}/libffi.a
- fi
- fi
-
- # fix libffi paths to work with glib and other libraries
- if [ "${NACL_LIBC}" = "glibc" ]; then
- if ! [ -e "${NACLPORTS_LIBDIR}/libffi.so.6" ]; then
- ln ${NACLPORTS_LIBDIR}/../lib${NACL_BIT_ARCH_ID}/libffi.so.6.0.4 \
- ${NACLPORTS_LIBDIR}/libffi.so.6
- fi
- sed -i.bak 's/\/\//\//g' ${NACLPORTS_LIBDIR}/*.la
- if ! [ -e "${NACLPORTS_LIBDIR}/libffi.so" ]; then
- ln ${NACLPORTS_LIBDIR}/../lib${NACL_BIT_ARCH_ID}/libffi.so.6.0.4 \
- ${NACLPORTS_LIBDIR}/libffi.so
- fi
- if ! [ -e "${NACLPORTS_LIBDIR}/libffi.la" ]; then
- ln ${NACLPORTS_LIBDIR}/../lib${NACL_BIT_ARCH_ID}/libffi.la \
- ${NACLPORTS_LIBDIR}/libffi.la
- fi
- fi
-
- NACLPORTS_CPPFLAGS+=" -DNVALGRIND=1"
-
- SetupCrossEnvironment
-
- export glib_cv_stack_grows=no
- export glib_cv_uscore=no
- export ac_cv_func_issetugid=no
- export ac_cv_func_posix_getpwuid_r=yes
- export ac_cv_func_posix_getgrgid_r=yes
-
- LogExecute ${SRC_DIR}/configure \
- --host=nacl \
- --prefix=${PREFIX} \
- --disable-libelf \
- --${NACL_OPTION}-mmx \
- --${NACL_OPTION}-sse \
- --${NACL_OPTION}-sse2 \
- --${NACL_OPTION}-asm
-}
-
-InstallStep(){
- # fix pkgconfig files to explicitly include libffi
- # for things that depend on glib
- sed -i 's/-lglib-2.0 -lintl/-lglib-2.0 -lffi -lintl/'\
- ${BUILD_DIR}/glib-2.0.pc
-
- DefaultInstallStep
-}
diff --git a/ports/glib/diff_skip.txt b/ports/glib/diff_skip.txt
deleted file mode 100644
index e8c05a6..0000000
--- a/ports/glib/diff_skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-configure
diff --git a/ports/glib/nacl.patch b/ports/glib/nacl.patch
deleted file mode 100644
index f5c3e70..0000000
--- a/ports/glib/nacl.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff --git a/gio/glocalfile.c b/gio/glocalfile.c
---- a/gio/glocalfile.c
-+++ b/gio/glocalfile.c
-@@ -69,6 +69,16 @@
-
- #include "glib-private.h"
-
-+/*
-+ * The headers for the NaCl newlib toolchain define AT_FDCWD
-+ * and this file interprets that to mean that openat, and fstatat
-+ * are useable, which they are not.
-+ * TODO(sbc): remove this once we fix this bug: http://crbug.com/436533
-+ */
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#undef AT_FDCWD
-+#endif
-+
- #ifdef G_OS_WIN32
- #include <windows.h>
- #include <io.h>
-diff --git a/gio/gsocket.c b/gio/gsocket.c
---- a/gio/gsocket.c
-+++ b/gio/gsocket.c
-@@ -2501,7 +2501,9 @@ g_socket_get_available_bytes (GSocket *socket)
- if (!g_socket_get_option (socket, SOL_SOCKET, SO_NREAD, &avail, NULL))
- return -1;
- #elif !defined (G_OS_WIN32)
-+#ifndef __native_client__
- if (ioctl (socket->priv->fd, FIONREAD, &avail) < 0)
-+#endif
- avail = -1;
- #else
- if (socket->priv->type == G_SOCKET_TYPE_DATAGRAM)
-diff --git a/glib/gbacktrace.h b/glib/gbacktrace.h
---- a/glib/gbacktrace.h
-+++ b/glib/gbacktrace.h
-@@ -47,7 +47,9 @@ void g_on_error_stack_trace (const gchar *prg_name);
- * On x86 and alpha systems this is implemented as a soft interrupt
- * and on other architectures it raises a `SIGTRAP` signal.
- */
--#if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2
-+#ifdef __native_client__
-+# define G_BREAKPOINT() __builtin_trap()
-+#elif (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2
- # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END
- #elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86)
- # define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END
-diff --git a/glib/gbitlock.c b/glib/gbitlock.c
---- a/glib/gbitlock.c
-+++ b/glib/gbitlock.c
-@@ -178,7 +178,7 @@ g_futex_wake (const volatile gint *address)
- #define CONTENTION_CLASSES 11
- static volatile gint g_bit_lock_contended[CONTENTION_CLASSES];
-
--#if (defined (i386) || defined (__amd64__))
-+#if (defined (i386) || defined (__amd64__)) && !defined(__native_client__)
- #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
- #define USE_ASM_GOTO 1
- #endif
-diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c
---- a/glib/gthread-posix.c
-+++ b/glib/gthread-posix.c
-@@ -652,6 +652,9 @@ g_cond_impl_new (void)
- pthread_condattr_init (&attr);
-
- #ifdef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP
-+#elif defined(__native_client__)
-+ if G_UNLIKELY ((status = pthread_condattr_setclock (&attr, CLOCK_REALTIME)) != 0)
-+ g_thread_abort (status, "pthread_condattr_setclock - CLOCK_REALTIME");
- #elif defined (HAVE_PTHREAD_CONDATTR_SETCLOCK) && defined (CLOCK_MONOTONIC)
- if G_UNLIKELY ((status = pthread_condattr_setclock (&attr, CLOCK_MONOTONIC)) != 0)
- g_thread_abort (status, "pthread_condattr_setclock");
-diff --git a/glib/gtypes.h b/glib/gtypes.h
---- a/glib/gtypes.h
-+++ b/glib/gtypes.h
-@@ -178,7 +178,7 @@ typedef const gchar * (*GTranslateFunc) (const gchar *str,
-
- /* Arch specific stuff for speed
- */
--#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
-+#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__) && !defined(__native_client__)
-
- # if __GNUC__ >= 4 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 3
- # define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((gint32) (val)))
diff --git a/ports/glib/pkg_info b/ports/glib/pkg_info
deleted file mode 100644
index 47a4ad1..0000000
--- a/ports/glib/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=glib
-VERSION=2.45.2
-URL=http://ftp.gnome.org/pub/gnome/sources/glib/2.45/glib-2.45.2.tar.xz
-LICENSE=LGPL
-DEPENDS=(libffi zlib gettext)
-# glib depends on the system gettext and for some reason it can't
-# detect this on mac.
-BUILD_OS=linux
-SHA1=495f7cc9281847ecfbbaf9d3edd9eb2a2123350e
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/glibc-compat/Makefile b/ports/glibc-compat/Makefile
deleted file mode 100644
index 1c2fb6c..0000000
--- a/ports/glibc-compat/Makefile
+++ /dev/null
@@ -1,96 +0,0 @@
-# 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.
-
-ifneq ($(TOOLCHAIN),glibc)
-LIBC = newlib
-endif
-
-CFLAGS += -Wno-implicit-function-declaration
-CPPFLAGS += -Werror -Wno-unused-value -pthread
-CPPFLAGS += -DNACL_SDK_VERSION=$(NACL_SDK_VERSION)
-CPPFLAGS += -I$(GTEST_DIR)/include
-OUT := out
-SOURCES := \
- src/alarm.c \
- src/getpass.c \
- src/err.c \
- src/fpending.c \
- src/dirfd.c \
- src/flock.c \
- src/fts.c \
- src/getprotobyname_r.c \
- src/getservbyname_r.c \
- src/herrno.c \
- src/herror.c \
- src/in6_addr.c \
- src/inet_addr.c \
- src/inet_pton.c \
- src/lockf.c \
- src/mktemp.c \
- src/ns_name.c \
- src/ns_netint.c \
- src/ns_samedomain.c \
- src/openat.c \
- src/qsort_r.c \
- src/random.c \
- src/realpath.c \
- src/res_comp.c \
- src/res_data.c \
- src/res_debug.c \
- src/res_init.c \
- src/res_libc.c \
- src/res_mkquery.c \
- src/res_query.c \
- src/res_send.c \
- src/setregid.c \
- src/tcgetpgrp.c \
- src/timegm.c \
- src/writev.c
-
-OBJS := $(patsubst src/%.c,$(OUT)/%.o,$(SOURCES))
-
-ifeq ($(V),1)
-CXX_PREFIX =
-CC_PREFIX =
-AR_PREFIX =
-else
-CXX_PREFIX = @echo " CXX $@";
-CC_PREFIX = @echo " CC $@";
-AR_PREFIX = @echo " AR $@";
-endif
-
-ifeq ($(LIBC),newlib)
-LIB = $(OUT)/libglibc-compat.a
-CPPFLAGS += -Iinclude -Isrc -D_LIBC
-endif
-
-all: $(LIB) $(OUT)/glibc_compat_test
-
-$(OUT)/%.o : src/%.c
- @mkdir -p $(OUT)
- $(CC_PREFIX)$(CC) -o $@ -c $< $(CFLAGS) $(CPPFLAGS)
-
-$(OUT)/gtest-all.o : $(GTEST_DIR)/src/gtest-all.cc
- @mkdir -p $(OUT)
- $(CXX_PREFIX)$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -I$(GTEST_DIR)
-
-$(OUT)/%.o : src/%.cc
- @mkdir -p $(OUT)
- $(CXX_PREFIX)$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS)
-
-$(OUT)/libglibc-compat.a: $(OBJS)
- $(AR_PREFIX)$(AR) rcs $@ $^
-
-TEST_LIBS=$(LIB) $(OUT)/gtest-all.o -lpthread
-
-$(OUT)/glibc_compat_test: $(OUT)/test.o $(OUT)/gtest-all.o $(LIB)
- @mkdir -p $(OUT)
- $(CXX_PREFIX)$(CXX) -o $@ $^ -L$(OUT) $(LDFLAGS) -pthread
-
-test: $(OUT)/glibc_compat_test
-
-clean:
- rm -rf $(OUT)
-
-.PHONY: test clean all
diff --git a/ports/glibc-compat/README b/ports/glibc-compat/README
deleted file mode 100644
index 84e1971..0000000
--- a/ports/glibc-compat/README
+++ /dev/null
@@ -1,21 +0,0 @@
-This directory contains headers and stubs needed to compile libraries with
-extensive dependencies on Glibc, which couldn't be directly compiled with
-newlib headers.
-
-Code here is mostly taken from the newlib CVS (trunk from Sep 5 2012), see
-http://sourceware.org/newlib/download.html
-and is BSD-licensed, so could be linked statically into differently
-licensed programs. Some simple placeholders were written from scratch, and also
-BSD-style licensed.
-
-elf*.h is taken from the native_client/src/include
-directory of Native Client with revisions to:
-- Reduce unneeded dependencies
-- Change top-relative includes to file-relative includes
-- Add the Elf32_Dyn, Elf64_Dyn, and DT_* definitions
-
-Some more contents are added to elf*.h from freebsd source tree
-https://svnweb.freebsd.org/base/release/10.1.0/
-
-flock.c, fts.h, fts.c, err.h, err.c and timegm are pulled from freebsd 10.1 with
-some modifications.
diff --git a/ports/glibc-compat/build.sh b/ports/glibc-compat/build.sh
deleted file mode 100644
index bfb9c44..0000000
--- a/ports/glibc-compat/build.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-# 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.
-
-BUILD_DIR=${SRC_DIR}
-if [ "${TOOLCHAIN}" != "emscripten" ]; then
- EXECUTABLES=out/glibc_compat_test
-fi
-
-ConfigureStep() {
- LogExecute cp -rf ${START_DIR}/* .
- LogExecute rm -rf out
-}
-
-
-BuildStep() {
- if [ "${TOOLCHAIN}" = "emscripten" ]; then
- return
- fi
- # export the nacl tools
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- export AR=${NACLAR}
- export NACL_SDK_VERSION
- export NACL_SDK_ROOT
- export LDFLAGS=${NACLPORTS_LDFLAGS}
- export CPPFLAGS=${NACLPORTS_CPPFLAGS}
- export CFLAGS=${NACLPORTS_CFLAGS}
- export GTEST_DIR=${NACL_PREFIX}/src/gtest
- DefaultBuildStep
-}
-
-TestStep() {
- if [ "${TOOLCHAIN}" = "emscripten" ]; then
- return
- fi
- if [ "${TOOLCHAIN}" = "pnacl" ]; then
- RunSelLdrCommand ./out/glibc_compat_test
- else
- LogExecute ./out/glibc_compat_test.sh
- fi
-}
-
-InstallStep() {
- if [ "${NACL_LIBC}" != "newlib" ]; then
- return
- fi
- local LIB=libglibc-compat.a
- INCDIR=${DESTDIR_INCLUDE}/glibc-compat
- MakeDir ${DESTDIR_LIB}
- Remove ${INCDIR}
- MakeDir ${INCDIR}
- LogExecute install -m 644 out/${LIB} ${DESTDIR_LIB}/${LIB}
- for file in include/*.h ${INCDIR}; do
- if [ -f $file ]; then
- LogExecute install -m 644 $file ${INCDIR}/
- fi
- done
- for dir in sys arpa machine net netinet netinet6; do
- MakeDir ${INCDIR}/${dir}
- LogExecute install -m 644 include/${dir}/*.h ${INCDIR}/${dir}/
- done
-}
diff --git a/ports/glibc-compat/include/arpa/nameser.h b/ports/glibc-compat/include/arpa/nameser.h
deleted file mode 100644
index 6209afd..0000000
--- a/ports/glibc-compat/include/arpa/nameser.h
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * From: Id: nameser.h,v 8.16 1998/02/06 00:35:58 halley Exp
- * $FreeBSD: src/include/arpa/nameser.h,v 1.16 2002/03/23 17:24:55 imp Exp $
- */
-
-#ifndef _ARPA_NAMESER_H_
-#define _ARPA_NAMESER_H_
-
-#define BIND_4_COMPAT
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-/*
- * revision information. this is the release date in YYYYMMDD format.
- * it can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__NAMESER > 19931104)". do not
- * compare for equality; rather, use it to determine whether your libnameser.a
- * is new enough to contain a certain feature.
- */
-
-/* XXXRTH I made this bigger than __BIND in 4.9.5 T6B */
-#define __NAMESER 19961001 /* New interface version stamp. */
-
-/*
- * Define constants based on RFC 883, RFC 1034, RFC 1035
- */
-#define NS_PACKETSZ 512 /* maximum packet size */
-#define NS_MAXDNAME 1025 /* maximum domain name */
-#define NS_MAXCDNAME 255 /* maximum compressed domain name */
-#define NS_MAXLABEL 63 /* maximum length of domain label */
-#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
-#define NS_INADDRSZ 4 /* IPv4 T_A */
-#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
-#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
-
-/*
- * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
- * in synch with it.
- */
-typedef enum __ns_sect {
- ns_s_qd = 0, /* Query: Question. */
- ns_s_zn = 0, /* Update: Zone. */
- ns_s_an = 1, /* Query: Answer. */
- ns_s_pr = 1, /* Update: Prerequisites. */
- ns_s_ns = 2, /* Query: Name servers. */
- ns_s_ud = 2, /* Update: Update. */
- ns_s_ar = 3, /* Query|Update: Additional records. */
- ns_s_max = 4
-} ns_sect;
-
-/*
- * This is a message handle. It is caller allocated and has no dynamic data.
- * This structure is intended to be opaque to all but ns_parse.c, thus the
- * leading _'s on the member names. Use the accessor functions, not the _'s.
- */
-typedef struct __ns_msg {
- const u_char *_msg, *_eom;
- u_int16_t _id, _flags, _counts[ns_s_max];
- const u_char *_sections[ns_s_max];
- ns_sect _sect;
- int _rrnum;
- const u_char *_ptr;
-} ns_msg;
-
-/* Private data structure - do not use from outside library. */
-struct _ns_flagdata { int mask, shift; };
-extern struct _ns_flagdata _ns_flagdata[];
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_msg_getflag(handle, flag) ( \
- ((handle)._flags & _ns_flagdata[flag].mask) \
- >> _ns_flagdata[flag].shift \
- )
-#define ns_msg_id(handle) ((handle)._id + 0)
-#define ns_msg_base(handle) ((handle)._msg + 0)
-#define ns_msg_end(handle) ((handle)._eom + 0)
-#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
-#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
-
-/*
- * This is a parsed record. It is caller allocated and has no dynamic data.
- */
-typedef struct __ns_rr {
- char name[NS_MAXDNAME]; /* XXX need to malloc */
- u_int16_t type;
- u_int16_t rr_class;
- u_int32_t ttl;
- u_int16_t rdlength;
- const u_char *rdata;
-} ns_rr;
-
-/* Accessor macros - this is part of the public interface. */
-#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
-#define ns_rr_type(rr) ((rr).type + 0)
-#define ns_rr_class(rr) ((rr).rr_class + 0)
-#define ns_rr_ttl(rr) ((rr).ttl + 0)
-#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
-#define ns_rr_rdata(rr) ((rr).rdata + 0)
-
-/*
- * These don't have to be in the same order as in the packet flags word,
- * and they can even overlap in some cases, but they will need to be kept
- * in synch with ns_parse.c:ns_flagdata[].
- */
-typedef enum __ns_flag {
- ns_f_qr, /* Question/Response. */
- ns_f_opcode, /* Operation code. */
- ns_f_aa, /* Authoritative Answer. */
- ns_f_tc, /* Truncation occurred. */
- ns_f_rd, /* Recursion Desired. */
- ns_f_ra, /* Recursion Available. */
- ns_f_z, /* MBZ. */
- ns_f_ad, /* Authentic Data (DNSSEC). */
- ns_f_cd, /* Checking Disabled (DNSSEC). */
- ns_f_rcode, /* Response code. */
- ns_f_max
-} ns_flag;
-
-/*
- * Currently defined opcodes.
- */
-typedef enum __ns_opcode {
- ns_o_query = 0, /* Standard query. */
- ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /* Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /* Zone change notification. */
- ns_o_update = 5, /* Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-/*
- * Currently defined response codes.
- */
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /* No error occurred. */
- ns_r_formerr = 1, /* Format error. */
- ns_r_servfail = 2, /* Server failure. */
- ns_r_nxdomain = 3, /* Name error. */
- ns_r_notimpl = 4, /* Unimplemented. */
- ns_r_refused = 5, /* Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /* Name exists */
- ns_r_yxrrset = 7, /* RRset exists */
- ns_r_nxrrset = 8, /* RRset does not exist */
- ns_r_notauth = 9, /* Not authoritative for zone */
- ns_r_notzone = 10, /* Zone of record different from zone section */
- ns_r_max = 11,
- /* The following are TSIG extended errors */
- ns_r_badsig = 16,
- ns_r_badkey = 17,
- ns_r_badtime = 18
-} ns_rcode;
-
-/* BIND_UPDATE */
-typedef enum __ns_update_operation {
- ns_uop_delete = 0,
- ns_uop_add = 1,
- ns_uop_max = 2
-} ns_update_operation;
-
-/*
- * * This structure is used for TSIG authenticated messages
- * */
-struct ns_tsig_key {
- char name[NS_MAXDNAME], alg[NS_MAXDNAME];
- unsigned char *data;
- int len;
-};
-typedef struct ns_tsig_key ns_tsig_key;
-
-/*
- * * This structure is used for TSIG authenticated TCP messages
- * */
-struct ns_tcp_tsig_state {
- int counter;
- struct dst_key *key;
- void *ctx;
- unsigned char sig[NS_PACKETSZ];
- int siglen;
-};
-typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
-
-#define NS_TSIG_FUDGE 300
-#define NS_TSIG_TCP_COUNT 100
-#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
-
-#define NS_TSIG_ERROR_NO_TSIG -10
-#define NS_TSIG_ERROR_NO_SPACE -11
-#define NS_TSIG_ERROR_FORMERR -12
-
-/*
- * Currently defined type values for resources and queries.
- */
-typedef enum __ns_type {
- ns_t_invalid = 0, /* Cookie. */
- ns_t_a = 1, /* Host address. */
- ns_t_ns = 2, /* Authoritative server. */
- ns_t_md = 3, /* Mail destination. */
- ns_t_mf = 4, /* Mail forwarder. */
- ns_t_cname = 5, /* Canonical name. */
- ns_t_soa = 6, /* Start of authority zone. */
- ns_t_mb = 7, /* Mailbox domain name. */
- ns_t_mg = 8, /* Mail group member. */
- ns_t_mr = 9, /* Mail rename name. */
- ns_t_null = 10, /* Null resource record. */
- ns_t_wks = 11, /* Well known service. */
- ns_t_ptr = 12, /* Domain name pointer. */
- ns_t_hinfo = 13, /* Host information. */
- ns_t_minfo = 14, /* Mailbox information. */
- ns_t_mx = 15, /* Mail routing information. */
- ns_t_txt = 16, /* Text strings. */
- ns_t_rp = 17, /* Responsible person. */
- ns_t_afsdb = 18, /* AFS cell database. */
- ns_t_x25 = 19, /* X_25 calling address. */
- ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
- ns_t_nsap = 22, /* NSAP address. */
- ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /* Security signature. */
- ns_t_key = 25, /* Security key. */
- ns_t_px = 26, /* X.400 mail mapping. */
- ns_t_gpos = 27, /* Geographical position (withdrawn). */
- ns_t_aaaa = 28, /* Ip6 Address. */
- ns_t_loc = 29, /* Location Information. */
- ns_t_nxt = 30, /* Next domain (security). */
- ns_t_eid = 31, /* Endpoint identifier. */
- ns_t_nimloc = 32, /* Nimrod Locator. */
- ns_t_srv = 33, /* Server Selection. */
- ns_t_atma = 34, /* ATM Address */
- ns_t_naptr = 35, /* Naming Authority PoinTeR */
- ns_t_kx = 36, /* Key Exchange */
- ns_t_cert = 37, /* Certification record */
- ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
- ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
- ns_t_sink = 40, /* Kitchen sink (experimentatl) */
- ns_t_opt = 41, /* EDNS0 option (meta-RR) */
- ns_t_tsig = 250, /* Transaction signature. */
- ns_t_ixfr = 251, /* Incremental zone transfer. */
- ns_t_axfr = 252, /* Transfer zone of authority. */
- ns_t_mailb = 253, /* Transfer mailbox records. */
- ns_t_maila = 254, /* Transfer mail agent records. */
- ns_t_any = 255, /* Wildcard match. */
- ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
- ns_t_max = 65536
-} ns_type;
-
-/* Exclusively a QTYPE? (not also an RTYPE) */
-#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
- (t) == ns_t_mailb || (t) == ns_t_maila)
-/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
-#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
-/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
-#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
-#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
-#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
- (t) == ns_t_zxfr)
-
-
-/*
- * This RR-like structure is particular to UPDATE.
- */
-struct ns_updrec {
- struct ns_updrec *r_prev; /* prev record */
- struct ns_updrec *r_next; /* next record */
- u_int8_t r_section; /* ZONE/PREREQUISITE/UPDATE */
- char * r_dname; /* owner of the RR */
- u_int16_t r_class; /* class number */
- u_int16_t r_type; /* type number */
- u_int32_t r_ttl; /* time to live */
- u_char * r_data; /* rdata fields as text string */
- u_int16_t r_size; /* size of r_data field */
- int r_opcode; /* type of operation */
- /* following fields for private use by the resolver/server routines */
- struct ns_updrec *r_grpnext; /* next record when grouped */
- struct databuf *r_dp; /* databuf to process */
- struct databuf *r_deldp; /* databuf's deleted/overwritten */
- u_int16_t r_zone; /* zone number on server */
-};
-typedef struct ns_updrec ns_updrec;
-
-
-/*
- * Values for class field
- */
-typedef enum __ns_class {
- ns_c_in = 1, /* Internet. */
- /* Class 2 unallocated/unsupported. */
- ns_c_chaos = 3, /* MIT Chaos-net. */
- ns_c_hs = 4, /* MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /* for prereq. sections in update requests */
- ns_c_any = 255, /* Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-/* DNSSEC constants. */
-
-typedef enum __ns_key_types {
- ns_kt_rsa = 1, /* key type RSA/MD5 */
- ns_kt_dh = 2, /* Diffie Hellman */
- ns_kt_dsa = 3, /* Digital Signature Standard (MANDATORY) */
- ns_kt_private = 254 /* Private key type starts with OID */
-} ns_key_types;
-
-typedef enum __ns_cert_types {
- cert_t_pkix = 1, /* PKIX (X.509v3) */
- cert_t_spki = 2, /* SPKI */
- cert_t_pgp = 3, /* PGP */
- cert_t_url = 253, /* URL private type */
- cert_t_oid = 254 /* OID private type */
-} ns_cert_types;
-
-
-/*
- * Flags field of the KEY RR rdata
- */
-#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
-#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
-#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
-#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
-#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
-/* The type bits can also be interpreted independently, as single bits: */
-#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
-#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
-#define NS_KEY_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */
-#define NS_KEY_RESERVED3 0x1000 /* reserved - must be zero */
-#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
-#define NS_KEY_USERACCOUNT 0x0400 /* key is assoc. with a user acct */
-#define NS_KEY_ENTITY 0x0200 /* key is assoc. with entity eg host */
-#define NS_KEY_ZONEKEY 0x0100 /* key is zone key */
-#define NS_KEY_IPSEC 0x0080 /* key is for IPSEC (host or user)*/
-#define NS_KEY_EMAIL 0x0040 /* key is for email (MIME security) */
-#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
-#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
-#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
-
-#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED3 | \
- NS_KEY_RESERVED4 | \
- NS_KEY_RESERVED10 | \
- NS_KEY_RESERVED11 )
-
-/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
-#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
-#define NS_ALG_DH 2 /* Diffie Hellman KEY */
-#define NS_ALG_DSA 3 /* DSA KEY */
-#define NS_ALG_DSS NS_ALG_DSA
-
-#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
-#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
-
-/* Signatures */
-#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
-#define NS_MD5RSA_MAX_BITS 2552
- /* Total of binary mod and exp */
-#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
- /* Max length of text sig block */
-#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
-
-/* Offsets into SIG record rdata to find various values */
-#define NS_SIG_TYPE 0 /* Type flags */
-#define NS_SIG_ALG 2 /* Algorithm */
-#define NS_SIG_LABELS 3 /* How many labels in name */
-#define NS_SIG_OTTL 4 /* Original TTL */
-#define NS_SIG_EXPIR 8 /* Expiration time */
-#define NS_SIG_SIGNED 12 /* Signature time */
-#define NS_SIG_FOOT 16 /* Key footprint */
-#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
-
-/* How RR types are represented as bit-flags in NXT records */
-#define NS_NXT_BITS 8
-#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
-#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
-
-
-/*
- * Inline versions of get/put short/long. Pointer is advanced.
- */
-#define NS_GET16(s, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (s) = ((u_int16_t)t_cp[0] << 8) \
- | ((u_int16_t)t_cp[1]) \
- ; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_GET32(l, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (l) = ((u_int32_t)t_cp[0] << 24) \
- | ((u_int32_t)t_cp[1] << 16) \
- | ((u_int32_t)t_cp[2] << 8) \
- | ((u_int32_t)t_cp[3]) \
- ; \
- (cp) += NS_INT32SZ; \
-}
-
-#define NS_PUT16(s, cp) { \
- register u_int16_t t_s = (u_int16_t)(s); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_s >> 8; \
- *t_cp = t_s; \
- (cp) += NS_INT16SZ; \
-}
-
-#define NS_PUT32(l, cp) { \
- register u_int32_t t_l = (u_int32_t)(l); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_l >> 24; \
- *t_cp++ = t_l >> 16; \
- *t_cp++ = t_l >> 8; \
- *t_cp = t_l; \
- (cp) += NS_INT32SZ; \
-}
-
-/*
- * ANSI C identifier hiding.
- */
-#define ns_get16 __ns_get16
-#define ns_get32 __ns_get32
-#define ns_put16 __ns_put16
-#define ns_put32 __ns_put32
-#define ns_initparse __ns_initparse
-#define ns_parserr __ns_parserr
-#define ns_sprintrr __ns_sprintrr
-#define ns_sprintrrf __ns_sprintrrf
-#define ns_format_ttl __ns_format_ttl
-#define ns_parse_ttl __ns_parse_ttl
-#define ns_name_ntop __ns_name_ntop
-#define ns_name_pton __ns_name_pton
-#define ns_name_unpack __ns_name_unpack
-#define ns_name_pack __ns_name_pack
-#define ns_name_compress __ns_name_compress
-#define ns_name_uncompress __ns_name_uncompress
-
-__BEGIN_DECLS
-u_int ns_get16(const u_char *);
-u_long ns_get32(const u_char *);
-void ns_put16(u_int, u_char *);
-void ns_put32(u_long, u_char *);
-int ns_initparse(const u_char *, int, ns_msg *);
-int ns_parserr(ns_msg *, ns_sect, int, ns_rr *);
-int ns_sprintrr(const ns_msg *, const ns_rr *,
- const char *, const char *, char *, size_t);
-int ns_sprintrrf(const u_char *, size_t, const char *,
- ns_class, ns_type, u_long, const u_char *,
- size_t, const char *, const char *,
- char *, size_t);
-int ns_format_ttl(u_long, char *, size_t);
-int ns_parse_ttl(const char *, u_long *);
-int ns_name_ntop(const u_char *, char *, size_t);
-int ns_name_pton(const char *, u_char *, size_t);
-int ns_name_unpack(const u_char *, const u_char *,
- const u_char *, u_char *, size_t);
-int ns_name_pack(const u_char *, u_char *, int,
- const u_char **, const u_char **);
-int ns_name_uncompress(const u_char *, const u_char *,
- const u_char *, char *, size_t);
-int ns_name_compress(const char *, u_char *, size_t,
- const u_char **, const u_char **);
-int ns_name_skip(const u_char **, const u_char *);
-__END_DECLS
-
-#ifdef BIND_4_COMPAT
-#include <arpa/nameser_compat.h>
-#endif
-
-#endif /* !_ARPA_NAMESER_H_ */
diff --git a/ports/glibc-compat/include/arpa/nameser_compat.h b/ports/glibc-compat/include/arpa/nameser_compat.h
deleted file mode 100644
index 5a07e37..0000000
--- a/ports/glibc-compat/include/arpa/nameser_compat.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Copyright (c) 1983, 1989
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * from nameser.h 8.1 (Berkeley) 6/2/93
- * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp
- * $FreeBSD: src/include/arpa/nameser_compat.h,v 1.3 2001/06/10 20:25:22 ume Exp $
- */
-
-#ifndef _ARPA_NAMESER_COMPAT_
-#define _ARPA_NAMESER_COMPAT_
-
-#define __BIND 19950621 /* (DEAD) interface version stamp. */
-
-#include <endian.h>
-#include <machine/endian.h>
-
-#if !defined(BYTE_ORDER) || \
- (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
- BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- #error "Undefined or invalid BYTE_ORDER";
-#endif
-
-/*
- * Structure for query header. The order of the fields is machine- and
- * compiler-dependent, depending on the byte/bit order and the layout
- * of bit fields. We use bit fields only in int variables, as this
- * is all ANSI requires. This requires a somewhat confusing rearrangement.
- */
-
-typedef struct {
- unsigned id :16; /* query identification number */
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- unsigned rd :1; /* recursion desired */
- unsigned tc :1; /* truncated message */
- unsigned aa :1; /* authoritive answer */
- unsigned opcode :4; /* purpose of message */
- unsigned qr :1; /* response flag */
- /* fields in fourth byte */
- unsigned rcode :4; /* response code */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned ad: 1; /* authentic data from named */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ra :1; /* recursion available */
-#endif
- /* remaining bytes */
- unsigned qdcount :16; /* number of question entries */
- unsigned ancount :16; /* number of answer entries */
- unsigned nscount :16; /* number of authority entries */
- unsigned arcount :16; /* number of resource entries */
-} HEADER;
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INT32SZ NS_INT32SZ
-#define INT16SZ NS_INT16SZ
-#define INADDRSZ NS_INADDRSZ
-#define IN6ADDRSZ NS_IN6ADDRSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define S_ZONE ns_s_zn
-#define S_PREREQ ns_s_pr
-#define S_UPDATE ns_s_ud
-#define S_ADDT ns_s_ar
-
-#define QUERY ns_o_query
-#define IQUERY ns_o_iquery
-#define STATUS ns_o_status
-#define NS_NOTIFY_OP ns_o_notify
-#define NS_UPDATE_OP ns_o_update
-
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define SERVFAIL ns_r_servfail
-#define NXDOMAIN ns_r_nxdomain
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#define YXDOMAIN ns_r_yxdomain
-#define YXRRSET ns_r_yxrrset
-#define NXRRSET ns_r_nxrrset
-#define NOTAUTH ns_r_notauth
-#define NOTZONE ns_r_notzone
-
-#define DELETE ns_uop_delete
-#define ADD ns_uop_add
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_OPT ns_t_opt
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-/* BIND_UPDATE */
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#define GETSHORT NS_GET16
-#define GETLONG NS_GET32
-#define PUTSHORT NS_PUT16
-#define PUTLONG NS_PUT32
-
-#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/ports/glibc-compat/include/elf.h b/ports/glibc-compat/include/elf.h
deleted file mode 100644
index 9b93e6e..0000000
--- a/ports/glibc-compat/include/elf.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2011 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.
- */
-
-/* @file
- *
- * Minimal ELF header declaration / constants. Only Elf values are
- * handled, and constants are defined only for fields that are actually
- * used. (Unused constants for used fields are include only for
- * "completeness", though of course in many cases there are more
- * values in use, e.g., the EM_* values for e_machine.)
- *
- * Note: We define both 32 and 64 bit versions of the elf file in
- * separate files. We define sizeless aliases here to keep most other
- * code width-agnostic. But in fact, we really only deal with 32-bit
- * formats internally. For compatibility with past practice, we
- * recognize the 64-bit format for x86-64, but we translate that to
- * 32-bit format in our own data structures.
- *
- * (Re)Created from the ELF specification at
- * http://x86.ddj.com/ftp/manuals/tools/elf.pdf which is referenced
- * from wikipedia article
- * http://en.wikipedia.org/wki/Executable_and_Linkable_Format
- */
-
-#ifndef NATIVE_CLIENT_SRC_INCLUDE_ELF_H_
-#define NATIVE_CLIENT_SRC_INCLUDE_ELF_H_ 1
-
-
-#include "elf_auxv.h"
-#include <bits/wordsize.h>
-#include <sys/types.h>
-#include <stdint.h>
-
-#include "elf32.h"
-#include "elf64.h"
-
-
-EXTERN_C_BEGIN
-
-#define NACL_ELF_CLASS ELFCLASS32
-
-#define NACL_PRIdElf_Addr NACL_PRId32
-#define NACL_PRIiElf_Addr NACL_PRIi32
-#define NACL_PRIoElf_Addr NACL_PRIo32
-#define NACL_PRIuElf_Addr NACL_PRIu32
-#define NACL_PRIxElf_Addr NACL_PRIx32
-#define NACL_PRIXElf_Addr NACL_PRIX32
-
-#define NACL_PRIxElf_AddrAll "08" NACL_PRIx32
-#define NACL_PRIXElf_AddrAll "08" NACL_PRIX32
-
-#define NACL_PRIdElf_Off NACL_PRId32
-#define NACL_PRIiElf_Off NACL_PRIi32
-#define NACL_PRIoElf_Off NACL_PRIo32
-#define NACL_PRIuElf_Off NACL_PRIu32
-#define NACL_PRIxElf_Off NACL_PRIx32
-#define NACL_PRIXElf_Off NACL_PRIX32
-
-#define NACL_PRIdElf_Half NACL_PRId16
-#define NACL_PRIiElf_Half NACL_PRIi16
-#define NACL_PRIoElf_Half NACL_PRIo16
-#define NACL_PRIuElf_Half NACL_PRIu16
-#define NACL_PRIxElf_Half NACL_PRIx16
-#define NACL_PRIXElf_Half NACL_PRIX16
-
-#define NACL_PRIdElf_Word NACL_PRId32
-#define NACL_PRIiElf_Word NACL_PRIi32
-#define NACL_PRIoElf_Word NACL_PRIo32
-#define NACL_PRIuElf_Word NACL_PRIu32
-#define NACL_PRIxElf_Word NACL_PRIx32
-#define NACL_PRIXElf_Word NACL_PRIX32
-
-#define NACL_PRIdElf_Sword NACL_PRId32z
-#define NACL_PRIiElf_Sword NACL_PRIi32z
-#define NACL_PRIoElf_Sword NACL_PRIo32z
-#define NACL_PRIuElf_Sword NACL_PRIu32z
-#define NACL_PRIxElf_Sword NACL_PRIx32z
-#define NACL_PRIXElf_Sword NACL_PRIX32z
-
-#define NACL_PRIdElf_Xword NACL_PRId32
-#define NACL_PRIiElf_Xword NACL_PRIi32
-#define NACL_PRIoElf_Xword NACL_PRIo32
-#define NACL_PRIuElf_Xword NACL_PRIu32
-#define NACL_PRIxElf_Xword NACL_PRIx32
-#define NACL_PRIXElf_Xword NACL_PRIX32
-
-#define NACL_PRIdElf_Sxword NACL_PRId32
-#define NACL_PRIiElf_Sxword NACL_PRIi32
-#define NACL_PRIoElf_Sxword NACL_PRIo32
-#define NACL_PRIuElf_Sxword NACL_PRIu32
-#define NACL_PRIxElf_Sxword NACL_PRIx32
-#define NACL_PRIXElf_Sxword NACL_PRIX32
-
-/* Define sub architecture neutral types */
-typedef Elf32_Addr Elf_Addr;
-typedef Elf32_Off Elf_Off;
-typedef Elf32_Half Elf_Half;
-typedef Elf32_Word Elf_Word;
-typedef Elf32_Sword Elf_Sword;
-typedef Elf32_Word Elf_Xword;
-typedef Elf32_Sword Elf_Xsword;
-
-/* Define ranges for elf types. */
-#define MIN_ELF_ADDR 0x0
-#define MAX_ELF_ADDR 0xffffffff
-
-/* Define a neutral form of the file header. */
-typedef Elf32_Ehdr Elf_Ehdr;
-
-/* Define a neutral form of a program header. */
-typedef Elf32_Phdr Elf_Phdr;
-
-/* Define neutral section headers. */
-typedef Elf32_Shdr Elf_Shdr;
-
-/* Define neutral section headers. */
-typedef Elf32_Sym Elf_Sym;
-
-EXTERN_C_END
-
-#endif /* NATIVE_CLIENT_SRC_INCLUDE_ELF_H_ */
diff --git a/ports/glibc-compat/include/elf32.h b/ports/glibc-compat/include/elf32.h
deleted file mode 100644
index 4843547..0000000
--- a/ports/glibc-compat/include/elf32.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2011 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.
- */
-
-/* @file
- *
- * Minimal ELF header declaration / constants for Elf32* values.
- * Constants are defined only for fields that are actualy
- * used. (Unused constants for used fields are include only for
- * "completeness", though of course in many cases there are more
- * values in use, e.g., the EM_* values for e_machine.)
- *
- * (Re)Created from the ELF specification at
- * http://x86.ddj.com/ftp/manuals/tools/elf.pdf which is referenced
- * from wikipedia article
- * http://en.wikipedia.org/wki/Executable_and_Linkable_Format
- */
-
-/*-
- * Copyright (c) 1996-1998 John D. Polstra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/sys/elf32.h,v 1.13 2006/10/17 05:43:30 jkoshy Exp $
- */
-#ifndef NATIVE_CLIENT_SRC_INCLUDE_ELF32_H_
-#define NATIVE_CLIENT_SRC_INCLUDE_ELF32_H_
-
-#include "elf_constants.h"
-
-EXTERN_C_BEGIN
-
-/* assumes 32-bit int, 16-bit short, 8-bit char */
-
-/* Define 32-bit specific types */
-typedef uint32_t Elf32_Addr; /* alignment 4 */
-typedef uint16_t Elf32_Half; /* alignment 2 */
-typedef uint32_t Elf32_Off; /* alignment 4 */
-typedef int32_t Elf32_Sword; /* alignment 4 */
-typedef uint32_t Elf32_Word; /* alignment 4 */
-
-/* unsigned char, size 1, alignment 1 */
-
-/* Define the structure of the file header for 32 bits. */
-typedef struct {
- unsigned char e_ident[EI_NIDENT];
- Elf32_Half e_type;
- Elf32_Half e_machine;
- Elf32_Word e_version;
- Elf32_Addr e_entry;
- Elf32_Off e_phoff;
- Elf32_Off e_shoff;
- Elf32_Word e_flags;
- Elf32_Half e_ehsize;
- Elf32_Half e_phentsize;
- Elf32_Half e_phnum;
- Elf32_Half e_shentsize;
- Elf32_Half e_shnum;
- Elf32_Half e_shstrndx;
-} Elf32_Ehdr;
-
-/* Define the structure of a program header table for 32-bits. */
-typedef struct {
- Elf32_Word p_type;
- Elf32_Off p_offset;
- Elf32_Addr p_vaddr;
- Elf32_Addr p_paddr;
- Elf32_Word p_filesz;
- Elf32_Word p_memsz;
- Elf32_Word p_flags;
- Elf32_Word p_align;
-} Elf32_Phdr;
-
-/*
- * Define 32-bit section headers.
- * ncfileutil wants section headers, even though service runtime does
- * not.
- */
-typedef struct {
- Elf32_Word sh_name;
- Elf32_Word sh_type;
- Elf32_Word sh_flags;
- Elf32_Addr sh_addr;
- Elf32_Off sh_offset;
- Elf32_Word sh_size;
- Elf32_Word sh_link;
- Elf32_Word sh_info;
- Elf32_Word sh_addralign;
- Elf32_Word sh_entsize;
-} Elf32_Shdr;
-
-typedef struct {
- Elf32_Sword d_tag;
- union {
- Elf32_Word d_val;
- Elf32_Addr d_ptr;
- } d_un;
-} Elf32_Dyn;
-
-typedef struct {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
-} Elf32_Rel;
-
-#define ELF32_R_TYPE(val) ((val) & 0xff)
-
-typedef struct {
- Elf32_Word n_namesz;
- Elf32_Word n_descsz;
- Elf32_Word n_type;
-} Elf32_Nhdr;
-
-/*
- * The auxiliary vector is passed on the stack between ELF loaders,
- * dynamic linkers, and program startup code. The gratuitous union
- * is the historical standard API, though it has no purpose today.
- */
-typedef struct {
- Elf32_Word a_type; /* Entry type */
- union {
- Elf32_Word a_val; /* Integer value */
- } a_un;
-} Elf32_auxv_t;
-
-/*
- * Symbol table entries.
- */
-
-typedef struct {
- Elf32_Word st_name; /* String table index of name. */
- Elf32_Addr st_value; /* Symbol value. */
- Elf32_Word st_size; /* Size of associated object. */
- unsigned char st_info; /* Type and binding information. */
- unsigned char st_other; /* Reserved (not used). */
- Elf32_Half st_shndx; /* Section index of symbol. */
-} Elf32_Sym;
-
-/* Macros for accessing the fields of st_info. */
-#define ELF32_ST_BIND(info) ((info) >> 4)
-#define ELF32_ST_TYPE(info) ((info) & 0xf)
-EXTERN_C_END
-
-#endif /* NATIVE_CLIENT_SRC_INCLUDE_ELF32_H_ */
diff --git a/ports/glibc-compat/include/elf64.h b/ports/glibc-compat/include/elf64.h
deleted file mode 100644
index 5195e93..0000000
--- a/ports/glibc-compat/include/elf64.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-/* @file
- *
- * Minimal ELF header declaration / constants for Elf32* values.
- * Constants are defined only for fields that are actualy
- * used. (Unused constants for used fields are include only for
- * "completeness", though of course in many cases there are more
- * values in use, e.g., the EM_* values for e_machine.)
- *
- * (Re)Created from the ELF specification at
- * http://x86.ddj.com/ftp/manuals/tools/elf.pdf which is referenced
- * from wikipedia article
- * http://en.wikipedia.org/wki/Executable_and_Linkable_Format
- */
-
-/*-
-* Copyright (c) 1996-1998 John D. Polstra.
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-*
-* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-* SUCH DAMAGE.
-*
-* $FreeBSD$
-*/
-#ifndef NATIVE_CLIENT_SRC_INCLUDE_ELF64_H_
-#define NATIVE_CLIENT_SRC_INCLUDE_ELF64_H_
-
-#include "elf_constants.h"
-
-/* Define 64-bit specific types */
-typedef uint64_t Elf64_Addr; /* alignment 8 */
-typedef uint64_t Elf64_Off; /* alignment 8 */
-typedef uint16_t Elf64_Half; /* alignment 2 */
-typedef uint32_t Elf64_Word; /* alignment 4 */
-typedef int32_t Elf64_Sword; /* alignment 4 */
-typedef uint64_t Elf64_Xword; /* alignment 8 */
-typedef int64_t Elf64_Sxword; /* alignment 8 */
-/* unsigned char, size 1, alignment 1 */
-
-/* Define the structure of the file header for 64 bits. */
-typedef struct {
- unsigned char e_ident[EI_NIDENT];
- Elf64_Half e_type;
- Elf64_Half e_machine;
- Elf64_Word e_version;
- Elf64_Addr e_entry;
- Elf64_Off e_phoff;
- Elf64_Off e_shoff;
- Elf64_Word e_flags;
- Elf64_Half e_ehsize;
- Elf64_Half e_phentsize;
- Elf64_Half e_phnum;
- Elf64_Half e_shentsize;
- Elf64_Half e_shnum;
- Elf64_Half e_shstrndx;
-} Elf64_Ehdr;
-
-/* Define the structure of a program header table for 64-bits. */
-typedef struct {
- Elf64_Word p_type;
- Elf64_Word p_flags;
- Elf64_Off p_offset;
- Elf64_Addr p_vaddr;
- Elf64_Addr p_paddr;
- Elf64_Xword p_filesz;
- Elf64_Xword p_memsz;
- Elf64_Xword p_align;
-} Elf64_Phdr;
-
-/* Define 64-bit section headers. */
-typedef struct {
- Elf64_Word sh_name;
- Elf64_Word sh_type;
- Elf64_Xword sh_flags;
- Elf64_Addr sh_addr;
- Elf64_Off sh_offset;
- Elf64_Xword sh_size;
- Elf64_Word sh_link;
- Elf64_Word sh_info;
- Elf64_Xword sh_addralign;
- Elf64_Xword sh_entsize;
-} Elf64_Shdr;
-
-typedef struct {
- Elf64_Sxword d_tag; /* Dynamic entry type */
- union {
- Elf64_Xword d_val; /* Integer value */
- Elf64_Addr d_ptr; /* Address value */
- } d_un;
-} Elf64_Dyn;
-
-/*
- 187 * Symbol table entries.
- 188 */
-
-typedef struct {
- Elf64_Word st_name; /* String table index of name. */
- unsigned char st_info; /* Type and binding information. */
- unsigned char st_other; /* Reserved (not used). */
- Elf64_Half st_shndx; /* Section index of symbol. */
- Elf64_Addr st_value; /* Symbol value. */
- Elf64_Xword st_size; /* Size of associated object. */
-} Elf64_Sym;
-
-#endif /* NATIVE_CLIENT_SRC_INCLUDE_ELF64_H_ */
diff --git a/ports/glibc-compat/include/elf_auxv.h b/ports/glibc-compat/include/elf_auxv.h
deleted file mode 100644
index 990632b..0000000
--- a/ports/glibc-compat/include/elf_auxv.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef NATIVE_CLIENT_SRC_INCLUDE_ELF_AUXV_H_
-#define NATIVE_CLIENT_SRC_INCLUDE_ELF_AUXV_H_ 1
-
-/*
- * This is only in a separate file from elf.h and elf_constants.h
- * because these two contains #ifs which depend on
- * architecture-specific #defines which are supplied by the build
- * system. These #defines are not normally set when building
- * untrusted code.
- */
-
-/* Keys for auxiliary vector (auxv). */
-#define AT_NULL 0 /* Terminating item in auxv array */
-#define AT_IGNORE 1 /* Entry should be ignored */
-#define AT_BASE 7 /* Base address of interpreter
- (overloaded for dynamic text start) */
-#define AT_ENTRY 9 /* Entry point of the executable */
-#define AT_SYSINFO 32 /* System call entry point */
-
-#endif
diff --git a/ports/glibc-compat/include/elf_constants.h b/ports/glibc-compat/include/elf_constants.h
deleted file mode 100644
index e2628d2..0000000
--- a/ports/glibc-compat/include/elf_constants.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-
-/* @file
- *
- * Defines common constants used in ELF files, used by elf32.h, elf64.h
- * and elf.h
- *
- * (Re)Created from the ELF specification at
- * http://x86.ddj.com/ftp/manuals/tools/elf.pdf which is referenced
- * from wikipedia article
- * http://en.wikipedia.org/wki/Executable_and_Linkable_Format
- */
-
-/*-
-* Copyright (c) 2000, 2001, 2008, 2011, David E. O'Brien
-* Copyright (c) 1998 John D. Polstra.
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-*
-* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-* SUCH DAMAGE.
-*
-* $FreeBSD$
-*/
-#ifndef NATIVE_CLIENT_SRC_INCLUDE_ELF_CONSTANTS_H_
-#define NATIVE_CLIENT_SRC_INCLUDE_ELF_CONSTANTS_H_
-
-/*
- * This code is duplicated from nacl_base.h, in order to avoid
- * unnecessary definitions.
- */
-
-/*
- * putting extern "C" { } in header files make emacs want to indent
- * everything, which looks odd. rather than putting in fancy syntax
- * recognition in c-mode, we just use the following macros.
- *
- * TODO: before releasing code, we should provide a defintion of a
- * function to be called from c-mode-hook that will make it easy to
- * follow our coding style (which we also need to document).
- */
-#ifdef __cplusplus
-# define EXTERN_C_BEGIN extern "C" {
-# define EXTERN_C_END }
-# if !defined(DISALLOW_COPY_AND_ASSIGN)
-/*
- * This code is duplicated from base/basictypes.h, but including
- * that code should not be done except when building as part of Chrome.
- * Removing inclusion was necessitated by the fact that base/basictypes.h
- * sometimes defines CHECK, which conflicts with the NaCl definition.
- * Unfortunately this causes an include order dependency (this file has to
- * come after base/basictypes.h).
- * TODO(sehr): change CHECK to NACL_CHECK everywhere and remove this definition.
- */
-# define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
-#endif /* !defined(DISALLOW_COPY_AND_ASSIGN) */
-
-/* Mark this function as not throwing beyond */
-# define NO_THROW throw()
-#else
-# define EXTERN_C_BEGIN
-# define EXTERN_C_END
-# define NO_THROW
-#endif
-
-/*
- * This is necessary to make "#if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86" work.
- * #if-directives can work only with numerical values but not with strings e.g.
- * "NACL_x86"; therefore, we convert strings into integers. Whenever you use
- * NACL_ARCH or NACL_arm, you need to include this header.
- */
-#define NACL_MERGE(x, y) x ## y
-#define NACL_ARCH(x) NACL_MERGE(NACL_, x)
-
-
-EXTERN_C_BEGIN
-
-#define EI_NIDENT 16 /* fwd, see rest of EI_* below */
-
-#define ET_NONE 0 /* no file type */
-#define ET_REL 1 /* relocatable file */
-#define ET_EXEC 2 /* executable file */
-#define ET_DYN 3 /* shared object file */
-#define ET_CORE 4 /* core file */
-/* TODO(karl) figure out effect of adding ET_LOOS through ET_HIOS */
-#define ET_LOOS 0xfe00 /* Environment-specific */
-#define ET_HIOS 0xfeff /* Environment-specific */
-#define ET_LOPROC 0xff00 /* processor-specific */
-#define ET_HIPROC 0xffff /* processor-specific */
-
-#define EM_NONE 0 /* no machine */
-#define EM_M32 1 /* at&t we 32100 */
-#define EM_SPARC 2 /* sparc */
-#define EM_386 3 /* intel architecture */
-#define EM_68K 4 /* motorola 68000 */
-#define EM_88K 5 /* motorola 88000 */
-#define EM_860 7 /* intel 80860 */
-#define EM_MIPS 8 /* mips rs3000 */
-#define EM_MIPS_RS4_BE 10 /* mips rs4000 big-endian */
-#define EM_LORESERVED 11
-#define EM_HIRESERVED 16
-#define EM_ARM 40 /* arm */
-#define EM_X86_64 62 /* x86-64 */
-
-#define EV_NONE 0 /* invalid version */
-#define EV_CURRENT 1 /* current version */
-
-#define EI_MAG0 0 /* file identification */
-#define EI_MAG1 1 /* file identification */
-#define EI_MAG2 2 /* file identification */
-#define EI_MAG3 3 /* file identification */
-#define EI_CLASS 4 /* file class */
-#define EI_DATA 5 /* data encoding */
-#define EI_VERSION 6 /* file version */
-/*
- * EI_PAD deviates from the pdf specification, where its value is 7, since
- * EI_OSABI and EI_ABIVERSION have been introduced. EI_OSABI and
- * EI_OSABIVERSION are from linux elf.h for code usage compatibility.
- * Also, for Elf 64, the value for EI_PAD is also 9.
- */
-#define EI_PAD 9 /* start of padding bytes */
-
-#define EI_OSABI 7
-#define EI_ABIVERSION 8
-
-/*
- * ELFMAG and SELFMAG are names/values from linux elf.h, for code usage
- * compatibility.
- */
-#define ELFMAG0 0x7f
-#define ELFMAG1 'E'
-#define ELFMAG2 'L'
-#define ELFMAG3 'F'
-#define ELFMAG "\177ELF"
-#define SELFMAG 4
-
-/* EI_CLASS values */
-#define ELFCLASSNONE 0
-#define ELFCLASS32 1
-#define ELFCLASS64 2
-
-/* EI_DATA values */
-#define ELFDATANONE 0
-#define ELFDATA2LSB 1
-#define ELFDATA2MSB 2
-
-#define PT_NULL 0 /* Unused entry */
-#define PT_LOAD 1 /* Loadable segment */
-#define PT_DYNAMIC 2 /* Dynamic linking tables */
-#define PT_INTERP 3 /* Program interpreter path name */
-#define PT_NOTE 4 /* Note section */
-#define PT_SHLIB 5 /* Reserved */
-#define PT_PHDR 6 /* Program header table */
-#define PT_LOOS 0x60000000 /* Environment-specific low */
-#define PT_HIOS 0x6fffffff /* Environment-specific high */
-#define PT_LOPROC 0x70000000 /* Processor-specific low */
-#if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm
-#define PT_ARM_EXIDX 0x70000001 /* Exception unwind tables */
-#endif
-#if NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips
-#define PT_MIPS_REGINFO 0x70000000 /* Register usage, MIPS only, unused */
-#endif
-#define PT_HIPROC 0x7fffffff /* Processor-specific high */
-/*
- * These are from linux elf.h, for code usage
- * compatibility.
- */
-#define PT_TLS 7
-#define PT_GNU_STACK 0x6474e551
-#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
-#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
-
-
-#define PF_X 1
-#define PF_W 2
-#define PF_R 4
-/*
- * PF_MASKOS is from linux elf.h, for code usage compatibility
- */
-#define PF_MASKOS 0x0ff00000 /* os specific */
-
-#define SHF_WRITE 0x1 /* Has writable data */
-#define SHF_ALLOC 0x2 /* Allocated in memory image of program */
-#define SHF_EXECINSTR 0x4 /* Contains executable instructions */
-#define SHF_MASKOS 0x0f000000 /* Environment-specific use */
-#define SHF_MASKPROC 0xf0000000 /* Processor-specific use */
-
-/* Special section indexes. */
-#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */
-#define SHN_ABS 0xfff1 /* Absolute values. */
-#define SHN_COMMON 0xfff2 /* Common data. */
-
-/* sh_type */
-#define SHT_PROGBITS 1 /* program defined information */
-#define SHT_SYMTAB 2 /* symbol table section */
-#define SHT_NOBITS 8 /* no space section */
-
-/* Symbol Binding - ELFNN_ST_BIND - st_info */
-#define STB_LOCAL 0 /* Local symbol */
-#define STB_GLOBAL 1 /* Global symbol */
-#define STB_WEAK 2 /* like global - lower precedence */
-
-/* Symbol type - ELFNN_ST_TYPE - st_info */
-#define STT_FILE 4 /* Source file. */
-
-#define DT_NULL 0
-#define DT_NEEDED 1
-#define DT_PLTRELSZ 2
-#define DT_PLTGOT 3
-#define DT_HASH 4
-#define DT_STRTAB 5
-#define DT_SYMTAB 6
-#define DT_RELA 7
-#define DT_RELASZ 8
-#define DT_RELAENT 9
-#define DT_STRSZ 10
-#define DT_SYMENT 11
-#define DT_INIT 12
-#define DT_FINI 13
-#define DT_SONAME 14
-#define DT_RPATH 15
-#define DT_SYMBOLIC 16
-#define DT_REL 17
-#define DT_RELSZ 18
-#define DT_RELENT 19
-#define DT_PLTREL 20
-#define DT_DEBUG 21
-#define DT_TEXTREL 22
-#define DT_JMPREL 23
-#define DT_BIND_NOW 24
-#define DT_LOPROC 0x70000000
-#define DT_HIPROC 0x7fffffff
-
-#define ELF_NOTE_GNU "GNU"
-
-/* n_type value for build ID notes generated by "ld --build-id". */
-#define NT_GNU_BUILD_ID 3
-
-#define R_386_RELATIVE 8
-#define R_ARM_RELATIVE 23
-
-EXTERN_C_END
-
-#endif /* NATIVE_CLIENT_SRC_INCLUDE_ELF_CONSTANTS_H_ */
diff --git a/ports/glibc-compat/include/endian.h b/ports/glibc-compat/include/endian.h
deleted file mode 100644
index a2ea0c7..0000000
--- a/ports/glibc-compat/include/endian.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-#ifndef GLIBCEMU_ENDIAN_H
-#define GLIBCEMU_ENDIAN_H 1
-
-#include <machine/endian.h>
-
-#endif
diff --git a/ports/glibc-compat/include/err.h b/ports/glibc-compat/include/err.h
deleted file mode 100644
index 7453238..0000000
--- a/ports/glibc-compat/include/err.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)err.h 8.1 (Berkeley) 6/2/93
- * $FreeBSD: release/10.1.0/include/err.h 203964 2010-02-16 19:39:50Z imp $
- */
-
-#ifndef _ERR_H_
-#define _ERR_H_
-
-/*
- * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two
- * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
- * of them here we may collide with the utility's includes. It's unreasonable
- * for utilities to have to include one of them to include err.h, so we get
- * __va_list from <sys/_types.h> and use it.
- */
-#include <sys/cdefs.h>
-#include <sys/_types.h>
-#define __need___va_list
-#include <stdarg.h>
-#define __dead2 __attribute__((__noreturn__))
-
-__BEGIN_DECLS
-void err(int, const char *, ...) __dead2 __printf0like(2, 3);
-void verr(int, const char *, __gnuc_va_list) __dead2 __printf0like(2, 0);
-void errc(int, int, const char *, ...) __dead2 __printf0like(3, 4);
-void verrc(int, int, const char *, __gnuc_va_list) __dead2
- __printf0like(3, 0);
-void errx(int, const char *, ...) __dead2 __printf0like(2, 3);
-void verrx(int, const char *, __gnuc_va_list) __dead2 __printf0like(2, 0);
-void warn(const char *, ...) __printf0like(1, 2);
-void vwarn(const char *, __gnuc_va_list) __printf0like(1, 0);
-void warnc(int, const char *, ...) __printf0like(2, 3);
-void vwarnc(int, const char *, __gnuc_va_list) __printf0like(2, 0);
-void warnx(const char *, ...) __printflike(1, 2);
-void vwarnx(const char *, __gnuc_va_list) __printflike(1, 0);
-void err_set_file(void *);
-void err_set_exit(void (*)(int));
-__END_DECLS
-
-#endif /* !_ERR_H_ */
diff --git a/ports/glibc-compat/include/fcntl.h b/ports/glibc-compat/include/fcntl.h
deleted file mode 100644
index 96f7658..0000000
--- a/ports/glibc-compat/include/fcntl.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#ifndef GLIBCEMU_FCNTL_H
-#define GLIBCEMU_FCNTL_H 1
-
-#define O_NOCTTY 0400
-
-#include_next <fcntl.h>
-
-#endif
diff --git a/ports/glibc-compat/include/fts.h b/ports/glibc-compat/include/fts.h
deleted file mode 100644
index a755ac3..0000000
--- a/ports/glibc-compat/include/fts.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)fts.h 8.3 (Berkeley) 8/14/94
- * $FreeBSD: release/10.1.0/include/fts.h 250887 2013-05-21 21:20:10Z ed $
- */
-
-#ifndef _FTS_H_
-#define _FTS_H_
-
-#include <sys/types.h>
-
-typedef struct {
- struct _ftsent *fts_cur; /* current node */
- struct _ftsent *fts_child; /* linked list of children */
- struct _ftsent **fts_array; /* sort array */
- __dev_t fts_dev; /* starting device # */
- char *fts_path; /* path for this descent */
- int fts_rfd; /* fd for root */
- size_t fts_pathlen; /* sizeof(path) */
- size_t fts_nitems; /* elements in the sort array */
- int (*fts_compar) /* compare function */
- (const struct _ftsent * const *, const struct _ftsent * const *);
-
-#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
-#define FTS_LOGICAL 0x002 /* logical walk */
-#define FTS_NOCHDIR 0x004 /* don't change directories */
-#define FTS_NOSTAT 0x008 /* don't get stat info */
-#define FTS_PHYSICAL 0x010 /* physical walk */
-#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
-#define FTS_XDEV 0x040 /* don't cross devices */
-#define FTS_WHITEOUT 0x080 /* return whiteout information */
-#define FTS_OPTIONMASK 0x0ff /* valid user option mask */
-
-#define FTS_NAMEONLY 0x100 /* (private) child names only */
-#define FTS_STOP 0x200 /* (private) unrecoverable error */
- int fts_options; /* fts_open options, global flags */
- void *fts_clientptr; /* thunk for sort function */
-} FTS;
-
-typedef struct _ftsent {
- struct _ftsent *fts_cycle; /* cycle node */
- struct _ftsent *fts_parent; /* parent directory */
- struct _ftsent *fts_link; /* next file in directory */
- long long fts_number; /* local numeric value */
-#define fts_bignum fts_number /* XXX non-std, should go away */
- void *fts_pointer; /* local address value */
- char *fts_accpath; /* access path */
- char *fts_path; /* root path */
- int fts_errno; /* errno for this node */
- int fts_symfd; /* fd for symlink */
- size_t fts_pathlen; /* strlen(fts_path) */
- size_t fts_namelen; /* strlen(fts_name) */
-
- __ino_t fts_ino; /* inode */
- __dev_t fts_dev; /* device */
- __nlink_t fts_nlink; /* link count */
-
-#define FTS_ROOTPARENTLEVEL -1
-#define FTS_ROOTLEVEL 0
- long fts_level; /* depth (-1 to N) */
-
-#define FTS_D 1 /* preorder directory */
-#define FTS_DC 2 /* directory that causes cycles */
-#define FTS_DEFAULT 3 /* none of the above */
-#define FTS_DNR 4 /* unreadable directory */
-#define FTS_DOT 5 /* dot or dot-dot */
-#define FTS_DP 6 /* postorder directory */
-#define FTS_ERR 7 /* error; errno is set */
-#define FTS_F 8 /* regular file */
-#define FTS_INIT 9 /* initialized only */
-#define FTS_NS 10 /* stat(2) failed */
-#define FTS_NSOK 11 /* no stat(2) requested */
-#define FTS_SL 12 /* symbolic link */
-#define FTS_SLNONE 13 /* symbolic link without target */
-#define FTS_W 14 /* whiteout object */
- int fts_info; /* user status for FTSENT structure */
-
-#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
-#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
-#define FTS_ISW 0x04 /* this is a whiteout object */
- unsigned fts_flags; /* private flags for FTSENT structure */
-
-#define FTS_AGAIN 1 /* read node again */
-#define FTS_FOLLOW 2 /* follow symbolic link */
-#define FTS_NOINSTR 3 /* no instructions */
-#define FTS_SKIP 4 /* discard node */
- int fts_instr; /* fts_set() instructions */
-
- struct stat *fts_statp; /* stat(2) information */
- char *fts_name; /* file name */
- FTS *fts_fts; /* back pointer to main FTS */
-} FTSENT;
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-FTSENT *fts_children(FTS *, int);
-int fts_close(FTS *);
-void *fts_get_clientptr(FTS *);
-#define fts_get_clientptr(fts) ((fts)->fts_clientptr)
-FTS *fts_get_stream(FTSENT *);
-#define fts_get_stream(ftsent) ((ftsent)->fts_fts)
-FTS *fts_open(char * const *, int,
- int (*)(const FTSENT * const *, const FTSENT * const *));
-FTSENT *fts_read(FTS *);
-int fts_set(FTS *, FTSENT *, int);
-void fts_set_clientptr(FTS *, void *);
-__END_DECLS
-
-#endif /* !_FTS_H_ */
diff --git a/ports/glibc-compat/include/machine/ansi.h b/ports/glibc-compat/include/machine/ansi.h
deleted file mode 100644
index 737b6d0..0000000
--- a/ports/glibc-compat/include/machine/ansi.h
+++ /dev/null
@@ -1 +0,0 @@
-/* dummy header file to support BSD compiler */
diff --git a/ports/glibc-compat/include/machine/setjmp.h b/ports/glibc-compat/include/machine/setjmp.h
deleted file mode 100644
index 6bddab9..0000000
--- a/ports/glibc-compat/include/machine/setjmp.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_MACHINE_SETJMP_H
-#define GLIBCEMU_MACHINE_SETJMP_H 1
-
-/*
- * Includes the newlib version of machine/setjmp.h but define __rtems__
- * so that sigjmp_buf is defined.
- * TODO(sbc): remove this file once newlib's setjmp.h is updated
- *
- * Undefine _POSIX_THREADS so that pthread_sigmask is not used.
- * TODO(sbc): remove this once pthread_sigmask exists in libnacl:
- * https://codereview.chromium.org/642873002/
- */
-
-#include <sys/types.h>
-#include <sys/signal.h>
-#undef _POSIX_THREADS
-#define __rtems__
-#include_next <machine/setjmp.h>
-#undef __rtems__
-#define _POSIX_THREADS
-
-#endif
diff --git a/ports/glibc-compat/include/memory.h b/ports/glibc-compat/include/memory.h
deleted file mode 100644
index 41fdf7a..0000000
--- a/ports/glibc-compat/include/memory.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef GLIBCEMU_MEMORY_H
-#define GLIBCEMU_MEMORY_H 1
-
-# include <string.h>
-
-#endif
-
diff --git a/ports/glibc-compat/include/mntent.h b/ports/glibc-compat/include/mntent.h
deleted file mode 100644
index 9e2c51b..0000000
--- a/ports/glibc-compat/include/mntent.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_MNTENT_H
-#define GLIBCEMU_MNTENT_H 1
-
-#include <stdio.h>
-#include <sys/cdefs.h>
-
-#define MNTOPT_DEFAULTS "defaults" /* Use all default options. */
-#define MNTOPT_RO "ro" /* Read only. */
-#define MNTOPT_RW "rw" /* Read/write. */
-#define MNTOPT_SUID "suid" /* Set uid allowed. */
-#define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */
-#define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */
-
-struct mntent {
- char *mnt_fsname;
- char *mnt_dir;
- char *mnt_type;
- char *mnt_opts;
- int mnt_freq;
- int mnt_passno;
-};
-
-__BEGIN_DECLS
-
-FILE *setmntent(const char *filename, const char *type);
-
-struct mntent *getmntent(FILE *fp);
-
-int addmntent(FILE *fp, const struct mntent *mnt);
-
-int endmntent(FILE *fp);
-
-char *hasmntopt(const struct mntent *mnt, const char *opt);
-
-__END_DECLS
-
-#endif
diff --git a/ports/glibc-compat/include/net/if.h b/ports/glibc-compat/include/net/if.h
deleted file mode 100644
index 5671b11..0000000
--- a/ports/glibc-compat/include/net/if.h
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)if.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/net/if.h,v 1.71 2002/03/19 21:54:16 alfred Exp $
- */
-
-#ifndef _NET_IF_H_
-#define _NET_IF_H_
-
-#include <sys/queue.h>
-#include <sys/socket.h>
-
-/*
- * <net/if.h> does not depend on <sys/time.h> on most other systems. This
- * helps userland compatibility. (struct timeval ifi_lastchange)
- */
-#ifndef _KERNEL
-#include <sys/time.h>
-#endif
-
-struct ifnet;
-
-/*
- * Length of interface external name, including terminating '\0'.
- * Note: this is the same size as a generic device's external name.
- */
-#define IFNAMSIZ 16
-#define IF_NAMESIZE IFNAMSIZ
-#define IF_MAXUNIT 0x7fff /* ifp->if_unit is only 15 bits */
-
-/*
- * Structure describing a `cloning' interface.
- */
-struct if_clone {
- LIST_ENTRY(if_clone) ifc_list; /* on list of cloners */
- const char *ifc_name; /* name of device, e.g. `gif' */
- size_t ifc_namelen; /* length of name */
- int ifc_maxunit; /* maximum unit number */
- unsigned char *ifc_units; /* bitmap to handle units */
- int ifc_bmlen; /* bitmap length */
-
- int (*ifc_create)(struct if_clone *, int);
- int (*ifc_destroy)(struct ifnet *);
-};
-
-#define IF_CLONE_INITIALIZER(name, create, destroy, maxunit) \
- { { 0 }, name, sizeof(name) - 1, maxunit, NULL, 0, create, destroy }
-
-/*
- * Structure used to query names of interface cloners.
- */
-
-struct if_clonereq {
- int ifcr_total; /* total cloners (out) */
- int ifcr_count; /* room for this many in user buffer */
- char *ifcr_buffer; /* buffer for cloner names */
-};
-
-/*
- * Structure describing information about an interface
- * which may be of interest to management entities.
- */
-struct if_data {
- /* generic interface information */
- u_char ifi_type; /* ethernet, tokenring, etc */
- u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
- u_char ifi_addrlen; /* media address length */
- u_char ifi_hdrlen; /* media header length */
- u_char ifi_recvquota; /* polling quota for receive intrs */
- u_char ifi_xmitquota; /* polling quota for xmit intrs */
- u_long ifi_mtu; /* maximum transmission unit */
- u_long ifi_metric; /* routing metric (external only) */
- u_long ifi_baudrate; /* linespeed */
- /* volatile statistics */
- u_long ifi_ipackets; /* packets received on interface */
- u_long ifi_ierrors; /* input errors on interface */
- u_long ifi_opackets; /* packets sent on interface */
- u_long ifi_oerrors; /* output errors on interface */
- u_long ifi_collisions; /* collisions on csma interfaces */
- u_long ifi_ibytes; /* total number of octets received */
- u_long ifi_obytes; /* total number of octets sent */
- u_long ifi_imcasts; /* packets received via multicast */
- u_long ifi_omcasts; /* packets sent via multicast */
- u_long ifi_iqdrops; /* dropped on input, this interface */
- u_long ifi_noproto; /* destined for unsupported protocol */
- u_long ifi_hwassist; /* HW offload capabilities */
- u_long ifi_unused; /* XXX was ifi_xmittiming */
- struct timeval ifi_lastchange; /* time of last administrative change */
-};
-
-#define IFF_UP 0x1 /* interface is up */
-#define IFF_BROADCAST 0x2 /* broadcast address valid */
-#define IFF_DEBUG 0x4 /* turn on debugging */
-#define IFF_LOOPBACK 0x8 /* is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
-#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
-#define IFF_RUNNING 0x40 /* resources allocated */
-#define IFF_NOARP 0x80 /* no address resolution protocol */
-#define IFF_PROMISC 0x100 /* receive all packets */
-#define IFF_ALLMULTI 0x200 /* receive all multicast packets */
-#define IFF_OACTIVE 0x400 /* transmission in progress */
-#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
-#define IFF_LINK0 0x1000 /* per link layer defined bit */
-#define IFF_LINK1 0x2000 /* per link layer defined bit */
-#define IFF_LINK2 0x4000 /* per link layer defined bit */
-#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
-#define IFF_MULTICAST 0x8000 /* supports multicast */
-
-/*
- * The following flag(s) ought to go in if_flags, but we cannot change
- * struct ifnet because of binary compatibility, so we store them in
- * if_ipending, which is not used so far.
- * If possible, make sure the value is not conflicting with other
- * IFF flags, so we have an easier time when we want to merge them.
- */
-#define IFF_POLLING 0x10000 /* Interface is in polling mode. */
-
-/* flags set internally only: */
-#define IFF_CANTCHANGE \
- (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
- IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_NOTRAILERS)
-
-/* Capabilities that interfaces can advertise. */
-#define IFCAP_RXCSUM 0x0001 /* can offload checksum on RX */
-#define IFCAP_TXCSUM 0x0002 /* can offload checksum on TX */
-#define IFCAP_NETCONS 0x0004 /* can be a network console */
-
-#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
-
-#define IFQ_MAXLEN 50
-#define IFNET_SLOWHZ 1 /* granularity is 1 second */
-
-/*
- * Message format for use in obtaining information about interfaces
- * from getkerninfo and the routing socket
- */
-struct if_msghdr {
- u_short ifm_msglen; /* to skip over non-understood messages */
- u_char ifm_version; /* future binary compatibility */
- u_char ifm_type; /* message type */
- int ifm_addrs; /* like rtm_addrs */
- int ifm_flags; /* value of if_flags */
- u_short ifm_index; /* index for associated ifp */
- struct if_data ifm_data;/* statistics and other data about if */
-};
-
-/*
- * Message format for use in obtaining information about interface addresses
- * from getkerninfo and the routing socket
- */
-struct ifa_msghdr {
- u_short ifam_msglen; /* to skip over non-understood messages */
- u_char ifam_version; /* future binary compatibility */
- u_char ifam_type; /* message type */
- int ifam_addrs; /* like rtm_addrs */
- int ifam_flags; /* value of ifa_flags */
- u_short ifam_index; /* index for associated ifp */
- int ifam_metric; /* value of ifa_metric */
-};
-
-/*
- * Message format for use in obtaining information about multicast addresses
- * from the routing socket
- */
-struct ifma_msghdr {
- u_short ifmam_msglen; /* to skip over non-understood messages */
- u_char ifmam_version; /* future binary compatibility */
- u_char ifmam_type; /* message type */
- int ifmam_addrs; /* like rtm_addrs */
- int ifmam_flags; /* value of ifa_flags */
- u_short ifmam_index; /* index for associated ifp */
-};
-
-/*
- * Message format announcing the arrival or departure of a network interface.
- */
-struct if_announcemsghdr {
- u_short ifan_msglen; /* to skip over non-understood messages */
- u_char ifan_version; /* future binary compatibility */
- u_char ifan_type; /* message type */
- u_short ifan_index; /* index for associated ifp */
- char ifan_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- u_short ifan_what; /* what type of announcement */
-};
-
-#define IFAN_ARRIVAL 0 /* interface arrival */
-#define IFAN_DEPARTURE 1 /* interface departure */
-
-/*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
-struct ifreq {
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- struct sockaddr ifru_netmask;
- short ifru_flags[2];
- short ifru_index;
- int ifru_metric;
- int ifru_mtu;
- int ifru_phys;
- int ifru_media;
- caddr_t ifru_data;
- int ifru_cap[2];
- } ifr_ifru;
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
-#define ifr_flags ifr_ifru.ifru_flags[0] /* flags */
-#define ifr_prevflags ifr_ifru.ifru_flags[1] /* flags */
-#define ifr_metric ifr_ifru.ifru_metric /* metric */
-#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
-#define ifr_media ifr_ifru.ifru_media /* physical media */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-#define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */
-#define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */
-#define ifr_index ifr_ifru.ifru_index /* interface index */
-};
-
-struct ifaliasreq {
- char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr ifra_addr;
- struct sockaddr ifra_broadaddr;
- struct sockaddr ifra_mask;
-};
-
-struct ifmediareq {
- char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- int ifm_current; /* current media options */
- int ifm_mask; /* don't care mask */
- int ifm_status; /* media status */
- int ifm_active; /* active options */
- int ifm_count; /* # entries in ifm_ulist array */
- int *ifm_ulist; /* media words */
-};
-
-/*
- * Structure used to retrieve aux status data from interfaces.
- * Kernel suppliers to this interface should respect the formatting
- * needed by ifconfig(8): each line starts with a TAB and ends with
- * a newline. The canonical example to copy and paste is in if_tun.c.
- */
-
-#define IFSTATMAX 800 /* 10 lines of text */
-struct ifstat {
- char ifs_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- char ascii[IFSTATMAX + 1];
-};
-
-/*
- * Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
-struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
-};
-
-
-/*
- * Structure for SIOC[AGD]LIFADDR
- */
-struct if_laddrreq {
- char iflr_name[IFNAMSIZ];
- u_int flags;
-#define IFLR_PREFIX 0x8000 /* in: prefix given out: kernel fills id */
- u_int prefixlen; /* in/out */
- struct sockaddr_storage addr; /* in/out */
- struct sockaddr_storage dstaddr; /* out */
-};
-
-#ifdef _KERNEL
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_IFADDR);
-MALLOC_DECLARE(M_IFMADDR);
-#endif
-#endif
-
-#ifndef _KERNEL
-struct if_nameindex {
- u_int if_index; /* 1, 2, ... */
- char *if_name; /* null terminated name: "le0", ... */
-};
-
-__BEGIN_DECLS
-u_int if_nametoindex(const char *);
-char *if_indextoname(u_int, char *);
-struct if_nameindex *if_nameindex(void);
-void if_freenameindex(struct if_nameindex *);
-__END_DECLS
-#endif
-
-#ifdef _KERNEL
-struct thread;
-
-/* XXX - this should go away soon. */
-#include <net/if_var.h>
-#endif
-
-#endif /* !_NET_IF_H_ */
diff --git a/ports/glibc-compat/include/netdb.h b/ports/glibc-compat/include/netdb.h
deleted file mode 100644
index 89e82ae..0000000
--- a/ports/glibc-compat/include/netdb.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_NETDB_H
-#define GLIBCEMU_NETDB_H 1
-
-/* Redirect incorrect declarations to an alternate name. */
-#define getaddrinfo getaddrinfo_wrong
-#define getnameinfo getnameinfo_wrong
-/* Redirect h_addr to an alternate name to keep the struct correctly sized. */
-#ifdef h_addr
-# undef h_addr
-#endif
-#define h_addr h_addr_pad
-
-#include_next <netdb.h>
-
-/* Remove all the macros we added. */
-#undef getaddrinfo
-#undef getnameinfo
-#undef h_addr
-/* Defined h_addr as in glibc. */
-#define h_addr h_addr_list[0]
-
-__BEGIN_DECLS
-
-void herror(const char *);
-const char *hstrerror(int);
-
-/* Declare these two correctly. */
-int getaddrinfo(const char *, const char *,
- const struct addrinfo *, struct addrinfo **);
-int getnameinfo(const struct sockaddr *, socklen_t, char *,
- socklen_t, char *, socklen_t, unsigned int);
-
-__END_DECLS
-
-#endif /* GLIBCEMU_NETDB_H */
diff --git a/ports/glibc-compat/include/netinet/in_systm.h b/ports/glibc-compat/include/netinet/in_systm.h
deleted file mode 100644
index 62cea64..0000000
--- a/ports/glibc-compat/include/netinet/in_systm.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)in_systm.h 8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/netinet/in_systm.h,v 1.10 2002/03/19 21:25:46 alfred Exp $
- */
-
-#ifndef _NETINET_IN_SYSTM_H_
-#define _NETINET_IN_SYSTM_H_
-
-/*
- * Miscellaneous internetwork
- * definitions for kernel.
- */
-
-/*
- * Network types.
- *
- * Internally the system keeps counters in the headers with the bytes
- * swapped so that VAX instructions will work on them. It reverses
- * the bytes before transmission at each protocol level. The n_ types
- * represent the types with the bytes in ``high-ender'' order.
- */
-typedef u_int16_t n_short; /* short as received from the net */
-typedef u_int32_t n_long; /* long as received from the net */
-
-typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
-
-#ifdef _KERNEL
-n_time iptime(void);
-#endif
-
-#endif
diff --git a/ports/glibc-compat/include/netinet/ip.h b/ports/glibc-compat/include/netinet/ip.h
deleted file mode 100644
index 2b2bcb8..0000000
--- a/ports/glibc-compat/include/netinet/ip.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ip.h 8.2 (Berkeley) 6/1/94
- * $FreeBSD: src/sys/netinet/ip.h,v 1.19 2001/12/14 19:37:32 rwatson Exp $
- */
-
-#ifndef _NETINET_IP_H_
-#define _NETINET_IP_H_
-
-#include <netinet/in_systm.h>
-
-/*
- * Definitions for internet protocol version 4.
- * Per RFC 791, September 1981.
- */
-#define IPVERSION 4
-
-/*
- * Structure of an internet header, naked of options.
- */
-struct ip {
-#ifdef _IP_VHL
- u_char ip_vhl; /* version << 4 | header length >> 2 */
-#else
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_int ip_hl:4, /* header length */
- ip_v:4; /* version */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_int ip_v:4, /* version */
- ip_hl:4; /* header length */
-#endif
-#endif /* not _IP_VHL */
- u_char ip_tos; /* type of service */
- u_short ip_len; /* total length */
- u_short ip_id; /* identification */
- u_short ip_off; /* fragment offset field */
-#define IP_RF 0x8000 /* reserved fragment flag */
-#define IP_DF 0x4000 /* dont fragment flag */
-#define IP_MF 0x2000 /* more fragments flag */
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- u_char ip_ttl; /* time to live */
- u_char ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src,ip_dst; /* source and dest address */
-};
-
-#ifdef _IP_VHL
-#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))
-#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
-#define IP_VHL_V(vhl) ((vhl) >> 4)
-#define IP_VHL_BORING 0x45
-#endif
-
-#define IP_MAXPACKET 65535 /* maximum packet size */
-
-/*
- * Definitions for IP type of service (ip_tos)
- */
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
-/* ECN bits proposed by Sally Floyd */
-#define IPTOS_CE 0x01 /* congestion experienced */
-#define IPTOS_ECT 0x02 /* ECN-capable transport */
-
-
-/*
- * Definitions for IP precedence (also in ip_tos) (hopefully unused)
- */
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
-
-/*
- * Definitions for options.
- */
-#define IPOPT_COPIED(o) ((o)&0x80)
-#define IPOPT_CLASS(o) ((o)&0x60)
-#define IPOPT_NUMBER(o) ((o)&0x1f)
-
-#define IPOPT_CONTROL 0x00
-#define IPOPT_RESERVED1 0x20
-#define IPOPT_DEBMEAS 0x40
-#define IPOPT_RESERVED2 0x60
-
-#define IPOPT_EOL 0 /* end of option list */
-#define IPOPT_NOP 1 /* no operation */
-
-#define IPOPT_RR 7 /* record packet route */
-#define IPOPT_TS 68 /* timestamp */
-#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
-#define IPOPT_LSRR 131 /* loose source route */
-#define IPOPT_ESO 133 /* extended security */
-#define IPOPT_CIPSO 134 /* commerical security */
-#define IPOPT_SATID 136 /* satnet id */
-#define IPOPT_SSRR 137 /* strict source route */
-#define IPOPT_RA 148 /* router alert */
-
-/*
- * Offsets to fields in options other than EOL and NOP.
- */
-#define IPOPT_OPTVAL 0 /* option ID */
-#define IPOPT_OLEN 1 /* option length */
-#define IPOPT_OFFSET 2 /* offset within option */
-#define IPOPT_MINOFF 4 /* min value of above */
-
-/*
- * Time stamp option structure.
- */
-struct ip_timestamp {
- u_char ipt_code; /* IPOPT_TS */
- u_char ipt_len; /* size of structure (variable) */
- u_char ipt_ptr; /* index of current entry */
-#if BYTE_ORDER == LITTLE_ENDIAN
- u_int ipt_flg:4, /* flags, see below */
- ipt_oflw:4; /* overflow counter */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- u_int ipt_oflw:4, /* overflow counter */
- ipt_flg:4; /* flags, see below */
-#endif
- union ipt_timestamp {
- n_long ipt_time[1];
- struct ipt_ta {
- struct in_addr ipt_addr;
- n_long ipt_time;
- } ipt_ta[1];
- } ipt_timestamp;
-};
-
-/* flag bits for ipt_flg */
-#define IPOPT_TS_TSONLY 0 /* timestamps only */
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */
-
-/* bits for security (not byte swapped) */
-#define IPOPT_SECUR_UNCLASS 0x0000
-#define IPOPT_SECUR_CONFID 0xf135
-#define IPOPT_SECUR_EFTO 0x789a
-#define IPOPT_SECUR_MMMM 0xbc4d
-#define IPOPT_SECUR_RESTR 0xaf13
-#define IPOPT_SECUR_SECRET 0xd788
-#define IPOPT_SECUR_TOPSECRET 0x6bc5
-
-/*
- * Internet implementation parameters.
- */
-#define MAXTTL 255 /* maximum time to live (seconds) */
-#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
-#define IPFRAGTTL 60 /* time to live for frags, slowhz */
-#define IPTTLDEC 1 /* subtracted when forwarding */
-
-#define IP_MSS 576 /* default maximum segment size */
-
-#endif
diff --git a/ports/glibc-compat/include/netinet6/in6.h b/ports/glibc-compat/include/netinet6/in6.h
deleted file mode 100644
index 2c61c03..0000000
--- a/ports/glibc-compat/include/netinet6/in6.h
+++ /dev/null
@@ -1,646 +0,0 @@
-/* $FreeBSD: src/sys/netinet6/in6.h,v 1.19 2002/04/19 04:46:22 suz Exp $ */
-/* $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ */
-
-/*
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 1982, 1986, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)in.h 8.3 (Berkeley) 1/3/94
- */
-
-#ifndef __KAME_NETINET_IN_H_INCLUDED_
-#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"
-#endif
-
-#ifndef _NETINET6_IN6_H_
-#define _NETINET6_IN6_H_
-
-#include <sys/types.h>
-
-/*
- * Identification of the network protocol stack
- * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE
- * has the table of implementation/integration differences.
- */
-#define __KAME__
-#define __KAME_VERSION "20010528/FreeBSD"
-
-/*
- * Local port number conventions:
- *
- * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),
- * unless a kernel is compiled with IPNOPRIVPORTS defined.
- *
- * When a user does a bind(2) or connect(2) with a port number of zero,
- * a non-conflicting local port address is chosen.
- *
- * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
- * that is settable by sysctl(3); net.inet.ip.anonportmin and
- * net.inet.ip.anonportmax respectively.
- *
- * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
- * default assignment range.
- *
- * The value IP_PORTRANGE_DEFAULT causes the default behavior.
- *
- * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
- * and exists only for FreeBSD compatibility purposes.
- *
- * The value IP_PORTRANGE_LOW changes the range to the "low" are
- * that is (by convention) restricted to privileged processes.
- * This convention is based on "vouchsafe" principles only.
- * It is only secure if you trust the remote host to restrict these ports.
- * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
- */
-
-#define IPV6PORT_RESERVED 1024
-#define IPV6PORT_ANONMIN 49152
-#define IPV6PORT_ANONMAX 65535
-#define IPV6PORT_RESERVEDMIN 600
-#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1)
-
-/*
- * IPv6 address
- */
-struct in6_addr {
- union {
- uint8_t __u6_addr8[16];
- uint16_t __u6_addr16[8];
- uint32_t __u6_addr32[4];
- } __u6_addr; /* 128-bit IP6 address */
-};
-
-#define s6_addr __u6_addr.__u6_addr8
-#define s6_addr8 __u6_addr.__u6_addr8
-#define s6_addr16 __u6_addr.__u6_addr16
-#define s6_addr32 __u6_addr.__u6_addr32
-
-#define INET6_ADDRSTRLEN 46
-
-/*
- * Socket address for IPv6
- */
-struct sockaddr_in6 {
- uint8_t sin6_family; /* AF_INET6 (sa_family_t) */
- uint16_t sin6_port; /* Transport layer port # (in_port_t)*/
- uint32_t sin6_flowinfo; /* IP6 flow information */
- struct in6_addr sin6_addr; /* IP6 address */
- uint32_t sin6_scope_id; /* scope zone index */
-};
-
-/*
- * Local definition for masks
- */
-#ifdef _KERNEL /* XXX nonstandard */
-#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
-#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}
-#endif
-
-#ifdef _KERNEL
-extern const struct sockaddr_in6 sa6_any;
-
-extern const struct in6_addr in6mask0;
-extern const struct in6_addr in6mask32;
-extern const struct in6_addr in6mask64;
-extern const struct in6_addr in6mask96;
-extern const struct in6_addr in6mask128;
-#endif /* _KERNEL */
-
-/*
- * Macros started with IPV6_ADDR is KAME local
- */
-#ifdef _KERNEL /* XXX nonstandard */
-#if BYTE_ORDER == BIG_ENDIAN
-#define IPV6_ADDR_INT32_ONE 1
-#define IPV6_ADDR_INT32_TWO 2
-#define IPV6_ADDR_INT32_MNL 0xff010000
-#define IPV6_ADDR_INT32_MLL 0xff020000
-#define IPV6_ADDR_INT32_SMP 0x0000ffff
-#define IPV6_ADDR_INT16_ULL 0xfe80
-#define IPV6_ADDR_INT16_USL 0xfec0
-#define IPV6_ADDR_INT16_MLL 0xff02
-#elif BYTE_ORDER == LITTLE_ENDIAN
-#define IPV6_ADDR_INT32_ONE 0x01000000
-#define IPV6_ADDR_INT32_TWO 0x02000000
-#define IPV6_ADDR_INT32_MNL 0x000001ff
-#define IPV6_ADDR_INT32_MLL 0x000002ff
-#define IPV6_ADDR_INT32_SMP 0xffff0000
-#define IPV6_ADDR_INT16_ULL 0x80fe
-#define IPV6_ADDR_INT16_USL 0xc0fe
-#define IPV6_ADDR_INT16_MLL 0x02ff
-#endif
-#endif
-
-/*
- * Definition of some useful macros to handle IP6 addresses
- */
-#define IN6ADDR_ANY_INIT \
- {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6ADDR_LOOPBACK_INIT \
- {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
-#define IN6ADDR_NODELOCAL_ALLNODES_INIT \
- {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
-#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
- {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
-#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
- {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
-
-extern const struct in6_addr in6addr_any;
-extern const struct in6_addr in6addr_loopback;
-extern const struct in6_addr in6addr_nodelocal_allnodes;
-extern const struct in6_addr in6addr_linklocal_allnodes;
-extern const struct in6_addr in6addr_linklocal_allrouters;
-
-/*
- * Equality
- * NOTE: Some of kernel programming environment (for example, openbsd/sparc)
- * does not supply memcmp(). For userland memcmp() is preferred as it is
- * in ANSI standard.
- */
-#ifdef _KERNEL
-#define IN6_ARE_ADDR_EQUAL(a, b) \
- (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
-#else
-#define IN6_ARE_ADDR_EQUAL(a, b) \
- (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
-#endif
-
-#ifdef _KERNEL /* non standard */
-/* see if two addresses are equal in a scope-conscious manner. */
-#define SA6_ARE_ADDR_EQUAL(a, b) \
- (((a)->sin6_scope_id == 0 || (b)->sin6_scope_id == 0 || \
- ((a)->sin6_scope_id == (b)->sin6_scope_id)) && \
- (bcmp(&(a)->sin6_addr, &(b)->sin6_addr, sizeof(struct in6_addr)) == 0))
-#endif
-
-/*
- * Unspecified
- */
-#define IN6_IS_ADDR_UNSPECIFIED(a) \
- ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
-
-/*
- * Loopback
- */
-#define IN6_IS_ADDR_LOOPBACK(a) \
- ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
-
-/*
- * IPv4 compatible
- */
-#define IN6_IS_ADDR_V4COMPAT(a) \
- ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
-
-/*
- * Mapped
- */
-#define IN6_IS_ADDR_V4MAPPED(a) \
- ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
- (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
-
-/*
- * KAME Scope Values
- */
-
-#ifdef _KERNEL /* XXX nonstandard */
-#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
-#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
-#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
-#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
-#define IPV6_ADDR_SCOPE_GLOBAL 0x0e
-#else
-#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01
-#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02
-#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
-#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
-#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e
-#endif
-
-/*
- * Unicast Scope
- * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
- */
-#define IN6_IS_ADDR_LINKLOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
-#define IN6_IS_ADDR_SITELOCAL(a) \
- (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
-
-/*
- * Multicast
- */
-#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
-
-#ifdef _KERNEL /* XXX nonstandard */
-#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
-#else
-#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
-#endif
-
-/*
- * Multicast Scope
- */
-#ifdef _KERNEL /* refers nonstandard items */
-#define IN6_IS_ADDR_MC_NODELOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL))
-#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL))
-#define IN6_IS_ADDR_MC_SITELOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL))
-#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL))
-#define IN6_IS_ADDR_MC_GLOBAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL))
-#else
-#define IN6_IS_ADDR_MC_NODELOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL))
-#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL))
-#define IN6_IS_ADDR_MC_SITELOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
-#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
-#define IN6_IS_ADDR_MC_GLOBAL(a) \
- (IN6_IS_ADDR_MULTICAST(a) && \
- (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))
-#endif
-
-#ifdef _KERNEL /* nonstandard */
-/*
- * KAME Scope
- */
-#define IN6_IS_SCOPE_LINKLOCAL(a) \
- ((IN6_IS_ADDR_LINKLOCAL(a)) || \
- (IN6_IS_ADDR_MC_LINKLOCAL(a)))
-
-#define IFA6_IS_DEPRECATED(a) \
- ((a)->ia6_lifetime.ia6t_preferred != 0 && \
- (a)->ia6_lifetime.ia6t_preferred < time_second)
-#define IFA6_IS_INVALID(a) \
- ((a)->ia6_lifetime.ia6t_expire != 0 && \
- (a)->ia6_lifetime.ia6t_expire < time_second)
-#endif /* _KERNEL */
-
-/*
- * IP6 route structure
- */
-#ifndef _XOPEN_SOURCE
-struct route_in6 {
- struct rtentry *ro_rt;
- struct sockaddr_in6 ro_dst;
-};
-#endif
-
-/*
- * Options for use with [gs]etsockopt at the IPV6 level.
- * First word of comment is data type; bool is stored in int.
- */
-/* no hdrincl */
-#if 0 /* the followings are relic in IPv4 and hence are disabled */
-#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */
-#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */
-#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */
-#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */
-#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */
-#endif
-#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */
-#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */
-#define IPV6_MULTICAST_IF 9 /* u_char; set/get IP6 multicast i/f */
-#define IPV6_MULTICAST_HOPS 10 /* u_char; set/get IP6 multicast hops */
-#define IPV6_MULTICAST_LOOP 11 /* u_char; set/get IP6 multicast loopback */
-#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */
-#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */
-#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */
-#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */
-/* RFC2292 options */
-#define IPV6_PKTINFO 19 /* bool; send/recv if, src/dst addr */
-#define IPV6_HOPLIMIT 20 /* bool; hop limit */
-#define IPV6_NEXTHOP 21 /* bool; next hop addr */
-#define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */
-#define IPV6_DSTOPTS 23 /* bool; destination option */
-#define IPV6_RTHDR 24 /* bool; routing header */
-#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */
-
-#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */
-#define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */
-#ifndef _KERNEL
-#define IPV6_BINDV6ONLY IPV6_V6ONLY
-#endif
-
-#if 1 /* IPSEC */
-#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */
-#endif
-#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */
-
-#if 1 /* IPV6FIREWALL */
-#define IPV6_FW_ADD 30 /* add a firewall rule to chain */
-#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */
-#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */
-#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */
-#define IPV6_FW_GET 34 /* get entire firewall rule chain */
-#endif
-
-/* to define items, should talk with KAME guys first, for *BSD compatibility */
-
-#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */
-#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */
-#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */
-
-/*
- * Defaults and limits for options
- */
-#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */
-#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
-
-/*
- * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
- */
-struct ipv6_mreq {
- struct in6_addr ipv6mr_multiaddr;
- unsigned int ipv6mr_interface;
-};
-
-/*
- * IPV6_PKTINFO: Packet information(RFC2292 sec 5)
- */
-struct in6_pktinfo {
- struct in6_addr ipi6_addr; /* src/dst IPv6 address */
- unsigned int ipi6_ifindex; /* send/recv interface index */
-};
-
-/*
- * Argument for IPV6_PORTRANGE:
- * - which range to search when port is unspecified at bind() or connect()
- */
-#define IPV6_PORTRANGE_DEFAULT 0 /* default range */
-#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
-#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
-
-#ifndef _XOPEN_SOURCE
-/*
- * Definitions for inet6 sysctl operations.
- *
- * Third level is protocol number.
- * Fourth level is desired variable within that protocol.
- */
-#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */
-
-#define CTL_IPV6PROTO_NAMES { \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, \
- { "tcp6", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "udp6", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, \
- { "ip6", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, \
- { "ipsec6", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "icmp6", CTLTYPE_NODE }, \
- { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { 0, 0 }, \
- { "pim6", CTLTYPE_NODE }, \
-}
-
-/*
- * Names for IP sysctl objects
- */
-#define IPV6CTL_FORWARDING 1 /* act as router */
-#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/
-#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */
-#ifdef notyet
-#define IPV6CTL_DEFMTU 4 /* default MTU */
-#endif
-#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */
-#define IPV6CTL_STATS 6 /* stats */
-#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */
-#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */
-#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */
-#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */
-#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */
-#define IPV6CTL_ACCEPT_RTADV 12
-#define IPV6CTL_KEEPFAITH 13
-#define IPV6CTL_LOG_INTERVAL 14
-#define IPV6CTL_HDRNESTLIMIT 15
-#define IPV6CTL_DAD_COUNT 16
-#define IPV6CTL_AUTO_FLOWLABEL 17
-#define IPV6CTL_DEFMCASTHLIM 18
-#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */
-#define IPV6CTL_KAME_VERSION 20
-#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */
-#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */
-#if 0 /* obsolete */
-#define IPV6CTL_MAPPED_ADDR 23
-#endif
-#define IPV6CTL_V6ONLY 24
-#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */
-#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */
-#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */
-
-#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */
-#define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */
-#define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */
-#define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */
-#define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */
-
-/* New entries should be added here from current IPV6CTL_MAXID value. */
-/* to define items, should talk with KAME guys first, for *BSD compatibility */
-#define IPV6CTL_MAXID 37
-
-#endif /* !_XOPEN_SOURCE */
-
-/*
- * Redefinition of mbuf flags
- */
-#define M_AUTHIPHDR M_PROTO2
-#define M_DECRYPTED M_PROTO3
-#define M_LOOP M_PROTO4
-#define M_AUTHIPDGM M_PROTO5
-
-#ifdef _KERNEL
-struct cmsghdr;
-
-int in6_cksum __P((struct mbuf *, uint8_t, uint32_t, uint32_t));
-int in6_localaddr __P((struct in6_addr *));
-int in6_addrscope __P((struct in6_addr *));
-struct in6_ifaddr *in6_ifawithscope __P((struct ifnet *, struct in6_addr *));
-struct in6_ifaddr *in6_ifawithifp __P((struct ifnet *, struct in6_addr *));
-extern void in6_if_up __P((struct ifnet *));
-struct sockaddr;
-extern u_char ip6_protox[];
-
-void in6_sin6_2_sin __P((struct sockaddr_in *sin,
- struct sockaddr_in6 *sin6));
-void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *sin,
- struct sockaddr_in6 *sin6));
-void in6_sin6_2_sin_in_sock __P((struct sockaddr *nam));
-void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam));
-
-#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
-#define sin6tosa(sin6) ((struct sockaddr *)(sin6))
-#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
-
-extern int (*faithprefix_p)(struct in6_addr *);
-#endif /* _KERNEL */
-
-__BEGIN_DECLS
-struct cmsghdr;
-
-extern int inet6_option_space __P((int));
-extern int inet6_option_init __P((void *, struct cmsghdr **, int));
-extern int inet6_option_append __P((struct cmsghdr *, const uint8_t *,
- int, int));
-extern uint8_t *inet6_option_alloc __P((struct cmsghdr *, int, int, int));
-extern int inet6_option_next __P((const struct cmsghdr *, uint8_t **));
-extern int inet6_option_find __P((const struct cmsghdr *, uint8_t **, int));
-
-extern size_t inet6_rthdr_space __P((int, int));
-extern struct cmsghdr *inet6_rthdr_init __P((void *, int));
-extern int inet6_rthdr_add __P((struct cmsghdr *, const struct in6_addr *,
- unsigned int));
-extern int inet6_rthdr_lasthop __P((struct cmsghdr *, unsigned int));
-#if 0 /* not implemented yet */
-extern int inet6_rthdr_reverse __P((const struct cmsghdr *, struct cmsghdr *));
-#endif
-extern int inet6_rthdr_segments __P((const struct cmsghdr *));
-extern struct in6_addr *inet6_rthdr_getaddr __P((struct cmsghdr *, int));
-extern int inet6_rthdr_getflags __P((const struct cmsghdr *, int));
-
-extern int inet6_opt_init __P((void *, size_t));
-extern int inet6_opt_append __P((void *, size_t, int, uint8_t,
- size_t, uint8_t, void **));
-extern int inet6_opt_finish __P((void *, size_t, int));
-extern int inet6_opt_set_val __P((void *, size_t, void *, int));
-
-extern int inet6_opt_next __P((void *, size_t, int, uint8_t *,
- size_t *, void **));
-extern int inet6_opt_find __P((void *, size_t, int, uint8_t,
- size_t *, void **));
-extern int inet6_opt_get_val __P((void *, size_t, void *, int));
-extern size_t inet6_rth_space __P((int, int));
-extern void *inet6_rth_init __P((void *, int, int, int));
-extern int inet6_rth_add __P((void *, const struct in6_addr *));
-extern int inet6_rth_reverse __P((const void *, void *));
-extern int inet6_rth_segments __P((const void *));
-extern struct in6_addr *inet6_rth_getaddr __P((const void *, int));
-__END_DECLS
-
-#endif /* !_NETINET6_IN6_H_ */
diff --git a/ports/glibc-compat/include/nss.h b/ports/glibc-compat/include/nss.h
deleted file mode 100644
index e2ac4b9..0000000
--- a/ports/glibc-compat/include/nss.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef GLIBCEMU_NSS_H
-#define GLIBCEMU_NSS_H 1
-enum nss_status
-{
- NSS_STATUS_TRYAGAIN = -2,
- NSS_STATUS_UNAVAIL,
- NSS_STATUS_NOTFOUND,
- NSS_STATUS_SUCCESS,
- NSS_STATUS_RETURN
-};
-#endif
diff --git a/ports/glibc-compat/include/paths.h b/ports/glibc-compat/include/paths.h
deleted file mode 100644
index 34995c9..0000000
--- a/ports/glibc-compat/include/paths.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-#ifndef GLIBCEMU_PATHS_H
-#define GLIBCEMU_PATHS_H 1
-
-#include_next <paths.h>
-#define _PATH_TTY "/dev/tty"
-
-#endif /* GLIBCEMU_PATHS_H */
diff --git a/ports/glibc-compat/include/pthread.h b/ports/glibc-compat/include/pthread.h
deleted file mode 100644
index 1f77820..0000000
--- a/ports/glibc-compat/include/pthread.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-#ifndef GLIBCEMU_PTHREAD_H
-#define GLIBCEMU_PTHREAD_H
-
-#include_next <pthread.h>
-
-/* Newlib doesn't include a fallback for this call. */
-#define pthread_attr_setscope(x,y) (-1)
-
-#endif
diff --git a/ports/glibc-compat/include/resolv.h b/ports/glibc-compat/include/resolv.h
deleted file mode 100644
index 35db205..0000000
--- a/ports/glibc-compat/include/resolv.h
+++ /dev/null
@@ -1,392 +0,0 @@
-/*-
- * Copyright (c) 1983, 1987, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * From Id: resolv.h,v 8.12 1998/04/28 19:36:46 halley Exp $
- * $FreeBSD: src/include/resolv.h,v 1.21 2002/03/23 17:24:53 imp Exp $
- */
-
-#ifndef _RESOLV_H_
-#define _RESOLV_H_
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/cdefs.h>
-#include <sys/socket.h>
-#include <stdio.h>
-
-/*
- * Revision information. This is the release date in YYYYMMDD format.
- * It can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__RES > 19931104)". Do not
- * compare for equality; rather, use it to determine whether your resolver
- * is new enough to contain a certain feature.
- */
-
-#define __RES 19960801
-
-/*
- * Resolver configuration file.
- * Normally not present, but may contain the address of the
- * inital name server(s) to query and the domain search list.
- */
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-/*
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 3 /* max # name servers we'll track */
-#define MAXDFLSRCH 3 /* # default domain levels to try */
-#define MAXDNSRCH 6 /* max # domains in search path */
-#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
-
-#define RES_TIMEOUT 5 /* min. seconds between retries */
-#define MAXRESOLVSORT 10 /* number of net to sort on */
-#define RES_MAXNDOTS 15 /* should reflect bit field size */
-#define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */
-#define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */
-#define RES_DFLRETRY 2 /* Default #/tries. */
-#define RES_MAXTIME 65535 /* Infinity, in milliseconds. */
-
-
-typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
- res_sendhookact;
-typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns, const u_char **query,
- int *querylen,
- u_char *ans,
- int anssiz,
- int *resplen);
-
-typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns,
- const u_char *query,
- int querylen,
- u_char *ans,
- int anssiz,
- int *resplen);
-
-
-struct __res_state {
- int retrans; /* retransmition time interval */
- int retry; /* number of times to retransmit */
- u_long options; /* option flags - see below. */
- int nscount; /* number of name servers */
- struct sockaddr_in
- nsaddr_list[MAXNS]; /* address of name server */
-#define nsaddr nsaddr_list[0] /* for backward compatibility */
- u_short id; /* current message id */
- char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
- char defdname[256]; /* default domain (deprecated) */
- u_long pfcode; /* RES_PRF_ flags - see below. */
- unsigned ndots:4; /* threshold for initial abs. query */
- unsigned nsort:4; /* number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- u_int32_t mask;
- } sort_list[MAXRESOLVSORT];
- res_send_qhook qhook; /* query hook */
- res_send_rhook rhook; /* response hook */
- int res_h_errno; /* last one set for this context */
- int _vcsock; /* PRIVATE: for res_send VC i/o */
- u_int _flags; /* PRIVATE: see below */
- union {
- char pad[52]; /* On an i386 this means 512b total. */
- struct {
- u_int16_t nscount;
- u_int16_t nsmap[MAXNS];
- int nssocks[MAXNS];
- u_int16_t nscount6;
- u_int16_t nsinit;
- struct sockaddr_in6 *nsaddrs[MAXNS];
- unsigned long long int initstamp
- __attribute__((packed));
-#if 0
- unsigned int _initstamp[2];
-#endif
- } _ext;
- } _u;
-};
-
-typedef struct __res_state *res_state;
-
-/* for INET6 */
-/*
- * replacement of __res_state, separated to keep binary compatibility.
- */
-struct __res_state_ext {
- struct sockaddr_storage nsaddr_list[MAXNS];
- struct {
- int af; /* address family for addr, mask */
- union {
- struct in_addr ina;
- struct in6_addr in6a;
- } addr, mask;
- } sort_list[MAXRESOLVSORT];
-};
-
-/*
- * * Resolver flags (used to be discrete per-module statics ints).
- * */
-#define RES_F_VC 0x00000001 /* socket is TCP */
-#define RES_F_CONN 0x00000002 /* socket is connected */
-
-/* res_findzonecut() options */
-#define RES_EXHAUSTIVE 0x00000001 /* always do all queries */
-
-/*
- * Resolver options (keep these in synch with res_debug.c, please)
- */
-#define RES_INIT 0x00000001 /* address initialized */
-#define RES_DEBUG 0x00000002 /* print debug messages */
-#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
-#define RES_USEVC 0x00000008 /* use virtual circuit */
-#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /* ignore truncation errors */
-#define RES_RECURSE 0x00000040 /* recursion desired */
-#define RES_DEFNAMES 0x00000080 /* use default domain name */
-#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
-#define RES_DNSRCH 0x00000200 /* search up local domain tree */
-#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
-#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
-#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
-#define RES_ROTATE 0x00004000 /* rotate ns list after each query */
-#define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
-#define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
-#define RES_BLAST 0x00020000 /* blast all recursive servers */
-#define RES_USEBSTRING 0x00040000 /* IPv6 reverse lookup with byte
- strings */
-#define RES_NOIP6DOTINT 0x00080000 /* Do not use .ip6.int in IPv6
- reverse lookup */
-
-#define RES_DEFAULT (RES_RECURSE|RES_DEFNAMES|RES_DNSRCH|RES_NOIP6DOTINT)
-
-/*
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x00000001
-#define RES_PRF_UPDATE 0x00000002
-#define RES_PRF_CLASS 0x00000004
-#define RES_PRF_CMD 0x00000008
-#define RES_PRF_QUES 0x00000010
-#define RES_PRF_ANS 0x00000020
-#define RES_PRF_AUTH 0x00000040
-#define RES_PRF_ADD 0x00000080
-#define RES_PRF_HEAD1 0x00000100
-#define RES_PRF_HEAD2 0x00000200
-#define RES_PRF_TTLID 0x00000400
-#define RES_PRF_HEADX 0x00000800
-#define RES_PRF_QUERY 0x00001000
-#define RES_PRF_REPLY 0x00002000
-#define RES_PRF_INIT 0x00004000
-/* 0x00008000 */
-
-#define RES_SET_H_ERRNO(r,x) \
- do \
- { \
- (r)->res_h_errno = x; \
- h_errno = (x); \
- } \
- while (0)
-
-struct res_sym {
- int number; /* Identifying number, like T_MX */
- char * name; /* Its symbolic name, like "MX" */
- char * humanname; /* Its fun name, like "mail exchanger" */
-};
-
-extern struct __res_state _res;
-/* for INET6 */
-extern struct __res_state_ext _res_ext;
-
-extern const struct res_sym __p_class_syms[];
-extern const struct res_sym __p_type_syms[];
-
-/* Private routines shared between libc/net, named, nslookup and others. */
-#define res_hnok __res_hnok
-#define res_hostalias __res_hostalias
-#define res_ownok __res_ownok
-#define res_mailok __res_mailok
-#define res_dnok __res_dnok
-#define sym_ston __sym_ston
-#define sym_ntos __sym_ntos
-#define sym_ntop __sym_ntop
-#define b64_ntop __b64_ntop
-#define b64_pton __b64_pton
-#define loc_ntoa __loc_ntoa
-#define loc_aton __loc_aton
-#define fp_resstat __fp_resstat
-#define p_query __p_query
-#define dn_skipname __dn_skipname
-#define fp_resstat __fp_resstat
-#define fp_query __fp_query
-#define fp_nquery __fp_nquery
-#define hostalias __hostalias
-#define putlong __putlong
-#define putshort __putshort
-#define p_class __p_class
-#define p_rcode __p_rcode
-#define p_time __p_time
-#define p_type __p_type
-#define p_query __p_query
-#define p_cdnname __p_cdnname
-#define p_section __p_section
-#define p_cdname __p_cdname
-#define p_fqnname __p_fqnname
-#define p_fqname __p_fqname
-#define p_option __p_option
-#define p_secstodate __p_secstodate
-#define dn_count_labels __dn_count_labels
-#define dn_comp __dn_comp
-#define dn_expand __dn_expand
-#define res_init __res_init
-#define res_randomid __res_randomid
-#define res_query __res_query
-#define res_search __res_search
-#define res_querydomain __res_querydomain
-#define res_mkquery __res_mkquery
-#define res_send __res_send
-#define res_isourserver __res_isourserver
-#define res_nameinquery __res_nameinquery
-#define res_nclose __res_nclose
-#define res_ninit __res_ninit
-#define res_nmkquery __res_nmkquery
-#define res_npquery __res_npquery
-#define res_nquery __res_nquery
-#define res_nquerydomain __res_nquerydomain
-#define res_nsearch __res_nsearch
-#define res_nsend __res_nsend
-#define res_nisourserver __res_nisourserver
-#define res_queriesmatch __res_queriesmatch
-#define res_close __res_close
-#define res_opt __res_opt
-#define res_mkupdate __res_mkupdate
-#define res_mkupdrec __res_mkupdrec
-#define res_freeupdrec __res_freeupdrec
-
-__BEGIN_DECLS
-int res_hnok(const char *);
-int res_ownok(const char *);
-int res_mailok(const char *);
-int res_dnok(const char *);
-int sym_ston(const struct res_sym *, const char *, int *);
-const char * sym_ntos(const struct res_sym *, int, int *);
-const char * sym_ntop(const struct res_sym *, int, int *);
-int b64_ntop(u_char const *, size_t, char *, size_t);
-int b64_pton(char const *, u_char *, size_t);
-int loc_aton(const char *, u_char *);
-const char * loc_ntoa(const u_char *, char *);
-int dn_skipname(const u_char *, const u_char *);
-void fp_resstat(struct __res_state *, FILE *);
-void fp_query(const u_char *, FILE *);
-void fp_nquery(const u_char *, int, FILE *);
-const char * hostalias(const char *);
-void putlong(u_int32_t, u_char *);
-void putshort(u_int16_t, u_char *);
-const char * p_class(int);
-const char * p_rcode (int);
-const char * p_time(u_int32_t);
-const char * p_type(int);
-void p_query(const u_char *);
-const u_char * p_cdnname(const u_char *, const u_char *, int, FILE *);
-const u_char * p_cdname(const u_char *, const u_char *, FILE *);
-const u_char * p_fqnname(const u_char *, const u_char *,
- int, char *, int);
-const u_char * p_fqname(const u_char *, const u_char *, FILE *);
-const char * p_option(u_long);
-char * p_secstodate(u_long);
-int dn_count_labels(const char *);
-int dn_comp(const char *, u_char *, int, u_char **, u_char **);
-int dn_expand(const u_char *, const u_char *, const u_char *,
- char *, int);
-int res_init(void);
-u_int res_randomid(void);
-int res_query(const char *, int, int, u_char *, int);
-int res_search(const char *, int, int, u_char *, int);
-int res_querydomain(const char *, const char *, int, int,
- u_char *, int);
-int res_mkquery(int, const char *, int, int, const u_char *,
- int, const u_char *, u_char *, int);
-int res_send(const u_char *, int, u_char *, int);
-int res_isourserver(const struct sockaddr_in *);
-int res_nameinquery(const char *, int, int,
- const u_char *, const u_char *);
-void res_npquery (const res_state, const u_char *, int, FILE *);
-const char * res_hostalias (const res_state, const char *, char *, size_t);
-int res_nquery (res_state, const char *, int, int, u_char *, int);
-int res_nsearch (res_state, const char *, int, int, u_char *, int);
-int res_nquerydomain (res_state, const char *, const char *, int,
- int, u_char *, int);
-int res_nmkquery (res_state, int, const char *, int, int,
- const u_char *, int, const u_char *, u_char *,
- int);
-int res_nsend (res_state, const u_char *, int, u_char *, int);
-void res_nclose (res_state);
-
-int res_queriesmatch(const u_char *, const u_char *,
- const u_char *, const u_char *);
-void res_close(void);
-int res_opt(int, u_char *, int, int);
-const char * p_section(int, int);
-/* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */
-#ifdef _ARPA_NAMESER_H_
-int res_update(ns_updrec *);
-int res_mkupdate(ns_updrec *, u_char *, int);
-ns_updrec * res_mkupdrec(int, const char *, u_int, u_int, u_long);
-void res_freeupdrec(ns_updrec *);
-#endif
-
-__END_DECLS
-
-#endif /* !_RESOLV_H_ */
diff --git a/ports/glibc-compat/include/sgtty.h b/ports/glibc-compat/include/sgtty.h
deleted file mode 100644
index 2f5e71e..0000000
--- a/ports/glibc-compat/include/sgtty.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _SGTTY_H
-#define _SGTTY_H 1
-
-#include <sys/ioctl.h>
-
-struct sgttyb;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int gtty (int fd, struct sgttyb *params);
-extern int stty (int fd, const struct sgttyb *params);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/ports/glibc-compat/include/stdlib.h b/ports/glibc-compat/include/stdlib.h
deleted file mode 100644
index 5895c4a..0000000
--- a/ports/glibc-compat/include/stdlib.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#include_next <stdlib.h>
-
-#ifndef GLIBCEMU_STDLIB_H
-#define GLIBCEMU_STDLIB_H 1
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-long int random(void);
-
-void srandom(unsigned int seed);
-
-extern void qsort_r(void *base, size_t nmemb, size_t size,
- int (*compar)(const void *, const void *, void *),
- void *arg);
-
-__END_DECLS
-
-#endif
diff --git a/ports/glibc-compat/include/sys/dirent.h b/ports/glibc-compat/include/sys/dirent.h
deleted file mode 100644
index 910070d..0000000
--- a/ports/glibc-compat/include/sys/dirent.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-#ifndef _GLIBCEMU_SYS_DIRENT_H
-#define _GLIBCEMU_SYS_DIRENT_H
-
-#include <sys/cdefs.h>
-#include_next <sys/dirent.h>
-
-/* Work around a dirent.h wrapping includes in extern "C". */
-#if defined(_DIRENT_H_)
-__BEGIN_DECLS
-#endif
-
-int dirfd(DIR *dirp);
-int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
-int alphasort(const void *a, const void *b);
-int scandir(const char *dirp, struct dirent ***namelist,
- int (*filter)(const struct dirent *),
- int (*compar)(const struct dirent **, const struct dirent **));
-DIR *fdopendir(int fd);
-
-/* Work around a dirent.h wrapping includes in extern "C". */
-#if defined(_DIRENT_H_)
-__END_DECLS
-#endif
-
-#endif
diff --git a/ports/glibc-compat/include/sys/endian.h b/ports/glibc-compat/include/sys/endian.h
deleted file mode 100644
index b143a27..0000000
--- a/ports/glibc-compat/include/sys/endian.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/*
- * This file contains macros from BSD for converting little-endian
- * or big-endian to host-endian and back. Although these are not
- * part of glibc some software assumes that they exist when __GLIBC__
- * is *not* defined so they allow such software to build with newlib.
- */
-
-#ifndef GLIBCEMU_SYS_ENDIAN_H
-#define GLIBCEMU_SYS_ENDIAN_H 1
-
-#include <machine/endian.h>
-
-#define __byte_swap_constant_16(x) \
- ( (((unsigned short)(x) & 0xff) << 8) | \
- ((unsigned short)(x) >> 8) )
-
-#define __byte_swap_constant_32(x) \
- ( (((unsigned int)(x) & 0xff) << 24) | \
- (((unsigned int)(x) << 8) & 0x00ff0000) | \
- (((unsigned int)(x) >> 8) & 0x0000ff00) | \
- ((unsigned int)(x) >> 24) )
-
-
-_ELIDABLE_INLINE unsigned short int
-__inline_bswap_16 (unsigned short int x)
-{
- return __byte_swap_constant_16(x);
-}
-
-#define __byte_swap_16(x) \
- (__builtin_constant_p(x) ? __byte_swap_constant_16(x) : __inline_bswap_16(x))
-
-#define __byte_swap_32(x) \
- (__builtin_constant_p(x) ? __byte_swap_constant_32(x) : __builtin_bswap32(x))
-
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define htole16(x) (x)
-#define htole32(x) (x)
-#define letoh16(x) (x)
-#define letoh32(x) (x)
-#define htobe16(x) (__byte_swap_16(x))
-#define htobe32(x) (__byte_swap_32(x))
-#define betoh16(x) (__byte_swap_16(x))
-#define betoh32(x) (__byte_swap_32(x))
-#elif BYTE_ORDER == LITTLE_ENDIAN
-#else
-/* Native client is defined as always little endian */
-#error "Expected BYTE_ORDER == LITTLE_ENDIAN... "
-#endif
-
-#endif /* GLIBCEMU_SYS_ENDIAN_H */
diff --git a/ports/glibc-compat/include/sys/fcntl.h b/ports/glibc-compat/include/sys/fcntl.h
deleted file mode 100644
index 3e95d90..0000000
--- a/ports/glibc-compat/include/sys/fcntl.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#ifndef GLIBCEMU_SYS_FCNTL_H
-#define GLIBCEMU_SYS_FCNTL_H 1
-
-#include_next <sys/fcntl.h>
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-__BEGIN_DECLS
-
-#define F_ULOCK 0
-#define F_LOCK 1
-#define F_TLOCK 2
-#define AT_EACCESS 1
-#define AT_SYMLINK_NOFOLLOW 2
-#define AT_SYMLINK_FOLLOW 4
-#define AT_REMOVEDIR 8
-
-#if __BSD_VISIBLE
-/* lock operations for flock(2) */
-#define LOCK_SH 0x01 /* shared file lock */
-#define LOCK_EX 0x02 /* exclusive file lock */
-#define LOCK_NB 0x04 /* don't block when locking */
-#define LOCK_UN 0x08 /* unlock file */
-#endif
-
-int lockf(int fd, int command, off_t size);
-int flock(int fd, int operation);
-
-__END_DECLS
-
-#endif
diff --git a/ports/glibc-compat/include/sys/ioctl.h b/ports/glibc-compat/include/sys/ioctl.h
deleted file mode 100644
index d67a1c7..0000000
--- a/ports/glibc-compat/include/sys/ioctl.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* libc/sys/linux/sys/ioctl.h - ioctl prototype */
-
-/* Written 2000 by Werner Almesberger */
-
-
-#ifndef _SYS_IOCTL_H
-#define _SYS_IOCTL_H
-
-/* TODO(olonho): hack */
-#if 0
-#include <bits/ioctls.h>
-#endif
-
-#define TCGETS 0x5401
-#define TCSETS 0x5402
-#define TCSETSW 0x5403
-#define TCSETSF 0x5404
-#define TCGETA 0x5405
-#define TCSETA 0x5406
-#define TCSETAW 0x5407
-#define TCSETAF 0x5408
-#define TIOCGPGRP 0x540F
-#define TIOCGWINSZ 0x5413
-#define TIOCSWINSZ 0x5414
-#define TCXONC 0x540A
-
-struct winsize
- {
- unsigned short int ws_row;
- unsigned short int ws_col;
- unsigned short int ws_xpixel;
- unsigned short int ws_ypixel;
- };
-
-#define NCC 8
-struct termio
- {
- unsigned short int c_iflag; /* input mode flags */
- unsigned short int c_oflag; /* output mode flags */
- unsigned short int c_cflag; /* control mode flags */
- unsigned short int c_lflag; /* local mode flags */
- unsigned char c_line; /* line discipline */
- unsigned char c_cc[NCC]; /* control characters */
-};
-
-/* modem lines */
-#define TIOCM_LE 0x001
-#define TIOCM_DTR 0x002
-#define TIOCM_RTS 0x004
-#define TIOCM_ST 0x008
-#define TIOCM_SR 0x010
-#define TIOCM_CTS 0x020
-#define TIOCM_CAR 0x040
-#define TIOCM_RNG 0x080
-#define TIOCM_DSR 0x100
-#define TIOCM_CD TIOCM_CAR
-#define TIOCM_RI TIOCM_RNG
-
-/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-
-/* line disciplines */
-#define N_TTY 0
-#define N_SLIP 1
-#define N_MOUSE 2
-#define N_PPP 3
-#define N_STRIP 4
-#define N_AX25 5
-#define N_X25 6 /* X.25 async */
-#define N_6PACK 7
-#define N_MASC 8 /* Mobitex module */
-#define N_R3964 9 /* Simatic R3964 module */
-#define N_PROFIBUS_FDL 10 /* Profibus */
-#define N_IRDA 11 /* Linux IR */
-#define N_SMSBLOCK 12 /* SMS block mode */
-#define N_HDLC 13 /* synchronous HDLC */
-#define N_SYNC_PPP 14 /* synchronous PPP */
-#define N_HCI 15 /* Bluetooth HCI UART */
-
-#define TCGETA 0x5405
-#define TCSETA 0x5406
-
-#define FIONREAD 0x541B
-#define FIONBIO 0x5421
-
-#define SIOCGIFCONF 0x8912 /* get iface list */
-#define SIOCGIFFLAGS 0x8913 /* get flags */
-#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
-#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
-#define SIOCGIFNETMASK 0x891b /* get network PA mask */
-
-/* end olonho hack */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int ioctl(int fd,int request,...);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/ports/glibc-compat/include/sys/resource.h b/ports/glibc-compat/include/sys/resource.h
deleted file mode 100644
index efe6d2c..0000000
--- a/ports/glibc-compat/include/sys/resource.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_SYS_RESOURCE_H
-#define GLIBCEMU_SYS_RESOURCE_H
-
-#include_next <sys/resource.h>
-
-#define RLIMIT_CPU 0
-#define RLIMIT_FSIZE 1
-#define RLIMIT_DATA 2
-#define RLIMIT_STACK 3
-#define RLIMIT_CORE 4
-#define RLIMIT_NOFILE 5
-#define RLIM_INFINITY -1
-
-typedef unsigned long rlim_t;
-
-struct rlimit {
- rlim_t rlim_cur; /* Soft limit */
- rlim_t rlim_max; /* Hard limit (ceiling for rlim_cur) */
-};
-
-__BEGIN_DECLS
-
-int getrlimit(int resource, struct rlimit *rlim);
-int setrlimit(int resource, const struct rlimit *rlim);
-
-__END_DECLS
-
-#endif
diff --git a/ports/glibc-compat/include/sys/select.h b/ports/glibc-compat/include/sys/select.h
deleted file mode 100644
index ea8ec49..0000000
--- a/ports/glibc-compat/include/sys/select.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.
- */
-#ifndef _GLIBCEMU_SYS_SELECT_H
-#define _GLIBCEMU_SYS_SELECT_H 1
-
-#include <sys/time.h>
-#include <sys/types.h>
-#include <time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int select (int __nfds, fd_set *__restrict __readfds,
- fd_set *__restrict __writefds,
- fd_set *__restrict __exceptfds,
- struct timeval *__restrict __timeout);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GLIBCEMU_SYS_SELECT_H */
diff --git a/ports/glibc-compat/include/sys/signal.h b/ports/glibc-compat/include/sys/signal.h
deleted file mode 100644
index 40cd982..0000000
--- a/ports/glibc-compat/include/sys/signal.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_SYS_SIGNAL_H
-#define GLIBCEMU_SYS_SIGNAL_H
-
-#include_next <sys/signal.h>
-
-/*
- * newlib defines SA_SIGINFO even if _POSIX_REALTIME_SIGNALS is not defined (and
- * therefore sa_sighandler is not a member of sigaction). As it turns out a lot
- * of software assumgins that if SA_SIGINFO is defined then is can/should use
- * sa_sighandler.
- * TODO(sbc): remove this once this bug is fixed:
- * https://code.google.com/p/nativeclient/issues/detail?id=3989
- */
-#ifndef _POSIX_REALTIME_SIGNALS
-#undef SA_SIGINFO
-#endif
-
-#define SA_RESTART 0x10000000
-
-struct sigvec {
- void (*sv_handler)();
- int sv_mask;
- int sv_flags;
-};
-
-#endif
diff --git a/ports/glibc-compat/include/sys/socket.h b/ports/glibc-compat/include/sys/socket.h
deleted file mode 100644
index fd404fd..0000000
--- a/ports/glibc-compat/include/sys/socket.h
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)socket.h 8.4 (Berkeley) 2/21/94
- * $FreeBSD: src/sys/sys/socket.h,v 1.60 2002/04/20 02:24:35 mike Exp $
- */
-
-#ifndef _SYS_SOCKET_H_
-#define _SYS_SOCKET_H_
-
-#include <sys/types.h>
-#include <stdint.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-/*
- * Round p (pointer or byte index) up to a correctly-aligned value
- * for all data types (int, long, ...). The result is unsigned int
- * and must be cast to any desired pointer type.
- */
-#ifndef _ALIGNBYTES
-#define _ALIGNBYTES (sizeof(int) - 1)
-#endif
-#ifndef _ALIGN
-#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
-#endif
-
-/* Needed by linuxthreads. */
-
-# define __SOCKADDR_ARG struct sockaddr *__restrict
-# define __CONST_SOCKADDR_ARG __const struct sockaddr *
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Data types.
- */
-#ifdef _BSD_SA_FAMILY_T_
-typedef _BSD_SA_FAMILY_T_ sa_family_t;
-#undef _BSD_SA_FAMILY_T_
-#endif
-
-#ifdef _BSD_SOCKLEN_T_
-typedef _BSD_SOCKLEN_T_ socklen_t;
-#undef _BSD_SOCKLEN_T_
-#endif
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
-#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
-#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-/*efine SO_PRIVSTATE 0x1009 get/deny privileged state */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-struct accept_filter_arg {
- char af_name[16];
- char af_arg[256-16];
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/* Protocol families. */
-#define PF_UNSPEC 0 /* Unspecified. */
-#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
-#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
-#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
-#define PF_INET 2 /* IP protocol family. */
-#define PF_AX25 3 /* Amateur Radio AX.25. */
-#define PF_IPX 4 /* Novell Internet Protocol. */
-#define PF_APPLETALK 5 /* Appletalk DDP. */
-#define PF_NETROM 6 /* Amateur radio NetROM. */
-#define PF_BRIDGE 7 /* Multiprotocol bridge. */
-#define PF_ATMPVC 8 /* ATM PVCs. */
-#define PF_X25 9 /* Reserved for X.25 project. */
-#define PF_INET6 10 /* IP version 6. */
-#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
-#define PF_DECnet 12 /* Reserved for DECnet project. */
-#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
-#define PF_SECURITY 14 /* Security callback pseudo AF. */
-#define PF_KEY 15 /* PF_KEY key management API. */
-#define PF_NETLINK 16
-#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
-#define PF_PACKET 17 /* Packet family. */
-#define PF_ASH 18 /* Ash. */
-#define PF_ECONET 19 /* Acorn Econet. */
-#define PF_ATMSVC 20 /* ATM SVCs. */
-#define PF_SNA 22 /* Linux SNA Project */
-#define PF_IRDA 23 /* IRDA sockets. */
-#define PF_PPPOX 24 /* PPPoX sockets. */
-#define PF_WANPIPE 25 /* Wanpipe API sockets. */
-#define PF_BLUETOOTH 31 /* Bluetooth sockets. */
-#define PF_MAX 32 /* For now.. */
-
-/* Address families. */
-#define AF_UNSPEC PF_UNSPEC
-#define AF_LOCAL PF_LOCAL
-#define AF_UNIX PF_UNIX
-#define AF_FILE PF_FILE
-#define AF_INET PF_INET
-#define AF_AX25 PF_AX25
-#define AF_IPX PF_IPX
-#define AF_APPLETALK PF_APPLETALK
-#define AF_NETROM PF_NETROM
-#define AF_BRIDGE PF_BRIDGE
-#define AF_ATMPVC PF_ATMPVC
-#define AF_X25 PF_X25
-#define AF_INET6 PF_INET6
-#define AF_ROSE PF_ROSE
-#define AF_DECnet PF_DECnet
-#define AF_NETBEUI PF_NETBEUI
-#define AF_SECURITY PF_SECURITY
-#define AF_KEY PF_KEY
-#define AF_NETLINK PF_NETLINK
-#define AF_ROUTE PF_ROUTE
-#define AF_PACKET PF_PACKET
-#define AF_ASH PF_ASH
-#define AF_ECONET PF_ECONET
-#define AF_ATMSVC PF_ATMSVC
-#define AF_SNA PF_SNA
-#define AF_IRDA PF_IRDA
-#define AF_PPPOX PF_PPPOX
-#define AF_WANPIPE PF_WANPIPE
-#define AF_BLUETOOTH PF_BLUETOOTH
-#define AF_MAX PF_MAX
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- sa_family_t sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-#define SOCK_MAXADDRLEN 255 /* longest possible addresses */
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- uint16_t sp_family; /* address family */
- uint16_t sp_protocol; /* protocol */
-};
-
-/*
- * RFC 2553: protocol-independent placeholder for socket addresses
- */
-#define _SS_MAXSIZE 128U
-#define _SS_ALIGNSIZE (sizeof(int64_t))
-#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - sizeof(sa_family_t))
-#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - sizeof(sa_family_t) - \
- _SS_PAD1SIZE - _SS_ALIGNSIZE)
-
-struct sockaddr_storage {
- unsigned char ss_len; /* address length */
- sa_family_t ss_family; /* address family */
- char __ss_pad1[_SS_PAD1SIZE];
- int64_t __ss_align; /* force desired structure storage alignment */
- char __ss_pad2[_SS_PAD2SIZE];
-};
-
-/*
- * Definitions for network related sysctl, CTL_NET.
- *
- * Second level is protocol family.
- * Third level is protocol number.
- *
- * Further levels are defined by the individual families below.
- */
-#define NET_MAXID AF_MAX
-
-#define CTL_NET_NAMES { \
- { 0, 0 }, \
- { "unix", CTLTYPE_NODE }, \
- { "inet", CTLTYPE_NODE }, \
- { "implink", CTLTYPE_NODE }, \
- { "pup", CTLTYPE_NODE }, \
- { "chaos", CTLTYPE_NODE }, \
- { "xerox_ns", CTLTYPE_NODE }, \
- { "iso", CTLTYPE_NODE }, \
- { "emca", CTLTYPE_NODE }, \
- { "datakit", CTLTYPE_NODE }, \
- { "ccitt", CTLTYPE_NODE }, \
- { "ibm_sna", CTLTYPE_NODE }, \
- { "decnet", CTLTYPE_NODE }, \
- { "dec_dli", CTLTYPE_NODE }, \
- { "lat", CTLTYPE_NODE }, \
- { "hylink", CTLTYPE_NODE }, \
- { "appletalk", CTLTYPE_NODE }, \
- { "route", CTLTYPE_NODE }, \
- { "link_layer", CTLTYPE_NODE }, \
- { "xtp", CTLTYPE_NODE }, \
- { "coip", CTLTYPE_NODE }, \
- { "cnt", CTLTYPE_NODE }, \
- { "rtip", CTLTYPE_NODE }, \
- { "ipx", CTLTYPE_NODE }, \
- { "sip", CTLTYPE_NODE }, \
- { "pip", CTLTYPE_NODE }, \
- { "isdn", CTLTYPE_NODE }, \
- { "key", CTLTYPE_NODE }, \
- { "inet6", CTLTYPE_NODE }, \
- { "natm", CTLTYPE_NODE }, \
- { "atm", CTLTYPE_NODE }, \
- { "hdrcomplete", CTLTYPE_NODE }, \
- { "netgraph", CTLTYPE_NODE }, \
- { "snp", CTLTYPE_NODE }, \
- { "scp", CTLTYPE_NODE }, \
-}
-
-/*
- * PF_ROUTE - Routing table
- *
- * Three additional levels are defined:
- * Fourth: address family, 0 is wildcard
- * Fifth: type of info, defined below
- * Sixth: flag(s) to mask with for NET_RT_FLAGS
- */
-#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
-#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
-#define NET_RT_IFLIST 3 /* survey interface list */
-#define NET_RT_MAXID 4
-
-#define CTL_NET_RT_NAMES { \
- { 0, 0 }, \
- { "dump", CTLTYPE_STRUCT }, \
- { "flags", CTLTYPE_STRUCT }, \
- { "iflist", CTLTYPE_STRUCT }, \
-}
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#ifndef SOMAXCONN
-#define SOMAXCONN 128
-#endif
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- void *msg_name; /* optional address */
- socklen_t msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- void *msg_control; /* ancillary data, see below */
- socklen_t msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
-#define MSG_EOF 0x100 /* data completes connection */
-#define MSG_COMPAT 0x8000 /* used in sendit() */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- socklen_t cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by unsigned char cmsg_data[]; */
-};
-
-/*
- * While we may have more groups than this, the cmsgcred struct must
- * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow
- * this.
-*/
-#define CMGROUP_MAX 16
-
-/*
- * Credentials structure, used to verify the identity of a peer
- * process that has sent us a message. This is allocated by the
- * peer process but filled in by the kernel. This prevents the
- * peer from lying about its identity. (Note that cmcred_groups[0]
- * is the effective GID.)
- */
-struct cmsgcred {
- pid_t cmcred_pid; /* PID of sending process */
- uid_t cmcred_uid; /* real UID of sending process */
- uid_t cmcred_euid; /* effective UID of sending process */
- gid_t cmcred_gid; /* real GID of sending process */
- short cmcred_ngroups; /* number or groups */
- gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
-};
-
-/* given pointer to struct cmsghdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \
- _ALIGN(sizeof(struct cmsghdr)))
-
-/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len) + \
- _ALIGN(sizeof(struct cmsghdr)) > \
- (caddr_t)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* RFC 2292 additions */
-
-#define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l))
-#define CMSG_LEN(l) (_ALIGN(sizeof(struct cmsghdr)) + (l))
-
-#ifdef _KERNEL
-#define CMSG_ALIGN(n) _ALIGN(n)
-#endif
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
-#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- uint16_t sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-/*
- * howto arguments for shutdown(2), specified by Posix.1g.
- */
-#define SHUT_RD 0 /* shut down the reading side */
-#define SHUT_WR 1 /* shut down the writing side */
-#define SHUT_RDWR 2 /* shut down both sides */
-
-/*
- * sendfile(2) header/trailer struct
- */
-struct sf_hdtr {
- struct iovec *headers; /* pointer to an array of header struct iovec's */
- int hdr_cnt; /* number of header iovec's */
- struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
- int trl_cnt; /* number of trailer iovec's */
-};
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept(int, struct sockaddr *, socklen_t *);
-int bind(int, const struct sockaddr *, socklen_t);
-int connect(int, const struct sockaddr *, socklen_t);
-int getpeername(int, struct sockaddr *, socklen_t *);
-int getsockname(int, struct sockaddr *, socklen_t *);
-int getsockopt(int, int, int, void *, socklen_t *);
-int listen(int, int);
-ssize_t recv(int, void *, size_t, int);
-ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
-ssize_t recvmsg(int, struct msghdr *, int);
-ssize_t send(int, const void *, size_t, int);
-ssize_t sendto(int, const void *,
- size_t, int, const struct sockaddr *, socklen_t);
-ssize_t sendmsg(int, const struct msghdr *, int);
-int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int);
-int setsockopt(int, int, int, const void *, socklen_t);
-int shutdown(int, int);
-int socket(int, int, int);
-int socketpair(int, int, int, int *);
-__END_DECLS
-
-#endif /* !_SYS_SOCKET_H_ */
diff --git a/ports/glibc-compat/include/sys/stat.h b/ports/glibc-compat/include/sys/stat.h
deleted file mode 100644
index 1262d11..0000000
--- a/ports/glibc-compat/include/sys/stat.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#ifndef GLIBCEMU_SYS_STAT_H
-#define GLIBCEMU_SYS_STAT_H 1
-
-#include_next <sys/stat.h>
- /* 7777 */
-#define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-mode_t umask(mode_t mask);
-int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags);
-int mkdirat(int dirfd, const char *pathname, mode_t mode);
-int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/ports/glibc-compat/include/sys/statvfs.h b/ports/glibc-compat/include/sys/statvfs.h
deleted file mode 100644
index cb8b57b..0000000
--- a/ports/glibc-compat/include/sys/statvfs.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_SYS_STATVFS_H
-#define GLIBCEMU_SYS_STATVFS_H
-
-typedef long fsblkcnt_t;
-typedef long fsfilcnt_t;
-
-struct statvfs {
- unsigned long f_bsize; /* file system block size */
- unsigned long f_frsize; /* fragment size */
- fsblkcnt_t f_blocks; /* size of fs in f_frsize units */
- fsblkcnt_t f_bfree; /* # free blocks */
- fsblkcnt_t f_bavail; /* # free blocks for unprivileged users */
- fsfilcnt_t f_files; /* # inodes */
- fsfilcnt_t f_ffree; /* # free inodes */
- fsfilcnt_t f_favail; /* # free inodes for unprivileged users */
- unsigned long f_fsid; /* file system ID */
- unsigned long f_flag; /* mount flags */
- unsigned long f_namemax; /* maximum filename length */
-};
-
-int statvfs(const char *path, struct statvfs *buf);
-int fstatvfs(int fd, struct statvfs *buf);
-
-#endif
diff --git a/ports/glibc-compat/include/sys/syslog.h b/ports/glibc-compat/include/sys/syslog.h
deleted file mode 100644
index e1e73cf..0000000
--- a/ports/glibc-compat/include/sys/syslog.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1988, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)syslog.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _SYS_SYSLOG_H
-#define _SYS_SYSLOG_H 1
-
-/* @LOCALMOD-START */
-/* We do not want those glibc-style headers. */
-#if 0
-#include <features.h>
-#else
-#include <sys/cdefs.h>
-#endif
-/* @LOCALMOD-START */
-#define __need___va_list
-#include <stdarg.h>
-
-#if 0
-/* This file defines _PATH_LOG. */
-#include <bits/syslog-path.h>
-#else
-#define _PATH_LOG "/dev/log"
-#endif
-
-/*
- * priorities/facilities are encoded into a single 32-bit quantity, where the
- * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
- * (0-big number). Both the priorities and the facilities map roughly
- * one-to-one to strings in the syslogd(8) source code. This mapping is
- * included in this file.
- *
- * priorities (these are ordered)
- */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
- /* extract priority */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK)
-#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
-
-#ifdef SYSLOG_NAMES
-#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
- /* mark "facility" */
-#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
-typedef struct _code {
- char *c_name;
- int c_val;
-} CODE;
-
-CODE prioritynames[] =
- {
- { "alert", LOG_ALERT },
- { "crit", LOG_CRIT },
- { "debug", LOG_DEBUG },
- { "emerg", LOG_EMERG },
- { "err", LOG_ERR },
- { "error", LOG_ERR }, /* DEPRECATED */
- { "info", LOG_INFO },
- { "none", INTERNAL_NOPRI }, /* INTERNAL */
- { "notice", LOG_NOTICE },
- { "panic", LOG_EMERG }, /* DEPRECATED */
- { "warn", LOG_WARNING }, /* DEPRECATED */
- { "warning", LOG_WARNING },
- { NULL, -1 }
- };
-#endif
-
-/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
-#define LOG_FTP (11<<3) /* ftp daemon */
-
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* current number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
- /* facility of pri */
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
-
-#ifdef SYSLOG_NAMES
-CODE facilitynames[] =
- {
- { "auth", LOG_AUTH },
- { "authpriv", LOG_AUTHPRIV },
- { "cron", LOG_CRON },
- { "daemon", LOG_DAEMON },
- { "ftp", LOG_FTP },
- { "kern", LOG_KERN },
- { "lpr", LOG_LPR },
- { "mail", LOG_MAIL },
- { "mark", INTERNAL_MARK }, /* INTERNAL */
- { "news", LOG_NEWS },
- { "security", LOG_AUTH }, /* DEPRECATED */
- { "syslog", LOG_SYSLOG },
- { "user", LOG_USER },
- { "uucp", LOG_UUCP },
- { "local0", LOG_LOCAL0 },
- { "local1", LOG_LOCAL1 },
- { "local2", LOG_LOCAL2 },
- { "local3", LOG_LOCAL3 },
- { "local4", LOG_LOCAL4 },
- { "local5", LOG_LOCAL5 },
- { "local6", LOG_LOCAL6 },
- { "local7", LOG_LOCAL7 },
- { NULL, -1 }
- };
-#endif
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything.
- * LOG_NDELAY is the inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
-#define LOG_PERROR 0x20 /* log to stderr as well */
-
-__BEGIN_DECLS
-
-/* Close descriptor used to write to system logger.
-
- This function is a possible cancellation point and therefore not
- marked with __THROW. */
-extern void closelog (void);
-
-/* Open connection to system logger.
-
- This function is a possible cancellation point and therefore not
- marked with __THROW. */
-extern void openlog (__const char *__ident, int __option, int __facility);
-
-/* Set the log mask level. */
-extern int setlogmask (int __mask) __THROW;
-
-/* Generate a log message using FMT string and option arguments.
-
- This function is a possible cancellation point and therefore not
- marked with __THROW. */
-extern void syslog (int __pri, __const char *__fmt, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
-
-#ifdef __USE_BSD
-/* Generate a log message using FMT and using arguments pointed to by AP.
-
- This function is not part of POSIX and therefore no official
- cancellation point. But due to similarity with an POSIX interface
- or due to the implementation it is a cancellation point and
- therefore not marked with __THROW. */
-extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
- __attribute__ ((__format__ (__printf__, 2, 0)));
-#endif
-
-
-/* Define some macros helping to catch buffer overflows. */
-#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
-# include <bits/syslog.h>
-#endif
-#ifdef __LDBL_COMPAT
-# include <bits/syslog-ldbl.h>
-#endif
-
-__END_DECLS
-
-#endif /* sys/syslog.h */
diff --git a/ports/glibc-compat/include/sys/time.h b/ports/glibc-compat/include/sys/time.h
deleted file mode 100644
index c7964d7..0000000
--- a/ports/glibc-compat/include/sys/time.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-#ifndef GLIBCEMU_SYS_TIME_H
-#define GLIBCEMU_SYS_TIME_H 1
-
-/* gnulib hack (it builds its own headers sometimes)
- Include guard to prevent gnulib from defining conflicting types
- bug at:
- https://code.google.com/p/nativeclient/issues/detail?id=4198
-*/
-#include <sys/types.h>
-#include_next <sys/time.h>
-
-/* Convenience macros for operations on timevals.
- NOTE: `timercmp' does not work for >= or <=. */
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
-#define timercmp(a, b, CMP) \
- (((a)->tv_sec == (b)->tv_sec) ? \
- ((a)->tv_usec CMP (b)->tv_usec) : \
- ((a)->tv_sec CMP (b)->tv_sec))
-#define timeradd(a, b, result) \
- do { \
- (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
- if ((result)->tv_usec >= 1000000) \
- { \
- ++(result)->tv_sec; \
- (result)->tv_usec -= 1000000; \
- } \
- } while (0)
-#define timersub(a, b, result) \
- do { \
- (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
- if ((result)->tv_usec < 0) { \
- --(result)->tv_sec; \
- (result)->tv_usec += 1000000; \
- } \
- } while (0)
-
-# define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-# define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-#endif /* GLIBCEMU_SYS_TIME_H */
diff --git a/ports/glibc-compat/include/sys/types.h b/ports/glibc-compat/include/sys/types.h
deleted file mode 100644
index f7a99d3..0000000
--- a/ports/glibc-compat/include/sys/types.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_SYS_TYPES_H
-#define GLIBCEMU_SYS_TYPES_H 1
-
-#include <limits.h>
-#define SSIZE_MAX LONG_MAX
-
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64
-#endif
-
-#include_next <sys/types.h>
-
-/* TODO(sbc): Remove these once they get added to newlib headers */
-dev_t makedev(int maj, int min);
-
-/*
- * These must be macros otherwise we get compiler errors when
- * there are local variables that shadow them (this happens in
- * several projects including gdb).
- *
- * Arbitrarily split dev_t into upper and lower 32-bits.
- */
-#define major(dev) ((int)((dev) >> 32) & 0xffff)
-#define minor(dev) ((int)(dev) & 0xffff)
-
-#endif /* GLIBCEMU_SYS_TYPES_H */
diff --git a/ports/glibc-compat/include/sys/uio.h b/ports/glibc-compat/include/sys/uio.h
deleted file mode 100644
index 9ed1549..0000000
--- a/ports/glibc-compat/include/sys/uio.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _SYS_UIO_H
-#define _SYS_UIO_H
-
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Per POSIX
- */
-
-struct iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-ssize_t readv(int, const struct iovec *, int);
-ssize_t writev(int, const struct iovec *, int);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif
diff --git a/ports/glibc-compat/include/sys/un.h b/ports/glibc-compat/include/sys/un.h
deleted file mode 100644
index 2a9f994..0000000
--- a/ports/glibc-compat/include/sys/un.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-#ifndef GLIBCEMU_SYS_UN_H
-#define GLIBCEMU_SYS_UN_H 1
-
-#include <sys/socket.h>
-
-struct sockaddr_un {
- sa_family_t sun_family; /* address family */
- char sun_path[108];
-};
-
-/* pulled from freebsd 10.1 sys/sys/un.h */
-/* actual length of an initialized sockaddr_un */
-#define SUN_LEN(su) \
- (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
-
-#endif /* GLIBCEMU_SYS_UN_H */
diff --git a/ports/glibc-compat/include/sys/unistd.h b/ports/glibc-compat/include/sys/unistd.h
deleted file mode 100644
index 92e1129..0000000
--- a/ports/glibc-compat/include/sys/unistd.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_SYS_UNISTD_H
-#define GLIBCEMU_SYS_UNISTD_H
-
-#include_next <sys/unistd.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-
-/*
- * TODO(bradnelson): Consider adding sysconf (and this define) to nacl_io.
- * This would allow us to return more useful values.
- * For example nacl_io knows what this one should be.
- *
- * This sysconf parameter is unsupported by newlib, pick a bad value so that
- * we can still build when this is used, and instead hit a runtime error.
- * One port (tcl) has a fallback in this case to guess a reasonable value.
- */
-#define _SC_GETPW_R_SIZE_MAX (-1)
-#define _SC_GETGR_R_SIZE_MAX (-1)
-#define _SC_MONOTONIC_CLOCK (-1)
-#define _SC_OPEN_MAX (-1)
-#define _SC_CLK_TCK (-1)
-#define _SC_ARG_MAX (-1)
-
-/* TODO(bradnelson): Drop this once we've landed nacl_io pipe support. */
-extern int mknod(const char *pathname, mode_t mode, dev_t dev);
-extern int mkfifo(const char *pathname, mode_t mode);
-
-int readlinkat(int dirfd, const char *pathname,
- char *buf, size_t bufsiz);
-int unlinkat(int dirfd, const char *pathname, int flags);
-int faccessat(int dirfd, const char *pathname, int mode, int flags);
-int fchownat(int dirfd, const char *pathname,
- uid_t owner, gid_t group, int flags);
-int symlinkat(const char *oldpath, int newdirfd, const char *newpath);
-int linkat(int olddirfd, const char *oldpath,
- int newdirfd, const char *newpath, int flags);
-
-#endif
diff --git a/ports/glibc-compat/include/sys/utime.h b/ports/glibc-compat/include/sys/utime.h
deleted file mode 100644
index 1c30cfd..0000000
--- a/ports/glibc-compat/include/sys/utime.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-#ifndef GLIBCEMU_SYS_UTIME_H
-#define GLIBCEMU_SYS_UTIME_H
-
-#include_next <sys/utime.h>
-
-#include <sys/time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int utime(const char *filename, const struct utimbuf *times);
-int utimes(const char *filename, const struct timeval times[2]);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* GLIBCEMU_SYS_UTIME_H */
diff --git a/ports/glibc-compat/include/sysexits.h b/ports/glibc-compat/include/sysexits.h
deleted file mode 100644
index 37246b6..0000000
--- a/ports/glibc-compat/include/sysexits.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)sysexits.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _SYSEXITS_H
-#define _SYSEXITS_H 1
-
-/*
- * SYSEXITS.H -- Exit status codes for system programs.
- *
- * This include file attempts to categorize possible error
- * exit statuses for system programs, notably delivermail
- * and the Berkeley network.
- *
- * Error numbers begin at EX__BASE to reduce the possibility of
- * clashing with other exit statuses that random programs may
- * already return. The meaning of the codes is approximately
- * as follows:
- *
- * EX_USAGE -- The command was used incorrectly, e.g., with
- * the wrong number of arguments, a bad flag, a bad
- * syntax in a parameter, or whatever.
- * EX_DATAERR -- The input data was incorrect in some way.
- * This should only be used for user's data & not
- * system files.
- * EX_NOINPUT -- An input file (not a system file) did not
- * exist or was not readable. This could also include
- * errors like "No message" to a mailer (if it cared
- * to catch it).
- * EX_NOUSER -- The user specified did not exist. This might
- * be used for mail addresses or remote logins.
- * EX_NOHOST -- The host specified did not exist. This is used
- * in mail addresses or network requests.
- * EX_UNAVAILABLE -- A service is unavailable. This can occur
- * if a support program or file does not exist. This
- * can also be used as a catchall message when something
- * you wanted to do doesn't work, but you don't know
- * why.
- * EX_SOFTWARE -- An internal software error has been detected.
- * This should be limited to non-operating system related
- * errors as possible.
- * EX_OSERR -- An operating system error has been detected.
- * This is intended to be used for such things as "cannot
- * fork", "cannot create pipe", or the like. It includes
- * things like getuid returning a user that does not
- * exist in the passwd file.
- * EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
- * etc.) does not exist, cannot be opened, or has some
- * sort of error (e.g., syntax error).
- * EX_CANTCREAT -- A (user specified) output file cannot be
- * created.
- * EX_IOERR -- An error occurred while doing I/O on some file.
- * EX_TEMPFAIL -- temporary failure, indicating something that
- * is not really an error. In sendmail, this means
- * that a mailer (e.g.) could not create a connection,
- * and the request should be reattempted later.
- * EX_PROTOCOL -- the remote system returned something that
- * was "not possible" during a protocol exchange.
- * EX_NOPERM -- You did not have sufficient permission to
- * perform the operation. This is not intended for
- * file system problems, which should use NOINPUT or
- * CANTCREAT, but rather for higher level permissions.
- */
-
-#define EX_OK 0 /* successful termination */
-
-#define EX__BASE 64 /* base value for error messages */
-
-#define EX_USAGE 64 /* command line usage error */
-#define EX_DATAERR 65 /* data format error */
-#define EX_NOINPUT 66 /* cannot open input */
-#define EX_NOUSER 67 /* addressee unknown */
-#define EX_NOHOST 68 /* host name unknown */
-#define EX_UNAVAILABLE 69 /* service unavailable */
-#define EX_SOFTWARE 70 /* internal software error */
-#define EX_OSERR 71 /* system error (e.g., can't fork) */
-#define EX_OSFILE 72 /* critical OS file missing */
-#define EX_CANTCREAT 73 /* can't create (user) output file */
-#define EX_IOERR 74 /* input/output error */
-#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
-#define EX_PROTOCOL 76 /* remote error in protocol */
-#define EX_NOPERM 77 /* permission denied */
-#define EX_CONFIG 78 /* configuration error */
-
-#define EX__MAX 78 /* maximum listed value */
-
-#endif /* sysexits.h */
diff --git a/ports/glibc-compat/include/syslog.h b/ports/glibc-compat/include/syslog.h
deleted file mode 100644
index 830b492..0000000
--- a/ports/glibc-compat/include/syslog.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sys/syslog.h>
diff --git a/ports/glibc-compat/include/termio.h b/ports/glibc-compat/include/termio.h
deleted file mode 100644
index 1452c58..0000000
--- a/ports/glibc-compat/include/termio.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <termios.h>
-#include <sys/ioctl.h>
diff --git a/ports/glibc-compat/include/time.h b/ports/glibc-compat/include/time.h
deleted file mode 100644
index 01243ad..0000000
--- a/ports/glibc-compat/include/time.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-#ifndef GLIBCEMU_TIME_H
-#define GLIBCEMU_TIME_H 1
-
-#include_next <time.h>
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-time_t timegm(struct tm *tm);
-time_t timelocal(struct tm *tm);
-__END_DECLS
-
-#endif
diff --git a/ports/glibc-compat/pkg_info b/ports/glibc-compat/pkg_info
deleted file mode 100644
index c07549e..0000000
--- a/ports/glibc-compat/pkg_info
+++ /dev/null
@@ -1,3 +0,0 @@
-NAME=glibc-compat
-DEPENDS=(corelibs gtest)
-VERSION=0.1
diff --git a/ports/glibc-compat/src/alarm.c b/ports/glibc-compat/src/alarm.c
deleted file mode 100644
index c21fccf..0000000
--- a/ports/glibc-compat/src/alarm.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-unsigned int alarm(unsigned int seconds) {
- return 0;
-}
diff --git a/ports/glibc-compat/src/config.h b/ports/glibc-compat/src/config.h
deleted file mode 100644
index 31056b9..0000000
--- a/ports/glibc-compat/src/config.h
+++ /dev/null
@@ -1 +0,0 @@
-/* Intentionally empty. */
diff --git a/ports/glibc-compat/src/dirfd.c b/ports/glibc-compat/src/dirfd.c
deleted file mode 100644
index 0da98ef..0000000
--- a/ports/glibc-compat/src/dirfd.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * Copyright (c) 2011 Gleb Kurtsou <gleb@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: release/10.1.0/lib/libc/gen/dirfd.c 235649 2012-05-19 14:30:49Z
- * gleb $
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: release/10.1.0/lib/libc/gen/dirfd.c 235649 2012-05-19 \
-14:30:49Z gleb $");
-
-#include <sys/param.h>
-
-#include <dirent.h>
-
-// pull from freebsd 10.1 lib/libc/gen/gen-private.h
-#define _dirfd(dirp) ((dirp)->dd_fd)
-
-int
-dirfd(DIR *dirp)
-{
- return (_dirfd(dirp));
-}
diff --git a/ports/glibc-compat/src/err.c b/ports/glibc-compat/src/err.c
deleted file mode 100644
index e3a0ddf..0000000
--- a/ports/glibc-compat/src/err.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: release/10.1.0/lib/libc/gen/err.c 177893 2008-04-03 20:36:44Z imp $");
-
-#include <err.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-static FILE *err_file; /* file to use for error output */
-static void (*err_exit)(int);
-
-const char * getprogname(void) __attribute__((weak));
-
-static const char * _getprogname(void) {
- if (getprogname)
- return getprogname();
- else
- return "missing_getprogname";
-}
-
-/*
- * This is declared to take a `void *' so that the caller is not required
- * to include <stdio.h> first. However, it is really a `FILE *', and the
- * manual page documents it as such.
- */
-void
-err_set_file(void *fp)
-{
- if (fp)
- err_file = fp;
- else
- err_file = stderr;
-}
-
-void
-err_set_exit(void (*ef)(int))
-{
- err_exit = ef;
-}
-
-void err(int eval, const char *fmt, ...) __attribute__((weak));
-
-void
-err(int eval, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- verrc(eval, errno, fmt, ap);
- va_end(ap);
-}
-
-void
-verr(eval, fmt, ap)
- int eval;
- const char *fmt;
- va_list ap;
-{
- verrc(eval, errno, fmt, ap);
-}
-
-void
-errc(int eval, int code, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- verrc(eval, code, fmt, ap);
- va_end(ap);
-}
-
-void
-verrc(int eval, int code, const char *fmt, va_list ap)
-{
- if (err_file == 0)
- err_set_file((FILE *)0);
- fprintf(err_file, "%s: ", _getprogname());
- if (fmt != NULL) {
- vfprintf(err_file, fmt, ap);
- fprintf(err_file, ": ");
- }
- fprintf(err_file, "%s\n", strerror(code));
- if (err_exit)
- err_exit(eval);
- exit(eval);
-}
-
-void
-errx(int eval, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- verrx(eval, fmt, ap);
- va_end(ap);
-}
-
-void
-verrx(int eval, const char *fmt, va_list ap)
-{
- if (err_file == 0)
- err_set_file((FILE *)0);
- fprintf(err_file, "%s: ", _getprogname());
- if (fmt != NULL)
- vfprintf(err_file, fmt, ap);
- fprintf(err_file, "\n");
- if (err_exit)
- err_exit(eval);
- exit(eval);
-}
-
-void warn(const char *fmt, ...) __attribute__((weak));
-
-void
-warn(const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- vwarnc(errno, fmt, ap);
- va_end(ap);
-}
-
-void
-vwarn(const char *fmt, va_list ap)
-{
- vwarnc(errno, fmt, ap);
-}
-
-void
-warnc(int code, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- vwarnc(code, fmt, ap);
- va_end(ap);
-}
-
-void
-vwarnc(int code, const char *fmt, va_list ap)
-{
- if (err_file == 0)
- err_set_file((FILE *)0);
- fprintf(err_file, "%s: ", _getprogname());
- if (fmt != NULL) {
- vfprintf(err_file, fmt, ap);
- fprintf(err_file, ": ");
- }
- fprintf(err_file, "%s\n", strerror(code));
-}
-
-void
-warnx(const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- vwarnx(fmt, ap);
- va_end(ap);
-}
-
-void
-vwarnx(const char *fmt, va_list ap)
-{
- if (err_file == 0)
- err_set_file((FILE *)0);
- fprintf(err_file, "%s: ", _getprogname());
- if (fmt != NULL)
- vfprintf(err_file, fmt, ap);
- fprintf(err_file, "\n");
-}
diff --git a/ports/glibc-compat/src/flock.c b/ports/glibc-compat/src/flock.c
deleted file mode 100644
index d48111c..0000000
--- a/ports/glibc-compat/src/flock.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-
-#define OP_MASK (LOCK_SH | LOCK_EX | LOCK_UN)
-
-int flock(int fd, int operation)
-{
- struct flock arg;
- int code, cmd;
-
- arg.l_whence = SEEK_SET;
- arg.l_start = 0;
- arg.l_len = 0; /* means to EOF */
-
- if (operation & LOCK_NB)
- cmd = F_SETLK;
- else
- cmd = F_SETLKW; /* Blocking */
-
- switch (operation & OP_MASK) {
- case LOCK_UN:
- arg.l_type = F_UNLCK;
- code = fcntl(fd, F_SETLK, &arg);
- break;
- case LOCK_SH:
- arg.l_type = F_RDLCK;
- code = fcntl(fd, cmd, &arg);
- break;
- case LOCK_EX:
- arg.l_type = F_WRLCK;
- code = fcntl(fd, cmd, &arg);
- break;
- default:
- errno = EINVAL;
- code = -1;
- break;
- }
- return code;
-}
diff --git a/ports/glibc-compat/src/fpending.c b/ports/glibc-compat/src/fpending.c
deleted file mode 100644
index 71dde79..0000000
--- a/ports/glibc-compat/src/fpending.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <stdio.h>
-
-size_t __fpending(FILE *stream) {
- return 1;
-}
diff --git a/ports/glibc-compat/src/fts.c b/ports/glibc-compat/src/fts.c
deleted file mode 100644
index 1847cc6..0000000
--- a/ports/glibc-compat/src/fts.c
+++ /dev/null
@@ -1,1218 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $
- */
-
-#if 0
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
-#endif /* LIBC_SCCS and not lint */
-#endif
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: release/10.1.0/lib/libc/gen/fts.c 264172 2014-04-05 \
-20:26:17Z jilles $");
-
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <fts.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <sys/dirent.h>
-
-// Pull from freebsd 10.1 sys/mount.h
-/*
- * NOTE: When changing statfs structure, mount structure, MNT_* flags or
- * MNTK_* flags also update DDB show mount command in vfs_subr.c.
- */
-
-typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */
-
-/*
- * filesystem statistics
- */
-#define MFSNAMELEN 16 /* length of type name including null */
-#define MNAMELEN 88 /* size of on/from name bufs */
-#define STATFS_VERSION 0x20030518 /* current version number */
-struct statfs {
- uint32_t f_version; /* structure version number */
- uint32_t f_type; /* type of filesystem */
- uint64_t f_flags; /* copy of mount exported flags */
- uint64_t f_bsize; /* filesystem fragment size */
- uint64_t f_iosize; /* optimal transfer block size */
- uint64_t f_blocks; /* total data blocks in filesystem */
- uint64_t f_bfree; /* free blocks in filesystem */
- int64_t f_bavail; /* free blocks avail to non-superuser */
- uint64_t f_files; /* total file nodes in filesystem */
- int64_t f_ffree; /* free nodes avail to non-superuser */
- uint64_t f_syncwrites; /* count of sync writes since mount */
- uint64_t f_asyncwrites; /* count of async writes since mount */
- uint64_t f_syncreads; /* count of sync reads since mount */
- uint64_t f_asyncreads; /* count of async reads since mount */
- uint64_t f_spare[10]; /* unused spare */
- uint32_t f_namemax; /* maximum filename length */
- uid_t f_owner; /* user that mounted the filesystem */
- fsid_t f_fsid; /* filesystem id */
- char f_charspare[80]; /* spare string space */
- char f_fstypename[MFSNAMELEN]; /* filesystem type name */
- char f_mntfromname[MNAMELEN]; /* mounted filesystem */
- char f_mntonname[MNAMELEN]; /* directory on which mounted */
-};
-
-static FTSENT *fts_alloc(FTS *, char *, size_t);
-static FTSENT *fts_build(FTS *, int);
-static void fts_lfree(FTSENT *);
-static void fts_load(FTS *, FTSENT *);
-static size_t fts_maxarglen(char * const *);
-static void fts_padjust(FTS *, FTSENT *);
-static int fts_palloc(FTS *, size_t);
-static FTSENT *fts_sort(FTS *, FTSENT *, size_t);
-static int fts_stat(FTS *, FTSENT *, int);
-static int fts_safe_changedir(FTS *, FTSENT *, int, char *);
-static int fts_ufslinks(FTS *, const FTSENT *);
-
-#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
-
-#define CLR(opt) (sp->fts_options &= ~(opt))
-#define ISSET(opt) (sp->fts_options & (opt))
-#define SET(opt) (sp->fts_options |= (opt))
-
-#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
-
-/* fts_build flags */
-#define BCHILD 1 /* fts_children */
-#define BNAMES 2 /* fts_children, names only */
-#define BREAD 3 /* fts_read */
-
-/*
- * Internal representation of an FTS, including extra implementation
- * details. The FTS returned from fts_open points to this structure's
- * ftsp_fts member (and can be cast to an _fts_private as required)
- */
-struct _fts_private {
- FTS ftsp_fts;
- struct statfs ftsp_statfs;
- dev_t ftsp_dev;
- int ftsp_linksreliable;
-};
-
-/*
- * The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it
- * knows that a directory could not possibly have subdirectories. This
- * is decided by looking at the link count: a subdirectory would
- * increment its parent's link count by virtue of its own ".." entry.
- * This assumption only holds for UFS-like filesystems that implement
- * links and directories this way, so we must punt for others.
- */
-
-static const char *ufslike_filesystems[] = {
- "ufs",
- "zfs",
- "nfs",
- "nfs4",
- "ext2fs",
- 0
-};
-
-FTS *
-fts_open(argv, options, compar)
- char * const *argv;
- int options;
- int (*compar)(const FTSENT * const *, const FTSENT * const *);
-{
- struct _fts_private *priv;
- FTS *sp;
- FTSENT *p, *root;
- FTSENT *parent, *tmp;
- size_t len, nitems;
-
- /* Options check. */
- if (options & ~FTS_OPTIONMASK) {
- errno = EINVAL;
- return (NULL);
- }
-
- /* fts_open() requires at least one path */
- if (*argv == NULL) {
- errno = EINVAL;
- return (NULL);
- }
-
- /* Allocate/initialize the stream. */
- if ((priv = calloc(1, sizeof(*priv))) == NULL)
- return (NULL);
- sp = &priv->ftsp_fts;
- sp->fts_compar = compar;
- sp->fts_options = options;
-
- /* Shush, GCC. */
- tmp = NULL;
-
- /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
- if (ISSET(FTS_LOGICAL))
- SET(FTS_NOCHDIR);
-
- /*
- * Start out with 1K of path space, and enough, in any case,
- * to hold the user's paths.
- */
- if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
- goto mem1;
-
- /* Allocate/initialize root's parent. */
- if ((parent = fts_alloc(sp, "", 0)) == NULL)
- goto mem2;
- parent->fts_level = FTS_ROOTPARENTLEVEL;
-
- /* Allocate/initialize root(s). */
- for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
- len = strlen(*argv);
-
- p = fts_alloc(sp, *argv, len);
- p->fts_level = FTS_ROOTLEVEL;
- p->fts_parent = parent;
- p->fts_accpath = p->fts_name;
- p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
-
- /* Command-line "." and ".." are real directories. */
- if (p->fts_info == FTS_DOT)
- p->fts_info = FTS_D;
-
- /*
- * If comparison routine supplied, traverse in sorted
- * order; otherwise traverse in the order specified.
- */
- if (compar) {
- p->fts_link = root;
- root = p;
- } else {
- p->fts_link = NULL;
- if (root == NULL)
- tmp = root = p;
- else {
- tmp->fts_link = p;
- tmp = p;
- }
- }
- }
- if (compar && nitems > 1)
- root = fts_sort(sp, root, nitems);
-
- /*
- * Allocate a dummy pointer and make fts_read think that we've just
- * finished the node before the root(s); set p->fts_info to FTS_INIT
- * so that everything about the "current" node is ignored.
- */
- if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
- goto mem3;
- sp->fts_cur->fts_link = root;
- sp->fts_cur->fts_info = FTS_INIT;
-
- /*
- * If using chdir(2), grab a file descriptor pointing to dot to ensure
- * that we can get back here; this could be avoided for some paths,
- * but almost certainly not worth the effort. Slashes, symbolic links,
- * and ".." are all fairly nasty problems. Note, if we can't get the
- * descriptor we run anyway, just more slowly.
- */
- if (!ISSET(FTS_NOCHDIR) &&
- (sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
- SET(FTS_NOCHDIR);
-
- return (sp);
-
-mem3: fts_lfree(root);
- free(parent);
-mem2: free(sp->fts_path);
-mem1: free(sp);
- return (NULL);
-}
-
-static void
-fts_load(FTS *sp, FTSENT *p)
-{
- size_t len;
- char *cp;
-
- /*
- * Load the stream structure for the next traversal. Since we don't
- * actually enter the directory until after the preorder visit, set
- * the fts_accpath field specially so the chdir gets done to the right
- * place and the user can access the first node. From fts_open it's
- * known that the path will fit.
- */
- len = p->fts_pathlen = p->fts_namelen;
- memmove(sp->fts_path, p->fts_name, len + 1);
- if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
- len = strlen(++cp);
- memmove(p->fts_name, cp, len + 1);
- p->fts_namelen = len;
- }
- p->fts_accpath = p->fts_path = sp->fts_path;
- sp->fts_dev = p->fts_dev;
-}
-
-int
-fts_close(FTS *sp)
-{
- FTSENT *freep, *p;
- int saved_errno;
-
- /*
- * This still works if we haven't read anything -- the dummy structure
- * points to the root list, so we step through to the end of the root
- * list which has a valid parent pointer.
- */
- if (sp->fts_cur) {
- for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
- freep = p;
- p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
- free(freep);
- }
- free(p);
- }
-
- /* Free up child linked list, sort array, path buffer. */
- if (sp->fts_child)
- fts_lfree(sp->fts_child);
- if (sp->fts_array)
- free(sp->fts_array);
- free(sp->fts_path);
-
- /* Return to original directory, save errno if necessary. */
- if (!ISSET(FTS_NOCHDIR)) {
- saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
- (void)close(sp->fts_rfd);
-
- /* Set errno and return. */
- if (saved_errno != 0) {
- /* Free up the stream pointer. */
- free(sp);
- errno = saved_errno;
- return (-1);
- }
- }
-
- /* Free up the stream pointer. */
- free(sp);
- return (0);
-}
-
-/*
- * Special case of "/" at the end of the path so that slashes aren't
- * appended which would cause paths to be written as "....//foo".
- */
-#define NAPPEND(p) \
- (p->fts_path[p->fts_pathlen - 1] == '/' \
- ? p->fts_pathlen - 1 : p->fts_pathlen)
-
-FTSENT *
-fts_read(FTS *sp)
-{
- FTSENT *p, *tmp;
- int instr;
- char *t;
- int saved_errno;
-
- /* If finished or unrecoverable error, return NULL. */
- if (sp->fts_cur == NULL || ISSET(FTS_STOP))
- return (NULL);
-
- /* Set current node pointer. */
- p = sp->fts_cur;
-
- /* Save and zero out user instructions. */
- instr = p->fts_instr;
- p->fts_instr = FTS_NOINSTR;
-
- /* Any type of file may be re-visited; re-stat and re-turn. */
- if (instr == FTS_AGAIN) {
- p->fts_info = fts_stat(sp, p, 0);
- return (p);
- }
-
- /*
- * Following a symlink -- SLNONE test allows application to see
- * SLNONE and recover. If indirecting through a symlink, have
- * keep a pointer to current location. If unable to get that
- * pointer, follow fails.
- */
- if (instr == FTS_FOLLOW &&
- (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
- p->fts_info = fts_stat(sp, p, 1);
- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
- if ((p->fts_symfd = open(".", O_RDONLY | O_CLOEXEC,
- 0)) < 0) {
- p->fts_errno = errno;
- p->fts_info = FTS_ERR;
- } else
- p->fts_flags |= FTS_SYMFOLLOW;
- }
- return (p);
- }
-
- /* Directory in pre-order. */
- if (p->fts_info == FTS_D) {
- /* If skipped or crossed mount point, do post-order visit. */
- if (instr == FTS_SKIP ||
- (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
- if (p->fts_flags & FTS_SYMFOLLOW)
- (void)close(p->fts_symfd);
- if (sp->fts_child) {
- fts_lfree(sp->fts_child);
- sp->fts_child = NULL;
- }
- p->fts_info = FTS_DP;
- return (p);
- }
-
- /* Rebuild if only read the names and now traversing. */
- if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
- CLR(FTS_NAMEONLY);
- fts_lfree(sp->fts_child);
- sp->fts_child = NULL;
- }
-
- /*
- * Cd to the subdirectory.
- *
- * If have already read and now fail to chdir, whack the list
- * to make the names come out right, and set the parent errno
- * so the application will eventually get an error condition.
- * Set the FTS_DONTCHDIR flag so that when we logically change
- * directories back to the parent we don't do a chdir.
- *
- * If haven't read do so. If the read fails, fts_build sets
- * FTS_STOP or the fts_info field of the node.
- */
- if (sp->fts_child != NULL) {
- if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
- p->fts_errno = errno;
- p->fts_flags |= FTS_DONTCHDIR;
- for (p = sp->fts_child; p != NULL;
- p = p->fts_link)
- p->fts_accpath =
- p->fts_parent->fts_accpath;
- }
- } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
- if (ISSET(FTS_STOP))
- return (NULL);
- return (p);
- }
- p = sp->fts_child;
- sp->fts_child = NULL;
- goto name;
- }
-
- /* Move to the next node on this level. */
-next: tmp = p;
- if ((p = p->fts_link) != NULL) {
- /*
- * If reached the top, return to the original directory (or
- * the root of the tree), and load the paths for the next root.
- */
- if (p->fts_level == FTS_ROOTLEVEL) {
- if (FCHDIR(sp, sp->fts_rfd)) {
- SET(FTS_STOP);
- return (NULL);
- }
- free(tmp);
- fts_load(sp, p);
- return (sp->fts_cur = p);
- }
-
- /*
- * User may have called fts_set on the node. If skipped,
- * ignore. If followed, get a file descriptor so we can
- * get back if necessary.
- */
- if (p->fts_instr == FTS_SKIP) {
- free(tmp);
- goto next;
- }
- if (p->fts_instr == FTS_FOLLOW) {
- p->fts_info = fts_stat(sp, p, 1);
- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
- if ((p->fts_symfd =
- open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) {
- p->fts_errno = errno;
- p->fts_info = FTS_ERR;
- } else
- p->fts_flags |= FTS_SYMFOLLOW;
- }
- p->fts_instr = FTS_NOINSTR;
- }
-
- free(tmp);
-
-name: t = sp->fts_path + NAPPEND(p->fts_parent);
- *t++ = '/';
- memmove(t, p->fts_name, p->fts_namelen + 1);
- return (sp->fts_cur = p);
- }
-
- /* Move up to the parent node. */
- p = tmp->fts_parent;
-
- if (p->fts_level == FTS_ROOTPARENTLEVEL) {
- /*
- * Done; free everything up and set errno to 0 so the user
- * can distinguish between error and EOF.
- */
- free(tmp);
- free(p);
- errno = 0;
- return (sp->fts_cur = NULL);
- }
-
- /* NUL terminate the pathname. */
- sp->fts_path[p->fts_pathlen] = '\0';
-
- /*
- * Return to the parent directory. If at a root node or came through
- * a symlink, go back through the file descriptor. Otherwise, cd up
- * one directory.
- */
- if (p->fts_level == FTS_ROOTLEVEL) {
- if (FCHDIR(sp, sp->fts_rfd)) {
- SET(FTS_STOP);
- return (NULL);
- }
- } else if (p->fts_flags & FTS_SYMFOLLOW) {
- if (FCHDIR(sp, p->fts_symfd)) {
- saved_errno = errno;
- (void)close(p->fts_symfd);
- errno = saved_errno;
- SET(FTS_STOP);
- return (NULL);
- }
- (void)close(p->fts_symfd);
- } else if (!(p->fts_flags & FTS_DONTCHDIR) &&
- fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
- SET(FTS_STOP);
- return (NULL);
- }
- free(tmp);
- p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
- return (sp->fts_cur = p);
-}
-
-/*
- * Fts_set takes the stream as an argument although it's not used in this
- * implementation; it would be necessary if anyone wanted to add global
- * semantics to fts using fts_set. An error return is allowed for similar
- * reasons.
- */
-/* ARGSUSED */
-int
-fts_set(FTS *sp, FTSENT *p, int instr)
-{
- if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
- instr != FTS_NOINSTR && instr != FTS_SKIP) {
- errno = EINVAL;
- return (1);
- }
- p->fts_instr = instr;
- return (0);
-}
-
-FTSENT *
-fts_children(FTS *sp, int instr)
-{
- FTSENT *p;
- int fd;
-
- if (instr != 0 && instr != FTS_NAMEONLY) {
- errno = EINVAL;
- return (NULL);
- }
-
- /* Set current node pointer. */
- p = sp->fts_cur;
-
- /*
- * Errno set to 0 so user can distinguish empty directory from
- * an error.
- */
- errno = 0;
-
- /* Fatal errors stop here. */
- if (ISSET(FTS_STOP))
- return (NULL);
-
- /* Return logical hierarchy of user's arguments. */
- if (p->fts_info == FTS_INIT)
- return (p->fts_link);
-
- /*
- * If not a directory being visited in pre-order, stop here. Could
- * allow FTS_DNR, assuming the user has fixed the problem, but the
- * same effect is available with FTS_AGAIN.
- */
- if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
- return (NULL);
-
- /* Free up any previous child list. */
- if (sp->fts_child != NULL)
- fts_lfree(sp->fts_child);
-
- if (instr == FTS_NAMEONLY) {
- SET(FTS_NAMEONLY);
- instr = BNAMES;
- } else
- instr = BCHILD;
-
- /*
- * If using chdir on a relative path and called BEFORE fts_read does
- * its chdir to the root of a traversal, we can lose -- we need to
- * chdir into the subdirectory, and we don't know where the current
- * directory is, so we can't get back so that the upcoming chdir by
- * fts_read will work.
- */
- if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
- ISSET(FTS_NOCHDIR))
- return (sp->fts_child = fts_build(sp, instr));
-
- if ((fd = open(".", O_RDONLY | O_CLOEXEC, 0)) < 0)
- return (NULL);
- sp->fts_child = fts_build(sp, instr);
- if (fchdir(fd)) {
- (void)close(fd);
- return (NULL);
- }
- (void)close(fd);
- return (sp->fts_child);
-}
-
-#ifndef fts_get_clientptr
-#error "fts_get_clientptr not defined"
-#endif
-
-void *
-(fts_get_clientptr)(FTS *sp)
-{
-
- return (fts_get_clientptr(sp));
-}
-
-#ifndef fts_get_stream
-#error "fts_get_stream not defined"
-#endif
-
-FTS *
-(fts_get_stream)(FTSENT *p)
-{
- return (fts_get_stream(p));
-}
-
-void
-fts_set_clientptr(FTS *sp, void *clientptr)
-{
-
- sp->fts_clientptr = clientptr;
-}
-
-/*
- * This is the tricky part -- do not casually change *anything* in here. The
- * idea is to build the linked list of entries that are used by fts_children
- * and fts_read. There are lots of special cases.
- *
- * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is
- * set and it's a physical walk (so that symbolic links can't be directories),
- * we can do things quickly. First, if it's a 4.4BSD file system, the type
- * of the file is in the directory entry. Otherwise, we assume that the number
- * of subdirectories in a node is equal to the number of links to the parent.
- * The former skips all stat calls. The latter skips stat calls in any leaf
- * directories and for any files after the subdirectories in the directory have
- * been found, cutting the stat calls by about 2/3.
- */
-static FTSENT *
-fts_build(FTS *sp, int type)
-{
- struct dirent *dp;
- FTSENT *p, *head;
- FTSENT *cur, *tail;
- DIR *dirp;
- void *oldaddr;
- char *cp;
- int cderrno, descend, oflag, saved_errno, nostat, doadjust;
- long level;
- long nlinks; /* has to be signed because -1 is a magic value */
- size_t dnamlen, len, maxlen, nitems;
-
- /* Set current node pointer. */
- cur = sp->fts_cur;
-
- /*
- * Open the directory for reading. If this fails, we're done.
- * If being called from fts_read, set the fts_info field.
- */
-#if defined FTS_WHITEOUT && !defined (__native_client__)
- if (ISSET(FTS_WHITEOUT))
- oflag = DTF_NODUP | DTF_REWIND;
- else
- oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
-#else
-#define __opendir2(path, flag) opendir(path)
-#endif
- if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) {
- if (type == BREAD) {
- cur->fts_info = FTS_DNR;
- cur->fts_errno = errno;
- }
- return (NULL);
- }
-
- /*
- * Nlinks is the number of possible entries of type directory in the
- * directory if we're cheating on stat calls, 0 if we're not doing
- * any stat calls at all, -1 if we're doing stats on everything.
- */
- if (type == BNAMES) {
- nlinks = 0;
- /* Be quiet about nostat, GCC. */
- nostat = 0;
- } else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
-#ifdef __native_client__
- nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
-#else
- if (fts_ufslinks(sp, cur))
- nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
- else
- nlinks = -1;
-#endif
- nostat = 1;
- } else {
- nlinks = -1;
- nostat = 0;
- }
-
-#ifdef notdef
- (void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink);
- (void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n",
- ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT));
-#endif
- /*
- * If we're going to need to stat anything or we want to descend
- * and stay in the directory, chdir. If this fails we keep going,
- * but set a flag so we don't chdir after the post-order visit.
- * We won't be able to stat anything, but we can still return the
- * names themselves. Note, that since fts_read won't be able to
- * chdir into the directory, it will have to return different path
- * names than before, i.e. "a/b" instead of "b". Since the node
- * has already been visited in pre-order, have to wait until the
- * post-order visit to return the error. There is a special case
- * here, if there was nothing to stat then it's not an error to
- * not be able to stat. This is all fairly nasty. If a program
- * needed sorted entries or stat information, they had better be
- * checking FTS_NS on the returned nodes.
- */
- cderrno = 0;
- if (nlinks || type == BREAD) {
- if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
- if (nlinks && type == BREAD)
- cur->fts_errno = errno;
- cur->fts_flags |= FTS_DONTCHDIR;
- descend = 0;
- cderrno = errno;
- } else
- descend = 1;
- } else
- descend = 0;
-
- /*
- * Figure out the max file name length that can be stored in the
- * current path -- the inner loop allocates more path as necessary.
- * We really wouldn't have to do the maxlen calculations here, we
- * could do them in fts_read before returning the path, but it's a
- * lot easier here since the length is part of the dirent structure.
- *
- * If not changing directories set a pointer so that can just append
- * each new name into the path.
- */
- len = NAPPEND(cur);
- if (ISSET(FTS_NOCHDIR)) {
- cp = sp->fts_path + len;
- *cp++ = '/';
- } else {
- /* GCC, you're too verbose. */
- cp = NULL;
- }
- len++;
- maxlen = sp->fts_pathlen - len;
-
- level = cur->fts_level + 1;
-
- /* Read the directory, attaching each entry to the `link' pointer. */
- doadjust = 0;
- for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
- dnamlen = strlen(dp->d_name);
- if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
- continue;
-
- if ((p = fts_alloc(sp, dp->d_name, dnamlen)) == NULL)
- goto mem1;
- if (dnamlen >= maxlen) { /* include space for NUL */
- oldaddr = sp->fts_path;
- if (fts_palloc(sp, dnamlen + len + 1)) {
- /*
- * No more memory for path or structures. Save
- * errno, free up the current structure and the
- * structures already allocated.
- */
-mem1: saved_errno = errno;
- if (p)
- free(p);
- fts_lfree(head);
- (void)closedir(dirp);
- cur->fts_info = FTS_ERR;
- SET(FTS_STOP);
- errno = saved_errno;
- return (NULL);
- }
- /* Did realloc() change the pointer? */
- if (oldaddr != sp->fts_path) {
- doadjust = 1;
- if (ISSET(FTS_NOCHDIR))
- cp = sp->fts_path + len;
- }
- maxlen = sp->fts_pathlen - len;
- }
-
- p->fts_level = level;
- p->fts_parent = sp->fts_cur;
- p->fts_pathlen = len + dnamlen;
-
-#if defined (FTS_WHITEOUT) && !(defined __native_client__)
- if (dp->d_type == DT_WHT)
- p->fts_flags |= FTS_ISW;
-#endif
-
- if (cderrno) {
- if (nlinks) {
- p->fts_info = FTS_NS;
- p->fts_errno = cderrno;
- } else
- p->fts_info = FTS_NSOK;
- p->fts_accpath = cur->fts_accpath;
- } else if (nlinks == 0
-#ifdef DT_DIR
- || (nostat &&
- dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
-#endif
- ) {
- p->fts_accpath =
- ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
- p->fts_info = FTS_NSOK;
- } else {
- /* Build a file name for fts_stat to stat. */
- if (ISSET(FTS_NOCHDIR)) {
- p->fts_accpath = p->fts_path;
- memmove(cp, p->fts_name, p->fts_namelen + 1);
- } else
- p->fts_accpath = p->fts_name;
- /* Stat it. */
- p->fts_info = fts_stat(sp, p, 0);
-
- /* Decrement link count if applicable. */
- if (nlinks > 0 && (p->fts_info == FTS_D ||
- p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
- --nlinks;
- }
-
- /* We walk in directory order so "ls -f" doesn't get upset. */
- p->fts_link = NULL;
- if (head == NULL)
- head = tail = p;
- else {
- tail->fts_link = p;
- tail = p;
- }
- ++nitems;
- }
- if (dirp)
- (void)closedir(dirp);
-
- /*
- * If realloc() changed the address of the path, adjust the
- * addresses for the rest of the tree and the dir list.
- */
- if (doadjust)
- fts_padjust(sp, head);
-
- /*
- * If not changing directories, reset the path back to original
- * state.
- */
- if (ISSET(FTS_NOCHDIR))
- sp->fts_path[cur->fts_pathlen] = '\0';
-
- /*
- * If descended after called from fts_children or after called from
- * fts_read and nothing found, get back. At the root level we use
- * the saved fd; if one of fts_open()'s arguments is a relative path
- * to an empty directory, we wind up here with no other way back. If
- * can't get back, we're done.
- */
- if (descend && (type == BCHILD || !nitems) &&
- (cur->fts_level == FTS_ROOTLEVEL ?
- FCHDIR(sp, sp->fts_rfd) :
- fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
- cur->fts_info = FTS_ERR;
- SET(FTS_STOP);
- return (NULL);
- }
-
- /* If didn't find anything, return NULL. */
- if (!nitems) {
- if (type == BREAD)
- cur->fts_info = FTS_DP;
- return (NULL);
- }
-
- /* Sort the entries. */
- if (sp->fts_compar && nitems > 1)
- head = fts_sort(sp, head, nitems);
- return (head);
-}
-
-static int
-fts_stat(FTS *sp, FTSENT *p, int follow)
-{
- FTSENT *t;
- dev_t dev;
- ino_t ino;
- struct stat *sbp, sb;
- int saved_errno;
-
- /* If user needs stat info, stat buffer already allocated. */
- sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
-
-#if defined (FTS_WHITEOUT) && !defined(__native_client__)
- /* Check for whiteout. */
- if (p->fts_flags & FTS_ISW) {
- if (sbp != &sb) {
- memset(sbp, '\0', sizeof(*sbp));
- sbp->st_mode = S_IFWHT;
- }
- return (FTS_W);
- }
-#endif
-
- /*
- * If doing a logical walk, or application requested FTS_FOLLOW, do
- * a stat(2). If that fails, check for a non-existent symlink. If
- * fail, set the errno from the stat call.
- */
- if (ISSET(FTS_LOGICAL) || follow) {
- if (stat(p->fts_accpath, sbp)) {
- saved_errno = errno;
- if (!lstat(p->fts_accpath, sbp)) {
- errno = 0;
- return (FTS_SLNONE);
- }
- p->fts_errno = saved_errno;
- goto err;
- }
- } else if (lstat(p->fts_accpath, sbp)) {
- p->fts_errno = errno;
-err: memset(sbp, 0, sizeof(struct stat));
- return (FTS_NS);
- }
-
- if (S_ISDIR(sbp->st_mode)) {
- /*
- * Set the device/inode. Used to find cycles and check for
- * crossing mount points. Also remember the link count, used
- * in fts_build to limit the number of stat calls. It is
- * understood that these fields are only referenced if fts_info
- * is set to FTS_D.
- */
- dev = p->fts_dev = sbp->st_dev;
- ino = p->fts_ino = sbp->st_ino;
- p->fts_nlink = sbp->st_nlink;
-
- if (ISDOT(p->fts_name))
- return (FTS_DOT);
-
- /*
- * Cycle detection is done by brute force when the directory
- * is first encountered. If the tree gets deep enough or the
- * number of symbolic links to directories is high enough,
- * something faster might be worthwhile.
- */
- for (t = p->fts_parent;
- t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
- if (ino == t->fts_ino && dev == t->fts_dev) {
- p->fts_cycle = t;
- return (FTS_DC);
- }
- return (FTS_D);
- }
- if (S_ISLNK(sbp->st_mode))
- return (FTS_SL);
- if (S_ISREG(sbp->st_mode))
- return (FTS_F);
- return (FTS_DEFAULT);
-}
-
-/*
- * The comparison function takes pointers to pointers to FTSENT structures.
- * Qsort wants a comparison function that takes pointers to void.
- * (Both with appropriate levels of const-poisoning, of course!)
- * Use a trampoline function to deal with the difference.
- */
-static int
-fts_compar(const void *a, const void *b)
-{
- FTS *parent;
-
- parent = (*(const FTSENT * const *)a)->fts_fts;
- return (*parent->fts_compar)(a, b);
-}
-
-static FTSENT *
-fts_sort(FTS *sp, FTSENT *head, size_t nitems)
-{
- FTSENT **ap, *p;
-
- /*
- * Construct an array of pointers to the structures and call qsort(3).
- * Reassemble the array in the order returned by qsort. If unable to
- * sort for memory reasons, return the directory entries in their
- * current order. Allocate enough space for the current needs plus
- * 40 so don't realloc one entry at a time.
- */
- if (nitems > sp->fts_nitems) {
- sp->fts_nitems = nitems + 40;
- if ((sp->fts_array = reallocf(sp->fts_array,
- sp->fts_nitems * sizeof(FTSENT *))) == NULL) {
- sp->fts_nitems = 0;
- return (head);
- }
- }
- for (ap = sp->fts_array, p = head; p; p = p->fts_link)
- *ap++ = p;
- qsort(sp->fts_array, nitems, sizeof(FTSENT *), fts_compar);
- for (head = *(ap = sp->fts_array); --nitems; ++ap)
- ap[0]->fts_link = ap[1];
- ap[0]->fts_link = NULL;
- return (head);
-}
-
-static FTSENT *
-fts_alloc(FTS *sp, char *name, size_t namelen)
-{
- FTSENT *p;
- size_t len;
-
- struct ftsent_withstat {
- FTSENT ent;
- struct stat statbuf;
- };
-
- /*
- * The file name is a variable length array and no stat structure is
- * necessary if the user has set the nostat bit. Allocate the FTSENT
- * structure, the file name and the stat structure in one chunk, but
- * be careful that the stat structure is reasonably aligned.
- */
- if (ISSET(FTS_NOSTAT))
- len = sizeof(FTSENT) + namelen + 1;
- else
- len = sizeof(struct ftsent_withstat) + namelen + 1;
-
- if ((p = malloc(len)) == NULL)
- return (NULL);
-
- if (ISSET(FTS_NOSTAT)) {
- p->fts_name = (char *)(p + 1);
- p->fts_statp = NULL;
- } else {
- p->fts_name = (char *)((struct ftsent_withstat *)p + 1);
- p->fts_statp = &((struct ftsent_withstat *)p)->statbuf;
- }
-
- /* Copy the name and guarantee NUL termination. */
- memcpy(p->fts_name, name, namelen);
- p->fts_name[namelen] = '\0';
- p->fts_namelen = namelen;
- p->fts_path = sp->fts_path;
- p->fts_errno = 0;
- p->fts_flags = 0;
- p->fts_instr = FTS_NOINSTR;
- p->fts_number = 0;
- p->fts_pointer = NULL;
- p->fts_fts = sp;
- return (p);
-}
-
-static void
-fts_lfree(FTSENT *head)
-{
- FTSENT *p;
-
- /* Free a linked list of structures. */
- while ((p = head)) {
- head = head->fts_link;
- free(p);
- }
-}
-
-/*
- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
- * though the kernel won't resolve them. Add the size (not just what's needed)
- * plus 256 bytes so don't realloc the path 2 bytes at a time.
- */
-static int
-fts_palloc(FTS *sp, size_t more)
-{
-
- sp->fts_pathlen += more + 256;
- sp->fts_path = reallocf(sp->fts_path, sp->fts_pathlen);
- return (sp->fts_path == NULL);
-}
-
-/*
- * When the path is realloc'd, have to fix all of the pointers in structures
- * already returned.
- */
-static void
-fts_padjust(FTS *sp, FTSENT *head)
-{
- FTSENT *p;
- char *addr = sp->fts_path;
-
-#define ADJUST(p) do { \
- if ((p)->fts_accpath != (p)->fts_name) { \
- (p)->fts_accpath = \
- (char *)addr + ((p)->fts_accpath - (p)->fts_path); \
- } \
- (p)->fts_path = addr; \
-} while (0)
- /* Adjust the current set of children. */
- for (p = sp->fts_child; p; p = p->fts_link)
- ADJUST(p);
-
- /* Adjust the rest of the tree, including the current level. */
- for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
- ADJUST(p);
- p = p->fts_link ? p->fts_link : p->fts_parent;
- }
-}
-
-static size_t
-fts_maxarglen(argv)
- char * const *argv;
-{
- size_t len, max;
-
- for (max = 0; *argv; ++argv)
- if ((len = strlen(*argv)) > max)
- max = len;
- return (max + 1);
-}
-
-/*
- * Change to dir specified by fd or p->fts_accpath without getting
- * tricked by someone changing the world out from underneath us.
- * Assumes p->fts_dev and p->fts_ino are filled in.
- */
-static int
-fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
-{
- int ret, oerrno, newfd;
- struct stat sb;
-
- newfd = fd;
- if (ISSET(FTS_NOCHDIR))
- return (0);
- if (fd < 0 && (newfd = open(path, O_RDONLY | O_DIRECTORY |
- O_CLOEXEC, 0)) < 0)
- return (-1);
- if (fstat(newfd, &sb)) {
- ret = -1;
- goto bail;
- }
- if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
- errno = ENOENT; /* disinformation */
- ret = -1;
- goto bail;
- }
- ret = fchdir(newfd);
-bail:
- oerrno = errno;
- if (fd < 0)
- (void)close(newfd);
- errno = oerrno;
- return (ret);
-}
-
-// native client does not implement statfs
-#ifndef __native_client__
-/*
- * Check if the filesystem for "ent" has UFS-style links.
- */
-static int
-fts_ufslinks(FTS *sp, const FTSENT *ent)
-{
- struct _fts_private *priv;
- const char **cpp;
-
- priv = (struct _fts_private *)sp;
- /*
- * If this node's device is different from the previous, grab
- * the filesystem information, and decide on the reliability
- * of the link information from this filesystem for stat(2)
- * avoidance.
- */
- if (priv->ftsp_dev != ent->fts_dev) {
- if (statfs(ent->fts_path, &priv->ftsp_statfs) != -1) {
- priv->ftsp_dev = ent->fts_dev;
- priv->ftsp_linksreliable = 0;
- for (cpp = ufslike_filesystems; *cpp; cpp++) {
- if (strcmp(priv->ftsp_statfs.f_fstypename,
- *cpp) == 0) {
- priv->ftsp_linksreliable = 1;
- break;
- }
- }
- } else {
- priv->ftsp_linksreliable = 0;
- }
- }
- return (priv->ftsp_linksreliable);
-}
-#endif
diff --git a/ports/glibc-compat/src/getpass.c b/ports/glibc-compat/src/getpass.c
deleted file mode 100644
index 79ae474..0000000
--- a/ports/glibc-compat/src/getpass.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <errno.h>
-#include <unistd.h>
-
-char *getpass(const char *prompt) {
- errno = ENXIO;
- return 0;
-}
diff --git a/ports/glibc-compat/src/getprotobyname_r.c b/ports/glibc-compat/src/getprotobyname_r.c
deleted file mode 100644
index 9c7253d..0000000
--- a/ports/glibc-compat/src/getprotobyname_r.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
-#include <netdb.h>
-
-struct protoent *getprotobyname(const char *name) {
- return NULL;
-}
-
-int __getprotobyname_r(const char *name,
- struct protoent *result_buf, char *buf,
- size_t buflen, struct protoent **result)
-{
- *result = NULL;
- return 1;
-}
diff --git a/ports/glibc-compat/src/getservbyname_r.c b/ports/glibc-compat/src/getservbyname_r.c
deleted file mode 100644
index 64e737c..0000000
--- a/ports/glibc-compat/src/getservbyname_r.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * 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.
- */
-#include <netdb.h>
-
-struct servent *
-getservbyname(const char *name, const char *proto)
-{
- return NULL;
-}
-
-int __getservbyname_r(const char *name, const char *proto,
- struct servent *result_buf, char *buf,
- size_t buflen, struct servent **result)
-{
- *result = NULL;
- return 1;
-}
diff --git a/ports/glibc-compat/src/herrno.c b/ports/glibc-compat/src/herrno.c
deleted file mode 100644
index bb6d3f5..0000000
--- a/ports/glibc-compat/src/herrno.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <reent.h>
-
-int *__h_errno_location() {
- return &(_REENT->_new._reent._h_errno);
-}
-
diff --git a/ports/glibc-compat/src/herror.c b/ports/glibc-compat/src/herror.c
deleted file mode 100644
index 5a9e9f1..0000000
--- a/ports/glibc-compat/src/herror.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/uio.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <string.h>
-
-const char *const h_errlist[] = {
- "Resolver Error 0 (no error)",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
-};
-const int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
-
-extern int h_errno;
-
-/*
- * herror --
- * print the error indicated by the h_errno value.
- */
-void
-herror(const char *s) {
- struct iovec iov[4];
- struct iovec *v = iov;
-
- if (s != NULL && *s != '\0') {
- v->iov_base = (/*noconst*/ char *)s;
- v->iov_len = strlen(s);
- v++;
- v->iov_base = ": ";
- v->iov_len = 2;
- v++;
- }
- v->iov_base = (char *)hstrerror(h_errno);
- v->iov_len = strlen(v->iov_base);
- v++;
- v->iov_base = "\n";
- v->iov_len = 1;
- writev(STDERR_FILENO, iov, (v - iov) + 1);
-}
-
-/*
- * hstrerror --
- * return the string associated with a given "host" errno value.
- */
-const char *
-hstrerror(int err) {
- if (err < 0)
- return ("Resolver internal error");
- else if (err < h_nerr)
- return (h_errlist[err]);
- return ("Unknown resolver error");
-}
diff --git a/ports/glibc-compat/src/hp-timing.h b/ports/glibc-compat/src/hp-timing.h
deleted file mode 100644
index 86b275f..0000000
--- a/ports/glibc-compat/src/hp-timing.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _HP_TIMING_H
-#define _HP_TIMING_H 1
-
-/* Just dummy stubs. */
-#define HP_TIMING_AVAIL (0)
-#define HP_TIMING_INLINE (0)
-typedef int hp_timing_t;
-#define HP_TIMING_ZERO(Var)
-#define HP_TIMING_NOW(var)
-#define HP_TIMING_DIFF_INIT()
-#define HP_TIMING_DIFF(Diff, Start, End)
-#define HP_TIMING_ACCUM(Sum, Diff)
-#define HP_TIMING_ACCUM_NT(Sum, Diff)
-#define HP_TIMING_PRINT(Buf, Len, Val)
-
-/* Since this implementation is not available we tell the user about it. */
-#define HP_TIMING_NONAVAIL 1
-
-#endif /* hp-timing.h */
diff --git a/ports/glibc-compat/src/in6_addr.c b/ports/glibc-compat/src/in6_addr.c
deleted file mode 100644
index 88a98bc..0000000
--- a/ports/glibc-compat/src/in6_addr.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <netinet/in.h>
-
-const struct in6_addr in6addr_any =
-{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
-const struct in6_addr in6addr_loopback =
-{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
diff --git a/ports/glibc-compat/src/inet_addr.c b/ports/glibc-compat/src/inet_addr.c
deleted file mode 100644
index 87e2a6b..0000000
--- a/ports/glibc-compat/src/inet_addr.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* $KAME: inet_addr.c,v 1.5 2001/08/20 02:32:40 itojun Exp $ */
-
-/*
- * ++Copyright++ 1983, 1990, 1993
- * -
- * Copyright (c) 1983, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <machine/endian.h>
-
-#include <sys/param.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-/*
- * ASCII internet address interpretation routine.
- * The value returned is in network order.
- */
-in_addr_t /* XXX should be struct in_addr :( */
-inet_addr(cp)
- const char *cp;
-{
- struct in_addr val;
-
- if (inet_aton(cp, &val))
- return (val.s_addr);
- return (INADDR_NONE);
-}
-
-/*
- * Check whether "cp" is a valid ASCII representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
-int
-inet_aton(cp, addr)
- const char *cp;
- struct in_addr *addr;
-{
- u_long parts[4];
- in_addr_t val;
- char *c;
- char *endptr;
- int gotend, n;
-
- c = (char *)cp;
- n = 0;
- /*
- * Run through the string, grabbing numbers until
- * the end of the string, or some error
- */
- gotend = 0;
- while (!gotend) {
- errno = 0;
- val = strtoul(c, &endptr, 0);
-
- if (errno == ERANGE) /* Fail completely if it overflowed. */
- return (0);
-
- /*
- * If the whole string is invalid, endptr will equal
- * c.. this way we can make sure someone hasn't
- * gone '.12' or something which would get past
- * the next check.
- */
- if (endptr == c)
- return (0);
- parts[n] = val;
- c = endptr;
-
- /* Check the next character past the previous number's end */
- switch (*c) {
- case '.' :
- /* Make sure we only do 3 dots .. */
- if (n == 3) /* Whoops. Quit. */
- return (0);
- n++;
- c++;
- break;
-
- case '\0':
- gotend = 1;
- break;
-
- default:
- if (isspace((unsigned char)*c)) {
- gotend = 1;
- break;
- } else
- return (0); /* Invalid character, so fail */
- }
-
- }
-
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
-
- switch (n) {
- case 0: /* a -- 32 bits */
- /*
- * Nothing is necessary here. Overflow checking was
- * already done in strtoul().
- */
- break;
- case 1: /* a.b -- 8.24 bits */
- if (val > 0xffffff || parts[0] > 0xff)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 2: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 3: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff ||
- parts[2] > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
-
- if (addr != NULL)
- addr->s_addr = htonl(val);
- return (1);
-}
-
-#if 0
-/*
- * Weak aliases for applications that use certain private entry points,
- * and fail to include <arpa/inet.h>.
- */
-#undef inet_addr
-__weak_reference(__inet_addr, inet_addr);
-#undef inet_aton
-__weak_reference(__inet_aton, inet_aton);
-#endif
diff --git a/ports/glibc-compat/src/inet_pton.c b/ports/glibc-compat/src/inet_pton.c
deleted file mode 100644
index a6dc803..0000000
--- a/ports/glibc-compat/src/inet_pton.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/* $KAME: inet_pton.c,v 1.5 2001/08/20 02:32:40 itojun Exp $ */
-
-/* Copyright (c) 1996 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <string.h>
-#include <errno.h>
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static int inet_pton4(const char *src, u_char *dst);
-static int inet_pton6(const char *src, u_char *dst);
-
-/* int
- * inet_pton(af, src, dst)
- * convert from presentation format (which usually means ASCII printable)
- * to network format (which is usually some kind of binary format).
- * return:
- * 1 if the address was valid for the specified address family
- * 0 if the address wasn't valid (`dst' is untouched in this case)
- * -1 if some other error occurred (`dst' is untouched in this case, too)
- * author:
- * Paul Vixie, 1996.
- */
-int
-inet_pton(af, src, dst)
- int af;
- const char *src;
- void *dst;
-{
- switch (af) {
- case AF_INET:
- return (inet_pton4(src, dst));
- case AF_INET6:
- return (inet_pton6(src, dst));
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
- /* NOTREACHED */
-}
-
-/* int
- * inet_pton4(src, dst)
- * like inet_aton() but without all the hexadecimal and shorthand.
- * return:
- * 1 if `src' is a valid dotted quad, else 0.
- * notice:
- * does not touch `dst' unless it's returning 1.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton4(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char digits[] = "0123456789";
- int saw_digit, octets, ch;
- u_char tmp[NS_INADDRSZ], *tp;
-
- saw_digit = 0;
- octets = 0;
- *(tp = tmp) = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr(digits, ch)) != NULL) {
- u_int new = *tp * 10 + (pch - digits);
-
- if (new > 255)
- return (0);
- *tp = new;
- if (! saw_digit) {
- if (++octets > 4)
- return (0);
- saw_digit = 1;
- }
- } else if (ch == '.' && saw_digit) {
- if (octets == 4)
- return (0);
- *++tp = 0;
- saw_digit = 0;
- } else
- return (0);
- }
- if (octets < 4)
- return (0);
-
- memcpy(dst, tmp, NS_INADDRSZ);
- return (1);
-}
-
-/* int
- * inet_pton6(src, dst)
- * convert presentation level address to network order binary form.
- * return:
- * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
- * notice:
- * (1) does not touch `dst' unless it's returning 1.
- * (2) :: in a full address is silently ignored.
- * credit:
- * inspired by Mark Andrews.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton6(src, dst)
- const char *src;
- u_char *dst;
-{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- u_int val;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= (pch - xdigits);
- if (val > 0xffff)
- return (0);
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_pton4(curtok, tp) > 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
- }
- return (0);
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- for (i = 1; i <= n; i++) {
- endp[- i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- return (0);
- memcpy(dst, tmp, NS_IN6ADDRSZ);
- return (1);
-}
-
-#if 0
-/*
- * Weak aliases for applications that use certain private entry points,
- * and fail to include <arpa/inet.h>.
- */
-#undef inet_pton
-__weak_reference(__inet_pton, inet_pton);
-#endif
diff --git a/ports/glibc-compat/src/libc-symbols.h b/ports/glibc-compat/src/libc-symbols.h
deleted file mode 100644
index c98c52e..0000000
--- a/ports/glibc-compat/src/libc-symbols.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-#ifndef _LIBC_SYMBOLS_H
-#define _LIBC_SYMBOLS_H 1
-
-#define libc_hidden_def(x)
-#define libc_hidden_weak(x)
-#define libc_hidden_proto(x)
-#define libc_hidden_data_def(x)
-#define libresolv_hidden_def(x)
-#define libresolv_hidden_weak(x)
-#define libresolv_hidden_data_def(x)
-#define libresolv_hidden_proto(x)
-#define static_link_warning(x)
-#define libc_freeres_ptr(x) x
-#define DL_CALL_FCT(x,y) x y
-#define attribute_hidden
-#define internal_function
-#define __set_errno(x) (errno = (x))
-#define weak_alias(name, aliasname) _weak_alias (name, aliasname)
-#define _weak_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
-
-#endif
diff --git a/ports/glibc-compat/src/local.h b/ports/glibc-compat/src/local.h
deleted file mode 100644
index 9380d7c..0000000
--- a/ports/glibc-compat/src/local.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <alloca.h>
-#include "libc-symbols.h"
-
-# define extend_alloca(buf, len, newlen) \
- (__typeof (buf)) ({ size_t __newlen = (newlen); \
- char *__newbuf = alloca (__newlen); \
- if (__newbuf > (char *)buf) \
- if ((char *)buf + len == __newbuf) { \
- len += __newlen; \
- __newbuf = buf; \
- } \
- else { \
- if (__newbuf + newlen == (char *)buf) \
- len += __newlen; \
- else \
- len = __newlen; \
- } \
- __newbuf; })
-
-#define __fsetlocking(fp, x) fp
-
-extern const char *_res_opcodes[];
-libresolv_hidden_proto (_res_opcodes)
-
diff --git a/ports/glibc-compat/src/lockf.c b/ports/glibc-compat/src/lockf.c
deleted file mode 100644
index 2d2ace0..0000000
--- a/ports/glibc-compat/src/lockf.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <strings.h>
-
-int lockf(int fd, int command, off_t size) {
- struct flock params;
- bzero(¶ms, sizeof(params));
-
- params.l_whence = SEEK_CUR;
- params.l_start = 0;
- params.l_len = size;
- int fcntl_command = F_SETLK;
-
- switch(command) {
- case F_ULOCK:
- params.l_type = F_UNLCK;
- fcntl_command = F_SETLK;
- break;
- case F_LOCK:
- fcntl_command = F_SETLKW;
- case F_TLOCK:
- params.l_type = F_WRLCK;
- break;
- default:
- errno = EINVAL;
- return -1;
- }
-
- return fcntl(fd, fcntl_command, ¶ms);
-}
diff --git a/ports/glibc-compat/src/mktemp.c b/ports/glibc-compat/src/mktemp.c
deleted file mode 100644
index db5b2d0..0000000
--- a/ports/glibc-compat/src/mktemp.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Copyright 2014 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. */
-
-/*
- * Quick a dirty version of mkdtemp. This is needed since the one
- * compiled into newlib is currently non-functional (it returns the
- * same value each times its called).
- * TODO(sbc): remove this file once we fix:
- * https://code.google.com/p/nativeclient/issues/detail?id=4020
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-
-static char* _mktemp(char *template, int suffixlen, int* fd, int open_flags) {
- int i;
- int len = strlen(template);
- if (len < 6) {
- errno = EINVAL;
- return NULL;
- }
-
- const char* suffix = "";
- if (suffixlen)
- suffix = template + len - suffixlen;
-
- /* template_start points to the start of the XXXXXX string */
- char* template_start = template + len - suffixlen - 6;
-
- for (i = 0; i < 6; i++) {
- if (template_start[i] != 'X') {
- errno = EINVAL;
- return NULL;
- }
- }
-
- for (i = 1; INT_MAX; i++) {
- /* Write the 6 digit number plus the suffix */
- sprintf(template_start, "%06d%s", i, suffix);
- struct stat buf;
- if (stat(template, &buf) == -1 && errno == ENOENT) {
- if (fd) {
- *fd = open(template, open_flags, 0600);
- if (*fd != -1) {
- return template;
- }
- }
- return template;
- }
- }
-
- /* Should never get here. */
- assert(0);
- abort();
-}
-
-char *mkdtemp(char *template) {
- char* rtn = _mktemp(template, 0, NULL, 0);
- if (rtn == NULL)
- return NULL;
-
- if (mkdir(template, 0700) != 0)
- return NULL;
-
- return template;
-}
-
-char *mktemp(char *template) {
- if (_mktemp(template, 0, NULL, 0) == NULL)
- template[0] = '\0';
- return template;
-}
-
-int mkstemp(char *template) {
- int fd = -1;
- if (_mktemp(template, 0, &fd, O_RDWR | O_EXCL | O_CREAT) == NULL)
- return -1;
- return fd;
-}
-
-int mkstemps(char *template, int suffixlen) {
- int fd = -1;
- if (_mktemp(template, suffixlen, &fd, O_RDWR | O_EXCL | O_CREAT) == NULL)
- return -1;
- return fd;
-}
-
-int mkostemp(char *template, int flags) {
- int fd = -1;
- if (_mktemp(template, 0, &fd, flags) == NULL)
- return -1;
- return fd;
-}
-
-int mkostemps(char *template, int suffixlen, int flags) {
- int fd = -1;
- if (_mktemp(template, suffixlen, &fd, flags) == NULL)
- return -1;
- return fd;
-}
diff --git a/ports/glibc-compat/src/not-cancel.h b/ports/glibc-compat/src/not-cancel.h
deleted file mode 100644
index 3606397..0000000
--- a/ports/glibc-compat/src/not-cancel.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Uncancelable open. */
-#define open_not_cancel(name, flags, mode) open((name), (flags), (mode))
-#define open_not_cancel_2(name, flags) open((name), (flags))
-
-/* Uncancelable close. */
-#define close_not_cancel(fd) close((fd))
-#define close_not_cancel_no_status(fd) (void)close((fd))
-
-/* Uncancelable read. */
-#define read_not_cancel(fd, buf, n) read((fd), (buf), (n))
-
-/* Uncancelable write. */
-#define write_not_cancel(fd, buf, n) write((fd), (buf), (n))
-
-/* Uncancelable writev. */
-#define writev_not_cancel_no_status(fd, iov, n) \
- (void) writev((fd), (iov), (n))
-
-/* Uncancelable fcntl. */
-#define fcntl_not_cancel(fd, cmd, val) fcntl((fd), (cmd), (val))
diff --git a/ports/glibc-compat/src/ns_name.c b/ports/glibc-compat/src/ns_name.c
deleted file mode 100644
index d6c4cc8..0000000
--- a/ports/glibc-compat/src/ns_name.c
+++ /dev/null
@@ -1,748 +0,0 @@
-/*
- * Copyright (c) 1996,1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(_LIBC) && !defined(lint)
-static const char rcsid[] = "$BINDId: ns_name.c,v 8.15 2000/03/30 22:53:46 vixie Exp $";
-#endif
-
-#include <sys/types.h>
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <resolv.h>
-#include <string.h>
-#include <ctype.h>
-#include "libc-symbols.h"
-
-/* Data. */
-
-static const char digits[] = "0123456789";
-
-/* Forward. */
-
-static int special(int);
-static int printable(int);
-static int dn_find(const u_char *, const u_char *,
- const u_char * const *,
- const u_char * const *);
-
-/* Public. */
-
-/*
- * ns_name_ntop(src, dst, dstsiz)
- * Convert an encoded domain name to printable ascii as per RFC1035.
- * return:
- * Number of bytes written to buffer, or -1 (with errno set)
- * notes:
- * The root is returned as "."
- * All other domains are returned in non absolute form
- */
-int
-ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
- const u_char *cp;
- char *dn, *eom;
- u_char c;
- u_int n;
-
- cp = src;
- dn = dst;
- eom = dst + dstsiz;
-
- while ((n = *cp++) != 0) {
- if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) {
- /* Some kind of compression pointer. */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- if (dn != dst) {
- if (dn >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = '.';
- }
-
- if (n == 0x41) {
- n = *cp++ / 8;
- if (dn + n * 2 + 4 >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = '[';
- *dn++ = 'x';
-
- while (n-- > 0) {
- c = *cp++;
- unsigned u = c >> 4;
- *dn++ = u > 9 ? 'a' + u - 10 : '0' + u;
- u = c & 0xf;
- *dn++ = u > 9 ? 'a' + u - 10 : '0' + u;
- }
-
- *dn++ = ']';
- continue;
- }
-
- if (dn + n >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- for ((void)NULL; n > 0; n--) {
- c = *cp++;
- if (special(c)) {
- if (dn + 1 >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = (char)c;
- } else if (!printable(c)) {
- if (dn + 3 >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = '\\';
- *dn++ = digits[c / 100];
- *dn++ = digits[(c % 100) / 10];
- *dn++ = digits[c % 10];
- } else {
- if (dn >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = (char)c;
- }
- }
- }
- if (dn == dst) {
- if (dn >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = '.';
- }
- if (dn >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = '\0';
- return (dn - dst);
-}
-libresolv_hidden_def (ns_name_ntop)
-
-/*
- * ns_name_pton(src, dst, dstsiz)
- * Convert a ascii string into an encoded domain name as per RFC1035.
- * return:
- * -1 if it fails
- * 1 if string was fully qualified
- * 0 is string was not fully qualified
- * notes:
- * Enforces label and domain length limits.
- */
-
-int
-ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
- u_char *label, *bp, *eom;
- int c, n, escaped;
- char *cp;
-
- escaped = 0;
- bp = dst;
- eom = dst + dstsiz;
- label = bp++;
-
- while ((c = *src++) != 0) {
- if (escaped) {
- if ((cp = strchr(digits, c)) != NULL) {
- n = (cp - digits) * 100;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- n += (cp - digits) * 10;
- if ((c = *src++) == 0 ||
- (cp = strchr(digits, c)) == NULL) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- n += (cp - digits);
- if (n > 255) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- c = n;
- } else if (c == '[' && label == bp - 1 && *src == 'x') {
- /* Theoretically we would have to handle \[o
- as well but we do not since we do not need
- it internally. */
- *label = 0x41;
- label = bp++;
- ++src;
- while (isxdigit (*src)) {
- n = *src > '9' ? *src - 'a' + 10 : *src - '0';
- ++src;
- if (! isxdigit(*src)) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- n <<= 4;
- n += *src > '9' ? *src - 'a' + 10 : *src - '0';
- if (bp + 1 >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *bp++ = n;
- ++src;
- }
- *label = (bp - label - 1) * 8;
- if (*src++ != ']' || *src++ != '.') {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- escaped = 0;
- label = bp++;
- if (bp >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- continue;
- }
- escaped = 0;
- } else if (c == '\\') {
- escaped = 1;
- continue;
- } else if (c == '.') {
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- if (label >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *label = c;
- /* Fully qualified ? */
- if (*src == '\0') {
- if (c != 0) {
- if (bp >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *bp++ = '\0';
- }
- if ((bp - dst) > MAXCDNAME) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- return (1);
- }
- if (c == 0 || *src == '.') {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- label = bp++;
- continue;
- }
- if (bp >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *bp++ = (u_char)c;
- }
- c = (bp - label - 1);
- if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- if (label >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *label = c;
- if (c != 0) {
- if (bp >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *bp++ = 0;
- }
- if ((bp - dst) > MAXCDNAME) { /* src too big */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- return (0);
-}
-
-/*
- * ns_name_ntol(src, dst, dstsiz)
- * Convert a network strings labels into all lowercase.
- * return:
- * Number of bytes written to buffer, or -1 (with errno set)
- * notes:
- * Enforces label and domain length limits.
- */
-
-int
-ns_name_ntol(const u_char *src, u_char *dst, size_t dstsiz) {
- const u_char *cp;
- u_char *dn, *eom;
- u_char c;
- u_int n;
-
- cp = src;
- dn = dst;
- eom = dst + dstsiz;
-
- while ((n = *cp++) != 0) {
- if ((n & NS_CMPRSFLGS) != 0) {
- /* Some kind of compression pointer. */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dn++ = n;
- if (dn + n >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- for ((void)NULL; n > 0; n--) {
- c = *cp++;
- if (isupper(c))
- *dn++ = tolower(c);
- else
- *dn++ = c;
- }
- }
- *dn++ = '\0';
- return (dn - dst);
-}
-
-/*
- * ns_name_unpack(msg, eom, src, dst, dstsiz)
- * Unpack a domain name from a message, source may be compressed.
- * return:
- * -1 if it fails, or consumed octets if it succeeds.
- */
-int
-ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
- u_char *dst, size_t dstsiz)
-{
- const u_char *srcp, *dstlim;
- u_char *dstp;
- int n, len, checked;
-
- len = -1;
- checked = 0;
- dstp = dst;
- srcp = src;
- dstlim = dst + dstsiz;
- if (srcp < msg || srcp >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- /* Fetch next label in domain name. */
- while ((n = *srcp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0x40:
- if (n == 0x41) {
- if (dstp + 1 >= dstlim) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *dstp++ = 0x41;
- n = *srcp++ / 8;
- ++checked;
- } else {
- __set_errno (EMSGSIZE);
- return (-1); /* flag error */
- }
- /* FALLTHROUGH */
- case 0:
- /* Limit checks. */
- if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- checked += n + 1;
- dstp = mempcpy(dstp, srcp - 1, n + 1);
- srcp += n;
- break;
-
- case NS_CMPRSFLGS:
- if (srcp >= eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- if (len < 0)
- len = srcp - src + 1;
- srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
- if (srcp < msg || srcp >= eom) { /* Out of range. */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- checked += 2;
- /*
- * Check for loops in the compressed name;
- * if we've looked at the whole message,
- * there must be a loop.
- */
- if (checked >= eom - msg) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- break;
-
- default:
- __set_errno (EMSGSIZE);
- return (-1); /* flag error */
- }
- }
- *dstp = '\0';
- if (len < 0)
- len = srcp - src;
- return (len);
-}
-libresolv_hidden_def (ns_name_unpack)
-
-/*
- * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
- * Pack domain name 'domain' into 'comp_dn'.
- * return:
- * Size of the compressed name, or -1.
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message. The array
- * ends with NULL.
- * 'lastdnptr' is a pointer to the end of the array pointed to
- * by 'dnptrs'.
- * Side effects:
- * The list of pointers in dnptrs is updated for labels inserted into
- * the message as we compress the name. If 'dnptr' is NULL, we don't
- * try to compress names. If 'lastdnptr' is NULL, we don't update the
- * list.
- */
-int
-ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char *dstp;
- const u_char **cpp, **lpp, *eob, *msg;
- const u_char *srcp;
- int n, l, first = 1;
-
- srcp = src;
- dstp = dst;
- eob = dstp + dstsiz;
- lpp = cpp = NULL;
- if (dnptrs != NULL) {
- if ((msg = *dnptrs++) != NULL) {
- for (cpp = dnptrs; *cpp != NULL; cpp++)
- (void)NULL;
- lpp = cpp; /* end of list to search */
- }
- } else
- msg = NULL;
-
- /* make sure the domain we are about to add is legal */
- l = 0;
- do {
- n = *srcp;
- if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- if (n == 0x41)
- n = *++srcp / 8;
- l += n + 1;
- if (l > MAXCDNAME) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- srcp += n + 1;
- } while (n != 0);
-
- /* from here on we need to reset compression pointer array on error */
- srcp = src;
- do {
- /* Look to see if we can use pointers. */
- n = *srcp;
- if (n != 0 && n != 0x41 && msg != NULL) {
- l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
- (const u_char * const *)lpp);
- if (l >= 0) {
- if (dstp + 1 >= eob) {
- goto cleanup;
- }
- *dstp++ = (l >> 8) | NS_CMPRSFLGS;
- *dstp++ = l % 256;
- return (dstp - dst);
- }
- /* Not found, save it. */
- if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
- (dstp - msg) < 0x4000 && first) {
- *cpp++ = dstp;
- *cpp = NULL;
- first = 0;
- }
- }
- /* copy label to buffer */
- if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) { /* Should not happen. */
- goto cleanup;
- }
- if (n == 0x41) {
- n = *++srcp / 8;
- if (dstp + 1 >= eob)
- goto cleanup;
- *dstp++ = 0x41;
- }
- if (dstp + 1 + n >= eob) {
- goto cleanup;
- }
- memcpy(dstp, srcp, n + 1);
- srcp += n + 1;
- dstp += n + 1;
- } while (n != 0);
-
- if (dstp > eob) {
-cleanup:
- if (msg != NULL)
- *lpp = NULL;
- __set_errno (EMSGSIZE);
- return (-1);
- }
- return (dstp - dst);
-}
-
-/*
- * ns_name_uncompress(msg, eom, src, dst, dstsiz)
- * Expand compressed domain name to presentation format.
- * return:
- * Number of bytes read out of `src', or -1 (with errno set).
- * note:
- * Root domain returns as "." not "".
- */
-int
-ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, size_t dstsiz)
-{
- u_char tmp[NS_MAXCDNAME];
- int n;
-
- if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
- return (-1);
- if (ns_name_ntop(tmp, dst, dstsiz) == -1)
- return (-1);
- return (n);
-}
-
-/*
- * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
- * Compress a domain name into wire format, using compression pointers.
- * return:
- * Number of bytes consumed in `dst' or -1 (with errno set).
- * notes:
- * 'dnptrs' is an array of pointers to previous compressed names.
- * dnptrs[0] is a pointer to the beginning of the message.
- * The list ends with NULL. 'lastdnptr' is a pointer to the end of the
- * array pointed to by 'dnptrs'. Side effect is to update the list of
- * pointers for labels inserted into the message as we compress the name.
- * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
- * is NULL, we don't update the list.
- */
-int
-ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
- const u_char **dnptrs, const u_char **lastdnptr)
-{
- u_char tmp[NS_MAXCDNAME];
-
- if (ns_name_pton(src, tmp, sizeof tmp) == -1)
- return (-1);
- return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
-}
-
-/*
- * Reset dnptrs so that there are no active references to pointers at or
- * after src.
- */
-void
-ns_name_rollback(const u_char *src, const u_char **dnptrs,
- const u_char **lastdnptr)
-{
- while (dnptrs < lastdnptr && *dnptrs != NULL) {
- if (*dnptrs >= src) {
- *dnptrs = NULL;
- break;
- }
- dnptrs++;
- }
-}
-
-/*
- * ns_name_skip(ptrptr, eom)
- * Advance *ptrptr to skip over the compressed name it points at.
- * return:
- * 0 on success, -1 (with errno set) on failure.
- */
-int
-ns_name_skip(const u_char **ptrptr, const u_char *eom) {
- const u_char *cp;
- u_int n;
-
- cp = *ptrptr;
- while (cp < eom && (n = *cp++) != 0) {
- /* Check for indirection. */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- cp += n;
- continue;
- case NS_CMPRSFLGS: /* indirection */
- cp++;
- break;
- default: /* illegal type */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- break;
- }
- if (cp > eom) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- *ptrptr = cp;
- return (0);
-}
-
-/* Private. */
-
-/*
- * special(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this characted special ("in need of quoting") ?
- * return:
- * boolean.
- */
-static int
-special(int ch) {
- switch (ch) {
- case 0x22: /* '"' */
- case 0x2E: /* '.' */
- case 0x3B: /* ';' */
- case 0x5C: /* '\\' */
- /* Special modifiers in zone files. */
- case 0x40: /* '@' */
- case 0x24: /* '$' */
- return (1);
- default:
- return (0);
- }
-}
-
-/*
- * printable(ch)
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * is this character visible and not a space when printed ?
- * return:
- * boolean.
- */
-static int
-printable(int ch) {
- return (ch > 0x20 && ch < 0x7f);
-}
-
-/*
- * Thinking in noninternationalized USASCII (per the DNS spec),
- * convert this character to lower case if it's upper case.
- */
-static int
-mklower(int ch) {
- if (ch >= 0x41 && ch <= 0x5A)
- return (ch + 0x20);
- return (ch);
-}
-
-/*
- * dn_find(domain, msg, dnptrs, lastdnptr)
- * Search for the counted-label name in an array of compressed names.
- * return:
- * offset from msg if found, or -1.
- * notes:
- * dnptrs is the pointer to the first name on the list,
- * not the pointer to the start of the message.
- */
-static int
-dn_find(const u_char *domain, const u_char *msg,
- const u_char * const *dnptrs,
- const u_char * const *lastdnptr)
-{
- const u_char *dn, *cp, *sp;
- const u_char * const *cpp;
- u_int n;
-
- for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
- sp = *cpp;
- /*
- * terminate search on:
- * root label
- * compression pointer
- * unusable offset
- */
- while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 &&
- (sp - msg) < 0x4000) {
- dn = domain;
- cp = sp;
- while ((n = *cp++) != 0) {
- /*
- * check for indirection
- */
- switch (n & NS_CMPRSFLGS) {
- case 0: /* normal case, n == len */
- if (n != *dn++)
- goto next;
- for ((void)NULL; n > 0; n--)
- if (mklower(*dn++) !=
- mklower(*cp++))
- goto next;
- /* Is next root for both ? */
- if (*dn == '\0' && *cp == '\0')
- return (sp - msg);
- if (*dn)
- continue;
- goto next;
-
- case NS_CMPRSFLGS: /* indirection */
- cp = msg + (((n & 0x3f) << 8) | *cp);
- break;
-
- default: /* illegal type */
- __set_errno (EMSGSIZE);
- return (-1);
- }
- }
- next:
- sp += *sp + 1;
- }
- }
- __set_errno (ENOENT);
- return (-1);
-}
diff --git a/ports/glibc-compat/src/ns_netint.c b/ports/glibc-compat/src/ns_netint.c
deleted file mode 100644
index 16282e5..0000000
--- a/ports/glibc-compat/src/ns_netint.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1996,1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(_LIBC) && !defined(lint)
-static const char rcsid[] = "$BINDId: ns_netint.c,v 8.4 1999/10/13 16:39:35 vixie Exp $";
-#endif
-
-/* Import. */
-
-#include <arpa/nameser.h>
-#include <resolv.h>
-#include "libc-symbols.h"
-
-/* Public. */
-
-u_int
-ns_get16(const u_char *src) {
- u_int dst;
-
- NS_GET16(dst, src);
- return (dst);
-}
-libresolv_hidden_def (ns_get16)
-
-u_long
-ns_get32(const u_char *src) {
- u_long dst;
-
- NS_GET32(dst, src);
- return (dst);
-}
-libresolv_hidden_def (ns_get32)
-
-void
-ns_put16(u_int src, u_char *dst) {
- NS_PUT16(src, dst);
-}
-
-void
-ns_put32(u_long src, u_char *dst) {
- NS_PUT32(src, dst);
-}
diff --git a/ports/glibc-compat/src/ns_samedomain.c b/ports/glibc-compat/src/ns_samedomain.c
deleted file mode 100644
index 9648637..0000000
--- a/ports/glibc-compat/src/ns_samedomain.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 1995,1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if !defined(_LIBC) && !defined(lint)
-static const char rcsid[] = "$BINDId: ns_samedomain.c,v 8.9 1999/10/15 21:06:51 vixie Exp $";
-#endif
-
-#include <sys/types.h>
-#include <arpa/nameser.h>
-#include <errno.h>
-#include <string.h>
-
-#include "libc-symbols.h"
-
-/*
- * int
- * ns_samedomain(a, b)
- * Check whether a name belongs to a domain.
- * Inputs:
- * a - the domain whose ancestory is being verified
- * b - the potential ancestor we're checking against
- * Return:
- * boolean - is a at or below b?
- * Notes:
- * Trailing dots are first removed from name and domain.
- * Always compare complete subdomains, not only whether the
- * domain name is the trailing string of the given name.
- *
- * "host.foobar.top" lies in "foobar.top" and in "top" and in ""
- * but NOT in "bar.top"
- */
-
-int
-ns_samedomain(const char *a, const char *b) {
- size_t la, lb;
- int diff, i, escaped;
- const char *cp;
-
- la = strlen(a);
- lb = strlen(b);
-
- /* Ignore a trailing label separator (i.e. an unescaped dot) in 'a'. */
- if (la != 0 && a[la - 1] == '.') {
- escaped = 0;
- /* Note this loop doesn't get executed if la==1. */
- for (i = la - 2; i >= 0; i--)
- if (a[i] == '\\') {
- if (escaped)
- escaped = 0;
- else
- escaped = 1;
- } else
- break;
- if (!escaped)
- la--;
- }
-
- /* Ignore a trailing label separator (i.e. an unescaped dot) in 'b'. */
- if (lb != 0 && b[lb - 1] == '.') {
- escaped = 0;
- /* note this loop doesn't get executed if lb==1 */
- for (i = lb - 2; i >= 0; i--)
- if (b[i] == '\\') {
- if (escaped)
- escaped = 0;
- else
- escaped = 1;
- } else
- break;
- if (!escaped)
- lb--;
- }
-
- /* lb == 0 means 'b' is the root domain, so 'a' must be in 'b'. */
- if (lb == 0)
- return (1);
-
- /* 'b' longer than 'a' means 'a' can't be in 'b'. */
- if (lb > la)
- return (0);
-
- /* 'a' and 'b' being equal at this point indicates sameness. */
- if (lb == la)
- return (strncasecmp(a, b, lb) == 0);
-
- /* Ok, we know la > lb. */
-
- diff = la - lb;
-
- /*
- * If 'a' is only 1 character longer than 'b', then it can't be
- * a subdomain of 'b' (because of the need for the '.' label
- * separator).
- */
- if (diff < 2)
- return (0);
-
- /*
- * If the character before the last 'lb' characters of 'b'
- * isn't '.', then it can't be a match (this lets us avoid
- * having "foobar.com" match "bar.com").
- */
- if (a[diff - 1] != '.')
- return (0);
-
- /*
- * We're not sure about that '.', however. It could be escaped
- * and thus not a really a label separator.
- */
- escaped = 0;
- for (i = diff - 2; i >= 0; i--)
- if (a[i] == '\\')
- if (escaped)
- escaped = 0;
- else
- escaped = 1;
- else
- break;
- if (escaped)
- return (0);
-
- /* Now compare aligned trailing substring. */
- cp = a + diff;
- return (strncasecmp(cp, b, lb) == 0);
-}
-
-/*
- * int
- * ns_subdomain(a, b)
- * is "a" a subdomain of "b"?
- */
-int
-ns_subdomain(const char *a, const char *b) {
- return (ns_samename(a, b) != 1 && ns_samedomain(a, b));
-}
-
-/*
- * int
- * ns_makecanon(src, dst, dstsize)
- * make a canonical copy of domain name "src"
- * notes:
- * foo -> foo.
- * foo. -> foo.
- * foo.. -> foo.
- * foo\. -> foo\..
- * foo\\. -> foo\\.
- */
-
-int
-ns_makecanon(const char *src, char *dst, size_t dstsize) {
- size_t n = strlen(src);
-
- if (n + sizeof "." > dstsize) {
- __set_errno (EMSGSIZE);
- return (-1);
- }
- strcpy(dst, src);
- while (n > 0 && dst[n - 1] == '.') /* Ends in "." */
- if (n > 1 && dst[n - 2] == '\\' && /* Ends in "\." */
- (n < 2 || dst[n - 3] != '\\')) /* But not "\\." */
- break;
- else
- dst[--n] = '\0';
- dst[n++] = '.';
- dst[n] = '\0';
- return (0);
-}
-
-/*
- * int
- * ns_samename(a, b)
- * determine whether domain name "a" is the same as domain name "b"
- * return:
- * -1 on error
- * 0 if names differ
- * 1 if names are the same
- */
-
-int
-ns_samename(const char *a, const char *b) {
- char ta[NS_MAXDNAME], tb[NS_MAXDNAME];
-
- if (ns_makecanon(a, ta, sizeof ta) < 0 ||
- ns_makecanon(b, tb, sizeof tb) < 0)
- return (-1);
- if (strcasecmp(ta, tb) == 0)
- return (1);
- else
- return (0);
-}
diff --git a/ports/glibc-compat/src/openat.c b/ports/glibc-compat/src/openat.c
deleted file mode 100644
index 9110ebb..0000000
--- a/ports/glibc-compat/src/openat.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <limits.h>
-#include <dirent.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-// xgetcwd is pulled from toybox lib/xwrap.c
-static char *xgetcwd(void) {
- char *buf = (char*)malloc(sizeof(char) * (PATH_MAX+1));
- if (buf == NULL) {
- fprintf(stderr, "malloc failed\n");
- exit(1);
- }
- buf = getcwd(buf, PATH_MAX+1);
- if (!buf) {
- perror("xgetcwd");
- exit(1);
- }
- return buf;
-}
-
-// The following functions are pulled from toybox nacl.patch
-#define _AT_WRAP_START(A) \
- int fchdir_err = 0; \
- char *save = xgetcwd(); \
- if (!save) { \
- perror("fd_wrapper_"A); \
- exit(1); \
- } \
- if (dirfd != AT_FDCWD) { \
- fchdir_err = fchdir(dirfd); \
- if (fchdir_err == -1) \
- perror("fchdir"); \
- }
-
-#define _AT_WRAP_END(A) \
- if (dirfd != AT_FDCWD) chdir(save); \
- free(save);
-
-int openat(int dirfd, const char *pathname, int flags, ...) {
- _AT_WRAP_START("openat")
- int fd = open(pathname, flags);
- _AT_WRAP_END("openat")
- return fd;
-}
-
-int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags) {
- // We are going to ignore flags here.
- //if (flags) perror_exit("fstatat_flags");
- _AT_WRAP_START("fstatat")
- int result;
- if (flags & AT_SYMLINK_NOFOLLOW)
- result = lstat(pathname, buf);
- else
- result = stat(pathname, buf);
- _AT_WRAP_END("fstatat")
- return result;
-}
-
-int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags) {
- // We are going to ignore flags here.
- //if (flags) perror_exit("fchmodat_flags");
- _AT_WRAP_START("fchmodat")
- int result = chmod(pathname, mode);
- _AT_WRAP_END("fchmodat")
- return result;
-}
-
-int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz) {
- _AT_WRAP_START("readlinkat")
- int result = readlink(pathname, buf, bufsiz);
- _AT_WRAP_END("readlinkat")
- return result;
-}
-
-int unlinkat(int dirfd, const char *pathname, int flags) {
- // We are going to ignore flags here.
- //if (flags) perror_exit("unlinkat_flags");
- _AT_WRAP_START("unlinkat")
- int result;
- if(flags & AT_REMOVEDIR) {
- result = rmdir(pathname);
- } else {
- result = unlink(pathname);
- }
- _AT_WRAP_END("unlinkat")
- return result;
-}
-
-int faccessat(int dirfd, const char *pathname, int mode, int flags) {
- //if (flags) perror_exit("faccessat_flags");
- _AT_WRAP_START("faccessat")
- int result = access(pathname, mode);
- _AT_WRAP_END("faccessat")
- return result;
-}
-
-DIR *fdopendir(int dirfd) {
- _AT_WRAP_START("fdopendir")
- DIR *dir;
- if (fchdir_err) {
- perror("fdopendir: ");
- }
- dir = opendir(".");
- _AT_WRAP_END("fdopendir")
- return dir;
-}
-
-int mkdirat(int dirfd, const char *pathname, mode_t mode) {
- _AT_WRAP_START("mkdirat")
- int result = mkdir(pathname, mode);
- _AT_WRAP_END("mkdirat")
- return result;
-}
-
-int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev) {
- fprintf(stderr, "mknod not supported\n");
- return 1;
-}
-
-int fchownat(int dirfd, const char *pathname, uid_t owner,
- gid_t group, int flags) {
- _AT_WRAP_START("fchownat")
- int result = chown(pathname, owner, group);
- _AT_WRAP_END("fchownat")
- return result;
-}
-
-int symlinkat(const char *oldpath, int dirfd, const char *newpath) {
- _AT_WRAP_START("symlinkat")
- int result = symlink(oldpath, newpath);
- _AT_WRAP_END("symlinkat")
- return result;
-}
-
-int linkat(int olddirfd, const char *oldpath,
- int newdirfd, const char *newpath, int flags) {
- int result;
- if ((oldpath[0] == '/') && (newpath[0] == '/')) {
- result = link(oldpath, newpath);
- } else {
- errno = EINVAL;
- result = -1;
- }
- // We do not support double linking.
- return result;
-}
diff --git a/ports/glibc-compat/src/qsort_r.c b/ports/glibc-compat/src/qsort_r.c
deleted file mode 100644
index 0c8344f..0000000
--- a/ports/glibc-compat/src/qsort_r.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * This is an implementation of qsort_r that is copied from the newlib
- * implementation of qsort.
- *
- * The only difference is that it takes a fifth argument, an opaque pointer,
- * which is passed to the comparison function as a third parameter.
- */
-
-/*
-FUNCTION
-<<qsort>>---sort an array
-
-INDEX
- qsort
-
-ANSI_SYNOPSIS
- #include <stdlib.h>
- void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>,
- int (*<[compar]>)(const void *, const void *) );
-
-TRAD_SYNOPSIS
- #include <stdlib.h>
- qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> )
- char *<[base]>;
- size_t <[nmemb]>;
- size_t <[size]>;
- int (*<[compar]>)();
-
-DESCRIPTION
-<<qsort>> sorts an array (beginning at <[base]>) of <[nmemb]> objects.
-<[size]> describes the size of each element of the array.
-
-You must supply a pointer to a comparison function, using the argument
-shown as <[compar]>. (This permits sorting objects of unknown
-properties.) Define the comparison function to accept two arguments,
-each a pointer to an element of the array starting at <[base]>. The
-result of <<(*<[compar]>)>> must be negative if the first argument is
-less than the second, zero if the two arguments match, and positive if
-the first argument is greater than the second (where ``less than'' and
-``greater than'' refer to whatever arbitrary ordering is appropriate).
-
-The array is sorted in place; that is, when <<qsort>> returns, the
-array elements beginning at <[base]> have been reordered.
-
-RETURNS
-<<qsort>> does not return a result.
-
-PORTABILITY
-<<qsort>> is required by ANSI (without specifying the sorting algorithm).
-*/
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <_ansi.h>
-#include <stdlib.h>
-
-#ifndef __GNUC__
-#define inline
-#endif
-
-static inline char *med3 _PARAMS((char *, char *, char *, int (*)(), void *));
-static inline void swapfunc _PARAMS((char *, char *, int, int));
-
-#define min(a, b) (a) < (b) ? a : b
-
-/*
- * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
- */
-#define swapcode(TYPE, parmi, parmj, n) { \
- long i = (n) / sizeof (TYPE); \
- register TYPE *pi = (TYPE *) (parmi); \
- register TYPE *pj = (TYPE *) (parmj); \
- do { \
- register TYPE t = *pi; \
- *pi++ = *pj; \
- *pj++ = t; \
- } while (--i > 0); \
-}
-
-#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
- es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
-
-static inline void
-_DEFUN(swapfunc, (a, b, n, swaptype),
- char *a _AND
- char *b _AND
- int n _AND
- int swaptype)
-{
- if(swaptype <= 1)
- swapcode(long, a, b, n)
- else
- swapcode(char, a, b, n)
-}
-
-#define swap(a, b) \
- if (swaptype == 0) { \
- long t = *(long *)(a); \
- *(long *)(a) = *(long *)(b); \
- *(long *)(b) = t; \
- } else \
- swapfunc(a, b, es, swaptype)
-
-#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
-
-static inline char *
-_DEFUN(med3, (a, b, c, cmp, arg),
- char *a _AND
- char *b _AND
- char *c _AND
- int (*cmp)() _AND
- void *arg)
-{
- return cmp(a, b, arg) < 0 ?
- (cmp(b, c, arg) < 0 ? b : (cmp(a, c, arg) < 0 ? c : a ))
- :(cmp(b, c, arg) > 0 ? b : (cmp(a, c, arg) < 0 ? a : c ));
-}
-
-void
-_DEFUN(qsort_r, (a, n, es, cmp, arg),
- void *a _AND
- size_t n _AND
- size_t es _AND
- int (*cmp)() _AND
- void *arg)
-{
- char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
- int d, r, swaptype, swap_cnt;
-
-loop: SWAPINIT(a, es);
- swap_cnt = 0;
- if (n < 7) {
- for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
- for (pl = pm; pl > (char *) a && cmp(pl - es, pl, arg) > 0;
- pl -= es)
- swap(pl, pl - es);
- return;
- }
- pm = (char *) a + (n / 2) * es;
- if (n > 7) {
- pl = a;
- pn = (char *) a + (n - 1) * es;
- if (n > 40) {
- d = (n / 8) * es;
- pl = med3(pl, pl + d, pl + 2 * d, cmp, arg);
- pm = med3(pm - d, pm, pm + d, cmp, arg);
- pn = med3(pn - 2 * d, pn - d, pn, cmp, arg);
- }
- pm = med3(pl, pm, pn, cmp, arg);
- }
- swap(a, pm);
- pa = pb = (char *) a + es;
-
- pc = pd = (char *) a + (n - 1) * es;
- for (;;) {
- while (pb <= pc && (r = cmp(pb, a, arg)) <= 0) {
- if (r == 0) {
- swap_cnt = 1;
- swap(pa, pb);
- pa += es;
- }
- pb += es;
- }
- while (pb <= pc && (r = cmp(pc, a, arg)) >= 0) {
- if (r == 0) {
- swap_cnt = 1;
- swap(pc, pd);
- pd -= es;
- }
- pc -= es;
- }
- if (pb > pc)
- break;
- swap(pb, pc);
- swap_cnt = 1;
- pb += es;
- pc -= es;
- }
- if (swap_cnt == 0) { /* Switch to insertion sort */
- for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
- for (pl = pm; pl > (char *) a && cmp(pl - es, pl, arg) > 0;
- pl -= es)
- swap(pl, pl - es);
- return;
- }
-
- pn = (char *) a + n * es;
- r = min(pa - (char *)a, pb - pa);
- vecswap(a, pb - r, r);
- r = min(pd - pc, pn - pd - es);
- vecswap(pb, pn - r, r);
- if ((r = pb - pa) > es)
- qsort_r(a, r / es, es, cmp, arg);
- if ((r = pd - pc) > es) {
- /* Iterate rather than recurse to save stack space */
- a = pn - r;
- n = r / es;
- goto loop;
- }
-/* qsort_r(pn - r, r / es, es, cmp, arg);*/
-}
diff --git a/ports/glibc-compat/src/random.c b/ports/glibc-compat/src/random.c
deleted file mode 100644
index bd5d584..0000000
--- a/ports/glibc-compat/src/random.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-#include <stdlib.h>
-
-/*
- * Implemenat random/srandom in terms of rand/srand.
- * TODO(sbc): remove this once these get added to newlib.
- */
-
-long int random(void) __attribute__((weak));
-long int random(void) {
- return rand();
-}
-
-void srandom(unsigned int seed) __attribute__((weak));
-void srandom(unsigned int seed) {
- srand(seed);
-}
diff --git a/ports/glibc-compat/src/realpath.c b/ports/glibc-compat/src/realpath.c
deleted file mode 100644
index b865492..0000000
--- a/ports/glibc-compat/src/realpath.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Copyright 2014 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file. */
-
-/*
- * Copied from native_client_sdk/src/libraries/nacl_io/
- * TODO(sbc): remove this file once realpath.c is added to libnacl
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-char* realpath(const char* path, char* resolved_path) {
- if (path == NULL) {
- errno = EINVAL;
- return NULL;
- }
-
- int needs_free = 0;
- if (resolved_path == NULL) {
- resolved_path = (char*)malloc(PATH_MAX);
- needs_free = 1;
- }
-
- struct stat statbuf;
- const char* in = path;
- char* out = resolved_path;
- char* out_end = resolved_path + PATH_MAX - 1;
- int done = 0;
-
- *out = 0;
-
- if (*in == '/') {
- // Absolute path.
- strcat(out, "/");
- in++;
- out++;
- } else {
- // Relative path.
- if (getcwd(out, out_end - out) == NULL)
- goto fail;
-
- out += strlen(out);
- }
-
- if (stat(resolved_path, &statbuf) != 0)
- goto fail;
-
- while (!done) {
- const char* next_slash = strchr(in, '/');
- size_t namelen;
- const char* next_in;
- if (next_slash) {
- namelen = next_slash - in;
- next_in = next_slash + 1;
- } else {
- namelen = strlen(in);
- next_in = in + namelen; // Move to the '\0'
- done = 1;
- }
-
- if (namelen == 0) {
- // Empty name, do nothing.
- } else if (namelen == 1 && strncmp(in, ".", 1) == 0) {
- // Current directory, do nothing.
- } else if (namelen == 2 && strncmp(in, "..", 2) == 0) {
- // Parent directory, find previous slash in resolved_path.
- char* prev_slash = strrchr(resolved_path, '/');
- assert(prev_slash != NULL);
-
- out = prev_slash;
- if (prev_slash == resolved_path) {
- // Moved to the root. Keep the slash.
- ++out;
- }
-
- *out = 0;
- } else {
- // Append a slash if not at root.
- if (out != resolved_path + 1) {
- if (out + 1 > out_end) {
- errno = ENAMETOOLONG;
- goto fail;
- }
-
- strncat(out, "/", namelen);
- out++;
- }
-
- if (out + namelen > out_end) {
- errno = ENAMETOOLONG;
- goto fail;
- }
-
- strncat(out, in, namelen);
- out += namelen;
- }
-
- in = next_in;
-
- if (stat(resolved_path, &statbuf) != 0)
- goto fail;
-
- // If there is more to the path, then the current path must be a directory.
- if (!done && !S_ISDIR(statbuf.st_mode)) {
- errno = ENOTDIR;
- goto fail;
- }
- }
-
- return resolved_path;
-
-fail:
- if (needs_free) {
- free(resolved_path);
- }
- return NULL;
-}
diff --git a/ports/glibc-compat/src/res_comp.c b/ports/glibc-compat/src/res_comp.c
deleted file mode 100644
index 51211f7..0000000
--- a/ports/glibc-compat/src/res_comp.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 1985, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$BINDId: res_comp.c,v 8.15 1999/10/13 16:39:39 vixie Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include "libc-symbols.h"
-
-/*
- * Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
- * 'eomorig' points to the first location after the message,
- * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
- * Return size of compressed name or -1 if there was an error.
- */
-int
-dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
- char *dst, int dstsiz)
-{
- int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
-
- if (n > 0 && dst[0] == '.')
- dst[0] = '\0';
- return (n);
-}
-libresolv_hidden_def (dn_expand)
-
-/*
- * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
- * Return the size of the compressed name or -1.
- * 'length' is the size of the array pointed to by 'comp_dn'.
- */
-int
-dn_comp(const char *src, u_char *dst, int dstsiz,
- u_char **dnptrs, u_char **lastdnptr)
-{
- return (ns_name_compress(src, dst, (size_t)dstsiz,
- (const u_char **)dnptrs,
- (const u_char **)lastdnptr));
-}
-libresolv_hidden_def (dn_comp)
-
-/*
- * Skip over a compressed domain name. Return the size or -1.
- */
-int
-dn_skipname(const u_char *ptr, const u_char *eom) {
- const u_char *saveptr = ptr;
-
- if (ns_name_skip(&ptr, eom) == -1)
- return (-1);
- return (ptr - saveptr);
-}
-libresolv_hidden_def (dn_skipname)
-
-/*
- * Verify that a domain name uses an acceptable character set.
- */
-
-/*
- * Note the conspicuous absence of ctype macros in these definitions. On
- * non-ASCII hosts, we can't depend on string literals or ctype macros to
- * tell us anything about network-format data. The rest of the BIND system
- * is not careful about this, but for some reason, we're doing it right here.
- */
-#define PERIOD 0x2e
-#define hyphenchar(c) ((c) == 0x2d)
-#define underscorechar(c) ((c) == 0x5f)
-#define bslashchar(c) ((c) == 0x5c)
-#define periodchar(c) ((c) == PERIOD)
-#define asterchar(c) ((c) == 0x2a)
-#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
- || ((c) >= 0x61 && (c) <= 0x7a))
-#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
-
-#define borderchar(c) (alphachar(c) || digitchar(c))
-#define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
-#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
-
-int
-res_hnok(const char *dn) {
- int ppch = '\0', pch = PERIOD, ch = *dn++;
-
- while (ch != '\0') {
- int nch = *dn++;
-
- if (periodchar(ch)) {
- (void)NULL;
- } else if (periodchar(pch)) {
- if (!borderchar(ch))
- return (0);
- } else if (periodchar(nch) || nch == '\0') {
- if (!borderchar(ch))
- return (0);
- } else {
- if (!middlechar(ch))
- return (0);
- }
- ppch = pch, pch = ch, ch = nch;
- }
- return (1);
-}
-libresolv_hidden_def (res_hnok)
-
-/*
- * hostname-like (A, MX, WKS) owners can have "*" as their first label
- * but must otherwise be as a host name.
- */
-int
-res_ownok(const char *dn) {
- if (asterchar(dn[0])) {
- if (periodchar(dn[1]))
- return (res_hnok(dn+2));
- if (dn[1] == '\0')
- return (1);
- }
- return (res_hnok(dn));
-}
-
-/*
- * SOA RNAMEs and RP RNAMEs can have any printable character in their first
- * label, but the rest of the name has to look like a host name.
- */
-int
-res_mailok(const char *dn) {
- int ch, escaped = 0;
-
- /* "." is a valid missing representation */
- if (*dn == '\0')
- return (1);
-
- /* otherwise <label>.<hostname> */
- while ((ch = *dn++) != '\0') {
- if (!domainchar(ch))
- return (0);
- if (!escaped && periodchar(ch))
- break;
- if (escaped)
- escaped = 0;
- else if (bslashchar(ch))
- escaped = 1;
- }
- if (periodchar(ch))
- return (res_hnok(dn));
- return (0);
-}
-
-/*
- * This function is quite liberal, since RFC 1034's character sets are only
- * recommendations.
- */
-int
-res_dnok(const char *dn) {
- int ch;
-
- while ((ch = *dn++) != '\0')
- if (!domainchar(ch))
- return (0);
- return (1);
-}
-libresolv_hidden_def (res_dnok)
-
-#ifdef BIND_4_COMPAT
-/*
- * This module must export the following externally-visible symbols:
- * ___putlong
- * ___putshort
- * __getlong
- * __getshort
- * Note that one _ comes from C and the others come from us.
- */
-void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
-libresolv_hidden_def (__putlong)
-void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
-libresolv_hidden_def (__putshort)
-#ifndef __ultrix__
-u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
-u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
-#endif /*__ultrix__*/
-#endif /*BIND_4_COMPAT*/
-
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libresolv, GLIBC_2_0, GLIBC_2_2)
-# undef dn_expand
-weak_alias (__dn_expand, dn_expand);
-#endif
diff --git a/ports/glibc-compat/src/res_data.c b/ports/glibc-compat/src/res_data.c
deleted file mode 100644
index cb140ee..0000000
--- a/ports/glibc-compat/src/res_data.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 1995-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$BINDId: res_data.c,v 8.17 1999/10/13 17:11:31 vixie Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <netdb.h>
-#include <resolv.h>
-#ifdef BIND_UPDATE
-#include <res_update.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "libc-symbols.h"
-
-const char *_res_opcodes[] = {
- "QUERY",
- "IQUERY",
- "CQUERYM",
- "CQUERYU", /* experimental */
- "NOTIFY", /* experimental */
- "UPDATE",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "ZONEINIT",
- "ZONEREF",
-};
-libresolv_hidden_data_def (_res_opcodes)
-
-#ifdef BIND_UPDATE
-const char *_res_sectioncodes[] attribute_hidden = {
- "ZONE",
- "PREREQUISITES",
- "UPDATE",
- "ADDITIONAL",
-};
-#endif
-
-#ifndef __BIND_NOSTATIC
-#ifdef _LIBC
-/* The definition has been moved to res_libc.c. */
-#else
-#undef _res
-struct __res_state _res
-# if defined(__BIND_RES_TEXT)
- = { RES_TIMEOUT, } /* Motorola, et al. */
-# endif
- ;
-#endif
-
-/* Proto. */
-#ifndef _LIBC
-int res_ourserver_p(const res_state, const struct sockaddr_in *);
-void res_pquery(const res_state, const u_char *, int, FILE *);
-#endif
-
-#ifndef _LIBC
-/* Moved to res_libc.c since res_init() should go into libc.so but the
- rest of this file not. */
-int
-res_init(void) {
- extern int __res_vinit(res_state, int);
-
- /*
- * These three fields used to be statically initialized. This made
- * it hard to use this code in a shared library. It is necessary,
- * now that we're doing dynamic initialization here, that we preserve
- * the old semantics: if an application modifies one of these three
- * fields of _res before res_init() is called, res_init() will not
- * alter them. Of course, if an application is setting them to
- * _zero_ before calling res_init(), hoping to override what used
- * to be the static default, we can't detect it and unexpected results
- * will follow. Zero for any of these fields would make no sense,
- * so one can safely assume that the applications were already getting
- * unexpected results.
- *
- * _res.options is tricky since some apps were known to diddle the bits
- * before res_init() was first called. We can't replicate that semantic
- * with dynamic initialization (they may have turned bits off that are
- * set in RES_DEFAULT). Our solution is to declare such applications
- * "broken". They could fool us by setting RES_INIT but none do (yet).
- */
- if (!_res.retrans)
- _res.retrans = RES_TIMEOUT;
- if (!_res.retry)
- _res.retry = 4;
- if (!(_res.options & RES_INIT))
- _res.options = RES_DEFAULT;
-
- /*
- * This one used to initialize implicitly to zero, so unless the app
- * has set it to something in particular, we can randomize it now.
- */
- if (!_res.id)
- _res.id = res_randomid();
-
- return (__res_vinit(&_res, 1));
-}
-#endif
-
-void
-p_query(const u_char *msg) {
- fp_query(msg, stdout);
-}
-
-void
-fp_query(const u_char *msg, FILE *file) {
- fp_nquery(msg, PACKETSZ, file);
-}
-libresolv_hidden_def (fp_query)
-
-void
-fp_nquery(const u_char *msg, int len, FILE *file) {
- if (__res_maybe_init (&_res, 0) == -1)
- return;
-
- res_pquery(&_res, msg, len, file);
-}
-libresolv_hidden_def (fp_nquery)
-
-int
-res_mkquery(int op, /* opcode of query */
- const char *dname, /* domain name */
- int class, int type, /* class and type of query */
- const u_char *data, /* resource record data */
- int datalen, /* length of data */
- const u_char *newrr_in, /* new rr for modify or append */
- u_char *buf, /* buffer to put query */
- int buflen) /* size of buffer */
-{
- if (__res_maybe_init (&_res, 1) == -1) {
- RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
- return (-1);
- }
- return (res_nmkquery(&_res, op, dname, class, type,
- data, datalen,
- newrr_in, buf, buflen));
-}
-
-#ifdef BIND_UPDATE
-int
-res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
- if (__res_maybe_init (&_res, 1) == -1) {
- RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
- return (-1);
- }
-
- return (res_nmkupdate(&_res, rrecp_in, buf, buflen));
-}
-#endif
-
-int
-res_query(const char *name, /* domain name */
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen) /* size of answer buffer */
-{
- if (__res_maybe_init (&_res, 1) == -1) {
- RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
- return (-1);
- }
- return (res_nquery(&_res, name, class, type, answer, anslen));
-}
-
-void
-res_send_setqhook(res_send_qhook hook) {
- _res.qhook = hook;
-}
-
-void
-res_send_setrhook(res_send_rhook hook) {
- _res.rhook = hook;
-}
-
-int
-res_isourserver(const struct sockaddr_in *inp) {
- return (res_ourserver_p(&_res, (const struct sockaddr_in6 *) inp));
-}
-
-int
-res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) {
- if (__res_maybe_init (&_res, 1) == -1) {
- /* errno should have been set by res_init() in this case. */
- return (-1);
- }
-
- return (res_nsend(&_res, buf, buflen, ans, anssiz));
-}
-
-#ifndef _LIBC
-int
-res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key,
- u_char *ans, int anssiz)
-{
- if (__res_maybe_init (&_res, 1) == -1) {
- /* errno should have been set by res_init() in this case. */
- return (-1);
- }
-
- return (res_nsendsigned(&_res, buf, buflen, key, ans, anssiz));
-}
-#endif
-
-void
-res_close(void) {
-#ifdef _LIBC
- /*
- * Some stupid programs out there call res_close() before res_init().
- * Since _res._vcsock isn't explicitly initialized, these means that
- * we could do a close(0), which might lead to some security problems.
- * Therefore we check if res_init() was called before by looking at
- * the RES_INIT bit in _res.options. If it hasn't been set we bail out
- * early. */
- if ((_res.options & RES_INIT) == 0)
- return;
-#endif
- res_nclose(&_res);
-}
-
-#ifdef BIND_UPDATE
-int
-res_update(ns_updrec *rrecp_in) {
- if (__res_maybe_init (&_res, 1) == -1) {
- RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
- return (-1);
- }
-
- return (res_nupdate(&_res, rrecp_in, NULL));
-}
-#endif
-
-int
-res_search(const char *name, /* domain name */
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen) /* size of answer */
-{
- if (__res_maybe_init (&_res, 1) == -1) {
- RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
- return (-1);
- }
-
- return (res_nsearch(&_res, name, class, type, answer, anslen));
-}
-
-int
-res_querydomain(const char *name,
- const char *domain,
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen) /* size of answer */
-{
- if (__res_maybe_init (&_res, 1) == -1) {
- RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
- return (-1);
- }
-
- return (res_nquerydomain(&_res, name, domain,
- class, type,
- answer, anslen));
-}
-
-const char *
-hostalias(const char *name) {
- static char abuf[MAXDNAME];
-
- return (res_hostalias(&_res, name, abuf, sizeof abuf));
-}
-libresolv_hidden_def (hostalias)
-
-#ifdef ultrix
-int
-local_hostname_length(const char *hostname) {
- int len_host, len_domain;
-
- if (!*_res.defdname)
- res_init();
- len_host = strlen(hostname);
- len_domain = strlen(_res.defdname);
- if (len_host > len_domain &&
- !strcasecmp(hostname + len_host - len_domain, _res.defdname) &&
- hostname[len_host - len_domain - 1] == '.')
- return (len_host - len_domain - 1);
- return (0);
-}
-#endif /*ultrix*/
-
-#endif
-
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libresolv, GLIBC_2_0, GLIBC_2_2)
-# undef res_mkquery
-# undef res_query
-# undef res_querydomain
-# undef res_search
-weak_alias (__res_mkquery, res_mkquery);
-weak_alias (__res_query, res_query);
-weak_alias (__res_querydomain, res_querydomain);
-weak_alias (__res_search, res_search);
-#endif
diff --git a/ports/glibc-compat/src/res_debug.c b/ports/glibc-compat/src/res_debug.c
deleted file mode 100644
index 16aa6e7..0000000
--- a/ports/glibc-compat/src/res_debug.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <math.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include "local.h"
-
-void
-res_pquery(const res_state statp, const u_char *msg, int len, FILE *file) {
-}
diff --git a/ports/glibc-compat/src/res_debug.h b/ports/glibc-compat/src/res_debug.h
deleted file mode 100644
index 4a0aa99..0000000
--- a/ports/glibc-compat/src/res_debug.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#ifndef _RES_DEBUG_H_
-#define _RES_DEBUG_H_
-
-#ifndef DEBUG
-# define Dprint(cond, args) /*empty*/
-# define DprintQ(cond, args, query, size) /*empty*/
-# define Aerror(statp, file, string, error, address) /*empty*/
-# define Perror(statp, file, string, error) /*empty*/
-#else
-# define Dprint(cond, args) if (cond) {fprintf args;} else {}
-# define DprintQ(cond, args, query, size) if (cond) {\
- fprintf args;\
- res_pquery(statp, query, size, stdout);\
- } else {}
-#endif
-
-#endif /* _RES_DEBUG_H_ */
diff --git a/ports/glibc-compat/src/res_init.c b/ports/glibc-compat/src/res_init.c
deleted file mode 100644
index aa5b5b4..0000000
--- a/ports/glibc-compat/src/res_init.c
+++ /dev/null
@@ -1,614 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$BINDId: res_init.c,v 8.16 2000/05/09 07:10:12 vixie Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <stdio.h>
-#ifndef __native_client__
-#include <stdio_ext.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <not-cancel.h>
-#include "local.h"
-#include <resolv.h>
-
-/* Options. Should all be left alone. */
-#define RESOLVSORT
-#define RFC1535
-/* #undef DEBUG */
-
-#ifdef __native_client__
-#define __gethostname gethostname
-#endif
-
-static void res_setoptions (res_state, const char *, const char *)
- internal_function;
-
-#ifdef RESOLVSORT
-static const char sort_mask_chars[] = "/&";
-#define ISSORTMASK(ch) (strchr(sort_mask_chars, ch) != NULL)
-static u_int32_t net_mask (struct in_addr) __THROW;
-#endif
-
-#if !defined(isascii) /* XXX - could be a function */
-# define isascii(c) (!(c & 0200))
-#endif
-
-#ifdef _LIBC
-unsigned long long int __res_initstamp attribute_hidden;
-#endif
-
-/*
- * Resolver state default settings.
- */
-
-/*
- * Set up default settings. If the configuration file exist, the values
- * there will have precedence. Otherwise, the server address is set to
- * INADDR_ANY and the default domain name comes from the gethostname().
- *
- * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
- * rather than INADDR_ANY ("0.0.0.0") as the default name server address
- * since it was noted that INADDR_ANY actually meant ``the first interface
- * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
- * it had to be "up" in order for you to reach your own name server. It
- * was later decided that since the recommended practice is to always
- * install local static routes through 127.0.0.1 for all your network
- * interfaces, that we could solve this problem without a code change.
- *
- * The configuration file should always be used, since it is the only way
- * to specify a default domain. If you are running a server on your local
- * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
- * in the configuration file.
- *
- * Return 0 if completes successfully, -1 on error
- */
-extern int __res_vinit(res_state, int);
-int
-res_ninit(res_state statp) {
-
- return (__res_vinit(statp, 0));
-}
-#ifdef _LIBC
-libc_hidden_def (__res_ninit)
-#endif
-
-/* This function has to be reachable by res_data.c but not publically. */
-int
-__res_vinit(res_state statp, int preinit) {
- register FILE *fp;
- register char *cp, **pp;
- register int n;
- char buf[BUFSIZ];
- int nserv = 0; /* number of nameserver records read from file */
-#ifdef _LIBC
- int nservall = 0; /* number of NS records read, nserv IPv4 only */
-#endif
- int haveenv = 0;
- int havesearch = 0;
-#ifdef RESOLVSORT
- int nsort = 0;
- char *net;
-#endif
-#ifndef RFC1535
- int dots;
-#endif
-#ifdef _LIBC
- statp->_u._ext.initstamp = __res_initstamp;
-#endif
-
- if (!preinit) {
- statp->retrans = RES_TIMEOUT;
- statp->retry = RES_DFLRETRY;
- statp->options = RES_DEFAULT;
- statp->id = res_randomid();
- }
-
-#ifdef USELOOPBACK
- statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
- statp->nsaddr.sin_addr.s_addr = INADDR_ANY;
-#endif
- statp->nsaddr.sin_family = AF_INET;
- statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
- statp->nscount = 1;
- statp->ndots = 1;
- statp->pfcode = 0;
- statp->_vcsock = -1;
- statp->_flags = 0;
- statp->qhook = NULL;
- statp->rhook = NULL;
- statp->_u._ext.nsinit = 0;
- statp->_u._ext.nscount = 0;
-#ifdef _LIBC
- statp->_u._ext.nscount6 = 0;
- for (n = 0; n < MAXNS; n++) {
- statp->_u._ext.nsaddrs[n] = NULL;
- statp->_u._ext.nsmap[n] = MAXNS;
- }
-#endif
-
- /* Allow user to override the local domain definition */
- if ((cp = getenv("LOCALDOMAIN")) != NULL) {
- (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
- statp->defdname[sizeof(statp->defdname) - 1] = '\0';
- haveenv++;
-
- /*
- * Set search list to be blank-separated strings
- * from rest of env value. Permits users of LOCALDOMAIN
- * to still have a search list, and anyone to set the
- * one that they want to use as an individual (even more
- * important now that the rfc1535 stuff restricts searches)
- */
- cp = statp->defdname;
- pp = statp->dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
- if (*cp == '\n') /* silly backwards compat */
- break;
- else if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- havesearch = 1;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- }
-
-#define MATCH(line, name) \
- (!strncmp(line, name, sizeof(name) - 1) && \
- (line[sizeof(name) - 1] == ' ' || \
- line[sizeof(name) - 1] == '\t'))
-
- if ((fp = fopen(_PATH_RESCONF, "rc")) != NULL) {
- /* No threads use this stream. */
- __fsetlocking (fp, FSETLOCKING_BYCALLER);
- /* read the config file */
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- /* skip comments */
- if (*buf == ';' || *buf == '#')
- continue;
- /* read default domain name */
- if (MATCH(buf, "domain")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("domain") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
- statp->defdname[sizeof(statp->defdname) - 1] = '\0';
- if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL)
- *cp = '\0';
- havesearch = 0;
- continue;
- }
- /* set search list */
- if (MATCH(buf, "search")) {
- if (haveenv) /* skip if have from environ */
- continue;
- cp = buf + sizeof("search") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp == '\0') || (*cp == '\n'))
- continue;
- strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
- statp->defdname[sizeof(statp->defdname) - 1] = '\0';
- if ((cp = strchr(statp->defdname, '\n')) != NULL)
- *cp = '\0';
- /*
- * Set search list to be blank-separated strings
- * on rest of line.
- */
- cp = statp->defdname;
- pp = statp->dnsrch;
- *pp++ = cp;
- for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
- if (*cp == ' ' || *cp == '\t') {
- *cp = 0;
- n = 1;
- } else if (n) {
- *pp++ = cp;
- n = 0;
- }
- }
- /* null terminate last domain if there are excess */
- while (*cp != '\0' && *cp != ' ' && *cp != '\t')
- cp++;
- *cp = '\0';
- *pp++ = 0;
- havesearch = 1;
- continue;
- }
- /* read nameservers to query */
-#ifdef _LIBC
- if (MATCH(buf, "nameserver") && nservall < MAXNS) {
-#else
- if (MATCH(buf, "nameserver") && nserv < MAXNS) {
-#endif
- struct in_addr a;
-
- cp = buf + sizeof("nameserver") - 1;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if ((*cp != '\0') && (*cp != '\n')
- && inet_aton(cp, &a)) {
- statp->nsaddr_list[nserv].sin_addr = a;
- statp->nsaddr_list[nserv].sin_family = AF_INET;
- statp->nsaddr_list[nserv].sin_port =
- htons(NAMESERVER_PORT);
- nserv++;
-#ifdef _LIBC
- nservall++;
- } else {
- struct in6_addr a6;
- char *el;
-
- if ((el = strchr(cp, '\n')) != NULL)
- *el = '\0';
- if ((*cp != '\0') &&
- (inet_pton(AF_INET6, cp, &a6) > 0)) {
- struct sockaddr_in6 *sa6;
-
- sa6 = malloc(sizeof(*sa6));
- if (sa6 != NULL) {
- sa6->sin6_addr = a6;
- sa6->sin6_family = AF_INET6;
- sa6->sin6_port = htons(NAMESERVER_PORT);
- statp->_u._ext.nsaddrs[nservall] = sa6;
- statp->_u._ext.nssocks[nservall] = -1;
- statp->_u._ext.nsmap[nservall] = MAXNS + 1;
- nservall++;
- }
- }
-#endif
- }
- continue;
- }
-#ifdef RESOLVSORT
- if (MATCH(buf, "sortlist")) {
- struct in_addr a;
-
- cp = buf + sizeof("sortlist") - 1;
- while (nsort < MAXRESOLVSORT) {
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if (*cp == '\0' || *cp == '\n' || *cp == ';')
- break;
- net = cp;
- while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- statp->sort_list[nsort].addr = a;
- if (ISSORTMASK(n)) {
- *cp++ = n;
- net = cp;
- while (*cp && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
- cp++;
- n = *cp;
- *cp = 0;
- if (inet_aton(net, &a)) {
- statp->sort_list[nsort].mask = a.s_addr;
- } else {
- statp->sort_list[nsort].mask =
- net_mask(statp->sort_list[nsort].addr);
- }
- } else {
- statp->sort_list[nsort].mask =
- net_mask(statp->sort_list[nsort].addr);
- }
- nsort++;
- }
- *cp = n;
- }
- continue;
- }
-#endif
- if (MATCH(buf, "options")) {
- res_setoptions(statp, buf + sizeof("options") - 1, "conf");
- continue;
- }
- }
- if (nserv > 1)
- statp->nscount = nserv;
-#ifdef _LIBC
- if (nservall - nserv > 0)
- statp->_u._ext.nscount6 = nservall - nserv;
-#endif
-#ifdef RESOLVSORT
- statp->nsort = nsort;
-#endif
- (void) fclose(fp);
- }
- if (statp->defdname[0] == 0 &&
- __gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
- (cp = strchr(buf, '.')) != NULL)
- strcpy(statp->defdname, cp + 1);
-
- /* find components of local domain that might be searched */
- if (havesearch == 0) {
- pp = statp->dnsrch;
- *pp++ = statp->defdname;
- *pp = NULL;
-
-#ifndef RFC1535
- dots = 0;
- for (cp = statp->defdname; *cp; cp++)
- dots += (*cp == '.');
-
- cp = statp->defdname;
- while (pp < statp->dnsrch + MAXDFLSRCH) {
- if (dots < LOCALDOMAINPARTS)
- break;
- cp = memchr(cp, '.') + 1; /* we know there is one */
- *pp++ = cp;
- dots--;
- }
- *pp = NULL;
-#ifdef DEBUG
- if (statp->options & RES_DEBUG) {
- printf(";; res_init()... default dnsrch list:\n");
- for (pp = statp->dnsrch; *pp; pp++)
- printf(";;\t%s\n", *pp);
- printf(";;\t..END..\n");
- }
-#endif
-#endif /* !RFC1535 */
- }
-
- if ((cp = getenv("RES_OPTIONS")) != NULL)
- res_setoptions(statp, cp, "env");
- statp->options |= RES_INIT;
- return (0);
-}
-
-static void
-internal_function
-res_setoptions(res_state statp, const char *options, const char *source) {
- const char *cp = options;
- int i;
-
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";; res_setoptions(\"%s\", \"%s\")...\n",
- options, source);
-#endif
- while (*cp) {
- /* skip leading and inner runs of spaces */
- while (*cp == ' ' || *cp == '\t')
- cp++;
- /* search for and process individual options */
- if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
- i = atoi(cp + sizeof("ndots:") - 1);
- if (i <= RES_MAXNDOTS)
- statp->ndots = i;
- else
- statp->ndots = RES_MAXNDOTS;
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";;\tndots=%d\n", statp->ndots);
-#endif
- } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) {
- i = atoi(cp + sizeof("timeout:") - 1);
- if (i <= RES_MAXRETRANS)
- statp->retrans = i;
- else
- statp->retrans = RES_MAXRETRANS;
- } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
- i = atoi(cp + sizeof("attempts:") - 1);
- if (i <= RES_MAXRETRY)
- statp->retry = i;
- else
- statp->retry = RES_MAXRETRY;
- } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
-#ifdef DEBUG
- if (!(statp->options & RES_DEBUG)) {
- printf(";; res_setoptions(\"%s\", \"%s\")..\n",
- options, source);
- statp->options |= RES_DEBUG;
- }
- printf(";;\tdebug\n");
-#endif
- } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
- statp->options |= RES_USE_INET6;
- } else if (!strncmp(cp, "ip6-bytestring",
- sizeof("ip6-bytestring") - 1)) {
- statp->options |= RES_USEBSTRING;
- } else if (!strncmp(cp, "no-ip6-dotint",
- sizeof("no-ip6-dotint") - 1)) {
- statp->options |= RES_NOIP6DOTINT;
- } else if (!strncmp(cp, "ip6-dotint",
- sizeof("ip6-dotint") - 1)) {
- statp->options &= ~RES_NOIP6DOTINT;
- } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) {
- statp->options |= RES_ROTATE;
- } else if (!strncmp(cp, "no-check-names",
- sizeof("no-check-names") - 1)) {
- statp->options |= RES_NOCHECKNAME;
- } else {
- /* XXX - print a warning here? */
- }
- /* skip to next run of spaces */
- while (*cp && *cp != ' ' && *cp != '\t')
- cp++;
- }
-}
-
-#ifdef RESOLVSORT
-/* XXX - should really support CIDR which means explicit masks always. */
-static u_int32_t
-net_mask(in) /* XXX - should really use system's version of this */
- struct in_addr in;
-{
- register u_int32_t i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (htonl(IN_CLASSA_NET));
- else if (IN_CLASSB(i))
- return (htonl(IN_CLASSB_NET));
- return (htonl(IN_CLASSC_NET));
-}
-#endif
-
-u_int
-res_randomid(void) {
- struct timeval now;
-
- gettimeofday(&now, NULL);
- return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid()));
-}
-#ifdef _LIBC
-libc_hidden_def (__res_randomid)
-#endif
-
-
-/*
- * This routine is for closing the socket if a virtual circuit is used and
- * the program wants to close it. This provides support for endhostent()
- * which expects to close the socket.
- *
- * This routine is not expected to be user visible.
- */
-void
-res_nclose(res_state statp) {
- int ns;
-
- if (statp->_vcsock >= 0) {
- close_not_cancel_no_status(statp->_vcsock);
- statp->_vcsock = -1;
- statp->_flags &= ~(RES_F_VC | RES_F_CONN);
- }
-#ifdef _LIBC
- for (ns = 0; ns < MAXNS; ns++)
-#else
- for (ns = 0; ns < statp->_u._ext.nscount; ns++)
-#endif
- if (statp->_u._ext.nsaddrs[ns]
- && statp->_u._ext.nssocks[ns] != -1) {
- close_not_cancel_no_status(statp->_u._ext.nssocks[ns]);
- statp->_u._ext.nssocks[ns] = -1;
- }
- statp->_u._ext.nsinit = 0;
-}
-#ifdef _LIBC
-libc_hidden_def (__res_nclose)
-#endif
-
-#ifdef _LIBC
-# ifdef _LIBC_REENTRANT
-/* This is called when a thread is exiting to free resources held in _res. */
-static void __attribute__ ((section ("__libc_thread_freeres_fn")))
-res_thread_freeres (void)
-{
- if (_res.nscount == 0)
- /* Never called res_ninit. */
- return;
-
- __res_nclose (&_res); /* Close any VC sockets. */
-
- for (int ns = 0; ns < MAXNS; ns++)
- if (_res._u._ext.nsaddrs[ns] != NULL)
- {
- free (_res._u._ext.nsaddrs[ns]);
- _res._u._ext.nsaddrs[ns] = NULL;
- }
-
- /* Make sure we do a full re-initialization the next time. */
- _res.options = 0;
-}
-text_set_element (__libc_thread_subfreeres, res_thread_freeres);
-text_set_element (__libc_subfreeres, res_thread_freeres);
-# endif
-#endif
diff --git a/ports/glibc-compat/src/res_libc.c b/ports/glibc-compat/src/res_libc.c
deleted file mode 100644
index 6607da2..0000000
--- a/ports/glibc-compat/src/res_libc.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 1995-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-#ifndef __native_client__
-#include <machine/atomic.h>
-#endif
-#include <limits.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-#ifndef __native_client__
-#include <bits/libc-lock.h>
-#endif
-
-#include "libc-symbols.h"
-
-
-/* The following bit is copied from res_data.c (where it is #ifdef'ed
- out) since res_init() should go into libc.so but the rest of that
- file should not. */
-
-extern unsigned long long int __res_initstamp attribute_hidden;
-#ifdef __native_client__
-# define atomicinclock(lock) (void) 0
-# define atomicincunlock(lock) (void) 0
-# define atomicinc(var) ++var
-#else
-/* We have atomic increment operations on 64-bit platforms. */
-#if __WORDSIZE == 64
-# define atomicinclock(lock) (void) 0
-# define atomicincunlock(lock) (void) 0
-# define atomicinc(var) atomic_increment (&(var))
-#else
-__libc_lock_define_initialized (static, lock);
-# define atomicinclock(lock) __libc_lock_lock (lock)
-# define atomicincunlock(lock) __libc_lock_unlock (lock)
-# define atomicinc(var) ++var
-#endif
-#endif
-
-extern int __res_vinit(res_state, int);
-int
-res_init(void) {
-
- /*
- * These three fields used to be statically initialized. This made
- * it hard to use this code in a shared library. It is necessary,
- * now that we're doing dynamic initialization here, that we preserve
- * the old semantics: if an application modifies one of these three
- * fields of _res before res_init() is called, res_init() will not
- * alter them. Of course, if an application is setting them to
- * _zero_ before calling res_init(), hoping to override what used
- * to be the static default, we can't detect it and unexpected results
- * will follow. Zero for any of these fields would make no sense,
- * so one can safely assume that the applications were already getting
- * unexpected results.
- *
- * _res.options is tricky since some apps were known to diddle the bits
- * before res_init() was first called. We can't replicate that semantic
- * with dynamic initialization (they may have turned bits off that are
- * set in RES_DEFAULT). Our solution is to declare such applications
- * "broken". They could fool us by setting RES_INIT but none do (yet).
- */
- if (!_res.retrans)
- _res.retrans = RES_TIMEOUT;
- if (!_res.retry)
- _res.retry = 4;
- if (!(_res.options & RES_INIT))
- _res.options = RES_DEFAULT;
- else if (_res.nscount > 0) {
- __res_nclose (&_res); /* Close any VC sockets. */
- int ns;
- for (ns = 0; ns < MAXNS; ns++) {
- free (_res._u._ext.nsaddrs[ns]);
- _res._u._ext.nsaddrs[ns] = NULL;
- }
- }
-
- /*
- * This one used to initialize implicitly to zero, so unless the app
- * has set it to something in particular, we can randomize it now.
- */
- if (!_res.id)
- _res.id = res_randomid();
-
- atomicinclock (lock);
- /* Request all threads to re-initialize their resolver states,
- resolv.conf might have changed. */
- atomicinc (__res_initstamp);
- atomicincunlock (lock);
-
- return (__res_vinit(&_res, 1));
-}
-
-/* Initialize resp if RES_INIT is not yet set or if res_init in some other
- thread requested re-initializing. */
-int
-__res_maybe_init (res_state resp, int preinit)
-{
- if (resp->options & RES_INIT) {
- if (__res_initstamp != resp->_u._ext.initstamp) {
- if (resp->nscount > 0) {
- __res_nclose (resp);
- int ns;
- for (ns = 0; ns < MAXNS; ns++) {
- free (resp->_u._ext.nsaddrs[ns]);
- resp->_u._ext.nsaddrs[ns] = NULL;
- }
- return __res_vinit (resp, 1);
- }
- }
- return 0;
- } else if (preinit) {
- if (!resp->retrans)
- resp->retrans = RES_TIMEOUT;
- if (!resp->retry)
- resp->retry = 4;
- resp->options = RES_DEFAULT;
- if (!resp->id)
- resp->id = res_randomid ();
- return __res_vinit (resp, 1);
- } else
- return __res_ninit (resp);
-}
-libc_hidden_def (__res_maybe_init)
-
-/* This needs to be after the use of _res in res_init, above. */
-#undef _res
-
-/* The resolver state for use by single-threaded programs.
- This differs from plain `struct __res_state _res;' in that it doesn't
- create a common definition, but a plain symbol that resides in .bss,
- which can have an alias. */
-/* Removed __attribute__((section(".bss"))) because PNaCl doesn't support
- this trick and trick with removing common definition is not critical. */
-struct __res_state _res /* __attribute__((section (".bss"))) */;
-
-#define USE___THREAD 1
-
-#if USE___THREAD
-#undef __resp
-__thread struct __res_state *__resp = &_res;
-#endif
-
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2)
-# undef res_init
-extern int __res_init_weak (void);
-weak_extern (__res_init_weak);
-strong_alias (__res_init, __res_init_weak);
-compat_symbol (libc, __res_init_weak, res_init, GLIBC_2_0);
-#endif
diff --git a/ports/glibc-compat/src/res_mkquery.c b/ports/glibc-compat/src/res_mkquery.c
deleted file mode 100644
index 5849088..0000000
--- a/ports/glibc-compat/src/res_mkquery.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 1985, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$BINDId: res_mkquery.c,v 8.12 1999/10/13 16:39:40 vixie Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include "local.h"
-
-/* Options. Leave them on. */
-/* #define DEBUG */
-
-#ifdef _LIBC
-# include <hp-timing.h>
-# if HP_TIMING_AVAIL
-# define RANDOM_BITS(Var) { uint64_t v64; HP_TIMING_NOW (v64); Var = v64; }
-# endif
-#endif
-
-/*
- * Form all types of queries.
- * Returns the size of the result or -1.
- */
-int
-res_nmkquery(res_state statp,
- int op, /* opcode of query */
- const char *dname, /* domain name */
- int class, int type, /* class and type of query */
- const u_char *data, /* resource record data */
- int datalen, /* length of data */
- const u_char *newrr_in, /* new rr for modify or append */
- u_char *buf, /* buffer to put query */
- int buflen) /* size of buffer */
-{
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *dnptrs[20], **dpp, **lastdnptr;
-
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";; res_nmkquery(%s, %s, %s, %s)\n",
- _res_opcodes[op], dname, p_class(class), p_type(type));
-#endif
- /*
- * Initialize header fields.
- */
- if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
- memset(buf, 0, HFIXEDSZ);
- hp = (HEADER *) buf;
- /* We randomize the IDs every time. The old code just
- incremented by one after the initial randomization which
- still predictable if the application does multiple
- requests. */
-#if 0
- hp->id = htons(++statp->id);
-#else
- hp->id = htons(statp->id);
- int randombits;
- do
- {
-#ifdef RANDOM_BITS
- RANDOM_BITS (randombits);
-#else
- struct timeval tv;
- gettimeofday (&tv, NULL);
- randombits = (tv.tv_sec << 8) ^ tv.tv_usec;
-#endif
- }
- while ((randombits & 0xffff) == 0);
- statp->id = (statp->id + randombits) & 0xffff;
-#endif
- hp->opcode = op;
- hp->rd = (statp->options & RES_RECURSE) != 0;
- hp->rcode = NOERROR;
- cp = buf + HFIXEDSZ;
- buflen -= HFIXEDSZ;
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
- /*
- * perform opcode specific processing
- */
- switch (op) {
- case QUERY: /*FALLTHROUGH*/
- case NS_NOTIFY_OP:
- if ((buflen -= QFIXEDSZ) < 0)
- return (-1);
- if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- hp->qdcount = htons(1);
- if (op == QUERY || data == NULL)
- break;
- /*
- * Make an additional record for completion domain.
- */
- buflen -= RRFIXEDSZ;
- n = dn_comp((char *)data, cp, buflen, dnptrs, lastdnptr);
- if (n < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(T_NULL, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(0, cp);
- cp += INT16SZ;
- hp->arcount = htons(1);
- break;
-
- case IQUERY:
- /*
- * Initialize answer section
- */
- if (buflen < 1 + RRFIXEDSZ + datalen)
- return (-1);
- *cp++ = '\0'; /* no domain name */
- __putshort(type, cp);
- cp += INT16SZ;
- __putshort(class, cp);
- cp += INT16SZ;
- __putlong(0, cp);
- cp += INT32SZ;
- __putshort(datalen, cp);
- cp += INT16SZ;
- if (datalen) {
- memcpy(cp, data, datalen);
- cp += datalen;
- }
- hp->ancount = htons(1);
- break;
-
- default:
- return (-1);
- }
- return (cp - buf);
-}
-libresolv_hidden_def (res_nmkquery)
diff --git a/ports/glibc-compat/src/res_query.c b/ports/glibc-compat/src/res_query.c
deleted file mode 100644
index fcb624e..0000000
--- a/ports/glibc-compat/src/res_query.c
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Copyright (c) 1988, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$BINDId: res_query.c,v 8.20 2000/02/29 05:39:12 vixie Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "libc-symbols.h"
-
-/* Options. Leave them on. */
-/* #undef DEBUG */
-
-#if PACKETSZ > 65536
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 65536
-#endif
-
-#define QUERYSIZE (HFIXEDSZ + QFIXEDSZ + MAXCDNAME + 1)
-
-static int
-__libc_res_nquerydomain(res_state statp, const char *name, const char *domain,
- int class, int type, u_char *answer, int anslen,
- u_char **answerp);
-
-/*
- * Formulate a normal query, send, and await answer.
- * Returned answer is placed in supplied buffer "answer".
- * Perform preliminary check of answer, returning success only
- * if no error is indicated and the answer count is nonzero.
- * Return the size of the response on success, -1 on error.
- * Error number is left in H_ERRNO.
- *
- * Caller must parse answer and determine whether it answers the question.
- */
-int
-__libc_res_nquery(res_state statp,
- const char *name, /* domain name */
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen, /* size of answer buffer */
- u_char **answerp) /* if buffer needs to be enlarged */
-{
- u_char *buf;
- HEADER *hp = (HEADER *) answer;
- int n, use_malloc = 0;
-
- hp->rcode = NOERROR; /* default */
-
- buf = alloca (QUERYSIZE);
-
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";; res_query(%s, %d, %d)\n", name, class, type);
-#endif
-
- n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL,
- buf, QUERYSIZE);
- if (__builtin_expect (n <= 0, 0)) {
- /* Retry just in case res_nmkquery failed because of too
- short buffer. Shouldn't happen. */
- buf = malloc (MAXPACKET);
- if (buf != NULL) {
- use_malloc = 1;
- n = res_nmkquery(statp, QUERY, name, class, type, NULL,
- 0, NULL, buf, MAXPACKET);
- }
- }
- if (__builtin_expect (n <= 0, 0)) {
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";; res_query: mkquery failed\n");
-#endif
- RES_SET_H_ERRNO(statp, NO_RECOVERY);
- if (use_malloc)
- free (buf);
- return (n);
- }
- n = __libc_res_nsend(statp, buf, n, answer, anslen, answerp);
- if (use_malloc)
- free (buf);
- if (n < 0) {
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";; res_query: send error\n");
-#endif
- RES_SET_H_ERRNO(statp, TRY_AGAIN);
- return (n);
- }
-
- if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";; rcode = %d, ancount=%d\n", hp->rcode,
- ntohs(hp->ancount));
-#endif
- switch (hp->rcode) {
- case NXDOMAIN:
- RES_SET_H_ERRNO(statp, HOST_NOT_FOUND);
- break;
- case SERVFAIL:
- RES_SET_H_ERRNO(statp, TRY_AGAIN);
- break;
- case NOERROR:
- RES_SET_H_ERRNO(statp, NO_DATA);
- break;
- case FORMERR:
- case NOTIMP:
- case REFUSED:
- default:
- RES_SET_H_ERRNO(statp, NO_RECOVERY);
- break;
- }
- return (-1);
- }
- return (n);
-}
-libresolv_hidden_def (__libc_res_nquery)
-
-int
-res_nquery(res_state statp,
- const char *name, /* domain name */
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen) /* size of answer buffer */
-{
- return __libc_res_nquery(statp, name, class, type, answer, anslen,
- NULL);
-}
-libresolv_hidden_def (res_nquery)
-
-/*
- * Formulate a normal query, send, and retrieve answer in supplied buffer.
- * Return the size of the response on success, -1 on error.
- * If enabled, implement search rules until answer or unrecoverable failure
- * is detected. Error code, if any, is left in H_ERRNO.
- */
-int
-__libc_res_nsearch(res_state statp,
- const char *name, /* domain name */
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen, /* size of answer */
- u_char **answerp)
-{
- const char *cp, * const *domain;
- HEADER *hp = (HEADER *) answer;
- char tmp[NS_MAXDNAME];
- u_int dots;
- int trailing_dot, ret, saved_herrno;
- int got_nodata = 0, got_servfail = 0, root_on_list = 0;
- int tried_as_is = 0;
-
- __set_errno (0);
- RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); /* True if we never query. */
-
- dots = 0;
- for (cp = name; *cp != '\0'; cp++)
- dots += (*cp == '.');
- trailing_dot = 0;
- if (cp > name && *--cp == '.')
- trailing_dot++;
-
- /* If there aren't any dots, it could be a user-level alias. */
- if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL)
- return (__libc_res_nquery(statp, cp, class, type, answer,
- anslen, answerp));
-
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf("dots=%d, statp->ndots=%d, trailing_dot=%d, name=%s\n",
- (int)dots,(int)statp->ndots,(int)trailing_dot,name);
-#endif
-
- /*
- * If there are enough dots in the name, let's just give it a
- * try 'as is'. The threshold can be set with the "ndots" option.
- * Also, query 'as is', if there is a trailing dot in the name.
- */
- saved_herrno = -1;
- if (dots >= statp->ndots || trailing_dot) {
- ret = __libc_res_nquerydomain(statp, name, NULL, class, type,
- answer, anslen, answerp);
- if (ret > 0 || trailing_dot)
- return (ret);
- saved_herrno = h_errno;
- tried_as_is++;
- if (answerp && *answerp != answer) {
- answer = *answerp;
- anslen = MAXPACKET;
- }
- }
-
- /*
- * We do at least one level of search if
- * - there is no dot and RES_DEFNAME is set, or
- * - there is at least one dot, there is no trailing dot,
- * and RES_DNSRCH is set.
- */
- if ((!dots && (statp->options & RES_DEFNAMES) != 0) ||
- (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0)) {
- int done = 0;
-
- for (domain = (const char * const *)statp->dnsrch;
- *domain && !done;
- domain++) {
-
- if (domain[0][0] == '\0' ||
- (domain[0][0] == '.' && domain[0][1] == '\0'))
- root_on_list++;
-
- ret = __libc_res_nquerydomain(statp, name, *domain,
- class, type,
- answer, anslen, answerp);
- if (ret > 0)
- return (ret);
-
- if (answerp && *answerp != answer) {
- answer = *answerp;
- anslen = MAXPACKET;
- }
-
- /*
- * If no server present, give up.
- * If name isn't found in this domain,
- * keep trying higher domains in the search list
- * (if that's enabled).
- * On a NO_DATA error, keep trying, otherwise
- * a wildcard entry of another type could keep us
- * from finding this entry higher in the domain.
- * If we get some other error (negative answer or
- * server failure), then stop searching up,
- * but try the input name below in case it's
- * fully-qualified.
- */
- if (errno == ECONNREFUSED) {
- RES_SET_H_ERRNO(statp, TRY_AGAIN);
- return (-1);
- }
-
- switch (statp->res_h_errno) {
- case NO_DATA:
- got_nodata++;
- /* FALLTHROUGH */
- case HOST_NOT_FOUND:
- /* keep trying */
- break;
- case TRY_AGAIN:
- if (hp->rcode == SERVFAIL) {
- /* try next search element, if any */
- got_servfail++;
- break;
- }
- /* FALLTHROUGH */
- default:
- /* anything else implies that we're done */
- done++;
- }
-
- /* if we got here for some reason other than DNSRCH,
- * we only wanted one iteration of the loop, so stop.
- */
- if ((statp->options & RES_DNSRCH) == 0)
- done++;
- }
- }
-
- /*
- * If the name has any dots at all, and no earlier 'as-is' query
- * for the name, and "." is not on the search list, then try an as-is
- * query now.
- */
- if (dots && !(tried_as_is || root_on_list)) {
- ret = __libc_res_nquerydomain(statp, name, NULL, class, type,
- answer, anslen, answerp);
- if (ret > 0)
- return (ret);
- }
-
- /* if we got here, we didn't satisfy the search.
- * if we did an initial full query, return that query's H_ERRNO
- * (note that we wouldn't be here if that query had succeeded).
- * else if we ever got a nodata, send that back as the reason.
- * else send back meaningless H_ERRNO, that being the one from
- * the last DNSRCH we did.
- */
- if (saved_herrno != -1)
- RES_SET_H_ERRNO(statp, saved_herrno);
- else if (got_nodata)
- RES_SET_H_ERRNO(statp, NO_DATA);
- else if (got_servfail)
- RES_SET_H_ERRNO(statp, TRY_AGAIN);
- return (-1);
-}
-libresolv_hidden_def (__libc_res_nsearch)
-
-int
-res_nsearch(res_state statp,
- const char *name, /* domain name */
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen) /* size of answer */
-{
- return __libc_res_nsearch(statp, name, class, type, answer,
- anslen, NULL);
-}
-libresolv_hidden_def (res_nsearch)
-
-/*
- * Perform a call on res_query on the concatenation of name and domain,
- * removing a trailing dot from name if domain is NULL.
- */
-static int
-__libc_res_nquerydomain(res_state statp,
- const char *name,
- const char *domain,
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen, /* size of answer */
- u_char **answerp)
-{
- char nbuf[MAXDNAME];
- const char *longname = nbuf;
- int n, d;
-
-#ifdef DEBUG
- if (statp->options & RES_DEBUG)
- printf(";; res_nquerydomain(%s, %s, %d, %d)\n",
- name, domain?domain:"<Nil>", class, type);
-#endif
- if (domain == NULL) {
- /*
- * Check for trailing '.';
- * copy without '.' if present.
- */
- n = strlen(name);
- if (n >= MAXDNAME) {
- RES_SET_H_ERRNO(statp, NO_RECOVERY);
- return (-1);
- }
- n--;
- if (n >= 0 && name[n] == '.') {
- strncpy(nbuf, name, n);
- nbuf[n] = '\0';
- } else
- longname = name;
- } else {
- n = strlen(name);
- d = strlen(domain);
- if (n + d + 1 >= MAXDNAME) {
- RES_SET_H_ERRNO(statp, NO_RECOVERY);
- return (-1);
- }
- sprintf(nbuf, "%s.%s", name, domain);
- }
- return (__libc_res_nquery(statp, longname, class, type, answer,
- anslen, answerp));
-}
-
-int
-res_nquerydomain(res_state statp,
- const char *name,
- const char *domain,
- int class, int type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
- int anslen) /* size of answer */
-{
- return __libc_res_nquerydomain(statp, name, domain, class, type,
- answer, anslen, NULL);
-}
-libresolv_hidden_def (res_nquerydomain)
-
-const char *
-res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
- char *file, *cp1, *cp2;
- char buf[BUFSIZ];
- FILE *fp;
-
- if (statp->options & RES_NOALIASES)
- return (NULL);
- file = getenv("HOSTALIASES");
- if (file == NULL || (fp = fopen(file, "r")) == NULL)
- return (NULL);
- setbuf(fp, NULL);
- buf[sizeof(buf) - 1] = '\0';
- while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1)
- ;
- if (!*cp1)
- break;
- *cp1 = '\0';
- if (ns_samename(buf, name) == 1) {
- while (isspace(*++cp1))
- ;
- if (!*cp1)
- break;
- for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2)
- ;
- *cp2 = '\0';
- strncpy(dst, cp1, siz - 1);
- dst[siz - 1] = '\0';
- fclose(fp);
- return (dst);
- }
- }
- fclose(fp);
- return (NULL);
-}
-libresolv_hidden_def (res_hostalias)
diff --git a/ports/glibc-compat/src/res_send.c b/ports/glibc-compat/src/res_send.c
deleted file mode 100644
index 670641f..0000000
--- a/ports/glibc-compat/src/res_send.c
+++ /dev/null
@@ -1,1139 +0,0 @@
-/*
- * Copyright (c) 1985, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$BINDId: res_send.c,v 8.38 2000/03/30 20:16:51 vixie Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#define s6_addr32 __u6_addr.__u6_addr32
-/*
- * Send query to name server and wait for reply.
- */
-
-#include <assert.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#ifndef __native_client__
-# include <sys/poll.h>
-#endif
-
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <arpa/inet.h>
-#include <sys/ioctl.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "libc-symbols.h"
-
-#if PACKETSZ > 65536
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 65536
-#endif
-
-
-/* From ev_streams.c. */
-
-static inline void
-__attribute ((always_inline))
-evConsIovec(void *buf, size_t cnt, struct iovec *vec) {
- memset(vec, 0xf5, sizeof (*vec));
- vec->iov_base = buf;
- vec->iov_len = cnt;
-}
-
-/* From ev_timers.c. */
-
-#define BILLION 1000000000
-
-static inline void
-evConsTime(struct timespec *res, time_t sec, long nsec) {
- res->tv_sec = sec;
- res->tv_nsec = nsec;
-}
-
-static inline void
-evAddTime(struct timespec *res, const struct timespec *addend1,
- const struct timespec *addend2) {
- res->tv_sec = addend1->tv_sec + addend2->tv_sec;
- res->tv_nsec = addend1->tv_nsec + addend2->tv_nsec;
- if (res->tv_nsec >= BILLION) {
- res->tv_sec++;
- res->tv_nsec -= BILLION;
- }
-}
-
-static inline void
-evSubTime(struct timespec *res, const struct timespec *minuend,
- const struct timespec *subtrahend) {
- res->tv_sec = minuend->tv_sec - subtrahend->tv_sec;
- if (minuend->tv_nsec >= subtrahend->tv_nsec)
- res->tv_nsec = minuend->tv_nsec - subtrahend->tv_nsec;
- else {
- res->tv_nsec = (BILLION
- - subtrahend->tv_nsec + minuend->tv_nsec);
- res->tv_sec--;
- }
-}
-
-static inline int
-evCmpTime(struct timespec a, struct timespec b) {
- long x = a.tv_sec - b.tv_sec;
-
- if (x == 0L)
- x = a.tv_nsec - b.tv_nsec;
- return (x < 0L ? (-1) : x > 0L ? (1) : (0));
-}
-
-static inline void
-evNowTime(struct timespec *res) {
- struct timeval now;
-
- if (gettimeofday(&now, NULL) < 0)
- evConsTime(res, 0, 0);
- else
- TIMEVAL_TO_TIMESPEC (&now, res);
-}
-
-
-/* Options. Leave them on. */
-/* #undef DEBUG */
-#include "res_debug.h"
-
-#define EXT(res) ((res)->_u._ext)
-
-/* Forward. */
-
-static int send_vc(res_state, const u_char *, int,
- u_char **, int *, int *, int, u_char **);
-static int send_dg(res_state, const u_char *, int,
- u_char **, int *, int *, int,
- int *, int *, u_char **);
-#ifdef DEBUG
-static void Aerror(const res_state, FILE *, const char *, int,
- const struct sockaddr *);
-static void Perror(const res_state, FILE *, const char *, int);
-#endif
-static int sock_eq(struct sockaddr_in6 *, struct sockaddr_in6 *);
-
-/* Reachover. */
-
-static void convaddr4to6(struct sockaddr_in6 *sa);
-void res_pquery(const res_state, const u_char *, int, FILE *);
-
-/* Public. */
-
-/* int
- * res_isourserver(ina)
- * looks up "ina" in _res.ns_addr_list[]
- * returns:
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_ourserver_p(const res_state statp, const struct sockaddr_in6 *inp)
-{
- int ns;
-
- if (inp->sin6_family == AF_INET) {
- struct sockaddr_in *in4p = (struct sockaddr_in *) inp;
- in_port_t port = in4p->sin_port;
- in_addr_t addr = in4p->sin_addr.s_addr;
-
- for (ns = 0; ns < MAXNS; ns++) {
- const struct sockaddr_in *srv =
- (struct sockaddr_in *)EXT(statp).nsaddrs[ns];
-
- if ((srv != NULL) && (srv->sin_family == AF_INET) &&
- (srv->sin_port == port) &&
- (srv->sin_addr.s_addr == INADDR_ANY ||
- srv->sin_addr.s_addr == addr))
- return (1);
- }
- } else if (inp->sin6_family == AF_INET6) {
- for (ns = 0; ns < MAXNS; ns++) {
- const struct sockaddr_in6 *srv = EXT(statp).nsaddrs[ns];
- if ((srv != NULL) && (srv->sin6_family == AF_INET6) &&
- (srv->sin6_port == inp->sin6_port) &&
- !(memcmp(&srv->sin6_addr, &in6addr_any,
- sizeof (struct in6_addr)) &&
- memcmp(&srv->sin6_addr, &inp->sin6_addr,
- sizeof (struct in6_addr))))
- return (1);
- }
- }
- return (0);
-}
-
-/* int
- * res_nameinquery(name, type, class, buf, eom)
- * look for (name,type,class) in the query section of packet (buf,eom)
- * requires:
- * buf + HFIXEDSZ <= eom
- * returns:
- * -1 : format error
- * 0 : not found
- * >0 : found
- * author:
- * paul vixie, 29may94
- */
-int
-res_nameinquery(const char *name, int type, int class,
- const u_char *buf, const u_char *eom)
-{
- const u_char *cp = buf + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf)->qdcount);
-
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf, eom, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (ttype == type && tclass == class &&
- ns_samename(tname, name) == 1)
- return (1);
- }
- return (0);
-}
-libresolv_hidden_def (res_nameinquery)
-
-/* int
- * res_queriesmatch(buf1, eom1, buf2, eom2)
- * is there a 1:1 mapping of (name,type,class)
- * in (buf1,eom1) and (buf2,eom2)?
- * returns:
- * -1 : format error
- * 0 : not a 1:1 mapping
- * >0 : is a 1:1 mapping
- * author:
- * paul vixie, 29may94
- */
-int
-res_queriesmatch(const u_char *buf1, const u_char *eom1,
- const u_char *buf2, const u_char *eom2)
-{
- const u_char *cp = buf1 + HFIXEDSZ;
- int qdcount = ntohs(((HEADER*)buf1)->qdcount);
-
- if (buf1 + HFIXEDSZ > eom1 || buf2 + HFIXEDSZ > eom2)
- return (-1);
-
- /*
- * Only header section present in replies to
- * dynamic update packets.
- */
- if ((((HEADER *)buf1)->opcode == ns_o_update) &&
- (((HEADER *)buf2)->opcode == ns_o_update))
- return (1);
-
- if (qdcount != ntohs(((HEADER*)buf2)->qdcount))
- return (0);
- while (qdcount-- > 0) {
- char tname[MAXDNAME+1];
- int n, ttype, tclass;
-
- n = dn_expand(buf1, eom1, cp, tname, sizeof tname);
- if (n < 0)
- return (-1);
- cp += n;
- if (cp + 2 * INT16SZ > eom1)
- return (-1);
- ttype = ns_get16(cp); cp += INT16SZ;
- tclass = ns_get16(cp); cp += INT16SZ;
- if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
- return (0);
- }
- return (1);
-}
-libresolv_hidden_def (res_queriesmatch)
-
-int
-__libc_res_nsend(res_state statp, const u_char *buf, int buflen,
- u_char *ans, int anssiz, u_char **ansp)
-{
- int gotsomewhere, terrno, try, v_circuit, resplen, ns, n;
-
- if (statp->nscount == 0) {
- __set_errno (ESRCH);
- return (-1);
- }
-
- if (anssiz < HFIXEDSZ) {
- __set_errno (EINVAL);
- return (-1);
- }
-
- if ((statp->qhook || statp->rhook) && anssiz < MAXPACKET && ansp) {
- u_char *buf = malloc (MAXPACKET);
- if (buf == NULL)
- return (-1);
- memcpy (buf, ans, HFIXEDSZ);
- *ansp = buf;
- ans = buf;
- anssiz = MAXPACKET;
- }
-
- DprintQ((statp->options & RES_DEBUG) || (statp->pfcode & RES_PRF_QUERY),
- (stdout, ";; res_send()\n"), buf, buflen);
- v_circuit = (statp->options & RES_USEVC) || buflen > PACKETSZ;
- gotsomewhere = 0;
- terrno = ETIMEDOUT;
-
- /*
- * If the ns_addr_list in the resolver context has changed, then
- * invalidate our cached copy and the associated timing data.
- */
- if (EXT(statp).nsinit) {
- int needclose = 0;
-
- if (EXT(statp).nscount != statp->nscount)
- needclose++;
- else
- for (ns = 0; ns < MAXNS; ns++) {
- unsigned int map = EXT(statp).nsmap[ns];
- if (map < MAXNS
- && !sock_eq((struct sockaddr_in6 *)
- &statp->nsaddr_list[map],
- EXT(statp).nsaddrs[ns]))
- {
- needclose++;
- break;
- }
- }
- if (needclose)
- res_nclose(statp);
- }
-
- /*
- * Maybe initialize our private copy of the ns_addr_list.
- */
- if (EXT(statp).nsinit == 0) {
- unsigned char map[MAXNS];
-
- memset (map, MAXNS, sizeof (map));
- for (n = 0; n < MAXNS; n++) {
- ns = EXT(statp).nsmap[n];
- if (ns < statp->nscount)
- map[ns] = n;
- else if (ns < MAXNS) {
- free(EXT(statp).nsaddrs[n]);
- EXT(statp).nsaddrs[n] = NULL;
- EXT(statp).nsmap[n] = MAXNS;
- }
- }
- n = statp->nscount;
- if (statp->nscount > EXT(statp).nscount)
- for (n = EXT(statp).nscount, ns = 0;
- n < statp->nscount; n++) {
- while (ns < MAXNS
- && EXT(statp).nsmap[ns] != MAXNS)
- ns++;
- if (ns == MAXNS)
- break;
- EXT(statp).nsmap[ns] = n;
- map[n] = ns++;
- }
- EXT(statp).nscount = n;
- for (ns = 0; ns < EXT(statp).nscount; ns++) {
- n = map[ns];
- if (EXT(statp).nsaddrs[n] == NULL)
- EXT(statp).nsaddrs[n] =
- malloc(sizeof (struct sockaddr_in6));
- if (EXT(statp).nsaddrs[n] != NULL) {
- memcpy(EXT(statp).nsaddrs[n],
- &statp->nsaddr_list[ns],
- sizeof (struct sockaddr_in));
- EXT(statp).nssocks[n] = -1;
- n++;
- }
- }
- EXT(statp).nsinit = 1;
- }
-
- /*
- * Some resolvers want to even out the load on their nameservers.
- * Note that RES_BLAST overrides RES_ROTATE.
- */
- if ((statp->options & RES_ROTATE) != 0 &&
- (statp->options & RES_BLAST) == 0) {
- struct sockaddr_in6 *ina;
- unsigned int map;
-
- n = 0;
- while (n < MAXNS && EXT(statp).nsmap[n] == MAXNS)
- n++;
- if (n < MAXNS) {
- ina = EXT(statp).nsaddrs[n];
- map = EXT(statp).nsmap[n];
- for (;;) {
- ns = n + 1;
- while (ns < MAXNS
- && EXT(statp).nsmap[ns] == MAXNS)
- ns++;
- if (ns == MAXNS)
- break;
- EXT(statp).nsaddrs[n] = EXT(statp).nsaddrs[ns];
- EXT(statp).nsmap[n] = EXT(statp).nsmap[ns];
- n = ns;
- }
- EXT(statp).nsaddrs[n] = ina;
- EXT(statp).nsmap[n] = map;
- }
- }
-
- /*
- * Send request, RETRY times, or until successful.
- */
- for (try = 0; try < statp->retry; try++) {
- for (ns = 0; ns < MAXNS; ns++)
- {
- struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns];
-
- if (nsap == NULL)
- goto next_ns;
- same_ns:
- if (statp->qhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- struct sockaddr_in *nsap4;
- nsap4 = (struct sockaddr_in *) nsap;
- act = (*statp->qhook)(&nsap4, &buf, &buflen,
- ans, anssiz, &resplen);
- nsap = (struct sockaddr_in6 *) nsap4;
- switch (act) {
- case res_goahead:
- done = 1;
- break;
- case res_nextns:
- res_nclose(statp);
- goto next_ns;
- case res_done:
- return (resplen);
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
- }
-
-#ifdef DEBUG
- char tmpbuf[40];
-#endif
- Dprint(statp->options & RES_DEBUG,
- (stdout, ";; Querying server (# %d) address = %s\n",
- ns + 1, inet_ntop(AF_INET6, &nsap->sin6_addr,
- tmpbuf, sizeof (tmpbuf))));
-
- if (v_circuit) {
- /* Use VC; at most one attempt per server. */
- try = statp->retry;
- n = send_vc(statp, buf, buflen, &ans, &anssiz, &terrno,
- ns, ansp);
- if (n < 0)
- return (-1);
- if (n == 0)
- goto next_ns;
- resplen = n;
- } else {
- /* Use datagrams. */
- n = send_dg(statp, buf, buflen, &ans, &anssiz, &terrno,
- ns, &v_circuit, &gotsomewhere, ansp);
- if (n < 0)
- return (-1);
- if (n == 0)
- goto next_ns;
- if (v_circuit)
- goto same_ns;
- resplen = n;
- }
-
- Dprint((statp->options & RES_DEBUG) ||
- ((statp->pfcode & RES_PRF_REPLY) &&
- (statp->pfcode & RES_PRF_HEAD1)),
- (stdout, ";; got answer:\n"));
-
- DprintQ((statp->options & RES_DEBUG) ||
- (statp->pfcode & RES_PRF_REPLY),
- (stdout, "%s", ""),
- ans, (resplen > anssiz) ? anssiz : resplen);
-
- /*
- * If we have temporarily opened a virtual circuit,
- * or if we haven't been asked to keep a socket open,
- * close the socket.
- */
- if ((v_circuit && (statp->options & RES_USEVC) == 0) ||
- (statp->options & RES_STAYOPEN) == 0) {
- res_nclose(statp);
- }
- if (statp->rhook) {
- int done = 0, loops = 0;
-
- do {
- res_sendhookact act;
-
- act = (*statp->rhook)((struct sockaddr_in *)
- nsap, buf, buflen,
- ans, anssiz, &resplen);
- switch (act) {
- case res_goahead:
- case res_done:
- done = 1;
- break;
- case res_nextns:
- res_nclose(statp);
- goto next_ns;
- case res_modified:
- /* give the hook another try */
- if (++loops < 42) /*doug adams*/
- break;
- /*FALLTHROUGH*/
- case res_error:
- /*FALLTHROUGH*/
- default:
- return (-1);
- }
- } while (!done);
-
- }
- return (resplen);
- next_ns: ;
- } /*foreach ns*/
- } /*foreach retry*/
- res_nclose(statp);
- if (!v_circuit) {
- if (!gotsomewhere)
- __set_errno (ECONNREFUSED); /* no nameservers found */
- else
- __set_errno (ETIMEDOUT); /* no answer obtained */
- } else
- __set_errno (terrno);
- return (-1);
-}
-
-int
-res_nsend(res_state statp,
- const u_char *buf, int buflen, u_char *ans, int anssiz)
-{
- return __libc_res_nsend(statp, buf, buflen, ans, anssiz, NULL);
-}
-libresolv_hidden_def (res_nsend)
-
-/* Private */
-#ifdef __native_client__
-static int
-send_vc(res_state statp,
- const u_char *buf, int buflen, u_char **ansp, int *anssizp,
- int *terrno, int ns, u_char **anscp)
-{
- fprintf(stderr, "Must not reach: send_vc()\n");
- abort();
- return 0;
-}
-
-static int
-send_dg(res_state statp,
- const u_char *buf, int buflen, u_char **ansp, int *anssizp,
- int *terrno, int ns, int *v_circuit, int *gotsomewhere, u_char **anscp)
-{
- fprintf(stderr, "Must not reach: send_dg()\n");
- abort();
- return 0;
-}
-#else
-static int
-send_vc(res_state statp,
- const u_char *buf, int buflen, u_char **ansp, int *anssizp,
- int *terrno, int ns, u_char **anscp)
-{
- const HEADER *hp = (HEADER *) buf;
- u_char *ans = *ansp;
- int anssiz = *anssizp;
- HEADER *anhp = (HEADER *) ans;
- struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns];
- int truncating, connreset, resplen, n;
- struct iovec iov[2];
- u_short len;
- u_char *cp;
-
- connreset = 0;
- same_ns:
- truncating = 0;
-
- /* Are we still talking to whom we want to talk to? */
- if (statp->_vcsock >= 0 && (statp->_flags & RES_F_VC) != 0) {
- struct sockaddr_in6 peer;
- int size = sizeof peer;
-
- if (getpeername(statp->_vcsock,
- (struct sockaddr *)&peer, &size) < 0 ||
- !sock_eq(&peer, nsap)) {
- res_nclose(statp);
- statp->_flags &= ~RES_F_VC;
- }
- }
-
- if (statp->_vcsock < 0 || (statp->_flags & RES_F_VC) == 0) {
- if (statp->_vcsock >= 0)
- res_nclose(statp);
-
- statp->_vcsock = socket(nsap->sin6_family, SOCK_STREAM, 0);
- if (statp->_vcsock < 0) {
- *terrno = errno;
- Perror(statp, stderr, "socket(vc)", errno);
- return (-1);
- }
- __set_errno (0);
- if (connect(statp->_vcsock, (struct sockaddr *)nsap,
- sizeof *nsap) < 0) {
- *terrno = errno;
- Aerror(statp, stderr, "connect/vc", errno,
- (struct sockaddr *) nsap);
- res_nclose(statp);
- return (0);
- }
- statp->_flags |= RES_F_VC;
- }
-
- /*
- * Send length & message
- */
- putshort((u_short)buflen, (u_char*)&len);
- evConsIovec(&len, INT16SZ, &iov[0]);
- evConsIovec((void*)buf, buflen, &iov[1]);
- if (TEMP_FAILURE_RETRY (writev(statp->_vcsock, iov, 2))
- != (INT16SZ + buflen)) {
- *terrno = errno;
- Perror(statp, stderr, "write failed", errno);
- res_nclose(statp);
- return (0);
- }
- /*
- * Receive length & response
- */
- read_len:
- cp = ans;
- len = INT16SZ;
- while ((n = TEMP_FAILURE_RETRY (read(statp->_vcsock, (char *)cp,
- (int)len))) > 0) {
- cp += n;
- if ((len -= n) <= 0)
- break;
- }
- if (n <= 0) {
- *terrno = errno;
- Perror(statp, stderr, "read failed", errno);
- res_nclose(statp);
- /*
- * A long running process might get its TCP
- * connection reset if the remote server was
- * restarted. Requery the server instead of
- * trying a new one. When there is only one
- * server, this means that a query might work
- * instead of failing. We only allow one reset
- * per query to prevent looping.
- */
- if (*terrno == ECONNRESET && !connreset) {
- connreset = 1;
- res_nclose(statp);
- goto same_ns;
- }
- res_nclose(statp);
- return (0);
- }
- resplen = ns_get16(ans);
- if (resplen > anssiz) {
- if (anscp) {
- ans = malloc (MAXPACKET);
- if (ans == NULL) {
- *terrno = ENOMEM;
- res_nclose(statp);
- return (0);
- }
- anssiz = MAXPACKET;
- *anssizp = MAXPACKET;
- *ansp = ans;
- *anscp = ans;
- anhp = (HEADER *) ans;
- len = resplen;
- } else {
- Dprint(statp->options & RES_DEBUG,
- (stdout, ";; response truncated\n")
- );
- truncating = 1;
- len = anssiz;
- }
- } else
- len = resplen;
- if (len < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(statp->options & RES_DEBUG,
- (stdout, ";; undersized: %d\n", len));
- *terrno = EMSGSIZE;
- res_nclose(statp);
- return (0);
- }
- cp = ans;
- while (len != 0 && (n = read(statp->_vcsock, (char *)cp, (int)len)) > 0){
- cp += n;
- len -= n;
- }
- if (n <= 0) {
- *terrno = errno;
- Perror(statp, stderr, "read(vc)", errno);
- res_nclose(statp);
- return (0);
- }
- if (truncating) {
- /*
- * Flush rest of answer so connection stays in synch.
- */
- anhp->tc = 1;
- len = resplen - anssiz;
- while (len != 0) {
- char junk[PACKETSZ];
-
- n = read(statp->_vcsock, junk,
- (len > sizeof junk) ? sizeof junk : len);
- if (n > 0)
- len -= n;
- else
- break;
- }
- }
- /*
- * If the calling applicating has bailed out of
- * a previous call and failed to arrange to have
- * the circuit closed or the server has got
- * itself confused, then drop the packet and
- * wait for the correct one.
- */
- if (hp->id != anhp->id) {
- DprintQ((statp->options & RES_DEBUG) ||
- (statp->pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer (unexpected):\n"),
- ans, (resplen > anssiz) ? anssiz: resplen);
- goto read_len;
- }
-
- /*
- * All is well, or the error is fatal. Signal that the
- * next nameserver ought not be tried.
- */
- return (resplen);
-}
-
-static int
-send_dg(res_state statp,
- const u_char *buf, int buflen, u_char **ansp, int *anssizp,
- int *terrno, int ns, int *v_circuit, int *gotsomewhere, u_char **anscp)
-{
- const HEADER *hp = (HEADER *) buf;
- u_char *ans = *ansp;
- int anssiz = *anssizp;
- HEADER *anhp = (HEADER *) ans;
- struct sockaddr_in6 *nsap = EXT(statp).nsaddrs[ns];
- struct timespec now, timeout, finish;
- struct pollfd pfd[1];
- int ptimeout;
- struct sockaddr_in6 from;
- static int socket_pf = 0;
- int fromlen, resplen, seconds, n;
-
- if (EXT(statp).nssocks[ns] == -1) {
- /* only try IPv6 if IPv6 NS and if not failed before */
- if ((EXT(statp).nscount6 > 0) && (socket_pf != PF_INET)) {
- EXT(statp).nssocks[ns] =
- socket(PF_INET6, SOCK_DGRAM, 0);
- socket_pf = EXT(statp).nssocks[ns] < 0 ? PF_INET
- : PF_INET6;
- }
- if (EXT(statp).nssocks[ns] < 0)
- EXT(statp).nssocks[ns] = socket(PF_INET, SOCK_DGRAM, 0);
- if (EXT(statp).nssocks[ns] < 0) {
- *terrno = errno;
- Perror(statp, stderr, "socket(dg)", errno);
- return (-1);
- }
- /* If IPv6 socket and nsap is IPv4, make it IPv4-mapped */
- if ((socket_pf == PF_INET6) && (nsap->sin6_family == AF_INET))
- convaddr4to6(nsap);
- /*
- * On a 4.3BSD+ machine (client and server,
- * actually), sending to a nameserver datagram
- * port with no nameserver will cause an
- * ICMP port unreachable message to be returned.
- * If our datagram socket is "connected" to the
- * server, we get an ECONNREFUSED error on the next
- * socket operation, and select returns if the
- * error message is received. We can thus detect
- * the absence of a nameserver without timing out.
- */
- if (connect(EXT(statp).nssocks[ns], (struct sockaddr *)nsap,
- sizeof *nsap) < 0) {
- Aerror(statp, stderr, "connect(dg)", errno,
- (struct sockaddr *) nsap);
- res_nclose(statp);
- return (0);
- }
- /* Make socket non-blocking. */
- int fl = fcntl (EXT(statp).nssocks[ns], F_GETFL);
- if (fl != -1)
- fcntl (EXT(statp).nssocks[ns], F_SETFL,
- fl | O_NONBLOCK);
- Dprint(statp->options & RES_DEBUG,
- (stdout, ";; new DG socket\n"))
- }
-
- /*
- * Compute time for the total operation.
- */
- seconds = (statp->retrans << ns);
- if (ns > 0)
- seconds /= statp->nscount;
- if (seconds <= 0)
- seconds = 1;
- evNowTime(&now);
- evConsTime(&timeout, seconds, 0);
- evAddTime(&finish, &now, &timeout);
- int need_recompute = 0;
- int nwritten = 0;
- pfd[0].fd = EXT(statp).nssocks[ns];
- pfd[0].events = POLLOUT;
- wait:
- if (need_recompute) {
- evNowTime(&now);
- if (evCmpTime(finish, now) <= 0) {
- Perror(statp, stderr, "select", errno);
- res_nclose(statp);
- return (0);
- }
- evSubTime(&timeout, &finish, &now);
- }
- /* Convert struct timespec in milliseconds. */
- ptimeout = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000;
-
- n = 0;
- if (nwritten == 0)
- n = poll (pfd, 1, 0);
- if (__builtin_expect (n == 0, 0)) {
- n = poll (pfd, 1, ptimeout);
- need_recompute = 1;
- }
- if (n == 0) {
- Dprint(statp->options & RES_DEBUG, (stdout,
- ";; timeout sending\n"));
- *gotsomewhere = 1;
- return (0);
- }
- if (n < 0) {
- if (errno == EINTR) {
- recompute_resend:
- evNowTime(&now);
- if (evCmpTime(finish, now) > 0) {
- evSubTime(&timeout, &finish, &now);
- goto wait;
- }
- }
- Perror(statp, stderr, "poll", errno);
- res_nclose(statp);
- return (0);
- }
- __set_errno (0);
- if (pfd[0].revents & POLLOUT) {
- if (send(pfd[0].fd, (char*)buf, buflen, 0) != buflen) {
- if (errno == EINTR || errno == EAGAIN)
- goto recompute_resend;
- Perror(statp, stderr, "send", errno);
- res_nclose(statp);
- return (0);
- }
- pfd[0].events = POLLIN;
- ++nwritten;
- goto wait;
- } else if (pfd[0].revents & POLLIN) {
- fromlen = sizeof(struct sockaddr_in6);
- if (anssiz < MAXPACKET
- && anscp
- && (ioctl (pfd[0].fd, FIONREAD, &resplen) < 0
- || anssiz < resplen)) {
- ans = malloc (MAXPACKET);
- if (ans == NULL)
- ans = *ansp;
- else {
- anssiz = MAXPACKET;
- *anssizp = MAXPACKET;
- *ansp = ans;
- *anscp = ans;
- anhp = (HEADER *) ans;
- }
- }
- resplen = recvfrom(pfd[0].fd, (char*)ans, anssiz,0,
- (struct sockaddr *)&from, &fromlen);
- if (resplen <= 0) {
- if (errno == EINTR || errno == EAGAIN) {
- need_recompute = 1;
- goto wait;
- }
- Perror(statp, stderr, "recvfrom", errno);
- res_nclose(statp);
- return (0);
- }
- *gotsomewhere = 1;
- if (resplen < HFIXEDSZ) {
- /*
- * Undersized message.
- */
- Dprint(statp->options & RES_DEBUG,
- (stdout, ";; undersized: %d\n",
- resplen));
- *terrno = EMSGSIZE;
- res_nclose(statp);
- return (0);
- }
- if (hp->id != anhp->id) {
- /*
- * response from old query, ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((statp->options & RES_DEBUG) ||
- (statp->pfcode & RES_PRF_REPLY),
- (stdout, ";; old answer:\n"),
- ans, (resplen > anssiz) ? anssiz : resplen);
- goto wait;
- }
- if (!(statp->options & RES_INSECURE1) &&
- !res_ourserver_p(statp, &from)) {
- /*
- * response from wrong server? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((statp->options & RES_DEBUG) ||
- (statp->pfcode & RES_PRF_REPLY),
- (stdout, ";; not our server:\n"),
- ans, (resplen > anssiz) ? anssiz : resplen);
- goto wait;
- }
- if (!(statp->options & RES_INSECURE2) &&
- !res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
- /*
- * response contains wrong query? ignore it.
- * XXX - potential security hazard could
- * be detected here.
- */
- DprintQ((statp->options & RES_DEBUG) ||
- (statp->pfcode & RES_PRF_REPLY),
- (stdout, ";; wrong query name:\n"),
- ans, (resplen > anssiz) ? anssiz : resplen);
- goto wait;
- }
- if (anhp->rcode == SERVFAIL ||
- anhp->rcode == NOTIMP ||
- anhp->rcode == REFUSED) {
- DprintQ(statp->options & RES_DEBUG,
- (stdout, "server rejected query:\n"),
- ans, (resplen > anssiz) ? anssiz : resplen);
- res_nclose(statp);
- /* don't retry if called from dig */
- if (!statp->pfcode)
- return (0);
- }
- if (!(statp->options & RES_IGNTC) && anhp->tc) {
- /*
- * To get the rest of answer,
- * use TCP with same server.
- */
- Dprint(statp->options & RES_DEBUG,
- (stdout, ";; truncated answer\n"));
- *v_circuit = 1;
- res_nclose(statp);
- return (1);
- }
- /*
- * All is well, or the error is fatal. Signal that the
- * next nameserver ought not be tried.
- */
- return (resplen);
- } else if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
- /* Something went wrong. We can stop trying. */
- res_nclose(statp);
- return (0);
- }
-}
-
-#ifdef DEBUG
-static void
-Aerror(const res_state statp, FILE *file, const char *string, int error,
- const struct sockaddr *address)
-{
- int save = errno;
-
- if ((statp->options & RES_DEBUG) != 0) {
- char tmp[sizeof "xxxx.xxxx.xxxx.255.255.255.255"];
-
- fprintf(file, "res_send: %s ([%s].%u): %s\n",
- string,
- inet_ntop(address->sa_family, address->sa_data,
- tmp, sizeof tmp),
- (address->sa_family == AF_INET
- ? ntohs(((struct sockaddr_in *) address)->sin_port)
- : address->sa_family == AF_INET6
- ? ntohs(((struct sockaddr_in6 *) address)->sin6_port)
- : 0),
- strerror(error));
- }
- __set_errno (save);
-}
-#endif
-
-static void
-Perror(const res_state statp, FILE *file, const char *string, int error) {
- int save = errno;
-
- if ((statp->options & RES_DEBUG) != 0)
- fprintf(file, "res_send: %s: %s\n",
- string, strerror(error));
- __set_errno (save);
-}
-#endif
-
-static int
-sock_eq(struct sockaddr_in6 *a1, struct sockaddr_in6 *a2) {
- if (a1->sin6_family == a2->sin6_family) {
- if (a1->sin6_family == AF_INET)
- return ((((struct sockaddr_in *)a1)->sin_port ==
- ((struct sockaddr_in *)a2)->sin_port) &&
- (((struct sockaddr_in *)a1)->sin_addr.s_addr ==
- ((struct sockaddr_in *)a2)->sin_addr.s_addr));
- else
- return ((a1->sin6_port == a2->sin6_port) &&
- !memcmp(&a1->sin6_addr, &a2->sin6_addr,
- sizeof (struct in6_addr)));
- }
- if (a1->sin6_family == AF_INET) {
- struct sockaddr_in6 *sap = a1;
- a1 = a2;
- a2 = sap;
- } /* assumes that AF_INET and AF_INET6 are the only possibilities */
- return ((a1->sin6_port == ((struct sockaddr_in *)a2)->sin_port) &&
- IN6_IS_ADDR_V4MAPPED(&a1->sin6_addr) &&
- (a1->sin6_addr.s6_addr32[3] ==
- ((struct sockaddr_in *)a2)->sin_addr.s_addr));
-}
-
-/*
- * Converts IPv4 family, address and port to
- * IPv6 family, IPv4-mapped IPv6 address and port.
- */
-static void
-convaddr4to6(struct sockaddr_in6 *sa)
-{
- struct sockaddr_in *sa4p = (struct sockaddr_in *) sa;
- in_port_t port = sa4p->sin_port;
- in_addr_t addr = sa4p->sin_addr.s_addr;
-
- sa->sin6_family = AF_INET6;
- sa->sin6_port = port;
- sa->sin6_addr.s6_addr32[0] = 0;
- sa->sin6_addr.s6_addr32[1] = 0;
- sa->sin6_addr.s6_addr32[2] = htonl(0xFFFF);
- sa->sin6_addr.s6_addr32[3] = addr;
-}
diff --git a/ports/glibc-compat/src/setregid.c b/ports/glibc-compat/src/setregid.c
deleted file mode 100644
index cc150f7..0000000
--- a/ports/glibc-compat/src/setregid.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <sys/types.h>
-#include <unistd.h>
-
-int setregid(gid_t rgid, gid_t egid) {
- return 0;
-}
diff --git a/ports/glibc-compat/src/shlib-compat.h b/ports/glibc-compat/src/shlib-compat.h
deleted file mode 100644
index eb7514c..0000000
--- a/ports/glibc-compat/src/shlib-compat.h
+++ /dev/null
@@ -1 +0,0 @@
-#define SHLIB_COMPAT(libc, introduced, obsoleted) 0
diff --git a/ports/glibc-compat/src/tcgetpgrp.c b/ports/glibc-compat/src/tcgetpgrp.c
deleted file mode 100644
index 95ffc7f..0000000
--- a/ports/glibc-compat/src/tcgetpgrp.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <errno.h>
-#include <unistd.h>
-
-pid_t tcgetpgrp(int fd) {
- errno = ENOTTY;
- return -1;
-}
-
-int tcsetpgrp(int fd, pid_t pgrp) {
- errno = ENOTTY;
- return -1;
-}
diff --git a/ports/glibc-compat/src/test.cc b/ports/glibc-compat/src/test.cc
deleted file mode 100644
index 61a82b9..0000000
--- a/ports/glibc-compat/src/test.cc
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Copyright 2014 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. */
-
-#include <endian.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <sys/file.h>
-#include <err.h>
-#include <time.h>
-
-#ifndef __GLIBC__
-#include <sys/endian.h>
-#endif
-
-#include "gtest/gtest.h"
-
-TEST(TestMktemp, mkdtemp_errors) {
- char small[] = "small";
- char missing_template[] = "missing_template";
- char short_template_XXX[] = "short_template_XXX";
- char not_XXXXXX_suffix[] = "not_XXXXXX_suffix";
- ASSERT_EQ((char*)NULL, mkdtemp(small));
- ASSERT_EQ(EINVAL, errno);
- ASSERT_EQ((char*)NULL, mkdtemp(missing_template));
- ASSERT_EQ(EINVAL, errno);
- ASSERT_EQ((char*)NULL, mkdtemp(short_template_XXX));
- ASSERT_EQ(EINVAL, errno);
- ASSERT_EQ((char*)NULL, mkdtemp(not_XXXXXX_suffix));
- ASSERT_EQ(EINVAL, errno);
-}
-
-TEST(TestMktemp, mkdtemp) {
- char tempdir[] = "tempfile_XXXXXX";
- ASSERT_NE((char*)NULL, mkdtemp(tempdir));
- // Check that tempname starts with the correct prefix but has been
- // modified from the original.
- ASSERT_EQ(0, strncmp("tempfile_", tempdir, strlen("tempfile_")));
- ASSERT_STRNE("tempfile_XXXXXX", tempdir);
-
- // Check the directory exists
- struct stat buf;
- ASSERT_EQ(0, stat(tempdir, &buf));
- ASSERT_TRUE(S_ISDIR(buf.st_mode));
- ASSERT_EQ(0, rmdir(tempdir));
-}
-
-TEST(TestMktemp, mkstemp) {
- char tempfile[] = "tempfile_XXXXXX";
- int fd = mkstemp(tempfile);
- ASSERT_GT(fd, -1);
-
- // Check that tempname starts with the correct prefix but has been
- // modified from the original.
- ASSERT_EQ(0, strncmp("tempfile_", tempfile, strlen("tempfile_")));
- ASSERT_STRNE("tempfile_XXXXXX", tempfile);
-
- ASSERT_EQ(4, write(fd, "test", 4));
- ASSERT_EQ(0, close(fd));
-}
-
-TEST(TestEndian, byte_order) {
-#ifdef __native_client__
- ASSERT_EQ(LITTLE_ENDIAN, BYTE_ORDER);
- ASSERT_EQ(LITTLE_ENDIAN, BYTE_ORDER);
-#endif
-}
-
-#ifndef __GLIBC__
-TEST(TestEndian, byte_swap) {
- // Test BSD byte-swapping macros
- uint16_t num16 = 0x0102u;
- uint32_t num32 = 0x01020304u;
- ASSERT_EQ(num16, htole16(num16));
- ASSERT_EQ(num32, htole32(num32));
- ASSERT_EQ(num16, letoh16(num16));
- ASSERT_EQ(num32, letoh32(num32));
-
- // Can't inline these in the ASSERT_EQ statements as they can be
- // 'statement expressions' (on bionic at least) which can't be
- // template parameters apparently.
- int n16 = htons(num16);
- int n32 = htonl(num32);
- int h16 = ntohs(num16);
- int h32 = ntohl(num32);
- ASSERT_EQ(n16, htobe16(num16));
- ASSERT_EQ(n32, htobe32(num32));
- ASSERT_EQ(h16, betoh16(num16));
- ASSERT_EQ(h32, betoh32(num32));
-}
-#endif
-
-// readv is not implemented in glibc.
-#ifndef __GLIBC__
-TEST(TestReadv, readv_writev) {
- struct iovec write_iov[3];
- struct iovec read_iov[3];
- char first[28], second[28], third[12];
- read_iov[0].iov_base = first;
- read_iov[0].iov_len = sizeof(first);
- read_iov[1].iov_base = second;
- read_iov[1].iov_len = sizeof(second);
- read_iov[2].iov_base = third;
- read_iov[2].iov_len = sizeof(third);
- int i = 0;
- ssize_t ret = 0;
- const char* str1 = "abcdefghijklmnopqrstuvwxyz\n";
- const char* str2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n";
- const char* str3 = "0123456789\n";
- write_iov[0].iov_base = (void*)str1;
- write_iov[0].iov_len = strlen(str1) + 1;
- write_iov[1].iov_base = (void*)str2;
- write_iov[1].iov_len = strlen(str2) + 1;
- write_iov[2].iov_base = (void*)str3;
- write_iov[2].iov_len = strlen(str3) + 1;
- int fd = open("test.txt", O_CREAT | O_WRONLY, S_IRUSR|S_IWUSR);
- ASSERT_NE(fd, -1);
- ret = writev(fd, write_iov, 3);
- ASSERT_NE(ret, -1);
- ASSERT_NE(close(fd), -1);
- fd = open("test.txt", O_RDONLY);
- ASSERT_NE(fd, -1);
- ret = readv(fd, read_iov, 3);
- ASSERT_NE(ret, -1);
- ASSERT_STREQ(str1, (const char*)read_iov[0].iov_base);
- ASSERT_EQ(28, read_iov[0].iov_len);
- ASSERT_STREQ(str2, (const char*)read_iov[1].iov_base);
- ASSERT_EQ(28, read_iov[1].iov_len);
- ASSERT_STREQ(str3, (const char*)read_iov[2].iov_base);
- ASSERT_EQ(12, read_iov[2].iov_len);
- ASSERT_NE(close(fd), -1);
- ASSERT_NE(-1, unlink("test.txt"));
-}
-#endif
-
-// No tests for funtions ended with at, e.g. openat, fts_*
-// fchdir is not implemented in sel_ldr
-#if 0
-TEST(TestOpenat, openat) {
- ASSERT_NE(-1, mkdir("t1", S_IRWXU | S_IRWXG | S_IXGRP));
- DIR* dir = opendir("t1");
- ASSERT_NE((DIR*)NULL, dir);
- int fd_t1 = dirfd(dir);
- ASSERT_NE(-1, fd_t1);
- int fd_t2 = openat(fd_t1, "test.txt", O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
- ASSERT_NE(-1, fd_t2);
- ASSERT_EQ(4, write(fd_t2, "test", 4));
- ASSERT_NE(-1, close(fd_t2));
- ASSERT_NE(-1, close(fd_t1));
- ASSERT_NE(-1, unlink("t1/test.txt"));
- ASSERT_NE(-1, rmdir("t1"));
-}
-#endif
-
-TEST(TestLockf, lockf) {
- // The fcntl() method underlying lockf() is not implemented in NaCl.
- ASSERT_EQ(-1, lockf(1, F_LOCK, 1));
- ASSERT_EQ(ENOSYS, errno);
- ASSERT_EQ(-1, lockf(1, F_TLOCK, 1));
- ASSERT_EQ(ENOSYS, errno);
- ASSERT_EQ(-1, lockf(1, F_ULOCK, 1));
- ASSERT_EQ(ENOSYS, errno);
-}
-
-TEST(TestFlock, flock) {
- // The fcntl() method underlying flock() is not implemented in NaCl.
- ASSERT_EQ(-1, flock(1, LOCK_SH));
- ASSERT_EQ(ENOSYS, errno);
- ASSERT_EQ(-1, flock(1, LOCK_EX));
- ASSERT_EQ(ENOSYS, errno);
- ASSERT_EQ(-1, flock(1, LOCK_UN));
- ASSERT_EQ(ENOSYS, errno);
-}
-
-/* Calling err will cause the test program exit with failure code if errno
- * is set. No tests for err.
- */
-
-TEST(TestTimegm, timegm) {
- struct tm tmp;
- tmp.tm_sec = 1;
- tmp.tm_min = 0;
- tmp.tm_hour = 0;
- tmp.tm_mday = 3;
- tmp.tm_mon = 4 - 1;
- tmp.tm_year = 2015 - 1900;
- tmp.tm_isdst = -1;
- time_t tt = timegm(&tmp);
- ASSERT_EQ(1428019201, tt);
-}
-
-int main(int argc, char** argv) {
- setenv("TERM", "xterm-256color", 0);
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/ports/glibc-compat/src/timegm.c b/ports/glibc-compat/src/timegm.c
deleted file mode 100644
index 7d2d542..0000000
--- a/ports/glibc-compat/src/timegm.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright 2015 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.
- */
-/* pull from freebsd 10.1 ./contrib/ldns/compat/timegm.c */
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-
-time_t
-timegm (struct tm *tm) {
- time_t ret;
- char *tz;
-
- tz = getenv("TZ");
- putenv((char*)"TZ=");
- tzset();
- ret = mktime(tm);
- if (tz) {
- char buf[256];
- snprintf(buf, sizeof(buf), "TZ=%s", tz);
- putenv(tz);
- }
- else
- putenv((char*)"TZ");
- tzset();
- return ret;
-}
diff --git a/ports/glibc-compat/src/writev.c b/ports/glibc-compat/src/writev.c
deleted file mode 100644
index cc33dd1..0000000
--- a/ports/glibc-compat/src/writev.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-#include <unistd.h>
-#include <sys/uio.h>
-#include <errno.h>
-
-int writev(int fd, const struct iovec *iov, int iovcnt) {
- int i = 0, ret = 0, n = 0, len = 0;
- char* base;
- errno = 0;
- while (i < iovcnt) {
- len = iov->iov_len;
- base = iov->iov_base;
- while (len > 0) {
- ret = write(fd, base, len);
- if (ret < 0 && n == 0) return -1;
- if (ret <= 0) return n;
- errno = 0;
- n += ret;
- len -= ret;
- base += ret;
- }
- iov++;
- i++;
- }
- return n;
-}
-
-ssize_t readv(int fd, const struct iovec *iov, int iovcnt) {
- int i = 0, ret = 0, n = 0, len = 0;
- char* base;
- errno = 0;
- while (i < iovcnt) {
- len = iov->iov_len;
- base = iov->iov_base;
- while (len > 0) {
- ret = read(fd, base, len);
- if (ret < 0 && n == 0) return -1;
- if (ret <= 0) return n;
- errno = 0;
- n += ret;
- len -= ret;
- base += ret;
- }
- iov++;
- i++;
- }
- return n;
-}
diff --git a/ports/glproto/pkg_info b/ports/glproto/pkg_info
deleted file mode 100644
index 33d8dcb..0000000
--- a/ports/glproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=glproto
-VERSION=1.4.15
-URL=http://www.x.org/releases/X11R7.7/src/everything/glproto-1.4.15.tar.bz2
-LICENSE=GPL
-SHA1=4cee35232f1926312b29d59a94da1c526b01e5c3
diff --git a/ports/gmock/build.sh b/ports/gmock/build.sh
deleted file mode 100644
index f8ccbc9..0000000
--- a/ports/gmock/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2011 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.
-
-InstallStep() {
- LogExecute tar -C ${SRC_DIR}/include -cf - gmock | \
- tar -C ${DESTDIR_INCLUDE} -xpf -
- LogExecute install -m 644 lib/.libs/libgmock.a ${DESTDIR_LIB}/
-}
diff --git a/ports/gmock/nacl.patch b/ports/gmock/nacl.patch
deleted file mode 100644
index 92fb263..0000000
--- a/ports/gmock/nacl.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -Naur gmock-1.5.0/Makefile gmock-1.5.0.nacl/Makefile
---- gmock-1.5.0/Makefile 1969-12-31 17:00:00.000000000 -0700
-+++ gmock-1.5.0.nacl/Makefile 2010-07-07 14:28:27.000000000 -0600
-@@ -0,0 +1,23 @@
-+CXXFLAGS = -O0 -g
-+INCLUDE = -Iinclude -I.
-+LIB_GMOCK = libgmock.a
-+OBJ_DIR = obj
-+
-+OBJ_FILES = \
-+ gmock-all.o \
-+ gmock_main.o
-+
-+all: $(LIB_GMOCK)
-+ @echo "Making libgmock"
-+
-+clean:
-+ rm -rf $(OBJ_DIR) $(LIB_GMOCK)
-+
-+$(OBJ_DIR):
-+ mkdir $(OBJ_DIR)
-+
-+$(OBJ_FILES): %.o: src/%.cc $(OBJ_DIR)
-+ $(CXX) -c $(INCLUDE) $(CXXFLAGS) $< -o $(OBJ_DIR)/$@
-+
-+$(LIB_GMOCK): $(OBJ_DIR) $(OBJ_FILES)
-+ cd $(OBJ_DIR) && $(AR) rcs ../$(LIB_GMOCK) $(OBJ_FILES)
diff --git a/ports/gmock/pkg_info b/ports/gmock/pkg_info
deleted file mode 100644
index 566e9ed..0000000
--- a/ports/gmock/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gmock
-VERSION=1.5.0
-URL=http://googlemock.googlecode.com/files/gmock-1.5.0.tar.gz
-LICENSE=BSD
-SHA1=6352080213097c20e6645b8466b13dc1fb895153
-DISABLED=1
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gmp/build.sh b/ports/gmp/build.sh
deleted file mode 100644
index 7669e0e..0000000
--- a/ports/gmp/build.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (c) 2014 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.
-
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-HOST_INSTALL_DIR=${WORK_DIR}/install_host
-
-BuildHostGmp() {
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- CC="gcc" \
- LogExecute ${SRC_DIR}/configure --prefix=${HOST_INSTALL_DIR}
- LogExecute make
- LogExecute make install
-}
-
-if [ "${NACL_SHARED}" = "1" ]; then
- NACLPORTS_CFLAGS+=" -fPIC"
-fi
-
-# define LONGLONG_STANDALONE so that longlong.h doesn't
-# contain references to machine-dependant functions.
-# This is needed in particular on ARM but is correct on
-# all platforms since we don't compile machine-depenedant
-# files.
-NACLPORTS_CFLAGS+=" -DLONGLONG_STANDALONE"
-
-# Disable all assembly code by specifying none-none-none.
-EXTRA_CONFIGURE_ARGS=--host=none-none-none
-
-ConfigureStep() {
- if [ "${OS_NAME}" = "Linux" ]; then
- ChangeDir ${SRC_DIR}
- BuildHostGmp
- ChangeDir ${BUILD_DIR}
- fi
- DefaultConfigureStep
-}
-
-TestStep() {
- MAKE_TARGETS="allprogs"
- EXECUTABLES="demos/calc/calc${NACL_EXEEXT}"
- ChangeDir ${BUILD_DIR}/demos
- DefaultBuildStep
- RunPostBuildStep
- if [ "${NACL_ARCH}" != "pnacl" ]; then
- # Perform a simple calculation using the calc demo program
- RESULT=$(echo "1000 * 1000" | demos/calc/calc)
- if [ "$RESULT" != "1000000" ]; then
- echo "Unexpted result from calc test: ${RESULT}"
- exit 1
- fi
- fi
-}
diff --git a/ports/gmp/pkg_info b/ports/gmp/pkg_info
deleted file mode 100644
index e0ab4e0..0000000
--- a/ports/gmp/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=gmp
-VERSION=5.0.2
-URL=ftp://ftp.gmplib.org/pub/gmp/gmp-5.0.2.tar.bz2
-LICENSE=LGPL3
-SHA1=2968220e1988eabb61f921d11e5d2db5431e0a35
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/grep/build.sh b/ports/grep/build.sh
deleted file mode 100644
index 53a1dec..0000000
--- a/ports/grep/build.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (c) 2014 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.
-
-ConfigureStep() {
- EnableGlibcCompat
- NACLPORTS_LIBS+=" -l${NACL_CXX_LIB}"
- NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-
- if [ "${TOOLCHAIN}" = "glibc" ]; then
- # Glibc's *at functions don't work correctly since they rely on
- # /proc/self/fd/X. This ensure thats gnulib's replacements are used
- # instead.
- export ac_cv_func_faccessat=no
- export ac_cv_func_fstatat=no
- export ac_cv_func_fchdir=no
- export ac_cv_func_fdopendir=no
-
- export gl_cv_func_open_directory_works=yes
- fi
-
- # Grep fails to build NDEBUG defined
- # ib/chdir-long.c:62: error: unused variable 'close_fail'
- NACLPORTS_CFLAGS="${NACLPORTS_CFLAGS/-DNDEBUG/}"
- DefaultConfigureStep
-}
diff --git a/ports/grep/nacl.patch b/ports/grep/nacl.patch
deleted file mode 100644
index 9042449..0000000
--- a/ports/grep/nacl.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -33696,7 +33696,6 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wattributes \
- -Wbad-function-cast \
- -Wbuiltin-macro-redefined \
-- -Wcast-align \
- -Wchar-subscripts \
- -Wclobbered \
- -Wcomment \
-@@ -33711,7 +33710,6 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wdouble-promotion \
- -Wempty-body \
- -Wendif-labels \
-- -Wenum-compare \
- -Wextra \
- -Wformat-contains-nul \
- -Wformat-extra-args \
-@@ -33734,14 +33732,11 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wmain \
- -Wmaybe-uninitialized \
- -Wmissing-braces \
-- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-include-dirs \
- -Wmissing-parameter-type \
-- -Wmissing-prototypes \
- -Wmultichar \
- -Wnarrowing \
-- -Wnested-externs \
- -Wnonnull \
- -Wold-style-declaration \
- -Wold-style-definition \
-@@ -33767,8 +33762,6 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wstrict-prototypes \
- -Wsuggest-attribute=const \
- -Wsuggest-attribute=format \
-- -Wsuggest-attribute=noreturn \
-- -Wsuggest-attribute=pure \
- -Wswitch \
- -Wswitch-default \
- -Wsync-nand \
-diff --git a/lib/error.c b/lib/error.c
---- a/lib/error.c
-+++ b/lib/error.c
-@@ -378,13 +378,14 @@ error_at_line (int status, int errnum, const char *file_name,
- #endif
- }
-
-+ if (file_name != NULL)
- #if _LIBC
-- __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ",
-- file_name, line_number);
-+ __fxprintf (NULL, "%s:%d: ", file_name, line_number);
- #else
-- fprintf (stderr, file_name != NULL ? "%s:%d: " : " ",
-- file_name, line_number);
-+ fprintf (stderr, "%s:%d: ", file_name, line_number);
- #endif
-+ else
-+ fprintf (stderr, " ");
-
- va_start (args, message);
- error_tail (status, errnum, message, args);
-diff --git a/lib/fcntl.c b/lib/fcntl.c
---- a/lib/fcntl.c
-+++ b/lib/fcntl.c
-@@ -202,7 +202,12 @@ rpl_fcntl (int fd, int action, /* arg */...)
- {
- int target = va_arg (arg, int);
- /* Detect invalid target; needed for cygwin 1.5.x. */
-+ /* TODO(bradnelson): Drop once newlib has getdtablesize. */
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ if (target < 0)
-+#else
- if (target < 0 || getdtablesize () <= target)
-+#endif
- errno = EINVAL;
- else
- {
-diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
---- a/lib/gettimeofday.c
-+++ b/lib/gettimeofday.c
-@@ -19,6 +19,11 @@
-
- #include <config.h>
-
-+/* TODO(bradnelson): Drop this once newlib's includes are order independent. */
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
-+#include <sys/types.h>
-+#endif
-+
- /* Specification. */
- #include <sys/time.h>
-
-diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h
---- a/lib/glthread/lock.h
-+++ b/lib/glthread/lock.h
-@@ -125,11 +125,13 @@ extern int glthread_in_use (void);
- # pragma weak pthread_mutex_lock
- # pragma weak pthread_mutex_unlock
- # pragma weak pthread_mutex_destroy
-+#ifdef HAVE_PTHREAD_RWLOCK
- # pragma weak pthread_rwlock_init
- # pragma weak pthread_rwlock_rdlock
- # pragma weak pthread_rwlock_wrlock
- # pragma weak pthread_rwlock_unlock
- # pragma weak pthread_rwlock_destroy
-+#endif
- # pragma weak pthread_once
- # pragma weak pthread_cond_init
- # pragma weak pthread_cond_wait
-diff --git a/lib/open.c b/lib/open.c
---- a/lib/open.c
-+++ b/lib/open.c
-@@ -173,7 +173,7 @@ open (const char *filename, int flags, ...)
- #endif
-
- #if REPLACE_FCHDIR
-- if (!REPLACE_OPEN_DIRECTORY && 0 <= fd)
-+ if (0 <= fd)
- fd = _gl_register_fd (fd, filename);
- #endif
-
-diff --git a/lib/openat.c b/lib/openat.c
---- a/lib/openat.c
-+++ b/lib/openat.c
-@@ -27,6 +27,11 @@
- #include <sys/types.h>
- #undef __need_system_fcntl_h
-
-+/* TODO(bradnelson): Drop once nacl_io has openat. */
-+#if defined(__native_client__)
-+# undef HAVE_OPENAT
-+#endif
-+
- #if HAVE_OPENAT
- static int
- orig_openat (int fd, char const *filename, int flags, mode_t mode)
-diff --git a/lib/regex_internal.c b/lib/regex_internal.c
---- a/lib/regex_internal.c
-+++ b/lib/regex_internal.c
-@@ -1389,7 +1389,12 @@ static void
- internal_function
- re_node_set_remove_at (re_node_set *set, Idx idx)
- {
-+#if defined(__clang__)
-+ /* clang notices this can never be negative. */
-+ if (idx >= set->nelem)
-+#else
- if (idx < 0 || idx >= set->nelem)
-+#endif
- return;
- --set->nelem;
- for (; idx < set->nelem; idx++)
-diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
---- a/lib/sys_stat.in.h
-+++ b/lib/sys_stat.in.h
-@@ -43,7 +43,9 @@
- #include <time.h>
-
- /* The include_next requires a split double-inclusion guard. */
-+#define fstatat not_fstatat
- #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
-+#undef fstatat
-
- #ifndef _@GUARD_PREFIX@_SYS_STAT_H
- #define _@GUARD_PREFIX@_SYS_STAT_H
-diff --git a/lib/unistd--.h b/lib/unistd--.h
---- a/lib/unistd--.h
-+++ b/lib/unistd--.h
-@@ -20,8 +20,14 @@
- #include <unistd.h>
- #include "unistd-safer.h"
-
-+#ifndef __native_client__
-+/*
-+ * TODO(crbug.com/555102): dup_safer relies on the F_DUPFD fcntl which is not
-+ * yet supported in nacl_io.
-+ */
- #undef dup
- #define dup dup_safer
-+#endif
-
- #undef pipe
- #define pipe pipe_safer
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -1259,7 +1259,7 @@ clean-binPROGRAMS:
-
- grep$(EXEEXT): $(grep_OBJECTS) $(grep_DEPENDENCIES) $(EXTRA_grep_DEPENDENCIES)
- @rm -f grep$(EXEEXT)
-- $(AM_V_CCLD)$(LINK) $(grep_OBJECTS) $(grep_LDADD) $(LIBS)
-+ $(AM_V_CCLD)$(LINK) $(grep_OBJECTS) $(grep_LDADD) -Wl,--undefined=PSUserMainGet -lcli_main -lnacl_spawn -lppapi_simple -lnacl_io -lppapi -pthread $(LIBS)
- install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
diff --git a/ports/grep/pkg_info b/ports/grep/pkg_info
deleted file mode 100644
index be8a386..0000000
--- a/ports/grep/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=grep
-VERSION=2.21
-URL=http://ftp.gnu.org/gnu/grep/grep-2.21.tar.xz
-LICENSE=GPL
-DEPENDS=(nacl-spawn pcre)
-SHA1=c7e6525c5c5aaa1bc3c1774db1697f42b11c2d85
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/grpc/build.sh b/ports/grpc/build.sh
deleted file mode 100644
index 82d63ae..0000000
--- a/ports/grpc/build.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 2016 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.
-
-NACLPORTS_CPPFLAGS+=" -D_POSIX_TIMERS"
-EnableGlibcCompat
-
-ConfigureStep() {
- LogExecute cp -rfl ${SRC_DIR}/* .
-}
-
-SetupEnv() {
- SetupCrossEnvironment
- export DEFAULT_CC=${CC}
- export DEFAULT_CXX=${CXX}
- export SYSTEM=NaCl
- export PATH=${BUILD_DIR}/../../protobuf/build_host/src:$PATH
- export LDLIBS=${LIBS}
- unset LIBS
-}
-
-BuildStep() {
- SetupEnv
- DefaultBuildStep
-}
-
-TestStep() {
- SetupEnv
- MAKE_ARGS="-j${OS_JOBS}"
- if [[ ${VERBOSE:-} == 1 ]]; then
- MAKE_ARGS+=" VERBOSE=1 V=1"
- fi
- LogExecute make ${MAKE_ARGS} buildtests_c
- # C++ tests not building yet
- #LogExecute make buildtests_cxx -j${OS_JOBS}
-
- # A fairly random selections of the C tests that currently pass.
- # Most of the failing tests are due to missing pipe() and socket() functions
- # in sel_ldr.
- exes="
-bins/opt/uri_parser_test
-bins/opt/alloc_test
-bins/opt/alpn_test
-bins/opt/bin_encoder_test
-
-bins/opt/gpr_avl_test
-bins/opt/gpr_cmdline_test
-bins/opt/gpr_cpu_test
-bins/opt/gpr_env_test
-bins/opt/gpr_file_test
-bins/opt/gpr_histogram_test
-bins/opt/gpr_host_port_test
-bins/opt/gpr_log_test
-bins/opt/gpr_slice_buffer_test
-bins/opt/gpr_slice_test
-bins/opt/gpr_string_test
-bins/opt/gpr_sync_test
-bins/opt/gpr_time_test
-bins/opt/gpr_tls_test
-bins/opt/gpr_useful_test
-"
- if [[ ${NACL_ARCH} != arm ]]; then
- exes+="
-bins/opt/gpr_stack_lockfree_test
-bins/opt/gpr_thd_test
-"
- fi
-
- for exe in ${exes}; do
- RunSelLdrCommand ${exe}
- done
-}
-
-InstallStep() {
- SetupEnv
- LogExecute make install prefix=${DESTDIR}/${PREFIX}
-}
diff --git a/ports/grpc/nacl.patch b/ports/grpc/nacl.patch
deleted file mode 100644
index 2bb02ae..0000000
--- a/ports/grpc/nacl.patch
+++ /dev/null
@@ -1,893 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -64,19 +64,19 @@ HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false)
- HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false)
-
- ifeq ($(HAS_CC),true)
--DEFAULT_CC = cc
--DEFAULT_CXX = c++
-+DEFAULT_CC ?= cc
-+DEFAULT_CXX ?= c++
- else
- ifeq ($(HAS_GCC),true)
--DEFAULT_CC = gcc
--DEFAULT_CXX = g++
-+DEFAULT_CC ?= gcc
-+DEFAULT_CXX ?= g++
- else
- ifeq ($(HAS_CLANG),true)
--DEFAULT_CC = clang
--DEFAULT_CXX = clang++
-+DEFAULT_CC ?= clang
-+DEFAULT_CXX ?= clang++
- else
--DEFAULT_CC = no_c_compiler
--DEFAULT_CXX = no_c++_compiler
-+DEFAULT_CC ?= no_c_compiler
-+DEFAULT_CXX ?= no_c++_compiler
- endif
- endif
- endif
-@@ -246,6 +246,9 @@ LDXX ?= $(LDXX_$(CONFIG))
- ifeq ($(origin AR), default)
- AR = ar
- endif
-+ifeq ($(origin RANLIB), default)
-+RANLIB = ranlib
-+endif
- ifeq ($(SYSTEM),Linux)
- STRIP ?= strip --strip-unneeded
- else
-@@ -293,9 +296,15 @@ ifdef EXTRA_DEFINES
- DEFINES += $(EXTRA_DEFINES)
- endif
-
--CFLAGS += -std=c99 -Wsign-conversion -Wconversion -Wshadow
-+ifeq ($(SYSTEM),NaCl)
-+BUILD_SHARED = false
-+CFLAGS += -std=gnu99 -Wno-sign-compare
-+else
-+BUILD_SHARED = true
-+CFLAGS += -std=c99 -Wshadow -Wsign-conversion -Wconversion
-+endif
- ifeq ($(HAS_CXX11),true)
--CXXFLAGS += -std=c++11
-+CXXFLAGS += -std=gnu++11
- else
- CXXFLAGS += -std=c++0x
- endif
-@@ -344,6 +353,11 @@ LIBS = rt m pthread
- LDFLAGS += -pthread
- endif
-
-+ifeq ($(SYSTEM),NaCl)
-+LIBS = m pthread
-+LDFLAGS += -pthread
-+endif
-+
- ifeq ($(SYSTEM),MINGW32)
- LIBS = m pthread
- LDFLAGS += -pthread
-@@ -552,6 +566,7 @@ EMBED_ZLIB ?= false
- endif
-
- ifeq ($(EMBED_ZLIB),true)
-+$(error)
- ZLIB_DEP = $(LIBDIR)/$(CONFIG)/libz.a
- ZLIB_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libz.a
- CPPFLAGS += -Ithird_party/zlib
-@@ -1078,6 +1093,7 @@ static_c: pc_c pc_c_unsecure cache.mk pc_gpr pc_c_zookeeper $(LIBDIR)/$(CONFIG)/
-
- static_cxx: pc_cxx pc_cxx_unsecure pc_gpr cache.mk $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a
-
-+ifeq ($(BUILD_SHARED),true)
- shared: shared_c shared_cxx
-
- shared_c: pc_c pc_c_unsecure pc_gpr cache.mk pc_c_zookeeper $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.$(SHARED_EXT) shared_zookeeper_libs
-@@ -1085,6 +1101,12 @@ shared_c: pc_c pc_c_unsecure pc_gpr cache.mk pc_c_zookeeper $(LIBDIR)/$(CONFIG)/
- shared_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.$(SHARED_EXT)
-
- shared_csharp: shared_c $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.$(SHARED_EXT)
-+
-+grpc_csharp_ext: shared_csharp
-+else
-+shared:
-+endif
-+
- ifeq ($(HAS_ZOOKEEPER),true)
- static_zookeeper_libs: $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a
- shared_zookeeper_libs: $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.$(SHARED_EXT)
-@@ -1096,13 +1118,12 @@ shared_zookeeper_libs:
-
- endif
-
--grpc_csharp_ext: shared_csharp
-
- plugins: $(PROTOC_PLUGINS)
-
- privatelibs: privatelibs_c privatelibs_cxx
-
--privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a
-+privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a
- pc_gpr: $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc
-
- pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc
-@@ -1644,11 +1665,16 @@ buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark $
-
- benchmarks: buildbenchmarks
-
-+ifneq ($(SYSTEM),NaCl)
- strip: strip-static strip-shared
-
- strip-static: strip-static_c strip-static_cxx
-
-+ifeq ($(BUILD_SHARED),true)
- strip-shared: strip-shared_c strip-shared_cxx
-+else
-+strip-shared:
-+endif
-
-
- # TODO(nnoble): the strip target is stripping in-place, instead
-@@ -1677,6 +1703,7 @@ ifeq ($(CONFIG),opt)
- $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a
- endif
-
-+ifeq ($(BUILD_SHARED),true)
- strip-shared_c: shared_c
- ifeq ($(CONFIG),opt)
- $(E) "[STRIP] Stripping libgpr.so"
-@@ -1704,6 +1731,8 @@ ifeq ($(CONFIG),opt)
- $(E) "[STRIP] Stripping libgrpc_csharp_ext.so"
- $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.$(SHARED_EXT)
- endif
-+endif
-+endif
-
- cache.mk::
- $(E) "[MAKE] Generating $@"
-@@ -2002,6 +2031,7 @@ install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx
-
-
-
-+ifeq ($(BUILD_SHARED),true)
- install-shared_c: shared_c strip-shared_c install-pkg-config_c
- ifeq ($(SYSTEM),MINGW32)
- $(E) "[INSTALL] Installing gpr.$(SHARED_EXT)"
-@@ -2128,7 +2158,7 @@ ifneq ($(SYSTEM),Darwin)
- $(Q) ldconfig || true
- endif
- endif
--
-+endif
-
- install-plugins: $(PROTOC_PLUGINS)
- ifeq ($(SYSTEM),MINGW32)
-@@ -2278,7 +2308,7 @@ $(LIBDIR)/$(CONFIG)/libgpr.a: $(ZLIB_DEP) $(LIBGPR_OBJS)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgpr.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBGPR_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgpr.a
- endif
-
-
-@@ -2319,7 +2349,7 @@ $(LIBDIR)/$(CONFIG)/libgpr_test_util.a: $(ZLIB_DEP) $(LIBGPR_TEST_UTIL_OBJS)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgpr_test_util.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBGPR_TEST_UTIL_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr_test_util.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a
- endif
-
-
-@@ -2537,14 +2567,14 @@ $(LIBDIR)/$(CONFIG)/libgrpc.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_OBJS)
- cd $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc/ssl ; \
- $(AR) x $${l} ) ; done
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc/*/__.SYMDEF*
-- $(Q) ar rcs $(LIBDIR)/$(CONFIG)/libgrpc.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc/*/*
-+ $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc/*/*
- $(Q) rm -rf $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc.a
- endif
-
-
--
-+ifeq ($(BUILD_SHARED),true)
- ifeq ($(SYSTEM),MINGW32)
- $(LIBDIR)/$(CONFIG)/grpc.$(SHARED_EXT): $(LIBGRPC_OBJS) $(ZLIB_DEP) $(LIBDIR)/$(CONFIG)/gpr.$(SHARED_EXT) $(OPENSSL_DEP)
- $(E) "[LD] Linking $@"
-@@ -2562,6 +2592,7 @@ else
- $(Q) ln -sf libgrpc.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc.so
- endif
- endif
-+endif
-
- endif
-
-@@ -2607,7 +2638,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_TE
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBGRPC_TEST_UTIL_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a
- endif
-
-
-@@ -2643,7 +2674,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a: $(ZLIB_DEP) $(LIBGRPC_TEST_UT
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBGRPC_TEST_UTIL_UNSECURE_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a
- endif
-
-
-@@ -2817,10 +2848,10 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a: $(ZLIB_DEP) $(LIBGRPC_UNSECURE_OBJS)
- cd $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc_unsecure/zlib ; \
- $(AR) x $${l} ) ; done
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc_unsecure/*/__.SYMDEF*
-- $(Q) ar rcs $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc_unsecure/*/*
-+ $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc_unsecure/*/*
- $(Q) rm -rf $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc_unsecure
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
- endif
-
-
-@@ -2863,11 +2894,11 @@ $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a: $(ZLIB_DEP) $(LIBGRPC_ZOOKEEPER_OBJS)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a $(LIBGRPC_ZOOKEEPER_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a
- endif
-
-
--
-+ifeq ($(BUILD_SHARED),true)
- ifeq ($(SYSTEM),MINGW32)
- $(LIBDIR)/$(CONFIG)/grpc_zookeeper.$(SHARED_EXT): $(LIBGRPC_ZOOKEEPER_OBJS) $(ZLIB_DEP) $(LIBDIR)/$(CONFIG)/gpr.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/grpc.$(SHARED_EXT)
- $(E) "[LD] Linking $@"
-@@ -2885,6 +2916,7 @@ else
- $(Q) ln -sf libgrpc_zookeeper.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.so
- endif
- endif
-+endif
-
- ifneq ($(NO_DEPS),true)
- -include $(LIBGRPC_ZOOKEEPER_OBJS:.o=.dep)
-@@ -2914,7 +2946,7 @@ $(LIBDIR)/$(CONFIG)/libreconnect_server.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBRECON
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libreconnect_server.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBRECONNECT_SERVER_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libreconnect_server.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libreconnect_server.a
- endif
-
-
-@@ -2952,7 +2984,7 @@ $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBTEST_T
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBTEST_TCP_SERVER_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a
- endif
-
-
-@@ -3094,10 +3126,10 @@ $(LIBDIR)/$(CONFIG)/libgrpc++.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LI
- cd $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++/zlib ; \
- $(AR) x $${l} ) ; done
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++/*/__.SYMDEF*
-- $(Q) ar rcs $(LIBDIR)/$(CONFIG)/libgrpc++.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++/*/*
-+ $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc++.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++/*/*
- $(Q) rm -rf $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc++.a
- endif
-
-
-@@ -3162,7 +3194,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOB
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBGRPC++_TEST_CONFIG_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
- endif
-
-
-@@ -3216,7 +3248,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBGRPC++_TEST_UTIL_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a
- endif
-
-
-@@ -3345,10 +3377,10 @@ $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBGRPC
- cd $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++_unsecure/zlib ; \
- $(AR) x $${l} ) ; done
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++_unsecure/*/__.SYMDEF*
-- $(Q) ar rcs $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++_unsecure/*/*
-+ $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++_unsecure/*/*
- $(Q) rm -rf $(BUILDDIR_ABSOLUTE)/tmp-merge-grpc++_unsecure
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a
- endif
-
-
-@@ -3404,7 +3436,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIB
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a $(LIBGRPC_PLUGIN_SUPPORT_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a
- endif
-
-
-@@ -3449,7 +3481,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PRO
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBINTEROP_CLIENT_HELPER_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a
- endif
-
-
-@@ -3502,7 +3534,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_client_main.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTO
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_client_main.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBINTEROP_CLIENT_MAIN_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_client_main.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libinterop_client_main.a
- endif
-
-
-@@ -3552,7 +3584,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PRO
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBINTEROP_SERVER_HELPER_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a
- endif
-
-
-@@ -3603,7 +3635,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_server_main.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTO
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_server_main.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBINTEROP_SERVER_MAIN_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_server_main.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libinterop_server_main.a
- endif
-
-
-@@ -3667,7 +3699,7 @@ $(LIBDIR)/$(CONFIG)/libqps.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LIBQP
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libqps.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libqps.a $(LIBQPS_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libqps.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libqps.a
- endif
-
-
-@@ -3722,7 +3754,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_C
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a $(LIBGRPC_CSHARP_EXT_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a
- endif
-
-
-@@ -4062,7 +4094,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl.a: $(ZLIB_DEP) $(LIBBORINGSSL_OBJS)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl.a $(LIBBORINGSSL_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl.a
- endif
-
-
-@@ -4099,7 +4131,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIB
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBBORINGSSL_TEST_UTIL_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a
- endif
-
-
-@@ -4136,7 +4168,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBBORINGSSL_AES_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a
- endif
-
-
-@@ -4173,7 +4205,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBBORINGSSL_BASE64_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a
- endif
-
-
-@@ -4210,7 +4242,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBBORINGSSL_BIO_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a
- endif
-
-
-@@ -4247,7 +4279,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(L
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBBORINGSSL_BN_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a
- endif
-
-
-@@ -4284,7 +4316,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBBORINGSSL_BYTESTRING_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a
- endif
-
-
-@@ -4321,7 +4353,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBBORINGSSL_AEAD_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a
- endif
-
-
-@@ -4358,7 +4390,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBBORINGSSL_CIPHER_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a
- endif
-
-
-@@ -4395,7 +4427,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBBORINGSSL_CMAC_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a
- endif
-
-
-@@ -4423,7 +4455,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a: $(ZLIB_DEP) $(LIBBOR
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a $(LIBBORINGSSL_CONSTANT_TIME_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a
- endif
-
-
-@@ -4458,7 +4490,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBBORINGSSL_ED25519_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a
- endif
-
-
-@@ -4495,7 +4527,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBBORINGSSL_X25519_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a
- endif
-
-
-@@ -4532,7 +4564,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(L
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBBORINGSSL_DH_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a
- endif
-
-
-@@ -4569,7 +4601,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBBORINGSSL_DIGEST_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a
- endif
-
-
-@@ -4597,7 +4629,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_DSA
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a $(LIBBORINGSSL_DSA_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a
- endif
-
-
-@@ -4632,7 +4664,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(L
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBBORINGSSL_EC_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a
- endif
-
-
-@@ -4660,7 +4692,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a $(LIBBORINGSSL_EXAMPLE_MUL_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a
- endif
-
-
-@@ -4695,7 +4727,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBBORINGSSL_ECDSA_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a
- endif
-
-
-@@ -4732,7 +4764,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBBORINGSSL_ERR_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a
- endif
-
-
-@@ -4769,7 +4801,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_D
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBBORINGSSL_EVP_EXTRA_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a
- endif
-
-
-@@ -4806,7 +4838,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBBORINGSSL_EVP_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a
- endif
-
-
-@@ -4843,7 +4875,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBBORINGSSL_PBKDF_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a
- endif
-
-
-@@ -4871,7 +4903,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_HK
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a $(LIBBORINGSSL_HKDF_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a
- endif
-
-
-@@ -4906,7 +4938,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBBORINGSSL_HMAC_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a
- endif
-
-
-@@ -4934,7 +4966,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_L
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a $(LIBBORINGSSL_LHASH_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a
- endif
-
-
-@@ -4960,7 +4992,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_GCM
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a $(LIBBORINGSSL_GCM_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a
- endif
-
-
-@@ -4995,7 +5027,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBBORINGSSL_PKCS12_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a
- endif
-
-
-@@ -5032,7 +5064,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBBORINGSSL_PKCS8_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a
- endif
-
-
-@@ -5069,7 +5101,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DE
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBBORINGSSL_POLY1305_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a
- endif
-
-
-@@ -5097,7 +5129,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSS
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a $(LIBBORINGSSL_REFCOUNT_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a
- endif
-
-
-@@ -5132,7 +5164,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBBORINGSSL_RSA_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a
- endif
-
-
-@@ -5160,7 +5192,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a $(LIBBORINGSSL_THREAD_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a
- endif
-
-
-@@ -5186,7 +5218,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_P
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a $(LIBBORINGSSL_PKCS7_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a
- endif
-
-
-@@ -5212,7 +5244,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_TAB
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a $(LIBBORINGSSL_TAB_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a
- endif
-
-
-@@ -5238,7 +5270,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a $(LIBBORINGSSL_V3NAME_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a
- endif
-
-
-@@ -5264,7 +5296,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a $(LIBBORINGSSL_PQUEUE_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a
- endif
-
-
-@@ -5299,7 +5331,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBBORINGSSL_SSL_TEST_LIB_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a
- endif
-
-
-@@ -5312,6 +5344,7 @@ ifneq ($(NO_DEPS),true)
- endif
-
-
-+ifeq ($(HAS_SYSTEM_ZLIB),false)
- LIBZ_SRC = \
- third_party/zlib/adler32.c \
- third_party/zlib/compress.c \
-@@ -5340,7 +5373,7 @@ $(LIBDIR)/$(CONFIG)/libz.a: $(LIBZ_OBJS)
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libz.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libz.a $(LIBZ_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libz.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libz.a
- endif
-
-
-@@ -5349,6 +5382,7 @@ endif
- ifneq ($(NO_DEPS),true)
- -include $(LIBZ_OBJS:.o=.dep)
- endif
-+endif
-
-
- LIBBAD_CLIENT_TEST_SRC = \
-@@ -5374,7 +5408,7 @@ $(LIBDIR)/$(CONFIG)/libbad_client_test.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBBAD_CL
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libbad_client_test.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBBAD_CLIENT_TEST_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libbad_client_test.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libbad_client_test.a
- endif
-
-
-@@ -5412,7 +5446,7 @@ $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBBA
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBBAD_SSL_TEST_SERVER_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a
- endif
-
-
-@@ -5486,7 +5520,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_tests.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBEND2END_
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_tests.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBEND2END_TESTS_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_tests.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libend2end_tests.a
- endif
-
-
-@@ -5549,7 +5583,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a: $(ZLIB_DEP) $(LIBEND2END_NOSEC_TE
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBEND2END_NOSEC_TESTS_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a
- endif
-
-
-@@ -5585,7 +5619,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_certs.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBEND2END_
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_certs.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBEND2END_CERTS_OBJS)
- ifeq ($(SYSTEM),Darwin)
-- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_certs.a
-+ $(Q) $(RANLIB) $(LIBDIR)/$(CONFIG)/libend2end_certs.a
- endif
-
-
-@@ -10648,7 +10682,7 @@ $(OBJDIR)/$(CONFIG)/test/core/surface/public_headers_must_be_c89.o: $(LIBDIR)/$
- $(OBJDIR)/$(CONFIG)/test/core/surface/public_headers_must_be_c89.o : test/core/surface/public_headers_must_be_c89.c
- $(E) "[C] Compiling $<"
- $(Q) mkdir -p `dirname $@`
-- $(Q) $(CC) $(CPPFLAGS) $(CFLAGS) -std=c89 -pedantic -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
-+ $(Q) $(CC) $(CPPFLAGS) $(CFLAGS) -std=c89 -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
-
- deps_public_headers_must_be_c89: $(PUBLIC_HEADERS_MUST_BE_C89_OBJS:.o=.dep)
-
-diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h
---- a/include/grpc/support/port_platform.h
-+++ b/include/grpc/support/port_platform.h
-@@ -242,6 +242,39 @@
- #else /* _LP64 */
- #define GPR_ARCH_32 1
- #endif /* _LP64 */
-+#elif defined(__native_client__)
-+#define GPR_PLATFORM_STRING "nacl"
-+#ifndef _BSD_SOURCE
-+#define _BSD_SOURCE
-+#endif
-+#ifndef _DEFAULT_SOURCE
-+#define _DEFAULT_SOURCE
-+#endif
-+#ifndef _GNU_SOURCE
-+#define _GNU_SOURCE
-+#endif
-+#define GPR_CPU_POSIX 1
-+#define GPR_GCC_ATOMIC 1
-+#define GPR_GCC_TLS 1
-+#define GPR_POSIX_LOG 1
-+#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
-+#define GPR_POSIX_WAKEUP_FD 1
-+#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
-+#define GPR_POSIX_SOCKET 1
-+#define GPR_POSIX_SOCKETADDR 1
-+#define GPR_POSIX_SOCKETUTILS 1
-+#define GPR_POSIX_ENV 1
-+#define GPR_POSIX_FILE 1
-+#define GPR_POSIX_STRING 1
-+#define GPR_POSIX_SUBPROCESS 1
-+#define GPR_POSIX_SYNC 1
-+#define GPR_POSIX_TIME 1
-+#define GPR_GETPID_IN_UNISTD_H 1
-+#ifdef _LP64
-+#define GPR_ARCH_64 1
-+#else /* _LP64 */
-+#define GPR_ARCH_32 1
-+#endif /* _LP64 */
- #else
- #error Could not auto-detect platform
- #endif
-diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c
---- a/src/core/iomgr/tcp_posix.c
-+++ b/src/core/iomgr/tcp_posix.c
-@@ -42,6 +42,7 @@
- #include <string.h>
- #include <sys/types.h>
- #include <sys/socket.h>
-+#include <sys/uio.h>
- #include <unistd.h>
-
- #include <grpc/support/alloc.h>
-diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c
---- a/src/core/iomgr/udp_server.c
-+++ b/src/core/iomgr/udp_server.c
-@@ -217,8 +217,10 @@ static int prepare_socket(int fd, const struct sockaddr *addr,
- size_t addr_len) {
- struct sockaddr_storage sockname_temp;
- socklen_t sockname_len;
-+#if !defined(__native_client__)
- int get_local_ip;
- int rc;
-+#endif
-
- if (fd < 0) {
- goto error;
-@@ -229,6 +231,7 @@ static int prepare_socket(int fd, const struct sockaddr *addr,
- strerror(errno));
- }
-
-+#if !defined(__native_client__)
- get_local_ip = 1;
- rc = setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &get_local_ip,
- sizeof(get_local_ip));
-@@ -238,6 +241,7 @@ static int prepare_socket(int fd, const struct sockaddr *addr,
- sizeof(get_local_ip));
- #endif
- }
-+#endif
-
- GPR_ASSERT(addr_len < ~(socklen_t)0);
- if (bind(fd, addr, (socklen_t)addr_len) < 0) {
diff --git a/ports/grpc/pkg_info b/ports/grpc/pkg_info
deleted file mode 100644
index d508526..0000000
--- a/ports/grpc/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=grpc
-VERSION=0.12.0
-DEPENDS=(protobuf openssl zlib gflags)
-LICENSE=CUSTOM:README
-URL=https://github.com/grpc/grpc.git@9fad88fe
-# Disabled for older glibc compilers due to lack of full C++11 support.
-DISABLED_TOOLCHAIN=(glibc/x86_64 glibc/i686)
diff --git a/ports/gsl/build.sh b/ports/gsl/build.sh
deleted file mode 100644
index 2f2188a..0000000
--- a/ports/gsl/build.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="
- gsl-randist${NACL_EXEEXT}
- gsl-histogram${NACL_EXEEXT}
- sys/test${NACL_EXEEXT}
-"
-
-ConfigureStep() {
- # TODO(sbc): Remove when this is fixed.
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- if [ "$NACL_ARCH" = "arm" ]; then
- NACLPORTS_CFLAGS="${NACLPORTS_CFLAGS/-O2/}"
- fi
-
- DefaultConfigureStep
-}
-
-BuildStep() {
- DefaultBuildStep
- LogExecute make -C sys test${NACL_EXEEXT}
-}
-
-TestStep() {
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- return
- fi
- LogExecute ./sys/test
-}
diff --git a/ports/gsl/pkg_info b/ports/gsl/pkg_info
deleted file mode 100644
index d3817ce..0000000
--- a/ports/gsl/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=gsl
-VERSION=1.16
-URL=http://ftpmirror.gnu.org/gsl/gsl-1.16.tar.gz
-LICENSE=GPL3
-SHA1=210af9366485f149140973700d90dc93a4b6213e
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gtest/build.sh b/ports/gtest/build.sh
deleted file mode 100644
index 0fed6df..0000000
--- a/ports/gtest/build.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright (c) 2011 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.
-
-CTEST_EXECUTABLES="
-gtest_break_on_failure_unittest_
-gtest_catch_exceptions_ex_test_
-gtest_catch_exceptions_no_ex_test_
-gtest_color_test_
-gtest_env_var_test_
-gtest_filter_unittest_
-gtest_help_test_
-gtest_list_tests_unittest_
-gtest_output_test_
-gtest_shuffle_test_
-gtest_throw_on_failure_test_
-gtest_uninitialized_test_
-gtest_xml_outfile1_test_
-gtest_xml_outfile2_test_
-gtest_xml_output_unittest_
-gtest_main_unittest
-gtest_unittest
-gtest_no_test_unittest
-gtest_no_rtti_unittest
-gtest_pred_impl_unittest
-gtest-death-test_ex_catch_test
-gtest-death-test_ex_nocatch_test
-gtest-death-test_test
-gtest_environment_test
-gtest-filepath_test
-gtest-linked_ptr_test
-gtest-listener_test
-gtest-message_test
-gtest-options_test
-gtest-param-test_test
-gtest-port_test
-gtest_premature_exit_test
-gtest-printers_test
-gtest_prod_test
-gtest_repeat_test
-gtest_sole_header_test
-gtest_stress_test
-gtest-test-part_test
-gtest_throw_on_failure_ex_test
-gtest-tuple_test
-gtest-typed-test_test
-gtest-unittest-api_test
-gtest_use_own_tuple_test
-"
-
-if [[ -e "$NACL_SDK_ROOT/include/gtest" ]]; then
- echo "The current NaCl SDK includes its own version of gtest"
- if [[ -z ${BUILDBOT_BUILDERNAME:-} ]]; then
- # normal use case: prompt the user to move the pre-installed gtest headers
- echo "Please remove or rename '$NACL_SDK_ROOT/include/gtest' to continue"
- exit 1
- else
- # on the buildbot simply move the headers
- mv $NACL_SDK_ROOT/include/gtest $NACL_SDK_ROOT/include/gtest-old
- fi
-fi
-
-ConfigureStep() {
- if [[ -z ${GTEST_TEST:-} ]]; then
- Banner "Skipping configure step (set GTEST_TEST to enable)"
- return
- fi
- Remove ${SRC_DIR}/configure
- EXTRA_CMAKE_ARGS="-Dgtest_build_tests=1"
- for exe in $CTEST_EXECUTABLES; do
- Remove $exe
- done
- DefaultConfigureStep
-}
-
-BuildStep() {
- return
-}
-
-InstallStep() {
- local srcdir=${DESTDIR}/${PREFIX}/src
- MakeDir ${srcdir}/gtest/include
-
- LogExecute cp -r ${SRC_DIR}/include/gtest ${srcdir}/gtest/include/gtest
- LogExecute cp -r ${SRC_DIR}/src ${srcdir}/gtest
-}
-
-TestStep() {
- if [[ -z ${GTEST_TEST:-} ]]; then
- Banner "Skipping tests (set GTEST_TEST to enable)"
- return
- fi
- DefaultBuildStep
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- return
- fi
- for exe in $CTEST_EXECUTABLES; do
- mv $exe $exe$NACL_EXEEXT
- WriteLauncherScript $exe $exe$NACL_EXEEXT
- done
- LogExecute make TZ=gmt test
-}
diff --git a/ports/gtest/diff_skip.txt b/ports/gtest/diff_skip.txt
deleted file mode 100644
index e8c05a6..0000000
--- a/ports/gtest/diff_skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-configure
diff --git a/ports/gtest/nacl.patch b/ports/gtest/nacl.patch
deleted file mode 100644
index 7f223e6..0000000
--- a/ports/gtest/nacl.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -172,14 +172,16 @@ if (gtest_build_tests)
- cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
- gtest_main_no_rtti test/gtest_unittest.cc)
-
-- cxx_shared_library(gtest_dll "${cxx_default}"
-- src/gtest-all.cc src/gtest_main.cc)
-+ if (NOT NACL)
-+ cxx_shared_library(gtest_dll "${cxx_default}"
-+ src/gtest-all.cc src/gtest_main.cc)
-
-- cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
-- gtest_dll test/gtest_all_test.cc)
-- set_target_properties(gtest_dll_test_
-- PROPERTIES
-- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-+ cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
-+ gtest_dll test/gtest_all_test.cc)
-+ set_target_properties(gtest_dll_test_
-+ PROPERTIES
-+ COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-+ endif()
-
- if (NOT MSVC OR MSVC_VERSION LESS 1600) # 1600 is Visual Studio 2010.
- # Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that
-diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc
---- a/test/gtest-death-test_test.cc
-+++ b/test/gtest-death-test_test.cc
-@@ -1303,6 +1303,7 @@ TEST(ConditionalDeathMacrosDeathTest, ExpectsDeathWhenDeathTestsAvailable) {
- EXPECT_FATAL_FAILURE(ASSERT_DEATH_IF_SUPPORTED(;, ""), "");
- }
-
-+#if 0
- TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) {
- testing::GTEST_FLAG(death_test_style) = "fast";
- EXPECT_FALSE(InDeathTestChild());
-@@ -1322,6 +1323,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) {
- _exit(1);
- }, "Inside");
- }
-+#endif
-
- #else // !GTEST_HAS_DEATH_TEST follows
-
-diff --git a/test/gtest-options_test.cc b/test/gtest-options_test.cc
---- a/test/gtest-options_test.cc
-+++ b/test/gtest-options_test.cc
-@@ -116,6 +116,7 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
- // Chandler Carruth's libtool replacement is ready.
- const bool success =
- exe_str == "gtest-options_test" ||
-+ exe_str == "gtest-options_test.nexe" ||
- exe_str == "gtest_all_test" ||
- exe_str == "lt-gtest_all_test" ||
- exe_str == "gtest_dll_test";
-diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc
---- a/test/gtest-printers_test.cc
-+++ b/test/gtest-printers_test.cc
-@@ -959,6 +959,7 @@ TEST(PrintStlContainerTest, NestedContainer) {
- EXPECT_EQ("{ { 1, 2 }, { 3, 4, 5 } }", Print(v));
- }
-
-+#if 0
- TEST(PrintStlContainerTest, OneDimensionalNativeArray) {
- const int a[3] = { 1, 2, 3 };
- NativeArray<int> b(a, 3, RelationToSourceReference());
-@@ -970,6 +971,7 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) {
- NativeArray<int[3]> b(a, 2, RelationToSourceReference());
- EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b));
- }
-+#endif
-
- // Tests that a class named iterator isn't treated as a container.
-
-diff --git a/test/gtest_break_on_failure_unittest.py b/test/gtest_break_on_failure_unittest.py
---- a/test/gtest_break_on_failure_unittest.py
-+++ b/test/gtest_break_on_failure_unittest.py
-@@ -136,6 +136,9 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
-
- SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, None)
-
-+ if gtest_test_utils.IS_NACL:
-+ return
-+
- msg = ('when %s%s, an assertion failure in "%s" %s cause a seg-fault.' %
- (BREAK_ON_FAILURE_ENV_VAR, env_var_value_msg, ' '.join(command),
- should_or_not))
-diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py
---- a/test/gtest_help_test.py
-+++ b/test/gtest_help_test.py
-@@ -44,7 +44,8 @@ import re
- import gtest_test_utils
-
-
--IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-+IS_NACL = True
-+IS_LINUX = not IS_NACL and (os.name == 'posix' and os.uname()[0] == 'Linux')
- IS_WINDOWS = os.name == 'nt'
-
- PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
-diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py
---- a/test/gtest_test_utils.py
-+++ b/test/gtest_test_utils.py
-@@ -54,6 +54,7 @@ except:
- GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
-
- IS_WINDOWS = os.name == 'nt'
-+IS_NACL = True
- IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
-
- # The environment variable for specifying the path to the premature-exit file.
-@@ -300,7 +301,8 @@ class Subprocess:
- else:
- self.terminated_by_signal = False
- self.exited = True
-- self.exit_code = self._return_code
-+
-+ self.exit_code = self._return_code
-
-
- def Main():
-diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc
---- a/test/gtest_unittest.cc
-+++ b/test/gtest_unittest.cc
-@@ -7608,6 +7608,7 @@ TEST(CopyArrayTest, WorksForTwoDimensionalArrays) {
-
- // Tests NativeArray.
-
-+#if 0
- TEST(NativeArrayTest, ConstructorFromArrayWorks) {
- const int a[3] = { 0, 1, 2 };
- NativeArray<int> na(a, 3, RelationToSourceReference());
-@@ -7629,6 +7630,7 @@ TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo) {
- // We rely on the heap checker to verify that na deletes the copy of
- // array.
- }
-+#endif
-
- TEST(NativeArrayTest, TypeMembersAreCorrect) {
- StaticAssertTypeEq<char, NativeArray<char>::value_type>();
-@@ -7638,6 +7640,7 @@ TEST(NativeArrayTest, TypeMembersAreCorrect) {
- StaticAssertTypeEq<const bool(*)[2], NativeArray<bool[2]>::const_iterator>();
- }
-
-+#if 0
- TEST(NativeArrayTest, MethodsWork) {
- const int a[3] = { 0, 1, 2 };
- NativeArray<int> na(a, 3, RelationToSourceCopy());
-@@ -7670,6 +7673,7 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
- ASSERT_EQ(2U, na.size());
- EXPECT_EQ(a, na.begin());
- }
-+#endif
-
- // Tests SkipPrefix().
-
-diff --git a/test/gtest_xml_outfiles_test.py b/test/gtest_xml_outfiles_test.py
---- a/test/gtest_xml_outfiles_test.py
-+++ b/test/gtest_xml_outfiles_test.py
-@@ -108,12 +108,13 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase):
- # gtest_xml_outfiles_test_. To account for this possibillity, we
- # allow both names in the following code. We should remove this
- # hack when Chandler Carruth's libtool replacement tool is ready.
-- output_file_name1 = test_name + ".xml"
-+ output_file_name1 = test_name + ".nexe.xml"
- output_file1 = os.path.join(self.output_dir_, output_file_name1)
- output_file_name2 = 'lt-' + output_file_name1
- output_file2 = os.path.join(self.output_dir_, output_file_name2)
- self.assert_(os.path.isfile(output_file1) or os.path.isfile(output_file2),
-- output_file1)
-+ "Nither output file exists (%s %s)" % (output_file1,
-+ output_file2))
-
- expected = minidom.parseString(expected_xml)
- if os.path.isfile(output_file1):
diff --git a/ports/gtest/pkg_info b/ports/gtest/pkg_info
deleted file mode 100644
index 84b8627..0000000
--- a/ports/gtest/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=gtest
-VERSION=1.7.0+
-URL=https://github.com/google/googletest.git@6f8a664
-LICENSE=BSD:COPYING
diff --git a/ports/gtk+/README.nacl b/ports/gtk+/README.nacl
deleted file mode 100644
index 3827dbb..0000000
--- a/ports/gtk+/README.nacl
+++ /dev/null
@@ -1,14 +0,0 @@
-gtk+ port to Native Client
-==========================
-
-The easiest way to run the demo from within Chrome is to install gtk-demo and
-run the gtk+ demo as an app. If you want to run it stand alone, install the
-xorg-server app and run that. Then you can run the gtk-demo in a tab ("make run"
-from the webports directory to launch a web server and then simply navigate to
-the gtk-demo.html page on localhost) and the demo will launch on the x-server.
-It is also recommended that you use a window manager (there is none packaged
-with the demo, which does involve creating various new windows). The x-server
-and gtk-demo by default use DISPLAY=:42 so point your favorite window manager
-at :42 ex: "DISPLAY=:42 twm" and you should be able to see the gtk-demo.
-
-WARNING: this port currently only runs when built with the glibc toolchain.
diff --git a/ports/gtk+/build.sh b/ports/gtk+/build.sh
deleted file mode 100644
index 33e8d2e..0000000
--- a/ports/gtk+/build.sh
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 2015 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.
-
-ConfigureStep() {
- if [ "${NACL_LIBC}" = "newlib" ]; then
- # newlib requires different library order to deal with static libraries
- NACLPORTS_LIBS+=" -lXext -lX11 -lxcb -lXau"
- fi
-
- EnableGlibcCompat
- EnableCliMain
-
- EXTRA_CONFIGURE_ARGS+=" --disable-shm --enable-explicit-deps --disable-cups \
- --enable-gtk-doc-html=no"
-
- export enable_gtk_doc=no
-
- DefaultConfigureStep
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- local FONT_ROOT_DIR="${PUBLISH_DIR}/${NACL_ARCH}/root"
- local FONTCONFIG_DIR="${START_DIR}/../fontconfig"
- local FONT_CACHE="${NACL_PACKAGES_PUBLISH}/xfonts/${TOOLCHAIN}/${NACL_ARCH}"
-
- # Create Fonts tar
-
- # Setup Directory Structure
- # TODO(josephpereira): put everything in /usr not webports-dummydir
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/var/cache/fontconfig
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/lib/pkgconfig
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/share/gtk-2.0/demo
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/share/themes
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/share/aclocal
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/share/X11
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/share/locale
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/lib/gdk-pixbuf-2.0/2.10.0
- MakeDir ${FONT_ROOT_DIR}/webports-dummydir/etc/pango
- MakeDir ${FONT_ROOT_DIR}/usr/share/locale
- MakeDir ${FONT_ROOT_DIR}/usr/share/fonts
- MakeDir ${FONT_ROOT_DIR}/usr/lib/pkgconfig
- MakeDir ${FONT_ROOT_DIR}/gdk-pixbuf
- MakeDir ${FONT_ROOT_DIR}/modules
- MakeDir ${FONT_ROOT_DIR}/conf.d
-
- # Move fontconfig files
- LogExecute cp -rf ${NACLPORTS_LIBDIR}/../share/fontconfig/conf.avail/*\
- ${FONT_ROOT_DIR}/conf.d
- LogExecute cp -rf ${FONTCONFIG_DIR}/fonts\
- ${FONT_ROOT_DIR}/webports-dummydir/etc
-
- # Get Cache from xfonts
- LogExecute cp -f ${FONT_CACHE}/xorg-fonts-cache-${NACL_ARCH}.tar\
- ${FONT_ROOT_DIR}/cache.tar
- ChangeDir ${FONT_ROOT_DIR}
- LogExecute tar -xvf cache.tar
- LogExecute rm -f cache.tar
-
- # Move X11 font files
- LogExecute cp -rf ${NACLPORTS_LIBDIR}/../share/fonts/*\
- ${FONT_ROOT_DIR}/usr/share/fonts
- LogExecute cp -rf ${NACLPORTS_LIBDIR}/../share/X11/locale/*\
- ${FONT_ROOT_DIR}/usr/share/locale
-
- # Other setup
- echo "0" > ${FONT_ROOT_DIR}/usr/share/fonts/X11/fonts.scale
- echo "0" > ${FONT_ROOT_DIR}/usr/share/fonts/X11/fonts.dir
- echo "[Pango]" > ${FONT_ROOT_DIR}/webports-dummydir/etc/pango/pangorc
- echo "ModuleFiles = ../modules/pango.modules" >>\
- ${FONT_ROOT_DIR}/webports-dummydir/etc/pango/pangorc
- LogExecute touch ${FONT_ROOT_DIR}/webports-dummydir/lib/charset.alias
- LogExecute cp -f ${NACLPORTS_LIBDIR}/pkgconfig/gdk-pixbuf*.pc\
- ${FONT_ROOT_DIR}/webports-dummydir/lib/pkgconfig
- LogExecute cp -f ${NACLPORTS_LIBDIR}/pkgconfig/gdk-pixbuf*.pc\
- ${FONT_ROOT_DIR}/usr/lib/pkgconfig
- LogExecute touch\
- ${FONT_ROOT_DIR}/webports-dummydir/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
- LogExecute cp -rf ${NACLPORTS_LIBDIR}/../share/aclocal/*\
- ${FONT_ROOT_DIR}/webports-dummydir/share/aclocal
- LogExecute cp -rf ${NACLPORTS_LIBDIR}/../share/locale/*\
- ${FONT_ROOT_DIR}/webports-dummydir/share/locale
- LogExecute cp -rf ${NACLPORTS_LIBDIR}/../share/X11/*\
- ${FONT_ROOT_DIR}/webports-dummydir/share/X11
-
- # Looks for these files to be there, otherwise assumes bad install
- LogExecute touch ${FONT_ROOT_DIR}/gdk-pixbuf/gdk-pixbuf.loaders
- LogExecute touch ${FONT_ROOT_DIR}/modules/pango.modules
-
- # Grab source to display in demo
- LogExecute cp -rf ${BUILD_DIR}/../gtk+-2.24.28/demos/gtk-demo/*\
- ${FONT_ROOT_DIR}/webports-dummydir/share/gtk-2.0/demo
-
- # tar gtk+ directory structure
- LogExecute tar -cvf gtk-demo.tar *
-
- local APP_DIR="${PUBLISH_DIR}/${NACL_ARCH}"
- MakeDir ${APP_DIR}
- LogExecute cp -f gtk-demo.tar ${APP_DIR}/gtk-demo.tar
- ChangeDir ${APP_DIR}
- local exe="${APP_DIR}/gtk-demo${NACL_EXEEXT}"
- LogExecute cp ${INSTALL_DIR}/webports-dummydir/bin/gtk-demo${NACL_EXEEXT} \
- ${exe}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${exe} -s . -L ${INSTALL_DIR}/webports-dummydir/lib \
- -o gtk-demo.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py -n gtk-demo gtk-demo.nmf
- InstallNaClTerm ${APP_DIR}
- LogExecute cp -f ${START_DIR}/*.js ${APP_DIR}
- LogExecute rm -rf ${FONT_ROOT_DIR}
-}
diff --git a/ports/gtk+/gtk-demo.js b/ports/gtk+/gtk-demo.js
deleted file mode 100644
index 414b269..0000000
--- a/ports/gtk+/gtk-demo.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-NaClTerm.nmf = 'gtk-demo.nmf';
-NaClTerm.env = [
- 'NACL_SPAWN_MODE=embed',
- 'NACL_EMBED_WIDTH=100%',
- 'NACL_EMBED_HEIGHT=100%',
- 'DISPLAY=:42',
-];
-
-document.title = 'Gtk+ Demo';
diff --git a/ports/gtk+/nacl.patch b/ports/gtk+/nacl.patch
deleted file mode 100644
index e254d32..0000000
--- a/ports/gtk+/nacl.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -2,7 +2,7 @@
- include $(top_srcdir)/Makefile.decl
-
- SRC_SUBDIRS = gdk gtk modules demos tests perf
--SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
-+SUBDIRS = po po-properties $(SRC_SUBDIRS) m4macros build
-
- # require automake 1.4
- AUTOMAKE_OPTIONS = 1.7
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -564,7 +564,7 @@ XVFB_START = \
- && DISPLAY=:$$XID && export DISPLAY
-
- SRC_SUBDIRS = gdk gtk modules demos tests perf
--SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
-+SUBDIRS = po po-properties $(SRC_SUBDIRS) m4macros build
-
- # require automake 1.4
- AUTOMAKE_OPTIONS = 1.7
-diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
---- a/demos/gtk-demo/main.c
-+++ b/demos/gtk-demo/main.c
-@@ -934,6 +934,9 @@ main (int argc, char **argv)
- GtkWidget *tree;
- GtkTextTag *tag;
-
-+ if (nacl_startup_untar(argv[0], "gtk-demo.tar", "/"))
-+ return -1;
-+
- /* Most code in gtk-demo is intended to be exemplary, but not
- * these few lines, which are just a hack so gtk-demo will work
- * in the GTK tree without installing it.
-diff --git a/perf/marshalers.c b/perf/marshalers.c
---- a/perf/marshalers.c
-+++ b/perf/marshalers.c
-@@ -50,6 +50,7 @@
-
-
- /* OBJECT:VOID (./marshalers.list:1) */
-+#ifndef __native_client__
- void
- _gtk_marshal_OBJECT__VOID (GClosure *closure,
- GValue *return_value G_GNUC_UNUSED,
-@@ -85,6 +86,7 @@ _gtk_marshal_OBJECT__VOID (GClosure *closure,
-
- g_value_take_object (return_value, v_return);
- }
-+#endif
-
- /* VOID:ENUM,OBJECT,DOUBLE (./marshalers.list:2) */
- void
diff --git a/ports/gtk+/pkg_info b/ports/gtk+/pkg_info
deleted file mode 100644
index 4aba5b3..0000000
--- a/ports/gtk+/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=gtk+
-VERSION=2.24.28
-URL=http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.28.tar.xz
-LICENSE=LGPL
-DEPENDS=(pango atk cairo gdk-pixbuf glibc-compat xfonts)
-SHA1=f3c2f1a3728ed51d08054f6b4c7384fbf99477c0
-# buildbots mess up the pango flags for newlib and clang-newlib
-DISABLED_LIBC=(newlib)
diff --git a/ports/gtk-demo/Xsdl.js b/ports/gtk-demo/Xsdl.js
deleted file mode 100644
index 9a64a04..0000000
--- a/ports/gtk-demo/Xsdl.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-/* globals NaClTerm, NaClProcessManager */
-
-'use strict';
-
-NaClTerm.nmf = 'Xsdl.nmf';
-NaClTerm.argv = [
- '-screen', '1024x768x32', '-ac', '-br', '-noreset', ':42'
-];
-NaClTerm.env = [
- 'NACL_SPAWN_MODE=embed',
- 'NACL_EMBED_WIDTH=100%',
- 'NACL_EMBED_HEIGHT=100%',
-];
-document.title = 'Loading ...';
-
-var mgr = new NaClProcessManager();
-mgr.onTerminalResize(80, 24);
-var env = [
- 'DISPLAY=:42',
-];
-
-// TODO(bradnelson): Do something more robust than racing gtk + xserver.
-function startDemo() {
- // Assume a default terminal size for headless processes.
- mgr.spawn(
- 'gtk-demo.nmf', ['-g', '162x53'], env,
- '/', 'nacl', null, function(pid) {
- mgr.waitpid(pid, 0, function() {
- window.close();
- });
- });
- window.setTimeout(function() { document.title = 'Gtk+ Demo'; }, 15000);
-}
-
-function startWindowManager() {
- mgr.spawn(
- 'twm.nmf', [""], env,
- '/', 'nacl', null, function(pid) {
- mgr.waitpid(pid, 0, function() {
- window.close();
- });
- });
-}
-
-startDemo();
-window.setTimeout(startWindowManager, 5000);
diff --git a/ports/gtk-demo/build.sh b/ports/gtk-demo/build.sh
deleted file mode 100644
index 883532c..0000000
--- a/ports/gtk-demo/build.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2015 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.
-
-BuildStep() {
- # Meta package, no build.
- return
-}
-
-InstallStep() {
- local ASSEMBLY_DIR=${PUBLISH_DIR}/app
- MakeDir ${ASSEMBLY_DIR}
-
- local GTK_PORT_DIR=${START_DIR}/../gtk+
- local GTK_DIR=${NACL_PACKAGES_PUBLISH}/gtk+/${TOOLCHAIN}/${NACL_ARCH}
- local XORG_DIR=${NACL_PACKAGES_PUBLISH}/xorg-server/${TOOLCHAIN}/xorg-server
- local TWM_DIR=${NACL_PACKAGES_PUBLISH}/twm/${TOOLCHAIN}
-
- LogExecute cp ${GTK_DIR}/*.nmf ${ASSEMBLY_DIR}/
- LogExecute cp ${GTK_DIR}/*.nexe ${ASSEMBLY_DIR}/
- LogExecute cp -r ${GTK_DIR}/lib* ${ASSEMBLY_DIR}/
- LogExecute cp ${GTK_DIR}/*.tar ${ASSEMBLY_DIR}/
-
- LogExecute cp ${TWM_DIR}/*.nmf ${ASSEMBLY_DIR}/
- LogExecute cp ${TWM_DIR}/*.nexe ${ASSEMBLY_DIR}/
- LogExecute cp -r ${TWM_DIR}/lib* ${ASSEMBLY_DIR}/
-
- LogExecute cp -r ${XORG_DIR}/_platform_specific ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.nmf ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.nexe ${ASSEMBLY_DIR}/
- LogExecute cp -r ${XORG_DIR}/lib* ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.tar ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.js ${ASSEMBLY_DIR}/
- LogExecute cp ${XORG_DIR}/*.html ${ASSEMBLY_DIR}/
-
- LogExecute cp ${START_DIR}/Xsdl.js ${ASSEMBLY_DIR}/
- LogExecute cp ${START_DIR}/*.png ${ASSEMBLY_DIR}/
-
- LogExecute python ${TOOLS_DIR}/create_term.py -n gtk-demo gtk-demo.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py -n twm twm.nmf
- GenerateManifest ${START_DIR}/manifest.json ${ASSEMBLY_DIR} \
- "TITLE"="Gtk-Demo"
-}
diff --git a/ports/gtk-demo/icon_128.png b/ports/gtk-demo/icon_128.png
deleted file mode 100644
index 7b0ea8c..0000000
--- a/ports/gtk-demo/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/gtk-demo/icon_16.png b/ports/gtk-demo/icon_16.png
deleted file mode 100644
index a158efb..0000000
--- a/ports/gtk-demo/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/gtk-demo/icon_48.png b/ports/gtk-demo/icon_48.png
deleted file mode 100644
index f5dbf6f..0000000
--- a/ports/gtk-demo/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/gtk-demo/manifest.json b/ports/gtk-demo/manifest.json
deleted file mode 100644
index f54eb19..0000000
--- a/ports/gtk-demo/manifest.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "%(TITLE)s",
- "description": "The gtk+ demo running using NativeClient",
- "version": "0.0.0.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "file_handlers": {
- "edit": {
- "types": [
- "text/*"
- ],
- "extensions": [
- "json",
- "txt",
- "js",
- "html",
- "h",
- "c",
- "cc",
- "cpp",
- "java"
- ]
- }
- },
- "permissions": [
- "fileSystem",
- "storage",
- "unlimitedStorage",
- {
- "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/gtk-demo/pkg_info b/ports/gtk-demo/pkg_info
deleted file mode 100644
index 3d5b7fc..0000000
--- a/ports/gtk-demo/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=gtk-demo
-VERSION=0.1
-# Currently only builds on linux (due to x11)
-BUILD_OS=linux
-DEPENDS=(xorg-server gtk+ twm)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/gzip/build.sh b/ports/gzip/build.sh
deleted file mode 100644
index abcaaf0..0000000
--- a/ports/gzip/build.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (c) 2015 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.
-
-EXECUTABLES=gzip${NACL_EXEEXT}
-
-ConfigureStep() {
- EnableGlibcCompat
- EnableCliMain
-
- export gzip_cv_assembler=no
- export gl_cv_header_wchar_h_correct_inline=yes
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- NACLPORTS_CFLAGS+=" -std=gnu89"
- export ac_cv_type_signal=int
- export ac_cv_type_off_t=yes
- elif [[ ${TOOLCHAIN} == emscripten ]]; then
- export ac_cv_func_nanotime=no
- fi
-
- DefaultConfigureStep
-}
diff --git a/ports/gzip/nacl.patch b/ports/gzip/nacl.patch
deleted file mode 100644
index 6113abf..0000000
--- a/ports/gzip/nacl.patch
+++ /dev/null
@@ -1,282 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -27641,7 +27641,6 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wattributes \
- -Wbad-function-cast \
- -Wbuiltin-macro-redefined \
-- -Wcast-align \
- -Wchar-subscripts \
- -Wclobbered \
- -Wcomment \
-@@ -27655,10 +27654,8 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wdouble-promotion \
- -Wempty-body \
- -Wendif-labels \
-- -Wenum-compare \
- -Wextra \
- -Wformat-contains-nul \
-- -Wformat-extra-args \
- -Wformat-nonliteral \
- -Wformat-security \
- -Wformat-y2k \
-@@ -27666,7 +27663,6 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wfree-nonheap-object \
- -Wignored-qualifiers \
- -Wimplicit \
-- -Wimplicit-function-declaration \
- -Wimplicit-int \
- -Winit-self \
- -Winline \
-@@ -27676,14 +27672,10 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wjump-misses-init \
- -Wlogical-op \
- -Wmain \
-- -Wmaybe-uninitialized \
- -Wmissing-braces \
-- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-include-dirs \
- -Wmissing-parameter-type \
-- -Wmissing-prototypes \
-- -Wmudflap \
- -Wmultichar \
- -Wnarrowing \
- -Wnested-externs \
-@@ -27710,10 +27702,6 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wstrict-aliasing \
- -Wstrict-overflow \
- -Wstrict-prototypes \
-- -Wsuggest-attribute=const \
-- -Wsuggest-attribute=format \
-- -Wsuggest-attribute=noreturn \
-- -Wsuggest-attribute=pure \
- -Wswitch \
- -Wswitch-default \
- -Wsync-nand \
-@@ -27724,20 +27712,15 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wuninitialized \
- -Wunknown-pragmas \
- -Wunsafe-loop-optimizations \
-- -Wunused \
- -Wunused-but-set-parameter \
- -Wunused-but-set-variable \
-- -Wunused-function \
- -Wunused-label \
- -Wunused-local-typedefs \
-- -Wunused-macros \
- -Wunused-parameter \
- -Wunused-result \
- -Wunused-value \
-- -Wunused-variable \
- -Wvarargs \
- -Wvariadic-macros \
-- -Wvector-operation-performance \
- -Wvla \
- -Wvolatile-register-var \
- -Wwrite-strings \
-@@ -27903,6 +27886,7 @@ main ()
- ;
- return 0;
- }
-+#if !defined(__NEWLIB_VERSION) || !defined(__arm__)
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_warn_c__Wsuggest_attribute_const=yes
-@@ -27930,6 +27914,7 @@ else
- gl_save_compiler_FLAGS="$CFLAGS"
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsuggest-attribute=noreturn"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+ #endif
- /* end confdefs.h. */
-
- int
-@@ -27939,6 +27924,7 @@ main ()
- ;
- return 0;
- }
-+#if !defined(__NEWLIB_VERSION) || !defined(__arm__)
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- gl_cv_warn_c__Wsuggest_attribute_noreturn=yes
-@@ -27954,7 +27940,7 @@ printf "%s\n" "$gl_cv_warn_c__Wsuggest_attribute_noreturn" >&6; }
- if test "x$gl_cv_warn_c__Wsuggest_attribute_noreturn" = xyes; then :
- as_fn_append WARN_CFLAGS " -Wsuggest-attribute=noreturn"
- fi
--
-+#endif
-
-
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5
-@@ -28028,7 +28014,7 @@ else
- as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wsuggest-attribute=pure"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
--
-+#if !defined(__NEWLIB_VERSION) || !defined(__arm__)
- int
- main ()
- {
-@@ -28051,7 +28037,7 @@ printf "%s\n" "$gl_cv_warn_c__Wsuggest_attribute_pure" >&6; }
- if test "x$gl_cv_warn_c__Wsuggest_attribute_pure" = xyes; then :
- as_fn_append WARN_CFLAGS " -Wsuggest-attribute=pure"
- fi
--
-+#endif
-
- fi
- rm -f conftest.err conftest.i conftest.$ac_ext
-diff --git a/gzip.c b/gzip.c
---- a/gzip.c
-+++ b/gzip.c
-@@ -300,7 +300,9 @@ local int check_ofname (void);
- local void copy_stat (struct stat *ifstat);
- local void install_signal_handlers (void);
- local void remove_output_file (void);
-+#if !defined(__pnacl__)
- local RETSIGTYPE abort_gzip_signal (int);
-+#endif
- local void do_exit (int exitcode) ATTRIBUTE_NORETURN;
- int main (int argc, char **argv);
- static int (*work) (int infile, int outfile) = zip; /* function to call */
-@@ -1577,10 +1579,18 @@ local void do_list(ifd, method)
- struct tm *tm = localtime (&time_stamp.tv_sec);
- printf ("%5s %08lx ", methods[method], crc);
- if (tm)
-+ #ifdef __NEWLIB_VERSION
- printf ("%s%3d %02d:%02d ",
- ("Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec"
- + 4 * tm->tm_mon),
- tm->tm_mday, tm->tm_hour, tm->tm_min);
-+ #else
-+ // non-newlib requires the parenthesis before addition to a pointer
-+ printf ("%s%3d %02d:%02d ",
-+ ("Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec")
-+ + 4 * tm->tm_mon,
-+ tm->tm_mday, tm->tm_hour, tm->tm_min);
-+ #endif
- else
- printf ("??? ?? ??:?? ");
- }
-@@ -1837,8 +1847,9 @@ install_signal_handlers ()
- if (act.sa_handler != SIG_IGN)
- sigaddset (&caught_signals, handled_sig[i]);
- }
--
-+ #if !defined(__pnacl__)
- act.sa_handler = abort_gzip_signal;
-+ #endif
- act.sa_mask = caught_signals;
- act.sa_flags = 0;
-
-@@ -1921,6 +1932,7 @@ abort_gzip ()
- /* ========================================================================
- * Signal handler.
- */
-+#if !defined(__pnacl__)
- static RETSIGTYPE
- abort_gzip_signal (sig)
- int sig;
-@@ -1933,3 +1945,4 @@ abort_gzip_signal (sig)
- signal (sig, SIG_DFL);
- raise (sig);
- }
-+#endif
-diff --git a/lib/chdir-long.c b/lib/chdir-long.c
---- a/lib/chdir-long.c
-+++ b/lib/chdir-long.c
-@@ -59,8 +59,8 @@ cdb_free (struct cd_buf const *cdb)
- {
- if (0 <= cdb->fd)
- {
-- bool close_fail = close (cdb->fd);
-- assert (! close_fail);
-+ if(!close (cdb->fd))
-+ assert (false);
- }
- }
-
-diff --git a/lib/error.c b/lib/error.c
---- a/lib/error.c
-+++ b/lib/error.c
-@@ -172,7 +172,8 @@ print_errno_message (int errnum)
- #if defined HAVE_STRERROR_R || _LIBC
- char errbuf[1024];
- # if STRERROR_R_CHAR_P || _LIBC
-- s = __strerror_r (errnum, errbuf, sizeof errbuf);
-+ __strerror_r (errnum, errbuf, sizeof errbuf);
-+ s = errbuf;
- # else
- if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
- s = errbuf;
-@@ -376,7 +377,7 @@ error_at_line (int status, int errnum, const char *file_name,
- #if _LIBC
- __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ",
- file_name, line_number);
--#else
-+#elif defined __NEWLIB_VERSION
- fprintf (stderr, file_name != NULL ? "%s:%d: " : " ",
- file_name, line_number);
- #endif
-diff --git a/lib/fpending.c b/lib/fpending.c
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -23,8 +23,10 @@
-
- /* Return the number of pending (aka buffered, unflushed)
- bytes on the stream, FP, that is open for writing. */
-+# if !(HAVE_STDIO_EXT_H)
- size_t
- __fpending (FILE *fp)
- {
- return PENDING_OUTPUT_N_BYTES;
- }
-+# endif
-diff --git a/lib/getcwd-lgpl.c b/lib/getcwd-lgpl.c
---- a/lib/getcwd-lgpl.c
-+++ b/lib/getcwd-lgpl.c
-@@ -22,6 +22,9 @@
- #include <errno.h>
- #include <string.h>
-
-+#ifdef __GLIBC__
-+#include <stdlib.h>
-+#endif
- #if GNULIB_GETCWD
- /* Favor GPL getcwd.c if both getcwd and getcwd-lgpl modules are in use. */
- typedef int dummy;
-diff --git a/lib/strerror_r.c b/lib/strerror_r.c
---- a/lib/strerror_r.c
-+++ b/lib/strerror_r.c
-@@ -195,11 +195,16 @@ strerror_r (int errnum, char *buf, size_t buflen)
- ret = strerror_r (errnum, buf, buflen);
- }
- # else
-- ret = strerror_r (errnum, buf, buflen);
-+ strerror_r (errnum, buf, buflen);
-
- /* Some old implementations may return (-1, EINVAL) instead of EINVAL. */
-- if (ret < 0)
-- ret = errno;
-+ if (*buf == '\0')
-+ ret = 0;
-+ // When not in newlib, requires a value for ret (although never used)
-+ #if !defined(__NEWLIB_VERSION)
-+ else
-+ ret = 1;
-+ #endif
- # endif
-
- # ifdef _AIX
-@@ -229,8 +234,9 @@ strerror_r (int errnum, char *buf, size_t buflen)
- char stackbuf[STACKBUF_LEN];
-
- /* STACKBUF_LEN should have been large enough. */
-- if (strerror_r (errnum, stackbuf, sizeof stackbuf) == ERANGE)
-- abort ();
-+ /* copies empty string instead of aborting when string buf is
-+ too small */
-+ strerror_r (errnum, stackbuf, sizeof stackbuf);
- safe_copy (buf, buflen, stackbuf);
- }
- # endif
diff --git a/ports/gzip/pkg_info b/ports/gzip/pkg_info
deleted file mode 100644
index e14d990..0000000
--- a/ports/gzip/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=gzip
-VERSION=1.6
-URL=ftp://ftp.gnu.org/gnu/gzip/gzip-1.6.tar.gz
-LICENSE=GPL
-DEPENDS=(glibc-compat nacl-spawn)
-SHA1=7ec6403090b3eaeb53ef017223cb8034eebc1f49
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/harfbuzz/build.sh b/ports/harfbuzz/build.sh
deleted file mode 100644
index c1f1440..0000000
--- a/ports/harfbuzz/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright 2015 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.
-
-EXECUTABLES="util/hb-shape${NACL_EXEEXT}\
- util/hb-ot-shape-closure${NACL_EXEEXT}"
-EnableCliMain
-
-EXTRA_CONFIGURE_ARGS+=" --with-gobject --without-icu"
diff --git a/ports/harfbuzz/pkg_info b/ports/harfbuzz/pkg_info
deleted file mode 100644
index f416138..0000000
--- a/ports/harfbuzz/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=harfbuzz
-VERSION=0.9.41
-URL=http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.41.tar.bz2
-LICENSE="OLD MIT"
-DEPENDS=(freetype glib)
-SHA1=a77d5d061e91322c1196ab23afeeb8c7e4bf62bb
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/hdf5/H5Tinit.c b/ports/hdf5/H5Tinit.c
deleted file mode 100644
index 3f3a309..0000000
--- a/ports/hdf5/H5Tinit.c
+++ /dev/null
@@ -1,975 +0,0 @@
-/* Generated automatically by H5detect -- do not edit */
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Created: Jan 2, 2014
- *
- * Purpose: This machine-generated source code contains
- * information about the various integer and
- * floating point numeric formats found on this
- * architecture. The parameters below should be
- * checked carefully and errors reported to the
- * HDF5 maintainer.
- *
- * Each of the numeric formats listed below are
- * printed from most significant bit to least
- * significant bit even though the actual bytes
- * might be stored in a different order in
- * memory. The integers above each binary byte
- * indicate the relative order of the bytes in
- * memory; little-endian machines have
- * decreasing numbers while big-endian machines
- * have increasing numbers.
- *
- * The fields of the numbers are printed as
- * letters with `S' for the mantissa sign bit,
- * `M' for the mantissa magnitude, and `E' for
- * the exponent. The exponent has an associated
- * bias which can be subtracted to find the
- * true exponent. The radix point is assumed
- * to be before the first `M' bit. Any bit
- * of a floating-point value not falling into one
- * of these categories is printed as a question
- * mark. Bits of integer types are printed as
- * `I' for 2's complement and `U' for magnitude.
- *
- * If the most significant bit of the normalized
- * mantissa (always a `1' except for `0.0') is
- * not stored then an `implicit=yes' appears
- * under the field description. In thie case,
- * the radix point is still assumed to be
- * before the first `M' but after the implicit
- * bit.
- *
- * Modifications:
- *
- * DO NOT MAKE MODIFICATIONS TO THIS FILE!
- * It was generated by code in `H5detect.c'.
- *
- *-------------------------------------------------------------------------
- */
-
-/****************/
-/* Module Setup */
-/****************/
-
-#define H5T_PACKAGE /*suppress error about including H5Tpkg.h*/
-
-
-/***********/
-/* Headers */
-/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Tpkg.h" /* Datatypes */
-
-
-/****************/
-/* Local Macros */
-/****************/
-
-
-/******************/
-/* Local Typedefs */
-/******************/
-
-
-/********************/
-/* Package Typedefs */
-/********************/
-
-
-/********************/
-/* Local Prototypes */
-/********************/
-
-
-/********************/
-/* Public Variables */
-/********************/
-
-
-/*****************************/
-/* Library Private Variables */
-/*****************************/
-
-
-/*********************/
-/* Package Variables */
-/*********************/
-
-
-
-/*******************/
-/* Local Variables */
-/*******************/
-
-
-
-/*-------------------------------------------------------------------------
- * Function: H5TN_init_interface
- *
- * Purpose: Initialize pre-defined native datatypes from code generated
- * during the library configuration by H5detect.
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Robb Matzke
- * Wednesday, December 16, 1998
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5TN_init_interface(void)
-{
- H5T_t *dt = NULL;
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /*
- * 0
- * IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 1;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 8;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_SCHAR_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_SCHAR_ALIGN_g = 1;
- H5T_NATIVE_SCHAR_COMP_ALIGN_g = 1;
-
- /*
- * 0
- * UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 1;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 8;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UCHAR_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UCHAR_ALIGN_g = 1;
-
- /*
- * 1 0
- * IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 2;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 16;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_SHORT_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_SHORT_ALIGN_g = 1;
- H5T_NATIVE_SHORT_COMP_ALIGN_g = 2;
-
- /*
- * 1 0
- * UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 2;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 16;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_USHORT_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_USHORT_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_ALIGN_g = 1;
- H5T_NATIVE_INT_COMP_ALIGN_g = 4;
-
- /*
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_LONG_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_LONG_ALIGN_g = 1;
- H5T_NATIVE_LONG_COMP_ALIGN_g = 4;
-
- /*
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_ULONG_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_ULONG_ALIGN_g = 1;
-
- /*
- * 0
- * IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 1;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 8;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT8_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT8_ALIGN_g = 1;
-
- /*
- * 0
- * UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 1;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 8;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT8_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT8_ALIGN_g = 1;
-
- /*
- * 0
- * IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 1;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 8;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_LEAST8_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_LEAST8_ALIGN_g = 1;
-
- /*
- * 0
- * UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 1;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 8;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_LEAST8_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_LEAST8_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_FAST8_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_FAST8_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_FAST8_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_FAST8_ALIGN_g = 1;
-
- /*
- * 1 0
- * IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 2;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 16;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT16_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT16_ALIGN_g = 1;
-
- /*
- * 1 0
- * UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 2;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 16;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT16_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT16_ALIGN_g = 1;
-
- /*
- * 1 0
- * IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 2;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 16;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_LEAST16_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_LEAST16_ALIGN_g = 1;
-
- /*
- * 1 0
- * UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 2;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 16;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_LEAST16_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_LEAST16_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_FAST16_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_FAST16_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_FAST16_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_FAST16_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT32_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT32_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT32_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT32_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_LEAST32_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_LEAST32_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_LEAST32_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_LEAST32_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_FAST32_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_FAST32_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_FAST32_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_FAST32_ALIGN_g = 1;
-
- /*
- * 7 6 5 4
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT64_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT64_ALIGN_g = 1;
-
- /*
- * 7 6 5 4
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT64_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT64_ALIGN_g = 1;
-
- /*
- * 7 6 5 4
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_LEAST64_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_LEAST64_ALIGN_g = 1;
-
- /*
- * 7 6 5 4
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_LEAST64_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_LEAST64_ALIGN_g = 1;
-
- /*
- * 7 6 5 4
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_INT_FAST64_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_INT_FAST64_ALIGN_g = 1;
-
- /*
- * 7 6 5 4
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_UINT_FAST64_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_UINT_FAST64_ALIGN_g = 1;
-
- /*
- * 7 6 5 4
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * 3 2 1 0
- * IIIIIIII IIIIIIII IIIIIIII IIIIIIII
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_2;
- if((H5T_NATIVE_LLONG_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_LLONG_ALIGN_g = 1;
- H5T_NATIVE_LLONG_COMP_ALIGN_g = 8;
-
- /*
- * 7 6 5 4
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * 3 2 1 0
- * UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_INTEGER;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.i.sign = H5T_SGN_NONE;
- if((H5T_NATIVE_ULLONG_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_ULLONG_ALIGN_g = 1;
-
- /*
- * 3 2 1 0
- * SEEEEEEE EMMMMMMM MMMMMMMM MMMMMMMM
- * Implicit bit? yes
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_FLOAT;
- dt->shared->size = 4;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 32;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.f.sign = 31;
- dt->shared->u.atomic.u.f.epos = 23;
- dt->shared->u.atomic.u.f.esize = 8;
- dt->shared->u.atomic.u.f.ebias = 0x0000007f;
- dt->shared->u.atomic.u.f.mpos = 0;
- dt->shared->u.atomic.u.f.msize = 23;
- dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED;
- dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO;
- if((H5T_NATIVE_FLOAT_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_FLOAT_ALIGN_g = 1;
- H5T_NATIVE_FLOAT_COMP_ALIGN_g = 4;
-
- /*
- * 7 6 5 4
- * SEEEEEEE EEEEMMMM MMMMMMMM MMMMMMMM
- * 3 2 1 0
- * MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM
- * Implicit bit? yes
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_FLOAT;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.f.sign = 63;
- dt->shared->u.atomic.u.f.epos = 52;
- dt->shared->u.atomic.u.f.esize = 11;
- dt->shared->u.atomic.u.f.ebias = 0x000003ff;
- dt->shared->u.atomic.u.f.mpos = 0;
- dt->shared->u.atomic.u.f.msize = 52;
- dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED;
- dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO;
- if((H5T_NATIVE_DOUBLE_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_DOUBLE_ALIGN_g = 1;
- H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 8;
-
- /*
- * 7 6 5 4
- * SEEEEEEE EEEEMMMM MMMMMMMM MMMMMMMM
- * 3 2 1 0
- * MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM
- * Implicit bit? yes
- * Alignment: none
- */
- if(NULL == (dt = H5T__alloc()))
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed")
- dt->shared->state = H5T_STATE_IMMUTABLE;
- dt->shared->type = H5T_FLOAT;
- dt->shared->size = 8;
- dt->shared->u.atomic.order = H5T_ORDER_LE;
- dt->shared->u.atomic.offset = 0;
- dt->shared->u.atomic.prec = 64;
- dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;
- dt->shared->u.atomic.u.f.sign = 63;
- dt->shared->u.atomic.u.f.epos = 52;
- dt->shared->u.atomic.u.f.esize = 11;
- dt->shared->u.atomic.u.f.ebias = 0x000003ff;
- dt->shared->u.atomic.u.f.mpos = 0;
- dt->shared->u.atomic.u.f.msize = 52;
- dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED;
- dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO;
- if((H5T_NATIVE_LDOUBLE_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype")
- H5T_NATIVE_LDOUBLE_ALIGN_g = 1;
- H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 8;
-
- /* Set the native order for this machine */
- H5T_native_order_g = H5T_ORDER_LE;
-
- /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
- H5T_POINTER_COMP_ALIGN_g = 4;
- H5T_HVL_COMP_ALIGN_g = 4;
- H5T_HOBJREF_COMP_ALIGN_g = 8;
- H5T_HDSETREGREF_COMP_ALIGN_g = 1;
-
-done:
- if(ret_value < 0) {
- if(dt != NULL) {
- dt->shared = H5FL_FREE(H5T_shared_t, dt->shared);
- dt = H5FL_FREE(H5T_t, dt);
- } /* end if */
- } /* end if */
-
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5TN_init_interface() */
-
-/****************************************/
-/* ALIGNMENT and signal-handling status */
-/****************************************/
-/* Signal() support: yes */
-/* setjmp() support: no */
-/* longjmp() support: yes */
-/* sigsetjmp() support: no */
-/* siglongjmp() support: no */
-/* sigprocmask() support: yes */
-
-/******************************/
-/* signal handlers statistics */
-/******************************/
-/* signal_handlers tested: 10 times */
-/* sigbus_handler called: 0 times */
-/* sigsegv_handler called: 0 times */
diff --git a/ports/hdf5/H5lib_settings.c b/ports/hdf5/H5lib_settings.c
deleted file mode 100644
index cf450df..0000000
--- a/ports/hdf5/H5lib_settings.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Generated automatically by H5make_libsettings -- do not edit */
-
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Created: Jan 2, 2014
- *
- * Purpose: This machine-generated source code contains
- * information about the library build configuration
- *
- * Modifications:
- *
- * DO NOT MAKE MODIFICATIONS TO THIS FILE!
- * It was generated by code in `H5make_libsettings.c'.
- *
- *-------------------------------------------------------------------------
- */
-
-char H5libhdf5_settings[]=
- " SUMMARY OF THE HDF5 CONFIGURATION\n"
- " =================================\n"
- "\n"
- "General Information:\n"
- "-------------------\n"
- " HDF5 Version: 1.8.12\n"
- " Configured by: Native Client Build Process\n"
- " Byte sex: little-endian\n"
- " Libraries: static\n"
- "\n"
- "Compiling Options:\n"
- "------------------\n"
- " Compilation Mode: production\n"
- "\n"
- "Languages:\n"
- "----------\n"
- " Fortran: no\n"
- "\n"
- " C++: no\n"
- "\n"
- "Features:\n"
- "---------\n"
- " Parallel HDF5: no\n"
- " High Level library: yes\n"
- " Threadsafety: no\n"
- " Default API Mapping: v18\n"
- " With Deprecated Public Symbols: yes\n"
- " I/O filters (external): \n"
- " I/O filters (internal): shuffle,fletcher32,nbit,scaleoffset\n"
- " MPE: no\n"
- " Direct VFD: no\n"
- " dmalloc: no\n"
- "Clear file buffers before write: yes\n"
- " Using memory checker: no\n"
- " Function Stack Tracing: no\n"
- " GPFS: no\n"
- " Strict File Format Checks: no\n"
- " Optimization Instrumentation: no\n"
- " Large File Support (LFS): no\n"
-;
-
diff --git a/ports/hdf5/README.nacl b/ports/hdf5/README.nacl
deleted file mode 100644
index b631d32..0000000
--- a/ports/hdf5/README.nacl
+++ /dev/null
@@ -1,12 +0,0 @@
-HDF5 relies on a number of POSIX commands and conventions that are not
-necessarily supported in Native Client (as of pepper_34). The changes made
-here include a pre-generated H5Tinit.c, run inside sel_ldr on x86_64, that
-creates the "native" datatypes, and a H5lib_settings.c also run inside sel_ldr.
-The options in config.site were computed by manually extracting the test
-programs from configure.ac and executing them inside sel_ldr, where some
-surprising results for number rounding were found.
-
-The only file driver known to work in sec2, which may behave strangely
-depending on the file system being used. Note that support for truncate is
-required, and a hack for computing inodes of files for internal reference
-counts (to prevent collision) has been implemented.
diff --git a/ports/hdf5/build.sh b/ports/hdf5/build.sh
deleted file mode 100644
index b55a1be..0000000
--- a/ports/hdf5/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2011 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.
-
-ConfigureStep() {
- EnableGlibcCompat
- export CROSS_COMPILE=true
- export CONFIG_SITE=${START_DIR}/config.site
- EXTRA_CONFIGURE_ARGS="--disable-shared --disable-linux-lfs --disable-largefile"
- EXTRA_CONFIGURE_ARGS+=" --disable-largefile"
- DefaultConfigureStep
- LogExecute cp ${START_DIR}/H5lib_settings.c ${SRC_DIR}/src/
- LogExecute cp ${START_DIR}/H5Tinit.c ${SRC_DIR}/src/
-}
diff --git a/ports/hdf5/config.site b/ports/hdf5/config.site
deleted file mode 100644
index 11f80a2..0000000
--- a/ports/hdf5/config.site
+++ /dev/null
@@ -1,20 +0,0 @@
-cross_compiling=yes
-enable_linux_lfs=no
-enable_largefile=no
-ac_cv_func_symlink=no
-hdf5_cv_gettimeofday_tz=yes
-hdf5_cv_vsnprintf_works=yes
-hdf5_cv_printf_ll=q
-hdf5_cv_system_scope_threads=yes
-hdf5_cv_direct_io=no
-hdf5_cv_ldouble_to_integer_works=yes
-hdf5_cv_ulong_to_float_accurate=yes
-hdf5_cv_fp_to_ullong_accurate=yes
-hdf5_cv_fp_to_ullong_right_maximum=no
-hdf5_cv_ldouble_to_uint_accurate=yes
-hdf5_cv_ullong_to_ldouble_precision=no
-hdf5_cv_fp_to_integer_overflow_works=yes
-hdf5_cv_ldouble_to_long_special=no
-hdf5_cv_long_to_ldouble_special=no
-hdf5_cv_ldouble_to_llong_accurate=yes
-hdf5_cv_llong_to_ldouble_correct=yes
diff --git a/ports/hdf5/libhdf5.settings b/ports/hdf5/libhdf5.settings
deleted file mode 100644
index 52a4493..0000000
--- a/ports/hdf5/libhdf5.settings
+++ /dev/null
@@ -1 +0,0 @@
-char H5libhdf5_settings[]="NaCl build: no settings available.";
diff --git a/ports/hdf5/nacl.patch b/ports/hdf5/nacl.patch
deleted file mode 100644
index 4b5fbd1..0000000
--- a/ports/hdf5/nacl.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
---- a/src/H5FDsec2.c
-+++ b/src/H5FDsec2.c
-@@ -379,6 +379,20 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
- /* Retain a copy of the name used to open the file, for possible error reporting */
- HDstrncpy(file->filename, name, sizeof(file->filename));
- file->filename[sizeof(file->filename) - 1] = '\0';
-+#if defined(__native_client__)
-+ /* Native Client currently does not provide accurate or unique inodes.
-+ * However, it also does not currently support symlinks. So each filename
-+ * should be unique (via djb2 hash), and we can use that for our inode. */
-+ unsigned long hash = 5381;
-+ unsigned char* str = &file->filename[0];
-+ int c = *str;
-+
-+ while ((c = *(str++))) {
-+ hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
-+ }
-+
-+ file->inode = hash;
-+#endif
-
- /* Check for non-default FAPL */
- if(H5P_FILE_ACCESS_DEFAULT != fapl_id) {
-diff --git a/src/H5PL.c b/src/H5PL.c
---- a/src/H5PL.c
-+++ b/src/H5PL.c
-@@ -28,6 +28,31 @@
- #include "H5PLprivate.h" /* Plugin */
- #include "H5Zprivate.h" /* Filter pipeline */
-
-+#if defined(__native_client__) && !defined(RTLD_NOW)
-+#define RTLD_NOW -1
-+void *dlopen(const char *filename, int flag) __attribute__((weak));
-+int dlclose(void *handle) __attribute__((weak));
-+char *dlerror(void) __attribute__((weak));
-+void *dlsym(void* handle, const char *symbol) __attribute__((weak));
-+
-+void *dlopen(const char *filename, int flag) {
-+ /* We cannot ever open dynamic libraries in newlib */
-+ return NULL;
-+}
-+
-+int dlclose(void *handle) {
-+ return 0;
-+}
-+
-+char *dlerror(void) {
-+ return "Cannot use dynamic libraries.";
-+}
-+
-+void *dlsym(void* handle, const char *symbol) {
-+ return NULL;
-+}
-+#endif
-+
- #ifndef H5_VMS
-
- /****************/
-diff --git a/src/H5private.h b/src/H5private.h
---- a/src/H5private.h
-+++ b/src/H5private.h
-@@ -69,7 +69,7 @@
- # include <sys/types.h>
- # include <unistd.h>
- #endif
--#ifdef _POSIX_VERSION
-+#if defined _POSIX_VERSION || defined (__native_client__)
- # include <sys/wait.h>
- # include <pwd.h>
- #endif
-@@ -759,6 +759,10 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
- * For Unix, if off_t is not 64bit big, try use the pseudo-standard
- * xxx64 versions if available.
- */
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+// Newlib doesn't define lstat.
-+#define lstat stat
-+#endif
- #if !defined(HDfstat) || !defined(HDstat) || !defined(HDlstat)
- #if H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64)
- #ifndef HDfstat
-@@ -1069,7 +1073,11 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
- #define HDrealloc(M,Z) realloc(M,Z)
- #endif /* HDrealloc */
- #ifndef HDrealpath
-+#ifdef __native_client__
-+#define HDrealpath(rel, abs) strncpy((abs), (rel), PATH_MAX)
-+#else
- #define HDrealpath(F1,F2) realpath(F1,F2)
-+#endif
- #endif /* HDrealloc */
- #ifdef H5_VMS
- #ifdef __cplusplus
-diff --git a/src/Makefile.am b/src/Makefile.am
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -26,7 +26,7 @@ include $(top_srcdir)/config/lt_vers.am
- # Use -g to force no optimization since many compilers (e.g., Intel) takes
- # a long time to compile it with any optimization on. H5detect is used
- # to generate H5Tinit.c once. So, optimization is not critical.
--noinst_PROGRAMS = H5detect H5make_libsettings
-+noinst_PROGRAMS =
-
- # Our main target, the HDF5 library
- lib_LTLIBRARIES=libhdf5.la
-@@ -35,7 +35,7 @@ lib_LTLIBRARIES=libhdf5.la
- libhdf5_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS)
-
- # H5Tinit.c and H5lib_settings.c are generated files and should be cleaned.
--MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.c
-+MOSTLYCLEANFILES=
- # H5pubconf.h is generated by configure, and should be cleaned.
- DISTCLEANFILES=H5pubconf.h
-
-@@ -126,24 +126,12 @@ settings_DATA=libhdf5.settings
- # Things should have been all set during H5detect making.
- # Remove the generated .c file if errors occur unless HDF5_Make_Ignore
- # is set to ignore the error.
--H5Tinit.c: H5detect$(EXEEXT)
-- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
-- sed -e 's/-L/:/g' -e 's/ //g'`" \
-- $(RUNSERIAL) ./H5detect$(EXEEXT) > $@ || \
-- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
-- ($(RM) $@ ; exit 1)
-
- # Build configuration header file generation
- # The LD_LIBRARY_PATH setting is a kludge.
- # Things should have been all set during H5make_libsettings making.
- # Remove the generated .c file if errors occur unless HDF5_Make_Ignore
- # is set to ignore the error.
--H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings
-- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
-- sed -e 's/-L/:/g' -e 's/ //g'`" \
-- $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > $@ || \
-- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
-- ($(RM) $@ ; exit 1)
-
- # Error header generation
- #
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -77,7 +77,7 @@ DIST_COMMON = $(include_HEADERS) $(srcdir)/H5config.h.in \
- $(top_srcdir)/config/commence.am \
- $(top_srcdir)/config/conclude.am \
- $(top_srcdir)/config/lt_vers.am COPYING
--noinst_PROGRAMS = H5detect$(EXEEXT) H5make_libsettings$(EXEEXT)
-+noinst_PROGRAMS =
- TESTS =
- subdir = src
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-@@ -524,7 +524,7 @@ lib_LTLIBRARIES = libhdf5.la
- libhdf5_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS)
-
- # H5Tinit.c and H5lib_settings.c are generated files and should be cleaned.
--MOSTLYCLEANFILES = H5Tinit.c H5lib_settings.c
-+MOSTLYCLEANFILES =
- # H5pubconf.h is generated by configure, and should be cleaned.
- DISTCLEANFILES = H5pubconf.h
-
-@@ -728,12 +728,6 @@ clean-noinstPROGRAMS:
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
--H5detect$(EXEEXT): $(H5detect_OBJECTS) $(H5detect_DEPENDENCIES) $(EXTRA_H5detect_DEPENDENCIES)
-- @rm -f H5detect$(EXEEXT)
-- $(AM_V_CCLD)$(LINK) $(H5detect_OBJECTS) $(H5detect_LDADD) $(LIBS)
--H5make_libsettings$(EXEEXT): $(H5make_libsettings_OBJECTS) $(H5make_libsettings_DEPENDENCIES) $(EXTRA_H5make_libsettings_DEPENDENCIES)
-- @rm -f H5make_libsettings$(EXEEXT)
-- $(AM_V_CCLD)$(LINK) $(H5make_libsettings_OBJECTS) $(H5make_libsettings_LDADD) $(LIBS)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-@@ -1312,24 +1306,12 @@ help:
- # Things should have been all set during H5detect making.
- # Remove the generated .c file if errors occur unless HDF5_Make_Ignore
- # is set to ignore the error.
--H5Tinit.c: H5detect$(EXEEXT)
-- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
-- sed -e 's/-L/:/g' -e 's/ //g'`" \
-- $(RUNSERIAL) ./H5detect$(EXEEXT) > $@ || \
-- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
-- ($(RM) $@ ; exit 1)
-
- # Build configuration header file generation
- # The LD_LIBRARY_PATH setting is a kludge.
- # Things should have been all set during H5make_libsettings making.
- # Remove the generated .c file if errors occur unless HDF5_Make_Ignore
- # is set to ignore the error.
--H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings
-- LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
-- sed -e 's/-L/:/g' -e 's/ //g'`" \
-- $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > $@ || \
-- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
-- ($(RM) $@ ; exit 1)
-
- # Error header generation
- #
diff --git a/ports/hdf5/pkg_info b/ports/hdf5/pkg_info
deleted file mode 100644
index aa7a89f..0000000
--- a/ports/hdf5/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=hdf5
-VERSION=1.8.12
-URL=http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.12.tar.gz
-LICENSE=CUSTOM:COPYING
-# x86_64-nacl-clang crashes:
-# https://code.google.com/p/nativeclient/issues/detail?id=4124
-DISABLED_TOOLCHAIN=(emscripten)
-DEPENDS=(glibc-compat)
-SHA1=965d954d596cfa694f3260856a6406ea69e46e68
diff --git a/ports/hello/build.sh b/ports/hello/build.sh
deleted file mode 100644
index 1c38273..0000000
--- a/ports/hello/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2015 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.
-
-EXECUTABLES=hello${NACL_EXEEXT}
-
-TestStep() {
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- return
- fi
- LogExecute ./hello
-}
diff --git a/ports/hello/pkg_info b/ports/hello/pkg_info
deleted file mode 100644
index 14dbe47..0000000
--- a/ports/hello/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=hello
-VERSION=2.10
-URL=http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
-LICENSE=GPL3
-SHA1=f7bebf6f9c62a2295e889f66e05ce9bfaed9ace3
diff --git a/ports/icu/build.sh b/ports/icu/build.sh
deleted file mode 100644
index 0624aff..0000000
--- a/ports/icu/build.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES=bin/makeconv
-NACL_CONFIGURE_PATH=${SRC_DIR}/source/configure
-
-# Disable packaging of data files. This doesn't seem to be well
-# supported when cross compiling.
-EXTRA_CONFIGURE_ARGS+=" --disable-extras"
-EXTRA_CONFIGURE_ARGS+=" --with-data-packaging=archive"
-
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CONFIGURE_ARGS+=" --disable-shared --enable-static --disable-dyload"
-fi
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- # The newlib headers don't define tzset when --std=c++0x, only with
- # gnu++0x. This prevents ICU from using its default of c++0x.
- NACLPORTS_CXXFLAGS+=" -std=gnu++0x"
-fi
-
-if [ "${TOOLCHAIN}" = "pnacl" ]; then
- # Samples don't link with the PNaCl toolchain becuase they try to
- # link agaist the non-stub version of libicudata.a, which we can't
- # use because its a native library produced by the pkgdata utility
- # which is not fully setup for cross compiling :(
- EXTRA_CONFIGURE_ARGS+=" --disable-samples"
-else
- EXECUTABLES+=" samples/date/icudate"
-fi
-
-BuildHostICU() {
- Banner "Configuring host version of ${NAME}"
- if [ "${NACL_ARCH}" = "x86_64" ]; then
- HOST_BUILD_DIR=${WORK_DIR}/build_host_64
- export CPPFLAGS=-m64
- export LDFLAGS=-m64
- else
- HOST_BUILD_DIR=${WORK_DIR}/build_host_32
- export CPPFLAGS=-m32
- export LDFLAGS=-m32
- fi
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- LogExecute ${NACL_CONFIGURE_PATH}
- Banner "Building host version of ${NAME}"
- LogExecute make
-}
-
-ConfigureStep() {
- BuildHostICU
- Banner "Configuring cross build of ${NAME}"
- NACL_ARFLAGS=
- EXTRA_CONFIGURE_ARGS+=" --with-cross-build=${HOST_BUILD_DIR}"
- ChangeDir ${BUILD_DIR}
- DefaultConfigureStep
-}
diff --git a/ports/icu/nacl.patch b/ports/icu/nacl.patch
deleted file mode 100644
index 91b96c6..0000000
--- a/ports/icu/nacl.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/source/configure b/source/configure
---- a/source/configure
-+++ b/source/configure
-@@ -4938,6 +4938,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- *-apple-darwin*) icu_cv_host_frag=mh-darwin ;;
- *-*-beos) icu_cv_host_frag=mh-beos ;;
- *-*-haiku) icu_cv_host_frag=mh-haiku ;;
-+*-*-nacl) icu_cv_host_frag=mh-linux ;;
- *-*-irix*) icu_cv_host_frag=mh-irix ;;
- *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;;
- *-*-nto*) icu_cv_host_frag=mh-qnx ;;
-@@ -7406,6 +7407,7 @@ ICUDATA_CHAR=$U_ENDIAN_CHAR
- case "${host}" in
- *-*-solaris*) platform=U_SOLARIS ;;
- *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) platform=U_LINUX ;;
-+ *-*-nacl) platform=U_NACL ;;
- *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;;
- *-*-aix*) platform=U_AIX ;;
- *-*-hpux*) platform=U_HPUX ;;
-diff --git a/source/tools/gendict/gendict.cpp b/source/tools/gendict/gendict.cpp
---- a/source/tools/gendict/gendict.cpp
-+++ b/source/tools/gendict/gendict.cpp
-@@ -43,7 +43,7 @@ static int elapsedTime() {
- return (int)uprv_floor((uprv_getRawUTCtime()-startTime)/1000.0);
- }
-
--#if U_PLATFORM_IMPLEMENTS_POSIX && !U_PLATFORM_HAS_WIN32_API
-+#if U_PLATFORM_IMPLEMENTS_POSIX && !U_PLATFORM_HAS_WIN32_API && !defined __native_client__
-
- #include <signal.h>
- #include <unistd.h>
-diff --git a/source/tools/toolutil/pkg_genc.c b/source/tools/toolutil/pkg_genc.c
---- a/source/tools/toolutil/pkg_genc.c
-+++ b/source/tools/toolutil/pkg_genc.c
-@@ -672,9 +672,14 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
- /* set defaults */
- #ifdef U_ELF
- /* set EM_386 because elf.h does not provide better defaults */
-+#if defined(__x86_64__)
-+ *pCPU=EM_X86_64;
-+#else
- *pCPU=EM_386;
-- *pBits=32;
-- *pIsBigEndian=(UBool)(U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB);
-+#endif
-+ *pBits= *pCPU==EM_386 ? 32 : 64;
-+ *pIsBigEndian=(UBool)(U_IS_BIG_ENDIAN ? TRUE : FALSE);
-+ printf("U_IS_BIG_ENDIAN : %d\n", U_IS_BIG_ENDIAN);
- #elif U_PLATFORM_HAS_WIN32_API
- /* _M_IA64 should be defined in windows.h */
- # if defined(_M_IA64)
-@@ -1022,7 +1027,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
-
- /* deal with options, files and the entry point name */
- getArchitecture(&cpu, &bits, &makeBigEndian, optMatchArch);
-- printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%d\n", cpu, bits, makeBigEndian);
-+ printf("genccode: --match-arch=%s cpu=%hu bits=%hu big-endian=%d\n", optMatchArch, cpu, bits, makeBigEndian);
- #if U_PLATFORM_HAS_WIN32_API
- if(cpu==IMAGE_FILE_MACHINE_I386) {
- entryOffset=1;
diff --git a/ports/icu/pkg_info b/ports/icu/pkg_info
deleted file mode 100644
index 3a6e13b..0000000
--- a/ports/icu/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=icu
-VERSION=53.1
-ARCHIVE_ROOT=icu
-URL=http://download.icu-project.org/files/icu4c/53.1/icu4c-53_1-src.tgz
-SHA1=7eca017fdd101e676d425caaf28ef862d3655e0f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/id3lib/build.sh b/ports/id3lib/build.sh
deleted file mode 100644
index 907a48c..0000000
--- a/ports/id3lib/build.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015 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.
-
-EXECUTABLES="
-examples/id3tag
-examples/id3cp
-examples/id3info
-examples/id3convert
-"
diff --git a/ports/id3lib/nacl.patch b/ports/id3lib/nacl.patch
deleted file mode 100644
index dec7cd4..0000000
--- a/ports/id3lib/nacl.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -10173,7 +10185,7 @@ done
-
-
-
--for ac_header in fstream iostream iomanip vector \
-+for ac_header in fstream iostream vector \
-
- do
- as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-@@ -10296,7 +10308,6 @@ done
-
- for ac_header in \
- string \
-- iomanip.h \
-
- do
- as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-diff --git a/examples/demo_convert.cpp b/examples/demo_convert.cpp
---- a/examples/demo_convert.cpp
-+++ b/examples/demo_convert.cpp
-@@ -84,7 +84,7 @@ void DisplayTags(ostream &os, luint nTags)
- }
- }
-
--int main( unsigned int argc, char * const argv[])
-+int main( int argc, char * const argv[])
- {
- flags_t ulFlag = ID3TT_ALL;
- gengetopt_args_info args;
-diff --git a/examples/demo_copy.cpp b/examples/demo_copy.cpp
---- a/examples/demo_copy.cpp
-+++ b/examples/demo_copy.cpp
-@@ -81,7 +81,7 @@ void DisplayTags(ostream &os, luint nTags)
- }
- }
-
--int main( unsigned int argc, char * const argv[])
-+int main( int argc, char * const argv[])
- {
- int ulFlag = ID3TT_ID3;
- ID3D_INIT_DOUT();
-diff --git a/examples/demo_info.cpp b/examples/demo_info.cpp
---- a/examples/demo_info.cpp
-+++ b/examples/demo_info.cpp
-@@ -309,7 +309,7 @@ void PrintInformation(const ID3_Tag &myTag)
-
- #define DEBUG
-
--int main( unsigned int argc, char * const argv[])
-+int main( int argc, char * const argv[])
- {
- ID3D_INIT_DOUT();
-
-diff --git a/examples/demo_tag.cpp b/examples/demo_tag.cpp
---- a/examples/demo_tag.cpp
-+++ b/examples/demo_tag.cpp
-@@ -46,7 +46,7 @@ void DisplayTags(ostream &os, luint nTags)
- os << "v2";
- }
-
--int main( unsigned int argc, char * const argv[])
-+int main( int argc, char * const argv[])
- {
- int ulFlag = ID3TT_ID3;
- ID3D_INIT_DOUT();
-diff --git a/examples/findeng.cpp b/examples/findeng.cpp
---- a/examples/findeng.cpp
-+++ b/examples/findeng.cpp
-@@ -9,7 +9,7 @@
- using std::cout;
- using std::endl;
-
--int main(unsigned argc, char* argv[])
-+int main(int argc, char* argv[])
- {
- ID3D_INIT_DOUT();
- ID3D_INIT_WARNING();
-diff --git a/examples/findstr.cpp b/examples/findstr.cpp
---- a/examples/findstr.cpp
-+++ b/examples/findstr.cpp
-@@ -9,7 +9,7 @@
- using std::cout;
- using std::endl;
-
--int main(unsigned argc, char* argv[])
-+int main(int argc, char* argv[])
- {
- ID3D_INIT_DOUT();
- ID3D_INIT_WARNING();
-diff --git a/include/id3/id3lib_strings.h b/include/id3/id3lib_strings.h
---- a/include/id3/id3lib_strings.h
-+++ b/include/id3/id3lib_strings.h
-@@ -30,6 +30,7 @@
- #define _ID3LIB_STRINGS_H_
-
- #include <string>
-+#include <cstring>
-
- #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
- namespace std
-diff --git a/include/id3/writers.h b/include/id3/writers.h
---- a/include/id3/writers.h
-+++ b/include/id3/writers.h
-@@ -30,7 +30,7 @@
-
- #include "id3/writer.h"
- #include "id3/id3lib_streams.h"
--//#include <string.h>
-+#include <cstring>
-
- class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer
- {
diff --git a/ports/id3lib/pkg_info b/ports/id3lib/pkg_info
deleted file mode 100644
index bc83047..0000000
--- a/ports/id3lib/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=id3lib
-VERSION=3.8.3
-URL=http://downloads.sf.net/id3lib/3.8.3/id3lib-3.8.3.tar.gz
-LICENSE=GPL
-SHA1=c92c880da41d1ec0b242745a901702ae87970838
diff --git a/ports/imagemagick/build.sh b/ports/imagemagick/build.sh
deleted file mode 100644
index 6533d7c..0000000
--- a/ports/imagemagick/build.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright (c) 2011 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.
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- # TODO(sbc): remove once this is fixed:
- # https://code.google.com/p/nativeclient/issues/detail?id=3790
- NACLPORTS_CPPFLAGS+=" -DSSIZE_MAX=LONG_MAX"
- EXE_DIR=""
-else
- EXE_DIR=".libs/"
-fi
-
-EXTRA_CONFIGURE_ARGS="
---disable-largefile
---without-fftw
---without-xml
---without-fontconfig
---without-pango"
-
-EXECUTABLES="
- utilities/animate${NACL_EXEEXT}
- utilities/compare${NACL_EXEEXT}
- utilities/composite${NACL_EXEEXT}
- utilities/conjure${NACL_EXEEXT}
- utilities/convert${NACL_EXEEXT}
- utilities/display${NACL_EXEEXT}
- utilities/identify${NACL_EXEEXT}
- utilities/import${NACL_EXEEXT}
- utilities/mogrify${NACL_EXEEXT}
- utilities/montage${NACL_EXEEXT}
- utilities/stream${NACL_EXEEXT}"
-
-TEST_EXECUTABLES="
- tests/${EXE_DIR}wandtest${NACL_EXEEXT}
- tests/${EXE_DIR}drawtest${NACL_EXEEXT}
- tests/${EXE_DIR}validate${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/flip${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/detrans${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/shapes${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/gravity${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/button${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/zoom${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/piddle${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/demo${NACL_EXEEXT}
- Magick++/${EXE_DIR}demo/analyze${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/attributes${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/exceptions${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/readWriteImages${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/coalesceImages${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/color${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/readWriteBlob${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/averageImages${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/morphImages${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/montageImages${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/coderInfo${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/appendImages${NACL_EXEEXT}
- Magick++/${EXE_DIR}tests/colorHistogram${NACL_EXEEXT}"
-
-ConfigureStep() {
- # TODO: Remove when this is fixed.
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- if [ "$NACL_ARCH" = "arm" ]; then
- NACLPORTS_CFLAGS="${NACLPORTS_CFLAGS/-O2/-O1}"
- fi
- DefaultConfigureStep
-}
-
-TestStep() {
- # The tests as (a) very slow and (b) not all passing at this point.
- return 0
-
- # As part of 'make check' there will be several test executables built.
- # We need to create the script that launch them ahead of time.
- for EXE in ${TEST_EXECUTABLES}; do
- WriteLauncherScript ${EXE%%${NACL_EXEEXT}} $(basename ${EXE})
- done
- LogExecute make check
-}
diff --git a/ports/imagemagick/pkg_info b/ports/imagemagick/pkg_info
deleted file mode 100644
index 22de3cd..0000000
--- a/ports/imagemagick/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=imagemagick
-VERSION=6.9.0-2
-ARCHIVE_ROOT=ImageMagick-6.9.0-2
-URL=http://www.imagemagick.org/download/ImageMagick-6.9.0-2.tar.bz2
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(libpng jpeg8d bzip2 zlib)
-SHA1=4a2bc1c64f081ef6e5c1f44b97bdd6a0c526258b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/inputproto/pkg_info b/ports/inputproto/pkg_info
deleted file mode 100644
index f380a18..0000000
--- a/ports/inputproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=inputproto
-VERSION=2.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/inputproto-2.2.tar.bz2
-LICENSE=GPL
-SHA1=500e0a6dac3523887c0b82753fe5e9d4bb982137
diff --git a/ports/ipython-ppapi/Makefile b/ports/ipython-ppapi/Makefile
deleted file mode 100644
index 41b5859..0000000
--- a/ports/ipython-ppapi/Makefile
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-include $(NACL_SDK_ROOT)/tools/common.mk
-
-TARGET = kernel
-LIBS = freetype bz2 ssl crypto z png readline ncurses
-ifeq ($(TOOLCHAIN),glibc)
-LIBS += util dl
-NACL_LDFLAGS += -Wl,-export-dynamic
-else
-LIBS += glibc-compat
-endif
-SOURCES = kernel.cc
-INC_PATHS = $(NACLPORTS_INCLUDE)/python2.7
-INSTALL_DIR = $(NACL_PACKAGES_PUBLISH)/ipython/$(TOOLCHAIN)
-
-ifeq ($(TOOLCHAIN),pnacl)
-EXEEXT=.pexe
-else
-EXEEXT=.nexe
-endif
-
-ifneq ($(TOOLCHAIN),pnacl)
-# We want the nmf to contain all the .nexe we have previously
-# built as well as the one currently being built, so we modify
-# the list of executables that we pass to create_nmf.
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_64$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_32$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_arm$(EXEEXT))
-endif
-
-# Build rules generated by macros from common.mk:
-
-$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
-
-ifeq ($(CONFIG),Release)
-$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
-$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
-else
-$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
-endif
-
-$(eval $(call NMF_RULE,$(TARGET),))
-
-ifeq ($(TOOLCHAIN),glibc)
-EXTRA_ASSETS = lib/libz.so.1 lib/libreadline.so lib/libncurses.so.5
-endif
-
-install:
- mkdir -p $(INSTALL_DIR)
- tar -h -c -C ${NACL_PREFIX} -f $(INSTALL_DIR)/pydata_$(NACL_ARCH).tar lib/python2.7 ${EXTRA_ASSETS}
- cp $(OUTDIR)/$(TARGET)*$(EXEEXT) $(INSTALL_DIR)
- rm -f $(INSTALL_DIR)/*_unstripped*$(EXEEXT)
- cp $(OUTDIR)/$(TARGET).nmf $(INSTALL_DIR)
- cp kernel.py $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),glibc)
- cp -r $(OUTDIR)/lib* $(INSTALL_DIR)
-endif
diff --git a/ports/ipython-ppapi/README.nacl b/ports/ipython-ppapi/README.nacl
deleted file mode 100644
index 550f1b7..0000000
--- a/ports/ipython-ppapi/README.nacl
+++ /dev/null
@@ -1,13 +0,0 @@
-IPython Kernel for Native Client
-===============================
-
-This package runs an IPython kernel inside Native Client.
-It creates a Native Client binary, and support files that
-must be available to the binary via HTTP. Running this
-Native Client binary inside Chrome, runs an IPython kernel.
-
-Communication with the kernel is done by Pepper messaging,
-not by ZeroMQ. This is accomplished by making modifications
-to the IPython Kernel. Users call postMessage from JavaScript,
-and listening for the replies. Messages follow essentially the
-same pattern as the IPython messaging system.
\ No newline at end of file
diff --git a/ports/ipython-ppapi/build.sh b/ports/ipython-ppapi/build.sh
deleted file mode 100644
index a582471..0000000
--- a/ports/ipython-ppapi/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2014 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.
-
-NACLPORTS_LIBS="-lpython2.7"
-EnableCliMainCxx
-SetupSDKBuildSystem
diff --git a/ports/ipython-ppapi/kernel.cc b/ports/ipython-ppapi/kernel.cc
deleted file mode 100644
index e4d9485..0000000
--- a/ports/ipython-ppapi/kernel.cc
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Copyright (c) 2014 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. */
-
-#include <python2.7/Python.h>
-#include <libtar.h>
-#include <locale.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/mount.h>
-#include <errno.h>
-
-#include <ppapi/cpp/var.h>
-#include <ppapi/cpp/var_array.h>
-#include <ppapi/cpp/var_dictionary.h>
-#include <ppapi_simple/ps_interface.h>
-
-#include <nacl_io/nacl_io.h>
-#include <ppapi_simple/ps_instance.h>
-#include <ppapi_simple/ps_main.h>
-
-#ifdef __pnacl__
-#define DATA_FILE "pydata_pnacl.tar"
-#else
-#error "Unknown arch"
-#endif
-
-/* TODO(bradnelson): Switch ipython to use cli_main and drop this. */
-
-static int setup_unix_environment() {
- int ret = umount("/");
- if (ret) {
- printf("unmounting root fs failed\n");
- return 1;
- }
-
- ret = mount("", "/", "memfs", 0, NULL);
- if (ret) {
- printf("mounting root fs failed\n");
- return 1;
- }
-
- const char* data_url = getenv("NACL_DATA_URL");
- if (!data_url)
- data_url = "./";
- mkdir("/mnt/http", 0777);
- ret = mount(data_url, "/mnt/http", "httpfs", 0, "allow_cross_origin_requests:true allow_credentials:false");
- if (ret) {
- printf("mounting http filesystem failed\n");
- return 1;
- }
-
- char filename[PATH_MAX];
- strcpy(filename, "/mnt/http/");
- strcat(filename, DATA_FILE);
- TAR* tar;
- ret = tar_open(&tar, filename, NULL, O_RDONLY, 0, 0);
- if (ret) {
- printf("error opening %s\n", filename);
- return 1;
- }
-
- mkdir("/lib", 0777);
- ret = tar_extract_all(tar, (char *)"/");
- if (ret) {
- printf("error extracting %s\n", filename);
- return 1;
- }
-
- ret = tar_close(tar);
-
- setenv("PYTHONHOME", "", 1);
- return 0;
-}
-
-extern "C" {
-
-static PyObject * post_json_message(PyObject * self, PyObject * args) {
- char * stream;
- char * json;
- if (!PyArg_ParseTuple(args, "ss", &stream, &json)) {
- return NULL;
- }
-
- pp::VarDictionary message;
- message.Set("stream", pp::Var(stream));
- message.Set("json", pp::Var(json));
-
- const PPB_Messaging * messaging = PSInterfaceMessaging();
- PP_Instance instance = PSGetInstanceId();
- messaging->PostMessage(instance, message.pp_var());
-
- Py_RETURN_NONE;
-}
-
-static PyObject * acquire_json_message_wait(PyObject *self, PyObject * args) {
- if (!PyArg_ParseTuple(args, "")) {
- return NULL;
- }
-
- const PPB_Messaging * messaging = PSInterfaceMessaging();
- PP_Instance instance = PSGetInstanceId();
- PSEventSetFilter(PSE_INSTANCE_HANDLEMESSAGE);
- PSEvent *event = PSEventWaitAcquire();
- if (event->type != PSE_INSTANCE_HANDLEMESSAGE)
- Py_RETURN_NONE;
-
- pp::Var message(event->as_var);
-
- if (!message.is_dictionary())
- Py_RETURN_NONE;
-
- pp::VarDictionary request(message);
- pp::Var json(request.Get("json"));
- if (!json.is_string())
- Py_RETURN_NONE;
-
- return PyString_FromString(json.AsString().c_str());
-}
-
-const PPB_Messaging *setup_ppapi_connection(PP_Instance *instance) {
- printf("Initializing external PPAPI signals for PyPPAPI\n");
- (*instance) = PSGetInstanceId();
- const PPB_Messaging *msg = PSInterfaceMessaging();
- if (msg == NULL) {
- printf("PPB Messaging is NULL, which will cause a failure.\n");
- }
- return msg;
-}
-
-}
-
-static PyMethodDef PPMessageMethods[] = {
- {
- "_PostJSONMessage",
- post_json_message,
- METH_VARARGS,
- "Post a message encoded as JSON"
- },
- {
- "_AcquireJSONMessageWait",
- acquire_json_message_wait,
- METH_VARARGS,
- "Acquire a message encoded as JSON (blocking)"},
- {NULL, NULL, 0, NULL}
-};
-
-int main(int argc, char **argv) {
- printf("Setting up unix environment...\n");
- if (setup_unix_environment()) {
- printf("Error: %s\n", strerror(errno));
- return -1;
- }
- printf("done\n");
-
- // Initialize Pepper API
- PSInterfaceInit();
-
- int quit = 0;
-
- while(!quit) {
- // Initialize Python interpreter
- Py_Initialize();
-
- // Load module that provides access to Pepper messaging API
- // from within the interpreter
- Py_InitModule("ppmessage", PPMessageMethods);
-
- // Run the interpreter main loop.
- const char * main_filename = "/mnt/http/kernel.py";
- FILE *main = fopen(main_filename, "r");
- if (main == NULL) {
- printf("failed to load interpreter code\n");
- return -1;
- }
-
- quit = PyRun_SimpleFileEx(main, main_filename, 1);
-
- Py_Finalize();
- }
-
- return 0;
-}
diff --git a/ports/ipython-ppapi/kernel.py b/ports/ipython-ppapi/kernel.py
deleted file mode 100644
index cec1050..0000000
--- a/ports/ipython-ppapi/kernel.py
+++ /dev/null
@@ -1,393 +0,0 @@
-# Copyright (c) 2014 Google Inc. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""A simple shell that uses the IPython messaging system."""
-
-# Override platform information.
-import platform
-platform.system = lambda: "pnacl"
-platform.release = lambda: "chrome"
-
-import time
-import json
-import logging
-import sys
-import Queue
-import thread
-
-stdin_input = Queue.Queue()
-shell_input = Queue.Queue()
-stdin_output = Queue.Queue()
-shell_output = Queue.Queue()
-iopub_output = Queue.Queue()
-
-sys_stdout = sys.stdout
-sys_stderr = sys.stderr
-
-def emit(s):
- print >> sys_stderr, "EMITTING: %s" % (s)
- time.sleep(1)
-
-import IPython
-from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC
-from IPython.utils.traitlets import Type, Dict, Instance
-from IPython.core.displayhook import DisplayHook
-from IPython.utils import py3compat
-from IPython.utils.py3compat import builtin_mod
-from IPython.utils.jsonutil import json_clean, encode_images
-from IPython.core.displaypub import DisplayPublisher
-from IPython.config.configurable import Configurable
-
-# module defined in shell.cc for communicating via pepper API
-from pyppapi import nacl_instance
-
-def CreateMessage(msg_type, parent_header=None, content=None):
- if parent_header is None:
- parent_header = {}
- if content is None:
- content = {}
- return {
- 'header': {'msg_type': msg_type},
- 'parent_header': parent_header,
- 'content': content,
- 'msg_type': msg_type,
- }
-
-class MsgOutStream(object):
- """Class to overrides stderr and stdout."""
-
- def __init__(self, stream_name):
- self._stream_name = stream_name
- self._parent_header = {}
-
- def SetParentHeader(self, parent_header):
- self._parent_header = parent_header
-
- def close(self):
- pass
-
- def flush(self):
- pass
-
- def write(self, string):
- iopub_output.put(CreateMessage('stream', parent_header=self._parent_header,
- content={'name': self._stream_name, 'data': string}))
-
- def writelines(self, sequence):
- for string in sequence:
- self.write(string)
-
-# override sys.stdout and sys.stderr to broadcast on iopub
-stdout_stream = MsgOutStream('stdout')
-stderr_stream = MsgOutStream('stderr')
-sys.stdout = stdout_stream
-sys.stderr = stderr_stream
-
-
-class PepperShellDisplayHook(DisplayHook):
- parent_header = Dict({})
-
- def set_parent_header(self, parent_header):
- """Set the parent for outbound messages."""
- self.parent_header = parent_header
-
- def start_displayhook(self):
- self.content = {}
-
- def write_output_prompt(self):
- self.content['execution_count'] = self.prompt_count
-
- def write_format_data(self, format_dict, md_dict=None):
- self.content['data'] = encode_images(format_dict)
- self.content['metadata'] = md_dict
-
- def finish_displayhook(self):
- sys.stdout.flush()
- sys.stderr.flush()
- iopub_output.put(CreateMessage('pyout', parent_header=self.parent_header,
- content=self.content))
- self.content = None
-
-
-class PepperDisplayPublisher(DisplayPublisher):
- parent_header = Dict({})
-
- def set_parent_header(self, parent_header):
- self.parent_header = parent_header
-
- def _flush_streams(self):
- """flush IO Streams prior to display"""
- sys.stdout.flush()
- sys.stderr.flush()
-
- def publish(self, source, data, metadata=None):
- self._flush_streams()
- if metadata is None:
- metadata = {}
- self._validate_data(source, data, metadata)
- content = {}
- content['source'] = source
- content['data'] = encode_images(data)
- content['metadata'] = metadata
- iopub_output.put(CreateMessage('display_data', content=json_clean(content),
- parent_header=self.parent_header))
-
- def clear_output(self, stdout=True, stderr=True, other=True):
- content = dict(stdout=stdout, stderr=stderr, other=other)
-
- if stdout:
- sys.stdout.write('\r')
- if stderr:
- sys.stderr.write('\r')
-
- self._flush_streams()
- iopub_output.put(CreateMessage('clear_output', content=content,
- parent_header=self.parent_header))
-
-
-class PepperInteractiveShell(InteractiveShell):
- """A subclass of InteractiveShell for the Pepper Messagin API."""
- displayhook_class = Type(PepperShellDisplayHook)
- display_pub_class = Type(PepperDisplayPublisher)
- @staticmethod
- def enable_gui(gui):
- pass
-
-
-InteractiveShellABC.register(PepperInteractiveShell)
-
-class PepperKernel(Configurable):
- shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
- shell_class = Type(PepperInteractiveShell)
-
- def __init__(self):
- self.shell = self.shell_class.instance(parent=self)
- self.shell.run_cell("""
-import os
-matplotlib_config_dir = '/mplconfigdir'
-os.environ['XDG_CONFIG_HOME'] = matplotlib_config_dir
-os.environ['TMP'] = ''
-import matplotlib
-import matplotlib.cbook
-""")
-
-shell = PepperKernel().shell
-
-# Taken from IPython 2.x branch, IPython/kernel/zmq/ipykernel.py
-def _complete(msg):
- c = msg['content']
- try:
- cpos = int(c['cursor_pos'])
- except:
- # If we don't get something that we can convert to an integer, at
- # least attempt the completion guessing the cursor is at the end of
- # the text, if there's any, and otherwise of the line
- cpos = len(c['text'])
- if cpos==0:
- cpos = len(c['line'])
- return shell.complete(c['text'], c['line'], cpos)
-
-# Special message to indicate the NaCl kernel is ready.
-iopub_output.put(CreateMessage('status', content={'execution_state': 'nacl_ready'}))
-
-
-def _no_raw_input(self):
- """Raise StdinNotImplentedError if active frontend doesn't support
- stdin."""
- raise StdinNotImplementedError("raw_input was called, but this "
- "frontend does not support stdin.")
-
-def _raw_input(prompt, parent_header):
- # Flush output before making the request.
- sys.stderr.flush()
- sys.stdout.flush()
- # flush the stdin socket, to purge stale replies
- while True:
- try:
- stdin_input.get_nowait()
- except Queue.Empty:
- break
-
- # Send the input request.
- content = json_clean(dict(prompt=prompt))
- stdin_output.put(CreateMessage('input_request', content=content,
- parent_header=parent_header))
-
- # Await a response.
- while True:
- try:
- reply = stdin_input.get()
- except Exception:
- print "Invalid Message"
- except KeyboardInterrupt:
- # re-raise KeyboardInterrupt, to truncate traceback
- raise KeyboardInterrupt
- else:
- break
- try:
- value = py3compat.unicode_to_str(reply['content']['value'])
- except:
- print "Got bad raw_input reply: "
- print reply
- value = ''
- if value == '\x04':
- # EOF
- raise EOFError
- return value
-
-def main_loop():
- execution_count = 1
- while 1:
- iopub_output.put(CreateMessage('status', content={'execution_state': 'idle'}))
- msg = shell_input.get()
- iopub_output.put(CreateMessage('status', content={'execution_state': 'busy'}))
-
- if not 'header' in msg:
- continue
- request_header = msg['header']
- if not 'msg_type' in request_header:
- continue
- msg_type = request_header['msg_type']
- if msg_type == 'execute_request':
- try:
- content = msg[u'content']
- code = content[u'code']
- silent = content[u'silent']
- store_history = content.get(u'store_history', not silent)
- except:
- self.log.error("Got bad msg: ")
- self.log.error("%s", msg)
- continue
-
- # Replace raw_input. Note that is not sufficient to replace
- # raw_input in the user namespace.
- if content.get('allow_stdin', False):
- raw_input = lambda prompt='': _raw_input(prompt, request_header)
- input = lambda prompt='': eval(raw_input(prompt))
- else:
- raw_input = input = lambda prompt='' : _no_raw_input()
-
- if py3compat.PY3:
- _sys_raw_input = builtin_mod.input
- builtin_mod.input = raw_input
- else:
- _sys_raw_input = builtin_mod.raw_input
- _sys_eval_input = builtin_mod.input
- builtin_mod.raw_input = raw_input
- builtin_mod.input = input
-
- # Let output streams know which message the output is for
- stdout_stream.SetParentHeader(request_header)
- stderr_stream.SetParentHeader(request_header)
- shell.displayhook.set_parent_header(request_header)
- shell.display_pub.set_parent_header(request_header)
-
- status = 'ok'
- content = {}
- try:
- shell.run_cell(msg['content']['code'],
- store_history=store_history,
- silent=silent)
- except Exception, ex:
- status = 'error'
- logging.exception('Exception occured while running cell')
- finally:
- # Restore raw_input.
- if py3compat.PY3:
- builtin_mod.input = _sys_raw_input
- else:
- builtin_mod.raw_input = _sys_raw_input
- builtin_mod.input = _sys_eval_input
-
- content = {'status': status,
- 'execution_count': execution_count}
-
- if status == 'ok':
- content['payload'] = []
- content['user_variables'] = {}
- content['user_expressions'] = {}
- elif status == 'error':
- content['ename'] = type(ex).__name__
- content['evalue'] = str(ex)
- content['traceback'] = []
-
- execution_count += 1
- if status == 'error':
- iopub_output.put(CreateMessage('pyerr', parent_header=request_header,
- content={
- 'execution_count': execution_count,
- 'ename': type(ex).__name__,
- 'evalue': str(ex),
- 'traceback': []
- }
- ))
- shell_output.put(CreateMessage('execute_reply', parent_header=request_header,
- content=content))
- elif msg_type == 'complete_request':
- # Taken from IPython 2.x branch, IPython/kernel/zmq/ipykernel.py
- txt, matches = _complete(msg)
- matches = {'matches' : matches,
- 'matched_text' : txt,
- 'status' : 'ok'}
- matches = json_clean(matches)
- shell_output.put(CreateMessage('complete_reply',
- parent_header = request_header,
- content = matches))
- elif msg_type == 'object_info_request':
- # Taken from IPython 2.x branch, IPython/kernel/zmq/ipykernel.py
- content = msg['content']
- object_info = shell.object_inspect(content['oname'],
- detail_level = content.get('detail_level', 0))
- # Before we send this object over, we scrub it for JSON usage
- oinfo = json_clean(object_info)
- shell_output.put(CreateMessage('object_info_reply',
- parent_header = request_header,
- content = oinfo))
- elif msg_type == 'restart':
- # break out of this loop, ending this program.
- # The main event loop in shell.cc will then
- # run this program again.
- break
- elif msg_type == 'kill':
- # Raise an exception so that the function
- # running this script will return -1, resulting
- # in no restart of this script.
- raise RuntimeError
-
-thread.start_new_thread(main_loop, ())
-
-def deal_message(msg):
- channel = msg['stream']
- content = json.loads(msg['json'])
-
- queues = {'shell': shell_input, 'stdin': stdin_input}
- queue = queues[channel]
-
- queue.put(content)
-
-def send_message(stream, msg):
- nacl_instance.send_raw_object({
- 'stream': stream,
- 'json': json.dumps(msg)
- })
-
-while 1:
- msg = nacl_instance.wait_for_message(timeout=1, sleeptime=10000)
- try:
- deal_message(msg)
- except:
- pass
-
- output_streams = [
- (stdin_output, 'stdin'),
- (shell_output, 'shell'),
- (iopub_output, 'iopub')
- ]
- for msg_queue, stream in output_streams:
- msg = None
- try:
- msg = msg_queue.get_nowait()
- send_message(stream, msg)
- except Queue.Empty:
- pass
diff --git a/ports/ipython-ppapi/pkg_info b/ports/ipython-ppapi/pkg_info
deleted file mode 100644
index ac1d754..0000000
--- a/ports/ipython-ppapi/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=ipython-ppapi
-VERSION=0.1
-LICENSE=BSD
-ARCH=(pnacl)
-DEPENDS=(numpy matplotlib python-static libtar nacl-spawn freetype openssl libpng readline ncurses bzip2 ipython)
diff --git a/ports/jpeg6b/build.sh b/ports/jpeg6b/build.sh
deleted file mode 100644
index d2537c5..0000000
--- a/ports/jpeg6b/build.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="\
- cjpeg${NACL_EXEEXT} \
- djpeg${NACL_EXEEXT} \
- jpegtran${NACL_EXEEXT} \
- rdjpgcom${NACL_EXEEXT} \
- wrjpgcom${NACL_EXEEXT}"
-
-
-BuildStep() {
- for exe in ${EXECUTABLES}; do
- rm -f ${exe} ${exe%%${NACL_EXEEXT}}
- done
- DefaultBuildStep
- for exe in ${EXECUTABLES}; do
- mv ${exe%%${NACL_EXEEXT}} ${exe}
- done
-}
-
-
-InstallStep() {
- MakeDir ${DESTDIR}/${PREFIX}/include
- MakeDir ${DESTDIR}/${PREFIX}/lib
- LogExecute make install-lib prefix=${DESTDIR}/${PREFIX}
-}
-
-
-TestStep() {
- if [ ${NACL_ARCH} = "pnacl" ]; then
- for arch in x86-32 x86-64; do
- for exe in ${EXECUTABLES}; do
- local exe_noext=${exe%.*}
- WriteLauncherScript ${exe_noext} ${exe_noext}.${arch}.nexe
- done
- make test
- done
- else
- make test
- fi
-}
diff --git a/ports/jpeg6b/nacl.patch b/ports/jpeg6b/nacl.patch
deleted file mode 100644
index c3a5500..0000000
--- a/ports/jpeg6b/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/makefile.cfg b/makefile.cfg
---- a/makefile.cfg
-+++ b/makefile.cfg
-@@ -60,7 +60,7 @@ RM= rm -f
- # directory creation command
- MKDIR= mkdir
- # library (.a) file creation command
--AR= ar rc
-+AR= $(NACLAR) rc
- # second step in .a creation (use "touch" if not needed)
- AR2= @RANLIB@
- # installation program
diff --git a/ports/jpeg6b/pkg_info b/ports/jpeg6b/pkg_info
deleted file mode 100644
index 2973061..0000000
--- a/ports/jpeg6b/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=jpeg6b
-VERSION=6b
-ARCHIVE_ROOT=jpeg-6b
-URL=http://www.ijg.org/files/jpegsrc.v6b.tar.gz
-LICENSE=CUSTOM:README
-SHA1=7079f0d6c42fad0cfba382cf6ad322add1ace8f9
-CONFLICTS=(jpeg8d)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/jpeg8d/build.sh b/ports/jpeg8d/build.sh
deleted file mode 100644
index d0af466..0000000
--- a/ports/jpeg8d/build.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="rdjpgcom${NACL_EXEEXT} wrjpgcom${NACL_EXEEXT} \
- cjpeg${NACL_EXEEXT} djpeg${NACL_EXEEXT} jpegtran${NACL_EXEEXT}"
-
-RunTestsPnacl() {
- local arch=$1
- for exe in ${EXECUTABLES}; do
- local exe_noext=${exe%.*}
- WriteLauncherScript ${exe_noext} ${exe_noext}.${arch}.nexe
- done
- LogExecute make test
-}
-
-TestStep() {
- export SEL_LDR_LIB_PATH=$PWD/.libs
-
- if [[ ${NACL_SHARED} == 1 ]]; then
- for exe in ${EXECUTABLES}; do
- local script=$(basename ${exe%.*})
- WriteLauncherScript ${script} ${exe}
- done
- fi
- LogExecute make test
-
- if [[ ${NACL_ARCH} == pnacl ]]; then
- RunTestsPnacl x86-32
- if [[ ${SEL_LDR_SUPPORTS_ARM} == 1 ]]; then
- RunTestsPnacl arm
- fi
- fi
-}
diff --git a/ports/jpeg8d/pkg_info b/ports/jpeg8d/pkg_info
deleted file mode 100644
index 77a82b3..0000000
--- a/ports/jpeg8d/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=jpeg8d
-VERSION=8d
-ARCHIVE_ROOT=jpeg-8d
-URL=http://www.ijg.org/files/jpegsrc.v8d.tar.gz
-LICENSE=CUSTOM:README
-SHA1=f080b2fffc7581f7d19b968092ba9ebc234556ff
-CONFLICTS=(jpeg6b)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/json-glib/pkg_info b/ports/json-glib/pkg_info
deleted file mode 100644
index 6fa375d..0000000
--- a/ports/json-glib/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=json-glib
-VERSION=1.0.4
-URL=http://ftp.gnome.org/pub/gnome/sources/json-glib/1.0/json-glib-1.0.4.tar.xz
-LICENSE=LGPL
-DEPENDS=(glib)
-SHA1=efdf5a66d1d8fb504448a40ba2352bbfef301074
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/jsoncpp/build.sh b/ports/jsoncpp/build.sh
deleted file mode 100644
index 492e053..0000000
--- a/ports/jsoncpp/build.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-# The NaCL SDK includes a version of jsoncpp conflicts with this one.
-# Remove the SDK include path so that these headers don't get used
-# during the build.
-NACLPORTS_CPPFLAGS=${NACLPORTS_CPPFLAGS/-I${NACL_SDK_ROOT}\/include/}
-
-EXECUTABLES=src/test_lib_json/jsoncpp_test
-
-EXTRA_CMAKE_ARGS="-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF"
-
-TestStep() {
- if [ "${TOOLCHAIN}" = "pnacl" ]; then
- return
- fi
- LogExecute src/test_lib_json/jsoncpp_test.sh
-}
diff --git a/ports/jsoncpp/nacl.patch b/ports/jsoncpp/nacl.patch
deleted file mode 100644
index 662b9f6..0000000
--- a/ports/jsoncpp/nacl.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -94,10 +94,11 @@ endif( MSVC )
-
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- # using regular Clang or AppleClang
-- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
-+ # pnacl-clang requires gnu++11 rather than c++11 in order to access isascii et al.
-+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall")
- elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- # using GCC
-- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -pedantic")
-+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -Wall -Wextra -pedantic")
- endif()
-
- IF(JSONCPP_WITH_WARNING_AS_ERROR)
-diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
---- a/src/lib_json/json_writer.cpp
-+++ b/src/lib_json/json_writer.cpp
-@@ -29,8 +29,6 @@
-
- #if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below
- #define snprintf _snprintf
--#elif __cplusplus >= 201103L
--#define snprintf std::snprintf
- #endif
-
- #if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
-diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp
---- a/src/test_lib_json/main.cpp
-+++ b/src/test_lib_json/main.cpp
-@@ -679,7 +679,10 @@ JSONTEST_FIXTURE(ValueTest, integers) {
- JSONTEST_ASSERT_EQUAL(kint32max, val.asUInt());
- JSONTEST_ASSERT_EQUAL(kint32max, val.asLargestUInt());
- JSONTEST_ASSERT_EQUAL(kint32max, val.asDouble());
-+#if !(defined(__native_client__) && defined(__i386__))
-+ // This test mysteriously fails in i686-nacl-gcc
- JSONTEST_ASSERT_EQUAL(kfint32max, val.asFloat());
-+#endif
- JSONTEST_ASSERT_EQUAL(true, val.asBool());
- JSONTEST_ASSERT_STRING_EQUAL("2147483647", val.asString());
-
diff --git a/ports/jsoncpp/pkg_info b/ports/jsoncpp/pkg_info
deleted file mode 100644
index 2457ca2..0000000
--- a/ports/jsoncpp/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=jsoncpp
-VERSION=1.6.1
-URL=https://github.com/open-source-parsers/jsoncpp/archive/1.6.1/jsoncpp-1.6.1.tar.gz
-LICENSE=CUSTOM:LICENSE
-SHA1=e05f87331ec7ce95cd1d2bcea7f49f1a436ae7b1
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/kbproto/pkg_info b/ports/kbproto/pkg_info
deleted file mode 100644
index d8359aa..0000000
--- a/ports/kbproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=kbproto
-VERSION=1.0.6
-URL=http://www.x.org/releases/X11R7.7/src/everything/kbproto-1.0.6.tar.bz2
-LICENSE=GPL
-SHA1=a2cc82357c22a1f4d6243017982c32703c95575c
diff --git a/ports/lame/pkg_info b/ports/lame/pkg_info
deleted file mode 100644
index 88db98e..0000000
--- a/ports/lame/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=lame
-VERSION=3.99.5
-URL=http://download.sf.net/lame/lame/3.99/lame-3.99.5.tar.gz
-LICENSE=LGPL
-SHA1=03a0bfa85713adcc6b3383c12e2cc68a9cfbf4c4
diff --git a/ports/lcms/pkg_info b/ports/lcms/pkg_info
deleted file mode 100644
index eca53ce..0000000
--- a/ports/lcms/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=lcms
-VERSION=2.4
-ARCHIVE_ROOT=lcms2-2.4
-URL=http://downloads.sf.net/project/lcms/lcms/2.4/lcms2-2.4.tar.gz
-LICENSE=MIT:COPYING
-DEPENDS=(zlib jpeg8d tiff)
-DISABLED_TOOLCHAIN=(emscripten)
-SHA1=9944902864283af49e4e21a1ca456db4e04ea7c2
diff --git a/ports/less/build.sh b/ports/less/build.sh
deleted file mode 100644
index 7f50c20..0000000
--- a/ports/less/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2015 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.
-
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-
-EnableCliMain
-
-PatchStep() {
- LogExecute chmod 777 ${SRC_DIR}/configure
- DefaultPatchStep
-}
diff --git a/ports/less/nacl.patch b/ports/less/nacl.patch
deleted file mode 100644
index 4f9bc1f..0000000
--- a/ports/less/nacl.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/screen.c b/screen.c
---- a/screen.c
-+++ b/screen.c
-@@ -282,7 +282,8 @@ raw_mode(on)
- save_term = s;
- saved_term = 1;
- }
--#if HAVE_OSPEED
-+/*cfgetospeed is not linkable , shouldn't define HAVE_OSPEED */
-+#if HAVE_OSPEED && !defined(__native_client__)
- switch (cfgetospeed(&s))
- {
- #ifdef B0
diff --git a/ports/less/pkg_info b/ports/less/pkg_info
deleted file mode 100644
index 85c4b2a..0000000
--- a/ports/less/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=less
-VERSION=451
-URL=http://ftp.gnu.org/gnu/less/less-451.tar.gz
-DEPENDS=(ncurses nacl-spawn)
-# missing 'mblen' and 'sysinfo'
-SHA1=ee95be670e8fcc97ac87d02dd1980209130423d0
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/leveldb/README b/ports/leveldb/README
deleted file mode 100644
index a51ba16..0000000
--- a/ports/leveldb/README
+++ /dev/null
@@ -1,10 +0,0 @@
-leveldb port to Native Client
-=============================
-
-This port pulls code directly from git since leveldb stopped
-publishing tarball releases on code.google.com with 1.15.0.
-
-While code.google.com does support automatic archives using
-URLs like 'https://leveldb.googlecode.com/archive/e353fbc.tar.gz'
-it seems that these do not have consistent hashes and so we
-can't use them in webports.
diff --git a/ports/leveldb/build.sh b/ports/leveldb/build.sh
deleted file mode 100644
index 3e1d65c..0000000
--- a/ports/leveldb/build.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright (c) 2011 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.
-
-# All these tests rely on mkdir() working, and currently
-# neither newlib or glibc has mkdir plumbed through to the
-# IRT.
-#autocompact_test
-#corruption_test
-#db_test
-#issue178_test
-EXECUTABLES="\
- issue200_test \
- c_test \
- table_test \
- arena_test \
- bloom_test \
- cache_test \
- coding_test \
- crc32c_test \
- dbformat_test \
- env_test \
- filename_test \
- filter_block_test \
- log_test \
- memenv_test \
- skiplist_test \
- version_edit_test \
- version_set_test \
- write_batch_test"
-
-BUILD_DIR=${SRC_DIR}
-
-
-BuildStep() {
- export TARGET_OS=NaCl
- export AR=${NACLAR}
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- LogExecute make clean
- LogExecute make -j${OS_JOBS} OPT=""
- LogExecute make -j${OS_JOBS} OPT="" tests programs
-}
-
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}
- LogExecute cp libleveldb.a ${DESTDIR_LIB}
- LogExecute cp -r include/leveldb ${DESTDIR_INCLUDE}
-}
-
-TestStep() {
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- return
- fi
-
- for test_binary in $EXECUTABLES; do
- echo "***** Running $test_binary.sh"
- ./$test_binary.sh
- done
-}
diff --git a/ports/leveldb/nacl.patch b/ports/leveldb/nacl.patch
deleted file mode 100644
index 43a6d0d..0000000
--- a/ports/leveldb/nacl.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -99,7 +99,11 @@ endif # PLATFORM_SHARED_EXT
-
- all: $(SHARED) $(LIBRARY)
-
--check: all $(PROGRAMS) $(TESTS)
-+tests: $(TESTS)
-+
-+programs: $(PROGRAMS)
-+
-+check: all programs tests
- for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done
-
- clean:
-diff --git a/build_detect_platform b/build_detect_platform
---- a/build_detect_platform
-+++ b/build_detect_platform
-@@ -104,6 +104,31 @@ case "$TARGET_OS" in
- PLATFORM_LIBS="-lpthread"
- PORT_FILE=port/port_posix.cc
- ;;
-+ NaCl)
-+ PLATFORM=OS_NACL
-+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_NACL -DLEVELDB_PLATFORM_POSIX"
-+ PLATFORM_LDFLAGS="-pthread"
-+ PORT_FILE=port/port_posix.cc
-+ CROSS_COMPILE=true
-+ if [ "$TOOLCHAIN" = "pnacl" -o "$TOOLCHAIN" = "clang-newlib" ]; then
-+ COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_ATOMIC_PRESENT"
-+ # Would use -std=c++11 here but its broken on PNaCl:
-+ # http://crbug.com/314944
-+ PLATFORM_CXXFLAGS="-std=gnu++11"
-+ fi
-+ if [ "$TOOLCHAIN" = "glibc" ]; then
-+ if [ "$NACL_ARCH" = "arm" ]; then
-+ COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_ATOMIC_PRESENT"
-+ PLATFORM_CXXFLAGS="-std=c++11"
-+ else
-+ COMMON_FLAGS="$COMMON_FLAGS -D__STDC_LIMIT_MACROS"
-+ PLATFORM_CXXFLAGS="-std=c++0x"
-+ fi
-+ fi
-+ if [ "$NACL_SHARED" != 1 ]; then
-+ PLATFORM_SHARED_EXT=""
-+ fi
-+ ;;
- NetBSD)
- PLATFORM=OS_NETBSD
- COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_NETBSD"
-diff --git a/port/port_posix.h b/port/port_posix.h
---- a/port/port_posix.h
-+++ b/port/port_posix.h
-@@ -34,6 +34,14 @@
- // See http://code.google.com/p/android/issues/detail?id=39824
- #include <endian.h>
- #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
-+#elif defined(OS_NACL)
-+ #include <sys/types.h>
-+ #if defined(_NEWLIB_VERSION)
-+ #include <machine/endian.h>
-+ #define PLATFORM_IS_LITTLE_ENDIAN (BYTE_ORDER == LITTLE_ENDIAN)
-+ #else
-+ #include <endian.h>
-+ #endif
- #else
- #include <endian.h>
- #endif
-@@ -52,7 +60,7 @@
-
- #if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\
- defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\
-- defined(OS_ANDROID) || defined(OS_HPUX) || defined(CYGWIN)
-+ defined(OS_ANDROID) || defined(OS_HPUX) || defined(CYGWIN) || (defined(OS_NACL) && (defined(_NEWLIB_VERSION) || defined(__BIONIC__)))
- // Use fread/fwrite/fflush on platforms without _unlocked variants
- #define fread_unlocked fread
- #define fwrite_unlocked fwrite
-diff --git a/util/env_posix.cc b/util/env_posix.cc
---- a/util/env_posix.cc
-+++ b/util/env_posix.cc
-@@ -24,6 +24,32 @@
- #include "util/mutexlock.h"
- #include "util/posix_logger.h"
-
-+#ifdef __native_client__
-+// TODO(sbc): remove once fsync/fdatasync get implemented in sel_ldr.
-+#define fsync(X) 0
-+#define fdatasync(X) 0
-+#ifdef __GLIBC__
-+#define geteuid(X) 0
-+ssize_t pread(int fd, char* buf, size_t n, off_t off) {
-+ off_t cur_pos;
-+ ssize_t num_read;
-+
-+ if ((cur_pos = lseek(fd, 0, SEEK_CUR)) == (off_t)-1)
-+ return -1;
-+
-+ if (lseek(fd, off, SEEK_SET) == (off_t)-1)
-+ return -1;
-+
-+ num_read = read(fd, buf, n);
-+
-+ if (lseek(fd, cur_pos, SEEK_SET) == (off_t)-1)
-+ return -1;
-+
-+ return num_read;
-+}
-+#endif
-+#endif
-+
- namespace leveldb {
-
- namespace {
-@@ -254,6 +280,9 @@ class PosixWritableFile : public WritableFile {
- };
-
- static int LockOrUnlock(int fd, bool lock) {
-+#ifdef __native_client__
-+ return 0;
-+#else
- errno = 0;
- struct flock f;
- memset(&f, 0, sizeof(f));
-@@ -262,6 +291,7 @@ static int LockOrUnlock(int fd, bool lock) {
- f.l_start = 0;
- f.l_len = 0; // Lock/unlock entire file
- return fcntl(fd, F_SETLK, &f);
-+#endif
- }
-
- class PosixFileLock : public FileLock {
diff --git a/ports/leveldb/pkg_info b/ports/leveldb/pkg_info
deleted file mode 100644
index 87c590e..0000000
--- a/ports/leveldb/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=leveldb
-VERSION=1.18
-URL=https://github.com/google/leveldb/archive/v1.18/leveldb-1.18.tar.gz
-LICENSE=BSD
-SHA1=18684a0ad7a07920d10f5295b171fbf5eeec7337
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libarchive-dev/build.sh b/ports/libarchive-dev/build.sh
deleted file mode 100644
index 6a72a50..0000000
--- a/ports/libarchive-dev/build.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-# TODO(mtomasz): Remove this package, once a new upstream release of libarchive
-# is available.
-
-AutogenStep() {
- ChangeDir ${SRC_DIR}
- export MAKE_LIBARCHIVE_RELEASE="1"
- ./build/autogen.sh
- PatchConfigure
- cd -
-}
-
-if [ "${NACL_SHARED}" = "0" ]; then
- EXTRA_CONFIGURE_ARGS+=" --enable-shared=no"
-fi
-
-EnableGlibcCompat
-
-ConfigureStep() {
- AutogenStep
-
- EXTRA_CONFIGURE_ARGS="--disable-bsdtar --disable-bsdcpio"
- EXTRA_CONFIGURE_ARGS+=" --without-iconv"
-
- # Temporary xml2 support cannot be added because the patch used in
- # ports/libarchve doesn't apply correctly here due. The reason is that
- # configure file is not present on gihub repository and is created
- # after AutogenStep.
- # # TODO(cmihail): Remove this once nacl.patch is applied correctly.
- EXTRA_CONFIGURE_ARGS+=" --without-xml2"
-
- NACLPORTS_CPPFLAGS+=" -Dtimezone=_timezone"
-
- DefaultConfigureStep
-}
-
-BuildHost() {
- HOST_BUILD_DIR=${WORK_DIR}/build_host
- HOST_INSTALL_DIR=${WORK_DIR}/install_host
- if [ ! -d ${HOST_INSTALL_DIR} ]; then
- Banner "Build host version"
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- LogExecute ${SRC_DIR}/configure --without-lzma
- LogExecute make -j${OS_JOBS}
- LogExecute make install DESTDIR=${HOST_INSTALL_DIR}
- cd -
- fi
-}
-
-BuildStep() {
- BuildHost
- DefaultBuildStep
-}
diff --git a/ports/libarchive-dev/nacl.patch b/ports/libarchive-dev/nacl.patch
deleted file mode 100644
index ce1bdf8..0000000
--- a/ports/libarchive-dev/nacl.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -24,7 +24,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
- COMMON_CFLAGS=-Wall -Wformat -Wformat-security
- # The next line is commented out by default in shipping libarchive releases.
- # It is uncommented by default in trunk.
--DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g
-+# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g
- AM_CFLAGS=$(COMMON_CFLAGS) $(DEV_CFLAGS)
- PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@
- AM_CPPFLAGS=$(PLATFORMCPPFLAGS)
-diff --git a/libarchive/archive_random.c b/libarchive/archive_random.c
---- a/libarchive/archive_random.c
-+++ b/libarchive/archive_random.c
-@@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$");
-
- #ifdef HAVE_FCNTL
- #include <fcntl.h>
-+// TODO(cmihail): If possible remove this workaround for O_CLOEXEC.
-+#ifndef O_CLOEXEC
-+#define O_CLOEXEC 0
-+#endif
- #endif
- #ifdef HAVE_LIMITS_H
- #include <limits.h>
-diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
---- a/libarchive/archive_write_disk_posix.c
-+++ b/libarchive/archive_write_disk_posix.c
-@@ -2740,7 +2740,7 @@ create_dir(struct archive_write_disk *a, char *path)
- static int
- set_ownership(struct archive_write_disk *a)
- {
--#ifndef __CYGWIN__
-+#if !defined(__CYGWIN__) && !defined(__native_client__)
- /* unfortunately, on win32 there is no 'root' user with uid 0,
- so we just have to try the chown and see if it works */
-
-@@ -2792,7 +2792,8 @@ set_time(int fd, int mode, const char *name,
- time_t mtime, long mtime_nsec)
- {
- /* Select the best implementation for this platform. */
--#if defined(HAVE_UTIMENSAT) && defined(HAVE_FUTIMENS)
-+ /* futimens is not implemented in nacl glibc */
-+#if defined(HAVE_UTIMENSAT) && defined(HAVE_FUTIMENS) && !defined(__native_client__)
- /*
- * utimensat() and futimens() are defined in
- * POSIX.1-2008. They support ns resolution and setting times
-diff --git a/libarchive_fe/passphrase.c b/libarchive_fe/passphrase.c
---- a/libarchive_fe/passphrase.c
-+++ b/libarchive_fe/passphrase.c
-@@ -142,7 +142,11 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
- # define _POSIX_VDISABLE VDISABLE
- #endif
-
-+#ifdef _NEWLIB_VERSION
-+static volatile sig_atomic_t signo[NSIG];
-+#else
- static volatile sig_atomic_t signo[_NSIG];
-+#endif
-
- static void
- handler(int s)
-@@ -168,7 +172,11 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
- }
-
- restart:
-- for (i = 0; i < _NSIG; i++)
-+#ifdef _NEWLIB_VERSION
-+ for (i = 0; i < NSIG; i++)
-+#else
-+ for (i = 0; i < _NSIG; i++)
-+#endif
- signo[i] = 0;
- nr = -1;
- save_errno = 0;
-@@ -273,7 +281,11 @@ restart:
- * If we were interrupted by a signal, resend it to ourselves
- * now that we have restored the signal handlers.
- */
-- for (i = 0; i < _NSIG; i++) {
-+#ifdef _NEWLIB_VERSION
-+ for (i = 0; i < NSIG; i++) {
-+#else
-+ for (i = 0; i < _NSIG; i++) {
-+#endif
- if (signo[i]) {
- kill(getpid(), i);
- switch (i) {
-@@ -311,4 +323,3 @@ lafe_readpassphrase(const char *prompt, char *buf, size_t bufsiz)
- }
- return (p);
- }
--
diff --git a/ports/libarchive-dev/pkg_info b/ports/libarchive-dev/pkg_info
deleted file mode 100644
index 0e2ff47..0000000
--- a/ports/libarchive-dev/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libarchive-dev
-VERSION=0.1 # Custom version.
-URL=https://github.com/libarchive/libarchive.git@d094dc
-LICENSE=BSD
-DEPENDS=(zlib openssl bzip2 xz)
-CONFLICTS=(libarchive)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libarchive/build.sh b/ports/libarchive/build.sh
deleted file mode 100644
index 175206c..0000000
--- a/ports/libarchive/build.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXTRA_CONFIGURE_ARGS="--disable-bsdtar --disable-bsdcpio"
-EXTRA_CONFIGURE_ARGS+=" --without-iconv"
-
-NACLPORTS_CPPFLAGS+=" -Dtimezone=_timezone"
-
-# Because /usr/bin/xml2-config works different on Linux and Mac we need
-# to treat them differently. On Mac the build works correctly with no
-# changes, but Linux requires --prefix=<path_to_xml2>, which is an invalid
-# flag on Mac.
-if [ $OS_NAME = "Linux" ]; then
- export XML2_CONFIG_PREFIX="--prefix=\"${NACL_PREFIX}\""
-fi
-
-# Necessary for libxml2.
-export LIBS="-lpthread -lm"
diff --git a/ports/libarchive/nacl.patch b/ports/libarchive/nacl.patch
deleted file mode 100644
index 27be92d..0000000
--- a/ports/libarchive/nacl.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/configure b/configure
-index 4b5a965..50c4f14 100755
---- a/configure
-+++ b/configure
-@@ -14617,8 +14617,8 @@ fi
-
-
- if test "x$XML2_CONFIG" != "x"; then
-- CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
-- LIBS="${LIBS} `${XML2_CONFIG} --libs`"
-+ CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} ${XML2_CONFIG_PREFIX} --cflags`"
-+ LIBS="${LIBS} `${XML2_CONFIG} ${XML2_CONFIG_PREFIX} --libs`"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlInitParser in -lxml2" >&5
- $as_echo_n "checking for xmlInitParser in -lxml2... " >&6; }
- if ${ac_cv_lib_xml2_xmlInitParser+:} false; then :
---
-2.0.0.526.g5318336
-
diff --git a/ports/libarchive/pkg_info b/ports/libarchive/pkg_info
deleted file mode 100644
index dda8d31..0000000
--- a/ports/libarchive/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libarchive
-VERSION=3.1.2
-URL=http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz
-LICENSE=BSD
-DEPENDS=(zlib libxml2)
-SHA1=6a991777ecb0f890be931cec4aec856d1a195489
-CONFLICTS=(libarchive-dev)
diff --git a/ports/libatomic-ops/build.sh b/ports/libatomic-ops/build.sh
deleted file mode 100644
index 7de8a1a..0000000
--- a/ports/libatomic-ops/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
-
-NACLPORTS_CPPFLAGS+=" -D__ILP32__"
diff --git a/ports/libatomic-ops/pkg_info b/ports/libatomic-ops/pkg_info
deleted file mode 100644
index acd567e..0000000
--- a/ports/libatomic-ops/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=libatomic-ops
-VERSION=7.4.0
-URL=http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-7.4.0.tar.gz
-LICENSE=GPL
-ARCHIVE_ROOT=libatomic_ops-7.4.0
-DEPENDS=(glibc-compat)
-DISABLED_ARCH=(pnacl)
-SHA1=3397c2b2a02be3c27af6ed603332e81464447653
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libav/build.sh b/ports/libav/build.sh
deleted file mode 100644
index 10233af..0000000
--- a/ports/libav/build.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) 2013 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.
-
-ConfigureStep() {
- SetupCrossEnvironment
- local extra_args=""
- if [ "${TOOLCHAIN}" = pnacl ]; then
- extra_args="--cc=pnacl-clang"
- elif [ "${TOOLCHAIN}" = "clang-newlib" ]; then
- extra_args="--cc=${CC}"
- fi
-
- LogExecute ${SRC_DIR}/configure \
- --cross-prefix=${NACL_CROSS_PREFIX}- \
- --arch=${NACL_ARCH} \
- --target-os=linux \
- --enable-gpl \
- --enable-static \
- --enable-cross-compile \
- --disable-asm \
- --disable-inline-asm \
- --disable-programs \
- --disable-ssse3 \
- --disable-mmx \
- --disable-mmxext \
- --disable-amd3dnow \
- --disable-amd3dnowext \
- --disable-indevs \
- --disable-protocols \
- --disable-network \
- --enable-protocol=file \
- --enable-libmp3lame \
- --enable-libvorbis \
- --disable-demuxer=rtsp \
- --disable-demuxer=image2 \
- --prefix=${PREFIX} \
- ${extra_args}
-}
diff --git a/ports/libav/nacl.patch b/ports/libav/nacl.patch
deleted file mode 100644
index 2932daa..0000000
--- a/ports/libav/nacl.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff --git a/doc/Makefile b/doc/Makefile
---- a/doc/Makefile
-+++ b/doc/Makefile
-@@ -29,7 +29,7 @@ $(GENTEXI): doc/avoptions_%.texi: doc/print_options
- doc/%.html: TAG = HTML
- doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
- $(Q)$(TEXIDEP)
-- $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
-+ $(M)texi2html -I doc -monolithic --init_file $(SRC_PATH)/doc/t2h.init --output $@ $<
-
- doc/%.pod: TAG = POD
- doc/%.pod: doc/%.texi $(GENTEXI)
-diff --git a/libavutil/mem.c b/libavutil/mem.c
---- a/libavutil/mem.c
-+++ b/libavutil/mem.c
-@@ -48,11 +48,11 @@
-
- void *malloc(size_t size);
- void *memalign(size_t align, size_t size);
--int posix_memalign(void **ptr, size_t align, size_t size);
- void *realloc(void *ptr, size_t size);
- void free(void *ptr);
-
- #endif /* MALLOC_PREFIX */
-+int posix_memalign(void **ptr, size_t align, size_t size);
-
- /* You can redefine av_malloc and av_free in your project to use your
- * memory allocator. You do not need to suppress this file because the
-diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
---- a/libavutil/x86/cpu.c
-+++ b/libavutil/x86/cpu.c
-@@ -85,6 +85,12 @@ static int cpuid_test(void)
- }
- #endif
-
-+#ifdef __native_client__
-+#include "cpuid.h"
-+#define cpuid __cpuid
-+#define cpuid_test() 1
-+#endif /* __native_client__ */
-+
- /* Function to test if multimedia instructions are supported... */
- int ff_get_cpu_flags_x86(void)
- {
diff --git a/ports/libav/pkg_info b/ports/libav/pkg_info
deleted file mode 100644
index f3bf9fb..0000000
--- a/ports/libav/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=libav
-VERSION=9.6
-URL=http://libav.org/releases/libav-9.6.tar.xz
-LICENSE=GPL,LGPL
-CONFLICTS=(ffmpeg)
-# TODO(sbc): remove this conditional once this bug gets fixed:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-DISABLED_ARCH=(arm)
-DEPENDS=(lame libvorbis)
-SHA1=7c66e9776e83b13910eae960d63b7b86ad229dfe
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libbsd/build.sh b/ports/libbsd/build.sh
deleted file mode 100644
index 5184fdc..0000000
--- a/ports/libbsd/build.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2015 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.
-
-EXTRA_CONFIGURE_ARGS="--disable-largefile"
-
-export getline=getline
-
-EnableGlibcCompat
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- NACLPORTS_CPPFLAGS+=" -std=gnu99"
- export getline=__getline
-fi
-
-BuildHost() {
- HOST_BUILD_DIR=${WORK_DIR}/build_host
- HOST_INSTALL_DIR=${WORK_DIR}/install_host
- if [ ! -d ${HOST_INSTALL_DIR} ]; then
- Banner "Build host version"
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- LogExecute ${SRC_DIR}/configure
- LogExecute make -j${OS_JOBS}
- LogExecute make install DESTDIR=${HOST_INSTALL_DIR}
- cd -
- fi
-}
-
-BuildStep() {
- (unset getline && BuildHost)
- DefaultBuildStep
-}
diff --git a/ports/libbsd/nacl.patch b/ports/libbsd/nacl.patch
deleted file mode 100644
index fed1f30..0000000
--- a/ports/libbsd/nacl.patch
+++ /dev/null
@@ -1,191 +0,0 @@
-diff --git a/config.h.in b/config.h.in
---- a/config.h.in
-+++ b/config.h.in
-@@ -27,6 +27,9 @@
- /* Define to 1 if you have the `getline' function. */
- #undef HAVE_GETLINE
-
-+/* Define to 1 if you have the `__getline' function. */
-+#undef HAVE___GETLINE
-+
- /* Define to 1 if you have the <inttypes.h> header file. */
- #undef HAVE_INTTYPES_H
-
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -13017,7 +13030,7 @@ int
- main ()
- {
- extern char *__progname;
-- const char *p = __progname;
-+return (int)__progname;
- ;
- return 0;
- }
-@@ -13035,7 +13048,7 @@ fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
--for ac_func in clearenv dirfd fopencookie __fpurge getexecname getline sysconf
-+for ac_func in clearenv dirfd fopencookie __fpurge getexecname ${getline:-getline} sysconf
- do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
- ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
---- a/include/bsd/libutil.h
-+++ b/include/bsd/libutil.h
-@@ -39,7 +39,11 @@
- #ifndef _LIBUTIL_H_
- #define _LIBUTIL_H_
-
-+#ifdef _NEWLIB_VERSION
-+#include <sys/features.h>
-+#else
- #include <features.h>
-+#endif
- #include <sys/cdefs.h>
- #include <sys/types.h>
- #include <stdint.h>
-diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
---- a/include/bsd/stdio.h
-+++ b/include/bsd/stdio.h
-@@ -54,6 +54,7 @@ char *fgetln(FILE *fp, size_t *lenp);
- * as the code has to be modified anyway, we might just as well use the
- * correct declaration here.
- */
-+#ifndef _NEWLIB_VERSION
- FILE *funopen(const void *cookie,
- int (*readfn)(void *cookie, char *buf, int size),
- int (*writefn)(void *cookie, const char *buf, int size),
-@@ -62,6 +63,7 @@ FILE *funopen(const void *cookie,
-
- #define fropen(cookie, fn) funopen(cookie, fn, NULL, NULL, NULL)
- #define fwopen(cookie, fn) funopen(cookie, NULL, fn, NULL, NULL)
-+#endif
-
- int fpurge(FILE *fp);
- __END_DECLS
-diff --git a/src/err.c b/src/err.c
---- a/src/err.c
-+++ b/src/err.c
-@@ -24,22 +24,11 @@
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
--
- #include <err.h>
- #include <errno.h>
- #include <stdarg.h>
-
- void
--warnc(int code, const char *format, ...)
--{
-- va_list ap;
--
-- va_start(ap, format);
-- vwarnc(code, format, ap);
-- va_end(ap);
--}
--
--void
- vwarnc(int code, const char *format, va_list ap)
- {
- int tmp = errno;
-@@ -50,12 +39,12 @@ vwarnc(int code, const char *format, va_list ap)
- }
-
- void
--errc(int status, int code, const char *format, ...)
-+warnc(int code, const char *format, ...)
- {
- va_list ap;
-
- va_start(ap, format);
-- verrc(status, code, format, ap);
-+ vwarnc(code, format, ap);
- va_end(ap);
- }
-
-@@ -65,3 +54,13 @@ verrc(int status, int code, const char *format, va_list ap)
- errno = code;
- verr(status, format, ap);
- }
-+
-+void
-+errc(int status, int code, const char *format, ...)
-+{
-+ va_list ap;
-+
-+ va_start(ap, format);
-+ verrc(status, code, format, ap);
-+ va_end(ap);
-+}
-diff --git a/src/fgetln.c b/src/fgetln.c
---- a/src/fgetln.c
-+++ b/src/fgetln.c
-@@ -30,7 +30,7 @@
- #include <sys/types.h>
- #include <string.h>
-
--#ifdef HAVE_GETLINE
-+#if defined HAVE_GETLINE || defined (HAVE___GETLINE)
- struct filebuf {
- FILE *fp;
- char *buf;
-@@ -58,7 +58,11 @@ fgetln(FILE *stream, size_t *len)
- }
- fb->fp = stream;
-
-+#ifdef HAVE___GETLINE
-+ nread = __getline(&fb->buf, &fb->len, stream);
-+#else
- nread = getline(&fb->buf, &fb->len, stream);
-+#endif
- /* Note: the getdelim/getline API ensures nread != 0. */
- if (nread == -1) {
- *len = 0;
-diff --git a/src/funopen.c b/src/funopen.c
---- a/src/funopen.c
-+++ b/src/funopen.c
-@@ -30,6 +30,7 @@
- #include <stdlib.h>
- #include <stdio.h>
-
-+#ifndef _NEWLIB_VERSION
- #ifdef HAVE_FOPENCOOKIE
- struct funopen_cookie {
- void *orig_cookie;
-@@ -140,3 +141,4 @@ funopen(const void *cookie,
- #else
- #error "Function funopen() needs to be ported."
- #endif
-+#endif
-diff --git a/src/getpeereid.c b/src/getpeereid.c
---- a/src/getpeereid.c
-+++ b/src/getpeereid.c
-@@ -40,7 +40,7 @@ int
- getpeereid(int s, uid_t *euid, gid_t *egid)
- {
- /* XXX: This should be autodetected at build time instead. */
--#if defined(__linux__)
-+#if defined(__linux__) || defined(__native_client__)
- struct ucred cred;
- #elif defined(__OpenBSD__)
- struct sockpeercred cred;
-diff --git a/src/nlist.c b/src/nlist.c
---- a/src/nlist.c
-+++ b/src/nlist.c
-@@ -27,6 +27,7 @@
- * SUCH DAMAGE.
- */
-
-+#ifndef __native_client__
- #if defined(LIBC_SCCS) && !defined(lint)
- static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
- #endif /* LIBC_SCCS and not lint */
-@@ -421,3 +422,4 @@ elf_sym_to_nlist(nl, s, shdr, shnum)
- nl->n_type |= N_EXT;
- }
- #endif /* _NLIST_DO_ELF */
-+#endif /* not __native_client__*/
diff --git a/ports/libbsd/pkg_info b/ports/libbsd/pkg_info
deleted file mode 100644
index 3a3b871..0000000
--- a/ports/libbsd/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libbsd
-VERSION=0.7.0
-URL=http://libbsd.freedesktop.org/releases/libbsd-0.7.0.tar.xz
-LICENSE=BSD
-DEPENDS=(glibc-compat)
-SHA1=3039eb71dc72fd892c6ac7ef0eedbd288f8d5e25
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libebml/build.sh b/ports/libebml/build.sh
deleted file mode 100644
index c393983..0000000
--- a/ports/libebml/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXTRA_CONFIGURE_ARGS="--target=nacl"
diff --git a/ports/libebml/nacl.patch b/ports/libebml/nacl.patch
deleted file mode 100644
index ccf49a5..0000000
--- a/ports/libebml/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/ebml/EbmlBinary.h b/ebml/EbmlBinary.h
-index d617c98..5263a85 100644
---- a/ebml/EbmlBinary.h
-+++ b/ebml/EbmlBinary.h
-@@ -38,6 +38,7 @@
- #define LIBEBML_BINARY_H
-
- #include <cstring>
-+#include <stdlib.h>
-
- #include "EbmlTypes.h"
- #include "EbmlElement.h"
diff --git a/ports/libebml/pkg_info b/ports/libebml/pkg_info
deleted file mode 100644
index a62b945..0000000
--- a/ports/libebml/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=libebml
-VERSION=1.3.1
-URL=http://dl.matroska.org/downloads/libebml/libebml-1.3.1.tar.bz2
-SHA1=3b49d15b6744ab4e53b624e3fd529e1f5717b523
-LICENSE=LGPL2.1
diff --git a/ports/libelf/build.sh b/ports/libelf/build.sh
deleted file mode 100644
index 1df056b..0000000
--- a/ports/libelf/build.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015 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.
-
-INSTALL_TARGETS="install instroot=${DESTDIR}"
-
-if [[ ${NACL_ARCH} == pnacl ]]; then
- export libelf_cv_int32=int
- export libelf_cv_int16=short
-fi
diff --git a/ports/libelf/pkg_info b/ports/libelf/pkg_info
deleted file mode 100644
index 29daa2b..0000000
--- a/ports/libelf/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libelf
-VERSION=0.8.13
-URL=http://www.mr511.de/software/libelf-0.8.13.tar.gz
-LICENSE=GPL
-SHA1=c1d6ac5f182d19dd685c4dfd74eedbfe3992425d
-DEPENDS=(glibc-compat)
diff --git a/ports/libevent/README.nacl b/ports/libevent/README.nacl
deleted file mode 100644
index 2044bdd..0000000
--- a/ports/libevent/README.nacl
+++ /dev/null
@@ -1,49 +0,0 @@
-Libevent for NaCl
-=================
-
-This is a port of libevent (an event notification library) to NaCl platform.
-For details visit : http://libevent.org .
-
-**The library is "functional" albeit with some issues, this documents lists and
-keep track of all those.**
-
-1. **Callbacks due to signals are NOT supported.**
-
- **Reason:** nacl_io do not support POSIX signals.
-
- **Details:** sigaction(...) and signal(...) are not(yet) implemented on
- NaCl.io,thus the calls evsignal_add,evsignal_del,evsignal_pending should
- be avoided,also event_add/event_del when passed with EV_SIGNAL will
- also fail.
-
- For details about these functions visit :
- http://www.wangafu.net/~nickm/libevent-book/Ref4_event.html
-
- See /samples/hello-world.c for more details.
- To check if everything is working fine, run hello-world.nexe in nacl-devenv
- extension and point your browser to localhost:9995 and you should see "hello
- world".
-
- To debug/see implementation
- Look for /event.c, /signal.c and /evmap.c
- In /signal.c see function _evsig_set_handler and _evsig_restore_handler
-
- Typical function call
- event_add > event_add_internal > (if signal) evmap_signal_add > evsig_add
-
-2. **Post build tests are skipped.**
-
- **Reason:** setitimer and getitimer not available in newlib.
-
-3. **Build against glibc is not functional, ie either static linking fails or
- sometimes ELF header error pops up.**
-
- **Reason:** unknown (issue de-prioritized,toolchain disabled in pkg_info)
-
-**Notes**
-
- - Code in /samples/ (except hello-world.c) is not yet tested (or not yet
- modified to work on nacl platform)
- - Libevent uses socketpair(...) extensively, however the same is not
- implemented on nacl, thus custom implementation is used, to see details
- look for evutil_ersatz_socketpair(...) in /evutil.c
diff --git a/ports/libevent/build.sh b/ports/libevent/build.sh
deleted file mode 100644
index 109dcda..0000000
--- a/ports/libevent/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2015 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.
-
-EnableCliMain
-EnableGlibcCompat
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- # setitimer and getitimer not available in newlib, no plan to implement them
- # TODO(dt) remove this flag once this issue is sorted.
- EXTRA_CONFIGURE_ARGS+=" --disable-libevent-regress"
-fi
diff --git a/ports/libevent/nacl.patch b/ports/libevent/nacl.patch
deleted file mode 100644
index 2287a58..0000000
--- a/ports/libevent/nacl.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff --git a/evutil.c b/evutil.c
---- a/evutil.c
-+++ b/evutil.c
-@@ -183,9 +183,15 @@ int
- evutil_socketpair(int family, int type, int protocol, evutil_socket_t fd[2])
- {
- #ifndef WIN32
-- return socketpair(family, type, protocol, fd);
-+ #ifdef __native_client__
-+ // nacl.io lacks socketpair implementation.
-+ // TODO(dt) remove this once socketpair is available on nacl.io
-+ return evutil_ersatz_socketpair(family, type, protocol, fd);
-+ #else
-+ return socketpair(family, type, protocol, fd);
-+ #endif
- #else
-- return evutil_ersatz_socketpair(family, type, protocol, fd);
-+ return evutil_ersatz_socketpair(family, type, protocol, fd);
- #endif
- }
-
-@@ -2187,4 +2193,3 @@ evutil_load_windows_system_library(const TCHAR *library_name)
- return LoadLibrary(path);
- }
- #endif
--
-diff --git a/sample/hello-world.c b/sample/hello-world.c
---- a/sample/hello-world.c
-+++ b/sample/hello-world.c
-@@ -66,14 +66,19 @@ main(int argc, char **argv)
- if (!listener) {
- fprintf(stderr, "Could not create a listener!\n");
- return 1;
-- }
-+ } else {
-+ printf("\n listening on port %d\n",PORT);
-+ }
-
-+// nacl_io don't support signals
-+#ifndef __native_client__
- signal_event = evsignal_new(base, SIGINT, signal_cb, (void *)base);
-
- if (!signal_event || event_add(signal_event, NULL)<0) {
- fprintf(stderr, "Could not create/add a signal event!\n");
- return 1;
- }
-+#endif
-
- event_base_dispatch(base);
-
-@@ -129,6 +134,8 @@ conn_eventcb(struct bufferevent *bev, short events, void *user_data)
- bufferevent_free(bev);
- }
-
-+// nacl_io don't support signals
-+#ifndef __native_client__
- static void
- signal_cb(evutil_socket_t sig, short events, void *user_data)
- {
-@@ -139,3 +146,4 @@ signal_cb(evutil_socket_t sig, short events, void *user_data)
-
- event_base_loopexit(base, &delay);
- }
-+#endif
diff --git a/ports/libevent/pkg_info b/ports/libevent/pkg_info
deleted file mode 100644
index adfba2b..0000000
--- a/ports/libevent/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libevent
-VERSION=2.0.22-stable
-URL=http://download.sf.net/project/levent/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz
-LICENSE="3-clause BSD license"
-SHA1=a586882bc93a208318c70fc7077ed8fca9862864
-DEPENDS=(nacl-spawn glibc-compat)
-DISABLED_TOOLCHAIN=(emscripten glibc)
diff --git a/ports/libffi/build.sh b/ports/libffi/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libffi/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libffi/nacl.patch b/ports/libffi/nacl.patch
deleted file mode 100644
index 45c6b42..0000000
--- a/ports/libffi/nacl.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -17074,6 +17099,10 @@ fi
- TARGETDIR="unknown"
- HAVE_LONG_DOUBLE_VARIANT=0
- case "$host" in
-+ *nacl*)
-+ TARGET=NACL; TARGETDIR=x86
-+ ;;
-+
- aarch64*-*-*)
- TARGET=AARCH64; TARGETDIR=aarch64
- ;;
-diff --git a/src/types.c b/src/types.c
---- a/src/types.c
-+++ b/src/types.c
-@@ -33,6 +33,38 @@
-
- /* Type definitions */
-
-+#ifdef __native_client__
-+/*
-+ * Dummy implementation of libffi functions. This may be an incomplete
-+ * list. It was intented to be enough to allow glib to be built.
-+ * TODO(sbc): Remove this once we fix libffi:
-+ * https://code.google.com/p/naclports/issues/detail?id=183
-+ */
-+void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) {
-+ abort();
-+}
-+
-+ffi_status ffi_prep_cif_machdep(ffi_cif *cif) {
-+ abort();
-+ return FFI_BAD_ABI;
-+}
-+
-+ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif* cif,
-+ void (*fun)(ffi_cif*,void*,void**,void*), void *user_data, void *codeloc)
-+{
-+ abort();
-+ return FFI_BAD_ABI;
-+}
-+
-+ffi_status ffi_prep_raw_closure_loc(ffi_raw_closure *closure, ffi_cif *cif,
-+ void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data,
-+ void *codeloc) {
-+ abort();
-+ return FFI_BAD_ABI;
-+}
-+#endif
-+
-+
- #define FFI_TYPEDEF(name, type, id, maybe_const)\
- struct struct_align_##name { \
- char c; \
diff --git a/ports/libffi/pkg_info b/ports/libffi/pkg_info
deleted file mode 100644
index a57ac85..0000000
--- a/ports/libffi/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libffi
-VERSION=3.2.1
-URL=ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz
-LICENSE=custom
-DEPENDS=(glibc-compat)
-SHA1=280c265b789e041c02e5c97815793dfc283fb1e6
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libfontenc/pkg_info b/ports/libfontenc/pkg_info
deleted file mode 100644
index 8fa6244..0000000
--- a/ports/libfontenc/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libfontenc
-VERSION=1.1.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libfontenc-1.1.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(zlib xproto)
-SHA1=90bdd53d75585dd0f06ad7bc23faccd8a01bb733
diff --git a/ports/libgit2-demo/Makefile b/ports/libgit2-demo/Makefile
deleted file mode 100644
index bfc6f05..0000000
--- a/ports/libgit2-demo/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 2014 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.
-
-include $(NACL_SDK_ROOT)/tools/common.mk
-
-TARGET = libgit2-demo
-
-LIBS = git2 ssh2 ssl crypto z
-ifeq ($(TOOLCHAIN),newlib)
-LIBS += glibc-compat
-endif
-ifeq ($(TOOLCHAIN),pnacl)
-LIBS += glibc-compat
-endif
-ifeq ($(TOOLCHAIN),clang-newlib)
-LIBS += glibc-compat
-endif
-SOURCES = libgit2-demo.c operations.c
-INSTALL_DIR = $(NACL_PACKAGES_PUBLISH)/$(TARGET)/$(TOOLCHAIN)
-CFLAGS += -Wall -Werror
-
-ifeq ($(TOOLCHAIN),pnacl)
-EXEEXT=.pexe
-else
-EXEEXT=.nexe
-endif
-
-ifneq ($(TOOLCHAIN),pnacl)
-# We want the nmf to contain all the .nexe we have previously
-# built as well as the one currently being built, so we modify
-# the list of executables that we pass to create_nmf.
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_64$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_32$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_arm$(EXEEXT))
-endif
-
-# Build rules generated by macros from common.mk:
-
-$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
-
-ifeq ($(CONFIG),Release)
-$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
-$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
-else
-$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
-endif
-
-$(eval $(call NMF_RULE,$(TARGET),))
-
-install:
- mkdir -p $(INSTALL_DIR)
- cp $(OUTDIR)/$(TARGET)*$(EXEEXT) $(INSTALL_DIR)
- rm -f $(INSTALL_DIR)/*_unstripped*$(EXEEXT)
- cp $(OUTDIR)/$(TARGET).nmf $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),glibc)
- cp -r $(OUTDIR)/lib* $(INSTALL_DIR)
-endif
- cp httpd.py $(INSTALL_DIR)
- cp index.html $(INSTALL_DIR)
- cp background.js $(INSTALL_DIR)
- cp libgit2.js $(INSTALL_DIR)
- cp manifest.json $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),pnacl)
- sed -i.bak 's/x-nacl/x-pnacl/g' $(INSTALL_DIR)/index.html
-endif
diff --git a/ports/libgit2-demo/background.js b/ports/libgit2-demo/background.js
deleted file mode 100644
index 8ff8092..0000000
--- a/ports/libgit2-demo/background.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2014 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function(launchData) {
- chrome.app.window.create('index.html', {
- 'id': 'main',
- 'innerBounds': {
- 'width': 800,
- 'height': 600
- }
- });
-});
diff --git a/ports/libgit2-demo/build.sh b/ports/libgit2-demo/build.sh
deleted file mode 100644
index 842123c..0000000
--- a/ports/libgit2-demo/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright 2014 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.
-
-EnableCliMain
-SetupSDKBuildSystem
diff --git a/ports/libgit2-demo/httpd.py b/ports/libgit2-demo/httpd.py
deleted file mode 100755
index 2d86cbc..0000000
--- a/ports/libgit2-demo/httpd.py
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 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.
-
-"""
-An example HTTP server that returns the correct CORS headers for using with the
-libgit2 URL transport scheme.
-
-The libgit2-demo allows you to use two alternate schemes: "pepper_http://" and
-"pepper_https://" to communicate with remote git servers. These schemes will
-communicate using the Pepper URLLoader interface instead of Pepper TCPSocket
-interface. URLLoader is available to all Native Client applications, but
-TCPSockets are only available to Chrome Apps.
-
-These alternate schemes require the git server to respond with specific CORS
-headers, which as of this writing, most git servers don't do. This server shows
-gives an example of a CGI script that calls git http-backend, as well as
-returning the correct CORS headers.
-
-To use this script, run it in the directory you want to serve from. It must
-contain a subdirectory "git" which contains one or more subdirectories for your
-git repositories. e.g.
-
- serve_root/
- serve_root/git
- serve_root/git/my_repo1
- serve_root/git/my_repo2
- etc.
-
-These git repositories can then be accessed via the following URLs:
-
- http://localhost:8080/git/my_repo1
- http://localhost:8080/git/my_repo2
- etc.
-
-If you use these URLs in the libgit2-demo, it will use the Pepper socket API.
-to use the URLLoader interface, you must instead use the alternate schemes:
-
- pepper_http://localhost:8080/git/my_repo1
- pepper_http://localhost:8080/git/my_repo2
-
-"""
-
-import os
-import select
-import subprocess
-import urlparse
-from SimpleHTTPServer import SimpleHTTPRequestHandler
-
-class GetHandler(SimpleHTTPRequestHandler):
- def do_GET(self):
- if self.handle_git('GET'):
- return
- SimpleHTTPRequestHandler.do_GET(self)
-
- def do_HEAD(self):
- if self.handle_git('HEAD'):
- return
- SimpleHTTPRequestHandler.do_HEAD(self)
-
- def do_OPTIONS(self):
- self.send_response(200, 'Script output follows')
- self.send_header('Access-Control-Allow-Origin', '*')
- self.send_header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS')
- self.send_header('Access-Control-Allow-Headers', 'content-type')
- self.end_headers()
-
- def do_POST(self):
- if self.handle_git('POST'):
- return
- SimpleHTTPRequestHandler.do_POST(self)
-
- def handle_git(self, method):
- parsed_path = urlparse.urlparse(self.path)
- if not parsed_path.path.startswith('/git/'):
- return False
-
- path_no_git = parsed_path.path[len('/git/'):]
- first_slash = path_no_git.find('/')
- if first_slash < 0:
- return False
-
- # Assume that all git projects are in /git/<PROJECT NAME>
- git_project_root = path_no_git[:first_slash]
- path_info = path_no_git[first_slash:]
-
- env = dict(os.environ)
- env['GIT_HTTP_EXPORT_ALL'] = '1'
- env['REQUEST_METHOD'] = method
- env['QUERY_STRING'] = parsed_path.query
- env['PATH_INFO'] = path_info
- env['GIT_PROJECT_ROOT'] = os.path.join(os.getcwd(), 'git', git_project_root)
- env['REMOTE_USER'] = 'git-user'
-
- if self.headers.typeheader is None:
- env['CONTENT_TYPE'] = self.headers.type
- else:
- env['CONTENT_TYPE'] = self.headers.typeheader
- length = self.headers.getheader('content-length')
- if length:
- env['CONTENT_LENGTH'] = length
-
- nbytes = 0
- if length is not None:
- nbytes = int(length)
-
- self.send_response(200, 'Script output follows')
- self.send_header('Access-Control-Allow-Origin', '*')
-
- # from CGIHTTPServer.CGIHTTPRequestHandler
- p = subprocess.Popen(['git', 'http-backend'],
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- env=env)
- if method == "POST" and nbytes > 0:
- data = self.rfile.read(nbytes)
- else:
- data = None
- # throw away additional data [see bug #427345]
- while select.select([self.rfile._sock], [], [], 0)[0]:
- if not self.rfile._sock.recv(1):
- break
- stdout, stderr = p.communicate(data)
- self.wfile.write(stdout)
- if stderr:
- self.log_error('%s', stderr)
- p.stderr.close()
- p.stdout.close()
- status = p.returncode
- if status:
- self.log_error("CGI script exit status %#x", status)
- else:
- self.log_message("CGI script exited OK")
- return True
-
-
-if __name__ == '__main__':
- from BaseHTTPServer import HTTPServer
- server = HTTPServer(('localhost', 8080), GetHandler)
- print 'Starting server, use <Ctrl-C> to stop'
- server.serve_forever()
diff --git a/ports/libgit2-demo/index.html b/ports/libgit2-demo/index.html
deleted file mode 100644
index 6fafb76..0000000
--- a/ports/libgit2-demo/index.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!-- Copyright 2014 Google Inc. All rights reserved. -->
-<head>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <title>Native Client libgit2 demo</title>
- <script type="text/javascript" src="libgit2.js"></script>
-</head>
-
-<body>
- <h1>Native Client libgit2 demo</h1>
- <embed name="nacl_module"
- width=0,
- height=0,
- PWD="/tmp",
- id="nacl_module"
- src="libgit2-demo.nmf"
- type="application/x-nacl">
- <p>
- This demo embeds an invisible NaCl element in the page which can recieve
- requests vis postMessage to perform various git operation using the libgit2
- library.
- </p>
- <p>
- Clone and push normally will use the Pepper socket interface. These APIs
- are only available when running as a Chrome App.
- </p>
- <p>
- You can also use Pepper URL Loader as a transport for the
- <code>http://</code> and <code>https://</code> schemes, by using
- <code>pepper_http://</code> and <code>pepper_https://</code> instead. These
- will always work, but they require coordination with the server; if the git
- server is on a different origin, they must respond with the correct CORS
- headers. See httpd.py in this directory for an example.
- </p>
- <p>
- Working directory: <input type="text" id="directory" value="/tmp/test"></br>
- Clone URL: <input size="50" type="text" id="clone_url"
- value="https://github.com/google/adb-sync.git"></br>
- Commit filename: <input size="50" type="text" id="commit_filename"
- value="foobar"></br>
- Push Refspec: <input size="50" type="text" id="push_refspec"
- value="refs/heads/master:refs/heads/master"></br>
- </p>
- <p>
- <button id="clone">clone</button>
- <button id="init">init</button>
- <button id="status">status</button>
- <button id="mount">mount filesystem</button>
- <button id="commit">commit file</button>
- <button id="push">push</button>
- </p>
- <p>
- Output:
- </p>
- <textarea cols="80" rows="20" id="output" readonly></textarea>
-</body>
-</html>
diff --git a/ports/libgit2-demo/libgit2-demo.c b/ports/libgit2-demo/libgit2-demo.c
deleted file mode 100644
index 64de7a0..0000000
--- a/ports/libgit2-demo/libgit2-demo.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* Copyright 2014 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. */
-
-#include "operations.h"
-
-#include <alloca.h>
-#include <assert.h>
-#include <errno.h>
-#include <git2.h>
-#include <git2/transport.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <ppapi/c/pp_errors.h>
-#include <ppapi/c/pp_var.h>
-#include <ppapi/c/ppb_messaging.h>
-#include <ppapi/c/ppb_var_array.h>
-#include <ppapi/c/ppb_var.h>
-#include <ppapi_simple/ps.h>
-#include <ppapi_simple/ps_event.h>
-
-const struct PPB_Var_1_2* var_iface = NULL;
-const struct PPB_VarArray_1_0* array_iface = NULL;
-const struct PPB_Messaging_1_0* msg_iface = NULL;
-
-void post_message(const char* message) {
- struct PP_Var var = var_iface->VarFromUtf8(message, strlen(message));
- msg_iface->PostMessage(PSGetInstanceId(), var);
- var_iface->Release(var);
-}
-
-void handle_cmd(const char* cmd, const char* repo_directory, const char* arg) {
- if (!strcmp(cmd, "clone")) {
- do_git_clone(repo_directory, arg);
- } else if (!strcmp(cmd, "push")) {
- do_git_push(repo_directory, arg);
- } else if (!strcmp(cmd, "commit")) {
- do_git_commit(repo_directory, arg);
- } else if (!strcmp(cmd, "init")) {
- do_git_init(repo_directory);
- } else if (!strcmp(cmd, "status")) {
- do_git_status(repo_directory);
- } else {
- output("Got unhandled cmd=%s\n", cmd);
- }
-}
-
-void do_mount(PP_Resource filesystem, const char* prefix, const char* dir) {
- char options[64];
- snprintf(options, 64, "filesystem_resource=%d,SOURCE=%s", filesystem, prefix);
- output("mounting filesystem at %s [%s]\n", dir, options);
- int rtn = mount("/", dir, "html5fs", 0, options);
- if (rtn != 0)
- output("mount failed: %s\n", strerror(errno));
- struct stat buf;
- char full[512];
- sprintf(full, "%s/gyp", dir);
- if (stat(full, &buf) != 0) {
- output("stat failed (%s): %s\n", full, strerror(errno));
- return;
- }
- output("st_mode %#x\n", buf.st_mode);
-}
-
-void handle_message(struct PP_Var message) {
- uint32_t len;
- char* cmd;
- char* repo_directory;
- const char* var_str;
- char* arg = NULL;
- struct PP_Var var;
-
- // Extract command from incoming array of strings
- if (message.type != PP_VARTYPE_ARRAY) {
- output("Got unexpected message type from js: %d\n", message.type);
- return;
- }
-
- var = array_iface->Get(message, 0);
- assert(var.type == PP_VARTYPE_STRING);
- var_str = var_iface->VarToUtf8(var, &len);
- cmd = alloca(len + 1);
- memcpy(cmd, var_str, len);
- cmd[len] = '\0';
- var_iface->Release(var);
-
- var = array_iface->Get(message, 1);
- assert(var.type == PP_VARTYPE_STRING);
- var_str = var_iface->VarToUtf8(var, &len);
- repo_directory = alloca(len + 1);
- memcpy(repo_directory, var_str, len);
- repo_directory[len] = '\0';
- var_iface->Release(var);
-
- if (array_iface->GetLength(message) > 2) {
- var = array_iface->Get(message, 2);
- if (!strcmp(cmd, "mount") && var.type == PP_VARTYPE_RESOURCE) {
- char* prefix;
- PP_Resource fs = var_iface->VarToResource(var);
- var = array_iface->Get(message, 3);
- var_str = var_iface->VarToUtf8(var, &len);
- prefix = alloca(len + 1);
- memcpy(prefix, var_str, len);
- prefix[len] = '\0';
- var_iface->Release(var);
- // special handling for 'mount' command
- do_mount(fs, prefix, repo_directory);
- return;
- }
- if (var.type != PP_VARTYPE_STRING) {
- output("Got unexpected arg type from js: %d\n", var.type);
- return;
- }
- var_str = var_iface->VarToUtf8(var, &len);
- arg = alloca(len + 1);
- memcpy(arg, var_str, len);
- arg[len] = '\0';
- var_iface->Release(var);
- }
-
- handle_cmd(cmd, repo_directory, arg);
-}
-
-git_smart_subtransport_definition pepper_http_subtransport_definition = {
- git_smart_subtransport_pepper_http,
- 1 /* use rpc */
-};
-
-int main(int argc, char** argv) {
- srand(123);
- int rtn = git_threads_init();
- if (rtn) {
- output("git_threads_init failed: %d\n", rtn);
- return 1;
- }
-
- rtn = git_smart_subtransport_pepper_http_init(PSGetInstanceId(),
- PSGetInterface);
- if (rtn) {
- const git_error* err = giterr_last();
- output("git_smart_subtransport_pepper_http_init failed %d [%d] %s\n", rtn,
- err->klass, err->message);
- return 1;
- }
-
- git_transport_register("pepper_http://", 2, git_transport_smart,
- &pepper_http_subtransport_definition);
-
- git_transport_register("pepper_https://", 2, git_transport_smart,
- &pepper_http_subtransport_definition);
-
- var_iface = PSGetInterface(PPB_VAR_INTERFACE_1_2);
- array_iface = PSGetInterface(PPB_VAR_ARRAY_INTERFACE_1_0);
- msg_iface = PSGetInterface(PPB_MESSAGING_INTERFACE_1_0);
- assert(var_iface);
- assert(array_iface);
- assert(msg_iface);
-
- PSEventSetFilter(PSE_INSTANCE_HANDLEMESSAGE);
- while (1) {
- PSEvent* event = PSEventWaitAcquire();
- if (event->type != PSE_INSTANCE_HANDLEMESSAGE)
- output("unexpected message type: %d\n", event->type);
- handle_message(event->as_var);
- PSEventRelease(event);
- }
- return 0;
-}
diff --git a/ports/libgit2-demo/libgit2.js b/ports/libgit2-demo/libgit2.js
deleted file mode 100644
index 491dc9c..0000000
--- a/ports/libgit2-demo/libgit2.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2014 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.
- */
-
-'use strict';
-function runGitCmd(message, arg1, arg2) {
- var dir = document.getElementById('directory').value;
- if (arg2 && arg1) {
- window.embed.postMessage([message, dir, arg1, arg2]);
- } else if (arg1) {
- window.embed.postMessage([message, dir, arg1]);
- } else {
- window.embed.postMessage([message, dir]);
- }
-}
-
-function clone() {
- var url = document.getElementById('clone_url').value;
- runGitCmd('clone', url);
-}
-
-function chdir() {
- runGitCmd('chdir');
-}
-
-function init() {
- runGitCmd('init');
-}
-
-function status() {
- runGitCmd('status');
-}
-
-function mount() {
- chrome.fileSystem.chooseEntry({type:"openDirectory"}, function(entry) {
- runGitCmd('mount', entry.filesystem, entry.fullPath);
- });
-}
-
-function push() {
- var refspec = document.getElementById('push_refspec').value;
- runGitCmd('push', refspec);
-}
-
-function commit() {
- var filename = document.getElementById('commit_filename').value;
- runGitCmd('commit', filename);
-}
-
-function handleMessage(message) {
- var output = document.getElementById('output');
- output.value += message.data;
- output.scrollTop = output.scrollHeight;
-}
-
-function onLoad() {
- window.embed = document.getElementById('nacl_module');
- window.embed.addEventListener('message', handleMessage, true);
- document.getElementById('init').addEventListener('click', init);
- document.getElementById('clone').addEventListener('click', clone);
- document.getElementById('status').addEventListener('click', status);
- document.getElementById('mount').addEventListener('click', mount);
- document.getElementById('push').addEventListener('click', push);
- document.getElementById('commit').addEventListener('click', commit);
-}
-
-window.onload = onLoad;
diff --git a/ports/libgit2-demo/manifest.json b/ports/libgit2-demo/manifest.json
deleted file mode 100644
index e29e669..0000000
--- a/ports/libgit2-demo/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "libgit2-demo",
- "description": "Demo of libgit2 running in nacl",
- "version": "0.0.0.1",
- "manifest_version": 2,
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "permissions": [
- "storage",
- "unlimitedStorage",
- { "fileSystem": ["write", "directory", "retainEntries"] },
- { "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/libgit2-demo/operations.c b/ports/libgit2-demo/operations.c
deleted file mode 100644
index a0a3ff1..0000000
--- a/ports/libgit2-demo/operations.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/* Copyright 2014 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. */
-
-/*
- * Sample set of libgit2 operations. The code in this file is generic
- * and should not depend on PPAPI or chrome (i.e. it should run just
- * run on desktop linux).
- */
-
-#include "operations.h"
-
-#include <dirent.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <git2.h>
-
-static void voutput(const char* message, va_list args) {
- va_list args_copy;
- va_copy(args_copy, args);
-
- // First send to stdout
- vfprintf(stdout, message, args);
-
- // Next send via postmessage
- char buffer[1024];
- vsnprintf(buffer, 1024, message, args_copy);
- post_message(buffer);
- va_end(args_copy);
-}
-
-void output(const char* message, ...) {
- va_list ap;
- va_start(ap, message);
- voutput(message, ap);
- va_end(ap);
-}
-
-static int transfer_progress(const git_transfer_progress* stats,
- void* payload) {
- output("transfered: %d/%d %d KiB\n", stats->received_objects,
- stats->total_objects, stats->received_bytes / 1024);
- return 0;
-}
-
-static int status_callback(const char* path,
- unsigned int flags,
- void* payload) {
- output("%#x: %s\n", flags, path);
- return 0;
-}
-
-git_repository* init_repo(const char* repo_directory) {
- git_repository* repo = NULL;
- int rtn = git_repository_open(&repo, repo_directory);
- if (rtn != 0) {
- const git_error* err = giterr_last();
- output("git_repository_open failed %d [%d] %s\n", rtn, err->klass,
- err->message);
- return NULL;
- }
-
- return repo;
-}
-
-void do_git_status(const char* repo_directory) {
- time_t start = time(NULL);
- output("status: %s\n", repo_directory);
- git_repository* repo = init_repo(repo_directory);
- if (!repo)
- return;
-
- int rtn = git_status_foreach(repo, status_callback, NULL);
- if (rtn == 0) {
- output("status success [%d]\n", time(NULL) - start);
- } else {
- const git_error* err = giterr_last();
- output("status failed %d [%d] %s\n", rtn, err->klass, err->message);
- }
-
- git_repository_free(repo);
-
- output("%s contents:\n", repo_directory);
- DIR* dir = opendir(repo_directory);
- struct dirent* ent;
- while ((ent = readdir(dir)) != NULL) {
- output(" %s\n", ent->d_name);
- }
- closedir(dir);
-}
-
-void do_git_init(const char* repo_directory) {
- output("init new git repo: %s\n", repo_directory);
- git_repository* repo;
- git_repository_init_options options = GIT_REPOSITORY_INIT_OPTIONS_INIT;
- options.flags = GIT_REPOSITORY_INIT_NO_REINIT | GIT_REPOSITORY_INIT_MKPATH;
- int rtn = git_repository_init_ext(&repo, repo_directory, &options);
- if (rtn == 0) {
- output("init success: %s\n", repo_directory);
- } else {
- const git_error* err = giterr_last();
- output("init failed %d [%d] %s\n", rtn, err->klass, err->message);
- }
-
- git_repository_free(repo);
-}
-
-void do_git_clone(const char* repo_directory, const char* url) {
- git_repository* repo;
- git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
- callbacks.transfer_progress = &transfer_progress;
-
- git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
- opts.remote_callbacks = callbacks;
- opts.ignore_cert_errors = 1;
-
- output("cloning %s -> %s\n", url, repo_directory);
- int rtn = git_clone(&repo, url, repo_directory, &opts);
- if (rtn == 0) {
- output("clone success\n");
- git_repository_free(repo);
- } else {
- const git_error* err = giterr_last();
- output("clone failed %d [%d] %s\n", rtn, err->klass, err->message);
- }
-}
-
-void do_git_push(const char* repo_directory, const char* refspec) {
- git_repository* repo = init_repo(repo_directory);
- if (!repo)
- return;
-
- git_push_options opts = GIT_PUSH_OPTIONS_INIT;
- git_push* push = NULL;
- git_remote* remote = NULL;
- const git_error* err = NULL;
- const char* failure = NULL;
-
- int rtn;
- rtn = git_remote_load(&remote, repo, "origin");
- if (rtn != 0) {
- failure = "git_remote_load";
- goto error;
- }
-
- output("pushing %s [%s]\n", repo_directory, refspec);
- rtn = git_push_new(&push, remote);
- if (rtn != 0) {
- failure = "git_push_new";
- goto error;
- }
-
- rtn = git_push_set_options(push, &opts);
- if (rtn != 0) {
- failure = "git_push_set_options";
- goto error;
- }
-
- rtn = git_push_add_refspec(push, refspec);
- if (rtn != 0) {
- failure = "git_push_add_refspec";
- goto error;
- }
-
- rtn = git_push_finish(push);
- if (rtn != 0) {
- failure = "git_push_finish";
- goto error;
- }
-
- rtn = git_push_unpack_ok(push);
- if (rtn == 0) {
- failure = "git_push_unpack_ok";
- goto error;
- }
-
- goto cleanup;
-
-error:
- err = giterr_last();
- if (err) {
- output("%s failed %d [%d] %s\n", failure, rtn, err->klass, err->message);
- } else {
- output("%s failed %d <unknown error>\n", failure, rtn);
- }
- return;
-
-cleanup:
- git_push_free(push);
- git_remote_free(remote);
- git_repository_free(repo);
-
- output("push success\n");
-}
-
-int index_matched_path_cb(const char* path,
- const char* matched_pathspec,
- void* payload) {
- output("update_all matched: %s\n", path);
- return 0;
-}
-
-void do_git_commit(const char* repo_directory, const char* filename) {
- const char kUserName[] = "Foo Bar";
- const char kUserEmail[] = "foobar@example.com";
- const size_t kFileSize = 1024 * 50;
-
- int rtn;
- char buffer[1024];
- git_signature* sig = NULL;
- const char* failure = NULL;
- git_repository* repo = init_repo(repo_directory);
- git_index* index = NULL;
- git_oid tree_id;
- git_oid head_id;
- git_commit* parent = NULL;
- git_oid commit_id;
- git_tree* tree = NULL;
- FILE* f = NULL;
- const git_error* err = NULL;
-
- if (!repo)
- return;
-
- output("committing %s (%d random bytes) as \"%s <%s>\"\n", filename,
- kFileSize, kUserName, kUserEmail);
-
- rtn = git_signature_now(&sig, kUserName, kUserEmail);
- if (rtn != 0) {
- failure = "git_signature_now";
- goto error;
- }
-
- rtn = git_repository_index(&index, repo);
- if (rtn != 0) {
- failure = "git_repository_index";
- goto error;
- }
-
- rtn = git_index_read(index, 1);
- if (rtn != 0) {
- failure = "git_index_read";
- goto error;
- }
-
- snprintf(buffer, 1024, "%s/%s", repo_directory, filename);
-
- f = fopen(buffer, "wb");
- if (!f) {
- failure = "fopen";
- goto error;
- }
-
- size_t size_left = kFileSize;
- while (size_left > 0) {
- int i;
- size_t buffer_len = size_left;
- if (buffer_len > 1024)
- buffer_len = 1024;
-
- for (i = 0; i < buffer_len; ++i) {
- buffer[i] = rand() % 256;
- }
-
- if (fwrite(&buffer, 1, buffer_len, f) != buffer_len) {
- failure = "fwrite";
- goto error;
- }
- size_left -= buffer_len;
- }
-
- fclose(f);
- f = NULL;
-
- const char* paths[] = {"*"};
- git_strarray arr = {(char**)paths, 1};
- rtn = git_index_add_all(index, &arr, GIT_INDEX_ADD_DEFAULT,
- index_matched_path_cb, NULL);
- if (rtn != 0) {
- failure = "git_index_update_all";
- goto error;
- }
-
- rtn = git_index_write_tree(&tree_id, index);
- if (rtn != 0) {
- failure = "git_index_write_tree";
- goto error;
- }
-
- rtn = git_tree_lookup(&tree, repo, &tree_id);
- if (rtn != 0) {
- failure = "git_tree_lookup";
- goto error;
- }
-
- rtn = git_reference_name_to_id(&head_id, repo, "HEAD");
- if (rtn != 0) {
- failure = "git_reference_name_to_id";
- goto error;
- }
-
- rtn = git_commit_lookup(&parent, repo, &head_id);
- if (rtn != 0) {
- failure = "git_commit_lookup";
- goto error;
- }
-
- snprintf(buffer, 1024, "Add file %s", filename);
-
- rtn = git_commit_create_v(&commit_id, repo, "HEAD", sig, sig, NULL, buffer,
- tree, 1, parent);
- if (rtn != 0) {
- failure = "git_commit_create_v";
- goto error;
- }
-
- goto cleanup;
-
-error:
- err = giterr_last();
- if (err) {
- output("%s failed %d [%d] %s\n", failure, rtn, err->klass, err->message);
- } else {
- output("%s failed %d <unknown error>\n", failure, rtn);
- }
-
- return;
-
-cleanup:
- if (f)
- fclose(f);
-
- git_commit_free(parent);
- git_tree_free(tree);
- git_index_free(index);
- git_repository_free(repo);
- git_signature_free(sig);
-
- output("commit success\n");
-}
diff --git a/ports/libgit2-demo/operations.h b/ports/libgit2-demo/operations.h
deleted file mode 100644
index 2681a22..0000000
--- a/ports/libgit2-demo/operations.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Copyright 2014 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. */
-#ifndef LIBGIT2_DEMO_OPERATIONS_H_
-#define LIBGIT2_DEMO_OPERATIONS_H_
-
-void post_message(const char* message);
-void output(const char* message, ...);
-
-void do_git_status(const char* repo_dir);
-void do_git_clone(const char* repo_dir, const char* url);
-void do_git_init(const char* repo_dir);
-void do_git_push(const char* repo_dir, const char* refspec);
-void do_git_commit(const char* repo_dir, const char* filename);
-
-#endif
diff --git a/ports/libgit2-demo/pkg_info b/ports/libgit2-demo/pkg_info
deleted file mode 100644
index a3df598..0000000
--- a/ports/libgit2-demo/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=libgit2-demo
-VERSION=0.1
-DISABLED_TOOLCHAIN=(emscripten)
-DEPENDS=(libgit2 nacl-spawn)
diff --git a/ports/libgit2/README.nacl b/ports/libgit2/README.nacl
deleted file mode 100644
index 74b069f..0000000
--- a/ports/libgit2/README.nacl
+++ /dev/null
@@ -1,13 +0,0 @@
-This port of libgit2 has been extended with a new transport layer. Normally
-libgit2 uses POSIX sockets to communicate with remote git servers. These APIs
-are available in Pepper (via nacl_io), but can only be used with Chrome Apps,
-not when running on the open web.
-
-The new transport layer uses the Pepper URLLoader interface, which is
-equivalent to a JavaScript XMLHttpRequest. This is allowed for all Native
-Client applications. The one drawback is that this requires cooperation with
-the git server to return the correct CORS headers. The httpd.py Python server
-in the libgit2-demo example shows how to do this.
-
-To use this new transport layer, you must register it with a custom URL scheme.
-See the libgit2-demo for an example of this.
diff --git a/ports/libgit2/build.sh b/ports/libgit2/build.sh
deleted file mode 100644
index a62fee0..0000000
--- a/ports/libgit2/build.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES="libgit2_clar"
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CMAKE_ARGS="-DBUILD_SHARED_LIBS=OFF"
-fi
-
-EnableGlibcCompat
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- # newlib headers generate a lot of char-subscript warnings
- # for macros such as tolower()
- NACLPORTS_CPPFLAGS+=" -Wno-char-subscripts"
- if [ "$NACL_ARCH" != "arm" ]; then
- # Our x86 version of gcc generates a lot of strict aliasing
- # warnings.
- NACLPORTS_CPPFLAGS+=" -fno-strict-aliasing"
- fi
-fi
diff --git a/ports/libgit2/nacl.patch b/ports/libgit2/nacl.patch
deleted file mode 100644
index fe80b48..0000000
--- a/ports/libgit2/nacl.patch
+++ /dev/null
@@ -1,1102 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -91,6 +91,10 @@ FUNCTION(TARGET_OS_LIBRARIES target)
- TARGET_LINK_LIBRARIES(${target} rt)
- SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE)
- ENDIF()
-+ IF("$ENV{NACL_LIBC}" STREQUAL "newlib")
-+ TARGET_LINK_LIBRARIES(${target} glibc-compat)
-+ SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lglibc-compat" PARENT_SCOPE)
-+ ENDIF()
-
- IF(THREADSAFE)
- TARGET_LINK_LIBRARIES(${target} ${CMAKE_THREAD_LIBS_INIT})
-@@ -364,6 +368,8 @@ FILE(GLOB SRC_H include/git2.h include/git2/*.h include/git2/sys/*.h)
- IF (WIN32 AND NOT CYGWIN)
- ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0501)
- FILE(GLOB SRC_OS src/win32/*.c src/win32/*.h)
-+ELSEIF (NACL)
-+ ADD_DEFINITIONS(-DNO_MMAP)
- ELSEIF (AMIGA)
- ADD_DEFINITIONS(-DNO_ADDRINFO -DNO_READDIR_R -DNO_MMAP)
- ELSE()
-@@ -385,8 +391,8 @@ ENDIF()
-
- # Compile and link libgit2
- ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1} ${WIN_RC})
--TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
- TARGET_LINK_LIBRARIES(git2 ${SSH_LIBRARIES})
-+TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
- TARGET_LINK_LIBRARIES(git2 ${ICONV_LIBRARIES})
- TARGET_OS_LIBRARIES(git2)
-
-@@ -451,8 +457,8 @@ IF (BUILD_CLAR)
-
- ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1})
-
-- TARGET_LINK_LIBRARIES(libgit2_clar ${SSL_LIBRARIES})
- TARGET_LINK_LIBRARIES(libgit2_clar ${SSH_LIBRARIES})
-+ TARGET_LINK_LIBRARIES(libgit2_clar ${SSL_LIBRARIES})
- TARGET_LINK_LIBRARIES(libgit2_clar ${ICONV_LIBRARIES})
- TARGET_OS_LIBRARIES(libgit2_clar)
- MSVC_SPLIT_SOURCES(libgit2_clar)
-diff --git a/include/git2/transport.h b/include/git2/transport.h
---- a/include/git2/transport.h
-+++ b/include/git2/transport.h
-@@ -11,6 +11,11 @@
- #include "net.h"
- #include "types.h"
-
-+#ifdef __native_client__
-+#include <ppapi/c/pp_instance.h>
-+#include <ppapi/c/ppb.h>
-+#endif
-+
- /**
- * @file git2/transport.h
- * @brief Git transport interfaces and functions
-@@ -514,6 +519,33 @@ GIT_EXTERN(int) git_smart_subtransport_http(
- git_smart_subtransport **out,
- git_transport* owner);
-
-+#ifdef __native_client__
-+/**
-+ * This function must be called before using git_smart_subtransport_pepper_http.
-+ * It will initialize
-+ */
-+GIT_EXTERN(int) git_smart_subtransport_pepper_http_init(
-+ PP_Instance instance,
-+ PPB_GetInterface get_interface);
-+
-+/**
-+ * Create an instance of the pepper http subtransport. This subtransport
-+ * also supports https.
-+ *
-+ * This will use the Pepper URLLoader interface rather than sockets. This will
-+ * allow libgit2 to be used without socket permission, though it requires the
-+ * git server to be on the same origin, or to respond with the correct CORS
-+ * headers (most git servers don't).
-+ *
-+ * @param out The newly created subtransport
-+ * @param owner The smart transport to own this subtransport
-+ * @return 0 or an error code
-+ */
-+GIT_EXTERN(int) git_smart_subtransport_pepper_http(
-+ git_smart_subtransport **out,
-+ git_transport* owner);
-+#endif
-+
- /**
- * Create an instance of the git subtransport.
- *
-diff --git a/src/indexer.c b/src/indexer.c
---- a/src/indexer.c
-+++ b/src/indexer.c
-@@ -437,12 +437,17 @@ static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t
- page_start = (offset / page_size) * page_size;
- page_offset = offset - page_start;
-
-+#ifdef NO_MMAP
-+ if ((error = pwrite(fd, data, size, offset)) < 0)
-+ return error;
-+#else
- if ((error = p_mmap(&map, page_offset + size, GIT_PROT_WRITE, GIT_MAP_SHARED, fd, page_start)) < 0)
- return error;
-
- map_data = (unsigned char *)map.data;
- memcpy(map_data + page_offset, data, size);
- p_munmap(&map);
-+#endif
-
- return 0;
- }
-diff --git a/src/pool.c b/src/pool.c
---- a/src/pool.c
-+++ b/src/pool.c
-@@ -312,7 +312,7 @@ uint32_t git_pool__system_page_size(void)
- #elif defined(__amigaos4__)
- size = (uint32_t)4096; /* 4K as there is no global value we can query */
- #else
-- size = (uint32_t)sysconf(_SC_PAGE_SIZE);
-+ size = (uint32_t)sysconf(_SC_PAGESIZE);
- #endif
-
- size -= 2 * sizeof(void *); /* allow space for malloc overhead */
-diff --git a/src/posix.h b/src/posix.h
---- a/src/posix.h
-+++ b/src/posix.h
-@@ -12,6 +12,10 @@
- #include <time.h>
- #include "fnmatch.h"
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+mode_t umask(mode_t cmask);
-+#endif
-+
- #ifndef S_IFGITLINK
- #define S_IFGITLINK 0160000
- #define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
-diff --git a/src/transports/pepperhttp.c b/src/transports/pepperhttp.c
-new file mode 100644
---- /dev/null
-+++ b/src/transports/pepperhttp.c
-@@ -0,0 +1,621 @@
-+/* Copyright 2014 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. */
-+
-+#ifdef __native_client__
-+
-+#include "git2.h"
-+#include "http_parser.h"
-+#include "buffer.h"
-+#include "netops.h"
-+#include "smart.h"
-+
-+#include <ppapi/c/pp_errors.h>
-+#include <ppapi/c/pp_resource.h>
-+#include <ppapi/c/pp_var.h>
-+#include <ppapi/c/ppb_core.h>
-+#include <ppapi/c/ppb_url_loader.h>
-+#include <ppapi/c/ppb_url_request_info.h>
-+#include <ppapi/c/ppb_url_response_info.h>
-+#include <ppapi/c/ppb_var.h>
-+#include <ppapi_simple/ps.h>
-+
-+static PP_Instance pp_instance;
-+static const struct PPB_Core_1_0* core_iface;
-+static const struct PPB_Var_1_2* var_iface;
-+static const struct PPB_URLLoader_1_0* url_loader_iface;
-+static const struct PPB_URLRequestInfo_1_0* url_request_info_iface;
-+static const struct PPB_URLResponseInfo_1_0* url_response_info_iface;
-+
-+static const char* upload_pack_service = "upload-pack";
-+static const char* upload_pack_ls_service_url =
-+ "/info/refs?service=git-upload-pack";
-+static const char* upload_pack_service_url = "/git-upload-pack";
-+static const char* receive_pack_service = "receive-pack";
-+static const char* receive_pack_ls_service_url =
-+ "/info/refs?service=git-receive-pack";
-+static const char* receive_pack_service_url = "/git-receive-pack";
-+static const char* get_verb = "GET";
-+static const char* post_verb = "POST";
-+
-+#define OWNING_SUBTRANSPORT(s) \
-+ ((pepper_http_subtransport*)(s)->parent.subtransport)
-+
-+enum last_cb {
-+ NONE,
-+ FIELD,
-+ VALUE
-+};
-+
-+typedef struct {
-+ git_smart_subtransport_stream parent;
-+ PP_Resource url_request_info;
-+ PP_Resource url_loader;
-+ const char* service;
-+ const char* service_url;
-+ const char* verb;
-+ unsigned sent_request : 1;
-+ unsigned received_response : 1;
-+ unsigned chunked : 1;
-+} pepper_http_stream;
-+
-+typedef struct {
-+ git_smart_subtransport parent;
-+ void* owner;
-+ char* url;
-+ git_cred* cred;
-+ git_cred* url_cred;
-+} pepper_http_subtransport;
-+
-+typedef struct {
-+ pepper_http_stream* s;
-+ pepper_http_subtransport* t;
-+
-+ git_buf parse_header_name;
-+ git_buf parse_header_value;
-+ char* content_type;
-+ enum last_cb last_cb;
-+ int parse_error;
-+} parser_context;
-+
-+static int pepper_http_connect(pepper_http_subtransport* t) {
-+ return 0;
-+}
-+
-+static int pepper_http_stream_connect(pepper_http_stream* s) {
-+ int error = -1;
-+ struct PP_Var url_var = PP_MakeUndefined();
-+ struct PP_Var method_var = PP_MakeUndefined();
-+ struct PP_Var headers_var = PP_MakeUndefined();
-+ pepper_http_subtransport* t = OWNING_SUBTRANSPORT(s);
-+ git_buf buf = GIT_BUF_INIT;
-+ git_buf headers = GIT_BUF_INIT;
-+ char* url_colon;
-+ const char* scheme;
-+
-+ if (s->url_loader != 0)
-+ return 0;
-+
-+ s->url_loader = url_loader_iface->Create(pp_instance);
-+ if (s->url_loader == 0)
-+ return -1;
-+
-+ s->url_request_info = url_request_info_iface->Create(pp_instance);
-+ if (s->url_request_info == 0) {
-+ goto on_error;
-+ }
-+
-+ /* Allow the user to register the stream with a different scheme name. We
-+ * assume that if it contains https somewhere it should be an https stream,
-+ * otherwise it will be an http stream. */
-+ url_colon = strchr(t->url, ':');
-+ if (url_colon) {
-+ char* https = strstr(t->url, "https");
-+ if (https == NULL || https > url_colon) {
-+ /* Not HTTPS, replace the scheme with http */
-+ scheme = "http";
-+ } else {
-+ scheme = "https";
-+ }
-+ git_buf_printf(&buf, "%s%s%s", scheme, url_colon, s->service_url);
-+ } else {
-+ /* If there is no colon it must be a relative URL, so no modification is
-+ * necessary. */
-+ git_buf_printf(&buf, "%s%s", t->url, s->service_url);
-+ }
-+
-+ if (git_buf_oom(&buf)) {
-+ goto on_error;
-+ }
-+
-+ url_var = var_iface->VarFromUtf8(git_buf_cstr(&buf), git_buf_len(&buf));
-+ if (!url_request_info_iface->SetProperty(
-+ s->url_request_info, PP_URLREQUESTPROPERTY_URL, url_var)) {
-+ giterr_set(GITERR_OS, "Failed to set url property");
-+ goto on_error;
-+ }
-+
-+ method_var = var_iface->VarFromUtf8(s->verb, strlen(s->verb));
-+ if (!url_request_info_iface->SetProperty(
-+ s->url_request_info, PP_URLREQUESTPROPERTY_METHOD, method_var)) {
-+ giterr_set(GITERR_OS, "Failed to set method property");
-+ goto on_error;
-+ }
-+
-+ url_request_info_iface->SetProperty(
-+ s->url_request_info, PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS,
-+ PP_MakeBool(PP_TRUE));
-+
-+ if (post_verb == s->verb) {
-+ git_buf_printf(&headers, "Content-Type: application/x-git-%s-request\n",
-+ s->service);
-+ git_buf_printf(&headers, "Accept: application/x-git-%s-result\n",
-+ s->service);
-+
-+ if (git_buf_oom(&headers)) {
-+ goto on_error;
-+ }
-+
-+ headers_var =
-+ var_iface->VarFromUtf8(git_buf_cstr(&headers), git_buf_len(&headers));
-+ if (!url_request_info_iface->SetProperty(
-+ s->url_request_info, PP_URLREQUESTPROPERTY_HEADERS, headers_var)) {
-+ giterr_set(GITERR_OS, "Failed to set headers property");
-+ goto on_error;
-+ }
-+ }
-+
-+ error = 0;
-+
-+on_error:
-+ git_buf_free(&headers);
-+ git_buf_free(&buf);
-+ var_iface->Release(headers_var);
-+ var_iface->Release(method_var);
-+ var_iface->Release(url_var);
-+ return error;
-+}
-+
-+static int on_header_ready(parser_context* ctx) {
-+ git_buf* name = &ctx->parse_header_name;
-+ git_buf* value = &ctx->parse_header_value;
-+
-+ if (!strcasecmp("Content-Type", git_buf_cstr(name))) {
-+ if (!ctx->content_type) {
-+ ctx->content_type = git__strdup(git_buf_cstr(value));
-+ GITERR_CHECK_ALLOC(ctx->content_type);
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+static int on_header_field(http_parser* parser, const char* str, size_t len) {
-+ parser_context* ctx = (parser_context*)parser->data;
-+
-+ /* Both parse_header_name and parse_header_value are populated
-+ * and ready for consumption */
-+ if (VALUE == ctx->last_cb)
-+ if (on_header_ready(ctx) < 0)
-+ return ctx->parse_error = -1;
-+
-+ if (NONE == ctx->last_cb || VALUE == ctx->last_cb)
-+ git_buf_clear(&ctx->parse_header_name);
-+
-+ if (git_buf_put(&ctx->parse_header_name, str, len) < 0)
-+ return ctx->parse_error = -1;
-+
-+ ctx->last_cb = FIELD;
-+ return 0;
-+}
-+
-+static int on_header_value(http_parser* parser, const char* str, size_t len) {
-+ parser_context* ctx = (parser_context*)parser->data;
-+
-+ assert(NONE != ctx->last_cb);
-+
-+ if (FIELD == ctx->last_cb)
-+ git_buf_clear(&ctx->parse_header_value);
-+
-+ if (git_buf_put(&ctx->parse_header_value, str, len) < 0)
-+ return ctx->parse_error = -1;
-+
-+ ctx->last_cb = VALUE;
-+ return 0;
-+}
-+
-+static int pepper_http_stream_read_send_request(pepper_http_stream* s) {
-+ int32_t result;
-+ int rtn = -1;
-+ PP_Resource response;
-+ struct PP_Var statuscode_var;
-+ struct PP_Var headers_var;
-+ const char* var_str;
-+ uint32_t var_len;
-+ parser_context ctx;
-+ http_parser parser;
-+ http_parser_settings settings;
-+ size_t bytes_parsed;
-+ git_buf headers_buf = GIT_BUF_INIT;
-+ const char* headers_str;
-+ size_t headers_len;
-+ git_buf buf = GIT_BUF_INIT;
-+
-+ result = url_loader_iface->Open(s->url_loader, s->url_request_info,
-+ PP_BlockUntilComplete());
-+ if (result != PP_OK) {
-+ giterr_set(GITERR_OS, "Failed to send request");
-+ goto on_error0;
-+ }
-+
-+ response = url_loader_iface->GetResponseInfo(s->url_loader);
-+
-+ /* Check statuscode */
-+ statuscode_var = url_response_info_iface->GetProperty(
-+ response, PP_URLRESPONSEPROPERTY_STATUSCODE);
-+ if (statuscode_var.type != PP_VARTYPE_INT32) {
-+ giterr_set(GITERR_NET, "Invalid statuscode var type: %d",
-+ statuscode_var.type);
-+ goto on_error1;
-+ }
-+
-+ if (statuscode_var.value.as_int != 200) {
-+ giterr_set(GITERR_NET, "Unexpected HTTP status code: %d",
-+ statuscode_var.value.as_int);
-+ goto on_error1;
-+ }
-+
-+ /* Check content-type header */
-+ headers_var = url_response_info_iface->GetProperty(
-+ response, PP_URLRESPONSEPROPERTY_HEADERS);
-+ if (headers_var.type != PP_VARTYPE_STRING) {
-+ giterr_set(GITERR_NET, "Invalid headers var type: %d", headers_var.type);
-+ goto on_error2;
-+ }
-+
-+ var_str = var_iface->VarToUtf8(headers_var, &var_len);
-+ if (var_str == NULL) {
-+ giterr_set(GITERR_NET, "Unable to convert headers str to utf8");
-+ goto on_error2;
-+ }
-+
-+ git_buf_printf(&headers_buf, "HTTP/1.0 %d\n", statuscode_var.value.as_int);
-+ git_buf_put(&headers_buf, var_str, var_len);
-+
-+ headers_str = git_buf_cstr(&headers_buf);
-+ headers_len = git_buf_len(&headers_buf);
-+
-+ http_parser_init(&parser, HTTP_RESPONSE);
-+ memset(&ctx, 0, sizeof(ctx));
-+ git_buf_init(&ctx.parse_header_name, 0);
-+ git_buf_init(&ctx.parse_header_value, 0);
-+ ctx.last_cb = NONE;
-+ parser.data = &ctx;
-+
-+ memset(&settings, 0, sizeof(settings));
-+ settings.on_header_field = on_header_field;
-+ settings.on_header_value = on_header_value;
-+ bytes_parsed =
-+ http_parser_execute(&parser, &settings, headers_str, headers_len);
-+
-+ if (bytes_parsed != headers_len) {
-+ giterr_set(GITERR_NET, "HTTP parser error: %s.\nHeaders=%.*s",
-+ http_errno_description((enum http_errno)parser.http_errno),
-+ headers_len, headers_str);
-+ goto on_error3;
-+ }
-+
-+ if (!ctx.content_type) {
-+ giterr_set(GITERR_NET, "No Content-Type header in response");
-+ goto on_error3;
-+ }
-+
-+ /* The Content-Type header must match our expectation. */
-+ if (get_verb == s->verb) {
-+ git_buf_printf(&buf, "application/x-git-%s-advertisement", s->service);
-+ } else {
-+ git_buf_printf(&buf, "application/x-git-%s-result", s->service);
-+ }
-+
-+ if (git_buf_oom(&buf)) {
-+ goto on_error4;
-+ }
-+
-+ if (strcmp(ctx.content_type, git_buf_cstr(&buf))) {
-+ giterr_set(GITERR_NET, "Invalid Content-Type: %s", ctx.content_type);
-+ goto on_error4;
-+ }
-+
-+ s->sent_request = 1;
-+ rtn = 0;
-+
-+on_error4:
-+ git_buf_free(&buf);
-+on_error3:
-+ git_buf_free(&ctx.parse_header_name);
-+ git_buf_free(&ctx.parse_header_value);
-+ git__free(ctx.content_type);
-+ git_buf_free(&headers_buf);
-+on_error2:
-+ var_iface->Release(headers_var);
-+on_error1:
-+ var_iface->Release(statuscode_var);
-+on_error0:
-+ if (rtn) {
-+ ctx.parse_error = rtn;
-+ }
-+
-+ return rtn;
-+}
-+
-+static int pepper_http_stream_read(git_smart_subtransport_stream* stream,
-+ char* buffer, size_t buf_size,
-+ size_t* bytes_read) {
-+ int32_t result;
-+ pepper_http_stream* s = (pepper_http_stream*)stream;
-+
-+ if (!s->url_request_info && pepper_http_stream_connect(s) < 0)
-+ return -1;
-+
-+ if (!s->received_response) {
-+ if (!s->sent_request) {
-+ int rtn = pepper_http_stream_read_send_request(s);
-+ if (rtn) {
-+ return rtn;
-+ }
-+ }
-+
-+ s->received_response = 1;
-+ }
-+
-+ result = url_loader_iface->ReadResponseBody(s->url_loader, buffer, buf_size,
-+ PP_BlockUntilComplete());
-+ if (result < 0) {
-+ giterr_set(GITERR_OS, "Failed to read data");
-+ return -1;
-+ }
-+
-+ *bytes_read = result;
-+
-+ return 0;
-+}
-+
-+static int pepper_http_stream_write_buffered(
-+ git_smart_subtransport_stream* stream, const char* buffer, size_t len) {
-+ pepper_http_stream* s = (pepper_http_stream*)stream;
-+
-+ if (!s->url_request_info && pepper_http_stream_connect(s) < 0)
-+ return -1;
-+
-+ if (url_request_info_iface->AppendDataToBody(s->url_request_info, buffer,
-+ len) != PP_TRUE) {
-+ giterr_set(GITERR_OS, "Failed to write buffered data");
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+
-+static int pepper_http_stream_write_single(
-+ git_smart_subtransport_stream* stream, const char* buffer, size_t len) {
-+ int32_t result;
-+ pepper_http_stream *s = (pepper_http_stream *)stream;
-+
-+ if (!s->url_request_info && pepper_http_stream_connect(s) < 0)
-+ return -1;
-+
-+ if (s->sent_request) {
-+ giterr_set(GITERR_NET, "Subtransport configured for only one write");
-+ return -1;
-+ }
-+
-+ if (url_request_info_iface->AppendDataToBody(s->url_request_info, buffer,
-+ len) != PP_TRUE) {
-+ giterr_set(GITERR_OS, "Failed to write data");
-+ return -1;
-+ }
-+
-+ result = url_loader_iface->Open(s->url_loader, s->url_request_info,
-+ PP_BlockUntilComplete());
-+ if (result != PP_OK) {
-+ giterr_set(GITERR_OS, "Failed to send request");
-+ return -1;
-+ }
-+
-+ s->sent_request = 1;
-+
-+ return 0;
-+}
-+
-+static void pepper_http_stream_free(git_smart_subtransport_stream* stream) {
-+ pepper_http_stream* s = (pepper_http_stream*)stream;
-+
-+ if (s->url_request_info) {
-+ core_iface->ReleaseResource(s->url_request_info);
-+ s->url_request_info = 0;
-+ }
-+
-+ if (s->url_loader) {
-+ core_iface->ReleaseResource(s->url_loader);
-+ s->url_loader = 0;
-+ }
-+
-+ free(s);
-+}
-+
-+static int pepper_http_stream_alloc(pepper_http_subtransport* t,
-+ git_smart_subtransport_stream** stream) {
-+ pepper_http_stream* s;
-+
-+ if (!stream) return -1;
-+
-+ s = calloc(sizeof(pepper_http_stream), 1);
-+
-+ s->parent.subtransport = &t->parent;
-+ s->parent.read = pepper_http_stream_read;
-+ s->parent.write = pepper_http_stream_write_single;
-+ s->parent.free = pepper_http_stream_free;
-+
-+ *stream = (git_smart_subtransport_stream*)s;
-+ return 0;
-+}
-+
-+static int pepper_http_uploadpack_ls(pepper_http_subtransport* t,
-+ git_smart_subtransport_stream** stream) {
-+ pepper_http_stream* s;
-+
-+ if (pepper_http_stream_alloc(t, stream) < 0) return -1;
-+
-+ s = (pepper_http_stream*)*stream;
-+
-+ s->service = upload_pack_service;
-+ s->service_url = upload_pack_ls_service_url;
-+ s->verb = get_verb;
-+
-+ return 0;
-+}
-+
-+static int pepper_http_uploadpack(pepper_http_subtransport* t,
-+ git_smart_subtransport_stream** stream) {
-+ pepper_http_stream* s;
-+
-+ if (pepper_http_stream_alloc(t, stream) < 0) return -1;
-+
-+ s = (pepper_http_stream*)*stream;
-+
-+ s->service = upload_pack_service;
-+ s->service_url = upload_pack_service_url;
-+ s->verb = post_verb;
-+
-+ return 0;
-+}
-+
-+static int pepper_http_receivepack_ls(pepper_http_subtransport* t,
-+ git_smart_subtransport_stream** stream) {
-+ pepper_http_stream* s;
-+
-+ if (pepper_http_stream_alloc(t, stream) < 0) return -1;
-+
-+ s = (pepper_http_stream*)*stream;
-+
-+ s->service = receive_pack_service;
-+ s->service_url = receive_pack_ls_service_url;
-+ s->verb = get_verb;
-+
-+ return 0;
-+}
-+
-+static int pepper_http_receivepack(pepper_http_subtransport* t,
-+ git_smart_subtransport_stream** stream) {
-+ pepper_http_stream* s;
-+
-+ if (pepper_http_stream_alloc(t, stream) < 0) return -1;
-+
-+ s = (pepper_http_stream*)*stream;
-+
-+ s->parent.write = pepper_http_stream_write_buffered;
-+
-+ s->service = receive_pack_service;
-+ s->service_url = receive_pack_service_url;
-+ s->verb = post_verb;
-+
-+ return 0;
-+}
-+
-+static int pepper_http_action(git_smart_subtransport_stream** stream,
-+ git_smart_subtransport* subtransport,
-+ const char* url, git_smart_service_t action) {
-+ pepper_http_subtransport* t = (pepper_http_subtransport*)subtransport;
-+
-+ if (!stream) return -1;
-+
-+ t->url = strdup(url);
-+
-+ if (pepper_http_connect(t) < 0) return -1;
-+
-+ switch (action) {
-+ case GIT_SERVICE_UPLOADPACK_LS:
-+ return pepper_http_uploadpack_ls(t, stream);
-+
-+ case GIT_SERVICE_UPLOADPACK:
-+ return pepper_http_uploadpack(t, stream);
-+
-+ case GIT_SERVICE_RECEIVEPACK_LS:
-+ return pepper_http_receivepack_ls(t, stream);
-+
-+ case GIT_SERVICE_RECEIVEPACK:
-+ return pepper_http_receivepack(t, stream);
-+ }
-+
-+ giterr_set(GITERR_NET, "Invalid action received in pepper_http_action: %d\n",
-+ action);
-+ *stream = NULL;
-+ return -1;
-+}
-+
-+static int pepper_http_close(git_smart_subtransport* subtransport) {
-+ pepper_http_subtransport *t = (pepper_http_subtransport *) subtransport;
-+ if (t->url) {
-+ free(t->url);
-+ t->url = 0;
-+ }
-+
-+ return 0;
-+}
-+
-+static void pepper_http_free(git_smart_subtransport* subtransport) {
-+ pepper_http_subtransport *t = (pepper_http_subtransport *) subtransport;
-+ pepper_http_close(subtransport);
-+ free(t);
-+}
-+
-+int git_smart_subtransport_pepper_http(git_smart_subtransport** out,
-+ git_transport* owner) {
-+ pepper_http_subtransport* t;
-+
-+ if (!out)
-+ return -1;
-+
-+ if (!core_iface || !var_iface || !url_loader_iface ||
-+ !url_request_info_iface || !url_response_info_iface) {
-+ giterr_set(GITERR_INVALID,
-+ "You must call "
-+ "git_smart_subtransport_pepper_http_init() before creating a "
-+ "pepper_http git subtransport.");
-+ return -1;
-+ }
-+
-+ t = calloc(sizeof(pepper_http_subtransport), 1);
-+
-+ t->owner = (void*)owner;
-+ t->parent.action = pepper_http_action;
-+ t->parent.close = pepper_http_close;
-+ t->parent.free = pepper_http_free;
-+
-+ *out = (git_smart_subtransport*)t;
-+ return 0;
-+}
-+
-+#define GET_INTERFACE(var, name) \
-+ do { \
-+ var = get_interface(name); \
-+ if (!var) { \
-+ giterr_set(GITERR_OS, "Unable to get interface: " name); \
-+ return -1; \
-+ } \
-+ } while (0)
-+
-+int git_smart_subtransport_pepper_http_init(PP_Instance instance,
-+ PPB_GetInterface get_interface) {
-+ pp_instance = instance;
-+ GET_INTERFACE(core_iface, PPB_CORE_INTERFACE_1_0);
-+ GET_INTERFACE(var_iface, PPB_VAR_INTERFACE_1_1);
-+ GET_INTERFACE(url_loader_iface, PPB_URLLOADER_INTERFACE_1_0);
-+ GET_INTERFACE(url_request_info_iface, PPB_URLREQUESTINFO_INTERFACE_1_0);
-+ GET_INTERFACE(url_response_info_iface, PPB_URLRESPONSEINFO_INTERFACE_1_0);
-+
-+ return 0;
-+}
-+
-+#endif // native_client
-+
-diff --git a/tests/clar.c b/tests/clar.c
---- a/tests/clar.c
-+++ b/tests/clar.c
-@@ -222,7 +222,7 @@ static void
- clar_run_suite(const struct clar_suite *suite, const char *filter)
- {
- const struct clar_func *test = suite->tests;
-- size_t i, matchlen;
-+ size_t i, matchlen = 0;
-
- if (!suite->enabled)
- return;
-diff --git a/tests/clar/fs.h b/tests/clar/fs.h
---- a/tests/clar/fs.h
-+++ b/tests/clar/fs.h
-@@ -250,6 +250,249 @@ cl_fs_cleanup(void)
- fs_rm(fixture_path(_clar_path, "*"));
- }
-
-+#elif defined(__native_client__)
-+
-+#include <dirent.h>
-+#include <errno.h>
-+#include <limits.h>
-+#include <sys/stat.h>
-+
-+static int fs_copy_helper(const char* source, const char* dest);
-+
-+static int fs_copy_dir(const char* source, const char* dest) {
-+ DIR* src_dir = opendir(source);
-+ struct dirent* dirent_buf = malloc(sizeof(struct dirent));
-+ struct dirent* dir_entry = NULL;
-+ int result = 1;
-+
-+ if (src_dir == NULL) {
-+ fprintf(stderr, "Error opening directory %s: %s\n",
-+ source, strerror(errno));
-+ goto error;
-+ }
-+
-+ // Create the destination directory.
-+ if (mkdir(dest, 0700) != 0) {
-+ if (errno != EEXIST) {
-+ fprintf(stderr, "Error creating directory %s: %s\n",
-+ dest, strerror(errno));
-+ goto error;
-+ }
-+ }
-+
-+ while (1) {
-+ char src_entry_path[PATH_MAX];
-+ char dst_entry_path[PATH_MAX];
-+ const char* entry_name;
-+
-+ if (readdir_r(src_dir, dirent_buf, &dir_entry) != 0) {
-+ fprintf(stderr, "Error reading directory %s: %s\n",
-+ source, strerror(errno));
-+ goto error;
-+ }
-+
-+ if (dir_entry == NULL) {
-+ break;
-+ }
-+
-+ entry_name = dir_entry->d_name;
-+
-+ if (strcmp(entry_name, ".") == 0 || strcmp(entry_name, "..") == 0)
-+ continue;
-+
-+ snprintf(&src_entry_path[0], PATH_MAX, "%s/%s", source, entry_name);
-+ snprintf(&dst_entry_path[0], PATH_MAX, "%s/%s", dest, entry_name);
-+
-+ if (!fs_copy_helper(src_entry_path, dst_entry_path)) {
-+ goto error;
-+ }
-+ }
-+
-+ goto cleanup;
-+
-+error:
-+ result = 0;
-+
-+cleanup:
-+ closedir(src_dir);
-+ return result;
-+}
-+
-+static int fs_copy_file(const char* source, const char* dest) {
-+ const size_t buffer_size = 8192;
-+ char buffer[buffer_size];
-+ int result = 1;
-+ FILE* dst_file = NULL;
-+
-+ FILE* src_file = fopen(source, "r");
-+ if (src_file == NULL) {
-+ fprintf(stderr, "Error opening file %s for reading: %s\n",
-+ source, strerror(errno));
-+ goto error;
-+ }
-+
-+ dst_file = fopen(dest, "w");
-+ if (dst_file == NULL) {
-+ fprintf(stderr, "Error opening file %s for writing: %s\n",
-+ dest, strerror(errno));
-+ goto error;
-+ }
-+
-+ while (!feof(src_file)) {
-+ ssize_t bytes_read = fread(&buffer[0], 1, buffer_size, src_file);
-+ ssize_t bytes_written;
-+ if (bytes_read < 0) {
-+ fprintf(stderr, "Unable to read from %s: %s\n", source, strerror(errno));
-+ goto error;
-+ }
-+
-+ bytes_written = fwrite(&buffer[0], 1, bytes_read, dst_file);
-+ if (bytes_written != bytes_read) {
-+ fprintf(stderr, "Unable to write %d bytes of %s to %s: %s\n",
-+ bytes_read, source, dest, strerror(errno));
-+ goto error;
-+ }
-+ }
-+
-+ goto cleanup;
-+
-+error:
-+ result = 0;
-+
-+cleanup:
-+ if (src_file)
-+ fclose(src_file);
-+
-+ if (dst_file)
-+ fclose(dst_file);
-+
-+ return result;
-+}
-+
-+static int fs_copy_helper(const char *source, const char *dest) {
-+ struct stat statbuf;
-+ if (stat(source, &statbuf) != 0) {
-+ fprintf(stderr, "Error stat'ing file %s: %s\n", source, strerror(errno));
-+ return 0;
-+ }
-+
-+ if (S_ISDIR(statbuf.st_mode)) {
-+ if (!fs_copy_dir(source, dest))
-+ return 0;
-+ } else {
-+ if (!fs_copy_file(source, dest))
-+ return 0;
-+ }
-+
-+ return 1;
-+}
-+
-+
-+static void fs_copy(const char *source, const char *dest) {
-+ char real_dest[PATH_MAX];
-+ char* last_slash = NULL;
-+
-+ // Copy the base directory name of source to dest.
-+ // e.g. fs_copy("foo/bar/baz", "/tmp/blah") creates "/tmp/blah/baz".
-+
-+ last_slash = strrchr(source, '/');
-+ if (last_slash != NULL) {
-+ snprintf(real_dest, PATH_MAX, "%s/%s", dest, last_slash + 1);
-+ } else {
-+ strncpy(real_dest, dest, PATH_MAX);
-+ }
-+
-+ cl_must_pass_(fs_copy_helper(source, real_dest),
-+ "Failed to copy test fixtures to sandbox");
-+}
-+
-+static int fs_rm_helper(const char* source);
-+
-+static int fs_rm_dir(const char* source) {
-+ DIR* src_dir = opendir(source);
-+ struct dirent* dir_entry = NULL;
-+ int result = 1;
-+
-+ if (src_dir == NULL) {
-+ fprintf(stderr, "Error opening directory %s: %s\n",
-+ source, strerror(errno));
-+ goto error;
-+ }
-+
-+ for (dir_entry = readdir(src_dir); dir_entry; dir_entry = readdir(src_dir)) {
-+ char src_entry_path[PATH_MAX];
-+ const char* entry_name = dir_entry->d_name;
-+
-+ if (strcmp(entry_name, ".") == 0 || strcmp(entry_name, "..") == 0)
-+ continue;
-+
-+ snprintf(&src_entry_path[0], PATH_MAX, "%s/%s", source, entry_name);
-+
-+ if (!fs_rm_helper(src_entry_path)) {
-+ goto error;
-+ }
-+ }
-+
-+ // Finally, remove source.
-+ if (rmdir(source) != 0) {
-+ fprintf(stderr, "Error removing directory %s: %s\n",
-+ source, strerror(errno));
-+ goto error;
-+ }
-+
-+ goto cleanup;
-+
-+error:
-+ result = 0;
-+
-+cleanup:
-+ closedir(src_dir);
-+ return result;
-+}
-+
-+static int fs_rm_file(const char* source) {
-+ if (unlink(source) != 0) {
-+ fprintf(stderr, "Error removing file %s: %s\n", source, strerror(errno));
-+ return 0;
-+ }
-+
-+ return 1;
-+}
-+
-+static int fs_rm_helper(const char* source) {
-+ struct stat statbuf;
-+ if (lstat(source, &statbuf) != 0) {
-+ fprintf(stderr, "Error stat'ing file %s: %s\n", source, strerror(errno));
-+ return 0;
-+ }
-+
-+ if (S_ISDIR(statbuf.st_mode)) {
-+ if (!fs_rm_dir(source))
-+ return 0;
-+ } else {
-+ if (!fs_rm_file(source))
-+ return 0;
-+ }
-+
-+ return 1;
-+}
-+
-+static void
-+fs_rm(const char *source)
-+{
-+ cl_must_pass_(
-+ fs_rm_helper(source),
-+ "Failed to cleanup the sandbox"
-+ );
-+}
-+
-+void
-+cl_fs_cleanup(void)
-+{
-+ clar_unsandbox();
-+ clar_sandbox();
-+}
-+
- #else
-
- #include <errno.h>
-diff --git a/tests/clar/sandbox.h b/tests/clar/sandbox.h
---- a/tests/clar/sandbox.h
-+++ b/tests/clar/sandbox.h
-@@ -110,8 +110,21 @@ static int build_sandbox_path(void)
- return -1;
- #else
- if (mkdtemp(_clar_path) == NULL)
-+#if defined(__native_client__)
-+ {
-+ // Under sel_ldr mkdtemp currently always fails. For now
-+ // fake it.
-+ struct stat buf;
-+ strcpy(_clar_path + strlen(_clar_path) - 6, "123456");
-+ if (stat(_clar_path, &buf) == 0)
-+ fs_rm(_clar_path);
-+ if (mkdir(_clar_path, 0700) != 0)
-+ return -1;
-+ }
-+#else
- return -1;
- #endif
-+#endif
-
- return 0;
- }
-diff --git a/tests/commit/parse.c b/tests/commit/parse.c
---- a/tests/commit/parse.c
-+++ b/tests/commit/parse.c
-@@ -119,8 +119,8 @@ passing_signature_test_case passing_signature_cases[] = {
- {"author Vicent Marti <tanoku@gmail.com> 1234567890 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 1234567890, 0},
- {"author Vicent Marti <tanoku@gmail.com> 2147483647 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 0x7fffffff, 0},
- {"author Vicent Marti <tanoku@gmail.com> 4294967295 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 0xffffffff, 0},
-- {"author Vicent Marti <tanoku@gmail.com> 4294967296 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 4294967296, 0},
-- {"author Vicent Marti <tanoku@gmail.com> 8589934592 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 8589934592, 0},
-+ {"author Vicent Marti <tanoku@gmail.com> 4294967296 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 4294967296ll, 0},
-+ {"author Vicent Marti <tanoku@gmail.com> 8589934592 \n", "author ", "Vicent Marti", "tanoku@gmail.com", 8589934592ll, 0},
-
- {NULL,NULL,NULL,NULL,0,0}
- };
-diff --git a/tests/config/read.c b/tests/config/read.c
---- a/tests/config/read.c
-+++ b/tests/config/read.c
-@@ -477,7 +477,7 @@ void test_config_read__simple_read_from_specific_level(void)
- {
- git_config *cfg, *cfg_specific;
- int i;
-- int64_t l, expected = +9223372036854775803;
-+ int64_t l, expected = +9223372036854775803ll;
- const char *s;
-
- cl_git_pass(git_config_new(&cfg));
-diff --git a/tests/config/write.c b/tests/config/write.c
---- a/tests/config/write.c
-+++ b/tests/config/write.c
-@@ -18,7 +18,7 @@ void test_config_write__replace_value(void)
- {
- git_config *cfg;
- int i;
-- int64_t l, expected = +9223372036854775803;
-+ int64_t l, expected = +9223372036854775803ll;
-
- /* By freeing the config, we make sure we flush the values */
- cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
-@@ -179,7 +179,7 @@ void test_config_write__add_value_at_specific_level(void)
- {
- git_config *cfg, *cfg_specific;
- int i;
-- int64_t l, expected = +9223372036854775803;
-+ int64_t l, expected = +9223372036854775803ll;
- const char *s;
-
- // open config15 as global level config file
diff --git a/ports/libgit2/pkg_info b/ports/libgit2/pkg_info
deleted file mode 100644
index d4c5e68..0000000
--- a/ports/libgit2/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libgit2
-VERSION=0.21.2
-URL=https://github.com/libgit2/libgit2/archive/v0.21.2/libgit2-0.21.2.tar.gz
-DEPENDS=(glibc-compat libssh2 zlib)
-# GPL2 with linking exemption.
-LICENSE=CUSTOM:COPYING
-SHA1=a16a59df1bfe073483be0c58a81cdbc89f7b7070
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libhangul/nacl.patch b/ports/libhangul/nacl.patch
deleted file mode 100644
index c37f206..0000000
--- a/ports/libhangul/nacl.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-diff --git a/config.h.in b/config.h.in
---- a/config.h.in
-+++ b/config.h.in
-@@ -149,6 +149,3 @@
- #ifndef __cplusplus
- #undef inline
- #endif
--
--/* Define to rpl_realloc if the replacement function should be used. */
--#undef realloc
diff --git a/ports/libhangul/pkg_info b/ports/libhangul/pkg_info
deleted file mode 100644
index 6929dc1..0000000
--- a/ports/libhangul/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=libhangul
-VERSION=0.1.0
-URL=http://libhangul.googlecode.com/files/libhangul-0.1.0.tar.gz
-SHA1=9c6f3a82f2d4068771215f1b9f13a0d4bdbbfc77
diff --git a/ports/libice/build.sh b/ports/libice/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libice/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libice/nacl.patch b/ports/libice/nacl.patch
deleted file mode 100644
index 475d62b..0000000
--- a/ports/libice/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/iceauth.c b/src/iceauth.c
---- a/src/iceauth.c
-+++ b/src/iceauth.c
-@@ -67,7 +67,7 @@ IceGenerateMagicCookie (
- }
- #else
- {
--#ifndef __UNIXOS2__
-+#if !defined(__UNIXOS2__) && (!defined(__native_client__) || !defined(_NEWLIB_VERSION))
- long time ();
- #endif
- ldata[0] = time ((long *) 0);
diff --git a/ports/libice/pkg_info b/ports/libice/pkg_info
deleted file mode 100644
index f442b3b..0000000
--- a/ports/libice/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libice
-ARCHIVE_ROOT=libICE-1.0.8
-VERSION=1.0.8
-URL=http://www.x.org/releases/X11R7.7/src/everything/libICE-1.0.8.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat xproto xtrans)
-SHA1=ddb14df8bbc43df7322978f5f9f802936e2a7324
diff --git a/ports/libiconv/build.sh b/ports/libiconv/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libiconv/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libiconv/nacl.patch b/ports/libiconv/nacl.patch
deleted file mode 100644
index a0831d8..0000000
--- a/ports/libiconv/nacl.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/srclib/stdio.in.h b/srclib/stdio.in.h
---- a/srclib/stdio.in.h
-+++ b/srclib/stdio.in.h
-@@ -692,10 +692,12 @@ _GL_CXXALIAS_SYS (gets, char *, (char *s));
- # undef gets
- # endif
- _GL_CXXALIASWARN (gets);
-+# if HAVE_RAW_DECL_GETS
- /* It is very rare that the developer ever has full control of stdin,
- so any use of gets warrants an unconditional warning. Assume it is
- always declared, since it is required by C89. */
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
-+# endif
- #endif
-
-
diff --git a/ports/libiconv/pkg_info b/ports/libiconv/pkg_info
deleted file mode 100644
index a5eba2d..0000000
--- a/ports/libiconv/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=libiconv
-VERSION=1.14
-URL=http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-# The configure script for libiconv doesn't honor $AR which means
-# pnacl builds on OSX fail.
-BUILD_OS=linux
-SHA1=be7d67e50d72ff067b2c0291311bc283add36965
diff --git a/ports/libmatroska/pkg_info b/ports/libmatroska/pkg_info
deleted file mode 100644
index 6a69a6d..0000000
--- a/ports/libmatroska/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libmatroska
-VERSION=1.4.2
-URL=http://dl.matroska.org/downloads/libmatroska/libmatroska-1.4.2.tar.bz2
-SHA1=546a761a763b2d1d15dbbccaa5495eb63dd87223
-LICENSE=LGPL2.1
-DEPENDS=(libebml)
diff --git a/ports/libmikmod/build.sh b/ports/libmikmod/build.sh
deleted file mode 100644
index b8831f2..0000000
--- a/ports/libmikmod/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2011 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.
-
-
-EXTRA_CONFIGURE_ARGS=--disable-esd
diff --git a/ports/libmikmod/pkg_info b/ports/libmikmod/pkg_info
deleted file mode 100644
index 0229d99..0000000
--- a/ports/libmikmod/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=libmikmod
-VERSION=3.1.11
-URL=http://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz
-LICENSE=LGPL
-SHA1=ca18fff19348d3bcf3550aa920b129b082c5069a
diff --git a/ports/libmng/build.sh b/ports/libmng/build.sh
deleted file mode 100644
index ee54965..0000000
--- a/ports/libmng/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2013 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.
-
-BUILD_DIR=${SRC_DIR}
-
-ConfigureStep() {
- # export the nacl tools
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- export AR=${NACLAR}
- export RANLIB=${NACLRANLIB}
- export CFLAGS="${NACLPORTS_CFLAGS} ${NACLPORTS_CPPFLAGS}"
- export LDFLAGS="${NACLPORTS_LDFLAGS}"
- ./unmaintained/autogen.sh --host=nacl --prefix=${PREFIX}
-}
diff --git a/ports/libmng/nacl.patch b/ports/libmng/nacl.patch
deleted file mode 100644
index b7271be..0000000
--- a/ports/libmng/nacl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/makefiles/configure.in b/makefiles/configure.in
---- a/makefiles/configure.in
-+++ b/makefiles/configure.in
-@@ -15,7 +15,6 @@ AC_SUBST(VERSION)
- dnl Checks for programs.
- AC_PROG_CC
- AC_ISC_POSIX
--AM_C_PROTOTYPES
- if test "x$U" != "x"; then
- AC_MSG_ERROR(Compiler not ANSI compliant)
- fi
diff --git a/ports/libmng/pkg_info b/ports/libmng/pkg_info
deleted file mode 100644
index 81d828f..0000000
--- a/ports/libmng/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libmng
-VERSION=1.0.10
-URL=http://downloads.sf.net/project/libmng/libmng-devel/1.0.10/libmng-1.0.10.tar.gz
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(zlib jpeg8d)
-SHA1=78ad516a1de79d00de720bf2a7c9afea2c896b09
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libmodplug/build.sh b/ports/libmodplug/build.sh
deleted file mode 100644
index de33682..0000000
--- a/ports/libmodplug/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libmodplug/pkg_info b/ports/libmodplug/pkg_info
deleted file mode 100644
index 92cf88b..0000000
--- a/ports/libmodplug/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libmodplug
-VERSION=0.8.7
-URL=http://download.sf.net/modplug-xmms/libmodplug/0.8.7/libmodplug-0.8.7.tar.gz
-LICENSE=CUSTOM:COPYING
-SHA1=52cb47ef9291b0286430c5de02ef33731d359f2e
-DEPENDS=(glibc-compat)
diff --git a/ports/libogg/pkg_info b/ports/libogg/pkg_info
deleted file mode 100644
index 97ad4ba..0000000
--- a/ports/libogg/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libogg
-VERSION=1.3.0
-URL=http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
-LICENSE=BSD:COPYING
-SHA1=a900af21b6d7db1c7aa74eb0c39589ed9db991b8
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/liboggz/build.sh b/ports/liboggz/build.sh
deleted file mode 100644
index d671bda..0000000
--- a/ports/liboggz/build.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="
- src/tools/oggz${NACL_EXEEXT}
- src/tests/read-stop-ok${NACL_EXEEXT}
- src/examples/read-file${NACL_EXEEXT}
-"
-
-TESTS="
-comment-test
-io-count
-io-read
-io-read-single
-io-run
-io-seek
-io-write-flush
-io-write
-read-generated
-read-stop-err
-read-stop-ok
-write-bad-bos
-write-bad-bytes
-write-bad-eos
-write-bad-granulepos
-write-bad-guard
-write-bad-packetno
-write-bad-serialno
-write-dup-bos
-write-prefix
-write-recursive
-write-suffix
-write-unmarked-guard
-"
-
-# This test requires some kind of file to operator on
-#seek-stress
-
-TestStep() {
- export SEL_LDR_LIB_PATH=$PWD/src/liboggz/.libs
- for test in ${TESTS}; do
- RunSelLdrCommand "src/tests/${test}${NACL_EXEEXT}"
- done
-}
diff --git a/ports/liboggz/nacl.patch b/ports/liboggz/nacl.patch
deleted file mode 100644
index 19f6f5d..0000000
--- a/ports/liboggz/nacl.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/tools/oggz-chop/httpdate.c b/src/tools/oggz-chop/httpdate.c
---- a/src/tools/oggz-chop/httpdate.c
-+++ b/src/tools/oggz-chop/httpdate.c
-@@ -5,6 +5,10 @@
- #include <string.h>
- #include <time.h>
-
-+#ifdef _NEWLIB_VERSION
-+#define timezone _timezone
-+#endif
-+
- #define HTTPDATE_FMT "%3s, %02d %s %4d %02d:%02d:%02d GMT"
-
- static char * wdays[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
-diff --git a/src/tools/oggz-chop/httpdate_test.c b/src/tools/oggz-chop/httpdate_test.c
---- a/src/tools/oggz-chop/httpdate_test.c
-+++ b/src/tools/oggz-chop/httpdate_test.c
-@@ -7,6 +7,10 @@
-
- #include "httpdate.h"
-
-+#ifdef _NEWLIB_VERSION
-+#define timezone _timezone
-+#endif
-+
- int
- main (int argc, char * argv[])
- {
diff --git a/ports/liboggz/pkg_info b/ports/liboggz/pkg_info
deleted file mode 100644
index 8f0471c..0000000
--- a/ports/liboggz/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=liboggz
-VERSION=1.1.1
-URL=http://downloads.xiph.org/releases/liboggz/liboggz-1.1.1.tar.gz
-LICENSE=BSD
-DEPENDS=(libogg)
-SHA1=3540190c8c9a31d834aa7794ef991bbab699f4de
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libpciaccess/build.sh b/ports/libpciaccess/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libpciaccess/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libpciaccess/pkg_info b/ports/libpciaccess/pkg_info
deleted file mode 100644
index 50aff2f..0000000
--- a/ports/libpciaccess/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libpciaccess
-VERSION=0.13.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libpciaccess-0.13.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-SHA1=ae4dcf27a1b52c6a1fd90b21165fbaecae34e8ac
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libpng/build.sh b/ports/libpng/build.sh
deleted file mode 100644
index 6de5477..0000000
--- a/ports/libpng/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="pngtest${NACL_EXEEXT} pngvalid${NACL_EXEEXT} pngfix${NACL_EXEEXT}"
diff --git a/ports/libpng/nacl.patch b/ports/libpng/nacl.patch
deleted file mode 100644
index fa58f50..0000000
--- a/ports/libpng/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/arm/filter_neon.S b/arm/filter_neon.S
---- a/arm/filter_neon.S
-+++ b/arm/filter_neon.S
-@@ -17,7 +17,7 @@
- #define PNG_VERSION_INFO_ONLY
- #include "../pngpriv.h"
-
--#if defined(__linux__) && defined(__ELF__)
-+#if defined(__ELF__)
- .section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
- #endif
-
diff --git a/ports/libpng/pkg_info b/ports/libpng/pkg_info
deleted file mode 100644
index 38b3849..0000000
--- a/ports/libpng/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libpng
-VERSION=1.6.20
-URL=http://download.sf.net/libpng/libpng-1.6.20.tar.gz
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(zlib)
-SHA1=0b3712365571199ef7864177faa0f6e9f4d946ab
-CONFLICTS=(libpng12)
diff --git a/ports/libpng12/pkg_info b/ports/libpng12/pkg_info
deleted file mode 100644
index f44f874..0000000
--- a/ports/libpng12/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=libpng12
-VERSION=1.2.51
-ARCHIVE_ROOT=libpng-1.2.51
-URL=http://download.sf.net/libpng/libpng-1.2.51.tar.gz
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(zlib)
-SHA1=5175be08c4fa767b0d3d025f636e73e78780f988
-CONFLICTS=(libpng)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libsm/build.sh b/ports/libsm/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libsm/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libsm/pkg_info b/ports/libsm/pkg_info
deleted file mode 100644
index a3c446f..0000000
--- a/ports/libsm/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libsm
-ARCHIVE_ROOT=libSM-1.2.1
-VERSION=1.2.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libSM-1.2.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat libice)
-SHA1=8d354a165e330022ffd3606aba562b8c8154213d
diff --git a/ports/libsodium/build.sh b/ports/libsodium/build.sh
deleted file mode 100644
index ed156e2..0000000
--- a/ports/libsodium/build.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXTRA_CONFIGURE_ARGS="--disable-pie --disable-shared"
-
-RunTest() {
- naclport_test/crypto_box_test
-}
-
-TestStep() {
- MakeDir naclport_test/lib
-
- # the libtool warns "libtool: install: warning: remember to run
- # `libtool --finish pepper_31/toolchain/linux_pnacl/usr/lib'"
- (cd src/libsodium;
- /bin/bash ../../libtool --mode=install /usr/bin/install \
- -c libsodium.la $(cd ../../naclport_test/lib && pwd))
-
- if [[ ${NACL_ARCH} == pnacl ]]; then
- EXT=.bc
- else
- EXT=${NACL_EXEEXT}
- fi
-
- # on newlib_arm compilation crashed when without -lssp,
- # on other platforms it was ok without it
- LSSP=""
- if [[ ${NACL_ARCH} == arm && ${TOOLCHAIN} == newlib ]]; then
- LSSP="-lssp"
- fi
- INCLUDES="-Isrc/libsodium/include -Isrc/libsodium/include/sodium \
- -I${SRC_DIR}/src/libsodium/include \
- -I${SRC_DIR}/src/libsodium/include/sodium"
- ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS} \
- ${NACLPORTS_LDFLAGS} -o naclport_test/crypto_box_test${EXT} \
- ${START_DIR}/crypto_box_test.c naclport_test/lib/libsodium.a \
- -lnacl_io -lpthread ${LSSP}
-
- [[ ${NACL_ARCH} == "pnacl" ]] && ${PNACLFINALIZE} \
- -o naclport_test/crypto_box_test${NACL_EXEEXT} naclport_test/crypto_box_test${EXT}
-
- echo "Running test"
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- local pexe=crypto_box_test${NACL_EXEEXT}
- (cd naclport_test;
- TranslateAndWriteLauncherScript ${pexe} x86-32 crypto_box_test.x86-32${EXT} crypto_box_test)
- RunTest
- (cd naclport_test;
- TranslateAndWriteLauncherScript ${pexe} x86-64 crypto_box_test.x86-64${EXT} crypto_box_test)
- RunTest
- echo "Tests OK"
- elif [ "$(uname -m)" = "${NACL_ARCH_ALT}" ]; then
- WriteLauncherScript naclport_test/crypto_box_test crypto_box_test${EXT}
- RunTest
- echo "Tests OK"
- fi
-}
diff --git a/ports/libsodium/crypto_box_test.c b/ports/libsodium/crypto_box_test.c
deleted file mode 100644
index f8a5c10..0000000
--- a/ports/libsodium/crypto_box_test.c
+++ /dev/null
@@ -1,232 +0,0 @@
-// 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.
-
-// Based on Public Domain code made released by Moritz Warning, can be obtained at
-// https://github.com/mwarning/libsodium-example/blob/master/crypto_box.c
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-
-// sodium needs /dev/urandom
-#include "nacl_io/nacl_io.h"
-#include "sys/mount.h"
-#include "sys/stat.h"
-
-// the library we are testing
-#include <sodium.h>
-
-// the testing is done with asserts
-#include <assert.h>
-
-typedef unsigned char UCHAR;
-
-// helper function for calling sodium and printing back results
-
-char* to_hex( char hex[], const UCHAR bin[], size_t length )
-{
- int i;
- UCHAR *p0 = (UCHAR *)bin;
- char *p1 = hex;
-
- for( i = 0; i < length; i++ ) {
- snprintf( p1, 3, "%02x", *p0 );
- p0 += 1;
- p1 += 2;
- }
-
- return hex;
-}
-
-int is_zero( const UCHAR *data, int len )
-{
- int i;
- int rc;
-
- rc = 0;
- for(i = 0; i < len; ++i) {
- rc |= data[i];
- }
-
- return rc;
-}
-
-#define MAX_MSG_SIZE 1400
-
-int encrypt(UCHAR encrypted[], const UCHAR pk[], const UCHAR sk[], const UCHAR nonce[], const UCHAR plain[], int length)
-{
- int rc;
- UCHAR temp_plain[MAX_MSG_SIZE];
- UCHAR temp_encrypted[MAX_MSG_SIZE];
-
-
- if(length+crypto_box_ZEROBYTES >= MAX_MSG_SIZE) {
- return -2;
- }
-
- memset(temp_plain, '\0', crypto_box_ZEROBYTES);
- memcpy(temp_plain + crypto_box_ZEROBYTES, plain, length);
-
- rc = crypto_box(temp_encrypted, temp_plain, crypto_box_ZEROBYTES + length, nonce, pk, sk);
-
- if( rc != 0 ) {
- return -1;
- }
-
- // this check is probably superficial
- if( is_zero(temp_plain, crypto_box_BOXZEROBYTES) != 0 ) {
- return -3;
- }
-
- memcpy(encrypted, temp_encrypted + crypto_box_BOXZEROBYTES, crypto_box_ZEROBYTES + length);
-
- return crypto_box_ZEROBYTES + length - crypto_box_BOXZEROBYTES;
-}
-
-int decrypt(UCHAR plain[], const UCHAR pk[], const UCHAR sk[], const UCHAR nonce[], const UCHAR encrypted[], int length)
-{
- int rc;
- UCHAR temp_encrypted[MAX_MSG_SIZE];
- UCHAR temp_plain[MAX_MSG_SIZE];
-
- if(length+crypto_box_BOXZEROBYTES >= MAX_MSG_SIZE) {
- return -2;
- }
-
- memset(temp_encrypted, '\0', crypto_box_BOXZEROBYTES);
- memcpy(temp_encrypted + crypto_box_BOXZEROBYTES, encrypted, length);
-
- rc = crypto_box_open(temp_plain, temp_encrypted, crypto_box_BOXZEROBYTES + length, nonce, pk, sk);
-
- if( rc != 0 ) {
- return -1;
- }
-
- // this check is probably superficial
- if( is_zero(temp_plain, crypto_box_ZEROBYTES) != 0 ) {
- return -3;
- }
-
- memcpy(plain, temp_plain + crypto_box_ZEROBYTES, crypto_box_BOXZEROBYTES + length);
-
- return crypto_box_BOXZEROBYTES + length - crypto_box_ZEROBYTES;
-}
-
-struct User {
- char* name;
- UCHAR public_key[crypto_box_PUBLICKEYBYTES];
- UCHAR secret_key[crypto_box_SECRETKEYBYTES];
-};
-
-void print_user(struct User *user)
-{
- char phexbuf[2*crypto_box_PUBLICKEYBYTES+1];
- char shexbuf[2*crypto_box_SECRETKEYBYTES+1];
-
- printf("username: %s\n", user->name);
- printf("public key: %s\n", to_hex(phexbuf, user->public_key, crypto_box_PUBLICKEYBYTES ));
- printf("secret key: %s\n\n", to_hex(shexbuf, user->secret_key, crypto_box_SECRETKEYBYTES ));
-}
-
-// initialization
-
-void initialize() {
- nacl_io_init();
- int rc;
- rc = sodium_init();
- assert(rc == 0);
-}
-
-void randombytes_test() {
-
- UCHAR a[24];
- UCHAR b[24];
-
- memset(a, '\0', 24);
- memset(b, '\0', 24);
-
- // check that is_zero is not broken
- assert(is_zero(a, 24) == 0);
- assert(is_zero(b, 24) == 0);
-
- randombytes(a, 24);
- randombytes(b, 24);
-
- // TEST: randombytes changes both variables
- assert(is_zero(a, 24) != 0);
- assert(is_zero(b, 24) != 0);
- // TEST: randobytes returned something different each time
- assert(memcmp(a,b,24) != 0);
-}
-
-void crypto_box_test() {
- int rc;
- char hexbuf[256];
- struct User alice = {"alice",
- {0x9a, 0x6a, 0x29, 0xbc, 0x58, 0x75, 0x77,
- 0xe6, 0xf8, 0x0d, 0x48, 0xc0, 0xcc, 0x4c,
- 0x41, 0xe5, 0xd5, 0xe1, 0x3d, 0x5e, 0xed,
- 0xc2, 0x7d, 0xf1, 0xc0, 0xd8, 0x08, 0xc5,
- 0xdd, 0x2e, 0xa6, 0x56},
- {0x89, 0x9d, 0x63, 0xea, 0x4c, 0x7a, 0x9b,
- 0xee, 0xad, 0xf7, 0x26, 0x1d, 0x81, 0x56,
- 0x38, 0x8a, 0xe2, 0x64, 0x51, 0xf0, 0xe8,
- 0x1d, 0x3d, 0x9f, 0x9c, 0xde, 0xed, 0x7e,
- 0xde, 0xe1, 0xe7, 0x78}
- };
- struct User bob = {"bob",
- {0x0e, 0x32, 0x48, 0x73, 0xd9, 0x96, 0x93,
- 0xa7, 0x39, 0x40, 0x85, 0xc2, 0x0a, 0x72,
- 0x72, 0xe7, 0xda, 0xde, 0xc9, 0x51, 0x06,
- 0xb6, 0x43, 0x35, 0x37, 0x15, 0xa6, 0x77,
- 0xb7, 0x6b, 0x9a, 0x63},
- {0xfc, 0x17, 0x2d, 0xdf, 0xd8, 0xb0, 0x79,
- 0x2d, 0x4f, 0x0f, 0x9e, 0x03, 0x6f, 0xaa,
- 0x79, 0x32, 0x50, 0xe4, 0xc9, 0x84, 0x63,
- 0xbe, 0x15, 0xc8, 0x13, 0xa0, 0xcb, 0xed,
- 0x2a, 0xc0, 0xb9, 0x17}
- };
- UCHAR nonce[crypto_box_NONCEBYTES] = {0x77, 0xf4,
- 0xce, 0x6d, 0x6b, 0xfd, 0x93, 0x69, 0x1e,
- 0x9d, 0xd3, 0xa5, 0x99, 0xca, 0xd3, 0x61,
- 0xd4, 0xbb, 0x65, 0x83, 0x99, 0x00, 0x7a,
- 0x67};
-
- char *msg = "Hello";
-
- print_user(&alice);
- print_user(&bob);
- printf("message to bob: %s\n", msg);
- printf("nonce: %s\n\n", to_hex(hexbuf, nonce, crypto_box_NONCEBYTES));
-
- UCHAR encrypted[1000];
- rc = encrypt(encrypted, bob.public_key, alice.secret_key, nonce, (const UCHAR *)msg, strlen(msg));
- assert( rc >= 0 );
- printf("encrypted message to bob: %s\n", to_hex(hexbuf, encrypted, rc ));
-
- UCHAR decrypted[1000];
- rc = decrypt(decrypted, alice.public_key, bob.secret_key, nonce, encrypted, rc);
- assert( rc >= 0 );
- decrypted[rc] = '\0';
- printf("decrypted message from alice: %s\n", decrypted);
-
- // TEST: msg = decrypt(encrypt(msg))
- assert(memcmp(msg, decrypted, strlen(msg)) == 0);
- // TEST: msg != encrypt(msg)
- assert(memcmp(msg, encrypted, strlen(msg)) != 0);
- // TEST: encrypt(msg) == "..."
- UCHAR correct[21] = {0x72, 0xd0, 0x7e, 0xf9, 0x72,
- 0x36, 0xd6, 0x5f, 0x7d, 0x37, 0xa5, 0xf0, 0x84,
- 0xf4, 0x37, 0xc8, 0xe9, 0x70, 0xd0, 0xe2, 0x20};
- assert(memcmp(encrypted, correct, 21) == 0);
-}
-
-int main( int argc, char **argv )
-{
- initialize();
- randombytes_test();
- crypto_box_test();
- return 0;
-}
\ No newline at end of file
diff --git a/ports/libsodium/pkg_info b/ports/libsodium/pkg_info
deleted file mode 100644
index 2ba3bda..0000000
--- a/ports/libsodium/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libsodium
-VERSION=1.0.3
-URL=https://github.com/jedisct1/libsodium/releases/download/1.0.3/libsodium-1.0.3.tar.gz
-LICENSE=ISC
-SHA1=e44ed485842966d4e2d8f58e74a5fd78fbfbe4b0
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libssh/build.sh b/ports/libssh/build.sh
deleted file mode 100644
index 808b163..0000000
--- a/ports/libssh/build.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-EXTRA_CMAKE_ARGS="\
- -DPNACL=ON\
- -DWITH_STATIC_LIB=ON\
- -DWITH_SHARED_LIB=OFF\
- -DWITH_EXAMPLES=OFF\
- -DHAVE_GETADDRINFO=ON
-"
diff --git a/ports/libssh/nacl.patch b/ports/libssh/nacl.patch
deleted file mode 100644
index 02b8f42..0000000
--- a/ports/libssh/nacl.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
---- a/ConfigureChecks.cmake
-+++ b/ConfigureChecks.cmake
-@@ -215,6 +215,6 @@ if (WITH_GSSAPI AND NOT GSSAPI_FOUND)
- endif (WITH_GSSAPI AND NOT GSSAPI_FOUND)
-
- # ENDIAN
--if (NOT WIN32)
-+if (NOT WIN32 AND NOT PNACL)
- test_big_endian(WORDS_BIGENDIAN)
--endif (NOT WIN32)
-+endif (NOT WIN32 AND NOT PNACL)
-diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake
---- a/cmake/Modules/DefineCompilerFlags.cmake
-+++ b/cmake/Modules/DefineCompilerFlags.cmake
-@@ -10,7 +10,11 @@ if (UNIX AND NOT WIN32)
- if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
-
- # add -Wconversion ?
-- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -pedantic-errors")
-+ # TODO(sbc): revert this change once these issues get fixed
-+ # https://code.google.com/p/nativeclient/issues/detail?id=3794
-+ # https://code.google.com/p/nativeclient/issues/detail?id=781
-+ #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -pedantic-errors")
-+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fno-builtin")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute")
-@@ -21,10 +25,12 @@ if (UNIX AND NOT WIN32)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
- endif (WITH_FPIC)
-
-- check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
-- if (WITH_STACK_PROTECTOR)
-- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
-- endif (WITH_STACK_PROTECTOR)
-+ if (NOT NACL)
-+ check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
-+ if (WITH_STACK_PROTECTOR)
-+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
-+ endif (WITH_STACK_PROTECTOR)
-+ endif ()
-
- if (CMAKE_BUILD_TYPE)
- string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -93,10 +93,12 @@ set(LIBSSH_LINK_LIBRARIES
- CACHE INTERNAL "libssh link libraries"
- )
-
-+if (WITH_SHARED_LIB)
- set(LIBSSH_SHARED_LIBRARY
- ssh_shared
- CACHE INTERNAL "libssh shared library"
- )
-+endif (WITH_SHARED_LIB)
-
- if (WITH_STATIC_LIB)
- set(LIBSSH_STATIC_LIBRARY
-@@ -217,6 +219,7 @@ include_directories(
- ${LIBSSH_PRIVATE_INCLUDE_DIRS}
- )
-
-+if (WITH_SHARED_LIB)
- add_library(${LIBSSH_SHARED_LIBRARY} SHARED ${libssh_SRCS})
-
- target_link_libraries(${LIBSSH_SHARED_LIBRARY} ${LIBSSH_LINK_LIBRARIES})
-@@ -247,6 +250,7 @@ install(
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- COMPONENT libraries
- )
-+endif (WITH_SHARED_LIB)
-
- if (WITH_STATIC_LIB)
- add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
-diff --git a/src/threads/CMakeLists.txt b/src/threads/CMakeLists.txt
---- a/src/threads/CMakeLists.txt
-+++ b/src/threads/CMakeLists.txt
-@@ -11,10 +11,12 @@ set(LIBSSH_THREADS_PRIVATE_INCLUDE_DIRS
- ${CMAKE_BINARY_DIR}
- )
-
-+if (WITH_SHARED_LIB)
- set(LIBSSH_THREADS_SHARED_LIBRARY
- ssh_threads_shared
- CACHE INTERNAL "libssh threads shared library"
- )
-+endif (WITH_SHARED_LIB)
-
- if (WITH_STATIC_LIB)
- set(LIBSSH_THREADS_STATIC_LIBRARY
-@@ -53,6 +55,7 @@ include_directories(
- ${LIBSSH_THREADS_PRIVATE_INCLUDE_DIRS}
- )
-
-+if (WITH_SHARED_LIB)
- add_library(${LIBSSH_THREADS_SHARED_LIBRARY} SHARED ${libssh_threads_SRCS})
-
- target_link_libraries(${LIBSSH_THREADS_SHARED_LIBRARY} ${LIBSSH_THREADS_LINK_LIBRARIES})
-@@ -82,6 +85,7 @@ install(
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- COMPONENT libraries
- )
-+endif (WITH_SHARED_LIB)
-
- if (WITH_STATIC_LIB)
- add_library(${LIBSSH_THREADS_STATIC_LIBRARY} STATIC ${libssh_threads_SRCS})
diff --git a/ports/libssh/pkg_info b/ports/libssh/pkg_info
deleted file mode 100644
index fd4a532..0000000
--- a/ports/libssh/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libssh
-VERSION=0.6.0
-URL=https://red.libssh.org/attachments/download/71/libssh-0.6.0.tar.xz
-LICENSE=LGPL
-DEPENDS=(openssl zlib glibc-compat)
-SHA1=da432966c2123bc7aa399d93dc8c185149d661a2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libssh2/build.sh b/ports/libssh2/build.sh
deleted file mode 100644
index 653e31d..0000000
--- a/ports/libssh2/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="tests/ssh2${NACL_EXEEXT}"
-
-EnableGlibcCompat
diff --git a/ports/libssh2/nacl.patch b/ports/libssh2/nacl.patch
deleted file mode 100644
index 1f22562..0000000
--- a/ports/libssh2/nacl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/example/x11.c b/example/x11.c
---- a/example/x11.c
-+++ b/example/x11.c
-@@ -10,6 +10,7 @@
- #include <sys/ioctl.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
-+#include <sys/time.h>
- #include <arpa/inet.h>
- #include <unistd.h>
- #include <sys/types.h>
diff --git a/ports/libssh2/pkg_info b/ports/libssh2/pkg_info
deleted file mode 100644
index 54f8d0f..0000000
--- a/ports/libssh2/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libssh2
-VERSION=1.4.3
-URL=http://www.libssh2.org/download/libssh2-1.4.3.tar.gz
-LICENSE=BSD
-DEPENDS=(openssl glibc-compat)
-SHA1=c27ca83e1ffeeac03be98b6eef54448701e044b0
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libtar/build.sh b/ports/libtar/build.sh
deleted file mode 100644
index 97d4361..0000000
--- a/ports/libtar/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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.
-
-NACLPORTS_CPPFLAGS+=" -DMAXPATHLEN=512 -DHAVE_STDARG_H"
-
-if [ "${NACL_SHARED}" = "1" ]; then
- NACLPORTS_CFLAGS+=" -fPIC"
-fi
-
-if [ "${NACL_DEBUG}" = "1" ]; then
- NACLPORTS_CPPFLAGS+=" -DDEBUG"
-fi
-
-export compat_cv_func_snprintf_works=yes
diff --git a/ports/libtar/nacl.patch b/ports/libtar/nacl.patch
deleted file mode 100644
index d633441..0000000
--- a/ports/libtar/nacl.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -2602,8 +2602,8 @@ cat >>confdefs.h <<\_ACEOF
- #define HAVE_STRLCPY 1
- _ACEOF
-
--else
-- LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
-+#else
-+# LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
-
- fi
-
-@@ -6236,7 +6236,8 @@ else
- See \`config.log' for more details." >&5
- echo "$as_me: error: cannot run test program while cross compiling
- See \`config.log' for more details." >&2;}
-- { (exit 1); exit 1; }; }
-+# { (exit 1); exit 1; }; }
-+}
- else
- cat >conftest.$ac_ext <<_ACEOF
-
-diff --git a/lib/decode.c b/lib/decode.c
---- a/lib/decode.c
-+++ b/lib/decode.c
-@@ -46,6 +46,10 @@ th_get_pathname(TAR *t)
- uid_t
- th_get_uid(TAR *t)
- {
-+#ifdef __native_client__
-+ /* Since we can't actually get a uid, we return a bogus value */
-+ return 1001;
-+#else
- int uid;
- struct passwd *pw;
-
-@@ -56,12 +60,17 @@ th_get_uid(TAR *t)
- /* if the password entry doesn't exist */
- sscanf(t->th_buf.uid, "%o", &uid);
- return uid;
-+#endif
- }
-
-
- gid_t
- th_get_gid(TAR *t)
- {
-+#ifdef __native_client__
-+ /* Since we can't actually get a gid, we return a bogus value */
-+ return 1002;
-+#else
- int gid;
- struct group *gr;
-
-@@ -72,6 +81,7 @@ th_get_gid(TAR *t)
- /* if the group entry doesn't exist */
- sscanf(t->th_buf.gid, "%o", &gid);
- return gid;
-+#endif
- }
-
-
-diff --git a/lib/encode.c b/lib/encode.c
---- a/lib/encode.c
-+++ b/lib/encode.c
-@@ -155,6 +155,7 @@ th_set_device(TAR *t, dev_t device)
- void
- th_set_user(TAR *t, uid_t uid)
- {
-+#if !defined(__BIONIC__)
- struct passwd *pw;
-
- pw = getpwuid(uid);
-@@ -162,6 +163,7 @@ th_set_user(TAR *t, uid_t uid)
- strlcpy(t->th_buf.uname, pw->pw_name, sizeof(t->th_buf.uname));
-
- int_to_oct(uid, t->th_buf.uid, 8);
-+#endif
- }
-
-
-@@ -169,6 +171,7 @@ th_set_user(TAR *t, uid_t uid)
- void
- th_set_group(TAR *t, gid_t gid)
- {
-+#if !defined(__BIONIC__)
- struct group *gr;
-
- gr = getgrgid(gid);
-@@ -176,6 +179,7 @@ th_set_group(TAR *t, gid_t gid)
- strlcpy(t->th_buf.gname, gr->gr_name, sizeof(t->th_buf.gname));
-
- int_to_oct(gid, t->th_buf.gid, 8);
-+#endif
- }
-
-
-diff --git a/lib/extract.c b/lib/extract.c
---- a/lib/extract.c
-+++ b/lib/extract.c
-@@ -28,6 +28,22 @@
- #endif
-
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+struct group *getgrgid(gid_t gid) {
-+ errno = ENOSYS;
-+ return NULL;
-+}
-+
-+int major(dev_t dev) {
-+ return 0;
-+}
-+
-+int minor(dev_t dev) {
-+ return 0;
-+}
-+#endif
-+
-+
- struct linkname
- {
- char ln_save[MAXPATHLEN];
-@@ -74,10 +90,17 @@ tar_set_file_perms(TAR *t, char *realname)
- /* change access/modification time */
- if (!TH_ISSYM(t) && utime(filename, &ut) == -1)
- {
-+ /* TODO(bradnelson): Remove this when all mounts support utime. */
-+#if defined(__native_client__)
-+ if (errno != ENOSYS && errno != EINVAL) {
-+#endif
- #ifdef DEBUG
- perror("utime()");
- #endif
- return -1;
-+#if defined(__native_client__)
-+ }
-+#endif
- }
-
- /* change permissions */
-@@ -117,6 +140,7 @@ tar_extract_file(TAR *t, char *realname)
- if (i == 1)
- i = 0;
- }
-+#ifndef __native_client__
- else if (TH_ISLNK(t))
- i = tar_extract_hardlink(t, realname);
- else if (TH_ISSYM(t))
-@@ -127,6 +151,7 @@ tar_extract_file(TAR *t, char *realname)
- i = tar_extract_blockdev(t, realname);
- else if (TH_ISFIFO(t))
- i = tar_extract_fifo(t, realname);
-+#endif
- else /* if (TH_ISREG(t)) */
- i = tar_extract_regfile(t, realname);
-
-@@ -282,6 +307,7 @@ tar_skip_regfile(TAR *t)
- }
-
-
-+#ifndef __native_client__
- /* hardlink */
- int
- tar_extract_hardlink(TAR * t, char *realname)
-@@ -436,6 +462,7 @@ tar_extract_blockdev(TAR *t, char *realname)
-
- return 0;
- }
-+#endif
-
-
- /* directory */
-@@ -493,6 +520,7 @@ tar_extract_dir(TAR *t, char *realname)
- }
-
-
-+#ifndef __native_client__
- /* FIFO */
- int
- tar_extract_fifo(TAR *t, char *realname)
-@@ -525,5 +553,6 @@ tar_extract_fifo(TAR *t, char *realname)
-
- return 0;
- }
-+#endif
-
-
-diff --git a/lib/output.c b/lib/output.c
---- a/lib/output.c
-+++ b/lib/output.c
-@@ -82,14 +82,22 @@ th_print_long_ls(TAR *t)
- #endif
-
- uid = th_get_uid(t);
-+#if defined(__BIONIC__)
-+ pw = NULL;
-+#else
- pw = getpwuid(uid);
-+#endif
- if (pw == NULL)
- snprintf(username, sizeof(username), "%d", uid);
- else
- strlcpy(username, pw->pw_name, sizeof(username));
-
- gid = th_get_gid(t);
-+#if defined(__BIONIC__)
-+ gr = NULL;
-+#else
- gr = getgrgid(gid);
-+#endif
- if (gr == NULL)
- snprintf(groupname, sizeof(groupname), "%d", gid);
- else
-diff --git a/libtar/Makefile.in b/libtar/Makefile.in
---- a/libtar/Makefile.in
-+++ b/libtar/Makefile.in
-@@ -16,7 +16,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
-
- ### Installation programs and flags
- INSTALL = @INSTALL@
--INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
-+INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_DATA = @INSTALL_DATA@
- LN_S = @LN_S@
- MKDIR = @MKDIR@
diff --git a/ports/libtar/pkg_info b/ports/libtar/pkg_info
deleted file mode 100644
index ed0a7c7..0000000
--- a/ports/libtar/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libtar
-VERSION=1.2.11
-URL=ftp://ftp.feep.net/pub/software/libtar/libtar-1.2.11.tar.gz
-LICENSE=CUSTOM
-DEPENDS=(zlib)
-SHA1=9611f23024b0e89aad1cfea301122186b3c160f8
diff --git a/ports/libtheora/build.sh b/ports/libtheora/build.sh
deleted file mode 100644
index f6f5d2d..0000000
--- a/ports/libtheora/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2011 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.
-
-# Turn off doxygen (it doesn't exist on Mac & Linux, and has an error on
-# Windows).
-export HAVE_DOXYGEN="false"
-EXTRA_CONFIGURE_ARGS="\
- --disable-examples \
- --disable-sdltest \
- --${NACL_OPTION}-asm"
diff --git a/ports/libtheora/nacl.patch b/ports/libtheora/nacl.patch
deleted file mode 100644
index 7179635..0000000
--- a/ports/libtheora/nacl.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -11863,7 +11863,7 @@ else
- case $host in
- *)
- DEBUG="-g -Wall -Wno-parentheses -DDEBUG -D__NO_MATH_INLINES"
-- CFLAGS="-Wall -Wno-parentheses -O3 -fforce-addr -fomit-frame-pointer -finline-functions -funroll-loops"
-+ CFLAGS="-Wall -Wno-parentheses -O3 -fomit-frame-pointer -finline-functions -funroll-loops"
- PROFILE="-Wall -Wno-parentheses -pg -g -O3 -fno-inline-functions -DDEBUG";;
- esac
- fi
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -168,7 +168,7 @@ else
- case $host in
- *)
- DEBUG="-g -Wall -Wno-parentheses -DDEBUG -D__NO_MATH_INLINES"
-- CFLAGS="-Wall -Wno-parentheses -O3 -fforce-addr -fomit-frame-pointer -finline-functions -funroll-loops"
-+ CFLAGS="-Wall -Wno-parentheses -O3 -fomit-frame-pointer -finline-functions -funroll-loops"
- PROFILE="-Wall -Wno-parentheses -pg -g -O3 -fno-inline-functions -DDEBUG";;
- esac
- fi
-diff --git a/lib/cpu.c b/lib/cpu.c
---- a/lib/cpu.c
-+++ b/lib/cpu.c
-@@ -20,6 +20,7 @@
-
- #include "cpu.h"
-
-+
- #if !defined(OC_X86_ASM)
- static ogg_uint32_t oc_cpu_flags_get(void){
- return 0;
-@@ -130,6 +131,7 @@ static ogg_uint32_t oc_cpu_flags_get(void){
- ogg_uint32_t ebx;
- ogg_uint32_t ecx;
- ogg_uint32_t edx;
-+# if !defined(__native_client__)
- # if !defined(__amd64__)&&!defined(__x86_64__)
- /*Not all x86-32 chips support cpuid, so we have to check.*/
- # if !defined(_MSC_VER)
-@@ -154,6 +156,7 @@ static ogg_uint32_t oc_cpu_flags_get(void){
- /*No cpuid.*/
- if(eax==ebx)return 0;
- # endif
-+# endif
- cpuid(0,eax,ebx,ecx,edx);
- /* l e t n I e n i u n e G*/
- if(ecx==0x6C65746E&&edx==0x49656E69&&ebx==0x756E6547||
diff --git a/ports/libtheora/pkg_info b/ports/libtheora/pkg_info
deleted file mode 100644
index a571e0b..0000000
--- a/ports/libtheora/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libtheora
-VERSION=1.1.1
-URL=http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
-LICENSE=BSD:COPYING
-DEPENDS=(libogg)
-SHA1=8dcaa8e61cd86eb1244467c0b64b9ddac04ae262
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libtomcrypt/build.sh b/ports/libtomcrypt/build.sh
deleted file mode 100644
index abd9666..0000000
--- a/ports/libtomcrypt/build.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2011 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.
-
-BUILD_DIR=${SRC_DIR}
-
-MAKE_TARGETS="-f makefile.unix test"
-EXECUTABLES=test
-
-BuildStep() {
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-TestStep() {
- RunSelLdrCommand test
-}
-
-InstallStep() {
- # copy libs and headers manually
- MakeDir ${DESTDIR_INCLUDE}
- MakeDir ${DESTDIR_LIB}
- LogExecute cp src/headers/*.h ${DESTDIR_INCLUDE}
- LogExecute cp *.a ${DESTDIR_LIB}
-}
diff --git a/ports/libtomcrypt/nacl.patch b/ports/libtomcrypt/nacl.patch
deleted file mode 100644
index 239f055..0000000
--- a/ports/libtomcrypt/nacl.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff --git a/makefile.unix b/makefile.unix
---- a/makefile.unix
-+++ b/makefile.unix
-@@ -3,16 +3,20 @@
- # Tom St Denis
-
- # Compiler and Linker Names
--CC=cc
--LD=ld
-+CC?=cc
-+LD?=ld
-+RANLIB?=ranlib
-
- # Archiver [makes .a files]
--AR=ar
--ARFLAGS=r
-+AR?=ar
-+ARFLAGS?=r
-
- # Compilation flags. Note the += does not write over the user's CFLAGS!
- CFLAGS = -c -I./testprof/ -I./src/headers/ -DLTC_SOURCE -O2 ${CFLAGS_OPTS} -o $@
-
-+CFLAGS += -DGMP_DESC -DUSE_GMP -DLTC_NO_ASM
-+EXTRALIBS ?= -lgmp
-+
- LIBNAME=libtomcrypt.a
- LIBTEST=libtomcrypt_prof.a
- LIBTEST_S=$(LIBTEST)
-diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h
---- a/src/headers/tomcrypt_cfg.h
-+++ b/src/headers/tomcrypt_cfg.h
-@@ -70,7 +70,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
- #endif
-
- /* detect amd64 */
--#if !defined(__STRICT_ANSI__) && defined(__x86_64__)
-+#if !defined(__STRICT_ANSI__) && defined(__x86_64__) && !defined(__native_client__)
- #define ENDIAN_LITTLE
- #define ENDIAN_64BITWORD
- #define LTC_FAST
-diff --git a/src/headers/tomcrypt_macros.h b/src/headers/tomcrypt_macros.h
---- a/src/headers/tomcrypt_macros.h
-+++ b/src/headers/tomcrypt_macros.h
-@@ -7,10 +7,10 @@
- typedef unsigned long long ulong64;
- #endif
-
--/* this is the "32-bit at least" data type
-- * Re-define it to suit your platform but it must be at least 32-bits
-+/* this is the "32-bit at least" data type
-+ * Re-define it to suit your platform but it must be at least 32-bits
- */
--#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__))
-+#if !defined(__native_client__) && defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__))
- typedef unsigned ulong32;
- #else
- typedef unsigned long ulong32;
-@@ -67,7 +67,7 @@
-
- #ifdef ENDIAN_LITTLE
-
--#if !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__))))
-+#if !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__) && !defined(__native_client__))))
-
- #define STORE32H(x, y) \
- asm __volatile__ ( \
-@@ -98,7 +98,7 @@ asm __volatile__ ( \
-
-
- /* x86_64 processor */
--#if !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__))
-+#if !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__) && !defined(__native_client__))
-
- #define STORE64H(x, y) \
- asm __volatile__ ( \
-@@ -341,7 +341,7 @@ static inline unsigned RORc(unsigned word, const int i)
-
-
- /* 64-bit Rotates */
--#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
-+#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM) && !defined(__native_client__)
-
- static inline unsigned long ROL64(unsigned long word, int i)
- {
diff --git a/ports/libtomcrypt/pkg_info b/ports/libtomcrypt/pkg_info
deleted file mode 100644
index bba3c86..0000000
--- a/ports/libtomcrypt/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libtomcrypt
-VERSION=1.17
-URL=http://libtomcrypt.googlecode.com/files/crypt-1.17.tar.bz2
-DEPENDS=(gmp)
-LICENSE=CUSTOM:LICENSE
-SHA1=9c746822c84e4276e432b64964f94d1d5ddd13ad
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libtommath/build.sh b/ports/libtommath/build.sh
deleted file mode 100644
index e1acc66..0000000
--- a/ports/libtommath/build.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (c) 2011 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.
-
-BUILD_DIR=${SRC_DIR}
-MAKE_TARGETS=mtest
-EXECUTABLES=mtest/mtest${NACL_EXEEXT}
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-BuildStep() {
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-TestStep() {
- # To run tests, pipe mtest.nexe output into test.nexe input
- # mtest/mtest.exe | test.nexe
- # However, this test is setup to run forever, so we don't run
- # it as part of the build.
- #RunSelLdrCommand mtest/mtest.nexe | RunSelLdrCommand test.nexe
- return
-}
-
-InstallStep() {
- # copy libs and headers manually
- MakeDir ${DESTDIR_INCLUDE}
- MakeDir ${DESTDIR_LIB}
- LogExecute cp *.h ${DESTDIR_INCLUDE}/
- LogExecute cp *.a ${DESTDIR_LIB}/
-}
diff --git a/ports/libtommath/nacl.patch b/ports/libtommath/nacl.patch
deleted file mode 100644
index 60edd95..0000000
--- a/ports/libtommath/nacl.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-diff --git a/makefile b/makefile
---- a/makefile
-+++ b/makefile
-@@ -11,6 +11,8 @@ ifndef MAKE
- MAKE=make
- endif
-
-+RANLIB ?= ranlib
-+
- ifndef IGNORE_SPEED
-
- #for speed
-@@ -87,7 +89,7 @@ bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin_n.o
-
- $(LIBNAME): $(OBJECTS)
- $(AR) $(ARFLAGS) $@ $(OBJECTS)
-- ranlib $@
-+ $(RANLIB) $@
-
- #make a profiled library (takes a while!!!)
- #
-@@ -97,17 +99,17 @@ $(LIBNAME): $(OBJECTS)
- # So far I've seen improvements in the MP math
- profiled:
- make CFLAGS="$(CFLAGS) -fprofile-arcs -DTESTING" timing
-- ./ltmtest
-- rm -f *.a *.o ltmtest
-+ ./ltmtest$(EXEEXT)
-+ rm -f *.a *.o ltmtest$(EXEEXT)
- make CFLAGS="$(CFLAGS) -fbranch-probabilities"
-
- #make a single object profiled library
- profiled_single:
- perl gen.pl
- $(CC) $(CFLAGS) -fprofile-arcs -DTESTING -c mpi.c -o mpi.o
-- $(CC) $(CFLAGS) -DTESTING -DTIMER demo/timing.c mpi.o -o ltmtest
-- ./ltmtest
-- rm -f *.o ltmtest
-+ $(CC) $(CFLAGS) -DTESTING -DTIMER demo/timing.c mpi.o -o ltmtest$(EXEEXT)
-+ ./ltmtest$(EXEEXT)
-+ rm -f *.o ltmtest$(EXEEXT)
- $(CC) $(CFLAGS) -fbranch-probabilities -DTESTING -c mpi.c -o mpi.o
- $(AR) $(ARFLAGS) $(LIBNAME) mpi.o
- ranlib $(LIBNAME)
-@@ -119,13 +121,13 @@ install: $(LIBNAME)
- install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
-
- test: $(LIBNAME) demo/demo.o
-- $(CC) $(CFLAGS) demo/demo.o $(LIBNAME) -o test
-+ $(CC) $(CFLAGS) demo/demo.o $(LIBNAME) -o test$(EXEEXT)
-
- mtest: test
-- cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest
-+ cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest$(EXEEXT)
-
- timing: $(LIBNAME)
-- $(CC) $(CFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o ltmtest
-+ $(CC) $(CFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o ltmtest$(EXEEXT)
-
- # makes the LTM book DVI file, requires tetex, perl and makeindex [part of tetex I think]
- docdvi: tommath.src
-@@ -165,7 +167,7 @@ pretty:
- perl pretty.build
-
- clean:
-- rm -f *.bat *.pdf *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \
-+ rm -f *.bat *.pdf *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test$(EXEEXT) ltmtest$(EXEEXT) mpitest$(EXEEXT) mtest/mtest$(EXEEXT) \
- *.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
- rm -rf .libs
- cd etc ; MAKE=${MAKE} ${MAKE} clean
-diff --git a/tommath.h b/tommath.h
---- a/tommath.h
-+++ b/tommath.h
-@@ -46,7 +46,7 @@ extern "C" {
-
-
- /* detect 64-bit mode if possible */
--#if defined(__x86_64__)
-+#if defined(__x86_64__) && !defined(__native_client__)
- #if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
- #define MP_64BIT
- #endif
diff --git a/ports/libtommath/pkg_info b/ports/libtommath/pkg_info
deleted file mode 100644
index a5f60fd..0000000
--- a/ports/libtommath/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=libtommath
-VERSION=0.41
-URL=http://download.sf.net/tommath/libtommath/0.41/ltm-0.41.tar.bz2
-LICENSE=CUSTOM:LICENSE
-SHA1=a6db2221c64a1951c5c78d573dbf427f989fd346
diff --git a/ports/libtool/build.sh b/ports/libtool/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libtool/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libtool/pkg_info b/ports/libtool/pkg_info
deleted file mode 100644
index 3f0519c..0000000
--- a/ports/libtool/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libtool
-VERSION=2.4
-URL=http://ftp.kaist.ac.kr/gnu/gnu/libtool/libtool-2.4.tar.xz
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-SHA1=a5a44aa791c8b93cbe1c2f839368cd3de5f5f3e1
diff --git a/ports/libunistring/build.sh b/ports/libunistring/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libunistring/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libunistring/pkg_info b/ports/libunistring/pkg_info
deleted file mode 100644
index 3d01e59..0000000
--- a/ports/libunistring/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libunistring
-VERSION=0.9.3
-URL=http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.3.tar.gz
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-SHA1=e1ea13c24a30bc93932d19eb5ad0704a618506dd
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libuuid/nacl.patch b/ports/libuuid/nacl.patch
deleted file mode 100644
index 306fe6a..0000000
--- a/ports/libuuid/nacl.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/randutils.c b/randutils.c
---- a/randutils.c
-+++ b/randutils.c
-@@ -13,7 +13,9 @@
- #include <string.h>
- #include <sys/time.h>
-
-+#ifndef __native_client__
- #include <sys/syscall.h>
-+#endif
-
- #include "randutils.h"
-
diff --git a/ports/libuuid/pkg_info b/ports/libuuid/pkg_info
deleted file mode 100644
index 31100fb..0000000
--- a/ports/libuuid/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=libuuid
-VERSION=1.0.3
-URL=http://downloads.sf.net/project/libuuid/libuuid-1.0.3.tar.gz
-LICENSE=BSD
-SHA1=46eaedb875ae6e63677b51ec583656199241d597
diff --git a/ports/libvorbis/build.sh b/ports/libvorbis/build.sh
deleted file mode 100644
index 8fb18db..0000000
--- a/ports/libvorbis/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2011 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.
-
-
-export LIBS="-lm"
diff --git a/ports/libvorbis/pkg_info b/ports/libvorbis/pkg_info
deleted file mode 100644
index c6d371d..0000000
--- a/ports/libvorbis/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libvorbis
-VERSION=1.3.3
-URL=http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
-LICENSE=CUSTOM:COPYING
-DEPENDS=(libogg)
-SHA1=8dae60349292ed76db0e490dc5ee51088a84518b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libvpx/build.sh b/ports/libvpx/build.sh
deleted file mode 100644
index a396b2c..0000000
--- a/ports/libvpx/build.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015 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.
-
-OS_JOBS=1
-
-if [[ ${NACL_LIBC} == newlib ]]; then
- NACLPORTS_CXXFLAGS+=" -std=gnu++11"
-fi
-
-if [[ ${NACL_ARCH} == arm && ${TOOLCHAIN} == glibc ]]; then
- # Force -O2 rather then -O3 to work around arm gcc bug
- EXTRA_CONFIGURE_ARGS="--enable-small"
-fi
-
-SetOptFlags() {
- # libvps sets it own optimisation flags
- return
-}
-
-ConfigureStep() {
- SetupCrossEnvironment
- LogExecute ${SRC_DIR}/configure --target=generic-gnu --cpu=le32 \
- --disable-unit-tests --prefix=${PREFIX} \
- --extra-cflags="${NACLPORTS_CPPFLAGS}" ${EXTRA_CONFIGURE_ARGS:-}
-}
diff --git a/ports/libvpx/pkg_info b/ports/libvpx/pkg_info
deleted file mode 100644
index 6eff0a3..0000000
--- a/ports/libvpx/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libvpx
-VERSION=1.4.0
-URL=https://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.4.0.tar.bz2
-LICENSE=BSD
-SHA1=d05f4e9a9878886282ac9c9246f8fac080c94c8f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libwebp/build.sh b/ports/libwebp/build.sh
deleted file mode 100644
index 7044a40..0000000
--- a/ports/libwebp/build.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2014 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.
-
-if [[ ${NACL_SHARED} != 1 ]]; then
- # Without this the test for libpng fails with undefined math functions
- NACLPORTS_LIBS+=" -lz -lm"
-fi
-
-EXECUTABLES="
- examples/dwebp${NACL_EXEEXT}
- examples/cwebp${NACL_EXEEXT}
-"
-
-TestStep() {
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- return
- fi
-
- EXAMPLE_DIR=examples
- if [[ ${NACL_SHARED} == 1 ]]; then
- EXAMPLE_DIR=examples/.libs
- export SEL_LDR_LIB_PATH=${BUILD_DIR}/src/.libs
- fi
- LogExecute ${EXAMPLE_DIR}/dwebp ${SRC_DIR}/examples/test.webp -o out.webp
- LogExecute ${EXAMPLE_DIR}/cwebp out.webp -o out.png
-}
diff --git a/ports/libwebp/pkg_info b/ports/libwebp/pkg_info
deleted file mode 100644
index d634dca..0000000
--- a/ports/libwebp/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libwebp
-VERSION=0.4.3
-URL=http://downloads.webmproject.org/releases/webp/libwebp-0.4.3.tar.gz
-LICENSE=BSD
-DEPENDS=(tiff jpeg8d libpng)
-SHA1=1c307a61c4d0018620b4ba9a58e8f48a8d6640ef
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libx11/build.sh b/ports/libx11/build.sh
deleted file mode 100644
index 53c2aee..0000000
--- a/ports/libx11/build.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2014 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.
-
-if [ "${NACL_SHARED}" = "0" ]; then
- EXTRA_CONFIGURE_ARGS+=" --enable-shared=no"
-fi
-
-EnableGlibcCompat
-
-InstallStep() {
- DefaultInstallStep
- local pkgconfig_file=${INSTALL_DIR}/webports-dummydir/lib/pkgconfig/x11.pc
- if [ "${NACL_LIBC}" = "newlib" ]; then
- if ! grep -Eq "lglibc-compat" $pkgconfig_file; then
- sed -i.bak 's/-lX11/-lX11 -lglibc-compat/' $pkgconfig_file
- fi
- fi
-}
-
diff --git a/ports/libx11/nacl.patch b/ports/libx11/nacl.patch
deleted file mode 100644
index 8e3e4c5..0000000
--- a/ports/libx11/nacl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -729,6 +729,7 @@ LDFLAGS_FOR_BUILD
- CFLAGS_FOR_BUILD
- CPPFLAGS_FOR_BUILD
- CC_FOR_BUILD
-+LIBS_FOR_BUILD
- HAVE_PERL_FALSE
- HAVE_PERL_TRUE
- PERL
-diff --git a/src/CrGlCur.c b/src/CrGlCur.c
---- a/src/CrGlCur.c
-+++ b/src/CrGlCur.c
-@@ -40,8 +40,10 @@ in this Software without prior written authorization from The Open Group.
- #if defined(hpux)
- #include <dl.h>
- #else
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- #include <dlfcn.h>
- #endif
-+#endif
- #include "Cr.h"
-
- #ifdef __CYGWIN__
-@@ -71,7 +73,11 @@ open_library (void)
- #if defined(hpux)
- module = shl_load(library, BIND_DEFERRED, 0L);
- #else
-+# if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ module == NULL;
-+# else
- module = dlopen(library, RTLD_LAZY);
-+# endif
- #endif
- if (module)
- return module;
-@@ -106,9 +112,13 @@ fetch_symbol (XModuleType module, const char *under_symbol)
- free(symbols);
- }
- #else
-+# if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ result = NULL;
-+# else
- result = dlsym (module, symbol);
- if (!result)
- result = dlsym (module, under_symbol);
-+# endif
- #endif
- return result;
- }
-diff --git a/src/GetDflt.c b/src/GetDflt.c
---- a/src/GetDflt.c
-+++ b/src/GetDflt.c
-@@ -127,10 +127,14 @@ GetHomeDir(
- (void) strncpy(dest, ptr, len-1);
- dest[len-1] = '\0';
- } else {
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+ pw = NULL;
-+#else
- if ((ptr = getenv("USER")))
- pw = _XGetpwnam(ptr,pwparams);
- else
- pw = _XGetpwuid(getuid(),pwparams);
-+#endif
- if (pw != NULL) {
- (void) strncpy(dest, pw->pw_dir, len-1);
- dest[len-1] = '\0';
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -1356,7 +1356,7 @@ preprocess: $(patsubst %.c,%.ii,$(libX11_la_SOURCES))
- @MAKE_LINT_LIB_TRUE@ $(AM_V_GEN)$(LINT) -y -oX11 -x $(ALL_LINT_FLAGS) $(lintlib_src)
-
- ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/src/util/makekeys$(EXEEXT)
-- $(top_builddir)/src/util/makekeys $(KEYSYMDEFS) > ks_tables_h
-+ $(top_builddir)/src/util/makekeys$(EXEEXT) $(KEYSYMDEFS) > ks_tables_h
- mv ks_tables_h $@
-
- $(top_builddir)/src/util/makekeys$(EXEEXT): force
-diff --git a/src/util/Makefile.in b/src/util/Makefile.in
---- a/src/util/Makefile.in
-+++ b/src/util/Makefile.in
-@@ -144,7 +144,7 @@ LD = @LD@
- LDFLAGS = @LDFLAGS_FOR_BUILD@
- LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS_FOR_BUILD@
- LIBTOOL = @LIBTOOL@
- LIB_MAN_DIR = @LIB_MAN_DIR@
- LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
-@@ -355,7 +355,8 @@ distclean-compile:
- @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
- makekeys-makekeys.o: makekeys.c
--@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(makekeys_CPPFLAGS) $(CPPFLAGS) $(makekeys_CFLAGS) $(CFLAGS) -MT makekeys-makekeys.o -MD -MP -MF $(DEPDIR)/makekeys-makekeys.Tpo -c -o makekeys-makekeys.o `test -f 'makekeys.c' || echo '$(srcdir)/'`makekeys.c
-+#@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(makekeys_CPPFLAGS) $(CPPFLAGS) $(makekeys_CFLAGS) $(CFLAGS) -MT makekeys-makekeys.o -MD -MP -MF $(DEPDIR)/makekeys-makekeys.Tpo -c -o makekeys-makekeys.o `test -f 'makekeys.c' || echo '$(srcdir)/'`makekeys.c
-+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) -MT makekeys-makekeys.o -MD -MP -MF $(DEPDIR)/makekeys-makekeys.Tpo -c -o makekeys-makekeys.o `test -f 'makekeys.c' || echo '$(srcdir)/'`makekeys.c
- @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/makekeys-makekeys.Tpo $(DEPDIR)/makekeys-makekeys.Po
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='makekeys.c' object='makekeys-makekeys.o' libtool=no @AMDEPBACKSLASH@
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
diff --git a/ports/libx11/pkg_info b/ports/libx11/pkg_info
deleted file mode 100644
index a4ecb9e..0000000
--- a/ports/libx11/pkg_info
+++ /dev/null
@@ -1,12 +0,0 @@
-NAME=libx11
-ARCHIVE_ROOT=libX11-1.5.0
-VERSION=1.5.0
-URL=http://www.x.org/releases/X11R7.7/src/everything/libX11-1.5.0.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat xproto kbproto xextproto xtrans libxcb inputproto)
-# No mac support, seems to clash with local headers.
-BUILD_OS=linux
-# Causes crash in arm-nacl-clang
-# https://code.google.com/p/nativeclient/issues/detail?id=4114
-DISABLED_TOOLCHAIN=(clang-newlib/arm emscripten)
-SHA1=8177535c9c59d8c3ab98d55ce53520b5737ccd1a
diff --git a/ports/libxau/pkg_info b/ports/libxau/pkg_info
deleted file mode 100644
index 5c67982..0000000
--- a/ports/libxau/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libxau
-ARCHIVE_ROOT=libXau-1.0.7
-VERSION=1.0.7
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXau-1.0.7.tar.bz2
-LICENSE=GPL
-DEPENDS=(xproto)
-SHA1=29c47207fd246425b906f525b2220235ce4cd0f6
diff --git a/ports/libxaw/build.sh b/ports/libxaw/build.sh
deleted file mode 100644
index 19a68f5..0000000
--- a/ports/libxaw/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
-
-InstallStep() {
- if [[ $NACL_SHARED == 0 ]]; then
- INSTALL_TARGETS="install LIBEXT=.a"
- fi
- DefaultInstallStep
-}
diff --git a/ports/libxaw/nacl.patch b/ports/libxaw/nacl.patch
deleted file mode 100644
index e8230d4..0000000
--- a/ports/libxaw/nacl.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -18510,7 +18523,11 @@ ac_config_commands="$ac_config_commands libtool_hack"
- # OSX/Win32 rules are different.
- platform_win32=no
- platform_darwin=no
--LIBEXT=so
-+if [ "$enable_shared" = "no" ]; then
-+ LIBEXT=a
-+else
-+ LIBEXT=so
-+fi
- case $host_os in
- cygwin*|mingw*)
- LIBEXT=dll.a
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -1438,7 +1438,7 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local
- @BUILD_XAW6_TRUE@@PLATFORM_DARWIN_TRUE@@PLATFORM_WIN32_FALSE@ -rm -f $(DESTDIR)$(libdir)/libXaw.6.@LIBEXT@
- @BUILD_XAW6_TRUE@@PLATFORM_DARWIN_TRUE@@PLATFORM_WIN32_FALSE@ (cd $(DESTDIR)$(libdir) && ln -s libXaw6.6.@LIBEXT@ libXaw.6.@LIBEXT@)
- @BUILD_XAW6_TRUE@@PLATFORM_DARWIN_FALSE@@PLATFORM_WIN32_FALSE@ -rm -f $(DESTDIR)$(libdir)/libXaw.@LIBEXT@.6
--@BUILD_XAW6_TRUE@@PLATFORM_DARWIN_FALSE@@PLATFORM_WIN32_FALSE@ (cd $(DESTDIR)$(libdir) && ln -s libXaw6.@LIBEXT@.6 libXaw.@LIBEXT@.6)
-+@BUILD_XAW6_TRUE@@PLATFORM_DARWIN_FALSE@@PLATFORM_WIN32_FALSE@ (cd $(DESTDIR)$(libdir) && if [ -f libXaw6.@LIBEXT@.6 ]; then ln -s libXaw6.@LIBEXT@.6 libXaw.@LIBEXT@.6; fi)
-
- @BUILD_XAW6_TRUE@@PLATFORM_WIN32_FALSE@uninstall-local::
- @BUILD_XAW6_TRUE@@PLATFORM_DARWIN_TRUE@@PLATFORM_WIN32_FALSE@ -rm -f $(DESTDIR)$(libdir)/libXaw.6.@LIBEXT@
-@@ -1448,7 +1448,7 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local
- @BUILD_XAW7_TRUE@@PLATFORM_DARWIN_TRUE@@PLATFORM_WIN32_FALSE@ -rm -f $(DESTDIR)$(libdir)/libXaw.7.@LIBEXT@
- @BUILD_XAW7_TRUE@@PLATFORM_DARWIN_TRUE@@PLATFORM_WIN32_FALSE@ (cd $(DESTDIR)$(libdir) && ln -s libXaw7.7.@LIBEXT@ libXaw.7.@LIBEXT@)
- @BUILD_XAW7_TRUE@@PLATFORM_DARWIN_FALSE@@PLATFORM_WIN32_FALSE@ -rm -f $(DESTDIR)$(libdir)/libXaw.@LIBEXT@.7
--@BUILD_XAW7_TRUE@@PLATFORM_DARWIN_FALSE@@PLATFORM_WIN32_FALSE@ (cd $(DESTDIR)$(libdir) && ln -s libXaw7.@LIBEXT@.7 libXaw.@LIBEXT@.7)
-+@BUILD_XAW7_TRUE@@PLATFORM_DARWIN_FALSE@@PLATFORM_WIN32_FALSE@ (cd $(DESTDIR)$(libdir) && if [ -f libXaw7.@LIBEXT@.7 ]; then ln -s libXaw7.@LIBEXT@.7 libXaw.@LIBEXT@.7; fi)
-
- @BUILD_XAW7_TRUE@@PLATFORM_WIN32_FALSE@uninstall-local::
- @BUILD_XAW7_TRUE@@PLATFORM_DARWIN_TRUE@@PLATFORM_WIN32_FALSE@ -rm -f $(DESTDIR)$(libdir)/libXaw.7.@LIBEXT@
-diff --git a/src/TextAction.c b/src/TextAction.c
---- a/src/TextAction.c
-+++ b/src/TextAction.c
-@@ -47,6 +47,10 @@ in this Software without prior written authorization from The Open Group.
- #include "Private.h"
- #include "XawI18n.h"
-
-+#if defined(__native_client__)
-+# include <sys/select.h>
-+#endif
-+
- #define SrcScan XawTextSourceScan
- #define FindDist XawTextSinkFindDistance
- #define FindPos XawTextSinkFindPosition
diff --git a/ports/libxaw/pkg_info b/ports/libxaw/pkg_info
deleted file mode 100644
index c83a668..0000000
--- a/ports/libxaw/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxaw
-ARCHIVE_ROOT=libXaw-1.0.11
-VERSION=1.0.11
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXaw-1.0.11.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat xproto libx11 libxext xextproto libxt libxmu libxpm)
-SHA1=a27556b14e2b4c250afcb98b6e99eebd7623816f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxcb/build.sh b/ports/libxcb/build.sh
deleted file mode 100644
index 389b551..0000000
--- a/ports/libxcb/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
-
-InstallStep() {
- DefaultInstallStep
- if [ "${NACL_LIBC}" = "newlib" ]; then
- local pkgconfig_file=${INSTALL_DIR}/webports-dummydir/lib/pkgconfig/xcb.pc
- if ! grep -Eq "lglibc-compat" $pkgconfig_file; then
- sed -i.bak 's/-lxcb/-lxcb -lglibc-compat/' $pkgconfig_file
- fi
- fi
-}
diff --git a/ports/libxcb/nacl.patch b/ports/libxcb/nacl.patch
deleted file mode 100644
index 40acac3..0000000
--- a/ports/libxcb/nacl.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -13123,7 +13136,9 @@ else
- $as_echo "yes" >&6; }
-
- fi
--NEEDED="pthread-stubs xau >= 0.99.2"
-+# Dropped pthread-stubs since for nacl we can always build against pthreads.
-+# This avoids an unused package.
-+NEEDED="xau >= 0.99.2"
-
- pkg_failed=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NEEDED" >&5
-diff --git a/src/xcb_conn.c b/src/xcb_conn.c
---- a/src/xcb_conn.c
-+++ b/src/xcb_conn.c
-@@ -63,6 +63,26 @@ static const int xcb_con_error = XCB_CONN_ERROR;
- static const int xcb_con_closed_mem_er = XCB_CONN_CLOSED_MEM_INSUFFICIENT;
- static const int xcb_con_closed_parse_er = XCB_CONN_CLOSED_PARSE_ERR;
-
-+#if defined(__native_client__) && defined(__GLIBC__)
-+#include "nacl_io/kernel_intercept.h"
-+#include "nacl_io/kernel_wrap.h"
-+#include <stdarg.h>
-+
-+/*
-+ * Explicitly use nacl_fcntl.
-+ * When built as a shared library, without this xcb seems to hit stubs.
-+ */
-+static int nacl_fcntl(int fd, int cmd, ...) {
-+ va_list ap;
-+ va_start(ap, cmd);
-+ int rtn = ki_fcntl(fd, cmd, ap);
-+ va_end(ap);
-+ return rtn;
-+}
-+#define fcntl nacl_fcntl
-+#endif
-+
-+
- static int set_fd_flags(const int fd)
- {
- /* Win32 doesn't have file descriptors and the fcntl function. This block sets the socket in non-blocking mode */
diff --git a/ports/libxcb/pkg_info b/ports/libxcb/pkg_info
deleted file mode 100644
index 675b444..0000000
--- a/ports/libxcb/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libxcb
-VERSION=1.8.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libxcb-1.8.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat xcb-proto libxau)
-SHA1=98199b6054750a06cddd4e77baa4354af547ce6f
diff --git a/ports/libxext/pkg_info b/ports/libxext/pkg_info
deleted file mode 100644
index 9065d4e..0000000
--- a/ports/libxext/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxext
-ARCHIVE_ROOT=libXext-1.3.1
-VERSION=1.3.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXext-1.3.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(libx11 xproto xextproto)
-SHA1=764ac472ae19a0faade193717a9e0938d3430aaa
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxfont/build.sh b/ports/libxfont/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/libxfont/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/libxfont/pkg_info b/ports/libxfont/pkg_info
deleted file mode 100644
index d83c10b..0000000
--- a/ports/libxfont/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libxfont
-ARCHIVE_ROOT=libXfont-1.4.5
-VERSION=1.4.5
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXfont-1.4.5.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat libfontenc freetype xtrans xproto fontsproto)
-SHA1=0bf3cb8aa192ab96bbaf384d1a4a00d15a40171e
diff --git a/ports/libxi/pkg_info b/ports/libxi/pkg_info
deleted file mode 100644
index 86641b9..0000000
--- a/ports/libxi/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxi
-ARCHIVE_ROOT=libXi-1.6.1
-VERSION=1.6.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXi-1.6.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(xproto libx11 xextproto libxext inputproto)
-SHA1=4b53b41fdaa3acc86606c696c68d5eed11454612
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxinerama/pkg_info b/ports/libxinerama/pkg_info
deleted file mode 100644
index 2f6b79f..0000000
--- a/ports/libxinerama/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxinerama
-ARCHIVE_ROOT=libXinerama-1.1.2
-VERSION=1.1.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXinerama-1.1.2.tar.bz2
-LICENSE=GPL
-DEPENDS=(libx11 libxext xextproto xineramaproto)
-SHA1=06a5b636305725ce09f6c3a4d5a15f2f188b5afd
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxkbfile/nacl.patch b/ports/libxkbfile/nacl.patch
deleted file mode 100644
index 1c803da..0000000
--- a/ports/libxkbfile/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/cout.c b/src/cout.c
---- a/src/cout.c
-+++ b/src/cout.c
-@@ -45,7 +45,7 @@ WriteCHdrVMods(FILE *file,Display *dpy,XkbDescPtr xkb)
- {
- register int i,nOut;
-
-- if ((!xkb)||(!xkb->names)||(!xkb->names->vmods))
-+ if ((!xkb)||(!xkb->names))
- return False;
- for (i=nOut=0;i<XkbNumVirtualMods;i++) {
- if (xkb->names->vmods[i]!=None) {
diff --git a/ports/libxkbfile/pkg_info b/ports/libxkbfile/pkg_info
deleted file mode 100644
index 7abdb40..0000000
--- a/ports/libxkbfile/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=libxkbfile
-VERSION=1.0.8
-URL=http://www.x.org/releases/X11R7.7/src/everything/libxkbfile-1.0.8.tar.bz2
-LICENSE=GPL
-DEPENDS=(kbproto libx11)
-SHA1=05139829837c26e3a14a40a700f058c018bc71f5
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxml2/build.sh b/ports/libxml2/build.sh
deleted file mode 100644
index f4092e9..0000000
--- a/ports/libxml2/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2011 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.
-
-MAKE_TARGETS="libxml2.la"
-INSTALL_TARGETS="install-libLTLIBRARIES install-data"
-EXTRA_CONFIGURE_ARGS="--with-python=no"
-EXTRA_CONFIGURE_ARGS+=" --with-iconv=no"
diff --git a/ports/libxml2/nacl.patch b/ports/libxml2/nacl.patch
deleted file mode 100644
index 60427e4..0000000
--- a/ports/libxml2/nacl.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/xmlIO.c b/xmlIO.c
---- a/xmlIO.c
-+++ b/xmlIO.c
-@@ -3649,10 +3649,12 @@ xmlParserGetDirectory(const char *filename) {
- else *cur = 0;
- ret = xmlMemStrdup(dir);
- } else {
-+#ifndef __native_client__
- if (getcwd(dir, 1024) != NULL) {
- dir[1023] = 0;
- ret = xmlMemStrdup(dir);
- }
-+#endif
- }
- return(ret);
- #undef IS_XMLPGD_SEP
diff --git a/ports/libxml2/pkg_info b/ports/libxml2/pkg_info
deleted file mode 100644
index dd30de1..0000000
--- a/ports/libxml2/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=libxml2
-VERSION=2.7.8
-URL=ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
-LICENSE=MIT
-SHA1=859dd535edbb851cc15b64740ee06551a7a17d40
diff --git a/ports/libxmu/nacl.patch b/ports/libxmu/nacl.patch
deleted file mode 100644
index d97cdc7..0000000
--- a/ports/libxmu/nacl.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/src/EditresCom.c b/src/EditresCom.c
---- a/src/EditresCom.c
-+++ b/src/EditresCom.c
-@@ -2196,11 +2196,13 @@ _XEditresGetStringValues(Widget w, Arg *warg, int numargs)
- case sizeof(int):
- XmuSnprintf(buffer, sizeof(buffer), "0x%08x", (int)value);
- break;
-+#if !defined(__native_client__)
- #ifdef LONG64
- case sizeof(long):
- XmuSnprintf(buffer, sizeof(buffer), "0x%016lx", value);
- break;
- #endif
-+#endif
- }
- }
- }
diff --git a/ports/libxmu/pkg_info b/ports/libxmu/pkg_info
deleted file mode 100644
index d518f76..0000000
--- a/ports/libxmu/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxmu
-ARCHIVE_ROOT=libXmu-1.1.1
-VERSION=1.1.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXmu-1.1.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(libxt libxext libx11 xextproto)
-SHA1=3e280aa927d78c05f94db6c7ae606f7ad132b495
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxpm/build.sh b/ports/libxpm/build.sh
deleted file mode 100644
index d569c8e..0000000
--- a/ports/libxpm/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright (c) 2014 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.
-
-NACLPORTS_LIBS+=" -lnacl_io"
-
-# The transtive dependencies of libxpm include nacl_io which is
-# written in C++. Without this sxpm binary fails to link.
-if [[ ${NACL_SHARED} != 1 ]]; then
- NACLPORTS_LIBS+=" -l${NACL_CXX_LIB} -pthread"
-fi
diff --git a/ports/libxpm/pkg_info b/ports/libxpm/pkg_info
deleted file mode 100644
index ed434ed..0000000
--- a/ports/libxpm/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=libxpm
-ARCHIVE_ROOT=libXpm-3.5.10
-VERSION=3.5.10
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXpm-3.5.10.tar.bz2
-LICENSE=GPL
-# creat() + other undefined symbols
-# libxt isn't really a hard dependency, but more things are built when it's
-# present, so making sure we hit that path.
-DEPENDS=(glibc-compat xproto libx11 libxt libxext)
-SHA1=eca9dbfa6253f7d6cc7d593dc83110c6c4876d7c
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxrender/pkg_info b/ports/libxrender/pkg_info
deleted file mode 100644
index 11efc88..0000000
--- a/ports/libxrender/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxrender
-ARCHIVE_ROOT=libXrender-0.9.7
-VERSION=0.9.7
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXrender-0.9.7.tar.bz2
-LICENSE=GPL
-DEPENDS=(libx11 renderproto)
-SHA1=6e4d75d8316d5217324258f555eba3a5d383feb2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxt/nacl.patch b/ports/libxt/nacl.patch
deleted file mode 100644
index db368b9..0000000
--- a/ports/libxt/nacl.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/src/Initialize.c b/src/Initialize.c
---- a/src/Initialize.c
-+++ b/src/Initialize.c
-@@ -314,10 +314,12 @@ String _XtGetUserName(
- (void) strncpy (dest, ptr, len-1);
- dest[len-1] = '\0';
- } else {
-+# if !defined(__native_client__) || defined(__GLIBC__)
- if ((pw = _XGetpwuid(getuid(),pwparams)) != NULL) {
- (void) strncpy (dest, pw->pw_name, len-1);
- dest[len-1] = '\0';
- } else
-+#endif
- *dest = '\0';
- }
- #endif
-@@ -361,6 +363,7 @@ static String GetRootDirName(
- (void) strncpy (dest, ptr, len-1);
- dest[len-1] = '\0';
- } else {
-+# if !defined(__native_client__) || defined(__GLIBC__)
- if ((ptr = getenv("USER")))
- pw = _XGetpwnam(ptr,pwparams);
- else
-@@ -369,6 +372,7 @@ static String GetRootDirName(
- (void) strncpy (dest, pw->pw_dir, len-1);
- dest[len-1] = '\0';
- } else
-+#endif
- *dest = '\0';
- }
- #endif
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -736,7 +736,7 @@ all-local: $(BUILT_FILES)
- $(BUILT_HEADER): $(BUILT_SOURCE)
-
- $(BUILT_SOURCE):
-- $(AM_V_GEN)$(top_builddir)/util/makestrs -i $(top_srcdir) $(STRINGSABIOPTIONS) < $(STRING_LIST) > StringDefs.c
-+ $(AM_V_GEN)$(top_builddir)/util/makestrs$(EXEEXT) -i $(top_srcdir) $(STRINGSABIOPTIONS) < $(STRING_LIST) > StringDefs.c
- $(AM_V_at)mkdir -p $(top_builddir)/src
- $(AM_V_at)mkdir -p $(top_builddir)/include/X11
- $(AM_V_at)cp StringDefs.h $(top_builddir)/include/X11
-diff --git a/util/Makefile.in b/util/Makefile.in
---- a/util/Makefile.in
-+++ b/util/Makefile.in
-@@ -311,7 +311,7 @@ distclean-compile:
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makestrs.Po@am__quote@
-
- .c.o:
--@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-+@am__fastdepCC_TRUE@ gcc -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
diff --git a/ports/libxt/pkg_info b/ports/libxt/pkg_info
deleted file mode 100644
index 14b5db5..0000000
--- a/ports/libxt/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxt
-ARCHIVE_ROOT=libXt-1.1.3
-VERSION=1.1.3
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXt-1.1.3.tar.bz2
-LICENSE=GPL
-DEPENDS=(libsm libice libx11 xproto kbproto)
-SHA1=2cef068bc4d7170e31b89b5c06aeaf4451a7699a
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libxtst/pkg_info b/ports/libxtst/pkg_info
deleted file mode 100644
index a3d34bd..0000000
--- a/ports/libxtst/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=libxtst
-ARCHIVE_ROOT=libXtst-1.2.1
-VERSION=1.2.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/libXtst-1.2.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(libx11 libxext libxi recordproto xextproto inputproto)
-SHA1=44e19899f9938d3db5546e51c338d6f86d88cfe2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/libyuv/build.sh b/ports/libyuv/build.sh
deleted file mode 100644
index 9b17074..0000000
--- a/ports/libyuv/build.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="convert libyuv_unittest"
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-EnableGlibcCompat
-
-if [ "${NACL_ARCH}" = "x86_64" ]; then
- NACLPORTS_CPPFLAGS+=" -DLIBYUV_DISABLE_X86=1"
-fi
-
-EXTRA_CMAKE_ARGS="-DTEST=ON"
-EXTRA_CMAKE_ARGS+=" -DGTEST_SRC_DIR=${GTEST_SRC}"
-
-TestStep() {
- # TODO(sbc): re-enable i686 testing once we fix this gtest-releated issue:
- # http://crbug.com/434821
- if [ "${NACL_ARCH}" = "i686" ]; then
- return
- fi
- if [ "${NACL_ARCH}" = pnacl ]; then
- return
- fi
- LogExecute ./libyuv_unittest.sh --gtest_filter=-libyuvTest.ARGBRect_Unaligned
-}
diff --git a/ports/libyuv/nacl.patch b/ports/libyuv/nacl.patch
deleted file mode 100644
index 890a2a9..0000000
--- a/ports/libyuv/nacl.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -102,12 +102,13 @@ endif()
- if(TEST)
- find_library(GTEST_LIBRARY gtest)
- if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND")
-- set(GTEST_SRC_DIR /usr/src/gtest)
-+ set(GTEST_SRC_DIR /usr/src/gtest CACHE STRING "Location of gtest sources")
- if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc)
- message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}")
- set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc)
- add_library(gtest STATIC ${gtest_sources})
- include_directories(${GTEST_SRC_DIR})
-+ include_directories(${GTEST_SRC_DIR}/include)
- set(GTEST_LIBRARY gtest)
- else()
- message(FATAL_ERROR "TEST is set but unable to find gtest library")
diff --git a/ports/libyuv/pkg_info b/ports/libyuv/pkg_info
deleted file mode 100644
index 7c92f00..0000000
--- a/ports/libyuv/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=libyuv
-VERSION=632c50f
-URL=https://chromium.googlesource.com/external/libyuv.git@632c50f
-DEPENDS=(glibc-compat jpeg8d)
-DISABLED_TOOLCHAIN=(emscripten)
-LICENSE=BSD
diff --git a/ports/lua/README.nacl b/ports/lua/README.nacl
deleted file mode 100644
index 4080643..0000000
--- a/ports/lua/README.nacl
+++ /dev/null
@@ -1,47 +0,0 @@
-Lua for Chrome
-==============
-
-This is package of the Lua interactive shell built to run under Native Client
-within Chrome/Chromium.
-
-The NaCl binary is essentially an slightly modfied version of the 'lua'
-executable linked with the 'nacl_io' library in order to provide emulated POSIX
-I/O within Chrome. The terminal is rendered in HTML/CSS using hterm
-(https://github.com/libapps-mirror/libapps). See naclterm.js for more
-details.
-
-The logo files here are derived from the postscript logo available at:
-http://www.lua.org/images/
-
-The PNaCl version is published here:
-http://gonativeclient.appspot.com/demos/lua/
-
-The NaCl version is published in the Chrome Web Store:
-https://chrome.google.com/webstore/detail/lua/nkcnhkobblkmiampcmimoemaeffjopph
-
-Passing Arguments to Lua
-------------------------
-
-Aguments can be passed to Lua via the URL parameters. For example to run
-Lua with the arguments "myfile.lua -v" the URL can be modified to look like::
-
- index.html?ARG1=myfile.lua&ARG2=-v
-
-URL parameters are converted automatically to environment variables and
-variables of form ARG<N> are passed to the executable as part of the argv
-array.
-
-Testing
--------
-
-The Lua test suite is installed into the application virtual files system
-at startup and is located at "/lua-5.3.0-tests". The current working
-directory is also set to this directory on startup so it is possible to
-run all the tests using the following URL::
-
- index.html?ARG1=all.lua&ARG2=-e_U%3dtrue
-
-For more information on how to running the lua test suite see the lua
-teste suite website at http://www.lua.org/tests/.
-
-.. vim:ft=rst:
diff --git a/ports/lua/background.js b/ports/lua/background.js
deleted file mode 100644
index 980cef8..0000000
--- a/ports/lua/background.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('lua.html', {
- 'id': 'main',
- 'bounds': {
- 'width': 800,
- 'height': 800
- }
- });
-});
diff --git a/ports/lua/binarytrees.lua b/ports/lua/binarytrees.lua
deleted file mode 100644
index 41881bf..0000000
--- a/ports/lua/binarytrees.lua
+++ /dev/null
@@ -1,51 +0,0 @@
--- Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
--- The Computer Language Benchmarks Game
--- http://benchmarksgame.alioth.debian.org/
--- contributed by Mike Pall
-
-local function BottomUpTree(item, depth)
- if depth > 0 then
- local i = item + item
- depth = depth - 1
- local left, right = BottomUpTree(i-1, depth), BottomUpTree(i, depth)
- return { item, left, right }
- else
- return { item }
- end
-end
-
-local function ItemCheck(tree)
- if tree[2] then
- return tree[1] + ItemCheck(tree[2]) - ItemCheck(tree[3])
- else
- return tree[1]
- end
-end
-
-local N = tonumber(arg and arg[1]) or 0
-local mindepth = 4
-local maxdepth = mindepth + 2
-if maxdepth < N then maxdepth = N end
-
-do
- local stretchdepth = maxdepth + 1
- local stretchtree = BottomUpTree(0, stretchdepth)
- io.write(string.format("stretch tree of depth %d\t check: %d\n",
- stretchdepth, ItemCheck(stretchtree)))
-end
-
-local longlivedtree = BottomUpTree(0, maxdepth)
-
-for depth=mindepth,maxdepth,2 do
- local iterations = 2 ^ (maxdepth - depth + mindepth)
- local check = 0
- for i=1,iterations do
- check = check + ItemCheck(BottomUpTree(1, depth)) +
- ItemCheck(BottomUpTree(-1, depth))
- end
- io.write(string.format("%d\t trees of depth %d\t check: %d\n",
- iterations*2, depth, check))
-end
-
-io.write(string.format("long lived tree of depth %d\t check: %d\n",
- maxdepth, ItemCheck(longlivedtree)))
diff --git a/ports/lua/build.sh b/ports/lua/build.sh
deleted file mode 100644
index 40bcb92..0000000
--- a/ports/lua/build.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright (c) 2011 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.
-
-BUILD_DIR=${SRC_DIR}
-EXECUTABLES="src/lua${NACL_EXEEXT} src/luac${NACL_EXEEXT}"
-
-EnableCliMain
-
-if [ ${TOOLCHAIN} == glibc ]; then
- PLAT=nacl-glibc
-elif [ ${TOOLCHAIN} == emscripten ]; then
- PLAT=emscripten
-else
- PLAT=nacl-newlib
-fi
-
-TEST_FILE=lua-5.3.0-tests.tar.gz
-TEST_URL=http://www.lua.org/tests/${TEST_FILE}
-TEST_SHA1=8fd633ab67edf5e824c2afc62f318de245fce268
-
-DownloadStep() {
- if ! CheckHash ${NACL_PACKAGES_CACHE}/${TEST_FILE} ${TEST_SHA1}; then
- Fetch ${TEST_URL} ${NACL_PACKAGES_CACHE}/${TEST_FILE}
- if ! CheckHash ${NACL_PACKAGES_CACHE}/${TEST_FILE} ${TEST_SHA1} ; then
- Banner "${TEST_FILE} failed checksum!"
- exit -1
- fi
- fi
-
- ChangeDir ${BUILD_DIR}
- if [ -d lua-5.3.0-tests ]; then
- Remove lua-5.3.0-tests
- fi
- LogExecute tar zxf ${NACL_PACKAGES_CACHE}/${TEST_FILE}
- ChangeDir lua-5.3.0-tests
- LogExecute patch -p1 < ${START_DIR}/lua_tests.patch
-}
-
-BuildStep() {
- LogExecute make PLAT=${PLAT} clean
- set -x
- make MYLDFLAGS="${NACLPORTS_LDFLAGS}" MYCFLAGS="${NACLPORTS_CPPFLAGS}" \
- AR="${NACLAR} rcu" RANLIB="${NACLRANLIB}" CC="${NACLCC} -std=gnu99" \
- MYLIBS="${NACLPORTS_LIBS}" \
- PLAT=${PLAT} EXEEXT=${NACL_EXEEXT} -j${OS_JOBS}
- set +x
-}
-
-TestStep() {
- # First, run the 'make test' target. This currently just runs
- # lua -v.
- LogExecute make PLAT=${PLAT} test
-
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- # TODO(sbc): fix lua tests running under node.js
- return
- fi
-
- # Second, run the lua unittests. See: http://www.lua.org/tests/
- ChangeDir lua-5.3.0-tests
- LogExecute ../src/lua -e"_U=true" all.lua
-}
-
-InstallStep() {
- LogExecute make PLAT=${PLAT} EXEEXT=${NACL_EXEEXT} \
- INSTALL_TOP=${DESTDIR}/${PREFIX} install
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
-
- PublishMultiArch src/lua${NACL_EXEEXT} lua
-
- LogExecute python ${TOOLS_DIR}/create_term.py lua
-
- GenerateManifest ${START_DIR}/manifest.json ${PUBLISH_DIR}
- InstallNaClTerm ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/background.js ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/lua.js ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/*.lua ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/index.html ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${PUBLISH_DIR}
- LogExecute rm -rf ${PUBLISH_DIR}/lua-5.3.0-tests
- LogExecute cp -r ${BUILD_DIR}/lua-5.3.0-tests ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- rm -f manifest.txt lua.zip
- ${NACL_SDK_ROOT}/tools/genhttpfs.py . -r > ../manifest.txt
- mv ../manifest.txt .
- CreateWebStoreZip lua.zip .
-}
diff --git a/ports/lua/icon_128.png b/ports/lua/icon_128.png
deleted file mode 100644
index 2f79314..0000000
--- a/ports/lua/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/lua/icon_16.png b/ports/lua/icon_16.png
deleted file mode 100644
index 40256ed..0000000
--- a/ports/lua/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/lua/icon_48.png b/ports/lua/icon_48.png
deleted file mode 100644
index 9207805..0000000
--- a/ports/lua/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/lua/index.html b/ports/lua/index.html
deleted file mode 100644
index 592c00b..0000000
--- a/ports/lua/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Lua Interpreter</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="lua.js"></script>
-
- <style type="text/css">
- #terminal {
- position: relative;
- display: block;
- width: 95%;
- height: 400px;
- }
- </style>
- </head>
- <body>
- <p><b>Lua Interpreter</b></p>
- <p>This example shoes the Lua interpreter running in Native Client. By
- default it runs the an interactive REPL (Run Eval Print Loop), but can also
- run Lua files from its virtual file system.</p>
- The filesystem is pre-populated with the Lua unit test suite as well as
- a couple of Lua benchmarks. For can run these by passing the arguments to
- the Lua executable on as URL parameters. For example, you can run the
- <a href="index.html?pwd=/mnt/http/lua-5.3.0-tests&arg1=-e_U%3dtrue&arg2=all.lua">unit tests</a> or
- the <a href="index.html?arg1=/mnt/http/scimark.lua">SciMark</a> or <a
- href="index.html?arg1=/mnt/http/binarytrees.lua">binarytrees</a>
- benchmarks. You can also write your own files the virtual filesystem using
- the button below. These files will be written to the HTML5 persistent
- filesystem which is mounted at '/mnt/html5' within Lua's virtual
- filesystem.</p>
- <input type="file" id="upload" multiple="multiple" onchange="uploadFiles" />
- <div id="log"></div>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/lua/lua.html b/ports/lua/lua.html
deleted file mode 100644
index b7fa0e2..0000000
--- a/ports/lua/lua.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Lua Interpreter</title>
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="lua.js"></script>
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- overflow: hidden;
- }
-
- #terminal {
- display: block;
- position: static;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/lua/lua.js b/ports/lua/lua.js
deleted file mode 100644
index 3e882a0..0000000
--- a/ports/lua/lua.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-/* globals NaClTerm, lib */
-
-'use strict';
-
-NaClTerm.nmf = 'lua.nmf';
-NaClTerm.env = ['NACL_DATA_MOUNT_FLAGS=manifest=/manifest.txt'];
-
-function log(message) {
- document.getElementById('log').textContent = message;
-}
-
-function fsErrorHandler(error) {
- log("Filesystem error: "+ error);
-}
-
-function uploadFile(file) {
- window.fs.root.getFile(file.name, {create: true, exclusive: true},
- function(fileEntry) {
- fileEntry.createWriter(function(fileWriter) {
- // Note: write() can take a File or Blob object.
- fileWriter.write(file);
- log("File uploaded!\n");
- }, fsErrorHandler);
- }, fsErrorHandler);
-}
-
-function uploadFiles(evt) {
- var files = evt.srcElement.files;
- var i;
- for (i = 0; i < files.length; i++) {
- uploadFile(files[i]);
- }
-}
-
-function onInitFS(fs) {
- var upload = document.getElementById('upload');
- if (upload !== null) {
- upload.addEventListener('change', uploadFiles, false);
- window.fs = fs;
- }
- NaClTerm.init();
-}
-
-function onInit() {
- navigator.webkitPersistentStorage.requestQuota(1024 * 1024,
- function(bytes) {
- window.webkitRequestFileSystem(window.PERSISTENT, bytes, onInitFS);
- },
- function() {
- log("Failed to allocate space!\n");
- // Start the terminal even if FS failed to init.
- NaClTerm.init();
- }
- );
-}
-
-window.onload = function() {
- lib.init(function() {
- onInit();
- });
-};
diff --git a/ports/lua/lua_tests.patch b/ports/lua/lua_tests.patch
deleted file mode 100644
index 7f12d26..0000000
--- a/ports/lua/lua_tests.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ru lua-5.3.0-tests.good/literals.lua lua-5.3.0-tests/literals.lua
---- lua-5.3.0-tests.good/literals.lua 2015-06-08 16:37:37.370668718 -0700
-+++ lua-5.3.0-tests/literals.lua 2015-06-08 16:17:53.205731969 -0700
-@@ -3,7 +3,7 @@
- print('testing scanner')
-
- local debug = require "debug"
--
-+local nacl = true
-
- local function dostring (x) return assert(load(x))() end
-
-@@ -261,7 +261,7 @@
-
-
- -- testing decimal point locale
--if os.setlocale("pt_BR") or os.setlocale("ptb") then
-+if not nacl and (os.setlocale("pt_BR") or os.setlocale("ptb")) then
- assert(not load("a = (3,4)"))
- assert(tonumber("3,4") == 3.4 and tonumber"3.4" == nil)
- assert(assert(load("return 3.4"))() == 3.4)
diff --git a/ports/lua/manifest.json b/ports/lua/manifest.json
deleted file mode 100644
index 94f04fe..0000000
--- a/ports/lua/manifest.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "name": "Lua",
- "description": "Lua interactive shell built using Native Client",
- "version": "5.2.3.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "permissions": [
- "clipboardRead",
- "clipboardWrite",
- "storage",
- "unlimitedStorage"
- ]
-}
diff --git a/ports/lua/nacl.patch b/ports/lua/nacl.patch
deleted file mode 100644
index 428adc8..0000000
--- a/ports/lua/nacl.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -36,10 +36,10 @@ RM= rm -f
- # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-
- # Convenience platforms targets.
--PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
-+PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris nacl-newlib nacl-glibc emscripten
-
- # What to install.
--TO_BIN= lua luac
-+TO_BIN= lua$(EXEEXT) luac$(EXEEXT)
- TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
- TO_LIB= liblua.a
- TO_MAN= lua.1 luac.1
-diff --git a/src/Makefile b/src/Makefile
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -36,10 +36,10 @@ LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
- lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
- BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-
--LUA_T= lua
-+LUA_T= lua$(EXEEXT)
- LUA_O= lua.o
-
--LUAC_T= luac
-+LUAC_T= luac$(EXEEXT)
- LUAC_O= luac.o
-
- ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-@@ -106,6 +106,15 @@ freebsd:
-
- generic: $(ALL)
-
-+nacl-newlib:
-+ $(MAKE) all SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_READLINE" SYSLIBS="-lreadline -lhistory -lncurses -lglibc-compat"
-+
-+nacl-glibc:
-+ $(MAKE) all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
-+
-+emscripten:
-+ $(MAKE) all SYSCFLAGS="-DLUA_USE_READLINE" SYSLIBS="-lreadline -lhistory -lncurses"
-+
- linux:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
-
-diff --git a/src/liolib.c b/src/liolib.c
---- a/src/liolib.c
-+++ b/src/liolib.c
-@@ -75,7 +75,7 @@
-
- #if !defined(l_getc) /* { */
-
--#if defined(LUA_USE_POSIX)
-+#if defined(LUA_USE_POSIX) && !defined(__native_client__)
- #define l_getc(f) getc_unlocked(f)
- #define l_lockfile(f) flockfile(f)
- #define l_unlockfile(f) funlockfile(f)
diff --git a/ports/lua/pkg_info b/ports/lua/pkg_info
deleted file mode 100644
index 4d2becb..0000000
--- a/ports/lua/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=lua
-VERSION=5.3.0
-ARCHIVE_ROOT=lua-5.3.0
-URL=http://www.lua.org/ftp/lua-5.3.0.tar.gz
-LICENSE=MIT
-DEPENDS=(readline nacl-spawn glibc-compat)
-SHA1=1c46d1c78c44039939e820126b86a6ae12dadfba
diff --git a/ports/lua/scimark.lua b/ports/lua/scimark.lua
deleted file mode 100644
index c01ddec..0000000
--- a/ports/lua/scimark.lua
+++ /dev/null
@@ -1,424 +0,0 @@
-------------------------------------------------------------------------------
--- Lua SciMark (2010-12-20).
---
--- A literal translation of SciMark 2.0a, written in Java and C.
--- Credits go to the original authors Roldan Pozo and Bruce Miller.
--- See: http://math.nist.gov/scimark2/
-------------------------------------------------------------------------------
--- Copyright (C) 2006-2010 Mike Pall. All rights reserved.
---
--- Permission is hereby granted, free of charge, to any person obtaining
--- a copy of this software and associated documentation files (the
--- "Software"), to deal in the Software without restriction, including
--- without limitation the rights to use, copy, modify, merge, publish,
--- distribute, sublicense, and/or sell copies of the Software, and to
--- permit persons to whom the Software is furnished to do so, subject to
--- the following conditions:
---
--- The above copyright notice and this permission notice shall be
--- included in all copies or substantial portions of the Software.
---
--- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
--- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
--- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
--- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
--- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
--- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
--- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
--- [ MIT license: http://www.opensource.org/licenses/mit-license.php ]
-------------------------------------------------------------------------------
-
-local SCIMARK_VERSION = "2010-12-10"
-local SCIMARK_COPYRIGHT = "Copyright (C) 2006-2010 Mike Pall"
-
-local MIN_TIME = 2.0
-local RANDOM_SEED = 101009 -- Must be odd.
-local SIZE_SELECT = "small"
-
-local benchmarks = {
- "FFT", "SOR", "MC", "SPARSE", "LU",
- small = {
- FFT = { 1024 },
- SOR = { 100 },
- MC = { },
- SPARSE = { 1000, 5000 },
- LU = { 100 },
- },
- large = {
- FFT = { 1048576 },
- SOR = { 1000 },
- MC = { },
- SPARSE = { 100000, 1000000 },
- LU = { 1000 },
- },
-}
-
-local abs, log, sin, floor = math.abs, math.log, math.sin, math.floor
-local pi, clock = math.pi, os.clock
-local format = string.format
-
-------------------------------------------------------------------------------
--- Select array type: Lua tables or native (FFI) arrays
-------------------------------------------------------------------------------
-
-local darray, iarray
-
-local function array_init()
- if jit and jit.status and jit.status() then
- local ok, ffi = pcall(require, "ffi")
- if ok then
- darray = ffi.typeof("double[?]")
- iarray = ffi.typeof("int[?]")
- return
- end
- end
- function darray(n) return {} end
- iarray = darray
-end
-
-------------------------------------------------------------------------------
--- This is a Lagged Fibonacci Pseudo-random Number Generator with
--- j, k, M = 5, 17, 31. Pretty weak, but same as C/Java SciMark.
-------------------------------------------------------------------------------
-
-local rand, rand_init
-
-if jit and jit.status and jit.status() then
- -- LJ2 has bit operations and zero-based arrays (internally).
- local bit = require("bit")
- local band, sar = bit.band, bit.arshift
- function rand_init(seed)
- local Rm, Rj, Ri = iarray(17), 16, 11
- for i=0,16 do Rm[i] = 0 end
- for i=16,0,-1 do
- seed = band(seed*9069, 0x7fffffff)
- Rm[i] = seed
- end
- function rand()
- local i = band(Ri+1, sar(Ri-16, 31))
- local j = band(Rj+1, sar(Rj-16, 31))
- Ri, Rj = i, j
- local k = band(Rm[i] - Rm[j], 0x7fffffff)
- Rm[j] = k
- return k * (1.0/2147483647.0)
- end
- end
-else
- -- Better for standard Lua with one-based arrays and without bit operations.
- function rand_init(seed)
- local Rm, Rj = {}, 1
- for i=1,17 do Rm[i] = 0 end
- for i=17,1,-1 do
- seed = (seed*9069) % (2^31)
- Rm[i] = seed
- end
- function rand()
- local j, m = Rj, Rm
- local h = j - 5
- if h < 1 then h = h + 17 end
- local k = m[h] - m[j]
- if k < 0 then k = k + 2147483647 end
- m[j] = k
- if j < 17 then Rj = j + 1 else Rj = 1 end
- return k * (1.0/2147483647.0)
- end
- end
-end
-
-local function random_vector(n)
- local v = darray(n+1)
- for x=1,n do v[x] = rand() end
- return v
-end
-
-local function random_matrix(m, n)
- local a = {}
- for y=1,m do
- local v = darray(n+1)
- a[y] = v
- for x=1,n do v[x] = rand() end
- end
- return a
-end
-
-------------------------------------------------------------------------------
--- FFT: Fast Fourier Transform.
-------------------------------------------------------------------------------
-
-local function fft_bitreverse(v, n)
- local j = 0
- for i=0,2*n-4,2 do
- if i < j then
- v[i+1], v[i+2], v[j+1], v[j+2] = v[j+1], v[j+2], v[i+1], v[i+2]
- end
- local k = n
- while k <= j do j = j - k; k = k / 2 end
- j = j + k
- end
-end
-
-local function fft_transform(v, n, dir)
- if n <= 1 then return end
- fft_bitreverse(v, n)
- local dual = 1
- repeat
- local dual2 = 2*dual
- for i=1,2*n-1,2*dual2 do
- local j = i+dual2
- local ir, ii = v[i], v[i+1]
- local jr, ji = v[j], v[j+1]
- v[j], v[j+1] = ir - jr, ii - ji
- v[i], v[i+1] = ir + jr, ii + ji
- end
- local theta = dir * pi / dual
- local s, s2 = sin(theta), 2.0 * sin(theta * 0.5)^2
- local wr, wi = 1.0, 0.0
- for a=3,dual2-1,2 do
- wr, wi = wr - s*wi - s2*wr, wi + s*wr - s2*wi
- for i=a,a+2*(n-dual2),2*dual2 do
- local j = i+dual2
- local jr, ji = v[j], v[j+1]
- local dr, di = wr*jr - wi*ji, wr*ji + wi*jr
- local ir, ii = v[i], v[i+1]
- v[j], v[j+1] = ir - dr, ii - di
- v[i], v[i+1] = ir + dr, ii + di
- end
- end
- dual = dual2
- until dual >= n
-end
-
-function benchmarks.FFT(n)
- local l2n = log(n)/log(2)
- if l2n % 1 ~= 0 then
- io.stderr:write("Error: FFT data length is not a power of 2\n")
- os.exit(1)
- end
- local v = random_vector(n*2)
- return function(cycles)
- local norm = 1.0 / n
- for p=1,cycles do
- fft_transform(v, n, -1)
- fft_transform(v, n, 1)
- for i=1,n*2 do v[i] = v[i] * norm end
- end
- return ((5*n-2)*l2n + 2*(n+1)) * cycles
- end
-end
-
-------------------------------------------------------------------------------
--- SOR: Jacobi Successive Over-Relaxation.
-------------------------------------------------------------------------------
-
-local function sor_run(mat, m, n, cycles, omega)
- local om4, om1 = omega*0.25, 1.0-omega
- m = m - 1
- n = n - 1
- for i=1,cycles do
- for y=2,m do
- local v, vp, vn = mat[y], mat[y-1], mat[y+1]
- for x=2,n do
- v[x] = om4*((vp[x]+vn[x])+(v[x-1]+v[x+1])) + om1*v[x]
- end
- end
- end
-end
-
-function benchmarks.SOR(n)
- local mat = random_matrix(n, n)
- return function(cycles)
- sor_run(mat, n, n, cycles, 1.25)
- return (n-1)*(n-1)*cycles*6
- end
-end
-
-------------------------------------------------------------------------------
--- MC: Monte Carlo Integration.
-------------------------------------------------------------------------------
-
-local function mc_integrate(cycles)
- local under_curve = 0
- local rand = rand
- for i=1,cycles do
- local x = rand()
- local y = rand()
- if x*x + y*y <= 1.0 then under_curve = under_curve + 1 end
- end
- return (under_curve/cycles) * 4
-end
-
-function benchmarks.MC()
- return function(cycles)
- local res = mc_integrate(cycles)
- assert(math.sqrt(cycles)*math.abs(res-math.pi) < 5.0, "bad MC result")
- return cycles * 4 -- Way off, but same as SciMark in C/Java.
- end
-end
-
-------------------------------------------------------------------------------
--- Sparse Matrix Multiplication.
-------------------------------------------------------------------------------
-
-local function sparse_mult(n, cycles, vy, val, row, col, vx)
- for p=1,cycles do
- for r=1,n do
- local sum = 0
- for i=row[r],row[r+1]-1 do sum = sum + vx[col[i]] * val[i] end
- vy[r] = sum
- end
- end
-end
-
-function benchmarks.SPARSE(n, nz)
- local nr = floor(nz/n)
- local anz = nr*n
- local vx = random_vector(n)
- local val = random_vector(anz)
- local vy, col, row = darray(n+1), iarray(nz+1), iarray(n+2)
- row[1] = 1
- for r=1,n do
- local step = floor(r/nr)
- if step < 1 then step = 1 end
- local rr = row[r]
- row[r+1] = rr+nr
- for i=0,nr-1 do col[rr+i] = 1+i*step end
- end
- return function(cycles)
- sparse_mult(n, cycles, vy, val, row, col, vx)
- return anz*cycles*2
- end
-end
-
-------------------------------------------------------------------------------
--- LU: Dense Matrix Factorization.
-------------------------------------------------------------------------------
-
-local function lu_factor(a, pivot, m, n)
- local min_m_n = m < n and m or n
- for j=1,min_m_n do
- local jp, t = j, abs(a[j][j])
- for i=j+1,m do
- local ab = abs(a[i][j])
- if ab > t then
- jp = i
- t = ab
- end
- end
- pivot[j] = jp
- if a[jp][j] == 0 then error("zero pivot") end
- if jp ~= j then a[j], a[jp] = a[jp], a[j] end
- if j < m then
- local recp = 1.0 / a[j][j]
- for k=j+1,m do
- local v = a[k]
- v[j] = v[j] * recp
- end
- end
- if j < min_m_n then
- for i=j+1,m do
- local vi, vj = a[i], a[j]
- local eij = vi[j]
- for k=j+1,n do vi[k] = vi[k] - eij * vj[k] end
- end
- end
- end
-end
-
-local function matrix_alloc(m, n)
- local a = {}
- for y=1,m do a[y] = darray(n+1) end
- return a
-end
-
-local function matrix_copy(dst, src, m, n)
- for y=1,m do
- local vd, vs = dst[y], src[y]
- for x=1,n do vd[x] = vs[x] end
- end
-end
-
-function benchmarks.LU(n)
- local mat = random_matrix(n, n)
- local tmp = matrix_alloc(n, n)
- local pivot = iarray(n+1)
- return function(cycles)
- for i=1,cycles do
- matrix_copy(tmp, mat, n, n)
- lu_factor(tmp, pivot, n, n)
- end
- return 2.0/3.0*n*n*n*cycles
- end
-end
-
-------------------------------------------------------------------------------
--- Main program.
-------------------------------------------------------------------------------
-
-local function printf(...)
- io.write(format(...))
-end
-
-local function fmtparams(p1, p2)
- if p2 then return format("[%d, %d]", p1, p2)
- elseif p1 then return format("[%d]", p1) end
- return ""
-end
-
-local function measure(min_time, name, ...)
- array_init()
- rand_init(RANDOM_SEED)
- local run = benchmarks[name](...)
- local cycles = 1
- repeat
- local tm = clock()
- local flops = run(cycles, ...)
- tm = clock() - tm
- if tm >= min_time then
- local res = flops / tm * 1.0e-6
- local p1, p2 = ...
- printf("%-7s %8.2f %s\n", name, res, fmtparams(...))
- return res
- end
- cycles = cycles * 2
- until false
-end
-
-printf("Lua SciMark %s based on SciMark 2.0a. %s.\n\n",
- SCIMARK_VERSION, SCIMARK_COPYRIGHT)
-
-while arg and arg[1] do
- local a = table.remove(arg, 1)
- if a == "-noffi" then
- package.preload.ffi = nil
- elseif a == "-small" then
- SIZE_SELECT = "small"
- elseif a == "-large" then
- SIZE_SELECT = "large"
- elseif benchmarks[a] then
- local p = benchmarks[SIZE_SELECT][a]
- measure(MIN_TIME, a, tonumber(arg[1]) or p[1], tonumber(arg[2]) or p[2])
- return
- else
- printf("Usage: scimark [-noffi] [-small|-large] [BENCH params...]\n\n")
- printf("BENCH -small -large\n")
- printf("---------------------------------------\n")
- for _,name in ipairs(benchmarks) do
- printf("%-7s %-13s %s\n", name,
- fmtparams(unpack(benchmarks.small[name])),
- fmtparams(unpack(benchmarks.large[name])))
- end
- printf("\n")
- os.exit(1)
- end
-end
-
-local params = benchmarks[SIZE_SELECT]
-local sum = 0
-for _,name in ipairs(benchmarks) do
- -- change unpack to table.unpack; compatible with lua5.3
- sum = sum + measure(MIN_TIME, name, table.unpack(params[name]))
-end
-printf("\nSciMark %8.2f [%s problem sizes]\n", sum / #benchmarks, SIZE_SELECT)
-io.flush()
-
diff --git a/ports/m4/build.sh b/ports/m4/build.sh
deleted file mode 100644
index 21bde66..0000000
--- a/ports/m4/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
-
-EnableGlibcCompat
-
-NACLPORTS_CPPFLAGS+=" -DGNULIB_defined_struct_sigaction -Dpipe=nacl_spawn_pipe"
-
-PatchStep() {
- DefaultPatchStep
- # Touch documentation to prevent it from updating.
- touch ${SRC_DIR}/doc/*
-}
diff --git a/ports/m4/nacl.patch b/ports/m4/nacl.patch
deleted file mode 100644
index bf59d43..0000000
--- a/ports/m4/nacl.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -7563,7 +7563,6 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wattributes \
- -Wbad-function-cast \
- -Wbuiltin-macro-redefined \
-- -Wcast-align \
- -Wchar-subscripts \
- -Wclobbered \
- -Wcomment \
-@@ -7581,7 +7580,6 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wextra \
- -Wformat-contains-nul \
- -Wformat-extra-args \
-- -Wformat-nonliteral \
- -Wformat-security \
- -Wformat-y2k \
- -Wformat-zero-length \
-@@ -7604,7 +7602,6 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wmissing-field-initializers \
- -Wmissing-include-dirs \
- -Wmissing-parameter-type \
-- -Wmissing-prototypes \
- -Wmudflap \
- -Wmultichar \
- -Wnarrowing \
-@@ -7634,7 +7631,6 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wstrict-prototypes \
- -Wsuggest-attribute=const \
- -Wsuggest-attribute=format \
-- -Wsuggest-attribute=noreturn \
- -Wsuggest-attribute=pure \
- -Wswitch \
- -Wswitch-default \
-@@ -15877,6 +15873,10 @@ _ACEOF
-
-
-
-+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
-+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
-+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
-+REPLACE_POSIX_SPAWN=1
-
-
-
-@@ -23088,7 +23088,7 @@ $as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
-
- case "$gl_cv_func_gettimeofday_clobber" in
- *yes)
-- REPLACE_GETTIMEOFDAY=1
-+ REPLACE_GETTIMEOFDAY=0
-
-
- $as_echo "#define gmtime rpl_gmtime" >>confdefs.h
-diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
---- a/lib/getdtablesize.c
-+++ b/lib/getdtablesize.c
-@@ -20,6 +20,14 @@
- /* Specification. */
- #include <unistd.h>
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+/* TODO(bradnelson): Remove when newlib supports this. */
-+/* Make up a value for newlib. */
-+int getdtablesize (void) {
-+ return 10000;
-+}
-+#endif
-+
- #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-
- #include <stdio.h>
-diff --git a/lib/sigaction.c b/lib/sigaction.c
---- a/lib/sigaction.c
-+++ b/lib/sigaction.c
-@@ -51,9 +51,11 @@
- with this module should stick with only sigaction(). */
-
- /* Check some of our assumptions. */
-+#if !defined(__native_client__)
- #if defined SIGCHLD || defined HAVE_SIGALTSTACK || defined HAVE_SIGINTERRUPT
- # error "Revisit the assumptions made in the sigaction module"
- #endif
-+#endif
-
- /* Out-of-range substitutes make a good fallback for uncatchable
- signals. */
-@@ -104,9 +106,11 @@ sigaction_handler (int sig)
- reinstall the handler will trigger the default handler; oh
- well. */
- handler = action_array[sig].sa_handler;
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- if ((action_array[sig].sa_flags & SA_RESETHAND) == 0)
- signal (sig, sigaction_handler);
- else
-+#endif
- action_array[sig].sa_handler = NULL;
-
- /* Block appropriate signals. */
-@@ -171,7 +175,11 @@ sigaction (int sig, const struct sigaction *restrict act,
- if (oact->sa_handler == SIG_ERR)
- goto failure;
- signal (sig, oact->sa_handler);
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ oact->sa_flags = SA_NODEFER;
-+#else
- oact->sa_flags = SA_RESETHAND | SA_NODEFER;
-+#endif
- sigemptyset (&oact->sa_mask);
- }
- }
-diff --git a/lib/spawni.c b/lib/spawni.c
---- a/lib/spawni.c
-+++ b/lib/spawni.c
-@@ -80,6 +80,9 @@
- # define internal_function /* empty */
- #endif
-
-+#if defined(__native_client__)
-+#include <spawn.h>
-+#endif
-
- /* The Unix standard contains a long explanation of the way to signal
- an error after the fork() was successful. Since no new wait status
-@@ -141,6 +144,13 @@ __spawni (pid_t *pid, const char *file,
- const posix_spawnattr_t *attrp, char *const argv[],
- char *const envp[], int use_path)
- {
-+#if defined(__native_client__)
-+ *pid = spawnve(P_NOWAIT, argv[0], argv, envp);
-+ if (*pid < 0) {
-+ return errno;
-+ }
-+ return 0;
-+#else
- pid_t new_pid;
- char *path, *p, *name;
- size_t len;
-@@ -369,6 +379,7 @@ __spawni (pid_t *pid, const char *file,
-
- /* Return with an error. */
- _exit (SPAWN_ERROR);
-+#endif
- }
-
- #endif
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -1488,7 +1488,7 @@ clean-binPROGRAMS:
-
- m4$(EXEEXT): $(m4_OBJECTS) $(m4_DEPENDENCIES) $(EXTRA_m4_DEPENDENCIES)
- @rm -f m4$(EXEEXT)
-- $(AM_V_CCLD)$(LINK) $(m4_OBJECTS) $(m4_LDADD) $(LIBS)
-+ $(AM_V_CCLD)$(LINK) $(m4_OBJECTS) $(m4_LDADD) $(LIBS) $(EXTRA_LIBS)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-diff --git a/src/builtin.c b/src/builtin.c
---- a/src/builtin.c
-+++ b/src/builtin.c
-@@ -153,6 +153,9 @@ static builtin const builtin_tab[] =
-
- static predefined const predefined_tab[] =
- {
-+#if defined(__native_client__)
-+ { "nacl", "__nacl__", "" },
-+#endif
- #if UNIX
- { "unix", "__unix__", "" },
- #endif
-@@ -162,7 +165,7 @@ static predefined const predefined_tab[] =
- #if OS2
- { "os2", "__os2__", "" },
- #endif
--#if !UNIX && !W32_NATIVE && !OS2
-+#if !UNIX && !W32_NATIVE && !OS2 && !defined(__native_client__)
- # warning Platform macro not provided
- #endif
- { NULL, "__gnu__", "" },
-diff --git a/src/m4.c b/src/m4.c
---- a/src/m4.c
-+++ b/src/m4.c
-@@ -403,7 +407,11 @@ main (int argc, char *const *argv)
- sigemptyset (&act.sa_mask);
- /* One-shot - if we fault while handling a fault, we want to revert
- to default signal behavior. */
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ act.sa_flags = SA_NODEFER;
-+#else
- act.sa_flags = SA_NODEFER | SA_RESETHAND;
-+#endif
- act.sa_handler = fault_handler;
- sigaction (SIGSEGV, &act, NULL);
- sigaction (SIGABRT, &act, NULL);
diff --git a/ports/m4/pkg_info b/ports/m4/pkg_info
deleted file mode 100644
index 6170c4d..0000000
--- a/ports/m4/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=m4
-VERSION=1.4.17
-URL=http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.xz
-LICENSE=GPL
-DEPENDS=(nacl-spawn)
-SHA1=74ad71fa100ec8c13bc715082757eb9ab1e4bbb0
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/make/build.sh b/ports/make/build.sh
deleted file mode 100644
index ee4bc68..0000000
--- a/ports/make/build.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES=make${NACL_EXEEXT}
-
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-EnableCliMain
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- # TODO(sbc): remove once nacl_io implements these.
- export ac_cv_func_getrlimit=no
- export ac_cv_func_seteuid=no
- export ac_cv_func_setegid=no
- # Without this configure will sometimes erroneously define
- # GETLOADAVG_PRIVILEGED=1 (seem to be in the presence of libbsd)
- export ac_cv_func_getloadavg_setgid=no
- NACLPORTS_CPPFLAGS+=" -D_POSIX_VERSION"
-fi
diff --git a/ports/make/nacl.patch b/ports/make/nacl.patch
deleted file mode 100644
index 93d2300..0000000
--- a/ports/make/nacl.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-diff --git a/job.c b/job.c
---- a/job.c
-+++ b/job.c
-@@ -29,6 +29,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
-
- #include <string.h>
-
-+#if defined(__native_client__)
-+# include <spawn.h>
-+#endif
-+
- /* Default shell to use. */
- #ifdef WINDOWS32
- #include <windows.h>
-diff --git a/main.c b/main.c
---- a/main.c
-+++ b/main.c
-@@ -921,6 +924,9 @@ main (int argc, char **argv, char **envp)
- struct dep *read_makefiles;
- PATH_VAR (current_directory);
- unsigned int restarts = 0;
-+#if defined(__native_client__)
-+ envp = environ;
-+#endif
- #ifdef WINDOWS32
- char *unix_path = NULL;
- char *windows32_path = NULL;
-diff --git a/misc.c b/misc.c
---- a/misc.c
-+++ b/misc.c
-@@ -715,7 +715,7 @@ log_access (const char *flavor)
- static void
- init_access (void)
- {
--#ifndef VMS
-+#if !defined(VMS) && !defined(__native_client__)
- user_uid = getuid ();
- user_gid = getgid ();
-
-@@ -723,6 +723,7 @@ init_access (void)
- make_gid = getegid ();
-
- /* Do these ever fail? */
-+ printf("%d %d %d %d\n", getuid(), getgid(), geteuid(), getegid());
- if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1)
- pfatal_with_name ("get{e}[gu]id");
-
-@@ -772,8 +773,11 @@ user_access (void)
- or the saved set ID (what the effective ID was before this set-ID
- executable (make) was exec'd). */
-
-+ /* TODO(sbc): remove this once nacl_io implements setuid and friends */
-+#if !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- if (setuid (user_uid) < 0)
- pfatal_with_name ("user_access: setuid");
-+#endif
-
- #else /* HAVE_SETREUID. */
-
-@@ -795,8 +799,11 @@ user_access (void)
- pfatal_with_name ("user_access: setegid");
- #else
- #ifndef HAVE_SETREGID
-+/* TODO(sbc): remove this once nacl_io implements setuid and friends */
-+#if !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- if (setgid (user_gid) < 0)
- pfatal_with_name ("user_access: setgid");
-+#endif
- #else
- if (setregid (make_gid, user_gid) < 0)
- pfatal_with_name ("user_access: setregid");
diff --git a/ports/make/pkg_info b/ports/make/pkg_info
deleted file mode 100644
index ce854b6..0000000
--- a/ports/make/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=make
-VERSION=3.82
-URL=http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
-LICENSE=GPL
-DEPENDS=(nacl-spawn)
-SHA1=92d1b87a30d1c9482e52fb4a68e8a355e7946331
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/mesa-demo/Makefile b/ports/mesa-demo/Makefile
deleted file mode 100644
index 20c0192..0000000
--- a/ports/mesa-demo/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2011 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.
-#
-# Makefile for the MesaGL example.
-
-NACLPORTS_ROOT ?= ../..
-
-DEFINES = -Wall -Wno-long-long -pthread -DXP_UNIX -Werror -DGL_GLEXT_PROTOTYPES
-# Note that the OpenGL libraries are NOT included. We use Mesa for rendering.
-LIBS = nacl_io ppapi_cpp ppapi OSMesa
-PAGE = $(OUTDIR)/mesa-demo.html
-PAGE_TC_CONFIG = $(PAGE)
-
-include $(NACL_SDK_ROOT)/tools/common.mk
-
-TARGET = mesa-demo
-SOURCES = mesa-demo.cc
-INSTALL_DIR = $(NACLPORTS_ROOT)/out/publish/$(TARGET)
-
-$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),)))
-
-$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
-
-$(eval $(call HTML_RULE,$(TARGET),))
-
-install:
- mkdir -p $(INSTALL_DIR)
- cp $(OUTDIR)/*$(NACL_EXEEXT) $(INSTALL_DIR)
- cp $(OUTDIR)/$(TARGET).nmf $(INSTALL_DIR)
- cp $(OUTDIR)/$(TARGET).html $(INSTALL_DIR)
-
-.PHONY: install
diff --git a/ports/mesa-demo/README.nacl b/ports/mesa-demo/README.nacl
deleted file mode 100644
index 9164349..0000000
--- a/ports/mesa-demo/README.nacl
+++ /dev/null
@@ -1,11 +0,0 @@
-The mesagl example demonstrates how to use the Mesa OpenGL library to port
-applications that use pre-OpenGL ES 2.0 APIs for rendering. The intent of this
-example is to help porting efforts that first want to port to NaCl, and then
-port to OpenGL ES 2.0
-
-Note that Mesa OpenGL provides software rendering and rasterization only. The
-only way to get hardware accelerated 3D graphics is through Pepper 3D and
-OpenGL ES 2.0.
-
-The Mesa OpenGL library for NaCl is available in the webports project:
- https://chromium.googlesource.com/webports/
diff --git a/ports/mesa-demo/build.sh b/ports/mesa-demo/build.sh
deleted file mode 100644
index ad52c31..0000000
--- a/ports/mesa-demo/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2013 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.
-
-SetupSDKBuildSystem
diff --git a/ports/mesa-demo/mesa-demo.cc b/ports/mesa-demo/mesa-demo.cc
deleted file mode 100755
index 5c9d3df..0000000
--- a/ports/mesa-demo/mesa-demo.cc
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Copyright (c) 2011 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.
- */
-
-// This example uses the Mesa OpenGL rendering library to render into a
-// Pepper 2D framebuffer. It also demonstrates use of vertex buffer objects
-// as specified in the OpenGL specification:
-// http://www.opengl.org/documentation/specs/
-// Note that Mesa OpenGL provides software rendering and rasterization only.
-// The only way to get hardware accelerated 3D graphics is through Pepper 3D and
-// OpenGL ES 2.0.
-
-#include <assert.h>
-#include <errno.h>
-
-#include <ppapi/c/pp_completion_callback.h>
-#include <ppapi/c/pp_errors.h>
-#include <ppapi/c/pp_instance.h>
-#include <ppapi/c/pp_module.h>
-#include <ppapi/c/pp_size.h>
-#include <ppapi/c/pp_var.h>
-#include <ppapi/c/ppb.h>
-#include <ppapi/c/ppb_core.h>
-#include <ppapi/c/ppb_graphics_2d.h>
-#include <ppapi/c/ppb_image_data.h>
-#include <ppapi/c/ppb_instance.h>
-#include <ppapi/c/ppp.h>
-#include <ppapi/c/ppp_instance.h>
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define GL_GLEXT_PROTOTYPES
-
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include <GL/osmesa.h>
-
-
-PPB_GetInterface g_get_browser_interface = NULL;
-
-const PPB_Core* g_core_interface;
-const PPB_Graphics2D* g_graphics_2d_interface;
-const PPB_ImageData* g_image_data_interface;
-const PPB_Instance* g_instance_interface;
-struct GLDemo* gldemo;
-
-// PPP_Instance implementation -----------------------------------------------
-
-struct InstanceInfo {
- PP_Instance pp_instance;
- struct PP_Size last_size;
-
- struct InstanceInfo* next;
-};
-
-// Linked list of all live instances.
-struct InstanceInfo* all_instances = NULL;
-
-
-//-----------------------------------------------------------------------------
-//
-// The module code. This section implements the application code. There are
-// three other sections that implement the Pepper module loading and browser
-// bridging code.
-//
-//-----------------------------------------------------------------------------
-
-// Returns a refed resource corresponding to the created device context.
-PP_Resource CreateDeviceContext(PP_Instance instance,
- const struct PP_Size* size) {
- PP_Resource device_context;
- device_context = g_graphics_2d_interface->Create(instance, size, PP_FALSE);
- if (!device_context)
- return 0;
- return device_context;
-}
-
-void BindDeviceContext(PP_Instance instance, PP_Resource device_context) {
- if (!g_instance_interface->BindGraphics(instance, device_context)) {
- g_core_interface->ReleaseResource(device_context);
- }
-}
-
-void FlushCompletionCallback(void* user_data, int32_t result) {
- // Don't need to do anything here.
-}
-
-// The Surface class owns a image resource and a Pepper 2D context, and owns the
-// Mesa OpenGL context that renders into that bitmap.
-class Surface {
- public:
- explicit Surface(struct InstanceInfo *instance);
- ~Surface();
- bool CreateContext(const struct PP_Size* size);
- void DestroyContext();
- bool MakeCurrentContext() const {
- return OSMesaMakeCurrent(mesa_context_,
- pixels(),
- GL_UNSIGNED_BYTE,
- width(),
- height()) == GL_TRUE;
- }
- bool IsContextValid() const {
- return static_cast<bool>(g_graphics_2d_interface->IsGraphics2D(context2d_));
- }
- void Flush();
- int width() const {
- return width_;
- }
- int height() const {
- return height_;
- }
- void* pixels() const {
- return static_cast<void *>(g_image_data_interface->Map(image_));
- }
-
- private:
- InstanceInfo* info_;
- int width_;
- int height_;
- PP_Resource image_;
- PP_Resource context2d_; // The Pepper device context.
- // Mesa specific
- OSMesaContext mesa_context_;
-};
-
-Surface::Surface(InstanceInfo* info)
- : info_(info),
- width_(0),
- height_(0),
- image_(0),
- context2d_(0),
- mesa_context_(0) {
-}
-
-Surface::~Surface() {
- DestroyContext();
-}
-
-bool Surface::CreateContext(const PP_Size* size) {
- if (IsContextValid())
- return true;
- width_ = size->width;
- height_ = size->height;
- image_ = g_image_data_interface->Create(
- info_->pp_instance, PP_IMAGEDATAFORMAT_BGRA_PREMUL, size, PP_TRUE);
- context2d_ = CreateDeviceContext(info_->pp_instance, size);
- BindDeviceContext(info_->pp_instance, context2d_);
-
- // Create a Mesa OpenGL context, bind it to the Pepper 2D context.
- mesa_context_ = OSMesaCreateContext(OSMESA_BGRA, NULL);
- if (0 == mesa_context_) {
- printf("OSMesaCreateContext failed!\n");
- DestroyContext();
- return false;
- }
- if (!MakeCurrentContext()) {
- printf("OSMesaMakeCurrent failed!\n");
- DestroyContext();
- return false;
- }
- // check for vertex buffer object support in OpenGL
- const char *extensions = reinterpret_cast<const char*>
- (glGetString(GL_EXTENSIONS));
- printf("OpenGL:supported extensions: %s\n", extensions);
- if (NULL != strstr(extensions, "GL_ARB_vertex_buffer_object")) {
- printf("OpenGL: GL_ARB_vertex_buffer_object available.\n");
- } else {
- // vertex buffer objects aren't available...
- printf("OpenGL: GL_ARB_vertex_buffer_object is not available.\n");
- printf("Vertex buffer objects are required for this demo,\n");
- DestroyContext();
- return false;
- }
- printf("OpenGL: Mesa context created.\n");
- return true;
-}
-
-void Surface::DestroyContext() {
- if (0 != mesa_context_) {
- OSMesaDestroyContext(mesa_context_);
- mesa_context_ = 0;
- }
- printf("OpenGL: Mesa context destroyed.\n");
- if (!IsContextValid())
- return;
- g_core_interface->ReleaseResource(context2d_);
- printf("OpenGL: Device context released.\n");
- g_core_interface->ReleaseResource(image_);
- printf("OpenGL: Image context released.\n");
-}
-
-void Surface::Flush() {
- g_graphics_2d_interface->ReplaceContents(context2d_, image_);
- g_graphics_2d_interface->Flush(context2d_,
- PP_MakeCompletionCallback(&FlushCompletionCallback, NULL));
-}
-
-// GLDemo is an object that responds to calls from the browser to do the 3D
-// rendering.
-class GLDemo {
- public:
- explicit GLDemo(InstanceInfo* info) : surf_(new Surface(info)) {}
- ~GLDemo() {
- delete surf_;
- }
-
- void Display() {
- surf_->Flush();
- }
- // Build a simple vertex buffer object
- void Setup(int width, int height);
-
- // Called from the browser via Invoke() when the method name is "update".
- // All of the opengl rendering is done in this function.
- void Update();
-
- private:
- Surface* surf_;
- GLuint vbo_color_;
- GLuint vbo_vertex_;
-};
-
-
-void GLDemo::Setup(int width, int height) {
- PP_Size size;
- size.width = width;
- size.height = height;
- if (!surf_->CreateContext(&size)) {
- return;
- }
- const int num_vertices = 3;
- GLfloat triangle_colors[num_vertices * 3] = {
- 1.0f, 0.0f, 0.0f, // color0
- 0.0f, 1.0f, 0.0f, // color1
- 0.0f, 0.0f, 1.0f, // color2
- };
- GLfloat triangle_vertices[num_vertices * 3] = {
- 0.0f, 1.0f, -2.0f, // vertex0
- 1.0f, -1.0f, -2.0f, // vertex1
- -1.0f, -1.0f, -2.0f, // vertex2
- };
-
- // build a vertex buffer object (vbo), copy triangle data
- glGenBuffers(1, &vbo_color_);
- printf("OpenGL:vbo_color_: %d\n", vbo_color_);
- glBindBuffer(GL_ARRAY_BUFFER, vbo_color_);
- glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * num_vertices * 3,
- triangle_colors, GL_STATIC_DRAW);
- // build a vertex buffer object, copy triangle data
- glGenBuffers(1, &vbo_vertex_);
- printf("OpenGL:vbo_vertex_: %d\n", vbo_vertex_);
- glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_);
- glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * num_vertices * 3,
- triangle_vertices, GL_STATIC_DRAW);
-}
-
-void GLDemo::Update() {
- if (!surf_->MakeCurrentContext()) {
- return;
- }
- // frame setup
- static float angle = 0.0f;
- glViewport(80, 0, 480, 480);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 100.0);
- glClearColor(0, 0, 0, 0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glRotatef(angle, 0.0f, 0.0f, 1.0f);
- angle = angle + 0.1f;
- glClear(GL_COLOR_BUFFER_BIT);
- // enable color & vertex arrays
- glEnable(GL_COLOR_ARRAY);
- glEnable(GL_VERTEX_ARRAY);
- // render the vertex buffer object (created in Setup)
- glBindBuffer(GL_ARRAY_BUFFER, vbo_color_);
- glColorPointer(3, GL_FLOAT, 0, NULL);
- glBindBuffer(GL_ARRAY_BUFFER, vbo_vertex_);
- glVertexPointer(3, GL_FLOAT, 0, NULL);
- glDrawArrays(GL_TRIANGLES, 0, 3);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- // disable color & vertex arrays
- glDisable(GL_COLOR_ARRAY);
- glDisable(GL_VERTEX_ARRAY);
- // make sure everything renders into the framebuffer
- glFlush();
-}
-
-//-----------------------------------------------------------------------------
-//
-// The scripting bridge code.
-//
-//-----------------------------------------------------------------------------
-
-// Returns the info for the given instance, or NULL if it's not found.
-struct InstanceInfo* FindInstance(PP_Instance instance) {
- struct InstanceInfo* cur = all_instances;
- while (cur) {
- if (cur->pp_instance == instance)
- return cur;
- }
- return NULL;
-}
-
-PP_Bool Instance_DidCreate(PP_Instance instance,
- uint32_t argc,
- const char* argn[],
- const char* argv[]) {
- struct InstanceInfo* info =
- (struct InstanceInfo*)malloc(sizeof(struct InstanceInfo));
- info->pp_instance = instance;
- info->last_size.width = 0;
- info->last_size.height = 0;
-
- // Insert into linked list of live instances.
- info->next = all_instances;
- all_instances = info;
-
- gldemo = new GLDemo(info);
- return PP_TRUE;
-}
-
-void Instance_DidDestroy(PP_Instance instance) {
- // Find the matching item in the linked list, delete it, and patch the
- // links.
- struct InstanceInfo** prev_ptr = &all_instances;
- struct InstanceInfo* cur = all_instances;
- while (cur) {
- if (instance == cur->pp_instance) {
- *prev_ptr = cur->next;
- free(cur);
- return;
- }
- prev_ptr = &cur->next;
- }
-}
-
-void Instance_DidChangeView(PP_Instance pp_instance,
- const struct PP_Rect* position,
- const struct PP_Rect* clip) {
-
- struct InstanceInfo* info = FindInstance(pp_instance);
- if (!info)
- return;
-
- if (info->last_size.width != position->size.width ||
- info->last_size.height != position->size.height) {
- // Got a resize, repaint the plugin.
- gldemo->Setup(position->size.width, position->size.height);
- gldemo->Update();
- gldemo->Display();
- info->last_size.width = position->size.width;
- info->last_size.height = position->size.height;
- }
-}
-
-void Instance_DidChangeFocus(PP_Instance pp_instance, PP_Bool has_focus) {
-}
-
-PP_Bool Instance_HandleDocumentLoad(PP_Instance pp_instance,
- PP_Resource pp_url_loader) {
- return PP_FALSE;
-}
-
-static PPP_Instance_1_0 instance_interface = {
- &Instance_DidCreate,
- &Instance_DidDestroy,
- &Instance_DidChangeView,
- &Instance_DidChangeFocus,
- &Instance_HandleDocumentLoad,
-};
-
-
-// Global entrypoints --------------------------------------------------------
-
-PP_EXPORT int32_t PPP_InitializeModule(PP_Module module,
- PPB_GetInterface get_browser_interface) {
- g_get_browser_interface = get_browser_interface;
-
- g_core_interface = (const PPB_Core*)
- get_browser_interface(PPB_CORE_INTERFACE);
- g_instance_interface = (const PPB_Instance*)
- get_browser_interface(PPB_INSTANCE_INTERFACE);
- g_image_data_interface = (const PPB_ImageData*)
- get_browser_interface(PPB_IMAGEDATA_INTERFACE);
- g_graphics_2d_interface = (const PPB_Graphics2D*)
- get_browser_interface(PPB_GRAPHICS_2D_INTERFACE);
- if (!g_core_interface || !g_instance_interface || !g_image_data_interface ||
- !g_graphics_2d_interface)
- return -1;
- return PP_OK;
-}
-
-PP_EXPORT void PPP_ShutdownModule() {
-}
-
-PP_EXPORT const void* PPP_GetInterface(const char* interface_name) {
- if (strcmp(interface_name, PPP_INSTANCE_INTERFACE_1_0) == 0)
- return &instance_interface;
- return NULL;
-}
diff --git a/ports/mesa-demo/pkg_info b/ports/mesa-demo/pkg_info
deleted file mode 100644
index 9794ec3..0000000
--- a/ports/mesa-demo/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=mesa-demo
-VERSION=0.1
-DEPENDS=(mesa)
-DISABLED=1
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/mesa/build.sh b/ports/mesa/build.sh
deleted file mode 100644
index 6f64583..0000000
--- a/ports/mesa/build.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (c) 2011 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.
-
-# Mesa uses autoconf but not automake and its handwritten Makefiles do not
-# support out-of-tree building
-BUILD_DIR=${SRC_DIR}
-
-EXTRA_CONFIGURE_ARGS="\
- --enable-static \
- --disable-gl-osmesa \
- --with-driver=osmesa \
- --disable-asm \
- --disable-glut \
- --disable-gallium \
- --disable-egl \
- --disable-glw"
-
-ConfigureStep() {
- export X11_INCLUDES=
- DefaultConfigureStep
-}
-
-BuildStep() {
- export AR=${NACLAR}
- DefaultBuildStep
-}
diff --git a/ports/mesa/nacl.patch b/ports/mesa/nacl.patch
deleted file mode 100644
index 00d7a61..0000000
--- a/ports/mesa/nacl.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-diff --git a/bin/mklib b/bin/mklib
---- a/bin/mklib
-+++ b/bin/mklib
-@@ -39,7 +39,7 @@ CPLUSPLUS=0
- STATIC=0
- DLOPEN=0
- INSTALLDIR="."
--ARCH="auto"
-+ARCH="nacl"
- ARCHOPT=""
- NOPREFIX=0
- EXPORTS=""
-@@ -213,6 +213,11 @@ if [ ] ; then
- echo "-----------------"
- echo ARCH is $ARCH
- echo LIBNAME is $LIBNAME
-+ echo CC is $CC
-+ echo CXX is $CXX
-+ echo AR is $AR
-+ echo LD is $LD
-+ echo RANLIB is $RANLIB
- echo MAJOR is $MAJOR
- echo MINOR is $MINOR
- echo PATCH is $PATCH
-@@ -228,15 +233,15 @@ fi
- #
- case $ARCH in
-
-- 'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*)
-+ 'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | 'nacl' | GNU/*)
- # we assume gcc
-
- if [ "x$LINK" = "x" ] ; then
- # -linker was not specified so set default link command now
- if [ $CPLUSPLUS = 1 ] ; then
-- LINK=g++
-+ LINK=${CXX} # g++
- else
-- LINK=gcc
-+ LINK=${CC} # gcc
- fi
- fi
-
-@@ -271,7 +276,7 @@ case $ARCH in
- elif [ $STATIC = 1 ] ; then
- LIBNAME="lib${LIBNAME}.a" # prefix with "lib", suffix with ".a"
- echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
-- LINK="ar"
-+ LINK=${AR} # "ar"
- OPTS="-ru"
- if [ "${ALTOPTS}" ] ; then
- OPTS=${ALTOPTS}
-@@ -285,8 +290,8 @@ case $ARCH in
- case $OBJ in
- *.a)
- # extract the .o files from this .a archive
-- FILES=`ar t $OBJ`
-- ar x $OBJ
-+ FILES=`${AR} t $OBJ`
-+ ${AR} x $OBJ
- NEWOBJECTS="$NEWOBJECTS $FILES"
- # keep track of temporary .o files and delete them below
- DELETIA="$DELETIA $FILES"
-@@ -300,7 +305,7 @@ case $ARCH in
-
- # make lib
- ${LINK} ${OPTS} ${LIBNAME} ${NEWOBJECTS}
-- ranlib ${LIBNAME}
-+ ${RANLIB} ${LIBNAME}
-
- # remove temporary extracted .o files
- rm -f ${DELETIA}
-diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
---- a/src/gallium/auxiliary/cso_cache/cso_context.c
-+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
-@@ -268,7 +268,7 @@ void cso_release_all( struct cso_context *ctx )
- void cso_destroy_context( struct cso_context *ctx )
- {
- if (ctx) {
-- //cso_release_all( ctx );
-+ /* cso_release_all( ctx ); */
- FREE( ctx );
- }
- }
-diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
---- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
-+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
-@@ -213,8 +213,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
- vs->prepare(vs, draw);
- }
-
--
-- //return TRUE;
-+ /* return TRUE; */
- }
-
-
-diff --git a/src/gallium/auxiliary/draw/draw_pt_post_vs.c b/src/gallium/auxiliary/draw/draw_pt_post_vs.c
---- a/src/gallium/auxiliary/draw/draw_pt_post_vs.c
-+++ b/src/gallium/auxiliary/draw/draw_pt_post_vs.c
-@@ -210,7 +210,7 @@ void draw_pt_post_vs_prepare( struct pt_post_vs *pvs,
- pvs->run = post_vs_viewport;
- }
- else {
-- //if (opengl)
-+ /* if (opengl) */
- pvs->run = post_vs_cliptest_viewport_gl;
- }
- }
-diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c
---- a/src/gallium/auxiliary/translate/translate_generic.c
-+++ b/src/gallium/auxiliary/translate/translate_generic.c
-@@ -217,7 +217,7 @@ ATTRIB( R8G8_SNORM, 2, char, FROM_8_SNORM, TO_8_SNORM )
- ATTRIB( R8_SNORM, 1, char, FROM_8_SNORM, TO_8_SNORM )
-
- ATTRIB( A8R8G8B8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM )
--//ATTRIB( R8G8B8A8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM )
-+/* ATTRIB( R8G8B8A8_UNORM, 4, ubyte, FROM_8_UNORM, TO_8_UNORM ) */
-
- ATTRIB( R32G32B32A32_FIXED, 4, int, FROM_32_FIXED, TO_32_FIXED )
- ATTRIB( R32G32B32_FIXED, 3, int, FROM_32_FIXED, TO_32_FIXED )
-diff --git a/src/gallium/drivers/i915simple/i915_state.c b/src/gallium/drivers/i915simple/i915_state.c
---- a/src/gallium/drivers/i915simple/i915_state.c
-+++ b/src/gallium/drivers/i915simple/i915_state.c
-@@ -58,8 +58,8 @@ translate_wrap_mode(unsigned wrap)
- return TEXCOORDMODE_CLAMP_EDGE;
- case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
- return TEXCOORDMODE_CLAMP_BORDER;
--// case PIPE_TEX_WRAP_MIRRORED_REPEAT:
--// return TEXCOORDMODE_MIRROR;
-+/* case PIPE_TEX_WRAP_MIRRORED_REPEAT: */
-+/* return TEXCOORDMODE_MIRROR; */
- default:
- return TEXCOORDMODE_WRAP;
- }
-diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
---- a/src/mesa/main/compiler.h
-+++ b/src/mesa/main/compiler.h
-@@ -45,7 +45,7 @@
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
--#if defined(__linux__) && defined(__i386__)
-+#if defined(__linux__) && defined(__i386__) && !defined(__native_client__)
- #include <fpu_control.h>
- #endif
- #include <float.h>
-diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
---- a/src/mesa/shader/slang/slang_codegen.c
-+++ b/src/mesa/shader/slang/slang_codegen.c
-@@ -924,7 +924,7 @@ gen_return_with_expression(slang_assemble_ctx *A, slang_operation *oper)
- slang_operation_copy(rhs, &oper->children[0]);
- }
-
-- ///blockOper->locals->outer_scope = oper->locals->outer_scope;
-+ /* blockOper->locals->outer_scope = oper->locals->outer_scope; */
-
- /*slang_print_tree(blockOper, 0);*/
-
-diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
---- a/src/mesa/state_tracker/st_atom.c
-+++ b/src/mesa/state_tracker/st_atom.c
-@@ -137,7 +137,7 @@ void st_validate_state( struct st_context *st )
- if (state->st == 0)
- return;
-
--// _mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);
-+/* _mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st); */
-
- if (1) {
- /* Debug version which enforces various sanity checks on the
-@@ -152,7 +152,7 @@ void st_validate_state( struct st_context *st )
- const struct st_tracked_state *atom = atoms[i];
- struct st_state_flags generated;
-
--// _mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);
-+/* _mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st); */
-
- if (!(atom->dirty.mesa || atom->dirty.st) ||
- !atom->update) {
-@@ -162,7 +162,7 @@ void st_validate_state( struct st_context *st )
-
- if (check_state(state, &atom->dirty)) {
- atoms[i]->update( st );
--// _mesa_printf("after: %x\n", atom->dirty.mesa);
-+/* _mesa_printf("after: %x\n", atom->dirty.mesa); */
- }
-
- accumulate_state(&examined, &atom->dirty);
-@@ -175,7 +175,7 @@ void st_validate_state( struct st_context *st )
- assert(!check_state(&examined, &generated));
- prev = *state;
- }
--// _mesa_printf("\n");
-+/* _mesa_printf("\n"); */
-
- }
- else {
-diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
---- a/src/mesa/state_tracker/st_cb_bitmap.c
-+++ b/src/mesa/state_tracker/st_cb_bitmap.c
-@@ -515,7 +515,7 @@ reset_cache(struct st_context *st)
- struct pipe_screen *screen = pipe->screen;
- struct bitmap_cache *cache = st->bitmap.cache;
-
-- //memset(cache->buffer, 0xff, sizeof(cache->buffer));
-+ /* memset(cache->buffer, 0xff, sizeof(cache->buffer)); */
- cache->empty = GL_TRUE;
-
- cache->xmin = 1000000;
-diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
---- a/src/mesa/vbo/vbo_exec_array.c
-+++ b/src/mesa/vbo/vbo_exec_array.c
-@@ -149,7 +149,7 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array,
- array->Ptr, array->BufferObj->Name);
- f[k] = 1.0; /* XXX replace the bad value! */
- }
-- //assert(!IS_INF_OR_NAN(f[k]));
-+ /* assert(!IS_INF_OR_NAN(f[k])); */
- }
- }
- break;
diff --git a/ports/mesa/pkg_info b/ports/mesa/pkg_info
deleted file mode 100644
index 3b2338f..0000000
--- a/ports/mesa/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=mesa
-VERSION=7.6
-ARCHIVE_ROOT=Mesa-7.6
-URL=http://www.sfr-fresh.com/unix/misc/MesaLib-7.6.tar.gz
-LICENSE=CUSTOM:docs/COPYING
-SHA1=a2b178bc05692f47e628570191b5ed2172d01012
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/metakit/build.sh b/ports/metakit/build.sh
deleted file mode 100644
index 9c2807e..0000000
--- a/ports/metakit/build.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2013 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_CONFIGURE_PATH=${SRC_DIR}/unix/configure
-
-if [ "${NACL_SHARED}" = "1" ]; then
- MAKE_TARGETS="libmk4.so libmk4.a"
-else
- EXTRA_CONFIGURE_ARGS="--disable-shared"
- MAKE_TARGETS="libmk4.a"
-fi
-
-AutoconfStep() {
- pushd ${SRC_DIR}/unix
- autoconf
- popd
-}
-
-ConfigureStep() {
- AutoconfStep
- DefaultConfigureStep
-}
diff --git a/ports/metakit/nacl.patch b/ports/metakit/nacl.patch
deleted file mode 100644
index 9147039..0000000
--- a/ports/metakit/nacl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/include/mk4.h b/include/mk4.h
---- a/include/mk4.h
-+++ b/include/mk4.h
-@@ -99,7 +99,7 @@ class c4_Persist; // not defined here
- #endif
-
- // and here's the other end of the scale...
--#if !defined (_WIN32) && !defined (q4_LONG64)
-+#if !defined (_WIN32) && !defined(__native_client__) && !defined (q4_LONG64)
- #if defined (_PA_RISC2_0) || defined (__powerpc64__) || defined(__sparcv9) || \
- defined(__x86_64__) || defined(__s390x__) || defined(__alpha) || \
- (defined(__ia64) && (!defined(__HP_aCC) || defined(__LP64__)))
-diff --git a/unix/Makefile.in b/unix/Makefile.in
---- a/unix/Makefile.in
-+++ b/unix/Makefile.in
-@@ -47,6 +47,8 @@ CXXFLAGS = $(CXX_FLAGS)
- #CXXFLAGS = -Dq4_CHECK $(CXX_FLAGS)
- #CXXFLAGS = -Wall -pedantic -Wno-unused $(CXX_FLAGS)
-
-+AR = @AR@
-+RANLIB = @RANLIB@
- CXX = @CXX@
- INSTALL = @INSTALL@
- INSTALL_DATA = @INSTALL_DATA@
-@@ -98,12 +100,12 @@ install-mk: libmk4$(LIBEXT)
- $(srcdir)/../include/mk4str.h \
- $(srcdir)/../include/mk4str.inl $(DESTDIR)$(includedir)
- $(INSTALL_PROGRAM) libmk4$(LIBEXT) $(DESTDIR)$(libdir)
-- if [ '${LIBEXT}' = '.a' ]; then ranlib $(DESTDIR)$(libdir)/libmk4.a; fi
-+ if [ '${LIBEXT}' = '.a' ]; then $(RANLIB) $(DESTDIR)$(libdir)/libmk4.a; fi
-
- install-tcl: Mk4tcl$(LIBEXT)
- mkdir -p $(DESTDIR)$(tcllibdir)/Mk4tcl
- $(INSTALL_PROGRAM) Mk4tcl$(LIBEXT) $(DESTDIR)$(tcllibdir)/Mk4tcl
-- if [ '${LIBEXT}' = '.a' ]; then ranlib $(DESTDIR)$(tcllibdir)/Mk4tcl/Mk4tcl.a; fi
-+ if [ '${LIBEXT}' = '.a' ]; then $(RANLIB) $(DESTDIR)$(tcllibdir)/Mk4tcl/Mk4tcl.a; fi
- echo 'package ifneeded Mk4tcl 2.4.9.7 [list load [file join $$dir Mk4tcl$(LIBEXT)] Mk4tcl]' >$(DESTDIR)$(tcllibdir)/Mk4tcl/pkgIndex.tcl
-
- install-python: Mk4py$(LIBEXT)
-@@ -130,22 +132,22 @@ $(srcdir)/configure: $(srcdir)/configure.in
- cd $(srcdir) && autoconf
-
- libmk4$(LIB_SUFFIX): $(LOBJS)
-- ar rcu $@ $(LOBJS)
-- ranlib $@
-+ $(AR) rcu $@ $(LOBJS)
-+ $(RANLIB) $@
-
- libmk4$(SHLIB_SUFFIX): $(LOBJS) $(LINK_SPECIAL_FILES)
- $(SHLIB_LD) -o $@ $(LOBJS) $(LINK_SPECIAL_FLAGS)
-
- Mk4tcl$(LIB_SUFFIX): mk4tcl.o mk4too.o $(LOBJS)
-- ar rcu $@ mk4tcl.o mk4too.o $(LOBJS)
-- ranlib $@
-+ $(AR) rcu $@ mk4tcl.o mk4too.o $(LOBJS)
-+ $(RANLIB) $@
-
- Mk4tcl$(SHLIB_SUFFIX): mk4tcl.o mk4too.o $(LOBJS) $(LINK_SPECIAL_FILES)
- $(SHLIB_LD) -o $@ mk4tcl.o mk4too.o $(LOBJS) $(LINK_SPECIAL_FLAGS)
-
- Mk4py$(LIB_SUFFIX): $(PYOBJS) $(LOBJS)
-- ar cru $@ $(PYOBJS) $(LOBJS)
-- ranlib $@
-+ $(AR) cru $@ $(PYOBJS) $(LOBJS)
-+ $(RANLIB) $@
-
- Mk4py$(SHLIB_SUFFIX): $(PYOBJS) $(LOBJS) $(LINK_SPECIAL_FILES)
- $(SHLIB_LD) -o $@ $(PYOBJS) $(LOBJS) $(LINK_SPECIAL_FLAGS)
-diff --git a/unix/configure.in b/unix/configure.in
---- a/unix/configure.in
-+++ b/unix/configure.in
-@@ -117,7 +117,7 @@ fi
- if test $SHARED_BUILD = 1; then
- SHLIB_FLAGS="-shared"
- SHLIB_CFLAGS="-fPIC -DUSE_TCL_STUBS"
-- SHLIB_LD="g++ -shared"
-+ SHLIB_LD="\$(CXX) -shared"
- else
- SHLIB_FLAGS=""
- SHLIB_CFLAGS=""
-@@ -127,6 +127,9 @@ fi
- # Checks for programs.
- AC_PROG_CXX
- AC_PROG_INSTALL
-+AC_PROG_RANLIB
-+m4_include([m4/ac_prog_ar.m4])
-+AC_PROG_AR
-
- # Checks for libraries.
-
-diff --git a/unix/m4/ac_prog_ar.m4 b/unix/m4/ac_prog_ar.m4
-new file mode 100644
---- /dev/null
-+++ b/unix/m4/ac_prog_ar.m4
-@@ -0,0 +1,8 @@
-+dnl Copied from chromiumos/third_party/ltp/m4/ac_prog_ar.m4
-+dnl based on AC_PROG_RANLIB from autoconf
-+m4_ifndef([AC_PROG_AR],[dnl
-+AN_MAKEVAR([AR], [AC_PROG_AR])
-+AN_PROGRAM([ar], [AC_PROG_AR])
-+AC_DEFUN([AC_PROG_AR],
-+[AC_CHECK_TOOL(AR, ar, :)])
-+])
diff --git a/ports/metakit/pkg_info b/ports/metakit/pkg_info
deleted file mode 100644
index 59b34eb..0000000
--- a/ports/metakit/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=metakit
-VERSION=2.4.9.7
-URL=http://equi4.com/pub/mk/metakit-2.4.9.7.tar.gz
-LICENSE=CUSTOM:README
-SHA1=1b75400038fcad941886deb0748e669c224bc995
-# metakit's configure chooses .dylib
-BUILD_OS=linux
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/mingn/build.sh b/ports/mingn/build.sh
deleted file mode 100644
index d2e269f..0000000
--- a/ports/mingn/build.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- # Nothing to build.
- return
-}
-
-InstallStep() {
- MakeDir ${INSTALL_DIR}${PREFIX}
- ChangeDir ${INSTALL_DIR}${PREFIX}
-
- # Create an archive which contains include files and shared objects.
-
- # Copy files (for now just headers) from $NACL_SDK_ROOT to the package.
- local dirs="
-toolchain/${OS_SUBDIR}_x86_glibc/x86_64-nacl/include
-"
- for d in ${dirs}; do
- local o=$(echo ${d} | sed "s/toolchain\/${OS_SUBDIR}_x86_glibc\///")
- echo "Copying libs from: ${d} -> ${o}"
- MakeDir ${o}
- if [ -d ${NACL_SDK_ROOT}/${d} ]; then
- cp -R ${NACL_SDK_ROOT}/${d} $(dirname ${o})
- else
- MakeDir ${o}
- fi
- done
-
- # Create libmingn.so ldscripts.
- MakeDir lib
- cat <<EOF > lib/libmingn.so
-GROUP(-lcli_main -lnacl_spawn -lppapi_simple -lnacl_io -lppapi -lstdc++ -lm)
-EXTERN(PSUserMainGet)
-EOF
-
- # Remove unnecessary files to reduce the size of the archive.
- LogExecute rm -fr x86_64-nacl/lib*/{gconv,libgfortran*}
- # These headers gome from the 'gcc' package
- LogExecute rm -fr x86_64-nacl/include/c++/
- # These scripts come from the 'binutils' package
- LogExecute rm -fr x86_64-nacl/lib/ldscripts/
-
- # Resolve all symlinks as nacl_io does not support symlinks.
- for i in $(find . -type l); do
- if [ ! -d ${i} ]; then
- cp ${i} ${i}.tmp
- rm ${i}
- mv ${i}.tmp ${i}
- fi
- done
-
- # Remove shared objects which are symlinked after we resolve them.
- find . -name '*.so.*.*' -exec rm -f {} \;
-
- MakeDir lib
- # Copy core libraries
- LogExecute cp -r ${NACL_SDK_LIB}/*.a lib/
- LogExecute cp -r ${NACL_SDK_LIB}/*.o lib/
-
- # Copy SDK libs
- LogExecute cp -r ${NACL_SDK_LIBDIR}/*.a lib/
-
- # Copy in SDK includes.
- LogExecute cp -r ${NACL_SDK_ROOT}/include ./
-}
diff --git a/ports/mingn/pkg_info b/ports/mingn/pkg_info
deleted file mode 100644
index b40e7fa..0000000
--- a/ports/mingn/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=mingn
-VERSION=0.2
-DISABLED_LIBC=(newlib)
-DEPENDS=(binutils gcc ncurses nacl-spawn zlib)
-DISABLED_TOOLCHAIN=(emscripten)
-TOOLCHAIN_INSTALL=0
diff --git a/ports/mongoose/README.nacl b/ports/mongoose/README.nacl
deleted file mode 100644
index 3521e65..0000000
--- a/ports/mongoose/README.nacl
+++ /dev/null
@@ -1,9 +0,0 @@
-Mongoose Webserver
-==================
-
-This example shows the mongoose webserver built for Native
-Client. It is setup to serve the contents of /tmp where
-the HTML5 temporary filesystem is mounted.
-
-By default a single files called 'index.html' is created
-in the filesystem and the server will listen on port 8080.
diff --git a/ports/mongoose/background.js b/ports/mongoose/background.js
deleted file mode 100644
index 326479b..0000000
--- a/ports/mongoose/background.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('gdb.html', {
- 'bounds': {
- 'width': 400,
- 'height': 500
- }
- });
-});
diff --git a/ports/mongoose/build.sh b/ports/mongoose/build.sh
deleted file mode 100644
index 70a2050..0000000
--- a/ports/mongoose/build.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (c) 2013 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.
-
-BUILD_DIR=${SRC_DIR}
-
-EnableCliMain
-
-BuildStep() {
- export EXTRA_CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export LDFLAGS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}"
- if [ "$NACL_LIBC" = "glibc" ]; then
- LDFLAGS+=" -ldl"
- fi
- CC=${NACLCC} LogExecute make clean
- CC=${NACLCC} LogExecute make nacl
-}
-
-
-InstallStep() {
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/mongoose"
- MakeDir ${ASSEMBLY_DIR}
- LogExecute cp mongoose \
- ${ASSEMBLY_DIR}/mongoose_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute cp ${START_DIR}/index.html ${ASSEMBLY_DIR}
- pushd ${ASSEMBLY_DIR}
- python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- mongoose_*${NACL_EXEEXT} \
- -s . \
- -o mongoose.nmf
- popd
-
- InstallNaClTerm ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/background.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/mongoose.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
-}
diff --git a/ports/mongoose/index.html b/ports/mongoose/index.html
deleted file mode 100644
index 58ffc5e..0000000
--- a/ports/mongoose/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Mongoose</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="mongoose.js"></script>
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- overflow: hidden;
- }
-
- #terminal {
- display: block;
- position: static;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/mongoose/manifest.json b/ports/mongoose/manifest.json
deleted file mode 100644
index 1f8b366..0000000
--- a/ports/mongoose/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "Mongoose Webserver",
- "description": "Mongoose Webserver built using Native Client",
- "version": "0.0.0.0",
- "manifest_version": 2,
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "permissions": [
- "storage",
- {"socket": [
- "resolve-host",
- "tcp-listen:*:*",
- "tcp-connect"
- ]}
- ]
-}
diff --git a/ports/mongoose/mongoose.js b/ports/mongoose/mongoose.js
deleted file mode 100644
index 30a305b..0000000
--- a/ports/mongoose/mongoose.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-/* globals NaClTerm, lib */
-
-'use strict';
-
-NaClTerm.nmf = 'mongoose.nmf';
-
-lib.rtdep('lib.f');
-
-window.onload = function() {
- lib.init(function() {
- navigator.webkitPersistentStorage.requestQuota(1024*1024,
- function(bytes) {
- NaClTerm.init();
- },
- function(e) { console.log('Error', e); });
- });
-};
diff --git a/ports/mongoose/nacl.patch b/ports/mongoose/nacl.patch
deleted file mode 100644
index 387f231..0000000
--- a/ports/mongoose/nacl.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -17,7 +17,7 @@
- # -DUSE_LUA - embed Lua in Mongoose (+100kb)
-
- PROG = mongoose
--CFLAGS = -std=c99 -O2 -W -Wall -pedantic -pthread
-+CFLAGS = -std=c99 -O2 -W -Wall -pedantic -pthread $(EXTRA_CFLAGS)
-
- # To build with Lua, download and unzip Lua 5.2.1 source code into the
- # mongoose directory, and then add $(LUA_SOURCES) to CFLAGS
-@@ -81,8 +81,10 @@ CL = $(MSVC)/bin/cl /MD /TC /nologo $(DBG) /W3 /GA /I$(MSVC)/include
- LINK = $(MSVC)/bin/link /incremental:no /libpath:$(MSVC)/lib /machine:IX86 \
- user32.lib shell32.lib comdlg32.lib ws2_32.lib advapi32.lib
-
-+CCLD ?= $(CC)
-+
- all:
-- @echo "make (linux|bsd|solaris|mac|windows|mingw|cygwin)"
-+ @echo "make (linux|bsd|solaris|mac|windows|mingw|cygwin|nacl)"
-
- %.obj: %.c
- $(CL) /c $(FLAGS) /Fo$@ $<
-@@ -105,6 +107,9 @@ linux_lua: $(ALL_OBJECTS)
- linux:
- $(CC) mongoose.c main.c -o $(PROG) -ldl $(CFLAGS)
-
-+nacl:
-+ $(CC) mongoose.c main.c -DNO_POPEN -DNO_CGI -o $(PROG) $(CFLAGS) $(LDFLAGS)
-+
- mac: bsd
- bsd:
- $(CC) mongoose.c main.c -o $(PROG) $(CFLAGS)
-diff --git a/main.c b/main.c
---- a/main.c
-+++ b/main.c
-@@ -893,7 +893,25 @@ int main(int argc, char *argv[]) {
- return EXIT_SUCCESS;
- }
- #else
-+
-+#ifdef __native_client__
-+#include <sys/mount.h>
-+#define main nacl_main
-+#endif
-+
- int main(int argc, char *argv[]) {
-+#ifdef __native_client__
-+ chdir("/tmp");
-+
-+ struct stat buf;
-+ if (stat("index.html", &buf) != 0) {
-+ const char* index_html = "<h1>Mongoose is working!</h1>\n";
-+ FILE* f = fopen("index.html", "w+");
-+ fwrite(index_html, strlen(index_html), 1, f);
-+ fclose(f);
-+ }
-+#endif
-+
- init_server_name();
- start_mongoose(argc, argv);
- printf("%s started on port(s) %s with web root [%s]\n",
-@@ -910,4 +928,5 @@ int main(int argc, char *argv[]) {
-
- return EXIT_SUCCESS;
- }
-+
- #endif /* _WIN32 */
-diff --git a/mongoose.c b/mongoose.c
---- a/mongoose.c
-+++ b/mongoose.c
-@@ -23,7 +23,7 @@
- #define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005
- #endif
- #else
--#ifdef __linux__
-+#if defined(__linux__) || defined(__native_client__)
- #define _XOPEN_SOURCE 600 // For flockfile() on Linux
- #endif
- #define _LARGEFILE_SOURCE // Enable 64-bit file offsets
diff --git a/ports/mongoose/pkg_info b/ports/mongoose/pkg_info
deleted file mode 100644
index 181b971..0000000
--- a/ports/mongoose/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=mongoose
-VERSION=3.8
-ARCHIVE_ROOT=mongoose
-URL=https://mongoose.googlecode.com/files/mongoose-3.8.tgz
-LICENSE=MIT
-DEPENDS=(nacl-spawn)
-DISABLED_LIBC=(newlib)
-SHA1=a25a1a00c51bb8bc86283ef15fc69254292dd0fc
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/mp4v2/build.sh b/ports/mp4v2/build.sh
deleted file mode 100644
index 45f33d6..0000000
--- a/ports/mp4v2/build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="mp4tags${NACL_EXEEXT} mp4info${NACL_EXEEXT}"
-
-EnableGlibcCompat
diff --git a/ports/mp4v2/pkg_info b/ports/mp4v2/pkg_info
deleted file mode 100644
index 4205370..0000000
--- a/ports/mp4v2/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=mp4v2
-VERSION=2.0.0
-URL=https://mp4v2.googlecode.com/files/mp4v2-2.0.0.tar.bz2
-LICENSE=MPL
-DEPENDS=(glibc-compat)
-SHA1=193260cfb7201e6ec250137bcca1468d4d20e2f0
diff --git a/ports/mpc/build.sh b/ports/mpc/build.sh
deleted file mode 100644
index 1978a78..0000000
--- a/ports/mpc/build.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2014 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.
-
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-HOST_INSTALL_DIR=${WORK_DIR}/install_host
-
-BuildHostMpc() {
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- CC="gcc" \
- LogExecute ${SRC_DIR}/configure \
- --prefix=${HOST_INSTALL_DIR} \
- --with-gmp=${NACL_PACKAGES_BUILD}/gmp/install_host \
- --with-mpfr=${NACL_PACKAGES_BUILD}/mpfr/install_host \
- --disable-shared
- LogExecute make
- LogExecute make install
-}
-
-if [ "${NACL_SHARED}" = "1" ]; then
- NACLPORTS_CFLAGS+=" -fPIC"
-fi
-
-# Disable all assembly code by specifying none-none-none.
-EXTRA_CONFIGURE_ARGS=--host=none-none-none
-
-ConfigureStep() {
- if [ "${OS_NAME}" = "Linux" ]; then
- ChangeDir ${SRC_DIR}
- BuildHostMpc
- ChangeDir ${BUILD_DIR}
- fi
- DefaultConfigureStep
-}
diff --git a/ports/mpc/pkg_info b/ports/mpc/pkg_info
deleted file mode 100644
index 349bf09..0000000
--- a/ports/mpc/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=mpc
-VERSION=1.0.1
-URL=http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz
-LICENSE=LGPL3
-DEPENDS=(gmp mpfr)
-SHA1=8c7e19ad0dd9b3b5cc652273403423d6cf0c5edf
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/mpfr/build.sh b/ports/mpfr/build.sh
deleted file mode 100644
index bac48cc..0000000
--- a/ports/mpfr/build.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2014 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.
-
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-HOST_INSTALL_DIR=${WORK_DIR}/install_host
-
-BuildHostMpfr() {
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- CC="gcc" \
- LogExecute ${SRC_DIR}/configure \
- --prefix=${HOST_INSTALL_DIR} \
- --with-gmp=${NACL_PACKAGES_BUILD}/gmp/install_host
-
- LogExecute make
- LogExecute make install
-}
-
-if [ "${NACL_SHARED}" = "1" ]; then
- NACLPORTS_CFLAGS+=" -fPIC"
-fi
-
-# Disable all assembly code by specifying none-none-none.
-EXTRA_CONFIGURE_ARGS=--host=none-none-none
-
-ConfigureStep() {
- if [ "${OS_NAME}" = "Linux" ]; then
- ChangeDir ${SRC_DIR}
- BuildHostMpfr
- ChangeDir ${BUILD_DIR}
- fi
- DefaultConfigureStep
-}
diff --git a/ports/mpfr/pkg_info b/ports/mpfr/pkg_info
deleted file mode 100644
index fd1cfe0..0000000
--- a/ports/mpfr/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=mpfr
-VERSION=3.1.2
-URL=http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.bz2
-LICENSE=LGPL3
-DEPENDS=(gmp)
-SHA1=46d5a11a59a4e31f74f73dd70c5d57a59de2d0b4
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/mpg123/build.sh b/ports/mpg123/build.sh
deleted file mode 100644
index 4c13612..0000000
--- a/ports/mpg123/build.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (c) 2013 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.
-
-# TODO(binji): Use assembly
-EXTRA_CONFIGURE_ARGS="--with-cpu=generic_fpu"
-
-# Explicitly specify the audio backends. Without this the
-# configure script can find the SDL backend which fails to
-# link when running with under the glibc toolchain.
-EXTRA_CONFIGURE_ARGS+=" --with-audio=openal"
-
-EXECUTABLES="
- src/mpg123${NACL_EXEEXT}
- src/out123${NACL_EXEEXT}
- src/mpg123-id3dump${NACL_EXEEXT}
- src/mpg123-strip${NACL_EXEEXT}"
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- # Disable network support for newlib builds.
- # TODO(sbc): remove this once network syscalls land in libnacl
- EXTRA_CONFIGURE_ARGS+=" --enable-network=no"
- # sigaction is not defined by newlib.
- NACLPORTS_CPPFLAGS+=" -DDONT_CATCH_SIGNALS"
-fi
-
-NACLPORTS_LDFLAGS="${NACLPORTS_LDFLAGS} -pthread"
diff --git a/ports/mpg123/pkg_info b/ports/mpg123/pkg_info
deleted file mode 100644
index 4518cf5..0000000
--- a/ports/mpg123/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=mpg123
-VERSION=1.20.0
-URL=http://www.mpg123.de/download/mpg123-1.20.0.tar.bz2
-LICENSE=LGPL:COPYING
-DEPENDS=(openal-soft)
-SHA1=f8060769e60c88fa2debf6c998773880e57b31a6
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/nacl-spawn/Makefile b/ports/nacl-spawn/Makefile
deleted file mode 100644
index 7699871..0000000
--- a/ports/nacl-spawn/Makefile
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (c) 2014 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.
-
-# TODO(hamaji): include $NACL_SDK_ROOT/tools/common.mk.
-
-NACL_SPAWN_OBJS = nacl_spawn.o nacl_setup_env.o path_util.o elf_reader.o \
- library_dependencies.o nacl_apipe.o nacl_pp_helpers.o
-
-TEST_EXES = test/unittests
-LIBRARIES = libcli_main.a libnacl_spawn.a
-
-CFLAGS += -std=gnu99
-CPPFLAGS += -Wall -Werror -Iinclude
-CPPFLAGS += -I$(GTEST_DIR)/include
-LDFLAGS += -lnacl_io
-
-ifeq ($(NACL_SHARED),1)
-LIBRARIES += libnacl_spawn.so
-endif
-
-ifeq ($(TOOLCHAIN),glibc)
-TEST_EXES += test/elf_reader test/library_dependencies
-TEST_BINARIES = test/test_exe test/libtest1.so test/libtest2.so test/libtest3.so
-endif
-
-all: $(LIBRARIES) $(TEST_EXES) $(TEST_BINARIES)
-
-test: $(TEST_EXES) $(TEST_BINARIES)
-
-# Targets for libcli_main
-
-libcli_main.a: cli_main.o nacl_startup_untar.o
- rm -f $@
- $(AR) rcs $@ $^
-
-%.o: %.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
-
-# Targets for libnacl_spawn
-
-libnacl_spawn.so: $(NACL_SPAWN_OBJS)
- $(CXX) $(LDFLAGS) -shared $^ -o $@
-
-libnacl_spawn.a: $(NACL_SPAWN_OBJS)
- rm -f $@
- $(AR) rcs $@ $^
-
-%.o: %.cc
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
-
-%.o: $(GTEST_DIR)/src/%.cc
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ -I$(GTEST_DIR)
-
-# Targets for tests
-
-LIBS=-Xlinker -uPSUserMainGet -lcli_main -lnacl_spawn
-LIBS+=-lppapi_simple_cpp -lnacl_io -lppapi_cpp -lppapi
-
-test/unittests: nacl_spawn_test.o $(LIBRARIES) gtest-all.o
- $(CXX) -L. $(LDFLAGS) $< gtest-all.o -o $@ $(LIBS)
-
-
-ifeq ($(TOOLCHAIN),glibc)
-test:
- ./test/run_test.sh
-
-test/elf_reader: elf_reader.cc
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DDEFINE_ELF_READER_MAIN $< -o $@
-test/library_dependencies: elf_reader.o path_util.o library_dependencies.cc
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DDEFINE_LIBRARY_DEPENDENCIES_MAIN $^ -o $@
-
-# We use -nostdlib not to have libc.so in their dependencies.
-test/test_exe: test/test_exe.c test/libtest1.so test/libtest2.so
- $(CC) $(CPPFLAGS) $(CFLAGS) $< -nostdlib -Wl,-rpath-link=test -Ltest -ltest1 -ltest2 -o $@
-test/libtest1.so: test/libtest1.c test/libtest3.so
- $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -Ltest -ltest3 -o $@
-test/libtest2.so: test/libtest2.c test/libtest3.so
- $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -Ltest -ltest3 -o $@
-test/libtest3.so: test/libtest3.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -o $@
-endif
-
-clean:
- rm -f *.a *.o *.so $(TEST_EXES) $(TEST_BINARIES)
-
-.PHONY: clean all test
diff --git a/ports/nacl-spawn/build.sh b/ports/nacl-spawn/build.sh
deleted file mode 100644
index 979f723..0000000
--- a/ports/nacl-spawn/build.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright (c) 2014 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.
-
-NACLPORTS_CPPFLAGS+=" -I${START_DIR}"
-
-if [[ ${TOOLCHAIN} != emscripten ]]; then
- EXECUTABLES="test/unittests"
-fi
-
-if [[ ${NACL_LIBC} == glibc ]]; then
- EXECUTABLES+=" test/elf_reader test/library_dependencies"
-fi
-
-if [[ ${NACL_SHARED} = 1 ]]; then
- NACLPORTS_CFLAGS+=" -fPIC"
- NACLPORTS_CXXFLAGS+=" -fPIC"
- EXECUTABLES+=
-fi
-
-if [[ ${TOOLCHAIN} == emscripten ]]; then
- NACLPORTS_CPPFLAGS+=" -I${EMSCRIPTEN}//system/lib/libcxxabi/include"
-fi
-
-if [[ ${NACL_DEBUG} == 1 ]]; then
- NACLPORTS_CPPFLAGS+=" -DNSPAWN_LOGGING=1"
-fi
-
-EnableGlibcCompat
-
-ConfigureStep() {
- MakeDir ${BUILD_DIR}
- cp -rf ${START_DIR}/* ${BUILD_DIR}
-}
-
-BuildStep() {
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- return
- fi
- SetupCrossEnvironment
- export TOOLCHAIN
- export NACL_SHARED
- export GTEST_DIR=${NACL_PREFIX}/src/gtest
- DefaultBuildStep
-}
-
-TestStep() {
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- return
- fi
- if [[ ${NACL_LIBC} == glibc ]]; then
- SetupCrossEnvironment
- export TOOLCHAIN
- export NACL_SHARED
- LogExecute make test
- fi
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- RunSelLdrCommand test/unittests
- else
- LogExecute test/unittests.sh
- fi
-}
-
-InstallStep() {
- if [[ ${TOOLCHAIN} == emscripten ]]; then
- return
- fi
- MakeDir ${DESTDIR_LIB}
- LogExecute cp libnacl_spawn.a ${DESTDIR_LIB}
- if [[ ${NACL_SHARED} == 1 ]]; then
- LogExecute cp libnacl_spawn.so ${DESTDIR_LIB}
- fi
- LogExecute cp libcli_main.a ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}
- LogExecute cp -f ${START_DIR}/include/spawn.h ${DESTDIR_INCLUDE}/
- LogExecute cp -f ${START_DIR}/include/nacl_main.h ${DESTDIR_INCLUDE}/
-}
diff --git a/ports/nacl-spawn/cli_main.c b/ports/nacl-spawn/cli_main.c
deleted file mode 100644
index 5cc20d7..0000000
--- a/ports/nacl-spawn/cli_main.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* Define a typical entry point for command line tools spawned by bash
- * (e.g., ls, objdump, and objdump). */
-
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <stdbool.h>
-
-#include "nacl_io/nacl_io.h"
-#include "nacl_main.h"
-#include "ppapi_simple/ps.h"
-#include "ppapi_simple/ps_main.h"
-
-bool _cli_main_init = false;
-
-#ifdef _NEWLIB_VERSION
-void setprogname(const char *progname) __attribute__((weak));
-#endif
-
-void nacl_setprogname(char* argv0) {
-#if defined(_NEWLIB_VERSION)
- /* If setprogname exists at runtime then call it to set the program name */
- if (setprogname)
- setprogname(argv0);
-#elif defined(__GLIBC__)
- char *p = strrchr (argv0, '/');
- if (p == NULL)
- program_invocation_short_name = argv0;
- else
- program_invocation_short_name = p + 1;
- program_invocation_name = argv0;
-#endif
-}
-
-int main(int argc, char* argv[]);
-
-int cli_main(int argc, char* argv[]) {
- _cli_main_init = true;
- if (argv && argv[0])
- nacl_setprogname(argv[0]);
-
- int rtn = nacl_setup_env();
- if (rtn != 0) {
- fprintf(stderr, "nacl_setup_env failed: %d\n", rtn);
- return 1;
- }
-
- return main(argc, argv);
-}
-
-PPAPI_SIMPLE_REGISTER_MAIN(cli_main)
diff --git a/ports/nacl-spawn/elf_reader.cc b/ports/nacl-spawn/elf_reader.cc
deleted file mode 100644
index 1654a02..0000000
--- a/ports/nacl-spawn/elf_reader.cc
+++ /dev/null
@@ -1,276 +0,0 @@
-// Copyright (c) 2014 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.
-
-#include "elf_reader.h"
-
-#include <assert.h>
-#include <elf.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <string>
-#include <vector>
-
-class ScopedFile {
- public:
- explicit ScopedFile(FILE* fp) : fp_(fp) {}
- ~ScopedFile() {
- if (fp_)
- fclose(fp_);
- }
-
- FILE* get() { return fp_; }
-
- private:
- FILE* fp_;
-};
-
-ElfReader::ElfReader(const char* filename)
- : filename_(filename), is_valid_(false), is_static_(false) {
- ScopedFile fp(fopen(filename, "rb"));
- if (!fp.get()) {
- PrintError("failed to open file: %s", strerror(errno));
- return;
- }
-
- std::vector<Elf64_Phdr> phdrs;
- if (!ReadHeaders(fp.get(), &phdrs))
- return;
-
- Elf64_Addr straddr = 0;
- size_t strsize = 0;
- std::vector<int> neededs;
- if (!ReadDynamic(fp.get(), phdrs, &straddr, &strsize, &neededs))
- return;
-
- std::string strtab;
- if (!ReadStrtab(fp.get(), phdrs, straddr, strsize, &strtab))
- return;
-
- for (size_t i = 0; i < neededs.size(); i++)
- neededs_.push_back(strtab.data() + neededs[i]);
-
- is_valid_= true;
-}
-
-bool ElfReader::ReadHeaders(FILE* fp, std::vector<Elf64_Phdr>* phdrs) {
- Elf32_Ehdr ehdr32;
- if (fread(&ehdr32, sizeof(ehdr32), 1, fp) != 1) {
- PrintError("failed to read ELF header");
- return false;
- }
-
- if (memcmp(ELFMAG, ehdr32.e_ident, SELFMAG)) {
- PrintError("not an ELF file");
- return false;
- }
-
- elf_class_ = ehdr32.e_ident[EI_CLASS];
- if (elf_class_ != ELFCLASS32 && elf_class_ != ELFCLASS64) {
- PrintError("bad ELFCLASS");
- return false;
- }
-
- Elf64_Ehdr ehdr64;
- if (elf_class_ == ELFCLASS64) {
- if (fseek(fp, 0, SEEK_SET) < 0) {
- PrintError("failed to seek back to ELF header");
- return false;
- }
- if (fread(&ehdr64, sizeof(ehdr64), 1, fp) != 1) {
- PrintError("failed to read ELF64 header");
- return false;
- }
- }
-
- if (elf_class_ == ELFCLASS32) {
- machine_ = ehdr32.e_machine;
- } else {
- machine_ = ehdr64.e_machine;
- }
-
- uint64_t off;
- if (elf_class_ == ELFCLASS32) {
- off = ehdr32.e_phoff;
- } else {
- off = ehdr64.e_phoff;
- }
- if (fseek(fp, off, SEEK_SET) < 0) {
- PrintError("failed to seek to program header");
- return false;
- }
-
- int phnum;
- if (elf_class_ == ELFCLASS32) {
- phnum = ehdr32.e_phnum;
- } else {
- phnum = ehdr64.e_phnum;
- }
- for (int i = 0; i < phnum; i++) {
- Elf64_Phdr phdr;
- if (elf_class_ == ELFCLASS32) {
- Elf32_Phdr phdr32;
- if (fread(&phdr32, sizeof(phdr32), 1, fp) != 1) {
- PrintError("failed to read a program header %d", i);
- return false;
- }
- phdr.p_type = phdr32.p_type;
- phdr.p_offset = phdr32.p_offset;
- phdr.p_vaddr = phdr32.p_vaddr;
- phdr.p_paddr = phdr32.p_paddr;
- phdr.p_filesz = phdr32.p_filesz;
- phdr.p_memsz = phdr32.p_memsz;
- phdr.p_flags = phdr32.p_flags;
- phdr.p_align = phdr32.p_align;
- } else {
- if (fread(&phdr, sizeof(phdr), 1, fp) != 1) {
- PrintError("failed to read a program header %d", i);
- return false;
- }
- }
- phdrs->push_back(phdr);
- }
- return true;
-}
-
-bool ElfReader::ReadDynamic(FILE* fp, const std::vector<Elf64_Phdr>& phdrs,
- Elf64_Addr* straddr, size_t* strsize,
- std::vector<int>* neededs) {
- bool dynamic_found = false;
- for (size_t i = 0; i < phdrs.size(); i++) {
- const Elf64_Phdr& phdr = phdrs[i];
- if (phdr.p_type != PT_DYNAMIC)
- continue;
-
- // NaCl glibc toolchain creates a dynamic segment with no contents
- // for statically linked binaries.
- if (phdr.p_filesz == 0) {
- PrintError("dynamic segment without no content");
- return false;
- }
-
- dynamic_found = true;
-
- if (fseek(fp, phdr.p_offset, SEEK_SET) < 0) {
- PrintError("failed to seek to dynamic segment");
- return false;
- }
-
- for (;;) {
- Elf64_Dyn dyn;
- if (elf_class_ == ELFCLASS32) {
- Elf32_Dyn dyn32;
- if (fread(&dyn32, sizeof(dyn32), 1, fp) != 1) {
- PrintError("failed to read a dynamic entry");
- return false;
- }
- dyn.d_tag = dyn32.d_tag;
- // TODO(bradnelson): This relies on little endian arches, fix.
- dyn.d_un.d_ptr = dyn32.d_un.d_ptr;
- } else {
- if (fread(&dyn, sizeof(dyn), 1, fp) != 1) {
- PrintError("failed to read a dynamic entry");
- return false;
- }
- }
-
- if (dyn.d_tag == DT_NULL)
- break;
- if (dyn.d_tag == DT_STRTAB)
- *straddr = dyn.d_un.d_ptr;
- else if (dyn.d_tag == DT_STRSZ)
- *strsize = dyn.d_un.d_val;
- else if (dyn.d_tag == DT_NEEDED)
- neededs->push_back(dyn.d_un.d_val);
- }
- }
-
- if (!dynamic_found) {
- is_valid_ = true;
- is_static_ = true;
- return false;
- }
- if (!strsize) {
- PrintError("DT_STRSZ does not exist");
- return false;
- }
- if (!straddr) {
- PrintError("DT_STRTAB does not exist");
- return false;
- }
- return true;
-}
-
-bool ElfReader::ReadStrtab(FILE* fp, const std::vector<Elf64_Phdr>& phdrs,
- Elf64_Addr straddr, size_t strsize,
- std::string* strtab) {
- // DT_STRTAB is specified by a pointer to a virtual address
- // space. We need to convert this value to a file offset. To do
- // this, we find a PT_LOAD segment which contains the address.
- Elf64_Addr stroff = 0;
- for (size_t i = 0; i < phdrs.size(); i++) {
- const Elf64_Phdr& phdr = phdrs[i];
- if (phdr.p_type == PT_LOAD &&
- phdr.p_vaddr <= straddr && straddr < phdr.p_vaddr + phdr.p_filesz) {
- stroff = straddr - phdr.p_vaddr + phdr.p_offset;
- break;
- }
- }
- if (!stroff) {
- PrintError("no segment which contains DT_STRTAB");
- return false;
- }
-
- strtab->resize(strsize);
- if (fseek(fp, stroff, SEEK_SET) < 0) {
- PrintError("failed to seek to dynamic strtab");
- return false;
- }
- if (fread(&(*strtab)[0], 1, strsize, fp) != strsize) {
- PrintError("failed to read dynamic strtab");
- return false;
- }
- return true;
-}
-
-void ElfReader::PrintError(const char* fmt, ...) {
- static const int kBufSize = 256;
- char buf[kBufSize];
- va_list ap;
- va_start(ap, fmt);
- int written = vsnprintf(buf, kBufSize - 1, fmt, ap);
- assert(written < kBufSize);
- if (written >= kBufSize)
- buf[kBufSize-1] = '\0';
-
- fprintf(stderr, "%s: %s\n", filename_, buf);
-}
-
-#if defined(DEFINE_ELF_READER_MAIN)
-
-int main(int argc, char* argv[]) {
- if (argc < 2) {
- fprintf(stderr, "Usage: %s <elf>\n", argv[0]);
- return 1;
- }
-
- // For test.
- if (!getenv("LD_LIBRARY_PATH"))
- setenv("LD_LIBRARY_PATH", ".", 1);
-
- ElfReader elf_reader(argv[1]);
- if (!elf_reader.is_valid())
- return 1;
-
- for (size_t i = 0; i < elf_reader.neededs().size(); i++) {
- if (i)
- printf(" ");
- printf("%s", elf_reader.neededs()[i].c_str());
- }
-}
-
-#endif // DEFINE_ELF_READER_MAIN
diff --git a/ports/nacl-spawn/include/elf_reader.h b/ports/nacl-spawn/include/elf_reader.h
deleted file mode 100644
index 6515b75..0000000
--- a/ports/nacl-spawn/include/elf_reader.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2014 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.
-
-#ifndef NACL_SPAWN_ELF_READER_H_
-#define NACL_SPAWN_ELF_READER_H_
-
-#include <elf.h>
-#include <stdio.h>
-
-#include <string>
-#include <vector>
-
-// An ELF reader which extracts shared objects which are necessary to
-// run the specified binary (DT_NEEDED). As no NaCl binary in the NaCl
-// SDK does not have DT_RPATH and DT_RUNPATH (as of Jan. 2014), we do
-// not support them.
-class ElfReader {
- public:
- explicit ElfReader(const char* filename);
-
- bool is_valid() const { return is_valid_; }
- bool is_static() const { return is_static_; }
- Elf64_Half machine() const { return machine_; }
- const std::vector<std::string>& neededs() const { return neededs_; }
-
- private:
- bool ReadHeaders(FILE* fp, std::vector<Elf64_Phdr>* phdrs);
- bool ReadDynamic(FILE* fp, const std::vector<Elf64_Phdr>& phdrs,
- Elf64_Addr* straddr, size_t* strsize,
- std::vector<int>* neededs);
- bool ReadStrtab(FILE* fp, const std::vector<Elf64_Phdr>& phdrs,
- Elf64_Addr straddr, size_t strsize,
- std::string* strtab);
- void PrintError(const char* fmt, ...);
-
- const char* filename_;
- bool is_valid_;
- bool is_static_;
- Elf64_Half machine_;
- unsigned char elf_class_;
- std::vector<std::string> neededs_;
-};
-
-#endif // NACL_SPAWN_ELF_READER_H_
diff --git a/ports/nacl-spawn/include/library_dependencies.h b/ports/nacl-spawn/include/library_dependencies.h
deleted file mode 100644
index 8422a34..0000000
--- a/ports/nacl-spawn/include/library_dependencies.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2014 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.
-
-#ifndef NACL_SPAWN_LIBRARY_DEPENDENCIES_H_
-#define NACL_SPAWN_LIBRARY_DEPENDENCIES_H_
-
-#include <string>
-#include <vector>
-
-// Finds shared objects which are necessary to run |filename|.
-// Also finds the architecture string |arch|.
-// Output paths will be stored in |dependencies|. |filename| will be
-// in |dependencies| if |filename| is dynamically linked. Otherwise,
-// |dependencies| will be empty. Returns false and update errno
-// appropriately on error.
-bool nspawn_find_arch_and_library_deps(const std::string& filename,
- std::string* arch,
- std::vector<std::string>* dependencies);
-
-#endif // NACL_SPAWN_LIBRARY_DEPENDENCIES_H_
diff --git a/ports/nacl-spawn/include/nacl_main.h b/ports/nacl-spawn/include/nacl_main.h
deleted file mode 100644
index 2127df9..0000000
--- a/ports/nacl-spawn/include/nacl_main.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-#ifndef NACL_SPAWN_NACL_MAIN_H_
-#define NACL_SPAWN_NACL_MAIN_H_
-
-#include <spawn.h>
-
-#include "nacl_io/log.h"
-
-#if defined(NDEBUG)
-#define NACL_LOG(format, ...)
-#else
-#define NACL_LOG(format, ...) nacl_io_log(format, ##__VA_ARGS__)
-#endif
-
-__BEGIN_DECLS
-
-/*
- * Entry point expected by libcli_main.a
- */
-int nacl_main(int argc, char* argv[]) __attribute__ ((visibility ("default")));
-
-/*
- * Untar a startup bundle to a particular root.
- *
- * NOTE: This lives in libcli_main.a
- * Args:
- * arg0: The contents of argv[0], used to determine relative tar location.
- * tarfile: The name of a tarfile to extract.
- * root: The absolute path to extract the startup tar file to.
- * Returns: 0 on success, non-zero on failure.
- */
-int nacl_startup_untar(const char* argv0, const char* tarfile,
- const char* root);
-
-/*
- * Setup common environment variables and mounts.
- * Returns: 0 on success, non-zero on failure.
- */
-int nacl_setup_env(void);
-
-__END_DECLS
-
-#endif /* NACL_SPAWN_NACL_MAIN_H_ */
diff --git a/ports/nacl-spawn/include/nacl_spawn.h b/ports/nacl-spawn/include/nacl_spawn.h
deleted file mode 100644
index e6597e7..0000000
--- a/ports/nacl-spawn/include/nacl_spawn.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#ifndef NACL_SPAWN_NACL_SPAWN_H_
-#define NACL_SPAWN_NACL_SPAWN_H_
-
-/*
- * Internal nacl_spawn functions
- */
-
-#include <stdbool.h>
-#include <sys/cdefs.h>
-
-#include "ppapi/c/ppb_var.h"
-#include "ppapi/c/ppb_var_array.h"
-#include "ppapi/c/ppb_var_dictionary.h"
-#include "nacl_io/log.h"
-
-#ifdef NSPAWN_LOGGING
-#define NSPAWN_LOG_PREFIX "nspawn: "
-#define NSPAWN_LOG(format, ...) \
- nacl_io_log(NSPAWN_LOG_PREFIX format "\n", ##__VA_ARGS__)
-#else
-#define NSPAWN_LOG(format, ...)
-#endif
-
-#define LOADER_NAME "nacl_spawn"
-
-__BEGIN_DECLS
-
-void nspawn_var_release(struct PP_Var var);
-
-/* Array helpers */
-struct PP_Var nspawn_array_create(void);
-void nspawn_array_insertstring(struct PP_Var array, uint32_t index,
- const char* value);
-void nspawn_array_setstring(struct PP_Var array, uint32_t index,
- const char* value);
-void nspawn_array_appendstring(struct PP_Var array, const char* value);
-
-/* Dictionary Helpers */
-struct PP_Var nspawn_dict_create(void);
-bool nspawn_dict_has_key(struct PP_Var dict, const char* key,
- struct PP_Var* out_value);
-struct PP_Var nspawn_dict_get(struct PP_Var dict, const char* key);
-void nspawn_dict_set(struct PP_Var dict, const char* key,
- struct PP_Var value_var);
-void nspawn_dict_setstring(struct PP_Var dict, const char* key,
- const char* value);
-void nspawn_dict_setint(struct PP_Var dict_var, const char* key, int32_t v);
-int nspawn_dict_getint(struct PP_Var dict_var, const char* key);
-int nspawn_dict_getint_release(struct PP_Var dict_var, const char* key);
-bool nspawn_dict_getbool(struct PP_Var dict_var, const char* key);
-
-/* Sends a spawn/wait request to JavaScript and returns the result. */
-struct PP_Var nspawn_send_request(struct PP_Var req_var);
-
-int nspawn_setup_anonymous_pipes(void);
-
-extern int nspawn_pid;
-extern int nspawn_ppid;
-
-__END_DECLS
-
-#endif /* NACL_SPAWN_NACL_SPAWN_H_ */
diff --git a/ports/nacl-spawn/include/path_util.h b/ports/nacl-spawn/include/path_util.h
deleted file mode 100644
index 40e4b51..0000000
--- a/ports/nacl-spawn/include/path_util.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2014 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.
-
-#ifndef NACL_SPAWN_PATH_UTIL_H_
-#define NACL_SPAWN_PATH_UTIL_H_
-
-#include <string>
-#include <vector>
-
-// Parses path environment variables such as PATH or LD_LIBRARY_PATH.
-void nspawn_get_paths(const char* env, std::vector<std::string>* paths);
-
-// Gets a file for the specified basename in paths. Returns true on
-// success and out_path will be updated. On failure, this function
-// returns false and out_path will not be updated.
-bool nspawn_find_in_paths(const std::string& basename,
- const std::vector<std::string>& paths,
- std::string* out_path);
-
-#endif // NACL_SPAWN_PATH_UTIL_H_
diff --git a/ports/nacl-spawn/include/spawn.h b/ports/nacl-spawn/include/spawn.h
deleted file mode 100644
index c08d0d7..0000000
--- a/ports/nacl-spawn/include/spawn.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-#include <setjmp.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include_next <spawn.h>
-
-/*
- * Include guards are here so that this header can forward to the next one in
- * presence of an already installed copy of nacl-spawn.
- */
-#ifndef NACL_SPAWN_SPAWN_H_
-#define NACL_SPAWN_SPAWN_H_
-
-__BEGIN_DECLS
-
-/*
- * Spawn a child using the given args.
- *
- * Args:
- * mode: Execute mode, one of the defines below.
- * path: The program to run.
- * argv: The startup arguments for the child.
- * Returns:
- * Process id of the child or -1 for error.
- */
-int spawnv(int mode, const char* path, char *const argv[]);
-
-/*
- * Spawn a child using the current environment and given args.
- *
- * Args:
- * mode: Execute mode, one of the defines below.
- * path: The program to run.
- * argv: The startup arguments for the child.
- * envp: The environment to run the child in.
- * Returns:
- * Process id of the child or -1 for error.
- */
-int spawnve(int mode, const char* path, char *const argv[], char *const envp[]);
-#define P_WAIT 0
-#define P_NOWAIT 1
-#define P_NOWAITO 1
-#define P_OVERLAY 2
-
-/*
- * Synchronously eval JavaScript.
- *
- * Args:
- * cmd: Null terminated string containing code to eval.
- * data: Pointer to a char* to receive eval string result.
- * len: Pointer to a size_t to receive the length of the result.
- */
-void jseval(const char* cmd, char** data, size_t* len);
-
-/*
- * Implement vfork as a macro.
- *
- * Returns:
- * Pid of a child, or zero if in the child.
- *
- * Done as a macro in order to allow portable implementation of
- * vfork's behavior, which requires multiple returns from the same
- * code location.
- * A before function is called to setup vfork state,
- * followed by setjmp passing its result to an after function.
- * A global setjmp buffer is used.
- */
-void nacl_spawn_vfork_before(void);
-pid_t nacl_spawn_vfork_after(int jmping);
-
-extern __thread jmp_buf nacl_spawn_vfork_env;
-#define vfork() (nacl_spawn_vfork_before(), \
- nacl_spawn_vfork_after(setjmp(nacl_spawn_vfork_env)))
-
-/*
- * Exit immediately with no cleanup.
- *
- * Args:
- * status: Exit status to return from process.
- *
- * Implemented as a macro to ensure we get the nacl_spawn version hooked
- * to interoperate with vfork in the case of an error.
- */
-void nacl_spawn_vfork_exit(int status);
-#if !defined(IN_NACL_SPAWN_CC)
-#define _exit(status) nacl_spawn_vfork_exit(status)
-#endif
-
-/*
- * Declarations of exec variants we support that aren't in our libc headers.
- *
- * The newer version of glibc already declared execvpe
- */
-#if !defined(__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 9)
-int execvpe(const char *file, char *const argv[], char *const envp[]);
-#endif
-int execlpe(const char *path, const char *arg, ...); /* char* const envp[] */
-
-__END_DECLS
-
-#endif /* NACL_SPAWN_SPAWN_H_ */
diff --git a/ports/nacl-spawn/library_dependencies.cc b/ports/nacl-spawn/library_dependencies.cc
deleted file mode 100644
index 67a5a22..0000000
--- a/ports/nacl-spawn/library_dependencies.cc
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright (c) 2014 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.
-
-#include "library_dependencies.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <set>
-
-#include "elf_reader.h"
-#include "nacl_spawn.h"
-#include "path_util.h"
-
-static bool s_debug;
-
-static void get_library_paths(std::vector<std::string>* paths) {
- // Partially emulate the behaviour of ls.so.
- // Search LD_LIBRARY_PATH first, then fall back to the defaults paths
- // (/lib and /usr/lib).
- const char* path_env = getenv("LD_LIBRARY_PATH");
- nspawn_get_paths(path_env, paths);
- paths->push_back("/lib");
- paths->push_back("/usr/lib");
- if (s_debug) {
- for (size_t i = 0; i < paths->size(); i++)
- fprintf(stderr, "%s: searching: %s\n", LOADER_NAME,
- paths->at(i).c_str());
- }
-}
-
-static bool find_arch_and_library_deps(
- const std::string& filename,
- const std::vector<std::string>& paths,
- std::string* arch,
- std::set<std::string>* dependencies) {
- if (!dependencies->insert(filename).second) {
- // We have already added this file.
- return true;
- }
-
- if (s_debug) {
- fprintf(stderr, "%s: resolving deps for: %s\n", LOADER_NAME,
- filename.c_str());
- }
-
- ElfReader elf_reader(filename.c_str());
-
- if (!elf_reader.is_valid()) {
- errno = ENOEXEC;
- return false;
- }
-
- Elf64_Half machine = elf_reader.machine();
- if (machine != EM_X86_64 && machine != EM_386 && machine != EM_ARM) {
- errno = ENOEXEC;
- return false;
- }
- if (arch) {
- if (machine == EM_X86_64) {
- *arch = "x86-64";
- } else if (machine == EM_386) {
- *arch = "x86-32";
- } else if (machine == EM_ARM) {
- *arch = "arm";
- } else {
- fprintf(stderr, "%s: unknown arch (%d): %s\n", LOADER_NAME, machine,
- filename.c_str());
- return false;
- }
- if (s_debug) {
- fprintf(stderr, "%s: arch=%s\n", LOADER_NAME, arch->c_str());
- }
- }
-
- if (elf_reader.is_static()) {
- assert(!dependencies->empty());
- if (dependencies->size() == 1) {
- // The main binary is statically linked.
- dependencies->clear();
- return true;
- } else {
- fprintf(stderr, "%s: unexpected static binary: %s\n", LOADER_NAME,
- filename.c_str());
- errno = ENOEXEC;
- return false;
- }
- }
-
- for (size_t i = 0; i < elf_reader.neededs().size(); i++) {
- const std::string& needed_name = elf_reader.neededs()[i];
- std::string needed_path;
- if (needed_name == "ld-nacl-x86-32.so.1" ||
- needed_name == "ld-nacl-x86-64.so.1") {
- // Our sdk includes ld-nacl-x86-*.so.1, for link time. However,
- // create_nmf.py (because of objdump) only publishes runnable-ld.so
- // (which is a version of ld-nacl-x86-*.so.1, modified to be runnable
- // as the initial nexe by nacl). Since all glibc NMFs include
- // ld-runnable.so (which has ld-nacl-*.so.1 as its SONAME), they will
- // already have this dependency, so we can ignore it.
- } else if (nspawn_find_in_paths(needed_name, paths, &needed_path)) {
- if (!find_arch_and_library_deps(needed_path, paths, NULL, dependencies))
- return false;
- } else {
- fprintf(stderr, "%s: library not found: %s\n", LOADER_NAME,
- needed_name.c_str());
- errno = ENOENT;
- return false;
- }
- }
- return true;
-}
-
-bool nspawn_find_arch_and_library_deps(const std::string& filename,
- std::string* arch,
- std::vector<std::string>* dependencies) {
- std::vector<std::string> paths;
-
- s_debug = getenv("LD_DEBUG") != NULL;
- get_library_paths(&paths);
-
- std::set<std::string> dep_set;
- if (!find_arch_and_library_deps(filename.c_str(), paths, arch, &dep_set))
- return false;
- dependencies->assign(dep_set.begin(), dep_set.end());
-
- // If we find any, also add runnable-ld.so, which we will also need.
- if (!dependencies->empty()) {
- std::string needed_path;
-#if defined(__arm__)
- if (nspawn_find_in_paths("elf_loader_arm.nexe", paths, &needed_path)) {
- dependencies->push_back(needed_path);
- }
- if (nspawn_find_in_paths("ld-nacl-arm.so.1", paths, &needed_path)) {
- dependencies->push_back(needed_path);
- }
-#else
- if (nspawn_find_in_paths("runnable-ld.so", paths, &needed_path)) {
- dependencies->push_back(needed_path);
- }
-#endif
- }
-
- return true;
-}
-
-#if defined(DEFINE_LIBRARY_DEPENDENCIES_MAIN)
-
-// When we run this under sel_ldr, we need to provide a valid
-// definition of access.
-#if defined(__native_client__)
-int access(const char* pathname, int mode) {
- int fd = open(pathname, O_RDONLY);
- if (fd < 0)
- return -1;
- close(fd);
- return 0;
-}
-#endif
-
-int main(int argc, char* argv[]) {
- if (argc < 2) {
- fprintf(stderr, "Usage: %s <elf>\n", argv[0]);
- return 1;
- }
-
- // For test.
- setenv("LD_LIBRARY_PATH", ".", 1);
-
- std::string arch;
- std::vector<std::string> dependencies;
- if (!nspawn_find_arch_and_library_deps(argv[1], &arch, &dependencies)) {
- perror("failed");
- return 1;
- }
-
- for (size_t i = 0; i < dependencies.size(); i++) {
- if (i)
- printf(" ");
- printf("%s", dependencies[i].c_str());
- }
-
- printf("\n");
-}
-
-#endif // DEFINE_LIBRARY_DEPENDENCIES_MAIN
diff --git a/ports/nacl-spawn/nacl_apipe.c b/ports/nacl-spawn/nacl_apipe.c
deleted file mode 100644
index 58f01d9..0000000
--- a/ports/nacl-spawn/nacl_apipe.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-
-/* TODO(sbc): These types should really be forward declared in fuse.h */
-struct statvfs;
-struct fuse_pollhandle;
-struct fuse_bufvec;
-
-#include "nacl_io/fuse.h"
-#include "nacl_io/nacl_io.h"
-#include "ppapi_simple/ps_interface.h"
-
-#include "nacl_spawn.h"
-
-static struct fuse_operations anonymous_pipe_ops;
-
-static int apipe_open(
- const char* path,
- struct fuse_file_info* info) {
- int id;
- if (sscanf(path, "/%d", &id) != 1) {
- return -ENOENT;
- }
- info->fh = id;
- info->nonseekable = 1;
- return 0;
-}
-
-static int apipe_read(
- const char* path, char* buf, size_t count, off_t offset,
- struct fuse_file_info* info) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_apipe_read");
- nspawn_dict_setint(req_var, "pipe_id", info->fh);
- nspawn_dict_setint(req_var, "count", count);
-
- struct PP_Var result_var = nspawn_send_request(req_var);
- struct PP_Var data = nspawn_dict_get(result_var, "data");
- assert(data.type == PP_VARTYPE_ARRAY_BUFFER);
- uint32_t len;
- if (!PSInterfaceVarArrayBuffer()->ByteLength(data, &len)) {
- nspawn_var_release(data);
- nspawn_var_release(result_var);
- return -EIO;
- }
- void *p = PSInterfaceVarArrayBuffer()->Map(data);
- if (len > 0 && !p) {
- nspawn_var_release(data);
- nspawn_var_release(result_var);
- return -EIO;
- }
- assert(len <= count);
- memcpy(buf, p, len);
- PSInterfaceVarArrayBuffer()->Unmap(data);
- nspawn_var_release(data);
- nspawn_var_release(result_var);
-
- return len;
-}
-
-static int apipe_write(
- const char* path,
- const char* buf,
- size_t count,
- off_t offset,
- struct fuse_file_info* info) {
- if (count == 0) return 0;
-
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_apipe_write");
- nspawn_dict_setint(req_var, "pipe_id", info->fh);
- struct PP_Var data = PSInterfaceVarArrayBuffer()->Create(count);
- if (data.type == PP_VARTYPE_NULL) return -EIO;
- void *p = PSInterfaceVarArrayBuffer()->Map(data);
- if (count > 0 && !p) {
- nspawn_var_release(data);
- nspawn_var_release(req_var);
- return -EIO;
- }
- memcpy(p, buf, count);
- PSInterfaceVarArrayBuffer()->Unmap(data);
- nspawn_dict_set(req_var, "data", data);
-
- struct PP_Var result_var = nspawn_send_request(req_var);
- int ret = nspawn_dict_getint(result_var, "count");
- nspawn_var_release(result_var);
-
- return ret;
-}
-
-static int apipe_release(const char* path, struct fuse_file_info* info) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_apipe_close");
- nspawn_dict_setint(req_var, "pipe_id", info->fh);
- nspawn_dict_setint(req_var, "writer", info->flags == O_WRONLY);
-
- struct PP_Var result_var = nspawn_send_request(req_var);
- int ret = nspawn_dict_getint(result_var, "result");
- nspawn_var_release(result_var);
-
- return ret;
-}
-
-static int apipe_fgetattr(
- const char* path, struct stat* st, struct fuse_file_info* info) {
- memset(st, 0, sizeof(*st));
- st->st_ino = info->fh;
- st->st_mode = S_IFIFO | S_IRUSR | S_IWUSR;
- // TODO(bradnelson): Do something better.
- // Stashing away the open flags (not a great place).
- st->st_rdev = info->flags;
- return 0;
-}
-
-int nspawn_setup_anonymous_pipes(void) {
- const char fs_type[] = "anonymous_pipe";
- int result;
-
- anonymous_pipe_ops.open = apipe_open;
- anonymous_pipe_ops.read = apipe_read;
- anonymous_pipe_ops.write = apipe_write;
- anonymous_pipe_ops.release = apipe_release;
- anonymous_pipe_ops.fgetattr = apipe_fgetattr;
-
- result = nacl_io_register_fs_type(fs_type, &anonymous_pipe_ops);
- if (!result) {
- fprintf(stderr, "error: resigstering fstype '%s' failed.\n", fs_type);
- return 1;
- }
- mkdir("/apipe", 0777);
- result = mount("", "/apipe", fs_type, 0, NULL);
- if (result != 0) {
- fprintf(stderr, "error: mount of '%s' failed: %d.\n", fs_type, result);
- return 1;;
- }
-
- return 0;
-}
diff --git a/ports/nacl-spawn/nacl_pp_helpers.c b/ports/nacl-spawn/nacl_pp_helpers.c
deleted file mode 100644
index c189391..0000000
--- a/ports/nacl-spawn/nacl_pp_helpers.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <assert.h>
-#include <string.h>
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-
-#include "nacl_spawn.h"
-
-#include "ppapi_simple/ps_interface.h"
-#include "ppapi_simple/ps.h"
-#include "ppapi_simple/ps_instance.h"
-
-void nspawn_var_release(struct PP_Var var) {
- PSInterfaceVar()->Release(var);
-}
-
-struct PP_Var nspawn_dict_create(void) {
- struct PP_Var ret = PSInterfaceVarDictionary()->Create();
- return ret;
-}
-
-bool nspawn_dict_has_key(struct PP_Var dict,
- const char* key,
- struct PP_Var* out_value) {
- assert(out_value);
- struct PP_Var key_var = PSInterfaceVar()->VarFromUtf8(key, strlen(key));
- bool has_value = PSInterfaceVarDictionary()->HasKey(dict, key_var);
- if (has_value) {
- *out_value = PSInterfaceVarDictionary()->Get(dict, key_var);
- }
- PSInterfaceVar()->Release(key_var);
- return has_value;
-}
-
-struct PP_Var nspawn_dict_get(struct PP_Var dict, const char* key) {
- struct PP_Var key_var = PSInterfaceVar()->VarFromUtf8(key, strlen(key));
- struct PP_Var ret = PSInterfaceVarDictionary()->Get(dict, key_var);
- PSInterfaceVar()->Release(key_var);
- return ret;
-}
-
-void nspawn_dict_set(struct PP_Var dict,
- const char* key,
- struct PP_Var value_var) {
- struct PP_Var key_var = PSInterfaceVar()->VarFromUtf8(key, strlen(key));
- PSInterfaceVarDictionary()->Set(dict, key_var, value_var);
- PSInterfaceVar()->Release(key_var);
- PSInterfaceVar()->Release(value_var);
-}
-
-void nspawn_dict_setstring(struct PP_Var dict,
- const char* key,
- const char* value) {
- struct PP_Var value_var = PSInterfaceVar()->VarFromUtf8(value, strlen(value));
- nspawn_dict_set(dict, key, value_var);
-}
-
-void nspawn_dict_setint(struct PP_Var dict_var,
- const char* key,
- int32_t v) {
- nspawn_dict_set(dict_var, key, PP_MakeInt32(v));
-}
-
-struct PP_Var nspawn_array_create(void) {
- struct PP_Var ret = PSInterfaceVarArray()->Create();
- return ret;
-}
-
-void nspawn_array_insert(struct PP_Var array,
- uint32_t index,
- struct PP_Var value_var) {
- uint32_t old_length = PSInterfaceVarArray()->GetLength(array);
- PSInterfaceVarArray()->SetLength(array, old_length + 1);
-
- for (uint32_t i = old_length; i > index; --i) {
- struct PP_Var from_var = PSInterfaceVarArray()->Get(array, i - 1);
- PSInterfaceVarArray()->Set(array, i, from_var);
- PSInterfaceVar()->Release(from_var);
- }
- PSInterfaceVarArray()->Set(array, index, value_var);
- PSInterfaceVar()->Release(value_var);
-}
-
-void nspawn_array_setstring(struct PP_Var array,
- uint32_t index,
- const char* value) {
- struct PP_Var value_var = PSInterfaceVar()->VarFromUtf8(value, strlen(value));
- PSInterfaceVarArray()->Set(array, index, value_var);
- PSInterfaceVar()->Release(value_var);
-}
-
-void nspawn_array_insertstring(struct PP_Var array,
- uint32_t index,
- const char* value) {
- struct PP_Var value_var = PSInterfaceVar()->VarFromUtf8(value, strlen(value));
- nspawn_array_insert(array, index, value_var);
-}
-
-void nspawn_array_appendstring(struct PP_Var array,
- const char* value) {
- uint32_t index = PSInterfaceVarArray()->GetLength(array);
- nspawn_array_setstring(array, index, value);
-}
-
-int nspawn_dict_getint(struct PP_Var dict_var, const char* key) {
- struct PP_Var value_var;
- if (!nspawn_dict_has_key(dict_var, key, &value_var)) {
- return -1;
- }
- assert(value_var.type == PP_VARTYPE_INT32);
- int value = value_var.value.as_int;
- if (value < 0) {
- errno = -value;
- return -1;
- }
- return value;
-}
-
-bool nspawn_dict_getbool(struct PP_Var dict_var, const char* key) {
- struct PP_Var value_var;
- if (!nspawn_dict_has_key(dict_var, key, &value_var)) {
- return -1;
- }
- assert(value_var.type == PP_VARTYPE_BOOL);
- bool value = value_var.value.as_bool;
- return value;
-}
-
-int nspawn_dict_getint_release(struct PP_Var dict_var, const char* key) {
- int ret = nspawn_dict_getint(dict_var, key);
- nspawn_var_release(dict_var);
- return ret;
-}
-
-// Returns a unique request ID to make all request strings different
-// from each other.
-static int64_t get_request_id() {
- static int64_t req_id = 0;
- static pthread_mutex_t mu = PTHREAD_MUTEX_INITIALIZER;
- pthread_mutex_lock(&mu);
- int64_t id = ++req_id;
- pthread_mutex_unlock(&mu);
- return id;
-}
-
-struct NaClSpawnReply {
- pthread_mutex_t mu;
- pthread_cond_t cond;
-
- struct PP_Var result_var;
-};
-
-/*
- * Handle reply from JavaScript. The key is the request string and the
- * value is Zero or positive on success or -errno on failure. The
- * user_data must be an instance of NaClSpawnReply.
- */
-static void handle_reply(struct PP_Var key, struct PP_Var value,
- void* user_data) {
- if (key.type != PP_VARTYPE_STRING || value.type != PP_VARTYPE_DICTIONARY) {
- fprintf(stderr, "Invalid parameter for handle_reply\n");
- fprintf(stderr, "key type=%d\n", key.type);
- fprintf(stderr, "value type=%d\n", value.type);
- }
- assert(key.type == PP_VARTYPE_STRING);
- assert(value.type == PP_VARTYPE_DICTIONARY);
-
- struct NaClSpawnReply* reply = (struct NaClSpawnReply*)user_data;
- pthread_mutex_lock(&reply->mu);
-
- PSInterfaceVar()->AddRef(value);
- reply->result_var = value;
-
- pthread_cond_signal(&reply->cond);
- pthread_mutex_unlock(&reply->mu);
-}
-
-struct PP_Var nspawn_send_request(struct PP_Var req_var) {
- /*
- * naclprocess.js is required in order send requests to JavasCript.
- * If NACL_PROCESS is not set in the environment then we assume it is
- * not present and exit early. Without this check we would block forever
- * waiting for a response for the JavaScript side.
- */
- const char* naclprocess = getenv("NACL_PROCESS");
- if (naclprocess == NULL) {
- fprintf(stderr, "nspawn_send_request called without NACL_PROCESS set\n");
- return PP_MakeNull();
- }
-
- int64_t id = get_request_id();
- char req_id[64];
- sprintf(req_id, "%lld", id);
- nspawn_dict_setstring(req_var, "id", req_id);
-
- struct NaClSpawnReply reply;
- pthread_mutex_init(&reply.mu, NULL);
- pthread_cond_init(&reply.cond, NULL);
- PSEventRegisterMessageHandler(req_id, &handle_reply, &reply);
-
- PSInterfaceMessaging()->PostMessage(PSGetInstanceId(), req_var);
- nspawn_var_release(req_var);
-
- pthread_mutex_lock(&reply.mu);
- /*
- * Wait for response for JavaScript. This can block for an unbounded amount
- * of time (e.g. waiting for a response to waitpid).
- */
- int error = pthread_cond_wait(&reply.cond, &reply.mu);
- pthread_mutex_unlock(&reply.mu);
-
- pthread_cond_destroy(&reply.cond);
- pthread_mutex_destroy(&reply.mu);
-
- PSEventRegisterMessageHandler(req_id, NULL, &reply);
-
- if (error != 0) {
- fprintf(stderr, "nspawn_send_request: pthread_cond_timedwait: %s\n",
- strerror(error));
- return PP_MakeNull();
- }
-
- return reply.result_var;
-}
diff --git a/ports/nacl-spawn/nacl_setup_env.c b/ports/nacl-spawn/nacl_setup_env.c
deleted file mode 100644
index 2f68896..0000000
--- a/ports/nacl-spawn/nacl_setup_env.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <locale.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "ppapi/c/ppb_file_system.h"
-#include "ppapi_simple/ps.h"
-#include "ppapi_simple/ps_instance.h"
-#include "ppapi_simple/ps_interface.h"
-
-#include "nacl_main.h"
-#include "nacl_spawn.h"
-
-#define MAX_OLD_PIPES 100
-
-/*
- * Get an environment variable as an int, or return -1 if the value cannot
- * be converted to an int.
- */
-static int getenv_as_int(const char *env) {
- const char* env_str = getenv(env);
- if (!env_str) {
- return -1;
- }
- errno = 0;
- int env_int = strtol(env_str, NULL, 0);
- if (errno) {
- return -1;
- }
- return env_int;
-}
-
-static int mkdir_checked(const char* dir) {
- int rtn = mkdir(dir, 0777);
- if (rtn != 0) {
- fprintf(stderr, "mkdir '%s' failed: %s\n", dir, strerror(errno));
- }
- return rtn;
-}
-
-static int do_mount(const char *source, const char *target,
- const char *filesystemtype, unsigned long mountflags,
- const void *data) {
- NACL_LOG("mount[%s] '%s' at '%s'\n", filesystemtype, source, target);
- return mount(source, target, filesystemtype, mountflags, data);
-}
-
-static void MountLocalFs(struct PP_Var mount_data) {
- bool available = nspawn_dict_getbool(mount_data, "available");
-
- if (!available)
- return;
-
- struct PP_Var filesystem = nspawn_dict_get(mount_data, "filesystem");
- PP_Resource filesystemResource =
- PSInterfaceVar()->VarToResource(filesystem);
- struct PP_Var filepath_var = nspawn_dict_get(mount_data, "fullPath");
- struct PP_Var mountpoint_var = nspawn_dict_get(mount_data, "mountPoint");
-
- uint32_t fp_len, mp_len;
- const char* filepath = PSInterfaceVar()->VarToUtf8(filepath_var,
- &fp_len);
- const char* mountpoint = PSInterfaceVar()->VarToUtf8(mountpoint_var,
- &mp_len);
- // TODO(gdeepti): Currently mount on the main thread always returns
- // without an error, crashes the nacl module and mkdir in /mnt/html5
- // does not work because we do not allow blocking calls on the main thread.
- // Move this off the main thread for better error checking.
- struct stat st;
- if (stat(mountpoint, &st) < 0) {
- mkdir_checked(mountpoint);
- }
-
- struct PP_Var status_var = nspawn_dict_create();
- char fs[1024];
- sprintf(fs, "filesystem_resource=%d\n", filesystemResource);
-
- if (do_mount(filepath, mountpoint, "html5fs", 0, fs) != 0) {
- fprintf(stderr, "Mounting HTML5 filesystem in %s failed.\n", filepath);
- nspawn_dict_setstring(status_var, "mount_status", "fail");
- } else {
- nspawn_dict_setstring(status_var, "mount_status", "success");
- }
- PSInterfaceMessaging()->PostMessage(PSGetInstanceId(), status_var);
- nspawn_var_release(filesystem);
- nspawn_var_release(filepath_var);
- nspawn_var_release(mountpoint_var);
-}
-
-static void UnmountLocalFs(struct PP_Var mount_data) {
- bool mounted = nspawn_dict_getbool(mount_data, "mounted");
- struct PP_Var mountpoint_var = nspawn_dict_get(mount_data, "mountPoint");
- uint32_t mp_len;
- const char* mountpoint = PSInterfaceVar()->VarToUtf8(mountpoint_var, &mp_len);
-
- if (!mounted) {
- perror("Directory not mounted, unable to unmount");
- return;
- }
-
- struct PP_Var status_var = nspawn_dict_create();
- if (umount(mountpoint) != 0) {
- fprintf(stderr, "Unmounting filesystem %s failed.\n", mountpoint);
- nspawn_dict_setstring(status_var, "unmount_status", "fail");
- } else {
- nspawn_dict_setstring(status_var, "unmount_status", "success");
- }
- PSInterfaceMessaging()->PostMessage(PSGetInstanceId(), status_var);
- nspawn_var_release(status_var);
- nspawn_var_release(mountpoint_var);
-}
-
-static void HandleMountMessage(struct PP_Var key,
- struct PP_Var value,
- void* user_data) {
- if (key.type != PP_VARTYPE_STRING || value.type != PP_VARTYPE_DICTIONARY) {
- fprintf(stderr, "Invalid parameter for HandleMountMessage\n");
- fprintf(stderr, "key type=%d\n", key.type);
- fprintf(stderr, "value type=%d\n", value.type);
- return;
- }
-
- MountLocalFs(value);
-}
-
-static void HandleUnmountMessage(struct PP_Var key,
- struct PP_Var value,
- void* user_data) {
- if (key.type != PP_VARTYPE_STRING || value.type != PP_VARTYPE_DICTIONARY) {
- fprintf(stderr, "Invalid parameter for HandleUnmountMessage\n");
- fprintf(stderr, "key type=%d\n", key.type);
- fprintf(stderr, "value type=%d\n", value.type);
- return;
- }
-
- UnmountLocalFs(value);
-}
-
-static void mountfs() {
- /* naclprocess.js is required in order to setup dynmamic mounts */
- const char* naclprocess = getenv("NACL_PROCESS");
- if (naclprocess == NULL) {
- return;
- }
-
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_mountfs");
- struct PP_Var result_dict_var = nspawn_send_request(req_var);
- if (result_dict_var.type == PP_VARTYPE_NULL)
- return;
-
- MountLocalFs(result_dict_var);
- nspawn_var_release(result_dict_var);
-
- PSEventRegisterMessageHandler("mount", &HandleMountMessage, NULL);
- PSEventRegisterMessageHandler("unmount", &HandleUnmountMessage, NULL);
-}
-
-static int restore_pipes(void) {
- int old_pipes[MAX_OLD_PIPES][3];
- int old_pipe_count = 0;
- int count = 0;
- int i;
- for (;;) {
- char entry[100];
- snprintf(entry, sizeof entry, "NACL_SPAWN_FD_SETUP_%d", count++);
- const char *env_entry = getenv(entry);
- if (!env_entry) {
- break;
- }
- int fd, port, writer;
- if (sscanf(env_entry, "pipe:%d:%d:%d", &fd, &port, &writer) != 3) {
- unsetenv(entry);
- continue;
- }
- unsetenv(entry);
- /*
- * NOTE: This is necessary as the javascript assumes all instances
- * of an anonymous pipe will be from the same file object.
- * This allows nacl_io to do the reference counting.
- * naclprocess.js then merely tracks which processes are readers and
- * writers for a given pipe.
- */
- for (i = 0; i < old_pipe_count; ++i) {
- if (old_pipes[i][0] == port && old_pipes[i][1] == writer) {
- dup2(old_pipes[i][2], fd);
- break;
- }
- }
- if (i != old_pipe_count) continue;
- char path[100];
- sprintf(path, "/apipe/%d", port);
- int fd_tmp = open(path, (writer ? O_WRONLY : O_RDONLY));
- if (fd_tmp < 0) {
- fprintf(stderr, "Failed to created pipe on port %d\n", port);
- return 1;
- }
- if (fd_tmp != fd) {
- dup2(fd_tmp, fd);
- close(fd_tmp);
- }
- if (old_pipe_count >= MAX_OLD_PIPES) {
- fprintf(stderr, "Too many old pipes to restore!\n");
- return 1;
- }
- old_pipes[old_pipe_count][0] = port;
- old_pipes[old_pipe_count][1] = writer;
- old_pipes[old_pipe_count][2] = fd;
- ++old_pipe_count;
- }
-
- return 0;
-}
-
-int nacl_setup_env() {
- /*
- * If we running in sel_ldr then don't do any the filesystem/nacl_io
- * setup. We detect sel_ldr by the absence of the Pepper Instance.
- */
- if (PSGetInstanceId() == 0) {
- NACL_LOG("nacl_setup_env: skipping setup; running under sel_ldr\n");
- return 0;
- }
-
- umount("/");
-
- /*
- * By default we use an ephemeral memfs for the root filesystem.
- * However apps can set NACL_HTML5_ROOT if they prefer to use html5
- * persistent storage, such is the dev env we multi-process and memfs
- * doesn't make much sense since we want a common filesystem between
- * processes.
- */
- const char* html5_root = getenv("NACL_HTML5_ROOT");
- if (html5_root != NULL) {
- NACL_LOG("nacl_setup_env: devenv\n");
- if (do_mount(html5_root, "/", "html5fs", 0, "type=PERSISTENT") != 0)
- return 1;
- } else {
- NACL_LOG("nacl_setup_env: standalone\n");
- if (do_mount("", "/", "memfs", 0, NULL) != 0)
- return 1;
- }
-
- int rtn = nspawn_setup_anonymous_pipes();
- if (rtn != 0)
- return rtn;
-
- /*
- * Setup common environment variables, but don't override those
- * set already by ppapi_simple.
- */
- setenv("HOME", "/home/user", 0);
- setenv("PATH", "/bin", 0);
- setenv("USER", "user", 0);
- setenv("LOGNAME", "user", 0);
-
- const char* home = getenv("HOME");
- mkdir_checked("/home");
- mkdir_checked(home);
- mkdir_checked("/tmp");
- mkdir_checked("/bin");
- mkdir_checked("/etc");
- mkdir_checked("/mnt");
- mkdir_checked("/mnt/http");
-
- /* HTTP mount */
- const char* data_url = getenv("NACL_DATA_URL");
- if (!data_url)
- data_url = "./";
- NACL_LOG("nacl_setup_env: NACL_DATA_URL=%s\n", data_url);
-
- const char* mount_flags = getenv("NACL_DATA_MOUNT_FLAGS");
- if (!mount_flags)
- mount_flags = "";
- NACL_LOG("nacl_setup_env: NACL_DATA_MOUNT_FLAGS=%s\n", mount_flags);
-
- if (do_mount(data_url, "/mnt/http", "httpfs", 0, mount_flags) != 0) {
- perror("mounting http filesystem at /mnt/http failed");
- }
-
- /* HTML5 mount (if we didn't already mount it as root) */
- if (!html5_root) {
- mkdir_checked("/mnt/html5");
- if (do_mount("/", "/mnt/html5", "html5fs", 0, "type=PERSISTENT") != 0) {
- perror("Mounting HTML5 filesystem in /mnt/html5 failed");
- } else {
- mkdir("/mnt/html5/home", 0777);
- struct stat st;
- if (stat("/mnt/html5/home", &st) < 0 || !S_ISDIR(st.st_mode)) {
- perror("Unable to create home directory in persistent storage");
- } else {
- if (do_mount("/home", home, "html5fs", 0, "type=PERSISTENT") != 0) {
- fprintf(stderr, "Mounting HTML5 filesystem in %s failed.\n", home);
- }
- }
- }
- }
-
- /* HTML5 temporary mount */
- if (do_mount("/", "/tmp", "html5fs", 0, "type=TEMPORARY") != 0) {
- perror("Mounting HTML5 filesystem in /tmp failed");
- }
-
- mountfs();
-
- /* naclprocess.js sends the current working directory using this
- * environment variable. */
- const char* pwd = getenv("PWD");
- if (pwd != NULL) {
- if (chdir(pwd)) {
- fprintf(stderr, "chdir() to %s failed: %s\n", pwd, strerror(errno));
- return 1;
- }
- }
-
- // Tell the NaCl architecture to /etc/bashrc of mingn.
-#if defined(__x86_64__)
- static const char kNaClArch[] = "x86_64";
- // Use __i386__ rather then __i686__ since the latter is not defined
- // by i686-nacl-clang.
-#elif defined(__i386__)
- static const char kNaClArch[] = "i686";
-#elif defined(__arm__)
- static const char kNaClArch[] = "arm";
-#elif defined(__pnacl__)
- static const char kNaClArch[] = "pnacl";
-#else
-# error "Unknown architecture"
-#endif
- // Set NACL_ARCH with a guess if not set (0 == set if not already).
- setenv("NACL_ARCH", kNaClArch, 0);
- // Set NACL_BOOT_ARCH if not inherited from a parent (0 == set if not already
- // set). This will let us prefer PNaCl if we started with PNaCl (for tests
- // mainly).
- setenv("NACL_BOOT_ARCH", kNaClArch, 0);
-
- setlocale(LC_CTYPE, "");
-
- nspawn_pid = getenv_as_int("NACL_PID");
- nspawn_ppid = getenv_as_int("NACL_PPID");
-
- if (restore_pipes())
- return 1;
-
- return 0;
-}
diff --git a/ports/nacl-spawn/nacl_spawn.cc b/ports/nacl-spawn/nacl_spawn.cc
deleted file mode 100644
index 59cd9a9..0000000
--- a/ports/nacl-spawn/nacl_spawn.cc
+++ /dev/null
@@ -1,834 +0,0 @@
-// Copyright (c) 2014 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.
-
-// Emulates spawning/waiting process by asking JavaScript to do so.
-
-// Include quoted spawn.h first so we can build in the presence of an installed
-// copy of nacl-spawn.
-#define IN_NACL_SPAWN_CC
-#include "spawn.h"
-
-#include "nacl_main.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <irt.h>
-#include <irt_dev.h>
-#include <libgen.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netinet/in.h>
-#include <setjmp.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <string>
-#include <vector>
-
-#include "ppapi/c/ppb_var.h"
-#include "ppapi/c/ppb_var_array.h"
-#include "ppapi/c/ppb_var_dictionary.h"
-
-#include "ppapi_simple/ps_interface.h"
-
-#include "library_dependencies.h"
-#include "path_util.h"
-#include "nacl_spawn.h"
-
-
-extern char** environ;
-
-int nspawn_pid;
-int nspawn_ppid;
-
-static std::string GetCwd() {
- char cwd[PATH_MAX] = ".";
- if (!getcwd(cwd, PATH_MAX)) {
- NACL_LOG("getcwd failed: %s\n", strerror(errno));
- assert(0);
- }
- return cwd;
-}
-
-static std::string GetAbsPath(const std::string& path) {
- assert(!path.empty());
- if (path[0] == '/')
- return path;
- else
- return GetCwd() + '/' + path;
-}
-
-// Adds a file into nmf. |key| is the key for open_resource IRT or
-// "program". |filepath| is not a URL yet. JavaScript code is
-// responsible to fix them. |arch| is the architecture string.
-static void AddFileToNmf(const std::string& key,
- const std::string& arch,
- const std::string& filepath,
- struct PP_Var dict_var) {
-
- struct PP_Var url_dict_var = nspawn_dict_create();
- nspawn_dict_setstring(url_dict_var, "url", filepath.c_str());
-
- struct PP_Var arch_dict_var = nspawn_dict_create();
- nspawn_dict_set(arch_dict_var, arch.c_str(), url_dict_var);
-
- nspawn_dict_set(dict_var, key.c_str(), arch_dict_var);
-}
-
-static void AddNmfToRequestForShared(
- std::string prog,
- const std::string& arch,
- const std::vector<std::string>& dependencies,
- struct PP_Var req_var) {
- struct PP_Var nmf_var = nspawn_dict_create();
- struct PP_Var files_var = nspawn_dict_create();
- const char* prog_base = basename(&prog[0]);
- for (size_t i = 0; i < dependencies.size(); i++) {
- std::string dep = dependencies[i];
- const std::string& abspath = GetAbsPath(dep);
- const char* base = basename(&dep[0]);
- // nacl_helper does not pass the name of program and the dynamic
- // loader always uses "main.nexe" as the main binary.
- if (strcmp(prog_base, base) == 0)
- base = "main.nexe";
- if (strcmp(base, "runnable-ld.so") == 0 ||
- strcmp(base, "elf_loader_arm.nexe") == 0) {
- AddFileToNmf("program", arch, abspath, nmf_var);
- } else {
- AddFileToNmf(base, arch, abspath, files_var);
- }
- }
-
- nspawn_dict_set(nmf_var, "files", files_var);
- nspawn_dict_set(req_var, "nmf", nmf_var);
-}
-
-static void AddNmfToRequestForStatic(const std::string& prog,
- const std::string& arch,
- struct PP_Var req_var) {
- struct PP_Var nmf_var = nspawn_dict_create();
- AddFileToNmf("program", arch, GetAbsPath(prog), nmf_var);
- nspawn_dict_set(req_var, "nmf", nmf_var);
-}
-
-static void AddNmfToRequestForPNaCl(const std::string& prog,
- struct PP_Var req_var) {
- struct PP_Var url_dict_var = nspawn_dict_create();
- nspawn_dict_setstring(url_dict_var, "url", GetAbsPath(prog).c_str());
-
- struct PP_Var translate_dict_var = nspawn_dict_create();
- nspawn_dict_set(translate_dict_var, "pnacl-translate", url_dict_var);
-
- struct PP_Var arch_dict_var = nspawn_dict_create();
- nspawn_dict_set(arch_dict_var, "portable", translate_dict_var);
-
- struct PP_Var nmf_var = nspawn_dict_create();
- nspawn_dict_set(nmf_var, "program", arch_dict_var);
-
- nspawn_dict_set(req_var, "nmf", nmf_var);
-}
-
-static void FindInterpreter(std::string* path) {
- // Check if the path exists.
- if (access(path->c_str(), R_OK) == 0) {
- return;
- }
- // As /bin and /usr/bin are currently only mounted to a memory filesystem
- // in nacl_spawn, programs usually located there are installed to some other
- // location which is included in the PATH.
- // For now, do something non-standard.
- // If the program cannot be found at its full path, strip the program path
- // down to the basename and relying on later path search steps to find the
- // actual program location.
- size_t i = path->find_last_of('/');
- if (i == std::string::npos) {
- return;
- }
- *path = path->substr(i + 1);
-}
-
-static bool ExpandShBang(std::string* prog, struct PP_Var req_var) {
- // Open script.
- int fh = open(prog->c_str(), O_RDONLY);
- if (fh < 0) {
- return false;
- }
- // Read first 4k.
- char buffer[4096];
- ssize_t len = read(fh, buffer, sizeof buffer);
- if (len < 0) {
- close(fh);
- return false;
- }
- // Close script.
- if (close(fh) < 0) {
- return false;
- }
- // At least must have room for #!.
- if (len < 2) {
- errno = ENOEXEC;
- return false;
- }
- // Check if it's a script.
- if (memcmp(buffer, "#!", 2) != 0) {
- // Not a script.
- return true;
- }
- const char* start = buffer + 2;
- // Skip leading space
- while (start < buffer + len && *start == ' ') {
- ++start;
- }
-
- // Find the end of the line while also looking for the first space.
- // Mimicking Linux behavior, in which the first space marks a split point
- // where everything before is the interpreter path and everything after is
- // (including spaces) is treated as a single extra argument.
- const char* split = NULL;
- const char* end = start;
-
- while (buffer - end < len && *end != '\n' && *end != '\r') {
- if (*end == ' ' && split == NULL) {
- split = end;
- }
- ++end;
- }
- // Update command to run.
- struct PP_Var args_var = nspawn_dict_get(req_var, "args");
- assert(args_var.type == PP_VARTYPE_ARRAY);
- // Set argv[0] in case it was path expanded.
- nspawn_array_setstring(args_var, 0, prog->c_str());
- std::string interpreter;
- if (split) {
- interpreter = std::string(start, split - start);
- std::string arg(split + 1, end - (split + 1));
- nspawn_array_insertstring(args_var, 0, arg.c_str());
- } else {
- interpreter = std::string(start, end - start);
- }
- FindInterpreter(&interpreter);
- nspawn_array_insertstring(args_var, 0, interpreter.c_str());
- nspawn_var_release(args_var);
- *prog = interpreter;
- return true;
-}
-
-static bool UseBuiltInFallback(std::string* prog, struct PP_Var req_var) {
- if (prog->find('/') == std::string::npos) {
- const char* path_env = getenv("PATH");
- std::vector<std::string> paths;
- nspawn_get_paths(path_env, &paths);
- if (nspawn_find_in_paths(*prog, paths, prog)) {
- // Update argv[0] to match prog if we ended up changing it.
- struct PP_Var args_var = nspawn_dict_get(req_var, "args");
- assert(args_var.type == PP_VARTYPE_ARRAY);
- nspawn_array_setstring(args_var, 0, prog->c_str());
- nspawn_var_release(args_var);
- } else {
- // If the path does not contain a slash and we cannot find it
- // from PATH, we use NMF served with the JavaScript.
- return true;
- }
- }
- return false;
-}
-
-static bool CheckFileMagic(const std::string& filename,
- const std::string& magic) {
- int fh = open(filename.c_str(), O_RDONLY);
- if (fh < 0) {
- return false;
- }
- // Read first 4 bytes.
- char buffer[4];
- ssize_t len = read(fh, buffer, sizeof buffer);
- close(fh);
- // Decide based on the header.
- return len == 4 && memcmp(buffer, magic.c_str(), sizeof buffer) == 0;
-}
-
-// Check if a file contains finalised PNaCl bitcode
-static bool IsPNaClType(const std::string& filename) {
- return CheckFileMagic(filename, "PEXE");
-}
-
-// Check if a file contains LLVM bitcode
-static bool IsBitcode(const std::string& filename) {
- return CheckFileMagic(filename, "BC\xc0\xde");
-}
-
-// Adds a NMF to the request if |prog| is stored in HTML5 filesystem.
-static bool AddNmfToRequest(std::string prog, struct PP_Var req_var) {
- if (UseBuiltInFallback(&prog, req_var)) {
- return true;
- }
- if (access(prog.c_str(), R_OK) != 0) {
- errno = ENOENT;
- return false;
- }
-
- if (!ExpandShBang(&prog, req_var)) {
- return false;
- }
-
- // Check fallback again in case of #! expanded to something else.
- if (UseBuiltInFallback(&prog, req_var)) {
- return true;
- }
-
- bool debug = getenv("LD_DEBUG") != NULL;
-
- // Check for pnacl.
- if (IsPNaClType(prog)) {
- if (debug) {
- fprintf(stderr, "%s: loading PNaCl bitcode: %s\n",
- LOADER_NAME, prog.c_str());
- }
- AddNmfToRequestForPNaCl(prog, req_var);
- return true;
- }
-
- if (IsBitcode(prog)) {
- fprintf(stderr, "%s: cannot execute unfinalized bitcode\n", prog.c_str());
- return false;
- }
-
- std::string arch;
- std::vector<std::string> dependencies;
- if (!nspawn_find_arch_and_library_deps(prog, &arch, &dependencies))
- return false;
-
- if (!dependencies.empty()) {
- AddNmfToRequestForShared(prog, arch, dependencies, req_var);
- } else {
- // No dependencies means the main binary is statically linked.
- AddNmfToRequestForStatic(prog, arch, req_var);
- }
-
- return true;
-}
-
-static pid_t waitpid_impl(int pid, int* status, int options);
-
-// TODO(bradnelson): Add sysconf means to query this in all libc's.
-#define MAX_FILE_DESCRIPTOR 1000
-
-static int CloneFileDescriptors(struct PP_Var envs_var) {
- int fd;
- int count = 0;
-
- for (fd = 0; fd < MAX_FILE_DESCRIPTOR; ++fd) {
- struct stat st;
- if (fstat(fd, &st) < 0) {
- if (errno == EBADF) {
- continue;
- }
- return -1;
- }
- int flags = fcntl(fd, F_GETFD);
- if (flags < 0) {
- fprintf(stderr, "fcntl failed when spawning on descriptor %d: %s\n",
- fd, strerror(errno));
- return -1;
- }
- // Skip close on exec descriptors.
- if (flags & FD_CLOEXEC) {
- continue;
- }
- if (S_ISREG(st.st_mode)) {
- // TODO(bradnelson): Land nacl_io ioctl to support this.
- } else if (S_ISDIR(st.st_mode)) {
- // TODO(bradnelson): Land nacl_io ioctl to support this.
- } else if (S_ISCHR(st.st_mode)) {
- // Unsupported.
- } else if (S_ISBLK(st.st_mode)) {
- // Unsupported.
- } else if (S_ISFIFO(st.st_mode)) {
- char entry[100];
- snprintf(entry, sizeof entry,
- "NACL_SPAWN_FD_SETUP_%d=pipe:%d:%d:%d", count++, fd,
- static_cast<int>(st.st_ino), st.st_rdev == O_WRONLY);
- nspawn_array_appendstring(envs_var, entry);
- } else if (S_ISLNK(st.st_mode)) {
- // Unsupported.
- } else if (S_ISSOCK(st.st_mode)) {
- // Unsupported.
- }
- }
- return 0;
-}
-
-static void stash_file_descriptors(void) {
- int fd;
-
- for (fd = 0; fd < MAX_FILE_DESCRIPTOR; ++fd) {
- // TODO(bradnelson): Make this more robust if there are more than
- // MAX_FILE_DESCRIPTOR descriptors.
- if (dup2(fd, fd + MAX_FILE_DESCRIPTOR) < 0) {
- assert(errno == EBADF);
- continue;
- }
- }
-}
-
-static void unstash_file_descriptors(void) {
- int fd;
-
- for (fd = 0; fd < MAX_FILE_DESCRIPTOR; ++fd) {
- int alt_fd = fd + MAX_FILE_DESCRIPTOR;
- if (dup2(alt_fd, fd) < 0) {
- assert(errno == EBADF);
- continue;
- }
- close(alt_fd);
- }
-}
-
-__thread jmp_buf nacl_spawn_vfork_env;
-static __thread pid_t vfork_pid = -1;
-static __thread int vforking = 0;
-
-// Shared spawnve implementation. Declared static so that shared library
-// overrides doesn't break calls meant to be internal to this implementation.
-static int spawnve_impl(int mode,
- const char* path,
- char* const argv[],
- char* const envp[]) {
- NSPAWN_LOG("spawnve_impl: mode=%x path=%s", mode, path);
- if (NULL == path || NULL == argv[0]) {
- errno = EINVAL;
- return -1;
- }
- if (mode == P_WAIT) {
- int pid = spawnve_impl(P_NOWAIT, path, argv, envp);
- if (pid < 0) {
- return -1;
- }
- int status;
- int result = waitpid_impl(pid, &status, 0);
- if (result < 0) {
- return -1;
- }
- return status;
- } else if (mode == P_NOWAIT || mode == P_NOWAITO) {
- // The normal case.
- } else if (mode == P_OVERLAY) {
- if (vforking) {
- vfork_pid = spawnve_impl(P_NOWAIT, path, argv, envp);
- longjmp(nacl_spawn_vfork_env, 1);
- }
- // The normal case
- } else {
- errno = EINVAL;
- return -1;
- }
- if (NULL == envp) {
- envp = environ;
- }
-
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_spawn");
- if (mode == P_OVERLAY) {
- nspawn_dict_setstring(req_var, "mode", "overlay");
- }
-
- struct PP_Var args_var = nspawn_array_create();
- for (int i = 0; argv[i]; i++)
- nspawn_array_setstring(args_var, i, argv[i]);
- nspawn_dict_set(req_var, "args", args_var);
-
- struct PP_Var envs_var = nspawn_array_create();
- for (int i = 0; envp[i]; i++)
- nspawn_array_setstring(envs_var, i, envp[i]);
-
- if (CloneFileDescriptors(envs_var) < 0) {
- return -1;
- }
-
- nspawn_dict_set(req_var, "envs", envs_var);
- nspawn_dict_setstring(req_var, "cwd", GetCwd().c_str());
-
- if (!AddNmfToRequest(path, req_var)) {
- errno = ENOENT;
- return -1;
- }
-
- int pid = nspawn_dict_getint_release(nspawn_send_request(req_var), "pid");
- if (mode == P_OVERLAY) {
- // In P_OVERLAY mode, then the request cause us to be killed (removed
- // from the DOM), and replaced by that child. In this case the reply
- // will never arrive.
- NSPAWN_LOG("spawnve_impl: should never get here");
- abort();
- }
- NSPAWN_LOG("new process pid=%d\n", pid);
- return pid;
-}
-
-// Spawn a new NaCl process. This is an alias for
-// spawnve(mode, path, argv, NULL). Returns 0 on success. On error -1 is
-// returned and errno will be set appropriately.
-int spawnv(int mode, const char* path, char* const argv[]) {
- return spawnve_impl(mode, path, argv, NULL);
-}
-
-int spawnve(int mode, const char* path,
- char* const argv[], char* const envp[]) {
- return spawnve_impl(mode, path, argv, envp);
-}
-
-// Shared below by waitpid and wait.
-// Done as a static so that users that replace waitpid and call wait (gcc)
-// don't cause infinite recursion.
-static pid_t waitpid_impl(int pid, int* status, int options) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_wait");
- nspawn_dict_set(req_var, "pid", PP_MakeInt32(pid));
- nspawn_dict_set(req_var, "options", PP_MakeInt32(options));
-
- struct PP_Var result_var = nspawn_send_request(req_var);
- int result_pid = nspawn_dict_getint(result_var, "pid");
-
- // WEXITSTATUS(s) is defined as ((s >> 8) & 0xff).
- struct PP_Var status_var;
- if (nspawn_dict_has_key(result_var, "status", &status_var)) {
- int raw_status = status_var.value.as_int;
- *status = (raw_status & 0xff) << 8;
- }
- nspawn_var_release(result_var);
- return result_pid;
-}
-
-extern "C" {
-
-#if defined(__GLIBC__)
-pid_t wait(void* status) {
-#else
-pid_t wait(int* status) {
-#endif
- return waitpid_impl(-1, static_cast<int*>(status), 0);
-}
-
-// Waits for the specified pid. The semantics of this function is as
-// same as waitpid, though this implementation has some restrictions.
-// Returns 0 on success. On error -1 is returned and errno will be set
-// appropriately.
-pid_t waitpid(pid_t pid, int* status, int options) {
- return waitpid_impl(pid, status, options);
-}
-
-// BSD wait variant with rusage.
-#if defined(__BIONIC__)
-pid_t wait3(int* status, int options, struct rusage* unused_rusage) {
-#else
-pid_t wait3(void* status, int options, struct rusage* unused_rusage) {
-#endif
- return waitpid_impl(-1, static_cast<int*>(status), options);
-}
-
-// BSD wait variant with pid and rusage.
-#if defined(__BIONIC__)
-pid_t wait4(pid_t pid, int* status, int options,
- struct rusage* unused_rusage) {
-#else
-pid_t wait4(pid_t pid, void* status, int options,
- struct rusage* unused_rusage) {
-#endif
- return waitpid_impl(pid, static_cast<int*>(status), options);
-}
-
-/*
- * Fake version of getpid(). This is used if there is no
- * nspawn_ppid set and no IRT getpid interface available.
- */
-static int getpid_fake(int* pid) {
- *pid = 1;
- return 0;
-}
-
-static struct nacl_irt_dev_getpid irt_dev_getpid;
-
-/*
- * IRT version of getpid(). This is used if there is no
- * nspawn_ppid set.
- */
-static pid_t getpid_irt() {
- if (irt_dev_getpid.getpid == NULL) {
- int res = nacl_interface_query(NACL_IRT_DEV_GETPID_v0_1,
- &irt_dev_getpid,
- sizeof(irt_dev_getpid));
- if (res != sizeof(irt_dev_getpid)) {
- irt_dev_getpid.getpid = getpid_fake;
- }
- }
-
- int pid;
- int error = irt_dev_getpid.getpid(&pid);
- if (error != 0) {
- errno = error;
- return -1;
- }
- return pid;
-}
-
-// Get the process ID of the calling process.
-pid_t getpid() {
- if (nspawn_pid == -1) {
- return getpid_irt();
- }
- return nspawn_pid;
-}
-
-// Get the process ID of the parent process.
-pid_t getppid() {
- if (nspawn_ppid == -1) {
- errno = ENOSYS;
- }
- return nspawn_ppid;
-}
-
-// Spawn a process.
-int posix_spawn(
- pid_t* pid, const char* path,
- const posix_spawn_file_actions_t* file_actions,
- const posix_spawnattr_t* attrp,
- char* const argv[], char* const envp[]) {
- int ret = spawnve_impl(P_NOWAIT, path, argv, envp);
- if (ret < 0) {
- return ret;
- }
- *pid = ret;
- return 0;
-}
-
-// Spawn a process using PATH to resolve.
-int posix_spawnp(
- pid_t* pid, const char* file,
- const posix_spawn_file_actions_t* file_actions,
- const posix_spawnattr_t* attrp,
- char* const argv[], char* const envp[]) {
- // TODO(bradnelson): Make path expansion optional.
- return posix_spawn(pid, file, file_actions, attrp, argv, envp);
-}
-
-// Get the process group ID of the given process.
-pid_t getpgid(pid_t pid) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_getpgid");
- nspawn_dict_set(req_var, "pid", PP_MakeInt32(pid));
-
- return nspawn_dict_getint_release(nspawn_send_request(req_var), "pgid");
-}
-
-// Get the process group ID of the current process. This is an alias for
-// getpgid(0).
-pid_t getpgrp() {
- return getpgid(0);
-}
-
-// Set the process group ID of the given process.
-pid_t setpgid(pid_t pid, pid_t pgid) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_setpgid");
- nspawn_dict_set(req_var, "pid", PP_MakeInt32(pid));
- nspawn_dict_set(req_var, "pgid", PP_MakeInt32(pgid));
-
- return nspawn_dict_getint_release(nspawn_send_request(req_var), "result");
-}
-
-// Set the process group ID of the given process. This is an alias for
-// setpgid(0, 0).
-pid_t setpgrp() {
- return setpgid(0, 0);
-}
-
-// Get the session ID of the given process.
-pid_t getsid(pid_t pid) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_getsid");
- nspawn_dict_set(req_var, "pid", PP_MakeInt32(pid));
- return nspawn_dict_getint_release(nspawn_send_request(req_var), "sid");
-}
-
-// Make the current process a session leader.
-pid_t setsid() {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_setsid");
- return nspawn_dict_getint_release(nspawn_send_request(req_var), "sid");
-}
-
-void jseval(const char* cmd, char** data, size_t* len) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_jseval");
- nspawn_dict_setstring(req_var, "cmd", cmd);
-
- struct PP_Var result_dict_var = nspawn_send_request(req_var);
- struct PP_Var result_var = nspawn_dict_get(result_dict_var, "result");
- uint32_t result_len;
- const char* result = PSInterfaceVar()->VarToUtf8(result_var, &result_len);
- if (len) {
- *len = result_len;
- }
- if (data) {
- *data = static_cast<char*>(malloc(result_len + 1));
- assert(*data);
- memcpy(*data, result, result_len);
- (*data)[result_len] = '\0';
- }
- nspawn_var_release(result_var);
- nspawn_var_release(result_dict_var);
-}
-
-// Create a javascript pipe. pipefd[0] will be the read end of the pipe
-// and pipefd[1] the write end of the pipe.
-int nacl_spawn_pipe(int pipefd[2]) {
- if (pipefd == NULL) {
- errno = EFAULT;
- return -1;
- }
-
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_apipe");
-
- struct PP_Var result_var = nspawn_send_request(req_var);
- int id = nspawn_dict_getint(result_var, "pipe_id");
- nspawn_var_release(result_var);
-
- int read_fd;
- int write_fd;
- char path[100];
- sprintf(path, "/apipe/%d", id);
- read_fd = open(path, O_RDONLY);
- write_fd = open(path, O_WRONLY);
- if (read_fd < 0 || write_fd < 0) {
- if (read_fd >= 0) {
- close(read_fd);
- }
- if (write_fd >= 0) {
- close(write_fd);
- }
- return -1;
- }
- pipefd[0] = read_fd;
- pipefd[1] = write_fd;
-
- return 0;
-}
-
-void nacl_spawn_vfork_before(void) {
- assert(!vforking);
- vforking = 1;
- stash_file_descriptors();
-}
-
-pid_t nacl_spawn_vfork_after(int jmping) {
- if (jmping) {
- unstash_file_descriptors();
- vforking = 0;
- return vfork_pid;
- }
- return 0;
-}
-
-void nacl_spawn_vfork_exit(int status) {
- if (vforking) {
- struct PP_Var req_var = nspawn_dict_create();
- nspawn_dict_setstring(req_var, "command", "nacl_deadpid");
- nspawn_dict_set(req_var, "status", PP_MakeInt32(status));
-
- struct PP_Var response_var = nspawn_send_request(req_var);
- int result = nspawn_dict_getint_release(response_var, "pid");
- if (result < 0) {
- errno = -result;
- vfork_pid = -1;
- } else {
- vfork_pid = result;
- }
- longjmp(nacl_spawn_vfork_env, 1);
- } else {
- _exit(status);
- }
-}
-
-#define VARG_TO_ARGV_START \
- va_list vl; \
- va_start(vl, arg); \
- va_list vl_count; \
- va_copy(vl_count, vl); \
- int count = 1; \
- while (va_arg(vl_count, char*)) { \
- ++count; \
- } \
- va_end(vl_count); \
- /* Copying all the args into argv plus a trailing NULL */ \
- char** argv = static_cast<char**>(alloca(sizeof(char *) * (count + 1))); \
- argv[0] = const_cast<char*>(arg); \
- for (int i = 1; i <= count; i++) { \
- argv[i] = va_arg(vl, char*); \
- }
-
-#define VARG_TO_ARGV \
- VARG_TO_ARGV_START; \
- va_end(vl);
-
-#define VARG_TO_ARGV_ENVP \
- VARG_TO_ARGV_START; \
- char* const* envp = va_arg(vl, char* const*); \
- va_end(vl);
-
-int execve(const char *filename, char *const argv[], char *const envp[]) {
- NSPAWN_LOG("execve: %s", filename);
- return spawnve_impl(P_OVERLAY, filename, argv, envp);
-}
-
-int execv(const char *path, char *const argv[]) {
- NSPAWN_LOG("execv: %s", path);
- return spawnve_impl(P_OVERLAY, path, argv, environ);
-}
-
-int execvp(const char *file, char *const argv[]) {
- NSPAWN_LOG("execvp: %s", file);
- // TODO(bradnelson): Limit path resolution to 'p' variants.
- return spawnve_impl(P_OVERLAY, file, argv, environ);
-}
-
-int execvpe(const char *file, char *const argv[], char *const envp[]) {
- NSPAWN_LOG("execvpe: %s", file);
- // TODO(bradnelson): Limit path resolution to 'p' variants.
- return spawnve_impl(P_OVERLAY, file, argv, envp);
-}
-
-int execl(const char *path, const char *arg, ...) {
- NSPAWN_LOG("execl: %s", path);
- VARG_TO_ARGV;
- return spawnve_impl(P_OVERLAY, path, argv, environ);
-}
-
-int execlp(const char *file, const char *arg, ...) {
- NSPAWN_LOG("execlp: %s", file);
- VARG_TO_ARGV;
- // TODO(bradnelson): Limit path resolution to 'p' variants.
- return spawnve_impl(P_OVERLAY, file, argv, environ);
-}
-
-int execle(const char *path, const char *arg, ...) { /* char* const envp[] */
- NSPAWN_LOG("execle: %s", path);
- VARG_TO_ARGV_ENVP;
- return spawnve_impl(P_OVERLAY, path, argv, envp);
-}
-
-int execlpe(const char *path, const char *arg, ...) { /* char* const envp[] */
- NSPAWN_LOG("execlpe: %s", path);
- VARG_TO_ARGV_ENVP;
- // TODO(bradnelson): Limit path resolution to 'p' variants.
- return spawnve_impl(P_OVERLAY, path, argv, envp);
-}
-
-}; // extern "C"
diff --git a/ports/nacl-spawn/nacl_spawn_test.cc b/ports/nacl-spawn/nacl_spawn_test.cc
deleted file mode 100644
index 32c8df5..0000000
--- a/ports/nacl-spawn/nacl_spawn_test.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2015 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.
-
-#include "gtest/gtest.h"
-
-// These unittests should be run in the sel_ldr. In this mode
-// nacl_io should not be initialized since we want direct access
-// to the real filesystem. Verify this by checking the value
-// or getcwd()
-TEST(NaClSpawn, test_nacl_io_not_initialized) {
- const char* cwd = getcwd(NULL, 0);
- printf("cwd: %s\n", cwd);
- ASSERT_NE((char*)NULL, strstr(cwd, "out/build/nacl-spawn"));
-}
-
-extern bool _cli_main_init;
-
-TEST(NaClSpawn, test_cli_main_called) {
- ASSERT_EQ(true, _cli_main_init);
-}
-
-int main(int argc, char** argv) {
- setenv("TERM", "xterm-256color", 0);
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/ports/nacl-spawn/nacl_startup_untar.c b/ports/nacl-spawn/nacl_startup_untar.c
deleted file mode 100644
index 3267c61..0000000
--- a/ports/nacl-spawn/nacl_startup_untar.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-#include "nacl_main.h"
-
-#include <assert.h>
-#include <fcntl.h>
-#include <libtar.h>
-#include <limits.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "ppapi_simple/ps.h"
-
-#define MAX_HASH_LEN (10 * 1024)
-
-struct hashfiles {
- char expected[PATH_MAX];
- char installed[PATH_MAX];
-};
-
-/*
- * Read file contents into buffer, and return number of bytes read.
- */
-static ssize_t read_file(const char* filename, char* buffer, int buffer_len) {
- ssize_t bytes_read = 0;
- FILE* f = fopen(filename, "r");
- if (!f)
- return -1;
- while (bytes_read < buffer_len) {
- int read = fread(buffer + bytes_read, 1, buffer_len - bytes_read, f);
- if (read == 0) {
- if (!feof(f)) {
- fclose(f);
- return -1;
- }
- break;
- }
- bytes_read += read;
- }
- fclose(f);
- return bytes_read;
-}
-
-/*
- * Write file, and return number of bytes read.
- */
-static ssize_t write_file(const char* filename, char* buffer, int buffer_len) {
- ssize_t bytes_written = 0;
- FILE* f = fopen(filename, "w");
- if (!f)
- return -1;
- while (bytes_written < buffer_len) {
- int written = fwrite(buffer + bytes_written, 1,
- buffer_len - bytes_written, f);
- if (written == 0) {
- fclose(f);
- return -1;
- }
- bytes_written += written;
- }
- fclose(f);
- return bytes_written;
-}
-
-static void copy_hashfile(struct hashfiles* files) {
- char buffer[MAX_HASH_LEN];
- int len = read_file(files->expected, buffer, MAX_HASH_LEN);
- if (len == -1) {
- return;
- }
- NACL_LOG("nacl_startup_untar: writing hash: %s\n", files->installed);
- write_file(files->installed, buffer, len);
-}
-
-/*
- * Return true is the given tarfile has already been extracted
- * to the given location. This is done by checking for the
- * existence of <tarfile>.hash, and then comparing it to
- * <root>/<tarfile>.installed_hash. If either of these does
- * not exist, or if the content does not match then we assume
- * the tarfile needs to be extracted.
- */
-static bool already_extracted(struct hashfiles* files) {
- char expected_hash[MAX_HASH_LEN];
- char installed_hash[MAX_HASH_LEN];
- ssize_t hash_len = read_file(files->expected, expected_hash, MAX_HASH_LEN);
- if (hash_len == -1) {
- // hash file could not be read
- NACL_LOG("nacl_startup_untar: hash file not found: %s\n", files->expected);
- return false;
- }
-
- if (read_file(files->installed, installed_hash, MAX_HASH_LEN) != hash_len) {
- // either installed hash could not be read, or size doesn't match.
- NACL_LOG("nacl_startup_untar: installed hash not found: %s\n",
- files->installed);
- return false;
- }
-
- if (strncmp(expected_hash, installed_hash, hash_len) != 0) {
- NACL_LOG("nacl_startup_untar: hash mismatch\n");
- return false;
- }
-
- return true;
-}
-
-int nacl_startup_untar(const char* argv0,
- const char* tarfile,
- const char* root) {
- int ret;
- TAR* tar;
- char filename[PATH_MAX];
- char* pos;
- struct stat statbuf;
- struct hashfiles files;
-
- if (PSGetInstanceId() == 0) {
- NACL_LOG("nacl_startup_untar: skipping untar; running in sel_ldr\n");
- return 0;
- }
-
- if (getenv("NACL_DEVENV") != NULL) {
- NACL_LOG("nacl_startup_untar: running in NaCl Dev Env\n");
- return 0;
- }
-
- NACL_LOG("nacl_startup_untar[%s]: %s -> %s\n", argv0, tarfile, root);
-
- /* First try relative to argv[0]. */
- strcpy(filename, argv0);
- pos = strrchr(filename, '/');
- if (pos) {
- pos[1] = '\0';
- } else {
- filename[0] = '\0';
- }
- strcat(filename, tarfile);
- if (stat(filename, &statbuf) != 0) {
- /* Fallback to /mnt/http. */
- strcpy(filename, "/mnt/http/");
- strcat(filename, tarfile);
- }
-
- strcpy(files.expected, filename);
- strcat(files.expected, ".hash");
-
- const char* basename = strrchr(filename, '/');
- if (!basename)
- basename = tarfile;
-
- strcpy(files.installed, root);
- strcat(files.installed, basename);
- strcat(files.installed, ".hash");
-
- if (already_extracted(&files)) {
- NACL_LOG("nacl_startup_untar: tar file already extracted: %s\n", filename);
- return 0;
- }
-
- ret = tar_open(&tar, filename, NULL, O_RDONLY, 0, 0);
- if (ret) {
- fprintf(stderr, "nacl_startup_untar: error opening %s\n", filename);
- return 1;
- }
-
- ret = tar_extract_all(tar, (char*)root);
- if (ret) {
- fprintf(stderr, "nacl_startup_untar: error extracting %s\n", filename);
- return 1;
- }
-
- ret = tar_close(tar);
- assert(ret == 0);
-
- copy_hashfile(&files);
- return 0;
-}
diff --git a/ports/nacl-spawn/path_util.cc b/ports/nacl-spawn/path_util.cc
deleted file mode 100644
index 8222c4e..0000000
--- a/ports/nacl-spawn/path_util.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2014 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.
-
-#include "path_util.h"
-
-#include <unistd.h>
-
-void nspawn_get_paths(const char* env, std::vector<std::string>* paths) {
- if (!env || !*env)
- return;
- for (const char* p = env; *p; p++) {
- if (*p == ':') {
- if (p == env)
- paths->push_back(".");
- else
- paths->push_back(std::string(env, p));
- env = p + 1;
- }
- }
- paths->push_back(env);
-}
-
-bool nspawn_find_in_paths(const std::string& basename,
- const std::vector<std::string>& paths,
- std::string* out_path) {
- for (size_t i = 0; i < paths.size(); i++) {
- const std::string path = paths[i] + '/' + basename;
- // We use this function for executables and shared objects, so
- // ideally we should use X_OK instead of R_OK. As nacl_io does not
- // support permissions well, we use R_OK for now.
- if (access(path.c_str(), R_OK) == 0) {
- *out_path = path;
- return true;
- }
- }
- return false;
-}
diff --git a/ports/nacl-spawn/pkg_info b/ports/nacl-spawn/pkg_info
deleted file mode 100644
index c85d8e0..0000000
--- a/ports/nacl-spawn/pkg_info
+++ /dev/null
@@ -1,3 +0,0 @@
-NAME=nacl-spawn
-VERSION=0.1
-DEPENDS=(corelibs glibc-compat libtar gtest)
diff --git a/ports/nacl-spawn/test/libtest1.c b/ports/nacl-spawn/test/libtest1.c
deleted file mode 100644
index 1009f94..0000000
--- a/ports/nacl-spawn/test/libtest1.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2014 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.
-
-void foo3();
-void foo1() {
- foo3();
-}
\ No newline at end of file
diff --git a/ports/nacl-spawn/test/libtest2.c b/ports/nacl-spawn/test/libtest2.c
deleted file mode 100644
index c5fe4f6..0000000
--- a/ports/nacl-spawn/test/libtest2.c
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2014 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.
-
-void foo3();
-void foo2() {
- foo3();
-}
\ No newline at end of file
diff --git a/ports/nacl-spawn/test/libtest3.c b/ports/nacl-spawn/test/libtest3.c
deleted file mode 100644
index b206f09..0000000
--- a/ports/nacl-spawn/test/libtest3.c
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright (c) 2014 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.
-
-void foo3() {
-}
\ No newline at end of file
diff --git a/ports/nacl-spawn/test/run_test.sh b/ports/nacl-spawn/test/run_test.sh
deleted file mode 100755
index 65b534a..0000000
--- a/ports/nacl-spawn/test/run_test.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2014 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.
-
-set -eu
-
-cd $(dirname $0)
-
-# Compares the first string argument with the result of a command
-# specified by the second argument. All line breaks in the command
-# output will be replaced by whitespaces.
-AssertCommandResultEquals() {
- local expected="$1"
- local command="$2"
- echo "[ RUN ] $command"
- local actual="$(python ${NACL_SDK_ROOT}/tools/sel_ldr.py ${command})"
- if [ "x${expected}" != "x${actual}" ]; then
- echo "command failed: $command"
- echo " expected=$expected"
- echo " actual=$actual"
- exit 1
- fi
- echo "[ PASSED ]"
-}
-
-# test_exe depends on libtest1.so and libtest2.so.
-# libtest1.so depends on libtest3.so.
-# libtest2.so also depends on libtest3.so.
-# libtest3.so depends on nothing.
-
-AssertCommandResultEquals "" "./elf_reader libtest3.so"
-AssertCommandResultEquals "libtest3.so" "./elf_reader libtest2.so"
-AssertCommandResultEquals "libtest1.so libtest2.so" "./elf_reader test_exe"
-AssertCommandResultEquals "libtest3.so" "./library_dependencies libtest3.so"
-AssertCommandResultEquals "./libtest3.so libtest1.so" \
- "./library_dependencies libtest1.so"
-AssertCommandResultEquals \
- "./libtest1.so ./libtest2.so ./libtest3.so test_exe" \
- "./library_dependencies test_exe"
diff --git a/ports/nacl-spawn/test/test_exe.c b/ports/nacl-spawn/test/test_exe.c
deleted file mode 100644
index 5d68542..0000000
--- a/ports/nacl-spawn/test/test_exe.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2014 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.
-
-void foo1();
-void foo2();
-void _start() {
- foo1();
- foo2();
-}
diff --git a/ports/nano/build.sh b/ports/nano/build.sh
deleted file mode 100644
index a4581f4..0000000
--- a/ports/nano/build.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright (c) 2013 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.
-
-NACLPORTS_LIBS+=" -lncurses"
-EXECUTABLES=src/nano${NACL_EXEEXT}
-
-EnableGlibcCompat
-EnableCliMain
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- EXTRA_CONFIGURE_ARGS="--enable-tiny"
-fi
-
-InstallStep() {
- DefaultInstallStep
- # The nano build results in a dangling symlink (symlink doesn't honor the
- # EXEEXT). We don't care about rnano anyway, so just remove it.
- LogExecute rm ${DESTDIR}${PREFIX}/bin/rnano
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
-
- LogExecute cp src/nano${NACL_EXEEXT} \
- "${PUBLISH_DIR}/nano_${NACL_ARCH}${NACL_EXEEXT}"
-
- rm -rf ${PUBLISH_DIR}/nanotar
- MakeDir ${PUBLISH_DIR}/nanotar/usr
- ChangeDir ${PUBLISH_DIR}/nanotar
- LogExecute cp -a ${DESTDIR}${PREFIX}/share usr/
- tar cf ${PUBLISH_DIR}/nano.tar .
- shasum ${PUBLISH_DIR}/nano.tar > ${PUBLISH_DIR}/nano.tar.hash
- rm -rf ${PUBLISH_DIR}/nanotar
-
- cd ${PUBLISH_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- nano_*${NACL_EXEEXT} \
- -s . \
- -o nano.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py nano.nmf
-
- InstallNaClTerm ${PUBLISH_DIR}
-
- GenerateManifest ${START_DIR}/manifest.json ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip nano-${VERSION}.zip .
-}
diff --git a/ports/nano/icon_128.png b/ports/nano/icon_128.png
deleted file mode 100644
index 3d64fe2..0000000
--- a/ports/nano/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/nano/icon_16.png b/ports/nano/icon_16.png
deleted file mode 100644
index 18a9194..0000000
--- a/ports/nano/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/nano/icon_48.png b/ports/nano/icon_48.png
deleted file mode 100644
index 4e09775..0000000
--- a/ports/nano/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/nano/manifest.json b/ports/nano/manifest.json
deleted file mode 100644
index c1772b9..0000000
--- a/ports/nano/manifest.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "Nano",
- "description": "Nano console application running using NativeClient",
- "version": "2.2.6.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "launch": {
- "local_path": "nano.html"
- }
- },
- "file_handlers": {
- "edit": {
- "types": [
- "text/*"
- ],
- "extensions": [
- "json",
- "txt",
- "js",
- "html",
- "h",
- "c",
- "cc",
- "cpp",
- "java"
- ],
- "title": "Edit with Nano"
- }
- },
- "permissions": [
- {"fileSystem": ["write"]},
- "clipboardRead",
- "clipboardWrite",
- "storage",
- "unlimitedStorage"
- ]
-}
diff --git a/ports/nano/nacl.patch b/ports/nano/nacl.patch
deleted file mode 100644
index afff8cd..0000000
--- a/ports/nano/nacl.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -286,7 +286,7 @@ clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
- nano$(EXEEXT): $(nano_OBJECTS) $(nano_DEPENDENCIES)
- @rm -f nano$(EXEEXT)
-- $(LINK) $(nano_OBJECTS) $(nano_LDADD) $(LIBS)
-+ $(LINK) $(nano_OBJECTS) $(nano_LDADD) $(LIBS) $(EXTRA_LIBS)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-diff --git a/src/nano.c b/src/nano.c
---- a/src/nano.c
-+++ b/src/nano.c
-@@ -1279,6 +1279,14 @@ RETSIGTYPE handle_sigwinch(int signal)
- LINES = win.ws_row;
- #endif
-
-+#ifndef __native_client__
-+ // NaCl's signal hanlder currently runs on the main PPAPI thread
-+ // but nano expects it to run on the nano thread and be able to
-+ // redraw the script from within the handler, which is currently
-+ // no supported.
-+ return;
-+#endif
-+
- /* If we've partitioned the filestruct, unpartition it now. */
- if (filepart != NULL)
- unpartition_filestruct(&filepart);
-@@ -2013,8 +2021,17 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
- update_line(openfile->current, openfile->current_x);
- }
-
-+#ifdef __native_client__
-+#include "nacl_main.h"
-+#endif
-+
- int main(int argc, char **argv)
- {
-+#ifdef __native_client__
-+ if (nacl_startup_untar(argv[0], "nano.tar", "/"))
-+ return 1;
-+#endif
-+
- int optchr;
- ssize_t startline = 1;
- /* Line to try and start at. */
diff --git a/ports/nano/pkg_info b/ports/nano/pkg_info
deleted file mode 100644
index 537062e..0000000
--- a/ports/nano/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=nano
-VERSION=2.2.6
-URL=http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz
-LICENSE=GPL
-DEPENDS=(ncurses libtar glibc-compat nacl-spawn)
-# missing getpwent/endpwent/getpwuid/sigsetjmp/ttyname
-SHA1=f2a628394f8dda1b9f28c7e7b89ccb9a6dbd302a
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/ncurses/build.sh b/ports/ncurses/build.sh
deleted file mode 100644
index 232b837..0000000
--- a/ports/ncurses/build.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-EXECUTABLES="progs/clear${NACL_EXEEXT}"
-
-EXTRA_CONFIGURE_ARGS+=" --disable-database"
-EXTRA_CONFIGURE_ARGS+=" --with-fallbacks=xterm-256color,vt100"
-EXTRA_CONFIGURE_ARGS+=" --disable-termcap"
-# Without this ncurses headers will be installed include/ncurses
-EXTRA_CONFIGURE_ARGS+=" --enable-overwrite"
-EXTRA_CONFIGURE_ARGS+=" --without-ada"
-
-if [ "${NACL_SHARED}" = 1 ]; then
- EXTRA_CONFIGURE_ARGS+=" --with-shared"
-fi
-
-if [ "${TOOLCHAIN}" = "pnacl" ]; then
- EXTRA_CONFIGURE_ARGS+=" --without-cxx-binding"
-fi
-
-
-EnableGlibcCompat
-
-export cf_cv_ar_flags=${NACL_ARFLAGS}
-NACL_ARFLAGS=""
-
-if [[ ${TOOLCHAIN} == emscripten ]]; then
- export cf_cv_posix_c_source=no
-fi
-
-if [[ ${TOOLCHAIN} == glibc ]]; then
- export ac_cv_func_sigvec=no
-fi
-
-InstallStep() {
- DefaultInstallStep
- ChangeDir ${DESTDIR_LIB}
- LogExecute ln -sf libncurses.a libtermcap.a
-}
diff --git a/ports/ncurses/nacl.patch b/ports/ncurses/nacl.patch
deleted file mode 100644
index 057b5b0..0000000
--- a/ports/ncurses/nacl.patch
+++ /dev/null
@@ -1,195 +0,0 @@
-diff --git a/c++/cursesf.h b/c++/cursesf.h
---- a/c++/cursesf.h
-+++ b/c++/cursesf.h
-@@ -681,7 +681,7 @@ public:
- const T* p_UserData = STATIC_CAST(T*)(0),
- bool with_frame=FALSE,
- bool autoDelete_Fields=FALSE)
-- : NCursesForm (Fields, with_frame, autoDelete_Fields) {
-+ : NCursesForm (&Fields, with_frame, autoDelete_Fields) {
- if (form)
- set_user (const_cast<void *>(p_UserData));
- };
-@@ -694,7 +694,7 @@ public:
- const T* p_UserData = STATIC_CAST(T*)(0),
- bool with_frame=FALSE,
- bool autoDelete_Fields=FALSE)
-- : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
-+ : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x,
- with_frame, autoDelete_Fields) {
- if (form)
- set_user (const_cast<void *>(p_UserData));
-diff --git a/c++/cursesm.h b/c++/cursesm.h
---- a/c++/cursesm.h
-+++ b/c++/cursesm.h
-@@ -639,7 +639,7 @@ public:
- const T* p_UserData = STATIC_CAST(T*)(0),
- bool with_frame=FALSE,
- bool autoDelete_Items=FALSE)
-- : NCursesMenu (Items, with_frame, autoDelete_Items) {
-+ : NCursesMenu (&Items, with_frame, autoDelete_Items) {
- if (menu)
- set_user (const_cast<void *>(p_UserData));
- };
-@@ -651,7 +651,7 @@ public:
- int begin_x = 0,
- const T* p_UserData = STATIC_CAST(T*)(0),
- bool with_frame=FALSE)
-- : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
-+ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) {
- if (menu)
- set_user (const_cast<void *>(p_UserData));
- };
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -5400,7 +5400,7 @@ irix*) #(vi
- LD_RPATH_OPT="-rpath "
- fi
- ;;
--linux*|gnu*|k*bsd*-gnu) #(vi
-+linux*|gnu*|nacl*|k*bsd*-gnu) #(vi
- LD_RPATH_OPT="-Wl,-rpath,"
- ;;
- openbsd[2-9].*) #(vi
-@@ -5662,7 +5662,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
- fi
- cf_cv_rm_so_locs=yes
- ;;
-- linux*|gnu*|k*bsd*-gnu) #(vi
-+ linux*|gnu*|nacl*|k*bsd*-gnu) #(vi
- if test "$DFT_LWR_MODEL" = "shared" ; then
- LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
- LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-@@ -18894,8 +18894,8 @@ if test "$GCC" = yes ; then
- LDFLAGS_SHARED=
- ;;
- *) #( normally, except when broken
-- LDFLAGS_STATIC=-static
-- LDFLAGS_SHARED=-dynamic
-+ LDFLAGS_STATIC=-Bstatic
-+ LDFLAGS_SHARED=-Bdynamic
- ;;
- esac
- else
-@@ -18948,7 +18948,7 @@ EOF
-
- cf_save_LIBS="$LIBS"
-
-- LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS"
-+ LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_SHARED $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- #line 18953 "configure"
- #include "confdefs.h"
-diff --git a/form/fty_num.c b/form/fty_num.c
---- a/form/fty_num.c
-+++ b/form/fty_num.c
-@@ -40,7 +40,7 @@ MODULE_ID("$Id: fty_num.c,v 1.28 2010/01/23 21:14:36 tom Exp $")
- #include <locale.h>
- #endif
-
--#if HAVE_LOCALE_H
-+#if HAVE_LOCALE_H && (!defined(__native_client__) || !defined(__BIONIC__))
- #define isDecimalPoint(c) ((c) == ((L && L->decimal_point) ? *(L->decimal_point) : '.'))
- #else
- #define isDecimalPoint(c) ((c) == '.')
-@@ -96,7 +96,7 @@ Generic_This_Type(void *arg)
- argn->low = args->low;
- argn->high = args->high;
-
--#if HAVE_LOCALE_H
-+#if HAVE_LOCALE_H && (!defined(__native_client__) || !defined(__BIONIC__))
- argn->L = localeconv();
- #else
- argn->L = NULL;
-diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c
---- a/ncurses/tinfo/lib_baudrate.c
-+++ b/ncurses/tinfo/lib_baudrate.c
-@@ -219,11 +219,17 @@ NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0)
-
- if (IsValidTIScreen(SP_PARM)) {
- #ifdef USE_OLD_TTY
-+#if defined(__native_client__)
-+ ospeed = 0;
-+#else
- result = cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb));
- ospeed = _nc_ospeed(result);
-+#endif
- #else /* !USE_OLD_TTY */
- #ifdef TERMIOS
-+#if !defined(__native_client__)
- ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb));
-+#endif
- #else
- ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed;
- #endif
-diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c
---- a/ncurses/tinfo/lib_kernel.c
-+++ b/ncurses/tinfo/lib_kernel.c
-@@ -57,7 +57,7 @@ _nc_vdisable(void)
- #if defined(_POSIX_VDISABLE) && HAVE_UNISTD_H
- value = _POSIX_VDISABLE;
- #endif
--#if defined(_PC_VDISABLE)
-+#if defined(_PC_VDISABLE) && !defined(__native_client__)
- if (value == -1) {
- value = (int) fpathconf(0, _PC_VDISABLE);
- if (value == -1) {
-diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c
---- a/ncurses/tty/lib_twait.c
-+++ b/ncurses/tty/lib_twait.c
-@@ -66,7 +66,10 @@
- # endif
- #endif
- #ifdef __MINGW32__
--# include <sys/time.h>
-+# include <sys/time.h>
-+#endif
-+#ifdef __native_client__
-+# include <sys/time.h>
- #endif
- #undef CUR
-
-diff --git a/progs/tset.c b/progs/tset.c
---- a/progs/tset.c
-+++ b/progs/tset.c
-@@ -583,7 +583,11 @@ get_termcap_entry(char *userarg)
- if ((ttype = getenv("TERM")) != 0)
- goto map;
-
-+#if defined(__native_client__) && defined(__BIONIC__)
-+ {
-+#else
- if ((ttypath = ttyname(STDERR_FILENO)) != 0) {
-+#endif
- p = _nc_basename(ttypath);
- #if HAVE_GETTTYNAM
- /*
-@@ -1260,7 +1264,11 @@ main(int argc, char **argv)
- can_restore = TRUE;
- original = oldmode = mode;
- #ifdef TERMIOS
-+#if defined(__native_client__)
-+ ospeed = 0;
-+#else
- ospeed = (NCURSES_OSPEED) cfgetospeed(&mode);
-+#endif
- #else
- ospeed = (NCURSES_OSPEED) mode.sg_ospeed;
- #endif
-diff --git a/test/bs.c b/test/bs.c
---- a/test/bs.c
-+++ b/test/bs.c
-@@ -220,10 +220,12 @@ intro(void)
-
- CATCHALL(uninitgame);
-
-+#if !(defined(__native_client__) && (defined(__BIONIC__) || defined(__GLIBC__)))
- if ((tmpname = getlogin()) != 0) {
- (void) strcpy(name, tmpname);
- name[0] = (char) toupper(UChar(name[0]));
- } else
-+#endif
- (void) strcpy(name, dftname);
-
- (void) initscr();
diff --git a/ports/ncurses/pkg_info b/ports/ncurses/pkg_info
deleted file mode 100644
index 519ec50..0000000
--- a/ports/ncurses/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=ncurses
-VERSION=5.9
-URL=ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
-LICENSE=CUSTOM
-DEPENDS=(glibc-compat)
-SHA1=3e042e5f2c7223bffdaac9646a533b8c758b65b5
diff --git a/ports/netcat/build.sh b/ports/netcat/build.sh
deleted file mode 100644
index 7452278..0000000
--- a/ports/netcat/build.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
-
-BuildStep() {
- # netcat's configure script doesn't check for CXX but we patch
- # the Makefile to use it, so we need to it be defined at make
- # time
- export CXX=${NACLCXX}
- DefaultBuildStep
-}
diff --git a/ports/netcat/nacl.patch b/ports/netcat/nacl.patch
deleted file mode 100644
index 8a41da8..0000000
--- a/ports/netcat/nacl.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -161,6 +161,7 @@ netcat_SOURCES = \
-
-
- netcat_LDADD = @CONTRIBLIBS@ @INTLLIBS@
-+netcat_PPAPI = -lppapi_simple -lnacl_io -lppapi
-
- EXTRA_DIST = *.h
-
-@@ -188,7 +189,7 @@ depcomp =
- am__depfiles_maybe =
- COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
--CCLD = $(CC)
-+CCLD = $(CXX)
- LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- DIST_SOURCES = $(netcat_SOURCES)
- DIST_COMMON = Makefile.am Makefile.in
-@@ -229,7 +230,7 @@ clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
- netcat$(EXEEXT): $(netcat_OBJECTS) $(netcat_DEPENDENCIES)
- @rm -f netcat$(EXEEXT)
-- $(LINK) $(netcat_LDFLAGS) $(netcat_OBJECTS) $(netcat_LDADD) $(LIBS)
-+ $(LINK) $(netcat_LDFLAGS) $(netcat_OBJECTS) $(netcat_LDADD) $(LIBS) $(netcat_PPAPI)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-diff --git a/src/flagset.c b/src/flagset.c
---- a/src/flagset.c
-+++ b/src/flagset.c
-@@ -169,7 +169,7 @@ int netcat_flag_count(void)
-
- unsigned short netcat_flag_rand(void)
- {
-- int rand, randmax = netcat_flag_count() - 1;
-+ int randv, randmax = netcat_flag_count() - 1;
- unsigned short ret = 0;
-
- assert(flagset);
-@@ -180,16 +180,16 @@ unsigned short netcat_flag_rand(void)
-
- #ifdef USE_RANDOM
- /* fetch a random number from the high-order bits */
-- rand = 1 + (int) ((float)randmax * RAND() / (RAND_MAX + 1.0));
-+ randv = 1 + (int) ((float)randmax * RAND() / (RAND_MAX + 1.0));
- #else
- # ifdef __GNUC__
- # warning "random routines not found, removed random support"
- # endif
-- rand = 1; /* simulates a random number */
-+ randv = 1; /* simulates a random number */
- #endif
-
- /* loop until we find the specified flag */
-- while (rand--)
-+ while (randv--)
- ret = netcat_flag_next(ret);
-
- /* don't return this same flag again */
-diff --git a/src/udphelper.c b/src/udphelper.c
---- a/src/udphelper.c
-+++ b/src/udphelper.c
-@@ -30,7 +30,9 @@
-
- #ifndef USE_PKTINFO
- #include <sys/ioctl.h>
--#include <net/if.h>
-+#if !defined(__native_client__) || defined(__GLIBC__)
-+# include <net/if.h>
-+#endif
- #ifdef HAVE_SYS_SOCKIO_H
- #include <sys/sockio.h>
- #endif
-@@ -109,6 +111,13 @@ int udphelper_ancillary_read(struct msghdr *my_hdr,
-
- int udphelper_sockets_open(int **sockbuf, in_port_t nport)
- {
-+#if defined(__native_client__)
-+ /*
-+ * TODO(bradnelson): figure out if nacl_io can support these calls.
-+ */
-+ errno = ENOSYS;
-+ return -1;
-+#else
- int ret, i, alloc_size, dummy_sock, if_total = 1;
- int *my_sockbuf = NULL, my_sockbuf_max = 0, sock_total = 0;
- unsigned int if_pos = 0;
-@@ -279,6 +288,7 @@ int udphelper_sockets_open(int **sockbuf, in_port_t nport)
- errno = ret;
-
- return -1;
-+#endif
- }
-
- #endif /* USE_PKTINFO */
diff --git a/ports/netcat/pkg_info b/ports/netcat/pkg_info
deleted file mode 100644
index 289979e..0000000
--- a/ports/netcat/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=netcat
-VERSION=0.7.1
-URL=http://sf.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-SHA1=b761d70fe9e3e8b3fe33a329b9bc31300dc04d11
diff --git a/ports/nethack/build.sh b/ports/nethack/build.sh
deleted file mode 100644
index e40a572..0000000
--- a/ports/nethack/build.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-# 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.
-
-BUILD_DIR=${SRC_DIR}
-EXECUTABLES=src/nethack
-
-BuildStep() {
- SetupCrossEnvironment
-
- # NOTE: we are using the non-standard vars NACL_CCFLAGS/NACL_LDFLAGS
- # because we are not running ./configure and the Makefile was hacked
- export NACL_CCFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export NACL_LDFLAGS="${NACLPORTS_LDFLAGS}"
- export WINTTYLIB="-lncurses ${NACL_CLI_MAIN_LIB}"
- if [ "${NACL_LIBC}" = "newlib" ]; then
- export WINTTYLIB="${WINTTYLIB} -lglibc-compat"
- export NACL_CCFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
- fi
-
- export NACLPORTS_INCLUDE
- export STRNCMPI=1
- cp ${START_DIR}/nethack_pepper.c ${SRC_DIR}/src
- LogExecute bash sys/unix/setup.sh
- LogExecute make
-}
-
-InstallStep() {
- ChangeDir ${SRC_DIR}
-
- make install
-
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/nethack"
- MakeDir ${ASSEMBLY_DIR}
- cp ${SRC_DIR}/out/games/lib/nethackdir/nethack \
- ${ASSEMBLY_DIR}/nethack_${NACL_ARCH}${NACL_EXEEXT}
- ChangeDir ${SRC_DIR}/out/games
- LogExecute rm ${SRC_DIR}/out/games/lib/nethackdir/nethack
- LogExecute tar cf ${ASSEMBLY_DIR}/nethack.tar lib
-
- pushd ${ASSEMBLY_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- nethack_*${NACL_EXEEXT} \
- -s . \
- -o nethack.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py nethack.nmf
- popd
- # Create a copy of nethack for debugging.
- LogExecute cp ${ASSEMBLY_DIR}/nethack.nmf ${ASSEMBLY_DIR}/nethack_debug.nmf
- sed 's/nethack\.js/nethack_debug.js/' \
- ${ASSEMBLY_DIR}/nethack.html > ${ASSEMBLY_DIR}/nethack_debug.html
- sed 's/nethack\.nmf/nethack_debug.nmf/' \
- ${ASSEMBLY_DIR}/nethack.js > ${ASSEMBLY_DIR}/nethack_debug.js
-
- # Uncomment these lines to copy over source tree as a gdb sample.
- # Do not submit otherwise nethack source tree will be uploaded to
- # along with the rest of the 'out/publish' tree.
- #local ASSEMBLY_SRC_DIR="${PUBLISH_DIR}/nethack_src"
- #LogExecute rm -rf ${ASSEMBLY_SRC_DIR}
- #LogExecute cp -r ${SRC_DIR} ${ASSEMBLY_SRC_DIR}
-
- local MANIFEST_PATH="${PUBLISH_DIR}/nethack.manifest"
- LogExecute rm -f ${MANIFEST_PATH}
- pushd ${PUBLISH_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/genhttpfs.py \
- -r -o /tmp/nethack_manifest.tmp .
- LogExecute cp /tmp/nethack_manifest.tmp ${MANIFEST_PATH}
- popd
-
- InstallNaClTerm ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR}
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip nethack-${VERSION}.zip nethack
-}
diff --git a/ports/nethack/icon_128.png b/ports/nethack/icon_128.png
deleted file mode 100644
index 3d64fe2..0000000
--- a/ports/nethack/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/nethack/icon_16.png b/ports/nethack/icon_16.png
deleted file mode 100644
index 18a9194..0000000
--- a/ports/nethack/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/nethack/icon_48.png b/ports/nethack/icon_48.png
deleted file mode 100644
index 4e09775..0000000
--- a/ports/nethack/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/nethack/manifest.json b/ports/nethack/manifest.json
deleted file mode 100644
index bb9cf5e..0000000
--- a/ports/nethack/manifest.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "Nethack",
- "description": "Nethack console application running using NativeClient",
- "version": "0.0.0.4",
- "manifest_version": 2,
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "launch": {
- "local_path": "nethack.html"
- }
- }
-}
diff --git a/ports/nethack/nacl.patch b/ports/nethack/nacl.patch
deleted file mode 100644
index 36b2285..0000000
--- a/ports/nethack/nacl.patch
+++ /dev/null
@@ -1,304 +0,0 @@
---- nethack-3.4.3-orig/win/tty/termcap.c 2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/win/tty/termcap.c 2011-09-27 13:38:17.000000000 -0700
-@@ -836,10 +836,6 @@
-
- #include <curses.h>
-
--#ifndef LINUX
--extern char *tparm();
--#endif
--
- # ifdef COLOR_BLACK /* trust include file */
- #undef COLOR_BLACK
- # elsediff -Naur nethack-3.4.3-orig/include/config.h nethack-3.4.3/include/config.h
---- nethack-3.4.3-orig/include/config.h 2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/include/config.h 2011-09-27 13:38:17.000000000 -0700
-@@ -169,7 +169,7 @@
-
- #ifdef UNIX
- /* path and file name extension for compression program */
--#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */
-+/*#define COMPRESS "/usr/bin/compress"*/ /* Lempel-Ziv compression */
- #define COMPRESS_EXTENSION ".Z" /* compress's extension */
- /* An example of one alternative you might want to use: */
- /* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */
-diff --git a/include/config1.h b/include/config1.h
---- a/include/config1.h
-+++ b/include/config1.h
-@@ -144,7 +144,7 @@
- # else
- # define NHSTDC
- # define USE_STDARG
--# define POSIX_TYPES
-+//# define POSIX_TYPES
- # define _DECC_V4_SOURCE /* avoid some incompatible V5.x changes */
- # endif
- # undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */
-diff -Naur nethack-3.4.3-orig/include/system.h nethack-3.4.3/include/system.h
---- nethack-3.4.3-orig/include/system.h 2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/include/system.h 2011-09-27 13:38:17.000000000 -0700
-@@ -422,7 +422,7 @@
- E unsigned int FDECL(strlen, (char *));
- # else
- # if !(defined(ULTRIX_PROTO) && defined(__GNUC__))
--E int FDECL(strlen, (const char *));
-+E size_t FDECL(strlen, (const char *));
- # endif
- # endif /* HPUX */
- # endif /* MICRO */
-diff --git a/include/unixconf.h b/include/unixconf.h
---- a/include/unixconf.h
-+++ b/include/unixconf.h
-@@ -95,8 +95,8 @@
- * Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88)
- */
-
--/* #define NO_FILE_LINKS */ /* if no hard links */
--/* #define LOCKDIR "/usr/games/lib/nethackdir" */ /* where to put locks */
-+#define NO_FILE_LINKS /* if no hard links */
-+#define LOCKDIR "/usr/games/lib/nethackdir" /* where to put locks */
-
- /*
- * If you want the static parts of your playground on a read-only file
-@@ -132,7 +132,8 @@
- * "extra output" method is used, but not all systems provide access to
- * a fine-grained timer.
- */
--/* #define TIMED_DELAY */ /* usleep() */
-+#define TIMED_DELAY /* usleep() */
-+#define msleep(k) sleep((k)/1000)
- #endif
-
- /*
-@@ -143,7 +144,7 @@
- * A stat system call is done on the mailbox every MAILCKFREQ moves.
- */
-
--#define MAIL /* Deliver mail during the game */
-+/* #define MAIL */ /* Deliver mail during the game */
-
- /* The Andrew Message System does mail a little differently from normal
- * UNIX. Mail is deposited in the user's own directory in ~/Mailbox
-@@ -270,7 +271,7 @@
- #endif
- #define tgetch getchar
-
--#define SHELL /* do not delete the '!' command */
-+/* #define SHELL */ /* do not delete the '!' command */
-
- #include "system.h"
-
-diff -Naur nethack-3.4.3-orig/sys/share/unixtty.c nethack-3.4.3/sys/share/unixtty.c
---- nethack-3.4.3-orig/sys/share/unixtty.c 2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/sys/share/unixtty.c 2011-09-27 13:38:17.000000000 -0700
-@@ -54,7 +54,7 @@
- # define CBRKMASK ICANON
- # define CBRKON ! /* reverse condition */
- # ifdef POSIX_TYPES
--# define OSPEED(x) (speednum(cfgetospeed(&x)))
-+# define OSPEED(x) 0
- # else
- # ifndef CBAUD
- # define CBAUD _CBAUD /* for POSIX nitpickers (like RS/6000 cc) */
-@@ -82,7 +82,7 @@
- # if defined(BSD) && !defined(__DGUX__)
- # define nonesuch _POSIX_VDISABLE
- # else
--# define nonesuch (fpathconf(0, _PC_VDISABLE))
-+# define nonesuch 0
- # endif
- # else
- # define nonesuch 0
-@@ -377,7 +377,7 @@ init_sco_cons()
-
-
- #ifdef __linux__ /* via Jesse Thilo and Ben Gertzfield */
--# include <sys/vt.h>
-+//# include <sys/vt.h>
-
- int linux_flag_console = 0;
-
-@@ -409,11 +409,13 @@ linux_mapoff()
- void
- check_linux_console()
- {
-+#if 0
- struct vt_mode vtm;
-
- if (isatty(0) && ioctl(0,VT_GETMODE,&vtm) >= 0) {
- linux_flag_console = 1;
- }
-+#endif
- }
-
- void
-diff -Naur nethack-3.4.3-orig/sys/unix/Makefile.src nethack-3.4.3/sys/unix/Makefile.src
---- nethack-3.4.3-orig/sys/unix/Makefile.src 2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/sys/unix/Makefile.src 2011-09-27 13:44:30.000000000 -0700
-@@ -36,7 +36,7 @@
- # SHELL=E:/GEMINI2/MUPFEL.TTP
-
- # Normally, the C compiler driver is used for linking:
--LINK=$(CC)
-+LINK=$(CC)
-
- # Pick the SYSSRC and SYSOBJ lines corresponding to your desired operating
- # system.
-@@ -151,14 +151,14 @@
- # flags for debugging:
- # CFLAGS = -g -I../include
-
--CFLAGS = -O -I../include
--LFLAGS =
-+CFLAGS := $(NACL_CCFLAGS) -I../include
-+LFLAGS = $(NACL_LDFLAGS)
-
- # The Qt and Be window systems are written in C++, while the rest of
- # NetHack is standard C. If using Qt, uncomment the LINK line here to get
- # the C++ libraries linked in.
- CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
--CXX=g++
-+CXX=g++
- #LINK=g++
- # For cross-compiling, eg. with gcc on Linux (see also CC further up):
- #CXX=arm-linux-g++
-@@ -171,8 +206,10 @@
- #
- # files for a straight tty port using no native windowing system
- WINTTYSRC = ../win/tty/getline.c ../win/tty/termcap.c ../win/tty/topl.c \
-- ../win/tty/wintty.c
--WINTTYOBJ = getline.o termcap.o topl.o wintty.o
-+ ../win/tty/wintty.c \
-+ nethack_pepper.c
-+WINTTYOBJ = getline.o termcap.o topl.o wintty.o \
-+ nethack_pepper.o
- #
- # files for an X11 port
- # (tile.c is a generated source file)
-@@ -231,7 +233,8 @@ WINOBJ = $(WINTTYOBJ)
- # WINTTYLIB = -lcurses
- # WINTTYLIB = -lcurses16
- # WINTTYLIB = -lncurses
--WINTTYLIB = -ltermlib
-+
-+
- #
- # libraries for X11
- # If USE_XPM is defined in config.h, you will also need -lXpm here.
-diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top
---- a/sys/unix/Makefile.top
-+++ b/sys/unix/Makefile.top
-@@ -14,7 +14,7 @@
- # MAKE = make
-
- # make NetHack
--PREFIX = /usr
-+PREFIX = ${PWD}/out
- GAME = nethack
- # GAME = nethack.prg
- GAMEUID = games
-@@ -64,8 +64,8 @@ VARDAT = $(VARDATD) $(VARDATND)
- # other permission-related reasons. If that happens, you may want to set the
- # command to "true", which is a no-op. Note that disabling chown or chgrp
- # will only work if setuid (or setgid) behavior is not desired or required.
--CHOWN = chown
--CHGRP = chgrp
-+CHOWN = echo
-+CHGRP = echo
-
- #
- # end of configuration
-diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl
---- a/sys/unix/Makefile.utl
-+++ b/sys/unix/Makefile.utl
-@@ -15,7 +15,7 @@
-
- # if you are using gcc as your compiler,
- # uncomment the CC definition below if it's not in your environment
--# CC = gcc
-+CC = gcc
- #
- # For Bull DPX/2 systems at B.O.S. 2.0 or higher use the following:
- #
-@@ -89,23 +89,24 @@
- # flags for debugging:
- # CFLAGS = -g -I../include
-
--CFLAGS = -O -I../include
--LFLAGS =
-+CFLAGS = -O -I../include -DSTRCMPI -DSTRNCMPI -m32
-+LFLAGS = -m32
-+CPPFLAGS =
-
- LIBS =
-
- # If you are cross-compiling, you must use this:
--#OBJDIR = .
-+OBJDIR = .
- # otherwise, you can save a little bit of disk space with this:
--OBJDIR = ../src
-+#OBJDIR = ../src
-
- # yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
- # if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
--YACC = yacc
--LEX = lex
--# YACC = bison -y
-+#YACC = yacc
-+#LEX = lex
-+YACC = bison -y
- # YACC = byacc
--# LEX = flex
-+LEX = flex
-
- # these are the names of the output files from YACC/LEX. Under MS-DOS
- # and similar systems, they may differ
-diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c
---- a/sys/unix/unixmain.c
-+++ b/sys/unix/unixmain.c
-@@ -45,7 +45,7 @@ static boolean wiz_error_flag = FALSE;
- #endif
-
- int
--main(argc,argv)
-+nethack_main(argc,argv)
- int argc;
- char *argv[];
- {
-diff --git a/win/tty/termcap.c b/win/tty/termcap.c
---- a/win/tty/termcap.c
-+++ b/win/tty/termcap.c
-@@ -108,6 +108,7 @@ int *wid, *hgt;
- # if defined(TOS) && defined(__GNUC__)
- if (!term)
- term = "builtin"; /* library has a default */
-+}
- # endif
- if (!term)
- #endif
-
-diff --git a/include/extern.h b/include/extern.h
-index 4e2314d..75c874c 100644
---- nethack-3.4.3-orig/include/extern.h
-+++ nethack-3.4.3/include/extern.h
-@@ -733,7 +733,7 @@ E int FDECL(distmin, (int,int,int,int));
- E boolean FDECL(online2, (int,int,int,int));
- E boolean FDECL(pmatch, (const char *,const char *));
- #ifndef STRNCMPI
--E int FDECL(strncmpi, (const char *,const char *,int));
-+//E int FDECL(strncmpi, (const char *,const char *,int));
- #endif
- #ifndef STRSTRI
- E char *FDECL(strstri, (const char *,const char *));
-diff --git a/src/hacklib.c b/src/hacklib.c
-index 0d08270..9e4902a 100644
---- nethack-3.4.3-orig/src/hacklib.c
-+++ nethack-3.4.3/src/hacklib.c
-@@ -356,6 +356,6 @@ pmatch_top:
- int
- strncmpi(s1, s2, n) /* case insensitive counted string comparison */
- register const char *s1, *s2;
-- register int n; /*(should probably be size_t, which is usually unsigned)*/
-+ register size_t n; /*(should probably be size_t, which is usually unsigned)*/
- { /*{ aka strncasecmp }*/
- register char t1, t2;
diff --git a/ports/nethack/nethack_pepper.c b/ports/nethack/nethack_pepper.c
deleted file mode 100644
index 8b07bc5..0000000
--- a/ports/nethack/nethack_pepper.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-
-#include <assert.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "nacl_main.h"
-
-extern int nethack_main(int argc, char* argv[]);
-
-static void setup_unix_environment(const char* arg0) {
- mkdir("/usr", 0777);
- mkdir("/usr/games", 0777);
-
- int ret = nacl_startup_untar(arg0, "nethack.tar", "/usr/games");
- if (ret != 0) {
- perror("Startup untar failed.");
- exit(1);
- }
-
- // Setup config file.
- ret = chdir(getenv("HOME"));
- if (ret != 0) {
- perror("Can change to HOME dir.");
- exit(1);
- }
- if (access(".nethackrc", R_OK) < 0) {
- int fh = open(".nethackrc", O_CREAT | O_WRONLY);
- const char config[] = "OPTIONS=color\n";
- write(fh, config, sizeof(config) - 1);
- close(fh);
- }
-
- ret = chdir("/usr/games");
- if (ret != 0) {
- perror("Can change to /usr/games.");
- exit(1);
- }
-}
-
-int main(int argc, char* argv[]) {
- setup_unix_environment(argv[0]);
- return nethack_main(argc, argv);
-}
diff --git a/ports/nethack/pkg_info b/ports/nethack/pkg_info
deleted file mode 100644
index eb8e3a8..0000000
--- a/ports/nethack/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=nethack
-VERSION=3.4.3
-URL=http://storage.googleapis.com/webports/mirror/nethack-343-src.tgz
-LICENSE=CUSTOM:dat/license
-DEPENDS=(ncurses libtar nacl-spawn)
-SHA1=c26537093c38152bc0fbcec20468d975b35f59fd
-# glibc/arm: missing getlogin()
-# https://code.google.com/p/nativeclient/issues/detail?id=4236
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
diff --git a/ports/nettle/build.sh b/ports/nettle/build.sh
deleted file mode 100644
index e49e38c..0000000
--- a/ports/nettle/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2015 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.
-
-EXTRA_CONFIGURE_ARGS+=" --disable-assembler"
-
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CONFIGURE_ARGS+=" --disable-shared"
-fi
-
-EXECUTABLES="
- ./tools/sexp-conv${NACL_EXEEXT}
- ./tools/pkcs1-conv${NACL_EXEEXT}
- ./tools/nettle-hash${NACL_EXEEXT}
- ./tools/nettle-lfib-stream${NACL_EXEEXT}"
diff --git a/ports/nettle/nacl.patch b/ports/nettle/nacl.patch
deleted file mode 100644
index db6fa43..0000000
--- a/ports/nettle/nacl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -16,7 +16,7 @@ MKDIR_P = @MKDIR_P@
-
- OPT_ASM_SOURCES = @OPT_ASM_SOURCES@
-
--SUBDIRS = tools testsuite examples
-+SUBDIRS = tools testsuite
-
- include config.make
-
-diff --git a/tools/Makefile.in b/tools/Makefile.in
---- a/tools/Makefile.in
-+++ b/tools/Makefile.in
-@@ -23,7 +23,7 @@ TARGETS = sexp-conv$(EXEEXT) nettle-hash$(EXEEXT) nettle-lfib-stream$(EXEEXT) \
-
- all: $(TARGETS)
-
--getopt_OBJS = ../getopt.$(OBJEXT) ../getopt1.$(OBJEXT)
-+getopt_OBJS =
-
- sexp_conv_SOURCES = sexp-conv.c input.c output.c parse.c misc.c
- pkcs1_conv_SOURCES = pkcs1-conv.c misc.c
diff --git a/ports/nettle/pkg_info b/ports/nettle/pkg_info
deleted file mode 100644
index 0147a5f..0000000
--- a/ports/nettle/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=nettle
-VERSION=2.7
-URL=ftp://ftp.gnu.org/gnu/nettle/nettle-2.7.tar.gz
-DEPENDS=(gmp)
-LICENSE=LGPL
-SHA1=e17de3678b987841e88a724b7d2f6856d97ab139
diff --git a/ports/ninja/build.sh b/ports/ninja/build.sh
deleted file mode 100644
index 3d1046e..0000000
--- a/ports/ninja/build.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES="ninja"
-
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-
-EnableCliMain
-EnableGlibcCompat
-
-BuildHostNinja() {
- # Build a host version ninja in $SRC_DIR
- if [ -f "${SRC_DIR}/ninja" ];then
- return
- fi
- ChangeDir ${SRC_DIR}
- LogExecute python ./configure.py --bootstrap
- ChangeDir ${BUILD_DIR}
-}
-
-ConfigureStep() {
- BuildHostNinja
- SetupCrossEnvironment
- # ninja doesn't honor CPPFLAGS to add them to CFLAGS
- CFLAGS+=" ${CPPFLAGS}"
- LogExecute python ${SRC_DIR}/configure.py --host=linux --platform=nacl
-}
-
-BuildStep() {
- LogExecute ${SRC_DIR}/ninja
-}
-
-TestStep() {
- LogExecute ${SRC_DIR}/ninja ninja_test
- RunSelLdrCommand ninja_test --gtest_filter=-SubprocessTest.*
-}
-
-InstallStep() {
- MakeDir ${DESTDIR}${PREFIX}/bin
- LogExecute cp ninja ${DESTDIR}${PREFIX}/bin/
-}
diff --git a/ports/ninja/nacl.patch b/ports/ninja/nacl.patch
deleted file mode 100644
index d5ea2ca..0000000
--- a/ports/ninja/nacl.patch
+++ /dev/null
@@ -1,432 +0,0 @@
-diff --git a/configure.py b/configure.py
---- a/configure.py
-+++ b/configure.py
-@@ -28,7 +28,9 @@ import string
- import subprocess
- import sys
-
--sys.path.insert(0, 'misc')
-+SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-+sys.path.insert(0, os.path.join(SCRIPT_DIR, 'misc'))
-+
- import ninja_syntax
-
-
-@@ -57,11 +59,13 @@ class Platform(object):
- self._platform = 'bitrig'
- elif self._platform.startswith('netbsd'):
- self._platform = 'netbsd'
-+ elif self._platform.startswith('nacl'):
-+ self._platform = 'nacl'
-
- @staticmethod
- def known_platforms():
- return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
-- 'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd']
-+ 'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd', 'nacl']
-
- def platform(self):
- return self._platform
-@@ -75,6 +79,9 @@ class Platform(object):
- def is_msvc(self):
- return self._platform == 'msvc'
-
-+ def is_nacl(self):
-+ return self._platform == 'nacl'
-+
- def msvc_needs_fs(self):
- popen = subprocess.Popen(['cl', '/nologo', '/?'],
- stdout=subprocess.PIPE,
-@@ -231,7 +238,7 @@ configure_args = sys.argv[1:]
- if '--bootstrap' in configure_args:
- configure_args.remove('--bootstrap')
- n.variable('configure_args', ' '.join(configure_args))
--env_keys = set(['CXX', 'AR', 'CFLAGS', 'LDFLAGS'])
-+env_keys = set(['CXX', 'AR', 'CFLAGS', 'LDFLAGS', 'LIBS'])
- configure_env = dict((k, os.environ[k]) for k in os.environ if k in env_keys)
- if configure_env:
- config_str = ' '.join([k + '=' + pipes.quote(configure_env[k])
-@@ -246,7 +253,7 @@ if platform.is_msvc():
- objext = '.obj'
-
- def src(filename):
-- return os.path.join('src', filename)
-+ return os.path.join('$srcdir', 'src', filename)
- def built(filename):
- return os.path.join('$builddir', filename)
- def doc(filename):
-@@ -263,6 +270,7 @@ def binary(name):
- return name
-
- n.variable('builddir', 'build')
-+n.variable('srcdir', os.path.relpath(SCRIPT_DIR, os.getcwd()))
- n.variable('cxx', CXX)
- if platform.is_msvc():
- n.variable('ar', 'link')
-@@ -326,6 +334,8 @@ if platform.is_mingw():
- ldflags.append('-static')
- elif platform.is_solaris():
- cflags.remove('-fvisibility=hidden')
-+elif platform.is_nacl():
-+ cflags.remove('-fvisibility=hidden')
- elif platform.is_msvc():
- pass
- else:
-@@ -354,9 +364,12 @@ def shell_escape(str):
-
- if 'CFLAGS' in configure_env:
- cflags.append(configure_env['CFLAGS'])
--n.variable('cflags', ' '.join(shell_escape(flag) for flag in cflags))
- if 'LDFLAGS' in configure_env:
- ldflags.append(configure_env['LDFLAGS'])
-+if 'LIBS' in configure_env:
-+ libs.append(configure_env['LIBS'])
-+
-+n.variable('cflags', ' '.join(shell_escape(flag) for flag in cflags))
- n.variable('ldflags', ' '.join(shell_escape(flag) for flag in ldflags))
- n.newline()
-
-@@ -403,10 +416,10 @@ objs = []
- if platform.supports_ninja_browse():
- n.comment('browse_py.h is used to inline browse.py.')
- n.rule('inline',
-- command='src/inline.sh $varname < $in > $out',
-+ command='$srcdir/src/inline.sh $varname < $in > $out',
- description='INLINE $out')
- n.build(built('browse_py.h'), 'inline', src('browse.py'),
-- implicit='src/inline.sh',
-+ implicit=src('inline.sh'),
- variables=[('varname', 'kBrowsePy')])
- n.newline()
-
-@@ -469,10 +482,11 @@ else:
- ninja_lib = n.build(built('libninja.a'), 'ar', objs)
- n.newline()
-
-+# TODO(bradnelson): Upstream this fix.
- if platform.is_msvc():
-- libs.append('ninja.lib')
-+ libs.insert(0, 'ninja.lib')
- else:
-- libs.append('-lninja')
-+ libs.insert(0, '-lninja')
-
- all_targets = []
-
-@@ -583,7 +597,7 @@ if not host.is_mingw():
- options.with_python,
- generator=True)
- n.build('build.ninja', 'configure',
-- implicit=['configure.py', os.path.normpath('misc/ninja_syntax.py')])
-+ implicit=['$srcdir/configure.py', os.path.normpath('$srcdir/misc/ninja_syntax.py')])
- n.newline()
-
- n.default(ninja)
-diff --git a/src/disk_interface_test.cc b/src/disk_interface_test.cc
---- a/src/disk_interface_test.cc
-+++ b/src/disk_interface_test.cc
-@@ -13,6 +13,8 @@
- // limitations under the License.
-
- #include <assert.h>
-+#include <errno.h>
-+#include <limits.h>
- #include <stdio.h>
- #ifdef _WIN32
- #include <io.h>
-@@ -65,8 +67,14 @@ TEST_F(DiskInterfaceTest, StatBadPath) {
- string bad_path("cc:\\foo");
- EXPECT_EQ(-1, disk_.Stat(bad_path));
- #else
-- string too_long_name(512, 'x');
-+ // If any component of the path is longer then NAME_MAX stat *should*
-+ // fail with ENAMETOOLONG. However this is not a POSIX requirement
-+ // according to the stat(3) manpage so this test is slightly dubious
-+#ifndef __native_client__
-+ string too_long_name(NAME_MAX+1, 'x');
- EXPECT_EQ(-1, disk_.Stat(too_long_name));
-+ EXPECT_EQ(ENAMETOOLONG, errno);
-+#endif
- #endif
- disk_.quiet_ = false;
- }
-diff --git a/src/manifest_parser_perftest.cc b/src/manifest_parser_perftest.cc
---- a/src/manifest_parser_perftest.cc
-+++ b/src/manifest_parser_perftest.cc
-@@ -99,7 +99,7 @@ int main(int argc, char* argv[]) {
- }
-
- if (chdir(kManifestDir) < 0)
-- Fatal("chdir: %s", strerror(errno));
-+ Fatal("chdir %s: %s", kManifestDir, strerror(errno));
-
- const int kNumRepetitions = 5;
- vector<int> times;
-diff --git a/src/ninja_test.cc b/src/ninja_test.cc
---- a/src/ninja_test.cc
-+++ b/src/ninja_test.cc
-@@ -14,6 +14,7 @@
-
- #include <stdarg.h>
- #include <stdio.h>
-+#include <stdlib.h>
-
- #ifdef _WIN32
- #include "getopt.h"
-@@ -21,6 +22,13 @@
- #include <getopt.h>
- #endif
-
-+#if defined(__native_client__)
-+#include <nacl_io/nacl_io.h>
-+#include <sys/stat.h>
-+#include <sys/mount.h>
-+#include <unistd.h>
-+#endif
-+
- #include "test.h"
- #include "line_printer.h"
-
-@@ -123,6 +131,16 @@ bool testing::Test::Check(bool condition, const char* file, int line,
- }
-
- int main(int argc, char **argv) {
-+#ifdef __native_client__
-+ // ninja tests require fcntl() and other functions which are not
-+ // available under sel_ldr, so we configure nacl_io and run the tests
-+ // in a memfs.
-+ nacl_io_init();
-+ umount("/");
-+ mount("", "/", "memfs", 0, NULL);
-+ mkdir("/tmp", 0777);
-+ chdir("/");
-+#endif
- int tests_started = 0;
-
- const char* test_filter = "*";
-@@ -152,5 +170,8 @@ int main(int argc, char **argv) {
- }
-
- printer.PrintOnNewLine(passed ? "passed\n" : "failed\n");
-+#ifdef __native_client__
-+ nacl_io_uninit();
-+#endif
- return passed ? EXIT_SUCCESS : EXIT_FAILURE;
- }
-diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
---- a/src/subprocess-posix.cc
-+++ b/src/subprocess-posix.cc
-@@ -17,14 +17,22 @@
- #include <assert.h>
- #include <errno.h>
- #include <fcntl.h>
--#include <poll.h>
-+// TODO(bradnelson): Drop this once poll.h in newlib is actually includable.
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
-+# include <poll.h>
-+#endif
-+#include <sys/select.h>
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
- #include <sys/wait.h>
-
-+#if defined(__native_client__)
-+# include <spawn.h>
-+#endif
- #include "util.h"
-
-+
- Subprocess::Subprocess(bool use_console) : fd_(-1), pid_(-1),
- use_console_(use_console) {
- }
-@@ -49,6 +57,14 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
- #endif // !USE_PPOLL
- SetCloseOnExec(fd_);
-
-+#if defined(__native_client__)
-+ const char *cmd[] = {"bash", "-c", (char *) NULL, (char *) NULL};
-+ cmd[2] = command.c_str();
-+ pid_ = spawnve(P_NOWAIT, cmd[0], const_cast<char *const*>(cmd), NULL);
-+ if (pid_ < 0) {
-+ Fatal("spawnve: %s", strerror(errno));
-+ }
-+#else
- pid_ = fork();
- if (pid_ < 0)
- Fatal("fork: %s", strerror(errno));
-@@ -59,10 +75,12 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
- // Track which fd we use to report errors on.
- int error_pipe = output_pipe[1];
- do {
-+#if !defined(__native_client__)
- if (sigaction(SIGINT, &set->old_act_, 0) < 0)
- break;
- if (sigprocmask(SIG_SETMASK, &set->old_mask_, 0) < 0)
- break;
-+#endif
-
- if (!use_console_) {
- // Put the child in its own process group, so ctrl-c won't reach it.
-@@ -100,6 +118,7 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
- }
- _exit(1);
- }
-+#endif
-
- close(output_pipe[1]);
- return true;
-@@ -152,6 +171,7 @@ void SubprocessSet::SetInterruptedFlag(int signum) {
- }
-
- SubprocessSet::SubprocessSet() {
-+#if !defined(__native_client__)
- sigset_t set;
- sigemptyset(&set);
- sigaddset(&set, SIGINT);
-@@ -163,15 +183,18 @@ SubprocessSet::SubprocessSet() {
- act.sa_handler = SetInterruptedFlag;
- if (sigaction(SIGINT, &act, &old_act_) < 0)
- Fatal("sigaction: %s", strerror(errno));
-+#endif
- }
-
- SubprocessSet::~SubprocessSet() {
- Clear();
-
-+#if !defined(__native_client__)
- if (sigaction(SIGINT, &old_act_, 0) < 0)
- Fatal("sigaction: %s", strerror(errno));
- if (sigprocmask(SIG_SETMASK, &old_mask_, 0) < 0)
- Fatal("sigprocmask: %s", strerror(errno));
-+#endif
- }
-
- Subprocess *SubprocessSet::Add(const string& command, bool use_console) {
-@@ -247,7 +270,11 @@ bool SubprocessSet::DoWork() {
- }
-
- interrupted_ = false;
-+#if defined(__native_client__)
-+ int ret = select(nfds, &set, 0, 0, 0);
-+#else
- int ret = pselect(nfds, &set, 0, 0, 0, &old_mask_);
-+#endif
- if (ret == -1) {
- if (errno != EINTR) {
- perror("ninja: pselect");
-diff --git a/src/test.cc b/src/test.cc
---- a/src/test.cc
-+++ b/src/test.cc
-@@ -20,10 +20,15 @@
-
- #include <algorithm>
-
-+#ifdef __native_client__
-+#include <dirent.h>
-+#include <sys/stat.h>
-+#endif
- #include <errno.h>
- #ifdef _WIN32
- #include <windows.h>
- #else
-+#include <stdlib.h>
- #include <unistd.h>
- #endif
-
-@@ -156,7 +161,7 @@ void ScopedTempDir::CreateAndEnter(const string& name) {
- if (start_dir_.empty())
- Fatal("couldn't get system temp dir");
- if (chdir(start_dir_.c_str()) < 0)
-- Fatal("chdir: %s", strerror(errno));
-+ Fatal("chdir %s: %s", start_dir_.c_str(), strerror(errno));
-
- // Create a temporary subdirectory of that.
- char name_template[1024];
-@@ -169,8 +174,49 @@ void ScopedTempDir::CreateAndEnter(const string& name) {
-
- // chdir into the new temporary directory.
- if (chdir(temp_dir_name_.c_str()) < 0)
-- Fatal("chdir: %s", strerror(errno));
-+ Fatal("chdir %s: %s", temp_dir_name_.c_str(), strerror(errno));
-+}
-+
-+#ifdef __native_client__
-+static int rmtree(const string& dirname) {
-+ while (1) {
-+ // Reopen the directory after each remove operation to work around
-+ // a bug in nacl_io.
-+ // TODO(sbc): simplify this once we fix this bug:
-+ DIR* dir = opendir(dirname.c_str());
-+
-+ struct dirent* entry;
-+ while ((entry = readdir(dir))) {
-+ struct stat buf;
-+ char fullname[PATH_MAX];
-+ if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
-+ continue;
-+ sprintf(fullname, "%s/%s", dirname.c_str(), entry->d_name);
-+ if (stat(fullname, &buf) != 0) {
-+ printf("stat failed '%s': %s\n", fullname, strerror(errno));
-+ return -1;
-+ }
-+
-+ if (S_ISDIR(buf.st_mode)) {
-+ if (rmtree(fullname) != 0) {
-+ return -1;
-+ }
-+ } else {
-+ if (remove(fullname) != 0) {
-+ printf("remove failed '%s': %s\n", fullname, strerror(errno));
-+ return -1;
-+ }
-+ }
-+ break;
-+ }
-+ closedir(dir);
-+ if (entry == NULL)
-+ break;
-+ }
-+
-+ return rmdir(dirname.c_str());
- }
-+#endif
-
- void ScopedTempDir::Cleanup() {
- if (temp_dir_name_.empty())
-@@ -180,6 +226,10 @@ void ScopedTempDir::Cleanup() {
- if (chdir(start_dir_.c_str()) < 0)
- Fatal("chdir: %s", strerror(errno));
-
-+#ifdef __native_client__
-+ if (rmtree(temp_dir_name_.c_str()) < 0)
-+ Fatal("rmtree: %s", strerror(errno));
-+#else
- #ifdef _WIN32
- string command = "rmdir /s /q " + temp_dir_name_;
- #else
-@@ -187,6 +237,7 @@ void ScopedTempDir::Cleanup() {
- #endif
- if (system(command.c_str()) < 0)
- Fatal("system: %s", strerror(errno));
-+#endif
-
- temp_dir_name_.clear();
- }
-diff --git a/src/util.cc b/src/util.cc
---- a/src/util.cc
-+++ b/src/util.cc
-@@ -49,6 +49,13 @@
- #include "edit_distance.h"
- #include "metrics.h"
-
-+#ifdef __native_client__
-+int getloadavg(double loadavg[], int nelem) {
-+ errno = ENOSYS;
-+ return -1;
-+}
-+#endif
-+
- void Fatal(const char* msg, ...) {
- va_list ap;
- fprintf(stderr, "ninja: fatal: ");
diff --git a/ports/ninja/pkg_info b/ports/ninja/pkg_info
deleted file mode 100644
index 24d0450..0000000
--- a/ports/ninja/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=ninja
-VERSION=1.5.3
-URL=https://github.com/martine/ninja/archive/v1.5.3/ninja-v1.5.3.tar.gz
-LICENSE=Apache
-DEPENDS=(nacl-spawn glibc-compat)
-SHA1=b3ff794461ff5e4e1e73fe6bd11e653bbe509e63
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/openal-ogg-demo/Makefile b/ports/openal-ogg-demo/Makefile
deleted file mode 100644
index 59cd81f..0000000
--- a/ports/openal-ogg-demo/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (c) 2011 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.
-
-# Build OpenAL/ogg demo with Pepper in C
-include $(NACL_SDK_ROOT)/tools/common.mk
-
-TARGET = openal-ogg-demo
-LIBS = openal vorbisfile vorbis ogg m ppapi pthread
-SOURCES = openal_ogg.c ogg_buffer_reader.c
-INSTALL_DIR = $(NACL_PACKAGES_PUBLISH)/$(TARGET)/$(TOOLCHAIN)
-CFLAGS += -Wall -Werror
-
-ifeq ($(TOOLCHAIN),pnacl)
-EXEEXT=.pexe
-else
-EXEEXT=.nexe
-endif
-
-ifneq ($(TOOLCHAIN),pnacl)
-# We want the nmf to contain all the .nexe we have previously
-# built as well as the one currently being built, so we modify
-# the list of executables that we pass to create_nmf.
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_64$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_32$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_arm$(EXEEXT))
-endif
-
-# Build rules generated by macros from common.mk:
-
-$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
-
-ifeq ($(CONFIG),Release)
-$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
-$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
-else
-$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
-endif
-
-$(eval $(call NMF_RULE,$(TARGET),))
-
-install:
- mkdir -p $(INSTALL_DIR)
- cp $(OUTDIR)/$(TARGET)*$(EXEEXT) $(INSTALL_DIR)
- rm -f $(INSTALL_DIR)/*_unstripped*$(EXEEXT)
- cp $(OUTDIR)/$(TARGET).nmf $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),glibc)
- cp -r $(OUTDIR)/lib* $(INSTALL_DIR)
-endif
- cp index.html $(INSTALL_DIR)
- cp sample.ogg $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),pnacl)
- sed -i.bak 's/x-nacl/x-pnacl/g' $(INSTALL_DIR)/index.html
-endif
diff --git a/ports/openal-ogg-demo/build.sh b/ports/openal-ogg-demo/build.sh
deleted file mode 100644
index 5709f1b..0000000
--- a/ports/openal-ogg-demo/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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.
-
-SetupSDKBuildSystem
diff --git a/ports/openal-ogg-demo/index.html b/ports/openal-ogg-demo/index.html
deleted file mode 100644
index a97e574..0000000
--- a/ports/openal-ogg-demo/index.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!-- Copyright 2012 Google Inc. All rights reserved. -->
-<head>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <title>Native Client OpenAL / Ogg Vorbis</title>
-</head>
-
-<body>
-
-<h1>Native Client OpenAL / Ogg Vorbis demo</h1>
-
-<p>The Ogg sample playing ("Arpeggio") was composed by <a href="http://en.wikipedia.org/wiki/User:Mysid">Mysid</a>.</p>
-
-<p>It was downloaded from <a href="http://commons.wikimedia.org/wiki/File:Arpeggio.ogg">http://commons.wikimedia.org/wiki/File:Arpeggio.ogg</a> and modified to reduce silent sections and to minimize pops when looped. The original file, as well as the resulting <a href="sample.ogg">sample.ogg</a>, are licensed under the <a href="http://creativecommons.org/licenses/by-sa/2.5/deed.en">Creative Commons Attribution-Share Alike 2.5 Generic</a> license (CC BY-SA 2.5).</p>
-
-Gain:<br>
-<input type="range" min="0" max="1" value="1" step=".01" onchange="valueChanged('gain', this.value)" />
-<span id="gain">1</span><br>
-Pitch:<br>
-<input type="range" min="0" max="3" value="1" step=".01" onchange="valueChanged('pitch', this.value)" />
-<span id="pitch">1</span><br>
-Source Location:
-<div id="source_pos"></div>
-Source Velocity:
-<div id="source_vel"></div>
-Listener Location:
-<div id="listener_pos"></div>
-Listener Velocity:
-<div id="listener_vel"></div>
-
-<script type="text/javascript">
-
-function addSliders(divid, min, max, value, step, prefix) {
- elem = document.getElementById(divid);
- elem.innerHTML = '<input type="range" min="'+min+'" max="'+max+'" value="'+value+'" step="'+step+'" onchange="valueChanged(\''+prefix+'_x\', this.value)" /> X: <span id="'+prefix+'_x">'+value+'</span><br>';
- elem.innerHTML += '<input type="range" min="'+min+'" max="'+max+'" value="'+value+'" step="'+step+'" onchange="valueChanged(\''+prefix+'_y\', this.value)" /> Y: <span id="'+prefix+'_y">'+value+'</span><br>';
- elem.innerHTML += '<input type="range" min="'+min+'" max="'+max+'" value="'+value+'" step="'+step+'" onchange="valueChanged(\''+prefix+'_z\', this.value)" /> Z: <span id="'+prefix+'_z">'+value+'</span><br>';
-}
-
-function valueChanged(name, value) {
- document.getElementById(name).innerHTML = value;
- var plugin = document.getElementById("openal_ogg_nexe");
- if (plugin != null)
- plugin.postMessage(name + " = " + value);
-}
-
-addSliders("source_pos", "-20", "20", "1", ".1", "source_pos");
-addSliders("source_vel", "-200", "200", "0", "1", "source_vel");
-addSliders("listener_pos", "-20", "20", "0", ".1", "listener_pos");
-addSliders("listener_vel", "-200", "200", "0", "1", "listener_vel");
-
-</script>
-
-<embed name="nacl_module"
- id="openal_ogg_nexe"
- src="openal-ogg-demo.nmf"
- type="application/x-nacl">
-
-
-</body>
-</html>
-
diff --git a/ports/openal-ogg-demo/ogg_buffer_reader.c b/ports/openal-ogg-demo/ogg_buffer_reader.c
deleted file mode 100644
index af89f3c..0000000
--- a/ports/openal-ogg-demo/ogg_buffer_reader.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "vorbis/vorbisfile.h"
-
-/* Opaque structure passed through the callbacks. */
-typedef struct ogg_handle {
- void* buffer;
- size_t size;
- off_t read_pos;
-} ogg_handle;
-
-/* reference:
-
-typedef struct {
- size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
- int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
- int (*close_func) (void *datasource);
- long (*tell_func) (void *datasource);
-} ov_callbacks;
-*/
-
-static size_t audio_read(void* buffer, size_t size, size_t nmemb, void* f) {
- size_t actual_size = size * nmemb;
- if (((ogg_handle*)f)->size - ((ogg_handle*)f)->read_pos < actual_size)
- actual_size = ((ogg_handle*)f)->size - ((ogg_handle*)f)->read_pos;
- if (actual_size != size * nmemb) {
- nmemb = actual_size / size;
- }
- memcpy(buffer, ((ogg_handle*)f)->buffer + ((ogg_handle*)f)->read_pos,
- size * nmemb);
- ((ogg_handle*)f)->read_pos += size * nmemb;
- return nmemb;
-}
-
-static int audio_seek(void* f, ogg_int64_t off, int whence) {
- switch (whence) {
- case SEEK_SET:
- ((ogg_handle*)f)->read_pos = off;
- break;
- case SEEK_CUR:
- ((ogg_handle*)f)->read_pos += off;
- break;
- case SEEK_END:
- ((ogg_handle*)f)->read_pos = (off_t)(((ogg_handle*)f)->size) + off;
- break;
- }
- return ((ogg_handle*)f)->read_pos;
-}
-
-static int audio_close(void* f) {
- return 0;
-}
-
-static long audio_tell(void* f) {
- return ((ogg_handle*)f)->read_pos;
-}
-
-void DecodeOggBuffer(void* inBuffer,
- size_t size,
- char** outBuffer,
- int* outBufferSize,
- int* outChannels,
- int* outRate) {
- OggVorbis_File ogg;
-
- ogg_handle oh;
- oh.buffer = inBuffer;
- oh.size = size;
- oh.read_pos = 0;
-
- /* Use custom callbacks to read the ogg file from a buffer in the absence of
- * ordinary POSIX file functions.
- */
- ov_callbacks callbacks = {
- (size_t (*)(void*, size_t, size_t, void*))audio_read,
- (int (*)(void*, ogg_int64_t, int))audio_seek,
- (int (*)(void*))audio_close,
- (long (*)(void*))audio_tell,
- };
-
- ov_open_callbacks(&oh, &ogg, NULL, 0, callbacks);
- vorbis_info* info = ov_info(&ogg, -1);
- printf("ogg file, channels: %d, rate: %ld\n", info->channels, info->rate);
- ogg_int64_t num_samples = ov_pcm_total(&ogg, -1);
-#define SAMPLE_SIZE sizeof(short) /* assume 16-bit samples */
- printf("\tnum_samples: %lld buffer size: %lld\n", num_samples,
- info->channels * SAMPLE_SIZE * num_samples);
-
- int buf_size = num_samples * SAMPLE_SIZE * info->channels;
- /* Caller is responsible for freeing the resulting PCM buffer. */
- char* pcm_buffer = (char*)malloc(buf_size);
- int pos = 0;
- while (pos < buf_size) {
- int ret = ov_read(&ogg, pcm_buffer + pos, buf_size - pos, 0, 2, 1, NULL);
- if (ret == OV_HOLE || ret == OV_EBADLINK || ret == OV_EINVAL)
- continue;
- pos += ret;
- }
-
- *outBuffer = pcm_buffer;
- *outBufferSize = buf_size;
- *outChannels = info->channels;
- *outRate = info->rate;
-}
diff --git a/ports/openal-ogg-demo/openal_ogg.c b/ports/openal-ogg-demo/openal_ogg.c
deleted file mode 100644
index ac3e209..0000000
--- a/ports/openal-ogg-demo/openal_ogg.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * 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.
- */
-
-/* This example loads an ogg file using the C Pepper URLLoader interface,
- * decodes the file using libvorbis/libogg, and loop plays the file using
- * OpenAL. Various properties of the audio source and listener can be changed
- * through HTML controls which result in PostMessage calls interpreted below in
- * Messaging_HandleMessage.
- */
-
-#include <assert.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "AL/al.h"
-#include "AL/alc.h"
-
-/* Pepper includes */
-#include "ppapi/c/pp_completion_callback.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_module.h"
-#include "ppapi/c/ppb_audio.h"
-#include "ppapi/c/ppb_audio_config.h"
-#include "ppapi/c/ppb_instance.h"
-#include "ppapi/c/ppb_core.h"
-#include "ppapi/c/ppb_url_loader.h"
-#include "ppapi/c/ppb_url_request_info.h"
-#include "ppapi/c/ppb_var.h"
-#include "ppapi/c/ppp.h"
-#include "ppapi/c/ppp_input_event.h"
-#include "ppapi/c/ppp_instance.h"
-#include "ppapi/c/ppp_messaging.h"
-
-PP_Module g_module = 0;
-PPB_GetInterface g_get_browser_interface = NULL;
-
-const size_t BUFFER_READ_SIZE = 4096;
-const char* OGG_FILE = "sample.ogg";
-
-/* NOTE on PP_Instance: In general Pepper is designed such that a
- * single plugin process can implement multiple plugin instances.
- * This might occur, for example, if a plugin were instantiated by
- * multiple <embed ...> tags in a single page.
- *
- * This implementation assumes at most one instance per plugin,
- * consistent with limitations of the current implementation of
- * Native Client.
- */
-struct PepperState {
- const struct PPB_Core_1_0* core_interface;
- const struct PPB_Instance_1_0* instance_interface;
- const struct PPB_URLRequestInfo_1_0* request_interface;
- const struct PPB_URLLoader_1_0* loader_interface;
- const struct PPB_Var_1_1* var_interface;
- PP_Instance instance;
- int ready;
- ALCdevice* alc_device;
- ALCcontext* alc_context;
- ALuint buffer;
- ALuint source;
- float source_pos[3];
- float source_vel[3];
- float listener_pos[3];
- float listener_vel[3];
- float pitch;
- float gain;
-};
-struct PepperState g_MyState;
-int g_MyStateIsValid = 0;
-
-char* ogg_file_contents = NULL;
-size_t ogg_file_size = 0;
-size_t ogg_file_alloced = 0;
-void ReadSome(void* data);
-
-extern void DecodeOggBuffer(void* inBuffer,
- size_t size,
- char** outBuffer,
- int* outBufferSize,
- int* outChannels,
- int* outRate);
-
-void SetupAndPlayAudio() {
- g_MyState.source_pos[0] = 1.0f;
- g_MyState.source_pos[1] = 1.0f;
- g_MyState.source_pos[2] = 1.0f;
-
- g_MyState.source_vel[0] = 0.0f;
- g_MyState.source_vel[1] = 0.0f;
- g_MyState.source_vel[2] = 0.0f;
-
- g_MyState.listener_pos[0] = 0.0f;
- g_MyState.listener_pos[1] = 0.0f;
- g_MyState.listener_pos[2] = 0.0f;
-
- g_MyState.listener_vel[0] = 0.0f;
- g_MyState.listener_vel[1] = 0.0f;
- g_MyState.listener_vel[2] = 0.0f;
-
- g_MyState.pitch = 1.0f;
- g_MyState.gain = 1.0f;
-
- alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
- assert(alGetError() == AL_NO_ERROR);
- alSourcei(g_MyState.source, AL_LOOPING, AL_TRUE);
- assert(alGetError() == AL_NO_ERROR);
- alSourcefv(g_MyState.source, AL_POSITION, g_MyState.source_pos);
- assert(alGetError() == AL_NO_ERROR);
- alSourcef(g_MyState.source, AL_REFERENCE_DISTANCE, 1.0f);
- assert(alGetError() == AL_NO_ERROR);
- alSourcef(g_MyState.source, AL_MAX_DISTANCE, 70.0f);
- assert(alGetError() == AL_NO_ERROR);
- alSourcef(g_MyState.source, AL_GAIN, 1.0f);
- assert(alGetError() == AL_NO_ERROR);
- alSourcei(g_MyState.source, AL_BUFFER, g_MyState.buffer);
- assert(alGetError() == AL_NO_ERROR);
- alSourcef(g_MyState.source, AL_PITCH, g_MyState.pitch);
- assert(alGetError() == AL_NO_ERROR);
- alSourcef(g_MyState.source, AL_GAIN, g_MyState.gain);
- assert(alGetError() == AL_NO_ERROR);
- alSourcePlay(g_MyState.source);
- assert(alGetError() == AL_NO_ERROR);
-}
-
-void DecodeAndPlayOggFile() {
- char* pcm_buffer;
- int buffer_size;
- int num_channels;
- int rate;
- DecodeOggBuffer(ogg_file_contents, ogg_file_size, &pcm_buffer, &buffer_size,
- &num_channels, &rate);
-
- /* Pass the decoded PCM buffer to OpenAL. */
- alBufferData(g_MyState.buffer,
- num_channels == 2 ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16,
- pcm_buffer, buffer_size, rate);
- assert(alGetError() == AL_NO_ERROR);
-
- free(pcm_buffer);
- free(ogg_file_contents);
-
- ogg_file_contents = NULL;
- ogg_file_alloced = 0;
- ogg_file_size = 0;
-
- SetupAndPlayAudio();
- g_MyState.ready = 1;
-}
-
-static void ReadCallback(void* data, int32_t result) {
- if (result == PP_OK) {
- /* We're done reading the file. */
- DecodeAndPlayOggFile();
- } else if (result > 0) {
- /* 'result' bytes were read into memory. */
- ogg_file_size += (size_t)result;
- ReadSome(data);
- } else
- assert(0);
-}
-
-static void OpenCallback(void* data, int32_t result) {
- assert(result == PP_OK);
- ReadSome(data);
-}
-
-/* Read up to BUFFER_READ_SIZE bytes more from the URLLoader.
- * Allocate more space in the destination buffer if needed.
- */
-void ReadSome(void* data) {
- while (ogg_file_alloced < ogg_file_size + BUFFER_READ_SIZE) {
- /* The buffer isn't big enough to hold BUFFER_READ_SIZE more bytes. */
- char* temp = (char*)malloc(ogg_file_alloced * 2);
- memcpy(temp, ogg_file_contents, ogg_file_size);
- free(ogg_file_contents);
- ogg_file_contents = temp;
- ogg_file_alloced *= 2;
- }
-
- struct PP_CompletionCallback cb =
- PP_MakeCompletionCallback(ReadCallback, data);
-#ifndef NDEBUG
- int32_t read_ret =
-#endif
- g_MyState.loader_interface->ReadResponseBody(
- (PP_Resource)data, ogg_file_contents + ogg_file_size,
- BUFFER_READ_SIZE, cb);
- assert(read_ret == PP_OK_COMPLETIONPENDING);
-}
-
-void InitializeOpenAL() {
- /* PPAPI should be the default device in NaCl, hence 'NULL'. */
- g_MyState.alc_device = alcOpenDevice(NULL);
- assert(g_MyState.alc_device != NULL);
-
- g_MyState.alc_context = alcCreateContext(g_MyState.alc_device, 0);
- assert(g_MyState.alc_context != NULL);
-
- alcMakeContextCurrent(g_MyState.alc_context);
- alGenBuffers(1, &g_MyState.buffer);
- assert(alGetError() == AL_NO_ERROR);
- alGenSources(1, &g_MyState.source);
- assert(alGetError() == AL_NO_ERROR);
-}
-
-static PP_Bool Instance_DidCreate(PP_Instance instance,
- uint32_t argc,
- const char* argn[],
- const char* argv[]) {
- g_MyState.instance = instance;
- g_MyState.ready = 0;
- g_MyStateIsValid = 1;
-
- /* This sets up OpenAL with PPAPI info. */
- alSetPpapiInfo(instance, g_get_browser_interface);
-
- const ALCchar* devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
- setenv("ALSOFT_LOGLEVEL", "3", 0);
- printf("Audio devices available:\n");
- while (devices[0] != '\0') {
- printf("\t%s\n", devices);
- devices = devices + strlen(devices) + 1;
- }
-
- InitializeOpenAL();
-
- ogg_file_contents = (char*)malloc(BUFFER_READ_SIZE);
- ogg_file_alloced = BUFFER_READ_SIZE;
-
- PP_Resource request = g_MyState.request_interface->Create(instance);
- g_MyState.request_interface->SetProperty(
- request, PP_URLREQUESTPROPERTY_URL,
- g_MyState.var_interface->VarFromUtf8(OGG_FILE, strlen(OGG_FILE)));
-
- PP_Resource loader = g_MyState.loader_interface->Create(instance);
- struct PP_CompletionCallback cb =
- PP_MakeCompletionCallback(OpenCallback, (void*)loader);
- int32_t open_ret = g_MyState.loader_interface->Open(loader, request, cb);
- assert(open_ret == PP_OK_COMPLETIONPENDING);
- if (open_ret != PP_OK_COMPLETIONPENDING)
- return PP_FALSE;
-
- return PP_TRUE;
-}
-
-static void Instance_DidDestroy(PP_Instance instance) {
- assert(g_MyState.instance == instance && g_MyStateIsValid == 1);
- g_MyStateIsValid = 0;
-}
-
-static void Instance_DidChangeView(PP_Instance pp_instance,
- PP_Resource view_resource) {
-}
-
-static void Instance_DidChangeFocus(PP_Instance pp_instance,
- PP_Bool has_focus) {
-}
-
-static PP_Bool Instance_HandleDocumentLoad(PP_Instance pp_instance,
- PP_Resource pp_url_loader) {
- return PP_FALSE;
-}
-
-static void Messaging_HandleMessage(PP_Instance pp_instance,
- struct PP_Var message) {
- if (g_MyState.ready == 0)
- return;
- if (message.type != PP_VARTYPE_STRING)
- return;
-
- uint32_t len;
- const char* str = g_MyState.var_interface->VarToUtf8(message, &len);
- int array_edit = 0;
- float* array = NULL;
- int array_index = 0;
-
- if (strstr(str, "source_pos")) {
- array_edit = 1;
- array = g_MyState.source_pos;
- } else if (strstr(str, "source_vel")) {
- array_edit = 1;
- array = g_MyState.source_vel;
- } else if (strstr(str, "listener_pos")) {
- array_edit = 1;
- array = g_MyState.listener_pos;
- } else if (strstr(str, "listener_vel")) {
- array_edit = 1;
- array = g_MyState.listener_vel;
- } else if (strstr(str, "pitch")) {
- double val = atof(strstr(str, "= ") + 2);
- g_MyState.pitch = val;
- } else if (strstr(str, "gain")) {
- double val = atof(strstr(str, "= ") + 2);
- g_MyState.gain = val;
- }
-
- if (array_edit) {
- if (strstr(str, "_x")) {
- array_index = 0;
- } else if (strstr(str, "_y")) {
- array_index = 1;
- } else if (strstr(str, "_z")) {
- array_index = 2;
- }
- double val = atof(strstr(str, "= ") + 2);
- array[array_index] = val;
- }
-
- alSourcefv(g_MyState.source, AL_POSITION, g_MyState.source_pos);
- assert(alGetError() == AL_NO_ERROR);
- alSourcefv(g_MyState.source, AL_VELOCITY, g_MyState.source_vel);
- assert(alGetError() == AL_NO_ERROR);
- alListenerfv(AL_POSITION, g_MyState.listener_pos);
- assert(alGetError() == AL_NO_ERROR);
- alListenerfv(AL_VELOCITY, g_MyState.listener_vel);
- assert(alGetError() == AL_NO_ERROR);
- alSourcef(g_MyState.source, AL_PITCH, g_MyState.pitch);
- assert(alGetError() == AL_NO_ERROR);
- alSourcef(g_MyState.source, AL_GAIN, g_MyState.gain);
- assert(alGetError() == AL_NO_ERROR);
-}
-
-static PPP_Instance instance_interface = {
- &Instance_DidCreate,
- &Instance_DidDestroy,
- &Instance_DidChangeView,
- &Instance_DidChangeFocus,
- &Instance_HandleDocumentLoad,
-};
-
-static PPP_Messaging messaging_interface = {
- &Messaging_HandleMessage,
-};
-
-/* Global entrypoints --------------------------------------------------------*/
-
-PP_EXPORT int32_t
-PPP_InitializeModule(PP_Module module, PPB_GetInterface get_browser_interface) {
- g_get_browser_interface = get_browser_interface;
- g_module = module;
-
-#define GET_INTERFFACE(MEMBER_NAME, IFACE_NAME) \
- g_MyState.MEMBER_NAME = \
- (typeof(g_MyState.MEMBER_NAME))get_browser_interface(IFACE_NAME); \
- if (g_MyState.MEMBER_NAME == NULL) { \
- printf("Required interfaces are not available: %s\n", IFACE_NAME); \
- return -1; \
- }
-
- GET_INTERFFACE(core_interface, PPB_CORE_INTERFACE_1_0);
- GET_INTERFFACE(instance_interface, PPB_INSTANCE_INTERFACE_1_0);
- GET_INTERFFACE(request_interface, PPB_URLREQUESTINFO_INTERFACE_1_0);
- GET_INTERFFACE(loader_interface, PPB_URLLOADER_INTERFACE_1_0);
- GET_INTERFFACE(var_interface, PPB_VAR_INTERFACE_1_1);
-
- /* These interfaces are used by OpenAL so check for them here
- * to make sure they're available.
- */
- if (get_browser_interface(PPB_AUDIO_INTERFACE) == NULL ||
- get_browser_interface(PPB_AUDIO_CONFIG_INTERFACE) == NULL) {
- printf("Audio interfaces are not available.\n");
- return -1;
- }
-
- return PP_OK;
-}
-
-PP_EXPORT void PPP_ShutdownModule() {
-}
-
-PP_EXPORT const void* PPP_GetInterface(const char* interface_name) {
- if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0)
- return &instance_interface;
- if (strcmp(interface_name, PPP_MESSAGING_INTERFACE) == 0)
- return &messaging_interface;
- return NULL;
-}
diff --git a/ports/openal-ogg-demo/pkg_info b/ports/openal-ogg-demo/pkg_info
deleted file mode 100644
index 7eb7ffb..0000000
--- a/ports/openal-ogg-demo/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=openal-ogg-demo
-VERSION=0.1
-DEPENDS=(openal-soft libvorbis)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/openal-ogg-demo/sample.ogg b/ports/openal-ogg-demo/sample.ogg
deleted file mode 100644
index 000bf51..0000000
--- a/ports/openal-ogg-demo/sample.ogg
+++ /dev/null
Binary files differ
diff --git a/ports/openal-soft/build.sh b/ports/openal-soft/build.sh
deleted file mode 100644
index ed7fdcb..0000000
--- a/ports/openal-soft/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-EXECUTABLES=openal-info
-
-# Our cpuid.h file for i686 contains asm that doesn't validate so for
-# now we disable use of cpuid.h.
-# TODO(sbc): re-enable once this get fixed:
-# https://code.google.com/p/nativeclient/issues/detail?id=3836
-if [ "${NACL_ARCH}" = "i686" ]; then
- EXTRA_CMAKE_ARGS+=" -DHAVE_CPUID_H=0"
-fi
-
-# Defaults to dynamic lib, but newlib can only link statically.
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CMAKE_ARGS+=" -DLIBTYPE=STATIC"
-fi
diff --git a/ports/openal-soft/nacl.patch b/ports/openal-soft/nacl.patch
deleted file mode 100644
index f9b2fc7..0000000
--- a/ports/openal-soft/nacl.patch
+++ /dev/null
@@ -1,612 +0,0 @@
-diff --git a/Alc/ALc.c b/Alc/ALc.c
---- a/Alc/ALc.c
-+++ b/Alc/ALc.c
-@@ -61,6 +61,9 @@ struct BackendInfo {
-
- #define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
- static struct BackendInfo BackendList[] = {
-+#ifdef HAVE_PPAPI
-+ { "ppapi", NULL, alc_ppapi_init, alc_ppapi_deinit, alc_ppapi_probe, EmptyFuncs },
-+#endif
- #ifdef HAVE_PULSEAUDIO
- { "pulse", ALCpulseBackendFactory_getFactory, NULL, NULL, NULL, EmptyFuncs },
- #endif
-diff --git a/Alc/backends/ppapi.c b/Alc/backends/ppapi.c
-new file mode 100644
---- /dev/null
-+++ b/Alc/backends/ppapi.c
-@@ -0,0 +1,458 @@
-+/**
-+ * OpenAL cross platform audio library
-+ * Copyright (C) 2012
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ * Or go to http://www.gnu.org/copyleft/lgpl.html
-+ */
-+
-+#include "config.h"
-+
-+#include "alMain.h"
-+#include "alu.h"
-+#include "AL/al.h"
-+#include "AL/alc.h"
-+#include "threads.h"
-+
-+#include <ppapi/c/pp_completion_callback.h>
-+#include <ppapi/c/pp_instance.h>
-+#include <ppapi/c/ppb.h>
-+#include <ppapi/c/ppb_audio.h>
-+#include <ppapi/c/ppb_audio_config.h>
-+#include <ppapi/c/ppb_core.h>
-+#include <stdlib.h>
-+
-+/*
-+ * The output buffer will be this multiple of the OpenAL device update size.
-+ * This needs to be at least 2 or we can't buffer output properly.
-+ */
-+const ALuint kBufferPadMult = 4;
-+
-+/*
-+ * How many samples for each frame will be buffered to Pepper.
-+ * Keep this low for low latency, but not too low or we will be CPU bound.
-+ */
-+const ALuint kRequestedFrameCount = 1024;
-+
-+/*
-+ * 4 is 2-channels, 2-bytes per sample.
-+ */
-+const ALuint kFrameSizeInBytes = 4;
-+
-+typedef struct {
-+ /*
-+ * Simple circular buffer (single producer/consumer) to buffer data output
-+ * from OpenAL before it's handed off to PPAPI.
-+ */
-+ ALvoid *buffer;
-+ ALuint size;
-+
-+ struct PPB_AudioConfig_1_1* audio_config;
-+ struct PPB_Audio_1_1* audio;
-+ struct PPB_Core_1_0* core;
-+
-+ PP_Resource audio_config_res;
-+ PP_Resource audio_res;
-+ ALuint sample_frame_count;
-+
-+ volatile ALuint read_ptr;
-+ volatile ALuint write_ptr;
-+
-+ ALCdevice *device;
-+
-+ volatile int killNow;
-+ althrd_t thread;
-+ volatile ALint main_thread_init_status;
-+ ALuint buffer_ready;
-+} ppapi_data;
-+
-+static PP_Instance gInstance;
-+static PPB_GetInterface gGetInterface;
-+
-+AL_API void AL_APIENTRY alSetPpapiInfo(PP_Instance instance, PPB_GetInterface get_interface)
-+{
-+ TRACE("alSetPpapiInfo\n");
-+ gInstance = instance;
-+ gGetInterface = get_interface;
-+}
-+
-+/* This is the callback from PPAPI to fill in the audio buffer. */
-+void PPAPI_Audio_Callback(void *sample_buffer,
-+ uint32_t buffer_size_in_bytes,
-+ PP_TimeDelta UNUSED(latency),
-+ void* user_data)
-+{
-+ ppapi_data* data = (ppapi_data*)user_data;
-+ if(!data->buffer_ready) return;
-+
-+ ALuint write_proxy = data->write_ptr;
-+ if(data->read_ptr > data->write_ptr)
-+ write_proxy = data->write_ptr + data->size;
-+
-+ ALuint available_bytes = write_proxy - data->read_ptr;
-+ if(available_bytes < buffer_size_in_bytes)
-+ {
-+ WARN("buffer underrun (buffer size=%d) (only buffering %d)\n",
-+ buffer_size_in_bytes, available_bytes);
-+ /* Zero the part of the buffer that we cannot fill */
-+ memset(sample_buffer + available_bytes,
-+ 0,
-+ buffer_size_in_bytes - available_bytes);
-+ buffer_size_in_bytes = available_bytes;
-+ }
-+
-+ if(data->read_ptr + buffer_size_in_bytes > data->size)
-+ {
-+ /* This read straddles the buffer boundary, split it up. */
-+ memcpy(sample_buffer,
-+ data->buffer + data->read_ptr,
-+ data->size - data->read_ptr);
-+ memcpy(sample_buffer + (data->size - data->read_ptr),
-+ data->buffer,
-+ buffer_size_in_bytes - (data->size - data->read_ptr));
-+ }
-+ else
-+ {
-+ memcpy(sample_buffer,
-+ data->buffer + data->read_ptr,
-+ buffer_size_in_bytes);
-+ }
-+
-+ data->read_ptr += buffer_size_in_bytes;
-+ if(data->read_ptr >= data->size)
-+ data->read_ptr -= data->size;
-+}
-+
-+static const ALCchar ppapiDevice[] = "PPAPI Output";
-+
-+static int ppapi_thread(ALvoid *ptr)
-+{
-+ ALCdevice *Device = (ALCdevice*)ptr;
-+ ppapi_data *data = (ppapi_data*)Device->ExtraData;
-+
-+ ALuint UpdateSizeInBytes = Device->UpdateSize * kFrameSizeInBytes;
-+ ALuint SampleFrameInBytes = data->sample_frame_count * kFrameSizeInBytes;
-+
-+ /*
-+ * Start to buffer when less than this many bytes are buffered. Keep this
-+ * small for low latency but large enough so we don't starve Pepper.
-+ *
-+ * SampleFrameInBytes is the size of the buffer that PPAPI asks for each
-+ * callback. We want to keep twice this amount in the buffer at any given
-+ * time.
-+ */
-+ const ALuint MinBufferSizeInBytes = maxu(SampleFrameInBytes*2,
-+ UpdateSizeInBytes);
-+
-+ while(!data->killNow && Device->Connected)
-+ {
-+ ALuint write_proxy = data->write_ptr;
-+ if(data->read_ptr > data->write_ptr)
-+ write_proxy = data->write_ptr + data->size;
-+
-+ if(data->read_ptr + MinBufferSizeInBytes >= write_proxy)
-+ {
-+ aluMixData(Device,
-+ data->buffer + data->write_ptr,
-+ Device->UpdateSize);
-+ if(data->write_ptr + UpdateSizeInBytes > data->size)
-+ {
-+ /*
-+ * Spilled over the edge, copy the last bits to the beginning
-+ * of the buffer.
-+ */
-+ memcpy(data->buffer,
-+ data->buffer + data->size,
-+ UpdateSizeInBytes - (data->size - data->write_ptr));
-+ }
-+
-+ data->write_ptr += UpdateSizeInBytes;
-+ if(data->write_ptr >= data->size)
-+ data->write_ptr -= data->size;
-+ }
-+ /* Small 1 ms sleep so we don't use too much CPU time. */
-+ al_nssleep(0, 1000000);
-+ }
-+
-+ return 0;
-+}
-+
-+/* This needs to be called on the main PPAPI thread. */
-+static void ppapi_open_playback_main_thread(void* user_data, int32_t result)
-+{
-+ ppapi_data *data = (ppapi_data*)user_data;
-+ (void)result;
-+
-+ PP_AudioSampleRate rate = PP_AUDIOSAMPLERATE_44100;
-+ if(data->device->Frequency == 48000)
-+ rate = PP_AUDIOSAMPLERATE_48000;
-+
-+ data->sample_frame_count =
-+ data->audio_config->RecommendSampleFrameCount(
-+#ifdef PPB_AUDIO_CONFIG_INTERFACE_1_1
-+ gInstance,
-+#endif
-+ rate,
-+ kRequestedFrameCount);
-+
-+ data->audio_config_res =
-+ data->audio_config->CreateStereo16Bit(gInstance,
-+ rate,
-+ data->sample_frame_count);
-+
-+ if(data->audio_config->IsAudioConfig(data->audio_config_res) == PP_FALSE)
-+ {
-+ ERR("PPAPI initialization: audio config creation failed.");
-+ data->main_thread_init_status = -1;
-+ return;
-+ }
-+
-+ data->audio_res = data->audio->Create(gInstance,
-+ data->audio_config_res,
-+ PPAPI_Audio_Callback,
-+ (void*)data);
-+
-+ if(PP_FALSE == data->audio->IsAudio(data->audio_res))
-+ {
-+ ERR("PPAPI initialization: audio resource creation failed.");
-+ data->main_thread_init_status = -1;
-+ return;
-+ }
-+
-+ if(PP_FALSE == data->audio->StartPlayback(data->audio_res))
-+ {
-+ ERR("PPAPI initialization: start playback failed.");
-+ data->main_thread_init_status = -1;
-+ return;
-+ }
-+
-+ data->main_thread_init_status = 1;
-+}
-+
-+static ALCenum ppapi_open_playback(ALCdevice *device,
-+ const ALCchar *deviceName)
-+{
-+ TRACE("ppapi_open_playback\n");
-+ ppapi_data *data;
-+
-+ if(!deviceName)
-+ deviceName = ppapiDevice;
-+ else if(strcmp(deviceName, ppapiDevice) != 0)
-+ return ALC_INVALID_VALUE;
-+
-+ int channels = ChannelsFromDevFmt(device->FmtChans);
-+ int bytes = BytesFromDevFmt(device->FmtType);
-+
-+ if(channels != 2)
-+ {
-+ WARN("PPAPI only supports 2 channel output "
-+ "(%d channels requested)\n", channels);
-+ return ALC_INVALID_VALUE;
-+ }
-+ if(bytes != 2)
-+ {
-+ WARN("PPAPI only supports 16-bit output "
-+ "(%d bytes-per-channel requested, format=%#x)\n", bytes, device->FmtType);
-+ return ALC_INVALID_VALUE;
-+ }
-+ if(device->Frequency != 44100 && device->Frequency != 44800)
-+ {
-+ WARN("PPAPI only supports 44100 and 44800 sample frequencies "
-+ "(%d requested)\n", device->Frequency);
-+ return ALC_INVALID_VALUE;
-+ }
-+
-+ data = (ppapi_data*)calloc(1, sizeof(*data));
-+
-+ device->ExtraData = data;
-+ data->device = device;
-+
-+ data->audio_config = (struct PPB_AudioConfig_1_1 *)gGetInterface(
-+ PPB_AUDIO_CONFIG_INTERFACE_1_1);
-+ if(!data->audio_config)
-+ {
-+ free(data);
-+ return ALC_INVALID_VALUE;
-+ }
-+
-+ data->audio = (struct PPB_Audio_1_1*)gGetInterface(PPB_AUDIO_INTERFACE_1_1);
-+ if(!data->audio)
-+ {
-+ free(data);
-+ return ALC_INVALID_VALUE;
-+ }
-+
-+ data->core = (struct PPB_Core_1_0*)gGetInterface(PPB_CORE_INTERFACE_1_0);
-+ if(!data->core)
-+ {
-+ free(data);
-+ return ALC_INVALID_VALUE;
-+ }
-+
-+ al_string_copy_cstr(&device->DeviceName, deviceName);
-+
-+ return ALC_NO_ERROR;
-+}
-+
-+
-+/* This needs to be called on the main PPAPI thread. */
-+static void ppapi_close_playback_main_thread(void* user_data,
-+ int32_t UNUSED(result))
-+{
-+ ppapi_data *data = (ppapi_data*)user_data;
-+
-+ data->audio->StopPlayback(data->audio_res);
-+
-+ data->core->ReleaseResource(data->audio_res);
-+ data->core->ReleaseResource(data->audio_config_res);
-+
-+ if(data->buffer)
-+ free(data->buffer);
-+ free(data);
-+}
-+
-+static void ppapi_close_playback(ALCdevice *device)
-+{
-+ ppapi_data *data = (ppapi_data*)device->ExtraData;
-+
-+ if(data->core->IsMainThread())
-+ {
-+ ppapi_close_playback_main_thread(data, 0);
-+ }
-+ else
-+ {
-+ struct PP_CompletionCallback cb =
-+ PP_MakeCompletionCallback(ppapi_close_playback_main_thread, data);
-+ data->core->CallOnMainThread(0, cb, 0);
-+ }
-+
-+ device->ExtraData = NULL;
-+}
-+
-+static ALCboolean ppapi_reset_playback(ALCdevice *device)
-+{
-+ ppapi_data *data = (ppapi_data*)device->ExtraData;
-+
-+ ALuint UpdateSizeInBytes = device->UpdateSize * kFrameSizeInBytes;
-+ ALuint SampleFrameInBytes = data->sample_frame_count * kFrameSizeInBytes;
-+ /* kBufferPadMult is added to protect against buffer underruns. */
-+ data->size = maxu(UpdateSizeInBytes, SampleFrameInBytes) * kBufferPadMult;
-+
-+ /* Extra UpdateSize added so we can read off the end of the buffer in one
-+ * shot from aluMixData, but treat the buffer like it's of size data->size.
-+ */
-+ data->buffer = calloc(1, data->size + UpdateSizeInBytes);
-+ if(!data->buffer)
-+ {
-+ ERR("buffer malloc failed\n");
-+ return ALC_FALSE;
-+ }
-+ SetDefaultWFXChannelOrder(device);
-+
-+ data->read_ptr = 0;
-+ data->write_ptr = 0;
-+ data->buffer_ready = 1;
-+ return ALC_TRUE;
-+}
-+
-+static ALCboolean ppapi_start_playback(ALCdevice *device)
-+{
-+ TRACE("ppapi_start_playback\n");
-+ ppapi_data *data = (ppapi_data*)device->ExtraData;
-+
-+ if(althrd_create(&data->thread, ppapi_thread, device) != althrd_success)
-+ {
-+ free(data->buffer);
-+ data->buffer = NULL;
-+ return ALC_FALSE;
-+ }
-+
-+ if(data->core->IsMainThread())
-+ {
-+ ppapi_open_playback_main_thread(data, 0);
-+ }
-+ else
-+ {
-+ struct PP_CompletionCallback cb =
-+ PP_MakeCompletionCallback(ppapi_open_playback_main_thread, data);
-+ data->core->CallOnMainThread(0, cb, 0);
-+
-+ while(data->main_thread_init_status == 0)
-+ al_nssleep(0, 1000000);
-+ }
-+
-+ if(data->main_thread_init_status < 0) {
-+ free(data);
-+ return ALC_FALSE;
-+ }
-+
-+ return ALC_TRUE;
-+}
-+
-+static void ppapi_stop_playback(ALCdevice *device)
-+{
-+ ppapi_data *data = (ppapi_data*)device->ExtraData;
-+
-+ if(data->killNow)
-+ return;
-+
-+ int res;
-+ data->killNow = 1;
-+ althrd_join(data->thread, &res);
-+ data->killNow = 0;
-+
-+ data->buffer_ready = 0;
-+ free(data->buffer);
-+ data->buffer = NULL;
-+}
-+
-+
-+BackendFuncs ppapi_funcs = {
-+ ppapi_open_playback,
-+ ppapi_close_playback,
-+ ppapi_reset_playback,
-+ ppapi_start_playback,
-+ ppapi_stop_playback,
-+
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+
-+ ALCdevice_GetLatencyDefault
-+};
-+
-+ALCboolean alc_ppapi_init(BackendFuncs *func_list)
-+{
-+ TRACE("alc_ppapi_init\n");
-+ *func_list = ppapi_funcs;
-+ return ALC_TRUE;
-+}
-+
-+void alc_ppapi_deinit(void)
-+{
-+ TRACE("alc_ppapi_deinit\n");
-+}
-+
-+void alc_ppapi_probe(enum DevProbe type)
-+{
-+ TRACE("alc_ppapi_probe\n");
-+ if(type == CAPTURE_DEVICE_PROBE)
-+ AppendCaptureDeviceList(ppapiDevice);
-+ else if(type == ALL_DEVICE_PROBE)
-+ AppendAllDevicesList(ppapiDevice);
-+}
-diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c
---- a/Alc/mixer_neon.c
-+++ b/Alc/mixer_neon.c
-@@ -75,7 +75,7 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2],
- #undef SUFFIX
-
-
--void MixDirect_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
-+void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
- MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize)
- {
- ALfloat gain, step;
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -611,6 +611,7 @@ SET(HAVE_MMDEVAPI 0)
- SET(HAVE_WINMM 0)
- SET(HAVE_PORTAUDIO 0)
- SET(HAVE_PULSEAUDIO 0)
-+SET(HAVE_PPAPI 0)
- SET(HAVE_COREAUDIO 0)
- SET(HAVE_OPENSL 0)
- SET(HAVE_WAVE 0)
-@@ -976,6 +977,17 @@ IF(ALSOFT_REQUIRE_OPENSL AND NOT HAVE_OPENSL)
- MESSAGE(FATAL_ERROR "Failed to enabled required OpenSL backend")
- ENDIF()
-
-+# Check PPAPI backend
-+OPTION(PPAPI "Check for PPAPI backend" ON)
-+IF (PPAPI)
-+ CHECK_INCLUDE_FILE(ppapi/c/ppb_audio.h HAVE_PPAPI_PPB_AUDIO_H)
-+ IF(HAVE_PPAPI_PPB_AUDIO_H)
-+ SET(HAVE_PPAPI 1)
-+ SET(ALC_OBJS ${ALC_OBJS} Alc/backends/ppapi.c)
-+ SET(BACKENDS "${BACKENDS} PPAPI,")
-+ ENDIF()
-+ENDIF()
-+
- # Optionally enable the Wave Writer backend
- OPTION(ALSOFT_BACKEND_WAVE "Enable Wave Writer backend" ON)
- IF(ALSOFT_BACKEND_WAVE)
-@@ -1030,7 +1042,12 @@ CONFIGURE_FILE(
- ADD_LIBRARY(common STATIC ${COMMON_OBJS})
-
- # Build main library
--ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
-+IF(LIBTYPE STREQUAL "STATIC")
-+ ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS} ${COMMON_OBJS})
-+ELSE()
-+ ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
-+ENDIF()
-+
- SET_PROPERTY(TARGET ${LIBNAME} APPEND PROPERTY COMPILE_DEFINITIONS AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES)
- IF(WIN32 AND ALSOFT_NO_UID_DEFS)
- SET_PROPERTY(TARGET ${LIBNAME} APPEND PROPERTY COMPILE_DEFINITIONS AL_NO_UID_DEFS)
-diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
---- a/OpenAL32/Include/alMain.h
-+++ b/OpenAL32/Include/alMain.h
-@@ -273,6 +273,14 @@ typedef ptrdiff_t ALsizeiptrEXT;
- #define U64(x) ((ALuint64)(x##ul))
- #elif SIZEOF_LONG_LONG == 8
- #define U64(x) ((ALuint64)(x##ull))
-+#elif defined(__WORDSIZE)
-+#if __WORDSIZE == 64
-+#define U64(x) ((ALuint64)(x##ul))
-+#else
-+#define U64(x) ((ALuint64)(x##ull))
-+#endif
-+#else
-+#error "unable to define U64"
- #endif
- #endif
-
-@@ -500,6 +508,9 @@ void alc_opensl_probe(enum DevProbe type);
- ALCboolean alc_qsa_init(BackendFuncs *func_list);
- void alc_qsa_deinit(void);
- void alc_qsa_probe(enum DevProbe type);
-+ALCboolean alc_ppapi_init(BackendFuncs *func_list);
-+void alc_ppapi_deinit(void);
-+void alc_ppapi_probe(enum DevProbe type);
-
- struct ALCbackend;
-
-@@ -549,7 +560,7 @@ enum DevFmtType {
- DevFmtUInt = ALC_UNSIGNED_INT_SOFT,
- DevFmtFloat = ALC_FLOAT_SOFT,
-
-- DevFmtTypeDefault = DevFmtFloat
-+ DevFmtTypeDefault = DevFmtShort
- };
- enum DevFmtChannels {
- DevFmtMono = ALC_MONO_SOFT,
-diff --git a/config.h.in b/config.h.in
---- a/config.h.in
-+++ b/config.h.in
-@@ -70,6 +70,9 @@
- /* Define if we have the OpenSL backend */
- #cmakedefine HAVE_OPENSL
-
-+/* Define if we have the PPAPI backend */
-+#cmakedefine HAVE_PPAPI
-+
- /* Define if we have the Wave Writer backend */
- #cmakedefine HAVE_WAVE
-
-diff --git a/include/AL/alc.h b/include/AL/alc.h
---- a/include/AL/alc.h
-+++ b/include/AL/alc.h
-@@ -230,6 +230,15 @@ typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
- typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
- typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
-
-+#if defined(__native_client__)
-+#include <ppapi/c/ppp.h>
-+#include <ppapi/c/ppp_instance.h>
-+/* This function is part of the NaCl libopenal port and is
-+ * required to be called before OpenAL initialization.
-+ */
-+extern void alSetPpapiInfo(PP_Instance, PPB_GetInterface);
-+#endif
-+
- #if defined(__cplusplus)
- }
- #endif
-diff --git a/include/atomic.h b/include/atomic.h
---- a/include/atomic.h
-+++ b/include/atomic.h
-@@ -11,7 +11,7 @@ extern "C" {
- typedef void *volatile XchgPtr;
-
- /* Atomics using C11 */
--#ifdef HAVE_C11_ATOMIC
-+#if defined(HAVE_C11_ATOMIC) && !defined(__native_client__)
-
- #include <stdatomic.h>
-
diff --git a/ports/openal-soft/pkg_info b/ports/openal-soft/pkg_info
deleted file mode 100644
index 2e898b2..0000000
--- a/ports/openal-soft/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=openal-soft
-VERSION=1.16.0
-URL=http://kcat.strangesoft.net/openal-releases/openal-soft-1.16.0.tar.bz2
-LICENSE=LGPL2
-# sched_yield no defined
-SHA1=f70892fc075ae726320478c0179f7011fea0d157
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/opencv/build.sh b/ports/opencv/build.sh
deleted file mode 100644
index 2cdaa21..0000000
--- a/ports/opencv/build.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2013 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.
-
-EXECUTABLES="
-bin/opencv_createsamples
-bin/opencv_haartraining
-bin/opencv_performance
-bin/opencv_traincascade
-"
-EXTRA_CMAKE_ARGS="-DBUILD_SHARED_LIBS=OFF \
- -DWITH_FFMPEG=OFF \
- -DWITH_OPENEXR=OFF \
- -DWITH_CUDA=OFF \
- -DWITH_JASPER=OFF \
- -DWITH_OPENCL=OFF \
- -DWITH_1394=OFF \
- -DWITH_V4L=OFF \
- -DBUILD_opencv_java=OFF \
- -DBUILD_TESTS=OFF \
- -DBUILD_PERF_TESTS=OFF \
- -DBUILD_FAT_JAVA_LIB=OFF"
-
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CMAKE_ARGS+=" -DBUILD_SHARED_LIBS=OFF"
-fi
diff --git a/ports/opencv/nacl.patch b/ports/opencv/nacl.patch
deleted file mode 100644
index f89934e..0000000
--- a/ports/opencv/nacl.patch
+++ /dev/null
@@ -1,253 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -326,8 +326,10 @@ else()
- endif()
- endif()
-
--set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
--set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-+if(BUILD_SHARED_LIBS)
-+ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
-+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-+endif()
-
- if(INSTALL_TO_MANGLED_PATHS)
- set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-${OPENCV_VERSION})
-@@ -434,6 +436,8 @@ if(UNIX)
- set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly")
- set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
-+ elseif(NACL AND NACL_LIBC STREQUAL "newlib")
-+ set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
- else()
- set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
- endif()
-@@ -449,8 +453,8 @@ include(cmake/OpenCVModule.cmake)
- # Detect endianness of build platform
- # ----------------------------------------------------------------------------
-
--if(CMAKE_SYSTEM_NAME STREQUAL iOS)
-- # test_big_endian needs try_compile, which doesn't work for iOS
-+if(CMAKE_SYSTEM_NAME STREQUAL iOS OR NACL)
-+ # test_big_endian needs try_compile, which doesn't work for iOS or PNaCl
- # http://public.kitware.com/Bug/view.php?id=12288
- set(WORDS_BIGENDIAN 0)
- else()
-diff --git a/modules/contrib/src/inputoutput.cpp b/modules/contrib/src/inputoutput.cpp
---- a/modules/contrib/src/inputoutput.cpp
-+++ b/modules/contrib/src/inputoutput.cpp
-@@ -76,7 +76,8 @@ namespace cv
- {
- return list;
- }
--
-+// NaCl does not define struct fields to deal with folders.
-+#ifndef __native_client__
- while ((dirp = readdir(dp)) != NULL)
- {
- if (dirp->d_type == DT_REG)
-@@ -89,6 +90,7 @@ namespace cv
- }
- }
- closedir(dp);
-+#endif //#ifndef __native__client__
- #endif
-
- return list;
-@@ -166,7 +168,8 @@ namespace cv
- {
- return list;
- }
--
-+// NaCl does not define struct fields to deal with folders.
-+#ifndef __native_client__
- while ((dirp = readdir(dp)) != NULL)
- {
- if (dirp->d_type == DT_DIR &&
-@@ -181,6 +184,8 @@ namespace cv
- }
- }
- closedir(dp);
-+#endif //#ifndef __native__client__
-+
- #endif
-
- return list;
-diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp
---- a/modules/core/include/opencv2/core/operations.hpp
-+++ b/modules/core/include/opencv2/core/operations.hpp
-@@ -58,7 +58,13 @@
-
- #if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__
- #ifdef __ATOMIC_SEQ_CST
-+ // Clang in NaCl "cannot compile this atomic library call yet": use
-+ // instead a programmatic atomic fetch.
-+ #ifndef __native_client__
- #define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST)
-+ #else
-+ static inline int CV_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; }
-+ #endif //#ifndef __native_client__
- #else
- #define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), (delta), 5)
- #endif
-diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
---- a/modules/core/src/system.cpp
-+++ b/modules/core/src/system.cpp
-@@ -491,7 +491,11 @@ string tempfile( const char* suffix )
- const int fd = mkstemp((char*)fname.c_str());
- if (fd == -1) return string();
-
-+# ifndef __native_client__
- close(fd);
-+# else
-+ fclose((FILE*)fd);
-+# endif //#ifndef __native_client__
- remove(fname.c_str());
- # endif
-
-diff --git a/modules/flann/include/opencv2/flann/allocator.h b/modules/flann/include/opencv2/flann/allocator.h
---- a/modules/flann/include/opencv2/flann/allocator.h
-+++ b/modules/flann/include/opencv2/flann/allocator.h
-@@ -68,7 +68,10 @@ T* allocate(size_t count = 1)
- *
- */
-
-+// Some NaCl toolchains used to defined this.
-+#if !defined(__native_client__) || !defined(WORDSIZE)
- const size_t WORDSIZE=16;
-+#endif
- const size_t BLOCKSIZE=8192;
-
- class PooledAllocator
-diff --git a/modules/legacy/include/opencv2/legacy/legacy.hpp b/modules/legacy/include/opencv2/legacy/legacy.hpp
---- a/modules/legacy/include/opencv2/legacy/legacy.hpp
-+++ b/modules/legacy/include/opencv2/legacy/legacy.hpp
-@@ -519,8 +519,8 @@ typedef struct CvStereoCamera
-
- /* New part for stereo */
- CvPoint3D32f epipole[2];
-- CvPoint2D32f quad[2][4]; /* coordinates of destination quadrangle after
-- epipolar geometry rectification */
-+ CvPoint2D32f quads[2][4]; /* coordinates of destination quadrangle after
-+ epipolar geometry rectification */
- double coeffs[2][3][3];/* coefficients for transformation */
- CvPoint2D32f border[2][4];
- CvSize warpSize;
-diff --git a/modules/legacy/src/calibfilter.cpp b/modules/legacy/src/calibfilter.cpp
---- a/modules/legacy/src/calibfilter.cpp
-+++ b/modules/legacy/src/calibfilter.cpp
-@@ -42,7 +42,10 @@
- #include "precomp.hpp"
- #include <stdio.h>
-
-+// PNaCl likes this preprocessor definition active, to use a struct field.
-+#ifndef __native_client__
- #undef quad
-+#endif //#ifndef __native_client__
-
- CvCalibFilter::CvCalibFilter()
- {
-@@ -95,10 +98,11 @@ bool CvCalibFilter::SetEtalon( CvCalibEtalonType type, double* params,
-
- Stop();
-
-- if (latestPoints != NULL)
-+ for( i = 0; i < MAX_CAMERAS; i++ )
- {
-- for( i = 0; i < MAX_CAMERAS; i++ )
-+ if( latestPoints[i] != NULL ) {
- cvFree( latestPoints + i );
-+ }
- }
-
- if( type == CV_CALIB_ETALON_USER || type != etalonType )
-@@ -529,7 +533,8 @@ void CvCalibFilter::DrawPoints( CvMat** dstarr )
- return;
- }
-
-- if( latestCounts )
-+
-+ if( 1 ) //latestCounts
- {
- for( i = 0; i < cameraCount; i++ )
- {
-@@ -686,8 +691,8 @@ bool CvCalibFilter::SaveCameraParams( const char* filename )
- {
- for( j = 0; j < 4; j++ )
- {
-- fprintf(f, "%15.10f ", stereo.quad[i][j].x );
-- fprintf(f, "%15.10f ", stereo.quad[i][j].y );
-+ fprintf(f, "%15.10f ", stereo.quads[i][j].x );
-+ fprintf(f, "%15.10f ", stereo.quads[i][j].y );
- }
- fprintf(f, "\n");
- }
-@@ -743,9 +748,9 @@ bool CvCalibFilter::LoadCameraParams( const char* filename )
- {
- for( j = 0; j < 4; j++ )
- {
-- int values_read = fscanf(f, "%f ", &(stereo.quad[i][j].x) );
-+ int values_read = fscanf(f, "%f ", &(stereo.quads[i][j].x) );
- CV_Assert(values_read == 1);
-- values_read = fscanf(f, "%f ", &(stereo.quad[i][j].y) );
-+ values_read = fscanf(f, "%f ", &(stereo.quads[i][j].y) );
- CV_Assert(values_read == 1);
- }
- }
-diff --git a/modules/legacy/src/epilines.cpp b/modules/legacy/src/epilines.cpp
---- a/modules/legacy/src/epilines.cpp
-+++ b/modules/legacy/src/epilines.cpp
-@@ -46,7 +46,10 @@
-
- /* Valery Mosyagin */
-
-+// PNaCl likes this preprocessor definition active, to use a struct field.
-+#ifndef __native_client__
- #undef quad
-+#endif //#ifndef __native_client__
-
- #define EPS64D 1e-9
-
-@@ -312,11 +315,11 @@ int icvComputeCoeffForStereo( CvStereoCamera* stereoCamera)
- int i;
- for( i = 0; i < 4; i++ )
- {
-- quad1[i][0] = stereoCamera->quad[0][i].x;
-- quad1[i][1] = stereoCamera->quad[0][i].y;
-+ quad1[i][0] = stereoCamera->quads[0][i].x;
-+ quad1[i][1] = stereoCamera->quads[0][i].y;
-
-- quad2[i][0] = stereoCamera->quad[1][i].x;
-- quad2[i][1] = stereoCamera->quad[1][i].y;
-+ quad2[i][0] = stereoCamera->quads[1][i].x;
-+ quad2[i][1] = stereoCamera->quads[1][i].y;
- }
-
- icvComputeCoeffForStereoNew( quad1,
-@@ -1761,8 +1764,8 @@ void icvGetQuadsTransformStruct( CvStereoCamera* stereoCamera)
- int i;
- for( i = 0; i < 4; i++ )
- {
-- stereoCamera->quad[0][i] = cvPoint2D32f(quad1[i][0],quad1[i][1]);
-- stereoCamera->quad[1][i] = cvPoint2D32f(quad2[i][0],quad2[i][1]);
-+ stereoCamera->quads[0][i] = cvPoint2D32f(quad1[i][0],quad1[i][1]);
-+ stereoCamera->quads[1][i] = cvPoint2D32f(quad2[i][0],quad2[i][1]);
- }
-
- return;
-@@ -3067,12 +3070,12 @@ int icvComputeRestStereoParams(CvStereoCamera *stereoparams)
- icvGetQuadsTransformStruct(stereoparams);
-
- cvInitPerspectiveTransform( stereoparams->warpSize,
-- stereoparams->quad[0],
-+ stereoparams->quads[0],
- stereoparams->coeffs[0],
- 0);
-
- cvInitPerspectiveTransform( stereoparams->warpSize,
-- stereoparams->quad[1],
-+ stereoparams->quads[1],
- stereoparams->coeffs[1],
- 0);
-
diff --git a/ports/opencv/pkg_info b/ports/opencv/pkg_info
deleted file mode 100644
index d90ac26..0000000
--- a/ports/opencv/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=opencv
-VERSION=2.4.9
-URL=https://github.com/Itseez/opencv/archive/2.4.9/opencv-2.4.9.tar.gz
-LICENSE=BSD:doc/license.txt
-# TODO(sbc): remove this conditional once this bug gets fixed:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-DISABLED_ARCH=(arm)
-DEPENDS=(zlib libpng jpeg6b tiff)
-SHA1=d16ced627db17f9864c681545f18f030c7a4cc0b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/openjpeg/build.sh b/ports/openjpeg/build.sh
deleted file mode 100644
index 3ddfa8f..0000000
--- a/ports/openjpeg/build.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="bin/opj_decompress bin/opj_compress"
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-if [ "${NACL_SHARED}" != "1" ]; then
- EXTRA_CMAKE_ARGS+=" -DBUILD_SHARED_LIBS=OFF"
-fi
-
-if [ "${NACL_ARCH}" = "pnacl" ]; then
- # The cmake endian test fails on PNaCl as it tries to search
- # for string constants in object files which doesn't work in
- # bitcode files. Instead disable the endian test and just use
- # the default (littleendian).
- EXTRA_CMAKE_ARGS+=" -DHAVE_OPJ_BIG_ENDIAN=TRUE"
-fi
diff --git a/ports/openjpeg/pkg_info b/ports/openjpeg/pkg_info
deleted file mode 100644
index e804ea0..0000000
--- a/ports/openjpeg/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=openjpeg
-VERSION=2.1.0
-URL=http://download.sf.net/openjpeg.mirror/2.1.0/openjpeg-2.1.0.tar.gz
-LICENSE=BSD
-SHA1=c2a255f6b51ca96dc85cd6e85c89d300018cb1cb
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/openscenegraph/build.sh b/ports/openscenegraph/build.sh
deleted file mode 100644
index aee0993..0000000
--- a/ports/openscenegraph/build.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2011 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.
-
-BUILD_DIR=${SRC_DIR}
-
-export LIB_OSG=libosg.a
-export LIB_OSGUTIL=libosgUtil.a
-export LIB_OPENTHREADS=libOpenThreads.a
-
-ConfigureStep() {
- return 0
-}
-
-BuildStep() {
- SetupCrossEnvironment
- CFLAGS+=" ${CPPFLAGS}"
- CXXFLAGS+=" ${CPPFLAGS}"
- DefaultBuildStep
-}
-
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}
- Remove ${DESTDIR_INCLUDE}/osg
- Remove ${DESTDIR_INCLUDE}/osgUtil
- Remove ${DESTDIR_INCLUDE}/OpenThreads
- LogExecute cp -R include/osg ${DESTDIR_INCLUDE}/osg
- LogExecute cp -R include/osgUtil ${DESTDIR_INCLUDE}/osgUtil
- LogExecute cp -R include/OpenThreads ${DESTDIR_INCLUDE}/OpenThreads
- Remove ${DESTDIR_LIB}/libosg.a
- Remove ${DESTDIR_LIB}/libosgUtil.a
- Remove ${DESTDIR_LIB}/libOpenThreads.a
- install -m 644 ${LIB_OSG} ${DESTDIR_LIB}/${LIB_OSG}
- install -m 644 ${LIB_OSGUTIL} ${DESTDIR_LIB}/${LIB_OSGUTIL}
- install -m 644 ${LIB_OPENTHREADS} ${DESTDIR_LIB}/${LIB_OPENTHREADS}
-}
diff --git a/ports/openscenegraph/nacl.patch b/ports/openscenegraph/nacl.patch
deleted file mode 100644
index 68c7d4b..0000000
--- a/ports/openscenegraph/nacl.patch
+++ /dev/null
@@ -1,1314 +0,0 @@
-diff --git a/Makefile b/Makefile
-new file mode 100644
---- /dev/null
-+++ b/Makefile
-@@ -0,0 +1,17 @@
-+export CXXFLAGS += -O3
-+
-+.PHONY: all clean
-+
-+NACLPORTS_INCLUDE = ../../../toolchain/$(OS_PREFIX)_x86/nacl/usr/include
-+
-+all:
-+ cd src/osg && $(MAKE) all
-+ cd src/osgUtil && $(MAKE) all
-+ cd src/OpenThreads && $(MAKE) all
-+
-+clean:
-+ @echo Make clean
-+ rm -f *.a
-+ cd src/osg && $(MAKE) clean
-+ cd src/osgUtil && $(MAKE) clean
-+ cd src/OpenThreads && $(MAKE) clean
-diff --git a/include/OpenThreads/Config b/include/OpenThreads/Config
-new file mode 100644
---- /dev/null
-+++ b/include/OpenThreads/Config
-@@ -0,0 +1,42 @@
-+/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008 Robert Osfield
-+ *
-+ * This library is open source and may be redistributed and/or modified under
-+ * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
-+ * (at your option) any later version. The full license is in LICENSE file
-+ * included with this distribution, and on the openscenegraph.org website.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * OpenSceneGraph Public License for more details.
-+*/
-+
-+/****************************************************************************
-+ * THIS FILE IS AUTOGENERATED BY CMAKE. DO NOT EDIT!
-+ ****************************************************************************/
-+
-+/* Changes to the configuration reflected here can be made with ccmake on
-+ * unix or with cmake-gui on windows. Alternatively you can use cmake's -D
-+ * or -P switches to set some configuration values at cmake configuration time.
-+ */
-+
-+#ifndef _OPENTHREADS_CONFIG
-+#define _OPENTHREADS_CONFIG
-+
-+#ifdef __linux__
-+#define _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
-+#endif // __linux__
-+
-+/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */
-+/* #undef _OPENTHREADS_ATOMIC_USE_SUN */
-+
-+#ifdef WIN32
-+#define _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
-+#endif // WIN32
-+
-+/* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */
-+/* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */
-+
-+#define OT_LIBRARY_STATIC
-+
-+#endif
-diff --git a/include/osg/Array b/include/osg/Array
---- a/include/osg/Array
-+++ b/include/osg/Array
-@@ -154,7 +154,7 @@ class TemplateArray : public Array, public MixinVector<T>
- TemplateArray& operator = (const TemplateArray& array)
- {
- if (this==&array) return *this;
-- assign(array.begin(),array.end());
-+ this->assign(array.begin(),array.end());
- return *this;
- }
-
-@@ -240,7 +240,7 @@ class TemplateIndexArray : public IndexArray, public MixinVector<T>
- TemplateIndexArray& operator = (const TemplateIndexArray& array)
- {
- if (this==&array) return *this;
-- assign(array.begin(),array.end());
-+ this->assign(array.begin(),array.end());
- return *this;
- }
-
-diff --git a/include/osg/Config b/include/osg/Config
-new file mode 100644
---- /dev/null
-+++ b/include/osg/Config
-@@ -0,0 +1,48 @@
-+/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008-2009 Robert Osfield
-+ *
-+ * This library is open source and may be redistributed and/or modified under
-+ * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
-+ * (at your option) any later version. The full license is in LICENSE file
-+ * included with this distribution, and on the openscenegraph.org website.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * OpenSceneGraph Public License for more details.
-+*/
-+
-+/****************************************************************************
-+ * THIS FILE IS AUTOGENERATED BY CMAKE. DO NOT EDIT!
-+ ****************************************************************************/
-+
-+/* Changes to the configuration reflected here can be made with ccmake on
-+ * unix or with cmake-gui on windows. Alternatively you can use cmake's -D
-+ * or -P switches to set some configuration values at cmake configuration time.
-+ */
-+
-+#ifndef OSG_CONFIG
-+#define OSG_CONFIG 1
-+
-+/* #undef OSG_NOTIFY_DISABLED */
-+#define OSG_USE_FLOAT_MATRIX
-+#define OSG_USE_FLOAT_PLANE
-+#define OSG_USE_FLOAT_BOUNDINGSPHERE
-+#define OSG_USE_FLOAT_BOUNDINGBOX
-+#define OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION
-+/* #undef OSG_USE_UTF8_FILENAME */
-+#define OSG_DISABLE_MSVC_WARNINGS
-+
-+/* #undef OSG_GLU_AVAILABLE */
-+/* #undef OSG_GL1_AVAILABLE */
-+/* #undef OSG_GL2_AVAILABLE */
-+/* #undef OSG_GL3_AVAILABLE */
-+/* #undef OSG_GLES1_AVAILABLE */
-+#define OSG_GLES2_AVAILABLE
-+#define OSG_GL_LIBRARY_STATIC
-+/* #undef OSG_GL_DISPLAYLISTS_AVAILABLE */
-+/* #undef OSG_GL_MATRICES_AVAILABLE */
-+/* #undef OSG_GL_VERTEX_FUNCS_AVAILABLE */
-+/* #undef OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE */
-+/* #undef OSG_GL_FIXED_FUNCTION_AVAILABLE */
-+
-+#endif
-diff --git a/include/osg/Math b/include/osg/Math
---- a/include/osg/Math
-+++ b/include/osg/Math
-@@ -211,9 +211,19 @@ inline double round(double v) { return v>=0.0?floor(v+0.5):ceil(v-0.5); }
- inline bool isNaN(float v) { return std::isnan(v); }
- inline bool isNaN(double v) { return std::isnan(v); }
- #else
-- // Need to use to std::isnan to avoid undef problem from <cmath>
-- inline bool isNaN(float v) { return isnan(v); }
-- inline bool isNaN(double v) { return isnan(v); }
-+ #if defined(__native_client__)
-+ #if defined(_GLIBCXX_HAVE_ISNAN) || defined(isnan)
-+ inline bool isNaN(float v) { return isnan(v); }
-+ inline bool isNaN(double v) { return isnan(v); }
-+ #else
-+ inline bool isNaN(float v) { return std::isnan(v); }
-+ inline bool isNaN(double v) { return std::isnan(v); }
-+ #endif
-+ #else
-+ // Need to use to std::isnan to avoid undef problem from <cmath>
-+ inline bool isNaN(float v) { return isnan(v); }
-+ inline bool isNaN(double v) { return isnan(v); }
-+ #endif
- #endif
- #endif
-
-diff --git a/src/OpenThreads/Makefile b/src/OpenThreads/Makefile
-new file mode 100644
---- /dev/null
-+++ b/src/OpenThreads/Makefile
-@@ -0,0 +1,43 @@
-+OSG_ROOT = ../..
-+
-+INCLUDE = -I$(OSG_ROOT)/include
-+
-+NACL_PORTS_PREFIX = ../../../../../toolchain/$(OS_PREFIX)_x86/nacl/usr
-+
-+NACLPORTS_INCLUDE = $(NACL_PORTS_PREFIX)/include
-+
-+NACLPORTS_LIBDIR = $(NACL_PORTS_PREFIX)/lib
-+
-+INCLUDE = -I$(OSG_ROOT)/include
-+
-+COMMON_OBJ_FILES = \
-+ common/Atomic.o \
-+ common/Version.o
-+
-+PTHREADS_OBJ_FILES = \
-+ pthreads/PThread.o \
-+ pthreads/PThreadBarrier.o \
-+ pthreads/PThreadCondition.o \
-+ pthreads/PThreadMutex.o
-+
-+OBJ_DIR = obj
-+
-+all: $(LIB_OPENTHREADS)
-+ @echo "Making libOpenThreads"
-+
-+clean:
-+ rm -rf $(OBJ_DIR) $(LIB_OPENTHREADS)
-+
-+$(OBJ_DIR):
-+ mkdir $(OBJ_DIR)
-+ mkdir $(OBJ_DIR)/common
-+ mkdir $(OBJ_DIR)/pthreads
-+
-+$(COMMON_OBJ_FILES): %.o: %.cpp $(OBJ_DIR)
-+ $(CXX) -c $(INCLUDE) $(CXXFLAGS) $< -o $(OBJ_DIR)/$@
-+
-+$(PTHREADS_OBJ_FILES): %.o: %.c++ $(OBJ_DIR)
-+ $(CXX) -c $(INCLUDE) $(CXXFLAGS) $< -o $(OBJ_DIR)/$@
-+
-+$(LIB_OPENTHREADS): $(OBJ_DIR) $(COMMON_OBJ_FILES) $(PTHREADS_OBJ_FILES)
-+ cd $(OBJ_DIR) && $(AR) rcs ../$(OSG_ROOT)/$(LIB_OPENTHREADS) $(COMMON_OBJ_FILES) $(PTHREADS_OBJ_FILES)
-diff --git a/src/OpenThreads/common/Version.in b/src/OpenThreads/common/Version.in
-new file mode 100644
---- /dev/null
-+++ b/src/OpenThreads/common/Version.in
-@@ -0,0 +1,38 @@
-+/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group
-+ *
-+ * This library is open source and may be redistributed and/or modified under
-+ * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
-+ * (at your option) any later version. The full license is in LICENSE file
-+ * included with this distribution, and on the openscenegraph.org website.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * OpenSceneGraph Public License for more details.
-+*/
-+
-+#ifndef OPENTHREADS_VERSION
-+#define OPENTHREADS_VERSION 1
-+
-+#include <OpenThreads/Exports>
-+
-+extern "C" {
-+
-+#define OPENTHREADS_MAJOR_VERSION @OPENTHREADS_MAJOR_VERSION@
-+#define OPENTHREADS_MINOR_VERSION @OPENTHREADS_MINOR_VERSION@
-+#define OPENTHREADS_PATCH_VERSION @OPENTHREADS_PATCH_VERSION@
-+#define OPENTHREADS_SOVERSION @OPENTHREADS_SOVERSION@
-+
-+/** OpenThreadsGetVersion() returns the library version number.
-+ * Numbering convention : OpenThreads-1.0 will return 1.0 from OpenThreadsGetVersion. */
-+extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetVersion();
-+
-+/** The OpenThreadsGetSOVersion() method returns the OpenSceneGraph soversion number. */
-+extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetSOVersion();
-+
-+/** The OpenThreadsGetLibraryName() method returns the library name in human-friendly form. */
-+extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetLibraryName();
-+
-+}
-+
-+#endif
-diff --git a/src/OpenThreads/pthreads/PThread.c++ b/src/OpenThreads/pthreads/PThread.c++
---- a/src/OpenThreads/pthreads/PThread.c++
-+++ b/src/OpenThreads/pthreads/PThread.c++
-@@ -45,6 +45,7 @@
- #endif
-
- #include <OpenThreads/Thread>
-+#include "PThreadCleanup.h"
- #include "PThreadPrivateData.h"
-
- #include <iostream>
-@@ -149,7 +150,7 @@ private:
- printf("Error: pthread_setspecific(,) returned error status, status = %d\n",status);
- }
-
-- pthread_cleanup_push(thread_cleanup_handler, &tcs);
-+ PThreadCleanup thread_cleanup(thread_cleanup_handler, &tcs);
-
- #ifdef ALLOW_PRIORITY_SCHEDULING
-
-@@ -169,7 +170,7 @@ private:
-
- pd->isRunning = false;
-
-- pthread_cleanup_pop(0);
-+ thread_cleanup.Reset(0);
-
- return 0;
-
-@@ -387,6 +388,7 @@ Thread::Thread() {
- pd->threadPriority = Thread::THREAD_PRIORITY_DEFAULT;
- pd->threadPolicy = Thread::THREAD_SCHEDULE_DEFAULT;
- pd->cpunum = -1;
-+ pd->isCanceledMutex = new Mutex(Mutex::MUTEX_RECURSIVE);
-
- _prvData = static_cast<void *>(pd);
-
-@@ -412,6 +414,7 @@ Thread::~Thread()
- cancel();
- }
-
-+ delete pd->isCanceledMutex;
- delete pd;
-
- _prvData = 0;
-@@ -693,14 +696,16 @@ int Thread::join() {
- //
- int Thread::testCancel() {
-
-+ int rv = 0;
- PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
--
-- if(pthread_self() != pd->tid)
-- return -1;
--
-- pthread_testcancel();
--
-- return 0;
-+ if (pd->isRunning)
-+ {
-+ pd->isCanceledMutex->lock();
-+ if (pd->isCanceled)
-+ rv = 1;
-+ pd->isCanceledMutex->unlock();
-+ }
-+ return rv;
-
- }
-
-@@ -716,56 +721,15 @@ int Thread::cancel() {
- PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
- if (pd->isRunning)
- {
-+ pd->isCanceledMutex->lock();
- pd->isCanceled = true;
-- int status = pthread_cancel(pd->tid);
-- return status;
-+ pd->isCanceledMutex->unlock();
- }
- return 0;
- }
-
- //-----------------------------------------------------------------------------
- //
--// Description: Disable cancelibility
--//
--// Use: public
--//
--int Thread::setCancelModeDisable() {
--
-- return pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, 0 );
--
--}
--
--//-----------------------------------------------------------------------------
--//
--// Description: set the thread to cancel immediately
--//
--// Use: public
--//
--int Thread::setCancelModeAsynchronous() {
--
-- int status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
-- if(status != 0) return status;
--
-- return pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, 0);
--}
--
--//-----------------------------------------------------------------------------
--//
--// Description: set the thread to cancel at the next convienent point.
--//
--// Use: public
--//
--int Thread::setCancelModeDeferred() {
--
-- int status = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, 0);
-- if(status != 0) return status;
--
-- return pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, 0);
--
--}
--
--//-----------------------------------------------------------------------------
--//
- // Description: Set the thread's schedule priority (if able)
- //
- // Use: public
-@@ -910,7 +874,7 @@ int Thread::YieldCurrentThread()
- //
- int Thread::microSleep(unsigned int microsec)
- {
-- return ::usleep(microsec);
-+ return ::sleep(microsec);
- }
-
-
-diff --git a/src/OpenThreads/pthreads/PThreadBarrier.c++ b/src/OpenThreads/pthreads/PThreadBarrier.c++
---- a/src/OpenThreads/pthreads/PThreadBarrier.c++
-+++ b/src/OpenThreads/pthreads/PThreadBarrier.c++
-@@ -21,6 +21,7 @@
- #include <unistd.h>
- #include <OpenThreads/Barrier>
- #include "PThreadBarrierPrivateData.h"
-+#include "PThreadCleanup.h"
-
- using namespace OpenThreads;
-
-@@ -178,11 +179,11 @@ void Barrier::block(unsigned int numThreads) {
- {
- while (pd->phase == my_phase)
- {
-- pthread_cleanup_push(barrier_cleanup_handler, &(pd->lock));
-+ PThreadCleanup thread_cleanup(barrier_cleanup_handler, &(pd->lock));
-
- pthread_cond_wait(&(pd->cond), &(pd->lock));
-
-- pthread_cleanup_pop(0);
-+ thread_cleanup.Reset(0);
- }
- }
- }
-diff --git a/src/OpenThreads/pthreads/PThreadCleanup.h b/src/OpenThreads/pthreads/PThreadCleanup.h
-new file mode 100644
---- /dev/null
-+++ b/src/OpenThreads/pthreads/PThreadCleanup.h
-@@ -0,0 +1,28 @@
-+#ifndef _PTHREADCLEANUP_H_
-+#define _PTHREADCLEANUP_H_
-+namespace OpenThreads {
-+class PThreadCleanup {
-+ public:
-+ typedef void (*CleanupHandler)(void*);
-+
-+ PThreadCleanup(CleanupHandler handler, void* arg)
-+ : handler_(handler), arg_(arg) {
-+ }
-+ ~PThreadCleanup() {
-+ if (handler_) {
-+ (*handler_)(arg_);
-+ }
-+ }
-+ void Reset(int execute) {
-+ if (0 != execute && NULL != handler_) {
-+ (*handler_)(arg_);
-+ }
-+ handler_ = NULL;
-+ }
-+
-+ private:
-+ CleanupHandler handler_;
-+ void* arg_;
-+};
-+}
-+#endif
-diff --git a/src/OpenThreads/pthreads/PThreadCondition.c++ b/src/OpenThreads/pthreads/PThreadCondition.c++
---- a/src/OpenThreads/pthreads/PThreadCondition.c++
-+++ b/src/OpenThreads/pthreads/PThreadCondition.c++
-@@ -26,6 +26,7 @@
- #include <stdio.h>
-
- #include <OpenThreads/Condition>
-+#include "PThreadCleanup.h"
- #include "PThreadConditionPrivateData.h"
- #include "PThreadMutexPrivateData.h"
-
-@@ -132,11 +133,11 @@ int Condition::wait(Mutex *mutex) {
-
- int status;
-
-- pthread_cleanup_push(condition_cleanup_handler, &mpd->mutex);
-+ PThreadCleanup thread_cleanup(condition_cleanup_handler, &mpd->mutex);
-
- status = pthread_cond_wait( &pd->condition, &mpd->mutex );
-
-- pthread_cleanup_pop(0);
-+ thread_cleanup.Reset(0);
-
- return status;
-
-@@ -179,11 +180,11 @@ int Condition::wait(Mutex *mutex, unsigned long int ms) {
-
- int status;
-
-- pthread_cleanup_push(condition_cleanup_handler, &mpd->mutex);
-+ PThreadCleanup thread_cleanup(condition_cleanup_handler, &mpd->mutex);
-
- status = pthread_cond_timedwait( &pd->condition, &mpd->mutex, &abstime );
-
-- pthread_cleanup_pop(0);
-+ thread_cleanup.Reset(0);
-
- return status;
-
-diff --git a/src/OpenThreads/pthreads/PThreadPrivateData.h b/src/OpenThreads/pthreads/PThreadPrivateData.h
---- a/src/OpenThreads/pthreads/PThreadPrivateData.h
-+++ b/src/OpenThreads/pthreads/PThreadPrivateData.h
-@@ -25,6 +25,8 @@
-
- namespace OpenThreads {
-
-+class Mutex;
-+
- class PThreadPrivateData {
-
- //-------------------------------------------------------------------------
-@@ -65,6 +67,8 @@ private:
- volatile int uniqueId;
-
- volatile int cpunum;
-+
-+ Mutex* isCanceledMutex;
-
-
- static int nextId;
-diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp
---- a/src/osg/GLExtensions.cpp
-+++ b/src/osg/GLExtensions.cpp
-@@ -27,9 +27,32 @@
- #include <set>
-
- #if defined(WIN32)
--#include <windows.h>
-+ #ifndef WIN32_LEAN_AND_MEAN
-+ #define WIN32_LEAN_AND_MEAN
-+ #endif // WIN32_LEAN_AND_MEAN
-+ #ifndef NOMINMAX
-+ #define NOMINMAX
-+ #endif // NOMINMAX
-+ #include <windows.h>
-+#elif !defined(OSG_GL_LIBRARY_STATIC)
-+#if defined(__APPLE__)
-+ // The NS*Symbol* stuff found in <mach-o/dyld.h> is deprecated.
-+ // Since 10.3 (Panther) OS X has provided the dlopen/dlsym/dlclose
-+ // family of functions under <dlfcn.h>. Since 10.4 (Tiger), Apple claimed
-+ // the dlfcn family was significantly faster than the NS*Symbol* family.
-+ // Since 'deprecated' needs to be taken very seriously with the
-+ // coming of 10.5 (Leopard), it makes sense to use the dlfcn family when possible.
-+ #include <AvailabilityMacros.h>
-+ #if !defined(MAC_OS_X_VERSION_10_3) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3)
-+ #define USE_APPLE_LEGACY_NSSYMBOL
-+ #include <mach-o/dyld.h>
-+ #else
-+ #include <dlfcn.h>
-+ #endif
-+#else
-+ #include <dlfcn.h>
-+#endif
- #endif
--
-
- typedef std::set<std::string> ExtensionSet;
- static osg::buffered_object<ExtensionSet> s_glExtensionSetList;
-@@ -91,18 +114,55 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex
- rendererString = renderer ? (const char*)renderer : "";
-
- // get the extension list from OpenGL.
-- const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
-- if (extensions==NULL) return false;
-+ #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
-+ if( osg::getGLVersionNumber() >= 3.0 )
-+ {
-+ // OpenGL 3.0 adds the concept of indexed strings and
-+ // deprecates calls to glGetString( GL_EXTENSIONS ), which
-+ // will now generate GL_INVALID_ENUM.
-
-- // insert the ' ' delimiated extensions words into the extensionSet.
-- const char *startOfWord = extensions;
-- const char *endOfWord;
-- while ((endOfWord = strchr(startOfWord,' '))!=NULL)
-+ // Get extensions using new indexed string interface.
-+
-+ typedef const GLubyte * GL_APIENTRY PFNGLGETSTRINGIPROC( GLenum, GLuint );
-+ PFNGLGETSTRINGIPROC* glGetStringi = 0;
-+ setGLExtensionFuncPtr( glGetStringi, "glGetStringi");
-+
-+ if( glGetStringi != NULL )
-+ {
-+ # ifndef GL_NUM_EXTENSIONS
-+ # define GL_NUM_EXTENSIONS 0x821D
-+ # endif
-+ GLint numExt;
-+ glGetIntegerv( GL_NUM_EXTENSIONS, &numExt );
-+ int idx;
-+ for( idx=0; idx<numExt; idx++ )
-+ {
-+ extensionSet.insert( std::string( (char*)( glGetStringi( GL_EXTENSIONS, idx ) ) ) );
-+ }
-+ }
-+ else
-+ {
-+ osg::notify( osg::WARN ) << "isGLExtensionOrVersionSupported: Can't obtain glGetStringi function pointer." << std::endl;
-+ }
-+ }
-+ else
-+ #endif
- {
-- extensionSet.insert(std::string(startOfWord,endOfWord));
-- startOfWord = endOfWord+1;
-+ // Get extensions using GL1/2 interface.
-+
-+ const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
-+ if (extensions==NULL) return false;
-+
-+ // insert the ' ' delimiated extensions words into the extensionSet.
-+ const char *startOfWord = extensions;
-+ const char *endOfWord;
-+ while ((endOfWord = strchr(startOfWord,' '))!=NULL)
-+ {
-+ extensionSet.insert(std::string(startOfWord,endOfWord));
-+ startOfWord = endOfWord+1;
-+ }
-+ if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord));
- }
-- if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord));
-
- #if defined(WIN32) && (defined(OSG_GL1_AVAILABLE) || defined(OSG_GL2_AVAILABLE) || defined(OSG_GL3_AVAILABLE))
-
-@@ -305,111 +365,97 @@
- }
- #endif
-
-+#ifdef OSG_GL_LIBRARY_STATIC
-
-+ #include "GLStaticLibrary.h"
-+
-+ void* osg::getGLExtensionFuncPtr(const char *funcName)
-+ {
-+ return GLStaticLibrary::getProcAddress(funcName);
-+ }
-
--#if defined(WIN32)
-- #define WIN32_LEAN_AND_MEAN
-- #ifndef NOMINMAX
-- #define NOMINMAX
-- #endif // NOMINMAX
-- #include <windows.h>
--#elif defined(__APPLE__)
-- // The NS*Symbol* stuff found in <mach-o/dyld.h> is deprecated.
-- // Since 10.3 (Panther) OS X has provided the dlopen/dlsym/dlclose
-- // family of functions under <dlfcn.h>. Since 10.4 (Tiger), Apple claimed
-- // the dlfcn family was significantly faster than the NS*Symbol* family.
-- // Since 'deprecated' needs to be taken very seriously with the
-- // coming of 10.5 (Leopard), it makes sense to use the dlfcn family when possible.
-- #include <AvailabilityMacros.h>
-- #if !defined(MAC_OS_X_VERSION_10_3) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3)
-- #define USE_APPLE_LEGACY_NSSYMBOL
-- #include <mach-o/dyld.h>
-- #else
-- #include <dlfcn.h>
-- #endif
- #else
-- #include <dlfcn.h>
--#endif
-
--void* osg::getGLExtensionFuncPtr(const char *funcName)
--{
-- // OSG_NOTIFY(osg::NOTICE)<<"osg::getGLExtensionFuncPtr("<<funcName<<")"<<std::endl;
--
--#if defined(WIN32)
-+ void* osg::getGLExtensionFuncPtr(const char *funcName)
-+ {
-+ // OSG_NOTIFY(osg::NOTICE)<<"osg::getGLExtensionFuncPtr("<<funcName<<")"<<std::endl;
-
-- #if defined(OSG_GLES2_AVAILABLE)
-- static HMODULE hmodule = GetModuleHandle("libGLESv2.dll");
-- return convertPointerType<void*, PROC>(GetProcAddress(hmodule, funcName));
-- #elif defined(OSG_GLES1_AVAILABLE)
-- static HMODULE hmodule = GetModuleHandle("libgles_cm.dll");
-- return convertPointerType<void*, PROC>(GetProcAddress(hmodule, funcName));
-- #else
-- return convertPointerType<void*, PROC>(wglGetProcAddress(funcName));
-- #endif
-+ #if defined(WIN32)
-
--#elif defined(__APPLE__)
-+ #if defined(OSG_GLES2_AVAILABLE)
-+ static HMODULE hmodule = GetModuleHandle(TEXT("libGLESv2.dll"));
-+ return convertPointerType<void*, PROC>(GetProcAddress(hmodule, funcName));
-+ #elif defined(OSG_GLES1_AVAILABLE)
-+ static HMODULE hmodule = GetModuleHandleA(TEXT("libgles_cm.dll"));
-+ return convertPointerType<void*, PROC>(GetProcAddress(hmodule, funcName));
-+ #else
-+ return convertPointerType<void*, PROC>(wglGetProcAddress(funcName));
-+ #endif
-+
-+ #elif defined(__APPLE__)
-+
-+ #if defined(USE_APPLE_LEGACY_NSSYMBOL)
-+ std::string temp( "_" );
-+ temp += funcName; // Mac OS X prepends an underscore on function names
-+ if ( NSIsSymbolNameDefined( temp.c_str() ) )
-+ {
-+ NSSymbol symbol = NSLookupAndBindSymbol( temp.c_str() );
-+ return NSAddressOfSymbol( symbol );
-+ } else
-+ return NULL;
-+ #else
-+ // I am uncertain of the correct and ideal usage of dlsym here.
-+ // On the surface, it would seem that the FreeBSD implementation
-+ // would be the ideal one to copy, but ELF and Mach-o are different
-+ // and Apple's man page says the following about using RTLD_DEFAULT:
-+ // "This can be a costly search and should be avoided."
-+ // The documentation mentions nothing about passing in 0 so I must
-+ // assume the behavior is undefined.
-+ // So I could try copying the Sun method which I think all this
-+ // actually originated from.
-+
-+ // return dlsym( RTLD_DEFAULT, funcName );
-+ static void *handle = dlopen((const char *)0L, RTLD_LAZY);
-+ return dlsym(handle, funcName);
-+ #endif
-
-- #if defined(USE_APPLE_LEGACY_NSSYMBOL)
-- std::string temp( "_" );
-- temp += funcName; // Mac OS X prepends an underscore on function names
-- if ( NSIsSymbolNameDefined( temp.c_str() ) )
-- {
-- NSSymbol symbol = NSLookupAndBindSymbol( temp.c_str() );
-- return NSAddressOfSymbol( symbol );
-- } else
-- return NULL;
-- #else
-- // I am uncertain of the correct and ideal usage of dlsym here.
-- // On the surface, it would seem that the FreeBSD implementation
-- // would be the ideal one to copy, but ELF and Mach-o are different
-- // and Apple's man page says the following about using RTLD_DEFAULT:
-- // "This can be a costly search and should be avoided."
-- // The documentation mentions nothing about passing in 0 so I must
-- // assume the behavior is undefined.
-- // So I could try copying the Sun method which I think all this
-- // actually originated from.
-+ #elif defined (__sun)
-
-- // return dlsym( RTLD_DEFAULT, funcName );
- static void *handle = dlopen((const char *)0L, RTLD_LAZY);
- return dlsym(handle, funcName);
-- #endif
-
--#elif defined (__sun)
-+ #elif defined (__sgi)
-
-- static void *handle = dlopen((const char *)0L, RTLD_LAZY);
-- return dlsym(handle, funcName);
--
--#elif defined (__sgi)
-+ static void *handle = dlopen((const char *)0L, RTLD_LAZY);
-+ return dlsym(handle, funcName);
-
-- static void *handle = dlopen((const char *)0L, RTLD_LAZY);
-- return dlsym(handle, funcName);
-+ #elif defined (__FreeBSD__)
-
--#elif defined (__FreeBSD__)
-+ return dlsym( RTLD_DEFAULT, funcName );
-
-- return dlsym( RTLD_DEFAULT, funcName );
-+ #elif defined (__linux__)
-
--#elif defined (__linux__)
-+ typedef void (*__GLXextFuncPtr)(void);
-+ typedef __GLXextFuncPtr (*GetProcAddressARBProc)(const char*);
-
-- typedef void (*__GLXextFuncPtr)(void);
-- typedef __GLXextFuncPtr (*GetProcAddressARBProc)(const char*);
--
-- #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
-- static GetProcAddressARBProc s_glXGetProcAddressARB = convertPointerType<GetProcAddressARBProc, void*>(dlsym(0, "glXGetProcAddressARB"));
-- if (s_glXGetProcAddressARB)
-- {
-- return convertPointerType<void*, __GLXextFuncPtr>((s_glXGetProcAddressARB)(funcName));
-- }
-- #endif
-+ #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
-+ static GetProcAddressARBProc s_glXGetProcAddressARB = convertPointerType<GetProcAddressARBProc, void*>(dlsym(0, "glXGetProcAddressARB"));
-+ if (s_glXGetProcAddressARB)
-+ {
-+ return convertPointerType<void*, __GLXextFuncPtr>((s_glXGetProcAddressARB)(funcName));
-+ }
-+ #endif
-
-- return dlsym(0, funcName);
-+ return dlsym(0, funcName);
-
--#elif defined (__QNX__)
-+ #elif defined (__QNX__)
-
-- return dlsym(RTLD_DEFAULT, funcName);
-+ return dlsym(RTLD_DEFAULT, funcName);
-
--#else // all other unixes
-+ #else // all other unixes
-
-- return dlsym(0, funcName);
-+ return dlsym(0, funcName);
-
-+ #endif
-+ }
- #endif
--}
-diff --git a/src/osg/GLStaticLibrary.cpp b/src/osg/GLStaticLibrary.cpp
-new file mode 100644
---- /dev/null
-+++ b/src/osg/GLStaticLibrary.cpp
-@@ -0,0 +1,211 @@
-+/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
-+ * Copyright (C) 2003-2005 3Dlabs Inc. Ltd.
-+ * Copyright (C) 2004-2005 Nathan Cournia
-+ * Copyright (C) 2008 Zebra Imaging
-+ *
-+ * This application is open source and may be redistributed and/or modified
-+ * freely and without restriction, both in commericial and non commericial
-+ * applications, as long as this copyright notice is maintained.
-+ *
-+ * This application is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-+ *
-+*/
-+
-+/* file: src/osg/GLStaticLibrary.cpp
-+ * author: Alok Priyadarshi 2010-04-27
-+*/
-+
-+#include "GLStaticLibrary.h"
-+#include <osg/GL>
-+#include <osg/Notify>
-+
-+#include <map>
-+#include <string>
-+
-+// This file is intended for GL static linking only.
-+#if defined(OSG_GL_LIBRARY_STATIC)
-+
-+using namespace osg;
-+
-+namespace {
-+typedef void (*GLProc)(void);
-+typedef std::map<std::string, GLProc> GLProcAddressMap;
-+static bool sProcAddressInitialized = false;
-+static GLProcAddressMap sProcAddressMap;
-+
-+#define ADD_FUNCTION(FunctionName) sProcAddressMap[#FunctionName] = reinterpret_cast<GLProc>(&FunctionName);
-+
-+void initGLES2ProcAddress()
-+{
-+ ADD_FUNCTION(glActiveTexture)
-+ ADD_FUNCTION(glAttachShader)
-+ ADD_FUNCTION(glBindAttribLocation)
-+ ADD_FUNCTION(glBindBuffer)
-+ ADD_FUNCTION(glBindFramebuffer)
-+ ADD_FUNCTION(glBindRenderbuffer)
-+ ADD_FUNCTION(glBindTexture)
-+ ADD_FUNCTION(glBlendColor)
-+ ADD_FUNCTION(glBlendEquation)
-+ ADD_FUNCTION(glBlendEquationSeparate)
-+ ADD_FUNCTION(glBlendFunc)
-+ ADD_FUNCTION(glBlendFuncSeparate)
-+ ADD_FUNCTION(glBufferData)
-+ ADD_FUNCTION(glBufferSubData)
-+ ADD_FUNCTION(glCheckFramebufferStatus)
-+ ADD_FUNCTION(glClear)
-+ ADD_FUNCTION(glClearColor)
-+ ADD_FUNCTION(glClearDepthf)
-+ ADD_FUNCTION(glClearStencil)
-+ ADD_FUNCTION(glColorMask)
-+ ADD_FUNCTION(glCompileShader)
-+ ADD_FUNCTION(glCompressedTexImage2D)
-+ ADD_FUNCTION(glCompressedTexSubImage2D)
-+ ADD_FUNCTION(glCopyTexImage2D)
-+ ADD_FUNCTION(glCopyTexSubImage2D)
-+ ADD_FUNCTION(glCreateProgram)
-+ ADD_FUNCTION(glCreateShader)
-+ ADD_FUNCTION(glCullFace)
-+ ADD_FUNCTION(glDeleteBuffers)
-+ ADD_FUNCTION(glDeleteFramebuffers)
-+ ADD_FUNCTION(glDeleteProgram)
-+ ADD_FUNCTION(glDeleteRenderbuffers)
-+ ADD_FUNCTION(glDeleteShader)
-+ ADD_FUNCTION(glDeleteTextures)
-+ ADD_FUNCTION(glDepthFunc)
-+ ADD_FUNCTION(glDepthMask)
-+
-+ ADD_FUNCTION(glDepthRangef)
-+ ADD_FUNCTION(glDetachShader)
-+ ADD_FUNCTION(glDisable)
-+ ADD_FUNCTION(glDisableVertexAttribArray)
-+ ADD_FUNCTION(glDrawArrays)
-+ ADD_FUNCTION(glDrawElements)
-+ ADD_FUNCTION(glEnable)
-+ ADD_FUNCTION(glEnableVertexAttribArray)
-+ ADD_FUNCTION(glFinish)
-+ ADD_FUNCTION(glFlush)
-+ ADD_FUNCTION(glFramebufferRenderbuffer)
-+ ADD_FUNCTION(glFramebufferTexture2D)
-+ ADD_FUNCTION(glFrontFace)
-+ ADD_FUNCTION(glGenBuffers)
-+ ADD_FUNCTION(glGenerateMipmap)
-+ ADD_FUNCTION(glGenFramebuffers)
-+ ADD_FUNCTION(glGenRenderbuffers)
-+ ADD_FUNCTION(glGenTextures)
-+ ADD_FUNCTION(glGetActiveAttrib)
-+ ADD_FUNCTION(glGetActiveUniform)
-+ ADD_FUNCTION(glGetAttachedShaders)
-+ ADD_FUNCTION(glGetAttribLocation)
-+ ADD_FUNCTION(glGetBooleanv)
-+ ADD_FUNCTION(glGetBufferParameteriv)
-+ ADD_FUNCTION(glGetError)
-+ ADD_FUNCTION(glGetFloatv)
-+ ADD_FUNCTION(glGetFramebufferAttachmentParameteriv)
-+ ADD_FUNCTION(glGetIntegerv)
-+ ADD_FUNCTION(glGetProgramiv)
-+ ADD_FUNCTION(glGetProgramInfoLog)
-+ ADD_FUNCTION(glGetRenderbufferParameteriv)
-+ ADD_FUNCTION(glGetShaderiv)
-+ ADD_FUNCTION(glGetShaderInfoLog)
-+ ADD_FUNCTION(glGetShaderPrecisionFormat)
-+ ADD_FUNCTION(glGetShaderSource)
-+ ADD_FUNCTION(glGetString)
-+ ADD_FUNCTION(glGetTexParameterfv)
-+ ADD_FUNCTION(glGetTexParameteriv)
-+ ADD_FUNCTION(glGetUniformfv)
-+ ADD_FUNCTION(glGetUniformiv)
-+ ADD_FUNCTION(glGetUniformLocation)
-+ ADD_FUNCTION(glGetVertexAttribfv)
-+ ADD_FUNCTION(glGetVertexAttribiv)
-+ ADD_FUNCTION(glGetVertexAttribPointerv)
-+ ADD_FUNCTION(glHint)
-+ ADD_FUNCTION(glIsBuffer)
-+ ADD_FUNCTION(glIsEnabled)
-+ ADD_FUNCTION(glIsFramebuffer)
-+ ADD_FUNCTION(glIsProgram)
-+ ADD_FUNCTION(glIsRenderbuffer)
-+ ADD_FUNCTION(glIsShader)
-+ ADD_FUNCTION(glIsTexture)
-+ ADD_FUNCTION(glLineWidth)
-+ ADD_FUNCTION(glLinkProgram)
-+ ADD_FUNCTION(glPixelStorei)
-+ ADD_FUNCTION(glPolygonOffset)
-+ ADD_FUNCTION(glReadPixels)
-+ ADD_FUNCTION(glReleaseShaderCompiler)
-+ ADD_FUNCTION(glRenderbufferStorage)
-+ ADD_FUNCTION(glSampleCoverage)
-+ ADD_FUNCTION(glScissor)
-+ ADD_FUNCTION(glShaderBinary)
-+ ADD_FUNCTION(glShaderSource)
-+ ADD_FUNCTION(glStencilFunc)
-+ ADD_FUNCTION(glStencilFuncSeparate)
-+ ADD_FUNCTION(glStencilMask)
-+ ADD_FUNCTION(glStencilMaskSeparate)
-+ ADD_FUNCTION(glStencilOp)
-+ ADD_FUNCTION(glStencilOpSeparate)
-+ ADD_FUNCTION(glTexImage2D)
-+ ADD_FUNCTION(glTexParameterf)
-+ ADD_FUNCTION(glTexParameterfv)
-+ ADD_FUNCTION(glTexParameteri)
-+ ADD_FUNCTION(glTexParameteriv)
-+ ADD_FUNCTION(glTexSubImage2D)
-+ ADD_FUNCTION(glUniform1f)
-+ ADD_FUNCTION(glUniform1fv)
-+ ADD_FUNCTION(glUniform1i)
-+ ADD_FUNCTION(glUniform1iv)
-+ ADD_FUNCTION(glUniform2f)
-+ ADD_FUNCTION(glUniform2fv)
-+ ADD_FUNCTION(glUniform2i)
-+ ADD_FUNCTION(glUniform2iv)
-+ ADD_FUNCTION(glUniform3f)
-+ ADD_FUNCTION(glUniform3fv)
-+ ADD_FUNCTION(glUniform3i)
-+ ADD_FUNCTION(glUniform3iv)
-+ ADD_FUNCTION(glUniform4f)
-+ ADD_FUNCTION(glUniform4fv)
-+ ADD_FUNCTION(glUniform4i)
-+ ADD_FUNCTION(glUniform4iv)
-+ ADD_FUNCTION(glUniformMatrix2fv)
-+ ADD_FUNCTION(glUniformMatrix3fv)
-+ ADD_FUNCTION(glUniformMatrix4fv)
-+ ADD_FUNCTION(glUseProgram)
-+ ADD_FUNCTION(glValidateProgram)
-+ ADD_FUNCTION(glVertexAttrib1f)
-+ ADD_FUNCTION(glVertexAttrib1fv)
-+ ADD_FUNCTION(glVertexAttrib2f)
-+ ADD_FUNCTION(glVertexAttrib2fv)
-+ ADD_FUNCTION(glVertexAttrib3f)
-+ ADD_FUNCTION(glVertexAttrib3fv)
-+ ADD_FUNCTION(glVertexAttrib4f)
-+ ADD_FUNCTION(glVertexAttrib4fv)
-+ ADD_FUNCTION(glVertexAttribPointer)
-+ ADD_FUNCTION(glViewport)
-+}
-+
-+void initProcAddress()
-+{
-+#if defined(OSG_GLES2_AVAILABLE)
-+ initGLES2ProcAddress();
-+#else
-+ OSG_NOTICE << "initProcAddress() not implemented for static GL lib yet." << std::endl;
-+#endif
-+}
-+
-+} // namespace
-+
-+void* GLStaticLibrary::getProcAddress(const char* procName)
-+{
-+ // TODO(alokp): Add a mutex around sProcAddressInitialized.
-+ if (!sProcAddressInitialized)
-+ {
-+ initProcAddress();
-+ sProcAddressInitialized = true;
-+ }
-+
-+ GLProcAddressMap::const_iterator iter = sProcAddressMap.find(procName);
-+ return reinterpret_cast<void*>(iter != sProcAddressMap.end() ? iter->second : 0);
-+}
-+
-+#endif // OSG_GLES2_LIBRARY_STATIC
-diff --git a/src/osg/GLStaticLibrary.h b/src/osg/GLStaticLibrary.h
-new file mode 100644
---- /dev/null
-+++ b/src/osg/GLStaticLibrary.h
-@@ -0,0 +1,33 @@
-+/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
-+ * Copyright (C) 2003-2005 3Dlabs Inc. Ltd.
-+ * Copyright (C) 2004-2005 Nathan Cournia
-+ * Copyright (C) 2007 Art Tevs
-+ * Copyright (C) 2008 Zebra Imaging
-+ *
-+ * This application is open source and may be redistributed and/or modified
-+ * freely and without restriction, both in commericial and non commericial
-+ * applications, as long as this copyright notice is maintained.
-+ *
-+ * This application is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-+*/
-+
-+/* file: src/osg/GLStaticLibrary.h
-+ * author: Alok Priyadarshi 2010-04-27
-+*/
-+
-+#ifndef OSG_GLSTATICLIBRARY
-+#define OSG_GLSTATICLIBRARY 1
-+
-+namespace osg {
-+
-+class GLStaticLibrary
-+{
-+public:
-+ static void* getProcAddress(const char* procName);
-+};
-+
-+}
-+
-+#endif
-diff --git a/src/osg/Makefile b/src/osg/Makefile
-new file mode 100644
---- /dev/null
-+++ b/src/osg/Makefile
-@@ -0,0 +1,161 @@
-+OSG_ROOT = ../..
-+
-+NACL_PORTS_PREFIX = ../../../../../toolchain/$(OS_PREFIX)_x86/nacl/usr
-+
-+NACLPORTS_INCLUDE = $(NACL_PORTS_PREFIX)/include
-+
-+NACLPORTS_LIBDIR = $(NACL_PORTS_PREFIX)/lib
-+
-+INCLUDE = -I$(OSG_ROOT)/include
-+
-+OBJ_FILES = \
-+ AlphaFunc.o \
-+ AnimationPath.o \
-+ ApplicationUsage.o \
-+ ArgumentParser.o \
-+ Array.o \
-+ ArrayDispatchers.o \
-+ AudioStream.o \
-+ AutoTransform.o \
-+ Billboard.o \
-+ BlendColor.o \
-+ BlendEquation.o \
-+ BlendFunc.o \
-+ BufferObject.o \
-+ Camera.o \
-+ CameraView.o \
-+ ClampColor.o \
-+ ClearNode.o \
-+ ClipNode.o \
-+ ClipPlane.o \
-+ ClusterCullingCallback.o \
-+ CollectOccludersVisitor.o \
-+ ColorMask.o \
-+ ColorMatrix.o \
-+ ComputeBoundsVisitor.o \
-+ ConvexPlanarOccluder.o \
-+ ConvexPlanarPolygon.o \
-+ CoordinateSystemNode.o \
-+ CopyOp.o \
-+ CullFace.o \
-+ CullSettings.o \
-+ CullStack.o \
-+ CullingSet.o \
-+ DeleteHandler.o \
-+ Depth.o \
-+ DisplaySettings.o \
-+ DrawPixels.o \
-+ Drawable.o \
-+ Fog.o \
-+ FragmentProgram.o \
-+ FrameBufferObject.o \
-+ FrameStamp.o \
-+ FrontFace.o \
-+ GL2Extensions.o \
-+ GLBeginEndAdapter.o \
-+ GLExtensions.o \
-+ GLObjects.o \
-+ GLStaticLibrary.o \
-+ Geode.o \
-+ Geometry.o \
-+ GraphicsContext.o \
-+ GraphicsThread.o \
-+ Group.o \
-+ Hint.o \
-+ Image.o \
-+ ImageSequence.o \
-+ ImageStream.o \
-+ ImageUtils.o \
-+ KdTree.o \
-+ LOD.o \
-+ Light.o \
-+ LightModel.o \
-+ LightSource.o \
-+ LineSegment.o \
-+ LineStipple.o \
-+ LineWidth.o \
-+ LogicOp.o \
-+ Material.o \
-+ Math.o \
-+ MatrixDecomposition.o \
-+ MatrixTransform.o \
-+ Matrixd.o \
-+ Matrixf.o \
-+ Multisample.o \
-+ Node.o \
-+ NodeCallback.o \
-+ NodeTrackerCallback.o \
-+ NodeVisitor.o \
-+ Notify.o \
-+ Object.o \
-+ Observer.o \
-+ ObserverNodePath.o \
-+ OccluderNode.o \
-+ OcclusionQueryNode.o \
-+ OperationThread.o \
-+ PagedLOD.o \
-+ Point.o \
-+ PointSprite.o \
-+ PolygonMode.o \
-+ PolygonOffset.o \
-+ PolygonStipple.o \
-+ PositionAttitudeTransform.o \
-+ PrimitiveSet.o \
-+ Program.o \
-+ Projection.o \
-+ ProxyNode.o \
-+ Quat.o \
-+ Referenced.o \
-+ Scissor.o \
-+ Sequence.o \
-+ ShadeModel.o \
-+ Shader.o \
-+ ShadowVolumeOccluder.o \
-+ Shape.o \
-+ ShapeDrawable.o \
-+ State.o \
-+ StateAttribute.o \
-+ StateSet.o \
-+ Stats.o \
-+ Stencil.o \
-+ StencilTwoSided.o \
-+ Switch.o \
-+ TexEnv.o \
-+ TexEnvCombine.o \
-+ TexEnvFilter.o \
-+ TexGen.o \
-+ TexGenNode.o \
-+ TexMat.o \
-+ Texture.o \
-+ Texture1D.o \
-+ Texture2D.o \
-+ Texture2DArray.o \
-+ Texture3D.o \
-+ TextureCubeMap.o \
-+ TextureRectangle.o \
-+ Timer.o \
-+ TransferFunction.o \
-+ Transform.o \
-+ Uniform.o \
-+ Version.o \
-+ VertexProgram.o \
-+ View.o \
-+ Viewport.o \
-+ dxtctool.o
-+
-+OBJ_DIR = obj
-+
-+all: $(LIB_OSG)
-+ @echo "Making libosg"
-+
-+clean:
-+ rm -rf $(OBJ_DIR) $(LIB_OSG)
-+
-+$(OBJ_DIR):
-+ mkdir $(OBJ_DIR)
-+
-+$(OBJ_FILES): %.o: %.cpp $(OBJ_DIR)
-+ $(CXX) -c $(INCLUDE) $(CXXFLAGS) $< -o $(OBJ_DIR)/$@
-+
-+$(LIB_OSG): $(OBJ_DIR) $(OBJ_FILES)
-+ cd $(OBJ_DIR) && $(AR) rcs ../$(OSG_ROOT)/$(LIB_OSG) $(OBJ_FILES)
-diff --git a/src/osg/Notify.cpp b/src/osg/Notify.cpp
---- a/src/osg/Notify.cpp
-+++ b/src/osg/Notify.cpp
-@@ -219,7 +219,7 @@ std::ostream& osg::notify(const osg::NotifySeverity severity)
-
- void osg::StandardNotifyHandler::notify(osg::NotifySeverity severity, const char *message)
- {
--#if 0
-+#if 1
- if (severity <= osg::WARN)
- fputs(message, stderr);
- else
-@@ -231,7 +231,9 @@ void osg::StandardNotifyHandler::notify(osg::NotifySeverity severity, const char
-
- #if defined(WIN32) && !defined(__CYGWIN__)
-
--#define WIN32_LEAN_AND_MEAN
-+#ifndef WIN32_LEAN_AND_MEAN
-+ #define WIN32_LEAN_AND_MEAN
-+#endif
- #include <windows.h>
-
- void osg::WinDebugNotifyHandler::notify(osg::NotifySeverity severity, const char *message)
-diff --git a/src/osgUtil/Makefile b/src/osgUtil/Makefile
-new file mode 100644
---- /dev/null
-+++ b/src/osgUtil/Makefile
-@@ -0,0 +1,66 @@
-+OSG_ROOT = ../..
-+
-+NACL_PORTS_PREFIX = ../../../../../toolchain/$(OS_PREFIX)_x86/nacl/usr
-+
-+NACLPORTS_INCLUDE = $(NACL_PORTS_PREFIX)/include
-+
-+NACLPORTS_LIBDIR = $(NACL_PORTS_PREFIX)/lib
-+
-+INCLUDE = -I$(OSG_ROOT)/include
-+
-+INCLUDE = -I$(OSG_ROOT)/include
-+
-+OBJ_FILES = \
-+ CubeMapGenerator.o \
-+ CullVisitor.o \
-+ DelaunayTriangulator.o \
-+ DisplayRequirementsVisitor.o \
-+ DrawElementTypeSimplifier.o \
-+ EdgeCollector.o \
-+ GLObjectsVisitor.o \
-+ HalfWayMapGenerator.o \
-+ HighlightMapGenerator.o \
-+ IncrementalCompileOperation.o \
-+ IntersectVisitor.o \
-+ IntersectionVisitor.o \
-+ LineSegmentIntersector.o \
-+ Optimizer.o \
-+ PlaneIntersector.o \
-+ PolytopeIntersector.o \
-+ PositionalStateContainer.o \
-+ PrintVisitor.o \
-+ RenderBin.o \
-+ RenderLeaf.o \
-+ RenderStage.o \
-+ ReversePrimitiveFunctor.o \
-+ SceneGraphBuilder.o \
-+ SceneView.o \
-+ ShaderGen.o \
-+ Simplifier.o \
-+ SmoothingVisitor.o \
-+ StateGraph.o \
-+ Statistics.o \
-+ TangentSpaceGenerator.o \
-+ Tessellator.o \
-+ TransformAttributeFunctor.o \
-+ TransformCallback.o \
-+ TriStripVisitor.o \
-+ UpdateVisitor.o \
-+ Version.o
-+
-+OBJ_DIR = obj
-+
-+all: $(LIB_OSGUTIL)
-+ @echo "Making libosgUtils"
-+
-+clean:
-+ rm -rf $(OBJ_DIR) $(LIB_OSGUTIL)
-+
-+$(OBJ_DIR):
-+ mkdir $(OBJ_DIR)
-+
-+$(OBJ_FILES): %.o: %.cpp $(OBJ_DIR)
-+ $(CXX) -c $(INCLUDE) $(CXXFLAGS) $< -o $(OBJ_DIR)/$@
-+
-+$(LIB_OSGUTIL): $(OBJ_DIR) $(OBJ_FILES)
-+ cd $(OBJ_DIR) && $(AR) rcs ../$(OSG_ROOT)/$(LIB_OSGUTIL) $(OBJ_FILES)
diff --git a/ports/openscenegraph/pkg_info b/ports/openscenegraph/pkg_info
deleted file mode 100644
index 73e2ac1..0000000
--- a/ports/openscenegraph/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=openscenegraph
-VERSION=2.9.7
-ARCHIVE_ROOT=OpenSceneGraph-2.9.7
-URL=http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-2.9.7.zip
-LICENSE=CUSTOM:LICENSE.txt
-# TODO(sbc): remove this conditional once this bug gets fixed:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-DISABLED_ARCH=(arm)
-SHA1=5b374ef8459e95fc1b9eeebafedfb9d58a6b2290
diff --git a/ports/openssh/README.nacl b/ports/openssh/README.nacl
deleted file mode 100644
index a6cbb07..0000000
--- a/ports/openssh/README.nacl
+++ /dev/null
@@ -1,6 +0,0 @@
-OpenSSH for Native Client
-=========================
-
-This port is a work in progress. It currently builds only
-under GLIBC and has a memory corruption crash just after
-connecting.
diff --git a/ports/openssh/background.js b/ports/openssh/background.js
deleted file mode 100644
index 326479b..0000000
--- a/ports/openssh/background.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('gdb.html', {
- 'bounds': {
- 'width': 400,
- 'height': 500
- }
- });
-});
diff --git a/ports/openssh/build.sh b/ports/openssh/build.sh
deleted file mode 100644
index 2cff561..0000000
--- a/ports/openssh/build.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="scp${NACL_EXEEXT} ssh${NACL_EXEEXT} \
- ssh-add${NACL_EXEEXT} sshd${NACL_EXEEXT}"
-INSTALL_TARGETS="install-nokeys"
-
-# Add --with-privsep-path otherwise openssh creates /var/empty
-# in the root of DESTDIR.
-EXTRA_CONFIGURE_ARGS="--with-privsep-path=${PREFIX}/var/empty"
-
-# Force configure to recognise the existence of truncate
-# and sigaction. Normally it will detect that both this functions
-# are implemented by glibc in terms of NOSYS.
-export ac_cv_func_truncate=yes
-export ac_cv_func_sigaction=yes
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- NACLPORTS_LIBS+=" -lcrypto"
- export LD="${NACLCXX}"
-fi
-
-if [ "${NACL_LIBC}" = "glibc" ]; then
- # The host version of 'strip' doesn't always recognise NaCl binaries
- # and ssh runs 'install -s' which doesn't always runs the host 'strip'
- EXTRA_CONFIGURE_ARGS+=" --disable-strip"
-fi
-
-EnableCliMain
-EnableGlibcCompat
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/openssh"
- MakeDir ${ASSEMBLY_DIR}
- LogExecute cp ssh${NACL_EXEEXT} \
- ${ASSEMBLY_DIR}/ssh_${NACL_ARCH}${NACL_EXEEXT}
-
- pushd ${ASSEMBLY_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ssh_*${NACL_EXEEXT} \
- -s . \
- -o openssh.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py openssh.nmf
- popd
-
- InstallNaClTerm ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/background.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
-}
diff --git a/ports/openssh/manifest.json b/ports/openssh/manifest.json
deleted file mode 100644
index 65de020..0000000
--- a/ports/openssh/manifest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "OpenSSH",
- "description": "OpenSSH client built using Native Client",
- "version": "5.9.1.0",
- "manifest_version": 2,
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "permissions": [
- "storage",
- {"socket": [
- "resolve-host",
- "tcp-listen:*:*",
- "tcp-connect"
- ]}
- ]
-}
diff --git a/ports/openssh/nacl.patch b/ports/openssh/nacl.patch
deleted file mode 100644
index f09e1b1..0000000
--- a/ports/openssh/nacl.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-diff --git a/channels.h b/channels.h
---- a/channels.h
-+++ b/channels.h
-@@ -161,9 +161,9 @@ struct Channel {
-
- /* default window/packet sizes for tcp/x11-fwd-channel */
- #define CHAN_SES_PACKET_DEFAULT (32*1024)
--#define CHAN_SES_WINDOW_DEFAULT (64*CHAN_SES_PACKET_DEFAULT)
-+#define CHAN_SES_WINDOW_DEFAULT (4*CHAN_SES_PACKET_DEFAULT)
- #define CHAN_TCP_PACKET_DEFAULT (32*1024)
--#define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT)
-+#define CHAN_TCP_WINDOW_DEFAULT (4*CHAN_TCP_PACKET_DEFAULT)
- #define CHAN_X11_PACKET_DEFAULT (16*1024)
- #define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT)
-
-diff --git a/includes.h b/includes.h
---- a/includes.h
-+++ b/includes.h
-@@ -172,4 +172,10 @@
-
- #include "entropy.h"
-
-+/* TODO(sbc): remove this if/when arm/glibc toolchain is fixed */
-+/* https://code.google.com/p/nativeclient/issues/detail?id=4299 */
-+#ifndef MAXHOSTNAMELEN
-+#define MAXHOSTNAMELEN 64
-+#endif
-+
- #endif /* INCLUDES_H */
-diff --git a/misc.h b/misc.h
---- a/misc.h
-+++ b/misc.h
-@@ -15,6 +15,11 @@
- #ifndef _MISC_H
- #define _MISC_H
-
-+#if defined __native_client__ && !defined __GLIBC__
-+// for struct timeval
-+#include <sys/time.h>
-+#endif
-+
- /* misc.c */
-
- char *chop(char *);
-diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c
---- a/openbsd-compat/bsd-closefrom.c
-+++ b/openbsd-compat/bsd-closefrom.c
-@@ -93,12 +93,14 @@ closefrom(int lowfd)
- * resource limits since it is possible to open a file descriptor
- * and then drop the rlimit such that it is below the open fd.
- */
-+#if !defined __native_client__ || defined __GLIBC__
- #ifdef HAVE_SYSCONF
- maxfd = sysconf(_SC_OPEN_MAX);
- #else
- maxfd = getdtablesize();
- #endif /* HAVE_SYSCONF */
- if (maxfd < 0)
-+#endif
- maxfd = OPEN_MAX;
-
- for (fd = lowfd; fd < maxfd; fd++)
-diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
---- a/openbsd-compat/bsd-misc.c
-+++ b/openbsd-compat/bsd-misc.c
-@@ -169,12 +169,16 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
- pid_t
- tcgetpgrp(int fd)
- {
-+#ifdef __native_client__
-+ return(-1);
-+#else
- int ctty_pgrp;
-
- if (ioctl(fd, TIOCGPGRP, &ctty_pgrp) == -1)
- return(-1);
- else
- return(ctty_pgrp);
-+#endif
- }
- #endif /* HAVE_TCGETPGRP */
-
-diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c
---- a/openbsd-compat/xcrypt.c
-+++ b/openbsd-compat/xcrypt.c
-@@ -24,6 +24,7 @@
-
- #include "includes.h"
-
-+#include <assert.h>
- #include <sys/types.h>
- #include <unistd.h>
- #include <pwd.h>
-@@ -75,7 +76,11 @@ xcrypt(const char *password, const char *salt)
- # elif defined(HAVE_SECUREWARE)
- crypted = bigcrypt(password, salt);
- # else
-+#ifdef __native_client__
-+ assert(0);
-+#else
- crypted = crypt(password, salt);
-+#endif
- # endif
-
- return crypted;
-diff --git a/ssh.c b/ssh.c
---- a/ssh.c
-+++ b/ssh.c
-@@ -231,12 +231,29 @@ tilde_expand_paths(char **paths, u_int num_paths)
- }
- }
-
-+#ifdef __native_client__
-+struct passwd *getpwuid(uid_t uid) {
-+ static struct passwd passwd;
-+ passwd.pw_name = "user";
-+ passwd.pw_passwd = "*";
-+ passwd.pw_uid = 0;
-+ passwd.pw_gid = 0;
-+ passwd.pw_gecos = "";
-+ passwd.pw_dir = "/home";
-+ passwd.pw_shell = "/bin/sh";
-+ return &passwd;
-+}
-+#endif
-+
- /*
- * Main program for the ssh client.
- */
- int
--main(int ac, char **av)
-+main(int ac, char **av)
- {
-+ mkdir("/home", 0777);
-+ setenv("HOME", "/home", 1);
-+
- int i, r, opt, exit_status, use_syslog;
- char *p, *cp, *line, *argv0, buf[MAXPATHLEN], *host_arg;
- char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV];
-diff --git a/sshconnect.h b/sshconnect.h
---- a/sshconnect.h
-+++ b/sshconnect.h
-@@ -55,6 +55,10 @@ void ssh_userauth2(const char *, const char *, char *, Sensitive *);
- void ssh_put_password(char *);
- int ssh_local_cmd(const char *);
-
-+#ifdef __native_client__
-+#define PRIV_START
-+#define PRIV_END
-+#else
- /*
- * Macros to raise/lower permissions.
- */
-@@ -73,3 +77,4 @@ int ssh_local_cmd(const char *);
- strerror(errno)); \
- errno = save_errno; \
- } while (0)
-+#endif
diff --git a/ports/openssh/pkg_info b/ports/openssh/pkg_info
deleted file mode 100644
index 69fb9e0..0000000
--- a/ports/openssh/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=openssh
-VERSION=5.9p1
-URL=http://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.9p1.tar.gz
-DISABLED_LIBC=(newlib)
-DEPENDS=(zlib openssl jsoncpp nacl-spawn)
-SHA1=ac4e0055421e9543f0af5da607a72cf5922dcc56
diff --git a/ports/openssl/build.sh b/ports/openssl/build.sh
deleted file mode 100644
index a2ce174..0000000
--- a/ports/openssl/build.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-# 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.
-
-# The openssl build can fail when build with -jN.
-# TODO(sbc): Remove this if/when openssl is upgraded to a version that supports
-# parallel make.
-OS_JOBS=1
-BUILD_DIR=${SRC_DIR}
-INSTALL_TARGETS="install_sw INSTALL_PREFIX=${DESTDIR}"
-
-EnableGlibcCompat
-
-ConfigureStep() {
- if [ "${NACL_SHARED}" = "1" ] ; then
- local EXTRA_ARGS="shared"
- else
- local EXTRA_ARGS="no-dso"
- fi
-
- # Workaround for arm-gcc bug:
- # https://code.google.com/p/nativeclient/issues/detail?id=3205
- # TODO(sbc): remove this once the issue is fixed
- if [ "${NACL_ARCH}" = "arm" ]; then
- EXTRA_ARGS+=" -mfpu=vfp"
- fi
- EXTRA_ARGS+=" ${NACLPORTS_CPPFLAGS}"
-
- # Override $SYSTEM $RELEASE and $MACHINE, otherwise openssl's
- # config will use uname to try and guess them which has
- # different results depending on the host OS.
- local machine="le32${NACL_LIBC}"
- SYSTEM=nacl RELEASE=0 MACHINE=${machine} \
- CC=${NACLCC} AR=${NACLAR} RANLIB=${NACLRANLIB} \
- LogExecute ./config \
- --prefix=${PREFIX} no-asm no-hw no-krb5 ${EXTRA_ARGS} -D_GNU_SOURCE
-}
-
-
-BuildStep() {
- LogExecute make clean
- Banner "Building openssl"
- DefaultBuildStep
-}
-
-
-InstallStep() {
- DefaultInstallStep
- # openssl (for some reason) installs shared libraries with 555 (i.e.
- # not writable. This causes issues when create_nmf copies the libraries
- # and then tries to overwrite them later.
- if [ "${NACL_SHARED}" = "1" ] ; then
- LogExecute chmod 644 ${DESTDIR_LIB}/lib*.so*
- LogExecute chmod 644 ${DESTDIR_LIB}/engines/lib*.so*
- fi
-}
-
-
-TestStep() {
- # TODO(jvoung): Integrate better with "make test".
- # We'd need to make util/shlib_wrap.sh run the sel_ldr scripts instead
- # of trying to run the nexes directly.
- local all_tests="bntest ectest ecdsatest ecdhtest exptest \
-ideatest shatest sha1test sha256t sha512t mdc2test rmdtest md4test \
-md5test hmactest wp_test rc2test rc4test bftest casttest \
-destest randtest dhtest dsatest rsa_test enginetest igetest \
-srptest asn1test md2test rc5test ssltest jpaketest"
- ChangeDir test
- LogExecute make
- export SEL_LDR_LIB_PATH=$PWD/..
- for test_name in ${all_tests}; do
- RunSelLdrCommand ${test_name}
- done
- RunSelLdrCommand evp_test evptests.txt
-}
diff --git a/ports/openssl/diff_skip.txt b/ports/openssl/diff_skip.txt
deleted file mode 100644
index d653dd9..0000000
--- a/ports/openssl/diff_skip.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Makefile
-Makefile.bak
-crypto/opensslconf.h
-tools/c_rehash
diff --git a/ports/openssl/nacl.patch b/ports/openssl/nacl.patch
deleted file mode 100644
index 2e25bb2..0000000
--- a/ports/openssl/nacl.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-diff --git a/Configure b/Configure
---- a/Configure
-+++ b/Configure
-@@ -419,6 +419,13 @@ my %table=(
- "linux-x86_64-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
- "linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
- "linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
-+
-+#### NaCl configurations (glibc is much like linux-elf, newlib is
-+# similar to linux-aout, since it's statically linked.
-+"nacl-le32newlib", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out",
-+"nacl-le32bionic", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"nacl-le32glibc", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+
- #### So called "highgprs" target for z/Architecture CPUs
- # "Highgprs" is kernel feature first implemented in Linux 2.6.32, see
- # /proc/cpuinfo. The idea is to preserve most significant bits of
-@@ -932,6 +939,10 @@ PROCESS_ARGS:
- # The check for the option is there so scripts aren't
- # broken
- }
-+ elsif (/^[\/]/) # allow '-isystem /foo/bar' flags
-+ {
-+ $flags.=$_." ";
-+ }
- elsif (/^[-+]/)
- {
- if (/^--prefix=(.*)$/)
-diff --git a/apps/speed.c b/apps/speed.c
---- a/apps/speed.c
-+++ b/apps/speed.c
-@@ -108,6 +108,10 @@
- # include <signal.h>
- # endif
-
-+#ifdef __native_client__
-+#undef SIGALRM
-+#endif
-+
- # if defined(_WIN32) || defined(__CYGWIN__)
- # include <windows.h>
- # if defined(__CYGWIN__) && !defined(_WIN32)
-diff --git a/config b/config
---- a/config
-+++ b/config
-@@ -679,6 +679,9 @@ case "$GUESSOS" in
- #fi
- OUT="linux64-s390x"
- ;;
-+ le32newlib-*-nacl) OUT="nacl-le32newlib" ;;
-+ le32bionic-*-nacl) OUT="nacl-le32bionic" ;;
-+ le32glibc-*-nacl) OUT="nacl-le32glibc" ;;
- x86_64-*-linux?) OUT="linux-x86_64" ;;
- *86-*-linux2) OUT="linux-elf"
- if [ "$GCCVER" -gt 28 ]; then
-diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
---- a/crypto/rand/rand_unix.c
-+++ b/crypto/rand/rand_unix.c
-@@ -134,7 +134,30 @@
- # define FD_SETSIZE (8*sizeof(fd_set))
- # endif
-
--# if defined(OPENSSL_SYS_VOS)
-+#if defined(__native_client__)
-+#include <stdlib.h>
-+#include <irt.h>
-+/* TODO(sehr): remove this patch when nacl_io can handle /dev/urandom. */
-+int RAND_poll(void)
-+{
-+ unsigned char buf[ENTROPY_NEEDED];
-+ size_t n = 0;
-+ struct nacl_irt_random rand_intf;
-+ if (nacl_interface_query(NACL_IRT_RANDOM_v0_1, &rand_intf, sizeof(rand_intf))
-+ != sizeof(rand_intf))
-+ abort();
-+ while (n < sizeof(buf)) {
-+ size_t nread;
-+ if (rand_intf.get_random_bytes((unsigned char *)buf+n,
-+ ENTROPY_NEEDED-n, &nread) != 0)
-+ abort();
-+ n += nread;
-+ }
-+ RAND_add(buf, sizeof(buf), ENTROPY_NEEDED);
-+ memset(buf, 0, sizeof(buf));
-+ return 1;
-+}
-+#elif defined(OPENSSL_SYS_VOS)
-
- /*
- * The following algorithm repeatedly samples the real-time clock (RTC) to
diff --git a/ports/openssl/pkg_info b/ports/openssl/pkg_info
deleted file mode 100644
index 990cc63..0000000
--- a/ports/openssl/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=openssl
-VERSION=1.0.2e
-URL=http://www.openssl.org/source/openssl-1.0.2e.tar.gz
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(glibc-compat)
-SHA1=2c5691496761cb18f98476eefa4d35c835448fb6
-CONFLICTS=(boringssl)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/pango/build.sh b/ports/pango/build.sh
deleted file mode 100644
index 798a5a0..0000000
--- a/ports/pango/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES="pango-view/pango-view${NACL_EXEEXT}"
-EXTRA_CONFIGURE_ARGS+=" --with-included-modules --without-dynamic-modules"
-EXTRA_CONFIGURE_ARGS+=" --with-x"
-
-EnableCliMain
diff --git a/ports/pango/pkg_info b/ports/pango/pkg_info
deleted file mode 100644
index 064d539..0000000
--- a/ports/pango/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=pango
-VERSION=1.36.8
-URL=http://ftp.gnome.org/pub/GNOME/sources/pango/1.36/pango-1.36.8.tar.xz
-LICENSE=LGPL2
-DEPENDS=(glib cairo harfbuzz)
-SHA1=c6ba02ee8f9d8b22b7cfd74c4b6ae170bebc8d2b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/pcre/build.sh b/ports/pcre/build.sh
deleted file mode 100644
index de6e472..0000000
--- a/ports/pcre/build.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXECUTABLES="
- pcre_scanner_unittest${NACL_EXEEXT}
- pcre_stringpiece_unittest${NACL_EXEEXT}
- pcrecpp_unittest${NACL_EXEEXT}"
-
-# There are two additional tests (RunGrepTest and RunTest shell scripts) that
-# make check does but it would be hard to run it here. Especially the first one.
-TestStep() {
- # test only pnacl and if target and host architectures match
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- for test in ${EXECUTABLES}; do
- RunSelLdrCommand ${test}
- done
- echo "Tests OK"
- elif [ "$(uname -m)" = "${NACL_ARCH_ALT}" ]; then
- for test in ${EXECUTABLES}; do
- LogExecute ./${test%%${NACL_EXEEXT}}
- done
- echo "Tests OK"
- fi
-}
diff --git a/ports/pcre/nacl.patch b/ports/pcre/nacl.patch
deleted file mode 100644
index fb22952..0000000
--- a/ports/pcre/nacl.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/pcretest.c b/pcretest.c
---- a/pcretest.c
-+++ b/pcretest.c
-@@ -3101,7 +3101,8 @@ while (argc > 1 && argv[op][0] == '-')
- ((stack_size = get_value((pcre_uint8 *)argv[op+1], &endptr)),
- *endptr == 0))
- {
--#if defined(_WIN32) || defined(WIN32) || defined(__minix) || defined(NATIVE_ZOS) || defined(__VMS)
-+#if defined(_WIN32) || defined(WIN32) || defined(__minix) || \
-+ defined(NATIVE_ZOS) || defined(__VMS) || defined(__native_client__)
- printf("PCRE: -S not supported on this OS\n");
- exit(1);
- #else
diff --git a/ports/pcre/pkg_info b/ports/pcre/pkg_info
deleted file mode 100644
index ac159a8..0000000
--- a/ports/pcre/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=pcre
-VERSION=8.36
-URL=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2
-LICENSE=BSD
-SHA1=9a074e9cbf3eb9f05213fd9ca5bc188644845ccc
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/perl/build.sh b/ports/perl/build.sh
deleted file mode 100644
index 01f02bc..0000000
--- a/ports/perl/build.sh
+++ /dev/null
@@ -1,184 +0,0 @@
-# Copyright (c) 2015 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.
-
-# falling back to cc for generating build time artifacts
-export BUILD_CC=cc
-export BUILD_LD=cc
-# use -Wno-return-type to suppress return-type errors encountered
-# with pnacl, arm's clang-newlib (microperl)
-NACLPORTS_CFLAGS_MICRO=$NACLPORTS_CFLAGS
-NACLPORTS_CFLAGS_MICRO+=" -Wno-return-type "
-NACLPORTS_CFLAGS+=" -I${NACL_SDK_ROOT}/include -I${NACLPORTS_INCLUDE} \
- -Wno-return-type"
-BUILD_DIR=${SRC_DIR}
-# keeping microperl for now
-EXECUTABLES="perl microperl"
-# we need a working perl on host to build things for target
-HOST_BUILD=${WORK_DIR}/build_host
-ARCH_DIR=${PUBLISH_DIR}/${NACL_ARCH}
-# PNaCl and newlib dont have dynamic loading, so
-# using Perl's internal stub file dl_none.xs
-# specifically for systems which do not support it
-# Also, FILE pointer is structured a bit differently
-# Relevant stdio parameters found via sel_ldr on Linux
-if [ "${NACL_LIBC}" = "newlib" -o "${NACL_ARCH}" = "pnacl" ] ; then
- NACLPORTS_LIBS+=" -lm -ltar"
- DYNAMIC_EXT=""
- NACL_GLIBC_DEF="undef"
- PERL_STDIO_BASE="(((fp)->_bf)._base)"
- PERL_STDIO_BUFSIZ="(((fp)->_bf)._size)"
- PERL_STDIO_CNT=""
- PERL_STDIO_PTR="((fp)->_p)"
- PERL_DLSRC="dl_none.xs"
- NACLPORTS_CCDLFLAGS=""
-else
- NACLPORTS_LIBS+=" -ldl -lm -ltar"
- # disabled DB_File GDBM_File NDBM_File ODBM_File
- DYNAMIC_EXT="arybase attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib \
- Cwd Data/Dumper Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA \
- Encode Fcntl File/DosGlob File/Glob Filter/Util/Call Hash/Util \
- Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util \
- Math/BigInt/FastCalc MIME/Base64 mro Opcode PerlIO/encoding \
- PerlIO/mmap PerlIO/scalar PerlIO/via POSIX re SDBM_File \
- Socket Storable Sys/Hostname Sys/Syslog threads \
- threads/shared Tie/Hash/NamedCapture Time/HiRes Time/Piece \
- Unicode/Collate Unicode/Normalize XS/APItest XS/Typemap"
- NACL_GLIBC_DEF="define"
- PERL_STDIO_BASE="((fp)->_IO_read_base)"
- PERL_STDIO_BUFSIZ="((fp)->_IO_read_end - (fp)->_IO_read_base)"
- PERL_STDIO_CNT="((fp)->_IO_read_end - (fp)->_IO_read_ptr)"
- PERL_STDIO_PTR="((fp)->_IO_read_ptr)"
- PERL_DLSRC="dl_dlopen.xs"
- NACLPORTS_CCDLFLAGS="-Wl,-E"
-fi
-# include Errno in pnacl
-NONXS_EXT=""
-if [ "${NACL_ARCH}" = "pnacl" ] ; then
- NONXS_EXT="Errno"
-fi
-
-EnableCliMain
-EnableGlibcCompat
-
-# BuildHostMiniperl builds miniperl for host, which is needed for
-# building Perl for the target
-BuildHostMiniperl() {
- if [ ! -x ${HOST_BUILD}/miniperl ]; then
- MakeDir ${HOST_BUILD}
- ChangeDir ${SRC_DIR}
- LogExecute ${SRC_DIR}/Configure -des -Dprefix=${HOST_BUILD}
- LogExecute make -j${OS_JOBS} miniperl
- LogExecute cp miniperl ${HOST_BUILD}
- fi
-}
-
-# Don't include unistd.h for i686, because it causes issues
-# with spawn.h, which we need for spawnv
-UNDEF_FOR_I686='define'
-if [ "${NACL_ARCH}" = "i686" ] ; then
- UNDEF_FOR_I686='undef'
-fi
-
-# This is required to change the parameters in config.sh as according
-# to their values on host, since just using them in config.sh (after
-# export) doesn't work
-# TODO(agaurav77): Maybe use a better way.
-SedWork() {
- sed -i "s%\${NACLAR}%${NACLAR}%g" $1
- sed -i "s%\${NACLRANLIB}%${NACLRANLIB}%g" $1
- sed -i "s%\${NACL_ARCH}%${NACL_ARCH}%g" $1
- sed -i "s%\${NACLCC}%${NACLCC}%g" $1
- sed -i "s%\${NACLPORTS_CFLAGS}%${NACLPORTS_CFLAGS}%g" $1
- sed -i "s%\${NACLPORTS_CCDLFLAGS}%${NACLPORTS_CCDLFLAGS}%g" $1
- sed -i "s%\${NACLCXX}%${NACLCXX}%g" $1
- sed -i "s%\${BUILD_DIR}%${BUILD_DIR}%g" $1
- sed -i "s%\${HOST_BUILD}%${HOST_BUILD}%g" $1
- sed -i "s%\${NACLPORTS_INCLUDE}%${NACLPORTS_INCLUDE}%g" $1
- sed -i "s%\${NACLPORTS_LDFLAGS}%${NACLPORTS_LDFLAGS}%g" $1
- sed -i "s%\${NACLPORTS_LIBDIR}%${NACLPORTS_LIBDIR}%g" $1
- sed -i "s%\${DYNAMIC_EXT}%${DYNAMIC_EXT}%g" $1
- sed -i "s%\$NACL_GLIBC_DEF%${NACL_GLIBC_DEF}%g" $1
- sed -i "s%\${PERL_STDIO_BASE}%${PERL_STDIO_BASE}%g" $1
- sed -i "s%\${PERL_STDIO_BUFSIZ}%${PERL_STDIO_BUFSIZ}%g" $1
- sed -i "s%\${PERL_STDIO_CNT}%${PERL_STDIO_CNT}%g" $1
- sed -i "s%\${PERL_STDIO_PTR}%${PERL_STDIO_PTR}%g" $1
- sed -i "s%\${PERL_DLSRC}%${PERL_DLSRC}%g" $1
- sed -i "s%\$UNDEF_FOR_I686%${UNDEF_FOR_I686}%g" $1
- sed -i "s%\${NONXS_EXT}%${NONXS_EXT}%g" $1
- sed -i "s%\$DESTDIR%${DESTDIR}/${PREFIX}%g" $1
-}
-
-ConfigureStep() {
- BuildHostMiniperl
- LogExecute cp ${START_DIR}/config ${BUILD_DIR}/config.sh
- LogExecute SedWork ${BUILD_DIR}/config.sh
- ChangeDir ${BUILD_DIR}
- # all these SH files pick up values from config.sh
- ./config_h.SH
- ./metaconfig.SH
- chmod a+x pod/Makefile.SH
- ./pod/Makefile.SH
- ./makedepend.SH
- ./cflags.SH
- ./Makefile.SH
- ./myconfig.SH
- ./runtests.SH
- ./Policy_sh.SH
- ./x2p/Makefile.SH
-}
-
-BuildStep() {
- # clean up previous executables
- LogExecute make -j${OS_JOBS} -f Makefile.micro clean
- # microperl build from Makefile.micro
- LogExecute make -j${OS_JOBS} -f Makefile.micro CC="${NACLCC}" \
- CCFLAGS=" -c -DHAS_DUP2 -DPERL_MICRO ${NACLPORTS_CFLAGS_MICRO}" \
- LDFLAGS="${NACLPORTS_LDFLAGS}" LIBS="${NACLPORTS_LIBS}"
- # now make perl
- LogExecute cp -f microperl ${HOST_BUILD}
- LogExecute make clean
- LogExecute ${BUILD_CC} -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe \
- -O2 -Wall generate_uudmap.c
- LogExecute ${BUILD_LD} -o generate_uudmap generate_uudmap.o -lm
- LogExecute make -j${OS_JOBS} libs="${NACLPORTS_LIBS}" all
- # test_prep prepares the perl for tests, might use this later
- LogExecute make -j${OS_JOBS} libs="${NACLPORTS_LIBS}" test_prep
- LogExecute mv -f ${HOST_BUILD}/microperl ${SRC_DIR}
-}
-
-InstallStep() {
- if [ "${NACL_LIBC}" == "glibc" ] ; then
- # Install without man files due to the following bug
- # https://rt.perl.org/Public/Bug/Display.html?id=123532
- LogExecute make -j${OS_JOBS} libs="${NACLPORTS_LIBS}" install.perl
- else
- MakeDir ${DESTDIR_LIB}
- LogExecute cp -rf ${SRC_DIR}/lib/* ${DESTDIR_LIB}/
- MakeDir ${DESTDIR_BIN}
- LogExecute cp -f ${SRC_DIR}/{perl,microperl} ${DESTDIR_BIN}/
- fi
-}
-
-TestStep() {
- export NACL_SDK_ROOT
- export TOOLCHAIN
-
- # skip for pnacl
- if [ "${NACL_ARCH}" = "pnacl" ] ; then
- return
- fi
-
- # ignore error messages for now
- echo "Running ${START_DIR}/tests.sh"
- ${START_DIR}/tests.sh 2>tests_err.txt 1>tests_out.txt
- EXPECTED=${START_DIR}/expected_${TOOLCHAIN}.txt
- if ! cmp tests_out.txt ${EXPECTED}; then
- echo "Test output did not match expected output"
- echo "See ${PWD}/tests_err.txt"
- diff -u tests_out.txt ${EXPECTED}
- exit 1
- fi
-
- echo "PASSED"
-}
diff --git a/ports/perl/config b/ports/perl/config
deleted file mode 100644
index c8665b3..0000000
--- a/ports/perl/config
+++ /dev/null
@@ -1,1158 +0,0 @@
-#!/bin/sh
-#
-# This file was produced by running the Configure script. It holds all the
-# definitions figured out by Configure. Should you modify one of these values,
-# do not forget to propagate your changes by running "Configure -der". You may
-# instead choose to run each of the .SH files by yourself, or "Configure -S".
-#
-
-# Package name : perl5.20.2
-# Configured by : agaurav77
-# Target system : nacl/pnacl
-
-Author=''
-Date='$Date'
-Header=''
-Id='$Id'
-Locker=''
-Log='$Log'
-RCSfile='$RCSfile'
-Revision='$Revision'
-Source=''
-State=''
-_a='.a'
-_exe=''
-_o='.o'
-afs='false'
-afsroot='/afs'
-alignbytes='4'
-ansi2knr=''
-aphostname='/bin/hostname'
-api_revision='5'
-api_subversion='0'
-api_version='20'
-api_versionstring='5.20.2'
-ar="${NACLAR}"
-archlib="/usr/lib/"
-archlibexp="/usr/lib/"
-archname64='nacl-x86_64'
-archname='native-client'
-archobjs=''
-asctime_r_proto='0'
-awk='awk'
-baserev='5.0'
-bash=''
-# The bin directory for now on devenv
-bin='/usr/bin'
-bin_ELF='define'
-binexp='/usr/bin'
-bison='bison'
-bootstrap_charset='undef'
-byacc='byacc'
-byteorder='12345678'
-c=''
-castflags='0'
-cat='cat'
-cc="${NACLCC}"
-cccdlflags="-fPIC ${NACLPORTS_CFLAGS}"
-ccdlflags="${NACLPORTS_CCDLFLAGS}"
-ccflags=" ${NACLPORTS_CFLAGS} -fwrapv -fno-strict-aliasing -pipe"
-ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
-ccname='nacl-gcc'
-ccsymbols=''
-ccversion=''
-cf_by='agaurav77'
-cf_email='gauravashish07@gmail.com'
-cf_time='Wed Apr 9 12:26:42 CEST 2014'
-charbits='8'
-charsize='1'
-chgrp=''
-chmod='chmod'
-chown=''
-clocktype='clock_t'
-comm='comm'
-compress=''
-contains='grep'
-cp='cp'
-cpio=''
-cpp="${NACLCXX}"
-cpp_stuff='42'
-cppccsymbols=''
-cppflags=" ${NACLPORTS_CFLAGS} -fwrapv -fno-strict-aliasing -pipe"
-cpplast='-'
-cppminus='-'
-cpprun='cc -E'
-cppstdin='cc -E'
-cppsymbols='__DBL_MIN_EXP__ (-1021) __FLT_MIN__ 1.17549435e-38F __CHAR_BIT__ 8 __WCHAR_MAX__ 2147483647 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 __DBL_DENORM_MIN__ 4.9406564584124654e-324 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 __FLT_EVAL_METHOD__ 0 __unix__ 1 __x86_64 1 __DBL_MIN_10_EXP__ (-307) __FINITE_MATH_ONLY__ 0 __GNUC_PATCHLEVEL__ 3 __DEC64_MAX_EXP__ 385 __SHRT_MAX__ 32767 __LDBL_MAX__ 1.7976931348623157e+308L __UINTMAX_TYPE__ long long unsigned int __DEC32_EPSILON__ 1E-6DF __unix 1 __LDBL_MAX_EXP__ 1024 __SCHAR_MAX__ 127 __DBL_DIG__ 15 __SIZEOF_INT__ 4 __SIZEOF_POINTER__ 4 __USER_LABEL_PREFIX__ __STDC_HOSTED__ 1 __LDBL_HAS_INFINITY__ 1 __FLT_EPSILON__ 1.19209290e-7F __LDBL_MIN__ 2.2250738585072014e-308L __DEC32_MAX__ 9.999999E96DF __SIZEOF_LONG__ 4 __DECIMAL_DIG__ 17 __LDBL_HAS_QUIET_NAN__ 1 __GNUC__ 4 __MMX__ 1 __FLT_HAS_DENORM__ 1 __SIZEOF_LONG_DOUBLE__ 8 __BIGGEST_ALIGNMENT__ 16 __DBL_MAX__ 1.7976931348623157e+308 __DBL_HAS_INFINITY__ 1 __DEC32_MIN_EXP__ (-94) __LDBL_HAS_DENORM__ 1 __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL __DEC32_MIN__ 1E-95DF __DBL_MAX_EXP__ 1024 __DEC128_EPSILON__ 1E-33DL __SSE2_MATH__ 1 __amd64 1 __LONG_LONG_MAX__ 9223372036854775807LL __SIZEOF_SIZE_T__ 4 __SIZEOF_WINT_T__ 4 __GCC_HAVE_DWARF2_CFI_ASM 1 __GXX_ABI_VERSION 1002 __FLT_MIN_EXP__ (-125) __DBL_MIN__ 2.2250738585072014e-308 __DEC128_MIN__ 1E-6143DL __REGISTER_PREFIX__ __DBL_HAS_DENORM__ 1 __NO_INLINE__ 1 __FLT_MANT_DIG__ 24 __VERSION__ "4.4.3 20150409 (Native Client 11953a35fcd4f999b097a343bc49d89f94af21a8, Git Commit f80d6b9ee7f94755c697ffb7194fb01dd0c537dd)" __DEC64_EPSILON__ 1E-15DD __DEC128_MIN_EXP__ (-6142) unix 1 __SIZE_TYPE__ unsigned int __ELF__ 1 __FLT_RADIX__ 2 __LDBL_EPSILON__ 2.2204460492503131e-16L __SSE_MATH__ 1 __k8 1 __SIZEOF_PTRDIFF_T__ 4 __x86_64__ 1 __native_client__ 1 __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF __FLT_HAS_QUIET_NAN__ 1 __FLT_MAX_10_EXP__ 38 __LONG_MAX__ 2147483647L __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL __FLT_HAS_INFINITY__ 1 __DEC64_MAX__ 9.999999999999999E384DD __CHAR16_TYPE__ short unsigned int __DEC64_MANT_DIG__ 16 __DEC32_MAX_EXP__ 97 __LITTLE_ENDIAN__ 1 __SSE2__ 1 __LDBL_MANT_DIG__ 53 __DBL_HAS_QUIET_NAN__ 1 __k8__ 1 __WCHAR_TYPE__ long int __SIZEOF_FLOAT__ 4 __DEC64_MIN_EXP__ (-382) __FLT_DIG__ 6 __INT_MAX__ 2147483647 __amd64__ 1 __FLT_MAX_EXP__ 128 __DBL_MANT_DIG__ 53 __DEC64_MIN__ 1E-383DD __WINT_TYPE__ unsigned int __SIZEOF_SHORT__ 2 __SSE__ 1 __LDBL_MIN_EXP__ (-1021) __LDBL_MAX_10_EXP__ 308 __DBL_EPSILON__ 2.2204460492503131e-16 __SIZEOF_WCHAR_T__ 4 __DEC_EVAL_METHOD__ 2 __INTMAX_MAX__ 9223372036854775807LL __FLT_DENORM_MIN__ 1.40129846e-45F __CHAR32_TYPE__ unsigned int __FLT_MAX__ 3.40282347e+38F __SIZEOF_DOUBLE__ 8 __FLT_MIN_10_EXP__ (-37) __INTMAX_TYPE__ long long int __DEC128_MAX_EXP__ 6145 __GNUC_MINOR__ 4 __DEC32_MANT_DIG__ 7 __DBL_MAX_10_EXP__ 308 __LDBL_DENORM_MIN__ 4.9406564584124654e-324L __STDC__ 1 __PTRDIFF_TYPE__ int __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD __DEC128_MANT_DIG__ 34 __LDBL_MIN_10_EXP__ (-307) __SIZEOF_LONG_LONG__ 8 __LDBL_DIG__ 15 __GNUC_GNU_INLINE__ 1'
-crypt_r_proto='0'
-cryptlib=''
-csh='tcsh'
-ctermid_r_proto='0'
-ctime_r_proto='0'
-d_Gconvert='gcvt((x),(n),(b))'
-d_PRIEUldbl='define'
-d_PRIFUldbl='define'
-d_PRIGUldbl='define'
-d_PRIXU64='define'
-d_PRId64='define'
-d_PRIeldbl='define'
-d_PRIfldbl='define'
-d_PRIgldbl='define'
-d_PRIi64='define'
-d_PRIo64='define'
-d_PRIu64='define'
-d_PRIx64='define'
-d_SCNfldbl='define'
-d__fwalk='undef'
-d_access='define'
-d_accessx='undef'
-d_aintl='undef'
-d_alarm='define'
-d_archlib='define'
-d_asctime64='undef'
-d_asctime_r='undef'
-d_atolf='undef'
-d_atoll='define'
-d_attribute_deprecated='define'
-d_attribute_format='define'
-d_attribute_malloc='define'
-d_attribute_nonnull='define'
-d_attribute_noreturn='define'
-d_attribute_pure='define'
-d_attribute_unused='define'
-d_attribute_warn_unused_result='define'
-d_bcmp='define'
-d_bcopy='define'
-d_bsd='undef'
-d_bsdgetpgrp='undef'
-d_bsdsetpgrp='undef'
-d_builtin_choose_expr='define'
-d_builtin_expect='define'
-d_bzero='define'
-d_c99_variadic_macros='define'
-d_casti32='undef'
-d_castneg='define'
-d_charvspr='undef'
-d_chown='define'
-d_chroot='$NACL_GLIBC_DEF'
-d_chsize='undef'
-d_class='undef'
-d_clearenv='define'
-d_closedir='define'
-d_cmsghdr_s='define'
-d_const='define'
-d_copysignl='define'
-d_cplusplus='undef'
-d_crypt='undef'
-#d_crypt='define'
-d_crypt_r='undef'
-d_csh='define'
-d_ctermid='define'
-d_ctermid_r='undef'
-d_ctime64='undef'
-d_ctime_r='undef'
-d_cuserid='define'
-d_dbl_dig='define'
-d_dbminitproto='define'
-d_difftime64='undef'
-d_difftime='define'
-d_dir_dd_fd='undef'
-d_dirfd='$NACL_GLIBC_DEF'
-d_dirnamlen='undef'
-d_dlerror='define'
-d_dlopen='define'
-d_dlsymun='undef'
-d_dosuid='undef'
-d_drand48_r='undef'
-d_drand48proto='define'
-d_dup2='define'
-d_eaccess='$NACL_GLIBC_DEF'
-d_endgrent='define'
-d_endgrent_r='undef'
-d_endhent='$NACL_GLIBC_DEF'
-d_endhostent_r='undef'
-d_endnent='$NACL_GLIBC_DEF'
-d_endnetent_r='undef'
-d_endpent='$NACL_GLIBC_DEF'
-d_endprotoent_r='undef'
-d_endpwent='define'
-d_endpwent_r='undef'
-d_endsent='$NACL_GLIBC_DEF'
-d_endservent_r='undef'
-d_eofnblk='define'
-d_eunice='undef'
-d_faststdio='define'
-d_fchdir='$NACL_GLIBC_DEF'
-d_fchmod='define'
-d_fchown='define'
-d_fcntl='define'
-d_fcntl_can_lock='define'
-d_fd_macros='define'
-d_fd_set='define'
-d_fds_bits='undef'
-d_fgetpos='define'
-d_finite='define'
-d_finitel='define'
-d_flexfnam='define'
-d_flock='$NACL_GLIBC_DEF'
-d_flockproto='define'
-#d_fork='undef'
-d_fork='define'
-d_fp_class='undef'
-d_fpathconf='define'
-d_fpclass='undef'
-d_fpclassify='undef'
-d_fpclassl='undef'
-d_fpos64_t='undef'
-d_frexpl='define'
-d_fs_data_s='undef'
-d_fseeko='define'
-d_fsetpos='define'
-d_fstatfs='define'
-d_fstatvfs='define'
-d_fsync='define'
-d_ftello='define'
-d_ftime='undef'
-d_futimes='$NACL_GLIBC_DEF'
-d_gdbm_ndbm_h_uses_prototypes='undef'
-d_gdbmndbm_h_uses_prototypes='undef'
-d_getaddrinfo='define'
-d_getcwd='undef'
-#d_getcwd='define'
-d_getespwnam='undef'
-d_getfsstat='undef'
-d_getgrent='define'
-d_getgrent_r='undef'
-d_getgrgid_r='undef'
-d_getgrnam_r='undef'
-d_getgrps='define'
-d_gethbyaddr='$NACL_GLIBC_DEF'
-d_gethbyname='$NACL_GLIBC_DEF'
-d_gethent='$NACL_GLIBC_DEF'
-d_gethname='define'
-d_gethostbyaddr_r='undef'
-d_gethostbyname_r='undef'
-d_gethostent_r='undef'
-d_gethostprotos='define'
-d_getitimer='define'
-d_getlogin='define'
-d_getlogin_r='undef'
-d_getmnt='undef'
-d_getmntent='define'
-d_getnameinfo='define'
-d_getnbyaddr='$NACL_GLIBC_DEF'
-d_getnbyname='$NACL_GLIBC_DEF'
-d_getnent='$NACL_GLIBC_DEF'
-d_getnetbyaddr_r='undef'
-d_getnetbyname_r='undef'
-d_getnetent_r='undef'
-d_getnetprotos='define'
-d_getpagsz='define'
-d_getpbyname='$NACL_GLIBC_DEF'
-d_getpbynumber='$NACL_GLIBC_DEF'
-d_getpent='$NACL_GLIBC_DEF'
-d_getpgid='define'
-d_getpgrp2='undef'
-d_getpgrp='define'
-d_getppid='define'
-d_getprior='$NACL_GLIBC_DEF'
-d_getprotobyname_r='undef'
-d_getprotobynumber_r='undef'
-d_getprotoent_r='undef'
-d_getprotoprotos='define'
-d_getprpwnam='undef'
-d_getpwent='define'
-d_getpwent_r='undef'
-d_getpwnam_r='undef'
-d_getpwuid_r='undef'
-d_getsbyname='$NACL_GLIBC_DEF'
-d_getsbyport='$NACL_GLIBC_DEF'
-d_getsent='$NACL_GLIBC_DEF'
-d_getservbyname_r='undef'
-d_getservbyport_r='undef'
-d_getservent_r='undef'
-d_getservprotos='define'
-d_getspnam='undef'
-#d_getspnam='define'
-d_getspnam_r='undef'
-d_gettimeod='define'
-d_gmtime64='undef'
-d_gmtime_r='undef'
-d_gnulibc='define'
-d_grpasswd='define'
-d_hasmntopt='define'
-d_htonl='define'
-d_ilogbl='define'
-d_inc_version_list='undef'
-d_index='undef'
-d_inetaton='define'
-d_inetntop='define'
-d_inetpton='define'
-d_int64_t='define'
-d_ip_mreq='define'
-d_ip_mreq_source='define'
-d_ipv6_mreq='define'
-d_ipv6_mreq_source='undef'
-d_isascii='define'
-d_isblank='define'
-d_isfinite='undef'
-d_isinf='define'
-d_isnan='define'
-d_isnanl='define'
-d_killpg='$NACL_GLIBC_DEF'
-d_lchown='define'
-d_ldbl_dig='define'
-d_libm_lib_version='define'
-d_libname_unique='undef'
-d_link='define'
-d_localtime64='undef'
-d_localtime_r='undef'
-d_localtime_r_needs_tzset='undef'
-d_locconv='define'
-d_lockf='define'
-d_longdbl='define'
-d_longlong='define'
-d_lseekproto='define'
-d_lstat='define'
-d_madvise='define'
-d_malloc_good_size='undef'
-d_malloc_size='undef'
-d_mblen='define'
-d_mbstowcs='define'
-d_mbtowc='define'
-d_memchr='define'
-d_memcmp='define'
-d_memcpy='define'
-d_memmove='define'
-d_memset='define'
-d_mkdir='define'
-d_mkdtemp='define'
-d_mkfifo='define'
-d_mkstemp='define'
-d_mkstemps='define'
-d_mktime64='undef'
-d_mktime='define'
-d_mmap='define'
-d_modfl='define'
-d_modfl_pow32_bug='undef'
-d_modflproto='define'
-d_mprotect='define'
-d_msg='undef'
-#d_msg='define'
-d_msg_ctrunc='define'
-d_msg_dontroute='define'
-d_msg_oob='define'
-d_msg_peek='define'
-d_msg_proxy='define'
-d_msgctl='define'
-d_msgget='define'
-d_msghdr_s='define'
-d_msgrcv='define'
-d_msgsnd='define'
-d_msync='define'
-d_munmap='define'
-d_mymalloc='undef'
-d_ndbm='define'
-d_ndbm_h_uses_prototypes='define'
-d_nice='define'
-d_nl_langinfo='define'
-d_nv_preserves_uv='undef'
-d_nv_zero_is_allbits_zero='define'
-d_off64_t='undef'
-d_old_pthread_create_joinable='undef'
-d_oldpthreads='undef'
-d_oldsock='undef'
-d_open3='define'
-d_pathconf='define'
-d_pause='$NACL_GLIBC_DEF'
-d_perl_otherlibdirs='undef'
-d_phostname='undef'
-d_pipe='define'
-d_poll='define'
-d_portable='define'
-d_prctl='$NACL_GLIBC_DEF'
-d_prctl_set_name='$NACL_GLIBC_DEF'
-d_printf_format_null='define'
-d_procselfexe='define'
-d_pseudofork='define'
-#d_pseudofork='undef'
-d_pthread_atfork='undef'
-d_pthread_attr_setscope='define'
-d_pthread_yield='undef'
-d_pwage='undef'
-d_pwchange='undef'
-d_pwclass='undef'
-d_pwcomment='undef'
-d_pwexpire='undef'
-d_pwgecos='define'
-d_pwpasswd='define'
-d_pwquota='undef'
-d_qgcvt='define'
-d_quad='define'
-d_random_r='undef'
-d_readdir64_r='undef'
-d_readdir='define'
-d_readdir_r='undef'
-d_readlink='define'
-d_readv='define'
-d_recvmsg='define'
-d_rename='define'
-d_rewinddir='define'
-d_rmdir='define'
-d_safebcpy='undef'
-d_safemcpy='undef'
-d_sanemcmp='define'
-d_sbrkproto='define'
-d_scalbnl='define'
-d_sched_yield='define'
-d_scm_rights='define'
-d_seekdir='$NACL_GLIBC_DEF'
-d_select='define'
-d_sem='undef'
-#d_sem='define'
-d_semctl='define'
-d_semctl_semid_ds='define'
-d_semctl_semun='define'
-d_semget='define'
-d_semop='define'
-d_sendmsg='define'
-d_setegid='$NACL_GLIBC_DEF'
-d_seteuid='$NACL_GLIBC_DEF'
-d_setgrent='define'
-d_setgrent_r='undef'
-d_setgrps='define'
-d_sethent='$NACL_GLIBC_DEF'
-d_sethostent_r='undef'
-d_setitimer='define'
-d_setlinebuf='define'
-d_setlocale='define'
-d_setlocale_r='undef'
-d_setnent='$NACL_GLIBC_DEF'
-d_setnetent_r='undef'
-d_setpent='$NACL_GLIBC_DEF'
-d_setpgid='define'
-d_setpgrp2='undef'
-d_setpgrp='define'
-d_setprior='$NACL_GLIBC_DEF'
-d_setproctitle='undef'
-d_setprotoent_r='undef'
-d_setpwent='define'
-d_setpwent_r='undef'
-d_setregid='$NACL_GLIBC_DEF'
-d_setresgid='$NACL_GLIBC_DEF'
-d_setresuid='$NACL_GLIBC_DEF'
-d_setreuid='$NACL_GLIBC_DEF'
-d_setrgid='undef'
-d_setruid='undef'
-d_setsent='$NACL_GLIBC_DEF'
-d_setservent_r='undef'
-d_setsid='define'
-d_setvbuf='define'
-d_shm='undef'
-#d_shm='define'
-d_shmat='define'
-d_shmatprototype='define'
-d_shmctl='define'
-d_shmdt='define'
-d_shmget='define'
-d_sigaction='undef'
-#d_sigaction='define'
-d_signbit='define'
-d_sigprocmask='define'
-d_sigsetjmp='undef'
-d_sin6_scope_id='define'
-d_sitearch='define'
-d_snprintf='define'
-d_sockaddr_in6='define'
-d_sockaddr_sa_len='undef'
-d_sockatmark='define'
-d_sockatmarkproto='define'
-d_socket='$NACL_GLIBC_DEF'
-#d_socket='define'
-d_socklen_t='define'
-d_sockpair='$NACL_GLIBC_DEF'
-d_socks5_init='undef'
-d_sprintf_returns_strlen='define'
-d_sqrtl='define'
-d_srand48_r='undef'
-d_srandom_r='undef'
-d_sresgproto='undef'
-d_sresuproto='undef'
-d_statblks='define'
-d_statfs_f_flags='define'
-d_statfs_s='define'
-d_static_inline='define'
-d_statvfs='define'
-d_stdio_cnt_lval='undef'
-d_stdio_ptr_lval='define'
-d_stdio_ptr_lval_nochange_cnt='undef'
-d_stdio_ptr_lval_sets_cnt='define'
-d_stdio_stream_array='undef'
-d_stdiobase='define'
-d_stdstdio='$NACL_GLIBC_DEF'
-# struct FILE hack for newlib
-d_strchr='define'
-d_strcoll='define'
-d_strctcpy='define'
-d_strerrm='strerror(e)'
-d_strerror='define'
-d_strerror_r='undef'
-d_strftime='define'
-d_strlcat='undef'
-d_strlcpy='undef'
-d_strtod='define'
-d_strtol='define'
-d_strtold='define'
-d_strtoll='define'
-d_strtoq='define'
-d_strtoul='define'
-d_strtoull='define'
-d_strtouq='define'
-d_strxfrm='define'
-d_suidsafe='undef'
-d_symlink='define'
-d_syscall='$NACL_GLIBC_DEF'
-d_syscallproto='define'
-d_sysconf='define'
-d_sysernlst=''
-d_syserrlst='define'
-d_system='define'
-d_tcgetpgrp='define'
-d_tcsetpgrp='define'
-d_telldir='$NACL_GLIBC_DEF'
-d_telldirproto='define'
-d_time='define'
-d_timegm='define'
-d_times='define'
-d_tm_tm_gmtoff='undef'
-#d_tm_tm_gmtoff='define'
-d_tm_tm_zone='undef'
-#d_tm_tm_zone='define'
-d_tmpnam_r='undef'
-d_truncate='define'
-d_ttyname_r='undef'
-d_tzname='define'
-d_u32align='define'
-d_ualarm='define'
-d_umask='define'
-d_uname='define'
-d_union_semun='undef'
-d_unordered='undef'
-d_unsetenv='define'
-d_usleep='define'
-d_usleepproto='define'
-d_ustat='define'
-d_vendorarch='undef'
-d_vendorbin='undef'
-d_vendorlib='undef'
-d_vendorscript='undef'
-d_vfork='define'
-#d_vfork='undef'
-d_void_closedir='undef'
-d_voidsig='define'
-d_voidtty=''
-d_volatile='define'
-d_vprintf='define'
-d_vsnprintf='define'
-d_wait4='define'
-d_waitpid='define'
-d_wcstombs='define'
-d_wctomb='define'
-d_writev='define'
-d_xenix='undef'
-date='date'
-db_hashtype='u_int32_t'
-db_prefixtype='size_t'
-db_version_major='4'
-db_version_minor='8'
-db_version_patch='30'
-direntrytype='struct dirent'
-dlext='so'
-dlsrc="${PERL_DLSRC}"
-doublesize='8'
-drand01='Perl_drand48()'
-drand48_r_proto='0'
-dtrace=''
-dynamic_ext="${DYNAMIC_EXT}"
-#dynamic_ext='arybase attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper DB_File Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util Math/BigInt/FastCalc MIME/Base64 mro NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads threads/shared Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate Unicode/Normalize XS/APItest XS/Typemap'
-eagain='EAGAIN'
-ebcdic='undef'
-echo='echo'
-egrep='egrep'
-emacs=''
-endgrent_r_proto='0'
-endhostent_r_proto='0'
-endnetent_r_proto='0'
-endprotoent_r_proto='0'
-endpwent_r_proto='0'
-endservent_r_proto='0'
-eunicefix=':'
-exe_ext=''
-expr='expr'
-#extensions=''
-extensions='arybase attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper DB_File Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util Math/BigInt/FastCalc MIME/Base64 mro NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads threads/shared Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate Unicode/Normalize XS/APItest XS/Typemap Archive/Tar Attribute/Handlers autodie AutoLoader autouse base B/Debug bignum Carp CGI Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Devel/SelfStubber Digest Dumpvalue encoding/warnings Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS FileCache File/Fetch File/Find Fil`e/Path File/Temp Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags if IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP lib libnet Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/Build Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata Net/Ping NEXT Package/Constants Params/Check parent Parse/CPAN/Meta perlfaq PerlIO/via/QuotedPrint Perl/OSType Pod/Checker Pod/Escapes Pod/Functions Pod/Html podlators Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local version XSLoader'
-extern_C='extern'
-extras=''
-fflushNULL='define'
-fflushall='undef'
-find=''
-firstmakefile='makefile'
-flex=''
-fpossize='16'
-fpostype='fpos_t'
-freetype='void'
-from=':'
-full_ar="${NACLAR}"
-full_csh='/usr/bin/tcsh'
-full_sed='/usr/bin/sed'
-gccansipedantic=''
-gccosandvers=''
-gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]'
-getgrent_r_proto='0'
-getgrgid_r_proto='0'
-getgrnam_r_proto='0'
-gethostbyaddr_r_proto='0'
-gethostbyname_r_proto='0'
-gethostent_r_proto='0'
-getlogin_r_proto='0'
-getnetbyaddr_r_proto='0'
-getnetbyname_r_proto='0'
-getnetent_r_proto='0'
-getprotobyname_r_proto='0'
-getprotobynumber_r_proto='0'
-getprotoent_r_proto='0'
-getpwent_r_proto='0'
-getpwnam_r_proto='0'
-getpwuid_r_proto='0'
-getservbyname_r_proto='0'
-getservbyport_r_proto='0'
-getservent_r_proto='0'
-getspnam_r_proto='0'
-gidformat='"lu"'
-gidsign='1'
-gidsize='4'
-gidtype='gid_t'
-glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib '
-gmake='gmake'
-gmtime_r_proto='0'
-gnulibc_version='2.18'
-grep='grep'
-groupcat='cat /etc/group'
-groupstype='gid_t'
-gzip='gzip'
-h_fcntl='true'
-#h_fcntl='false'
-h_sysfile='true'
-hint='recommended'
-hostcat='ypcat hosts'
-hostgenerate="${BUILD_DIR}/generate_uudmap"
-#hostgenerate=''
-hostosname=''
-hostperl="${HOST_BUILD}/miniperl"
-html1dir=' '
-html1direxp=''
-html3dir=' '
-html3direxp=''
-i16size='2'
-i16type='short'
-i32size='4'
-i32type='long'
-i64size='8'
-i64type='long long'
-i8size='1'
-i8type='signed char'
-i_arpainet='$NACL_GLIBC_DEF'
-#i_arpainet='define'
-i_assert='define'
-i_bsdioctl=''
-i_crypt='undef'
-#i_crypt='define'
-i_db='undef'
-#i_db='define'
-i_dbm='define'
-i_dirent='define'
-i_dlfcn='define'
-i_fcntl='define'
-#i_fcntl='undef'
-i_float='define'
-i_fp='undef'
-i_fp_class='undef'
-i_gdbm='define'
-i_gdbm_ndbm='undef'
-i_gdbmndbm='undef'
-i_grp='define'
-i_ieeefp='undef'
-i_inttypes='define'
-i_langinfo='define'
-i_libutil='undef'
-i_limits='define'
-i_locale='define'
-i_machcthr='undef'
-i_malloc='define'
-i_mallocmalloc='undef'
-i_math='define'
-i_memory='undef'
-i_mntent='define'
-i_ndbm='define'
-i_netdb='$NACL_GLIBC_DEF'
-#i_netdb='define'
-i_neterrno='undef'
-i_netinettcp='define'
-i_niin='$NACL_GLIBC_DEF'
-#i_niin='define'
-i_poll='define'
-i_prot='undef'
-i_pthread='define'
-i_pwd='define'
-i_rpcsvcdbm='undef'
-i_sgtty='undef'
-i_shadow='undef'
-#i_shadow='define'
-i_socks='define'
-i_stdarg='define'
-i_stdbool='define'
-i_stddef='define'
-i_stdlib='define'
-i_string='define'
-i_sunmath='undef'
-i_sysaccess='undef'
-i_sysdir='define'
-i_sysfile='define'
-i_sysfilio='undef'
-i_sysin='undef'
-i_sysioctl='define'
-i_syslog='define'
-i_sysmman='define'
-i_sysmode='undef'
-i_sysmount='define'
-i_sysndir='undef'
-i_sysparam='define'
-i_syspoll='define'
-i_sysresrc='define'
-i_syssecrt='undef'
-i_sysselct='define'
-i_syssockio='undef'
-i_sysstat='define'
-i_sysstatfs='define'
-i_sysstatvfs='define'
-i_systime='define'
-i_systimek='undef'
-i_systimes='define'
-i_systypes='define'
-i_sysuio='define'
-i_sysun='define'
-i_sysutsname='define'
-i_sysvfs='define'
-i_syswait='define'
-i_termio='undef'
-i_termios='define'
-i_time='define'
-i_unistd='$UNDEF_FOR_I686'
-i_ustat='define'
-i_utime='define'
-i_values='define'
-i_varargs='undef'
-i_varhdr='stdarg.h'
-i_vfork='undef'
-ignore_versioned_solibs='y'
-inc_version_list=''
-inc_version_list_init='0'
-incpath=''
-#incpth='/usr/lib/gcc/i586-suse-linux/4.8/include /usr/local/include /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/include /usr/include'
-incpth="${NACLPORTS_INCLUDE}"
-inews=''
-initialinstalllocation='$DESTDIR/bin'
-installarchlib='$DESTDIR/lib/perl5/5.20.2/native-client'
-installbin='$DESTDIR/bin'
-installhtml1dir=''
-installhtml3dir=''
-installman1dir='$DESTDIR/local/man/man1'
-installman3dir='$DESTDIR/local/man/man3'
-installprefix='$DESTDIR'
-installprefixexp='$DESTDIR'
-installprivlib='$DESTDIR/lib/perl5/5.20.2'
-installscript='$DESTDIR/bin'
-installsitearch='$DESTDIR/lib/perl5/site_perl/5.20.2/native-client'
-installsitebin='$DESTDIR/bin'
-installsitehtml1dir=''
-installsitehtml3dir=''
-installsitelib='$DESTDIR/lib/perl5/site_perl/5.20.2'
-installsiteman1dir='$DESTDIR/local/man/man1'
-installsiteman3dir='$DESTDIR/local/man/man3'
-installsitescript='$DESTDIR/bin'
-installstyle='lib/perl5'
-installusrbinperl='undef'
-installvendorarch=''
-installvendorbin=''
-installvendorhtml1dir=''
-installvendorhtml3dir=''
-installvendorlib=''
-installvendorman1dir=''
-installvendorman3dir=''
-installvendorscript=''
-intsize='4'
-issymlink='test -h'
-ivdformat='"Ld"'
-ivsize='8'
-ivtype='long long'
-#known_extensions=''
-known_extensions='Archive/Tar arybase Attribute/Handlers attributes autodie AutoLoader autouse B base B/Debug bignum Carp CGI Compress/Raw/Bzip2 Compress/Raw/Zlib Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Cwd Data/Dumper DB_File Devel/Peek Devel/PPPort Devel/SelfStubber Digest Digest/MD5 Digest/SHA Dumpvalue Encode encoding/warnings Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS Fcntl FileCache File/DosGlob File/Fetch File/Find File/Glob File/Path File/Temp Filter/Simple Filter/Util/Call GDBM_File Getopt/Long Hash/Util Hash/Util/FieldHash HTTP/Tiny I18N/Collate I18N/Langinfo I18N/LangTags if IO IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 IPC/SysV JSON/PP lib libnet List/Util Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigInt/FastCalc Math/BigRat Math/Complex Memoize MIME/Base64 Module/Build Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata mro NDBM_File Net/Ping NEXT ODBM_File Opcode Package/Constants Params/Check parent Parse/CPAN/Meta perlfaq PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via PerlIO/via/QuotedPrint Perl/OSType Pod/Checker Pod/Escapes Pod/Functions Pod/Html podlators Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage POSIX re Safe SDBM_File Search/Dict SelfLoader Socket Storable Sys/Hostname Sys/Syslog Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue threads Thread/Semaphore threads/shared Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/HiRes Time/Local Time/Piece Unicode/Collate Unicode/Normalize version VMS/DCLsym VMS/Filespec VMS/Stdio Win32 Win32API/File Win32CORE XS/APItest XSLoader XS/Typemap '
-ksh=''
-ld="${NACLCC}"
-ld_can_script='define'
-lddlflags=" -shared ${NACLPORTS_LDFLAGS}"
-ldflags=" ${NACLPORTS_LDFLAGS}"
-ldflags_uselargefiles=''
-ldlibpthname='LD_LIBRARY_PATH'
-less='less'
-lib_ext='.a'
-libc='libc-2.18.so'
-libperl='libperl.a'
-libpth="${NACLPORTS_LIBDIR}"
-libs='-lm'
-libsdirs=" ${NACLPORTS_LIBS}"
-libsfiles=' libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so'
-libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so /usr/lib/libgdbm_compat.so'
-libspath=' /usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /lib'
-libswanted='socket inet nsl nm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat'
-libswanted_uselargefiles=''
-line=''
-lint=''
-lkflags=''
-ln='ln'
-lns='ln -s'
-localtime_r_proto='0'
-locincpth="${NACLPORTS_INCLUDE}/../../include"
-loclibpth='/usr/local/lib'
-longdblsize='12'
-longlongsize='8'
-longsize='4'
-lp=''
-lpr=''
-ls='ls'
-lseeksize='8'
-lseektype='off_t'
-mad='undef'
-madlyh=''
-madlyobj=''
-madlysrc=''
-mail=''
-mailx=''
-make='make'
-make_set_make='#'
-mallocobj=''
-mallocsrc=''
-malloctype='void *'
-man1dir='$DESTDIR/local/man/man1'
-man1direxp='$DESTDIR/local/man/man1'
-man1ext='1'
-man3dir='$DESTDIR/local/man/man3'
-man3direxp='$DESTDIR/local/man/man3'
-man3ext='3'
-mips_type=''
-mistrustnm=''
-mkdir='mkdir'
-mmaptype='void *'
-modetype='mode_t'
-more='more'
-multiarch='undef'
-mv=''
-myarchname='nacl'
-mydomain='.(none)'
-myhostname='lx09'
-myuname='linux lx09 3.11.10-7-desktop #1 smp preempt mon feb 3 09:41:24 utc 2014 (750023e) i686 i686 i386 gnulinux '
-n='-n'
-need_va_copy='undef'
-netdb_hlen_type='size_t'
-netdb_host_type='const void *'
-netdb_name_type='const char *'
-netdb_net_type='in_addr_t'
-nm='nm'
-nm_opt=''
-nm_so_opt='--dynamic'
-nonxs_ext='Archive/Tar Attribute/Handlers autodie AutoLoader autouse base B/Debug bignum Carp CGI Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Devel/SelfStubber Digest Dumpvalue encoding/warnings Env Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS FileCache File/Fetch File/Find File/Path File/Temp Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags if IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP lib libnet Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/Build Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata Net/Ping NEXT Package/Constants Params/Check parent Parse/CPAN/Meta perlfaq PerlIO/via/QuotedPrint Perl/OSType Pod/Checker Pod/Escapes Pod/Functions Pod/Html podlators Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local version XSLoader ${NONXS_EXT}'
-#nonxs_ext='Archive/Tar Attribute/Handlers autodie AutoLoader autouse base B/Debug bignum Carp CGI Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Devel/SelfStubber Digest Dumpvalue encoding/warnings Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS FileCache File/Fetch File/Find File/Path File/Temp Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags if IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP lib libnet Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/Build Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata Net/Ping NEXT Package/Constants Params/Check parent Parse/CPAN/Meta perlfaq PerlIO/via/QuotedPrint Perl/OSType Pod/Checker Pod/Escapes Pod/Functions Pod/Html podlators Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local version XSLoader'
-nroff='nroff'
-nvEUformat='"E"'
-nvFUformat='"F"'
-nvGUformat='"G"'
-nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
-nv_preserves_uv_bits='53'
-nveformat='"e"'
-nvfformat='"f"'
-nvgformat='"g"'
-nvsize='8'
-nvtype='double'
-o_nonblock='O_NONBLOCK'
-obj_ext='.o'
-old_pthread_create_joinable=''
-optimize='-O2'
-orderlib='false'
-osname='linux'
-#osname='linux'
-osvers='3.11.10-7-desktop'
-otherlibdirs=' '
-package='perl5'
-pager='/usr/bin/less -R'
-passcat='cat /etc/passwd'
-patchlevel='19'
-path_sep=':'
-perl5='/usr/bin/perl'
-perl='perl'
-perl_patchlevel=''
-perl_static_inline='static __inline__'
-perladmin='hmbrand@cpan.org'
-perllibs='-lm'
-#perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc'
-perlpath='$DESTDIR/bin/perl'
-pg='pg'
-phostname='hostname'
-pidtype='pid_t'
-plibpth='/lib/i586-suse-linux/4.8 /lib /usr/lib/i586-suse-linux/4.8 /usr/lib'
-pmake=''
-pr=''
-prefix='$DESTDIR'
-prefixexp='$DESTDIR'
-privlib='$DESTDIR/lib/perl5/5.20.2'
-privlibexp='$DESTDIR/lib/perl5/5.20.2'
-procselfexe='"/proc/self/exe"'
-prototype='define'
-ptrsize='4'
-quadkind='3'
-quadtype='long long'
-randbits='48'
-randfunc='Perl_drand48'
-random_r_proto='0'
-randseedtype='U32'
-ranlib="${NACLRANLIB}"
-rd_nodata='-1'
-readdir64_r_proto='0'
-readdir_r_proto='0'
-revision='5'
-rm='rm'
-rm_try='rm -f try try a.out .out try.[cho] try..o core core.try* try.core*'
-rmail=''
-run=''
-runnm='false'
-sGMTIME_max='2147483647'
-sGMTIME_min='-2147483648'
-sLOCALTIME_max='2147483647'
-sLOCALTIME_min='-2147483648'
-sPRIEUldbl='"LE"'
-sPRIFUldbl='"LF"'
-sPRIGUldbl='"LG"'
-sPRIXU64='"LX"'
-sPRId64='"Ld"'
-sPRIeldbl='"Le"'
-sPRIfldbl='"Lf"'
-sPRIgldbl='"Lg"'
-sPRIi64='"Li"'
-sPRIo64='"Lo"'
-sPRIu64='"Lu"'
-sPRIx64='"Lx"'
-sSCNfldbl='"Lf"'
-sched_yield='sched_yield()'
-scriptdir='/usr/bin'
-scriptdirexp='/usr/bin'
-sed='sed'
-seedfunc='Perl_drand48_init'
-selectminbits='32'
-selecttype='fd_set *'
-sendmail=''
-setgrent_r_proto='0'
-sethostent_r_proto='0'
-setlocale_r_proto='0'
-setnetent_r_proto='0'
-setprotoent_r_proto='0'
-setpwent_r_proto='0'
-setservent_r_proto='0'
-sh='/bin/sh'
-shar=''
-sharpbang='#!'
-shmattype='void *'
-shortsize='2'
-shrpenv=''
-shsharp='true'
-sig_count='65'
-sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 RTMAX IOT CLD POLL UNUSED '
-sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "NUM32", "NUM33", "RTMIN", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "NUM63", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
-sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 6 17 29 31 '
-sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 6, 17, 29, 31, 0'
-sig_size='69'
-signal_t='void'
-sitearch='$DESTDIR/lib/perl5/site_perl/5.20.2/native-client'
-sitearchexp='$DESTDIR/lib/perl5/site_perl/5.20.2/native-client'
-sitebin='$DESTDIR/bin'
-sitebinexp='$DESTDIR/bin'
-sitehtml1dir=''
-sitehtml1direxp=''
-sitehtml3dir=''
-sitehtml3direxp=''
-sitelib='$DESTDIR/lib/perl5/site_perl/5.20.2'
-sitelib_stem='$DESTDIR/lib/perl5/site_perl'
-sitelibexp='$DESTDIR/lib/perl5/site_perl/5.20.2'
-siteman1dir='$DESTDIR/local/man/man1'
-siteman1direxp='$DESTDIR/local/man/man1'
-siteman3dir='$DESTDIR/local/man/man3'
-siteman3direxp='$DESTDIR/local/man/man3'
-siteprefix='$DESTDIR'
-siteprefixexp='$DESTDIR'
-sitescript='$DESTDIR/bin'
-sitescriptexp='$DESTDIR/bin'
-sizesize='4'
-sizetype='size_t'
-sleep=''
-smail=''
-so='so'
-sockethdr=''
-socketlib=''
-socksizetype='socklen_t'
-sort='sort'
-spackage='Perl5'
-spitshell='cat'
-srand48_r_proto='0'
-srandom_r_proto='0'
-src='.'
-ssizetype='ssize_t'
-st_ino_sign='1'
-st_ino_size='8'
-startperl='#!/usr/bin/perl'
-startsh='#!/bin/sh'
-static_ext=' '
-stdchar='char'
-stdio_base="${PERL_STDIO_BASE}"
-stdio_bufsiz="${PERL_STDIO_BUFSIZ}"
-##(failed) stdio_cnt='((((fp)->_bf)._size)-((fp)->_p-((fp)->_bf)._base))'
-##(failed) stdio_cnt='(((fp)->_r)+((fp)->_w))'
-stdio_cnt="${PERL_STDIO_CNT}"
-stdio_filbuf=''
-stdio_ptr="${PERL_STDIO_PTR}"
-stdio_stream_array=''
-strerror_r_proto='0'
-strings="${NACLPORTS_INCLUDE}/string.h"
-submit=''
-subversion='2'
-sysman='/usr/share/man/man1'
-sysroot="${NACLPORTS_INCLUDE}"
-#sysroot=''
-tail=''
-tar=''
-targetarch=''
-targetdir=''
-targetenv=''
-targethost=''
-targetmkdir=''
-targetport=''
-targetsh='/bin/sh'
-tbl=''
-tee=''
-test='test'
-timeincl="${NACLPORTS_INCLUDE}/sys/time.h ${NACLPORTS_INCLUDE}/time.h "
-timetype='time_t'
-tmpnam_r_proto='0'
-to=':'
-touch='touch'
-tr='tr'
-trnl='\n'
-troff=''
-ttyname_r_proto='0'
-u16size='2'
-u16type='unsigned short'
-u32size='4'
-u32type='unsigned long'
-u64size='8'
-u64type='unsigned long long'
-u8size='1'
-u8type='unsigned char'
-uidformat='"lu"'
-uidsign='1'
-uidsize='4'
-uidtype='uid_t'
-uname='uname'
-uniq='uniq'
-uquadtype='unsigned long long'
-use5005threads='undef'
-use64bitall='undef'
-use64bitint='define'
-usecrosscompile='define'
-#usecrosscompile='undef'
-usedevel='define'
-usedl='define'
-usedtrace='undef'
-usefaststdio='undef'
-useithreads='define'
-#useithreads='undef'
-usekernprocpathname='undef'
-uselargefiles='define'
-uselongdouble='undef'
-usemallocwrap='undef'
-#usemallocwrap='define'
-usemorebits='undef'
-usemultiplicity='undef'
-usemymalloc='y'
-usenm='false'
-usensgetexecutablepath='undef'
-useopcode='true'
-useperlio='undef'
-#useperlio='define'
-useposix='true'
-usereentrant='undef'
-userelocatableinc='undef'
-useshrplib='false'
-usesitecustomize='undef'
-usesocks='undef'
-usethreads='define'
-#usethreads='undef'
-usevendorprefix='undef'
-useversionedarchname='undef'
-usevfork='false'
-usrinc="${NACLPORTS_INCLUDE}"
-uuname=''
-uvXUformat='"LX"'
-uvoformat='"Lo"'
-uvsize='8'
-uvtype='unsigned long long'
-uvuformat='"Lu"'
-uvxformat='"Lx"'
-vaproto='define'
-vendorarch=''
-vendorarchexp=''
-vendorbin=''
-vendorbinexp=''
-vendorhtml1dir=' '
-vendorhtml1direxp=''
-vendorhtml3dir=' '
-vendorhtml3direxp=''
-vendorlib=''
-vendorlib_stem=''
-vendorlibexp=''
-vendorman1dir=' '
-vendorman1direxp=''
-vendorman3dir=' '
-vendorman3direxp=''
-vendorprefix=''
-vendorprefixexp=''
-vendorscript=''
-vendorscriptexp=''
-version='5.20.2'
-version_patchlevel_string='version 20 subversion 2'
-# Undef since if defined, this leads to all executables
-# being suffixed with version number
-versiononly='undef'
-vi=''
-xlibpth='/usr/lib/386 /lib/386'
-yacc=''
-yaccflags=''
-zcat=''
-zip='zip'
-PERL_REVISION=5
-PERL_VERSION=20
-PERL_SUBVERSION=2
-PERL_API_REVISION=5
-PERL_API_VERSION=20
-PERL_API_SUBVERSION=0
-PERL_PATCHLEVEL=''
-PERL_CONFIG_SH=true
-: Variables propagated from previous config.sh file.
-libdb_needs_pthread='N'
-libdirs=' /lib /usr/local/lib'
diff --git a/ports/perl/expected_clang-newlib.txt b/ports/perl/expected_clang-newlib.txt
deleted file mode 100644
index 4aa5e55..0000000
--- a/ports/perl/expected_clang-newlib.txt
+++ /dev/null
@@ -1,174 +0,0 @@
-base/cond.t .. ok
-base/if.t .. ok
-base/lex.t .. ok
-base/num.t .. not ok
-base/pat.t .. ok
-base/rs.t .. ok
-base/while.t .. ok
-cmd/elsif.t .. ok
-cmd/for.t .. ok
-cmd/mod.t .. ok
-cmd/subval.t .. ok
-cmd/switch.t .. ok
-comp/bproto.t .. ok
-comp/cmdopt.t .. ok
-comp/decl.t .. ok
-comp/final_line_num.t .. ok
-comp/fold.t .. ok
-comp/form_scope.t .. ok
-comp/line_debug.t .. ok
-comp/our.t .. ok
-comp/package_block.t .. ok
-comp/package.t .. ok
-comp/parser.t .. ok
-comp/proto.t .. ok
-comp/redef.t .. ok
-comp/retainedlines.t .. ok
-comp/term.t .. ok
-comp/uproto.t .. ok
-comp/use.t .. ok
-comp/utf.t .. ok
-io/argv.t .. not ok
-io/crlf.t .. ok
-io/defout.t .. ok
-io/eintr_print.t .. not ok
-io/eintr.t .. not ok
-io/errnosig.t .. ok
-io/errno.t .. not ok
-io/iofile.t .. not ok
-io/layers.t .. ok
-io/nargv.t .. ok
-io/open.t .. not ok
-io/perlio_fail.t .. ok
-io/perlio_open.t .. ok
-io/perlio.t .. ok
-io/print.t .. not ok
-io/sem.t .. ok
-io/socket.t .. ok
-io/tell.t .. ok
-io/utf8.t .. ok
-lib/commonsense.t .. ok
-lib/cygwin.t .. ok
-op/append.t .. ok
-op/args.t .. ok
-op/array.t .. not ok
-op/attrproto.t .. not ok
-op/auto.t .. ok
-op/avhv.t .. ok
-op/bless.t .. ok
-op/bop.t .. ok
-op/chars.t .. ok
-op/chop.t .. ok
-op/chr.t .. ok
-op/context.t .. ok
-op/cproto.t .. ok
-op/crypt.t .. ok
-op/current_sub.t .. ok
-op/dbm.t .. ok
-op/defins.t .. not ok
-op/delete.t .. ok
-op/die.t .. ok
-op/dor.t .. ok
-op/do.t .. not ok
-op/each_array.t .. ok
-op/each.t .. ok
-op/evalbytes.t .. ok
-op/eval.t .. not ok
-op/exp.t .. ok
-op/fh.t .. ok
-op/filetest_stack_ok.t .. ok
-op/filetest.t .. not ok
-op/grent.t .. ok
-op/grep.t .. ok
-op/hashassign.t .. not ok
-op/hash.t .. not ok
-op/hashwarn.t .. ok
-op/inccode.t .. ok
-op/incfilter.t .. ok
-op/inc.t .. not ok
-op/index.t .. ok
-op/int.t .. ok
-op/join.t .. ok
-op/kvaslice.t .. ok
-op/kvhslice.t .. ok
-op/lc.t .. not ok
-op/length.t .. ok
-op/list.t .. ok
-op/localref.t .. ok
-op/local.t .. not ok
-op/lock.t .. ok
-op/lop.t .. ok
-op/magic.t .. not ok
-op/negate.t .. ok
-op/not.t .. ok
-op/ord.t .. ok
-op/or.t .. not ok
-op/overload_integer.t .. ok
-op/pos.t .. ok
-op/postfixderef.t .. ok
-op/pow.t .. ok
-op/print.t .. not ok
-op/protowarn.t .. ok
-op/push.t .. ok
-op/pwent.t .. ok
-op/quotemeta.t .. ok
-op/rand.t .. ok
-op/range.t .. ok
-op/read.t .. ok
-op/ref.t .. not ok
-op/reverse.t .. ok
-op/rt119311.t .. ok
-op/select.t .. ok
-op/signatures.t .. ok
-op/sleep.t .. ok
-op/smartmatch.t .. ok
-op/sprintf.t .. ok
-op/state.t .. ok
-op/stat.t .. not ok
-op/study.t .. ok
-op/studytied.t .. ok
-op/sub_lval.t .. ok
-op/sub.t .. not ok
-op/svleak.t .. ok
-op/switch.t .. ok
-op/symbolcache.t .. ok
-op/sysio.t .. ok
-op/tiearray.t .. ok
-op/tie_fetch_count.t .. not ok
-op/tiehandle.t .. ok
-op/tie.t .. not ok
-op/tr.t .. not ok
-op/undef.t .. ok
-op/unlink.t .. ok
-op/upgrade.t .. ok
-op/utf8magic.t .. ok
-op/utfhash.t .. ok
-op/vec.t .. ok
-op/ver.t .. ok
-op/waitpid.t .. ok
-op/wantarray.t .. ok
-op/warn.t .. not ok
-op/yadayada.t .. ok
-opbasic/arith.t .. ok
-opbasic/cmp.t .. ok
-opbasic/concat.t .. ok
-opbasic/qq.t .. ok
-re/charset.t .. ok
-re/no_utf8_pm.t .. ok
-re/pat.t .. not ok
-re/qr_gc.t .. ok
-re/qrstack.t .. ok
-re/qr.t .. ok
-re/regexp_noamp.t .. not ok
-re/regexp_notrie.t .. not ok
-re/regexp_qr_embed.t .. not ok
-re/regexp_qr.t .. not ok
-re/regexp.t .. not ok
-re/regexp_trielist.t .. not ok
-re/regex_sets_compat.t .. not ok
-re/regex_sets.t .. not ok
-re/reg_nc_tie.t .. not ok
-re/reg_pmod.t .. ok
-re/rxcode.t .. not ok
-Scheduled 172 tests, passed 132 successfully.
-76% okay.
diff --git a/ports/perl/expected_glibc.txt b/ports/perl/expected_glibc.txt
deleted file mode 100644
index 04e9967..0000000
--- a/ports/perl/expected_glibc.txt
+++ /dev/null
@@ -1,174 +0,0 @@
-base/cond.t .. ok
-base/if.t .. ok
-base/lex.t .. ok
-base/num.t .. ok
-base/pat.t .. ok
-base/rs.t .. ok
-base/while.t .. ok
-cmd/elsif.t .. ok
-cmd/for.t .. ok
-cmd/mod.t .. ok
-cmd/subval.t .. ok
-cmd/switch.t .. ok
-comp/bproto.t .. ok
-comp/cmdopt.t .. ok
-comp/decl.t .. ok
-comp/final_line_num.t .. ok
-comp/fold.t .. not ok
-comp/form_scope.t .. ok
-comp/line_debug.t .. ok
-comp/our.t .. ok
-comp/package_block.t .. ok
-comp/package.t .. ok
-comp/parser.t .. ok
-comp/proto.t .. ok
-comp/redef.t .. ok
-comp/retainedlines.t .. ok
-comp/term.t .. ok
-comp/uproto.t .. ok
-comp/use.t .. ok
-comp/utf.t .. ok
-io/argv.t .. not ok
-io/crlf.t .. ok
-io/defout.t .. ok
-io/eintr_print.t .. ok
-io/eintr.t .. not ok
-io/errnosig.t .. ok
-io/errno.t .. not ok
-io/iofile.t .. ok
-io/layers.t .. ok
-io/nargv.t .. ok
-io/open.t .. not ok
-io/perlio_fail.t .. ok
-io/perlio_open.t .. ok
-io/perlio.t .. ok
-io/print.t .. not ok
-io/sem.t .. ok
-io/socket.t .. ok
-io/tell.t .. ok
-io/utf8.t .. ok
-lib/commonsense.t .. ok
-lib/cygwin.t .. ok
-op/append.t .. ok
-op/args.t .. ok
-op/array.t .. not ok
-op/attrproto.t .. ok
-op/auto.t .. ok
-op/avhv.t .. ok
-op/bless.t .. ok
-op/bop.t .. ok
-op/chars.t .. ok
-op/chop.t .. ok
-op/chr.t .. ok
-op/context.t .. ok
-op/cproto.t .. ok
-op/crypt.t .. ok
-op/current_sub.t .. ok
-op/dbm.t .. not ok
-op/defins.t .. ok
-op/delete.t .. ok
-op/die.t .. ok
-op/dor.t .. ok
-op/do.t .. not ok
-op/each_array.t .. ok
-op/each.t .. ok
-op/evalbytes.t .. ok
-op/eval.t .. not ok
-op/exp.t .. ok
-op/fh.t .. ok
-op/filetest_stack_ok.t .. ok
-op/filetest.t .. not ok
-op/grent.t .. ok
-op/grep.t .. ok
-op/hashassign.t .. ok
-op/hash.t .. not ok
-op/hashwarn.t .. ok
-op/inccode.t .. not ok
-op/incfilter.t .. ok
-op/inc.t .. not ok
-op/index.t .. ok
-op/int.t .. ok
-op/join.t .. ok
-op/kvaslice.t .. ok
-op/kvhslice.t .. ok
-op/lc.t .. not ok
-op/length.t .. ok
-op/list.t .. ok
-op/localref.t .. ok
-op/local.t .. not ok
-op/lock.t .. ok
-op/lop.t .. ok
-op/magic.t .. not ok
-op/negate.t .. ok
-op/not.t .. ok
-op/ord.t .. ok
-op/or.t .. not ok
-op/overload_integer.t .. ok
-op/pos.t .. ok
-op/postfixderef.t .. ok
-op/pow.t .. ok
-op/print.t .. not ok
-op/protowarn.t .. ok
-op/push.t .. ok
-op/pwent.t .. ok
-op/quotemeta.t .. ok
-op/rand.t .. ok
-op/range.t .. ok
-op/read.t .. ok
-op/ref.t .. not ok
-op/reverse.t .. ok
-op/rt119311.t .. ok
-op/select.t .. ok
-op/signatures.t .. ok
-op/sleep.t .. ok
-op/smartmatch.t .. ok
-op/sprintf.t .. ok
-op/state.t .. ok
-op/stat.t .. not ok
-op/study.t .. ok
-op/studytied.t .. ok
-op/sub_lval.t .. not ok
-op/sub.t .. not ok
-op/svleak.t .. not ok
-op/switch.t .. ok
-op/symbolcache.t .. ok
-op/sysio.t .. ok
-op/tiearray.t .. ok
-op/tie_fetch_count.t .. ok
-op/tiehandle.t .. ok
-op/tie.t .. not ok
-op/tr.t .. not ok
-op/undef.t .. ok
-op/unlink.t .. ok
-op/upgrade.t .. ok
-op/utf8magic.t .. ok
-op/utfhash.t .. ok
-op/vec.t .. ok
-op/ver.t .. ok
-op/waitpid.t .. ok
-op/wantarray.t .. ok
-op/warn.t .. not ok
-op/yadayada.t .. ok
-opbasic/arith.t .. ok
-opbasic/cmp.t .. ok
-opbasic/concat.t .. ok
-opbasic/qq.t .. ok
-re/charset.t .. not ok
-re/no_utf8_pm.t .. ok
-re/pat.t .. not ok
-re/qr_gc.t .. ok
-re/qrstack.t .. ok
-re/qr.t .. ok
-re/regexp_noamp.t .. ok
-re/regexp_notrie.t .. ok
-re/regexp_qr_embed.t .. ok
-re/regexp_qr.t .. ok
-re/regexp.t .. ok
-re/regexp_trielist.t .. ok
-re/regex_sets_compat.t .. ok
-re/regex_sets.t .. not ok
-re/reg_nc_tie.t .. ok
-re/reg_pmod.t .. ok
-re/rxcode.t .. ok
-Scheduled 172 tests, passed 142 successfully.
-82% okay.
diff --git a/ports/perl/expected_newlib.txt b/ports/perl/expected_newlib.txt
deleted file mode 100644
index 4aa5e55..0000000
--- a/ports/perl/expected_newlib.txt
+++ /dev/null
@@ -1,174 +0,0 @@
-base/cond.t .. ok
-base/if.t .. ok
-base/lex.t .. ok
-base/num.t .. not ok
-base/pat.t .. ok
-base/rs.t .. ok
-base/while.t .. ok
-cmd/elsif.t .. ok
-cmd/for.t .. ok
-cmd/mod.t .. ok
-cmd/subval.t .. ok
-cmd/switch.t .. ok
-comp/bproto.t .. ok
-comp/cmdopt.t .. ok
-comp/decl.t .. ok
-comp/final_line_num.t .. ok
-comp/fold.t .. ok
-comp/form_scope.t .. ok
-comp/line_debug.t .. ok
-comp/our.t .. ok
-comp/package_block.t .. ok
-comp/package.t .. ok
-comp/parser.t .. ok
-comp/proto.t .. ok
-comp/redef.t .. ok
-comp/retainedlines.t .. ok
-comp/term.t .. ok
-comp/uproto.t .. ok
-comp/use.t .. ok
-comp/utf.t .. ok
-io/argv.t .. not ok
-io/crlf.t .. ok
-io/defout.t .. ok
-io/eintr_print.t .. not ok
-io/eintr.t .. not ok
-io/errnosig.t .. ok
-io/errno.t .. not ok
-io/iofile.t .. not ok
-io/layers.t .. ok
-io/nargv.t .. ok
-io/open.t .. not ok
-io/perlio_fail.t .. ok
-io/perlio_open.t .. ok
-io/perlio.t .. ok
-io/print.t .. not ok
-io/sem.t .. ok
-io/socket.t .. ok
-io/tell.t .. ok
-io/utf8.t .. ok
-lib/commonsense.t .. ok
-lib/cygwin.t .. ok
-op/append.t .. ok
-op/args.t .. ok
-op/array.t .. not ok
-op/attrproto.t .. not ok
-op/auto.t .. ok
-op/avhv.t .. ok
-op/bless.t .. ok
-op/bop.t .. ok
-op/chars.t .. ok
-op/chop.t .. ok
-op/chr.t .. ok
-op/context.t .. ok
-op/cproto.t .. ok
-op/crypt.t .. ok
-op/current_sub.t .. ok
-op/dbm.t .. ok
-op/defins.t .. not ok
-op/delete.t .. ok
-op/die.t .. ok
-op/dor.t .. ok
-op/do.t .. not ok
-op/each_array.t .. ok
-op/each.t .. ok
-op/evalbytes.t .. ok
-op/eval.t .. not ok
-op/exp.t .. ok
-op/fh.t .. ok
-op/filetest_stack_ok.t .. ok
-op/filetest.t .. not ok
-op/grent.t .. ok
-op/grep.t .. ok
-op/hashassign.t .. not ok
-op/hash.t .. not ok
-op/hashwarn.t .. ok
-op/inccode.t .. ok
-op/incfilter.t .. ok
-op/inc.t .. not ok
-op/index.t .. ok
-op/int.t .. ok
-op/join.t .. ok
-op/kvaslice.t .. ok
-op/kvhslice.t .. ok
-op/lc.t .. not ok
-op/length.t .. ok
-op/list.t .. ok
-op/localref.t .. ok
-op/local.t .. not ok
-op/lock.t .. ok
-op/lop.t .. ok
-op/magic.t .. not ok
-op/negate.t .. ok
-op/not.t .. ok
-op/ord.t .. ok
-op/or.t .. not ok
-op/overload_integer.t .. ok
-op/pos.t .. ok
-op/postfixderef.t .. ok
-op/pow.t .. ok
-op/print.t .. not ok
-op/protowarn.t .. ok
-op/push.t .. ok
-op/pwent.t .. ok
-op/quotemeta.t .. ok
-op/rand.t .. ok
-op/range.t .. ok
-op/read.t .. ok
-op/ref.t .. not ok
-op/reverse.t .. ok
-op/rt119311.t .. ok
-op/select.t .. ok
-op/signatures.t .. ok
-op/sleep.t .. ok
-op/smartmatch.t .. ok
-op/sprintf.t .. ok
-op/state.t .. ok
-op/stat.t .. not ok
-op/study.t .. ok
-op/studytied.t .. ok
-op/sub_lval.t .. ok
-op/sub.t .. not ok
-op/svleak.t .. ok
-op/switch.t .. ok
-op/symbolcache.t .. ok
-op/sysio.t .. ok
-op/tiearray.t .. ok
-op/tie_fetch_count.t .. not ok
-op/tiehandle.t .. ok
-op/tie.t .. not ok
-op/tr.t .. not ok
-op/undef.t .. ok
-op/unlink.t .. ok
-op/upgrade.t .. ok
-op/utf8magic.t .. ok
-op/utfhash.t .. ok
-op/vec.t .. ok
-op/ver.t .. ok
-op/waitpid.t .. ok
-op/wantarray.t .. ok
-op/warn.t .. not ok
-op/yadayada.t .. ok
-opbasic/arith.t .. ok
-opbasic/cmp.t .. ok
-opbasic/concat.t .. ok
-opbasic/qq.t .. ok
-re/charset.t .. ok
-re/no_utf8_pm.t .. ok
-re/pat.t .. not ok
-re/qr_gc.t .. ok
-re/qrstack.t .. ok
-re/qr.t .. ok
-re/regexp_noamp.t .. not ok
-re/regexp_notrie.t .. not ok
-re/regexp_qr_embed.t .. not ok
-re/regexp_qr.t .. not ok
-re/regexp.t .. not ok
-re/regexp_trielist.t .. not ok
-re/regex_sets_compat.t .. not ok
-re/regex_sets.t .. not ok
-re/reg_nc_tie.t .. not ok
-re/reg_pmod.t .. ok
-re/rxcode.t .. not ok
-Scheduled 172 tests, passed 132 successfully.
-76% okay.
diff --git a/ports/perl/nacl.patch b/ports/perl/nacl.patch
deleted file mode 100644
index ff1615d..0000000
--- a/ports/perl/nacl.patch
+++ /dev/null
@@ -1,370 +0,0 @@
-diff --git a/Makefile.micro b/Makefile.micro
-old mode 100644
-new mode 100755
---- a/Makefile.micro
-+++ b/Makefile.micro
-@@ -1,11 +1,14 @@
- LD = $(CC)
- CCFLAGS = -c
-+BUILD_CCFLAGS = -c
- DEFINES = -DPERL_CORE -DPERL_MICRO -DSTANDARD_C -DPERL_USE_SAFE_PUTENV \
- -DNO_MATHOMS
- OPTIMIZE =
- CFLAGS = $(DEFINES) $(OPTIMIZE)
- LDFLAGS =
-+BUILD_LDFLAGS =
- LIBS = -lm
-+BUILD_LIBS = -lm
- _O = .o
- ENV = env
- PERL = perl
-@@ -14,7 +17,7 @@ RUN =
-
- all: microperl
-
--O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udump$(_O) \
-+O = uav$(_O) ucaretx$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udump$(_O) \
- uglobals$(_O) ugv$(_O) uhv$(_O) umro$(_O)\
- umg$(_O) uperlmain$(_O) uop$(_O) ureentr$(_O) \
- upad$(_O) uperl$(_O) uperlio$(_O) uperly$(_O) upp$(_O) \
-@@ -66,6 +69,9 @@ perly.h: perly.y
-
- uav$(_O): $(HE) av.c
- $(CC) $(CCFLAGS) -o $@ $(CFLAGS) av.c
-+
-+ucaretx$(_O): $(HE) caretx.c
-+ $(CC) $(CCFLAGS) -o $@ $(CFLAGS) caretx.c
-
- udeb$(_O): $(HE) deb.c
- $(CC) $(CCFLAGS) -o $@ $(CFLAGS) deb.c
-@@ -184,10 +190,10 @@ ubitcount.h: ugenerate_uudmap$(_X)
- $(RUN) ./ugenerate_uudmap$(_X) $(generated_headers)
-
- ugenerate_uudmap$(_O): generate_uudmap.c
-- $(CC) $(CCFLAGS) -o $@ $(CFLAGS) generate_uudmap.c
-+ $(BUILD_CC) $(BUILD_CCFLAGS) -o $@ $(CFLAGS) generate_uudmap.c
-
- ugenerate_uudmap$(_X): ugenerate_uudmap$(_O)
-- $(LD) -o ugenerate_uudmap $(LDFLAGS) ugenerate_uudmap$(_O) $(LIBS)
-+ $(BUILD_LD) -o ugenerate_uudmap $(BUILD_LDFLAGS) ugenerate_uudmap$(_O) $(BUILD_LIBS)
-
- microtest: microperl
- - cd t && (rm -f perl; ln -s ../microperl perl) \
-diff --git a/installperl b/installperl
---- a/installperl
-+++ b/installperl
-@@ -383,9 +383,9 @@ foreach my $file (@corefiles) {
- if (copy_if_diff($file,"$installarchlib/CORE/$file")) {
- if ($file =~ /\.(\Q$so\E|\Q$dlext\E)$/) {
- strip("-S", "$installarchlib/CORE/$file") if $^O eq 'darwin';
-- chmod(0555, "$installarchlib/CORE/$file");
-+ chmod(0755, "$installarchlib/CORE/$file");
- } else {
-- chmod(0444, "$installarchlib/CORE/$file");
-+ chmod(0644, "$installarchlib/CORE/$file");
- }
- }
- }
-@@ -753,7 +753,7 @@ sub installlib {
- if (copy_if_diff($_, "$installlib/$name")) {
- strip("-S", "$installlib/$name")
- if $^O eq 'darwin' and /\.(?:so|$dlext|a)$/;
-- chmod(/\.(so|$dlext)$/ ? 0555 : 0444, "$installlib/$name");
-+ chmod(/\.(so|$dlext)$/ ? 0755 : 0644, "$installlib/$name");
- }
- }
- }
-diff --git a/perl.h b/perl.h
-old mode 100644
-new mode 100755
---- a/perl.h
-+++ b/perl.h
-@@ -3561,7 +3561,7 @@ my_swap16(const U16 x) {
- #endif
-
- #ifndef __cplusplus
--#if !(defined(WIN32) || defined(UNDER_CE) || defined(SYMBIAN))
-+#if !(defined(WIN32) || defined(UNDER_CE) || defined(SYMBIAN) || defined(__native_client__))
- Uid_t getuid (void);
- Uid_t geteuid (void);
- Gid_t getgid (void);
-diff --git a/pod/Makefile.SH b/pod/Makefile.SH
-old mode 100644
-new mode 100755
-diff --git a/pp_sys.c b/pp_sys.c
-old mode 100644
-new mode 100755
---- a/pp_sys.c
-+++ b/pp_sys.c
-@@ -32,6 +32,11 @@
- #include "time64.h"
- #include "time64.c"
-
-+#if defined(__native_client__)
-+#include <spawn.h>
-+#define pipe nacl_spawn_pipe
-+#endif
-+
- #ifdef I_SHADOW
- /* Shadow password support for solaris - pdo@cs.umd.edu
- * Not just Solaris: at least HP-UX, IRIX, Linux.
-@@ -302,11 +307,31 @@ PP(pp_backtick)
- const char *mode = "r";
-
- TAINT_PROPER("``");
-+ /* Kind of like an inline implementation of popen.
-+ * Currently has race issues, and also possibly doesn't
-+ * work with some coreutils utilities.
-+ */
-+# if defined(__native_client__)
-+ int pipe_ends[2];
-+ char * popen_args[] = {"bash", "-c", tmps, NULL};
-+ pipe(pipe_ends);
-+ pid_t pid = vfork();
-+ /* CHILD */
-+ if (!pid) {
-+ close(pipe_ends[0]);
-+ dup2(pipe_ends[1], 1);
-+ execv(popen_args[0], popen_args);
-+ }
-+ /* PARENT */
-+ close(pipe_ends[1]);
-+ fp = fdopen(pipe_ends[0], "r");
-+# else
- if (PL_op->op_private & OPpOPEN_IN_RAW)
- mode = "rb";
- else if (PL_op->op_private & OPpOPEN_IN_CRLF)
- mode = "rt";
- fp = PerlProc_popen(tmps, mode);
-+# endif
- if (fp) {
- const char * const type = Perl_PerlIO_context_layers(aTHX_ NULL);
- if (type && *type)
-@@ -342,7 +367,18 @@ PP(pp_backtick)
- SvTAINTED_on(sv);
- }
- }
-+# if defined(__native_client__)
-+ /* Inline pclose */
-+ int pstat;
-+ (void) fclose(fp);
-+ do {
-+ pid = waitpid(pid, &pstat, 0);
-+ } while (pid == -1 && errno == EINTR);
-+ int ret = (pid == -1 ? -1 : pstat);
-+ STATUS_NATIVE_CHILD_SET(ret);
-+# else
- STATUS_NATIVE_CHILD_SET(PerlProc_pclose(fp));
-+# endif
- TAINT; /* "I believe that this is not gratuitous!" */
- }
- else {
-@@ -4114,7 +4150,7 @@ PP(pp_system)
- TAINT_PROPER("system");
- }
- PERL_FLUSHALL_FOR_CHILD;
--#if (defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(OS2) || defined(PERL_MICRO)
-+#if (defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__native_client__) && !defined(OS2) || defined(PERL_MICRO)
- {
- Pid_t childpid;
- int pp[2];
-@@ -4213,26 +4249,62 @@ PP(pp_system)
- }
- PerlProc__exit(-1);
- }
--#else /* ! FORK or VMS or OS/2 */
-+#else /* ! FORK or VMS or OS/2 or NaCl */
- PL_statusvalue = 0;
- result = 0;
-+ char * args[(SP-MARK)+3];
-+ args[0] = "bash";
-+ args[1] = "-c";
-+ int index = 2, counter = 0;
-+ while (++MARK <= SP) {
-+ if (*MARK) {
-+ args[index++] = SvPV_nolen(*MARK);
-+ counter++;
-+ }
-+ else
-+ args[index++] = "";
-+ }
-+ args[index] = NULL;
- if (PL_op->op_flags & OPf_STACKED) {
- SV * const really = *++MARK;
- # if defined(WIN32) || defined(OS2) || defined(__SYMBIAN32__) || defined(__VMS)
- value = (I32)do_aspawn(really, MARK, SP);
- # else
-+# if defined(__native_client__)
-+ /* In subsequent spawnv's, ideally "really"
-+ * should be first checked. If it is not NULL,
-+ * then it should be used instead of args[0]
-+ * But I'm replacing with args[0] or "bash",
-+ * since it always works. Also handling the
-+ * case when system() is called without any
-+ * arguments.
-+ */
-+ if (counter > 0) value = (I32)spawnv(P_WAIT, args[0], args);
-+# else
- value = (I32)do_aspawn(really, (void **)MARK, (void **)SP);
- # endif
-+# endif
- }
- else if (SP - MARK != 1) {
- # if defined(WIN32) || defined(OS2) || defined(__SYMBIAN32__) || defined(__VMS)
- value = (I32)do_aspawn(NULL, MARK, SP);
- # else
-+# if defined(__native_client__)
-+ /*
-+ * "really" is NULL.
-+ */
-+ if (counter > 0) value = (I32)spawnv(P_WAIT, args[0], args);
-+# else
- value = (I32)do_aspawn(NULL, (void **)MARK, (void **)SP);
- # endif
-+# endif
- }
- else {
-+# if defined(__native_client__)
-+ if (counter > 0) value = (I32)spawnv(P_WAIT, args[0], args);
-+# else
- value = (I32)do_spawn(SvPVx_nolen(sv_mortalcopy(*SP)));
-+# endif
- }
- if (PL_statusvalue == -1) /* hint that value must be returned as is */
- result = 1;
-@@ -4240,7 +4312,7 @@ PP(pp_system)
- do_execfree();
- SP = ORIGMARK;
- XPUSHi(result ? value : STATUS_CURRENT);
--#endif /* !FORK or VMS or OS/2 */
-+#endif /* !FORK or VMS or OS/2 or NaCl */
- #endif
- RETURN;
- }
-@@ -4561,12 +4633,17 @@ PP(pp_sleep)
- Time_t when;
-
- (void)time(&lasttime);
-+ #if defined(__native_client__)
-+ duration = POPi;
-+ sleep((unsigned int)duration);
-+ #else
- if (MAXARG < 1 || (!TOPs && !POPs))
- PerlProc_pause();
- else {
- duration = POPi;
- PerlProc_sleep((unsigned int)duration);
- }
-+ #endif
- (void)time(&when);
- XPUSHi(when - lasttime);
- RETURN;
-diff --git a/util.c b/util.c
-old mode 100644
-new mode 100755
---- a/util.c
-+++ b/util.c
-@@ -26,6 +26,11 @@
- #include "perl.h"
- #include "reentr.h"
-
-+#if defined(__native_client__)
-+#include <spawn.h>
-+#define pipe nacl_spawn_pipe
-+#endif
-+
- #if defined(USE_PERLIO)
- #include "perliol.h" /* For PerlIOUnix_refcnt */
- #endif
-@@ -2285,6 +2290,9 @@ Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
- /* Try for another pipe pair for error return */
- if (PerlProc_pipe(pp) >= 0)
- did_pipes = 1;
-+ #if defined(__native_client__)
-+ pid = vfork();
-+ #else
- while ((pid = PerlProc_fork()) < 0) {
- if (errno != EAGAIN) {
- PerlLIO_close(p[This]);
-@@ -2298,6 +2306,7 @@ Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
- Perl_ck_warner(aTHX_ packWARN(WARN_PIPE), "Can't fork, trying again in 5 seconds");
- sleep(5);
- }
-+ #endif
- if (pid == 0) {
- /* Child */
- #undef THIS
-@@ -2335,7 +2344,24 @@ Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
- }
- }
- #endif
-+ #if defined(__native_client__)
-+ /* Extract the char data in args to execv according to us */
-+ char * exec_args[n+3];
-+ int i = 2;
-+ exec_args[0] = "bash";
-+ exec_args[1] = "-c";
-+ SV **beg = args-1, **end = args-1+n;
-+ while (++beg <= end) {
-+ if (*beg)
-+ exec_args[i++] = SvPV_nolen_const(*beg);
-+ else
-+ exec_args[i++] = "";
-+ }
-+ exec_args[i] = NULL;
-+ execv(exec_args[0], exec_args);
-+ #else
- do_aexec5(NULL, args-1, args-1+n, pp[1], did_pipes);
-+ #endif
- PerlProc__exit(1);
- #undef THIS
- #undef THAT
-@@ -2430,6 +2456,9 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode)
- return NULL;
- if (doexec && PerlProc_pipe(pp) >= 0)
- did_pipes = 1;
-+ #if defined(__native_client__)
-+ pid = vfork();
-+ #else
- while ((pid = PerlProc_fork()) < 0) {
- if (errno != EAGAIN) {
- PerlLIO_close(p[This]);
-@@ -2445,6 +2474,7 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode)
- Perl_ck_warner(aTHX_ packWARN(WARN_PIPE), "Can't fork, trying again in 5 seconds");
- sleep(5);
- }
-+ #endif
- if (pid == 0) {
-
- #undef THIS
-@@ -2480,7 +2510,12 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode)
- }
- #endif
- /* may or may not use the shell */
-+ #if defined(__native_client__)
-+ char * exec_args[] = {"bash", "-c", cmd, NULL};
-+ execv(exec_args[0], exec_args);
-+ #else
- do_exec3(cmd, pp[1], did_pipes);
-+ #endif
- PerlProc__exit(1);
- }
- #endif /* defined OS2 */
-@@ -2616,7 +2651,17 @@ Perl_my_fork(void)
- #else
- /* atfork_lock() and atfork_unlock() are installed as pthread_atfork()
- * handlers elsewhere in the code */
-+ /* (TODO) agaurav77 : Remove vfork when all modules and functions using
-+ * fork have been patched to work fine, or when fork
-+ * is available. Currently doing a vfork is
-+ * advantageous in some situations and risky in some
-+ * other situations.
-+ */
-+ # if defined(__native_client__)
-+ pid = vfork();
-+ # else
- pid = fork();
-+ # endif
- #endif
- return pid;
- #else
diff --git a/ports/perl/pkg_info b/ports/perl/pkg_info
deleted file mode 100644
index bf6f6a5..0000000
--- a/ports/perl/pkg_info
+++ /dev/null
@@ -1,13 +0,0 @@
-NAME=perl
-VERSION=5.20.2
-URL=http://www.cpan.org/src/5.0/perl-5.20.2.tar.gz
-LICENSE=GPL
-DEPENDS=(glibc-compat libtar nacl-spawn)
-# build broken under mac
-# TODO(agaurav77) remove this after the issue is resolved
-# issue at http://code.google.com/p/naclports/issues/detail?id=220
-BUILD_OS=linux
-SHA1=07263da0703d97733a4d51bf77192039462d4a5a
-# glibc/arm: missing sys/prctl.h
-# https://code.google.com/p/nativeclient/issues/detail?id=4250
-DISABLED_TOOLCHAIN=(glibc/arm emscripten)
diff --git a/ports/perl/tests.sh b/ports/perl/tests.sh
deleted file mode 100755
index 5991a4f..0000000
--- a/ports/perl/tests.sh
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright 2015 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.
-
-# *** sel_ldr tests for Perl5 ***
-# A lot of the tests extensively use subprocesses, thus excluded
-# TODO(agaurav77) : recheck tests for more potential sel_ldr tests
-
-cd t
-# all the directories whose tests we want to run
-INCLUDE_DIRS="base cmd comp io lib op opbasic re"
-# files to be tested inside the included folders
-declare -a INCLUDE_FILES=(
- # base
- "cond if lex num pat rs while"
- # cmd
- "elsif for mod subval switch"
- # comp
- "bproto cmdopt decl final_line_num fold form_scope line_debug our \
- package_block package parser proto redef retainedlines term uproto \
- use utf"
- # io
- "crlf defout eintr_print errnosig iofile layers nargv perlio_fail \
- perlio_open perlio sem socket tell utf8"
- # lib
- "commonsense cygwin"
- # op
- "append args attrproto auto avhv bless bop chars chop chr context \
- cproto crypt current_sub dbm defins delete die dor each_array each \
- evalbytes exp fh filetest_stack_ok grent grep hashassign hashwarn \
- inccode incfilter index int join kvaslice kvhslice length list localref \
- lock lop negate not ord overload_integer pos postfixderef pow protowarn \
- push pwent quotemeta rand range read reverse rt119311 select signatures \
- sleep smartmatch sprintf state study studytied sub_lval svleak switch \
- symbolcache sysio tiearray tie_fetch_count tiehandle undef unlink upgrade \
- utf8magic utfhash vec ver waitpid wantarray yadayada"
- # opbasic
- "arith cmp concat qq"
- # re
- "charset no_utf8_pm qr_gc qrstack qr regexp_noamp regexp_notrie \
- regexp_qr_embed regexp_qr regexp regexp_trielist \
- regex_sets_compat reg_nc_tie reg_pmod rxcode"
- )
-
-# how many tests have gone by? how many successful?
-COUNT=0
-SUCCESS=0
-# which directory are we in?
-ARRAY_IDX=0
-for DIR in $INCLUDE_DIRS; do
- # enlist files in the directory FOLDER
- FILES=$(ls $DIR/)
- for FILE in $FILES; do
- # if FILE ends with .t and is not excluded, then do a test
- if [[ ${FILE:(-2)} == ".t" &&
- ${INCLUDE_FILES[$ARRAY_IDX]} == *${FILE::(-2)}* ]]; then
- # do the test
- OUTPUT=`../perl.sh ${DIR}/${FILE}`
- RE='^1..[0-9]+$'
- LIMITS=$(echo $OUTPUT | cut -d' ' -f 1)
- if ! [[ "${LIMITS}" =~ $RE ]]; then
- echo "${DIR}/${FILE} .. not ok"
- ((COUNT=COUNT+1))
- continue
- fi
- LOWER=$(echo $LIMITS | cut -d'.' -f 1)
- UPPER=$(echo $LIMITS | cut -d'.' -f 3)
- # echo "going from ${LOWER} to ${UPPER}"
- FOUND=0
- for ((i=LOWER;i<=UPPER;i++)); do
- if [[ "${OUTPUT}" == *"ok $i"* && "${OUTPUT}" != *"not ok $i"* ]]; then
- ((FOUND=FOUND+1))
- else
- break
- fi
- done
- if [[ "${FOUND}" == "${UPPER}" ]]; then
- echo "${DIR}/${FILE} .. ok"
- ((SUCCESS=SUCCESS+1))
- else
- echo "${DIR}/${FILE} .. not ok"
- fi
- ((COUNT=COUNT+1))
- fi
- done
- ((ARRAY_IDX=ARRAY_IDX+1))
-done
-# print results
-echo "Scheduled $COUNT tests, passed $SUCCESS successfully."
-echo "$((SUCCESS*100/COUNT))% okay."
diff --git a/ports/physfs/build.sh b/ports/physfs/build.sh
deleted file mode 100644
index 4e2f5d2..0000000
--- a/ports/physfs/build.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (c) 2013 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.
-
-# TODO(binji): turn on shared building for glibc (need -fPIC)
-BUILD_SHARED=FALSE
-# TODO(binji): The tests don't currently build without zlib as a shared
-# library.
-BUILD_TEST=FALSE
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-EXTRA_CMAKE_ARGS=" \
- -DPHYSFS_BUILD_SHARED=${BUILD_SHARED} \
- -DPHYSFS_BUILD_TEST=${BUILD_TEST} \
- -DPHYSFS_HAVE_MNTENT_H=FALSE"
diff --git a/ports/physfs/nacl.patch b/ports/physfs/nacl.patch
deleted file mode 100644
index 49a4056..0000000
--- a/ports/physfs/nacl.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff --git a/physfs_platforms.h b/physfs_platforms.h
---- a/physfs_platforms.h
-+++ b/physfs_platforms.h
-@@ -38,7 +38,7 @@
- # endif
- #elif defined(macintosh)
- # error Classic Mac OS support was dropped from PhysicsFS 2.0. Move to OS X.
--#elif defined(unix) || defined(__unix__)
-+#elif defined(unix) || defined(__unix__) || defined(__native_client__)
- # define PHYSFS_PLATFORM_UNIX
- # define PHYSFS_PLATFORM_POSIX
- #else
-diff --git a/platform/posix.c b/platform/posix.c
---- a/platform/posix.c
-+++ b/platform/posix.c
-@@ -27,6 +27,11 @@
- #include <linux/unistd.h>
- #endif
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+// Newlib doesn't define lstat.
-+#define lstat stat
-+#endif
-+
- #include "physfs_internal.h"
-
-
-diff --git a/platform/unix.c b/platform/unix.c
---- a/platform/unix.c
-+++ b/platform/unix.c
-@@ -283,8 +283,13 @@ char *__PHYSFS_platformRealPath(const char *path)
- char resolved_path[MAXPATHLEN];
- char *retval = NULL;
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+ // TODO(binji): Real implementation for Newlib.
-+ strncpy(resolved_path, path, MAXPATHLEN);
-+#else
- errno = 0;
- BAIL_IF_MACRO(!realpath(path, resolved_path), strerror(errno), NULL);
-+#endif
- retval = (char *) allocator.Malloc(strlen(resolved_path) + 1);
- BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
- strcpy(retval, resolved_path);
diff --git a/ports/physfs/pkg_info b/ports/physfs/pkg_info
deleted file mode 100644
index b9daef9..0000000
--- a/ports/physfs/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=physfs
-VERSION=2.0.3
-URL=http://icculus.org/physfs/downloads/physfs-2.0.3.tar.bz2
-LICENSE=CUSTOM:LICENSE.txt
-DEPENDS=(zlib)
-SHA1=327308c777009a41bbabb9159b18c4c0ac069537
-# The cmake version seems to fails when using with emcc
-# https://bugs.chromium.org/p/naclports/issues/detail?id=243
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/pixman/build.sh b/ports/pixman/build.sh
deleted file mode 100644
index f14be97..0000000
--- a/ports/pixman/build.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES=test/pixel-test${NACL_EXEEXT}
-
-EXTRA_CONFIGURE_ARGS="
- --disable-arm-simd
- --disable-arm-iwmmxt
- --disable-arm-iwmmxt2
- --disable-arm-neon"
-
-export PERL=/bin/true
diff --git a/ports/pixman/nacl.patch b/ports/pixman/nacl.patch
deleted file mode 100644
index 4f243c2..0000000
--- a/ports/pixman/nacl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
---- a/pixman/pixman-mmx.c
-+++ b/pixman/pixman-mmx.c
-@@ -97,7 +97,7 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
-
- asm ("pshufw %2, %1, %0\n\t"
- : "=y" (ret)
-- : "y" (__A), "K" (__N)
-+ : "y" (__A), "X" (__N)
- );
-
- return ret;
-diff --git a/pixman/pixman-x86.c b/pixman/pixman-x86.c
---- a/pixman/pixman-x86.c
-+++ b/pixman/pixman-x86.c
-@@ -80,7 +80,7 @@ detect_cpu_features (void)
- static pixman_bool_t
- have_cpuid (void)
- {
--#if _PIXMAN_X86_64 || defined (_MSC_VER)
-+#if _PIXMAN_X86_64 || defined (_MSC_VER) || defined (__native_client__)
-
- return TRUE;
-
diff --git a/ports/pixman/pkg_info b/ports/pixman/pkg_info
deleted file mode 100644
index dc5d5cb..0000000
--- a/ports/pixman/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=pixman
-VERSION=0.32.4
-URL=http://cairographics.org/releases/pixman-0.32.4.tar.gz
-LICENSE=CUSTOM:COPYING
-DEPENDS=(libpng)
-SHA1=54be89b3453109be0930400e5b13c35c9e9d5e3a
diff --git a/ports/pkg/build.sh b/ports/pkg/build.sh
deleted file mode 100644
index 49bd727..0000000
--- a/ports/pkg/build.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2015 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.
-
-EXECUTABLES="src/pkg-static${NACL_EXEEXT}"
-NACLPORTS_LIBS+=" -lbsd -pthread"
-
-EXTRA_CONFIGURE_ARGS+=" --prefix=/usr --exec-prefix=/usr"
-
-if [[ ${NACL_SHARED} == 1 ]]; then
- EXECUTABLES+=" src/pkg${NACL_EXEEXT}"
- NACLPORTS_LIBS+=" -lresolv -ldl -lrt"
- EXTRA_CONFIGURE_ARGS+=" --enable-shared=yes --with-staticonly=no"
- NACLPORTS_CPPFLAGS+=" -D_GNU_SOURCE"
-else
- EXTRA_CONFIGURE_ARGS+=" --enable-shared=no --with-staticonly=yes"
-fi
-
-EnableCliMain
-EnableGlibcCompat
-
-ConfigureStep() {
- ChangeDir ${SRC_DIR}
- ./autogen.sh
- PatchConfigure
- ChangeDir ${BUILD_DIR}
- DefaultConfigureStep
-}
-
-BuildHost() {
- HOST_BUILD_DIR=${WORK_DIR}/build_host
- if [[ ! -f ${HOST_BUILD_DIR}/src/pkg ]]; then
- MakeDir ${HOST_BUILD_DIR}
- Banner "Build host pkg"
-
- local libarchive_install=${WORK_DIR}/../libarchive-dev/install_host
- local libbsd_install=${WORK_DIR}/../libbsd/install_host
- export CPPFLAGS="-I${libarchive_install}/usr/local/include"
- export LDFLAGS="-L${libarchive_install}/usr/local/lib"
- CPPFLAGS+=" -I${libbsd_install}/usr/local/include"
- LDFLAGS+=" -L${libbsd_install}/usr/local/lib"
-
- cd ${HOST_BUILD_DIR}
- LogExecute ${SRC_DIR}/configure
- LogExecute make -j${OS_JOBS}
- cd -
- fi
-}
-
-BuildStep() {
- (BuildHost)
- DefaultBuildStep
-}
-
-TestStep() {
- LogExecute ${BUILD_DIR}/src/pkg-static -v
-}
-
-InstallStep() {
- DefaultInstallStep
- LogExecute mv ${DESTDIR}/usr ${DESTDIR}/${PREFIX}
- if [[ ${NACL_SHARED} == 0 ]]; then
- LogExecute mv ${DESTDIR}/${PREFIX}/sbin/pkg-static${NACL_EXEEXT} \
- ${DESTDIR}/${PREFIX}/sbin/pkg${NACL_EXEEXT}
- fi
-}
-
-PublishStep() {
- PublishMultiArch src/pkg-static${NACL_EXEEXT} pkg
-}
diff --git a/ports/pkg/nacl.patch b/ports/pkg/nacl.patch
deleted file mode 100644
index f759a08..0000000
--- a/ports/pkg/nacl.patch
+++ /dev/null
@@ -1,2191 +0,0 @@
-diff --git a/compat/Makefile.am b/compat/Makefile.am
---- a/compat/Makefile.am
-+++ b/compat/Makefile.am
-@@ -1,8 +1,7 @@
--noinst_LTLIBRARIES= libbsd_compat.la
- noinst_HEADERS= bsd_compat.h endian_util.h \
- humanize_number.h
-
--libbsd_compat_la_SOURCES= basename.c \
-+sources= basename.c \
- closefrom.c \
- dirname.c \
- file_at.c \
-@@ -11,4 +10,14 @@ libbsd_compat_la_SOURCES= basename.c \
- strnstr.c \
- funopen.c
-
-+libbsd_compat_la_SOURCES= $(sources)
- libbsd_compat_la_CFLAGS= $(pkg_common_cflags) -shared
-+libbsd_compat_static_la_SOURCES= $(sources)
-+libbsd_compat_static_la_CFLAGS= $(pkg_common_cflags) -static
-+libbsd_compat_static_la_LDFLAGS= -all-static
-+
-+noinst_LTLIBRARIES= libbsd_compat_static.la
-+
-+if DYNAMIC
-+noinst_LTLIBRARIES+= libbsd_compat.la
-+endif
-diff --git a/compat/bsd_compat.h b/compat/bsd_compat.h
---- a/compat/bsd_compat.h
-+++ b/compat/bsd_compat.h
-@@ -57,6 +57,10 @@
- #include <bsd/libutil.h>
- #endif
-
-+#ifdef __native_client__
-+#include <stdio.h>
-+#endif
-+
- #include <sys/stat.h>
- #include "endian_util.h"
-
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -244,28 +244,12 @@ AC_SUBST([GIT_HEAD])
- AC_DEFINE_UNQUOTED([GIT_HEAD], $GIT_HEAD)
- AC_DEFINE([PKG_API], [api_ver])
-
--AC_RUN_IFELSE(
-- [AC_LANG_SOURCE(
-- [[
-- #include <sys/types.h>
-- #include <sys/socket.h>
-- int main() { return socket(AF_LOCAL, SOCK_SEQPACKET, 0) == -1 ? -1 : 0; }
-- ]]
-- )],
-- [AC_DEFINE([HAVE_SEQPACKET], 1, [Define to 1 if you have SOCK_SEQPACKET working])]
--)
--
-+AC_DEFINE([HAVE_SEQPACKET], 1, [Define to 1 if you have SOCK_SEQPACKET working])
- AC_SUBST([HAVE_SEQPACKET])
-
--AC_SEARCH_LIBS([lzma_version_string], [lzma], [], [
-- AC_MSG_ERROR([unable to find the liblzma])
--])
--AC_SEARCH_LIBS([BZ2_bzReadOpen], [bz2], [], [
-- AC_MSG_ERROR([unable to find the libbz2])
--])
--AC_SEARCH_LIBS([zlibVersion], [z], [], [
-- AC_MSG_ERROR([unable to find the zlib])
--])
-+AC_SEARCH_LIBS([lzma_version_string], [lzma], [], [])
-+AC_SEARCH_LIBS([BZ2_bzReadOpen], [bz2], [], [])
-+AC_SEARCH_LIBS([zlibVersion], [z], [], [])
- AC_SEARCH_LIBS([archive_read_open], [archive], [], [
- AC_MSG_ERROR([unable to find the archive_read() function])
- ])
-@@ -411,7 +395,7 @@ else
- AC_MSG_RESULT([no])
- fi
-
--AM_CONDITIONAL(DYNAMIC, test "$with_staticonly" != "no")
-+AM_CONDITIONAL(DYNAMIC, test "$with_staticonly" != "yes")
-
- dnl Select appropriate ABI
- AS_CASE(
-diff --git a/external/blake2/Makefile.am b/external/blake2/Makefile.am
---- a/external/blake2/Makefile.am
-+++ b/external/blake2/Makefile.am
-@@ -1,11 +1,16 @@
- noinst_HEADERS= blake2.h \
- blake2-impl.h
-
--noinst_LTLIBRARIES= libblake2.la libblake2_static.la
-+noinst_LTLIBRARIES= libblake2_static.la
-
--blake2_common_cflags= -I$(top_srcdir)/compat -O3
- libblake2_la_SOURCES= blake2b-ref.c
- libblake2_la_CFLAGS= $(blake2_common_cflags) -shared
-+
-+if DYNAMIC
-+noinst_LTLIBRARIES+= libblake2.la
-+endif
-+
-+blake2_common_cflags= -I$(top_srcdir)/compat -O3
- libblake2_static_la_SOURCES= $(libblake2_la_SOURCES)
- libblake2_static_la_CFLAGS= $(blake2_common_cflags) -static
--libblake2_static_la_LDFLAGS= -all-static
-\ No newline at end of file
-+libblake2_static_la_LDFLAGS= -all-static
-diff --git a/external/libelf/_elftc.h b/external/libelf/_elftc.h
---- a/external/libelf/_elftc.h
-+++ b/external/libelf/_elftc.h
-@@ -216,8 +216,8 @@ struct name { \
- #define ELFTC_VCSID(ID) __FBSDID(ID)
- #endif
-
--#if defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__APPLE__)
--#if defined(__GNUC__)
-+#if defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) || defined(__APPLE__) || defined(__native_client__)
-+#if defined(__GNUC__) && !defined(__pnacl__)
- #define ELFTC_VCSID(ID) __asm__(".ident\t\"" ID "\"")
- #else
- #define ELFTC_VCSID(ID) /**/
-diff --git a/external/libelf/_libelf.h b/external/libelf/_libelf.h
---- a/external/libelf/_libelf.h
-+++ b/external/libelf/_libelf.h
-@@ -35,6 +35,13 @@
-
- #include "_elftc.h"
-
-+#ifndef roundup2
-+#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
-+#endif
-+#ifndef roundup
-+#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
-+#endif
-+
- /*
- * Library-private data structures.
- */
-diff --git a/external/libelf/_libelf_config.h b/external/libelf/_libelf_config.h
---- a/external/libelf/_libelf_config.h
-+++ b/external/libelf/_libelf_config.h
-@@ -40,7 +40,7 @@
-
- #endif /* __DragonFly__ */
-
--#ifdef __FreeBSD__
-+#if defined (__FreeBSD__) || defined(__native_client__)
-
- /*
- * Define LIBELF_{ARCH,BYTEORDER,CLASS} based on the machine architecture.
-@@ -103,6 +103,13 @@
- #define LIBELF_BYTEORDER ELFDATA2MSB
- #define LIBELF_CLASS ELFCLASS64
-
-+#elif defined(__pnacl__)
-+
-+// Some junk data filling to let it pass through
-+#define LIBELF_ARCH EM_386
-+#define LIBELF_BYTEORDER ELFDATA2LSB
-+#define LIBELF_CLASS ELFCLASS32
-+
- #else
- #error Unknown FreeBSD architecture.
- #endif
-diff --git a/external/libelf/libelf.h b/external/libelf/libelf.h
---- a/external/libelf/libelf.h
-+++ b/external/libelf/libelf.h
-@@ -32,6 +32,9 @@
- #include <sys/types.h>
-
- #include <elfdefinitions.h>
-+#ifdef _NEWLIB_VERSION
-+#include <sys/cdefs.h>
-+#endif
-
- /* Library private data structures */
- typedef struct _Elf Elf;
-diff --git a/external/libfetch/fetch.h b/external/libfetch/fetch.h
---- a/external/libfetch/fetch.h
-+++ b/external/libfetch/fetch.h
-@@ -37,6 +37,10 @@
- #define URL_USERLEN 256
- #define URL_PWDLEN 256
-
-+#ifndef MAXHOSTNAMELEN
-+#define MAXHOSTNAMELEN 64
-+#endif
-+
- struct url {
- char scheme[URL_SCHEMELEN+1];
- char user[URL_USERLEN+1];
-diff --git a/external/libsbuf/subr_sbuf.c b/external/libsbuf/subr_sbuf.c
---- a/external/libsbuf/subr_sbuf.c
-+++ b/external/libsbuf/subr_sbuf.c
-@@ -33,6 +33,9 @@
- #ifndef roundup2
- #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
- #endif
-+#ifndef roundup
-+#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
-+#endif
-
- #ifdef _KERNEL
- #include <sys/ctype.h>
-diff --git a/external/libucl/src/ucl_parser.c b/external/libucl/src/ucl_parser.c
---- a/external/libucl/src/ucl_parser.c
-+++ b/external/libucl/src/ucl_parser.c
-@@ -694,12 +694,21 @@ ucl_maybe_parse_number (ucl_object_t *obj,
- dv = strtod (c, &endptr);
- }
- else {
-+#ifdef _NEWLIB_VERSION
-+ if (is_hex) {
-+ lv = strtol (c, &endptr, 16);
-+ }
-+ else {
-+ lv = strtol (c, &endptr, 10);
-+ }
-+#else
- if (is_hex) {
- lv = strtoimax (c, &endptr, 16);
- }
- else {
- lv = strtoimax (c, &endptr, 10);
- }
-+#endif
- }
- if (errno == ERANGE) {
- *pos = start;
-diff --git a/external/sqlite/sqlite3.c b/external/sqlite/sqlite3.c
---- a/external/sqlite/sqlite3.c
-+++ b/external/sqlite/sqlite3.c
-@@ -19857,6 +19857,9 @@ SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
- ** processor and returns that value. This can be used for high-res
- ** profiling.
- */
-+#ifdef __pnacl__
-+SQLITE_PRIVATE sqlite_uint64 sqlite3Hwtime(void){ return ((sqlite_uint64)0); }
-+#else
- #if (defined(__GNUC__) || defined(_MSC_VER)) && \
- (defined(i386) || defined(__i386__) || defined(_M_IX86))
-
-@@ -19916,6 +19919,8 @@ SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
- SQLITE_PRIVATE sqlite_uint64 sqlite3Hwtime(void){ return ((sqlite_uint64)0); }
-
- #endif
-+#endif /* defined(__pnacl__) */
-+
-
- #endif /* !defined(_HWTIME_H_) */
-
-@@ -25702,7 +25707,7 @@ static int posixOpen(const char *zFile, int flags, int mode){
- ** we are not running as root.
- */
- static int posixFchown(int fd, uid_t uid, gid_t gid){
--#if OS_VXWORKS
-+#if OS_VXWORKS || defined (__native_client__)
- return 0;
- #else
- return geteuid() ? 0 : fchown(fd,uid,gid);
-@@ -25762,14 +25767,14 @@ static struct unix_syscall {
- { "read", (sqlite3_syscall_ptr)read, 0 },
- #define osRead ((ssize_t(*)(int,void*,size_t))aSyscall[8].pCurrent)
-
--#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
-+#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE && !defined(__native_client__)
- { "pread", (sqlite3_syscall_ptr)pread, 0 },
- #else
- { "pread", (sqlite3_syscall_ptr)0, 0 },
- #endif
- #define osPread ((ssize_t(*)(int,void*,size_t,off_t))aSyscall[9].pCurrent)
-
--#if defined(USE_PREAD64)
-+#if defined(USE_PREAD64) && !defined(__native_client__)
- { "pread64", (sqlite3_syscall_ptr)pread64, 0 },
- #else
- { "pread64", (sqlite3_syscall_ptr)0, 0 },
-@@ -25779,7 +25784,7 @@ static struct unix_syscall {
- { "write", (sqlite3_syscall_ptr)write, 0 },
- #define osWrite ((ssize_t(*)(int,const void*,size_t))aSyscall[11].pCurrent)
-
--#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE
-+#if defined(USE_PREAD) || SQLITE_ENABLE_LOCKING_STYLE && !defined(__native_client__)
- { "pwrite", (sqlite3_syscall_ptr)pwrite, 0 },
- #else
- { "pwrite", (sqlite3_syscall_ptr)0, 0 },
-@@ -25787,7 +25792,7 @@ static struct unix_syscall {
- #define osPwrite ((ssize_t(*)(int,const void*,size_t,off_t))\
- aSyscall[12].pCurrent)
-
--#if defined(USE_PREAD64)
-+#if defined(USE_PREAD64) && !defined(__native_client__)
- { "pwrite64", (sqlite3_syscall_ptr)pwrite64, 0 },
- #else
- { "pwrite64", (sqlite3_syscall_ptr)0, 0 },
-@@ -28512,7 +28517,7 @@ static int nfsUnlock(sqlite3_file *id, int eFileLock){
- static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){
- int got;
- int prior = 0;
--#if (!defined(USE_PREAD) && !defined(USE_PREAD64))
-+#if (!defined(USE_PREAD) && !defined(USE_PREAD64)) || defined(__native_client__)
- i64 newOffset;
- #endif
- TIMER_START;
-@@ -28520,10 +28525,10 @@ static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){
- assert( id->h>2 );
- cnt &= 0x1ffff;
- do{
--#if defined(USE_PREAD)
-+#if defined(USE_PREAD) && !defined (__native_client__)
- got = osPread(id->h, pBuf, cnt, offset);
- SimulateIOError( got = -1 );
--#elif defined(USE_PREAD64)
-+#elif defined(USE_PREAD64) && !defined (__native_client__)
- got = osPread64(id->h, pBuf, cnt, offset);
- SimulateIOError( got = -1 );
- #else
-@@ -28636,9 +28641,9 @@ static int seekAndWriteFd(
- nBuf &= 0x1ffff;
- TIMER_START;
-
--#if defined(USE_PREAD)
-+#if defined(USE_PREAD) && !defined(__native_client__)
- do{ rc = (int)osPwrite(fd, pBuf, nBuf, iOff); }while( rc<0 && errno==EINTR );
--#elif defined(USE_PREAD64)
-+#elif defined(USE_PREAD64) && !defined(__native_client__)
- do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
- #else
- do{
-diff --git a/libpkg/Makefile.am b/libpkg/Makefile.am
---- a/libpkg/Makefile.am
-+++ b/libpkg/Makefile.am
-@@ -75,6 +75,7 @@ libpkg_la_SOURCES+= pkg_macho.c
- pkg_common_cflags+= -I$(top_srcdir)/external/libmachista
- endif
-
-+if DYNAMIC
- libpkg_la_CFLAGS= @OS_CFLAGS@ $(pkg_common_cflags) -shared
- libpkg_la_LIBADD= $(top_builddir)/compat/libbsd_compat.la \
- $(top_builddir)/external/libucl.la \
-@@ -112,6 +113,7 @@ if HAVE_LD_VERSION_SCRIPT
- libpkg_la_LDFLAGS+= -version-info @LIBPKG_SO_VERSION@ -Wl,--version-script=$(srcdir)/libpkg.ver
- EXTRA_libpkg_la_DEPENDENCIES+= libpkg.ver
- endif
-+endif
-
- DYNLIBS= libpkg.la
- lib_LTLIBRARIES= libpkg_static.la
-diff --git a/libpkg/elfhints.c b/libpkg/elfhints.c
---- a/libpkg/elfhints.c
-+++ b/libpkg/elfhints.c
-@@ -228,9 +228,11 @@ scan_dirs_for_shlibs(struct shlib_list **shlib_list, int numdirs,
- /* Only regular files and sym-links. On some
- filesystems d_type is not set, on these the d_type
- field will be DT_UNKNOWN. */
-+#ifndef __native_client__
- if (dp->d_type != DT_REG && dp->d_type != DT_LNK &&
- dp->d_type != DT_UNKNOWN)
- continue;
-+#endif
-
- len = strlen(dp->d_name);
- if (strictnames) {
-diff --git a/libpkg/fetch.c b/libpkg/fetch.c
---- a/libpkg/fetch.c
-+++ b/libpkg/fetch.c
-@@ -43,6 +43,11 @@
-
- #include <bsd_compat.h>
-
-+#ifdef __native_client__
-+#include <spawn.h>
-+#include <sys/uio.h>
-+#endif
-+
- #include "pkg.h"
- #include "private/event.h"
- #include "private/pkg.h"
-@@ -60,7 +65,11 @@ gethttpmirrors(struct pkg_repo *repo, const char *url) {
- if ((f = fetchGetURL(url, "")) == NULL)
- return;
-
-+#ifdef _NEWLIB_VERSION
-+ while ((linelen = __getline(&line, &linecap, f)) > 0) {
-+#else
- while ((linelen = getline(&line, &linecap, f)) > 0) {
-+#endif
- if (strncmp(line, "URL:", 4) == 0) {
- /* trim '\n' */
- if (line[linelen - 1] == '\n')
-@@ -346,7 +355,11 @@ start_ssh(struct pkg_repo *repo, struct url *u, off_t *sz)
- socketpair(AF_UNIX, SOCK_STREAM, 0, sshout) < 0)
- return(EPKG_FATAL);
-
-+#ifdef __native_client__
-+ repo->sshio.pid = vfork();
-+#else
- repo->sshio.pid = fork();
-+#endif
- if (repo->sshio.pid == -1) {
- pkg_emit_errno("Cannot fork", "start_ssh");
- return (EPKG_FATAL);
-@@ -358,7 +371,11 @@ start_ssh(struct pkg_repo *repo, struct url *u, off_t *sz)
- close(sshout[0]) < 0 ||
- dup2(sshout[1], STDOUT_FILENO) < 0) {
- pkg_emit_errno("Cannot prepare pipes", "start_ssh");
-+#ifdef __native_client__
-+ _exit (EPKG_FATAL);
-+#else
- return (EPKG_FATAL);
-+#endif
- }
-
- cmd = sbuf_new_auto();
-@@ -407,8 +424,12 @@ start_ssh(struct pkg_repo *repo, struct url *u, off_t *sz)
- return (EPKG_FATAL);
- }
-
-+#ifdef _NEWLIB_VERSION
-+ if (__getline(&line, &linecap, repo->ssh) > 0) {
-+#else
- if (getline(&line, &linecap, repo->ssh) > 0) {
-- if (strncmp(line, "ok:", 3) != 0) {
-+#endif
-+ if (strncmp(line, "ok:", 3) != 0) {
- pkg_debug(1, "SSH> server rejected, got: %s", line);
- fclose(repo->ssh);
- free(line);
-@@ -423,7 +444,11 @@ start_ssh(struct pkg_repo *repo, struct url *u, off_t *sz)
- }
- pkg_debug(1, "SSH> get %s %" PRIdMAX "", u->doc, (intmax_t)u->ims_time);
- fprintf(repo->ssh, "get %s %" PRIdMAX "\n", u->doc, (intmax_t)u->ims_time);
-+#ifdef _NEWLIB_VERSION
-+ if ((linelen = __getline(&line, &linecap, repo->ssh)) > 0) {
-+#else
- if ((linelen = getline(&line, &linecap, repo->ssh)) > 0) {
-+#endif
- if (line[linelen -1 ] == '\n')
- line[linelen -1 ] = '\0';
-
-diff --git a/libpkg/pkg.h.in b/libpkg/pkg.h.in
---- a/libpkg/pkg.h.in
-+++ b/libpkg/pkg.h.in
-@@ -42,6 +42,7 @@ extern "C" {
- #include <sys/cdefs.h>
- #include <stdarg.h>
- #include <stdbool.h>
-+#include <stdint.h>
- #include <sys/sbuf.h>
- #include <openssl/pem.h>
- #include <sysexits.h>
-diff --git a/libpkg/pkg_add.c b/libpkg/pkg_add.c
---- a/libpkg/pkg_add.c
-+++ b/libpkg/pkg_add.c
-@@ -360,7 +360,11 @@ pkg_globmatch(char *pattern, const char *name)
- char *buf, *buf2;
- char *path = NULL;
-
-+#ifdef GLOB_NOMATCH
- if (glob(pattern, 0, NULL, &g) == GLOB_NOMATCH) {
-+#else
-+ if (glob(pattern, 0, NULL, &g) < 0) {
-+#endif
- globfree(&g);
-
- return (NULL);
-diff --git a/libpkg/pkg_config.c b/libpkg/pkg_config.c
---- a/libpkg/pkg_config.c
-+++ b/libpkg/pkg_config.c
-@@ -34,7 +34,11 @@
- #include <sys/un.h>
- #include <ctype.h>
- #include <dirent.h>
-+#ifdef _NEWLIB_VERSION
-+#include <sys/dirent.h>
-+#else
- #include <dlfcn.h>
-+#endif
- #include <errno.h>
- #include <fcntl.h>
- #ifdef HAVE_OSRELDATE_H
-@@ -181,12 +185,21 @@ static struct config_entry c[] = {
- PREFIX"/lib/pkg/",
- "Directory which pkg(8) will load plugins from",
- },
-+#ifdef _NEWLIB_VERSION
-+ {
-+ PKG_BOOL,
-+ "PKG_ENABLE_PLUGINS",
-+ "NO",
-+ "Newlib-build pkg does not support plugins",
-+ },
-+#else
- {
- PKG_BOOL,
- "PKG_ENABLE_PLUGINS",
- "YES",
- "Activate plugin support",
- },
-+#endif
- {
- PKG_ARRAY,
- "PLUGINS",
-@@ -458,7 +471,8 @@ pkg_config_dump(void)
- static void
- disable_plugins_if_static(void)
- {
-- void *dlh;
-+#ifndef _NEWLIB_VERSION
-+ void *dlh = NULL;
-
- dlh = dlopen(0, RTLD_NOW);
-
-@@ -467,8 +481,7 @@ disable_plugins_if_static(void)
- ucl_object_replace_key(config, ucl_object_frombool(false), "PKG_ENABLE_PLUGINS", 18, false);
- else
- dlclose(dlh);
--
-- return;
-+#endif
- }
-
- static void
-@@ -710,8 +723,25 @@ load_repo_files(const char *repodir, pkg_init_flags flags)
-
- pkg_debug(1, "PkgConfig: loading repositories in %s", repodir);
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ /*
-+ * scandir is currnetly broken with newlib and nacl_io
-+ * TODO(sbc): remove this once the fix lands:
-+ * https://codereview.chromium.org/1304983004/
-+ */
-+ nents = 1;
-+ ent = malloc(sizeof(void*));
-+ i = 0;
-+ DIR* dir = opendir(repodir);
-+ if (!dir)
-+ return;
-+ while (ent[i] = readdir(dir)) {
-+ if (ent[i]->d_name[0] == '.')
-+ continue;
-+#else
- nents = scandir(repodir, &ent, nodots, alphasort);
- for (i = 0; i < nents; i++) {
-+#endif
- if ((n = strlen(ent[i]->d_name)) <= 5)
- continue;
- p = &ent[i]->d_name[n - 5];
-@@ -722,10 +752,15 @@ load_repo_files(const char *repodir, pkg_init_flags flags)
- ent[i]->d_name);
- load_repo_file(path, flags);
- }
-+#if !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- free(ent[i]);
-+#endif
- }
- if (nents >= 0)
- free(ent);
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ closedir(dir);
-+#endif
- }
-
- static void
-@@ -1065,7 +1100,10 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
- if (evpipe != NULL)
- connect_evpipe(evpipe);
-
-- debug_level = pkg_object_int(pkg_config_get("DEBUG_LEVEL"));
-+ /* Only set debug level if it was not already set (e.g. by the cmd line) */
-+ if (debug_level == 0) {
-+ debug_level = pkg_object_int(pkg_config_get("DEBUG_LEVEL"));
-+ }
- developer_mode = pkg_object_bool(pkg_config_get("DEVELOPER_MODE"));
-
- it = NULL;
-diff --git a/libpkg/pkg_cudf.c b/libpkg/pkg_cudf.c
---- a/libpkg/pkg_cudf.c
-+++ b/libpkg/pkg_cudf.c
-@@ -443,7 +443,11 @@ pkg_jobs_cudf_parse_output(struct pkg_jobs *j, FILE *f)
-
- memset(&cur_pkg, 0, sizeof(cur_pkg));
-
-+#ifdef _NEWLIB_VERSION
-+ while ((linelen = __getline(&line, &linecap, f)) > 0) {
-+#else
- while ((linelen = getline(&line, &linecap, f)) > 0) {
-+#endif
- /* Split line, cut spaces */
- begin = line;
- param = strsep(&begin, ": \t");
-diff --git a/libpkg/pkg_delete.c b/libpkg/pkg_delete.c
---- a/libpkg/pkg_delete.c
-+++ b/libpkg/pkg_delete.c
-@@ -53,6 +53,75 @@
- #define NOCHANGESFLAGS (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)
- #endif
-
-+#if defined (__native_client__) && defined(__GLIBC__)
-+// xgetcwd is pulled from toybox lib/xwrap.c
-+char *xgetcwd(void) {
-+ char *buf = (char*)malloc(sizeof(char) * (PATH_MAX+1));
-+ if (buf == NULL) {
-+ fprintf(stderr, "malloc failed\n");
-+ exit(1);
-+ }
-+ buf = getcwd(buf, PATH_MAX+1);
-+ if (!buf) {
-+ perror("xgetcwd");
-+ exit(1);
-+ }
-+ return buf;
-+}
-+
-+// The following functions are pulled from toybox nacl.patch
-+#define _AT_WRAP_START(A) \
-+ int fchdir_err = 0; \
-+ char *save = xgetcwd(); \
-+ if (!save) { \
-+ perror("fd_wrapper_"A); \
-+ exit(1); \
-+ } \
-+ if (dirfd != AT_FDCWD) { \
-+ fchdir_err = fchdir(dirfd); \
-+ if (fchdir_err == -1) \
-+ perror("fchdir"); \
-+ }
-+
-+#define _AT_WRAP_END(A) \
-+ if (dirfd != AT_FDCWD) chdir(save); \
-+ free(save);
-+
-+int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags) {
-+ // We are going to ignore flags here.
-+ //if (flags) perror_exit("fstatat_flags");
-+ _AT_WRAP_START("fstatat")
-+ int result;
-+ if (flags & AT_SYMLINK_NOFOLLOW)
-+ result = lstat(pathname, buf);
-+ else
-+ result = stat(pathname, buf);
-+ _AT_WRAP_END("fstatat")
-+ return result;
-+}
-+
-+int openat(int dirfd, const char *pathname, int flags, ...) {
-+ _AT_WRAP_START("openat")
-+ int fd = open(pathname, flags);
-+ _AT_WRAP_END("openat")
-+ return fd;
-+}
-+
-+int unlinkat(int dirfd, const char *pathname, int flags) {
-+ // We are going to ignore flags here.
-+ //if (flags) perror_exit("unlinkat_flags");
-+ _AT_WRAP_START("unlinkat")
-+ int result;
-+ if(flags & AT_REMOVEDIR) {
-+ result = rmdir(pathname);
-+ } else {
-+ result = unlink(pathname);
-+ }
-+ _AT_WRAP_END("unlinkat")
-+ return result;
-+}
-+#endif
-+
- int
- pkg_delete(struct pkg *pkg, struct pkgdb *db, unsigned flags)
- {
-@@ -242,7 +311,15 @@ rmdir_p(struct pkgdb *db, struct pkg *pkg, char *dir, const char *prefix_r)
- #endif
-
- if (unlinkat(pkg->rootfd, dir, AT_REMOVEDIR) == -1) {
-+#ifdef __native_client__
-+ /*
-+ * TODO(sbc): nacl_io generates EPERM rather than ENOTEMPTY. We should
-+ * fix nacl_io and remove this patch: http://crbug.com/522169
-+ */
-+ if (errno != ENOTEMPTY && errno != EBUSY && errno != EPERM)
-+#else
- if (errno != ENOTEMPTY && errno != EBUSY)
-+#endif
- pkg_emit_errno("unlinkat", dir);
- /* If the directory was already removed by a bogus script, continue removing parents */
- if (errno != ENOENT)
-diff --git a/libpkg/pkg_elf.c b/libpkg/pkg_elf.c
---- a/libpkg/pkg_elf.c
-+++ b/libpkg/pkg_elf.c
-@@ -29,6 +29,7 @@
- #include "pkg_config.h"
- #endif
-
-+#include <sys/types.h>
- #ifdef HAVE_SYS_ENDIAN_H
- #include <sys/endian.h>
- #elif HAVE_ENDIAN_H
-@@ -36,7 +37,6 @@
- #elif HAVE_MACHINE_ENDIAN_H
- #include <machine/endian.h>
- #endif
--#include <sys/types.h>
- #if defined(HAVE_SYS_ELF_COMMON_H) && !defined(__DragonFly__)
- #include <sys/elf_common.h>
- #endif
-@@ -44,7 +44,9 @@
-
- #include <assert.h>
- #include <ctype.h>
-+#ifndef _NEWLIB_VERSION
- #include <dlfcn.h>
-+#endif
- #include <fcntl.h>
- #include <gelf.h>
- #include <libgen.h>
-@@ -457,10 +459,12 @@ pkg_analyse_files(struct pkgdb *db, struct pkg *pkg, const char *stage)
-
- shlib_list_init();
-
-+#ifndef __native_client__
- ret = shlib_list_from_elf_hints(_PATH_ELF_HINTS);
- if (ret != EPKG_OK)
- goto cleanup;
--
-+#endif
-+
- /* Assume no architecture dependence, for contradiction */
- if (developer_mode)
- pkg->flags &= ~(PKG_CONTAINS_ELF_OBJECTS |
-@@ -938,6 +942,7 @@ pkg_arch_to_legacy(const char *arch, char *dest, size_t sz)
- return (0);
- }
-
-+#ifndef __native_client__
- int
- pkg_get_myarch_legacy(char *dest, size_t sz)
- {
-@@ -952,8 +957,9 @@ pkg_get_myarch_legacy(char *dest, size_t sz)
-
- return (0);
- }
-+#endif
-
--#ifndef __DragonFly__
-+#if !defined(__DragonFly__) && !defined(__native_client__)
- int
- pkg_get_myarch(char *dest, size_t sz)
- {
-@@ -987,3 +993,49 @@ pkg_get_myarch(char *dest, size_t sz)
- }
- #endif
-
-+#ifdef __native_client__
-+int
-+pkg_get_myarch_legacy(char *dest, size_t sz)
-+{
-+ char current[sz];
-+ int ret;
-+
-+ if ((ret = pkg_get_myarch(current, sizeof(current))) != EPKG_OK)
-+ return ret;
-+
-+ return pkg_arch_to_legacy(current, dest, sz);
-+}
-+
-+int
-+pkg_get_myarch(char *dest, size_t sz)
-+{
-+ char * os_name = "nacl";
-+#ifdef __arm__
-+ const char* cpu_name = "arm";
-+#elif defined __i386__
-+ const char* cpu_name = "i686";
-+#elif defined __x86_64__
-+ const char* cpu_name = "x86_64";
-+#elif defined __pnacl__
-+ const char* cpu_name = "pnacl";
-+#else
-+#error "Unknown architecture"
-+#endif
-+ long long major_version = 0;
-+ char *spec = NULL;
-+ int ret = EPKG_OK;
-+
-+ asprintf(&spec, "%s:%lld:%s", os_name, major_version, cpu_name);
-+ if (spec == NULL) {
-+ pkg_emit_error("asprintf() failed to allocate output string");
-+ ret = EPKG_FATAL;
-+ goto cleanup;
-+ }
-+ strlcpy(dest, spec, sz);
-+
-+cleanup:
-+ free(spec);
-+ return ret;
-+
-+}
-+#endif
-diff --git a/libpkg/pkg_event.c b/libpkg/pkg_event.c
---- a/libpkg/pkg_event.c
-+++ b/libpkg/pkg_event.c
-@@ -304,6 +304,7 @@ pipeevent(struct pkg_event *ev)
- ev->e_file_mismatch.pkg,
- sbuf_json_escape(buf, ev->e_file_mismatch.file->path));
- break;
-+#ifndef _NEWLIB_VERSION
- case PKG_EVENT_PLUGIN_ERRNO:
- sbuf_printf(msg, "{ \"type\": \"ERROR_PLUGIN\", "
- "\"data\": {"
-@@ -335,6 +336,7 @@ pipeevent(struct pkg_event *ev)
- pkg_plugin_get(ev->e_plugin_info.plugin, PKG_PLUGIN_NAME),
- sbuf_json_escape(buf, ev->e_plugin_info.msg));
- break;
-+#endif
- case PKG_EVENT_INCREMENTAL_UPDATE:
- sbuf_printf(msg, "{ \"type\": \"INFO_INCREMENTAL_UPDATE\", "
- "\"data\": {"
-diff --git a/libpkg/pkg_jobs.c b/libpkg/pkg_jobs.c
---- a/libpkg/pkg_jobs.c
-+++ b/libpkg/pkg_jobs.c
-@@ -1384,7 +1384,8 @@ jobs_solve_autoremove(struct pkg_jobs *j)
- pkg_emit_locked(pkg);
- }
- else if (pkg_jobs_test_automatic(j, pkg)) {
-- assert(pkg_jobs_add_req(j, pkg));
-+ struct pkg_job_request_item* ret = pkg_jobs_add_req(j, pkg);
-+ assert(ret);
- }
-
- pkg = NULL;
-@@ -2131,6 +2132,8 @@ pkg_jobs_fetch(struct pkg_jobs *j)
- if (dlsize == 0)
- return (EPKG_OK);
-
-+// No statvfs or statfs in NaCl
-+#ifndef __native_client__
- #ifdef HAVE_STATFS
- struct statfs fs;
- while (statfs(cachedir, &fs) == -1) {
-@@ -2156,6 +2159,7 @@ pkg_jobs_fetch(struct pkg_jobs *j)
- }
- fs_avail = fs.f_bsize * (int64_t)fs.f_bavail;
- #endif
-+#endif
-
- if (fs_avail != -1 && dlsize > fs_avail) {
- char dlsz[9], fsz[9];
-diff --git a/libpkg/pkg_old.c b/libpkg/pkg_old.c
---- a/libpkg/pkg_old.c
-+++ b/libpkg/pkg_old.c
-@@ -25,6 +25,9 @@
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-+// TODO: Remove sys/types.h once this bug is fixed
-+// BUG=https://code.google.com/p/nativeclient/issues/detail?id=4264
-+#include <sys/types.h>
- #include <regex.h>
-
- #include <pkg.h>
-diff --git a/libpkg/pkg_ports.c b/libpkg/pkg_ports.c
---- a/libpkg/pkg_ports.c
-+++ b/libpkg/pkg_ports.c
-@@ -1287,7 +1287,11 @@ ports_parse_plist(struct pkg *pkg, const char *plist, const char *stage)
- return (EPKG_FATAL);
- }
-
-- while ((linelen = getline(&line, &linecap, plist_f)) > 0) {
-+#ifdef _NEWLIB_VERSION
-+ while ((linelen = __getline(&line, &linecap, plist_f)) > 0) {
-+#else
-+ while ((linelen = getline(&line, &linecap, plist_f)) > 0) {
-+#endif
- if (line[linelen - 1] == '\n')
- line[linelen - 1] = '\0';
- ret = plist_parse_line(pplist, line);
-diff --git a/libpkg/pkg_repo.c b/libpkg/pkg_repo.c
---- a/libpkg/pkg_repo.c
-+++ b/libpkg/pkg_repo.c
-@@ -31,12 +31,10 @@
-
- #include <sys/types.h>
- #include <sys/stat.h>
--#include <sys/sysctl.h>
- #include <sys/uio.h>
-
- #include <archive_entry.h>
- #include <assert.h>
--#include <fts.h>
- #include <libgen.h>
- #include <sqlite3.h>
- #include <string.h>
-@@ -56,6 +54,10 @@
- #include "private/pkg.h"
- #include "private/pkgdb.h"
-
-+#ifdef __native_client__
-+#include <spawn.h>
-+#endif
-+
- struct sig_cert {
- char name[MAXPATHLEN];
- char *sig;
-@@ -67,12 +69,23 @@ struct sig_cert {
- bool trusted;
- };
-
-+#ifdef __native_client__
-+static int
-+pkg_repo_fetch_remote_tmp(struct pkg_repo *repo,
-+ const char *filename, const char *extension, time_t *t, int *rc,
-+ char** tmp_file)
-+#else
- static int
- pkg_repo_fetch_remote_tmp(struct pkg_repo *repo,
- const char *filename, const char *extension, time_t *t, int *rc)
-+#endif
- {
- char url[MAXPATHLEN];
-+#ifdef __native_client__
-+ char * tmp = (char *) calloc(MAXPATHLEN, sizeof(char));
-+#else
- char tmp[MAXPATHLEN];
-+#endif
- int fd;
- const char *tmpdir, *dot;
-
-@@ -81,7 +94,11 @@ pkg_repo_fetch_remote_tmp(struct pkg_repo *repo,
- */
- dot = strrchr(filename, '.');
- if (dot != NULL) {
-+#ifdef __native_client__
-+ snprintf(tmp, MIN(MAXPATHLEN, dot - filename + 1), "%s", filename);
-+#else
- snprintf(tmp, MIN(sizeof(tmp), dot - filename + 1), "%s", filename);
-+#endif
- snprintf(url, sizeof(url), "%s/%s.%s", pkg_repo_url(repo), tmp,
- extension);
- }
-@@ -94,8 +111,41 @@ pkg_repo_fetch_remote_tmp(struct pkg_repo *repo,
- if (tmpdir == NULL)
- tmpdir = "/tmp";
- mkdirs(tmpdir);
-+#ifdef __native_client__
-+ snprintf(tmp, MAXPATHLEN, "%s/%s.%s.XXXXXX", tmpdir, filename, extension);
-+#else
- snprintf(tmp, sizeof(tmp), "%s/%s.%s.XXXXXX", tmpdir, filename, extension);
-+#endif
-
-+#ifdef __native_client__
-+ int pid = vfork();
-+ if (pid == -1) {
-+ rc = EPKG_FATAL;
-+ free(tmp);
-+ return (rc);
-+ } else if (pid == 0) {
-+ char* geturl_argv[4];
-+ geturl_argv[0] = "geturl";
-+ geturl_argv[1] = url;
-+ geturl_argv[2] = tmp;
-+ geturl_argv[3] = NULL;
-+ execvp("geturl", geturl_argv);
-+ // error when execvp returns
-+ free(tmp);
-+ *rc = EPKG_FATAL;
-+ _exit(-1);
-+ } else {
-+ int status;
-+ waitpid(pid, &status, 0);
-+ if (WEXITSTATUS(status) != 0) {
-+ *rc = EPKG_FATAL;
-+ free(tmp);
-+ return (-1);
-+ }
-+ }
-+ *tmp_file = tmp;
-+ fd = open(tmp, O_RDONLY);
-+#else
- fd = mkstemp(tmp);
- if (fd == -1) {
- pkg_emit_error("Could not create temporary file %s, "
-@@ -109,7 +159,7 @@ pkg_repo_fetch_remote_tmp(struct pkg_repo *repo,
- close(fd);
- fd = -1;
- }
--
-+#endif
- return (fd);
- }
-
-@@ -535,6 +585,67 @@ pkg_repo_parse_sigkeys(const char *in, int inlen, struct sig_cert **sc)
- return (rc);
- }
-
-+#ifdef __native_client__
-+static int
-+pkg_repo_meta_extract_signature_pubkey_nacl(int fd, void *ud)
-+{
-+ struct archive *a = NULL;
-+ struct archive_entry *ae = NULL;
-+ struct pkg_extract_cbdata *cb = ud;
-+ int siglen;
-+ void *sig;
-+ int rc = EPKG_FATAL;
-+
-+ pkg_debug(1, "PkgRepo: extracting signature of repo in a sandbox");
-+
-+ a = archive_read_new();
-+ archive_read_support_filter_all(a);
-+ archive_read_support_format_tar(a);
-+
-+ archive_read_open_fd(a, cb->afd, 4096);
-+ while (archive_read_next_header(a, &ae) == ARCHIVE_OK) {
-+ if (cb->need_sig && strcmp(archive_entry_pathname(ae), "signature") == 0) {
-+ siglen = archive_entry_size(ae);
-+ sig = malloc(siglen);
-+ if (sig == NULL) {
-+ pkg_emit_errno("pkg_repo_meta_extract_signature",
-+ "malloc failed");
-+ return (EPKG_FATAL);
-+ }
-+ if (archive_read_data(a, sig, siglen) == -1) {
-+ pkg_emit_errno("pkg_repo_meta_extract_signature",
-+ "archive_read_data failed");
-+ free(sig);
-+ return (EPKG_FATAL);
-+ }
-+ if (write(fd, sig, siglen) == -1) {
-+ pkg_emit_errno("pkg_repo_meta_extract_signature",
-+ "write failed");
-+ free(sig);
-+ return (EPKG_FATAL);
-+ }
-+ free(sig);
-+ rc = EPKG_OK;
-+ }
-+ else if (strcmp(archive_entry_pathname(ae), cb->fname) == 0) {
-+ if (archive_read_data_into_fd(a, cb->tfd) != 0) {
-+ pkg_emit_errno("archive_read_extract", "extract error");
-+ rc = EPKG_FATAL;
-+ break;
-+ }
-+ else if (!cb->need_sig) {
-+ rc = EPKG_OK;
-+ }
-+ }
-+ }
-+ if (a != NULL) {
-+ archive_read_close(a);
-+ archive_read_free(a);
-+ }
-+ return (rc);
-+}
-+#endif
-+
- static int
- pkg_repo_archive_extract_archive(int fd, const char *file,
- const char *dest, struct pkg_repo *repo, int dest_fd,
-@@ -609,6 +720,13 @@ pkg_repo_archive_extract_archive(int fd, const char *file,
- }
- else {
- cbdata.need_sig = false;
-+// Socketpair is broken in NaCl
-+// Don't check pubkey now.
-+#ifdef __native_client__
-+ // Pass in a invalide fd now
-+ // Not using the signature part of code
-+ pkg_repo_meta_extract_signature_pubkey_nacl(-1, &cbdata);
-+#else
- if (pkg_emit_sandbox_get_string(pkg_repo_meta_extract_signature_pubkey,
- &cbdata, (char **)&sig, &siglen) == EPKG_OK) {
- free(sig);
-@@ -617,6 +735,7 @@ pkg_repo_archive_extract_archive(int fd, const char *file,
- pkg_emit_error("Repo extraction failed");
- return (EPKG_FATAL);
- }
-+#endif
- }
- (void)lseek(fd, 0, SEEK_SET);
- if (dest_fd != -1)
-@@ -705,23 +824,43 @@ cleanup:
- return rc;
- }
-
-+#ifdef __native_client__
-+static int
-+pkg_repo_fetch_remote_extract_fd(struct pkg_repo *repo, const char *filename,
-+ time_t *t, int *rc, char** tmp_dest_file)
-+#else
- static int
- pkg_repo_fetch_remote_extract_fd(struct pkg_repo *repo, const char *filename,
- time_t *t, int *rc)
-+#endif
- {
- int fd, dest_fd;
- const char *tmpdir;
-+#ifdef __native_client__
-+ char* tmp = (char*)malloc(MAXPATHLEN*sizeof(char));
-+#else
- char tmp[MAXPATHLEN];
--
-+#endif
-+#ifdef __native_client__
-+ char* tmp_file;
-+ fd = pkg_repo_fetch_remote_tmp(repo, filename,
-+ packing_format_to_string(repo->meta->packing_format), t, rc,
-+ &tmp_file);
-+#else
- fd = pkg_repo_fetch_remote_tmp(repo, filename,
- packing_format_to_string(repo->meta->packing_format), t, rc);
-+#endif
- if (fd == -1)
- return (-1);
-
- tmpdir = getenv("TMPDIR");
- if (tmpdir == NULL)
- tmpdir = "/tmp";
-+#ifdef __native_client__
-+ snprintf(tmp, MAXPATHLEN, "%s/%s.XXXXXX", tmpdir, filename);
-+#else
- snprintf(tmp, sizeof(tmp), "%s/%s.XXXXXX", tmpdir, filename);
-+#endif
-
- dest_fd = mkstemp(tmp);
- if (dest_fd == -1) {
-@@ -731,8 +870,10 @@ pkg_repo_fetch_remote_extract_fd(struct pkg_repo *repo, const char *filename,
- *rc = EPKG_FATAL;
- return (-1);
- }
--
-+// POSIX semantics does not apply here
-+#ifndef __native_client__
- (void)unlink(tmp);
-+#endif
- if (pkg_repo_archive_extract_check_archive(fd, filename, NULL, repo, dest_fd)
- != EPKG_OK) {
- *rc = EPKG_FATAL;
-@@ -743,7 +884,11 @@ pkg_repo_fetch_remote_extract_fd(struct pkg_repo *repo, const char *filename,
-
- /* Thus removing archived file as well */
- close(fd);
--
-+#ifdef __native_client__
-+ (void)unlink(tmp_file);
-+ free(tmp_file);
-+ *tmp_dest_file = tmp;
-+#endif
- return (dest_fd);
- }
-
-@@ -755,7 +900,12 @@ pkg_repo_fetch_remote_extract_mmap(struct pkg_repo *repo, const char *filename,
- struct stat st;
- unsigned char *map;
-
-+#ifdef __native_client__
-+ char* tmp_file;
-+ fd = pkg_repo_fetch_remote_extract_fd(repo, filename, t, rc, &tmp_file);
-+#else
- fd = pkg_repo_fetch_remote_extract_fd(repo, filename, t, rc);
-+#endif
- if (fd == -1) {
- return (NULL);
- }
-@@ -774,6 +924,10 @@ pkg_repo_fetch_remote_extract_mmap(struct pkg_repo *repo, const char *filename,
-
- map = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
- close(fd);
-+#ifdef __native_client__
-+ (void)unlink(tmp_file);
-+ free(tmp_file);
-+#endif
- if (map == MAP_FAILED) {
- pkg_emit_errno("pkg_repo_fetch_remote_mmap", "cannot mmap fetched");
- *rc = EPKG_FATAL;
-@@ -789,8 +943,12 @@ pkg_repo_fetch_remote_extract_tmp(struct pkg_repo *repo, const char *filename,
- {
- int dest_fd;
- FILE *res;
--
-+#ifdef __native_client__
-+ char * tmp_file;
-+ dest_fd = pkg_repo_fetch_remote_extract_fd(repo, filename, t, rc, &tmp_file);
-+#else
- dest_fd = pkg_repo_fetch_remote_extract_fd(repo, filename, t, rc);
-+#endif
- if (dest_fd == -1) {
- *rc = EPKG_FATAL;
- return (NULL);
-@@ -804,6 +962,10 @@ pkg_repo_fetch_remote_extract_tmp(struct pkg_repo *repo, const char *filename,
- return (NULL);
- }
-
-+#ifdef __native_client__
-+ (void)unlink(tmp_file);
-+ free(tmp_file);
-+#endif
- *rc = EPKG_OK;
- return (res);
- }
-@@ -890,9 +1052,12 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t)
-
- dbdir = pkg_object_string(pkg_config_get("PKG_DBDIR"));
-
-+#ifdef __native_client__
-+ char* tmp_file;
-+ fd = pkg_repo_fetch_remote_tmp(repo, "meta", "tbz", t, &rc, &tmp_file);
-+#else
- fd = pkg_repo_fetch_remote_tmp(repo, "meta", "txz", t, &rc);
-- if (fd == -1)
-- return (rc);
-+#endif
-
- snprintf(filepath, sizeof(filepath), "%s/%s.meta", dbdir, pkg_repo_name(repo));
-
-@@ -922,12 +1087,18 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t)
- }
-
- close(fd);
-+#ifdef __native_client__
-+ (void)unlink(tmp_file);
-+ free(tmp_file);
-+#endif
-
- if (repo->signature_type == SIG_FINGERPRINT && repo->trusted_fp == NULL) {
- if (pkg_repo_load_fingerprints(repo) != EPKG_OK)
- return (EPKG_FATAL);
- }
-
-+ // No pubkey or fingerprint for nacl repo now.
-+#ifndef __native_client__
- /* Map meta file for extracting pubkeys from it */
- if (stat(filepath, &st) == -1) {
- pkg_emit_errno("pkg_repo_fetch_meta", "cannot stat meta fetched");
-@@ -947,6 +1118,7 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t)
- rc = EPKG_FATAL;
- goto cleanup;
- }
-+#endif
-
- if (repo->signature_type == SIG_FINGERPRINT) {
- cbdata.len = st.st_size;
-diff --git a/libpkg/pkg_repo_create.c b/libpkg/pkg_repo_create.c
---- a/libpkg/pkg_repo_create.c
-+++ b/libpkg/pkg_repo_create.c
-@@ -32,7 +32,12 @@
-
- #include <sys/types.h>
- #include <sys/stat.h>
-+#if defined(_NEWLIB_VERSION)
-+#include <fcntl.h>
-+#endif
-+#if defined(HAVE_SYSCTLBYNAME)
- #include <sys/sysctl.h>
-+#endif
- #include <sys/wait.h>
- #include <sys/socket.h>
- #include <sys/file.h>
-@@ -313,7 +318,11 @@ pkg_create_repo_worker(struct pkg_fts_item *start, size_t nelts,
- }
- }
-
-+#ifdef __native_client__
-+ pid = vfork();
-+#else
- pid = fork();
-+#endif
- switch(pid) {
- case -1:
- pkg_emit_errno("pkg_create_repo_worker", "fork");
-@@ -452,7 +461,11 @@ cleanup:
- free(mdigest);
-
- pkg_debug(1, "worker done");
-+#ifdef __native_client__
-+ _exit(ret);
-+#else
- exit(ret);
-+#endif
- }
-
- static int
-@@ -614,7 +627,7 @@ pkg_create_repo(char *path, const char *output_dir, bool filelist,
- num_workers = pkg_object_int(pkg_config_get("WORKERS_COUNT"));
- if (num_workers <= 0) {
- len = sizeof(num_workers);
--#ifdef HAVE_SYSCTLBYNAME
-+#if defined (HAVE_SYSCTLBYNAME) && !defined(_NEWLIB_VERSION)
- if (sysctlbyname("hw.ncpu", &num_workers, &len, NULL, 0) == -1)
- num_workers = 6;
- #else
-@@ -886,8 +899,12 @@ pkg_repo_sign(char *path, char **argv, int argc, struct sbuf **sig, struct sbuf
- if (*cert == NULL)
- *cert = sbuf_new_auto();
-
-+#ifdef _NEWLIB_VERSION
-+ while ((linelen = __getline(&line, &linecap, fp)) > 0 ) {
-+#else
- while ((linelen = getline(&line, &linecap, fp)) > 0 ) {
-- if (strcmp(line, "SIGNATURE\n") == 0) {
-+#endif
-+ if (strcmp(line, "SIGNATURE\n") == 0) {
- buf = *sig;
- continue;
- } else if (strcmp(line, "CERT\n") == 0) {
-@@ -1032,9 +1049,6 @@ pkg_finish_repo(const char *output_dir, pem_password_cb *password_cb,
- rsa_free(rsa);
- return (EPKG_FATAL);
- }
-- else {
-- meta = pkg_repo_meta_default();
-- }
- if (pkg_repo_pack_db(repo_meta_file, repo_path, repo_path, rsa, meta,
- argv, argc) != EPKG_OK) {
- ret = EPKG_FATAL;
-diff --git a/libpkg/pkg_solve.c b/libpkg/pkg_solve.c
---- a/libpkg/pkg_solve.c
-+++ b/libpkg/pkg_solve.c
-@@ -1435,8 +1435,12 @@ pkg_solve_parse_sat_output(FILE *f, struct pkg_solve_problem *problem)
- HASH_ADD_INT(ordered_variables, order, nord);
- }
-
-- while ((linelen = getline(&line, &linecap, f)) > 0) {
-- if (strncmp(line, "SAT", 3) == 0) {
-+#ifdef _NEWLIB_VERSION
-+ while ((linelen = __getline(&line, &linecap, f)) > 0) {
-+#else
-+ while ((linelen = getline(&line, &linecap, f)) > 0) {
-+#endif
-+ if (strncmp(line, "SAT", 3) == 0) {
- got_sat = true;
- }
- else if (got_sat) {
-diff --git a/libpkg/pkgdb.c b/libpkg/pkgdb.c
---- a/libpkg/pkgdb.c
-+++ b/libpkg/pkgdb.c
-@@ -73,6 +73,11 @@
-
- #include "private/db_upgrades.h"
-
-+#ifdef __native_client__
-+// Adapt the same fix as ruby
-+#define eaccess access
-+#endif
-+
- /* An application using a libpkg() DBVERSION is assumed to be compatible
- with:
-
-@@ -731,8 +736,15 @@ pkgdb_is_insecure_mode(const char *path, bool install_as_user)
- struct stat sb;
-
- if (install_as_user) {
-+ // No check for nacl
-+ // Turn back on when geteuid and getegid are available
-+#ifdef __native_client_
-+ fileowner = 0;
-+ filegroup = 0;
-+#else
- fileowner = geteuid();
- filegroup = getegid();
-+#endif
- } else {
- fileowner = 0;
- filegroup = 0;
-@@ -747,6 +759,8 @@ pkgdb_is_insecure_mode(const char *path, bool install_as_user)
- return (EPKG_FATAL);
- }
-
-+ // No check in devenv. Cannot change permission. Everything is 777.
-+#ifndef __native_client__
- /* if fileowner == 0, root ownership and no group or other
- read access. if fileowner != 0, require no other read
- access and group read access IFF the group ownership ==
-@@ -777,7 +791,7 @@ pkgdb_is_insecure_mode(const char *path, bool install_as_user)
- path, fileowner, filegroup, sb.st_uid, sb.st_gid);
- return (EPKG_INSECURE);
- }
--
-+#endif
- return (EPKG_OK);
- }
-
-@@ -1025,7 +1039,9 @@ pkgdb_open_all(struct pkgdb **db_p, pkgdb_t type, const char *reponame)
- /*
- * Fall back on unix-dotfile locking strategy if on a network filesystem
- */
--#if defined(HAVE_SYS_STATVFS_H) && defined(ST_LOCAL)
-+#ifdef __native_client__
-+ sqlite3_vfs_register(sqlite3_vfs_find("unix-dotfile"), 1);
-+#elif defined(HAVE_SYS_STATVFS_H) && defined(ST_LOCAL)
- struct statvfs stfs;
-
- if (statvfs(dbdir, &stfs) == 0) {
-diff --git a/libpkg/pkgdb_iterator.c b/libpkg/pkgdb_iterator.c
---- a/libpkg/pkgdb_iterator.c
-+++ b/libpkg/pkgdb_iterator.c
-@@ -38,6 +38,9 @@
-
- #include <assert.h>
- #include <errno.h>
-+// TODO: Remove sys/types.h once this bug is fixed
-+// BUG=https://code.google.com/p/nativeclient/issues/detail?id=4264
-+#include <sys/types.h>
- #include <regex.h>
- #include <grp.h>
- #ifdef HAVE_LIBUTIL_H
-diff --git a/libpkg/pkgdb_query.c b/libpkg/pkgdb_query.c
---- a/libpkg/pkgdb_query.c
-+++ b/libpkg/pkgdb_query.c
-@@ -38,6 +38,9 @@
-
- #include <assert.h>
- #include <errno.h>
-+// TODO: Remove sys/types.h once this bug is fixed
-+// BUG=https://code.google.com/p/nativeclient/issues/detail?id=4264
-+#include <sys/types.h>
- #include <regex.h>
- #include <grp.h>
- #ifdef HAVE_LIBUTIL_H
-diff --git a/libpkg/plugins.c b/libpkg/plugins.c
---- a/libpkg/plugins.c
-+++ b/libpkg/plugins.c
-@@ -31,9 +31,10 @@
-
- #include <ctype.h>
- #include <errno.h>
--#include <fts.h>
- #include <fcntl.h>
-+#ifndef _NEWLIB_VERSION
- #include <dlfcn.h>
-+#endif
- #include <stdbool.h>
- #include <string.h>
- #include <assert.h>
-@@ -67,11 +68,13 @@ static int pkg_plugin_free(void);
- static int pkg_plugin_hook_free(struct pkg_plugin *p);
- static int pkg_plugin_hook_exec(struct pkg_plugin *p, pkg_plugin_hook_t hook, void *data, struct pkgdb *db);
-
-+#ifndef _NEWLIB_VERSION
- void *
- pkg_plugin_func(struct pkg_plugin *p, const char *func)
- {
- return (dlsym(p->lh, func));
- }
-+#endif
-
- static int
- pkg_plugin_hook_free(struct pkg_plugin *p)
-@@ -267,6 +270,7 @@ pkg_plugins(struct pkg_plugin **plugin)
- return (EPKG_OK);
- }
-
-+#ifndef _NEWLIB_VERSION
- int
- pkg_plugins_init(void)
- {
-@@ -323,6 +327,7 @@ pkg_plugins_init(void)
-
- return (EPKG_OK);
- }
-+#endif
-
- int
- pkg_plugin_parse(struct pkg_plugin *p)
-@@ -379,6 +384,7 @@ pkg_plugin_parse(struct pkg_plugin *p)
- return (EPKG_OK);
- }
-
-+#ifndef _NEWLIB_VERSION
- void
- pkg_plugins_shutdown(void)
- {
-@@ -402,6 +408,7 @@ pkg_plugins_shutdown(void)
-
- return;
- }
-+#endif
-
- const pkg_object *
- pkg_plugin_conf(struct pkg_plugin *p)
-diff --git a/libpkg/private/pkg.h b/libpkg/private/pkg.h
---- a/libpkg/private/pkg.h
-+++ b/libpkg/private/pkg.h
-@@ -40,6 +40,7 @@
- #include <archive.h>
- #include <sqlite3.h>
- #include <stdbool.h>
-+#include <stdint.h>
- #include <uthash.h>
- #include <utlist.h>
- #include <ucl.h>
-diff --git a/libpkg/private/utils.h b/libpkg/private/utils.h
---- a/libpkg/private/utils.h
-+++ b/libpkg/private/utils.h
-@@ -39,11 +39,16 @@
- #include <openssl/pem.h>
- #include <openssl/rsa.h>
-
-+#ifndef MAXHOSTNAMELEN
-+#define MAXHOSTNAMELEN 64
-+#endif
-+
- #define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0)
-
- #define ERROR_SQLITE(db, query) do { \
-- pkg_emit_error("sqlite error while executing %s in file %s:%d: %s", (query), \
-- __FILE__, __LINE__, sqlite3_errmsg(db)); \
-+ pkg_emit_error("sqlite error executing %s on %s at %s:%d: %s", (query), \
-+ sqlite3_db_filename(db, "main"), bsd_basename(__FILE__), __LINE__, \
-+ sqlite3_errmsg(db)); \
- } while(0)
-
- KHASH_MAP_INIT_INT(hardlinks, int)
-diff --git a/libpkg/repo/binary/fetch.c b/libpkg/repo/binary/fetch.c
---- a/libpkg/repo/binary/fetch.c
-+++ b/libpkg/repo/binary/fetch.c
-@@ -42,6 +42,11 @@
- #include <limits.h>
-
- #include <libgen.h>
-+#ifdef __native_client__
-+#include <sys/types.h>
-+#include <sys/wait.h>
-+#include <spawn.h>
-+#endif
-
- #include "pkg.h"
- #include "private/event.h"
-@@ -110,6 +115,9 @@ pkg_repo_binary_create_symlink(struct pkg *pkg, const char *fname,
- /* Trim the path to just the filename. */
- if ((dest_fname = strrchr(fname, '/')) != NULL)
- ++dest_fname;
-+
-+// Symlink does not work in devenv
-+#ifndef __native_client__
- if (symlink(dest_fname, link_dest_tmp) == -1) {
- pkg_emit_errno("symlink", link_dest);
- return (EPKG_FATAL);
-@@ -120,7 +128,7 @@ pkg_repo_binary_create_symlink(struct pkg *pkg, const char *fname,
- unlink(link_dest_tmp);
- return (EPKG_FATAL);
- }
--
-+#endif
- return (EPKG_OK);
- }
-
-@@ -200,7 +208,29 @@ pkg_repo_binary_try_fetch(struct pkg_repo *repo, struct pkg *pkg,
- return (EPKG_OK);
- }
-
-+#ifdef __native_client__
-+ int pid = vfork();
-+ if (pid == -1) {
-+ retcode = EPKG_FATAL;
-+ } else if (pid == 0) {
-+ char* geturl_argv[4];
-+ geturl_argv[0] = "geturl";
-+ geturl_argv[1] = url;
-+ geturl_argv[2] = dest;
-+ geturl_argv[3] = NULL;
-+ execvp("geturl", geturl_argv);
-+ // execvp returns when there is error
-+ retcode = EPKG_FATAL;
-+ } else {
-+ int status;
-+ waitpid(pid, &status, 0);
-+ if (WEXITSTATUS(status) != 0) {
-+ retcode = EPKG_FATAL;
-+ }
-+ }
-+#else
- retcode = pkg_fetch_file(repo, url, dest, 0, offset, pkg->pkgsize);
-+#endif
- fetched = true;
-
- if (retcode != EPKG_OK)
-diff --git a/libpkg/repo/binary/init.c b/libpkg/repo/binary/init.c
---- a/libpkg/repo/binary/init.c
-+++ b/libpkg/repo/binary/init.c
-@@ -26,6 +26,9 @@
-
- #include <assert.h>
- #include <errno.h>
-+// TODO: Remove <sys/types.h> once this bug is fixed
-+// BUG=https://code.google.com/p/nativeclient/issues/detail?id=4264
-+#include <sys/types.h>
- #include <regex.h>
- #include <grp.h>
- #include <stdlib.h>
-@@ -316,7 +319,9 @@ pkg_repo_binary_open(struct pkg_repo *repo, unsigned mode)
- /*
- * Fall back on unix-dotfile locking strategy if on a network filesystem
- */
--#if defined(HAVE_SYS_STATVFS_H) && defined(ST_LOCAL)
-+#ifdef __native_client__
-+ sqlite3_vfs_register(sqlite3_vfs_find("unix-dotfile"), 1);
-+#elif defined(HAVE_SYS_STATVFS_H) && defined(ST_LOCAL)
- struct statvfs stfs;
-
- if (statvfs(dbdir, &stfs) == 0) {
-@@ -349,8 +354,13 @@ pkg_repo_binary_open(struct pkg_repo *repo, unsigned mode)
- return (EPKG_ENOACCESS);
-
- flags = (mode & W_OK) != 0 ? SQLITE_OPEN_READWRITE : SQLITE_OPEN_READONLY;
-+#ifdef __native_client__
-+ if (sqlite3_open_v2(filepath, &sqlite, flags, "unix-dotfile") != SQLITE_OK)
-+ return (EPKG_FATAL);
-+#else
- if (sqlite3_open_v2(filepath, &sqlite, flags, NULL) != SQLITE_OK)
- return (EPKG_FATAL);
-+#endif
-
- /* Sanitise sqlite database */
- if (get_pragma(sqlite, "SELECT count(name) FROM sqlite_master "
-@@ -434,7 +444,9 @@ pkg_repo_binary_create(struct pkg_repo *repo)
- /*
- * Fall back on unix-dotfile locking strategy if on a network filesystem
- */
--#if defined(HAVE_SYS_STATVFS_H) && defined(ST_LOCAL)
-+#ifdef __native_client__
-+ sqlite3_vfs_register(sqlite3_vfs_find("unix-dotfile"), 1);
-+#elif defined(HAVE_SYS_STATVFS_H) && defined(ST_LOCAL)
- struct statvfs stfs;
-
- if (statvfs(dbdir, &stfs) == 0) {
-diff --git a/libpkg/repo/binary/query.c b/libpkg/repo/binary/query.c
---- a/libpkg/repo/binary/query.c
-+++ b/libpkg/repo/binary/query.c
-@@ -23,6 +23,9 @@
-
- #include <assert.h>
- #include <errno.h>
-+// TODO: Remove sys/types.h once this bug is fixed
-+// BUG=https://code.google.com/p/nativeclient/issues/detail?id=4264
-+#include <sys/types.h>
- #include <regex.h>
- #include <grp.h>
- #include <stdlib.h>
-diff --git a/libpkg/scripts.c b/libpkg/scripts.c
---- a/libpkg/scripts.c
-+++ b/libpkg/scripts.c
-@@ -127,7 +127,11 @@ pkg_script_run(struct pkg * const pkg, pkg_script type)
- if a pipe is required to /bin/sh -s. Similar to
- find(1) determination */
- if ((argmax = sysconf(_SC_ARG_MAX)) == -1)
-- argmax = _POSIX_ARG_MAX;
-+#ifdef _NEWLIB_VERSION
-+ argmax = ARG_MAX;
-+#else
-+ argmax = _POSIX_ARG_MAX;
-+#endif
- argmax -= 1024;
- for (ep = environ; *ep != NULL; ep++)
- argmax -= strlen(*ep) + 1 + sizeof(*ep);
-@@ -228,4 +232,3 @@ cleanup:
-
- return (ret);
- }
--
-diff --git a/libpkg/ssh.c b/libpkg/ssh.c
---- a/libpkg/ssh.c
-+++ b/libpkg/ssh.c
-@@ -68,7 +68,11 @@ pkg_sshserve(int fd)
-
- printf("ok: pkg "PKGVERSION"\n");
- for (;;) {
-+#ifdef _NEWLIB_VERSION
-+ if ((linelen = __getline(&line, &linecap, stdin)) < 0)
-+#else
- if ((linelen = getline(&line, &linecap, stdin)) < 0)
-+#endif
- break;
-
- if (linelen == 0)
-diff --git a/libpkg/utils.c b/libpkg/utils.c
---- a/libpkg/utils.c
-+++ b/libpkg/utils.c
-@@ -475,7 +475,11 @@ process_spawn_pipe(FILE *inout[2], const char *command)
- argv[2] = __DECONST(char *, command);
- argv[3] = NULL;
-
-+#ifdef __native_client__
-+ pid = vfork();
-+#else
- pid = fork();
-+#endif
- if (pid > 0) {
- /* Parent process */
- inout[0] = fdopen(pipes[0], "r");
-@@ -502,7 +506,11 @@ process_spawn_pipe(FILE *inout[2], const char *command)
-
- execve(_PATH_BSHELL, argv, environ);
-
-+#ifdef __native_client__
-+ _exit(127);
-+#else
- exit(127);
-+#endif
- }
-
- return (-1); /* ? */
-diff --git a/src/Makefile.am b/src/Makefile.am
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -55,7 +55,7 @@ pkg_CFLAGS= @OS_CFLAGS@ \
- pkg_static_SOURCES=
- pkg_static_LDADD= @OS_LDFLAGS@ \
- $(top_builddir)/libpkg/libpkg_static.la \
-- $(top_builddir)/compat/libbsd_compat.la \
-+ $(top_builddir)/compat/libbsd_compat_static.la \
- $(top_builddir)/external/libsbuf_static.la \
- $(pkg_OBJECTS) \
- @LIBJAIL_LIB@ \
-@@ -63,7 +63,6 @@ pkg_static_LDADD= @OS_LDFLAGS@ \
- @OS_LIBS@ \
- -larchive \
- -lz \
-- -lutil \
- -lbz2 \
- -llzma \
- -lssl \
-diff --git a/src/add.c b/src/add.c
---- a/src/add.c
-+++ b/src/add.c
-@@ -36,6 +36,10 @@
- #include <sysexits.h>
- #include <unistd.h>
- #include <getopt.h>
-+#ifdef __native_client__
-+#include <sys/wait.h>
-+#include <spawn.h>
-+#endif
-
- #include <pkg.h>
-
-@@ -146,9 +150,32 @@ exec_add(int argc, char **argv)
- if (is_url(argv[i]) == EPKG_OK) {
- snprintf(path, sizeof(path), "%s/%s.XXXXX",
- getenv("TMPDIR") != NULL ? getenv("TMPDIR") : "/tmp", basename(argv[i]));
-+#ifdef __native_client__
-+ int pid = vfork();
-+ if (pid == -1) {
-+ retcode = EPKG_FATAL;
-+ break;
-+ } else if (pid == 0) {
-+ char* geturl_argv[4];
-+ geturl_argv[0] = "geturl";
-+ geturl_argv[1] = argv[i];
-+ geturl_argv[2] = path;
-+ geturl_argv[3] = NULL;
-+ execvp("geturl", geturl_argv);
-+ // execvp returns when there is error.
-+ _exit(1);
-+ } else {
-+ int status;
-+ waitpid(pid, &status, 0);
-+ if (WEXITSTATUS(status) != 0) {
-+ retcode = EPKG_FATAL;
-+ break;
-+ }
-+ }
-+#else
- if ((retcode = pkg_fetch_file(NULL, argv[i], path, 0, 0, 0)) != EPKG_OK)
- break;
--
-+#endif
- file = path;
- } else {
- file = argv[i];
-diff --git a/src/event.c b/src/event.c
---- a/src/event.c
-+++ b/src/event.c
-@@ -34,7 +34,9 @@
- #endif
-
- #include <sys/types.h>
-+#if defined (HAVE_SYSCTLBYNAME) && !defined(_NEWLIB_VERSION)
- #include <sys/sysctl.h>
-+#endif
- #include <sys/wait.h>
- #include <sys/socket.h>
-
-@@ -51,9 +53,15 @@
- #include <libutil.h>
- #endif
-
-+#ifdef __native_client__
-+#include <spawn.h>
-+#endif
-+
- #include <bsd_compat.h>
-
- #include "pkg.h"
-+int nbdone;
-+int nbactions;
- #include "pkgcli.h"
-
- #define STALL_TIME 5
-@@ -165,9 +173,13 @@ job_status_begin(struct sbuf *msg)
-
- if (jailed == -1) {
- intlen = sizeof(jailed);
-+#if defined (HAVE_SYSCTLBYNAME) && !defined(_NEWLIB_VERSION)
- if (sysctlbyname("security.jail.jailed", &jailed, &intlen,
- NULL, 0) == -1)
- jailed = 0;
-+#else
-+ jailed = 0;
-+#endif
- }
-
- if (jailed == 1) {
-@@ -202,7 +214,11 @@ event_sandboxed_call(pkg_sandbox_cb func, int fd, void *ud)
- int status, ret;
-
- ret = -1;
-+#ifdef __native_client__
-+ pid = vfork();
-+#else
- pid = fork();
-+#endif
-
- switch(pid) {
- case -1:
-@@ -237,7 +253,11 @@ event_sandboxed_call(pkg_sandbox_cb func, int fd, void *ud)
- #ifdef HAVE_CAPSICUM
- if (cap_enter() < 0 && errno != ENOSYS) {
- warn("cap_enter() failed");
-+#ifdef __native_client__
-+ _exit (EPKG_FATAL);
-+#else
- return (EPKG_FATAL);
-+#endif
- }
- #endif
-
-@@ -264,8 +284,11 @@ event_sandboxed_get_string(pkg_sandbox_cb func, char **result, int64_t *len,
- return (EPKG_FATAL);
- }
-
-+#ifdef __native_client__
-+ pid = vfork();
-+#else
- pid = fork();
--
-+#endif
- switch(pid) {
- case -1:
- warn("fork failed");
-@@ -341,7 +364,11 @@ event_sandboxed_get_string(pkg_sandbox_cb func, char **result, int64_t *len,
- #ifdef HAVE_CAPSICUM
- if (cap_enter() < 0 && errno != ENOSYS) {
- warn("cap_enter() failed");
-+#ifdef __native_client__
-+ _exit (EPKG_FATAL);
-+#else
- return (EPKG_FATAL);
-+#endif
- }
- #endif
-
-diff --git a/src/main.c b/src/main.c
---- a/src/main.c
-+++ b/src/main.c
-@@ -60,6 +60,10 @@
-
- #include <pkg.h>
-
-+#ifdef __native_client__
-+#include <spawn.h>
-+#endif
-+
- #include "pkgcli.h"
-
- /* Used to define why do we show usage message to a user */
-@@ -97,7 +101,9 @@ static struct commands {
- { "info", "Displays information about installed packages", exec_info, usage_info},
- { "install", "Installs packages from remote package repositories and local archives", exec_install, usage_install},
- { "lock", "Locks package against modifications or deletion", exec_lock, usage_lock},
-+#ifndef _NEWLIB_VERSION
- { "plugins", "Manages plugins and displays information about plugins", exec_plugins, usage_plugins},
-+#endif
- { "query", "Queries information about installed packages", exec_query, usage_query},
- { "register", "Registers a package into the local database", exec_register, usage_register},
- { "remove", "Deletes packages from the database and the system", exec_delete, usage_delete},
-@@ -196,6 +202,7 @@ usage(const char *conffile, const char *reposdir, FILE *out, enum pkg_usage_reas
-
- plugins_enabled = pkg_object_bool(pkg_config_get("PKG_ENABLE_PLUGINS"));
-
-+#ifndef _NEWLIB_VERSION
- if (plugins_enabled) {
- if (pkg_plugins_init() != EPKG_OK)
- errx(EX_SOFTWARE, "Plugins cannot be loaded");
-@@ -205,6 +212,7 @@ usage(const char *conffile, const char *reposdir, FILE *out, enum pkg_usage_reas
- STAILQ_FOREACH(c, &plugins, next)
- fprintf(out, "\t%-15s%s\n", c->name, c->desc);
- }
-+#endif
- fprintf(out, "\nFor more information on the different commands"
- " see 'pkg help <command>'.\n");
- exit(EXIT_SUCCESS);
-@@ -251,6 +259,7 @@ exec_help(int argc, char **argv)
-
- plugins_enabled = pkg_object_bool(pkg_config_get("PKG_ENABLE_PLUGINS"));
-
-+#ifndef _NEWLIB_VERSION
- if (plugins_enabled) {
- STAILQ_FOREACH(c, &plugins, next) {
- if (strcmp(c->name, argv[1]) == 0) {
-@@ -264,6 +273,7 @@ exec_help(int argc, char **argv)
- }
- }
- }
-+#endif
-
- if (strcmp(argv[1], "pkg") == 0) {
- system("/usr/bin/man 8 pkg");
-@@ -290,6 +300,7 @@ exec_help(int argc, char **argv)
- return (EX_USAGE);
- }
-
-+#ifndef _NEWLIB_VERSION
- static void
- show_plugin_info(void)
- {
-@@ -304,6 +315,7 @@ show_plugin_info(void)
- printf("%s\n", pkg_object_dump(conf));
- }
- }
-+#endif
-
- static void
- show_repository_info(void)
-@@ -377,7 +389,9 @@ show_version_info(int version)
- exit(EX_OK);
-
- printf("%s\n", pkg_config_dump());
-- show_plugin_info();
-+#ifndef _NEWLIB_VERSION
-+ show_plugin_info();
-+#endif
- show_repository_info();
-
- exit(EX_OK);
-@@ -438,6 +452,8 @@ export_arg_option (char *arg)
- }
- }
-
-+#ifndef __native_client__
-+/* The use of fork here is not compatible with NaCl, which only has vfork() */
- static void
- start_process_worker(char *const *save_argv)
- {
-@@ -463,7 +479,7 @@ start_process_worker(char *const *save_argv)
- } else {
- if (child_pid == -1)
- err(EX_OSERR, "Failed to fork worker process");
--
-+
- while (waitpid(child_pid, &status, 0) == -1) {
- if (errno != EINTR)
- err(EX_OSERR, "Child process pid=%d", (int)child_pid);
-@@ -486,6 +502,7 @@ start_process_worker(char *const *save_argv)
- exit(ret);
- /* NOTREACHED */
- }
-+#endif
-
- static int
- expand_aliases(int argc, char ***argv)
-@@ -580,7 +597,9 @@ main(int argc, char **argv)
- #ifdef HAVE_LIBJAIL
- { "jail", required_argument, NULL, 'j' },
- #endif
-+#ifndef _NEWLIB_VERSION
- { "chroot", required_argument, NULL, 'c' },
-+#endif
- { "config", required_argument, NULL, 'C' },
- { "repo-conf-dir", required_argument, NULL, 'R' },
- { "rootdir", required_argument, NULL, 'r' },
-@@ -622,9 +641,11 @@ main(int argc, char **argv)
- case 'd':
- debug++;
- break;
-+#ifndef _NEWLIB_VERSION
- case 'c':
- chroot_path = optarg;
- break;
-+#endif
- case 'C':
- conffile = optarg;
- break;
-@@ -684,8 +705,10 @@ main(int argc, char **argv)
- optreset = 1;
- optind = 1;
-
-+#ifndef __native_client__
- if (debug == 0 && version == 0)
- start_process_worker(save_argv);
-+#endif
-
- #ifdef HAVE_ARC4RANDOM
- /* Ensure that random is stirred after a possible fork */
-@@ -699,11 +722,13 @@ main(int argc, char **argv)
- "-j, -c and/or -r cannot be used at the same time!\n");
- }
-
-+#ifndef _NEWLIB_VERSION
- if (chroot_path != NULL) {
- if (chroot(chroot_path) == -1) {
- err(EX_SOFTWARE, "chroot failed");
- }
- }
-+#endif
-
- #ifdef HAVE_LIBJAIL
- if (jail_str != NULL) {
-@@ -729,9 +754,6 @@ main(int argc, char **argv)
- if (pkg_ini(conffile, reposdir, init_flags) != EPKG_OK)
- errx(EX_SOFTWARE, "Cannot parse configuration file!");
-
-- if (debug > 0)
-- pkg_set_debug_level(debug);
--
- if (atexit(&pkg_shutdown) != 0)
- errx(EX_SOFTWARE, "register pkg_shutdown() to run at exit");
-
-@@ -742,6 +764,7 @@ main(int argc, char **argv)
-
- plugins_enabled = pkg_object_bool(pkg_config_get("PKG_ENABLE_PLUGINS"));
-
-+#ifndef _NEWLIB_VERSION
- if (plugins_enabled) {
- struct pkg_plugin *p = NULL;
-
-@@ -768,6 +791,7 @@ main(int argc, char **argv)
- }
- }
- }
-+#endif
-
- if (version > 1)
- show_version_info(version);
-diff --git a/src/pkgcli.h b/src/pkgcli.h
---- a/src/pkgcli.h
-+++ b/src/pkgcli.h
-@@ -35,10 +35,8 @@
-
- extern bool quiet;
- extern int nbactions;
--int nbactions;
- extern int nbdone;
- extern bool newpkgversion;
--int nbdone;
-
- /* pkg add */
- int exec_add(int, char **);
-@@ -89,9 +87,11 @@ void usage_info(void);
- int exec_install(int, char **);
- void usage_install(void);
-
-+#ifndef _NEWLIB_VERSION
- /* pkg plugins */
- int exec_plugins(int, char **);
- void usage_plugins(void);
-+#endif
-
- /* pkg lock */
- int exec_lock(int, char **);
-diff --git a/src/plugins.c b/src/plugins.c
---- a/src/plugins.c
-+++ b/src/plugins.c
-@@ -35,6 +35,7 @@
-
- #include "pkgcli.h"
-
-+#ifndef _NEWLIB_VERSION
- void
- usage_plugins(void)
- {
-@@ -81,3 +82,4 @@ exec_plugins(int argc, char **argv)
-
- return (EX_OK);
- }
-+#endif
-diff --git a/src/updating.c b/src/updating.c
---- a/src/updating.c
-+++ b/src/updating.c
-@@ -177,7 +177,11 @@ exec_updating(int argc, char **argv)
- }
- }
-
-- while ((linelen = getline(&line, &linecap, fd)) > 0) {
-+#ifdef _NEWLIB_VERSION
-+ while ((linelen = __getline(&line, &linecap, fd)) > 0) {
-+#else
-+ while ((linelen = getline(&line, &linecap, fd)) > 0) {
-+#endif
- if (strspn(line, "0123456789:") == 9) {
- dateline = strdup(line);
- found = 0;
-diff --git a/src/utils.c b/src/utils.c
---- a/src/utils.c
-+++ b/src/utils.c
-@@ -140,7 +140,11 @@ vquery_yesno(bool deft, const char *msg, va_list ap)
- printf("%s", out);
-
- for (;;) {
-- if ((linelen = getline(&line, &linecap, stdin)) != -1) {
-+#ifdef _NEWLIB_VERSION
-+ if ((linelen = __getline(&line, &linecap, stdin)) != -1) {
-+#else
-+ if ((linelen = getline(&line, &linecap, stdin)) != -1) {
-+#endif
-
- if (linelen == 1 && line[0] == '\n') {
- if (default_yes)
-@@ -223,7 +227,11 @@ query_select(const char *msg, const char **opts, int ncnt, int deft)
- }
-
- i = deft;
-- while (getline(&str, &n, stdin) == -1) {
-+#ifdef _NEWLIB_VERSION
-+ while (__getline(&str, &n, stdin) == -1) {
-+#else
-+ while (getline(&str, &n, stdin) == -1) {
-+#endif
- if (errno == EINTR)
- continue;
- else
-diff --git a/src/version.c b/src/version.c
---- a/src/version.c
-+++ b/src/version.c
-@@ -206,7 +206,11 @@ do_testpattern(unsigned int opt, int argc, char ** restrict argv)
- if (!pattern_from_stdin && !pkgname_from_stdin)
- return (fnmatch(argv[1], argv[0], 0));
-
-+#ifdef _NEWLIB_VERSION
-+ while ((linelen = __getline(&line, &linecap, stdin)) > 0) {
-+#else
- while ((linelen = getline(&line, &linecap, stdin)) > 0) {
-+#endif
- line[linelen - 1] = '\0'; /* Strip trailing newline */
-
- if ((pattern_from_stdin && (fnmatch(argv[1], line, 0) == 0)) ||
-@@ -301,7 +305,11 @@ hash_indexfile(const char *indexfilename)
- if (!indexfile)
- err(EX_NOINPUT, "Unable to open %s", indexfilename);
-
-+#ifdef _NEWLIB_VERSION
-+ while (__getline(&line, &linecap, indexfile) > 0) {
-+#else
- while (getline(&line, &linecap, indexfile) > 0) {
-+#endif
- /* line is pkgname|portdir|... */
-
- l = line;
-diff --git a/tests/Makefile.am b/tests/Makefile.am
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -2,19 +2,23 @@ AUTOMAKE_OPTIONS= subdir-objects
-
- GENERIC_LDADD= $(top_builddir)/libpkg/libpkg_static.la \
- $(top_builddir)/external/libsbuf_static.la \
-- $(top_builddir)/compat/libbsd_compat.la \
- $(top_builddir)/external/libfetch_static.la \
- @LDNS_LIBS@ \
- @LIBJAIL_LIB@ \
- @OS_LIBS@ \
- -larchive \
-- -lutil \
- -lm \
- -lssl \
- -lcrypto \
- -L/usr/local/lib \
- -latf-c
-
-+if DYNAMIC
-+ GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat.la -lutil
-+else
-+ GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat_static.la
-+endif
-+
- if HAVE_ELF_ABI
- if LIBELF_BUNDLED
- GENERIC_LDADD+= $(top_builddir)/external/libelf_static.la
diff --git a/ports/pkg/pkg_info b/ports/pkg/pkg_info
deleted file mode 100644
index 34b691b..0000000
--- a/ports/pkg/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=pkg
-VERSION=1.6.1
-URL=https://github.com/freebsd/pkg/archive/1.6.1/pkg-1.6.1.tar.gz
-LICENSE="BSD 2-Clause"
-DEPENDS=(glibc-compat zlib libarchive-dev bzip2 xz libtar nacl-spawn libelf libbsd geturl)
-SHA1=e29a0d0926708713916e695ff3ec786aeab83dd6
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/pnacl-binutils-src/build.sh b/ports/pnacl-binutils-src/build.sh
deleted file mode 100644
index 352546f..0000000
--- a/ports/pnacl-binutils-src/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2015 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.
-
-BUILD_DIR=${SRC_DIR}
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- return
-}
-
-InstallStep() {
- return
-}
diff --git a/ports/pnacl-binutils-src/nacl.patch b/ports/pnacl-binutils-src/nacl.patch
deleted file mode 100644
index 58de783..0000000
--- a/ports/pnacl-binutils-src/nacl.patch
+++ /dev/null
@@ -1,383 +0,0 @@
-diff --git a/bfd/configure b/bfd/configure
---- a/bfd/configure
-+++ b/bfd/configure
-@@ -11809,9 +11809,7 @@ if test "${enable_plugins+set}" = set; then :
- enableval=$enable_plugins; case "${enableval}" in
- no) plugins=no ;;
- *) plugins=yes
-- if test "$maybe_plugins" != "yes" ; then
-- as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
-- fi ;;
-+ ;;
- esac
- else
- plugins=$maybe_plugins
-diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
---- a/bfd/elfxx-mips.c
-+++ b/bfd/elfxx-mips.c
-@@ -2161,6 +2161,7 @@ got_page_reloc_p (unsigned int r_type)
- return r_type == R_MIPS_GOT_PAGE || r_type == R_MICROMIPS_GOT_PAGE;
- }
-
-+#if !defined(__native_client__)
- static inline bfd_boolean
- got_ofst_reloc_p (unsigned int r_type)
- {
-@@ -2172,6 +2173,7 @@ got_hi16_reloc_p (unsigned int r_type)
- {
- return r_type == R_MIPS_GOT_HI16 || r_type == R_MICROMIPS_GOT_HI16;
- }
-+#endif
-
- static inline bfd_boolean
- got_lo16_reloc_p (unsigned int r_type)
-diff --git a/bfd/opncls.c b/bfd/opncls.c
---- a/bfd/opncls.c
-+++ b/bfd/opncls.c
-@@ -673,6 +673,9 @@ bfd_openw (const char *filename, const char *target)
- static inline void
- _maybe_make_executable (bfd * abfd)
- {
-+#if defined(__native_client__)
-+ (void) abfd;
-+#else
- /* If the file was open for writing and is now executable,
- make it so. */
- if (abfd->direction == write_direction
-@@ -694,6 +697,7 @@ _maybe_make_executable (bfd * abfd)
- & (buf.st_mode | ((S_IXUSR | S_IXGRP | S_IXOTH) &~ mask))));
- }
- }
-+#endif
- }
-
- /*
-diff --git a/bfd/plugin.c b/bfd/plugin.c
---- a/bfd/plugin.c
-+++ b/bfd/plugin.c
-@@ -28,6 +28,8 @@
- #include <dlfcn.h>
- #elif defined (HAVE_WINDOWS_H)
- #include <windows.h>
-+#elif defined (__native_client__)
-+// Handled inline.
- #else
- #error Unknown how to handle dynamic-load-libraries.
- #endif
-@@ -204,13 +206,19 @@ try_claim (bfd *abfd)
- static int
- try_load_plugin (const char *pname, bfd *abfd)
- {
-+#if !defined(__native_client__)
- void *plugin_handle;
-+#endif
- int tv_size = 4;
- struct ld_plugin_tv tv[tv_size];
- int i;
- ld_plugin_onload onload;
- enum ld_plugin_status status;
-
-+#if defined(__native_client__)
-+ (void) pname;
-+ onload = 0;
-+#else
- plugin_handle = dlopen (pname, RTLD_NOW);
- if (!plugin_handle)
- {
-@@ -221,6 +229,7 @@ try_load_plugin (const char *pname, bfd *abfd)
- onload = dlsym (plugin_handle, "onload");
- if (!onload)
- goto err;
-+#endif
-
- i = 0;
- tv[i].tv_tag = LDPT_MESSAGE;
-@@ -252,7 +261,9 @@ try_load_plugin (const char *pname, bfd *abfd)
- return 1;
-
- err:
-+#if !defined(__native_client__)
- plugin_handle = NULL;
-+#endif
- return 0;
- }
-
-diff --git a/binutils/configure b/binutils/configure
---- a/binutils/configure
-+++ b/binutils/configure
-@@ -11373,9 +11373,7 @@ if test "${enable_plugins+set}" = set; then :
- enableval=$enable_plugins; case "${enableval}" in
- no) plugins=no ;;
- *) plugins=yes
-- if test "$maybe_plugins" != "yes" ; then
-- as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
-- fi ;;
-+ ;;
- esac
- else
- plugins=$maybe_plugins
-diff --git a/gas/configure b/gas/configure
---- a/gas/configure
-+++ b/gas/configure
-@@ -11353,9 +11353,7 @@ if test "${enable_plugins+set}" = set; then :
- enableval=$enable_plugins; case "${enableval}" in
- no) plugins=no ;;
- *) plugins=yes
-- if test "$maybe_plugins" != "yes" ; then
-- as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
-- fi ;;
-+ ;;
- esac
- else
- plugins=$maybe_plugins
-diff --git a/gold/Makefile.in b/gold/Makefile.in
---- a/gold/Makefile.in
-+++ b/gold/Makefile.in
-@@ -563,7 +563,7 @@ incremental_dump_SOURCES = incremental-dump.cc
- incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
- $(LIBINTL_DEP)
-
--incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
-+incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \
- $(THREADSLIB) $(LIBDL)
-
- dwp_SOURCES = dwp.cc
-diff --git a/gold/descriptors.cc b/gold/descriptors.cc
---- a/gold/descriptors.cc
-+++ b/gold/descriptors.cc
-@@ -48,7 +48,7 @@ static inline void
- set_close_on_exec(int fd ATTRIBUTE_UNUSED)
- {
- // @LOCALMOD-SB-BEGIN
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- gold::gold_fatal(_("NaCl gold: unexpected use of fcntl for %d"), fd);
- #else
- // Mingw does not define F_SETFD.
-diff --git a/gold/fileread.cc b/gold/fileread.cc
---- a/gold/fileread.cc
-+++ b/gold/fileread.cc
-@@ -180,7 +180,7 @@ File_read::~File_read()
- if (this->is_descriptor_opened_)
- {
- // @LOCALMOD-SB-BEGIN
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- nacl_file::NaClReleaseFileDescriptor(this->descriptor_);
- #else
- release_descriptor(this->descriptor_, true);
-@@ -205,7 +205,7 @@ File_read::open(const Task* task, const std::string& name)
- this->name_ = name;
-
- // @LOCALMOD-SB-BEGIN
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- this->descriptor_ = nacl_file::NaClOpenFileDescriptor(this->name_.c_str());
- #else
- this->descriptor_ = open_descriptor(-1, this->name_.c_str(),
-@@ -257,7 +257,7 @@ File_read::reopen_descriptor()
- {
-
- // @LOCALMOD-SB-BEGIN
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- this->descriptor_ = nacl_file::NaClOpenFileDescriptor(this->name_.c_str());
- #else
- this->descriptor_ = open_descriptor(this->descriptor_,
-@@ -300,7 +300,7 @@ File_read::release()
- if (this->is_descriptor_opened_)
- {
- // @LOCALMOD-SB-BEGIN
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- nacl_file::NaClReleaseFileDescriptor(this->descriptor_);
- #else
- release_descriptor(this->descriptor_, false);
-diff --git a/gold/main.cc b/gold/main.cc
---- a/gold/main.cc
-+++ b/gold/main.cc
-@@ -137,7 +137,7 @@ write_debug_script(std::string, const char*, const char*)
- // For the in-browser sandboxed build, main() is defined in
- // nacl_file.cc and calls an IRT interface for handling the browser's
- // request. gold_main() is called by that request handler.
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- int
- gold_main(int argc, char** argv)
- #else
-@@ -162,7 +162,7 @@ main(int argc, char** argv)
- // @LOCALMOD-SB: skip this in sandboxed mode since the commandline we
- // build will likely not have @filename (and we can avoid hijacking
- // the file open operation there).
--#if !defined(__native_client__)
-+#if 1 || !defined(__native_client__)
- expandargv(&argc, &argv);
- #endif
-
-@@ -341,7 +341,7 @@ main(int argc, char** argv)
- // @LOCALMOD-SB-BEGIN
- // This function is called from an IPC request handler. We do not
- // want it to exit.
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- return errors.error_count() > 0;
- #else
- // If the user used --noinhibit-exec, we force the exit status to be
-diff --git a/gold/output.cc b/gold/output.cc
---- a/gold/output.cc
-+++ b/gold/output.cc
-@@ -5017,7 +5017,7 @@ Output_file::open(off_t file_size)
- // We let the name "-" mean "stdout"
-
- // @LOCALMOD-SB-BEGIN
--#if defined(__native_client__)
-+#if 0 && defined(__native_client__)
- int o = nacl_file::NaClOpenFileDescriptor(this->name_);
- if (o < 0)
- gold_fatal(_("%s: open: %s"), this->name_, strerror(errno));
-@@ -5037,6 +5037,7 @@ Output_file::open(off_t file_size)
- ::unlink(this->name_);
- else if (!parameters->options().relocatable())
- {
-+#if !defined(__native_client__)
- // If we don't unlink the existing file, add execute
- // permission where read permissions already exist
- // and where the umask permits.
-@@ -5044,6 +5045,7 @@ Output_file::open(off_t file_size)
- ::umask(mask);
- s.st_mode |= (s.st_mode & 0444) >> 2;
- ::chmod(this->name_, s.st_mode & ~mask);
-+#endif
- }
- }
-
-diff --git a/gold/plugin.cc b/gold/plugin.cc
---- a/gold/plugin.cc
-+++ b/gold/plugin.cc
-@@ -33,6 +33,8 @@
- #include <dlfcn.h>
- #elif defined (HAVE_WINDOWS_H)
- #include <windows.h>
-+#elif defined (__native_client__)
-+/* Handled inline. */
- #else
- #error Unknown how to handle dynamic-load-libraries.
- #endif
-@@ -74,6 +76,10 @@ dlerror(void)
- #include "descriptors.h"
- #include "elfcpp.h"
-
-+#if defined(__native_client__)
-+extern "C" ld_plugin_status LLVMgold_onload(ld_plugin_tv *tv);
-+#endif
-+
- namespace gold
- {
-
-@@ -178,6 +184,9 @@ void
- Plugin::load()
- {
- #ifdef ENABLE_PLUGINS
-+#if defined(__native_client__)
-+ ld_plugin_onload onload = ::LLVMgold_onload;
-+#else
- // Load the plugin library.
- // FIXME: Look for the library in standard locations.
- this->handle_ = dlopen(this->filename_.c_str(), RTLD_NOW);
-@@ -199,6 +208,7 @@ Plugin::load()
- ld_plugin_onload onload;
- gold_assert(sizeof(onload) == sizeof(ptr));
- memcpy(&onload, &ptr, sizeof(ptr));
-+#endif
-
- // Get the linker's version number.
- const char* ver = get_version_string();
-diff --git a/gprof/configure b/gprof/configure
---- a/gprof/configure
-+++ b/gprof/configure
-@@ -11283,9 +11283,7 @@ if test "${enable_plugins+set}" = set; then :
- enableval=$enable_plugins; case "${enableval}" in
- no) plugins=no ;;
- *) plugins=yes
-- if test "$maybe_plugins" != "yes" ; then
-- as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
-- fi ;;
-+ ;;
- esac
- else
- plugins=$maybe_plugins
-diff --git a/ld/configure b/ld/configure
---- a/ld/configure
-+++ b/ld/configure
-@@ -15109,14 +15109,14 @@ fi
- done
-
-
-+enable_plugins=no
-+
- # Check whether --enable-plugins was given.
- if test "${enable_plugins+set}" = set; then :
- enableval=$enable_plugins; case "${enableval}" in
- no) plugins=no ;;
- *) plugins=yes
-- if test "$maybe_plugins" != "yes" ; then
-- as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5
-- fi ;;
-+ ;;
- esac
- else
- plugins=$maybe_plugins
-diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
---- a/libiberty/strsignal.c
-+++ b/libiberty/strsignal.c
-@@ -550,6 +550,7 @@ followed by a newline.
-
- #ifndef HAVE_PSIGNAL
-
-+#if !defined(__native_client__)
- void
- psignal (int signo, char *message)
- {
-@@ -566,6 +567,7 @@ psignal (int signo, char *message)
- fprintf (stderr, "%s: %s\n", message, sys_siglist[signo]);
- }
- }
-+#endif
-
- #endif /* ! HAVE_PSIGNAL */
-
-diff --git a/libiberty/vfork.c b/libiberty/vfork.c
---- a/libiberty/vfork.c
-+++ b/libiberty/vfork.c
-@@ -11,6 +11,7 @@ Emulates @code{vfork} by calling @code{fork} and returning its value.
-
- */
-
-+#if !defined(__native_client__)
- #include "ansidecl.h"
-
- extern int fork (void);
-@@ -20,3 +21,4 @@ vfork (void)
- {
- return (fork ());
- }
-+#endif
-diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
---- a/opcodes/mips-dis.c
-+++ b/opcodes/mips-dis.c
-@@ -157,6 +157,7 @@ static const char * const mips_cp0_names_r5900[32] =
- "c0_taglo", "c0_taghi", "c0_errorepc", "$31"
- };
-
-+#if !defined(__native_client__)
- static const struct mips_cp0sel_name mips_cp0sel_names_mipsr5900[] =
- {
- { 24, 2, "c0_iab" },
-@@ -168,6 +169,7 @@ static const struct mips_cp0sel_name mips_cp0sel_names_mipsr5900[] =
- { 25, 1, "c0_perfcnt,1" },
- { 25, 2, "c0_perfcnt,2" }
- };
-+#endif
-
- static const char * const mips_cp0_names_mips3264[32] =
- {
diff --git a/ports/pnacl-binutils-src/pkg_info b/ports/pnacl-binutils-src/pkg_info
deleted file mode 100644
index 8130ad5..0000000
--- a/ports/pnacl-binutils-src/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=pnacl-binutils-src
-VERSION=0.0.1
-ARCHIVE_ROOT=binutils
-URL=https://chromium.googlesource.com/native_client/nacl-binutils.git@d5a23a3
-LICENSE=BSD
diff --git a/ports/pnacl-binutils-x86-src/build.sh b/ports/pnacl-binutils-x86-src/build.sh
deleted file mode 100644
index 352546f..0000000
--- a/ports/pnacl-binutils-x86-src/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2015 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.
-
-BUILD_DIR=${SRC_DIR}
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- return
-}
-
-InstallStep() {
- return
-}
diff --git a/ports/pnacl-binutils-x86-src/pkg_info b/ports/pnacl-binutils-x86-src/pkg_info
deleted file mode 100644
index 3036e27..0000000
--- a/ports/pnacl-binutils-x86-src/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=pnacl-binutils-x86-src
-VERSION=0.0.1
-ARCHIVE_ROOT=binutils
-URL=https://chromium.googlesource.com/native_client/nacl-binutils.git@1d8592c
-LICENSE=BSD
diff --git a/ports/pnacl-clang-src/build.sh b/ports/pnacl-clang-src/build.sh
deleted file mode 100644
index 352546f..0000000
--- a/ports/pnacl-clang-src/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2015 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.
-
-BUILD_DIR=${SRC_DIR}
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- return
-}
-
-InstallStep() {
- return
-}
diff --git a/ports/pnacl-clang-src/nacl.patch b/ports/pnacl-clang-src/nacl.patch
deleted file mode 100644
index ec09e05..0000000
--- a/ports/pnacl-clang-src/nacl.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/tools/libclang/CIndexer.cpp b/tools/libclang/CIndexer.cpp
---- a/tools/libclang/CIndexer.cpp
-+++ b/tools/libclang/CIndexer.cpp
-@@ -37,7 +37,7 @@
-
- #ifdef LLVM_ON_WIN32
- #include <windows.h>
--#else
-+#elif !defined(_NEWLIB_VERSION)
- #include <dlfcn.h>
- #endif
-
-@@ -69,6 +69,8 @@ const std::string &CIndexer::getClangResourcesPath() {
- #endif
-
- LibClangPath += llvm::sys::path::parent_path(path);
-+#elif defined(_NEWLIB_VERSION)
-+ LibClangPath += "";
- #else
- // This silly cast below avoids a C++ warning.
- Dl_info info;
-diff --git a/unittests/Makefile b/unittests/Makefile
---- a/unittests/Makefile
-+++ b/unittests/Makefile
-@@ -10,6 +10,14 @@
- # If CLANG_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
- # are being included from a subdirectory makefile.
-
-+ifeq ($(HOST_OS),NativeClient)
-+all:
-+ echo skipping
-+
-+install:
-+ echo skipping
-+else
-+
- ifndef CLANG_LEVEL
-
- IS_UNITTEST_LEVEL := 1
-@@ -33,3 +41,5 @@ MAKEFILE_UNITTEST_NO_INCLUDE_COMMON := 1
- include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
-
- endif # IS_UNITTEST_LEVEL
-+
-+endif
diff --git a/ports/pnacl-clang-src/pkg_info b/ports/pnacl-clang-src/pkg_info
deleted file mode 100644
index 26dd36f..0000000
--- a/ports/pnacl-clang-src/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=pnacl-clang-src
-VERSION=0.0.1
-ARCHIVE_ROOT=clang
-URL=https://chromium.googlesource.com/native_client/pnacl-clang.git@cf0dc7f
-LICENSE=BSD
diff --git a/ports/pnacl-llvm-src/README.nacl b/ports/pnacl-llvm-src/README.nacl
deleted file mode 100644
index a99f989..0000000
--- a/ports/pnacl-llvm-src/README.nacl
+++ /dev/null
@@ -1,10 +0,0 @@
-This source tree is a pinned revsion of that NaCl llvm repository.
-
-The nacl.patch contains changes needed to make llvm build with
-the nacl and pnacl toolchains.
-
-1. Fix unused symbol errors in Signals.inc
-
-2. Remove inline assembly use of xgetbv instruction
-
-3. Makefile.rules: Don't attempt to build loadable modules when ENABLE_SHARED=0
diff --git a/ports/pnacl-llvm-src/build.sh b/ports/pnacl-llvm-src/build.sh
deleted file mode 100644
index 352546f..0000000
--- a/ports/pnacl-llvm-src/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2015 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.
-
-BUILD_DIR=${SRC_DIR}
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- return
-}
-
-InstallStep() {
- return
-}
diff --git a/ports/pnacl-llvm-src/nacl.patch b/ports/pnacl-llvm-src/nacl.patch
deleted file mode 100644
index a121418..0000000
--- a/ports/pnacl-llvm-src/nacl.patch
+++ /dev/null
@@ -1,410 +0,0 @@
-diff --git a/Makefile.rules b/Makefile.rules
---- a/Makefile.rules
-+++ b/Makefile.rules
-@@ -1200,6 +1200,7 @@ ifdef EXPORTED_SYMBOL_FILE
- $(LibName.SO): $(NativeExportsFile)
- endif
-
-+ifeq ($(ENABLE_SHARED),1)
- ifdef LINK_LIBS_IN_SHARED
- ifdef LOADABLE_MODULE
- SharedLibKindMessage := "Loadable Module"
-@@ -1217,6 +1218,7 @@ $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
- $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
- $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
- endif
-+endif
-
- clean-local::
- ifneq ($(strip $(LibName.SO)),)
-@@ -1239,6 +1241,7 @@ endif
- DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
- DestSharedAlias := $(DestSharedLibDir)/$(BaseAliasName.SO)
-
-+ifeq ($(ENABLE_SHARED),1)
- install-local:: $(DestSharedLib)
-
- $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
-@@ -1257,6 +1260,7 @@ ifdef SHARED_ALIAS
- endif
- endif
- endif
-+endif
-
- #---------------------------------------------------------
- # Library Targets:
-@@ -1265,9 +1269,13 @@ endif
- #---------------------------------------------------------
- ifndef NO_BUILD_ARCHIVE
- ifndef BUILD_ARCHIVE
-+ifeq ($(ENABLE_SHARED),1)
- ifndef LOADABLE_MODULE
- BUILD_ARCHIVE = 1
- endif
-+else
-+BUILD_ARCHIVE = 1
-+endif
- endif
- endif
-
-diff --git a/include/llvm/Support/TargetRegistry.h b/include/llvm/Support/TargetRegistry.h
---- a/include/llvm/Support/TargetRegistry.h
-+++ b/include/llvm/Support/TargetRegistry.h
-@@ -814,7 +814,7 @@ namespace llvm {
- // @LOCALMOD-BEGIN
- // Prune out the .s printer for the sandboxed translator,
- // by preventing an InstPrinter from being used at all.
-- #if !defined(__native_client__)
-+ #if !defined(PNACL_BROWSER_TRANSLATOR)
- T.MCInstPrinterCtorFn = Fn;
- #endif
- // @LOCALMOD-END
-diff --git a/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp b/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
---- a/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
-+++ b/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
-@@ -34,7 +34,8 @@ RTDyldMemoryManager::~RTDyldMemoryManager() {}
-
- // Determine whether we can register EH tables.
- #if (defined(__GNUC__) && !defined(__ARM_EABI__) && !defined(__ia64__) && \
-- !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__))
-+ !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
-+ !defined(__pnacl__))
- #define HAVE_EHTABLE_SUPPORT 1
- #else
- #define HAVE_EHTABLE_SUPPORT 0
-diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp
---- a/lib/Support/Host.cpp
-+++ b/lib/Support/Host.cpp
-@@ -183,7 +183,7 @@ static bool GetX86CpuIDAndInfoEx(unsigned value, unsigned subleaf,
- }
-
- static bool GetX86XCR0(unsigned *rEAX, unsigned *rEDX) {
--#if defined(__GNUC__)
-+#if defined(__GNUC__) && !defined(__native_client__)
- // Check xgetbv; this uses a .byte sequence instead of the instruction
- // directly because older assemblers do not include support for xgetbv and
- // there is no easy way to conditionally compile based on the assembler used.
-diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
---- a/lib/Support/Unix/Path.inc
-+++ b/lib/Support/Unix/Path.inc
-@@ -67,7 +67,8 @@ namespace sys {
- namespace fs {
- #if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
- defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__) || \
-- defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__)
-+ defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__) || \
-+ defined(__native_client__)
- static int
- test_dir(char ret[PATH_MAX], const char *dir, const char *bin)
- {
-@@ -171,6 +172,11 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) {
- // @LOCALMOD-BEGIN
- #elif defined(__native_client__)
- // Nothing.
-+#if !defined(PNACL_BROWSER_TRANSLATOR)
-+ char exe_path[MAXPATHLEN];
-+ if (getprogpath(exe_path, argv0) != NULL)
-+ return exe_path;
-+#endif
- // @LOCALMOD-END
- #else
- #error GetMainExecutable is not implemented on this host yet.
-@@ -192,13 +198,13 @@ std::error_code current_path(SmallVectorImpl<char> &result) {
- result.clear();
- // @LOCALMOD-START NaCl doesn't have paths, and the translator returns an
- // error for getcwd below. Return a dummy path instead.
--#if defined(__native_client__)
-+#if defined(PNACL_BROWSER_TRANSLATOR)
- result.reserve(2);
- result.set_size(2);
- result[0] = '/';
- result[1] = '\0';
- return std::error_code();
--#else // !defined(__native_client__)
-+#else // !defined(PNACL_BROWSER_TRANSLATOR)
- // @LOCALMOD-END
- const char *pwd = ::getenv("PWD");
- llvm::sys::fs::file_status PWDStatus, DotStatus;
-diff --git a/lib/Support/Unix/Process.inc b/lib/Support/Unix/Process.inc
---- a/lib/Support/Unix/Process.inc
-+++ b/lib/Support/Unix/Process.inc
-@@ -61,7 +61,9 @@ using namespace llvm;
- using namespace sys;
-
- static std::pair<TimeValue, TimeValue> getRUsageTimes() {
--#if defined(HAVE_GETRUSAGE)
-+// @LOCALMOD-BEGIN
-+#if defined(HAVE_GETRUSAGE) && !defined(__native_client__)
-+// @LOCALMOD-END
- struct rusage RU;
- ::getrusage(RUSAGE_SELF, &RU);
- return std::make_pair(
-diff --git a/lib/Support/Unix/Program.inc b/lib/Support/Unix/Program.inc
---- a/lib/Support/Unix/Program.inc
-+++ b/lib/Support/Unix/Program.inc
-@@ -16,6 +16,11 @@
- //=== is guaranteed to work on *all* UNIX variants.
- //===----------------------------------------------------------------------===//
-
-+// @LOCALMOD-BEGIN
-+#if defined(__native_client__) && !defined(PNACL_BROWSER_TRANSLATOR)
-+#include <spawn.h>
-+#endif
-+// @LOCALMOD-END
- #include "Unix.h"
- #include "llvm/ADT/StringExtras.h"
- #include "llvm/Config/config.h"
-@@ -187,6 +192,15 @@ static bool Execute(ProcessInfo &PI, StringRef Program, const char **args,
- return false;
- }
-
-+// @LOCALMOD-BEGIN
-+#if defined(__native_client__) && !defined(PNACL_BROWSER_TRANSLATOR)
-+ int child = spawnve(P_NOWAIT, Program.begin(), (char**) args, (char**) envp);
-+ if (child < 0) {
-+ MakeErrMsg(ErrMsg, "Couldn't spawn");
-+ return false;
-+ }
-+#else
-+// @LOCALMOD-END
- // If this OS has posix_spawn and there is no memory limit being implied, use
- // posix_spawn. It is more efficient than fork/exec.
- #ifdef HAVE_POSIX_SPAWN
-@@ -312,6 +326,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program, const char **args,
- default:
- break;
- }
-+#endif
-
- PI.Pid = child;
-
-@@ -324,8 +339,10 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
- bool WaitUntilTerminates, std::string *ErrMsg) {
- // @LOCALMOD-BEGIN
- #if defined(HAVE_SYS_WAIT_H) && !defined(PNACL_BROWSER_TRANSLATOR)
-- // @LOCALMOD-END
-+#if !defined(__native_client__)
- struct sigaction Act, Old;
-+#endif
-+ // @LOCALMOD-END
- assert(PI.Pid && "invalid pid to wait on, process not started?");
-
- int WaitPidOptions = 0;
-@@ -333,6 +350,9 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
- if (WaitUntilTerminates) {
- SecondsToWait = 0;
- } else if (SecondsToWait) {
-+// @LOCALMOD-BEGIN
-+#if !defined(__native_client__)
-+// @LOCALMOD-END
- // Install a timeout handler. The handler itself does nothing, but the
- // simple fact of having a handler at all causes the wait below to return
- // with EINTR, unlike if we used SIG_IGN.
-@@ -341,6 +361,9 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
- sigemptyset(&Act.sa_mask);
- sigaction(SIGALRM, &Act, &Old);
- alarm(SecondsToWait);
-+// @LOCALMOD-BEGIN
-+#endif
-+// @LOCALMOD-END
- } else if (SecondsToWait == 0)
- WaitPidOptions = WNOHANG;
-
-@@ -358,12 +381,18 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
- return WaitResult;
- } else {
- if (SecondsToWait && errno == EINTR) {
-+// @LOCALMOD-BEGIN
-+#if !defined(__native_client__)
-+// @LOCALMOD-END
- // Kill the child.
- kill(PI.Pid, SIGKILL);
-
- // Turn off the alarm and restore the signal handler
- alarm(0);
- sigaction(SIGALRM, &Old, nullptr);
-+// @LOCALMOD-BEGIN
-+#endif
-+// @LOCALMOD-END
-
- // Wait for child to die
- if (wait(&status) != ChildPid)
-@@ -381,11 +410,17 @@ ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
- }
- }
-
-+// @LOCALMOD-BEGIN
-+#if !defined(__native_client__)
-+// @LOCALMOD-END
- // We exited normally without timeout, so turn off the timer.
- if (SecondsToWait && !WaitUntilTerminates) {
- alarm(0);
- sigaction(SIGALRM, &Old, nullptr);
- }
-+// @LOCALMOD-BEGIN
-+#endif
-+// @LOCALMOD-END
-
- // Return the proper exit status. Detect error conditions
- // so we can return -1 for them and set ErrMsg informatively.
-@@ -455,11 +490,13 @@ llvm::sys::writeFileWithEncoding(StringRef FileName, StringRef Contents,
- }
-
- bool llvm::sys::argumentsFitWithinSystemLimits(ArrayRef<const char*> Args) {
-+// @LOCALMOD-BEGIN
- #if defined(__native_client__)
- static long ArgMax = -1;
- #else // !__native_client__
- static long ArgMax = sysconf(_SC_ARG_MAX);
- #endif // __native_client__
-+// @LOCALMOD-END
-
- // System says no practical limit.
- if (ArgMax == -1)
-diff --git a/lib/Support/Unix/Signals.inc b/lib/Support/Unix/Signals.inc
---- a/lib/Support/Unix/Signals.inc
-+++ b/lib/Support/Unix/Signals.inc
-@@ -50,7 +50,9 @@
-
- using namespace llvm;
-
-+#if !defined(__native_client__)
- static RETSIGTYPE SignalHandler(int Sig); // defined below.
-+#endif
-
- static ManagedStatic<SmartMutex<true> > SignalsMutex;
-
-@@ -121,15 +123,15 @@ static void RegisterHandlers() {
- for (auto S : KillSigs) RegisterHandler(S);
- }
-
--static void UnregisterHandlers() {
- #if !defined(__native_client__)
-+static void UnregisterHandlers() {
- // Restore all of the signal handlers to how they were before we showed up.
- for (unsigned i = 0, e = NumRegisteredSignals; i != e; ++i)
- sigaction(RegisteredSignalInfo[i].SigNo,
- &RegisteredSignalInfo[i].SA, nullptr);
- NumRegisteredSignals = 0;
--#endif // (__native_client__)
- }
-+#endif // (__native_client__)
-
-
- /// RemoveFilesToRemove - Process the FilesToRemove list. This function
-@@ -164,6 +166,7 @@ static void RemoveFilesToRemove() {
- }
- }
-
-+#if !defined(__native_client__)
- // SignalHandler - The signal handler that runs.
- static RETSIGTYPE SignalHandler(int Sig) {
- // Restore the signal behavior to default, so that the program actually
-@@ -172,12 +175,10 @@ static RETSIGTYPE SignalHandler(int Sig) {
- // instead of recursing in the signal handler.
- UnregisterHandlers();
-
--#if !defined(__native_client__)
- // Unmask all potentially blocked kill signals.
- sigset_t SigMask;
- sigfillset(&SigMask);
- sigprocmask(SIG_UNBLOCK, &SigMask, nullptr);
--#endif
-
- {
- unique_lock<SmartMutex<true>> Guard(*SignalsMutex);
-@@ -214,6 +215,7 @@ static RETSIGTYPE SignalHandler(int Sig) {
- raise(Sig);
- #endif
- }
-+#endif
-
- void llvm::sys::RunInterruptHandlers() {
- sys::SmartScopedLock<true> Guard(*SignalsMutex);
-diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
---- a/tools/gold/gold-plugin.cpp
-+++ b/tools/gold/gold-plugin.cpp
-@@ -154,14 +154,20 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
- static ld_plugin_status all_symbols_read_hook(void);
- static ld_plugin_status cleanup_hook(void);
-
-+// @LOCALMOD-BEGIN
-+#if defined(__native_client__)
-+extern "C" ld_plugin_status LLVMgold_onload(ld_plugin_tv *tv);
-+ld_plugin_status LLVMgold_onload(ld_plugin_tv *tv) {
-+#else
- extern "C" ld_plugin_status onload(ld_plugin_tv *tv);
- ld_plugin_status onload(ld_plugin_tv *tv) {
-+#endif
-+// @LOCALMOD-END
- InitializeAllTargetInfos();
- InitializeAllTargets();
- InitializeAllTargetMCs();
- InitializeAllAsmParsers();
- InitializeAllAsmPrinters();
--
- // We're given a pointer to the first transfer vector. We read through them
- // until we find one where tv_tag == LDPT_NULL. The REGISTER_* tagged values
- // contain pointers to functions that we need to call to register our own
-diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
---- a/tools/lli/lli.cpp
-+++ b/tools/lli/lli.cpp
-@@ -386,7 +386,15 @@ static void addCygMingExtraModule(ExecutionEngine *EE,
- //===----------------------------------------------------------------------===//
- // main Driver function
- //
-+// @LOCALMOD-BEGIN
-+#if defined(__native_client__)
-+extern char **environ;
-+int main(int argc, char **argv) {
-+ char * const *envp = environ;
-+#else
- int main(int argc, char **argv, char * const *envp) {
-+#endif
-+// @LOCALMOD-END
- sys::PrintStackTraceOnErrorSignal();
- PrettyStackTraceProgram X(argc, argv);
-
-diff --git a/unittests/Bitcode/NaClMungeWriteErrorTests.cpp b/unittests/Bitcode/NaClMungeWriteErrorTests.cpp
---- a/unittests/Bitcode/NaClMungeWriteErrorTests.cpp
-+++ b/unittests/Bitcode/NaClMungeWriteErrorTests.cpp
-@@ -180,6 +180,7 @@ TEST(NaClMungeWriteErrorTests, CantWriteBadAbbrevIndex) {
- ExpectedDumpedBitcode);
- }
-
-+#ifdef GTEST_HAS_DEATH_TEST
- // Show that writing out an illegal abbreviation index, causes the
- // parser to fail.
- TEST(MyNaClMungerWriteErrorTests, DieOnWriteBadAbbreviationIndex) {
-@@ -199,6 +200,7 @@ TEST(MyNaClMungerWriteErrorTests, DieOnWriteBadAbbreviationIndex) {
- "LLVM ERROR\\: Unable to continue"
- ".*");
- }
-+#endif
-
- // Show what happens when we use more local abbreviations than specified in the
- // corresponding enclosing block.
-diff --git a/unittests/Makefile b/unittests/Makefile
---- a/unittests/Makefile
-+++ b/unittests/Makefile
-@@ -7,6 +7,14 @@
- #
- ##===----------------------------------------------------------------------===##
-
-+ifeq ($(HOST_OS),NativeClient)
-+all:
-+ echo skipping
-+
-+install:
-+ echo skipping
-+else
-+
- LEVEL = ..
-
- PARALLEL_DIRS = ADT Analysis Bitcode CodeGen DebugInfo ExecutionEngine IR \
-@@ -17,3 +25,5 @@ include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
-
- clean::
- $(Verb) $(RM) -f *Tests
-+
-+endif
diff --git a/ports/pnacl-llvm-src/pkg_info b/ports/pnacl-llvm-src/pkg_info
deleted file mode 100644
index 2a3c12b..0000000
--- a/ports/pnacl-llvm-src/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=pnacl-llvm-src
-VERSION=0.0.1
-ARCHIVE_ROOT=llvm
-URL=https://chromium.googlesource.com/native_client/pnacl-llvm.git@1ac309a
-LICENSE=BSD
diff --git a/ports/pnacl/build.sh b/ports/pnacl/build.sh
deleted file mode 100644
index 60d1937..0000000
--- a/ports/pnacl/build.sh
+++ /dev/null
@@ -1,250 +0,0 @@
-# Copyright (c) 2013 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.
-
-EnableGlibcCompat
-EnableCliMain
-
-PatchStep() {
- DefaultPatchStep
- MakeDir ${SRC_DIR}/toolchain_build/src
- Remove ${SRC_DIR}/toolchain_build/src/llvm
- LogExecute ln -fs ${SRC_DIR}/../../pnacl-llvm-src/llvm \
- ${SRC_DIR}/toolchain_build/src/llvm
- Remove ${SRC_DIR}/toolchain_build/src/binutils
- LogExecute ln -fs ${SRC_DIR}/../../pnacl-binutils-src/binutils \
- ${SRC_DIR}/toolchain_build/src/binutils
- Remove ${SRC_DIR}/toolchain_build/src/clang
- LogExecute ln -fs ${SRC_DIR}/../../pnacl-clang-src/clang \
- ${SRC_DIR}/toolchain_build/src/clang
- Remove ${SRC_DIR}/toolchain_build/src/llvm/tools/clang
- LogExecute ln -fs ${SRC_DIR}/../../pnacl-clang-src/clang \
- ${SRC_DIR}/toolchain_build/src/llvm/tools/clang
- Remove ${SRC_DIR}/toolchain_build/src/binutils-x86
- LogExecute ln -fs ${SRC_DIR}/../../pnacl-binutils-x86-src/binutils \
- ${SRC_DIR}/toolchain_build/src/binutils-x86
-}
-
-ConfigureStep() {
- return
-}
-
-OUT_DIR=${BUILD_DIR}/out
-OUT_INSTALL=${BUILD_DIR}/install
-
-BuildStep() {
- PNACL_DIR=${NACL_SDK_ROOT}/toolchain/linux_pnacl
- export PATH=${PNACL_DIR}/bin:${PATH}
- export LD_LIBRARY_PATH=${PNACL_DIR}/lib:${LD_LIBRARY_PATH:-}
- export BUILD_CC=clang
- export BUILD_CXX=clang++
-
- export STRIPPROG=echo
-
- export HOST_OS=NativeClient
- export KEEP_SYMBOLS=1
-
- GOLD_LDADD="--with-gold-ldadd="
- GOLD_LDADD+=" -Wl,--undefined=LLVMgold_onload"
- GOLD_LDADD+=" -L%(abs_llvm_le32_nacl)s/lib"
- # TODO(bradnelson): Apply llvm-config to pick this list.
- GOLD_LDADD+=" -Wl,--start-group"
- GOLD_LDADD+=" -lLLVMgold -lLLVMCodeGen -lLTO -lLLVMX86Disassembler"
- GOLD_LDADD+=" -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc"
- GOLD_LDADD+=" -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils"
- GOLD_LDADD+=" -lLLVMARMDisassembler -lLLVMARMCodeGen"
- GOLD_LDADD+=" -lLLVMNaClTransforms"
- GOLD_LDADD+=" -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo"
- GOLD_LDADD+=" -lLLVMARMAsmPrinter -lLLVMMipsDisassembler -lLLVMMipsCodeGen"
- GOLD_LDADD+=" -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen"
- GOLD_LDADD+=" -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo"
- GOLD_LDADD+=" -lLLVMMipsAsmPrinter -lLLVMMCDisassembler -lLLVMLTO"
- GOLD_LDADD+=" -lLLVMMCParser -lLLVMLinker -lLLVMipo -lLLVMObjCARCOpts"
- GOLD_LDADD+=" -lLLVMVectorize -lLLVMScalarOpts -lLLVMInstCombine"
- GOLD_LDADD+=" -lLLVMJSBackendCodeGen -lLLVMJSBackendDesc -lLLVMJSBackendInfo"
- GOLD_LDADD+=" -lLLVMTransformUtils -lLLVMipa -lLLVMBitWriter"
- GOLD_LDADD+=" -lLLVMBitReader -lLLVMAnalysis -lLLVMTarget -lLLVMMC"
- GOLD_LDADD+=" -lLLVMObject -lLLVMCore -lLLVMSupport"
- GOLD_LDADD+=" -Wl,--end-group"
-
- EXTRA_CONFIGURE="--extra-configure-arg=--disable-compiler-version-checks"
- EXTRA_CONFIGURE+=" --extra-configure-arg=--enable-libcpp"
- # Without this configure will detect vfork as missing and define
- # vfork to fork which clobbers that define in "spawn.h".
- EXTRA_CONFIGURE+=" --extra-configure-arg=ac_cv_func_vfork_works=yes"
- EXTRA_CONFIGURE+=" --extra-configure-arg=ac_cv_func_getrusage=no"
- if [[ ${NACL_DEBUG} == 1 ]]; then
- EXTRA_CONFIGURE+=" --host-flavor=debug"
- fi
-
- # Some code in llvm uses intrisics not supported in the pnacl stable abi.
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- EXTRA_CC_ARGS="-fgnu-inline-asm"
- EXTRA_CC_ARGS+=" --pnacl-disable-abi-check"
- fi
- if [[ ${TOOLCHAIN} != glibc ]]; then
- EXTRA_CC_ARGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
- fi
-
- EXTRA_CC_ARGS+=" -include spawn.h"
- EXTRA_CC_ARGS+=" -I${NACL_SDK_ROOT}/include"
- EXTRA_CC_ARGS+=" -I${NACLPORTS_INCLUDE}"
-
- # export WEBPORTS_EXTRA_LIBS so that compiler_wapper.py can access it
- export WEBPORTS_EXTRA_LIBS="${NACLPORTS_LDFLAGS} ${NACLPORTS_LIBS}"
- echo "WEBPORTS_EXTRA_LIBS=${WEBPORTS_EXTRA_LIBS}"
-
- # Inject a shim that speed up pnacl invocations for configure.
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- local PNACL_CONF_SHIM="${TOOLS_DIR}/pnacl-configure-shim.py"
- NACLCC="${PNACL_CONF_SHIM} ${NACLCC}"
- NACLCXX="${PNACL_CONF_SHIM} ${NACLCXX}"
- fi
-
- NACLCC="${START_DIR}/compiler_wrapper.py ${NACLCC}"
- NACLCXX="${START_DIR}/compiler_wrapper.py ${NACLCXX}"
-
- Remove ${OUT_INSTALL}
- MakeDir ${OUT_INSTALL}
-
- export CC=${NACLCC}
- export CXX=${NACLCXX}
- export AR=${NACLAR}
- export RANLIB=${NACLRANLIB}
- LogExecute ${SRC_DIR}/toolchain_build/toolchain_build_pnacl.py -v \
- --no-use-cached-results \
- --no-use-remote-cache \
- --no-annotator \
- --pnacl-in-pnacl \
- --output=${OUT_DIR} \
- --install=${OUT_INSTALL} \
- "--extra-cc-args=${EXTRA_CC_ARGS}" \
- ${EXTRA_CONFIGURE} \
- "--binutils-pnacl-extra-configure=${GOLD_LDADD}"
-
- CreateHybridToolchain
-}
-
-CreateHybridToolchain() {
- Banner "Creating Hybrid Toolchain"
-
- # Build a full toolchain based on the one in NACL_SDK_ROOT, but overlayed
- # with the one we just compiled.
- Remove toolchain
- MakeDir toolchain
-
- host_toolchain=${NACL_SDK_ROOT}/toolchain/linux_pnacl
- LogExecute cp -r ${host_toolchain}/* toolchain
-
- # Drop pyc files.
- LogExecute find toolchain -name "*.pyc" -exec rm {} \;
-
- # Overlay compiled toolchain
- Remove ${OUT_INSTALL}/x86_64-nacl/lib/32
- Remove ${OUT_INSTALL}/x86_64-nacl/lib64
- LogExecute cp -r ${OUT_INSTALL}/* toolchain/
-
- # Rename the nacl executables.
- for f in $(cd ${host_toolchain} && find . -executable -type f); do
- if [[ "$(file ${host_toolchain}/${f} | grep ELF)" != "" \
- && ${f} != *pnacl-abicheck ]]; then
- # We are dealing with an executable
- local built_exe="${OUT_INSTALL}/${f}"
- local exe="toolchain/${f}"
- if [[ -f ${built_exe} ]]; then
- LogExecute mv ${exe} ${exe}${NACL_EXEEXT}
- elif [[ $f == *-clang* ]]; then
- Remove ${exe}
- LogExecute ln -sf clang${NACL_EXEEXT} ${exe}${NACL_EXEEXT}
- else
- echo "Warning: dropping ${f} without a nacl replacement."
- LogExecute rm -f ${exe}
- fi
- fi
- done
-
- # Now create launcher scripts for each executable
- for f in toolchain/bin/*${NACL_EXEEXT}; do
- script=${f%.*}
- if [[ ${TOOLCHAIN} == pnacl ]]; then
- TranslateAndWriteLauncherScript "${f}" x86-64 "${script}.nexe" "${script}"
- else
- WriteLauncherScript "${script}" "$(basename ${f})"
- fi
- done
-
- # Drop parts we don't care about
- LogExecute rm -rf toolchain/translator
- LogExecute rm -rf toolchain/mipsel-nacl
- LogExecute rm -rf toolchain/*-nacl/usr
- LogExecute rm -f toolchain/bin/mipsel-*
- LogExecute rm -f toolchain/lib/*.so
-}
-
-InstallStep() {
- local INSTALL_DIR=${DESTDIR}/${PREFIX}/pnacl
- Remove ${INSTALL_DIR}/
- MakeDir ${INSTALL_DIR}/
-
- LogExecute cp -r toolchain/* ${INSTALL_DIR}
- for f in $(find ${INSTALL_DIR} -type l -name *-clang*${NACL_EXEEXT}); do
- # link to clang binary
- Remove $f ${f%.*}
- LogExecute ln -s clang ${f%.*}
- done
- for f in $(find ${INSTALL_DIR} -executable -type f -name *${NACL_EXEEXT}); do
- LogExecute mv $f ${f%.*}
- done
-}
-
-TestStep() {
- # Verify that binaries at least load under sel_ldr
- LogExecute toolchain/bin/le32-nacl-strings --version
- LogExecute toolchain/bin/arm-nacl-readelf --version
- LogExecute toolchain/bin/x86_64-nacl-as --version
- LogExecute toolchain/bin/clang --version
-
- # The end-to-end tests doesn't currently work for PNaCl
- if [[ $TOOLCHAIN == pnacl ]]; then
- return
- fi
- TestNaClClang
-}
-
-TestNaClClang() {
- # Try compiling and running a simple hello world program. We have to
- # use explicit compile, assemble and link commands since sel_ldr doesn't
- # provide fork().
-
- compile_command="toolchain/bin/x86_64-nacl-clang -cc1 -triple x86_64--nacl
- -S -disable-free -main-file-name ${START_DIR}/hello.c -mrelocation-model
- static -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as
- -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
- -target-linker-version 2.24 -v -dwarf-column-info
- -resource-dir $PWD/toolchain/bin/../lib/clang/3.7.0
- -internal-isystem $PWD/toolchain/bin/../lib/clang/3.7.0/include
- -internal-isystem $PWD/toolchain/bin/../x86_64-nacl/usr/include
- -internal-isystem $PWD/toolchain/bin/../x86_64-nacl/include
- -fno-dwarf-directory-asm -ferror-limit 19 -fmessage-length 0 -mstackrealign
- -fobjc-runtime=gcc -fdiagnostics-show-option -o hello.s -x c
- ${START_DIR}/hello.c
- "
- LogExecute $compile_command
-
- LogExecute toolchain/bin/x86_64-nacl-as --64 hello.s -o hello.o
- link_command="toolchain/x86_64-nacl/bin/ld --build-id -m
- elf_x86_64_nacl -static -o hello.nexe
- $PWD/toolchain/bin/../x86_64-nacl/lib/crt1.o
- $PWD/toolchain/bin/../x86_64-nacl/lib/crti.o
- $PWD/toolchain/bin/../lib/clang/3.7.0/lib/x86_64-nacl/crtbeginT.o
- -L$PWD/toolchain/bin/../x86_64-nacl/lib
- -L$PWD/toolchain/bin/../x86_64-nacl/usr/lib
- -L$PWD/toolchain/bin/../lib/clang/3.7.0/lib/x86_64-nacl
- ./hello.o --start-group -lc -lgcc --as-needed -lgcc_eh --no-as-needed
- --end-group
- $PWD/toolchain/bin/../lib/clang/3.7.0/lib/x86_64-nacl/crtend.o
- $PWD/toolchain/bin/../x86_64-nacl/lib/crtn.o
- "
- LogExecute $link_command
- RunSelLdrCommand hello.nexe
-}
diff --git a/ports/pnacl/compiler_wrapper.py b/ports/pnacl/compiler_wrapper.py
deleted file mode 100755
index b1ce27e..0000000
--- a/ports/pnacl/compiler_wrapper.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2016 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.
-
-"""Compiler wrapper for injecting extra libs at the end of the link
-line.
-
-This is used rather than just setting LDFLAGS/LIBS becuase setting
-LIBS/LDFLAGS will effect both host and target builds.
-"""
-
-import os
-import subprocess
-import sys
-
-cmd = sys.argv[1:]
-
-is_configuring = 'conftest.c' in cmd or 'conftest.pexe' in cmd
-is_linking = '-c' not in cmd and '-E' not in cmd
-is_shared = '-shared' in cmd
-
-# Add extra libs when linking executables
-if is_linking and not is_shared:
- cmd += os.environ['WEBPORTS_EXTRA_LIBS'].split()
-
-if is_configuring:
- cmd.remove('-include')
- cmd.remove('spawn.h')
-
-sys.exit(subprocess.call(cmd))
diff --git a/ports/pnacl/hello.c b/ports/pnacl/hello.c
deleted file mode 100644
index 2bbd671..0000000
--- a/ports/pnacl/hello.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2016 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.
- */
-
-/* Simple hello world test program for compiler smoketest */
-
-#include <stdio.h>
-
-int main() {
- printf("Hello, world!\n");
- return 0;
-}
diff --git a/ports/pnacl/nacl.patch b/ports/pnacl/nacl.patch
deleted file mode 100644
index 3d817af..0000000
--- a/ports/pnacl/nacl.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-diff --git a/toolchain_build/toolchain_build_pnacl.py b/toolchain_build/toolchain_build_pnacl.py
---- a/toolchain_build/toolchain_build_pnacl.py
-+++ b/toolchain_build/toolchain_build_pnacl.py
-@@ -191,29 +191,31 @@ binaries themselves should be considered inputs for memoization.
- # Return a tuple (C compiler, C++ compiler, ar, ranlib) of the compilers and
- # tools to compile the host toolchains.
- def CompilersForHost(host):
-- compiler = {
-+ rtn = {
- # For now we only do native builds for linux and mac
- # treat 32-bit linux like a native build
-- 'i686-linux': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'),
-- 'x86_64-linux': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'),
-- 'x86_64-apple-darwin': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'),
-+ 'i686-linux': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'],
-+ 'x86_64-linux': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'],
-+ 'x86_64-apple-darwin': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'],
- # Windows build should work for native and cross
-- 'i686-w64-mingw32': (
-- 'i686-w64-mingw32-gcc', 'i686-w64-mingw32-g++', 'ar', 'ranlib'),
-+ 'i686-w64-mingw32': [
-+ 'i686-w64-mingw32-gcc', 'i686-w64-mingw32-g++', 'ar', 'ranlib'],
- # TODO: add arm-hosted support
-- 'i686-pc-cygwin': ('gcc', 'g++', 'ar', 'ranlib'),
-- }
-- if host == 'le32-nacl':
-- nacl_sdk = os.environ.get('NACL_SDK_ROOT')
-- assert nacl_sdk, 'NACL_SDK_ROOT not set'
-- pnacl_bin_dir = os.path.join(nacl_sdk, 'toolchain/linux_pnacl/bin')
-- compiler.update({
-- 'le32-nacl': (os.path.join(pnacl_bin_dir, 'pnacl-clang'),
-- os.path.join(pnacl_bin_dir, 'pnacl-clang++'),
-- os.path.join(pnacl_bin_dir, 'pnacl-ar'),
-- os.path.join(pnacl_bin_dir, 'pnacl-ranlib')),
-- })
-- return compiler[host]
-+ 'i686-pc-cygwin': ['gcc', 'g++', 'ar', 'ranlib'],
-+ 'le32-nacl': ['pnacl-clang', 'pnacl-clang++', 'pnacl-ar', 'pnacl-ranlib'],
-+ }[host]
-+
-+ # Allow caller to override host toolchain
-+ if 'CC' in os.environ:
-+ rtn[0] = os.environ['CC']
-+ if 'CXX' in os.environ:
-+ rtn[1] = os.environ['CXX']
-+ if 'AR' in os.environ:
-+ rtn[2] = os.environ['AR']
-+ if 'RANLIB' in os.environ:
-+ rtn[3] = os.environ['RANLIB']
-+
-+ return rtn
-
- def AflFuzzCompilers(afl_fuzz_dir):
- """Returns the AFL (clang) compiler executables, assuming afl_fuzz_dir
-@@ -677,10 +679,12 @@ def HostTools(host, options):
- # [-Werror,-Wshift-negative-value]
- binutils_do_werror = False
- extra_gold_deps = []
-+ install_step = 'install-strip'
- if host == 'le32-nacl':
- # TODO(bradnelson): Fix warnings so this can go away.
- binutils_do_werror = False
- extra_gold_deps = [H('llvm')]
-+ install_step = 'install'
-
- # The binutils git checkout includes all the directories in the
- # upstream binutils-gdb.git repository, but some of these
-@@ -730,7 +734,7 @@ def HostTools(host, options):
- '--without-gas'
- ])] + DummyDirCommands(binutils_dummy_dirs) + [
- command.Command(MakeCommand(host)),
-- command.Command(MAKE_DESTDIR_CMD + ['install-strip'])] +
-+ command.Command(MAKE_DESTDIR_CMD + [install_step])] +
- [command.RemoveDirectory(os.path.join('%(output)s', dir))
- for dir in ('lib', 'lib32')] +
- # Since it has dual use, just create links for both sets of names
-@@ -1033,6 +1037,9 @@ def HostToolsDirectToNacl(host, options):
- binutils_flags, binutils_inputs, binutils_deps = ConfigureBinutilsCommon(
- host, options, False)
- redirect_inputs.update(binutils_inputs)
-+ install_step = 'install-strip'
-+ if host == 'le32-nacl':
-+ install_step = 'install'
- tools.update({
- H('binutils_x86'): {
- 'type': 'build',
-@@ -1049,7 +1056,7 @@ def HostToolsDirectToNacl(host, options):
- '--enable-targets=x86_64-nacl,i686-nacl',
- '--disable-werror']),
- command.Command(MakeCommand(host)),
-- command.Command(MAKE_DESTDIR_CMD + ['install-strip'])] +
-+ command.Command(MAKE_DESTDIR_CMD + [install_step])] +
- # Remove the share dir from this binutils build and leave the one
- # from the newer version used for bitcode linking. Always remove
- # the lib dirs, which have unneeded host libs.
-@@ -1311,7 +1318,7 @@ def main():
- packages.update(HostTools(host, args))
- if not args.pnacl_in_pnacl:
- packages.update(HostLibs(host, args))
-- packages.update(HostToolsDirectToNacl(host, args))
-+ packages.update(HostToolsDirectToNacl(host, args))
- if not args.pnacl_in_pnacl:
- packages.update(TargetLibCompiler(pynacl.platform.PlatformTriple(), args))
- # Don't build the target libs on Windows because of pathname issues.
diff --git a/ports/pnacl/pkg_info b/ports/pnacl/pkg_info
deleted file mode 100644
index 54b0b62..0000000
--- a/ports/pnacl/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=pnacl
-VERSION=0.0.1
-ARCHIVE_ROOT=native_client
-URL=https://chromium.googlesource.com/native_client/src/native_client.git@642939f
-LICENSE=BSD
-DEPENDS=(glibc-compat nacl-spawn pnacl-clang-src pnacl-binutils-src pnacl-llvm-src pnacl-binutils-x86-src)
-# x86 glibc toolchain is too old to build clang
-# arm glibc fails with unrecognized command line option ‘-stdlib=libc++’
-DISABLED_TOOLCHAIN=(glibc emscripten)
diff --git a/ports/poly2tri/CMakeLists.txt b/ports/poly2tri/CMakeLists.txt
deleted file mode 100644
index 3dbc0e3..0000000
--- a/ports/poly2tri/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2015 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.
-cmake_minimum_required(VERSION 2.8)
-INCLUDE_DIRECTORIES(./poly2tri ./poly2tri/common ./poly2tri/sweep)
-FILE(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/poly2tri/*.cc)
-ADD_LIBRARY(poly2tri ${sources})
-SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
-INSTALL(TARGETS poly2tri ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
-SET(HEADER_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
-INSTALL(DIRECTORY poly2tri DESTINATION "${HEADER_INSTALL_DIR}" FILES_MATCHING PATTERN "*.h")
diff --git a/ports/poly2tri/build.sh b/ports/poly2tri/build.sh
deleted file mode 100644
index 367ade1..0000000
--- a/ports/poly2tri/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2015 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.
-
-ConfigureStep() {
- cp ${START_DIR}/CMakeLists.txt ${SRC_DIR}/
- DefaultConfigureStep
-}
\ No newline at end of file
diff --git a/ports/poly2tri/pkg_info b/ports/poly2tri/pkg_info
deleted file mode 100644
index 4ad6f15..0000000
--- a/ports/poly2tri/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=poly2tri
-VERSION=26242d0aa7b8
-URL=https://poly2tri.googlecode.com/archive/26242d0aa7b8.tar.gz
-ARCHIVE_ROOT=poly2tri-26242d0aa7b8
-LICENSE="New BSD License"
-SHA1=588f08f77671b231aeb1ae7dcc77ba43dbf86a07
-# The cmake version seems to fails when using with emcc
-# https://bugs.chromium.org/p/naclports/issues/detail?id=243
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/protobuf-c/build.sh b/ports/protobuf-c/build.sh
deleted file mode 100644
index 6e83427..0000000
--- a/ports/protobuf-c/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-export EXTRA_CONFIGURE_ARGS=--disable-protoc
diff --git a/ports/protobuf-c/pkg_info b/ports/protobuf-c/pkg_info
deleted file mode 100644
index f3b5027..0000000
--- a/ports/protobuf-c/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=protobuf-c
-VERSION=1.0.2
-URL=http://github.com/protobuf-c/protobuf-c/releases/download/v1.0.2/protobuf-c-1.0.2.tar.gz
-LICENSE=BSD
-SHA1=f831f98a1142fdd3072b329fdc3b30533be67f48
diff --git a/ports/protobuf/README.nacl b/ports/protobuf/README.nacl
deleted file mode 100644
index 9747e68..0000000
--- a/ports/protobuf/README.nacl
+++ /dev/null
@@ -1,4 +0,0 @@
-The patch file removes -nostdlib check from the configure script
-to work around a linker bug in the nacl-clang toolchain:
-
-https://bugs.chromium.org/p/nativeclient/issues/detail?id=4350
diff --git a/ports/protobuf/build.sh b/ports/protobuf/build.sh
deleted file mode 100644
index 123279c..0000000
--- a/ports/protobuf/build.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2014 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.
-
-EXECUTABLES="src/protoc${NACL_EXEEXT}"
-TESTS="protobuf-lite-test${NACL_EXEEXT} protobuf-test${NACL_EXEEXT}"
-HOST_BUILD_DIR="${WORK_DIR}/build_host"
-EXTRA_CONFIGURE_ARGS="--with-protoc=$HOST_BUILD_DIR/src/protoc"
-
-# The version of gtest embeded in the protobuf distro isn't recent
-# enough to know that NaCl has thread support
-# TODO(sbc): remove this when protobuf is next updated.
-NACLPORTS_CPPFLAGS+=" -DGTEST_HAS_PTHREAD=1"
-
-if [[ ${NACL_LIBC} == newlib ]]; then
- # needed to LLONG_MAX
- NACLPORTS_CXXFLAGS+=" -std=gnu++11"
-fi
-
-BuildHostProtoc() {
- if [ ! -f "${HOST_BUILD_DIR}/src/protoc" ]; then
- MakeDir "${HOST_BUILD_DIR}"
- ChangeDir "${HOST_BUILD_DIR}"
- LogExecute "${SRC_DIR}/configure"
- LogExecute make -C src -j${OS_JOBS} protoc
- ChangeDir ${BUILD_DIR}
- fi
-}
-
-ConfigureStep() {
- BuildHostProtoc
- DefaultConfigureStep
-}
-
-TestStep() {
- LogExecute make -j${OS_JOBS} -C gmock
- LogExecute make -j${OS_JOBS} -C src ${TESTS}
-
- # The protobuf-test exectuable expects srcdir to be set so it
- # can find its source data.
- export srcdir=${SRC_DIR}/src
- for test in ${TESTS}; do
- RunSelLdrCommand src/${test}
- done
-}
diff --git a/ports/protobuf/nacl.patch b/ports/protobuf/nacl.patch
deleted file mode 100644
index ce3cdb3..0000000
--- a/ports/protobuf/nacl.patch
+++ /dev/null
@@ -1,200 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -7179,7 +7179,8 @@ irix5* | irix6* | nonstopux*)
- ;;
-
- # This must be glibc/ELF.
--linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-+# Patched by naclports using patch_configure.py
-+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | nacl*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-@@ -12407,6 +12408,18 @@ uts4*)
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-+nacl)
-+ # Patched by naclports using patch_configure.py
-+ if libc_so=`$CC -print-file-name=libc.so` && [ "$libc_so" != libc.so ]; then
-+ dynamic_linker="GNU/NaCl ld.so"
-+ version_type=linux
-+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-+ soname_spec='${libname}${release}${shared_ext}$major'
-+ else
-+ dynamic_linker=no
-+ fi
-+ ;;
-+
- *)
- dynamic_linker=no
- ;;
-@@ -16239,6 +16252,18 @@ uts4*)
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-+nacl)
-+ # Patched by naclports using patch_configure.py
-+ if libc_so=`$CC -print-file-name=libc.so` && [ "$libc_so" != libc.so ]; then
-+ dynamic_linker="GNU/NaCl ld.so"
-+ version_type=linux
-+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-+ soname_spec='${libname}${release}${shared_ext}$major'
-+ else
-+ dynamic_linker=no
-+ fi
-+ ;;
-+
- *)
- dynamic_linker=no
- ;;
-@@ -17357,40 +17382,6 @@ $as_echo "$as_me: WARNING: Impossible to determine how to use pthreads with shar
- acx_pthread_ok=no
- fi
-
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether what we have so far is sufficient with -nostdlib" >&5
--$as_echo_n "checking whether what we have so far is sufficient with -nostdlib... " >&6; }
-- CFLAGS="-nostdlib $CFLAGS"
-- # we need c with nostdlib
-- LIBS="$LIBS -lc"
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <pthread.h>
--int
--main ()
--{
--pthread_t th; pthread_join(th, 0);
-- pthread_attr_init(0); pthread_cleanup_push(0, 0);
-- pthread_create(0,0,0,0); pthread_cleanup_pop(0);
-- ;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_link "$LINENO"; then :
-- done=yes
--else
-- done=no
--fi
--rm -f core conftest.err conftest.$ac_objext \
-- conftest$ac_exeext conftest.$ac_ext
--
-- if test "x$done" = xyes; then
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
--$as_echo "yes" >&6; }
-- else
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
--$as_echo "no" >&6; }
-- fi
--
- if test x"$done" = xno; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lpthread saves the day" >&5
- $as_echo_n "checking whether -lpthread saves the day... " >&6; }
-diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc
---- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
-+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
-@@ -67,6 +67,10 @@ namespace google {
- namespace protobuf {
- namespace compiler {
-
-+// Disable this whole test when running on Native Client since it doesn't
-+// support fork/spawning new processing.
-+#if !defined(__native_client__)
-+
- // Disable the whole test when we use tcmalloc for "draconian" heap checks, in
- // which case tcmalloc will print warnings that fail the plugin tests.
- #if !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN
-@@ -1822,6 +1826,7 @@ TEST_F(EncodeDecodeTest, ProtoParseError) {
-
- } // anonymous namespace
-
-+#endif // !__native_client__
- #endif // !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN
-
- } // namespace compiler
-diff --git a/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc b/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
---- a/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
-+++ b/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
-@@ -39,6 +39,10 @@
- #include <gtest/gtest.h>
- #include <google/protobuf/testing/file.h>
-
-+// Don't try to run ruby tests. The source distribution doesn't seem to
-+// contain the ruby test data at all
-+#if !defined(__native_client__)
-+
- namespace google {
- namespace protobuf {
- namespace compiler {
-@@ -121,3 +125,5 @@ TEST(RubyGeneratorTest, GeneratorTest) {
- } // namespace compiler
- } // namespace protobuf
- } // namespace google
-+
-+#endif // __native_client__
-diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc
---- a/src/google/protobuf/io/zero_copy_stream_unittest.cc
-+++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc
-@@ -848,6 +848,9 @@ TEST_F(IoTest, FileWriteError) {
- EXPECT_EQ(EBADF, input.GetErrno());
- }
-
-+// pipe() doesn't under sel_ldr.
-+// TODO(sbc): Its possible we could make this work with nacl_io.
-+#ifndef __native_client__
- // Pipes are not seekable, so File{Input,Output}Stream ends up doing some
- // different things to handle them. We'll test by writing to a pipe and
- // reading back from it.
-@@ -876,6 +879,7 @@ TEST_F(IoTest, PipeIo) {
- }
- }
- }
-+#endif
-
- // Test using C++ iostreams.
- TEST_F(IoTest, IostreamIo) {
-diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc
---- a/src/google/protobuf/message_unittest.cc
-+++ b/src/google/protobuf/message_unittest.cc
-@@ -110,6 +110,7 @@ TEST(MessageTest, ParseFromFileDescriptor) {
- string filename = TestSourceDir() +
- "/google/protobuf/testdata/golden_message";
- int file = open(filename.c_str(), O_RDONLY | O_BINARY);
-+ ASSERT_NE(file, -1);
-
- unittest::TestAllTypes message;
- EXPECT_TRUE(message.ParseFromFileDescriptor(file));
-@@ -123,6 +124,7 @@ TEST(MessageTest, ParsePackedFromFileDescriptor) {
- TestSourceDir() +
- "/google/protobuf/testdata/golden_packed_fields_message";
- int file = open(filename.c_str(), O_RDONLY | O_BINARY);
-+ ASSERT_NE(file, -1);
-
- unittest::TestPackedTypes message;
- EXPECT_TRUE(message.ParseFromFileDescriptor(file));
-diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h
---- a/src/google/protobuf/stubs/atomicops.h
-+++ b/src/google/protobuf/stubs/atomicops.h
-@@ -212,7 +212,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
- #include <google/protobuf/stubs/atomicops_internals_mips_gcc.h>
- #elif defined(GOOGLE_PROTOBUF_ARCH_POWER)
- #include <google/protobuf/stubs/atomicops_internals_power.h>
--#elif defined(__native_client__)
-+#elif defined(__pnacl__)
- #include <google/protobuf/stubs/atomicops_internals_pnacl.h>
- #elif (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))
- #include <google/protobuf/stubs/atomicops_internals_generic_gcc.h>
-diff --git a/src/google/protobuf/stubs/stringprintf_unittest.cc b/src/google/protobuf/stubs/stringprintf_unittest.cc
---- a/src/google/protobuf/stubs/stringprintf_unittest.cc
-+++ b/src/google/protobuf/stubs/stringprintf_unittest.cc
-@@ -54,8 +54,8 @@ TEST(StringPrintfTest, Empty) {
- }
-
- TEST(StringPrintfTest, Misc) {
--// MSVC and mingw does not support $ format specifier.
--#if !defined(_MSC_VER) && !defined(__MINGW32__)
-+// MSVC, mingw and newlib don't not support $ format specifier.
-+#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_NEWLIB_VERSION)
- EXPECT_EQ("123hello w", StringPrintf("%3$d%2$s %1$c", 'w', "hello", 123));
- #endif // !_MSC_VER
- }
diff --git a/ports/protobuf/pkg_info b/ports/protobuf/pkg_info
deleted file mode 100644
index a072dc0..0000000
--- a/ports/protobuf/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=protobuf
-VERSION=3.0.0-beta-2
-URL=https://github.com/google/protobuf/releases/download/v3.0.0-beta-2/protobuf-cpp-3.0.0-beta-2.tar.gz
-LICENSE=BSD:COPYING.txt
-DEPENDS=(zlib)
-SHA1=7c6aa027e3f78084dbab72f2d32688de70431a75
-# emscripten: sched_yield missing
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python-host/build.sh b/ports/python-host/build.sh
deleted file mode 100644
index 4faa630..0000000
--- a/ports/python-host/build.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2013 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.
-
-# Use the same patch here as for the destination tree. This allows us to use
-# the same tree for both, although some care should be taken to note that our
-# DYNLOAD will be different between the two builds.
-BUILD_DIR=${WORK_DIR}/build_host
-
-ConfigureStep() {
- # Reset CFLAGS and LDFLAGS when configuring the host
- # version of python since they hold values designed for
- # building for NaCl. Note that we are forcing 32 bits here so
- # our generated modules use Py_ssize_t of the correct size.
- export CC="gcc -m32"
- export CXX="g++ -m32"
- export LD="gcc -m32"
- LogExecute ${SRC_DIR}/configure --prefix=${NACL_HOST_PYROOT}
-}
-
-BuildStep() {
- DefaultBuildStep
- ssl_lib=$(find build -name "_ssl.*")
- if [ -z "${ssl_lib}" ]; then
- echo "Failed to build _ssl python module."
- echo "Check for 32-bit install of libssl and libcryto (see README.rst)"
- exit 1
- fi
- echo "Built ssl lib: ${ssl_lib}"
-}
-
-InstallStep() {
- LogExecute make install
-}
diff --git a/ports/python-host/nacl.patch b/ports/python-host/nacl.patch
deleted file mode 100644
index 56d51fe..0000000
--- a/ports/python-host/nacl.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
---- a/Lib/distutils/unixccompiler.py
-+++ b/Lib/distutils/unixccompiler.py
-@@ -286,3 +286,42 @@ class UnixCCompiler(CCompiler):
-
- # Oops, didn't find it in *any* of 'dirs'
- return None
-+
-+# Thanks to the GPAW project for this function.
-+def _link_shared_object (self,
-+ objects,
-+ output_filename,
-+ output_dir=None,
-+ libraries=None,
-+ library_dirs=None,
-+ runtime_library_dirs=None,
-+ export_symbols=None,
-+ debug=0,
-+ extra_preargs=None,
-+ extra_postargs=None,
-+ build_temp=None,
-+ target_lang=None):
-+
-+ if output_dir is None:
-+ (output_dir, output_filename) = os.path.split(output_filename)
-+ output_fullname = os.path.join(output_dir, output_filename)
-+ output_fullname = os.path.abspath(output_fullname)
-+ linkline = "%s %s" % (output_filename[:-2], output_fullname)
-+ for l in library_dirs:
-+ linkline += " -L" + l
-+ for l in libraries:
-+ linkline += " -l" + l
-+ old_fmt = self.static_lib_format
-+ self.static_lib_format = "%s%.0s"
-+ self.create_static_lib(objects,
-+ output_filename,
-+ output_dir,
-+ debug,
-+ target_lang)
-+
-+ self.static_lib_format = old_fmt
-+
-+# Only override when the NACL_SDK_ROOT
-+import os
-+if os.environ.get("NACL_PORT_BUILD", None) in ["dest", "bootstrap"]:
-+ UnixCCompiler.link_shared_object = _link_shared_object
-diff --git a/setup.py b/setup.py
---- a/setup.py
-+++ b/setup.py
-@@ -378,6 +378,8 @@ class PyBuildExt(build_ext):
-
- if multiarch_path_component != '':
- add_dir_to_list(self.compiler.library_dirs,
-+ '/lib/' + multiarch_path_component)
-+ add_dir_to_list(self.compiler.library_dirs,
- '/usr/lib/' + multiarch_path_component)
- add_dir_to_list(self.compiler.include_dirs,
- '/usr/include/' + multiarch_path_component)
-@@ -399,6 +401,8 @@ class PyBuildExt(build_ext):
- with open(tmpfile) as fp:
- multiarch_path_component = fp.readline().strip()
- add_dir_to_list(self.compiler.library_dirs,
-+ '/lib/' + multiarch_path_component)
-+ add_dir_to_list(self.compiler.library_dirs,
- '/usr/lib/' + multiarch_path_component)
- add_dir_to_list(self.compiler.include_dirs,
- '/usr/include/' + multiarch_path_component)
-@@ -507,7 +511,7 @@ class PyBuildExt(build_ext):
- ):
- add_dir_to_list(inc_dirs, d)
- for d in (
-- '/lib64', '/usr/lib64',
-+ '/lib32', '/usr/lib32',
- '/lib', '/usr/lib',
- ):
- add_dir_to_list(lib_dirs, d)
-@@ -1418,6 +1422,8 @@ class PyBuildExt(build_ext):
- extra_link_args = zlib_extra_link_args))
- have_zlib = True
- else:
-+ print "zlib missing"
-+ sys.exit(1)
- missing.append('zlib')
- else:
- missing.append('zlib')
diff --git a/ports/python-host/pkg_info b/ports/python-host/pkg_info
deleted file mode 100644
index 26e3538..0000000
--- a/ports/python-host/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=python-host
-VERSION=2.7.10
-ARCHIVE_ROOT=Python-2.7.10
-URL=http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
-LICENSE=CUSTOM:LICENSE
-SHA1=49089f1f6ab445dc8ace97beeb276095c4c8039b
diff --git a/ports/python-static/Setup.local b/ports/python-static/Setup.local
deleted file mode 100644
index 5873d20..0000000
--- a/ports/python-static/Setup.local
+++ /dev/null
@@ -1,109 +0,0 @@
-# This file gets copied into the Modules/ folder when building
-# newlib configurations which do not support dynamic library
-# loading.
-
-*static*
-
-# GNU readline. Unlike previous Python incarnations, GNU readline is
-# now incorporated in an optional module, configured in the Setup file
-# instead of by a configure script switch. You may have to insert a
-# -L option pointing to the directory where libreadline.* lives,
-# and you may have to change -ltermcap to -ltermlib or perhaps remove
-# it, depending on your system -- see the GNU readline instructions.
-# It's okay for this to be a shared library, too.
-
-# NOTE this has been commented out in webports to ensure no
-# GPL dependencies are used in the python-static build
-#readline readline.c -lreadline -ltermcap
-
-# Modules that should always be present (non UNIX dependent):
-
-array arraymodule.c # array objects
-cmath cmathmodule.c _math.c # -lm # complex math library functions
-math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
-_struct _struct.c # binary structure packing/unpacking
-time timemodule.c # -lm # time operations and variables
-operator operator.c # operator.add() and similar goodies
-_testcapi _testcapimodule.c # Python C API test module
-_random _randommodule.c # Random number generator
-_collections _collectionsmodule.c # Container types
-_heapq _heapqmodule.c # Heapq type
-itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-strop stropmodule.c # String manipulations
-_functools _functoolsmodule.c # Tools for working with functions and callable objects
-_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
-datetime datetimemodule.c # date/time type
-_bisect _bisectmodule.c # Bisection algorithms
-
-_json _json.c
-
-unicodedata unicodedata.c
-
-# Standard I/O baseline
-_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c
-
-
-# Modules with some UNIX dependencies -- on by default:
-# (If you have a really backward UNIX, select and socket may not be
-# supported...)
-
-fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-#spwd spwdmodule.c # spwd(3)
-#grp grpmodule.c # grp(3)
-select selectmodule.c # select(2); not on ancient System V
-
-# Memory-mapped files (also works on Win32).
-mmap mmapmodule.c
-
-# CSV file helper
-_csv _csv.c
-
-# Socket module helper for socket(2)
-_socket socketmodule.c timemodule.c
-
-# Some more UNIX dependent modules -- off by default, since these
-# are not supported by all UNIX systems:
-
-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-termios termios.c # Steen Lumholt's termios module
-#resource resource.c # Jeremy Hylton's rlimit interface
-
-_ssl _ssl.c -DUSE_SSL -lssl -lcrypto
-
-# Note that the _md5 and _sha modules are normally only built if the
-# system does not have the OpenSSL libs containing an optimized version.
-
-# The _md5 module implements the RSA Data Security, Inc. MD5
-# Message-Digest Algorithm, described in RFC 1321. The necessary files
-# md5.c and md5.h are included here.
-
-_md5 md5module.c md5.c
-
-
-# The _sha module implements the SHA checksum algorithms.
-# (NIST's Secure Hash Algorithms.)
-_sha shamodule.c
-_sha256 sha256module.c
-_sha512 sha512module.c
-
-# Helper module for various ascii-encoders
-binascii binascii.c
-
-future_builtins future_builtins.c
-
-# Fred Drake's interface to the Python parser
-parser parsermodule.c
-
-# cStringIO and cPickle
-cStringIO cStringIO.c
-cPickle cPickle.c
-
-# Andrew Kuchling's zlib module.
-# This require zlib 1.1.3 (or later).
-# See http://www.gzip.org/zlib/
-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-
-bz2 bz2module.c -I$(prefix)/include -L$(exec_prefix)/lib -lbz2
-
-# This file will have appended to it the contents of the registered modules in
-# the host python tree.
diff --git a/ports/python-static/build.sh b/ports/python-static/build.sh
deleted file mode 100644
index b42f8d9..0000000
--- a/ports/python-static/build.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES=python${NACL_EXEEXT}
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-# Currently this package only builds on linux.
-# The build relies on certain host binaries and python's configure
-# requires us to set --build= as well as --host=.
-#
-# The module downloader is patterned after the Bochs image downloading step.
-
-SetOptFlags() {
- # Python build system sets its own opt flags
- return
-}
-
-ConfigureStep() {
- SetupCrossEnvironment
- export CROSS_COMPILE=true
- # We pre-seed configure with certain results that it cannot determine
- # since we are doing a cross compile. The $CONFIG_SITE file is sourced
- # by configure early on.
- export CONFIG_SITE=${START_DIR}/config.site
- # Disable ipv6 since configure claims it requires a working getaddrinfo
- # which we do not provide. TODO(sbc): remove this once nacl_io supports
- # getaddrinfo.
- EXTRA_CONFIGURE_ARGS="--disable-ipv6"
- EXTRA_CONFIGURE_ARGS+=" --with-suffix=${NACL_EXEEXT}"
- EXTRA_CONFIGURE_ARGS+=" --build=i686-linux-gnu --disable-shared --enable-static"
- if [ "${NACL_DEBUG}" = 1 ]; then
- EXTRA_CONFIGURE_ARGS+=" --with-pydebug"
- fi
- export SO=.a
- export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen"
- export LIBS="-ltermcap"
- export DYNLOADFILE=dynload_ppapi.o
- export MACHDEP=ppapi
- export LINKCC=${NACLCXX}
- EnableGlibcCompat
- LogExecute cp ${START_DIR}/dynload_ppapi.c ${SRC_DIR}/Python/
- # This next step is costly, but it sets the environment variables correctly.
- DefaultConfigureStep
-
- LogExecute cp ${START_DIR}/Setup.local Modules/
- cat ${DEST_PYTHON_OBJS}/*.list >> Modules/Setup.local
- PY_MOD_LIBS=""
- for MODFILE in ${DEST_PYTHON_OBJS}/*.libs ; do
- if [ -e ${MODFILE} ]; then
- source ${MODFILE}
- fi
- done
- LogExecute rm -vf libpython2.7.a
- PY_LINK_LINE+="ppapi_wrapper ${DEST_PYTHON_OBJS}/\*/\*.o"
- PY_LINK_LINE+=" ${PY_MOD_LIBS} -lz -lbz2 ${NACL_CLI_MAIN_LIB_CPP}"
- if [ "${NACL_LIBC}" = "newlib" ]; then
- PY_LINK_LINE+=" -lglibc-compat"
- fi
- echo ${PY_LINK_LINE} >> Modules/Setup.local
- # At this point we use the existing environment variables from
- # DefaultConfigureStep to build our destination Python modules
-}
-
-BuildStep() {
- SetupCrossEnvironment
- export CROSS_COMPILE=true
- export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen"
- DefaultBuildStep
- ChangeDir ${BUILD_DIR}
- Banner "Rebuilding libpython2.7.a"
- ${AR} cr libpython2.7.a ${DEST_PYTHON_OBJS}/*/*.o
- ${RANLIB} libpython2.7.a
- # To avoid rebuilding python.nexe with the new libpython2.7.a and duplicating
- # symbols
- LogExecute touch python${NACL_EXEEXT}
- # The modules get built with SO=so, but they need to be SO=a inside the
- # destination filesystem.
- for fn in $(find ${NACL_DEST_PYROOT}/${SITE_PACKAGES} -name "*.so"); do
- LogExecute touch ${fn%%so}a
- LogExecute rm -v ${fn}
- done
-}
diff --git a/ports/python-static/config.site b/ports/python-static/config.site
deleted file mode 100644
index 322962d..0000000
--- a/ports/python-static/config.site
+++ /dev/null
@@ -1,11 +0,0 @@
-# Python's configure can't detect these two options when cross
-# compiling so we pre-seed it with the answers.
-ac_cv_file__dev_ptmx=no
-ac_cv_file__dev_ptc=no
-
-# Currently we don't provide an implemention of getnameinfo
-# in nacl_io, but python detects and uses the stub version in
-# glibc-compat. This forces python to use its own internal
-# implemenation.
-# TODO(sbc): Remove this once we add getnameinfo: http://crbug.com/386832
-ac_cv_func_getnameinfo=no
diff --git a/ports/python-static/dynload_ppapi.c b/ports/python-static/dynload_ppapi.c
deleted file mode 100644
index 05c2255..0000000
--- a/ports/python-static/dynload_ppapi.c
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/* This module provides the simulation of dynamic loading */
-
-#include "Python.h"
-#include "importdl.h"
-
-const struct filedescr _PyImport_DynLoadFiletab[] = {
- {".a", "rb", C_EXTENSION},
- {0, 0}
-};
-
-extern struct _inittab _PyImport_Inittab[];
-
-dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
- const char *pathname, FILE *fp)
-{
- struct _inittab *tab = _PyImport_Inittab;
- while (tab->name && strcmp(shortname, tab->name)) tab++;
-
- return tab->initfunc;
-}
diff --git a/ports/python-static/nacl.patch b/ports/python-static/nacl.patch
deleted file mode 100644
index 065f133..0000000
--- a/ports/python-static/nacl.patch
+++ /dev/null
@@ -1,972 +0,0 @@
-diff --git a/Include/datetime.h b/Include/datetime.h
---- a/Include/datetime.h
-+++ b/Include/datetime.h
-@@ -166,6 +166,8 @@ typedef struct {
-
- #ifdef Py_BUILD_CORE
-
-+#define PyDataTime_STATIC 1
-+
- /* Macros for type checking when building the Python core. */
- #define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType)
- #define PyDate_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateType)
-diff --git a/Lib/platform.py b/Lib/platform.py
---- a/Lib/platform.py
-+++ b/Lib/platform.py
-@@ -1001,7 +1001,7 @@ def _syscmd_uname(option,default=''):
-
- """ Interface to the system's uname command.
- """
-- if sys.platform in ('dos','win32','win16','os2'):
-+ if sys.platform in ('dos','win32','win16','os2','nacl'):
- # XXX Others too ?
- return default
- try:
-diff --git a/Lib/subprocess.py b/Lib/subprocess.py
---- a/Lib/subprocess.py
-+++ b/Lib/subprocess.py
-@@ -388,6 +388,7 @@ except that:
-
- import sys
- mswindows = (sys.platform == "win32")
-+nacl = (sys.platform == "nacl")
-
- import os
- import types
-@@ -1206,7 +1207,10 @@ class Popen(object):
- args = list(args)
-
- if shell:
-- args = ["/bin/sh", "-c"] + args
-+ if nacl:
-+ args = ["bash", "-c"] + args
-+ else:
-+ args = ["/bin/sh", "-c"] + args
- if executable:
- args[0] = executable
-
-@@ -1217,6 +1221,15 @@ class Popen(object):
- os.close(fd)
- to_close.remove(fd)
-
-+ # TODO(bradnelson,sbc): Add support for pipes.
-+ if nacl:
-+ if env is None:
-+ self.pid = os.spawnv(os.P_NOWAIT, executable, args)
-+ else:
-+ self.pid = os.spawnve(os.P_NOWAIT, executable, args, env)
-+ self._child_created = True
-+ return
-+
- # For transferring possible exec failure from child to parent
- # The first char specifies the exception type: 0 means
- # OSError, 1 means some other error.
-diff --git a/Makefile.pre.in b/Makefile.pre.in
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -442,7 +442,7 @@ coverage:
- $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
- $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
- Modules/python.o \
-- $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-+ $(BLDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) $(LDLAST)
-
- platform: $(BUILDPYTHON) pybuilddir.txt
- $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
-@@ -610,14 +610,18 @@ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule
-
- $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
- @$(MKDIR_P) Include
-+ifndef CROSS_COMPILE
- $(MAKE) $(PGEN)
-+endif
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
- $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
- $(MAKE) $(GRAMMAR_H)
- touch $(GRAMMAR_C)
-
-+ifndef CROSS_COMPILE
- $(PGEN): $(PGENOBJS)
- $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
-+endif
-
- Parser/grammar.o: $(srcdir)/Parser/grammar.c \
- $(srcdir)/Include/token.h \
-@@ -1042,6 +1046,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
- $(DESTDIR)$(LIBDEST)/distutils/tests ; \
- fi
-+ifndef CROSS_COMPILE
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
-@@ -1060,6 +1065,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-+endif
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
---- a/Modules/_ctypes/libffi/configure
-+++ b/Modules/_ctypes/libffi/configure
-@@ -17261,7 +17261,7 @@ case "$host" in
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- case "$host" in
-- *-gnux32)
-+ *-gnux32 | *-nacl)
- TARGET=X86_64
- ;;
- *)
-diff --git a/Modules/_ctypes/libffi/src/x86/unix64.S b/Modules/_ctypes/libffi/src/x86/unix64.S
---- a/Modules/_ctypes/libffi/src/x86/unix64.S
-+++ b/Modules/_ctypes/libffi/src/x86/unix64.S
-@@ -1,5 +1,6 @@
- /* -----------------------------------------------------------------------
-- unix64.S - Copyright (c) 2013 The Written Word, Inc.
-+ unix64.S - Copyright (c) 2015 Georgia Institute of Technology
-+ - Copyright (c) 2013 The Written Word, Inc.
- - Copyright (c) 2008 Red Hat, Inc
- - Copyright (c) 2002 Bo Thorsen <bo@suse.de>
-
-@@ -31,6 +32,24 @@
- #include <fficonfig.h>
- #include <ffi.h>
-
-+.section .rodata
-+.Lstore_table:
-+ .long .Lst_void-.Lstore_table /* FFI_TYPE_VOID */
-+ .long .Lst_sint32-.Lstore_table /* FFI_TYPE_INT */
-+ .long .Lst_float-.Lstore_table /* FFI_TYPE_FLOAT */
-+ .long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */
-+ .long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
-+ .long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */
-+ .long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */
-+ .long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */
-+ .long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */
-+ .long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */
-+ .long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */
-+ .long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */
-+ .long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */
-+ .long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
-+ .long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
-+
- .text
-
- /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
-@@ -48,115 +67,122 @@ ffi_call_unix64:
- .LUW0:
- movq (%rsp), %r10 /* Load return address. */
- leaq (%rdi, %rsi), %rax /* Find local stack base. */
-- movq %rdx, (%rax) /* Save flags. */
-- movq %rcx, 8(%rax) /* Save raddr. */
-- movq %rbp, 16(%rax) /* Save old frame pointer. */
-- movq %r10, 24(%rax) /* Relocate return address. */
-- movq %rax, %rbp /* Finalize local stack frame. */
-+ movq %rdx, %nacl:0(%r15, %rax) /* Save flags. */
-+ movq %rcx, %nacl:8(%r15, %rax) /* Save raddr. */
-+ movq %rbp, %nacl:16(%r15, %rax) /* Save old frame pointer. */
-+ movq %r10, %nacl:24(%r15, %rax) /* Relocate return address. */
-+ naclrestbp %eax, %r15 /* Finalize local stack frame. */
- .LUW1:
-- movq %rdi, %r10 /* Save a copy of the register area. */
-- movq %r8, %r11 /* Save a copy of the target fn. */
-+ movl %edi, %r10d /* Save a copy of the register area. */
-+ movl %r8d, %r11d /* Save a copy of the target fn. */
- movl %r9d, %eax /* Set number of SSE registers. */
-
- /* Load up all argument registers. */
-- movq (%r10), %rdi
-- movq 8(%r10), %rsi
-- movq 16(%r10), %rdx
-- movq 24(%r10), %rcx
-- movq 32(%r10), %r8
-- movq 40(%r10), %r9
-+ movq %nacl:0(%r15, %r10), %rdi
-+ movq %nacl:8(%r15, %r10), %rsi
-+ movq %nacl:16(%r15, %r10), %rdx
-+ movq %nacl:24(%r15, %r10), %rcx
-+ movq %nacl:32(%r15, %r10), %r8
-+ movq %nacl:40(%r15, %r10), %r9
- testl %eax, %eax
- jnz .Lload_sse
- .Lret_from_load_sse:
-
- /* Deallocate the reg arg area. */
-- leaq 176(%r10), %rsp
-+ .bundle_lock
-+ leal 176(%r10), %esp
-+ addq %r15, %rsp
-+ .bundle_unlock
-
- /* Call the user function. */
-- call *%r11
-+ naclcall %r11d, %r15
-
- /* Deallocate stack arg area; local stack frame in redzone. */
-- leaq 24(%rbp), %rsp
-+ .bundle_lock
-+ leal 24(%rbp), %esp
-+ addq %r15, %rsp
-+ .bundle_unlock
-
- movq 0(%rbp), %rcx /* Reload flags. */
- movq 8(%rbp), %rdi /* Reload raddr. */
-- movq 16(%rbp), %rbp /* Reload old frame pointer. */
-+ naclrestbp 16(%rbp), %r15 /* Reload old frame pointer. */
- .LUW2:
-
- /* The first byte of the flags contains the FFI_TYPE. */
- movzbl %cl, %r10d
-- leaq .Lstore_table(%rip), %r11
-- movslq (%r11, %r10, 4), %r10
-- addq %r11, %r10
-- jmp *%r10
--
--.Lstore_table:
-- .long .Lst_void-.Lstore_table /* FFI_TYPE_VOID */
-- .long .Lst_sint32-.Lstore_table /* FFI_TYPE_INT */
-- .long .Lst_float-.Lstore_table /* FFI_TYPE_FLOAT */
-- .long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */
-- .long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
-- .long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */
-- .long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */
-- .long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */
-- .long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */
-- .long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */
-- .long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */
-- .long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */
-- .long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */
-- .long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
-- .long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
-+ leal .Lstore_table(%rip), %r11d
-+ leal (%r11, %r10, 4), %r10d
-+ movl %nacl:(%r15, %r10), %r10d
-+ addl %r11d, %r10d
-+ nacljmp %r10d, %r15
-
-- .align 2
-+ .align 32
- .Lst_void:
-- ret
-- .align 2
-+ pop %r11
-+ nacljmp %r11d, %r15
-
-+ .align 32
- .Lst_uint8:
- movzbq %al, %rax
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_sint8:
- movsbq %al, %rax
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_uint16:
- movzwq %ax, %rax
-- movq %rax, (%rdi)
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_sint16:
- movswq %ax, %rax
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_uint32:
- movl %eax, %eax
-- movq %rax, (%rdi)
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_sint32:
- cltq
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_int64:
-- movq %rax, (%rdi)
-- ret
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-
-- .align 2
-+ .align 32
- .Lst_float:
-- movss %xmm0, (%rdi)
-- ret
-- .align 2
-+ movss %xmm0, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_double:
-- movsd %xmm0, (%rdi)
-- ret
- .Lst_ldouble:
-- fstpt (%rdi)
-- ret
-+ movsd %xmm0, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-
-- .align 2
-+ .align 32
- .Lst_struct:
- leaq -20(%rsp), %rsi /* Scratch area in redzone. */
-
-@@ -175,14 +201,15 @@ ffi_call_unix64:
- testl $0x400, %ecx
- cmovnz %r10, %rax
- cmovnz %r11, %rdx
-- movq %rax, (%rsi)
-- movq %rdx, 8(%rsi)
-+ movq %rax, %nacl:0(%r15, %rsi)
-+ movq %rdx, %nacl:8(%r15, %rsi)
-
- /* Bits 12-31 contain the true size of the structure. Copy from
- the scratch area to the true destination. */
- shrl $12, %ecx
-- rep movsb
-- ret
-+ rep movs %nacl:(%rsi), %nacl:(%rdi), %r15
-+ pop %r11
-+ nacljmp %r11d, %r15
-
- /* Many times we can avoid loading any SSE registers at all.
- It's not worth an indirect jump to load the exact set of
-@@ -190,14 +217,14 @@ ffi_call_unix64:
- .align 2
- .LUW3:
- .Lload_sse:
-- movdqa 48(%r10), %xmm0
-- movdqa 64(%r10), %xmm1
-- movdqa 80(%r10), %xmm2
-- movdqa 96(%r10), %xmm3
-- movdqa 112(%r10), %xmm4
-- movdqa 128(%r10), %xmm5
-- movdqa 144(%r10), %xmm6
-- movdqa 160(%r10), %xmm7
-+ movdqa %nacl:48(%r15, %r10), %xmm0
-+ movdqa %nacl:64(%r15, %r10), %xmm1
-+ movdqa %nacl:80(%r15, %r10), %xmm2
-+ movdqa %nacl:96(%r15, %r10), %xmm3
-+ movdqa %nacl:112(%r15, %r10), %xmm4
-+ movdqa %nacl:128(%r15, %r10), %xmm5
-+ movdqa %nacl:144(%r15, %r10), %xmm6
-+ movdqa %nacl:160(%r15, %r10), %xmm7
- jmp .Lret_from_load_sse
-
- .LUW4:
-@@ -208,6 +235,10 @@ ffi_call_unix64:
- .type ffi_closure_unix64,@function
-
- ffi_closure_unix64:
-+#ifdef __native_client__
-+ hlt
-+#else
-+ /* THIS IMPLEMENTATION VIOLATES NATIVE CLIENT SFI MODEL */
- .LUW5:
- /* The carry flag is set by the trampoline iff SSE registers
- are used. Don't clobber it before the branch instruction. */
-@@ -422,9 +453,10 @@ ffi_closure_unix64:
-
- .align 8
- .LEFDE3:
--
- #endif /* __GNUC__ */
-
-+#endif /* __native_client__ */
-+
- #endif /* __x86_64__ */
-
- #if defined __ELF__ && defined __linux__
-diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
---- a/Modules/_testcapimodule.c
-+++ b/Modules/_testcapimodule.c
-@@ -1378,6 +1378,9 @@ static int test_run_counter = 0;
-
- static PyObject *
- test_datetime_capi(PyObject *self, PyObject *args) {
-+#ifdef PyDataTime_STATIC
-+ Py_RETURN_NONE;
-+#else
- if (PyDateTimeAPI) {
- if (test_run_counter) {
- /* Probably regrtest.py -R */
-@@ -1395,6 +1398,7 @@ test_datetime_capi(PyObject *self, PyObject *args) {
- Py_RETURN_NONE;
- else
- return NULL;
-+#endif
- }
-
-
-diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
---- a/Modules/mmapmodule.c
-+++ b/Modules/mmapmodule.c
-@@ -78,6 +78,12 @@ my_getpagesize(void)
- # define MAP_ANONYMOUS MAP_ANON
- #endif
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#define MS_SYNC 0
-+/* Defined in glibc-compat */
-+int msync(void *addr, size_t length, int flags);
-+#endif
-+
- static PyObject *mmap_module_error;
-
- typedef enum
-diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
---- a/Modules/posixmodule.c
-+++ b/Modules/posixmodule.c
-@@ -216,6 +216,13 @@ extern int lstat(const char *, struct stat *);
-
- #endif /* !_MSC_VER */
-
-+#if defined(__native_client__)
-+#include <spawn.h>
-+#if !defined(HAVE_SPAWNV)
-+#define HAVE_SPAWNV 1
-+#endif /* !defined(HAVE_SPAWNV) */
-+#endif /* defined(__native_client__) */
-+
- #ifdef HAVE_UTIME_H
- #include <utime.h>
- #endif /* HAVE_UTIME_H */
-@@ -718,9 +725,13 @@ posix_error_with_unicode_filename(Py_UNICODE* name)
-
-
- static PyObject *
--posix_error_with_allocated_filename(char* name)
-+posix_error_with_allocated_filename(const char* func, char* name)
- {
-- PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
-+ PyObject *rc;
-+ if (errno == ENOSYS)
-+ rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, func);
-+ else
-+ rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
- PyMem_Free(name);
- return rc;
- }
-@@ -881,7 +892,7 @@ posix_1str(PyObject *args, char *format, int (*func)(const char*))
- res = (*func)(path1);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path1);
-+ return posix_error_with_allocated_filename(format, path1);
- PyMem_Free(path1);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -1913,7 +1924,7 @@ posix_chmod(PyObject *self, PyObject *args)
- res = chmod(path, i);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("chmod", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -1960,7 +1971,7 @@ posix_lchmod(PyObject *self, PyObject *args)
- res = lchmod(path, i);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("lchmod", path);
- PyMem_Free(path);
- Py_RETURN_NONE;
- }
-@@ -1985,7 +1996,7 @@ posix_chflags(PyObject *self, PyObject *args)
- res = chflags(path, flags);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("chflags", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2011,7 +2022,7 @@ posix_lchflags(PyObject *self, PyObject *args)
- res = lchflags(path, flags);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("lchflags", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2082,7 +2093,7 @@ posix_chown(PyObject *self, PyObject *args)
- res = chown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("chown", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2137,7 +2148,7 @@ posix_lchown(PyObject *self, PyObject *args)
- res = lchown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("lchown", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2532,7 +2543,7 @@ posix_listdir(PyObject *self, PyObject *args)
- dirp = opendir(name);
- Py_END_ALLOW_THREADS
- if (dirp == NULL) {
-- return posix_error_with_allocated_filename(name);
-+ return posix_error_with_allocated_filename("listdir", name);
- }
- if ((d = PyList_New(0)) == NULL) {
- Py_BEGIN_ALLOW_THREADS
-@@ -2554,7 +2565,7 @@ posix_listdir(PyObject *self, PyObject *args)
- closedir(dirp);
- Py_END_ALLOW_THREADS
- Py_DECREF(d);
-- return posix_error_with_allocated_filename(name);
-+ return posix_error_with_allocated_filename("listdir", name);
- }
- }
- if (ep->d_name[0] == '.' &&
-@@ -2714,7 +2725,7 @@ posix_mkdir(PyObject *self, PyObject *args)
- #endif
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("mkdir", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -3113,7 +3124,7 @@ done:
- #endif /* HAVE_UTIMES */
- }
- if (res < 0) {
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("utime", path);
- }
- PyMem_Free(path);
- Py_INCREF(Py_None);
-@@ -3430,7 +3441,7 @@ posix_spawnv(PyObject *self, PyObject *args)
- }
- argvlist[argc] = NULL;
-
--#if defined(PYOS_OS2) && defined(PYCC_GCC)
-+#if (defined(PYOS_OS2) && defined(PYCC_GCC)) || defined(__native_client__)
- Py_BEGIN_ALLOW_THREADS
- spawnval = spawnv(mode, path, argvlist);
- Py_END_ALLOW_THREADS
-@@ -3575,7 +3586,7 @@ posix_spawnve(PyObject *self, PyObject *args)
- }
- envlist[envc] = 0;
-
--#if defined(PYOS_OS2) && defined(PYCC_GCC)
-+#if (defined(PYOS_OS2) && defined(PYCC_GCC)) || defined(__native_client__)
- Py_BEGIN_ALLOW_THREADS
- spawnval = spawnve(mode, path, argvlist, envlist);
- Py_END_ALLOW_THREADS
-@@ -6370,7 +6381,7 @@ posix_readlink(PyObject *self, PyObject *args)
- n = readlink(path, buf, (int) sizeof buf);
- Py_END_ALLOW_THREADS
- if (n < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("readlink", path);
-
- PyMem_Free(path);
- v = PyString_FromStringAndSize(buf, n);
-@@ -6616,7 +6627,7 @@ posix_open(PyObject *self, PyObject *args)
- PyErr_Clear();
- #endif
-
-- if (!PyArg_ParseTuple(args, "eti|i",
-+ if (!PyArg_ParseTuple(args, "eti|i:open",
- Py_FileSystemDefaultEncoding, &file,
- &flag, &mode))
- return NULL;
-@@ -6625,7 +6636,7 @@ posix_open(PyObject *self, PyObject *args)
- fd = open(file, flag, mode);
- Py_END_ALLOW_THREADS
- if (fd < 0)
-- return posix_error_with_allocated_filename(file);
-+ return posix_error_with_allocated_filename("open", file);
- PyMem_Free(file);
- return PyInt_FromLong((long)fd);
- }
-@@ -9431,6 +9442,11 @@ all_ins(PyObject *d)
- if (ins(d, "P_TILDE", (long)P_TILDE)) return -1;
- if (ins(d, "P_UNRELATED", (long)P_UNRELATED)) return -1;
- if (ins(d, "P_DEBUGDESC", (long)P_DEBUGDESC)) return -1;
-+#elif defined(__native_client__)
-+ if (ins(d, "P_WAIT", (long)P_WAIT)) return -1;
-+ if (ins(d, "P_NOWAIT", (long)P_NOWAIT)) return -1;
-+ if (ins(d, "P_OVERLAY", (long)P_OVERLAY)) return -1;
-+ if (ins(d, "P_NOWAITO", (long)P_NOWAITO)) return -1;
- #else
- if (ins(d, "P_WAIT", (long)_P_WAIT)) return -1;
- if (ins(d, "P_NOWAIT", (long)_P_NOWAIT)) return -1;
-diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
---- a/Modules/pwdmodule.c
-+++ b/Modules/pwdmodule.c
-@@ -94,6 +94,29 @@ mkpwent(struct passwd *p)
- return v;
- }
-
-+#ifdef __native_client__
-+// python relies on a working version of getpwuid(3)
-+// which Native Client does not yet provide.
-+// TODO(sbc): This should only really be needed when
-+// building for the sel_ldr. It should be possible to
-+// use the C-library version (which tries of open files
-+// under /etc) when using nacl_io.
-+static struct passwd *my_getpwuid(uid_t uid)
-+{
-+ static struct passwd dummy = {
-+ "nacl_user",
-+ "nacl_pass",
-+ 1,
-+ 1,
-+ "NaCl User",
-+ "/home/nacl_user",
-+ "/bin/sh",
-+ };
-+ return &dummy;
-+}
-+#define getpwuid my_getpwuid
-+#endif
-+
- PyDoc_STRVAR(pwd_getpwuid__doc__,
- "getpwuid(uid) -> (pw_name,pw_passwd,pw_uid,\n\
- pw_gid,pw_gecos,pw_dir,pw_shell)\n\
-diff --git a/Modules/python.c b/Modules/python.c
---- a/Modules/python.c
-+++ b/Modules/python.c
-@@ -6,6 +6,21 @@
- #include <floatingpoint.h>
- #endif
-
-+#ifdef __native_client__
-+#define main nacl_main
-+#ifdef __arm__
-+#define DATA_FILE "_platform_specific/arm/pydata.tar"
-+#elif defined __i386__
-+#define DATA_FILE "_platform_specific/i686/pydata.tar"
-+#elif defined __x86_64__
-+#define DATA_FILE "_platform_specific/x86_64/pydata.tar"
-+#elif defined __pnacl__
-+#define DATA_FILE "pydata.tar"
-+#else
-+#error "Unknown arch"
-+#endif
-+#endif
-+
- int
- main(int argc, char **argv)
- {
-@@ -20,5 +35,11 @@ main(int argc, char **argv)
- m = fpgetmask();
- fpsetmask(m & ~FP_X_OFL);
- #endif
-+#ifdef __native_client__
-+ setvbuf(stdout, NULL, _IOLBF, 0);
-+ setvbuf(stdin, NULL, _IOLBF, 0);
-+ if (nacl_startup_untar(argv[0], DATA_FILE, "/"))
-+ return -1;
-+#endif
- return Py_Main(argc, argv);
- }
-diff --git a/Modules/readline.c b/Modules/readline.c
---- a/Modules/readline.c
-+++ b/Modules/readline.c
-@@ -965,7 +965,12 @@ setup_readline(void)
- /* Wrapper around GNU readline that handles signals differently. */
-
-
--#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT)
-+/*
-+ * Don't use the select()-based readline under Native Client. While select()
-+ * is available and compile and link time it will fail at runtime under sel_ldr
-+ * since there is no IRT/syscall implemenation of select().
-+ */
-+#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) && !defined(__native_client__)
-
- static char *completed_input_string;
- static void
-diff --git a/Modules/timemodule.c b/Modules/timemodule.c
---- a/Modules/timemodule.c
-+++ b/Modules/timemodule.c
-@@ -34,6 +34,11 @@ extern int ftime(struct timeb *);
- #endif /* MS_WINDOWS */
- #endif /* HAVE_FTIME */
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+#define timezone _timezone
-+#define daylight _daylight
-+#endif
-+
- #if defined(__WATCOMC__) && !defined(__QNX__)
- #include <i86.h>
- #else
-diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
---- a/Python/dynload_shlib.c
-+++ b/Python/dynload_shlib.c
-@@ -84,6 +84,11 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
- PyOS_snprintf(funcname, sizeof(funcname),
- LEAD_UNDERSCORE "init%.200s", shortname);
-
-+
-+/* Native Client's fstat() imlemenation doesn't set st_dev
-+ * and st_ino correctly so disable the dlopen handle cache.
-+ * TODO(sbc): fix NaCl's fstat() */
-+#ifndef __native_client__
- if (fp != NULL) {
- int i;
- struct stat statb;
-@@ -107,6 +112,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
- #endif
- }
- }
-+#endif
-
- #if !(defined(PYOS_OS2) && defined(PYCC_GCC))
- dlopenflags = PyThreadState_GET()->interp->dlopenflags;
-diff --git a/Python/getversion.c b/Python/getversion.c
---- a/Python/getversion.c
-+++ b/Python/getversion.c
-@@ -8,8 +8,8 @@
- const char *
- Py_GetVersion(void)
- {
-- static char version[250];
-- PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
-+ static char version[270];
-+ PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.100s",
- PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
- return version;
- }
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -2880,6 +2880,11 @@ if test "$cross_compiling" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
- $as_echo_n "checking for python interpreter for cross build... " >&6; }
- if test -z "$PYTHON_FOR_BUILD"; then
-+ case "$host" in
-+ *-*-nacl*)
-+ interp=$(cd ../../python-host/build_host && pwd)/python
-+ ;;
-+ *)
- for interp in python$PACKAGE_VERSION python2 python; do
- which $interp >/dev/null 2>&1 || continue
- if $interp -c 'import sys;sys.exit(not (sys.version_info[:2] >= (2,7) and sys.version_info[0] < 3))'; then
-@@ -2887,12 +2892,13 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
- fi
- interp=
- done
-+ esac
- if test x$interp = x; then
- as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
- $as_echo "$interp" >&6; }
-- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
-+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(abs_srcdir)/Lib:$(abs_srcdir)/Lib/$(PLATDIR) '$interp
- fi
- elif test "$cross_compiling" = maybe; then
- as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
-@@ -3196,6 +3202,9 @@ then
- # `define_xopen_source' in the case statement below. For the
- # current supported cross builds, this macro is not adjusted.
- case "$host" in
-+ *-*-nacl*)
-+ ac_sys_system=NaCl
-+ ;;
- *-*-linux*)
- ac_sys_system=Linux
- ;;
-@@ -3245,6 +3254,15 @@ if test "$cross_compiling" = yes; then
- _host_cpu=$host_cpu
- esac
- ;;
-+ *-*-nacl*)
-+ case "$host_cpu" in
-+ arm*)
-+ _host_cpu=arm
-+ ;;
-+ *)
-+ _host_cpu=$host_cpu
-+ esac
-+ ;;
- *-*-cygwin*)
- _host_cpu=
- ;;
-@@ -5168,7 +5186,11 @@ if test -d casesensitivetestdir
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-- BUILDEXEEXT=.exe
-+ if [ -z $EXEEXT ]; then
-+ BUILDEXEEXT=.exe
-+ else
-+ BUILDEXEEXT=$EXEEXT
-+ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
-@@ -5966,11 +5988,11 @@ then
- # debug builds.
- OPT="-g -O0 -Wall $STRICT_PROTO"
- else
-- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
-+ OPT="-g $WRAP -O2 -Wall $STRICT_PROTO"
- fi
- ;;
- *)
-- OPT="-O3 -Wall $STRICT_PROTO"
-+ OPT="-O2 -Wall $STRICT_PROTO"
- ;;
- esac
- case $ac_sys_system in
-@@ -8270,7 +8292,7 @@ then
- BLDSHARED="$LDSHARED"
- fi
- ;;
-- Linux*|GNU*|QNX*)
-+ Linux*|GNU*|QNX*|NaCl*)
- LDSHARED='$(CC) -shared'
- LDCXXSHARED='$(CXX) -shared';;
- BSD/OS*/4*)
-@@ -8344,7 +8366,7 @@ then
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
- fi;;
-- Linux*|GNU*) CCSHARED="-fPIC";;
-+ Linux*|GNU*|NaCl*) CCSHARED="-fPIC";;
- BSD/OS*/4*) CCSHARED="-fpic";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
- OpenUNIX*|UnixWare*)
-@@ -8378,7 +8400,7 @@ then
- LINKFORSHARED="-Wl,-E -Wl,+s";;
- # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
-- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
-+ Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";;
- # -u libsys_s pulls in all symbols in libsys
- Darwin/*)
- # -u _PyMac_Error is needed to pull in the mac toolbox glue,
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -22,6 +22,11 @@ rm -f pybuilddir.txt
- if test "$cross_compiling" = yes; then
- AC_MSG_CHECKING([for python interpreter for cross build])
- if test -z "$PYTHON_FOR_BUILD"; then
-+ case "$host" in
-+ *-*-nacl*)
-+ interp=$(cd ../../python-host/build_host && pwd)/python
-+ ;;
-+ *)
- for interp in python$PACKAGE_VERSION python2 python; do
- which $interp >/dev/null 2>&1 || continue
- if $interp -c 'import sys;sys.exit(not (sys.version_info@<:@:2@:>@ >= (2,7) and sys.version_info@<:@0@:>@ < 3))'; then
-@@ -29,11 +34,12 @@ if test "$cross_compiling" = yes; then
- fi
- interp=
- done
-+ esac
- if test x$interp = x; then
- AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
- fi
- AC_MSG_RESULT($interp)
-- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
-+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(abs_srcdir)/Lib:$(abs_srcdir)/Lib/$(PLATDIR) '$interp
- fi
- elif test "$cross_compiling" = maybe; then
- AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
-@@ -322,6 +328,9 @@ then
- *-*-cygwin*)
- ac_sys_system=Cygwin
- ;;
-+ *-*-nacl*)
-+ ac_sys_system=NaCl
-+ ;;
- *)
- # for now, limit cross builds to known configurations
- MACHDEP="unknown"
-@@ -365,6 +374,15 @@ if test "$cross_compiling" = yes; then
- _host_cpu=$host_cpu
- esac
- ;;
-+ *-*-nacl*)
-+ case "$host_cpu" in
-+ arm*)
-+ _host_cpu=arm
-+ ;;
-+ *)
-+ _host_cpu=$host_cpu
-+ esac
-+ ;;
- *-*-cygwin*)
- _host_cpu=
- ;;
-@@ -2036,7 +2054,7 @@ then
- BLDSHARED="$LDSHARED"
- fi
- ;;
-- Linux*|GNU*|QNX*)
-+ Linux*|GNU*|QNX*|NaCl*)
- LDSHARED='$(CC) -shared'
- LDCXXSHARED='$(CXX) -shared';;
- BSD/OS*/4*)
-@@ -2108,7 +2126,7 @@ then
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
- fi;;
-- Linux*|GNU*) CCSHARED="-fPIC";;
-+ Linux*|GNU*|NaCl*) CCSHARED="-fPIC";;
- BSD/OS*/4*) CCSHARED="-fpic";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
- OpenUNIX*|UnixWare*)
-@@ -2140,7 +2158,7 @@ then
- LINKFORSHARED="-Wl,-E -Wl,+s";;
- # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
-- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
-+ Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";;
- # -u libsys_s pulls in all symbols in libsys
- Darwin/*)
- # -u _PyMac_Error is needed to pull in the mac toolbox glue,
diff --git a/ports/python-static/pkg_info b/ports/python-static/pkg_info
deleted file mode 100644
index a804e67..0000000
--- a/ports/python-static/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=python-static
-VERSION=2.7.10
-ARCHIVE_ROOT=Python-2.7.10
-URL=http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(readline zlib glibc-compat pyppapi openssl bzip2 libpng freetype nacl-spawn python-host)
-CONFLICTS=(python)
-SHA1=49089f1f6ab445dc8ace97beeb276095c4c8039b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python/README.nacl b/ports/python/README.nacl
deleted file mode 100644
index 8be9b1f..0000000
--- a/ports/python/README.nacl
+++ /dev/null
@@ -1,14 +0,0 @@
-Python Interative Shell for Chrome
-==================================
-
-This is package of the Python interactive shell built to run
-under Native Client within chrome/chromium.
-
-The logo files here are derived from the SVG logo available at
-http://www.python.org/community/logos/
-
-Run ./nacl-python_ppapi.sh to build Python for use directly within
-chrome (requires the --enable-nacl flag) or via the chome web
-store. The chrome webstore version is published here:
-
-https://chrome.google.com/webstore/detail/python/nodpmmidbgeganfponihbgmfcoiibffi
diff --git a/ports/python/Setup.local b/ports/python/Setup.local
deleted file mode 100644
index 7d2104b..0000000
--- a/ports/python/Setup.local
+++ /dev/null
@@ -1,107 +0,0 @@
-# This file gets copied into the Modules/ folder when building
-# newlib configurations which do not support dynamic library
-# loading.
-
-*static*
-
-# GNU readline. Unlike previous Python incarnations, GNU readline is
-# now incorporated in an optional module, configured in the Setup file
-# instead of by a configure script switch. You may have to insert a
-# -L option pointing to the directory where libreadline.* lives,
-# and you may have to change -ltermcap to -ltermlib or perhaps remove
-# it, depending on your system -- see the GNU readline instructions.
-# It's okay for this to be a shared library, too.
-
-readline readline.c -lreadline -ltermcap
-
-# Modules that should always be present (non UNIX dependent):
-
-array arraymodule.c # array objects
-cmath cmathmodule.c _math.c # -lm # complex math library functions
-math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
-_struct _struct.c # binary structure packing/unpacking
-time timemodule.c # -lm # time operations and variables
-operator operator.c # operator.add() and similar goodies
-_testcapi _testcapimodule.c # Python C API test module
-_random _randommodule.c # Random number generator
-_collections _collectionsmodule.c # Container types
-_heapq _heapqmodule.c # Heapq type
-itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-strop stropmodule.c # String manipulations
-_functools _functoolsmodule.c # Tools for working with functions and callable objects
-_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
-datetime datetimemodule.c # date/time type
-_bisect _bisectmodule.c # Bisection algorithms
-
-_json _json.c
-
-unicodedata unicodedata.c
-
-# Standard I/O baseline
-_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c
-
-
-# Modules with some UNIX dependencies -- on by default:
-# (If you have a really backward UNIX, select and socket may not be
-# supported...)
-
-fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-#spwd spwdmodule.c # spwd(3)
-#grp grpmodule.c # grp(3)
-select selectmodule.c # select(2); not on ancient System V
-
-# Memory-mapped files (also works on Win32).
-mmap mmapmodule.c
-
-# CSV file helper
-_csv _csv.c
-
-# Socket module helper for socket(2)
-_socket socketmodule.c timemodule.c
-
-# Some more UNIX dependent modules -- off by default, since these
-# are not supported by all UNIX systems:
-
-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-termios termios.c # Steen Lumholt's termios module
-#resource resource.c # Jeremy Hylton's rlimit interface
-
-_ssl _ssl.c -DUSE_SSL -lssl -lcrypto
-
-# Note that the _md5 and _sha modules are normally only built if the
-# system does not have the OpenSSL libs containing an optimized version.
-
-# The _md5 module implements the RSA Data Security, Inc. MD5
-# Message-Digest Algorithm, described in RFC 1321. The necessary files
-# md5.c and md5.h are included here.
-
-_md5 md5module.c md5.c
-
-
-# The _sha module implements the SHA checksum algorithms.
-# (NIST's Secure Hash Algorithms.)
-_sha shamodule.c
-_sha256 sha256module.c
-_sha512 sha512module.c
-
-# Helper module for various ascii-encoders
-binascii binascii.c
-
-future_builtins future_builtins.c
-
-# Fred Drake's interface to the Python parser
-parser parsermodule.c
-
-# cStringIO and cPickle
-cStringIO cStringIO.c
-cPickle cPickle.c
-
-# Andrew Kuchling's zlib module.
-# This require zlib 1.1.3 (or later).
-# See http://www.gzip.org/zlib/
-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-
-bz2 bz2module.c -I$(prefix)/include -L$(exec_prefix)/lib -lbz2
-
-# Multiprocessing
-_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/socket_connection.c
diff --git a/ports/python/background.js b/ports/python/background.js
deleted file mode 100644
index d6fb185..0000000
--- a/ports/python/background.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('index.html', {
- 'id': 'main',
- 'bounds': {
- 'width': 800,
- 'height': 800
- }
- });
-});
diff --git a/ports/python/build.sh b/ports/python/build.sh
deleted file mode 100644
index 29d12af..0000000
--- a/ports/python/build.sh
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXECUTABLES=python${NACL_EXEEXT}
-
-# This build relies on certain host binaries and python's configure
-# requires us to set --build= as well as --host=.
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-SetOptFlags() {
- # Python build system sets its own opt flags
- return
-}
-
-ConfigureStep() {
- # We pre-seed configure with certain results that it cannot determine
- # since we are doing a cross compile. The $CONFIG_SITE file is sourced
- # by configure early on.
- export CROSS_COMPILE=true
- export CONFIG_SITE=${START_DIR}/config.site
- # Disable ipv6 since configure claims it requires a working getaddrinfo
- # which we do not provide. TODO(sbc): remove this once nacl_io supports
- # getaddrinfo.
- EXTRA_CONFIGURE_ARGS+=" --disable-ipv6"
- EXTRA_CONFIGURE_ARGS+=" --with-suffix=${NACL_EXEEXT}"
- EXTRA_CONFIGURE_ARGS+=" --build=x86_64-linux-gnu"
- if [ "${NACL_DEBUG}" = 1 ]; then
- EXTRA_CONFIGURE_ARGS+=" --with-pydebug"
- fi
- NACLPORTS_LIBS+=" -ltermcap"
- if [ "${NACL_LIBC}" = "newlib" ]; then
- # When python builds with wait3/wait4 support it also expects struct rusage
- # to have certain fields and newlib lacks.
- export ac_cv_func_wait3=no
- export ac_cv_func_wait4=no
- fi
- EnableCliMain
- EnableGlibcCompat
- DefaultConfigureStep
- if [ "${NACL_LIBC}" = "newlib" ]; then
- # For static linking we copy in a pre-baked Setup.local
- LogExecute cp ${START_DIR}/Setup.local Modules/
- fi
-}
-
-BuildStep() {
- export CROSS_COMPILE=true
- export MAKEFLAGS="PGEN=${NACL_HOST_PYBUILD}/Parser/pgen"
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-InstallStep() {
- export CROSS_COMPILE=true
- DefaultInstallStep
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
-
- PublishMultiArch python${NACL_EXEEXT} python
- ChangeDir ${PUBLISH_DIR}
- if [[ $TOOLCHAIN == pnacl ]]; then
- local tar_file=pydata.tar
- else
- local tar_file=_platform_specific/${NACL_ARCH}/pydata.tar
- fi
-
- LogExecute tar cf ${tar_file} -C ${INSTALL_DIR}${PREFIX} lib/python2.7
- if [[ $NACL_SHARED == 1 ]]; then
- # Extra shared libraries depedencies requires by python loadable modules
- LogExecute tar rf ${tar_file} -h -C ${NACL_PREFIX} lib/libz.so.1 \
- lib/libreadline.so lib/libncurses.so.5 lib/libbz2.so.1.0 \
- lib/libssl.so.1.0.0 lib/libcrypto.so.1.0.0
- fi
- LogExecute shasum ${tar_file} > ${tar_file}.hash
-
- LogExecute python ${TOOLS_DIR}/create_term.py python.nmf
-
- GenerateManifest ${START_DIR}/manifest.json ${PUBLISH_DIR}
- InstallNaClTerm ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/background.js ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/python.js ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/index.html ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip python-${VERSION}.zip .
-}
diff --git a/ports/python/config.site b/ports/python/config.site
deleted file mode 100644
index dfe717a..0000000
--- a/ports/python/config.site
+++ /dev/null
@@ -1,17 +0,0 @@
-# Python's configure can't detect these two options when cross
-# compiling so we pre-seed it with the answers.
-ac_cv_file__dev_ptmx=no
-ac_cv_file__dev_ptc=no
-
-# Currently we don't provide an implemention of getnameinfo
-# in nacl_io, but python detects and uses the stub version in
-# glibc-compat. This forces python to use its own internal
-# implemenation.
-# TODO(sbc): Remove this once we add getnameinfo: http://crbug.com/386832
-ac_cv_func_getnameinfo=no
-
-# The check for uname currently fails with newlib since libnacl
-# does not contain a uname() stub function.
-# TODO(sbc): Remove this once uname() gets added to libnacl.
-# https://code.google.com/p/nativeclient/issues/detail?id=3997
-ac_cv_func_uname=yes
diff --git a/ports/python/icon_128.png b/ports/python/icon_128.png
deleted file mode 100644
index 9561dfd..0000000
--- a/ports/python/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/python/icon_16.png b/ports/python/icon_16.png
deleted file mode 100644
index 0b0d642..0000000
--- a/ports/python/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/python/icon_48.png b/ports/python/icon_48.png
deleted file mode 100644
index 31c74b9..0000000
--- a/ports/python/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/python/index.html b/ports/python/index.html
deleted file mode 100644
index bd32291..0000000
--- a/ports/python/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Python</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="python.js"></script>
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- overflow: hidden;
- }
-
- #terminal {
- display: block;
- position: static;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/python/manifest.json b/ports/python/manifest.json
deleted file mode 100644
index d212a8f..0000000
--- a/ports/python/manifest.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "Python",
- "description": "Python interactive shell built with Native Client",
- "version": "2.7.10.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": [
- "background.js"
- ]
- }
- },
- "platforms": [
- {
- "nacl_arch": "arm",
- "sub_package_path": "_platform_specific/arm/"
- },
- {
- "nacl_arch": "x86-32",
- "sub_package_path": "_platform_specific/i686/"
- },
- {
- "nacl_arch": "x86-64",
- "sub_package_path": "_platform_specific/x86_64/"
- }
- ],
- "permissions": [
- "clipboardRead",
- "clipboardWrite",
- "storage",
- "unlimitedStorage",
- { "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/python/nacl.patch b/ports/python/nacl.patch
deleted file mode 100644
index d817383..0000000
--- a/ports/python/nacl.patch
+++ /dev/null
@@ -1,964 +0,0 @@
-diff --git a/Include/datetime.h b/Include/datetime.h
---- a/Include/datetime.h
-+++ b/Include/datetime.h
-@@ -166,6 +166,8 @@ typedef struct {
-
- #ifdef Py_BUILD_CORE
-
-+#define PyDataTime_STATIC 1
-+
- /* Macros for type checking when building the Python core. */
- #define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType)
- #define PyDate_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateType)
-diff --git a/Lib/platform.py b/Lib/platform.py
---- a/Lib/platform.py
-+++ b/Lib/platform.py
-@@ -1001,7 +1001,7 @@ def _syscmd_uname(option,default=''):
-
- """ Interface to the system's uname command.
- """
-- if sys.platform in ('dos','win32','win16','os2'):
-+ if sys.platform in ('dos','win32','win16','os2','nacl'):
- # XXX Others too ?
- return default
- try:
-diff --git a/Lib/subprocess.py b/Lib/subprocess.py
---- a/Lib/subprocess.py
-+++ b/Lib/subprocess.py
-@@ -388,6 +388,7 @@ except that:
-
- import sys
- mswindows = (sys.platform == "win32")
-+nacl = (sys.platform == "nacl")
-
- import os
- import types
-@@ -1206,7 +1207,10 @@ class Popen(object):
- args = list(args)
-
- if shell:
-- args = ["/bin/sh", "-c"] + args
-+ if nacl:
-+ args = ["bash", "-c"] + args
-+ else:
-+ args = ["/bin/sh", "-c"] + args
- if executable:
- args[0] = executable
-
-@@ -1217,6 +1221,15 @@ class Popen(object):
- os.close(fd)
- to_close.remove(fd)
-
-+ # TODO(bradnelson,sbc): Add support for pipes.
-+ if nacl:
-+ if env is None:
-+ self.pid = os.spawnv(os.P_NOWAIT, executable, args)
-+ else:
-+ self.pid = os.spawnve(os.P_NOWAIT, executable, args, env)
-+ self._child_created = True
-+ return
-+
- # For transferring possible exec failure from child to parent
- # The first char specifies the exception type: 0 means
- # OSError, 1 means some other error.
-diff --git a/Makefile.pre.in b/Makefile.pre.in
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -610,14 +610,18 @@ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule
-
- $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
- @$(MKDIR_P) Include
-+ifndef CROSS_COMPILE
- $(MAKE) $(PGEN)
-+endif
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
- $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
- $(MAKE) $(GRAMMAR_H)
- touch $(GRAMMAR_C)
-
-+ifndef CROSS_COMPILE
- $(PGEN): $(PGENOBJS)
- $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
-+endif
-
- Parser/grammar.o: $(srcdir)/Parser/grammar.c \
- $(srcdir)/Include/token.h \
-@@ -1042,6 +1046,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
- $(DESTDIR)$(LIBDEST)/distutils/tests ; \
- fi
-+ifndef CROSS_COMPILE
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
-@@ -1060,6 +1065,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-+endif
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
---- a/Modules/_ctypes/libffi/configure
-+++ b/Modules/_ctypes/libffi/configure
-@@ -17261,7 +17261,7 @@ case "$host" in
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- case "$host" in
-- *-gnux32)
-+ *-gnux32 | *-nacl)
- TARGET=X86_64
- ;;
- *)
-diff --git a/Modules/_ctypes/libffi/src/x86/unix64.S b/Modules/_ctypes/libffi/src/x86/unix64.S
---- a/Modules/_ctypes/libffi/src/x86/unix64.S
-+++ b/Modules/_ctypes/libffi/src/x86/unix64.S
-@@ -1,5 +1,6 @@
- /* -----------------------------------------------------------------------
-- unix64.S - Copyright (c) 2013 The Written Word, Inc.
-+ unix64.S - Copyright (c) 2015 Georgia Institute of Technology
-+ - Copyright (c) 2013 The Written Word, Inc.
- - Copyright (c) 2008 Red Hat, Inc
- - Copyright (c) 2002 Bo Thorsen <bo@suse.de>
-
-@@ -31,6 +32,24 @@
- #include <fficonfig.h>
- #include <ffi.h>
-
-+.section .rodata
-+.Lstore_table:
-+ .long .Lst_void-.Lstore_table /* FFI_TYPE_VOID */
-+ .long .Lst_sint32-.Lstore_table /* FFI_TYPE_INT */
-+ .long .Lst_float-.Lstore_table /* FFI_TYPE_FLOAT */
-+ .long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */
-+ .long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
-+ .long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */
-+ .long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */
-+ .long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */
-+ .long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */
-+ .long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */
-+ .long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */
-+ .long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */
-+ .long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */
-+ .long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
-+ .long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
-+
- .text
-
- /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
-@@ -48,115 +67,122 @@ ffi_call_unix64:
- .LUW0:
- movq (%rsp), %r10 /* Load return address. */
- leaq (%rdi, %rsi), %rax /* Find local stack base. */
-- movq %rdx, (%rax) /* Save flags. */
-- movq %rcx, 8(%rax) /* Save raddr. */
-- movq %rbp, 16(%rax) /* Save old frame pointer. */
-- movq %r10, 24(%rax) /* Relocate return address. */
-- movq %rax, %rbp /* Finalize local stack frame. */
-+ movq %rdx, %nacl:0(%r15, %rax) /* Save flags. */
-+ movq %rcx, %nacl:8(%r15, %rax) /* Save raddr. */
-+ movq %rbp, %nacl:16(%r15, %rax) /* Save old frame pointer. */
-+ movq %r10, %nacl:24(%r15, %rax) /* Relocate return address. */
-+ naclrestbp %eax, %r15 /* Finalize local stack frame. */
- .LUW1:
-- movq %rdi, %r10 /* Save a copy of the register area. */
-- movq %r8, %r11 /* Save a copy of the target fn. */
-+ movl %edi, %r10d /* Save a copy of the register area. */
-+ movl %r8d, %r11d /* Save a copy of the target fn. */
- movl %r9d, %eax /* Set number of SSE registers. */
-
- /* Load up all argument registers. */
-- movq (%r10), %rdi
-- movq 8(%r10), %rsi
-- movq 16(%r10), %rdx
-- movq 24(%r10), %rcx
-- movq 32(%r10), %r8
-- movq 40(%r10), %r9
-+ movq %nacl:0(%r15, %r10), %rdi
-+ movq %nacl:8(%r15, %r10), %rsi
-+ movq %nacl:16(%r15, %r10), %rdx
-+ movq %nacl:24(%r15, %r10), %rcx
-+ movq %nacl:32(%r15, %r10), %r8
-+ movq %nacl:40(%r15, %r10), %r9
- testl %eax, %eax
- jnz .Lload_sse
- .Lret_from_load_sse:
-
- /* Deallocate the reg arg area. */
-- leaq 176(%r10), %rsp
-+ .bundle_lock
-+ leal 176(%r10), %esp
-+ addq %r15, %rsp
-+ .bundle_unlock
-
- /* Call the user function. */
-- call *%r11
-+ naclcall %r11d, %r15
-
- /* Deallocate stack arg area; local stack frame in redzone. */
-- leaq 24(%rbp), %rsp
-+ .bundle_lock
-+ leal 24(%rbp), %esp
-+ addq %r15, %rsp
-+ .bundle_unlock
-
- movq 0(%rbp), %rcx /* Reload flags. */
- movq 8(%rbp), %rdi /* Reload raddr. */
-- movq 16(%rbp), %rbp /* Reload old frame pointer. */
-+ naclrestbp 16(%rbp), %r15 /* Reload old frame pointer. */
- .LUW2:
-
- /* The first byte of the flags contains the FFI_TYPE. */
- movzbl %cl, %r10d
-- leaq .Lstore_table(%rip), %r11
-- movslq (%r11, %r10, 4), %r10
-- addq %r11, %r10
-- jmp *%r10
--
--.Lstore_table:
-- .long .Lst_void-.Lstore_table /* FFI_TYPE_VOID */
-- .long .Lst_sint32-.Lstore_table /* FFI_TYPE_INT */
-- .long .Lst_float-.Lstore_table /* FFI_TYPE_FLOAT */
-- .long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */
-- .long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
-- .long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */
-- .long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */
-- .long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */
-- .long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */
-- .long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */
-- .long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */
-- .long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */
-- .long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */
-- .long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
-- .long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
-+ leal .Lstore_table(%rip), %r11d
-+ leal (%r11, %r10, 4), %r10d
-+ movl %nacl:(%r15, %r10), %r10d
-+ addl %r11d, %r10d
-+ nacljmp %r10d, %r15
-
-- .align 2
-+ .align 32
- .Lst_void:
-- ret
-- .align 2
-+ pop %r11
-+ nacljmp %r11d, %r15
-
-+ .align 32
- .Lst_uint8:
- movzbq %al, %rax
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_sint8:
- movsbq %al, %rax
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_uint16:
- movzwq %ax, %rax
-- movq %rax, (%rdi)
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_sint16:
- movswq %ax, %rax
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_uint32:
- movl %eax, %eax
-- movq %rax, (%rdi)
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_sint32:
- cltq
-- movq %rax, (%rdi)
-- ret
-- .align 2
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_int64:
-- movq %rax, (%rdi)
-- ret
-+ movq %rax, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-
-- .align 2
-+ .align 32
- .Lst_float:
-- movss %xmm0, (%rdi)
-- ret
-- .align 2
-+ movss %xmm0, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-+
-+ .align 32
- .Lst_double:
-- movsd %xmm0, (%rdi)
-- ret
- .Lst_ldouble:
-- fstpt (%rdi)
-- ret
-+ movsd %xmm0, %nacl:0(%r15, %rdi)
-+ pop %r11
-+ nacljmp %r11d, %r15
-
-- .align 2
-+ .align 32
- .Lst_struct:
- leaq -20(%rsp), %rsi /* Scratch area in redzone. */
-
-@@ -175,14 +201,15 @@ ffi_call_unix64:
- testl $0x400, %ecx
- cmovnz %r10, %rax
- cmovnz %r11, %rdx
-- movq %rax, (%rsi)
-- movq %rdx, 8(%rsi)
-+ movq %rax, %nacl:0(%r15, %rsi)
-+ movq %rdx, %nacl:8(%r15, %rsi)
-
- /* Bits 12-31 contain the true size of the structure. Copy from
- the scratch area to the true destination. */
- shrl $12, %ecx
-- rep movsb
-- ret
-+ rep movs %nacl:(%rsi), %nacl:(%rdi), %r15
-+ pop %r11
-+ nacljmp %r11d, %r15
-
- /* Many times we can avoid loading any SSE registers at all.
- It's not worth an indirect jump to load the exact set of
-@@ -190,14 +217,14 @@ ffi_call_unix64:
- .align 2
- .LUW3:
- .Lload_sse:
-- movdqa 48(%r10), %xmm0
-- movdqa 64(%r10), %xmm1
-- movdqa 80(%r10), %xmm2
-- movdqa 96(%r10), %xmm3
-- movdqa 112(%r10), %xmm4
-- movdqa 128(%r10), %xmm5
-- movdqa 144(%r10), %xmm6
-- movdqa 160(%r10), %xmm7
-+ movdqa %nacl:48(%r15, %r10), %xmm0
-+ movdqa %nacl:64(%r15, %r10), %xmm1
-+ movdqa %nacl:80(%r15, %r10), %xmm2
-+ movdqa %nacl:96(%r15, %r10), %xmm3
-+ movdqa %nacl:112(%r15, %r10), %xmm4
-+ movdqa %nacl:128(%r15, %r10), %xmm5
-+ movdqa %nacl:144(%r15, %r10), %xmm6
-+ movdqa %nacl:160(%r15, %r10), %xmm7
- jmp .Lret_from_load_sse
-
- .LUW4:
-@@ -208,6 +235,10 @@ ffi_call_unix64:
- .type ffi_closure_unix64,@function
-
- ffi_closure_unix64:
-+#ifdef __native_client__
-+ hlt
-+#else
-+ /* THIS IMPLEMENTATION VIOLATES NATIVE CLIENT SFI MODEL */
- .LUW5:
- /* The carry flag is set by the trampoline iff SSE registers
- are used. Don't clobber it before the branch instruction. */
-@@ -422,9 +453,10 @@ ffi_closure_unix64:
-
- .align 8
- .LEFDE3:
--
- #endif /* __GNUC__ */
-
-+#endif /* __native_client__ */
-+
- #endif /* __x86_64__ */
-
- #if defined __ELF__ && defined __linux__
-diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
---- a/Modules/_testcapimodule.c
-+++ b/Modules/_testcapimodule.c
-@@ -1378,6 +1378,9 @@ static int test_run_counter = 0;
-
- static PyObject *
- test_datetime_capi(PyObject *self, PyObject *args) {
-+#ifdef PyDataTime_STATIC
-+ Py_RETURN_NONE;
-+#else
- if (PyDateTimeAPI) {
- if (test_run_counter) {
- /* Probably regrtest.py -R */
-@@ -1395,6 +1398,7 @@ test_datetime_capi(PyObject *self, PyObject *args) {
- Py_RETURN_NONE;
- else
- return NULL;
-+#endif
- }
-
-
-diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
---- a/Modules/mmapmodule.c
-+++ b/Modules/mmapmodule.c
-@@ -78,6 +78,12 @@ my_getpagesize(void)
- # define MAP_ANONYMOUS MAP_ANON
- #endif
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#define MS_SYNC 0
-+/* Defined in glibc-compat */
-+int msync(void *addr, size_t length, int flags);
-+#endif
-+
- static PyObject *mmap_module_error;
-
- typedef enum
-diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
---- a/Modules/posixmodule.c
-+++ b/Modules/posixmodule.c
-@@ -216,6 +216,13 @@ extern int lstat(const char *, struct stat *);
-
- #endif /* !_MSC_VER */
-
-+#if defined(__native_client__)
-+#include <spawn.h>
-+#if !defined(HAVE_SPAWNV)
-+#define HAVE_SPAWNV 1
-+#endif /* !defined(HAVE_SPAWNV) */
-+#endif /* defined(__native_client__) */
-+
- #ifdef HAVE_UTIME_H
- #include <utime.h>
- #endif /* HAVE_UTIME_H */
-@@ -718,9 +725,13 @@ posix_error_with_unicode_filename(Py_UNICODE* name)
-
-
- static PyObject *
--posix_error_with_allocated_filename(char* name)
-+posix_error_with_allocated_filename(const char* func, char* name)
- {
-- PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
-+ PyObject *rc;
-+ if (errno == ENOSYS)
-+ rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, func);
-+ else
-+ rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
- PyMem_Free(name);
- return rc;
- }
-@@ -881,7 +892,7 @@ posix_1str(PyObject *args, char *format, int (*func)(const char*))
- res = (*func)(path1);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path1);
-+ return posix_error_with_allocated_filename(format, path1);
- PyMem_Free(path1);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -1913,7 +1924,7 @@ posix_chmod(PyObject *self, PyObject *args)
- res = chmod(path, i);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("chmod", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -1960,7 +1971,7 @@ posix_lchmod(PyObject *self, PyObject *args)
- res = lchmod(path, i);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("lchmod", path);
- PyMem_Free(path);
- Py_RETURN_NONE;
- }
-@@ -1985,7 +1996,7 @@ posix_chflags(PyObject *self, PyObject *args)
- res = chflags(path, flags);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("chflags", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2011,7 +2022,7 @@ posix_lchflags(PyObject *self, PyObject *args)
- res = lchflags(path, flags);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("lchflags", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2082,7 +2093,7 @@ posix_chown(PyObject *self, PyObject *args)
- res = chown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("chown", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2137,7 +2148,7 @@ posix_lchown(PyObject *self, PyObject *args)
- res = lchown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("lchown", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -2532,7 +2543,7 @@ posix_listdir(PyObject *self, PyObject *args)
- dirp = opendir(name);
- Py_END_ALLOW_THREADS
- if (dirp == NULL) {
-- return posix_error_with_allocated_filename(name);
-+ return posix_error_with_allocated_filename("listdir", name);
- }
- if ((d = PyList_New(0)) == NULL) {
- Py_BEGIN_ALLOW_THREADS
-@@ -2554,7 +2565,7 @@ posix_listdir(PyObject *self, PyObject *args)
- closedir(dirp);
- Py_END_ALLOW_THREADS
- Py_DECREF(d);
-- return posix_error_with_allocated_filename(name);
-+ return posix_error_with_allocated_filename("listdir", name);
- }
- }
- if (ep->d_name[0] == '.' &&
-@@ -2714,7 +2725,7 @@ posix_mkdir(PyObject *self, PyObject *args)
- #endif
- Py_END_ALLOW_THREADS
- if (res < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("mkdir", path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-@@ -3113,7 +3124,7 @@ done:
- #endif /* HAVE_UTIMES */
- }
- if (res < 0) {
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("utime", path);
- }
- PyMem_Free(path);
- Py_INCREF(Py_None);
-@@ -3430,7 +3441,7 @@ posix_spawnv(PyObject *self, PyObject *args)
- }
- argvlist[argc] = NULL;
-
--#if defined(PYOS_OS2) && defined(PYCC_GCC)
-+#if (defined(PYOS_OS2) && defined(PYCC_GCC)) || defined(__native_client__)
- Py_BEGIN_ALLOW_THREADS
- spawnval = spawnv(mode, path, argvlist);
- Py_END_ALLOW_THREADS
-@@ -3575,7 +3586,7 @@ posix_spawnve(PyObject *self, PyObject *args)
- }
- envlist[envc] = 0;
-
--#if defined(PYOS_OS2) && defined(PYCC_GCC)
-+#if (defined(PYOS_OS2) && defined(PYCC_GCC)) || defined(__native_client__)
- Py_BEGIN_ALLOW_THREADS
- spawnval = spawnve(mode, path, argvlist, envlist);
- Py_END_ALLOW_THREADS
-@@ -6370,7 +6381,7 @@ posix_readlink(PyObject *self, PyObject *args)
- n = readlink(path, buf, (int) sizeof buf);
- Py_END_ALLOW_THREADS
- if (n < 0)
-- return posix_error_with_allocated_filename(path);
-+ return posix_error_with_allocated_filename("readlink", path);
-
- PyMem_Free(path);
- v = PyString_FromStringAndSize(buf, n);
-@@ -6616,7 +6627,7 @@ posix_open(PyObject *self, PyObject *args)
- PyErr_Clear();
- #endif
-
-- if (!PyArg_ParseTuple(args, "eti|i",
-+ if (!PyArg_ParseTuple(args, "eti|i:open",
- Py_FileSystemDefaultEncoding, &file,
- &flag, &mode))
- return NULL;
-@@ -6625,7 +6636,7 @@ posix_open(PyObject *self, PyObject *args)
- fd = open(file, flag, mode);
- Py_END_ALLOW_THREADS
- if (fd < 0)
-- return posix_error_with_allocated_filename(file);
-+ return posix_error_with_allocated_filename("open", file);
- PyMem_Free(file);
- return PyInt_FromLong((long)fd);
- }
-@@ -9431,6 +9442,11 @@ all_ins(PyObject *d)
- if (ins(d, "P_TILDE", (long)P_TILDE)) return -1;
- if (ins(d, "P_UNRELATED", (long)P_UNRELATED)) return -1;
- if (ins(d, "P_DEBUGDESC", (long)P_DEBUGDESC)) return -1;
-+#elif defined(__native_client__)
-+ if (ins(d, "P_WAIT", (long)P_WAIT)) return -1;
-+ if (ins(d, "P_NOWAIT", (long)P_NOWAIT)) return -1;
-+ if (ins(d, "P_OVERLAY", (long)P_OVERLAY)) return -1;
-+ if (ins(d, "P_NOWAITO", (long)P_NOWAITO)) return -1;
- #else
- if (ins(d, "P_WAIT", (long)_P_WAIT)) return -1;
- if (ins(d, "P_NOWAIT", (long)_P_NOWAIT)) return -1;
-diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
---- a/Modules/pwdmodule.c
-+++ b/Modules/pwdmodule.c
-@@ -94,6 +94,29 @@ mkpwent(struct passwd *p)
- return v;
- }
-
-+#ifdef __native_client__
-+// python relies on a working version of getpwuid(3)
-+// which Native Client does not yet provide.
-+// TODO(sbc): This should only really be needed when
-+// building for the sel_ldr. It should be possible to
-+// use the C-library version (which tries of open files
-+// under /etc) when using nacl_io.
-+static struct passwd *my_getpwuid(uid_t uid)
-+{
-+ static struct passwd dummy = {
-+ "nacl_user",
-+ "nacl_pass",
-+ 1,
-+ 1,
-+ "NaCl User",
-+ "/home/nacl_user",
-+ "/bin/sh",
-+ };
-+ return &dummy;
-+}
-+#define getpwuid my_getpwuid
-+#endif
-+
- PyDoc_STRVAR(pwd_getpwuid__doc__,
- "getpwuid(uid) -> (pw_name,pw_passwd,pw_uid,\n\
- pw_gid,pw_gecos,pw_dir,pw_shell)\n\
-diff --git a/Modules/python.c b/Modules/python.c
---- a/Modules/python.c
-+++ b/Modules/python.c
-@@ -6,6 +6,20 @@
- #include <floatingpoint.h>
- #endif
-
-+#ifdef __native_client__
-+#ifdef __arm__
-+#define DATA_FILE "_platform_specific/arm/pydata.tar"
-+#elif defined __i386__
-+#define DATA_FILE "_platform_specific/i686/pydata.tar"
-+#elif defined __x86_64__
-+#define DATA_FILE "_platform_specific/x86_64/pydata.tar"
-+#elif defined __pnacl__
-+#define DATA_FILE "pydata.tar"
-+#else
-+#error "Unknown arch"
-+#endif
-+#endif
-+
- int
- main(int argc, char **argv)
- {
-@@ -20,5 +34,11 @@ main(int argc, char **argv)
- m = fpgetmask();
- fpsetmask(m & ~FP_X_OFL);
- #endif
-+#ifdef __native_client__
-+ setvbuf(stdout, NULL, _IOLBF, 0);
-+ setvbuf(stdin, NULL, _IOLBF, 0);
-+ if (nacl_startup_untar(argv[0], DATA_FILE, "/"))
-+ return -1;
-+#endif
- return Py_Main(argc, argv);
- }
-diff --git a/Modules/readline.c b/Modules/readline.c
---- a/Modules/readline.c
-+++ b/Modules/readline.c
-@@ -965,7 +965,12 @@ setup_readline(void)
- /* Wrapper around GNU readline that handles signals differently. */
-
-
--#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT)
-+/*
-+ * Don't use the select()-based readline under Native Client. While select()
-+ * is available and compile and link time it will fail at runtime under sel_ldr
-+ * since there is no IRT/syscall implemenation of select().
-+ */
-+#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) && !defined(__native_client__)
-
- static char *completed_input_string;
- static void
-diff --git a/Modules/timemodule.c b/Modules/timemodule.c
---- a/Modules/timemodule.c
-+++ b/Modules/timemodule.c
-@@ -34,6 +34,11 @@ extern int ftime(struct timeb *);
- #endif /* MS_WINDOWS */
- #endif /* HAVE_FTIME */
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+#define timezone _timezone
-+#define daylight _daylight
-+#endif
-+
- #if defined(__WATCOMC__) && !defined(__QNX__)
- #include <i86.h>
- #else
-diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
---- a/Python/dynload_shlib.c
-+++ b/Python/dynload_shlib.c
-@@ -84,6 +84,11 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
- PyOS_snprintf(funcname, sizeof(funcname),
- LEAD_UNDERSCORE "init%.200s", shortname);
-
-+
-+/* Native Client's fstat() imlemenation doesn't set st_dev
-+ * and st_ino correctly so disable the dlopen handle cache.
-+ * TODO(sbc): fix NaCl's fstat() */
-+#ifndef __native_client__
- if (fp != NULL) {
- int i;
- struct stat statb;
-@@ -107,6 +112,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
- #endif
- }
- }
-+#endif
-
- #if !(defined(PYOS_OS2) && defined(PYCC_GCC))
- dlopenflags = PyThreadState_GET()->interp->dlopenflags;
-diff --git a/Python/getversion.c b/Python/getversion.c
---- a/Python/getversion.c
-+++ b/Python/getversion.c
-@@ -8,8 +8,8 @@
- const char *
- Py_GetVersion(void)
- {
-- static char version[250];
-- PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
-+ static char version[270];
-+ PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.100s",
- PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
- return version;
- }
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -2880,6 +2880,12 @@ if test "$cross_compiling" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
- $as_echo_n "checking for python interpreter for cross build... " >&6; }
- if test -z "$PYTHON_FOR_BUILD"; then
-+ case "$host" in
-+ *-*-nacl*)
-+ interp=$(cd ../../python-host/build_host && pwd)/python.exe
-+ if [ ! -f $interp ]; then interp=$(cd ../../python-host/build_host && pwd)/python; fi
-+ ;;
-+ *)
- for interp in python$PACKAGE_VERSION python2 python; do
- which $interp >/dev/null 2>&1 || continue
- if $interp -c 'import sys;sys.exit(not (sys.version_info[:2] >= (2,7) and sys.version_info[0] < 3))'; then
-@@ -2887,12 +2893,13 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
- fi
- interp=
- done
-+ esac
- if test x$interp = x; then
- as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
- $as_echo "$interp" >&6; }
-- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
-+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(abs_srcdir)/Lib:$(abs_srcdir)/Lib/$(PLATDIR) '$interp
- fi
- elif test "$cross_compiling" = maybe; then
- as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
-@@ -3196,6 +3203,9 @@ then
- # `define_xopen_source' in the case statement below. For the
- # current supported cross builds, this macro is not adjusted.
- case "$host" in
-+ *-*-nacl*)
-+ ac_sys_system=NaCl
-+ ;;
- *-*-linux*)
- ac_sys_system=Linux
- ;;
-@@ -3245,6 +3255,15 @@ if test "$cross_compiling" = yes; then
- _host_cpu=$host_cpu
- esac
- ;;
-+ *-*-nacl*)
-+ case "$host_cpu" in
-+ arm*)
-+ _host_cpu=arm
-+ ;;
-+ *)
-+ _host_cpu=$host_cpu
-+ esac
-+ ;;
- *-*-cygwin*)
- _host_cpu=
- ;;
-@@ -5168,7 +5187,11 @@ if test -d casesensitivetestdir
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-- BUILDEXEEXT=.exe
-+ if [ -z $EXEEXT ]; then
-+ BUILDEXEEXT=.exe
-+ else
-+ BUILDEXEEXT=$EXEEXT
-+ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
-@@ -5966,11 +5989,11 @@ then
- # debug builds.
- OPT="-g -O0 -Wall $STRICT_PROTO"
- else
-- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
-+ OPT="-g $WRAP -O2 -Wall $STRICT_PROTO"
- fi
- ;;
- *)
-- OPT="-O3 -Wall $STRICT_PROTO"
-+ OPT="-O2 -Wall $STRICT_PROTO"
- ;;
- esac
- case $ac_sys_system in
-@@ -8270,7 +8293,7 @@ then
- BLDSHARED="$LDSHARED"
- fi
- ;;
-- Linux*|GNU*|QNX*)
-+ Linux*|GNU*|QNX*|NaCl*)
- LDSHARED='$(CC) -shared'
- LDCXXSHARED='$(CXX) -shared';;
- BSD/OS*/4*)
-@@ -8344,7 +8367,7 @@ then
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
- fi;;
-- Linux*|GNU*) CCSHARED="-fPIC";;
-+ Linux*|GNU*|NaCl*) CCSHARED="-fPIC";;
- BSD/OS*/4*) CCSHARED="-fpic";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
- OpenUNIX*|UnixWare*)
-@@ -8378,7 +8401,7 @@ then
- LINKFORSHARED="-Wl,-E -Wl,+s";;
- # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
-- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
-+ Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";;
- # -u libsys_s pulls in all symbols in libsys
- Darwin/*)
- # -u _PyMac_Error is needed to pull in the mac toolbox glue,
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -22,6 +22,12 @@ rm -f pybuilddir.txt
- if test "$cross_compiling" = yes; then
- AC_MSG_CHECKING([for python interpreter for cross build])
- if test -z "$PYTHON_FOR_BUILD"; then
-+ case "$host" in
-+ *-*-nacl*)
-+ interp=$(cd ../../python-host/build_host && pwd)/python.exe
-+ if [ ! -f $interp ]; then interp=$(cd ../../python-host/build_host && pwd)/python; fi
-+ ;;
-+ *)
- for interp in python$PACKAGE_VERSION python2 python; do
- which $interp >/dev/null 2>&1 || continue
- if $interp -c 'import sys;sys.exit(not (sys.version_info@<:@:2@:>@ >= (2,7) and sys.version_info@<:@0@:>@ < 3))'; then
-@@ -29,11 +35,12 @@ if test "$cross_compiling" = yes; then
- fi
- interp=
- done
-+ esac
- if test x$interp = x; then
- AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
- fi
- AC_MSG_RESULT($interp)
-- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
-+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(abs_srcdir)/Lib:$(abs_srcdir)/Lib/$(PLATDIR) '$interp
- fi
- elif test "$cross_compiling" = maybe; then
- AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
-@@ -322,6 +329,9 @@ then
- *-*-cygwin*)
- ac_sys_system=Cygwin
- ;;
-+ *-*-nacl*)
-+ ac_sys_system=NaCl
-+ ;;
- *)
- # for now, limit cross builds to known configurations
- MACHDEP="unknown"
-@@ -365,6 +375,15 @@ if test "$cross_compiling" = yes; then
- _host_cpu=$host_cpu
- esac
- ;;
-+ *-*-nacl*)
-+ case "$host_cpu" in
-+ arm*)
-+ _host_cpu=arm
-+ ;;
-+ *)
-+ _host_cpu=$host_cpu
-+ esac
-+ ;;
- *-*-cygwin*)
- _host_cpu=
- ;;
-@@ -2036,7 +2055,7 @@ then
- BLDSHARED="$LDSHARED"
- fi
- ;;
-- Linux*|GNU*|QNX*)
-+ Linux*|GNU*|QNX*|NaCl*)
- LDSHARED='$(CC) -shared'
- LDCXXSHARED='$(CXX) -shared';;
- BSD/OS*/4*)
-@@ -2108,7 +2127,7 @@ then
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
- fi;;
-- Linux*|GNU*) CCSHARED="-fPIC";;
-+ Linux*|GNU*|NaCl*) CCSHARED="-fPIC";;
- BSD/OS*/4*) CCSHARED="-fpic";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
- OpenUNIX*|UnixWare*)
-@@ -2140,7 +2159,7 @@ then
- LINKFORSHARED="-Wl,-E -Wl,+s";;
- # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
-- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
-+ Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";;
- # -u libsys_s pulls in all symbols in libsys
- Darwin/*)
- # -u _PyMac_Error is needed to pull in the mac toolbox glue,
diff --git a/ports/python/pkg_info b/ports/python/pkg_info
deleted file mode 100644
index 63a3f18..0000000
--- a/ports/python/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=python
-VERSION=2.7.10
-ARCHIVE_ROOT=Python-2.7.10
-URL=http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(glibc-compat readline zlib libtar nacl-spawn openssl bzip2 python-host)
-CONFLICTS=(python-static)
-# incomplete lconv struct
-SHA1=49089f1f6ab445dc8ace97beeb276095c4c8039b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python/python.js b/ports/python/python.js
deleted file mode 100644
index e382cbb..0000000
--- a/ports/python/python.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-NaClTerm.nmf = 'python.nmf';
diff --git a/ports/python3/README.nacl b/ports/python3/README.nacl
deleted file mode 100644
index 8be9b1f..0000000
--- a/ports/python3/README.nacl
+++ /dev/null
@@ -1,14 +0,0 @@
-Python Interative Shell for Chrome
-==================================
-
-This is package of the Python interactive shell built to run
-under Native Client within chrome/chromium.
-
-The logo files here are derived from the SVG logo available at
-http://www.python.org/community/logos/
-
-Run ./nacl-python_ppapi.sh to build Python for use directly within
-chrome (requires the --enable-nacl flag) or via the chome web
-store. The chrome webstore version is published here:
-
-https://chrome.google.com/webstore/detail/python/nodpmmidbgeganfponihbgmfcoiibffi
diff --git a/ports/python3/Setup.local b/ports/python3/Setup.local
deleted file mode 100644
index db68181..0000000
--- a/ports/python3/Setup.local
+++ /dev/null
@@ -1,152 +0,0 @@
-# This file gets copied into the Modules/ folder when building
-# newlib configurations which do not support dynamic library
-# loading.
-
-*static*
-
-# GNU readline. Unlike previous Python incarnations, GNU readline is
-# now incorporated in an optional module, configured in the Setup file
-# instead of by a configure script switch. You may have to insert a
-# -L option pointing to the directory where libreadline.* lives,
-# and you may have to change -ltermcap to -ltermlib or perhaps remove
-# it, depending on your system -- see the GNU readline instructions.
-# It's okay for this to be a shared library, too.
-
-readline readline.c -lreadline -ltermcap
-
-# Modules that should always be present (non UNIX dependent):
-
-array arraymodule.c # array objects
-cmath cmathmodule.c _math.c # -lm # complex math library functions
-math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
-_struct _struct.c # binary structure packing/unpacking
-time timemodule.c # -lm # time operations and variables
-_testcapi _testcapimodule.c # Python C API test module
-_random _randommodule.c # Random number generator
-_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
-_pickle _pickle.c # pickle accelerator
-_datetime _datetimemodule.c # datetime accelerator
-_bisect _bisectmodule.c # Bisection algorithms
-_heapq _heapqmodule.c # Heap queue algorithm
-
-# Modules with some UNIX dependencies -- on by default:
-# (If you have a really backward UNIX, select and socket may not be
-# supported...)
-
-#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-#spwd spwdmodule.c # spwd(3)
-#grp grpmodule.c # grp(3)
-select selectmodule.c # select(2); not on ancient System V
-
-# Memory-mapped files (also works on Win32).
-#mmap mmapmodule.c
-
-# CSV file helper
-_csv _csv.c
-
-# Socket module helper for socket(2)
-_socket socketmodule.c timemodule.c
-
-# Socket module helper for SSL support; you must comment out the other
-# socket line above, and possibly edit the SSL variable:
-#SSL=/usr/local/ssl
-#_ssl _ssl.c \
-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-# -L$(SSL)/lib -lssl -lcrypto
-
-# The crypt module is now disabled by default because it breaks builds
-# on many systems (where -lcrypt is needed), e.g. Linux (I believe).
-#
-# First, look at Setup.config; configure may have set this for you.
-
-#_crypt _cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-
-
-# Some more UNIX dependent modules -- off by default, since these
-# are not supported by all UNIX systems:
-
-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-#termios termios.c # Steen Lumholt's termios module
-#resource resource.c # Jeremy Hylton's rlimit interface
-
-#_posixsubprocess _posixsubprocess.c # POSIX subprocess module helper
-
-# Multimedia modules -- off by default.
-# These don't work for 64-bit platforms!!!
-# #993173 says audioop works on 64-bit platforms, though.
-# These represent audio samples or images as strings:
-
-#audioop audioop.c # Operations on audio samples
-
-
-# Note that the _md5 and _sha modules are normally only built if the
-# system does not have the OpenSSL libs containing an optimized version.
-
-# The _md5 module implements the RSA Data Security, Inc. MD5
-# Message-Digest Algorithm, described in RFC 1321.
-
-_md5 md5module.c
-
-
-# The _sha module implements the SHA checksum algorithms.
-# (NIST's Secure Hash Algorithms.)
-_sha1 sha1module.c
-_sha256 sha256module.c
-_sha512 sha512module.c
-
-# Helper module for various ascii-encoders
-binascii binascii.c
-
-# Fred Drake's interface to the Python parser
-parser parsermodule.c
-
-# Lee Busby's SIGFPE modules.
-# The library to link fpectl with is platform specific.
-# Choose *one* of the options below for fpectl:
-
-# For SGI IRIX (tested on 5.3):
-#fpectl fpectlmodule.c -lfpe
-
-# For Solaris with SunPro compiler (tested on Solaris 2.5 with SunPro C 4.2):
-# (Without the compiler you don't have -lsunmath.)
-#fpectl fpectlmodule.c -R/opt/SUNWspro/lib -lsunmath -lm
-
-# For other systems: see instructions in fpectlmodule.c.
-#fpectl fpectlmodule.c ...
-
-# Test module for fpectl. No extra libraries needed.
-#fpetest fpetestmodule.c
-
-# Andrew Kuchling's zlib module.
-# This require zlib 1.1.3 (or later).
-# See http://www.gzip.org/zlib/
-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-
-_bz2 _bz2module.c -I$(prefix)/include -L$(exec_prefix)/lib -lbz2
-
-
-# Interface to the Expat XML parser
-#
-# Expat was written by James Clark and is now maintained by a group of
-# developers on SourceForge; see www.libexpat.org for more
-# information. The pyexpat module was written by Paul Prescod after a
-# prototype by Jack Jansen. Source of Expat 1.95.2 is included in
-# Modules/expat/. Usage of a system shared libexpat.so/expat.dll is
-# not advised.
-#
-# More information on Expat can be found at www.libexpat.org.
-#
-pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
-
-# Hye-Shik Chang's CJKCodecs
-
-# multibytecodec is required for all the other CJK codec modules
-#_multibytecodec cjkcodecs/multibytecodec.c
-
-#_codecs_cn cjkcodecs/_codecs_cn.c
-#_codecs_hk cjkcodecs/_codecs_hk.c
-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-#_codecs_jp cjkcodecs/_codecs_jp.c
-#_codecs_kr cjkcodecs/_codecs_kr.c
-#_codecs_tw cjkcodecs/_codecs_tw.c
-
diff --git a/ports/python3/background.js b/ports/python3/background.js
deleted file mode 100644
index d6fb185..0000000
--- a/ports/python3/background.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('index.html', {
- 'id': 'main',
- 'bounds': {
- 'width': 800,
- 'height': 800
- }
- });
-});
diff --git a/ports/python3/build.sh b/ports/python3/build.sh
deleted file mode 100644
index 2d161e2..0000000
--- a/ports/python3/build.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright (c) 2013 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.
-
-EXECUTABLES=python${NACL_EXEEXT}
-
-# Currently this package only builds on linux.
-# The build relies on certain host binaries and python's configure
-# requires us to set --build= as well as --host=.
-
-HOST_BUILD_DIR=${WORK_DIR}/build_host
-export PATH=${HOST_BUILD_DIR}/inst/usr/local/bin:${PATH}
-
-SetOptFlags() {
- # Python build system sets its own opt flags
- return
-}
-
-BuildHostPython() {
- MakeDir ${HOST_BUILD_DIR}
- ChangeDir ${HOST_BUILD_DIR}
- if [ -f python -a -f Parser/pgen ]; then
- return
- fi
- LogExecute ${SRC_DIR}/configure
- LogExecute make -j${OS_JOBS} all
- LogExecute make install DESTDIR=inst
-}
-
-ConfigureStep() {
- BuildHostPython
- ChangeDir ${BUILD_DIR}
- # We pre-seed configure with certain results that it cannot determine
- # since we are doing a cross compile. The $CONFIG_SITE file is sourced
- # by configure early on.
- export CONFIG_SITE=${START_DIR}/config.site
- # Disable ipv6 since configure claims it requires a working getaddrinfo
- # which we do not provide. TODO(sbc): remove this once nacl_io supports
- # getaddrinfo.
- EXTRA_CONFIGURE_ARGS="--disable-ipv6"
- EXTRA_CONFIGURE_ARGS+=" --with-suffix=${NACL_EXEEXT}"
- EXTRA_CONFIGURE_ARGS+=" --build=x86_64-linux-gnu"
- if [ "${NACL_DEBUG}" = 1 ]; then
- EXTRA_CONFIGURE_ARGS+=" --with-pydebug"
- fi
- if [ "${TOOLCHAIN}" = "glibc" -a "${NACL_ARCH}" = "arm" ]; then
- # Ignore sys/xattr.h, since glibc/arm toolchain does not define
- # XATTR_SIZE_MAX:
- # https://code.google.com/p/nativeclient/issues/detail?id=4300
- export ac_cv_header_sys_xattr_h=no
- fi
- NACLPORTS_LIBS+=" -ltermcap"
- if [ "${NACL_LIBC}" = "newlib" ]; then
- # When python builds with wait3/wait4 support it also expects struct rusage
- # to have certain fields and newlib lacks.
- export ac_cv_func_wait3=no
- export ac_cv_func_wait4=no
- fi
- EnableCliMain
- EnableGlibcCompat
- DefaultConfigureStep
- if [ "${NACL_LIBC}" = "newlib" ]; then
- LogExecute cp ${START_DIR}/Setup.local Modules/
- fi
-}
-
-BuildStep() {
- export CROSS_COMPILE=true
- export MAKEFLAGS="PGEN=${HOST_BUILD_DIR}/Parser/pgen"
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
-
- PublishMultiArch python${NACL_EXEEXT} python
- if [[ $TOOLCHAIN == pnacl ]]; then
- local tar_file=pydata.tar
- else
- local tar_file=_platform_specific/${NACL_ARCH}/pydata.tar
- fi
-
- ChangeDir ${PUBLISH_DIR}
- LogExecute tar cf ${tar_file} -C ${INSTALL_DIR}${PREFIX} lib/python3.4
- LogExecute shasum ${tar_file} > ${tar_file}.hash
-
- LogExecute python ${TOOLS_DIR}/create_term.py python.nmf
-
- GenerateManifest ${START_DIR}/manifest.json ${PUBLISH_DIR}
- InstallNaClTerm ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/background.js ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/python.js ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/index.html ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip python3-${VERSION}.zip .
-}
diff --git a/ports/python3/config.site b/ports/python3/config.site
deleted file mode 100644
index b79c60c..0000000
--- a/ports/python3/config.site
+++ /dev/null
@@ -1,14 +0,0 @@
-# Python's configure can't detect these two options when cross
-# compiling so we pre-seed it with the answers.
-ac_cv_file__dev_ptmx=no
-ac_cv_file__dev_ptc=no
-
-# These seem to be detected even though not there.
-ac_cv_func_sched_setparam=no
-ac_cv_func_sched_setscheduler=no
-
-# Force python's configure to think that _POSIX_THREADS is defined
-# in unistd.h even though under newlib it is not.
-# TODO(sbc): Remove this once newlib is fixed:
-# https://code.google.com/p/nativeclient/issues/detail?id=3551
-ac_cv_pthread=yes
diff --git a/ports/python3/icon_128.png b/ports/python3/icon_128.png
deleted file mode 100644
index 9561dfd..0000000
--- a/ports/python3/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/python3/icon_16.png b/ports/python3/icon_16.png
deleted file mode 100644
index 0b0d642..0000000
--- a/ports/python3/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/python3/icon_48.png b/ports/python3/icon_48.png
deleted file mode 100644
index 31c74b9..0000000
--- a/ports/python3/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/python3/index.html b/ports/python3/index.html
deleted file mode 100644
index bd32291..0000000
--- a/ports/python3/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Python</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="python.js"></script>
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- overflow: hidden;
- }
-
- #terminal {
- display: block;
- position: static;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/python3/manifest.json b/ports/python3/manifest.json
deleted file mode 100644
index e5f1611..0000000
--- a/ports/python3/manifest.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "name": "Python3",
- "description": "Python 3.4 interactive shell built with Native Client",
- "version": "3.4.2.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "platforms": [
- {
- "nacl_arch": "arm",
- "sub_package_path": "_platform_specific/arm/"
- },
- {
- "nacl_arch": "x86-32",
- "sub_package_path": "_platform_specific/i686/"
- },
- {
- "nacl_arch": "x86-64",
- "sub_package_path": "_platform_specific/x86_64/"
- }
- ],
- "permissions": [
- "clipboardRead",
- "clipboardWrite",
- "storage",
- "unlimitedStorage",
- { "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/python3/nacl.patch b/ports/python3/nacl.patch
deleted file mode 100644
index 4fc518e..0000000
--- a/ports/python3/nacl.patch
+++ /dev/null
@@ -1,510 +0,0 @@
-diff --git a/Include/datetime.h b/Include/datetime.h
---- a/Include/datetime.h
-+++ b/Include/datetime.h
-@@ -169,6 +169,8 @@ typedef struct {
-
- #ifdef Py_BUILD_CORE
-
-+#define PyDataTime_STATIC 1
-+
- /* Macros for type checking when building the Python core. */
- #define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType)
- #define PyDate_CheckExact(op) (Py_TYPE(op) == &PyDateTime_DateType)
-diff --git a/Makefile.pre.in b/Makefile.pre.in
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -747,14 +747,18 @@ $(IO_OBJS): $(IO_H)
-
- $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
- @$(MKDIR_P) Include
-+ifndef CROSS_COMPILE
- $(MAKE) $(PGEN)
-+endif
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
- $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
- $(MAKE) $(GRAMMAR_H)
- touch $(GRAMMAR_C)
-
-+ifndef CROSS_COMPILE
- $(PGEN): $(PGENOBJS)
- $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
-+endif
-
- Parser/grammar.o: $(srcdir)/Parser/grammar.c \
- $(srcdir)/Include/token.h \
-@@ -1539,9 +1543,12 @@ profile-removal:
- rm -rf $(COVERAGE_REPORT)
-
- clobber: clean profile-removal
-- -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
-+ -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
- tags TAGS \
- config.cache config.log pyconfig.h Modules/config.c
-+ifndef CROSS_COMPILE
-+ -rm -f $(PGEN)
-+endif
- -rm -rf build platform
- -rm -rf $(PYTHONFRAMEWORKDIR)
- -rm -f python-config.py python-config
-diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
---- a/Modules/_ctypes/libffi/configure
-+++ b/Modules/_ctypes/libffi/configure
-@@ -17261,7 +17261,7 @@ case "$host" in
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- case "$host" in
-- *-gnux32)
-+ *-gnux32 | *-nacl)
- TARGET=X86_64
- ;;
- *)
-diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
---- a/Modules/_datetimemodule.c
-+++ b/Modules/_datetimemodule.c
-@@ -7,6 +7,14 @@
-
- #include <time.h>
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+/* TODO(sbc): remove once this gets fixed:
-+ * https://code.google.com/p/nativeclient/issues/detail?id=3737
-+ */
-+#define timezone _timezone
-+#define daylight _daylight
-+#endif
-+
- /* Differentiate between building the core module and building extension
- * modules.
- */
-diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
---- a/Modules/_testcapimodule.c
-+++ b/Modules/_testcapimodule.c
-@@ -1810,6 +1810,9 @@ static int test_run_counter = 0;
-
- static PyObject *
- test_datetime_capi(PyObject *self, PyObject *args) {
-+#ifdef PyDataTime_STATIC
-+ Py_RETURN_NONE;
-+#else
- if (PyDateTimeAPI) {
- if (test_run_counter) {
- /* Probably regrtest.py -R */
-@@ -1827,6 +1830,7 @@ test_datetime_capi(PyObject *self, PyObject *args) {
- Py_RETURN_NONE;
- else
- return NULL;
-+#endif
- }
-
-
-diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
---- a/Modules/faulthandler.c
-+++ b/Modules/faulthandler.c
-@@ -15,6 +15,15 @@
- # define FAULTHANDLER_LATER
- #endif
-
-+#ifdef __native_client__
-+# ifndef SA_RESTART
-+# define SA_RESTART 0
-+# endif
-+# ifndef SA_NODEFER
-+# define SA_NODEFER 0
-+# endif
-+#endif
-+
- #ifndef MS_WINDOWS
- /* register() is useless on Windows, because only SIGSEGV, SIGABRT and
- SIGILL can be handled by the process, and these signals can only be used
-diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
---- a/Modules/pwdmodule.c
-+++ b/Modules/pwdmodule.c
-@@ -87,6 +87,29 @@ mkpwent(struct passwd *p)
- return v;
- }
-
-+#ifdef __native_client__
-+// python relies on a working version of getpwuid(3)
-+// which Native Client does not yet provide.
-+// TODO(sbc): This should only really be needed when
-+// building for the sel_ldr. It should be possible to
-+// use the C-library version (which tries of open files
-+// under /etc) when using nacl_io.
-+static struct passwd *my_getpwuid(uid_t uid)
-+{
-+ static struct passwd dummy = {
-+ "nacl_user",
-+ "nacl_pass",
-+ 1,
-+ 1,
-+ "NaCl User",
-+ "/home/nacl_user",
-+ "/bin/sh",
-+ };
-+ return &dummy;
-+}
-+#define getpwuid my_getpwuid
-+#endif
-+
- PyDoc_STRVAR(pwd_getpwuid__doc__,
- "getpwuid(uid) -> (pw_name,pw_passwd,pw_uid,\n\
- pw_gid,pw_gecos,pw_dir,pw_shell)\n\
-diff --git a/Modules/python.c b/Modules/python.c
---- a/Modules/python.c
-+++ b/Modules/python.c
-@@ -15,6 +15,22 @@ wmain(int argc, wchar_t **argv)
- }
- #else
-
-+#ifdef __native_client__
-+#include "nacl_main.h"
-+
-+#ifdef __arm__
-+#define DATA_FILE "_platform_specific/arm/pydata.tar"
-+#elif defined __i386__
-+#define DATA_FILE "_platform_specific/i686/pydata.tar"
-+#elif defined __x86_64__
-+#define DATA_FILE "_platform_specific/x86_64/pydata.tar"
-+#elif defined __pnacl__
-+#define DATA_FILE "pydata.tar"
-+#else
-+#error "Unknown arch"
-+#endif
-+#endif
-+
- int
- main(int argc, char **argv)
- {
-@@ -26,6 +42,10 @@ main(int argc, char **argv)
- #ifdef __FreeBSD__
- fp_except_t m;
- #endif
-+#ifdef __native_client__
-+ if (nacl_startup_untar(argv[0], DATA_FILE, "/"))
-+ return -1;
-+#endif
-
- argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
- argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
-diff --git a/Modules/readline.c b/Modules/readline.c
---- a/Modules/readline.c
-+++ b/Modules/readline.c
-@@ -1051,8 +1051,12 @@ setup_readline(readlinestate *mod_state)
-
- /* Wrapper around GNU readline that handles signals differently. */
-
--
--#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT)
-+/*
-+ * Don't use the select()-based readline under Native Client. While select()
-+ * is available and compile and link time it will fail at runtime under sel_ldr
-+ * since there is no IRT/syscall implemenation of select().
-+ */
-+#if defined(HAVE_RL_CALLBACK) && defined(HAVE_SELECT) && !defined(__native_client__)
-
- static char *completed_input_string;
- static void
-diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
---- a/Modules/signalmodule.c
-+++ b/Modules/signalmodule.c
-@@ -29,7 +29,7 @@
- # define PYPTHREAD_SIGMASK
- #endif
-
--#if defined(PYPTHREAD_SIGMASK) && defined(HAVE_PTHREAD_H)
-+#if (defined(PYPTHREAD_SIGMASK) || defined(HAVE_PTHREAD_KILL)) && defined(HAVE_PTHREAD_H)
- # include <pthread.h>
- #endif
-
-diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
---- a/Modules/socketmodule.c
-+++ b/Modules/socketmodule.c
-@@ -310,6 +310,14 @@ if_indextoname(index) -- return the corresponding interface name\n\
- # include "addrinfo.h"
- #endif
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+struct iovec {
-+ void *iov_base;
-+ size_t iov_len;
-+};
-+#undef CMSG_LEN
-+#endif
-+
- #ifndef HAVE_INET_PTON
- #if !defined(NTDDI_VERSION) || (NTDDI_VERSION < NTDDI_LONGHORN)
- int inet_pton(int af, const char *src, void *dst);
-diff --git a/Modules/timemodule.c b/Modules/timemodule.c
---- a/Modules/timemodule.c
-+++ b/Modules/timemodule.c
-@@ -2,6 +2,7 @@
-
- #include "Python.h"
-
-+
- #include <ctype.h>
-
- #ifdef HAVE_SYS_TIMES_H
-@@ -20,6 +21,11 @@
- #include <io.h>
- #endif
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+#define timezone _timezone
-+#define daylight _daylight
-+#endif
-+
- #if defined(__WATCOMC__) && !defined(__QNX__)
- #include <i86.h>
- #else
-@@ -41,6 +47,13 @@
- #include <mach/mach_time.h>
- #endif
-
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+int clock_settime(clockid_t clk_id, const struct timespec *tp) {
-+ errno = EPERM;
-+ return -1;
-+}
-+#endif
-+
- /* Forward declarations */
- static int floatsleep(double);
- static PyObject* floattime(_Py_clock_info_t *info);
-diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
---- a/Python/dynload_shlib.c
-+++ b/Python/dynload_shlib.c
-@@ -69,6 +69,11 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
- PyOS_snprintf(funcname, sizeof(funcname),
- LEAD_UNDERSCORE "PyInit_%.200s", shortname);
-
-+
-+/* Native Client's fstat() imlemenation doesn't set st_dev
-+ * and st_ino correctly so disable the dlopen handle cache.
-+ * TODO(sbc): fix NaCl's fstat() */
-+#ifndef __native_client__
- if (fp != NULL) {
- int i;
- struct stat statb;
-@@ -89,6 +94,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
- handles[nhandles].ino = statb.st_ino;
- }
- }
-+#endif
-
- dlopenflags = PyThreadState_GET()->interp->dlopenflags;
-
-diff --git a/Python/fileutils.c b/Python/fileutils.c
---- a/Python/fileutils.c
-+++ b/Python/fileutils.c
-@@ -599,6 +599,12 @@ get_inheritable(int fd, int raise)
-
- flags = fcntl(fd, F_GETFD, 0);
- if (flags == -1) {
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+ /* When running under NaCl within the sel_ldr this fcntl() will always
-+ fail. However we don't want to completely remove this block since
-+ fcntl() is emulated using nacl_io when running within chrome. */
-+ return 0;
-+#endif
- if (raise)
- PyErr_SetFromErrno(PyExc_OSError);
- return -1;
-@@ -707,6 +713,12 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works)
- /* slow-path: fcntl() requires two syscalls */
- flags = fcntl(fd, F_GETFD);
- if (flags < 0) {
-+#if defined(__native_client__) && !defined(__GLIBC__)
-+ /* When running under NaCl within the sel_ldr this fcntl() will always
-+ fail. However we don't want to completely remove this block since
-+ fcntl() is emulated using nacl_io when running within chrome. */
-+ return 0;
-+#endif
- if (raise)
- PyErr_SetFromErrno(PyExc_OSError);
- return -1;
-diff --git a/Python/getversion.c b/Python/getversion.c
---- a/Python/getversion.c
-+++ b/Python/getversion.c
-@@ -8,8 +8,8 @@
- const char *
- Py_GetVersion(void)
- {
-- static char version[250];
-- PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
-+ static char version[270];
-+ PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.100s",
- PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
- return version;
- }
-diff --git a/Python/thread.c b/Python/thread.c
---- a/Python/thread.c
-+++ b/Python/thread.c
-@@ -13,9 +13,19 @@
- library (e.g. gnu pth in pthread emulation) */
- # ifdef HAVE_PTHREAD_H
- # include <pthread.h> /* _POSIX_THREADS */
-+# if defined __native_client__ && !defined _POSIX_THREADS
-+ /* Under NaCl newlib neither pthread.h nor unistd.h defines _POSIX_THREADS.
-+ However this file expects it to be defined if pthreads are present so we
-+ define it here after including pthread.h
-+ TODO(sbc): remove this hack once newlib is fixed:
-+ https://code.google.com/p/nativeclient/issues/detail?id=3551
-+ */
-+# define _POSIX_THREADS
-+# endif
- # endif
- #endif
-
-+
- #ifndef DONT_HAVE_STDIO_H
- #include <stdio.h>
- #endif
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -2969,7 +2969,7 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
- $as_echo "$interp" >&6; }
-- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
-+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
- fi
- elif test "$cross_compiling" = maybe; then
- as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
-@@ -3284,6 +3284,9 @@ then
- # a lot of different things including 'define_xopen_source'
- # in the case statement below.
- case "$host" in
-+ *-*-nacl*)
-+ ac_sys_system=NaCl
-+ ;;
- *-*-linux*)
- ac_sys_system=Linux
- ;;
-@@ -3332,6 +3335,15 @@ if test "$cross_compiling" = yes; then
- _host_cpu=$host_cpu
- esac
- ;;
-+ *-*-nacl*)
-+ case "$host_cpu" in
-+ arm*)
-+ _host_cpu=arm
-+ ;;
-+ *)
-+ _host_cpu=$host_cpu
-+ esac
-+ ;;
- *-*-cygwin*)
- _host_cpu=
- ;;
-@@ -5376,7 +5388,11 @@ if test -d casesensitivetestdir
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-- BUILDEXEEXT=.exe
-+ if [ -z $EXEEXT ]; then
-+ BUILDEXEEXT=.exe
-+ else
-+ BUILDEXEEXT=$EXEEXT
-+ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
-@@ -6275,11 +6291,11 @@ then
- # debug builds.
- OPT="-g -O0 -Wall $STRICT_PROTO"
- else
-- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
-+ OPT="-g $WRAP -O2 -Wall $STRICT_PROTO"
- fi
- ;;
- *)
-- OPT="-O3 -Wall $STRICT_PROTO"
-+ OPT="-O2 -Wall $STRICT_PROTO"
- ;;
- esac
- case $ac_sys_system in
-@@ -8579,7 +8595,7 @@ then
- BLDSHARED="$LDSHARED"
- fi
- ;;
-- Linux*|GNU*|QNX*)
-+ Linux*|GNU*|QNX*|NaCl*)
- LDSHARED='$(CC) -shared'
- LDCXXSHARED='$(CXX) -shared';;
- BSD/OS*/4*)
-@@ -8650,7 +8666,7 @@ then
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
- fi;;
-- Linux*|GNU*) CCSHARED="-fPIC";;
-+ Linux*|GNU*|NaCl*) CCSHARED="-fPIC";;
- BSD/OS*/4*) CCSHARED="-fpic";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
- OpenUNIX*|UnixWare*)
-@@ -8683,7 +8699,7 @@ then
- LINKFORSHARED="-Wl,-E -Wl,+s";;
- # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
-- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
-+ Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";;
- # -u libsys_s pulls in all symbols in libsys
- Darwin/*)
- LINKFORSHARED="$extra_undefs -framework CoreFoundation"
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -373,6 +373,9 @@ then
- *-*-cygwin*)
- ac_sys_system=Cygwin
- ;;
-+ *-*-nacl*)
-+ ac_sys_system=NaCl
-+ ;;
- *)
- # for now, limit cross builds to known configurations
- MACHDEP="unknown"
-@@ -415,6 +418,15 @@ if test "$cross_compiling" = yes; then
- _host_cpu=$host_cpu
- esac
- ;;
-+ *-*-nacl*)
-+ case "$host_cpu" in
-+ arm*)
-+ _host_cpu=arm
-+ ;;
-+ *)
-+ _host_cpu=$host_cpu
-+ esac
-+ ;;
- *-*-cygwin*)
- _host_cpu=
- ;;
-@@ -2055,7 +2067,7 @@ then
- BLDSHARED="$LDSHARED"
- fi
- ;;
-- Linux*|GNU*|QNX*)
-+ Linux*|GNU*|QNX*|NaCl*)
- LDSHARED='$(CC) -shared'
- LDCXXSHARED='$(CXX) -shared';;
- BSD/OS*/4*)
-@@ -2124,7 +2136,7 @@ then
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
- fi;;
-- Linux*|GNU*) CCSHARED="-fPIC";;
-+ Linux*|GNU*|NaCl*) CCSHARED="-fPIC";;
- BSD/OS*/4*) CCSHARED="-fpic";;
- FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
- OpenUNIX*|UnixWare*)
-@@ -2155,7 +2167,7 @@ then
- LINKFORSHARED="-Wl,-E -Wl,+s";;
- # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
- BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
-- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
-+ Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";;
- # -u libsys_s pulls in all symbols in libsys
- Darwin/*)
- LINKFORSHARED="$extra_undefs -framework CoreFoundation"
diff --git a/ports/python3/pkg_info b/ports/python3/pkg_info
deleted file mode 100644
index 428e935..0000000
--- a/ports/python3/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=python3
-VERSION=3.4.2
-ARCHIVE_ROOT=Python-3.4.2
-URL=http://python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
-LICENSE=CUSTOM:LICENSE
-# missing decimal_point member in lconv struct lconv.
-BUILD_OS=linux
-DEPENDS=(readline zlib bzip2 gettext)
-SHA1=0727d8a8498733baabe6f51632b9bab0cbaa9ada
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python3/python.js b/ports/python3/python.js
deleted file mode 100644
index e382cbb..0000000
--- a/ports/python3/python.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-NaClTerm.nmf = 'python.nmf';
diff --git a/ports/python_modules/cython/build.sh b/ports/python_modules/cython/build.sh
deleted file mode 100644
index ae7ca83..0000000
--- a/ports/python_modules/cython/build.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- ChangeDir ${SRC_DIR}
- # No destination installation
- LogExecute rm -rf build dist
- export NACL_PORT_BUILD=host
- # Force 32 bits here for Py_ssize_t correctness.
- export CC="gcc -m32"
- export CXX="g++ -m32"
- export LD="gcc -m32"
- LogExecute ${NACL_HOST_PYTHON} setup.py install --prefix=${NACL_HOST_PYROOT}
-}
-
-InstallStep() {
- return
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/cython/pkg_info b/ports/python_modules/cython/pkg_info
deleted file mode 100644
index 3a66f10..0000000
--- a/ports/python_modules/cython/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=cython
-ARCHIVE_ROOT=Cython-0.19.1
-VERSION=0.19.1
-URL=http://cython.org/release/Cython-0.19.1.tar.gz
-LICENSE=BSD
-BUILD_OS=linux
-DEPENDS=(numpy)
-SHA1=f8c8baa2c358a7482de71d0c744bf19caaae6621
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/darksky-catalog/build.sh b/ports/python_modules/darksky-catalog/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/darksky-catalog/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/darksky-catalog/pkg_info b/ports/python_modules/darksky-catalog/pkg_info
deleted file mode 100644
index 957f68d..0000000
--- a/ports/python_modules/darksky-catalog/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=darksky-catalog
-VERSION=0.1.3
-ARCHIVE_ROOT=darksky_catalog-0.1.3
-URL=https://pypi.python.org/packages/source/d/darksky_catalog/darksky_catalog-0.1.3.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host yt thingking)
-SHA1=ab3310cb160a08ac6b1bca20364d08e1dcdb46c2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/distribute/build.sh b/ports/python_modules/distribute/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/distribute/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/distribute/pkg_info b/ports/python_modules/distribute/pkg_info
deleted file mode 100644
index 32ab8ef..0000000
--- a/ports/python_modules/distribute/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=distribute
-VERSION=0.6.28
-URL=http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
-LICENSE=PSF
-DEPENDS=(python-host pyparsing setuptools)
-SHA1=709bd97d46050d69865d4b588c7707768dfe6711
diff --git a/ports/python_modules/google-api-python-client/build.sh b/ports/python_modules/google-api-python-client/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/google-api-python-client/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/google-api-python-client/pkg_info b/ports/python_modules/google-api-python-client/pkg_info
deleted file mode 100644
index 3de165c..0000000
--- a/ports/python_modules/google-api-python-client/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=google-api-python-client
-VERSION=1.2
-URL=https://pypi.python.org/packages/source/g/google-api-python-client/google-api-python-client-1.2.tar.gz
-LICENSE=Apache
-DEPENDS=(python-host httplib2 openssl setuptools)
-SHA1=31ddb6e125b0683d29493c9f486d48a4f63c913b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/h5py/build.sh b/ports/python_modules/h5py/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/h5py/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/h5py/modules.libs b/ports/python_modules/h5py/modules.libs
deleted file mode 100644
index 788a0c2..0000000
--- a/ports/python_modules/h5py/modules.libs
+++ /dev/null
@@ -1 +0,0 @@
-PY_MOD_LIBS+=" -lhdf5 -lhdf5_hl"
diff --git a/ports/python_modules/h5py/modules.list b/ports/python_modules/h5py/modules.list
deleted file mode 100644
index 22f78d8..0000000
--- a/ports/python_modules/h5py/modules.list
+++ /dev/null
@@ -1,22 +0,0 @@
-_conv
-utils
-h5g
-h5o
-h5fd
-h5d
-h5s
-h5a
-h5i
-h5
-_errors
-h5r
-h5ds
-_objects
-h5l
-h5t
-defs
-h5f
-h5ac
-h5z
-h5p
-_proxy
diff --git a/ports/python_modules/h5py/pkg_info b/ports/python_modules/h5py/pkg_info
deleted file mode 100644
index 164b4f6..0000000
--- a/ports/python_modules/h5py/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=h5py
-VERSION=2.2.1
-URL=http://h5py.googlecode.com/files/h5py-2.2.1.tar.gz
-LICENSE=BSD
-DEPENDS=(hdf5 python-host cython numpy)
-SHA1=4b511ed7aa28ac4c61188a121d42f17f3096c15a
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/httplib2/build.sh b/ports/python_modules/httplib2/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/httplib2/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/httplib2/pkg_info b/ports/python_modules/httplib2/pkg_info
deleted file mode 100644
index cbb5e69..0000000
--- a/ports/python_modules/httplib2/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=httplib2
-VERSION=0.9
-URL=https://pypi.python.org/packages/source/h/httplib2/httplib2-0.9.tar.gz
-LICENSE=MIT
-DEPENDS=(python-host openssl)
-SHA1=1b9774a81136a222f02e711d81efb775dc87b70e
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/ipython/build.sh b/ports/python_modules/ipython/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/ipython/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/ipython/nacl.patch b/ports/python_modules/ipython/nacl.patch
deleted file mode 100644
index 4e9add2..0000000
--- a/ports/python_modules/ipython/nacl.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-diff --git a/IPython/core/prompts.py b/IPython/core/prompts.py
---- a/IPython/core/prompts.py
-+++ b/IPython/core/prompts.py
-@@ -145,7 +145,9 @@ HOME = os.path.realpath(HOME)
- # fixed once ipython starts. This reduces the runtime overhead of computing
- # prompt strings.
- USER = py3compat.str_to_unicode(os.environ.get("USER",''))
--HOSTNAME = py3compat.str_to_unicode(socket.gethostname())
-+# WEBPORTS NOTE: sockets module is not present in webports,
-+# so we sent HOSTNAME to empty
-+HOSTNAME = '' #py3compat.str_to_unicode(socket.gethostname())
- HOSTNAME_SHORT = HOSTNAME.split(".")[0]
-
- # IronPython doesn't currently have os.getuid() even if
-diff --git a/IPython/external/pexpect/_pexpect.py b/IPython/external/pexpect/_pexpect.py
---- a/IPython/external/pexpect/_pexpect.py
-+++ b/IPython/external/pexpect/_pexpect.py
-@@ -70,7 +70,7 @@ try:
- import select
- import re
- import struct
-- import resource
-+ #import resource
- import types
- import pty
- import tty
-@@ -571,7 +571,8 @@ class spawnb(object):
- # This is a serious limitation, but not a show stopper.
- pass
- # Do not allow child to inherit open file descriptors from parent.
-- max_fd = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
-+ #max_fd = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
-+ max_fd = 1024
- for i in range (3, max_fd):
- try:
- os.close (i)
-diff --git a/IPython/kernel/__init__.py b/IPython/kernel/__init__.py
---- a/IPython/kernel/__init__.py
-+++ b/IPython/kernel/__init__.py
-@@ -1,11 +1,6 @@
- """IPython kernels and associated utilities"""
-
--# just for friendlier zmq version check
--from . import zmq
--
--from .connect import *
--from .launcher import *
--from .client import KernelClient
--from .manager import KernelManager
--from .blocking import BlockingKernelClient
--from .multikernelmanager import MultiKernelManager
-+# WEBPORTS NOTE:
-+# This file is left empty because this package
-+# is only needed for IPython/kernel/zmq/pylab/backend_inline.py
-+# which in turn does not require the rest of the package to load.
-diff --git a/IPython/kernel/zmq/__init__.py b/IPython/kernel/zmq/__init__.py
---- a/IPython/kernel/zmq/__init__.py
-+++ b/IPython/kernel/zmq/__init__.py
-@@ -5,13 +5,7 @@
- # the file COPYING.txt, distributed as part of this software.
- #-----------------------------------------------------------------------------
-
--#-----------------------------------------------------------------------------
--# Verify zmq version dependency >= 2.1.11
--#-----------------------------------------------------------------------------
--
--from IPython.utils.zmqrelated import check_for_zmq
--
--check_for_zmq('2.1.11', 'IPython.kernel.zmq')
--
--from .session import Session
--
-+# WEBPORTS NOTE:
-+# This file is left empty because this package
-+# is only needed for IPython/kernel/zmq/pylab/backend_inline.py
-+# which in turn does not require the rest of the package to load.
diff --git a/ports/python_modules/ipython/pkg_info b/ports/python_modules/ipython/pkg_info
deleted file mode 100644
index dbaa285..0000000
--- a/ports/python_modules/ipython/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=ipython
-VERSION=2.1.0
-URL=http://archive.ipython.org/release/2.1.0/ipython-2.1.0.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host)
-SHA1=e80c30388cbe576038a78fc8ebb159cddae84fb4
diff --git a/ports/python_modules/jinja2/build.sh b/ports/python_modules/jinja2/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/jinja2/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/jinja2/pkg_info b/ports/python_modules/jinja2/pkg_info
deleted file mode 100644
index 84803a1..0000000
--- a/ports/python_modules/jinja2/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=jinja2
-VERSION=2.7.2
-URL=https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.2.tar.gz
-ARCHIVE_ROOT=Jinja2-2.7.2
-LICENSE=BSD
-DEPENDS=(python-host setuptools markupsafe)
-SHA1=1ce4c8bc722444ec3e77ef9db76faebbd17a40d8
diff --git a/ports/python_modules/markupsafe/build.sh b/ports/python_modules/markupsafe/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/markupsafe/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/markupsafe/pkg_info b/ports/python_modules/markupsafe/pkg_info
deleted file mode 100644
index a570faf..0000000
--- a/ports/python_modules/markupsafe/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=markupsafe
-VERSION=0.19
-ARCHIVE_ROOT=MarkupSafe-0.19
-URL=https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.19.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host setuptools)
-SHA1=5b0ef4acfa4af62277135fbafc99d42560434134
diff --git a/ports/python_modules/matplotlib/build.sh b/ports/python_modules/matplotlib/build.sh
deleted file mode 100644
index 0922b45..0000000
--- a/ports/python_modules/matplotlib/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
-
diff --git a/ports/python_modules/matplotlib/modules.libs b/ports/python_modules/matplotlib/modules.libs
deleted file mode 100644
index 9443e81..0000000
--- a/ports/python_modules/matplotlib/modules.libs
+++ /dev/null
@@ -1 +0,0 @@
-PY_MOD_LIBS+=" -lpng -lfreetype"
diff --git a/ports/python_modules/matplotlib/modules.list b/ports/python_modules/matplotlib/modules.list
deleted file mode 100644
index 708a701..0000000
--- a/ports/python_modules/matplotlib/modules.list
+++ /dev/null
@@ -1,9 +0,0 @@
-_tri
-_delaunay
-ft2font
-_png
-_backend_agg
-_path
-_image
-ttconv
-_cntr
diff --git a/ports/python_modules/matplotlib/nacl.patch b/ports/python_modules/matplotlib/nacl.patch
deleted file mode 100644
index aea28b3..0000000
--- a/ports/python_modules/matplotlib/nacl.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-diff --git a/lib/matplotlib/mpl-data/matplotlibrc b/lib/matplotlib/mpl-data/matplotlibrc
---- a/lib/matplotlib/mpl-data/matplotlibrc
-+++ b/lib/matplotlib/mpl-data/matplotlibrc
-@@ -29,7 +29,7 @@
- # You can also deploy your own backend outside of matplotlib by
- # referring to the module name (which must be in the PYTHONPATH) as
- # 'module://my_backend'
--backend : qt4agg
-+backend : Agg
-
- # If you are using the Qt4Agg backend, you can choose here
- # to use the PyQt4 bindings or the newer PySide bindings to
-diff --git a/lib/matplotlib/tri/_tri.cpp b/lib/matplotlib/tri/_tri.cpp
---- a/lib/matplotlib/tri/_tri.cpp
-+++ b/lib/matplotlib/tri/_tri.cpp
-@@ -2177,14 +2177,14 @@ TrapezoidMapTriFinder::Trapezoid::set_upper_right(Trapezoid* upper_right_)
-
-
- RandomNumberGenerator::RandomNumberGenerator(unsigned long seed)
-- : _M(21870), _A(1291), _C(4621), _seed(seed % _M)
-+ : _m(21870), _a(1291), _c(4621), _seed(seed % _m)
- {}
-
- unsigned long
- RandomNumberGenerator::operator()(unsigned long max_value)
- {
-- _seed = (_seed*_A + _C) % _M;
-- return (_seed*max_value) / _M;
-+ _seed = (_seed*_a + _c) % _m;
-+ return (_seed*max_value) / _m;
- }
-
-
-diff --git a/lib/matplotlib/tri/_tri.h b/lib/matplotlib/tri/_tri.h
---- a/lib/matplotlib/tri/_tri.h
-+++ b/lib/matplotlib/tri/_tri.h
-@@ -818,7 +818,7 @@ public:
- unsigned long operator()(unsigned long max_value);
-
- private:
-- const unsigned long _M, _A, _C;
-+ const unsigned long _m, _a, _c;
- unsigned long _seed;
- };
-
-diff --git a/setup.cfg b/setup.cfg
-new file mode 100644
---- /dev/null
-+++ b/setup.cfg
-@@ -0,0 +1,84 @@
-+# Rename this file to setup.cfg to modify matplotlib's
-+# build options.
-+
-+[egg_info]
-+
-+[directories]
-+# Uncomment to override the default basedir in setupext.py.
-+# This can be a single directory or a comma-delimited list of directories.
-+# This will be set inside setupext.py if we are inside a NaCl build.
-+#basedirlist=%(NACL_PREFIX)s
-+
-+[status]
-+# To suppress display of the dependencies and their versions
-+# at the top of the build log, uncomment the following line:
-+#suppress = False
-+
-+[packages]
-+# There are a number of subpackages of matplotlib that are considered
-+# optional. They are all installed by default, but they may be turned
-+# off here.
-+#
-+#tests = True
-+#sample_data = True
-+toolkits = False
-+
-+[gui_support]
-+# Matplotlib supports multiple GUI toolkits, including Cocoa,
-+# GTK, Fltk, MacOSX, Qt, Qt4, Tk, and WX. Support for many of
-+# these toolkits requires AGG, the Anti-Grain Geometry library,
-+# which is provided by matplotlib and built by default.
-+#
-+# Some backends are written in pure Python, and others require
-+# extension code to be compiled. By default, matplotlib checks for
-+# these GUI toolkits during installation and, if present, compiles the
-+# required extensions to support the toolkit.
-+#
-+# - GTK 2.x support of any kind requires the GTK runtime environment
-+# headers and PyGTK.
-+# - Tk support requires Tk development headers and Tkinter.
-+# - Mac OSX backend requires the Cocoa headers included with XCode.
-+# - Windowing is MS-Windows specific, and requires the "windows.h"
-+# header.
-+#
-+# The other GUI toolkits do not require any extension code, and can be
-+# used as long as the libraries are installed on your system --
-+# therefore they are installed unconditionally.
-+#
-+# You can uncomment any the following lines to change this
-+# behavior. Acceptible values are:
-+#
-+# True: build the extension. Exits with a warning if the
-+# required dependencies are not available
-+# False: do not build the extension
-+# auto: build if the required dependencies are available,
-+# otherwise skip silently. This is the default
-+# behavior
-+#
-+agg = True
-+cairo = False
-+gtk = False
-+gtk3agg = False
-+gtk3cairo = False
-+gtkagg = False
-+macosx = False
-+pyside = False
-+qt4agg = False
-+tkagg = False
-+windowing = False
-+wxagg = False
-+webagg = False
-+
-+[rc_options]
-+# User-configurable options
-+#
-+# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, GTKCairo,
-+# FltkAgg, MacOSX, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg.
-+#
-+# The Agg, Ps, Pdf and SVG backends do not require external
-+# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, or TkAgg
-+# if you have disabled the relevent extension modules. Agg will be used
-+# by default.
-+#
-+backend = Agg
-+#
-diff --git a/setupext.py b/setupext.py
---- a/setupext.py
-+++ b/setupext.py
-@@ -60,10 +60,12 @@ options = {
- 'basedirlist': None
- }
-
--
-+defaults = {}
-+if os.environ.get("NACL_BUILD_TREE") is not None:
-+ defaults["basedirlist"] = os.environ["NACL_BUILD_TREE"]
- setup_cfg = os.environ.get('MPLSETUPCFG', 'setup.cfg')
- if os.path.exists(setup_cfg):
-- config = configparser.SafeConfigParser()
-+ config = configparser.SafeConfigParser(defaults)
- config.read(setup_cfg)
-
- try:
-@@ -1064,7 +1066,8 @@ class Tornado(SetupPackage):
- return "using tornado version %s" % tornado.version
-
- def get_install_requires(self):
-- return ['tornado']
-+ # Manually force *not* to require tornado.
-+ return []
-
-
- class Pyparsing(SetupPackage):
diff --git a/ports/python_modules/matplotlib/pkg_info b/ports/python_modules/matplotlib/pkg_info
deleted file mode 100644
index c743458..0000000
--- a/ports/python_modules/matplotlib/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=matplotlib
-VERSION=1.3.1
-URL=http://sf.net/projects/matplotlib/files/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host freetype libpng distribute python-dateutil pyparsing six numpy nose)
-SHA1=8578afc86424392591c0ee03f7613ffa9b6f68ee
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/nose/build.sh b/ports/python_modules/nose/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/nose/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/nose/pkg_info b/ports/python_modules/nose/pkg_info
deleted file mode 100644
index d981669..0000000
--- a/ports/python_modules/nose/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=nose
-VERSION=1.3.0
-URL=https://pypi.python.org/packages/source/n/nose/nose-1.3.0.tar.gz
-LICENSE=LGPL
-DEPENDS=(python-host)
-SHA1=bd1bb889e421948ca57595e9e8d52246cb308294
diff --git a/ports/python_modules/numpy/build.sh b/ports/python_modules/numpy/build.sh
deleted file mode 100644
index 5d35b14..0000000
--- a/ports/python_modules/numpy/build.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2014 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_PYSETUP_ARGS="build --fcompiler=fake"
-
-BuildHost() {
- LogExecute rm -rf build dist
- export NACL_PORT_BUILD=host
- # Force 32 bits here for Py_ssize_t correctness.
- export CC="gcc -m32 -msse"
- export CXX="g++ -m32 -msse"
- export LD="gcc -m32 -msse"
- LogExecute ${NACL_HOST_PYTHON} setup.py ${NACL_PYSETUP_ARGS} \
- install --prefix=${NACL_HOST_PYROOT}
- unset LD
-}
-
-BuildStep() {
- export ATLAS=None
- export LAPACK=None
- export BLAS=None
- ChangeDir ${SRC_DIR}
- BuildHost
- LogExecute rm -rf build dist
- DefaultPythonModuleBuildStep bootstrap
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/numpy/modules.list b/ports/python_modules/numpy/modules.list
deleted file mode 100644
index ff9bc2b..0000000
--- a/ports/python_modules/numpy/modules.list
+++ /dev/null
@@ -1,11 +0,0 @@
-_capi
-scalarmath
-multiarray
-multiarray_tests
-umath
-_umath_linalg
-umath_tests
-_compiled_base
-lapack_lite
-fftpack_lite
-mtrand
diff --git a/ports/python_modules/numpy/nacl.patch b/ports/python_modules/numpy/nacl.patch
deleted file mode 100644
index 26969b4..0000000
--- a/ports/python_modules/numpy/nacl.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py
---- a/numpy/core/code_generators/generate_numpy_api.py
-+++ b/numpy/core/code_generators/generate_numpy_api.py
-@@ -111,14 +111,18 @@ _import_array(void)
- }
- #if NPY_BYTE_ORDER == NPY_BIG_ENDIAN
- if (st != NPY_CPU_BIG) {
-- PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\
-- "big endian, but detected different endianness at runtime");
-+ PyErr_Format(PyExc_RuntimeError, "FATAL: (for real) module compiled as "\
-+ "big endian, but detected different endianness at runtime. "\
-+ "(%%d %%d %%d) (%%d %%d)", st, (int) NPY_CPU_BIG, (int) NPY_CPU_LITTLE,
-+ (int) NPY_BIG_ENDIAN, (int) NPY_LITTLE_ENDIAN);
- return -1;
- }
- #elif NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN
- if (st != NPY_CPU_LITTLE) {
-- PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\
-- "little endian, but detected different endianness at runtime");
-+ PyErr_Format(PyExc_RuntimeError, "FATAL: (for real) module compiled as "\
-+ "little endian, but detected different endianness at runtime. " \
-+ "(%%d %%d %%d) (%%d %%d)", st, (int) NPY_CPU_BIG, (int) NPY_CPU_LITTLE,
-+ (int) NPY_BIG_ENDIAN, (int) NPY_LITTLE_ENDIAN);
- return -1;
- }
- #endif
-diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
---- a/numpy/core/include/numpy/npy_cpu.h
-+++ b/numpy/core/include/numpy/npy_cpu.h
-@@ -27,7 +27,10 @@
- * i386 by Sun compilers on opensolaris at least
- */
- #define NPY_CPU_X86
--#elif defined(__x86_64__) || defined(__amd64__) || defined(__x86_64) || defined(_M_AMD64)
-+/* For [P]NaCl toolchain, we need to define a CPU manually in order to ensure
-+ * it has been defined at all. This only comes into play in a handful of
-+ * places, but is necessary to generate any code at all. */
-+#elif defined(__x86_64__) || defined(__amd64__) || defined(__x86_64) || defined(_M_AMD64) || defined (__native_client__)
- /*
- * both __x86_64__ and __amd64__ are defined by gcc
- * __x86_64 defined by sun compiler on opensolaris at least
-diff --git a/numpy/core/setup.py b/numpy/core/setup.py
---- a/numpy/core/setup.py
-+++ b/numpy/core/setup.py
-@@ -288,7 +288,7 @@ def check_types(config_cmd, ext, build_dir):
- "Cannot compile 'Python.h'. Perhaps you need to "\
- "install python-dev|python-devel.")
- res = config_cmd.check_header("endian.h")
-- if res:
-+ if res and os.environ.get("NACL_PORT_BUILD") not in ["host", "bootstrap"]:
- private_defines.append(('HAVE_ENDIAN_H', 1))
- public_defines.append(('NPY_HAVE_ENDIAN_H', 1))
-
-@@ -465,7 +465,7 @@ def configuration(parent_package='',top_path=None):
- 'MOTOROLA_EXTENDED_12_BYTES_BE',
- 'IEEE_QUAD_LE', 'IEEE_QUAD_BE',
- 'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE',
-- 'DOUBLE_DOUBLE_BE']:
-+ 'DOUBLE_DOUBLE_BE', "NO_LONG_DOUBLE"]:
- moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
- else:
- raise ValueError("Unrecognized long double format: %s" % rep)
-@@ -648,12 +648,13 @@ def configuration(parent_package='',top_path=None):
- # explicitly add an extension which has generate_config_h and
- # generate_numpyconfig_h as sources *before* adding npymath.
-
-- config.add_extension('_dummy',
-- sources = [join('src', 'dummymodule.c'),
-- generate_config_h,
-- generate_numpyconfig_h,
-- generate_numpy_api]
-- )
-+ if os.environ.get("NACL_PORT_BUILD") != "bootstrap":
-+ config.add_extension('_dummy',
-+ sources = [join('src', 'dummymodule.c'),
-+ generate_config_h,
-+ generate_numpyconfig_h,
-+ generate_numpy_api]
-+ )
-
- #######################################################################
- # npymath library #
-diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
---- a/numpy/core/setup_common.py
-+++ b/numpy/core/setup_common.py
-@@ -3,6 +3,7 @@ from __future__ import division, absolute_import, print_function
- # Code common to build tools
- import sys
- from os.path import join
-+import os
- import warnings
- import copy
- import binascii
-@@ -304,5 +305,7 @@ def long_double_representation(lines):
- if saw is not None:
- raise ValueError("Unrecognized format (%s)" % saw)
- else:
-+ if os.environ.get("NACL_PORT_BUILD") == "bootstrap":
-+ return "NO_LONG_DOUBLE"
- # We never detected the after_sequence
- raise ValueError("Could not lock sequences (%s)" % saw)
-diff --git a/numpy/core/src/npymath/npy_math_private.h b/numpy/core/src/npymath/npy_math_private.h
---- a/numpy/core/src/npymath/npy_math_private.h
-+++ b/numpy/core/src/npymath/npy_math_private.h
-@@ -51,29 +51,27 @@
- * fix this at some point */
- #define IEEE_WORD_ORDER NPY_BYTE_ORDER
-
--#if IEEE_WORD_ORDER == NPY_BIG_ENDIAN
-+#if (IEEE_WORD_ORDER == NPY_LITTLE_ENDIAN) || defined(__native_client__)
-
- typedef union
- {
- double value;
- struct
- {
-- npy_uint32 msw;
- npy_uint32 lsw;
-+ npy_uint32 msw;
- } parts;
- } ieee_double_shape_type;
-
--#endif
--
--#if IEEE_WORD_ORDER == NPY_LITTLE_ENDIAN
-+#elif IEEE_WORD_ORDER == NPY_BIG_ENDIAN
-
- typedef union
- {
- double value;
- struct
- {
-- npy_uint32 lsw;
- npy_uint32 msw;
-+ npy_uint32 lsw;
- } parts;
- } ieee_double_shape_type;
-
-diff --git a/numpy/core/src/private/npy_fpmath.h b/numpy/core/src/private/npy_fpmath.h
---- a/numpy/core/src/private/npy_fpmath.h
-+++ b/numpy/core/src/private/npy_fpmath.h
-@@ -7,6 +7,10 @@
- #include "numpy/npy_cpu.h"
- #include "numpy/npy_common.h"
-
-+#ifdef __native_client__
-+ #define HAVE_LDOUBLE_IEEE_DOUBLE_LE
-+#endif
-+
- #ifdef NPY_OS_DARWIN
- /* This hardcoded logic is fragile, but universal builds makes it
- * difficult to detect arch-specific features */
-diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
---- a/numpy/distutils/misc_util.py
-+++ b/numpy/distutils/misc_util.py
-@@ -2036,6 +2036,11 @@ def get_cmd(cmdname, _cache={}):
-
- def get_numpy_include_dirs():
- # numpy_include_dirs are set by numpy/core/setup.py, otherwise []
-+ if os.environ.get("NACL_PORT_BUILD") == "dest":
-+ # We fake our numpy includes when building on the destination.
-+ base_path = os.environ["NACL_BUILD_TREE"]
-+ return [os.path.join(base_path,
-+ "lib/python2.7/site-packages/numpy/core/include")]
- include_dirs = Configuration.numpy_include_dirs[:]
- if not include_dirs:
- import numpy
diff --git a/ports/python_modules/numpy/pkg_info b/ports/python_modules/numpy/pkg_info
deleted file mode 100644
index 951df81..0000000
--- a/ports/python_modules/numpy/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=numpy
-VERSION=1.8.0
-URL=http://sf.net/projects/numpy/files/NumPy/1.8.0/numpy-1.8.0.tar.gz
-LICENSE=BSD
-BUILD_OS=linux
-DEPENDS=(python-host)
-SHA1=a2c02c5fb2ab8cf630982cddc6821e74f5769974
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/pandas/build.sh b/ports/python_modules/pandas/build.sh
deleted file mode 100644
index fbddd2d..0000000
--- a/ports/python_modules/pandas/build.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
- # This avoids name conflicts with Python's parser.o
- for OBJ in parser tokenizer; do
- LogExecute mv ${DEST_PYTHON_OBJS}/${PACKAGE_NAME}/${OBJ}.o \
- ${DEST_PYTHON_OBJS}/${PACKAGE_NAME}/p_${OBJ}.o
- done
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/pandas/modules.libs b/ports/python_modules/pandas/modules.libs
deleted file mode 100644
index 9443e81..0000000
--- a/ports/python_modules/pandas/modules.libs
+++ /dev/null
@@ -1 +0,0 @@
-PY_MOD_LIBS+=" -lpng -lfreetype"
diff --git a/ports/python_modules/pandas/modules.list b/ports/python_modules/pandas/modules.list
deleted file mode 100644
index 6af4b4e..0000000
--- a/ports/python_modules/pandas/modules.list
+++ /dev/null
@@ -1,9 +0,0 @@
-hashtable
-lib
-_sparse
-index
-tslib
-json
-algos
-_testing
-p_parser
diff --git a/ports/python_modules/pandas/nacl.patch b/ports/python_modules/pandas/nacl.patch
deleted file mode 100644
index 453925a..0000000
--- a/ports/python_modules/pandas/nacl.patch
+++ /dev/null
@@ -1,699 +0,0 @@
-diff --git a/pandas/__init__.py b/pandas/__init__.py
---- a/pandas/__init__.py
-+++ b/pandas/__init__.py
-@@ -3,7 +3,7 @@
- __docformat__ = 'restructuredtext'
-
- try:
-- from . import hashtable, tslib, lib
-+ import hashtable, tslib, lib
- except Exception: # pragma: no cover
- import sys
- e = sys.exc_info()[1] # Py25 and Py3 current exception syntax conflict
-@@ -15,6 +15,8 @@ except Exception: # pragma: no cover
- else:
- raise
-
-+import compat
-+import core
- from datetime import datetime
- import numpy as np
-
-diff --git a/pandas/io/packers.py b/pandas/io/packers.py
---- a/pandas/io/packers.py
-+++ b/pandas/io/packers.py
-@@ -60,7 +60,11 @@ from pandas.io.common import get_filepath_or_buffer
- from pandas.core.internals import BlockManager, make_block
- import pandas.core.internals as internals
-
--from pandas.msgpack import Unpacker as _Unpacker, Packer as _Packer
-+try:
-+ from pandas.msgpack import Unpacker as _Unpacker, Packer as _Packer
-+except ImportError:
-+ _Unpacker = object
-+ _Packer = object
- import zlib
-
- try:
-diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py
---- a/pandas/io/parsers.py
-+++ b/pandas/io/parsers.py
-@@ -22,7 +22,7 @@ from pandas.util.decorators import Appender
-
- import pandas.lib as lib
- import pandas.tslib as tslib
--import pandas.parser as _parser
-+import pandas.p_parser as _parser
-
-
- _parser_params = """Also supports optionally iterating or breaking of the file
-diff --git a/pandas/io/tests/test_cparser.py b/pandas/io/tests/test_cparser.py
---- a/pandas/io/tests/test_cparser.py
-+++ b/pandas/io/tests/test_cparser.py
-@@ -27,8 +27,8 @@ from pandas.lib import Timestamp
-
- import pandas.util.testing as tm
-
--from pandas.parser import TextReader
--import pandas.parser as parser
-+from pandas.p_parser import TextReader
-+import pandas.p_parser as parser
-
-
- class TestCParser(tm.TestCase):
-diff --git a/pandas/io/tests/test_parsers.py b/pandas/io/tests/test_parsers.py
---- a/pandas/io/tests/test_parsers.py
-+++ b/pandas/io/tests/test_parsers.py
-@@ -35,7 +35,7 @@ import pandas.tseries.tools as tools
- from numpy.testing.decorators import slow
- from numpy.testing import assert_array_equal
-
--from pandas.parser import OverflowError
-+from pandas.p_parser import OverflowError
-
-
- class ParserTests(object):
-diff --git a/pandas/src/datetime.pxd b/pandas/src/datetime.pxd
---- a/pandas/src/datetime.pxd
-+++ b/pandas/src/datetime.pxd
-@@ -65,6 +65,7 @@ cdef extern from "numpy/npy_common.h":
- ctypedef unsigned char npy_bool
-
- cdef extern from "datetime/np_datetime.h":
-+ # Note that for static linking we prefix these
-
- ctypedef enum PANDAS_DATETIMEUNIT:
- PANDAS_FR_Y
-@@ -89,10 +90,12 @@ cdef extern from "datetime/np_datetime.h":
- int cmp_pandas_datetimestruct(pandas_datetimestruct *a,
- pandas_datetimestruct *b)
-
-- int convert_pydatetime_to_datetimestruct(PyObject *obj,
-+ int convert_pydatetime_to_datetimestruct \
-+ "pandas_convert_pydatetime_to_datetimestruct" (
-+ PyObject *obj,
- pandas_datetimestruct *out,
- PANDAS_DATETIMEUNIT *out_bestunit,
-- int apply_tzinfo)
-+ int apply_tzinfo)
-
- npy_datetime pandas_datetimestruct_to_datetime(PANDAS_DATETIMEUNIT fr,
- pandas_datetimestruct *d)
-@@ -101,22 +104,22 @@ cdef extern from "datetime/np_datetime.h":
- pandas_datetimestruct *result)
- int days_per_month_table[2][12]
-
-- int dayofweek(int y, int m, int d)
-- int is_leapyear(int64_t year)
-- PANDAS_DATETIMEUNIT get_datetime64_unit(object o)
-+ int dayofweek "pandas_dayofweek" (int y, int m, int d)
-+ int is_leapyear "pandas_is_leapyear" (int64_t year)
-+ PANDAS_DATETIMEUNIT get_datetime64_unit "pandas_get_datetime64_unit" (object o)
-
- cdef extern from "datetime/np_datetime_strings.h":
-
-- int parse_iso_8601_datetime(char *str, int len, PANDAS_DATETIMEUNIT unit,
-+ int pandas_parse_iso_8601_datetime(char *str, int len, PANDAS_DATETIMEUNIT unit,
- NPY_CASTING casting, pandas_datetimestruct *out,
- npy_bool *out_local, PANDAS_DATETIMEUNIT *out_bestunit,
- npy_bool *out_special)
-
-- int make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
-+ int pandas_make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
- int local, PANDAS_DATETIMEUNIT base, int tzoffset,
- NPY_CASTING casting)
-
-- int get_datetime_iso_8601_strlen(int local, PANDAS_DATETIMEUNIT base)
-+ int pandas_get_datetime_iso_8601_strlen(int local, PANDAS_DATETIMEUNIT base)
-
- # int parse_python_string(object obj, pandas_datetimestruct *out) except -1
-
-@@ -143,7 +146,7 @@ cdef inline int _cstring_to_dts(char *val, int length,
- PANDAS_DATETIMEUNIT out_bestunit
- int result
-
-- result = parse_iso_8601_datetime(val, length, PANDAS_FR_ns,
-+ result = pandas_parse_iso_8601_datetime(val, length, PANDAS_FR_ns,
- NPY_UNSAFE_CASTING,
- dts, &islocal, &out_bestunit, &special)
- return result
-diff --git a/pandas/src/datetime/np_datetime.c b/pandas/src/datetime/np_datetime.c
---- a/pandas/src/datetime/np_datetime.c
-+++ b/pandas/src/datetime/np_datetime.c
-@@ -44,7 +44,7 @@ const int days_per_month_table[2][12] = {
- /*
- * Returns 1 if the given year is a leap year, 0 otherwise.
- */
--int is_leapyear(npy_int64 year)
-+int pandas_is_leapyear(npy_int64 year)
- {
- return (year & 0x3) == 0 && /* year % 4 == 0 */
- ((year % 100) != 0 ||
-@@ -54,7 +54,7 @@ int is_leapyear(npy_int64 year)
- /*
- * Sakamoto's method, from wikipedia
- */
--int dayofweek(int y, int m, int d)
-+int pandas_dayofweek(int y, int m, int d)
- {
- int day;
- static const int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
-@@ -69,7 +69,7 @@ int dayofweek(int y, int m, int d)
- * the current values are valid.g
- */
- void
--add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes)
-+pandas_add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes)
- {
- int isleap;
-
-@@ -121,7 +121,7 @@ add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes)
- * Calculates the days offset from the 1970 epoch.
- */
- npy_int64
--get_datetimestruct_days(const pandas_datetimestruct *dts)
-+pandas_get_datetimestruct_days(const pandas_datetimestruct *dts)
- {
- int i, month;
- npy_int64 year, days = 0;
-@@ -227,7 +227,7 @@ days_to_yearsdays(npy_int64 *days_)
- * the current values are valid.
- */
- NPY_NO_EXPORT void
--add_seconds_to_datetimestruct(pandas_datetimestruct *dts, int seconds)
-+pandas_add_seconds_to_datetimestruct(pandas_datetimestruct *dts, int seconds)
- {
- int minutes;
-
-@@ -239,12 +239,12 @@ add_seconds_to_datetimestruct(pandas_datetimestruct *dts, int seconds)
- --minutes;
- dts->sec += 60;
- }
-- add_minutes_to_datetimestruct(dts, minutes);
-+ pandas_add_minutes_to_datetimestruct(dts, minutes);
- }
- else if (dts->sec >= 60) {
- minutes = dts->sec / 60;
- dts->sec = dts->sec % 60;
-- add_minutes_to_datetimestruct(dts, minutes);
-+ pandas_add_minutes_to_datetimestruct(dts, minutes);
- }
- }
-
-@@ -356,7 +356,7 @@ cmp_pandas_datetimestruct(pandas_datetimestruct *a, pandas_datetimestruct *b)
- * if obj doesn't have the neeeded date or datetime attributes.
- */
- int
--convert_pydatetime_to_datetimestruct(PyObject *obj, pandas_datetimestruct *out,
-+pandas_convert_pydatetime_to_datetimestruct(PyObject *obj, pandas_datetimestruct *out,
- PANDAS_DATETIMEUNIT *out_bestunit,
- int apply_tzinfo)
- {
-@@ -527,7 +527,7 @@ convert_pydatetime_to_datetimestruct(PyObject *obj, pandas_datetimestruct *out,
- /* Convert to a minutes offset and apply it */
- minutes_offset = seconds_offset / 60;
-
-- add_minutes_to_datetimestruct(out, -minutes_offset);
-+ pandas_add_minutes_to_datetimestruct(out, -minutes_offset);
- }
- }
-
-@@ -560,7 +560,7 @@ npy_datetime pandas_datetimestruct_to_datetime(PANDAS_DATETIMEUNIT fr, pandas_da
- meta.base = fr;
- meta.num = 1;
-
-- convert_datetimestruct_to_datetime(&meta, d, &result);
-+ pandas_convert_datetimestruct_to_datetime(&meta, d, &result);
- return result;
- }
-
-@@ -572,10 +572,10 @@ void pandas_datetime_to_datetimestruct(npy_datetime val, PANDAS_DATETIMEUNIT fr,
- meta.base = fr;
- meta.num = 1;
-
-- convert_datetime_to_datetimestruct(&meta, val, result);
-+ pandas_convert_datetime_to_datetimestruct(&meta, val, result);
- }
-
--PANDAS_DATETIMEUNIT get_datetime64_unit(PyObject *obj) {
-+PANDAS_DATETIMEUNIT pandas_get_datetime64_unit(PyObject *obj) {
- return ((PyDatetimeScalarObject *) obj)->obmeta.base;
- }
-
-@@ -589,7 +589,7 @@ PANDAS_DATETIMEUNIT get_datetime64_unit(PyObject *obj) {
- * Returns 0 on success, -1 on failure.
- */
- int
--convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
-+pandas_convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
- const pandas_datetimestruct *dts,
- npy_datetime *out)
- {
-@@ -606,7 +606,7 @@ convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
- }
- else {
- /* Otherwise calculate the number of days to start */
-- npy_int64 days = get_datetimestruct_days(dts);
-+ npy_int64 days = pandas_get_datetimestruct_days(dts);
-
- switch (base) {
- case PANDAS_FR_W:
-@@ -717,7 +717,7 @@ convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
- * months units, and all the other units.
- */
- npy_bool
--can_cast_timedelta64_units(PANDAS_DATETIMEUNIT src_unit,
-+pandas_can_cast_timedelta64_units(PANDAS_DATETIMEUNIT src_unit,
- PANDAS_DATETIMEUNIT dst_unit,
- NPY_CASTING casting)
- {
-@@ -757,7 +757,7 @@ can_cast_timedelta64_units(PANDAS_DATETIMEUNIT src_unit,
- * for all but 'unsafe' casting.
- */
- npy_bool
--can_cast_datetime64_units(PANDAS_DATETIMEUNIT src_unit,
-+pandas_can_cast_datetime64_units(PANDAS_DATETIMEUNIT src_unit,
- PANDAS_DATETIMEUNIT dst_unit,
- NPY_CASTING casting)
- {
-@@ -794,7 +794,7 @@ can_cast_datetime64_units(PANDAS_DATETIMEUNIT src_unit,
- * Converts a datetime based on the given metadata into a datetimestruct
- */
- int
--convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
-+pandas_convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
- npy_datetime dt,
- pandas_datetimestruct *out)
- {
-@@ -973,7 +973,7 @@ convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
- --minutes;
- }
- /* Offset the negative minutes */
-- add_minutes_to_datetimestruct(out, minutes);
-+ pandas_add_minutes_to_datetimestruct(out, minutes);
- out->sec = (dt / 1000000000000000LL) % 60;
- out->us = (dt / 1000000000LL) % 1000000LL;
- out->ps = (dt / 1000LL) % 1000000LL;
-@@ -999,7 +999,7 @@ convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
- --seconds;
- }
- /* Offset the negative seconds */
-- add_seconds_to_datetimestruct(out, seconds);
-+ pandas_add_seconds_to_datetimestruct(out, seconds);
- out->us = (dt / 1000000000000LL) % 1000000LL;
- out->ps = (dt / 1000000LL) % 1000000LL;
- out->as = dt % 1000000LL;
-diff --git a/pandas/src/datetime/np_datetime.h b/pandas/src/datetime/np_datetime.h
---- a/pandas/src/datetime/np_datetime.h
-+++ b/pandas/src/datetime/np_datetime.h
-@@ -45,7 +45,7 @@ typedef struct {
- // stuff pandas needs
- // ----------------------------------------------------------------------------
-
--int convert_pydatetime_to_datetimestruct(PyObject *obj, pandas_datetimestruct *out,
-+int pandas_convert_pydatetime_to_datetimestruct(PyObject *obj, pandas_datetimestruct *out,
- PANDAS_DATETIMEUNIT *out_bestunit,
- int apply_tzinfo);
-
-@@ -55,14 +55,14 @@ npy_datetime pandas_datetimestruct_to_datetime(PANDAS_DATETIMEUNIT fr,
- void pandas_datetime_to_datetimestruct(npy_datetime val, PANDAS_DATETIMEUNIT fr,
- pandas_datetimestruct *result);
-
--int dayofweek(int y, int m, int d);
-+int pandas_dayofweek(int y, int m, int d);
-
- extern const int days_per_month_table[2][12];
-
- // stuff numpy-derived code needs in header
- // ----------------------------------------------------------------------------
-
--int is_leapyear(npy_int64 year);
-+int pandas_is_leapyear(npy_int64 year);
-
- /*
- * Converts a datetime from a datetimestruct to a datetime based
-@@ -73,7 +73,7 @@ int is_leapyear(npy_int64 year);
- * Returns 0 on success, -1 on failure.
- */
- int
--convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
-+pandas_convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
- const pandas_datetimestruct *dts,
- npy_datetime *out);
-
-@@ -81,14 +81,14 @@ convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
- * Calculates the days offset from the 1970 epoch.
- */
- npy_int64
--get_datetimestruct_days(const pandas_datetimestruct *dts);
-+pandas_get_datetimestruct_days(const pandas_datetimestruct *dts);
-
- /*
- * Adjusts a datetimestruct based on a minutes offset. Assumes
- * the current values are valid.
- */
- void
--add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes);
-+pandas_add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes);
-
- /*
- * This provides the casting rules for the TIMEDELTA data type units.
-@@ -97,23 +97,23 @@ add_minutes_to_datetimestruct(pandas_datetimestruct *dts, int minutes);
- * months units, and all the other units.
- */
- //npy_bool
--//can_cast_timedelta64_units(PANDAS_DATETIMEUNIT src_unit,
-+//pandas_can_cast_timedelta64_units(PANDAS_DATETIMEUNIT src_unit,
- // PANDAS_DATETIMEUNIT dst_unit,
- // NPY_CASTING casting);
-
- npy_bool
--can_cast_datetime64_units(PANDAS_DATETIMEUNIT src_unit,
-+pandas_can_cast_datetime64_units(PANDAS_DATETIMEUNIT src_unit,
- PANDAS_DATETIMEUNIT dst_unit,
- NPY_CASTING casting);
-
-
- int
--convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
-+pandas_convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
- npy_datetime dt,
- pandas_datetimestruct *out);
-
-
--PANDAS_DATETIMEUNIT get_datetime64_unit(PyObject *obj);
-+PANDAS_DATETIMEUNIT pandas_get_datetime64_unit(PyObject *obj);
-
-
- #endif
-diff --git a/pandas/src/datetime/np_datetime_strings.c b/pandas/src/datetime/np_datetime_strings.c
---- a/pandas/src/datetime/np_datetime_strings.c
-+++ b/pandas/src/datetime/np_datetime_strings.c
-@@ -21,7 +21,7 @@
- #include "np_datetime_strings.h"
-
- NPY_NO_EXPORT const char *
--npy_casting_to_string(NPY_CASTING casting)
-+pandas_npy_casting_to_string(NPY_CASTING casting)
- {
- switch (casting) {
- case NPY_NO_CASTING:
-@@ -199,7 +199,7 @@ convert_datetimestruct_utc_to_local(pandas_datetimestruct *out_dts_local,
- * we drop the seconds value from the pandas_datetimestruct, everything
- * is ok for this operation.
- */
-- rawtime = (time_t)get_datetimestruct_days(out_dts_local) * 24 * 60 * 60;
-+ rawtime = (time_t)pandas_get_datetimestruct_days(out_dts_local) * 24 * 60 * 60;
- rawtime += dts_utc->hour * 60 * 60;
- rawtime += dts_utc->min * 60;
-
-@@ -217,7 +217,7 @@ convert_datetimestruct_utc_to_local(pandas_datetimestruct *out_dts_local,
-
- /* Extract the timezone offset that was applied */
- rawtime /= 60;
-- localrawtime = (time_t)get_datetimestruct_days(out_dts_local) * 24 * 60;
-+ localrawtime = (time_t)pandas_get_datetimestruct_days(out_dts_local) * 24 * 60;
- localrawtime += out_dts_local->hour * 60;
- localrawtime += out_dts_local->min;
-
-@@ -330,7 +330,7 @@ convert_datetimestruct_local_to_utc(pandas_datetimestruct *out_dts_utc,
- /* } */
-
- /* /\* Parse the ISO date *\/ */
--/* if (parse_iso_8601_datetime(str, len, PANDAS_FR_us, NPY_UNSAFE_CASTING, */
-+/* if (pandas_parse_iso_8601_datetime(str, len, PANDAS_FR_us, NPY_UNSAFE_CASTING, */
- /* dts, NULL, &bestunit, NULL) < 0) { */
- /* Py_DECREF(bytes); */
- /* return -1; */
-@@ -377,7 +377,7 @@ convert_datetimestruct_local_to_utc(pandas_datetimestruct *out_dts_utc,
- * Returns 0 on success, -1 on failure.
- */
- int
--parse_iso_8601_datetime(char *str, int len,
-+pandas_parse_iso_8601_datetime(char *str, int len,
- PANDAS_DATETIMEUNIT unit,
- NPY_CASTING casting,
- pandas_datetimestruct *out,
-@@ -438,12 +438,12 @@ parse_iso_8601_datetime(char *str, int len,
- }
-
- /* Check the casting rule */
-- if (unit != -1 && !can_cast_datetime64_units(bestunit, unit,
-+ if (unit != -1 && !pandas_can_cast_datetime64_units(bestunit, unit,
- casting)) {
- PyErr_Format(PyExc_TypeError, "Cannot parse \"%s\" as unit "
- "'%s' using casting rule %s",
- str, _datetime_strings[unit],
-- npy_casting_to_string(casting));
-+ pandas_npy_casting_to_string(casting));
- return -1;
- }
-
-@@ -481,16 +481,16 @@ parse_iso_8601_datetime(char *str, int len,
- }
-
- /* Check the casting rule */
-- if (unit != -1 && !can_cast_datetime64_units(bestunit, unit,
-+ if (unit != -1 && !pandas_can_cast_datetime64_units(bestunit, unit,
- casting)) {
- PyErr_Format(PyExc_TypeError, "Cannot parse \"%s\" as unit "
- "'%s' using casting rule %s",
- str, _datetime_strings[unit],
-- npy_casting_to_string(casting));
-+ pandas_npy_casting_to_string(casting));
- return -1;
- }
-
-- return convert_datetime_to_datetimestruct(&meta, rawtime, out);
-+ return pandas_convert_datetime_to_datetimestruct(&meta, rawtime, out);
- }
-
- /* Anything else isn't a special value */
-@@ -872,7 +872,7 @@ parse_timezone:
- offset_hour = -offset_hour;
- offset_minute = -offset_minute;
- }
-- add_minutes_to_datetimestruct(out, -60 * offset_hour - offset_minute);
-+ pandas_add_minutes_to_datetimestruct(out, -60 * offset_hour - offset_minute);
- }
-
- /* Skip trailing whitespace */
-@@ -891,12 +891,12 @@ finish:
- }
-
- /* Check the casting rule */
-- if (unit != -1 && !can_cast_datetime64_units(bestunit, unit,
-+ if (unit != -1 && !pandas_can_cast_datetime64_units(bestunit, unit,
- casting)) {
- PyErr_Format(PyExc_TypeError, "Cannot parse \"%s\" as unit "
- "'%s' using casting rule %s",
- str, _datetime_strings[unit],
-- npy_casting_to_string(casting));
-+ pandas_npy_casting_to_string(casting));
- return -1;
- }
-
-@@ -917,7 +917,7 @@ error:
- * objects with the given local and unit settings.
- */
- int
--get_datetime_iso_8601_strlen(int local, PANDAS_DATETIMEUNIT base)
-+pandas_get_datetime_iso_8601_strlen(int local, PANDAS_DATETIMEUNIT base)
- {
- int len = 0;
-
-@@ -1047,7 +1047,7 @@ lossless_unit_from_datetimestruct(pandas_datetimestruct *dts)
- * string was too short).
- */
- int
--make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
-+pandas_make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
- int local, PANDAS_DATETIMEUNIT base, int tzoffset,
- NPY_CASTING casting)
- {
-@@ -1105,7 +1105,7 @@ make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
-
- /* Set and apply the required timezone offset */
- timezone_offset = tzoffset;
-- add_minutes_to_datetimestruct(dts, timezone_offset);
-+ pandas_add_minutes_to_datetimestruct(dts, timezone_offset);
- }
-
- /*
-diff --git a/pandas/src/datetime/np_datetime_strings.h b/pandas/src/datetime/np_datetime_strings.h
---- a/pandas/src/datetime/np_datetime_strings.h
-+++ b/pandas/src/datetime/np_datetime_strings.h
-@@ -41,7 +41,7 @@
- * Returns 0 on success, -1 on failure.
- */
- int
--parse_iso_8601_datetime(char *str, int len,
-+pandas_parse_iso_8601_datetime(char *str, int len,
- PANDAS_DATETIMEUNIT unit,
- NPY_CASTING casting,
- pandas_datetimestruct *out,
-@@ -54,7 +54,7 @@ parse_iso_8601_datetime(char *str, int len,
- * objects with the given local and unit settings.
- */
- int
--get_datetime_iso_8601_strlen(int local, PANDAS_DATETIMEUNIT base);
-+pandas_get_datetime_iso_8601_strlen(int local, PANDAS_DATETIMEUNIT base);
-
- /*
- * Converts an pandas_datetimestruct to an (almost) ISO 8601
-@@ -79,7 +79,7 @@ get_datetime_iso_8601_strlen(int local, PANDAS_DATETIMEUNIT base);
- * string was too short).
- */
- int
--make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
-+pandas_make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
- int local, PANDAS_DATETIMEUNIT base, int tzoffset,
- NPY_CASTING casting);
-
-diff --git a/pandas/src/datetime_helper.h b/pandas/src/datetime_helper.h
---- a/pandas/src/datetime_helper.h
-+++ b/pandas/src/datetime_helper.h
-@@ -1,5 +1,7 @@
- #include "datetime.h"
-+#include "helper.h"
-
-+PANDAS_INLINE
- void mangle_nat(PyObject *val) {
- PyDateTime_GET_MONTH(val) = -1;
- PyDateTime_GET_DAY(val) = -1;
-diff --git a/pandas/src/numpy_helper.h b/pandas/src/numpy_helper.h
---- a/pandas/src/numpy_helper.h
-+++ b/pandas/src/numpy_helper.h
-@@ -126,6 +126,7 @@ char_to_string(char* data) {
- // return PyString_Check(obj);
- // #endif
-
-+PANDAS_INLINE
- PyObject* sarr_from_data(PyArray_Descr *descr, int length, void* data) {
- PyArrayObject *result;
- npy_intp dims[1] = {length};
-@@ -140,6 +141,7 @@ PyObject* sarr_from_data(PyArray_Descr *descr, int length, void* data) {
- }
-
-
-+PANDAS_INLINE
- void transfer_object_column(char *dst, char *src, size_t stride,
- size_t length) {
- int i;
-@@ -158,10 +160,12 @@ void transfer_object_column(char *dst, char *src, size_t stride,
- }
- }
-
-+PANDAS_INLINE
- void set_array_owndata(PyArrayObject *ao) {
- ao->flags |= NPY_OWNDATA;
- }
-
-+PANDAS_INLINE
- void set_array_not_contiguous(PyArrayObject *ao) {
- ao->flags &= ~(NPY_C_CONTIGUOUS | NPY_F_CONTIGUOUS);
- }
-diff --git a/pandas/src/parse_helper.h b/pandas/src/parse_helper.h
---- a/pandas/src/parse_helper.h
-+++ b/pandas/src/parse_helper.h
-@@ -1,9 +1,11 @@
- #include <errno.h>
- #include <float.h>
-+#include "helper.h"
-
- static double xstrtod(const char *p, char **q, char decimal, char sci,
- int skip_trailing);
-
-+PANDAS_INLINE
- int to_double(char *item, double *p_value, char sci, char decimal)
- {
- char *p_end;
-diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
---- a/pandas/tests/test_frame.py
-+++ b/pandas/tests/test_frame.py
-@@ -37,7 +37,7 @@ from pandas.core.api import (DataFrame, Index, Series, notnull, isnull,
- from pandas import date_range
- import pandas as pd
- from pandas.io.parsers import read_csv
--from pandas.parser import CParserError
-+from pandas.p_parser import CParserError
- from pandas.util.misc import is_little_endian
-
- from pandas.util.testing import (assert_almost_equal,
-diff --git a/setup.py b/setup.py
---- a/setup.py
-+++ b/setup.py
-@@ -75,6 +75,7 @@ from distutils.extension import Extension
- from distutils.command.build import build
- from distutils.command.sdist import sdist
- from distutils.command.build_ext import build_ext as _build_ext
-+from numpy.distutils.misc_util import get_numpy_include_dirs
-
- try:
- from Cython.Distutils import build_ext as _build_ext
-@@ -88,11 +89,11 @@ from os.path import join as pjoin
-
- class build_ext(_build_ext):
- def build_extensions(self):
-- numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
--
-- for ext in self.extensions:
-- if hasattr(ext, 'include_dirs') and not numpy_incl in ext.include_dirs:
-- ext.include_dirs.append(numpy_incl)
-+ numpy_incl_dirs = get_numpy_include_dirs()
-+ for numpy_incl in numpy_incl_dirs:
-+ for ext in self.extensions:
-+ if hasattr(ext, 'include_dirs') and not numpy_incl in ext.include_dirs:
-+ ext.include_dirs.append(numpy_incl)
- _build_ext.build_extensions(self)
-
-
-@@ -435,7 +436,7 @@ ext_data = dict(
- 'pandas/src/datetime/np_datetime_strings.c']},
- algos={'pyxfile': 'algos',
- 'depends': [srcpath('generated', suffix='.pyx')]},
-- parser=dict(pyxfile='parser',
-+ p_parser=dict(pyxfile='parser',
- depends=['pandas/src/parser/tokenizer.h',
- 'pandas/src/parser/io.h',
- 'pandas/src/numpy_helper.h'],
-@@ -444,6 +445,8 @@ ext_data = dict(
- )
-
- extensions = []
-+included = set(['pandas/src/datetime/np_datetime.c',
-+ 'pandas/src/datetime/np_datetime_strings.c'])
-
- for name, data in ext_data.items():
- sources = [srcpath(data['pyxfile'], suffix=suffix, subdir='')]
-@@ -451,7 +454,10 @@ for name, data in ext_data.items():
- if suffix == '.pyx' and pxds:
- sources.extend(pxds)
-
-- sources.extend(data.get('sources', []))
-+ for source in data.get('sources', []):
-+ if source not in included:
-+ included.add(source)
-+ sources.append(source)
-
- include = data.get('include', common_include)
-
-@@ -493,7 +499,7 @@ msgpack_ext = Extension('pandas.msgpack',
- include_dirs=common_include,
- define_macros=macros)
-
--extensions.append(msgpack_ext)
-+#extensions.append(msgpack_ext)
-
- # if not ISRELEASED:
- # extensions.extend([sandbox_ext])
-@@ -514,7 +520,8 @@ ujson_ext = Extension('pandas.json',
- 'pandas/src/ujson/lib/ultrajsonenc.c',
- 'pandas/src/ujson/lib/ultrajsondec.c',
- 'pandas/src/datetime/np_datetime.c',
-- 'pandas/src/datetime/np_datetime_strings.c'],
-+ 'pandas/src/datetime/np_datetime_strings.c',
-+ ],
- include_dirs=['pandas/src/ujson/python',
- 'pandas/src/ujson/lib',
- 'pandas/src/datetime'] + common_include,
diff --git a/ports/python_modules/pandas/pkg_info b/ports/python_modules/pandas/pkg_info
deleted file mode 100644
index 995c385..0000000
--- a/ports/python_modules/pandas/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=pandas
-VERSION=0.13.1
-URL=https://pypi.python.org/packages/source/p/pandas/pandas-0.13.1.tar.gz
-LICENSE=BSD
-DISABLED_LIBC=(glibc)
-DEPENDS=(python-host python-dateutil distribute numpy six hdf5 h5py pytz)
-SHA1=fe0ffb959f8204ef1302cf49c56a7138d4a7752a
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/pyparsing/build.sh b/ports/python_modules/pyparsing/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/pyparsing/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/pyparsing/pkg_info b/ports/python_modules/pyparsing/pkg_info
deleted file mode 100644
index 21e89f3..0000000
--- a/ports/python_modules/pyparsing/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=pyparsing
-VERSION=2.0.1
-URL=https://pypi.python.org/packages/source/p/pyparsing/pyparsing-2.0.1.tar.gz
-LICENSE=MIT
-DEPENDS=(python-host)
-SHA1=b645857008881d70599e89c66e4bbc596fe22043
diff --git a/ports/python_modules/pyppapi/build.sh b/ports/python_modules/pyppapi/build.sh
deleted file mode 100644
index 0922b45..0000000
--- a/ports/python_modules/pyppapi/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
-
diff --git a/ports/python_modules/pyppapi/modules.list b/ports/python_modules/pyppapi/modules.list
deleted file mode 100644
index aec50da..0000000
--- a/ports/python_modules/pyppapi/modules.list
+++ /dev/null
@@ -1 +0,0 @@
-ppapi_wrapper
diff --git a/ports/python_modules/pyppapi/pkg_info b/ports/python_modules/pyppapi/pkg_info
deleted file mode 100644
index 3d9f116..0000000
--- a/ports/python_modules/pyppapi/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=pyppapi
-VERSION=0.4
-URL=https://pypi.python.org/packages/source/p/pyppapi/pyppapi-0.4.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host cython numpy)
-SHA1=203f78ad9ad4208fadc824c64915ae31633d878e
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/python-dateutil/build.sh b/ports/python_modules/python-dateutil/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/python-dateutil/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/python-dateutil/pkg_info b/ports/python_modules/python-dateutil/pkg_info
deleted file mode 100644
index 936975e..0000000
--- a/ports/python_modules/python-dateutil/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=python-dateutil
-VERSION=2.2
-URL=https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host six setuptools)
-SHA1=fbafcd19ea0082b3ecb17695b4cb46070181699f
diff --git a/ports/python_modules/python-gflags/build.sh b/ports/python_modules/python-gflags/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/python-gflags/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/python-gflags/pkg_info b/ports/python_modules/python-gflags/pkg_info
deleted file mode 100644
index fa9a2a4..0000000
--- a/ports/python_modules/python-gflags/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=python-gflags
-VERSION=2.0
-URL=https://pypi.python.org/packages/source/p/python-gflags/python-gflags-2.0.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host openssl setuptools)
-SHA1=1529a1102da2fc671f2a9a5e387ebabd1ceacbbf
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/pytz/build.sh b/ports/python_modules/pytz/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/pytz/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/pytz/pkg_info b/ports/python_modules/pytz/pkg_info
deleted file mode 100644
index 7e26832..0000000
--- a/ports/python_modules/pytz/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=pytz
-VERSION=2014.2
-URL=https://pypi.python.org/packages/source/p/pytz/pytz-2014.2.tar.gz
-LICENSE=MIT
-DISABLED_LIBC=(glibc)
-DEPENDS=(python-host)
-SHA1=ca2ddf147dee651e211d77438a914e0fac6414f2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/pyzmq/build.sh b/ports/python_modules/pyzmq/build.sh
deleted file mode 100644
index 0922b45..0000000
--- a/ports/python_modules/pyzmq/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
-
diff --git a/ports/python_modules/pyzmq/modules.libs b/ports/python_modules/pyzmq/modules.libs
deleted file mode 100644
index ed528c0..0000000
--- a/ports/python_modules/pyzmq/modules.libs
+++ /dev/null
@@ -1 +0,0 @@
-PY_MOD_LIBS+=" -lzmq"
diff --git a/ports/python_modules/pyzmq/modules.list b/ports/python_modules/pyzmq/modules.list
deleted file mode 100644
index e5fda79..0000000
--- a/ports/python_modules/pyzmq/modules.list
+++ /dev/null
@@ -1,12 +0,0 @@
-_zerror
-__zversion
-__zdevice
-_zconstants
-_zstopwatch
-__zpoll
-_zmessage
-_zcontext
-_zsocket
-_zrebuffer
-_zinitthreads
-_zmonitoredqueue
diff --git a/ports/python_modules/pyzmq/nacl.patch b/ports/python_modules/pyzmq/nacl.patch
deleted file mode 100644
index f4c1c7f..0000000
--- a/ports/python_modules/pyzmq/nacl.patch
+++ /dev/null
@@ -1,5112 +0,0 @@
-diff --git a/buildutils/config.py b/buildutils/config.py
---- a/buildutils/config.py
-+++ b/buildutils/config.py
-@@ -87,6 +87,11 @@ def get_cfg_args():
- cfg = cfg2dict(cfg)
-
- g = cfg.setdefault('global', {})
-+ if "NACL_BUILD_TREE" in os.environ:
-+ NACL_TREE = os.environ["NACL_BUILD_TREE"]
-+ cfg["global"]["zmq_prefix"] = NACL_TREE
-+ cfg["global"]["have_sys_un_h"] = "False"
-+
- # boolean keys:
- for key in ['libzmq_extension',
- 'bundle_libzmq_dylib',
-diff --git a/setup.cfg b/setup.cfg
-new file mode 100644
---- /dev/null
-+++ b/setup.cfg
-@@ -0,0 +1,3 @@
-+[bdist_egg]
-+plat-name = pnacl
-+
-diff --git a/setup.py b/setup.py
---- a/setup.py
-+++ b/setup.py
-@@ -270,6 +270,10 @@ class Configure(build_ext):
- # include internal directories
- settings.setdefault('include_dirs', [])
- settings['include_dirs'] += [pjoin('zmq', sub) for sub in ('utils','core','devices')]
-+ if "NACL_BUILD_TREE" in os.environ:
-+ settings['include_dirs'].append(pjoin(
-+ os.environ["NACL_BUILD_TREE"],
-+ "include", "glibc-compat"))
-
- for ext in self.distribution.ext_modules:
- if ext.name == 'zmq.libzmq':
-@@ -826,29 +830,29 @@ def dotc(subdir, name):
-
- libzmq = pxd('core', 'libzmq')
- buffers = pxd('utils', 'buffers')
--message = pxd('core', 'message')
--context = pxd('core', 'context')
--socket = pxd('core', 'socket')
-+message = pxd('core', '_zmessage')
-+context = pxd('core', '_zcontext')
-+socket = pxd('core', '_zsocket')
- checkrc = pxd('core', 'checkrc')
--monqueue = pxd('devices', 'monitoredqueue')
-+monqueue = pxd('devices', '_zmonitoredqueue')
-
- submodules = dict(
-- core = {'constants': [libzmq],
-- 'error':[libzmq, checkrc],
-- '_poll':[libzmq, socket, context, checkrc],
-- 'stopwatch':[libzmq, pxd('core','stopwatch'), checkrc],
-- 'context':[context, libzmq, checkrc],
-- 'message':[libzmq, buffers, message, checkrc],
-- 'socket':[context, message, socket, libzmq, buffers, checkrc],
-- '_device':[libzmq, socket, context, checkrc],
-- '_version':[libzmq],
-+ core = {'_zconstants': [libzmq],
-+ '_zerror':[libzmq, checkrc],
-+ '__zpoll':[libzmq, socket, context, checkrc],
-+ '_zstopwatch':[libzmq, pxd('core','_zstopwatch'), checkrc],
-+ '_zcontext':[context, libzmq, checkrc],
-+ '_zmessage':[libzmq, buffers, message, checkrc],
-+ '_zsocket':[context, message, socket, libzmq, buffers, checkrc],
-+ '__zdevice':[libzmq, socket, context, checkrc],
-+ '__zversion':[libzmq],
- },
- devices = {
-- 'monitoredqueue':[buffers, libzmq, monqueue, socket, context, checkrc],
-+ '_zmonitoredqueue':[buffers, libzmq, monqueue, socket, context, checkrc],
- },
- utils = {
-- 'initthreads':[libzmq],
-- 'rebuffer':[buffers],
-+ '_zinitthreads':[libzmq],
-+ '_zrebuffer':[buffers],
- },
- )
-
-diff --git a/zmq/__init__.py b/zmq/__init__.py
---- a/zmq/__init__.py
-+++ b/zmq/__init__.py
-@@ -39,7 +39,7 @@ if bundled:
-
- if 'PyPy' not in sys.version:
- try:
-- from zmq.utils import initthreads # initialize threads
-+ from zmq.utils import _zinitthreads as initthreads # initialize threads
- except ImportError as e:
- raise ImportError("%s\nAre you trying to `import zmq` from the pyzmq source dir?" % e)
- else:
-diff --git a/zmq/core/__init__.py b/zmq/core/__init__.py
---- a/zmq/core/__init__.py
-+++ b/zmq/core/__init__.py
-@@ -23,21 +23,21 @@
- # Imports
- #-----------------------------------------------------------------------------
-
--from zmq.core import (constants, error, message, context,
-- socket, stopwatch, _poll, _version, _device )
-+from zmq.core import (_zconstants, _zerror, _zmessage, _zcontext,
-+ _zsocket, _zstopwatch, __zpoll, __zversion, __zdevice )
-
- __all__ = []
--for submod in (constants, error, message, context,
-- socket, stopwatch, _poll, _version, _device):
-+for submod in (_zconstants, _zerror, _zmessage, _zcontext,
-+ _zsocket, _zstopwatch, __zpoll, __zversion, __zdevice):
- __all__.extend(submod.__all__)
-
--from zmq.core.constants import *
--from zmq.core.error import *
--from zmq.core.message import *
--from zmq.core.context import *
--from zmq.core.socket import *
--from zmq.core._poll import *
--from zmq.core.stopwatch import *
--from zmq.core._device import *
--from zmq.core._version import *
-+from zmq.core._zconstants import *
-+from zmq.core._zerror import *
-+from zmq.core._zmessage import *
-+from zmq.core._zcontext import *
-+from zmq.core._zsocket import *
-+from zmq.core.__zpoll import *
-+from zmq.core._zstopwatch import *
-+from zmq.core.__zdevice import *
-+from zmq.core.__zversion import *
-
-diff --git a/zmq/core/__zdevice.pyx b/zmq/core/__zdevice.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/__zdevice.pyx
-@@ -0,0 +1,86 @@
-+"""Python binding for 0MQ device function."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from libzmq cimport zmq_device, zmq_proxy, ZMQ_VERSION_MAJOR
-+from zmq.core._zsocket cimport Socket as cSocket
-+from zmq.core.checkrc cimport _check_rc
-+
-+#-----------------------------------------------------------------------------
-+# Basic device API
-+#-----------------------------------------------------------------------------
-+
-+def device(int device_type, cSocket frontend, cSocket backend=None):
-+ """device(device_type, frontend, backend)
-+
-+ Start a zeromq device.
-+
-+ WARNING: zmq.device is deprecated as of libzmq-3.2,
-+ in favor of zmq.proxy.
-+
-+ Parameters
-+ ----------
-+ device_type : (QUEUE, FORWARDER, STREAMER)
-+ The type of device to start.
-+ frontend : Socket
-+ The Socket instance for the incoming traffic.
-+ backend : Socket
-+ The Socket instance for the outbound traffic.
-+ """
-+ if ZMQ_VERSION_MAJOR >= 3:
-+ return proxy(frontend, backend)
-+
-+ cdef int rc = 0
-+ with nogil:
-+ rc = zmq_device(device_type, frontend.handle, backend.handle)
-+ _check_rc(rc)
-+ return rc
-+
-+def proxy(cSocket frontend, cSocket backend, cSocket capture=None):
-+ """proxy(frontend, backend, capture)
-+
-+ Start a zeromq proxy (replacement for device).
-+
-+ Parameters
-+ ----------
-+ frontend : Socket
-+ The Socket instance for the incoming traffic.
-+ backend : Socket
-+ The Socket instance for the outbound traffic.
-+ capture : Socket
-+ The Socket instance for capturing traffic.
-+ """
-+ cdef int rc = 0
-+ cdef void* capture_handle
-+ if isinstance(capture, cSocket):
-+ capture_handle = capture.handle
-+ else:
-+ capture_handle = NULL
-+ with nogil:
-+ rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
-+ _check_rc(rc)
-+ return rc
-+
-+__all__ = ['device', 'proxy']
-+
-diff --git a/zmq/core/__zpoll.pyx b/zmq/core/__zpoll.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/__zpoll.pyx
-@@ -0,0 +1,136 @@
-+"""0MQ polling related functions and classes."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from libc.stdlib cimport free, malloc
-+
-+from libzmq cimport zmq_pollitem_t, ZMQ_VERSION_MAJOR
-+from libzmq cimport zmq_poll as zmq_poll_c
-+from _zsocket cimport Socket
-+
-+import sys
-+
-+from zmq.core.checkrc cimport _check_rc
-+
-+#-----------------------------------------------------------------------------
-+# Polling related methods
-+#-----------------------------------------------------------------------------
-+
-+# version-independent typecheck for int/long
-+if sys.version_info[0] >= 3:
-+ int_t = int
-+else:
-+ int_t = (int,long)
-+
-+def zmq_poll(sockets, long timeout=-1):
-+ """zmq_poll(sockets, timeout=-1)
-+
-+ Poll a set of 0MQ sockets, native file descs. or sockets.
-+
-+ Parameters
-+ ----------
-+ sockets : list of tuples of (socket, flags)
-+ Each element of this list is a two-tuple containing a socket
-+ and a flags. The socket may be a 0MQ socket or any object with
-+ a ``fileno()`` method. The flags can be zmq.POLLIN (for detecting
-+ for incoming messages), zmq.POLLOUT (for detecting that send is OK)
-+ or zmq.POLLIN|zmq.POLLOUT for detecting both.
-+ timeout : int
-+ The number of milliseconds to poll for. Negative means no timeout.
-+ """
-+ cdef int rc, i
-+ cdef zmq_pollitem_t *pollitems = NULL
-+ cdef int nsockets = <int>len(sockets)
-+ cdef Socket current_socket
-+
-+ if nsockets == 0:
-+ return []
-+
-+ pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t))
-+ if pollitems == NULL:
-+ raise MemoryError("Could not allocate poll items")
-+
-+ if ZMQ_VERSION_MAJOR < 3:
-+ # timeout is us in 2.x, ms in 3.x
-+ # expected input is ms (matches 3.x)
-+ timeout = 1000*timeout
-+
-+ for i in range(nsockets):
-+ s = sockets[i][0]
-+ events = sockets[i][1]
-+ if isinstance(s, Socket):
-+ current_socket = s
-+ pollitems[i].socket = current_socket.handle
-+ pollitems[i].events = events
-+ pollitems[i].revents = 0
-+ elif isinstance(s, int_t):
-+ pollitems[i].socket = NULL
-+ pollitems[i].fd = s
-+ pollitems[i].events = events
-+ pollitems[i].revents = 0
-+ elif hasattr(s, 'fileno'):
-+ try:
-+ fileno = int(s.fileno())
-+ except:
-+ free(pollitems)
-+ raise ValueError('fileno() must return an valid integer fd')
-+ else:
-+ pollitems[i].socket = NULL
-+ pollitems[i].fd = fileno
-+ pollitems[i].events = events
-+ pollitems[i].revents = 0
-+ else:
-+ free(pollitems)
-+ raise TypeError(
-+ "Socket must be a 0MQ socket, an integer fd or have "
-+ "a fileno() method: %r" % s
-+ )
-+
-+
-+ with nogil:
-+ rc = zmq_poll_c(pollitems, nsockets, timeout)
-+
-+ if rc < 0:
-+ free(pollitems)
-+ _check_rc(rc)
-+
-+ results = []
-+ for i in range(nsockets):
-+ s = sockets[i][0]
-+ # Return the fd for sockets, for compat. with select.poll.
-+ if hasattr(s, 'fileno'):
-+ s = s.fileno()
-+ revents = pollitems[i].revents
-+ # Only return sockets with non-zero status for compat. with select.poll.
-+ if revents > 0:
-+ results.append((s, revents))
-+
-+ free(pollitems)
-+ return results
-+
-+#-----------------------------------------------------------------------------
-+# Symbols to export
-+#-----------------------------------------------------------------------------
-+
-+__all__ = [ 'zmq_poll' ]
-diff --git a/zmq/core/__zversion.pyx b/zmq/core/__zversion.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/__zversion.pyx
-@@ -0,0 +1,43 @@
-+"""PyZMQ and 0MQ version functions."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from libzmq cimport _zmq_version
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+def zmq_version_info():
-+ """zmq_version_info()
-+
-+ Return the version of ZeroMQ itself as a 3-tuple of ints.
-+ """
-+ cdef int major, minor, patch
-+ _zmq_version(&major, &minor, &patch)
-+ return (major, minor, patch)
-+
-+
-+__all__ = ['zmq_version_info']
-+
-diff --git a/zmq/core/_device.pyx b/zmq/core/_device.pyx
-deleted file mode 100644
---- a/zmq/core/_device.pyx
-+++ /dev/null
-@@ -1,86 +0,0 @@
--"""Python binding for 0MQ device function."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from libzmq cimport zmq_device, zmq_proxy, ZMQ_VERSION_MAJOR
--from zmq.core.socket cimport Socket as cSocket
--from zmq.core.checkrc cimport _check_rc
--
--#-----------------------------------------------------------------------------
--# Basic device API
--#-----------------------------------------------------------------------------
--
--def device(int device_type, cSocket frontend, cSocket backend=None):
-- """device(device_type, frontend, backend)
--
-- Start a zeromq device.
--
-- WARNING: zmq.device is deprecated as of libzmq-3.2,
-- in favor of zmq.proxy.
--
-- Parameters
-- ----------
-- device_type : (QUEUE, FORWARDER, STREAMER)
-- The type of device to start.
-- frontend : Socket
-- The Socket instance for the incoming traffic.
-- backend : Socket
-- The Socket instance for the outbound traffic.
-- """
-- if ZMQ_VERSION_MAJOR >= 3:
-- return proxy(frontend, backend)
--
-- cdef int rc = 0
-- with nogil:
-- rc = zmq_device(device_type, frontend.handle, backend.handle)
-- _check_rc(rc)
-- return rc
--
--def proxy(cSocket frontend, cSocket backend, cSocket capture=None):
-- """proxy(frontend, backend, capture)
--
-- Start a zeromq proxy (replacement for device).
--
-- Parameters
-- ----------
-- frontend : Socket
-- The Socket instance for the incoming traffic.
-- backend : Socket
-- The Socket instance for the outbound traffic.
-- capture : Socket
-- The Socket instance for capturing traffic.
-- """
-- cdef int rc = 0
-- cdef void* capture_handle
-- if isinstance(capture, cSocket):
-- capture_handle = capture.handle
-- else:
-- capture_handle = NULL
-- with nogil:
-- rc = zmq_proxy(frontend.handle, backend.handle, capture_handle)
-- _check_rc(rc)
-- return rc
--
--__all__ = ['device', 'proxy']
--
-diff --git a/zmq/core/_poll.pyx b/zmq/core/_poll.pyx
-deleted file mode 100644
---- a/zmq/core/_poll.pyx
-+++ /dev/null
-@@ -1,136 +0,0 @@
--"""0MQ polling related functions and classes."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from libc.stdlib cimport free, malloc
--
--from libzmq cimport zmq_pollitem_t, ZMQ_VERSION_MAJOR
--from libzmq cimport zmq_poll as zmq_poll_c
--from socket cimport Socket
--
--import sys
--
--from zmq.core.checkrc cimport _check_rc
--
--#-----------------------------------------------------------------------------
--# Polling related methods
--#-----------------------------------------------------------------------------
--
--# version-independent typecheck for int/long
--if sys.version_info[0] >= 3:
-- int_t = int
--else:
-- int_t = (int,long)
--
--def zmq_poll(sockets, long timeout=-1):
-- """zmq_poll(sockets, timeout=-1)
--
-- Poll a set of 0MQ sockets, native file descs. or sockets.
--
-- Parameters
-- ----------
-- sockets : list of tuples of (socket, flags)
-- Each element of this list is a two-tuple containing a socket
-- and a flags. The socket may be a 0MQ socket or any object with
-- a ``fileno()`` method. The flags can be zmq.POLLIN (for detecting
-- for incoming messages), zmq.POLLOUT (for detecting that send is OK)
-- or zmq.POLLIN|zmq.POLLOUT for detecting both.
-- timeout : int
-- The number of milliseconds to poll for. Negative means no timeout.
-- """
-- cdef int rc, i
-- cdef zmq_pollitem_t *pollitems = NULL
-- cdef int nsockets = <int>len(sockets)
-- cdef Socket current_socket
--
-- if nsockets == 0:
-- return []
--
-- pollitems = <zmq_pollitem_t *>malloc(nsockets*sizeof(zmq_pollitem_t))
-- if pollitems == NULL:
-- raise MemoryError("Could not allocate poll items")
--
-- if ZMQ_VERSION_MAJOR < 3:
-- # timeout is us in 2.x, ms in 3.x
-- # expected input is ms (matches 3.x)
-- timeout = 1000*timeout
--
-- for i in range(nsockets):
-- s = sockets[i][0]
-- events = sockets[i][1]
-- if isinstance(s, Socket):
-- current_socket = s
-- pollitems[i].socket = current_socket.handle
-- pollitems[i].events = events
-- pollitems[i].revents = 0
-- elif isinstance(s, int_t):
-- pollitems[i].socket = NULL
-- pollitems[i].fd = s
-- pollitems[i].events = events
-- pollitems[i].revents = 0
-- elif hasattr(s, 'fileno'):
-- try:
-- fileno = int(s.fileno())
-- except:
-- free(pollitems)
-- raise ValueError('fileno() must return an valid integer fd')
-- else:
-- pollitems[i].socket = NULL
-- pollitems[i].fd = fileno
-- pollitems[i].events = events
-- pollitems[i].revents = 0
-- else:
-- free(pollitems)
-- raise TypeError(
-- "Socket must be a 0MQ socket, an integer fd or have "
-- "a fileno() method: %r" % s
-- )
--
--
-- with nogil:
-- rc = zmq_poll_c(pollitems, nsockets, timeout)
--
-- if rc < 0:
-- free(pollitems)
-- _check_rc(rc)
--
-- results = []
-- for i in range(nsockets):
-- s = sockets[i][0]
-- # Return the fd for sockets, for compat. with select.poll.
-- if hasattr(s, 'fileno'):
-- s = s.fileno()
-- revents = pollitems[i].revents
-- # Only return sockets with non-zero status for compat. with select.poll.
-- if revents > 0:
-- results.append((s, revents))
--
-- free(pollitems)
-- return results
--
--#-----------------------------------------------------------------------------
--# Symbols to export
--#-----------------------------------------------------------------------------
--
--__all__ = [ 'zmq_poll' ]
-diff --git a/zmq/core/_version.pyx b/zmq/core/_version.pyx
-deleted file mode 100644
---- a/zmq/core/_version.pyx
-+++ /dev/null
-@@ -1,43 +0,0 @@
--"""PyZMQ and 0MQ version functions."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from libzmq cimport _zmq_version
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--def zmq_version_info():
-- """zmq_version_info()
--
-- Return the version of ZeroMQ itself as a 3-tuple of ints.
-- """
-- cdef int major, minor, patch
-- _zmq_version(&major, &minor, &patch)
-- return (major, minor, patch)
--
--
--__all__ = ['zmq_version_info']
--
-diff --git a/zmq/core/_zconstants.pyx b/zmq/core/_zconstants.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zconstants.pyx
-@@ -0,0 +1,190 @@
-+"""0MQ Constants."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from libzmq cimport *
-+
-+#-----------------------------------------------------------------------------
-+# Python module level constants
-+#-----------------------------------------------------------------------------
-+
-+_optionals = []
-+
-+if ZMQ_VERSION < 30000:
-+ # backport DONTWAIT as alias to NOBLOCK
-+ NOBLOCK = ZMQ_NOBLOCK
-+ DONTWAIT = ZMQ_NOBLOCK
-+else:
-+ # keep NOBLOCK as alias for new DONTWAIT
-+ NOBLOCK = ZMQ_DONTWAIT
-+ DONTWAIT = ZMQ_DONTWAIT
-+
-+VERSION = ZMQ_VERSION
-+
-+# socket types
-+PAIR = ZMQ_PAIR
-+PUB = ZMQ_PUB
-+SUB = ZMQ_SUB
-+REQ = ZMQ_REQ
-+REP = ZMQ_REP
-+DEALER = ZMQ_DEALER
-+ROUTER = ZMQ_ROUTER
-+PULL = ZMQ_PULL
-+PUSH = ZMQ_PUSH
-+XPUB = ZMQ_XPUB
-+XSUB = ZMQ_XSUB
-+
-+# keep deprecated aliases
-+XREQ = DEALER
-+XREP = ROUTER
-+UPSTREAM = PULL
-+DOWNSTREAM = PUSH
-+
-+
-+# socket options
-+AFFINITY = ZMQ_AFFINITY
-+IDENTITY = ZMQ_IDENTITY
-+SUBSCRIBE = ZMQ_SUBSCRIBE
-+UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
-+RATE = ZMQ_RATE
-+RECOVERY_IVL = ZMQ_RECOVERY_IVL
-+RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX
-+SNDBUF = ZMQ_SNDBUF
-+RCVBUF = ZMQ_RCVBUF
-+RCVMORE = ZMQ_RCVMORE
-+SNDMORE = ZMQ_SNDMORE
-+POLLIN = ZMQ_POLLIN
-+POLLOUT = ZMQ_POLLOUT
-+POLLERR = ZMQ_POLLERR
-+
-+STREAMER = ZMQ_STREAMER
-+FORWARDER = ZMQ_FORWARDER
-+QUEUE = ZMQ_QUEUE
-+
-+# sockopts new in 2.2.0
-+SNDTIMEO = ZMQ_SNDTIMEO
-+RCVTIMEO = ZMQ_RCVTIMEO
-+
-+# sockopts removed in 3.0.0
-+HWM = ZMQ_HWM
-+SWAP = ZMQ_SWAP
-+MCAST_LOOP = ZMQ_MCAST_LOOP
-+RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC
-+
-+# new in 3.x
-+IO_THREADS = ZMQ_IO_THREADS
-+MAX_SOCKETS = ZMQ_MAX_SOCKETS
-+
-+MORE = ZMQ_MORE
-+
-+MAXMSGSIZE = ZMQ_MAXMSGSIZE
-+SNDHWM = ZMQ_SNDHWM
-+RCVHWM = ZMQ_RCVHWM
-+MULTICAST_HOPS = ZMQ_MULTICAST_HOPS
-+IPV4ONLY = ZMQ_IPV4ONLY
-+LAST_ENDPOINT = ZMQ_LAST_ENDPOINT
-+
-+ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY
-+# aliases
-+ROUTER_BEHAVIOR = ROUTER_MANDATORY
-+FAIL_UNROUTABLE = ROUTER_MANDATORY
-+
-+TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE
-+TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT
-+TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE
-+TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL
-+TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER
-+DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT
-+XPUB_VERBOSE = ZMQ_XPUB_VERBOSE
-+ROUTER_RAW = ZMQ_ROUTER_RAW
-+
-+EVENT_CONNECTED = ZMQ_EVENT_CONNECTED
-+EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED
-+EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED
-+EVENT_LISTENING = ZMQ_EVENT_LISTENING
-+EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED
-+EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED
-+EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED
-+EVENT_CLOSED = ZMQ_EVENT_CLOSED
-+EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED
-+EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED
-+
-+FD = ZMQ_FD
-+EVENTS = ZMQ_EVENTS
-+TYPE = ZMQ_TYPE
-+LINGER = ZMQ_LINGER
-+RECONNECT_IVL = ZMQ_RECONNECT_IVL
-+BACKLOG = ZMQ_BACKLOG
-+
-+# As new constants are added in future versions, add a new block here
-+# like the two above, checking agains the relevant value for ZMQ_VERSION.
-+# The constants will need to be added to libzmq.pxd and utils/zmq_compat.h
-+# as well.
-+
-+#-----------------------------------------------------------------------------
-+# Error handling
-+#-----------------------------------------------------------------------------
-+
-+# Often used standard errnos
-+from errno import (
-+ EAGAIN,
-+ EINVAL,
-+ EFAULT,
-+ ENOMEM,
-+ ENODEV
-+)
-+
-+# For Windows compatability
-+ENOTSUP = ZMQ_ENOTSUP
-+EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
-+ENOBUFS = ZMQ_ENOBUFS
-+ENETDOWN = ZMQ_ENETDOWN
-+EADDRINUSE = ZMQ_EADDRINUSE
-+EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
-+ECONNREFUSED = ZMQ_ECONNREFUSED
-+EINPROGRESS = ZMQ_EINPROGRESS
-+ENOTSOCK = ZMQ_ENOTSOCK
-+
-+# new errnos in zmq3
-+EMSGSIZE = ZMQ_EMSGSIZE
-+EAFNOSUPPORT = ZMQ_EAFNOSUPPORT
-+ENETUNREACH = ZMQ_ENETUNREACH
-+ECONNABORTED = ZMQ_ECONNABORTED
-+ECONNRESET = ZMQ_ECONNRESET
-+ENOTCONN = ZMQ_ENOTCONN
-+ETIMEDOUT = ZMQ_ETIMEDOUT
-+EHOSTUNREACH = ZMQ_EHOSTUNREACH
-+ENETRESET = ZMQ_ENETRESET
-+
-+# 0MQ Native
-+EFSM = ZMQ_EFSM
-+ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
-+ETERM = ZMQ_ETERM
-+EMTHREAD = ZMQ_EMTHREAD
-+
-+#-----------------------------------------------------------------------------
-+# Symbols to export
-+#-----------------------------------------------------------------------------
-+_names = list(locals().keys())
-+__all__ = [ key for key in _names if not key.startswith('_') ]
-diff --git a/zmq/core/_zcontext.pxd b/zmq/core/_zcontext.pxd
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zcontext.pxd
-@@ -0,0 +1,40 @@
-+"""0MQ Context class declaration."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+cdef class Context:
-+ """Manage the lifecycle of a 0MQ context."""
-+
-+ cdef object __weakref__ # enable weakref
-+ cdef void *handle # The C handle for the underlying zmq object.
-+ cdef void **_sockets # A C-array containg socket handles
-+ cdef size_t _n_sockets # the number of sockets
-+ cdef size_t _max_sockets # the size of the _sockets array
-+ cdef int _pid # the pid of the process which created me (for fork safety)
-+
-+ cdef public object closed # bool property for a closed context.
-+ # helpers for events on _sockets in Socket.__cinit__()/close()
-+ cdef inline void _add_socket(self, void* handle)
-+ cdef inline void _remove_socket(self, void* handle)
-+
-diff --git a/zmq/core/_zcontext.pyx b/zmq/core/_zcontext.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zcontext.pyx
-@@ -0,0 +1,254 @@
-+"""0MQ Context class."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from libc.stdlib cimport free, malloc, realloc
-+
-+from libzmq cimport *
-+
-+cdef extern from "getpid_compat.h":
-+ int getpid()
-+
-+from zmq.error import ZMQError
-+from zmq.core.checkrc cimport _check_rc
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+_instance = None
-+
-+cdef class Context:
-+ """Context(io_threads=1)
-+
-+ Manage the lifecycle of a 0MQ context.
-+
-+ Parameters
-+ ----------
-+ io_threads : int
-+ The number of IO threads.
-+ """
-+
-+ def __cinit__(self, int io_threads = 1, **kwargs):
-+ self.handle = NULL
-+ self._sockets = NULL
-+
-+ if ZMQ_VERSION_MAJOR >= 3:
-+ self.handle = zmq_ctx_new()
-+ else:
-+ self.handle = zmq_init(io_threads)
-+
-+ if self.handle == NULL:
-+ raise ZMQError()
-+
-+ cdef int rc = 0
-+ if ZMQ_VERSION_MAJOR >= 3:
-+ rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
-+ _check_rc(rc)
-+
-+ self.closed = False
-+ self._n_sockets = 0
-+ self._max_sockets = 32
-+
-+ self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
-+ if self._sockets == NULL:
-+ raise MemoryError("Could not allocate _sockets array")
-+
-+ self._pid = getpid()
-+
-+ def __init__(self, io_threads=1):
-+ # no-op
-+ pass
-+
-+
-+ def __del__(self):
-+ """deleting a Context should terminate it, without trying non-threadsafe destroy"""
-+ self.term()
-+
-+ def __dealloc__(self):
-+ """don't touch members in dealloc, just cleanup allocations"""
-+ cdef int rc
-+ if self._sockets != NULL:
-+ free(self._sockets)
-+ self._sockets = NULL
-+ self._n_sockets = 0
-+ self.term()
-+
-+ cdef inline void _add_socket(self, void* handle):
-+ """Add a socket handle to be closed when Context terminates.
-+
-+ This is to be called in the Socket constructor.
-+ """
-+ # print self._n_sockets, self._max_sockets
-+ if self._n_sockets >= self._max_sockets:
-+ self._max_sockets *= 2
-+ self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
-+ if self._sockets == NULL:
-+ raise MemoryError("Could not reallocate _sockets array")
-+
-+ self._sockets[self._n_sockets] = handle
-+ self._n_sockets += 1
-+ # print self._n_sockets, self._max_sockets
-+
-+ cdef inline void _remove_socket(self, void* handle):
-+ """Remove a socket from the collected handles.
-+
-+ This should be called by Socket.close, to prevent trying to
-+ close a socket a second time.
-+ """
-+ cdef bint found = False
-+
-+ for idx in range(self._n_sockets):
-+ if self._sockets[idx] == handle:
-+ found=True
-+ break
-+
-+ if found:
-+ self._n_sockets -= 1
-+ if self._n_sockets:
-+ # move last handle to closed socket's index
-+ self._sockets[idx] = self._sockets[self._n_sockets]
-+
-+ @property
-+ def _handle(self):
-+ return <Py_ssize_t> self.handle
-+
-+ def term(self):
-+ """ctx.term()
-+
-+ Close or terminate the context.
-+
-+ This can be called to close the context by hand. If this is not called,
-+ the context will automatically be closed when it is garbage collected.
-+ """
-+ cdef int rc
-+ cdef int i=-1
-+
-+ if self.handle != NULL and not self.closed and getpid() == self._pid:
-+ with nogil:
-+ rc = zmq_ctx_destroy(self.handle)
-+ _check_rc(rc)
-+ self.handle = NULL
-+ self.closed = True
-+
-+ def set(self, int option, optval):
-+ """ctx.set(option, optval)
-+
-+ Set context options.
-+
-+ See the 0MQ API documentation for zmq_ctx_set
-+ for details on specific options.
-+
-+ New in libzmq-3.2
-+
-+ Parameters
-+ ----------
-+ option : int
-+ The option to set. Available values will depend on your
-+ version of libzmq. Examples include::
-+
-+ zmq.IO_THREADS, zmq.MAX_SOCKETS
-+
-+ optval : int
-+ The value of the option to set.
-+ """
-+ cdef int optval_int_c
-+ cdef int rc
-+ cdef char* optval_c
-+
-+ if self.closed:
-+ raise RuntimeError("Context has been destroyed")
-+
-+ if not isinstance(optval, int):
-+ raise TypeError('expected int, got: %r' % optval)
-+ optval_int_c = optval
-+ rc = zmq_ctx_set(self.handle, option, optval_int_c)
-+ _check_rc(rc)
-+
-+ def get(self, int option):
-+ """ctx.get(option)
-+
-+ Get the value of a context option.
-+
-+ See the 0MQ API documentation for zmq_ctx_get
-+ for details on specific options.
-+
-+ New in libzmq-3.2
-+
-+ Parameters
-+ ----------
-+ option : int
-+ The option to get. Available values will depend on your
-+ version of libzmq. Examples include::
-+
-+ zmq.IO_THREADS, zmq.MAX_SOCKETS
-+
-+ Returns
-+ -------
-+ optval : int
-+ The value of the option as an integer.
-+ """
-+ cdef int optval_int_c
-+ cdef size_t sz
-+ cdef int rc
-+
-+ if self.closed:
-+ raise RuntimeError("Context has been destroyed")
-+
-+ rc = zmq_ctx_get(self.handle, option)
-+ _check_rc(rc)
-+
-+ return rc
-+
-+ def destroy(self, linger=None):
-+ """ctx.destroy(linger=None)
-+
-+ Close all sockets associated with this context, and then terminate
-+ the context. If linger is specified,
-+ the LINGER sockopt of the sockets will be set prior to closing.
-+
-+ WARNING:
-+
-+ destroy involves calling zmq_close(), which is *NOT* threadsafe.
-+ If there are active sockets in other threads, this must not be called.
-+ """
-+
-+ cdef int linger_c
-+ cdef bint setlinger=False
-+
-+ if linger is not None:
-+ linger_c = linger
-+ setlinger=True
-+ if self.handle != NULL and not self.closed and self._n_sockets:
-+ while self._n_sockets:
-+ if setlinger:
-+ zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int))
-+ rc = zmq_close(self._sockets[0])
-+ if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK:
-+ raise ZMQError()
-+ self._n_sockets -= 1
-+ self._sockets[0] = self._sockets[self._n_sockets]
-+ self.term()
-+
-+__all__ = ['Context']
-diff --git a/zmq/core/_zerror.pyx b/zmq/core/_zerror.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zerror.pyx
-@@ -0,0 +1,56 @@
-+"""0MQ Error classes and functions."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+# allow const char*
-+cdef extern from *:
-+ ctypedef char* const_char_ptr "const char*"
-+
-+from libzmq cimport zmq_strerror, zmq_errno as zmq_errno_c
-+
-+from zmq.utils.strtypes import bytes
-+
-+def strerror(int errno):
-+ """strerror(errno)
-+
-+ Return the error string given the error number.
-+ """
-+ cdef const_char_ptr str_e
-+ # char * will be a bytes object:
-+ str_e = zmq_strerror(errno)
-+ if str is bytes:
-+ # Python 2: str is bytes, so we already have the right type
-+ return str_e
-+ else:
-+ # Python 3: decode bytes to unicode str
-+ return str_e.decode()
-+
-+def zmq_errno():
-+ """zmq_errno()
-+
-+ Return the integer errno of the most recent zmq error.
-+ """
-+ return zmq_errno_c()
-+
-+__all__ = ['strerror', 'zmq_errno']
-diff --git a/zmq/core/_zmessage.pxd b/zmq/core/_zmessage.pxd
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zmessage.pxd
-@@ -0,0 +1,66 @@
-+"""0MQ Message related class declarations."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from cpython cimport PyBytes_FromStringAndSize
-+
-+from libzmq cimport zmq_msg_t, zmq_msg_data, zmq_msg_size
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+cdef class MessageTracker(object):
-+ """A class for tracking if 0MQ is done using one or more messages."""
-+
-+ cdef set events # Message Event objects to track.
-+ cdef set peers # Other Message or MessageTracker objects.
-+
-+
-+cdef class Frame:
-+ """A Message Frame class for non-copy send/recvs."""
-+
-+ cdef zmq_msg_t zmq_msg
-+ cdef object _data # The actual message data as a Python object.
-+ cdef object _buffer # A Python Buffer/View of the message contents
-+ cdef object _bytes # A bytes/str copy of the message.
-+ cdef bint _failed_init # Flag to handle failed zmq_msg_init
-+ cdef public object tracker_event # Event for use with zmq_free_fn.
-+ cdef public object tracker # MessageTracker object.
-+ cdef public bint more # whether RCVMORE was set
-+
-+ cdef Frame fast_copy(self) # Create shallow copy of Message object.
-+ cdef object _getbuffer(self) # Construct self._buffer.
-+
-+
-+cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg):
-+ """ Copy the data from a zmq_msg_t """
-+ cdef char *data_c = NULL
-+ cdef Py_ssize_t data_len_c
-+ with nogil:
-+ data_c = <char *>zmq_msg_data(zmq_msg)
-+ data_len_c = zmq_msg_size(zmq_msg)
-+ return PyBytes_FromStringAndSize(data_c, data_len_c)
-+
-+
-diff --git a/zmq/core/_zmessage.pyx b/zmq/core/_zmessage.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zmessage.pyx
-@@ -0,0 +1,297 @@
-+"""0MQ Message related classes."""
-+
-+#
-+# Copyright (c) 2013 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+# get version-independent aliases:
-+cdef extern from "pyversion_compat.h":
-+ pass
-+
-+from cpython cimport Py_DECREF, Py_INCREF
-+
-+from buffers cimport asbuffer_r, viewfromobject_r
-+
-+cdef extern from "Python.h":
-+ ctypedef int Py_ssize_t
-+
-+from libzmq cimport *
-+
-+import time
-+
-+try:
-+ # below 3.3
-+ from threading import _Event as Event
-+except (ImportError, AttributeError):
-+ # python throws ImportError, cython throws AttributeError
-+ from threading import Event
-+
-+import zmq
-+from zmq.core.checkrc cimport _check_rc
-+from zmq.utils.strtypes import bytes,unicode,basestring
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+
-+cdef void free_python_msg(void *data, void *hint) with gil:
-+ """A function for DECREF'ing Python based messages."""
-+ if hint != NULL:
-+ tracker_event = (<tuple>hint)[1]
-+ Py_DECREF(<object>hint)
-+ if isinstance(tracker_event, Event):
-+ # don't assert before DECREF:
-+ # assert tracker_queue.empty(), "somebody else wrote to my Queue!"
-+ tracker_event.set()
-+ tracker_event = None
-+
-+
-+cdef class Frame:
-+ """Frame(data=None, track=False)
-+
-+ A zmq message Frame class for non-copy send/recvs.
-+
-+ This class is only needed if you want to do non-copying send and recvs.
-+ When you pass a string to this class, like ``Frame(s)``, the
-+ ref-count of `s` is increased by two: once because the Frame saves `s` as
-+ an instance attribute and another because a ZMQ message is created that
-+ points to the buffer of `s`. This second ref-count increase makes sure
-+ that `s` lives until all messages that use it have been sent. Once 0MQ
-+ sends all the messages and it doesn't need the buffer of s, 0MQ will call
-+ ``Py_DECREF(s)``.
-+
-+ Parameters
-+ ----------
-+
-+ data : object, optional
-+ any object that provides the buffer interface will be used to
-+ construct the 0MQ message data.
-+ track : bool [default: False]
-+ whether a MessageTracker_ should be created to track this object.
-+ Tracking a message has a cost at creation, because it creates a threadsafe
-+ Event object.
-+
-+ """
-+
-+ def __cinit__(self, object data=None, track=False, **kwargs):
-+ cdef int rc
-+ cdef char *data_c = NULL
-+ cdef Py_ssize_t data_len_c=0
-+ cdef object hint
-+
-+ # init more as False
-+ self.more = False
-+
-+ # Save the data object in case the user wants the the data as a str.
-+ self._data = data
-+ self._failed_init = True # bool switch for dealloc
-+ self._buffer = None # buffer view of data
-+ self._bytes = None # bytes copy of data
-+
-+ # Event and MessageTracker for monitoring when zmq is done with data:
-+ if track:
-+ evt = Event()
-+ self.tracker_event = evt
-+ self.tracker = zmq.MessageTracker(evt)
-+ else:
-+ self.tracker_event = None
-+ self.tracker = None
-+
-+ if isinstance(data, unicode):
-+ raise TypeError("Unicode objects not allowed. Only: str/bytes, buffer interfaces.")
-+
-+ if data is None:
-+ with nogil:
-+ rc = zmq_msg_init(&self.zmq_msg)
-+ _check_rc(rc)
-+ self._failed_init = False
-+ return
-+ else:
-+ asbuffer_r(data, <void **>&data_c, &data_len_c)
-+ # We INCREF the *original* Python object (not self) and pass it
-+ # as the hint below. This allows other copies of this Frame
-+ # object to take over the ref counting of data properly.
-+ hint = (data, self.tracker_event)
-+ Py_INCREF(hint)
-+ with nogil:
-+ rc = zmq_msg_init_data(
-+ &self.zmq_msg, <void *>data_c, data_len_c,
-+ <zmq_free_fn *>free_python_msg, <void *>hint
-+ )
-+ if rc != 0:
-+ Py_DECREF(hint)
-+ _check_rc(rc)
-+ self._failed_init = False
-+
-+ def __init__(self, object data=None, track=False):
-+ """Enforce signature"""
-+ pass
-+
-+ def __dealloc__(self):
-+ cdef int rc
-+ if self._failed_init:
-+ return
-+ # This simply decreases the 0MQ ref-count of zmq_msg.
-+ with nogil:
-+ rc = zmq_msg_close(&self.zmq_msg)
-+ _check_rc(rc)
-+
-+ # buffer interface code adapted from petsc4py by Lisandro Dalcin, a BSD project
-+
-+ def __getbuffer__(self, Py_buffer* buffer, int flags):
-+ # new-style (memoryview) buffer interface
-+ with nogil:
-+ buffer.buf = zmq_msg_data(&self.zmq_msg)
-+ buffer.len = zmq_msg_size(&self.zmq_msg)
-+
-+ buffer.obj = self
-+ buffer.readonly = 1
-+ buffer.format = "B"
-+ buffer.ndim = 0
-+ buffer.shape = NULL
-+ buffer.strides = NULL
-+ buffer.suboffsets = NULL
-+ buffer.itemsize = 1
-+ buffer.internal = NULL
-+
-+ def __getsegcount__(self, Py_ssize_t *lenp):
-+ # required for getreadbuffer
-+ if lenp != NULL:
-+ with nogil:
-+ lenp[0] = zmq_msg_size(&self.zmq_msg)
-+ return 1
-+
-+ def __getreadbuffer__(self, Py_ssize_t idx, void **p):
-+ # old-style (buffer) interface
-+ cdef char *data_c = NULL
-+ cdef Py_ssize_t data_len_c
-+ if idx != 0:
-+ raise SystemError("accessing non-existent buffer segment")
-+ # read-only, because we don't want to allow
-+ # editing of the message in-place
-+ with nogil:
-+ data_c = <char *>zmq_msg_data(&self.zmq_msg)
-+ data_len_c = zmq_msg_size(&self.zmq_msg)
-+ if p != NULL:
-+ p[0] = <void*>data_c
-+ return data_len_c
-+
-+ # end buffer interface
-+
-+ def __copy__(self):
-+ """Create a shallow copy of the message.
-+
-+ This does not copy the contents of the Frame, just the pointer.
-+ This will increment the 0MQ ref count of the message, but not
-+ the ref count of the Python object. That is only done once when
-+ the Python is first turned into a 0MQ message.
-+ """
-+ return self.fast_copy()
-+
-+ cdef Frame fast_copy(self):
-+ """Fast, cdef'd version of shallow copy of the Frame."""
-+ cdef Frame new_msg
-+ new_msg = Frame()
-+ # This does not copy the contents, but just increases the ref-count
-+ # of the zmq_msg by one.
-+ with nogil:
-+ zmq_msg_copy(&new_msg.zmq_msg, &self.zmq_msg)
-+ # Copy the ref to data so the copy won't create a copy when str is
-+ # called.
-+ if self._data is not None:
-+ new_msg._data = self._data
-+ if self._buffer is not None:
-+ new_msg._buffer = self._buffer
-+ if self._bytes is not None:
-+ new_msg._bytes = self._bytes
-+
-+ # Frame copies share the tracker and tracker_event
-+ new_msg.tracker_event = self.tracker_event
-+ new_msg.tracker = self.tracker
-+
-+ return new_msg
-+
-+ def __len__(self):
-+ """Return the length of the message in bytes."""
-+ cdef size_t sz
-+ with nogil:
-+ sz = zmq_msg_size(&self.zmq_msg)
-+ return sz
-+ # return <int>zmq_msg_size(&self.zmq_msg)
-+
-+ def __str__(self):
-+ """Return the str form of the message."""
-+ if isinstance(self._data, bytes):
-+ b = self._data
-+ else:
-+ b = self.bytes
-+ if str is unicode:
-+ return b.decode()
-+ else:
-+ return b
-+
-+ cdef inline object _getbuffer(self):
-+ """Create a Python buffer/view of the message data.
-+
-+ This will be called only once, the first time the `buffer` property
-+ is accessed. Subsequent calls use a cached copy.
-+ """
-+ if self._data is None:
-+ return viewfromobject_r(self)
-+ else:
-+ return viewfromobject_r(self._data)
-+
-+ @property
-+ def buffer(self):
-+ """Get a read-only buffer view of the message contents."""
-+ if self._buffer is None:
-+ self._buffer = self._getbuffer()
-+ return self._buffer
-+
-+ @property
-+ def bytes(self):
-+ """Get the message content as a Python str/bytes object.
-+
-+ The first time this property is accessed, a copy of the message
-+ contents is made. From then on that same copy of the message is
-+ returned.
-+ """
-+ if self._bytes is None:
-+ self._bytes = copy_zmq_msg_bytes(&self.zmq_msg)
-+ return self._bytes
-+
-+ def set(self, int option, int value):
-+ """Set a message property"""
-+ cdef int rc = zmq_msg_set(&self.zmq_msg, option, value)
-+ _check_rc(rc)
-+
-+ def get(self, int option):
-+ """Get a message property"""
-+ cdef int rc = zmq_msg_get(&self.zmq_msg, option)
-+ _check_rc(rc)
-+ return rc
-+
-+# legacy Message name
-+Message = Frame
-+
-+__all__ = ['Frame', 'Message']
-diff --git a/zmq/core/_zsocket.pxd b/zmq/core/_zsocket.pxd
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zsocket.pxd
-@@ -0,0 +1,48 @@
-+"""0MQ Socket class declaration."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from _zcontext cimport Context
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+
-+cdef class Socket:
-+ """A 0MQ socket."""
-+
-+ cdef object __weakref__ # enable weakref
-+ cdef void *handle # The C handle for the underlying zmq object.
-+ cdef public int socket_type # The 0MQ socket type - REQ,REP, etc.
-+ # Hold on to a reference to the context to make sure it is not garbage
-+ # collected until the socket it done with it.
-+ cdef public Context context # The zmq Context object that owns this.
-+ cdef public bint _closed # bool property for a closed socket.
-+ cdef int _pid # the pid of the process which created me (for fork safety)
-+
-+ # cpdef methods for direct-cython access:
-+ cpdef object send(self, object data, int flags=*, copy=*, track=*)
-+ cpdef object recv(self, int flags=*, copy=*, track=*)
-+
-diff --git a/zmq/core/_zsocket.pyx b/zmq/core/_zsocket.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zsocket.pyx
-@@ -0,0 +1,628 @@
-+"""0MQ Socket class."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Cython Imports
-+#-----------------------------------------------------------------------------
-+
-+# get version-independent aliases:
-+cdef extern from "pyversion_compat.h":
-+ pass
-+
-+from libc.errno cimport ENAMETOOLONG
-+from libc.string cimport memcpy
-+
-+from cpython cimport PyBytes_FromStringAndSize
-+from cpython cimport PyBytes_AsString, PyBytes_Size
-+from cpython cimport Py_DECREF, Py_INCREF
-+
-+from buffers cimport asbuffer_r, viewfromobject_r
-+
-+from libzmq cimport *
-+from _zmessage cimport Frame, copy_zmq_msg_bytes
-+
-+from _zcontext cimport Context
-+
-+cdef extern from "Python.h":
-+ ctypedef int Py_ssize_t
-+
-+cdef extern from "ipcmaxlen.h":
-+ int get_ipc_path_max_len()
-+
-+cdef extern from "getpid_compat.h":
-+ int getpid()
-+
-+
-+#-----------------------------------------------------------------------------
-+# Python Imports
-+#-----------------------------------------------------------------------------
-+
-+import copy as copy_mod
-+import time
-+import sys
-+import random
-+import struct
-+import codecs
-+
-+from zmq.utils import jsonapi
-+
-+try:
-+ import cPickle
-+ pickle = cPickle
-+except:
-+ cPickle = None
-+ import pickle
-+
-+import zmq
-+from zmq.core import _zconstants as constants
-+from zmq.core._zconstants import *
-+from zmq.core.checkrc cimport _check_rc
-+from zmq.error import ZMQError, ZMQBindError
-+from zmq.utils.strtypes import bytes,unicode,basestring
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+IPC_PATH_MAX_LEN = get_ipc_path_max_len()
-+
-+# inline some small socket submethods:
-+# true methods frequently cannot be inlined, acc. Cython docs
-+
-+cdef inline _check_closed(Socket s, bint raise_notsup):
-+ cdef int rc
-+ cdef int errno
-+ cdef int stype
-+ cdef size_t sz=sizeof(int)
-+ if s._closed:
-+ if raise_notsup:
-+ raise ZMQError(ENOTSUP)
-+ else:
-+ return True
-+ else:
-+ rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
-+ if rc < 0 and zmq_errno() == ENOTSOCK:
-+ s._closed = True
-+ if raise_notsup:
-+ raise ZMQError(ENOTSUP)
-+ else:
-+ return True
-+ else:
-+ _check_rc(rc)
-+ return False
-+
-+cdef inline Frame _recv_frame(void *handle, int flags=0, track=False):
-+ """Receive a message in a non-copying manner and return a Frame."""
-+ cdef int rc
-+ cdef Frame msg
-+ msg = Frame(track=track)
-+
-+ with nogil:
-+ rc = zmq_msg_recv(&msg.zmq_msg, handle, flags)
-+
-+ _check_rc(rc)
-+ return msg
-+
-+cdef inline object _recv_copy(void *handle, int flags=0):
-+ """Receive a message and return a copy"""
-+ cdef zmq_msg_t zmq_msg
-+ with nogil:
-+ zmq_msg_init (&zmq_msg)
-+ rc = zmq_msg_recv(&zmq_msg, handle, flags)
-+ _check_rc(rc)
-+ msg_bytes = copy_zmq_msg_bytes(&zmq_msg)
-+ with nogil:
-+ zmq_msg_close(&zmq_msg)
-+ return msg_bytes
-+
-+cdef inline object _send_frame(void *handle, Frame msg, int flags=0):
-+ """Send a Frame on this socket in a non-copy manner."""
-+ cdef int rc
-+ cdef Frame msg_copy
-+
-+ # Always copy so the original message isn't garbage collected.
-+ # This doesn't do a real copy, just a reference.
-+ msg_copy = msg.fast_copy()
-+
-+ with nogil:
-+ rc = zmq_msg_send(&msg_copy.zmq_msg, handle, flags)
-+
-+ _check_rc(rc)
-+ return msg.tracker
-+
-+
-+cdef inline object _send_copy(void *handle, object msg, int flags=0):
-+ """Send a message on this socket by copying its content."""
-+ cdef int rc, rc2
-+ cdef zmq_msg_t data
-+ cdef char *msg_c
-+ cdef Py_ssize_t msg_c_len=0
-+
-+ # copy to c array:
-+ asbuffer_r(msg, <void **>&msg_c, &msg_c_len)
-+
-+ # Copy the msg before sending. This avoids any complications with
-+ # the GIL, etc.
-+ # If zmq_msg_init_* fails we must not call zmq_msg_close (Bus Error)
-+ with nogil:
-+ rc = zmq_msg_init_size(&data, msg_c_len)
-+
-+ _check_rc(rc)
-+
-+ with nogil:
-+ memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
-+ rc = zmq_msg_send(&data, handle, flags)
-+ rc2 = zmq_msg_close(&data)
-+ _check_rc(rc)
-+ _check_rc(rc2)
-+
-+
-+cdef class Socket:
-+ """Socket(context, socket_type)
-+
-+ A 0MQ socket.
-+
-+ These objects will generally be constructed via the socket() method of a Context object.
-+
-+ Note: 0MQ Sockets are *not* threadsafe. **DO NOT** share them across threads.
-+
-+ Parameters
-+ ----------
-+ context : Context
-+ The 0MQ Context this Socket belongs to.
-+ socket_type : int
-+ The socket type, which can be any of the 0MQ socket types:
-+ REQ, REP, PUB, SUB, PAIR, DEALER, ROUTER, PULL, PUSH, XPUB, XSUB.
-+
-+ See Also
-+ --------
-+ .Context.socket : method for creating a socket bound to a Context.
-+ """
-+
-+ def __cinit__(self, Context context, int socket_type, *args, **kwrags):
-+ cdef Py_ssize_t c_handle
-+ c_handle = context._handle
-+
-+ self.handle = NULL
-+ self.context = context
-+ self.socket_type = socket_type
-+ with nogil:
-+ self.handle = zmq_socket(<void *>c_handle, socket_type)
-+ if self.handle == NULL:
-+ raise ZMQError()
-+ self._closed = False
-+ self._pid = getpid()
-+ context._add_socket(self.handle)
-+
-+ def __dealloc__(self):
-+ """close *and* remove from context's list
-+
-+ But be careful that context might not exist if called during gc
-+ """
-+ if self.handle != NULL and getpid() == self._pid:
-+ rc = zmq_close(self.handle)
-+ if rc != 0 and zmq_errno() != ENOTSOCK:
-+ # ignore ENOTSOCK (closed by Context)
-+ _check_rc(rc)
-+ # during gc, self.context might be NULL
-+ if self.context:
-+ self.context._remove_socket(self.handle)
-+
-+ def __init__(self, context, socket_type):
-+ pass
-+
-+ @property
-+ def closed(self):
-+ return _check_closed(self, False)
-+
-+ def close(self, linger=None):
-+ """s.close(linger=None)
-+
-+ Close the socket.
-+
-+ If linger is specified, LINGER sockopt will be set prior to closing.
-+
-+ This can be called to close the socket by hand. If this is not
-+ called, the socket will automatically be closed when it is
-+ garbage collected.
-+ """
-+ cdef int rc=0
-+ cdef int linger_c
-+ cdef bint setlinger=False
-+
-+ if linger is not None:
-+ linger_c = linger
-+ setlinger=True
-+
-+ if self.handle != NULL and not self._closed and getpid() == self._pid:
-+ if setlinger:
-+ zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int))
-+ rc = zmq_close(self.handle)
-+ if rc != 0 and zmq_errno() != ENOTSOCK:
-+ # ignore ENOTSOCK (closed by Context)
-+ _check_rc(rc)
-+ self._closed = True
-+ # during gc, self.context might be NULL
-+ if self.context:
-+ self.context._remove_socket(self.handle)
-+ self.handle = NULL
-+
-+ def set(self, int option, optval):
-+ """s.set(option, optval)
-+
-+ Set socket options.
-+
-+ See the 0MQ API documentation for details on specific options.
-+
-+ Parameters
-+ ----------
-+ option : int
-+ The option to set. Available values will depend on your
-+ version of libzmq. Examples include::
-+
-+ zmq.SUBSCRIBE, UNSUBSCRIBE, IDENTITY, HWM, LINGER, FD
-+
-+ optval : int or bytes
-+ The value of the option to set.
-+ """
-+ cdef int64_t optval_int64_c
-+ cdef int optval_int_c
-+ cdef int rc
-+ cdef char* optval_c
-+ cdef Py_ssize_t sz
-+
-+ _check_closed(self, True)
-+ if isinstance(optval, unicode):
-+ raise TypeError("unicode not allowed, use setsockopt_string")
-+
-+ if option in zmq.constants.bytes_sockopts:
-+ if not isinstance(optval, bytes):
-+ raise TypeError('expected bytes, got: %r' % optval)
-+ optval_c = PyBytes_AsString(optval)
-+ sz = PyBytes_Size(optval)
-+ with nogil:
-+ rc = zmq_setsockopt(
-+ self.handle, option,
-+ optval_c, sz
-+ )
-+ elif option in zmq.constants.int64_sockopts:
-+ if not isinstance(optval, int):
-+ raise TypeError('expected int, got: %r' % optval)
-+ optval_int64_c = optval
-+ with nogil:
-+ rc = zmq_setsockopt(
-+ self.handle, option,
-+ &optval_int64_c, sizeof(int64_t)
-+ )
-+ else:
-+ # default is to assume int, which is what most new sockopts will be
-+ # this lets pyzmq work with newer libzmq which may add constants
-+ # pyzmq has not yet added, rather than artificially raising. Invalid
-+ # sockopts will still raise just the same, but it will be libzmq doing
-+ # the raising.
-+ if not isinstance(optval, int):
-+ raise TypeError('expected int, got: %r' % optval)
-+ optval_int_c = optval
-+ with nogil:
-+ rc = zmq_setsockopt(
-+ self.handle, option,
-+ &optval_int_c, sizeof(int)
-+ )
-+
-+ _check_rc(rc)
-+
-+ def get(self, int option):
-+ """s.get(option)
-+
-+ Get the value of a socket option.
-+
-+ See the 0MQ API documentation for details on specific options.
-+
-+ Parameters
-+ ----------
-+ option : int
-+ The option to get. Available values will depend on your
-+ version of libzmq. Examples include::
-+
-+ zmq.IDENTITY, HWM, LINGER, FD, EVENTS
-+
-+ Returns
-+ -------
-+ optval : int or bytes
-+ The value of the option as a bytestring or int.
-+ """
-+ cdef int64_t optval_int64_c
-+ cdef int optval_int_c
-+ cdef fd_t optval_fd_c
-+ cdef char identity_str_c [255]
-+ cdef size_t sz
-+ cdef int rc
-+
-+ _check_closed(self, True)
-+
-+ if option in zmq.constants.bytes_sockopts:
-+ sz = 255
-+ with nogil:
-+ rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
-+ _check_rc(rc)
-+ result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz)
-+ elif option in zmq.constants.int64_sockopts:
-+ sz = sizeof(int64_t)
-+ with nogil:
-+ rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz)
-+ _check_rc(rc)
-+ result = optval_int64_c
-+ elif option == ZMQ_FD:
-+ sz = sizeof(fd_t)
-+ with nogil:
-+ rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz)
-+ _check_rc(rc)
-+ result = optval_fd_c
-+ else:
-+ # default is to assume int, which is what most new sockopts will be
-+ # this lets pyzmq work with newer libzmq which may add constants
-+ # pyzmq has not yet added, rather than artificially raising. Invalid
-+ # sockopts will still raise just the same, but it will be libzmq doing
-+ # the raising.
-+ sz = sizeof(int)
-+ with nogil:
-+ rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
-+ _check_rc(rc)
-+ result = optval_int_c
-+
-+ return result
-+
-+ def bind(self, addr):
-+ """s.bind(addr)
-+
-+ Bind the socket to an address.
-+
-+ This causes the socket to listen on a network port. Sockets on the
-+ other side of this connection will use ``Socket.connect(addr)`` to
-+ connect to this socket.
-+
-+ Parameters
-+ ----------
-+ addr : str
-+ The address string. This has the form 'protocol://interface:port',
-+ for example 'tcp://127.0.0.1:5555'. Protocols supported include
-+ tcp, udp, pgm, epgm, inproc and ipc. If the address is unicode, it is
-+ encoded to utf-8 first.
-+ """
-+ cdef int rc
-+ cdef char* c_addr
-+
-+ _check_closed(self, True)
-+ if isinstance(addr, unicode):
-+ addr = addr.encode('utf-8')
-+ if not isinstance(addr, bytes):
-+ raise TypeError('expected str, got: %r' % addr)
-+ c_addr = addr
-+ rc = zmq_bind(self.handle, c_addr)
-+ if rc != 0:
-+ if IPC_PATH_MAX_LEN and zmq_errno() == ENAMETOOLONG:
-+ # py3compat: addr is bytes, but msg wants str
-+ if str is unicode:
-+ addr = addr.decode('utf-8', 'replace')
-+ path = addr.split('://', 1)[-1]
-+ msg = ('ipc path "{0}" is longer than {1} '
-+ 'characters (sizeof(sockaddr_un.sun_path)). '
-+ 'zmq.IPC_PATH_MAX_LEN constant can be used '
-+ 'to check addr length (if it is defined).'
-+ .format(path, IPC_PATH_MAX_LEN))
-+ raise ZMQError(msg=msg)
-+ _check_rc(rc)
-+
-+ def connect(self, addr):
-+ """s.connect(addr)
-+
-+ Connect to a remote 0MQ socket.
-+
-+ Parameters
-+ ----------
-+ addr : str
-+ The address string. This has the form 'protocol://interface:port',
-+ for example 'tcp://127.0.0.1:5555'. Protocols supported are
-+ tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
-+ encoded to utf-8 first.
-+ """
-+ cdef int rc
-+ cdef char* c_addr
-+
-+ _check_closed(self, True)
-+ if isinstance(addr, unicode):
-+ addr = addr.encode('utf-8')
-+ if not isinstance(addr, bytes):
-+ raise TypeError('expected str, got: %r' % addr)
-+ c_addr = addr
-+
-+ rc = zmq_connect(self.handle, c_addr)
-+ if rc != 0:
-+ raise ZMQError()
-+
-+ def unbind(self, addr):
-+ """s.unbind(addr)
-+
-+ Unbind from an address (undoes a call to bind).
-+
-+ This feature requires libzmq-3
-+
-+ Parameters
-+ ----------
-+ addr : str
-+ The address string. This has the form 'protocol://interface:port',
-+ for example 'tcp://127.0.0.1:5555'. Protocols supported are
-+ tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
-+ encoded to utf-8 first.
-+ """
-+ cdef int rc
-+ cdef char* c_addr
-+
-+ if ZMQ_VERSION_MAJOR < 3:
-+ raise NotImplementedError("unbind requires libzmq >= 3.0, have %s" % zmq.zmq_version())
-+
-+
-+ _check_closed(self, True)
-+ if isinstance(addr, unicode):
-+ addr = addr.encode('utf-8')
-+ if not isinstance(addr, bytes):
-+ raise TypeError('expected str, got: %r' % addr)
-+ c_addr = addr
-+
-+ rc = zmq_unbind(self.handle, c_addr)
-+ if rc != 0:
-+ raise ZMQError()
-+
-+ def disconnect(self, addr):
-+ """s.disconnect(addr)
-+
-+ Disconnect from a remote 0MQ socket (undoes a call to connect).
-+
-+ This feature requires libzmq-3
-+
-+ Parameters
-+ ----------
-+ addr : str
-+ The address string. This has the form 'protocol://interface:port',
-+ for example 'tcp://127.0.0.1:5555'. Protocols supported are
-+ tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
-+ encoded to utf-8 first.
-+ """
-+ cdef int rc
-+ cdef char* c_addr
-+
-+ if ZMQ_VERSION_MAJOR < 3:
-+ raise NotImplementedError("disconnect requires libzmq >= 3.0, have %s" % zmq.zmq_version())
-+
-+ _check_closed(self, True)
-+ if isinstance(addr, unicode):
-+ addr = addr.encode('utf-8')
-+ if not isinstance(addr, bytes):
-+ raise TypeError('expected str, got: %r' % addr)
-+ c_addr = addr
-+
-+ rc = zmq_disconnect(self.handle, c_addr)
-+ if rc != 0:
-+ raise ZMQError()
-+
-+ #-------------------------------------------------------------------------
-+ # Sending and receiving messages
-+ #-------------------------------------------------------------------------
-+
-+ cpdef object send(self, object data, int flags=0, copy=True, track=False):
-+ """s.send(data, flags=0, copy=True, track=False)
-+
-+ Send a message on this socket.
-+
-+ This queues the message to be sent by the IO thread at a later time.
-+
-+ Parameters
-+ ----------
-+ data : object, str, Frame
-+ The content of the message.
-+ flags : int
-+ Any supported flag: NOBLOCK, SNDMORE.
-+ copy : bool
-+ Should the message be sent in a copying or non-copying manner.
-+ track : bool
-+ Should the message be tracked for notification that ZMQ has
-+ finished with it? (ignored if copy=True)
-+
-+ Returns
-+ -------
-+ None : if `copy` or not track
-+ None if message was sent, raises an exception otherwise.
-+ MessageTracker : if track and not copy
-+ a MessageTracker object, whose `pending` property will
-+ be True until the send is completed.
-+
-+ Raises
-+ ------
-+ TypeError
-+ If a unicode object is passed
-+ ValueError
-+ If `track=True`, but an untracked Frame is passed.
-+ ZMQError
-+ If the send does not succeed for any reason.
-+
-+ """
-+ _check_closed(self, True)
-+
-+ if isinstance(data, unicode):
-+ raise TypeError("unicode not allowed, use send_unicode")
-+
-+ if copy:
-+ # msg.bytes never returns the input data object
-+ # it is always a copy, but always the same copy
-+ if isinstance(data, Frame):
-+ data = data.buffer
-+ return _send_copy(self.handle, data, flags)
-+ else:
-+ if isinstance(data, Frame):
-+ if track and not data.tracker:
-+ raise ValueError('Not a tracked message')
-+ msg = data
-+ else:
-+ msg = Frame(data, track=track)
-+ return _send_frame(self.handle, msg, flags)
-+
-+ cpdef object recv(self, int flags=0, copy=True, track=False):
-+ """s.recv(flags=0, copy=True, track=False)
-+
-+ Receive a message.
-+
-+ Parameters
-+ ----------
-+ flags : int
-+ Any supported flag: NOBLOCK. If NOBLOCK is set, this method
-+ will raise a ZMQError with EAGAIN if a message is not ready.
-+ If NOBLOCK is not set, then this method will block until a
-+ message arrives.
-+ copy : bool
-+ Should the message be received in a copying or non-copying manner?
-+ If False a Frame object is returned, if True a string copy of
-+ message is returned.
-+ track : bool
-+ Should the message be tracked for notification that ZMQ has
-+ finished with it? (ignored if copy=True)
-+
-+ Returns
-+ -------
-+ msg : bytes, Frame
-+ The received message frame. If `copy` is False, then it will be a Frame,
-+ otherwise it will be bytes.
-+
-+ Raises
-+ ------
-+ ZMQError
-+ for any of the reasons zmq_msg_recv might fail.
-+ """
-+ _check_closed(self, True)
-+
-+ if copy:
-+ return _recv_copy(self.handle, flags)
-+ else:
-+ frame = _recv_frame(self.handle, flags, track)
-+ frame.more = self.getsockopt(zmq.RCVMORE)
-+ return frame
-+
-+
-+__all__ = ['Socket', 'IPC_PATH_MAX_LEN']
-diff --git a/zmq/core/_zstopwatch.pxd b/zmq/core/_zstopwatch.pxd
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zstopwatch.pxd
-@@ -0,0 +1,31 @@
-+"""0MQ Stopwatch class declaration."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+
-+cdef class Stopwatch:
-+ """A simple stopwatch based on zmq_stopwatch_start/stop."""
-+
-+ cdef void *watch # The C handle for the underlying zmq object
-+
-diff --git a/zmq/core/_zstopwatch.pyx b/zmq/core/_zstopwatch.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/core/_zstopwatch.pyx
-@@ -0,0 +1,90 @@
-+"""0MQ Stopwatch class."""
-+
-+#
-+# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
-+#
-+# This file is part of pyzmq.
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from libzmq cimport zmq_stopwatch_start, zmq_stopwatch_stop, zmq_sleep
-+
-+from zmq.error import ZMQError
-+
-+#-----------------------------------------------------------------------------
-+# Code
-+#-----------------------------------------------------------------------------
-+
-+cdef class Stopwatch:
-+ """Stopwatch()
-+
-+ A simple stopwatch based on zmq_stopwatch_start/stop.
-+
-+ This class should be used for benchmarking and timing 0MQ code.
-+ """
-+
-+ def __cinit__(self):
-+ self.watch = NULL
-+
-+ def __dealloc__(self):
-+ try:
-+ self.stop()
-+ except ZMQError:
-+ pass
-+
-+ def start(self):
-+ """s.start()
-+
-+ Start the stopwatch.
-+ """
-+ if self.watch == NULL:
-+ with nogil:
-+ self.watch = zmq_stopwatch_start()
-+ else:
-+ raise ZMQError('Stopwatch is already runing.')
-+
-+ def stop(self):
-+ """s.stop()
-+
-+ Stop the stopwatch.
-+
-+ Returns
-+ -------
-+ t : unsigned long int
-+ the number of microseconds since ``start()`` was called.
-+ """
-+ cdef unsigned long time
-+ if self.watch == NULL:
-+ raise ZMQError('Must start the Stopwatch before calling stop.')
-+ else:
-+ with nogil:
-+ time = zmq_stopwatch_stop(self.watch)
-+ self.watch = NULL
-+ return time
-+
-+ def sleep(self, int seconds):
-+ """s.sleep(seconds)
-+
-+ Sleep for an integer number of seconds.
-+ """
-+ with nogil:
-+ zmq_sleep(seconds)
-+
-+
-+__all__ = ['Stopwatch']
-diff --git a/zmq/core/constants.pyx b/zmq/core/constants.pyx
-deleted file mode 100644
---- a/zmq/core/constants.pyx
-+++ /dev/null
-@@ -1,190 +0,0 @@
--"""0MQ Constants."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from libzmq cimport *
--
--#-----------------------------------------------------------------------------
--# Python module level constants
--#-----------------------------------------------------------------------------
--
--_optionals = []
--
--if ZMQ_VERSION < 30000:
-- # backport DONTWAIT as alias to NOBLOCK
-- NOBLOCK = ZMQ_NOBLOCK
-- DONTWAIT = ZMQ_NOBLOCK
--else:
-- # keep NOBLOCK as alias for new DONTWAIT
-- NOBLOCK = ZMQ_DONTWAIT
-- DONTWAIT = ZMQ_DONTWAIT
--
--VERSION = ZMQ_VERSION
--
--# socket types
--PAIR = ZMQ_PAIR
--PUB = ZMQ_PUB
--SUB = ZMQ_SUB
--REQ = ZMQ_REQ
--REP = ZMQ_REP
--DEALER = ZMQ_DEALER
--ROUTER = ZMQ_ROUTER
--PULL = ZMQ_PULL
--PUSH = ZMQ_PUSH
--XPUB = ZMQ_XPUB
--XSUB = ZMQ_XSUB
--
--# keep deprecated aliases
--XREQ = DEALER
--XREP = ROUTER
--UPSTREAM = PULL
--DOWNSTREAM = PUSH
--
--
--# socket options
--AFFINITY = ZMQ_AFFINITY
--IDENTITY = ZMQ_IDENTITY
--SUBSCRIBE = ZMQ_SUBSCRIBE
--UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
--RATE = ZMQ_RATE
--RECOVERY_IVL = ZMQ_RECOVERY_IVL
--RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX
--SNDBUF = ZMQ_SNDBUF
--RCVBUF = ZMQ_RCVBUF
--RCVMORE = ZMQ_RCVMORE
--SNDMORE = ZMQ_SNDMORE
--POLLIN = ZMQ_POLLIN
--POLLOUT = ZMQ_POLLOUT
--POLLERR = ZMQ_POLLERR
--
--STREAMER = ZMQ_STREAMER
--FORWARDER = ZMQ_FORWARDER
--QUEUE = ZMQ_QUEUE
--
--# sockopts new in 2.2.0
--SNDTIMEO = ZMQ_SNDTIMEO
--RCVTIMEO = ZMQ_RCVTIMEO
--
--# sockopts removed in 3.0.0
--HWM = ZMQ_HWM
--SWAP = ZMQ_SWAP
--MCAST_LOOP = ZMQ_MCAST_LOOP
--RECOVERY_IVL_MSEC = ZMQ_RECOVERY_IVL_MSEC
--
--# new in 3.x
--IO_THREADS = ZMQ_IO_THREADS
--MAX_SOCKETS = ZMQ_MAX_SOCKETS
--
--MORE = ZMQ_MORE
--
--MAXMSGSIZE = ZMQ_MAXMSGSIZE
--SNDHWM = ZMQ_SNDHWM
--RCVHWM = ZMQ_RCVHWM
--MULTICAST_HOPS = ZMQ_MULTICAST_HOPS
--IPV4ONLY = ZMQ_IPV4ONLY
--LAST_ENDPOINT = ZMQ_LAST_ENDPOINT
--
--ROUTER_MANDATORY = ZMQ_ROUTER_MANDATORY
--# aliases
--ROUTER_BEHAVIOR = ROUTER_MANDATORY
--FAIL_UNROUTABLE = ROUTER_MANDATORY
--
--TCP_KEEPALIVE = ZMQ_TCP_KEEPALIVE
--TCP_KEEPALIVE_CNT = ZMQ_TCP_KEEPALIVE_CNT
--TCP_KEEPALIVE_IDLE = ZMQ_TCP_KEEPALIVE_IDLE
--TCP_KEEPALIVE_INTVL = ZMQ_TCP_KEEPALIVE_INTVL
--TCP_ACCEPT_FILTER = ZMQ_TCP_ACCEPT_FILTER
--DELAY_ATTACH_ON_CONNECT = ZMQ_DELAY_ATTACH_ON_CONNECT
--XPUB_VERBOSE = ZMQ_XPUB_VERBOSE
--ROUTER_RAW = ZMQ_ROUTER_RAW
--
--EVENT_CONNECTED = ZMQ_EVENT_CONNECTED
--EVENT_CONNECT_DELAYED = ZMQ_EVENT_CONNECT_DELAYED
--EVENT_CONNECT_RETRIED = ZMQ_EVENT_CONNECT_RETRIED
--EVENT_LISTENING = ZMQ_EVENT_LISTENING
--EVENT_BIND_FAILED = ZMQ_EVENT_BIND_FAILED
--EVENT_ACCEPTED = ZMQ_EVENT_ACCEPTED
--EVENT_ACCEPT_FAILED = ZMQ_EVENT_ACCEPT_FAILED
--EVENT_CLOSED = ZMQ_EVENT_CLOSED
--EVENT_CLOSE_FAILED = ZMQ_EVENT_CLOSE_FAILED
--EVENT_DISCONNECTED = ZMQ_EVENT_DISCONNECTED
--
--FD = ZMQ_FD
--EVENTS = ZMQ_EVENTS
--TYPE = ZMQ_TYPE
--LINGER = ZMQ_LINGER
--RECONNECT_IVL = ZMQ_RECONNECT_IVL
--BACKLOG = ZMQ_BACKLOG
--
--# As new constants are added in future versions, add a new block here
--# like the two above, checking agains the relevant value for ZMQ_VERSION.
--# The constants will need to be added to libzmq.pxd and utils/zmq_compat.h
--# as well.
--
--#-----------------------------------------------------------------------------
--# Error handling
--#-----------------------------------------------------------------------------
--
--# Often used standard errnos
--from errno import (
-- EAGAIN,
-- EINVAL,
-- EFAULT,
-- ENOMEM,
-- ENODEV
--)
--
--# For Windows compatability
--ENOTSUP = ZMQ_ENOTSUP
--EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
--ENOBUFS = ZMQ_ENOBUFS
--ENETDOWN = ZMQ_ENETDOWN
--EADDRINUSE = ZMQ_EADDRINUSE
--EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
--ECONNREFUSED = ZMQ_ECONNREFUSED
--EINPROGRESS = ZMQ_EINPROGRESS
--ENOTSOCK = ZMQ_ENOTSOCK
--
--# new errnos in zmq3
--EMSGSIZE = ZMQ_EMSGSIZE
--EAFNOSUPPORT = ZMQ_EAFNOSUPPORT
--ENETUNREACH = ZMQ_ENETUNREACH
--ECONNABORTED = ZMQ_ECONNABORTED
--ECONNRESET = ZMQ_ECONNRESET
--ENOTCONN = ZMQ_ENOTCONN
--ETIMEDOUT = ZMQ_ETIMEDOUT
--EHOSTUNREACH = ZMQ_EHOSTUNREACH
--ENETRESET = ZMQ_ENETRESET
--
--# 0MQ Native
--EFSM = ZMQ_EFSM
--ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
--ETERM = ZMQ_ETERM
--EMTHREAD = ZMQ_EMTHREAD
--
--#-----------------------------------------------------------------------------
--# Symbols to export
--#-----------------------------------------------------------------------------
--_names = list(locals().keys())
--__all__ = [ key for key in _names if not key.startswith('_') ]
-diff --git a/zmq/core/context.pxd b/zmq/core/context.pxd
-deleted file mode 100644
---- a/zmq/core/context.pxd
-+++ /dev/null
-@@ -1,40 +0,0 @@
--"""0MQ Context class declaration."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--cdef class Context:
-- """Manage the lifecycle of a 0MQ context."""
--
-- cdef object __weakref__ # enable weakref
-- cdef void *handle # The C handle for the underlying zmq object.
-- cdef void **_sockets # A C-array containg socket handles
-- cdef size_t _n_sockets # the number of sockets
-- cdef size_t _max_sockets # the size of the _sockets array
-- cdef int _pid # the pid of the process which created me (for fork safety)
--
-- cdef public object closed # bool property for a closed context.
-- # helpers for events on _sockets in Socket.__cinit__()/close()
-- cdef inline void _add_socket(self, void* handle)
-- cdef inline void _remove_socket(self, void* handle)
--
-diff --git a/zmq/core/context.pyx b/zmq/core/context.pyx
-deleted file mode 100644
---- a/zmq/core/context.pyx
-+++ /dev/null
-@@ -1,254 +0,0 @@
--"""0MQ Context class."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from libc.stdlib cimport free, malloc, realloc
--
--from libzmq cimport *
--
--cdef extern from "getpid_compat.h":
-- int getpid()
--
--from zmq.error import ZMQError
--from zmq.core.checkrc cimport _check_rc
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--_instance = None
--
--cdef class Context:
-- """Context(io_threads=1)
--
-- Manage the lifecycle of a 0MQ context.
--
-- Parameters
-- ----------
-- io_threads : int
-- The number of IO threads.
-- """
--
-- def __cinit__(self, int io_threads = 1, **kwargs):
-- self.handle = NULL
-- self._sockets = NULL
--
-- if ZMQ_VERSION_MAJOR >= 3:
-- self.handle = zmq_ctx_new()
-- else:
-- self.handle = zmq_init(io_threads)
--
-- if self.handle == NULL:
-- raise ZMQError()
--
-- cdef int rc = 0
-- if ZMQ_VERSION_MAJOR >= 3:
-- rc = zmq_ctx_set(self.handle, ZMQ_IO_THREADS, io_threads)
-- _check_rc(rc)
--
-- self.closed = False
-- self._n_sockets = 0
-- self._max_sockets = 32
--
-- self._sockets = <void **>malloc(self._max_sockets*sizeof(void *))
-- if self._sockets == NULL:
-- raise MemoryError("Could not allocate _sockets array")
--
-- self._pid = getpid()
--
-- def __init__(self, io_threads=1):
-- # no-op
-- pass
--
--
-- def __del__(self):
-- """deleting a Context should terminate it, without trying non-threadsafe destroy"""
-- self.term()
--
-- def __dealloc__(self):
-- """don't touch members in dealloc, just cleanup allocations"""
-- cdef int rc
-- if self._sockets != NULL:
-- free(self._sockets)
-- self._sockets = NULL
-- self._n_sockets = 0
-- self.term()
--
-- cdef inline void _add_socket(self, void* handle):
-- """Add a socket handle to be closed when Context terminates.
--
-- This is to be called in the Socket constructor.
-- """
-- # print self._n_sockets, self._max_sockets
-- if self._n_sockets >= self._max_sockets:
-- self._max_sockets *= 2
-- self._sockets = <void **>realloc(self._sockets, self._max_sockets*sizeof(void *))
-- if self._sockets == NULL:
-- raise MemoryError("Could not reallocate _sockets array")
--
-- self._sockets[self._n_sockets] = handle
-- self._n_sockets += 1
-- # print self._n_sockets, self._max_sockets
--
-- cdef inline void _remove_socket(self, void* handle):
-- """Remove a socket from the collected handles.
--
-- This should be called by Socket.close, to prevent trying to
-- close a socket a second time.
-- """
-- cdef bint found = False
--
-- for idx in range(self._n_sockets):
-- if self._sockets[idx] == handle:
-- found=True
-- break
--
-- if found:
-- self._n_sockets -= 1
-- if self._n_sockets:
-- # move last handle to closed socket's index
-- self._sockets[idx] = self._sockets[self._n_sockets]
--
-- @property
-- def _handle(self):
-- return <Py_ssize_t> self.handle
--
-- def term(self):
-- """ctx.term()
--
-- Close or terminate the context.
--
-- This can be called to close the context by hand. If this is not called,
-- the context will automatically be closed when it is garbage collected.
-- """
-- cdef int rc
-- cdef int i=-1
--
-- if self.handle != NULL and not self.closed and getpid() == self._pid:
-- with nogil:
-- rc = zmq_ctx_destroy(self.handle)
-- _check_rc(rc)
-- self.handle = NULL
-- self.closed = True
--
-- def set(self, int option, optval):
-- """ctx.set(option, optval)
--
-- Set context options.
--
-- See the 0MQ API documentation for zmq_ctx_set
-- for details on specific options.
--
-- New in libzmq-3.2
--
-- Parameters
-- ----------
-- option : int
-- The option to set. Available values will depend on your
-- version of libzmq. Examples include::
--
-- zmq.IO_THREADS, zmq.MAX_SOCKETS
--
-- optval : int
-- The value of the option to set.
-- """
-- cdef int optval_int_c
-- cdef int rc
-- cdef char* optval_c
--
-- if self.closed:
-- raise RuntimeError("Context has been destroyed")
--
-- if not isinstance(optval, int):
-- raise TypeError('expected int, got: %r' % optval)
-- optval_int_c = optval
-- rc = zmq_ctx_set(self.handle, option, optval_int_c)
-- _check_rc(rc)
--
-- def get(self, int option):
-- """ctx.get(option)
--
-- Get the value of a context option.
--
-- See the 0MQ API documentation for zmq_ctx_get
-- for details on specific options.
--
-- New in libzmq-3.2
--
-- Parameters
-- ----------
-- option : int
-- The option to get. Available values will depend on your
-- version of libzmq. Examples include::
--
-- zmq.IO_THREADS, zmq.MAX_SOCKETS
--
-- Returns
-- -------
-- optval : int
-- The value of the option as an integer.
-- """
-- cdef int optval_int_c
-- cdef size_t sz
-- cdef int rc
--
-- if self.closed:
-- raise RuntimeError("Context has been destroyed")
--
-- rc = zmq_ctx_get(self.handle, option)
-- _check_rc(rc)
--
-- return rc
--
-- def destroy(self, linger=None):
-- """ctx.destroy(linger=None)
--
-- Close all sockets associated with this context, and then terminate
-- the context. If linger is specified,
-- the LINGER sockopt of the sockets will be set prior to closing.
--
-- WARNING:
--
-- destroy involves calling zmq_close(), which is *NOT* threadsafe.
-- If there are active sockets in other threads, this must not be called.
-- """
--
-- cdef int linger_c
-- cdef bint setlinger=False
--
-- if linger is not None:
-- linger_c = linger
-- setlinger=True
-- if self.handle != NULL and not self.closed and self._n_sockets:
-- while self._n_sockets:
-- if setlinger:
-- zmq_setsockopt(self._sockets[0], ZMQ_LINGER, &linger_c, sizeof(int))
-- rc = zmq_close(self._sockets[0])
-- if rc < 0 and zmq_errno() != ZMQ_ENOTSOCK:
-- raise ZMQError()
-- self._n_sockets -= 1
-- self._sockets[0] = self._sockets[self._n_sockets]
-- self.term()
--
--__all__ = ['Context']
-diff --git a/zmq/core/error.pyx b/zmq/core/error.pyx
-deleted file mode 100644
---- a/zmq/core/error.pyx
-+++ /dev/null
-@@ -1,56 +0,0 @@
--"""0MQ Error classes and functions."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--# allow const char*
--cdef extern from *:
-- ctypedef char* const_char_ptr "const char*"
--
--from libzmq cimport zmq_strerror, zmq_errno as zmq_errno_c
--
--from zmq.utils.strtypes import bytes
--
--def strerror(int errno):
-- """strerror(errno)
--
-- Return the error string given the error number.
-- """
-- cdef const_char_ptr str_e
-- # char * will be a bytes object:
-- str_e = zmq_strerror(errno)
-- if str is bytes:
-- # Python 2: str is bytes, so we already have the right type
-- return str_e
-- else:
-- # Python 3: decode bytes to unicode str
-- return str_e.decode()
--
--def zmq_errno():
-- """zmq_errno()
--
-- Return the integer errno of the most recent zmq error.
-- """
-- return zmq_errno_c()
--
--__all__ = ['strerror', 'zmq_errno']
-diff --git a/zmq/core/message.pxd b/zmq/core/message.pxd
-deleted file mode 100644
---- a/zmq/core/message.pxd
-+++ /dev/null
-@@ -1,66 +0,0 @@
--"""0MQ Message related class declarations."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from cpython cimport PyBytes_FromStringAndSize
--
--from libzmq cimport zmq_msg_t, zmq_msg_data, zmq_msg_size
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--cdef class MessageTracker(object):
-- """A class for tracking if 0MQ is done using one or more messages."""
--
-- cdef set events # Message Event objects to track.
-- cdef set peers # Other Message or MessageTracker objects.
--
--
--cdef class Frame:
-- """A Message Frame class for non-copy send/recvs."""
--
-- cdef zmq_msg_t zmq_msg
-- cdef object _data # The actual message data as a Python object.
-- cdef object _buffer # A Python Buffer/View of the message contents
-- cdef object _bytes # A bytes/str copy of the message.
-- cdef bint _failed_init # Flag to handle failed zmq_msg_init
-- cdef public object tracker_event # Event for use with zmq_free_fn.
-- cdef public object tracker # MessageTracker object.
-- cdef public bint more # whether RCVMORE was set
--
-- cdef Frame fast_copy(self) # Create shallow copy of Message object.
-- cdef object _getbuffer(self) # Construct self._buffer.
--
--
--cdef inline object copy_zmq_msg_bytes(zmq_msg_t *zmq_msg):
-- """ Copy the data from a zmq_msg_t """
-- cdef char *data_c = NULL
-- cdef Py_ssize_t data_len_c
-- with nogil:
-- data_c = <char *>zmq_msg_data(zmq_msg)
-- data_len_c = zmq_msg_size(zmq_msg)
-- return PyBytes_FromStringAndSize(data_c, data_len_c)
--
--
-diff --git a/zmq/core/message.pyx b/zmq/core/message.pyx
-deleted file mode 100644
---- a/zmq/core/message.pyx
-+++ /dev/null
-@@ -1,297 +0,0 @@
--"""0MQ Message related classes."""
--
--#
--# Copyright (c) 2013 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--# get version-independent aliases:
--cdef extern from "pyversion_compat.h":
-- pass
--
--from cpython cimport Py_DECREF, Py_INCREF
--
--from buffers cimport asbuffer_r, viewfromobject_r
--
--cdef extern from "Python.h":
-- ctypedef int Py_ssize_t
--
--from libzmq cimport *
--
--import time
--
--try:
-- # below 3.3
-- from threading import _Event as Event
--except (ImportError, AttributeError):
-- # python throws ImportError, cython throws AttributeError
-- from threading import Event
--
--import zmq
--from zmq.core.checkrc cimport _check_rc
--from zmq.utils.strtypes import bytes,unicode,basestring
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--
--cdef void free_python_msg(void *data, void *hint) with gil:
-- """A function for DECREF'ing Python based messages."""
-- if hint != NULL:
-- tracker_event = (<tuple>hint)[1]
-- Py_DECREF(<object>hint)
-- if isinstance(tracker_event, Event):
-- # don't assert before DECREF:
-- # assert tracker_queue.empty(), "somebody else wrote to my Queue!"
-- tracker_event.set()
-- tracker_event = None
--
--
--cdef class Frame:
-- """Frame(data=None, track=False)
--
-- A zmq message Frame class for non-copy send/recvs.
--
-- This class is only needed if you want to do non-copying send and recvs.
-- When you pass a string to this class, like ``Frame(s)``, the
-- ref-count of `s` is increased by two: once because the Frame saves `s` as
-- an instance attribute and another because a ZMQ message is created that
-- points to the buffer of `s`. This second ref-count increase makes sure
-- that `s` lives until all messages that use it have been sent. Once 0MQ
-- sends all the messages and it doesn't need the buffer of s, 0MQ will call
-- ``Py_DECREF(s)``.
--
-- Parameters
-- ----------
--
-- data : object, optional
-- any object that provides the buffer interface will be used to
-- construct the 0MQ message data.
-- track : bool [default: False]
-- whether a MessageTracker_ should be created to track this object.
-- Tracking a message has a cost at creation, because it creates a threadsafe
-- Event object.
--
-- """
--
-- def __cinit__(self, object data=None, track=False, **kwargs):
-- cdef int rc
-- cdef char *data_c = NULL
-- cdef Py_ssize_t data_len_c=0
-- cdef object hint
--
-- # init more as False
-- self.more = False
--
-- # Save the data object in case the user wants the the data as a str.
-- self._data = data
-- self._failed_init = True # bool switch for dealloc
-- self._buffer = None # buffer view of data
-- self._bytes = None # bytes copy of data
--
-- # Event and MessageTracker for monitoring when zmq is done with data:
-- if track:
-- evt = Event()
-- self.tracker_event = evt
-- self.tracker = zmq.MessageTracker(evt)
-- else:
-- self.tracker_event = None
-- self.tracker = None
--
-- if isinstance(data, unicode):
-- raise TypeError("Unicode objects not allowed. Only: str/bytes, buffer interfaces.")
--
-- if data is None:
-- with nogil:
-- rc = zmq_msg_init(&self.zmq_msg)
-- _check_rc(rc)
-- self._failed_init = False
-- return
-- else:
-- asbuffer_r(data, <void **>&data_c, &data_len_c)
-- # We INCREF the *original* Python object (not self) and pass it
-- # as the hint below. This allows other copies of this Frame
-- # object to take over the ref counting of data properly.
-- hint = (data, self.tracker_event)
-- Py_INCREF(hint)
-- with nogil:
-- rc = zmq_msg_init_data(
-- &self.zmq_msg, <void *>data_c, data_len_c,
-- <zmq_free_fn *>free_python_msg, <void *>hint
-- )
-- if rc != 0:
-- Py_DECREF(hint)
-- _check_rc(rc)
-- self._failed_init = False
--
-- def __init__(self, object data=None, track=False):
-- """Enforce signature"""
-- pass
--
-- def __dealloc__(self):
-- cdef int rc
-- if self._failed_init:
-- return
-- # This simply decreases the 0MQ ref-count of zmq_msg.
-- with nogil:
-- rc = zmq_msg_close(&self.zmq_msg)
-- _check_rc(rc)
--
-- # buffer interface code adapted from petsc4py by Lisandro Dalcin, a BSD project
--
-- def __getbuffer__(self, Py_buffer* buffer, int flags):
-- # new-style (memoryview) buffer interface
-- with nogil:
-- buffer.buf = zmq_msg_data(&self.zmq_msg)
-- buffer.len = zmq_msg_size(&self.zmq_msg)
--
-- buffer.obj = self
-- buffer.readonly = 1
-- buffer.format = "B"
-- buffer.ndim = 0
-- buffer.shape = NULL
-- buffer.strides = NULL
-- buffer.suboffsets = NULL
-- buffer.itemsize = 1
-- buffer.internal = NULL
--
-- def __getsegcount__(self, Py_ssize_t *lenp):
-- # required for getreadbuffer
-- if lenp != NULL:
-- with nogil:
-- lenp[0] = zmq_msg_size(&self.zmq_msg)
-- return 1
--
-- def __getreadbuffer__(self, Py_ssize_t idx, void **p):
-- # old-style (buffer) interface
-- cdef char *data_c = NULL
-- cdef Py_ssize_t data_len_c
-- if idx != 0:
-- raise SystemError("accessing non-existent buffer segment")
-- # read-only, because we don't want to allow
-- # editing of the message in-place
-- with nogil:
-- data_c = <char *>zmq_msg_data(&self.zmq_msg)
-- data_len_c = zmq_msg_size(&self.zmq_msg)
-- if p != NULL:
-- p[0] = <void*>data_c
-- return data_len_c
--
-- # end buffer interface
--
-- def __copy__(self):
-- """Create a shallow copy of the message.
--
-- This does not copy the contents of the Frame, just the pointer.
-- This will increment the 0MQ ref count of the message, but not
-- the ref count of the Python object. That is only done once when
-- the Python is first turned into a 0MQ message.
-- """
-- return self.fast_copy()
--
-- cdef Frame fast_copy(self):
-- """Fast, cdef'd version of shallow copy of the Frame."""
-- cdef Frame new_msg
-- new_msg = Frame()
-- # This does not copy the contents, but just increases the ref-count
-- # of the zmq_msg by one.
-- with nogil:
-- zmq_msg_copy(&new_msg.zmq_msg, &self.zmq_msg)
-- # Copy the ref to data so the copy won't create a copy when str is
-- # called.
-- if self._data is not None:
-- new_msg._data = self._data
-- if self._buffer is not None:
-- new_msg._buffer = self._buffer
-- if self._bytes is not None:
-- new_msg._bytes = self._bytes
--
-- # Frame copies share the tracker and tracker_event
-- new_msg.tracker_event = self.tracker_event
-- new_msg.tracker = self.tracker
--
-- return new_msg
--
-- def __len__(self):
-- """Return the length of the message in bytes."""
-- cdef size_t sz
-- with nogil:
-- sz = zmq_msg_size(&self.zmq_msg)
-- return sz
-- # return <int>zmq_msg_size(&self.zmq_msg)
--
-- def __str__(self):
-- """Return the str form of the message."""
-- if isinstance(self._data, bytes):
-- b = self._data
-- else:
-- b = self.bytes
-- if str is unicode:
-- return b.decode()
-- else:
-- return b
--
-- cdef inline object _getbuffer(self):
-- """Create a Python buffer/view of the message data.
--
-- This will be called only once, the first time the `buffer` property
-- is accessed. Subsequent calls use a cached copy.
-- """
-- if self._data is None:
-- return viewfromobject_r(self)
-- else:
-- return viewfromobject_r(self._data)
--
-- @property
-- def buffer(self):
-- """Get a read-only buffer view of the message contents."""
-- if self._buffer is None:
-- self._buffer = self._getbuffer()
-- return self._buffer
--
-- @property
-- def bytes(self):
-- """Get the message content as a Python str/bytes object.
--
-- The first time this property is accessed, a copy of the message
-- contents is made. From then on that same copy of the message is
-- returned.
-- """
-- if self._bytes is None:
-- self._bytes = copy_zmq_msg_bytes(&self.zmq_msg)
-- return self._bytes
--
-- def set(self, int option, int value):
-- """Set a message property"""
-- cdef int rc = zmq_msg_set(&self.zmq_msg, option, value)
-- _check_rc(rc)
--
-- def get(self, int option):
-- """Get a message property"""
-- cdef int rc = zmq_msg_get(&self.zmq_msg, option)
-- _check_rc(rc)
-- return rc
--
--# legacy Message name
--Message = Frame
--
--__all__ = ['Frame', 'Message']
-diff --git a/zmq/core/socket.pxd b/zmq/core/socket.pxd
-deleted file mode 100644
---- a/zmq/core/socket.pxd
-+++ /dev/null
-@@ -1,48 +0,0 @@
--"""0MQ Socket class declaration."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from context cimport Context
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--
--cdef class Socket:
-- """A 0MQ socket."""
--
-- cdef object __weakref__ # enable weakref
-- cdef void *handle # The C handle for the underlying zmq object.
-- cdef public int socket_type # The 0MQ socket type - REQ,REP, etc.
-- # Hold on to a reference to the context to make sure it is not garbage
-- # collected until the socket it done with it.
-- cdef public Context context # The zmq Context object that owns this.
-- cdef public bint _closed # bool property for a closed socket.
-- cdef int _pid # the pid of the process which created me (for fork safety)
--
-- # cpdef methods for direct-cython access:
-- cpdef object send(self, object data, int flags=*, copy=*, track=*)
-- cpdef object recv(self, int flags=*, copy=*, track=*)
--
-diff --git a/zmq/core/socket.pyx b/zmq/core/socket.pyx
-deleted file mode 100644
---- a/zmq/core/socket.pyx
-+++ /dev/null
-@@ -1,628 +0,0 @@
--"""0MQ Socket class."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Cython Imports
--#-----------------------------------------------------------------------------
--
--# get version-independent aliases:
--cdef extern from "pyversion_compat.h":
-- pass
--
--from libc.errno cimport ENAMETOOLONG
--from libc.string cimport memcpy
--
--from cpython cimport PyBytes_FromStringAndSize
--from cpython cimport PyBytes_AsString, PyBytes_Size
--from cpython cimport Py_DECREF, Py_INCREF
--
--from buffers cimport asbuffer_r, viewfromobject_r
--
--from libzmq cimport *
--from message cimport Frame, copy_zmq_msg_bytes
--
--from context cimport Context
--
--cdef extern from "Python.h":
-- ctypedef int Py_ssize_t
--
--cdef extern from "ipcmaxlen.h":
-- int get_ipc_path_max_len()
--
--cdef extern from "getpid_compat.h":
-- int getpid()
--
--
--#-----------------------------------------------------------------------------
--# Python Imports
--#-----------------------------------------------------------------------------
--
--import copy as copy_mod
--import time
--import sys
--import random
--import struct
--import codecs
--
--from zmq.utils import jsonapi
--
--try:
-- import cPickle
-- pickle = cPickle
--except:
-- cPickle = None
-- import pickle
--
--import zmq
--from zmq.core import constants
--from zmq.core.constants import *
--from zmq.core.checkrc cimport _check_rc
--from zmq.error import ZMQError, ZMQBindError
--from zmq.utils.strtypes import bytes,unicode,basestring
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--IPC_PATH_MAX_LEN = get_ipc_path_max_len()
--
--# inline some small socket submethods:
--# true methods frequently cannot be inlined, acc. Cython docs
--
--cdef inline _check_closed(Socket s, bint raise_notsup):
-- cdef int rc
-- cdef int errno
-- cdef int stype
-- cdef size_t sz=sizeof(int)
-- if s._closed:
-- if raise_notsup:
-- raise ZMQError(ENOTSUP)
-- else:
-- return True
-- else:
-- rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
-- if rc < 0 and zmq_errno() == ENOTSOCK:
-- s._closed = True
-- if raise_notsup:
-- raise ZMQError(ENOTSUP)
-- else:
-- return True
-- else:
-- _check_rc(rc)
-- return False
--
--cdef inline Frame _recv_frame(void *handle, int flags=0, track=False):
-- """Receive a message in a non-copying manner and return a Frame."""
-- cdef int rc
-- cdef Frame msg
-- msg = Frame(track=track)
--
-- with nogil:
-- rc = zmq_msg_recv(&msg.zmq_msg, handle, flags)
--
-- _check_rc(rc)
-- return msg
--
--cdef inline object _recv_copy(void *handle, int flags=0):
-- """Receive a message and return a copy"""
-- cdef zmq_msg_t zmq_msg
-- with nogil:
-- zmq_msg_init (&zmq_msg)
-- rc = zmq_msg_recv(&zmq_msg, handle, flags)
-- _check_rc(rc)
-- msg_bytes = copy_zmq_msg_bytes(&zmq_msg)
-- with nogil:
-- zmq_msg_close(&zmq_msg)
-- return msg_bytes
--
--cdef inline object _send_frame(void *handle, Frame msg, int flags=0):
-- """Send a Frame on this socket in a non-copy manner."""
-- cdef int rc
-- cdef Frame msg_copy
--
-- # Always copy so the original message isn't garbage collected.
-- # This doesn't do a real copy, just a reference.
-- msg_copy = msg.fast_copy()
--
-- with nogil:
-- rc = zmq_msg_send(&msg_copy.zmq_msg, handle, flags)
--
-- _check_rc(rc)
-- return msg.tracker
--
--
--cdef inline object _send_copy(void *handle, object msg, int flags=0):
-- """Send a message on this socket by copying its content."""
-- cdef int rc, rc2
-- cdef zmq_msg_t data
-- cdef char *msg_c
-- cdef Py_ssize_t msg_c_len=0
--
-- # copy to c array:
-- asbuffer_r(msg, <void **>&msg_c, &msg_c_len)
--
-- # Copy the msg before sending. This avoids any complications with
-- # the GIL, etc.
-- # If zmq_msg_init_* fails we must not call zmq_msg_close (Bus Error)
-- with nogil:
-- rc = zmq_msg_init_size(&data, msg_c_len)
--
-- _check_rc(rc)
--
-- with nogil:
-- memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
-- rc = zmq_msg_send(&data, handle, flags)
-- rc2 = zmq_msg_close(&data)
-- _check_rc(rc)
-- _check_rc(rc2)
--
--
--cdef class Socket:
-- """Socket(context, socket_type)
--
-- A 0MQ socket.
--
-- These objects will generally be constructed via the socket() method of a Context object.
--
-- Note: 0MQ Sockets are *not* threadsafe. **DO NOT** share them across threads.
--
-- Parameters
-- ----------
-- context : Context
-- The 0MQ Context this Socket belongs to.
-- socket_type : int
-- The socket type, which can be any of the 0MQ socket types:
-- REQ, REP, PUB, SUB, PAIR, DEALER, ROUTER, PULL, PUSH, XPUB, XSUB.
--
-- See Also
-- --------
-- .Context.socket : method for creating a socket bound to a Context.
-- """
--
-- def __cinit__(self, Context context, int socket_type, *args, **kwrags):
-- cdef Py_ssize_t c_handle
-- c_handle = context._handle
--
-- self.handle = NULL
-- self.context = context
-- self.socket_type = socket_type
-- with nogil:
-- self.handle = zmq_socket(<void *>c_handle, socket_type)
-- if self.handle == NULL:
-- raise ZMQError()
-- self._closed = False
-- self._pid = getpid()
-- context._add_socket(self.handle)
--
-- def __dealloc__(self):
-- """close *and* remove from context's list
--
-- But be careful that context might not exist if called during gc
-- """
-- if self.handle != NULL and getpid() == self._pid:
-- rc = zmq_close(self.handle)
-- if rc != 0 and zmq_errno() != ENOTSOCK:
-- # ignore ENOTSOCK (closed by Context)
-- _check_rc(rc)
-- # during gc, self.context might be NULL
-- if self.context:
-- self.context._remove_socket(self.handle)
--
-- def __init__(self, context, socket_type):
-- pass
--
-- @property
-- def closed(self):
-- return _check_closed(self, False)
--
-- def close(self, linger=None):
-- """s.close(linger=None)
--
-- Close the socket.
--
-- If linger is specified, LINGER sockopt will be set prior to closing.
--
-- This can be called to close the socket by hand. If this is not
-- called, the socket will automatically be closed when it is
-- garbage collected.
-- """
-- cdef int rc=0
-- cdef int linger_c
-- cdef bint setlinger=False
--
-- if linger is not None:
-- linger_c = linger
-- setlinger=True
--
-- if self.handle != NULL and not self._closed and getpid() == self._pid:
-- if setlinger:
-- zmq_setsockopt(self.handle, ZMQ_LINGER, &linger_c, sizeof(int))
-- rc = zmq_close(self.handle)
-- if rc != 0 and zmq_errno() != ENOTSOCK:
-- # ignore ENOTSOCK (closed by Context)
-- _check_rc(rc)
-- self._closed = True
-- # during gc, self.context might be NULL
-- if self.context:
-- self.context._remove_socket(self.handle)
-- self.handle = NULL
--
-- def set(self, int option, optval):
-- """s.set(option, optval)
--
-- Set socket options.
--
-- See the 0MQ API documentation for details on specific options.
--
-- Parameters
-- ----------
-- option : int
-- The option to set. Available values will depend on your
-- version of libzmq. Examples include::
--
-- zmq.SUBSCRIBE, UNSUBSCRIBE, IDENTITY, HWM, LINGER, FD
--
-- optval : int or bytes
-- The value of the option to set.
-- """
-- cdef int64_t optval_int64_c
-- cdef int optval_int_c
-- cdef int rc
-- cdef char* optval_c
-- cdef Py_ssize_t sz
--
-- _check_closed(self, True)
-- if isinstance(optval, unicode):
-- raise TypeError("unicode not allowed, use setsockopt_string")
--
-- if option in zmq.constants.bytes_sockopts:
-- if not isinstance(optval, bytes):
-- raise TypeError('expected bytes, got: %r' % optval)
-- optval_c = PyBytes_AsString(optval)
-- sz = PyBytes_Size(optval)
-- with nogil:
-- rc = zmq_setsockopt(
-- self.handle, option,
-- optval_c, sz
-- )
-- elif option in zmq.constants.int64_sockopts:
-- if not isinstance(optval, int):
-- raise TypeError('expected int, got: %r' % optval)
-- optval_int64_c = optval
-- with nogil:
-- rc = zmq_setsockopt(
-- self.handle, option,
-- &optval_int64_c, sizeof(int64_t)
-- )
-- else:
-- # default is to assume int, which is what most new sockopts will be
-- # this lets pyzmq work with newer libzmq which may add constants
-- # pyzmq has not yet added, rather than artificially raising. Invalid
-- # sockopts will still raise just the same, but it will be libzmq doing
-- # the raising.
-- if not isinstance(optval, int):
-- raise TypeError('expected int, got: %r' % optval)
-- optval_int_c = optval
-- with nogil:
-- rc = zmq_setsockopt(
-- self.handle, option,
-- &optval_int_c, sizeof(int)
-- )
--
-- _check_rc(rc)
--
-- def get(self, int option):
-- """s.get(option)
--
-- Get the value of a socket option.
--
-- See the 0MQ API documentation for details on specific options.
--
-- Parameters
-- ----------
-- option : int
-- The option to get. Available values will depend on your
-- version of libzmq. Examples include::
--
-- zmq.IDENTITY, HWM, LINGER, FD, EVENTS
--
-- Returns
-- -------
-- optval : int or bytes
-- The value of the option as a bytestring or int.
-- """
-- cdef int64_t optval_int64_c
-- cdef int optval_int_c
-- cdef fd_t optval_fd_c
-- cdef char identity_str_c [255]
-- cdef size_t sz
-- cdef int rc
--
-- _check_closed(self, True)
--
-- if option in zmq.constants.bytes_sockopts:
-- sz = 255
-- with nogil:
-- rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
-- _check_rc(rc)
-- result = PyBytes_FromStringAndSize(<char *>identity_str_c, sz)
-- elif option in zmq.constants.int64_sockopts:
-- sz = sizeof(int64_t)
-- with nogil:
-- rc = zmq_getsockopt(self.handle, option, <void *>&optval_int64_c, &sz)
-- _check_rc(rc)
-- result = optval_int64_c
-- elif option == ZMQ_FD:
-- sz = sizeof(fd_t)
-- with nogil:
-- rc = zmq_getsockopt(self.handle, option, <void *>&optval_fd_c, &sz)
-- _check_rc(rc)
-- result = optval_fd_c
-- else:
-- # default is to assume int, which is what most new sockopts will be
-- # this lets pyzmq work with newer libzmq which may add constants
-- # pyzmq has not yet added, rather than artificially raising. Invalid
-- # sockopts will still raise just the same, but it will be libzmq doing
-- # the raising.
-- sz = sizeof(int)
-- with nogil:
-- rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
-- _check_rc(rc)
-- result = optval_int_c
--
-- return result
--
-- def bind(self, addr):
-- """s.bind(addr)
--
-- Bind the socket to an address.
--
-- This causes the socket to listen on a network port. Sockets on the
-- other side of this connection will use ``Socket.connect(addr)`` to
-- connect to this socket.
--
-- Parameters
-- ----------
-- addr : str
-- The address string. This has the form 'protocol://interface:port',
-- for example 'tcp://127.0.0.1:5555'. Protocols supported include
-- tcp, udp, pgm, epgm, inproc and ipc. If the address is unicode, it is
-- encoded to utf-8 first.
-- """
-- cdef int rc
-- cdef char* c_addr
--
-- _check_closed(self, True)
-- if isinstance(addr, unicode):
-- addr = addr.encode('utf-8')
-- if not isinstance(addr, bytes):
-- raise TypeError('expected str, got: %r' % addr)
-- c_addr = addr
-- rc = zmq_bind(self.handle, c_addr)
-- if rc != 0:
-- if IPC_PATH_MAX_LEN and zmq_errno() == ENAMETOOLONG:
-- # py3compat: addr is bytes, but msg wants str
-- if str is unicode:
-- addr = addr.decode('utf-8', 'replace')
-- path = addr.split('://', 1)[-1]
-- msg = ('ipc path "{0}" is longer than {1} '
-- 'characters (sizeof(sockaddr_un.sun_path)). '
-- 'zmq.IPC_PATH_MAX_LEN constant can be used '
-- 'to check addr length (if it is defined).'
-- .format(path, IPC_PATH_MAX_LEN))
-- raise ZMQError(msg=msg)
-- _check_rc(rc)
--
-- def connect(self, addr):
-- """s.connect(addr)
--
-- Connect to a remote 0MQ socket.
--
-- Parameters
-- ----------
-- addr : str
-- The address string. This has the form 'protocol://interface:port',
-- for example 'tcp://127.0.0.1:5555'. Protocols supported are
-- tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
-- encoded to utf-8 first.
-- """
-- cdef int rc
-- cdef char* c_addr
--
-- _check_closed(self, True)
-- if isinstance(addr, unicode):
-- addr = addr.encode('utf-8')
-- if not isinstance(addr, bytes):
-- raise TypeError('expected str, got: %r' % addr)
-- c_addr = addr
--
-- rc = zmq_connect(self.handle, c_addr)
-- if rc != 0:
-- raise ZMQError()
--
-- def unbind(self, addr):
-- """s.unbind(addr)
--
-- Unbind from an address (undoes a call to bind).
--
-- This feature requires libzmq-3
--
-- Parameters
-- ----------
-- addr : str
-- The address string. This has the form 'protocol://interface:port',
-- for example 'tcp://127.0.0.1:5555'. Protocols supported are
-- tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
-- encoded to utf-8 first.
-- """
-- cdef int rc
-- cdef char* c_addr
--
-- if ZMQ_VERSION_MAJOR < 3:
-- raise NotImplementedError("unbind requires libzmq >= 3.0, have %s" % zmq.zmq_version())
--
--
-- _check_closed(self, True)
-- if isinstance(addr, unicode):
-- addr = addr.encode('utf-8')
-- if not isinstance(addr, bytes):
-- raise TypeError('expected str, got: %r' % addr)
-- c_addr = addr
--
-- rc = zmq_unbind(self.handle, c_addr)
-- if rc != 0:
-- raise ZMQError()
--
-- def disconnect(self, addr):
-- """s.disconnect(addr)
--
-- Disconnect from a remote 0MQ socket (undoes a call to connect).
--
-- This feature requires libzmq-3
--
-- Parameters
-- ----------
-- addr : str
-- The address string. This has the form 'protocol://interface:port',
-- for example 'tcp://127.0.0.1:5555'. Protocols supported are
-- tcp, upd, pgm, inproc and ipc. If the address is unicode, it is
-- encoded to utf-8 first.
-- """
-- cdef int rc
-- cdef char* c_addr
--
-- if ZMQ_VERSION_MAJOR < 3:
-- raise NotImplementedError("disconnect requires libzmq >= 3.0, have %s" % zmq.zmq_version())
--
-- _check_closed(self, True)
-- if isinstance(addr, unicode):
-- addr = addr.encode('utf-8')
-- if not isinstance(addr, bytes):
-- raise TypeError('expected str, got: %r' % addr)
-- c_addr = addr
--
-- rc = zmq_disconnect(self.handle, c_addr)
-- if rc != 0:
-- raise ZMQError()
--
-- #-------------------------------------------------------------------------
-- # Sending and receiving messages
-- #-------------------------------------------------------------------------
--
-- cpdef object send(self, object data, int flags=0, copy=True, track=False):
-- """s.send(data, flags=0, copy=True, track=False)
--
-- Send a message on this socket.
--
-- This queues the message to be sent by the IO thread at a later time.
--
-- Parameters
-- ----------
-- data : object, str, Frame
-- The content of the message.
-- flags : int
-- Any supported flag: NOBLOCK, SNDMORE.
-- copy : bool
-- Should the message be sent in a copying or non-copying manner.
-- track : bool
-- Should the message be tracked for notification that ZMQ has
-- finished with it? (ignored if copy=True)
--
-- Returns
-- -------
-- None : if `copy` or not track
-- None if message was sent, raises an exception otherwise.
-- MessageTracker : if track and not copy
-- a MessageTracker object, whose `pending` property will
-- be True until the send is completed.
--
-- Raises
-- ------
-- TypeError
-- If a unicode object is passed
-- ValueError
-- If `track=True`, but an untracked Frame is passed.
-- ZMQError
-- If the send does not succeed for any reason.
--
-- """
-- _check_closed(self, True)
--
-- if isinstance(data, unicode):
-- raise TypeError("unicode not allowed, use send_unicode")
--
-- if copy:
-- # msg.bytes never returns the input data object
-- # it is always a copy, but always the same copy
-- if isinstance(data, Frame):
-- data = data.buffer
-- return _send_copy(self.handle, data, flags)
-- else:
-- if isinstance(data, Frame):
-- if track and not data.tracker:
-- raise ValueError('Not a tracked message')
-- msg = data
-- else:
-- msg = Frame(data, track=track)
-- return _send_frame(self.handle, msg, flags)
--
-- cpdef object recv(self, int flags=0, copy=True, track=False):
-- """s.recv(flags=0, copy=True, track=False)
--
-- Receive a message.
--
-- Parameters
-- ----------
-- flags : int
-- Any supported flag: NOBLOCK. If NOBLOCK is set, this method
-- will raise a ZMQError with EAGAIN if a message is not ready.
-- If NOBLOCK is not set, then this method will block until a
-- message arrives.
-- copy : bool
-- Should the message be received in a copying or non-copying manner?
-- If False a Frame object is returned, if True a string copy of
-- message is returned.
-- track : bool
-- Should the message be tracked for notification that ZMQ has
-- finished with it? (ignored if copy=True)
--
-- Returns
-- -------
-- msg : bytes, Frame
-- The received message frame. If `copy` is False, then it will be a Frame,
-- otherwise it will be bytes.
--
-- Raises
-- ------
-- ZMQError
-- for any of the reasons zmq_msg_recv might fail.
-- """
-- _check_closed(self, True)
--
-- if copy:
-- return _recv_copy(self.handle, flags)
-- else:
-- frame = _recv_frame(self.handle, flags, track)
-- frame.more = self.getsockopt(zmq.RCVMORE)
-- return frame
--
--
--__all__ = ['Socket', 'IPC_PATH_MAX_LEN']
-diff --git a/zmq/core/stopwatch.pxd b/zmq/core/stopwatch.pxd
-deleted file mode 100644
---- a/zmq/core/stopwatch.pxd
-+++ /dev/null
-@@ -1,31 +0,0 @@
--"""0MQ Stopwatch class declaration."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--
--cdef class Stopwatch:
-- """A simple stopwatch based on zmq_stopwatch_start/stop."""
--
-- cdef void *watch # The C handle for the underlying zmq object
--
-diff --git a/zmq/core/stopwatch.pyx b/zmq/core/stopwatch.pyx
-deleted file mode 100644
---- a/zmq/core/stopwatch.pyx
-+++ /dev/null
-@@ -1,90 +0,0 @@
--"""0MQ Stopwatch class."""
--
--#
--# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
--#
--# This file is part of pyzmq.
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from libzmq cimport zmq_stopwatch_start, zmq_stopwatch_stop, zmq_sleep
--
--from zmq.error import ZMQError
--
--#-----------------------------------------------------------------------------
--# Code
--#-----------------------------------------------------------------------------
--
--cdef class Stopwatch:
-- """Stopwatch()
--
-- A simple stopwatch based on zmq_stopwatch_start/stop.
--
-- This class should be used for benchmarking and timing 0MQ code.
-- """
--
-- def __cinit__(self):
-- self.watch = NULL
--
-- def __dealloc__(self):
-- try:
-- self.stop()
-- except ZMQError:
-- pass
--
-- def start(self):
-- """s.start()
--
-- Start the stopwatch.
-- """
-- if self.watch == NULL:
-- with nogil:
-- self.watch = zmq_stopwatch_start()
-- else:
-- raise ZMQError('Stopwatch is already runing.')
--
-- def stop(self):
-- """s.stop()
--
-- Stop the stopwatch.
--
-- Returns
-- -------
-- t : unsigned long int
-- the number of microseconds since ``start()`` was called.
-- """
-- cdef unsigned long time
-- if self.watch == NULL:
-- raise ZMQError('Must start the Stopwatch before calling stop.')
-- else:
-- with nogil:
-- time = zmq_stopwatch_stop(self.watch)
-- self.watch = NULL
-- return time
--
-- def sleep(self, int seconds):
-- """s.sleep(seconds)
--
-- Sleep for an integer number of seconds.
-- """
-- with nogil:
-- zmq_sleep(seconds)
--
--
--__all__ = ['Stopwatch']
-diff --git a/zmq/devices/__init__.py b/zmq/devices/__init__.py
---- a/zmq/devices/__init__.py
-+++ b/zmq/devices/__init__.py
-@@ -14,11 +14,12 @@
- #-----------------------------------------------------------------------------
-
- from zmq import device
--from zmq.devices import basedevice, proxydevice, monitoredqueue, monitoredqueuedevice
-+from zmq.devices import basedevice, proxydevice, monitoredqueuedevice
-+from zmq.devices import _zmonitoredqueue as monitoredqueue
-
- from zmq.devices.basedevice import *
- from zmq.devices.proxydevice import *
--from zmq.devices.monitoredqueue import *
-+from zmq.devices._zmonitoredqueue import *
- from zmq.devices.monitoredqueuedevice import *
-
- __all__ = ['device']
-diff --git a/zmq/devices/_zmonitoredqueue.pxd b/zmq/devices/_zmonitoredqueue.pxd
-new file mode 100644
---- /dev/null
-+++ b/zmq/devices/_zmonitoredqueue.pxd
-@@ -0,0 +1,166 @@
-+"""MonitoredQueue class declarations.
-+
-+Authors
-+-------
-+* MinRK
-+* Brian Granger
-+"""
-+
-+#
-+# Copyright (c) 2010 Min Ragan-Kelley, Brian Granger
-+#
-+# This file is part of pyzmq, but is derived and adapted from zmq_queue.cpp
-+# originally from libzmq-2.1.6, used under LGPLv3
-+#
-+# pyzmq is free software; you can redistribute it and/or modify it under
-+# the terms of the Lesser GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# pyzmq is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# Lesser GNU General Public License for more details.
-+#
-+# You should have received a copy of the Lesser GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+#
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+from libzmq cimport *
-+
-+#-----------------------------------------------------------------------------
-+# MonitoredQueue C functions
-+#-----------------------------------------------------------------------------
-+
-+cdef inline int _relay(void *insocket_, void *outsocket_, void *sidesocket_,
-+ zmq_msg_t msg, zmq_msg_t side_msg, zmq_msg_t id_msg,
-+ bint swap_ids) nogil:
-+ cdef int rc
-+ cdef int64_t flag_2
-+ cdef int flag_3
-+ cdef int flags
-+ cdef bint more
-+ cdef size_t flagsz
-+ cdef void * flag_ptr
-+
-+ if ZMQ_VERSION_MAJOR < 3:
-+ flagsz = sizeof (int64_t)
-+ flag_ptr = &flag_2
-+ else:
-+ flagsz = sizeof (int)
-+ flag_ptr = &flag_3
-+
-+ if swap_ids:# both router, must send second identity first
-+ # recv two ids into msg, id_msg
-+ rc = zmq_msg_recv(&msg, insocket_, 0)
-+ rc = zmq_msg_recv(&id_msg, insocket_, 0)
-+
-+ # send second id (id_msg) first
-+ #!!!! always send a copy before the original !!!!
-+ rc = zmq_msg_copy(&side_msg, &id_msg)
-+ rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
-+ rc = zmq_msg_send(&id_msg, sidesocket_, ZMQ_SNDMORE)
-+ # send first id (msg) second
-+ rc = zmq_msg_copy(&side_msg, &msg)
-+ rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
-+ rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
-+ if rc < 0:
-+ return rc
-+ while (True):
-+ rc = zmq_msg_recv(&msg, insocket_, 0)
-+ # assert (rc == 0)
-+ rc = zmq_getsockopt (insocket_, ZMQ_RCVMORE, flag_ptr, &flagsz)
-+ flags = 0
-+ if ZMQ_VERSION_MAJOR < 3:
-+ if flag_2:
-+ flags |= ZMQ_SNDMORE
-+ else:
-+ if flag_3:
-+ flags |= ZMQ_SNDMORE
-+ # LABEL has been removed:
-+ # rc = zmq_getsockopt (insocket_, ZMQ_RCVLABEL, flag_ptr, &flagsz)
-+ # if flag_3:
-+ # flags |= ZMQ_SNDLABEL
-+ # assert (rc == 0)
-+
-+ rc = zmq_msg_copy(&side_msg, &msg)
-+ if flags:
-+ rc = zmq_msg_send(&side_msg, outsocket_, flags)
-+ # only SNDMORE for side-socket
-+ rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
-+ else:
-+ rc = zmq_msg_send(&side_msg, outsocket_, 0)
-+ rc = zmq_msg_send(&msg, sidesocket_, 0)
-+ break
-+ return rc
-+
-+# the MonitoredQueue C function, adapted from zmq::queue.cpp :
-+cdef inline int c_monitored_queue (void *insocket_, void *outsocket_,
-+ void *sidesocket_, zmq_msg_t *in_msg_ptr,
-+ zmq_msg_t *out_msg_ptr, int swap_ids) nogil:
-+ """The actual C function for a monitored queue device.
-+
-+ See ``monitored_queue()`` for details.
-+ """
-+
-+ cdef zmq_msg_t msg
-+ cdef int rc = zmq_msg_init (&msg)
-+ cdef zmq_msg_t id_msg
-+ rc = zmq_msg_init (&id_msg)
-+ cdef zmq_msg_t side_msg
-+ rc = zmq_msg_init (&side_msg)
-+ # assert (rc == 0)
-+
-+
-+ cdef zmq_pollitem_t items [2]
-+ items [0].socket = insocket_
-+ items [0].fd = 0
-+ items [0].events = ZMQ_POLLIN
-+ items [0].revents = 0
-+ items [1].socket = outsocket_
-+ items [1].fd = 0
-+ items [1].events = ZMQ_POLLIN
-+ items [1].revents = 0
-+ # I don't think sidesocket should be polled?
-+ # items [2].socket = sidesocket_
-+ # items [2].fd = 0
-+ # items [2].events = ZMQ_POLLIN
-+ # items [2].revents = 0
-+
-+ while (True):
-+
-+ # // Wait while there are either requests or replies to process.
-+ rc = zmq_poll (&items [0], 2, -1)
-+ if rc < 0:
-+ return rc
-+ # // The algorithm below asumes ratio of request and replies processed
-+ # // under full load to be 1:1. Although processing requests replies
-+ # // first is tempting it is suspectible to DoS attacks (overloading
-+ # // the system with unsolicited replies).
-+ #
-+ # // Process a request.
-+ if (items [0].revents & ZMQ_POLLIN):
-+ # send in_prefix to side socket
-+ rc = zmq_msg_copy(&side_msg, in_msg_ptr)
-+ rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
-+ if rc < 0:
-+ return rc
-+ # relay the rest of the message
-+ rc = _relay(insocket_, outsocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
-+ if rc < 0:
-+ return rc
-+ if (items [1].revents & ZMQ_POLLIN):
-+ # send out_prefix to side socket
-+ rc = zmq_msg_copy(&side_msg, out_msg_ptr)
-+ rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
-+ if rc < 0:
-+ return rc
-+ # relay the rest of the message
-+ rc = _relay(outsocket_, insocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
-+ if rc < 0:
-+ return rc
-+ return 0
-diff --git a/zmq/devices/_zmonitoredqueue.pyx b/zmq/devices/_zmonitoredqueue.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/devices/_zmonitoredqueue.pyx
-@@ -0,0 +1,108 @@
-+"""MonitoredQueue classes and functions.
-+
-+Authors
-+-------
-+* MinRK
-+* Brian Granger
-+"""
-+
-+#-----------------------------------------------------------------------------
-+# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
-+#
-+# This file is part of pyzmq
-+#
-+# Distributed under the terms of the New BSD License. The full license is in
-+# the file COPYING.BSD, distributed as part of this software.
-+#-----------------------------------------------------------------------------
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+cdef extern from "Python.h":
-+ ctypedef int Py_ssize_t
-+
-+from libc.string cimport memcpy
-+
-+from buffers cimport asbuffer_r
-+from libzmq cimport *
-+
-+from zmq.core._zsocket cimport Socket
-+from zmq.core.checkrc cimport _check_rc
-+
-+from zmq import ROUTER, ZMQError
-+
-+#-----------------------------------------------------------------------------
-+# MonitoredQueue functions
-+#-----------------------------------------------------------------------------
-+
-+
-+def monitored_queue(Socket in_socket, Socket out_socket, Socket mon_socket,
-+ bytes in_prefix=b'in', bytes out_prefix=b'out'):
-+ """monitored_queue(in_socket, out_socket, mon_socket,
-+ in_prefix='in', out_prefix='out')
-+
-+ Start a monitored queue device.
-+
-+ A monitored queue behaves just like a zmq QUEUE device as far as in_socket
-+ and out_socket are concerned, except that all messages *also* go out on
-+ mon_socket. mon_socket also prefixes the messages coming from each with a
-+ prefix, by default 'in' and 'out', so all messages sent by mon_socket are
-+ multipart.
-+
-+ The only difference between this and a QUEUE as far as in/out are
-+ concerned is that it works with two ROUTER sockets by swapping the IDENT
-+ prefixes.
-+
-+ Parameters
-+ ----------
-+ in_socket : Socket
-+ One of the sockets to the Queue. Its messages will be prefixed with
-+ 'in'.
-+ out_socket : Socket
-+ One of the sockets to the Queue. Its messages will be prefixed with
-+ 'out'. The only difference between in/out socket is this prefix.
-+ mon_socket : Socket
-+ This socket sends out every message received by each of the others
-+ with an in/out prefix specifying which one it was.
-+ in_prefix : str
-+ Prefix added to broadcast messages from in_socket.
-+ out_prefix : str
-+ Prefix added to broadcast messages from out_socket.
-+ """
-+
-+ cdef void *ins=in_socket.handle
-+ cdef void *outs=out_socket.handle
-+ cdef void *mons=mon_socket.handle
-+ cdef zmq_msg_t in_msg
-+ cdef zmq_msg_t out_msg
-+ cdef bint swap_ids
-+ cdef char *msg_c = NULL
-+ cdef Py_ssize_t msg_c_len
-+ cdef int rc
-+
-+ # force swap_ids if both ROUTERs
-+ swap_ids = (in_socket.socket_type == ROUTER and
-+ out_socket.socket_type == ROUTER)
-+
-+ # build zmq_msg objects from str prefixes
-+ asbuffer_r(in_prefix, <void **>&msg_c, &msg_c_len)
-+ with nogil:
-+ rc = zmq_msg_init_size(&in_msg, msg_c_len)
-+ _check_rc(rc)
-+
-+ with nogil:
-+ memcpy(zmq_msg_data(&in_msg), msg_c, zmq_msg_size(&in_msg))
-+
-+ asbuffer_r(out_prefix, <void **>&msg_c, &msg_c_len)
-+
-+ with nogil:
-+ rc = zmq_msg_init_size(&out_msg, msg_c_len)
-+ _check_rc(rc)
-+
-+ with nogil:
-+ memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg))
-+ rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
-+ return rc
-+
-+__all__ = ['monitored_queue']
-diff --git a/zmq/devices/basedevice.py b/zmq/devices/basedevice.py
---- a/zmq/devices/basedevice.py
-+++ b/zmq/devices/basedevice.py
-@@ -20,8 +20,15 @@ Authors
- #-----------------------------------------------------------------------------
-
- import time
--from threading import Thread
--from multiprocessing import Process
-+try:
-+ from threading import Thread
-+except ImportError:
-+ Thread = None
-+
-+try:
-+ from multiprocessing import Process
-+except ImportError:
-+ Process = None
-
- from zmq import device, QUEUE, Context
-
-diff --git a/zmq/devices/monitoredqueue.pxd b/zmq/devices/monitoredqueue.pxd
-deleted file mode 100644
---- a/zmq/devices/monitoredqueue.pxd
-+++ /dev/null
-@@ -1,166 +0,0 @@
--"""MonitoredQueue class declarations.
--
--Authors
---------
--* MinRK
--* Brian Granger
--"""
--
--#
--# Copyright (c) 2010 Min Ragan-Kelley, Brian Granger
--#
--# This file is part of pyzmq, but is derived and adapted from zmq_queue.cpp
--# originally from libzmq-2.1.6, used under LGPLv3
--#
--# pyzmq is free software; you can redistribute it and/or modify it under
--# the terms of the Lesser GNU General Public License as published by
--# the Free Software Foundation; either version 3 of the License, or
--# (at your option) any later version.
--#
--# pyzmq is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY; without even the implied warranty of
--# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--# Lesser GNU General Public License for more details.
--#
--# You should have received a copy of the Lesser GNU General Public License
--# along with this program. If not, see <http://www.gnu.org/licenses/>.
--#
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--from libzmq cimport *
--
--#-----------------------------------------------------------------------------
--# MonitoredQueue C functions
--#-----------------------------------------------------------------------------
--
--cdef inline int _relay(void *insocket_, void *outsocket_, void *sidesocket_,
-- zmq_msg_t msg, zmq_msg_t side_msg, zmq_msg_t id_msg,
-- bint swap_ids) nogil:
-- cdef int rc
-- cdef int64_t flag_2
-- cdef int flag_3
-- cdef int flags
-- cdef bint more
-- cdef size_t flagsz
-- cdef void * flag_ptr
--
-- if ZMQ_VERSION_MAJOR < 3:
-- flagsz = sizeof (int64_t)
-- flag_ptr = &flag_2
-- else:
-- flagsz = sizeof (int)
-- flag_ptr = &flag_3
--
-- if swap_ids:# both router, must send second identity first
-- # recv two ids into msg, id_msg
-- rc = zmq_msg_recv(&msg, insocket_, 0)
-- rc = zmq_msg_recv(&id_msg, insocket_, 0)
--
-- # send second id (id_msg) first
-- #!!!! always send a copy before the original !!!!
-- rc = zmq_msg_copy(&side_msg, &id_msg)
-- rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
-- rc = zmq_msg_send(&id_msg, sidesocket_, ZMQ_SNDMORE)
-- # send first id (msg) second
-- rc = zmq_msg_copy(&side_msg, &msg)
-- rc = zmq_msg_send(&side_msg, outsocket_, ZMQ_SNDMORE)
-- rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
-- if rc < 0:
-- return rc
-- while (True):
-- rc = zmq_msg_recv(&msg, insocket_, 0)
-- # assert (rc == 0)
-- rc = zmq_getsockopt (insocket_, ZMQ_RCVMORE, flag_ptr, &flagsz)
-- flags = 0
-- if ZMQ_VERSION_MAJOR < 3:
-- if flag_2:
-- flags |= ZMQ_SNDMORE
-- else:
-- if flag_3:
-- flags |= ZMQ_SNDMORE
-- # LABEL has been removed:
-- # rc = zmq_getsockopt (insocket_, ZMQ_RCVLABEL, flag_ptr, &flagsz)
-- # if flag_3:
-- # flags |= ZMQ_SNDLABEL
-- # assert (rc == 0)
--
-- rc = zmq_msg_copy(&side_msg, &msg)
-- if flags:
-- rc = zmq_msg_send(&side_msg, outsocket_, flags)
-- # only SNDMORE for side-socket
-- rc = zmq_msg_send(&msg, sidesocket_, ZMQ_SNDMORE)
-- else:
-- rc = zmq_msg_send(&side_msg, outsocket_, 0)
-- rc = zmq_msg_send(&msg, sidesocket_, 0)
-- break
-- return rc
--
--# the MonitoredQueue C function, adapted from zmq::queue.cpp :
--cdef inline int c_monitored_queue (void *insocket_, void *outsocket_,
-- void *sidesocket_, zmq_msg_t *in_msg_ptr,
-- zmq_msg_t *out_msg_ptr, int swap_ids) nogil:
-- """The actual C function for a monitored queue device.
--
-- See ``monitored_queue()`` for details.
-- """
--
-- cdef zmq_msg_t msg
-- cdef int rc = zmq_msg_init (&msg)
-- cdef zmq_msg_t id_msg
-- rc = zmq_msg_init (&id_msg)
-- cdef zmq_msg_t side_msg
-- rc = zmq_msg_init (&side_msg)
-- # assert (rc == 0)
--
--
-- cdef zmq_pollitem_t items [2]
-- items [0].socket = insocket_
-- items [0].fd = 0
-- items [0].events = ZMQ_POLLIN
-- items [0].revents = 0
-- items [1].socket = outsocket_
-- items [1].fd = 0
-- items [1].events = ZMQ_POLLIN
-- items [1].revents = 0
-- # I don't think sidesocket should be polled?
-- # items [2].socket = sidesocket_
-- # items [2].fd = 0
-- # items [2].events = ZMQ_POLLIN
-- # items [2].revents = 0
--
-- while (True):
--
-- # // Wait while there are either requests or replies to process.
-- rc = zmq_poll (&items [0], 2, -1)
-- if rc < 0:
-- return rc
-- # // The algorithm below asumes ratio of request and replies processed
-- # // under full load to be 1:1. Although processing requests replies
-- # // first is tempting it is suspectible to DoS attacks (overloading
-- # // the system with unsolicited replies).
-- #
-- # // Process a request.
-- if (items [0].revents & ZMQ_POLLIN):
-- # send in_prefix to side socket
-- rc = zmq_msg_copy(&side_msg, in_msg_ptr)
-- rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
-- if rc < 0:
-- return rc
-- # relay the rest of the message
-- rc = _relay(insocket_, outsocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
-- if rc < 0:
-- return rc
-- if (items [1].revents & ZMQ_POLLIN):
-- # send out_prefix to side socket
-- rc = zmq_msg_copy(&side_msg, out_msg_ptr)
-- rc = zmq_msg_send(&side_msg, sidesocket_, ZMQ_SNDMORE)
-- if rc < 0:
-- return rc
-- # relay the rest of the message
-- rc = _relay(outsocket_, insocket_, sidesocket_, msg, side_msg, id_msg, swap_ids)
-- if rc < 0:
-- return rc
-- return 0
-diff --git a/zmq/devices/monitoredqueue.pyx b/zmq/devices/monitoredqueue.pyx
-deleted file mode 100644
---- a/zmq/devices/monitoredqueue.pyx
-+++ /dev/null
-@@ -1,108 +0,0 @@
--"""MonitoredQueue classes and functions.
--
--Authors
---------
--* MinRK
--* Brian Granger
--"""
--
--#-----------------------------------------------------------------------------
--# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
--#
--# This file is part of pyzmq
--#
--# Distributed under the terms of the New BSD License. The full license is in
--# the file COPYING.BSD, distributed as part of this software.
--#-----------------------------------------------------------------------------
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--cdef extern from "Python.h":
-- ctypedef int Py_ssize_t
--
--from libc.string cimport memcpy
--
--from buffers cimport asbuffer_r
--from libzmq cimport *
--
--from zmq.core.socket cimport Socket
--from zmq.core.checkrc cimport _check_rc
--
--from zmq import ROUTER, ZMQError
--
--#-----------------------------------------------------------------------------
--# MonitoredQueue functions
--#-----------------------------------------------------------------------------
--
--
--def monitored_queue(Socket in_socket, Socket out_socket, Socket mon_socket,
-- bytes in_prefix=b'in', bytes out_prefix=b'out'):
-- """monitored_queue(in_socket, out_socket, mon_socket,
-- in_prefix='in', out_prefix='out')
--
-- Start a monitored queue device.
--
-- A monitored queue behaves just like a zmq QUEUE device as far as in_socket
-- and out_socket are concerned, except that all messages *also* go out on
-- mon_socket. mon_socket also prefixes the messages coming from each with a
-- prefix, by default 'in' and 'out', so all messages sent by mon_socket are
-- multipart.
--
-- The only difference between this and a QUEUE as far as in/out are
-- concerned is that it works with two ROUTER sockets by swapping the IDENT
-- prefixes.
--
-- Parameters
-- ----------
-- in_socket : Socket
-- One of the sockets to the Queue. Its messages will be prefixed with
-- 'in'.
-- out_socket : Socket
-- One of the sockets to the Queue. Its messages will be prefixed with
-- 'out'. The only difference between in/out socket is this prefix.
-- mon_socket : Socket
-- This socket sends out every message received by each of the others
-- with an in/out prefix specifying which one it was.
-- in_prefix : str
-- Prefix added to broadcast messages from in_socket.
-- out_prefix : str
-- Prefix added to broadcast messages from out_socket.
-- """
--
-- cdef void *ins=in_socket.handle
-- cdef void *outs=out_socket.handle
-- cdef void *mons=mon_socket.handle
-- cdef zmq_msg_t in_msg
-- cdef zmq_msg_t out_msg
-- cdef bint swap_ids
-- cdef char *msg_c = NULL
-- cdef Py_ssize_t msg_c_len
-- cdef int rc
--
-- # force swap_ids if both ROUTERs
-- swap_ids = (in_socket.socket_type == ROUTER and
-- out_socket.socket_type == ROUTER)
--
-- # build zmq_msg objects from str prefixes
-- asbuffer_r(in_prefix, <void **>&msg_c, &msg_c_len)
-- with nogil:
-- rc = zmq_msg_init_size(&in_msg, msg_c_len)
-- _check_rc(rc)
--
-- with nogil:
-- memcpy(zmq_msg_data(&in_msg), msg_c, zmq_msg_size(&in_msg))
--
-- asbuffer_r(out_prefix, <void **>&msg_c, &msg_c_len)
--
-- with nogil:
-- rc = zmq_msg_init_size(&out_msg, msg_c_len)
-- _check_rc(rc)
--
-- with nogil:
-- memcpy(zmq_msg_data(&out_msg), msg_c, zmq_msg_size(&out_msg))
-- rc = c_monitored_queue(ins, outs, mons, &in_msg, &out_msg, swap_ids)
-- return rc
--
--__all__ = ['monitored_queue']
-diff --git a/zmq/devices/monitoredqueuedevice.py b/zmq/devices/monitoredqueuedevice.py
---- a/zmq/devices/monitoredqueuedevice.py
-+++ b/zmq/devices/monitoredqueuedevice.py
-@@ -24,7 +24,7 @@ import time
-
- from zmq import ZMQError, PUB
- from zmq.devices.proxydevice import ProxyBase, Proxy, ThreadProxy, ProcessProxy
--from zmq.devices.monitoredqueue import monitored_queue
-+from zmq.devices._zmonitoredqueue import monitored_queue
-
- #-----------------------------------------------------------------------------
- # Classes
-diff --git a/zmq/sugar/backend.py b/zmq/sugar/backend.py
---- a/zmq/sugar/backend.py
-+++ b/zmq/sugar/backend.py
-@@ -23,8 +23,9 @@ try:
- strerror, zmq_errno,
- zmq_poll,
- zmq_version_info,
-- constants,
-+ _zconstants,
- )
-+ constants = _zconstants
- except ImportError:
- from zmq.cffi_core import (
- Context,
-diff --git a/zmq/sugar/context.py b/zmq/sugar/context.py
---- a/zmq/sugar/context.py
-+++ b/zmq/sugar/context.py
-@@ -128,4 +128,4 @@ class Context(ContextBase, AttributeSetter):
- else:
- del self.sockopts[opt]
-
--__all__ = ['Context']
-\ No newline at end of file
-+__all__ = ['Context']
-diff --git a/zmq/utils/_zinitthreads.pyx b/zmq/utils/_zinitthreads.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/utils/_zinitthreads.pyx
-@@ -0,0 +1,23 @@
-+"""Utility to initialize threads."""
-+
-+#-----------------------------------------------------------------------------
-+# Copyright (c) 2010 Brian Granger, Min Ragan-Kelley
-+#
-+# Distributed under the terms of the New BSD License. The full license is in
-+# the file COPYING.BSD, distributed as part of this software.
-+#-----------------------------------------------------------------------------
-+
-+#-----------------------------------------------------------------------------
-+# Imports
-+#-----------------------------------------------------------------------------
-+
-+cdef extern from "Python.h":
-+ cdef void PyEval_InitThreads()
-+
-+# It seems that in only *some* version of Python/Cython we need to call this
-+# by hand to get threads initialized. Not clear why this is the case though.
-+# If we don't have this, pyzmq will segfault.
-+def init_threads():
-+ PyEval_InitThreads()
-+
-+__all__ = ['init_threads']
-diff --git a/zmq/utils/_zrebuffer.pyx b/zmq/utils/_zrebuffer.pyx
-new file mode 100644
---- /dev/null
-+++ b/zmq/utils/_zrebuffer.pyx
-@@ -0,0 +1,104 @@
-+"""
-+Utility for changing itemsize of memoryviews, and getting
-+numpy arrays from byte-arrays that should be interpreted with a different
-+itemsize.
-+
-+Authors
-+-------
-+* MinRK
-+"""
-+
-+#-----------------------------------------------------------------------------
-+# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
-+#
-+# This file is part of pyzmq
-+#
-+# Distributed under the terms of the New BSD License. The full license is in
-+# the file COPYING.BSD, distributed as part of this software.
-+#-----------------------------------------------------------------------------
-+
-+from libc.stdlib cimport malloc
-+from buffers cimport *
-+
-+cdef inline object _rebuffer(object obj, char * format, int itemsize):
-+ """clobber the format & itemsize of a 1-D
-+
-+ This is the Python 3 model, but will work on Python >= 2.6. Currently,
-+ we use it only on >= 3.0.
-+ """
-+ cdef Py_buffer view
-+ cdef int flags = PyBUF_SIMPLE
-+ cdef int mode = 0
-+ # cdef Py_ssize_t *shape, *strides, *suboffsets
-+
-+ mode = check_buffer(obj)
-+ if mode == 0:
-+ raise TypeError("%r does not provide a buffer interface."%obj)
-+
-+ if mode == 3:
-+ flags = PyBUF_ANY_CONTIGUOUS
-+ if format:
-+ flags |= PyBUF_FORMAT
-+ PyObject_GetBuffer(obj, &view, flags)
-+ assert view.ndim <= 1, "Can only reinterpret 1-D memoryviews"
-+ assert view.len % itemsize == 0, "Buffer of length %i not divisible into items of size %i"%(view.len, itemsize)
-+ # hack the format
-+ view.ndim = 1
-+ view.format = format
-+ view.itemsize = itemsize
-+ view.strides = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
-+ view.strides[0] = itemsize
-+ view.shape = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
-+ view.shape[0] = view.len/itemsize
-+ view.suboffsets = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
-+ view.suboffsets[0] = 0
-+ # for debug: make buffer writable, for zero-copy testing
-+ # view.readonly = 0
-+
-+ return PyMemoryView_FromBuffer(&view)
-+ else:
-+ raise TypeError("This funciton is only for new-style buffer objects.")
-+
-+def rebuffer(obj, format, itemsize):
-+ """Change the itemsize of a memoryview.
-+
-+ Only for 1D contiguous buffers.
-+ """
-+ return _rebuffer(obj, format, itemsize)
-+
-+def array_from_buffer(view, dtype, shape):
-+ """Get a numpy array from a memoryview, regardless of the itemsize of the original
-+ memoryview. This is important, because pyzmq does not send memoryview shape data
-+ over the wire, so we need to change the memoryview itemsize before calling
-+ asarray.
-+ """
-+ import numpy
-+ A = numpy.array([],dtype=dtype)
-+ ref = viewfromobject(A,0)
-+ fmt = ref.format.encode()
-+ buf = viewfromobject(view, 0)
-+ buf = _rebuffer(view, fmt, ref.itemsize)
-+ return numpy.asarray(buf, dtype=dtype).reshape(shape)
-+
-+def print_view_info(obj):
-+ """simple utility for printing info on a new-style buffer object"""
-+ cdef Py_buffer view
-+ cdef int flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT
-+ cdef int mode = 0
-+
-+ mode = check_buffer(obj)
-+ if mode == 0:
-+ raise TypeError("%r does not provide a buffer interface."%obj)
-+
-+ if mode == 3:
-+ PyObject_GetBuffer(obj, &view, flags)
-+ print <Py_ssize_t>view.buf, view.len, view.format, view.ndim,
-+ if view.ndim:
-+ if view.shape:
-+ print view.shape[0],
-+ if view.strides:
-+ print view.strides[0],
-+ if view.suboffsets:
-+ print view.suboffsets[0],
-+ print
-+
-\ No newline at end of file
-diff --git a/zmq/utils/initthreads.pyx b/zmq/utils/initthreads.pyx
-deleted file mode 100644
---- a/zmq/utils/initthreads.pyx
-+++ /dev/null
-@@ -1,23 +0,0 @@
--"""Utility to initialize threads."""
--
--#-----------------------------------------------------------------------------
--# Copyright (c) 2010 Brian Granger, Min Ragan-Kelley
--#
--# Distributed under the terms of the New BSD License. The full license is in
--# the file COPYING.BSD, distributed as part of this software.
--#-----------------------------------------------------------------------------
--
--#-----------------------------------------------------------------------------
--# Imports
--#-----------------------------------------------------------------------------
--
--cdef extern from "Python.h":
-- cdef void PyEval_InitThreads()
--
--# It seems that in only *some* version of Python/Cython we need to call this
--# by hand to get threads initialized. Not clear why this is the case though.
--# If we don't have this, pyzmq will segfault.
--def init_threads():
-- PyEval_InitThreads()
--
--__all__ = ['init_threads']
-diff --git a/zmq/utils/rebuffer.pyx b/zmq/utils/rebuffer.pyx
-deleted file mode 100644
---- a/zmq/utils/rebuffer.pyx
-+++ /dev/null
-@@ -1,104 +0,0 @@
--"""
--Utility for changing itemsize of memoryviews, and getting
--numpy arrays from byte-arrays that should be interpreted with a different
--itemsize.
--
--Authors
---------
--* MinRK
--"""
--
--#-----------------------------------------------------------------------------
--# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
--#
--# This file is part of pyzmq
--#
--# Distributed under the terms of the New BSD License. The full license is in
--# the file COPYING.BSD, distributed as part of this software.
--#-----------------------------------------------------------------------------
--
--from libc.stdlib cimport malloc
--from buffers cimport *
--
--cdef inline object _rebuffer(object obj, char * format, int itemsize):
-- """clobber the format & itemsize of a 1-D
--
-- This is the Python 3 model, but will work on Python >= 2.6. Currently,
-- we use it only on >= 3.0.
-- """
-- cdef Py_buffer view
-- cdef int flags = PyBUF_SIMPLE
-- cdef int mode = 0
-- # cdef Py_ssize_t *shape, *strides, *suboffsets
--
-- mode = check_buffer(obj)
-- if mode == 0:
-- raise TypeError("%r does not provide a buffer interface."%obj)
--
-- if mode == 3:
-- flags = PyBUF_ANY_CONTIGUOUS
-- if format:
-- flags |= PyBUF_FORMAT
-- PyObject_GetBuffer(obj, &view, flags)
-- assert view.ndim <= 1, "Can only reinterpret 1-D memoryviews"
-- assert view.len % itemsize == 0, "Buffer of length %i not divisible into items of size %i"%(view.len, itemsize)
-- # hack the format
-- view.ndim = 1
-- view.format = format
-- view.itemsize = itemsize
-- view.strides = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
-- view.strides[0] = itemsize
-- view.shape = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
-- view.shape[0] = view.len/itemsize
-- view.suboffsets = <Py_ssize_t *>malloc(sizeof(Py_ssize_t))
-- view.suboffsets[0] = 0
-- # for debug: make buffer writable, for zero-copy testing
-- # view.readonly = 0
--
-- return PyMemoryView_FromBuffer(&view)
-- else:
-- raise TypeError("This funciton is only for new-style buffer objects.")
--
--def rebuffer(obj, format, itemsize):
-- """Change the itemsize of a memoryview.
--
-- Only for 1D contiguous buffers.
-- """
-- return _rebuffer(obj, format, itemsize)
--
--def array_from_buffer(view, dtype, shape):
-- """Get a numpy array from a memoryview, regardless of the itemsize of the original
-- memoryview. This is important, because pyzmq does not send memoryview shape data
-- over the wire, so we need to change the memoryview itemsize before calling
-- asarray.
-- """
-- import numpy
-- A = numpy.array([],dtype=dtype)
-- ref = viewfromobject(A,0)
-- fmt = ref.format.encode()
-- buf = viewfromobject(view, 0)
-- buf = _rebuffer(view, fmt, ref.itemsize)
-- return numpy.asarray(buf, dtype=dtype).reshape(shape)
--
--def print_view_info(obj):
-- """simple utility for printing info on a new-style buffer object"""
-- cdef Py_buffer view
-- cdef int flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT
-- cdef int mode = 0
--
-- mode = check_buffer(obj)
-- if mode == 0:
-- raise TypeError("%r does not provide a buffer interface."%obj)
--
-- if mode == 3:
-- PyObject_GetBuffer(obj, &view, flags)
-- print <Py_ssize_t>view.buf, view.len, view.format, view.ndim,
-- if view.ndim:
-- if view.shape:
-- print view.shape[0],
-- if view.strides:
-- print view.strides[0],
-- if view.suboffsets:
-- print view.suboffsets[0],
-- print
--
-\ No newline at end of file
diff --git a/ports/python_modules/pyzmq/pkg_info b/ports/python_modules/pyzmq/pkg_info
deleted file mode 100644
index f2e7457..0000000
--- a/ports/python_modules/pyzmq/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=pyzmq
-VERSION=13.1.0
-URL=https://pypi.python.org/packages/source/p/pyzmq/pyzmq-13.1.0.tar.gz
-LICENSE=LGPL+BSD
-DEPENDS=(python-host cython zeromq)
-SHA1=775fcff7777d220f06f5ff9e531822d63a5671c0
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/requests/build.sh b/ports/python_modules/requests/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/requests/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/requests/pkg_info b/ports/python_modules/requests/pkg_info
deleted file mode 100644
index a5dacfd..0000000
--- a/ports/python_modules/requests/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=requests
-VERSION=2.3.0
-URL=https://pypi.python.org/packages/source/r/requests/requests-2.3.0.tar.gz
-LICENSE=Apache
-DEPENDS=(python-host openssl)
-SHA1=f57bc125d35ec01a81afe89f97dc75913a927e65
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/setuptools/build.sh b/ports/python_modules/setuptools/build.sh
deleted file mode 100644
index ae7ca83..0000000
--- a/ports/python_modules/setuptools/build.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- ChangeDir ${SRC_DIR}
- # No destination installation
- LogExecute rm -rf build dist
- export NACL_PORT_BUILD=host
- # Force 32 bits here for Py_ssize_t correctness.
- export CC="gcc -m32"
- export CXX="g++ -m32"
- export LD="gcc -m32"
- LogExecute ${NACL_HOST_PYTHON} setup.py install --prefix=${NACL_HOST_PYROOT}
-}
-
-InstallStep() {
- return
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/setuptools/pkg_info b/ports/python_modules/setuptools/pkg_info
deleted file mode 100644
index f21a314..0000000
--- a/ports/python_modules/setuptools/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=setuptools
-VERSION=2.0.1
-URL=https://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.1.tar.gz
-LICENSE=CUSTOM:LICENSE
-DEPENDS=(python-host)
-SHA1=5283b4dca46d45efd1156713ab51836509646c03
diff --git a/ports/python_modules/six/build.sh b/ports/python_modules/six/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/six/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/six/pkg_info b/ports/python_modules/six/pkg_info
deleted file mode 100644
index 59eabad..0000000
--- a/ports/python_modules/six/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=six
-VERSION=1.5.2
-URL=https://pypi.python.org/packages/source/s/six/six-1.5.2.tar.gz
-LICENSE=MIT
-DEPENDS=(python-host setuptools)
-SHA1=90128862139a79d10cf213b3baad9c6e2f72fc78
diff --git a/ports/python_modules/sympy/build.sh b/ports/python_modules/sympy/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/sympy/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/sympy/pkg_info b/ports/python_modules/sympy/pkg_info
deleted file mode 100644
index 3d7b74e..0000000
--- a/ports/python_modules/sympy/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=sympy
-VERSION=0.7.4.1
-URL=https://github.com/sympy/sympy/releases/download/sympy-0.7.4.1/sympy-0.7.4.1.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host)
-SHA1=073b2ddf7ee8bc2b9e3687660d59e8848d6fce6c
diff --git a/ports/python_modules/thingking/build.sh b/ports/python_modules/thingking/build.sh
deleted file mode 100644
index cb46ec0..0000000
--- a/ports/python_modules/thingking/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/thingking/nacl.patch b/ports/python_modules/thingking/nacl.patch
deleted file mode 100644
index 5a8a095..0000000
--- a/ports/python_modules/thingking/nacl.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-diff --git a/setup.py b/setup.py
---- a/setup.py
-+++ b/setup.py
-@@ -15,5 +15,5 @@ setup(name='thingking',
- author='Matthew Turk <matthewturk@gmail.com>, Samuel Skillman <samskillman@gmail.com>, Michael S. Warren <mswarren@gmail.com>',
- license='BSD',
- packages=find_packages(),
-- install_requires=["requests", "numpy", "functools32"],
-+ install_requires=["requests", "numpy"],
- )
diff --git a/ports/python_modules/thingking/pkg_info b/ports/python_modules/thingking/pkg_info
deleted file mode 100644
index d304d65..0000000
--- a/ports/python_modules/thingking/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=thingking
-VERSION=1.0.2
-URL=https://pypi.python.org/packages/source/t/thingking/thingking-1.0.2.tar.gz
-LICENSE=BSD
-DEPENDS=(python-host requests yt)
-SHA1=137a38bcf50354788b04d1497166622206aee125
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/python_modules/yt/build.sh b/ports/python_modules/yt/build.sh
deleted file mode 100644
index 219c1ee..0000000
--- a/ports/python_modules/yt/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- export PNG_DIR=${NACL_DEST_PYROOT}
- DefaultPythonModuleBuildStep
-}
-
-InstallStep() {
- DefaultPythonModuleInstallStep
-}
-
-ConfigureStep() {
- return
-}
diff --git a/ports/python_modules/yt/modules.list b/ports/python_modules/yt/modules.list
deleted file mode 100644
index a8d563b..0000000
--- a/ports/python_modules/yt/modules.list
+++ /dev/null
@@ -1,34 +0,0 @@
-_MPL
-EnzoFOF
-EnzoHop
-data_point_utilities
-RayIntegrators
-geometry_utils
-DepthFirstOctree
-ContourFinding
-alt_ray_tracers
-misc_utilities
-CICDeposit
-amr_kdtools
-GridTree
-QuadTree
-marching_cubes
-fortran_reader
-grid_traversal
-Octree
-mesh_utilities
-Interpolators
-write_array
-PointsInVolume
-ckdtree
-_distance_wrap
-smoothing_kernel
-_artio_caller
-oct_container
-fake_octree
-particle_deposit
-particle_smooth
-oct_visitors
-selection_routines
-particle_oct_container
-image_utilities
diff --git a/ports/python_modules/yt/pkg_info b/ports/python_modules/yt/pkg_info
deleted file mode 100644
index 51b86a7..0000000
--- a/ports/python_modules/yt/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=yt
-VERSION=3.0
-URL=https://pypi.python.org/packages/source/y/yt/yt-3.0.tar.gz
-LICENSE=BSD
-BUILD_OS=linux
-DEPENDS=(python-host cython h5py matplotlib numpy setuptools sympy)
-SHA1=fbbc92d17947a841f18c554975eb777cb95c4670
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/quakespasm/README.nacl b/ports/quakespasm/README.nacl
deleted file mode 100644
index 616da4d..0000000
--- a/ports/quakespasm/README.nacl
+++ /dev/null
@@ -1,13 +0,0 @@
-quakespasm for Native Client
-============================
-
-This port of quake is based on SDL and OpenGL. By utilising
-the SDL port to NaCl and Regal for OpenGL support these are
-almost no changes needed to build this game for Native Client.
-
-To run this you need to extract a set of data files into the
-directory alongside the executable. The simplest way to get
-acquire a data set is to download the shareware episode from
-libsdl.org::
-
- http://www.libsdl.org/projects/quake/data/quakesw-1.0.6.zip
diff --git a/ports/quakespasm/build.sh b/ports/quakespasm/build.sh
deleted file mode 100644
index 81ae328..0000000
--- a/ports/quakespasm/build.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (c) 2013 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.
-
-BUILD_DIR=${SRC_DIR}/Quake
-EXECUTABLES=quakespasm${NACL_EXEEXT}
-MAKE_TARGETS="MP3LIB=mpg123"
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- make clean
- if [ "${NACL_DEBUG}" = "1" ]; then
- MAKE_TARGETS+=" DEBUG=1"
- fi
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-InstallStep() {
- MakeDir ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/index.html ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/quakespasm.js ${PUBLISH_DIR}
- LogExecute cp ${NACL_SRC}/third_party/zip.js/WebContent/*.js ${PUBLISH_DIR}
- LogExecute cp ${BUILD_DIR}/quakespasm${NACL_EXEEXT} \
- ${PUBLISH_DIR}/quakespasm_${NACL_ARCH}${NACL_EXEEXT}
- ChangeDir ${PUBLISH_DIR}
- LogExecute ${NACL_SDK_ROOT}/tools/create_nmf.py -s . \
- quakespasm*${NACL_EXEEXT} -o quakespasm.nmf
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- sed -i.bak 's/x-nacl/x-pnacl/' quakespasm.js
- fi
-}
diff --git a/ports/quakespasm/index.html b/ports/quakespasm/index.html
deleted file mode 100644
index 365e38c..0000000
--- a/ports/quakespasm/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
- <!--
- Copyright (c) 2014 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.
- -->
- <head>
- <title>Quakespasm</title>
- <script type="text/javascript" src="zip.js"></script>
- <script type="text/javascript" src="zip-fs.js"></script>
- <script type="text/javascript" src="zip-ext.js"></script>
- <script type="text/javascript" src="quakespasm.js"></script>
- </head>
- <body>
- <h1>Quakespasm</h1>
- <p id="status"></p>
- <div id="quake" />
- <br />
- </body>
-</html>
diff --git a/ports/quakespasm/nacl.patch b/ports/quakespasm/nacl.patch
deleted file mode 100644
index 26aea5f..0000000
--- a/ports/quakespasm/nacl.patch
+++ /dev/null
@@ -1,238 +0,0 @@
-diff --git a/Quake/Makefile b/Quake/Makefile
---- a/Quake/Makefile
-+++ b/Quake/Makefile
-@@ -14,7 +14,7 @@ USE_CODEC_MP3=1
- USE_CODEC_VORBIS=1
-
- # which library to use for mp3 decoding: mad or mpg123
--MP3LIB=mad
-+MP3LIB=mpg123
- # which library to use for ogg decoding: vorbis or tremor
- VORBISLIB=vorbis
-
-@@ -45,11 +45,19 @@ STRIP ?= strip
- #CPUFLAGS= -mtune=k8
- #CPUFLAGS= -march=atom
- CPUFLAGS=
--LDFLAGS =
-+LDFLAGS ?=
- DFLAGS ?=
--CFLAGS ?= -Wall -Wno-trigraphs
-+CFLAGS ?= -Wall
-+CFLAGS += -Wno-unused-result -Wno-trigraphs
-+CFLAGS += -DREGAL_NO_ENUM_GL_EXT_TEXTURE_FILTER_ANISOTROPIC
- CFLAGS += $(CPUFLAGS)
-
-+ifneq ($(V),1)
-+RUN_CC = @echo " CC " $@;
-+RUN_CCLD = @echo " CCLD " $@;
-+RUN_STRIP = @echo " STRIP " $@;
-+endif
-+
- ifneq ($(DEBUG),0)
- DFLAGS += -DDEBUG
- CFLAGS += -g
-@@ -59,7 +67,7 @@ DFLAGS += -DNDEBUG
- CFLAGS += -O2
- CFLAGS += $(call check_gcc,-fweb,)
- CFLAGS += $(call check_gcc,-frename-registers,)
--cmd_strip=$(STRIP) $(1)
-+cmd_strip=$(RUN_STRIP)$(STRIP) $(1)
- define do_strip
- $(call cmd_strip,$(1));
- endef
-@@ -81,8 +89,8 @@ X11BASE_GUESS := $(shell \
- X11BASE ?= $(X11BASE_GUESS)
-
- ifneq ($(X11BASE),)
--LDFLAGS+= -L$(X11BASE)/lib
--CFLAGS += -I$(X11BASE)/include
-+LDFLAGS += -L$(X11BASE)/lib
-+CPPFLAGS += -I$(X11BASE)/include
- endif
-
- SDL_CONFIG ?= sdl-config
-@@ -91,7 +99,7 @@ SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
-
- ifeq ($(SDLNET),1)
- NET_LIBS :=-lSDL_net
--CFLAGS +=-D_USE_SDLNET
-+CPPFLAGS +=-D_USE_SDLNET
- else
- ifeq ($(HOST_OS),sunos)
- NET_LIBS :=-lsocket -lnsl -lresolv
-@@ -101,7 +109,7 @@ endif
- endif
-
- ifeq ($(USE_QS_CONBACK),1)
--CFLAGS+= -DUSE_QS_CONBACK
-+CPPFLAGS += -DUSE_QS_CONBACK
- endif
-
- ifneq ($(VORBISLIB),vorbis)
-@@ -133,18 +141,21 @@ endif
-
- CODECLIBS :=
- ifeq ($(USE_CODEC_WAVE),1)
--CFLAGS+= -DUSE_CODEC_WAVE
-+CPPFLAGS += -DUSE_CODEC_WAVE
- endif
- ifeq ($(USE_CODEC_VORBIS),1)
--CFLAGS+= -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
-+CPPFLAGS += -DUSE_CODEC_VORBIS $(cpp_vorbisdec)
- CODECLIBS+= $(lib_vorbisdec)
- endif
- ifeq ($(USE_CODEC_MP3),1)
--CFLAGS+= -DUSE_CODEC_MP3
-+CPPFLAGS+= -DUSE_CODEC_MP3
- CODECLIBS+= $(lib_mp3dec)
- endif
-
--COMMON_LIBS:= -lm -lGL
-+COMMON_LIBS := -lm
-+ifndef NACL_ARCH
-+COMMON_LIBS += -lGL
-+endif
-
- LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
-
-@@ -154,14 +165,14 @@ LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
-
- .PHONY: clean debug release
-
--DEFAULT_TARGET := quakespasm
-+DEFAULT_TARGET := quakespasm$(EXEEXT)
-
- # ---------------------------
- # rules
- # ---------------------------
-
- %.o: %.c
-- $(CC) $(DFLAGS) -c $(CFLAGS) $(SDL_CFLAGS) -o $@ $^
-+ $(RUN_CC)$(CC) $(DFLAGS) -c $(CPPFLAGS) $(CFLAGS) $(SDL_CFLAGS) -o $@ $^
-
- # ----------------------------------------------------------------------------
- # objects
-@@ -254,11 +265,11 @@ OBJS := strlcat.o \
- # Linux build rules
- # ------------------------
-
--quakespasm: $(OBJS)
-- $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@
-+quakespasm$(EXEEXT): $(OBJS)
-+ $(RUN_CCLD)$(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@
- $(call do_strip,$@)
-
--release: quakespasm
-+release: quakespasm$(EXEEXT)
- debug:
- $(error Use "make DEBUG=1")
-
-diff --git a/Quake/arch_def.h b/Quake/arch_def.h
---- a/Quake/arch_def.h
-+++ b/Quake/arch_def.h
-@@ -77,6 +77,7 @@
- defined(__sun) || defined(sun) || \
- defined(__sgi) || defined(sgi) || defined(__sgi__) || \
- defined(__GNU__) /* GNU/Hurd */ || \
-+ defined(__native_client__) || \
- defined(__QNX__) || defined(__QNXNTO__)
- # if !defined(PLATFORM_UNIX)
- # define PLATFORM_UNIX 1
-@@ -108,6 +109,8 @@
- # define PLATFORM_STRING "Windows"
- #elif defined(PLATFORM_DOS)
- # define PLATFORM_STRING "DOS"
-+#elif defined(__native_client__)
-+# define PLATFORM_STRING "NaCl"
- #elif defined(__linux__) || defined(__linux)
- # define PLATFORM_STRING "Linux"
- #elif defined(__DragonFly__)
-diff --git a/Quake/net_udp.c b/Quake/net_udp.c
---- a/Quake/net_udp.c
-+++ b/Quake/net_udp.c
-@@ -132,7 +132,9 @@ sys_socket_t UDP_OpenSocket (int port)
- {
- sys_socket_t newsocket;
- struct sockaddr_in address;
-+#ifdef FIONBIO
- int _true = 1;
-+#endif
- int err;
-
- if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)
-@@ -142,8 +144,10 @@ sys_socket_t UDP_OpenSocket (int port)
- return INVALID_SOCKET;
- }
-
-+#ifdef FIONBIO
- if (ioctlsocket (newsocket, FIONBIO, &_true) == SOCKET_ERROR)
- goto ErrorReturn;
-+#endif
-
- memset(&address, 0, sizeof(struct sockaddr_in));
- address.sin_family = AF_INET;
-@@ -152,7 +156,9 @@ sys_socket_t UDP_OpenSocket (int port)
- if (bind (newsocket, (struct sockaddr *)&address, sizeof(address)) == 0)
- return newsocket;
-
-+#ifdef FIONBIO
- ErrorReturn:
-+#endif
- err = SOCKETERRNO;
- Con_SafePrintf("UDP_OpenSocket: %s\n", socketerror(err));
- UDP_CloseSocket (newsocket);
-@@ -235,7 +241,9 @@ int UDP_Connect (sys_socket_t socketid, struct qsockaddr *addr)
-
- sys_socket_t UDP_CheckNewConnections (void)
- {
-+#ifdef FIONREAD
- int available;
-+#endif
- struct sockaddr_in from;
- socklen_t fromlen;
- char buff[1];
-@@ -243,6 +251,7 @@ sys_socket_t UDP_CheckNewConnections (void)
- if (net_acceptsocket == INVALID_SOCKET)
- return INVALID_SOCKET;
-
-+#ifdef FIONREAD
- if (ioctl (net_acceptsocket, FIONREAD, &available) == -1)
- {
- int err = SOCKETERRNO;
-@@ -250,6 +259,8 @@ sys_socket_t UDP_CheckNewConnections (void)
- }
- if (available)
- return net_acceptsocket;
-+#endif
-+
- // quietly absorb empty packets
- recvfrom (net_acceptsocket, buff, 0, 0, (struct sockaddr *) &from, &fromlen);
- return INVALID_SOCKET;
-@@ -382,6 +393,7 @@ int UDP_GetSocketAddr (sys_socket_t socketid, struct qsockaddr *addr)
-
- int UDP_GetNameFromAddr (struct qsockaddr *addr, char *name)
- {
-+#ifndef __native_client__
- struct hostent *hostentry;
-
- hostentry = gethostbyaddr ((char *)&((struct sockaddr_in *)addr)->sin_addr,
-@@ -391,6 +403,7 @@ int UDP_GetNameFromAddr (struct qsockaddr *addr, char *name)
- strncpy (name, (char *)hostentry->h_name, NET_NAMELEN - 1);
- return 0;
- }
-+#endif
-
- strcpy (name, UDP_AddrToString (addr));
- return 0;
-diff --git a/Quake/sys_sdl_unix.c b/Quake/sys_sdl_unix.c
---- a/Quake/sys_sdl_unix.c
-+++ b/Quake/sys_sdl_unix.c
-@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #include <unistd.h>
- #include <sys/stat.h>
- #include <sys/time.h>
-+#include <sys/select.h>
- #include <fcntl.h>
- #include <time.h>
-
diff --git a/ports/quakespasm/pkg_info b/ports/quakespasm/pkg_info
deleted file mode 100644
index 1386778..0000000
--- a/ports/quakespasm/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=quakespasm
-VERSION=0.85.9
-DEPENDS=(sdl libvorbis mpg123)
-LICENSE=GPL
-URL=http://downloads.sf.net/project/quakespasm/Source/quakespasm-0.85.9.tgz
-SHA1=d9f6278e2badb7be11830539e4d8bb16ef90e287
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/quakespasm/quakespasm.js b/ports/quakespasm/quakespasm.js
deleted file mode 100644
index 12817e6..0000000
--- a/ports/quakespasm/quakespasm.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-/* globals zip */
-
-'use strict';
-
-var PAK_FILE = 'id1/pak0.pak';
-
-function updateStatus(message) {
- document.getElementById('status').innerHTML += message + '<br />';
-}
-
-/*
- * Creates and add to the DOM the NaCl embed tag which
- * in effect launches Quake.
- */
-function runQuake(pwd) {
- var embed = document.createElement('embed');
- embed.width = 800;
- embed.height = 600;
- embed.type = 'application/x-nacl';
- embed.src = 'quakespasm.nmf';
- if (pwd) {
- embed.setAttribute('PWD', pwd);
- }
- document.getElementById('quake').appendChild(embed);
-}
-
-function extractNextEntry(entries, i, filesystem, oncomplete) {
- if (i === entries.length) {
- oncomplete();
- return;
- }
-
- var entry = entries[i];
- if (entry.directory) {
- filesystem.root.getDirectory(entry.filename, { create : true },
- function() {
- extractNextEntry(entries, i + 1, filesystem, oncomplete);
- }
- );
- return;
- }
-
- filesystem.root.getFile(entry.filename, { create : true },
- function(fileEntry) {
- var writer = new zip.FileWriter(fileEntry);
- entry.getData(writer,
- function() {
- extractNextEntry(entries, i + 1, filesystem, oncomplete);
- });
- },
- function(error) {
- updateStatus('error creating temp file: ' + error);
- }
- );
-}
-
-function extractZipFile(file, filesystem, oncomplete) {
- updateStatus('Extracting file: ' + file.name);
- zip.createReader(new zip.BlobReader(file),
- function(zipReader) {
- zipReader.getEntries(function(entries) {
- extractNextEntry(entries, 0, filesystem, oncomplete);
- });
- },
- function() {
- updateStatus('Error reading zip file');
- }
- );
-}
-
-function uploadDidChange(event) {
- function oncomplete() {
- // Once we have extracted all the files then
- // launch the game.
- updateStatus("Extracted all file. Launching Quake.");
- runQuake('/tmp');
- }
-
- window.webkitRequestFileSystem(window.TEMPORARY, 50 * 1024 * 1024,
- function(fs) {
- var file = event.target.files[0];
- extractZipFile(file, fs, oncomplete);
- },
- function() {
- updateStatus('Error accessing html5 filesystem.');
- }
- );
-}
-
-function loadFromLocalStorage() {
- function loadFailure() {
- updateStatus('Quake data not found in local html5 filesystem.');
- updateStatus('Please locate a quake level set (for example the ' +
- '<a href="http://www.libsdl.org/projects/quake/data/quakesw-1.0.6.zip">' +
- 'shareware levels</a>) and either extract them alongside the nmf file,' +
- ' or use the upload button below to unzip them in the local html5' +
- ' filesystem.');
- // Create an html5 file input elemnt in so the user can upload the game
- // data as a zip file.
- document.getElementById('quake').innerHTML =
- '<input type="file" accept="application/zip" id="infile">';
- document.getElementById('infile').addEventListener('change',
- uploadDidChange,
- false);
- }
-
- function loadSuccess() {
- updateStatus('Found pak file in local storage. Launching quake.');
- runQuake('/tmp');
- }
-
- window.webkitRequestFileSystem(window.TEMPORARY, 3 * 1024 * 1024,
- function(fs) {
- fs.root.getFile(PAK_FILE, {}, loadSuccess, loadFailure);
- }
- );
-}
-
-function onLoad() {
- updateStatus('Searching for Quake data (' + PAK_FILE + ')');
- var req = new XMLHttpRequest();
- req.onload = function() {
- if (this.status === 200) {
- updateStatus('Found ' + PAK_FILE + '. Launching quake.');
- runQuake();
- } else {
- // Failed to find PAK_FILE on webserver, try local storage
- updateStatus('Quake data not found alongside executable.');
- loadFromLocalStorage();
- }
- };
- req.open('GET', PAK_FILE);
- req.send(null);
-}
-
-window.onload = function() {
- onLoad();
-};
diff --git a/ports/randrproto/pkg_info b/ports/randrproto/pkg_info
deleted file mode 100644
index ad54e43..0000000
--- a/ports/randrproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=randrproto
-VERSION=1.3.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/randrproto-1.3.2.tar.bz2
-LICENSE=GPL
-SHA1=55d4b1a09fc8e645d9674a452ae151988caabad1
diff --git a/ports/readline/build.sh b/ports/readline/build.sh
deleted file mode 100644
index dec3a32..0000000
--- a/ports/readline/build.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (c) 2011 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.
-
-# Configure requires this variable to be pre-set when cross compiling.
-export bash_cv_wcwidth_broken=no
-
-MAKEFLAGS+=" EXEEXT=.${NACL_EXEEXT}"
-
-EnableGlibcCompat
-
-if [[ ${NACL_SHARED} = 0 ]]; then
- EXTRA_CONFIGURE_ARGS="--disable-shared"
-fi
-
-if [[ ${TOOLCHAIN} == emscripten ]]; then
- export bash_cv_signal_vintage=posix
- # Emscripten tends to let autoconf thinks things work when they don't.
- # Without this autoconf will detect that -lutil and -ldir are needed which
- # generated a lot of warnings during the build
- export ac_cv_lib_util_openpty=no
- export ac_cv_lib_dir_opendir=no
-fi
-
-TestStep() {
- if [ "${NACL_LIBC}" != "glibc" ]; then
- # readline example don't link under sel_ldr
- # TODO(sbc): find a way to add glibc-compat to link line for examples.
- return
- fi
- MAKE_TARGETS=examples
- DefaultBuildStep
- pushd examples
- # TODO(jvoung): PNaCl can't use WriteLauncherScript --
- # It should use TranslateAndWriteLauncherScript instead.
- # It probably shouldn't use .nexe as the extension either.
- for NEXE in *.nexe; do
- WriteLauncherScript ${NEXE%.*} ${NEXE}
- done
- popd
-}
-
-InstallStep() {
- DefaultInstallStep
- if [ "${NACL_SHARED}" = "1" ]; then
- cd ${DESTDIR_LIB}
- ln -sf libreadline.so.6 libreadline.so
- fi
-}
diff --git a/ports/readline/nacl.patch b/ports/readline/nacl.patch
deleted file mode 100644
index 4e8977c..0000000
--- a/ports/readline/nacl.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/rldefs.h b/rldefs.h
---- a/rldefs.h
-+++ b/rldefs.h
-@@ -34,6 +34,22 @@
- # undef HAVE_STRCOLL
- #endif
-
-+#if defined (__native_client__) && !defined (_POSIX_VERSION)
-+/* Currently the newlib toolchain in NaCl doesn't define _POSIX_VERSION
-+ * which causes readline to fall back to using ioctl() rather than
-+ * tcgetattr(). TODO(sbc): remove this patch once either ioctl() is
-+ * supported on tty nodes or _POSIX_VERSION is defined by newlib headers. */
-+#define _POSIX_VERSION 199309L
-+#endif
-+
-+#if defined (__native_client__) && !defined (__GLIBC__) && !defined TCOON
-+// TODO(sbc): remove once these are added to termios.h in NaCl
-+#define TCOOFF 0
-+#define TCOON 1
-+#define TCIOFF 2
-+#define TCION 3
-+#endif
-+
- #if defined (_POSIX_VERSION) && !defined (TERMIOS_MISSING)
- # define TERMIOS_TTY_DRIVER
- #else
diff --git a/ports/readline/pkg_info b/ports/readline/pkg_info
deleted file mode 100644
index ab04f04..0000000
--- a/ports/readline/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=readline
-VERSION=6.3
-URL=ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz
-LICENSE=GPL3
-DEPENDS=(ncurses glibc-compat)
-SHA1=017b92dc7fd4e636a2b5c9265a77ccc05798c9e1
diff --git a/ports/recordproto/pkg_info b/ports/recordproto/pkg_info
deleted file mode 100644
index 9225d3c..0000000
--- a/ports/recordproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=recordproto
-VERSION=1.14.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/recordproto-1.14.2.tar.bz2
-LICENSE=GPL
-SHA1=1f48c4b0004d8b133efd0498e8d88d68d3b9199c
diff --git a/ports/regal/build.sh b/ports/regal/build.sh
deleted file mode 100644
index 6cdf1af..0000000
--- a/ports/regal/build.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2013 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.
-
-BUILD_DIR=${SRC_DIR}
-
-MAKE_ARGS="SYSTEM=nacl-${NACL_ARCH} NACL_LIBC=${NACL_LIBC} -j${OS_JOBS}"
-if [ "$TOOLCHAIN" = "clang-newlib" ]; then
- MAKE_ARGS+=" NACL_CLANG=1"
-fi
-
-BuildStep() {
- LogExecute make ${MAKE_ARGS} clobber
- LogExecute make ${MAKE_ARGS} regal.lib
-}
-
-TestStep() {
- # Regal build system doesn't yet know how to run the arm tests
- if [ "${NACL_ARCH}" = "arm" ]; then
- return
- fi
- LogExecute make ${MAKE_ARGS} test
-}
-
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}
- LogExecute cp -a lib/nacl-${NACL_ARCH}/libRegal*.a ${DESTDIR_LIB}/
- LogExecute cp -a lib/nacl-${NACL_ARCH}/libglslopt.a ${DESTDIR_LIB}/
- if [ "${NACL_SHARED}" = 1 ]; then
- LogExecute cp -a lib/nacl-${NACL_ARCH}/libRegal*.so* ${DESTDIR_LIB}/
- fi
- LogExecute cp -r include/GL ${DESTDIR_INCLUDE}/
-}
diff --git a/ports/regal/nacl.patch b/ports/regal/nacl.patch
deleted file mode 100644
index b2c8107..0000000
--- a/ports/regal/nacl.patch
+++ /dev/null
@@ -1,609 +0,0 @@
-diff --git a/.travis.yml b/.travis.yml
---- a/.travis.yml
-+++ b/.travis.yml
-@@ -19,10 +19,14 @@ install:
- - "if [ \"$SYSTEM\" = linux ]; then sudo apt-get install libxmu-dev libxi-dev; fi"
- env:
- - SYSTEM=linux
-- - SYSTEM=nacl-i686
-+ - SYSTEM=nacl-x86_64 TOOLCHAIN=clang-newlib
-+ - SYSTEM=nacl-x86_64 TOOLCHAIN=glibc
- - SYSTEM=nacl-x86_64
-+ - SYSTEM=nacl-i686
- - SYSTEM=nacl-arm
-+ - SYSTEM=nacl-pnacl
- - MODE=debug SYSTEM=linux
-- - MODE=debug SYSTEM=nacl-i686
- - MODE=debug SYSTEM=nacl-x86_64
-+ - MODE=debug SYSTEM=nacl-i686
- - MODE=debug SYSTEM=nacl-arm
-+ - MODE=debug SYSTEM=nacl-pnacl
-diff --git a/Makefile.glu b/Makefile.glu
---- a/Makefile.glu
-+++ b/Makefile.glu
-@@ -36,7 +36,6 @@ GLU.OBJS := $(GLU.OBJS:.c=.o) $(GLU.OBJS:.cc=.o)
- GLU.OBJS := $(filter %.o,$(GLU.OBJS))
- GLU.DEPS := $(GLU.OBJS:.o=.d)
- GLU.LIBS := -Llib/$(SYSTEM) -lRegal
--GLU.LIBS += -lstdc++
- GLU.LIBS += -pthread -lm
-
- -include $(GLU.DEPS)
-diff --git a/Makefile.nacl b/Makefile.nacl
---- a/Makefile.nacl
-+++ b/Makefile.nacl
-@@ -37,9 +37,8 @@ NACL.SRCS.NAMES := $(notdir $(NACL.SRCS))
- NACL.OBJS := $(addprefix tmp/$(SYSTEM)/nacl/static/,$(NACL.SRCS.NAMES))
- NACL.OBJS := $(NACL.OBJS:.c=.o)
- NACL.CFLAGS := -Iinclude
--NACL.CFLAGS += -DREGAL_NAMESPACE=1
--NACL.LIBS += -Llib/$(SYSTEM) -lRegallib -lglslopt -lpnglib -lzlib
--NACL.LIBS += -lm -pthread -lppapi -lppapi_gles2 -lstdc++
-+NACL.LIBS += -Llib/$(SYSTEM) -lRegal -lglslopt -lpnglib -lzlib
-+NACL.LIBS += -lm -pthread -lppapi -lppapi_gles2
-
- -include $(NACL.DEPS)
-
-diff --git a/Makefile.regal b/Makefile.regal
---- a/Makefile.regal
-+++ b/Makefile.regal
-@@ -18,11 +18,17 @@ include build/regal.inc
- export:
- python scripts/Export.py --api gl 4.5 --api wgl 4.5 --api glx 4.5 --api cgl 1.4 --api egl 1.0 --outdir .
-
--# Shared library target not currently supported for NaCL or emscripten
-+# Shared library target not currently supported for emscripten
-
--ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
-+ifneq ($(filter emscripten%,$(SYSTEM)),)
-+REGAL.SHARED :=
-+endif
-+
-+ifneq ($(filter nacl%,$(SYSTEM)),)
-+ifneq ($(filter pnacl% newlib% clang-newlib%,$(TOOLCHAIN)),)
- REGAL.SHARED :=
- endif
-+endif
-
- ifdef REGAL.STATIC
-
-@@ -37,13 +43,7 @@ clean:: regal.clean
-
- framework:: regal.framework
-
--REGAL.LDFLAGS :=
--
--ifeq ($(filter nacl%,$(SYSTEM)),)
--REGAL.LDFLAGS += -lstdc++
--endif
--
--REGAL.LDFLAGS += -pthread -lm
-+REGAL.LDFLAGS := -pthread -lm
- REGAL.LIBS :=
-
- ifeq ($(filter nacl%,$(SYSTEM)),)
-@@ -114,22 +114,12 @@ endif
- # NaCL options
-
- ifneq ($(filter nacl%,$(SYSTEM)),)
--REGAL.CFLAGS += -DREGAL_SYS_ES2=1
--REGAL.CFLAGS += -DREGAL_HTTP=0
-+REGAL.CFLAGS += -DREGAL_HTTP=0
- REGAL.CFLAGS += -DREGAL_STATISTICS=0
--REGAL.CFLAGS += -Wno-constant-logical-operand
- REGAL.CFLAGS += -DREGAL_PLUGIN=0
- REGAL.CFLAGS += -DREGAL_TRACE=0
--REGAL.CFLAGS += -DREGAL_NAMESPACE=1 -DREGAL_STATIC_ES2
- REGAL_LOG = 0
- REGAL_NO_TLS = 1
--
--# Enabling this requires the library to be built with it, as well as all code
--# that uses it. Defining this means that Regal will link statically to GL
--# and EGL, and code will have to #include <GL/Regal.h> before any GL
--# includes to pull in a bunch of #defines (e.g. #define glGetError rglGetError)
--#LIB.CFLAGS += -DREGAL_SYS_EMSCRIPTEN_STATIC=1
--
- endif
-
- #
-@@ -152,8 +142,6 @@ REGAL_DEBUG := 0
- REGAL_NO_TLS := 1
- endif
-
--#
--
- ifneq ($(REGAL_LOG),)
- REGAL.CFLAGS += -DREGAL_LOG=$(REGAL_LOG)
- endif
-@@ -204,12 +192,14 @@ REGAL.SDEPS := $(LIBS.SOBJS:.o=.d)
-
- REGAL.LIBS += $(LDFLAGS.X11)
-
--ifneq ($(filter linux%,$(SYSTEM)),)
-+ifneq ($(filter nacl% linux%,$(SYSTEM)),)
-+ifeq ($(filter newlib% pnacl% clang-newlib%,$(TOOLCHAIN)),)
- REGAL.SONAME := lib$(NAME).so.$(SO_MAJOR)
- REGAL.DEVLNK := lib$(NAME).so
- REGAL.SHARED := lib$(NAME).so.$(SO_VERSION)
- REGAL.LDFLAGS.SO := $(LDFLAGS.SO) $(LDFLAGS.DYNAMIC) -Wl,-soname=$(REGAL.SONAME)
- endif
-+endif
-
- ifneq ($(filter darwin%,$(SYSTEM)),)
- OPENGL_NAME := OpenGL
-@@ -264,12 +254,6 @@ ifdef APITRACE.STATIC
- lib/$(SYSTEM)/$(REGAL.STATIC): lib/$(SYSTEM)/$(APITRACE.STATIC) lib/$(SYSTEM)/$(SNAPPY.STATIC)
- endif
-
--ifneq ($(filter nacl%,$(SYSTEM)),)
--ifeq ($(NACL_LIBC),glibc)
--regal.lib: lib/$(SYSTEM)/$(REGAL.SHARED)
--endif
--endif
--
- lib/$(SYSTEM)/$(REGAL.STATIC): lib/$(SYSTEM)/$(GLSLOPT.STATIC) lib/$(SYSTEM)/$(PCRE.STATIC) lib/$(SYSTEM)/$(LIBPNG.STATIC) lib/$(SYSTEM)/$(ZLIB.STATIC) $(REGAL.OBJS)
- @mkdir -p $(dir $@)
- $(LOG_AR)$(CCACHE) $(AR) cr $@ $(REGAL.OBJS)
-diff --git a/Makefile.regaltest b/Makefile.regaltest
---- a/Makefile.regaltest
-+++ b/Makefile.regaltest
-@@ -7,7 +7,7 @@ include build/common.inc
-
- # Not supported for Emscripten - Revisit
-
--ifeq ($(filter emscripten% nacl-pnacl,$(SYSTEM)),)
-+ifeq ($(filter emscripten%,$(SYSTEM)),)
-
- include build/regaltest.inc
-
-@@ -58,15 +58,24 @@ tmp/$(SYSTEM)/regaltest/static/%.o: tests/%.cpp
- @mkdir -p $(dir $@)
- $(LOG_CXX)$(CCACHE) $(CXX) $(REGAL.CFLAGS) $(REGALTEST.CFLAGS) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
-
-+ifeq ($(NACL_ARCH),pnacl)
-+LINK_OUTPUT_EXT=.bc
-+else
-+LINK_OUTPUT_EXT=$(BIN_EXTENSION)
-+endif
-+
- bin/$(SYSTEM)/regaltest$(BIN_EXTENSION): $(REGALTEST.OBJS) lib/$(SYSTEM)/$(GTEST.STATIC) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(PCRE.STATIC) $(REGAL.SHARED.DEPEND)
- @mkdir -p $(dir $@)
- ifdef APITRACE.STATIC
- $(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) -o $@ $(REGALTEST.OBJS) $(LDFLAGS.STARTGROUP) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(APITRACE.STATIC) $(LDFLAGS.ENDGROUP) $(REGAL.SHARED.DEPEND) $(REGAL.LIBS) $(REGALTEST.LIBS) lib/$(SYSTEM)/$(PCRE.STATIC) lib/$(SYSTEM)/$(GTEST.STATIC) $(REGAL.LDFLAGS)
- else
-- $(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) -o $@ $(REGALTEST.OBJS) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(PCRE.STATIC) $(REGAL.SHARED.DEPEND) $(REGAL.LIBS) $(REGALTEST.LIBS) lib/$(SYSTEM)/$(GTEST.STATIC) $(REGAL.LDFLAGS)
-+ $(LOG_LD)$(CCACHE) $(LD) $(LDFLAGS.EXTRA) -o $(@:$(BIN_EXTENSION)=$(LINK_OUTPUT_EXT)) $(REGALTEST.OBJS) lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(PCRE.STATIC) $(REGAL.SHARED.DEPEND) $(REGAL.LIBS) $(REGALTEST.LIBS) lib/$(SYSTEM)/$(GTEST.STATIC) $(REGAL.LDFLAGS)
- endif
- ifneq ($(STRIP),)
-- $(LOG_STRIP)$(STRIP) -x $@
-+ $(LOG_STRIP)$(STRIP) $(@:$(BIN_EXTENSION)=$(LINK_OUTPUT_EXT))
-+endif
-+ifeq ($(NACL_ARCH),pnacl)
-+ $(LOG_FINALIZE)$(FINALIZE) -o $@ $(@:$(BIN_EXTENSION)=$(LINK_OUTPUT_EXT))
- endif
-
- ifneq ($(NACL_ARCH),arm)
-@@ -75,7 +84,10 @@ test: bin/$(SYSTEM)/regaltest$(BIN_EXTENSION)
- ifeq ($(filter nacl%,$(SYSTEM)),)
- $^
- else
-- "$(NACL_SDK_ROOT)/tools/sel_ldr.py" $^
-+ifeq ($(NACL_ARCH),pnacl)
-+ $(LOG_FINALIZE)$(TRANSLATE) -arch x86-64 -o $(^:.pexe=.nexe) $^
-+endif
-+ "$(NACL_SDK_ROOT)/tools/sel_ldr.py" $(^:.pexe=.nexe)
- endif
- endif
-
-diff --git a/Makefile.regalw b/Makefile.regalw
---- a/Makefile.regalw
-+++ b/Makefile.regalw
-@@ -12,18 +12,23 @@ include build/regal.inc
- #
-
- REGALW.STATIC ?= libRegalW.a
--REGALW.SHARED ?= libRegal.so
-+REGALW.SHARED ?= libRegalW.so
-
- # Static library target not yet supported
-
- REGALW.STATIC :=
-
--# Shared library target not currently supported for NaCL or emscripten
-+# Shared library target not currently supported for emscripten
-
--ifneq ($(filter nacl% emscripten%,$(SYSTEM)),)
-+ifneq ($(filter emscripten%,$(SYSTEM)),)
- REGALW.SHARED :=
- endif
-
-+ifneq ($(filter nacl%,$(SYSTEM)),)
-+ifneq ($(filter pnacl% newlib% clang-newlib%,$(TOOLCHAIN)),)
-+REGALW.SHARED :=
-+endif
-+endif
-
- ifdef REGALW.SHARED
-
-@@ -31,7 +36,7 @@ all:: regalw.lib
-
- clean:: regalw.clean
-
--REGALW.LDFLAGS := -lstdc++ -pthread -lm
-+REGALW.LDFLAGS := -pthread -lm
- REGALW.LIBS :=
-
- REGALW.SRCS := $(REGAL.CXX)
-@@ -78,7 +83,7 @@ REGALW.SDEPS := $(LIBS.SOBJS:.o=.d)
-
- REGALW.LIBS += $(LDFLAGS.X11)
-
--ifneq ($(filter linux%,$(SYSTEM)),)
-+ifneq ($(filter linux% nacl%,$(SYSTEM)),)
- REGALW.SONAME := libRegalW.so.$(SO_MAJOR)
- REGALW.DEVLNK := libRegalW.so
- REGALW.SHARED := libRegalW.so.$(SO_VERSION)
-diff --git a/README.rst b/README.rst
---- a/README.rst
-+++ b/README.rst
-@@ -380,7 +380,8 @@ PPAPI and NaCl
-
- * NACL_SDK_ROOT needs to be set
-
--* NACL_LIBC=newlib is the default, specify glibc or pnacl as alternatives
-+* TOOLCHAIN=newlib is the default, specify glibc/pnacl/clang-newlib as
-+ alternatives
-
- Questions and Answers
- =====================
-diff --git a/build/glu.inc b/build/glu.inc
---- a/build/glu.inc
-+++ b/build/glu.inc
-@@ -102,9 +102,10 @@ GLU.CXX += src/glu/libnurbs/nurbtess/searchTree.cc
- GLU.CFLAGS := -Isrc/glu/include -Isrc/glu/libnurbs/interface -Isrc/glu/libnurbs/internals -Isrc/glu/libnurbs/nurbtess
- GLU.CFLAGS += -DLIBRARYBUILD
-
--GLU.SHARED := libRegalGLU.so
--GLU.STATIC := libRegalGLUlib.a
-+GLU.STATIC := libRegalGLU.a
-
- ifneq ($(filter darwin%,$(SYSTEM)),)
- GLU.SHARED := libRegalGLU.dylib
-+else
-+GLU.SHARED := libRegalGLU.so
- endif
-diff --git a/build/regal.inc b/build/regal.inc
---- a/build/regal.inc
-+++ b/build/regal.inc
-@@ -153,5 +153,5 @@ ifeq ($(PROFILE_OS),Windows)
- REGAL.INCLUDE += -Isrc/glsl/include/c99
- endif
-
--REGAL.STATIC ?= libRegallib.a
-+REGAL.STATIC ?= libRegal.a
- REGAL.SHARED ?= libRegal.so
-diff --git a/config/Makefile.linux b/config/Makefile.linux
---- a/config/Makefile.linux
-+++ b/config/Makefile.linux
-@@ -1,7 +1,7 @@
- NAME = $(REGAL_NAME)
- CC = cc
- CXX = c++
--LD = cc
-+LD = c++
- RANLIB :=
- # don't use abi-dumper by default
- # ABIDUMP = abi-dumper -bin-only -lver HEAD
-diff --git a/config/Makefile.linux-32 b/config/Makefile.linux-32
---- a/config/Makefile.linux-32
-+++ b/config/Makefile.linux-32
-@@ -1,7 +1,7 @@
- NAME = $(REGAL_NAME)
- CC = cc
- CXX = c++
--LD = cc
-+LD = c++
- RANLIB :=
- EXT.DYNAMIC = so
- PICFLAG = -fPIC
-diff --git a/config/Makefile.linux-64 b/config/Makefile.linux-64
---- a/config/Makefile.linux-64
-+++ b/config/Makefile.linux-64
-@@ -1,7 +1,7 @@
- NAME = $(REGAL_NAME)
- CC = cc
- CXX = c++
--LD = cc
-+LD = c++
- RANLIB :=
- EXT.DYNAMIC = so
- PICFLAG = -fPIC
-diff --git a/config/Makefile.nacl-arm b/config/Makefile.nacl-arm
---- a/config/Makefile.nacl-arm
-+++ b/config/Makefile.nacl-arm
-@@ -2,26 +2,36 @@ NACL_ARCH := arm
-
- include config/nacl.inc
-
--NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_arm_$(NACL_LIBC)
--
-+ifeq ($(TOOLCHAIN),clang-newlib)
-+CC := $(NACL_TOOLCHAIN)/bin/arm-nacl-clang
-+CXX := $(NACL_TOOLCHAIN)/bin/arm-nacl-clang++
-+LD := $(NACL_TOOLCHAIN)/bin/arm-nacl-clang++
-+AR := $(NACL_TOOLCHAIN)/bin/arm-nacl-ar
-+OBJDUMP:= $(NACL_TOOLCHAIN)/bin/arm-nacl-objdump
-+else
-+NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_arm_$(TOOLCHAIN)
- CC := $(NACL_TOOLCHAIN)/bin/arm-nacl-gcc
- CXX := $(NACL_TOOLCHAIN)/bin/arm-nacl-g++
- LD := $(NACL_TOOLCHAIN)/bin/arm-nacl-g++
- AR := $(NACL_TOOLCHAIN)/bin/arm-nacl-ar
- OBJDUMP:= $(NACL_TOOLCHAIN)/bin/arm-nacl-objdump
-+endif
- RANLIB :=
- STRIP ?=
-
--#WARN += -Wno-unused-but-set-variable -Wno-maybe-uninitialized
- BIN_EXTENSION = _arm.nexe
- EXT.DYNAMIC = so
- LIBDIR =
-+CFLAGS.EXTRA += -Wno-sizeof-pointer-memaccess
-+CFLAGS.EXTRA += -mfpu=vfp
- LDFLAGS.GL =
- LDFLAGS.GLU = -lRegalGLU
- LDFLAGS.GLUT = -lRegalGLUT
- LDFLAGS.STATIC =
-+LDFLAGS.DYNAMIC = -shared
- BIN.SUFFIX =
- LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
- LIB.DEVLNK = lib$(NAME).so
- LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
- LIB.STATIC = lib$(NAME).a
-+LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME)
-diff --git a/config/Makefile.nacl-i686 b/config/Makefile.nacl-i686
---- a/config/Makefile.nacl-i686
-+++ b/config/Makefile.nacl-i686
-@@ -2,15 +2,21 @@ NACL_ARCH := i686
-
- include config/nacl.inc
-
--NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_x86_$(NACL_LIBC)
--NACL_SEL_LDR := $(NACL_SDK_ROOT)/tools/sel_ldr_x86_32
--NACL_IRT := $(NACL_SDK_ROOT)/tools/irt_core_x86_32.nexe
--
-+ifeq ($(TOOLCHAIN),clang-newlib)
-+CC := $(NACL_TOOLCHAIN)/bin/i686-nacl-clang
-+CXX := $(NACL_TOOLCHAIN)/bin/i686-nacl-clang++
-+LD := $(NACL_TOOLCHAIN)/bin/i686-nacl-clang++
-+AR := $(NACL_TOOLCHAIN)/bin/i686-nacl-ar
-+OBJDUMP:= $(NACL_TOOLCHAIN)/bin/i686-nacl-objdump
-+else
-+NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_x86_$(TOOLCHAIN)
- CC := $(NACL_TOOLCHAIN)/bin/i686-nacl-gcc
- CXX := $(NACL_TOOLCHAIN)/bin/i686-nacl-g++
- LD := $(NACL_TOOLCHAIN)/bin/i686-nacl-g++
- AR := $(NACL_TOOLCHAIN)/bin/i686-nacl-ar
- OBJDUMP:= $(NACL_TOOLCHAIN)/bin/i686-nacl-objdump
-+endif
-+
- RANLIB :=
- STRIP ?=
-
-diff --git a/config/Makefile.nacl-pnacl b/config/Makefile.nacl-pnacl
---- a/config/Makefile.nacl-pnacl
-+++ b/config/Makefile.nacl-pnacl
-@@ -1,29 +1,26 @@
- NACL_ARCH := pnacl
-+TOOLCHAIN := pnacl
-
- include config/nacl.inc
-
- NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_pnacl
-
--CC := $(NACL_TOOLCHAIN)/bin/pnacl-clang
--CXX := $(NACL_TOOLCHAIN)/bin/pnacl-clang++
--LD := $(NACL_TOOLCHAIN)/bin/pnacl-clang++
--AR := $(NACL_TOOLCHAIN)/bin/pnacl-ar
--RANLIB :=
--STRIP ?=
-+CC := $(NACL_TOOLCHAIN)/bin/pnacl-clang
-+CXX := $(NACL_TOOLCHAIN)/bin/pnacl-clang++
-+LD := $(NACL_TOOLCHAIN)/bin/pnacl-clang++
-+AR := $(NACL_TOOLCHAIN)/bin/pnacl-ar
-+FINALIZE := $(NACL_TOOLCHAIN)/bin/pnacl-finalize
-+TRANSLATE := $(NACL_TOOLCHAIN)/bin/pnacl-translate
-+RANLIB := $(NACL_TOOLCHAIN)/bin/pnacl-ranlib
-+STRIP ?=
-
- BIN_EXTENSION = .pexe
--EXT.DYNAMIC = so
- LIBDIR =
--CFLAGS.EXTRA +=
-+CFLAGS.EXTRA += -Wno-tautological-undefined-compare -Wno-unused-function
- LDFLAGS.EXTRA +=
- LDFLAGS.GL =
- LDFLAGS.GLU = -lRegalGLU
- LDFLAGS.GLUT = -lRegalGLUT
- LDFLAGS.STATIC =
--LDFLAGS.DYNAMIC = -shared
- BIN.SUFFIX =
--LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
--LIB.DEVLNK = lib$(NAME).so
--LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
- LIB.STATIC = lib$(NAME).a
--LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME)
-diff --git a/config/Makefile.nacl-x86_64 b/config/Makefile.nacl-x86_64
---- a/config/Makefile.nacl-x86_64
-+++ b/config/Makefile.nacl-x86_64
-@@ -2,15 +2,21 @@ NACL_ARCH := x86_64
-
- include config/nacl.inc
-
--NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_x86_$(NACL_LIBC)
--NACL_SEL_LDR := $(NACL_SDK_ROOT)/tools/sel_ldr_x86_64
--NACL_IRT := $(NACL_SDK_ROOT)/tools/irt_core_x86_64.nexe
--
-+ifeq ($(TOOLCHAIN),clang-newlib)
-+CC := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-clang
-+CXX := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-clang++
-+LD := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-clang++
-+AR := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-ar
-+OBJDUMP:= $(NACL_TOOLCHAIN)/bin/x86_64-nacl-objdump
-+else
-+NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_x86_$(TOOLCHAIN)
- CC := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-gcc
- CXX := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++
- LD := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-g++
- AR := $(NACL_TOOLCHAIN)/bin/x86_64-nacl-ar
- OBJDUMP:= $(NACL_TOOLCHAIN)/bin/x86_64-nacl-objdump
-+endif
-+
- RANLIB :=
- STRIP ?=
-
-diff --git a/config/nacl.inc b/config/nacl.inc
---- a/config/nacl.inc
-+++ b/config/nacl.inc
-@@ -6,13 +6,13 @@ endif
-
- #
- # Specify on the command-line:
--# NACL_LIBC=newlib
--# or NACL_LIBC=glibc
-+# TOOLCHAIN=newlib
-+# or TOOLCHAIN=glibc
- #
-
--NACL_LIBC ?= newlib
-+TOOLCHAIN ?= newlib
-
--ifeq ($(NACL_LIBC),glibc)
-+ifeq ($(TOOLCHAIN),glibc)
- PICFLAG = -fPIC
- endif
-
-@@ -32,6 +32,10 @@ else
- endif
- endif
-
-+ifeq ($(TOOLCHAIN),clang-newlib)
-+NACL_TOOLCHAIN := $(NACL_SDK_ROOT)/toolchain/$(NACL_OS)_pnacl
-+endif
-+
- # ccache by default hashes the compiler’s mtime and size, but this
- # is insufficient for distinguising between glibc and newlib NaCl
- # variants
-@@ -40,18 +44,18 @@ endif
- # -rwxr-xr-x 2 user user 384 Oct 1 09:21 pepper_25/toolchain/mac_x86_glibc/bin/i686-nacl-g++
- # -rwxr-xr-x 2 user user 384 Oct 1 09:21 pepper_25/toolchain/mac_x86_newlib/bin/i686-nacl-g++
- #
--# We catenate the SYSTEM variable, NACL_LIBC and NACL_SDK_ROOT for keeping
-+# We catenate the SYSTEM variable, TOOLCHAIN and NACL_SDK_ROOT for keeping
- # the glibc and newlib outputs separate, and per-sdk-version separate.
-
--export CCACHE_COMPILERCHECK=echo $(SYSTEM)$(NACL_LIBC)$(NACL_SDK_ROOT)
-+export CCACHE_COMPILERCHECK=echo $(SYSTEM)$(TOOLCHAIN)$(NACL_SDK_ROOT)
-
- ifeq ($(NACL_ARCH),i686)
--NACL_LIBTYPE=$(NACL_LIBC)_x86_32
-+NACL_LIBTYPE=$(TOOLCHAIN)_x86_32
- else
- ifeq ($(NACL_ARCH),pnacl)
- NACL_LIBTYPE=$(NACL_ARCH)
- else
--NACL_LIBTYPE=$(NACL_LIBC)_$(NACL_ARCH)
-+NACL_LIBTYPE=$(TOOLCHAIN)_$(NACL_ARCH)
- endif
- endif
-
-@@ -68,6 +72,6 @@ NMF_FLAGS += -L$(NACL_SDK_ROOT)/lib/$(NACL_LIBTYPE)/Release
-
- CFLAGS.EXTRA += -I$(NACL_SDK_ROOT)/include -MMD
- WARN = -Wall -Wno-unused-parameter -Wno-char-subscripts -Wno-strict-aliasing
--# WARN += -Werror
-+#WARN += -Werror
- CFLAGS.DEBUG = -g
- CFLAGS.RELEASE = -O2
-diff --git a/nacl-regal.sh b/nacl-regal.sh
---- a/nacl-regal.sh
-+++ b/nacl-regal.sh
-@@ -10,22 +10,24 @@
- # - Pepper 25 is needed for the ARM build.
- # - Makefile needs to be specified for branches that have GNUmakefiles
- # - MODE=debug for debug-mode build
--# - NACL_LIBC=glibc on the command-line for glibc rather than newlib
-+# - TOOLCHAIN=glibc or clang-newlib to use and alternative to the default
-+# newlib toolchain.
- # - CCACHE=ccache is supported (and recommended)
-
- set -e
-
- echo "Building x86_64"
- make -f Makefile SYSTEM=nacl-x86_64 $*
-+make -f Makefile SYSTEM=nacl-x86_64 $* test
-
- echo "Building i686"
- make -f Makefile SYSTEM=nacl-i686 $*
-+make -f Makefile SYSTEM=nacl-i686 $* test
-
--if [ "$NACL_LIBC" != "glibc" ]; then
-- # No glibc support as yet on ARM
-- echo "Building ARM"
-- make -f Makefile SYSTEM=nacl-arm $*
--fi
-+echo "Building ARM"
-+make -f Makefile SYSTEM=nacl-arm $*
-+make -f Makefile SYSTEM=nacl-arm $* test
-
- echo "Building pnacl"
- make -f Makefile SYSTEM=nacl-pnacl $*
-+make -f Makefile SYSTEM=nacl-pnacl $* test
-diff --git a/src/apitrace/common/os_posix.cpp b/src/apitrace/common/os_posix.cpp
---- a/src/apitrace/common/os_posix.cpp
-+++ b/src/apitrace/common/os_posix.cpp
-@@ -123,7 +123,7 @@ getCurrentDir(void)
- size_t size = PATH_MAX;
- char *buf = path.buf(size);
-
-- getcwd(buf, size);
-+ buf = getcwd(buf, size);
- buf[size - 1] = 0;
-
- path.truncate();
-diff --git a/src/regal/RegalContext.cpp b/src/regal/RegalContext.cpp
---- a/src/regal/RegalContext.cpp
-+++ b/src/regal/RegalContext.cpp
-@@ -698,7 +698,7 @@ void RegalContext::parkContext( DispatchTableGlobal & tbl )
- //<> # error "Implement me!"
- #endif
- #if REGAL_SYS_PPAPI
-- Init::makeCurrent(NULL,NULL);
-+ Init::makeCurrent(0,NULL);
- #else
- Init::makeCurrent(NULL);
- #endif
-diff --git a/src/regal/RegalShader.cpp b/src/regal/RegalShader.cpp
---- a/src/regal/RegalShader.cpp
-+++ b/src/regal/RegalShader.cpp
-@@ -233,7 +233,7 @@ namespace Shader {
- bool status;
- };
-
-- static inline void debug_print_ir (const char* name, exec_list* ir, _mesa_glsl_parse_state* state, void* memctx)
-+ static inline void REGAL_UNUSED debug_print_ir (const char* name, exec_list* ir, _mesa_glsl_parse_state* state, void* memctx)
- {
- //_mesa_print_ir (ir, state);
- Error( "GLSLOptimize debug **** ", name, ":",
-diff --git a/src/regal/RegalUtil.h b/src/regal/RegalUtil.h
---- a/src/regal/RegalUtil.h
-+++ b/src/regal/RegalUtil.h
-@@ -56,7 +56,7 @@
- #endif
-
- #ifndef REGAL_UNUSED
--#if defined(__GNUC__) && !defined(__clang__)
-+#if defined(__GNUC__)
- #define REGAL_UNUSED __attribute__((unused))
- #else
- #define REGAL_UNUSED
diff --git a/ports/regal/pkg_info b/ports/regal/pkg_info
deleted file mode 100644
index 177b4f7..0000000
--- a/ports/regal/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=regal
-VERSION=5e14ae7
-URL=https://github.com/p3/regal/archive/5e14ae7/Regal-5e14ae7.tar.gz
-ARCHIVE_ROOT=regal-5e14ae7d62a1dcc673744a9709b4a68d27c674ba
-DEPENDS=(libpng)
-DISABLED_TOOLCHAIN=(emscripten)
-SHA1=8e4d95615591f9ade4613fac5ea34a4a098aed1b
diff --git a/ports/renderproto/pkg_info b/ports/renderproto/pkg_info
deleted file mode 100644
index 002a361..0000000
--- a/ports/renderproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=renderproto
-VERSION=0.11.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/renderproto-0.11.1.tar.bz2
-LICENSE=GPL
-SHA1=7ae9868a358859fe539482b02414aa15c2d8b1e4
diff --git a/ports/resourceproto/pkg_info b/ports/resourceproto/pkg_info
deleted file mode 100644
index fab1747..0000000
--- a/ports/resourceproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=resourceproto
-VERSION=1.2.0
-URL=http://www.x.org/releases/X11R7.7/src/everything/resourceproto-1.2.0.tar.bz2
-LICENSE=GPL
-SHA1=9ff9bb9243b0474330959dc3853973523c9dd9ce
diff --git a/ports/ruby-ppapi/Makefile b/ports/ruby-ppapi/Makefile
deleted file mode 100644
index 97d8933..0000000
--- a/ports/ruby-ppapi/Makefile
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-include $(NACL_SDK_ROOT)/tools/common.mk
-
-TARGET = ruby
-LIBS = ruby-static readline ncurses ppapi_simple tar nacl_io ppapi
-ifeq ($(TOOLCHAIN),glibc)
-ifneq ($(NACL_ARCH),arm)
-LIBS += util
-endif
-LIBS += dl rt crypt
-NACL_LDFLAGS += -Wl,-export-dynamic
-else
-LIBS += c glibc-compat
-endif
-SOURCES = main.c
-INC_PATHS = $(NACLPORTS_INCLUDE)/ruby-2.0.0
-ifeq ($(NACL_ARCH),x86_32)
-INC_PATHS += $(NACLPORTS_INCLUDE)/ruby-2.0.0/i686-nacl
-else
-ifeq ($(NACL_ARCH),pnacl)
-INC_PATHS += $(NACLPORTS_INCLUDE)/ruby-2.0.0/le32-nacl
-else
-INC_PATHS += $(NACLPORTS_INCLUDE)/ruby-2.0.0/$(NACL_ARCH)-nacl
-endif
-endif
-INSTALL_DIR = $(NACL_PACKAGES_PUBLISH)/ruby/$(TOOLCHAIN)
-
-ifeq ($(TOOLCHAIN),pnacl)
-EXEEXT=.pexe
-else
-EXEEXT=.nexe
-endif
-
-# We want the nmf to contain all the .nexe we have previously
-# built as well as the one currently being built, so we modify
-# the list of executables that we pass to create_nmf.
-ifneq ($(TOOLCHAIN),pnacl)
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_64$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_x86_32$(EXEEXT))
-EXECUTABLES += $(wildcard $(OUTDIR)/$(TARGET)_arm$(EXEEXT))
-endif
-
-# Build rules generated by macros from common.mk:
-
-$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
-
-ifeq ($(CONFIG),Release)
-$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
-$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
-else
-$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
-endif
-
-$(eval $(call NMF_RULE,$(TARGET),))
-
-DATA_ARCHIVE = $(INSTALL_DIR)/rbdata-$(NACL_ARCH).tar
-ASSETS = bin/irb lib/ruby/2.0.0
-ifeq ($(TOOLCHAIN),glibc)
-EXTRA_LIBS = lib/libz.so.1 lib/libreadline.so lib/libncurses.so.5
-endif
-
-CHROMEAPPS = $(NACL_SRC)/third_party/libapps/
-LIB_DOT = $(CHROMEAPPS)/libdot
-HTERM = $(CHROMEAPPS)/hterm
-
-install-hterm:
- mkdir -p $(INSTALL_DIR)
- LIBDOT_SEARCH_PATH=$(CHROMEAPPS) $(LIB_DOT)/bin/concat.sh -i $(HTERM)/concat/hterm_deps.concat -o $(INSTALL_DIR)/hterm.concat.js
- LIBDOT_SEARCH_PATH=$(CHROMEAPPS) $(LIB_DOT)/bin/concat.sh -i $(HTERM)/concat/hterm.concat -o $(INSTALL_DIR)/hterm2.concat.js
- chmod +w $(INSTALL_DIR)/hterm2.concat.js $(INSTALL_DIR)/hterm.concat.js
- cat $(INSTALL_DIR)/hterm2.concat.js >> $(INSTALL_DIR)/hterm.concat.js
- rm $(INSTALL_DIR)/hterm2.concat.js
- cp ../../build_tools/naclterm.js $(INSTALL_DIR)
- cp ../../build_tools/pipeserver.js $(INSTALL_DIR)
- cp ../../build_tools/naclprocess.js $(INSTALL_DIR)
-ifeq ($(TOOLCHAIN),pnacl)
- sed -i.bak 's/x-nacl/x-pnacl/g' $(INSTALL_DIR)/naclprocess.js
-endif
-
-install: install-hterm
- ../../build_tools/template_expand.py manifest.json version=$(NACLPORTS_REVISION) > $(INSTALL_DIR)/manifest.json
- tar -h -c -C ${NACL_PREFIX} -f $(DATA_ARCHIVE) ${ASSETS}
-ifeq ($(TOOLCHAIN),glibc)
- tar -h -r -C ${NACL_PREFIX} -f $(DATA_ARCHIVE) ${EXTRA_LIBS}
-endif
- shasum $(DATA_ARCHIVE) > $(DATA_ARCHIVE).hash
- cp $(OUTDIR)/ruby*$(EXEEXT) $(INSTALL_DIR)
- rm -f $(INSTALL_DIR)/*_unstripped*$(EXEEXT)
- cp $(OUTDIR)/ruby.nmf $(INSTALL_DIR)
- cp index.html $(INSTALL_DIR)
- cp ruby.js $(INSTALL_DIR)
- cp background.js ${INSTALL_DIR}
- cp icon_16.png ${INSTALL_DIR}
- cp icon_48.png ${INSTALL_DIR}
- cp icon_128.png ${INSTALL_DIR}
-ifeq ($(TOOLCHAIN),glibc)
- cp -r $(OUTDIR)/lib* $(INSTALL_DIR)
-endif
- cd $(INSTALL_DIR) && rm -f ruby.zip && zip -r ruby.zip .
-
-.PHONY: install-hterm
diff --git a/ports/ruby-ppapi/README.nacl b/ports/ruby-ppapi/README.nacl
deleted file mode 100644
index 53ae85d..0000000
--- a/ports/ruby-ppapi/README.nacl
+++ /dev/null
@@ -1,14 +0,0 @@
-Ruby IRB for Chrome
-===================
-
-This is package of IRB (the interactive ruby shell) built to
-run under Native Client within chrome/chromium.
-
-The logo files here are derived from the SVG logo available at
-http://www.ruby.or.jp/en/about/logo/.
-
-Run ./nacl-ruby_ppapi.sh to build IRB for use directly within
-chrome (requires the --enable-nacl flag) or via the chome web
-store. The chrome webstore version is published here:
-
-https://chrome.google.com/webstore/detail/ruby-irb/mdoifndblccpefkbdicgahkbbcfdk
diff --git a/ports/ruby-ppapi/background.js b/ports/ruby-ppapi/background.js
deleted file mode 100644
index d6fb185..0000000
--- a/ports/ruby-ppapi/background.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('index.html', {
- 'id': 'main',
- 'bounds': {
- 'width': 800,
- 'height': 800
- }
- });
-});
diff --git a/ports/ruby-ppapi/build.sh b/ports/ruby-ppapi/build.sh
deleted file mode 100644
index 6b7f148..0000000
--- a/ports/ruby-ppapi/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2013 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.
-
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-
-EnableCliMain
-SetupSDKBuildSystem
diff --git a/ports/ruby-ppapi/icon_128.png b/ports/ruby-ppapi/icon_128.png
deleted file mode 100644
index 078839f..0000000
--- a/ports/ruby-ppapi/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/ruby-ppapi/icon_16.png b/ports/ruby-ppapi/icon_16.png
deleted file mode 100644
index ddf1749..0000000
--- a/ports/ruby-ppapi/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/ruby-ppapi/icon_48.png b/ports/ruby-ppapi/icon_48.png
deleted file mode 100644
index 787a451..0000000
--- a/ports/ruby-ppapi/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/ruby-ppapi/index.html b/ports/ruby-ppapi/index.html
deleted file mode 100644
index 5cc3186..0000000
--- a/ports/ruby-ppapi/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Ruby (IRB)</title>
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
- <META HTTP-EQUIV="Expires" CONTENT="-1" />
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="ruby.js"></script>
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- overflow: hidden;
- }
-
- #terminal {
- display: block;
- position: static;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/ruby-ppapi/main.c b/ports/ruby-ppapi/main.c
deleted file mode 100644
index ae4778e..0000000
--- a/ports/ruby-ppapi/main.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) 2013 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. */
-
-#undef RUBY_EXPORT
-#include <ruby.h>
-#include <spawn.h>
-#include <stdio.h>
-
-#include "nacl_main.h"
-
-#ifdef __x86_64__
-#define NACL_ARCH "x86_64"
-#elif defined __i386__
-/*
- * Use __i386__ rather then __i686__ since the latter is not defined
- * by i686-nacl-clang.
- */
-#define NACL_ARCH "x86_32"
-#elif defined __arm__
-#define NACL_ARCH "arm"
-#elif defined __pnacl__
-#define NACL_ARCH "pnacl"
-#else
-#error "unknown arch"
-#endif
-
-#define DATA_ARCHIVE "rbdata-" NACL_ARCH ".tar"
-
-int main(int argc, char** argv) {
- if (nacl_startup_untar(argv[0], DATA_ARCHIVE, "/"))
- return -1;
-
- if (argc == 2 && !strcmp(argv[1], "/bin/irb"))
- fprintf(stderr, "Launching irb ...\n");
- ruby_sysinit(&argc, &argv);
- {
- RUBY_INIT_STACK;
- ruby_init();
- return ruby_run_node(ruby_options(argc, argv));
- }
-}
diff --git a/ports/ruby-ppapi/manifest.json b/ports/ruby-ppapi/manifest.json
deleted file mode 100644
index 175f022..0000000
--- a/ports/ruby-ppapi/manifest.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "Ruby (IRB)",
- "description": "Ruby IRB interactive shell built with Native Client",
- "version": "2.0.0.%(version)s",
- "manifest_version": 2,
- "minimum_chrome_version": "30",
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "permissions": [
- "clipboardRead",
- "clipboardWrite",
- "storage",
- "unlimitedStorage",
- { "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/ruby-ppapi/pkg_info b/ports/ruby-ppapi/pkg_info
deleted file mode 100644
index b26a574..0000000
--- a/ports/ruby-ppapi/pkg_info
+++ /dev/null
@@ -1,4 +0,0 @@
-NAME=ruby-ppapi
-VERSION=0.1
-DEPENDS=(ruby libtar glibc-compat nacl-spawn)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/ruby-ppapi/ruby.js b/ports/ruby-ppapi/ruby.js
deleted file mode 100644
index f10ddc5..0000000
--- a/ports/ruby-ppapi/ruby.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-NaClTerm.nmf = 'ruby.nmf';
-
-/*
- * Pass /bin/irb as argv[1] by default so we get an interactive
- * shell
- */
-NaClTerm.argv = ['/bin/irb'];
diff --git a/ports/ruby/build.sh b/ports/ruby/build.sh
deleted file mode 100644
index 140b3e7..0000000
--- a/ports/ruby/build.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (c) 2013 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.
-
-MAKE_TARGETS="pprogram"
-INSTALL_TARGETS="install-nodoc"
-
-EXECUTABLES="ruby${NACL_EXEEXT} pepper-ruby${NACL_EXEEXT}"
-
-ConfigureStep() {
- # We need to build a host version of ruby for use during the nacl
- # build.
- HOST_BUILD=${WORK_DIR}/build_host
- if [ ! -x ${HOST_BUILD}/inst/bin/ruby ]; then
- Banner "Building ruby for host"
- MakeDir ${HOST_BUILD}
- ChangeDir ${HOST_BUILD}
- CFLAGS="" LDFLAGS="" LogExecute ${SRC_DIR}/configure --prefix=$PWD/inst
- LogExecute make -j${OS_JOBS} miniruby
- LogExecute make -j${OS_JOBS} install-nodoc
- cd -
- fi
-
- # TODO(sbc): remove once getaddrinfo() is working
- EXTRA_CONFIGURE_ARGS=--disable-ipv6
-
- EnableGlibcCompat
-
- if [ "${NACL_LIBC}" = "newlib" ]; then
- EXTRA_CONFIGURE_ARGS+=" --with-static-linked-ext --with-newlib"
- else
- EXTRA_CONFIGURE_ARGS+=" --with-out-ext=openssl,digest/*"
- fi
-
- SetupCrossEnvironment
- LogExecute ${SRC_DIR}/configure \
- --host=${CONF_HOST} \
- --build=${CONF_BUILD} \
- --prefix=/ \
- --with-baseruby=${HOST_BUILD}/inst/bin/ruby \
- --with-http=no \
- --with-html=no \
- --with-ftp=no \
- --${NACL_OPTION}-mmx \
- --${NACL_OPTION}-sse \
- --${NACL_OPTION}-sse2 \
- --${NACL_OPTION}-asm \
- --with-x=no \
- ${EXTRA_CONFIGURE_ARGS}
-}
-
-InstallStep() {
- DESTDIR=${DESTDIR}/${PREFIX}
- DefaultInstallStep
-}
diff --git a/ports/ruby/nacl.patch b/ports/ruby/nacl.patch
deleted file mode 100644
index 59bd5df..0000000
--- a/ports/ruby/nacl.patch
+++ /dev/null
@@ -1,473 +0,0 @@
-diff --git a/.gitignore b/.gitignore
---- a/.gitignore
-+++ b/.gitignore
-@@ -50,7 +50,6 @@ y.tab.c
- /config.h.in
- /config.status
- /config.status.lineno
--/configure
- /doc/capi
- /enc.mk
- /encdb.h
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -199,7 +199,7 @@ miniruby$(EXEEXT):
- $(PROGRAM):
- @$(RM) $@
- $(ECHO) linking $@
-- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
-+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@
- $(Q) $(POSTLINK)
-
- # We must `rm' the library each time this rule is invoked because "updating" a
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -3160,11 +3160,13 @@ esac
- fi
-
-
-- case "$build_cpu" in #(
-+ case "$target_cpu" in #(
- x86_64|i?86) :
- nacl_cv_cpu_nick=x86 ;; #(
-+ le32) :
-+ nacl_cv_cpu_nick=pnacl; ac_cv_exeext=.pexe ;; #(
- *) :
-- nacl_cv_cpu_nick=$build_cpu ;;
-+ nacl_cv_cpu_nick=$target_cpu ;;
- esac
- case "$build_os" in #(
- linux*) :
-@@ -3185,6 +3187,9 @@ $as_echo_n "checking NativeClient toolchain... " >&6; }
- if test -d \
- "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
- NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
-+ elif test -d \
-+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"; then
-+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"
- else
- case "${nacl_cv_build_variant}" in #(
- glibc) :
-@@ -8272,15 +8277,6 @@ esac
- *) :
- CPPFLAGS="$CPPFLAGS -DNACL_NEWLIB" ;;
- esac
-- # RUBY_APPEND_OPTION(LIBS, '-lnosys')
-- case " ${LIBS-} " in #(
-- *' '-lnosys' '*) :
-- ;; #(
-- ' ') :
-- LIBS="'-lnosys'" ;; #(
-- *) :
-- LIBS="$LIBS '-lnosys'" ;;
--esac
- else
- # RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
- case " ${XCFLAGS-} " in #(
-@@ -8292,8 +8288,6 @@ esac
- XCFLAGS="$XCFLAGS -fPIC" ;;
- esac
- fi
-- ac_cv_func_shutdown=no
-- ac_cv_func_fcntl=no
- ;; #(
- *) :
- LIBS="-lm $LIBS" ;;
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -90,8 +90,11 @@ AC_DEFUN([RUBY_NACL],
- [no], [nacl_cv_build_variant=glibc],
- [yes], [nacl_cv_build_variant=newlib])])
-
-- AS_CASE(["$build_cpu"],
-- [x86_64|i?86], [nacl_cv_cpu_nick=x86], [nacl_cv_cpu_nick=$build_cpu])
-+ AS_CASE(["$target_cpu"],
-+ [x86_64|i?86], [nacl_cv_cpu_nick=x86],
-+ [le32], [nacl_cv_cpu_nick=pnacl
-+ ac_cv_exeext=.pexe],
-+ [nacl_cv_cpu_nick=$target_cpu])
- AS_CASE(["$build_os"],
- [linux*], [nacl_cv_os_nick=linux],
- [darwin*], [nacl_cv_os_nick=mac],
-@@ -105,6 +108,9 @@ AC_DEFUN([RUBY_NACL],
- if test -d \
- "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
- NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
-+ elif test -d \
-+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"; then
-+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"
- else
- AS_CASE(
- ["${nacl_cv_build_variant}"],
-@@ -950,12 +956,9 @@ $POSTLINK"
- LIBS="-lm $LIBS"
- if test "${nacl_cv_build_variant}" = "newlib"; then
- RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
-- RUBY_APPEND_OPTION(LIBS, '-lnosys')
- else
- RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
- fi
-- ac_cv_func_shutdown=no
-- ac_cv_func_fcntl=no
- ],
- [ LIBS="-lm $LIBS"])
-
-diff --git a/dln.c b/dln.c
---- a/dln.c
-+++ b/dln.c
-@@ -1318,28 +1318,13 @@ dln_load(const char *file)
- # define RTLD_GLOBAL 0
- #endif
-
--#ifdef __native_client__
-- char* p, *orig;
-- if (file[0] == '.' && file[1] == '/') file+=2;
-- orig = strdup(file);
-- for (p = file; *p; ++p) {
-- if (*p == '/') *p = '_';
-- }
--#endif
- /* Load file */
- if ((handle = (void*)dlopen(file, RTLD_LAZY|RTLD_GLOBAL)) == NULL) {
--#ifdef __native_client__
-- free(orig);
--#endif
- error = dln_strerror();
- goto failed;
- }
-
- init_fct = (void(*)())(VALUE)dlsym(handle, buf);
--#ifdef __native_client__
-- strcpy(file, orig);
-- free(orig);
--#endif
- #if defined __SYMBIAN32__
- if (init_fct == NULL) {
- init_fct = (void(*)())dlsym(handle, "1"); /* Some Symbian versions do not support symbol table in DLL, ordinal numbers only */
-diff --git a/ext/readline/readline.c b/ext/readline/readline.c
---- a/ext/readline/readline.c
-+++ b/ext/readline/readline.c
-@@ -1883,7 +1883,7 @@ Init_readline()
-
- rl_attempted_completion_function = readline_attempted_completion_function;
- #if defined(HAVE_RL_PRE_INPUT_HOOK)
-- rl_pre_input_hook = (Function *)readline_pre_input_hook;
-+ rl_pre_input_hook = readline_pre_input_hook;
- #endif
- #ifdef HAVE_RL_CATCH_SIGNALS
- rl_catch_signals = 0;
-diff --git a/ext/socket/addrinfo.h b/ext/socket/addrinfo.h
---- a/ext/socket/addrinfo.h
-+++ b/ext/socket/addrinfo.h
-@@ -140,6 +140,25 @@ struct addrinfo {
- };
- #endif
-
-+#ifdef __native_client__
-+/*
-+ * nacl_io does not yet support getaddrinfo() but it
-+ * exists as a stub and so ruby thinks it does.
-+ * TODO(sbc): remove once this gets fixed: http://crbug.com/315197
-+ */
-+#undef HAVE_GETADDRINFO
-+#undef HAVE_GETNAMEINFO
-+#undef HAVE_FREEHOSTENT
-+#undef HAVE_FREEADDRINFO
-+
-+#ifndef __GLIBC__
-+/*
-+ * TODO(sbc): Remove once this gets fixed: http://crbug.com/315196
-+ */
-+typedef uint32_t u_int32_t;
-+#endif
-+#endif
-+
- #ifndef HAVE_GETADDRINFO
- #undef getaddrinfo
- #define getaddrinfo getaddrinfo__compat
-diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
---- a/ext/socket/extconf.rb
-+++ b/ext/socket/extconf.rb
-@@ -423,7 +423,7 @@ $objs = [
- ]
-
- if getaddr_info_ok == :wide or
-- !have_func("getnameinfo", headers) or !have_func("getaddrinfo", headers)
-+ !have_func("getnameinfo", headers) or !have_func("getaddrinfo", headers) or RUBY_PLATFORM =~ /nacl/
- if have_struct_member("struct in6_addr", "s6_addr8", headers)
- $defs[-1] = "s6_addr=s6_addr8"
- end
-diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
---- a/ext/socket/rubysocket.h
-+++ b/ext/socket/rubysocket.h
-@@ -90,6 +90,18 @@
- #define EWOULDBLOCK EAGAIN
- #endif
-
-+#ifdef __native_client__
-+/*
-+ * nacl_io does not yet support getaddrinfo() but it
-+ * exists as a stub and so ruby thinks it does.
-+ * TODO(sbc): remove once getaddrinfo is added to nacl_io.
-+ */
-+#undef HAVE_GETADDRINFO
-+#undef HAVE_GETNAMEINFO
-+#undef HAVE_FREEHOSTENT
-+#undef HAVE_FREEADDRINFO
-+#endif
-+
- /*
- * workaround for NetBSD, OpenBSD and etc.
- * The problem is since 4.4BSD-Lite.
-diff --git a/file.c b/file.c
---- a/file.c
-+++ b/file.c
-@@ -1074,6 +1074,14 @@ rb_group_member(GETGROUPS_T gid)
- #define USE_GETEUID 1
- #endif
-
-+#ifdef __native_client__
-+// Although the NaCl toolchain contain eaccess() is it not yet
-+// overridden by nacl_io.
-+// TODO(sbc): Remove this once eaccess() is wired up correctly
-+// in NaCl.
-+#define eaccess access
-+#endif
-+
- #ifndef HAVE_EACCESS
- int
- eaccess(const char *path, int mode)
-@@ -5254,7 +5262,7 @@ rb_path_check(const char *path)
-
- #ifndef _WIN32
- #ifdef __native_client__
--__attribute__((noinline))
-+__attribute__((noinline,weak))
- #endif
- int
- rb_file_load_ok(const char *path)
-diff --git a/io.c b/io.c
---- a/io.c
-+++ b/io.c
-@@ -31,9 +31,7 @@
- #if defined HAVE_NET_SOCKET_H
- # include <net/socket.h>
- #elif defined HAVE_SYS_SOCKET_H
--# ifndef __native_client__
--# include <sys/socket.h>
--# endif
-+# include <sys/socket.h>
- #endif
-
- #if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__EMX__) || defined(__BEOS__) || defined(__HAIKU__)
-@@ -52,9 +50,6 @@
- #if defined(HAVE_SYS_IOCTL_H) && !defined(_WIN32)
- #include <sys/ioctl.h>
- #endif
--#if defined(__native_client__) && defined(NACL_NEWLIB)
--# include "nacl/ioctl.h"
--#endif
- #if defined(HAVE_FCNTL_H) || defined(_WIN32)
- #include <fcntl.h>
- #elif defined(HAVE_SYS_FCNTL_H)
-@@ -8534,6 +8529,14 @@ typedef long fcntl_arg_t;
- typedef int fcntl_arg_t;
- #endif
-
-+#if defined __native_client__ && !defined __GLIBC__
-+// struct flock is currently missing the NaCl newlib headers
-+// TODO(sbc): remove this once it gets added.
-+#undef F_GETLK
-+#undef F_SETLK
-+#undef F_SETLKW
-+#endif
-+
- static long
- fcntl_narg_len(int cmd)
- {
-diff --git a/nacl/GNUmakefile.in b/nacl/GNUmakefile.in
---- a/nacl/GNUmakefile.in
-+++ b/nacl/GNUmakefile.in
-@@ -4,48 +4,59 @@
- include Makefile
- -include uncommon.mk
-
-+# Remove the default -D_FORTIFY_SOURCE=2 from CFLAGS. Without this
-+# NaCl's glibc build generates undefined references to __memset_chk.
-+# TODO(sbc): Remove this once NaCl's glibc is fixed.
-+XCFLAGS := $(filter-out -D_FORTIFY_SOURCE=2,$(XCFLAGS))
-+
- NACL_SDK_ROOT=@NACL_SDK_ROOT@
- NACL_TOOLCHAIN=@NACL_TOOLCHAIN@
- NACL_TOOLCHAIN_DIR=$(NACL_SDK_ROOT)/toolchain/$(NACL_TOOLCHAIN)
-+
-+# Don't override CC/LD/etc if they are already set to absolute
-+# paths (this is the case when building in the webports tree).
-+ifeq ($(dir $(CC)),./)
- CC:=$(NACL_TOOLCHAIN_DIR)/bin/$(CC)
-+endif
-+ifeq ($(dir $(LD)),./)
- LD:=$(NACL_TOOLCHAIN_DIR)/bin/$(LD)
-+endif
-+ifeq ($(dir $(NM)),./)
- NM:=$(NACL_TOOLCHAIN_DIR)/bin/$(NM)
-+endif
-+ifeq ($(dir $(AR)),./)
- AR:=$(NACL_TOOLCHAIN_DIR)/bin/$(AR)
-+endif
-+ifeq ($(dir $(AS)),./)
- AS:=$(NACL_TOOLCHAIN_DIR)/bin/$(AS)
-+endif
-+ifeq ($(dir $(RANLIB)),./)
- RANLIB:=$(NACL_TOOLCHAIN_DIR)/bin/$(RANLIB)
--OBJDUMP:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJDUMP)
-+endif
-+ifeq ($(dir $(OBJCOPY)),./)
- OBJCOPY:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJCOPY)
-+endif
- PYTHON=@PYTHON@
-
- PPROGRAM=pepper-$(PROGRAM)
- PEPPER_LIBS=-lppapi
--PROGRAM_NMF=$(PROGRAM:.nexe=.nmf)
--PPROGRAM_NMF=$(PPROGRAM:.nexe=.nmf)
-+PROGRAM_NMF=$(PROGRAM:$(EXEEXT)=.nmf)
-+PPROGRAM_NMF=$(PPROGRAM:$(EXEEXT)=.nmf)
-
- GNUmakefile: $(srcdir)/nacl/GNUmakefile.in
- $(PPROGRAM): $(PROGRAM) pepper_main.$(OBJEXT)
- $(Q)$(MAKE) $(MFLAGS) PROGRAM=$(PPROGRAM) MAINOBJ="pepper_main.$(OBJEXT)" LIBS="$(LIBS) $(PEPPER_LIBS)" program
--$(PROGRAM_NMF) $(PPROGRAM_NMF): $(@:.nmf=.nexe) nacl/create_nmf.rb
-+$(PROGRAM_NMF) $(PPROGRAM_NMF): $(@:.nmf=$(EXEEXT)) nacl/create_nmf.rb
-
- .PHONY: pprogram package show_naclflags
--.SUFFIXES: .nexe .nmf
--.nexe.nmf:
-+.SUFFIXES: $(EXEEXT) .nmf
-+$(EXEEXT).nmf:
- $(ECHO) generating manifest $@
-- $(Q)$(MINIRUBY) $(srcdir)/nacl/create_nmf.rb --verbose=$(V) $(@:.nmf=.nexe) $@
-+ $(Q)$(MINIRUBY) $(srcdir)/nacl/create_nmf.rb --verbose=$(V) $(@:.nmf=$(EXEEXT)) $@
-
- pepper_main.$(OBJEXT): $(srcdir)/nacl/pepper_main.c
- @$(ECHO) compiling nacl/pepper_main.c
- $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(srcdir)/nacl/pepper_main.c
--ruby.$(OBJEXT):
-- @$(ECHO) compiling $<
-- $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@.tmp -c $<
-- $(Q) $(OBJCOPY) --weaken-symbol=rb_load_file $@.tmp $@
-- @-$(RM) $@.tmp
--file.$(OBJEXT):
-- @$(ECHO) compiling $<
-- $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@.tmp -c $<
-- $(Q) $(OBJCOPY) --weaken-symbol=rb_file_load_ok $@.tmp $@
-- @-$(RM) $@.tmp
-
- .rbconfig.time:
- @$(MAKE) .rbconfig.raw.time RBCONFIG=.rbconfig.raw.time
-@@ -56,7 +67,6 @@ file.$(OBJEXT):
- -e 's!CONFIG\["AR"\] = .*!CONFIG\["AR"\] = "$(AR)"!' \
- -e 's!CONFIG\["AS"\] = .*!CONFIG\["AS"\] = "$(AS)"!' \
- -e 's!CONFIG\["RANLIB"\] = .*!CONFIG\["RANLIB"\] = "$(RANLIB)"!' \
-- -e 's!CONFIG\["OBJDUMP"\] = .*!CONFIG\["OBJDUMP"\] = "$(OBJDUMP)"!' \
- -e 's!CONFIG\["OBJCOPY"\] = .*!CONFIG\["OBJCOPY"\] = "$(OBJCOPY)"!' \
- -i.bak rbconfig.rb
- @touch .rbconfig.time
-@@ -80,7 +90,6 @@ show_naclflags:
- @echo " AR = $(AR)"
- @echo " AS = $(AS)"
- @echo " RANLIB = $(RANLIB)"
-- @echo " OBJDUMP = $(OBJDUMP)"
- @echo " OBJCOPY = $(OBJCOPY)"
-
- clean-local::
-diff --git a/nacl/create_nmf.rb b/nacl/create_nmf.rb
---- a/nacl/create_nmf.rb
-+++ b/nacl/create_nmf.rb
-@@ -19,7 +19,6 @@ def create_dynamically_linked(nmf, exe)
- cmd = [
- PYTHON, CREATE_NMF,
- '-o', nmf,
-- '-D', OBJDUMP,
- '-L', HOST_LIB,
- exe
- ]
-diff --git a/nacl/nacl-config.rb b/nacl/nacl-config.rb
---- a/nacl/nacl-config.rb
-+++ b/nacl/nacl-config.rb
-@@ -16,7 +16,6 @@ module NaClConfig
-
- lib_suffix = config['host_cpu'][/i.86/] ? '32' : ''
- PYTHON = config['PYTHON']
-- OBJDUMP = config['OBJDUMP']
- SDK_ROOT = config['NACL_SDK_ROOT']
- CREATE_NMF = [
- File.join(SDK_ROOT, 'build_tools', 'nacl_sdk_scons', 'site_tools', 'create_nmf.py'),
-@@ -27,14 +26,13 @@ module NaClConfig
- INSTALL_PROGRAM = config['INSTALL_PROGRAM']
- INSTALL_LIBRARY = config['INSTALL_DATA']
-
-- SEL_LDR = [
-- File.join(SDK_ROOT, 'toolchain', config['NACL_TOOLCHAIN'], 'bin', "sel_ldr_#{cpu_nick}"),
-- File.join(SDK_ROOT, 'tools', "sel_ldr_#{cpu_nick}")
-- ].find{|path| File.executable?(path)} or raise "No sel_ldr found"
-- IRT_CORE = [
-- File.join(SDK_ROOT, 'toolchain', config['NACL_TOOLCHAIN'], 'bin', "irt_core_#{cpu_nick}.nexe"),
-- File.join(SDK_ROOT, 'tools', "irt_core_#{cpu_nick}.nexe")
-- ].find{|path| File.executable?(path)} or raise "No irt_core found"
-+ if cpu_nick == 'x86_64' or cpu_nick == 'x86_32'
-+ SEL_LDR = File.join(SDK_ROOT, 'tools', "sel_ldr_#{cpu_nick}")
-+ IRT_CORE = File.join(SDK_ROOT, 'tools', "irt_core_#{cpu_nick}.nexe")
-+ raise "No sel_ldr found" if not File.executable?(SEL_LDR)
-+ raise "No irt_core found" if not File.exists?(IRT_CORE)
-+ end
-+
- RUNNABLE_LD = File.join(HOST_LIB, 'runnable-ld.so')
-
- module_function
-diff --git a/nacl/pepper_main.c b/nacl/pepper_main.c
---- a/nacl/pepper_main.c
-+++ b/nacl/pepper_main.c
-@@ -210,7 +210,7 @@ pruby_async_return_value(void* data, VALUE value)
- static struct PP_Var
- pruby_cstr_to_var(const char* str)
- {
--#ifdef PPB_VAR_INTERFACE_1_0
-+#ifndef PPB_VAR_INTERFACE_1_1
- if (var_interface != NULL)
- return var_interface->VarFromUtf8(module_id, str, strlen(str));
- return PP_MakeUndefined();
-@@ -252,7 +252,7 @@ pruby_str_to_var(volatile VALUE str)
- fprintf(stderr, "[BUG] Unexpected object type: %x\n", TYPE(str));
- exit(EXIT_FAILURE);
- }
--#ifdef PPB_VAR_INTERFACE_1_0
-+#ifndef PPB_VAR_INTERFACE_1_1
- if (var_interface != NULL) {
- return var_interface->VarFromUtf8(module_id, RSTRING_PTR(str), RSTRING_LEN(str));
- }
-@@ -517,7 +517,7 @@ static void Instance_DidDestroy(PP_Instance instance) {
- * the top left of the plugin's coordinate system (not the page). If the
- * plugin is invisible, @a clip will be (0, 0, 0, 0).
- */
--#ifdef PPP_INSTANCE_INTERFACE_1_0
-+#ifndef PPP_INSTANCE_INTERFACE_1_1
- static void
- Instance_DidChangeView(PP_Instance instance,
- const struct PP_Rect* position,
-diff --git a/ruby.c b/ruby.c
---- a/ruby.c
-+++ b/ruby.c
-@@ -1747,6 +1747,9 @@ load_file(VALUE parser, VALUE fname, int script, struct cmdline_options *opt)
- return (NODE *)rb_ensure(load_file_internal, (VALUE)&arg, restore_lineno, rb_gv_get("$."));
- }
-
-+#ifdef __native_client__
-+__attribute__((weak))
-+#endif
- void *
- rb_load_file(const char *fname)
- {
diff --git a/ports/ruby/pkg_info b/ports/ruby/pkg_info
deleted file mode 100644
index d176e54..0000000
--- a/ports/ruby/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=ruby
-VERSION=2.0.0-p247
-URL=ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
-LICENSE=BSD
-DEPENDS=(readline zlib)
-SHA1=850b93afb5914ee3f38f0769e309abf0cedf084b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/samba/README.nacl b/ports/samba/README.nacl
deleted file mode 100644
index 7c325b7..0000000
--- a/ports/samba/README.nacl
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a work in progress. Currently only built with glibc and not tested at
-runtime yet.
-
-This is not tested or complete and is only a port of the client library.
diff --git a/ports/samba/answers b/ports/samba/answers
deleted file mode 100644
index b4b52a1..0000000
--- a/ports/samba/answers
+++ /dev/null
@@ -1,53 +0,0 @@
-Checking uname sysname type: "nacl"
-Checking uname machine type: "nacl"
-Checking uname release type: "nacl"
-Checking uname version type: "nacl"
-rpath library support: OK
--Wl,--version-script support: FAIL
-Checking for WORDS_BIGENDIAN: FAIL
-Checking size of bool: "1"
-Checking size of char: "1"
-Checking size of int: "4"
-Checking size of long long: "8"
-Checking size of long: "4"
-Checking size of short: "2"
-Checking size of size_t: "4"
-Checking size of ssize_t: "4"
-Checking size of int8_t: "1"
-Checking size of uint8_t: "1"
-Checking size of int16_t: "2"
-Checking size of uint16_t: "2"
-Checking size of int32_t: "4"
-Checking size of uint32_t: "4"
-Checking size of int64_t: "8"
-Checking size of uint64_t: "8"
-Checking size of void*: "4"
-Checking size of off_t: "8"
-Checking size of dev_t: "4"
-Checking size of ino_t: "4"
-Checking size of time_t: "8"
-Checking correct behavior of strtoll: FAIL
-Checking for working strptime: OK
-Checking for C99 vsnprintf: OK
-Checking for HAVE_SHARED_MMAP: FAIL
-Checking for HAVE_MREMAP: FAIL
-Checking for HAVE_INCOHERENT_MMAP: FAIL
-Checking value of NSIG: "0"
-Checking value of _NSIG: "0"
-Checking value of SIGRTMAX: "0"
-Checking value of SIGRTMIN: "0"
-Checking whether blkcnt_t is 32 bit: OK
-Checking whether blkcnt_t is 64 bit: FAIL
-Checking if can we convert from CP850 to UCS-2LE: FAIL
-Checking if can we convert from IBM850 to UCS-2LE: FAIL
-Checking if can we convert from UTF-8 to UCS-2LE: FAIL
-Checking if can we convert from UTF8 to UCS-2LE: FAIL
-vfs_fileid checking for statfs() and struct statfs.f_fsid: FAIL
-Checking size of ((struct utmp *)NULL)->ut_line: FAIL
-Checking whether we can use Linux thread-specific credentials: FAIL
-Checking whether setreuid is available: FAIL
-Checking whether setresuid is available: FAIL
-Checking whether seteuid is available: FAIL
-Checking for HAVE_IFACE_GETIFADDRS: FAIL
-Checking for HAVE_IFACE_IFCONF: FAIL
-Checking for HAVE_IFACE_IFREQ: FAIL
diff --git a/ports/samba/build.sh b/ports/samba/build.sh
deleted file mode 100755
index 76b4fb3..0000000
--- a/ports/samba/build.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2015 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.
-
-# Samba doesn't seem to support building outside the source tree.
-BUILD_DIR=${SRC_DIR}
-
-EnableGlibcCompat
-
-ConfigureStep() {
- NACLPORTS_CPPFLAGS+=" -DFAKE_GET_INTERFACES=1"
- NACLPORTS_CPPFLAGS="${NACLPORTS_CPPFLAGS/-fdiagnostics-color=auto/}"
- NACLPORTS_LDFLAGS="${NACLPORTS_CPPFLAGS/-fdiagnostics-color=auto/}"
- SetupCrossEnvironment
-
- # Inject a shim that speed up pnacl invocations for configure.
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- local PNACL_CONF_SHIM="${TOOLS_DIR}/pnacl-configure-shim.py"
- CC="${PNACL_CONF_SHIM} ${CC}"
- fi
-
- CC="${START_DIR}/cc_shim.sh ${CC}"
-
- # Specify both --build and --host options. This forces autoconf into cross
- # compile mode. This is useful since the autodection doesn't always works.
- # For example a trivial PNaCl binary can sometimes run on the linux host if
- # it has the correct LLVM bimfmt support. What is more, autoconf will
- # generate a warning if only --host is specified.
- LogExecute "${SRC_DIR}/configure" \
- --build=${CONF_BUILD} \
- --hostcc=gcc \
- --cross-compile \
- --cross-answers=${START_DIR}/answers \
- --prefix=${PREFIX}
-}
-
-BuildStep() {
- WAF_ARGS="--targets=smbclient"
- if [ "${VERBOSE:-}" = "1" ]; then
- WAF_ARGS+=" -v"
- fi
- WAF_MAKE=1 LogExecute python ./buildtools/bin/waf build ${WAF_ARGS}
-}
-
-InstallStep() {
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}
-
- # Copy the .so files.
- LogExecute find bin/default/ -name *.so -exec \
- cp -vuni '{}' "${DESTDIR_LIB}" ";"
-
- # Copy the headers files.
- MakeDir ${DESTDIR_INCLUDE}/samba
- LogExecute cp -r bin/default/include/public/* ${DESTDIR_INCLUDE}/samba
-
- # Make the symlinks for the versioned .so files.
- # TODO(zentaro): Generate this mapping automatically.
- #
- # List created with;
- # find out/build/samba/samba-4.1.16/bin/ -name *.so.* -exec ls -l '{}' ";" |
- # awk -F ' ' '{print $9, $11}'
- ChangeDir ${DESTDIR_LIB}
-
- LogExecute ln -sf libsmbclient.so libsmbclient.so.0
- LogExecute ln -sf libsmbconf.so libsmbconf.so.0
- LogExecute ln -sf libsamba-util.so libsamba-util.so.0
- LogExecute ln -sf libndr.so libndr.so.0
- LogExecute ln -sf libdcerpc-binding.so libdcerpc-binding.so.0
- LogExecute ln -sf libsamdb.so libsamdb.so.0
- LogExecute ln -sf libndr-nbt.so libndr-nbt.so.0
- LogExecute ln -sf libwbclient.so libwbclient.so.0
- LogExecute ln -sf libndr-standard.so libndr-standard.so.0
- LogExecute ln -sf libgensec.so libgensec.so.0
- LogExecute ln -sf libkrb5-samba4.so libkrb5-samba4.so.26
- LogExecute ln -sf libtalloc.so libtalloc.so.2
- LogExecute ln -sf libntdb.so libntdb.so.0
- LogExecute ln -sf libtdb.so libtdb.so.1
- LogExecute ln -sf libroken-samba4.so libroken-samba4.so.19
- LogExecute ln -sf libcom_err-samba4.so libcom_err-samba4.so.0
- LogExecute ln -sf libldb.so libldb.so.1
- LogExecute ln -sf libhx509-samba4.so libhx509-samba4.so.5
- LogExecute ln -sf libasn1-samba4.so libasn1-samba4.so.8
- LogExecute ln -sf libwind-samba4.so libwind-samba4.so.0
- LogExecute ln -sf libtevent.so libtevent.so.0
- LogExecute ln -sf libgssapi-samba4.so libgssapi-samba4.so.2
- LogExecute ln -sf libhcrypto-samba4.so libhcrypto-samba4.so.5
- LogExecute ln -sf libheimbase-samba4.so libheimbase-samba4.so.1
- LogExecute ln -sf libndr-krb5pac.so libndr-krb5pac.so.0
- LogExecute ln -sf libtevent-util.so libtevent-util.so.0
- LogExecute ln -sf libsamba-credentials.so libsamba-credentials.so.0
- LogExecute ln -sf libsamba-hostconfig.so libsamba-hostconfig.so.0
-}
diff --git a/ports/samba/cc_shim.sh b/ports/samba/cc_shim.sh
deleted file mode 100755
index 5e2b756..0000000
--- a/ports/samba/cc_shim.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2015 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.
-
-is_host=0
-
-for x in $*; do
- if [ ${x} = -D_SAMBA_HOSTCC_ ]; then
- is_host=1
- fi
- if [[ ${x} = *asn1/gen_template_132.o ]]; then
- is_host=1
- fi
- if [[ ${x} = */compile_et_134.o ]]; then
- is_host=1
- fi
- if [[ ${x} = */print_version_130.o ]]; then
- is_host=1
- fi
- if [[ ${x} = */version_130.o ]]; then
- is_host=1
- fi
-done
-
-
-if [ ${is_host} = 1 ]; then
- shift
- gcc $*
-else
- $*
-fi
diff --git a/ports/samba/nacl.patch b/ports/samba/nacl.patch
deleted file mode 100644
index 907fc47..0000000
--- a/ports/samba/nacl.patch
+++ /dev/null
@@ -1,441 +0,0 @@
-diff --git a/.gitignore b/.gitignore
-new file mode 100644
---- /dev/null
-+++ b/.gitignore
-@@ -0,0 +1,2 @@
-+*.pyc
-+/bin
-diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
---- a/buildtools/wafsamba/samba_python.py
-+++ b/buildtools/wafsamba/samba_python.py
-@@ -37,6 +37,8 @@ def SAMBA_PYTHON(bld, name,
- enabled=True):
- '''build a python extension for Samba'''
-
-+ return
-+
- # when we support static python modules we'll need to gather
- # the list from all the SAMBA_PYTHON() targets
- if init_function_sentinel is not None:
-diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
---- a/buildtools/wafsamba/wafsamba.py
-+++ b/buildtools/wafsamba/wafsamba.py
-@@ -135,6 +135,9 @@ def SAMBA_LIBRARY(bld, libname, source,
- enabled=True):
- '''define a Samba library'''
-
-+ if pyembed or pyext:
-+ return
-+
- if LIB_MUST_BE_PRIVATE(bld, libname):
- private_library=True
-
-@@ -520,6 +523,9 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
- pyembed=False):
- '''define a Samba subsystem'''
-
-+ if pyext or pyembed:
-+ return
-+
- if not enabled:
- SET_TARGET_TYPE(bld, modname, 'DISABLED')
- return
-diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
---- a/buildtools/wafsamba/wscript
-+++ b/buildtools/wafsamba/wscript
-@@ -291,7 +291,7 @@ def configure(conf):
- conf.CHECK_CODE('printf("hello world")',
- define='HAVE_SIMPLE_C_PROG',
- mandatory=True,
-- execute=True,
-+# execute=True,
- headers='stdio.h',
- msg='Checking simple C program')
-
-@@ -372,8 +372,8 @@ def configure(conf):
- conf.CHECK_HEADERS('limits.h assert.h')
-
- # see if we need special largefile flags
-- if not conf.CHECK_LARGEFILE():
-- raise Utils.WafError('Samba requires large file support support, but not available on this platform: sizeof(off_t) < 8')
-+# if not conf.CHECK_LARGEFILE():
-+# raise Utils.WafError('Samba requires large file support support, but not available on this platform: sizeof(off_t) < 8')
-
- if 'HAVE_STDDEF_H' in conf.env and 'HAVE_STDLIB_H' in conf.env:
- conf.DEFINE('STDC_HEADERS', 1)
-diff --git a/lib/ccan/wscript b/lib/ccan/wscript
---- a/lib/ccan/wscript
-+++ b/lib/ccan/wscript
-@@ -60,6 +60,7 @@ def configure(conf):
- #endif""",
- headers="endian.h sys/endian.h",
- define="HAVE_BIG_ENDIAN")
-+ conf.DEFINE('HAVE_LITTLE_ENDIAN', 1)
-
- if not conf.CONFIG_SET("HAVE_BIG_ENDIAN") and not conf.CONFIG_SET("HAVE_LITTLE_ENDIAN"):
- # That didn't work! Do runtime test.
-@@ -129,13 +130,15 @@ def configure(conf):
- # or _FILE_OFFSET_BITS defines.
- conf.check(fragment="""#include <sys/types.h>
- int main(void) { return !(sizeof(off_t) < 8); }""",
-- execute=True, msg='Checking for small off_t',
-+ #execute=True,
-+ msg='Checking for small off_t',
- define_name='SMALL_OFF_T')
- # Unreliable return value above, hence use define.
- if conf.CONFIG_SET('SMALL_OFF_T'):
- conf.check(fragment="""#include <sys/types.h>
- int main(void) { return !(sizeof(off_t) >= 8); }""",
-- execute=True, msg='Checking for -D_FILE_OFFSET_BITS=64',
-+ #execute=True,
-+ msg='Checking for -D_FILE_OFFSET_BITS=64',
- ccflags='-D_FILE_OFFSET_BITS=64',
- define_name='HAVE_FILE_OFFSET_BITS')
-
-diff --git a/lib/ldb-samba/wscript_build b/lib/ldb-samba/wscript_build
---- a/lib/ldb-samba/wscript_build
-+++ b/lib/ldb-samba/wscript_build
-@@ -8,7 +8,7 @@ bld.SAMBA_LIBRARY('ldbsamba',
- source='ldif_handlers.c',
- autoproto='ldif_handlers_proto.h',
- public_deps='ldb',
-- deps='samba-security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA tdb pyldb-util errors',
-+ deps='samba-security ndr NDR_DRSBLOBS NDR_DNSP ldbwrap samdb-common SAMDB_SCHEMA tdb errors',
- private_library=True
- )
-
-diff --git a/lib/replace/replace.h b/lib/replace/replace.h
---- a/lib/replace/replace.h
-+++ b/lib/replace/replace.h
-@@ -904,4 +904,9 @@ void rep_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
- #include <sys/atomic.h>
- #endif
-
-+/* This is needed for the NaCl port for ARM with glibc */
-+#ifndef FIONREAD
-+#define FIONREAD 0x541B
-+#endif
-+
- #endif /* _LIBREPLACE_REPLACE_H */
-diff --git a/lib/replace/system/wait.h b/lib/replace/system/wait.h
---- a/lib/replace/system/wait.h
-+++ b/lib/replace/system/wait.h
-@@ -49,7 +49,7 @@ typedef int sig_atomic_t;
- #endif
-
- #if !defined(HAVE_WAITPID) && defined(HAVE_WAIT4)
--int rep_waitpid(pid_t pid,int *status,int options)
-+int rep_waitpid(pid_t pid,int *status,int options);
- #endif
-
- #endif
-diff --git a/lib/replace/wscript b/lib/replace/wscript
---- a/lib/replace/wscript
-+++ b/lib/replace/wscript
-@@ -540,7 +540,8 @@ removeea setea
- define='HAVE_UNIXSOCKET', headers='sys/socket.h sys/un.h')
-
-
-- conf.CHECK_CODE('''
-+ if False:
-+ conf.CHECK_CODE('''
- struct stat st;
- char tpl[20]="/tmp/test.XXXXXX";
- char tpl2[20]="/tmp/test.XXXXXX";
-diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c
---- a/lib/socket/interfaces.c
-+++ b/lib/socket/interfaces.c
-@@ -25,6 +25,11 @@
- #include "interfaces.h"
- #include "lib/util/tsort.h"
-
-+#if FAKE_GET_INTERFACES
-+# include <sys/socket.h>
-+# include <netinet/in.h>
-+#endif
-+
- /****************************************************************************
- Create a struct sockaddr_storage with the netmask bits set to 1.
- ****************************************************************************/
-@@ -138,9 +143,53 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces)
- int total = 0;
- size_t copy_size;
-
-+#if FAKE_GET_INTERFACES
-+ // Under NaCl the API's to get network interfaces do not work. This code
-+ // path provides a fake response because if nothing is returned libsmbclient
-+ // will abort startup.
-+ //
-+ // The actual values returned here are never used as far as I can tell
-+ // and name resolution/NBT is done in javascript prior to calling libsmbclient
-+ // for the purposes of the Chrome Samba app.
-+ iflist = talloc_array(mem_ctx, struct iface_struct, 1);
-+ if (iflist == NULL) {
-+ errno = ENOMEM;
-+ return -1;
-+ }
-+
-+ iflist->ifa_next = NULL;
-+ iflist->ifa_name = talloc_strdup(mem_ctx, "fake");
-+ // This is what my real interface returned. It might only be necessary to
-+ // be IFF_BROADCAST and IFF_UP?
-+ iflist->ifa_flags = 0x00011043;
-+
-+ // IP Address
-+ struct sockaddr_in* addr = talloc(mem_ctx, struct sockaddr_in);
-+ addr->sin_family = AF_INET;
-+ addr->sin_port = 0;
-+ inet_aton("192.168.2.3", &addr->sin_addr.s_addr);
-+ iflist->ifa_addr = addr;
-+
-+ // Net mask
-+ addr = talloc(mem_ctx, struct sockaddr_in);
-+ addr->sin_family = AF_INET;
-+ addr->sin_port = 0;
-+ inet_aton("255.255.255.0", &addr->sin_addr.s_addr);
-+ iflist->ifa_netmask = addr;
-+
-+ // Broadcast address.
-+ addr = talloc(mem_ctx, struct sockaddr_in);
-+ addr->sin_family = AF_INET;
-+ addr->sin_port = 0;
-+ inet_aton("192.168.2.255", &addr->sin_addr.s_addr);
-+ iflist->ifa_broadaddr = addr;
-+
-+ iflist->ifa_data = NULL;
-+#else
- if (getifaddrs(&iflist) < 0) {
- return -1;
- }
-+#endif
-
- count = 0;
- for (ifptr = iflist; ifptr != NULL; ifptr = ifptr->ifa_next) {
-@@ -223,7 +272,11 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces)
- total++;
- }
-
-+// Since the iflist was allocated by talloc in the FAKE_GET_INTERFACES case it
-+// doesn't need to be deleted.
-+#if !FAKE_GET_INTERFACES
- freeifaddrs(iflist);
-+#endif
-
- *pifaces = ifaces;
- return total;
-diff --git a/source3/wscript b/source3/wscript
---- a/source3/wscript
-+++ b/source3/wscript
-@@ -130,7 +130,7 @@ long ret = splice(0,0,1,0,400,SPLICE_F_MOVE);
- #endif
- main() {
- exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
--}''', 'HAVE_KERNEL_CHANGE_NOTIFY', addmain=False, execute=True,
-+}''', 'HAVE_KERNEL_CHANGE_NOTIFY', addmain=False, #execute=True,
- headers='fcntl.h signal.h',
- msg="Checking for kernel change notify support")
-
-@@ -144,7 +144,7 @@ main() {
- #endif
- main() {
- exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0);
--}''', 'HAVE_KERNEL_OPLOCKS_LINUX', addmain=False, execute=True,
-+}''', 'HAVE_KERNEL_OPLOCKS_LINUX', addmain=False, #execute=True,
- msg="Checking for Linux kernel oplocks")
-
- # Check for IRIX kernel oplock types
-@@ -164,7 +164,7 @@ main() {
- #endif
- main() {
- exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
--}''', 'HAVE_KERNEL_SHARE_MODES', addmain=False, execute=True,
-+}''', 'HAVE_KERNEL_SHARE_MODES', addmain=False, #execute=True,
- msg="Checking for kernel share modes")
-
- # check for fam libs
-@@ -251,7 +251,7 @@ int main(int argc, char **argv)
- ''',
- 'USEABLE_DMAPI_LIBRARY',
- addmain=False,
-- execute=False,
-+ #execute=False,
- lib=samba_dmapi_lib,
- msg='Checking whether DMAPI lib '+samba_dmapi_lib+' can be used')
- if not conf.CONFIG_SET('USEABLE_DMAPI_LIBRARY'):
-@@ -998,7 +998,7 @@ syscall(SYS_setgroups32, 0, NULL);
- addmain=False,
- execute=True,
- msg="Checking whether seteuid is available")
-- if not seteuid:
-+ if not seteuid and False:
- seteuid = conf.CHECK_CODE('''
- #define AUTOCONF_TEST 1
- #define USE_SETUIDX 1
-@@ -1040,7 +1040,7 @@ syscall(SYS_setgroups32, 0, NULL);
- ''',
- 'HAVE_FCNTL_LOCK',
- addmain=False,
-- execute=True,
-+ #execute=True,
- msg='Checking whether fcntl locking is available')
-
- # glibc up to 2.3.6 had dangerously broken posix_fallocate(). DON'T USE IT.
-@@ -1144,7 +1144,7 @@ main() {
- }''',
- '__TIME_T_MAX',
- addmain=False,
-- execute=True,
-+ #execute=True,
- msg="Checking for the maximum value of the 'time_t' type"):
- conf.DEFINE('TIME_T_MAX', '67768036191676799ll')
-
-@@ -1177,14 +1177,15 @@ main() {
- ''',
- 'REALPATH_TAKES_NULL',
- addmain=False,
-- execute=True,
-+ #execute=True,
- msg='Checking whether the realpath function allows a NULL argument')
-
- conf.CHECK_CODE('''#include "../tests/ftruncate.c"''',
- 'HAVE_FTRUNCATE_EXTEND',
- msg='Checking for ftruncate extend',
- addmain=False,
-- execute=True)
-+ #execute=True
-+ )
-
- if Options.options.with_sendfile_support:
- if (host_os.rfind('linux') > -1) or (host_os.rfind('gnu') > -1) or (host_os.rfind('k*bsd*-gnu') > -1) or (host_os.rfind('kopensolaris*-gnu') > -1):
-@@ -1323,7 +1324,7 @@ main() {
- main() {
- char *s = getcwd(NULL,0);
- exit(s != NULL ? 0 : 1);
--}''', 'GETCWD_TAKES_NULL', addmain=False, execute=True,
-+}''', 'GETCWD_TAKES_NULL', addmain=False, #execute=True,
- msg="getcwd takes a NULL argument")
-
-
-@@ -1382,7 +1383,7 @@ main() {
- cflags=conf.env['WERROR_CFLAGS'],
- define='HAVE_QUOTACTL_4A',
- msg='for QUOTACTL_4A: long quotactl(int cmd, char *special, qid_t id, caddr_t addr)',
-- execute=True,
-+ #execute=True,
- addmain=False):
-
- conf.CHECK_CODE('''
-@@ -1393,7 +1394,7 @@ main() {
- cflags=conf.env['WERROR_CFLAGS'],
- define='HAVE_QUOTACTL_4B',
- msg='for QUOTACTL_4B: int quotactl(const char *path, int cmd, int id, char *addr)',
-- execute=True,
-+ #execute=True,
- addmain=False)
-
- conf.CHECK_CODE('''
-@@ -1402,7 +1403,7 @@ main() {
- headers="rpc/rpc.h rpc/types.h rpcsvc/rquota.h rpc/nettype.h rpc/xdr.h",
- define='HAVE_NFS_QUOTAS',
- msg='for NFS QUOTAS',
-- execute=True,
-+ #execute=True,
- local_include=False)
-
- if conf.CONFIG_SET('HAVE_QUOTACTL_LINUX') or \
-diff --git a/source4/heimdal/lib/hcrypto/rand-timer.c b/source4/heimdal/lib/hcrypto/rand-timer.c
---- a/source4/heimdal/lib/hcrypto/rand-timer.c
-+++ b/source4/heimdal/lib/hcrypto/rand-timer.c
-@@ -134,7 +134,8 @@ timer_bytes(unsigned char *outdata, int size)
- pid = fork();
- if(pid == -1){
- signal(SIGCHLD, ochld != SIG_ERR ? ochld : SIG_DFL);
-- des_not_rand_data(data, size);
-+ // This is commented out for NaCl build. This function does not exist.
-+ //des_not_rand_data(data, size);
- return;
- }
- if(pid == 0)
-diff --git a/source4/libnet/wscript_build b/source4/libnet/wscript_build
---- a/source4/libnet/wscript_build
-+++ b/source4/libnet/wscript_build
-@@ -3,7 +3,7 @@
- bld.SAMBA_LIBRARY('samba-net',
- source='libnet.c libnet_passwd.c libnet_time.c libnet_rpc.c libnet_join.c libnet_site.c libnet_become_dc.c libnet_unbecome_dc.c libnet_vampire.c libnet_samdump.c libnet_samsync_ldb.c libnet_user.c libnet_group.c libnet_share.c libnet_lookup.c libnet_domain.c userinfo.c groupinfo.c userman.c groupman.c prereq_domain.c libnet_samsync.c',
- autoproto='libnet_proto.h',
-- public_deps='samba-credentials dcerpc dcerpc-samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI cli_composite LIBCLI_RESOLVE LIBCLI_FINDDCS cli_cldap LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH ndr smbpasswdparser PROVISION LIBCLI_SAMSYNC LIBTSOCKET',
-+ public_deps='samba-credentials dcerpc dcerpc-samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI cli_composite LIBCLI_RESOLVE LIBCLI_FINDDCS cli_cldap LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH ndr smbpasswdparser LIBCLI_SAMSYNC LIBTSOCKET',
- private_library=True
- )
-
-diff --git a/source4/smbd/wscript_build b/source4/smbd/wscript_build
---- a/source4/smbd/wscript_build
-+++ b/source4/smbd/wscript_build
-@@ -22,7 +22,7 @@ bld.SAMBA_BINARY('samba',
- subsystem_name='service',
- deps='''events process_model service samba-hostconfig samba-util POPT_SAMBA
- popt gensec registry ntptr ntvfs share cluster COMMON_SCHANNEL SECRETS''',
-- pyembed=True,
-+ #pyembed=True,
- install_path='${SBINDIR}',
- enabled=bld.AD_DC_BUILD_IS_ENABLED()
- )
-diff --git a/source4/torture/local/wscript_build b/source4/torture/local/wscript_build
---- a/source4/torture/local/wscript_build
-+++ b/source4/torture/local/wscript_build
-@@ -18,7 +18,7 @@ TORTURE_LOCAL_SOURCE = '''../../../lib/util/charset/tests/iconv.c
- ../../dsdb/schema/tests/schema_syntax.c
- ../../../lib/util/tests/anonymous_shared.c'''
-
--TORTURE_LOCAL_DEPS = 'RPC_NDR_ECHO TDR LIBCLI_SMB MESSAGING iconv POPT_CREDENTIALS TORTURE_AUTH TORTURE_UTIL TORTURE_NDR TORTURE_LIBCRYPTO share torture_registry PROVISION ldb samdb replace-test'
-+TORTURE_LOCAL_DEPS = 'RPC_NDR_ECHO TDR LIBCLI_SMB MESSAGING iconv POPT_CREDENTIALS TORTURE_AUTH TORTURE_UTIL TORTURE_NDR TORTURE_LIBCRYPTO share torture_registry ldb samdb replace-test'
-
- if bld.CONFIG_SET("NSS_WRAPPER"):
- TORTURE_LOCAL_SOURCE += " ../../../lib/nss_wrapper/testsuite.c"
-diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
---- a/source4/torture/wscript_build
-+++ b/source4/torture/wscript_build
-@@ -132,7 +132,7 @@ bld.SAMBA_MODULE('TORTURE_NET',
- autoproto='libnet/proto.h',
- subsystem='smbtorture',
- init_function='torture_net_init',
-- deps='samba-net POPT_CREDENTIALS torture_rpc PROVISION',
-+ deps='samba-net POPT_CREDENTIALS torture_rpc',
- internal_module=True
- )
-
-@@ -159,7 +159,7 @@ bld.SAMBA_BINARY('smbtorture',
- manpages='man/smbtorture.1',
- public_headers='smbtorture.h',
- deps='torturemain torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
-- pyembed=True
-+ #pyembed=True
- )
-
- bld.SAMBA_BINARY('gentest',
-diff --git a/source4/utils/wscript_build b/source4/utils/wscript_build
---- a/source4/utils/wscript_build
-+++ b/source4/utils/wscript_build
-@@ -6,7 +6,7 @@ bld.SAMBA_BINARY('ntlm_auth4',
- deps='''samba-hostconfig samba-util popt
- POPT_SAMBA POPT_CREDENTIALS gensec LIBCLI_RESOLVE
- auth4 NTLMSSP_COMMON MESSAGING events service''',
-- pyembed=True,
-+ #pyembed=True,
- install=False
- )
-
-diff --git a/wscript b/wscript
---- a/wscript
-+++ b/wscript
-@@ -96,8 +96,8 @@ def configure(conf):
- conf.SAMBA_CHECK_PERL(mandatory=True)
- conf.find_program('xsltproc', var='XSLTPROC')
-
-- conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2,5,0))
-- conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
-+ conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,5,0))
-+ conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
-
- if sys.platform == 'darwin' and not conf.env['HAVE_ENVIRON_DECL']:
- # Mac OSX needs to have this and it's also needed that the python is compiled with this
diff --git a/ports/samba/pkg_info b/ports/samba/pkg_info
deleted file mode 100644
index 2a17f9a..0000000
--- a/ports/samba/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=samba
-VERSION=4.1.16
-URL=http://ftp.samba.org/pub/samba/samba-4.1.16.tar.gz
-LICENSE=GPL
-DEPENDS=(nacl-spawn glibc-compat)
-DISABLED_LIBC=(newlib)
-DISABLED_ARCH=(i686)
-DISABLED_TOOLCHAIN=(emscripten)
-# Build broken on mac.
-BUILD_OS=linux
-SHA1=6fe5cbbec3ebf29a22af35229c17f699b6559c6d
diff --git a/ports/scrnsaverproto/pkg_info b/ports/scrnsaverproto/pkg_info
deleted file mode 100644
index c9c4b85..0000000
--- a/ports/scrnsaverproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=scrnsaverproto
-VERSION=1.2.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/scrnsaverproto-1.2.2.tar.bz2
-LICENSE=GPL
-SHA1=640a2cbef5893aacda74799e6fa4d973e629b753
diff --git a/ports/scummvm/build.sh b/ports/scummvm/build.sh
deleted file mode 100644
index 84c3ad7..0000000
--- a/ports/scummvm/build.sh
+++ /dev/null
@@ -1,149 +0,0 @@
-# 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.
-
-MIRROR_URL=http://storage.googleapis.com/webports/mirror
-
-# Beneath a Steel Sky (floppy version)
-readonly BASS_FLOPPY_URL=${MIRROR_URL}/scummvm_games/bass/BASS-Floppy-1.3.zip
-readonly BASS_FLOPPY_NAME=BASS-Floppy-1.3
-readonly BASS_FLOPPY_SHA1=acd7a578879c73fb3994b9c72b6571dc62635f6e
-
-readonly LURE_URL=${MIRROR_URL}/scummvm_games/lure/lure-1.1.zip
-readonly LURE_NAME=lure-1.1
-readonly LURE_SHA1=b7d430b17c361396ccf81734148cb0abb4bb4abb
-
-EXECUTABLES=scummvm
-
-SCUMMVM_EXAMPLE_DIR=${NACL_SRC}/ports/scummvm
-
-ConfigureStep() {
- # NOTE: We can't use the DefaultConfigureStep, because the scummvm
- # configure script is hand-rolled, and won't accept additional arguments.
- # export the nacl tools
- # without this setting *make* will not show the full command lines
- export VERBOSE_BUILD=1
- SetupCrossEnvironment
-
- local conf_host=${NACL_CROSS_PREFIX}
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- conf_host="pnacl"
- elif [ "${NACL_ARCH}" = "arm" ]; then
- conf_host="nacl-arm"
- else
- conf_host="nacl-x86"
- fi
- export DEFINES="-DNACL -DSYSTEM_NOT_SUPPORTING_D_TYPE=1"
-
- # NOTE: disabled mt32emu because it using inline assembly that won't
- # validate.
- ${SRC_DIR}/configure \
- --prefix=${PREFIX} \
- --host=${conf_host} \
- --disable-flac \
- --disable-zlib \
- --disable-mt32emu \
- --disable-timidity \
- --disable-all-engines \
- --enable-engine=lure \
- --enable-engine=sky
-}
-
-InstallStep() {
- SCUMMVM_DIR=runimage/usr/local/share/scummvm
- ChangeDir ${SRC_DIR}
- MakeDir ${SCUMMVM_DIR}
- cp gui/themes/scummclassic.zip \
- dists/engine-data/sky.cpt \
- gui/themes/scummmodern.zip \
- gui/themes/translations.dat \
- dists/engine-data/lure.dat \
- dists/pred.dic \
- ${SCUMMVM_DIR}
-
- cp $(find gui/themes/fonts/ -type f) ${SCUMMVM_DIR}
-
- Banner "Creating tarballs"
- cd runimage
- tar cf ../runimage.tar ./
- cd ..
-
- #Beneath a Steel Sky (Floppy version)
- BASS_DIR=bass/usr/local/share/scummvm/${BASS_FLOPPY_NAME}
- mkdir -p ${BASS_DIR}
- cp -r ${WORK_DIR}/${BASS_FLOPPY_NAME}/* ${BASS_DIR}
- cd bass
- tar cf ../bass.tar ./
- cd ..
-
- #Lure of the temptress
- LURE_DIR=lure/usr/local/share/scummvm
- mkdir -p ${LURE_DIR}
- cp -r ${WORK_DIR}/${LURE_NAME}/* ${LURE_DIR}
- cd lure
- tar cf ../lure.tar ./
- cd ..
-
- Banner "Publishing to ${PUBLISH_DIR}"
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR=${PUBLISH_DIR}/scummvm
-
- MakeDir ${ASSEMBLY_DIR}
-
- cp ${START_DIR}/packaged_app/* ${ASSEMBLY_DIR}
- cp ${SRC_DIR}/*.tar ${ASSEMBLY_DIR}
- if [ "${NACL_DEBUG}" = "1" ]; then
- cp ${BUILD_DIR}/scummvm \
- ${ASSEMBLY_DIR}/scummvm_${NACL_ARCH}${NACL_EXEEXT}
- else
- ${NACLSTRIP} ${BUILD_DIR}/scummvm \
- -o ${ASSEMBLY_DIR}/scummvm_${NACL_ARCH}${NACL_EXEEXT}
- fi
-
- python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${ASSEMBLY_DIR}/scummvm_*${NACL_EXEEXT} \
- -s ${ASSEMBLY_DIR} \
- -o ${ASSEMBLY_DIR}/scummvm.nmf
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- sed -i.bak 's/x-nacl/x-pnacl/' ${ASSEMBLY_DIR}/index.html
- fi
-
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip scummvm-${VERSION}.zip scummvm
-}
-
-# $1 - url
-# $2 - filename
-# $3 - sha1
-DownloadZipStep() {
- cd ${NACL_PACKAGES_CACHE}
- # if matching zip already exists, don't download again
- if ! CheckHash $2 $3; then
- Fetch $1 $2
- if ! CheckHash $2 $3; then
- Banner "$2 failed checksum!"
- exit -1
- fi
- fi
-}
-
-ExtractGameZipStep() {
- Banner "Unzipping ${2}"
- ChangeDir ${WORK_DIR}
- Remove ${1}
- unzip -d ${1} ${NACL_PACKAGES_CACHE}/${2}
-}
-
-# $1 - url
-# $2 - filename
-# $3 - sha1
-GameGetStep() {
- DownloadZipStep $1 $2.zip $3
- ExtractGameZipStep $2 $2.zip
-}
-
-DownloadStep() {
- GameGetStep ${BASS_FLOPPY_URL} ${BASS_FLOPPY_NAME} ${BASS_FLOPPY_SHA1}
- GameGetStep ${LURE_URL} ${LURE_NAME} ${LURE_SHA1}
-}
diff --git a/ports/scummvm/nacl.patch b/ports/scummvm/nacl.patch
deleted file mode 100644
index 1536ccb..0000000
--- a/ports/scummvm/nacl.patch
+++ /dev/null
@@ -1,381 +0,0 @@
-diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp
---- a/backends/platform/sdl/posix/posix-main.cpp
-+++ b/backends/platform/sdl/posix/posix-main.cpp
-@@ -20,6 +20,13 @@
- *
- */
-
-+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
-+#define FORBIDDEN_SYMBOL_EXCEPTION_vprintf
-+#define FORBIDDEN_SYMBOL_EXCEPTION_vfprintf
-+#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
-+#define FORBIDDEN_SYMBOL_EXCEPTION_setenv
-+#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
-+
- #include "common/scummsys.h"
-
- #if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(MAEMO) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3)
-@@ -28,7 +35,85 @@
- #include "backends/plugins/sdl/sdl-provider.h"
- #include "base/main.h"
-
-+#if defined(NACL)
-+#include <fcntl.h>
-+#include <libtar.h>
-+#include <stdlib.h>
-+#include <sys/mount.h>
-+#include <sys/stat.h>
-+#include <unistd.h>
-+#include <SDL/SDL_main.h>
-+
-+#include "nacl_io/nacl_io.h"
-+#endif
-+
-+#if defined(NACL)
-+
-+#define CHECK(x) \
-+ ret = x; \
-+ if (ret != 0) \
-+ perror(#x " failed"); \
-+ assert(ret == 0) \
-+
-+void ExtractAll(const char* data_file) {
-+ printf("Extracting: %s ...\n", data_file);
-+ TAR* tar;
-+ int ret;
-+ CHECK(tar_open(&tar, const_cast<char*>(data_file), NULL, O_RDONLY, 0, 0));
-+ CHECK(tar_extract_all(tar, const_cast<char*>("/")));
-+ CHECK(tar_close(tar));
-+}
-+
-+void CopyFile(const char* src, const char* dst) {
-+ const size_t kBufferSize = 1024;
-+ char buffer[kBufferSize];
-+
-+ int src_fd = open(src, O_RDONLY);
-+ assert(src_fd != -1);
-+ int dst_fd = open(dst, O_WRONLY | O_CREAT);
-+ assert(dst_fd != -1);
-+
-+ int bytes_read;
-+ int write_offset;
-+ do {
-+ bytes_read = read(src_fd, &buffer[0], kBufferSize);
-+ assert(bytes_read >= 0);
-+ int bytes_to_write = bytes_read;
-+
-+ write_offset = 0;
-+ while (bytes_to_write > 0) {
-+ int bytes_written = write(dst_fd, &buffer[write_offset], bytes_to_write);
-+ assert(bytes_written >= 0);
-+ bytes_to_write -= bytes_written;
-+ write_offset += bytes_written;
-+ }
-+ } while(bytes_read > 0);
-+
-+ close(src_fd);
-+ close(dst_fd);
-+}
-+
-+bool FileExists(const char* path) {
-+ struct stat buf;
-+ return stat(path, &buf) == 0;
-+}
-+
-+int SDL_main(int argc, char *argv[]) {
-+ int ret;
-+
-+ ExtractAll("/mnt/http/runimage.tar");
-+ ExtractAll("/mnt/http/bass.tar");
-+ ExtractAll("/mnt/http/lure.tar");
-+
-+ const char kConfigFile[] = "/home/user/.scummvmrc";
-+ if (!FileExists(kConfigFile)) {
-+ // Initialize with a default .scummvmrm that already has the
-+ // games loaded.
-+ CopyFile("/mnt/http/scummvmrc", kConfigFile);
-+ }
-+#else
- int main(int argc, char *argv[]) {
-+#endif
-
- // Create our OSystem instance
- g_system = new OSystem_POSIX();
-diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
---- a/backends/platform/sdl/posix/posix.cpp
-+++ b/backends/platform/sdl/posix/posix.cpp
-@@ -161,6 +161,9 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
- }
-
- bool OSystem_POSIX::displayLogFile() {
-+#ifdef NACL
-+ return false;
-+#else
- if (_logFilePath.empty())
- return false;
-
-@@ -209,6 +212,7 @@ bool OSystem_POSIX::displayLogFile() {
- }
-
- return WIFEXITED(status) && WEXITSTATUS(status) == 0;
-+#endif
- }
-
-
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -1374,6 +1374,16 @@ n64)
- _host_cpu=mips
- _host_alias=mips64
- ;;
-+nacl-x86)
-+ _host_os=nacl
-+ _host_cpu=x86
-+ _host_alias=${NACL_CROSS_PREFIX}
-+ ;;
-+nacl-arm)
-+ _host_os=nacl
-+ _host_cpu=arm
-+ _host_alias=${NACL_CROSS_PREFIX}
-+ ;;
- neuros)
- _host_os=linux
- _host_cpu=arm
-@@ -1383,6 +1393,11 @@ openpandora)
- _host_cpu=arm
- _host_alias=arm-angstrom-linux-gnueabi
- ;;
-+pnacl)
-+ _host_os=pnacl
-+ _host_cpu=le32
-+ _host_alias=${NACL_CROSS_PREFIX}
-+ ;;
- ppc-amigaos)
- _host_os=amigaos
- _host_cpu=ppc
-@@ -1783,7 +1798,7 @@ if test "$have_gcc" = yes ; then
- case $_host_os in
- # newlib-based system include files suppress non-C89 function
- # declarations under __STRICT_ANSI__
-- amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | ps3 | tizen | wii | wince )
-+ amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | ps3 | tizen | wii | wince | *nacl* )
- ;;
- *)
- CXXFLAGS="$CXXFLAGS -ansi"
-@@ -1870,6 +1885,8 @@ if $_strings $TMPO.o | grep BIGenDianSyS >/dev/null; then
- _endian=big
- elif $_strings $TMPO.o | grep LiTTleEnDian >/dev/null; then
- _endian=little
-+elif [ "$_host_cpu" = "le32" ]; then
-+ _endian=little
- fi
- echo $_endian;
- cc_check_clean tmp_endianness_check.cpp
-@@ -2027,10 +2044,12 @@ echo_n "Checking host CPU architecture... "
- case $_host_cpu in
- arm*)
- echo "ARM"
-- define_in_config_if_yes yes 'USE_ARM_SCALER_ASM'
-- define_in_config_if_yes yes 'USE_ARM_SOUND_ASM'
-- define_in_config_if_yes yes 'USE_ARM_SMUSH_ASM'
-- define_in_config_if_yes yes 'USE_ARM_GFX_ASM'
-+ if [ ! $_host_os = "nacl" ]; then
-+ define_in_config_if_yes yes 'USE_ARM_SCALER_ASM'
-+ define_in_config_if_yes yes 'USE_ARM_SOUND_ASM'
-+ define_in_config_if_yes yes 'USE_ARM_SMUSH_ASM'
-+ define_in_config_if_yes yes 'USE_ARM_GFX_ASM'
-+ fi
- # FIXME: The following feature exhibits a bug during the intro scene of Indy 4
- # (on Pandora and iPhone at least)
- #define_in_config_if_yes yes 'USE_ARM_COSTUME_ASM'
-@@ -2053,6 +2072,9 @@ case $_host_cpu in
- amd64 | x86_64)
- echo "x86_64"
- ;;
-+ le32)
-+ echo "Generic le32"
-+ ;;
- *)
- echo "unknown ($_host_cpu)"
- ;;
-@@ -3103,7 +3125,7 @@ case $_host_os in
- amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince)
- _posix=no
- ;;
-- android | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos)
-+ android | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos | *nacl* )
- _posix=yes
- ;;
- os2-emx*)
-diff --git a/graphics/scaler/scale2x.cpp b/graphics/scaler/scale2x.cpp
---- a/graphics/scaler/scale2x.cpp
-+++ b/graphics/scaler/scale2x.cpp
-@@ -201,9 +201,15 @@ static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8*
- "0:\n"
-
- /* set the current, current_pre, current_next registers */
-+#if defined(__x86_64__)
-+ "movq %%nacl:-8(%%r15,%q1), %%mm0\n"
-+ "movq %%nacl:(%%r15,%q1), %%mm7\n"
-+ "movq %%nacl:8(%%r15,%q1), %%mm1\n"
-+#else
- "movq -8(%1), %%mm0\n"
- "movq (%1), %%mm7\n"
- "movq 8(%1), %%mm1\n"
-+#endif
- "psrlq $56, %%mm0\n"
- "psllq $56, %%mm1\n"
- "movq %%mm7, %%mm2\n"
-@@ -214,7 +220,11 @@ static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8*
- "por %%mm3, %%mm1\n"
-
- /* current_upper */
-+#if defined(__x86_64__)
-+ "movq %%nacl:(%%r15,%q0), %%mm6\n"
-+#else
- "movq (%0), %%mm6\n"
-+#endif
-
- /* compute the upper-left pixel for dst on %%mm2 */
- /* compute the upper-right pixel for dst on %%mm4 */
-@@ -224,8 +234,13 @@ static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8*
- "movq %%mm1, %%mm5\n"
- "pcmpeqb %%mm6, %%mm2\n"
- "pcmpeqb %%mm6, %%mm4\n"
-+#if defined(__x86_64__)
-+ "pcmpeqb %%nacl:(%%r15,%q2), %%mm3\n"
-+ "pcmpeqb %%nacl:(%%r15,%q2), %%mm5\n"
-+#else
- "pcmpeqb (%2), %%mm3\n"
- "pcmpeqb (%2), %%mm5\n"
-+#endif
- "pandn %%mm2, %%mm3\n"
- "pandn %%mm4, %%mm5\n"
- "movq %%mm0, %%mm2\n"
-@@ -247,8 +262,13 @@ static inline void scale2x_8_mmx_single(scale2x_uint8* dst, const scale2x_uint8*
- "movq %%mm2, %%mm3\n"
- "punpcklbw %%mm4, %%mm2\n"
- "punpckhbw %%mm4, %%mm3\n"
-+#if defined(__x86_64__)
-+ "movq %%mm2, %%nacl:(%%r15,%q3)\n"
-+ "movq %%mm3, %%nacl:8(%%r15,%q3)\n"
-+#else
- "movq %%mm2, (%3)\n"
- "movq %%mm3, 8(%3)\n"
-+#endif
-
- /* next */
- "add $8, %0\n"
-@@ -278,9 +298,15 @@ static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint
- "0:\n"
-
- /* set the current, current_pre, current_next registers */
-+#if defined(__x86_64__)
-+ "movq %%nacl:-8(%%r15,%q1), %%mm0\n"
-+ "movq %%nacl:(%%r15,%q1), %%mm7\n"
-+ "movq %%nacl:8(%%r15,%q1), %%mm1\n"
-+#else
- "movq -8(%1), %%mm0\n"
- "movq (%1), %%mm7\n"
- "movq 8(%1), %%mm1\n"
-+#endif
- "psrlq $48, %%mm0\n"
- "psllq $48, %%mm1\n"
- "movq %%mm7, %%mm2\n"
-@@ -291,7 +317,11 @@ static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint
- "por %%mm3, %%mm1\n"
-
- /* current_upper */
-+#if defined(__x86_64__)
-+ "movq %%nacl:(%%r15,%q0), %%mm6\n"
-+#else
- "movq (%0), %%mm6\n"
-+#endif
-
- /* compute the upper-left pixel for dst on %%mm2 */
- /* compute the upper-right pixel for dst on %%mm4 */
-@@ -301,8 +331,13 @@ static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint
- "movq %%mm1, %%mm5\n"
- "pcmpeqw %%mm6, %%mm2\n"
- "pcmpeqw %%mm6, %%mm4\n"
-+#if defined(__x86_64__)
-+ "pcmpeqw %%nacl:(%%r15,%q2), %%mm3\n"
-+ "pcmpeqw %%nacl:(%%r15,%q2), %%mm5\n"
-+#else
- "pcmpeqw (%2), %%mm3\n"
- "pcmpeqw (%2), %%mm5\n"
-+#endif
- "pandn %%mm2, %%mm3\n"
- "pandn %%mm4, %%mm5\n"
- "movq %%mm0, %%mm2\n"
-@@ -324,8 +359,13 @@ static inline void scale2x_16_mmx_single(scale2x_uint16* dst, const scale2x_uint
- "movq %%mm2, %%mm3\n"
- "punpcklwd %%mm4, %%mm2\n"
- "punpckhwd %%mm4, %%mm3\n"
-+#if defined(__x86_64__)
-+ "movq %%mm2, %%nacl:(%%r15,%q3)\n"
-+ "movq %%mm3, %%nacl:8(%%r15,%q3)\n"
-+#else
- "movq %%mm2, (%3)\n"
- "movq %%mm3, 8(%3)\n"
-+#endif
-
- /* next */
- "add $8, %0\n"
-@@ -355,9 +395,15 @@ static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint
- "0:\n"
-
- /* set the current, current_pre, current_next registers */
-+#if defined(__x86_64__)
-+ "movq %%nacl:-8(%%r15,%q1), %%mm0\n"
-+ "movq %%nacl:(%%r15,%q1), %%mm7\n"
-+ "movq %%nacl:8(%%r15,%q1), %%mm1\n"
-+#else
- "movq -8(%1), %%mm0\n"
- "movq (%1), %%mm7\n"
- "movq 8(%1), %%mm1\n"
-+#endif
- "psrlq $32, %%mm0\n"
- "psllq $32, %%mm1\n"
- "movq %%mm7, %%mm2\n"
-@@ -368,7 +414,11 @@ static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint
- "por %%mm3, %%mm1\n"
-
- /* current_upper */
-+#if defined(__x86_64__)
-+ "movq %%nacl:(%%r15,%q0), %%mm6\n"
-+#else
- "movq (%0), %%mm6\n"
-+#endif
-
- /* compute the upper-left pixel for dst on %%mm2 */
- /* compute the upper-right pixel for dst on %%mm4 */
-@@ -378,8 +428,13 @@ static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint
- "movq %%mm1, %%mm5\n"
- "pcmpeqd %%mm6, %%mm2\n"
- "pcmpeqd %%mm6, %%mm4\n"
-+#if defined(__x86_64__)
-+ "pcmpeqd %%nacl:(%%r15,%q2), %%mm3\n"
-+ "pcmpeqd %%nacl:(%%r15,%q2), %%mm5\n"
-+#else
- "pcmpeqd (%2), %%mm3\n"
- "pcmpeqd (%2), %%mm5\n"
-+#endif
- "pandn %%mm2, %%mm3\n"
- "pandn %%mm4, %%mm5\n"
- "movq %%mm0, %%mm2\n"
-@@ -401,8 +456,13 @@ static inline void scale2x_32_mmx_single(scale2x_uint32* dst, const scale2x_uint
- "movq %%mm2, %%mm3\n"
- "punpckldq %%mm4, %%mm2\n"
- "punpckhdq %%mm4, %%mm3\n"
-+#if defined(__x86_64__)
-+ "movq %%mm2, %%nacl:(%%r15,%q3)\n"
-+ "movq %%mm3, %%nacl:8(%%r15,%q3)\n"
-+#else
- "movq %%mm2, (%3)\n"
- "movq %%mm3, 8(%3)\n"
-+#endif
-
- /* next */
- "add $8, %0\n"
diff --git a/ports/scummvm/packaged_app/background.js b/ports/scummvm/packaged_app/background.js
deleted file mode 100644
index 23959b3..0000000
--- a/ports/scummvm/packaged_app/background.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-function onLaunched(launchData) {
- chrome.app.window.create('index.html', {
- width: 640,
- height: 800,
- });
-}
-
-chrome.app.runtime.onLaunched.addListener(onLaunched);
diff --git a/ports/scummvm/packaged_app/index.html b/ports/scummvm/packaged_app/index.html
deleted file mode 100644
index 85d9dcf..0000000
--- a/ports/scummvm/packaged_app/index.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
- <!--
- Copyright 2011 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.
- -->
- <head>
- <title>ScummVM NaCl Demo</title>
- </head>
- <h1>ScummVM Native Client Demo</h1>
- <p>This is a Native Client port of ScummVM.</p>
- <p style="margin-bottom: 0;">Notes:</p>
- <ul style="margin-top: 0;">
- <li>F5 to save/restore games in BASS</li>
- <li>F5 to save games in Lure, F7 to restore games in Lure</li>
- </ul>
- <center>
- <embed width=640 height=400
- src="scummvm.nmf"
- type="application/x-nacl" />
- </center>
- </body>
-
-</html>
diff --git a/ports/scummvm/packaged_app/manifest.json b/ports/scummvm/packaged_app/manifest.json
deleted file mode 100644
index 00c1f63..0000000
--- a/ports/scummvm/packaged_app/manifest.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "ScummVM",
- "description": "Play Beneath a Steel Sky and Lure of the Temptress",
- "version": "0.0.0.2",
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "icons": {
- "128": "scummvm_128.png",
- "16": "scummvm_16.png"
- },
- "permissions": [
- "unlimitedStorage"
- ]
-}
diff --git a/ports/scummvm/packaged_app/scummvm_128.png b/ports/scummvm/packaged_app/scummvm_128.png
deleted file mode 100644
index d56d421..0000000
--- a/ports/scummvm/packaged_app/scummvm_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/scummvm/packaged_app/scummvm_16.png b/ports/scummvm/packaged_app/scummvm_16.png
deleted file mode 100644
index e5ca4cc..0000000
--- a/ports/scummvm/packaged_app/scummvm_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/scummvm/packaged_app/scummvmrc b/ports/scummvm/packaged_app/scummvmrc
deleted file mode 100644
index d20b2e7..0000000
--- a/ports/scummvm/packaged_app/scummvmrc
+++ /dev/null
@@ -1,23 +0,0 @@
-[scummvm]
-lastselectedgame=lure
-browser_lastpath=/usr/local/share/scummvm/lure
-extrapath=/usr/local/share/scummvm
-themepath=/usr/local/share/scummvm
-mute=false
-versioninfo=1.6.0
-
-[sky]
-gameid=sky
-description=Beneath a Steel Sky (v0.0348 floppy)
-path=/usr/local/share/scummvm/BASS-Floppy-1.3
-guioptions=sndNoSpeech
-
-[lure]
-platform=pc
-gameid=lure
-description=Lure of the Temptress (VGA/DOS/English)
-language=en
-extra=VGA
-path=/usr/local/share/scummvm/lure
-guioptions=sndNoSpeech lang_English
-
diff --git a/ports/scummvm/pkg_info b/ports/scummvm/pkg_info
deleted file mode 100644
index e018892..0000000
--- a/ports/scummvm/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=scummvm
-VERSION=1.7.0
-URL=http://downloads.sf.net/scummvm/scummvm/1.7.0/scummvm-1.7.0.tar.gz
-LICENSE=LGPL,GPL,BSD
-DEPENDS=(sdl libvorbis libtar)
-SHA1=fcf083a3539a9daa69713794cdc8c2953a096f24
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/scummvm/screenshots/screen1.png b/ports/scummvm/screenshots/screen1.png
deleted file mode 100644
index ce8fb92..0000000
--- a/ports/scummvm/screenshots/screen1.png
+++ /dev/null
Binary files differ
diff --git a/ports/scummvm/screenshots/small_tile.png b/ports/scummvm/screenshots/small_tile.png
deleted file mode 100644
index a48e8ab..0000000
--- a/ports/scummvm/screenshots/small_tile.png
+++ /dev/null
Binary files differ
diff --git a/ports/sdl-image/build.sh b/ports/sdl-image/build.sh
deleted file mode 100644
index 781e4fc..0000000
--- a/ports/sdl-image/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2014 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.
-
-# sdl2-config --libs includes -lppapi which cannot be linked
-# with shared libraries, so for now we disable the shared build.
-# In the future we could instead filter out this flag or remove
-# it and force SDL2 programs to add it themselves.
-EXTRA_CONFIGURE_ARGS=--disable-shared
diff --git a/ports/sdl-image/pkg_info b/ports/sdl-image/pkg_info
deleted file mode 100644
index ffdf6ac..0000000
--- a/ports/sdl-image/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl-image
-VERSION=1.2.12
-ARCHIVE_ROOT=SDL_image-1.2.12
-URL=http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.tar.gz
-LICENSE=ZLIB
-DEPENDS=(sdl libpng jpeg8d)
-SHA1=5e3e393d4e366638048bbb10d6a269ea3f4e4cf2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl-mixer/build.sh b/ports/sdl-mixer/build.sh
deleted file mode 100644
index 9dc7454..0000000
--- a/ports/sdl-mixer/build.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXTRA_CONFIGURE_ARGS="
- --disable-music-flac
- --disable-music-mp3
-"
-
-# sdl-config --libs includes -lppapi which cannot be linked
-# with shared libraries, so for now we disable the shared build.
-# In the future we could instead filter out this flag or remove
-# it and force SDL2 programs to add it themselves.
-EXTRA_CONFIGURE_ARGS+=" --disable-shared"
-
-ConfigureStep() {
- SetupCrossEnvironment
- export LIBS="-lvorbisfile -lvorbis -logg -lm"
- ${SRC_DIR}/configure \
- --host=nacl \
- --prefix=${PREFIX} \
- --${NACL_OPTION}-mmx \
- --${NACL_OPTION}-sse \
- --${NACL_OPTION}-sse2 \
- --${NACL_OPTION}-asm \
- --with-x=no \
- $EXTRA_CONFIGURE_ARGS
-
-}
diff --git a/ports/sdl-mixer/pkg_info b/ports/sdl-mixer/pkg_info
deleted file mode 100644
index 82fd389..0000000
--- a/ports/sdl-mixer/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl-mixer
-VERSION=1.2.11
-ARCHIVE_ROOT=SDL_mixer-1.2.11
-URL=http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.tar.gz
-LICENSE=LGPL
-DEPENDS=(sdl libogg libvorbis libmikmod)
-SHA1=ef5d45160babeb51eafa7e4019cec38324ee1a5d
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl-net/build.sh b/ports/sdl-net/build.sh
deleted file mode 100644
index 781e4fc..0000000
--- a/ports/sdl-net/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2014 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.
-
-# sdl2-config --libs includes -lppapi which cannot be linked
-# with shared libraries, so for now we disable the shared build.
-# In the future we could instead filter out this flag or remove
-# it and force SDL2 programs to add it themselves.
-EXTRA_CONFIGURE_ARGS=--disable-shared
diff --git a/ports/sdl-net/pkg_info b/ports/sdl-net/pkg_info
deleted file mode 100644
index 29f94bb..0000000
--- a/ports/sdl-net/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl-net
-VERSION=1.2.7
-ARCHIVE_ROOT=SDL_net-1.2.7
-URL=http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.7.tar.gz
-LICENSE=LGPL2
-DEPENDS=(sdl)
-SHA1=b46c7e3221621cc34fec1238f1b5f0ce8972274d
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl-tests/build.sh b/ports/sdl-tests/build.sh
deleted file mode 100644
index e1ba56b..0000000
--- a/ports/sdl-tests/build.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2011 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.
-
-ConfigureStep() {
- Banner "Autogen ${PACKAGE_NAME}"
- pushd ${SRC_DIR}/test
- LogExecute ./autogen.sh
- popd
-
- Banner "Configuring ${PACKAGE_NAME}"
- SetupCrossEnvironment
-
- LIBS="$LDFLAGS"
- LogExecute ${SRC_DIR}/test/configure \
- --host=${CONF_HOST} \
- --build=${CONF_BUILD} \
- --prefix=${PREFIX}
-}
-
-InstallStep() {
- Remove ${PUBLISH_DIR}
- MakeDir ${PUBLISH_DIR}
- LogExecute cp *${NACL_EXEEXT} ${PUBLISH_DIR}
- ChangeDir ${SRC_DIR}/test
- LogExecute cp *.bmp *.wav *.xbm *.dat *.txt ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- for NEXE in *${NACL_EXEEXT}; do
- LogExecute "${NACL_SDK_ROOT}/tools/create_html.py" ${NEXE}
- done
- if [ ${NACL_ARCH} = "pnacl" ]; then
- sed -i.bak 's/x-nacl/x-pnacl/' *.html
- fi
-}
diff --git a/ports/sdl-tests/diff_skip.txt b/ports/sdl-tests/diff_skip.txt
deleted file mode 100644
index a306f9e..0000000
--- a/ports/sdl-tests/diff_skip.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-configure
-test/configure
diff --git a/ports/sdl-tests/nacl.patch b/ports/sdl-tests/nacl.patch
deleted file mode 100644
index 1bc8bf4..0000000
--- a/ports/sdl-tests/nacl.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/test/configure.in b/test/configure.in
---- a/test/configure.in
-+++ b/test/configure.in
-@@ -50,6 +50,18 @@ case "$host" in
- SYS_GL_LIBS="-lOSMesa"
- fi
- ;;
-+ *-*-nacl*)
-+ case "$CC" in
-+ */pnacl*)
-+ EXE=".pexe"
-+ ;;
-+ *)
-+ EXE=".nexe"
-+ ;;
-+ esac
-+ MATHLIB="-lm"
-+ SYS_GL_LIBS=""
-+ ;;
- *)
- EXE=""
- MATHLIB="-lm"
-@@ -68,6 +80,12 @@ AM_PATH_SDL($SDL_VERSION,
- CFLAGS="$CFLAGS $SDL_CFLAGS"
- LIBS="$LIBS $SDL_LIBS"
-
-+case "$host" in
-+ *-*-nacl*)
-+ LIBS="$LIBS -lnacl_io -l${NACL_CXX_LIB}"
-+ ;;
-+esac
-+
- dnl Check for X11 path, needed for OpenGL on some systems
- AC_PATH_X
- if test x$have_x = xyes; then
diff --git a/ports/sdl-tests/pkg_info b/ports/sdl-tests/pkg_info
deleted file mode 100644
index 3b07591..0000000
--- a/ports/sdl-tests/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl-tests
-VERSION=1.2.14
-ARCHIVE_ROOT=SDL-1.2.14
-URL=http://www.libsdl.org/release/SDL-1.2.14.tar.gz
-LICENSE=LGPL2
-DEPENDS=(sdl)
-SHA1=ba625b4b404589b97e92d7acd165992debe576dd
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl-ttf/build.sh b/ports/sdl-ttf/build.sh
deleted file mode 100644
index 781e4fc..0000000
--- a/ports/sdl-ttf/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2014 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.
-
-# sdl2-config --libs includes -lppapi which cannot be linked
-# with shared libraries, so for now we disable the shared build.
-# In the future we could instead filter out this flag or remove
-# it and force SDL2 programs to add it themselves.
-EXTRA_CONFIGURE_ARGS=--disable-shared
diff --git a/ports/sdl-ttf/nacl.patch b/ports/sdl-ttf/nacl.patch
deleted file mode 100644
index a7e5b45..0000000
--- a/ports/sdl-ttf/nacl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -39,7 +39,6 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- build_triplet = @build@
- host_triplet = @host@
--noinst_PROGRAMS = showfont$(EXEEXT) glfont$(EXEEXT)
- subdir = .
- DIST_COMMON = README $(am__configure_deps) \
- $(libSDL_ttfinclude_HEADERS) $(srcdir)/Makefile.am \
diff --git a/ports/sdl-ttf/pkg_info b/ports/sdl-ttf/pkg_info
deleted file mode 100644
index 89a6fc8..0000000
--- a/ports/sdl-ttf/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl-ttf
-VERSION=2.0.10
-ARCHIVE_ROOT=SDL_ttf-2.0.10
-URL=http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.10.tar.gz
-LICENSE=LGPL2
-DEPENDS=(sdl freetype)
-SHA1=98f6518ec71d94b8ad303a197445e0991850b887
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl/build.sh b/ports/sdl/build.sh
deleted file mode 100644
index ee30577..0000000
--- a/ports/sdl/build.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXTRA_CONFIGURE_ARGS="--disable-assembly --disable-pthread-sem"
-
-AutogenStep() {
- ChangeDir ${SRC_DIR}
- # For some reason if we don't remove configure before running
- # autoconf it doesn't always get updates correctly. About half
- # the time the old configure script (with no reference to nacl)
- # will remain after ./autogen.sh
- rm -f configure
- ./autogen.sh
- PatchConfigure
- PatchConfigSub
- cd -
-}
-
-ConfigureStep() {
- AutogenStep
- SetupCrossEnvironment
- DefaultConfigureStep
-}
diff --git a/ports/sdl/pkg_info b/ports/sdl/pkg_info
deleted file mode 100644
index 21813f1..0000000
--- a/ports/sdl/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=sdl
-VERSION=1.2.15
-URL=https://github.com/sbc100/SDL-mirror.git@1c6f2d0
-LICENSE=LGPL2
-DEPENDS=(nacl-spawn regal)
-SHA1=0c5f193ced810b0d7ce3ab06d808cbb5eef03a2c
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl2-gfx/build.sh b/ports/sdl2-gfx/build.sh
deleted file mode 100644
index 781e4fc..0000000
--- a/ports/sdl2-gfx/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2014 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.
-
-# sdl2-config --libs includes -lppapi which cannot be linked
-# with shared libraries, so for now we disable the shared build.
-# In the future we could instead filter out this flag or remove
-# it and force SDL2 programs to add it themselves.
-EXTRA_CONFIGURE_ARGS=--disable-shared
diff --git a/ports/sdl2-gfx/pkg_info b/ports/sdl2-gfx/pkg_info
deleted file mode 100644
index 5fc6502..0000000
--- a/ports/sdl2-gfx/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl2-gfx
-VERSION=1.0.0
-ARCHIVE_ROOT=SDL2_gfx-1.0.0
-URL=http://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.0.tar.gz
-DEPENDS=(sdl2)
-LICENSE=ZLIB
-SHA1=6b83f57a62a3d2a3850a56902a008d801c799ff8
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl2-image/build.sh b/ports/sdl2-image/build.sh
deleted file mode 100644
index 781e4fc..0000000
--- a/ports/sdl2-image/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2014 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.
-
-# sdl2-config --libs includes -lppapi which cannot be linked
-# with shared libraries, so for now we disable the shared build.
-# In the future we could instead filter out this flag or remove
-# it and force SDL2 programs to add it themselves.
-EXTRA_CONFIGURE_ARGS=--disable-shared
diff --git a/ports/sdl2-image/pkg_info b/ports/sdl2-image/pkg_info
deleted file mode 100644
index fda5be4..0000000
--- a/ports/sdl2-image/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl2-image
-VERSION=2.0.0
-ARCHIVE_ROOT=SDL2_image-2.0.0
-URL=http://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.tar.gz
-DEPENDS=(tiff libwebp sdl2 libpng jpeg8d)
-LICENSE=ZLIB
-SHA1=20b1b0db9dd540d6d5e40c7da8a39c6a81248865
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl2-tests/build.sh b/ports/sdl2-tests/build.sh
deleted file mode 100644
index 931dca0..0000000
--- a/ports/sdl2-tests/build.sh
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright (c) 2011 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.
-
-NACLPORTS_CFLAGS+=" -std=gnu99"
-
-EXECUTABLES="
-checkkeys${NACL_EXEEXT}
-controllermap${NACL_EXEEXT}
-loopwave${NACL_EXEEXT}
-loopwavequeue${NACL_EXEEXT}
-testatomic${NACL_EXEEXT}
-testaudioinfo${NACL_EXEEXT}
-testautomation${NACL_EXEEXT}
-testdraw2${NACL_EXEEXT}
-testdrawchessboard${NACL_EXEEXT}
-testdropfile${NACL_EXEEXT}
-testerror${NACL_EXEEXT}
-testfile${NACL_EXEEXT}
-testfilesystem${NACL_EXEEXT}
-testgamecontroller${NACL_EXEEXT}
-testgesture${NACL_EXEEXT}
-testgl2${NACL_EXEEXT}
-testgles2${NACL_EXEEXT}
-testgles${NACL_EXEEXT}
-testhaptic${NACL_EXEEXT}
-testhotplug${NACL_EXEEXT}
-testiconv${NACL_EXEEXT}
-testime${NACL_EXEEXT}
-testintersections${NACL_EXEEXT}
-testjoystick${NACL_EXEEXT}
-testkeys${NACL_EXEEXT}
-testloadso${NACL_EXEEXT}
-testlock${NACL_EXEEXT}
-testmessage${NACL_EXEEXT}
-testmultiaudio${NACL_EXEEXT}
-testoverlay2${NACL_EXEEXT}
-testplatform${NACL_EXEEXT}
-testpower${NACL_EXEEXT}
-testrelative${NACL_EXEEXT}
-testrendercopyex${NACL_EXEEXT}
-testrendertarget${NACL_EXEEXT}
-testresample${NACL_EXEEXT}
-testrumble${NACL_EXEEXT}
-testscale${NACL_EXEEXT}
-testsem${NACL_EXEEXT}
-testshader${NACL_EXEEXT}
-testshape${NACL_EXEEXT}
-testsprite2${NACL_EXEEXT}
-testspriteminimal${NACL_EXEEXT}
-teststreaming${NACL_EXEEXT}
-testthread${NACL_EXEEXT}
-testtimer${NACL_EXEEXT}
-testver${NACL_EXEEXT}
-testviewport${NACL_EXEEXT}
-testwm2${NACL_EXEEXT}
-torturethread${NACL_EXEEXT}
-"
-
-ConfigureStep() {
- Banner "Autogen ${PACKAGE_NAME}"
- pushd ${SRC_DIR}/test
- LogExecute ./autogen.sh
- popd
-
- Banner "Configure ${PACKAGE_NAME}"
- SetupCrossEnvironment
-
- CFLAGS="${CPPFLAGS} ${CFLAGS}"
- LIBS="${LDFLAGS}"
- LogExecute ${SRC_DIR}/test/configure \
- --host=${CONF_HOST} \
- --build=${CONF_BUILD} \
- --prefix=${PREFIX}
-}
-
-InstallStep() {
- Remove ${PUBLISH_DIR}
- MakeDir ${PUBLISH_DIR}
- LogExecute cp *${NACL_EXEEXT} ${PUBLISH_DIR}
- ChangeDir ${SRC_DIR}/test
- LogExecute cp *.bmp *.wav *.xbm *.dat *.txt ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- for NEXE in ${EXECUTABLES}; do
- LogExecute "${NACL_SDK_ROOT}/tools/create_html.py" ${NEXE}
- done
- if [ ${NACL_ARCH} = "pnacl" ]; then
- sed -i.bak 's/x-nacl/x-pnacl/' *.html
- fi
-}
diff --git a/ports/sdl2-tests/diff_skip.txt b/ports/sdl2-tests/diff_skip.txt
deleted file mode 100644
index e8c05a6..0000000
--- a/ports/sdl2-tests/diff_skip.txt
+++ /dev/null
@@ -1 +0,0 @@
-configure
diff --git a/ports/sdl2-tests/nacl.patch b/ports/sdl2-tests/nacl.patch
deleted file mode 100644
index 415dcff..0000000
--- a/ports/sdl2-tests/nacl.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/test/autogen.sh b/test/autogen.sh
---- a/test/autogen.sh
-+++ b/test/autogen.sh
-@@ -3,7 +3,7 @@
- # Regenerate configuration files
- cp acinclude.m4 aclocal.m4
- found=false
--for autoconf in autoconf autoconf259 autoconf-2.59
-+for autoconf in autoconf2.64 autoconf autoconf259 autoconf-2.59
- do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
- done
- if test x$found = xfalse; then
-diff --git a/test/configure.in b/test/configure.in
---- a/test/configure.in
-+++ b/test/configure.in
-@@ -67,7 +67,7 @@ case "$host" in
- ;;
- *-*-nacl*)
- case "$CC" in
-- *pnacl*)
-+ */pnacl-*)
- EXE=".pexe"
- ;;
- *)
-@@ -86,6 +86,8 @@ case "$host" in
- SYS_GL_LIBS="-lGL"
- ;;
- esac
-+
-+echo "----------------> Using EXE=$EXE"
- AC_SUBST(EXE)
- AC_SUBST(MATHLIB)
- AC_SUBST(ISMACOSX)
diff --git a/ports/sdl2-tests/pkg_info b/ports/sdl2-tests/pkg_info
deleted file mode 100644
index 05d070d..0000000
--- a/ports/sdl2-tests/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=sdl2-tests
-VERSION=2.0.3
-URL=https://github.com/sbc100/SDL-mirror.git@b406d6b
-LICENSE=ZLIB
-DEPENDS=(sdl2)
-SHA1=e40051311b648e4e60ed1683f62a948d93a0a49f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl2-ttf/build.sh b/ports/sdl2-ttf/build.sh
deleted file mode 100644
index 781e4fc..0000000
--- a/ports/sdl2-ttf/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2014 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.
-
-# sdl2-config --libs includes -lppapi which cannot be linked
-# with shared libraries, so for now we disable the shared build.
-# In the future we could instead filter out this flag or remove
-# it and force SDL2 programs to add it themselves.
-EXTRA_CONFIGURE_ARGS=--disable-shared
diff --git a/ports/sdl2-ttf/nacl.patch b/ports/sdl2-ttf/nacl.patch
deleted file mode 100644
index 673e057..0000000
--- a/ports/sdl2-ttf/nacl.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-
-WARNING: we are changing autogenerated Makefile.in instead of Makefile.am!
-
-diff -urN SDL_ttf-2.0.10/Makefile.in SDL_ttf-2.0.10-nacl/Makefile.in
---- SDL_ttf-2.0.10/Makefile.in 2009-10-19 01:18:21.000000000 -0700
-+++ SDL_ttf-2.0.10-nacl/Makefile.in 2011-09-26 18:16:05.010855000 -0700
-@@ -39,7 +39,6 @@
- POST_UNINSTALL = :
- build_triplet = @build@
- host_triplet = @host@
--noinst_PROGRAMS = showfont$(EXEEXT) glfont$(EXEEXT)
- subdir = .
- DIST_COMMON = README $(am__configure_deps) \
- $(libSDL_ttfinclude_HEADERS) $(srcdir)/Makefile.am \
diff --git a/ports/sdl2-ttf/pkg_info b/ports/sdl2-ttf/pkg_info
deleted file mode 100644
index 6738395..0000000
--- a/ports/sdl2-ttf/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=sdl2-ttf
-VERSION=2.0.12
-ARCHIVE_ROOT=SDL2_ttf-2.0.12
-URL=http://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.12.tar.gz
-DEPENDS=(sdl2 freetype)
-LICENSE=ZLIB
-SHA1=542865c604fe92d2f26000428ef733381caa0e8e
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdl2/README.nacl b/ports/sdl2/README.nacl
deleted file mode 100644
index da3de4c..0000000
--- a/ports/sdl2/README.nacl
+++ /dev/null
@@ -1,6 +0,0 @@
-SDL2 port to Native Client
-==========================
-
-WARNING: this port is a work in progress and is largely untested.
-
-Work is currently ongoing to bring the SDL port up to scratch.
diff --git a/ports/sdl2/build.sh b/ports/sdl2/build.sh
deleted file mode 100644
index 283538e..0000000
--- a/ports/sdl2/build.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2011 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.
-
-NACLPORTS_CFLAGS+=" -std=gnu99"
-
-AutogenStep() {
- ChangeDir ${SRC_DIR}
- # For some reason if we don't remove configure before running
- # autoconf it doesn't always get updates correctly. About half
- # the time the old configure script (with no reference to nacl)
- # will remain after ./autogen.sh
- rm -f configure
- ./autogen.sh
- PatchConfigure
- PatchConfigSub
- cd -
-}
-
-ConfigureStep() {
- AutogenStep
- SetupCrossEnvironment
-
- LogExecute ${SRC_DIR}/configure \
- --host=${CONF_HOST} \
- --build=${CONF_BUILD} \
- --prefix=${PREFIX} \
- --disable-assembly \
- --disable-pthread-sem
-}
diff --git a/ports/sdl2/nacl.patch b/ports/sdl2/nacl.patch
deleted file mode 100644
index 4e27b90..0000000
--- a/ports/sdl2/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -1355,7 +1355,7 @@ CheckNativeClient()
- AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
-
-- SDL_LIBS="-Wl,--undefined=PSUserCreateInstance -lSDL2main $SDL_LIBS -lppapi_gles2 -lppapi_simple -lnacl_io -lppapi_cpp -lppapi -lm -l${NACL_CPP_LIB:-stdc++}"
-+ SDL_LIBS="-Wl,--undefined=PSUserMainGet -lSDL2main $SDL_LIBS -lppapi_gles2 -lppapi_simple -lnacl_io -lppapi -lm -l${NACL_CXX_LIB:-stdc++}"
- EXTRA_LDFLAGS="-lppapi_simple"
-
- SDLMAIN_SOURCES="$srcdir/src/main/nacl/*.c"
diff --git a/ports/sdl2/pkg_info b/ports/sdl2/pkg_info
deleted file mode 100644
index ac90772..0000000
--- a/ports/sdl2/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=sdl2
-VERSION=2.0.3
-URL=https://github.com/sbc100/SDL-mirror.git@b406d6b
-LICENSE=ZLIB
-DEPENDS=(libtar)
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdlquake/Makefile b/ports/sdlquake/Makefile
deleted file mode 100644
index 47a9042..0000000
--- a/ports/sdlquake/Makefile
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXEEXT ?= .nexe
-
-SDL_LDFLAGS := $(shell sdl-config --libs)
-SDL_CFLAGS := $(shell sdl-config --cflags)
-LDFLAGS += $(SDL_LDFLAGS)
-CFLAGS += -Wno-pointer-sign -Wno-implicit-function-declaration
-
-CFLAGS += -fcommon -DSDL $(SDL_CFLAGS)
-ifeq ($(TOOLCHAIN),pnacl)
-# TODO(sbc): remove -fcommon once PNaCl toolchain changes its default
-# https://code.google.com/p/nativeclient/issues/detail?id=3888
-CFLAGS += -fcommon -Wno-dangling-else
-endif
-
-X86_SRCS := snd_mixa.S sys_dosa.S d_draw.S d_draw16.S d_parta.S d_polysa.S \
- d_scana.S d_spr8.S d_varsa.S math.S r_aclipa.S r_aliasa.S \
- r_drawa.S r_edgea.S surf16.S surf8.S worlda.S
-
-ifneq (V,1)
-RUN_CC = @echo " CC " $@;
-RUN_CCLD = @echo " CCLD " $@;
-RUN_STRIP = @echo " STRIP " $@;
-endif
-
-NONX86_SRCS := d_vars.c nonintel.c
-
-SOURCES += cd_nacl.c chase.c cl_demo.c cl_input.c cl_main.c cl_parse.c\
- cl_tent.c cmd.c common.c console.c crc.c cvar.c d_edge.c d_fill.c\
- d_init.c d_modech.c d_part.c d_polyse.c d_scan.c d_sky.c d_sprite.c\
- d_surf.c d_zpoint.c draw.c host.c host_cmd.c keys.c mathlib.c menu.c\
- model.c net_bsd.c net_dgrm.c net_loop.c net_main.c net_udp.c \
- net_vcr.c net_wso.c pr_cmds.c pr_edict.c pr_exec.c r_aclip.c\
- r_alias.c r_bsp.c r_draw.c r_edge.c r_efrag.c r_light.c r_main.c \
- r_misc.c r_part.c r_sky.c r_sprite.c r_surf.c r_vars.c \
- sbar.c screen.c snd_dma.c snd_mem.c snd_mix.c snd_sdl.c sv_main.c\
- sv_move.c sv_phys.c sv_user.c sys_sdl.c vid_sdl.c view.c \
- wad.c world.c zone.c
-
-#ifeq ($(NACL_ARCH),x86_64)
-#SOURCES += $(X86_SRCS)
-#else
-#ifeq ($(NACL_ARCH),i686)
-#SOURCES += $(X86_SRCS)
-#else
-#SOURCES += $(NONX86_SRCS)
-#endif
-#endif
-
-SOURCES += $(NONX86_SRCS)
-
-# These files were excluded from FILES because they use instructions
-# disallowed by Native Client
-OMITTED_S_FILES := d_copy.S dosasm.S
-
-OBJECTS := $(SOURCES:%.c=build/%.o)
-OBJECTS := $(OBJECTS:%.S=build/%.o)
-
-all: quake${EXEEXT}
-
-quake_debug${EXEEXT}: $(OBJECTS)
- $(RUN_CCLD)$(CXX) $(LDFLAGS) $^ -o $@
-
-quake${EXEEXT}: quake_debug${EXEEXT}
- $(RUN_STRIP)$(STRIP) -o $@ $<
-
-clean:
- rm -f build/*.o *.${EXEEXT}
-
-build/%.o: %.S
- @mkdir -p build
- $(RUN_CC)$(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $<
-
-build/%.o: %.c
- @mkdir -p build
- $(RUN_CC)$(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $<
diff --git a/ports/sdlquake/README.nacl b/ports/sdlquake/README.nacl
deleted file mode 100644
index c078754..0000000
--- a/ports/sdlquake/README.nacl
+++ /dev/null
@@ -1,13 +0,0 @@
-sdlquake for Native Client
-==========================
-
-This is a build of sdlquake from libsdl.org::
-
- http://www.libsdl.org/projects/quake/
-
-To run this you need to extract a set of data files into the
-directory alongside the executable. The simplest way to get
-acquire a data set is to download the shareware episode from
-libsdl.org::
-
- http://www.libsdl.org/projects/quake/data/quakesw-1.0.6.zip
diff --git a/ports/sdlquake/build.sh b/ports/sdlquake/build.sh
deleted file mode 100644
index 65a2a08..0000000
--- a/ports/sdlquake/build.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2013 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.
-
-BUILD_DIR=${SRC_DIR}
-EXECUTABLES=quake${NACL_EXEEXT}
-
-PatchStep() {
- DefaultPatchStep
- cp ${START_DIR}/Makefile ${BUILD_DIR}
-}
-
-ConfigureStep() {
- return
-}
-
-BuildStep() {
- make clean
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-InstallStep() {
- MakeDir ${PUBLISH_DIR}
- LogExecute cp ${START_DIR}/quake.html ${PUBLISH_DIR}
- LogExecute cp ${BUILD_DIR}/quake${NACL_EXEEXT} ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- LogExecute ${NACL_SDK_ROOT}/tools/create_nmf.py -s . quake${NACL_EXEEXT} \
- -o quake.nmf
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- sed -i.bak 's/x-nacl/x-pnacl/' quake.html
- fi
-}
diff --git a/ports/sdlquake/nacl.patch b/ports/sdlquake/nacl.patch
deleted file mode 100644
index a5a2408..0000000
--- a/ports/sdlquake/nacl.patch
+++ /dev/null
@@ -1,281 +0,0 @@
-diff --git a/cd_nacl.c b/cd_nacl.c
-new file mode 100644
---- /dev/null
-+++ b/cd_nacl.c
-@@ -0,0 +1,29 @@
-+/*
-+ The NaCl version of Quake does not support CDAudio, so just provide stubs
-+*/
-+
-+
-+#include "quakedef.h"
-+
-+void CDAudio_Stop() {
-+}
-+
-+void CDAudio_Pause() {
-+}
-+
-+void CDAudio_Resume() {
-+}
-+
-+void CDAudio_Update() {
-+}
-+
-+void CDAudio_Play(byte track, qboolean looping) {
-+}
-+
-+int CDAudio_Init() {
-+ return -1;
-+}
-+
-+void CDAudio_Shutdown() {
-+}
-+
-diff --git a/d_ifacea.h b/d_ifacea.h
---- a/d_ifacea.h
-+++ b/d_ifacea.h
-@@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #define CYCLE 128
-
- // !!! if this is changed, it must be changed in r_shared.h too !!!
--#define MAXHEIGHT 1024
-+#define MAXHEIGHT 2048
-
- // !!! if this is changed, it must be changed in quakedef.h too !!!
- #define CACHE_SIZE 32 // used to align key data structures
-diff --git a/net_dgrm.c b/net_dgrm.c
---- a/net_dgrm.c
-+++ b/net_dgrm.c
-@@ -19,6 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
- // net_dgrm.c
-
-+#include "quakedef.h"
-+
-+//#define HAVE_NET_DGRM
-+#if defined(HAVE_NET_DGRM)
-+
- // This is enables a simple IP banning mechanism
- #define BAN_TEST
-
-@@ -52,7 +57,6 @@ unsigned long inet_addr(const char *cp);
- #endif
- #endif // BAN_TEST
-
--#include "quakedef.h"
- #include "net_dgrm.h"
-
- // these two macros are to make the code more readable
-@@ -1388,3 +1392,53 @@ qsocket_t *Datagram_Connect (char *host)
- break;
- return ret;
- }
-+#else
-+
-+int Datagram_Init (void) {
-+ return -1;
-+}
-+
-+void Datagram_Listen (qboolean state) {
-+}
-+
-+void Datagram_SearchForHosts (qboolean xmit) {
-+}
-+
-+qsocket_t *Datagram_Connect (char *host) {
-+ return NULL;
-+}
-+
-+qsocket_t *Datagram_CheckNewConnections (void) {
-+ return NULL;
-+}
-+
-+int Datagram_GetMessage (qsocket_t *sock) {
-+ return -1;
-+}
-+
-+int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data) {
-+ return -1;
-+}
-+
-+int Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data) {
-+ return -1;
-+}
-+
-+qboolean Datagram_CanSendMessage (qsocket_t *sock) {
-+ return 0;
-+}
-+
-+qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock)
-+{
-+ return false;
-+}
-+
-+void Datagram_Close (qsocket_t *sock) {
-+}
-+
-+void Datagram_Shutdown (void) {
-+}
-+
-+
-+#endif
-+
-diff --git a/net_udp.c b/net_udp.c
---- a/net_udp.c
-+++ b/net_udp.c
-@@ -19,9 +19,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
- // net_udp.c
-
--#include "quakedef.h"
-+//#define HAVE_NET_UDP
-
-+#include "quakedef.h"
- #include <sys/types.h>
-+
-+#if defined(HAVE_NET_UDP)
-+
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netdb.h>
-@@ -413,3 +417,81 @@ int UDP_SetSocketPort (struct qsockaddr *addr, int port)
- }
-
- //=============================================================================
-+
-+#else
-+
-+int UDP_Init (void) {
-+ return -1;
-+}
-+
-+void UDP_Shutdown (void) {
-+}
-+
-+void UDP_Listen (qboolean state) {
-+}
-+
-+int UDP_OpenSocket (int port) {
-+ return -1;
-+}
-+
-+int UDP_CloseSocket (int socket) {
-+ return -1;
-+}
-+
-+int UDP_Connect (int socket, struct qsockaddr *addr) {
-+ return 0;
-+}
-+
-+int UDP_CheckNewConnections (void) {
-+ return -1;
-+}
-+
-+int UDP_Read (int socket, byte *buf, int len, struct qsockaddr *addr) {
-+ return -1;
-+}
-+
-+int UDP_MakeSocketBroadcastCapable (int socket) {
-+ return -1;
-+}
-+
-+int UDP_Broadcast (int socket, byte *buf, int len) {
-+ return -1;
-+}
-+
-+int UDP_Write (int socket, byte *buf, int len, struct qsockaddr *addr) {
-+ return -1;
-+}
-+
-+char *UDP_AddrToString (struct qsockaddr *addr) {
-+ return NULL;
-+}
-+
-+int UDP_StringToAddr (char *string, struct qsockaddr *addr) {
-+ return -1;
-+}
-+
-+int UDP_GetSocketAddr (int socket, struct qsockaddr *addr) {
-+ return -1;
-+}
-+
-+int UDP_GetNameFromAddr (struct qsockaddr *addr, char *name) {
-+ return -1;
-+}
-+
-+int UDP_GetAddrFromName(char *name, struct qsockaddr *addr) {
-+ return -1;
-+}
-+
-+int UDP_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2) {
-+ return -1;
-+}
-+
-+int UDP_GetSocketPort (struct qsockaddr *addr) {
-+ return -1;
-+}
-+
-+int UDP_SetSocketPort (struct qsockaddr *addr, int port) {
-+ return 0;
-+}
-+
-+#endif
-diff --git a/r_shared.h b/r_shared.h
---- a/r_shared.h
-+++ b/r_shared.h
-@@ -30,8 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #define MAXWORKINGVERTS (MAXVERTS+4) // max points in an intermediate
- // polygon (while processing)
- // !!! if this is changed, it must be changed in d_ifacea.h too !!!
--#define MAXHEIGHT 1024
--#define MAXWIDTH 1280
-+#define MAXHEIGHT 2048
-+#define MAXWIDTH 4096
- #define MAXDIMENSION ((MAXHEIGHT > MAXWIDTH) ? MAXHEIGHT : MAXWIDTH)
-
- #define SIN_BUFFER_SIZE (MAXDIMENSION+CYCLE)
-diff --git a/sys_sdl.c b/sys_sdl.c
---- a/sys_sdl.c
-+++ b/sys_sdl.c
-@@ -11,7 +11,7 @@
- #include <string.h>
- #include <ctype.h>
- #include <errno.h>
--#ifndef __WIN32__
-+#if !defined __WIN32__ && !defined __native_client__
- #include <sys/ipc.h>
- #include <sys/shm.h>
- #include <sys/stat.h>
-@@ -19,6 +19,8 @@
- #include <sys/mman.h>
- #endif
-
-+#include "SDL.h"
-+
- #include "quakedef.h"
-
- qboolean isDedicated;
-diff --git a/vid_sdl.c b/vid_sdl.c
---- a/vid_sdl.c
-+++ b/vid_sdl.c
-@@ -11,8 +11,8 @@ unsigned short d_8to16table[256];
- //#define BASEWIDTH 320
- //#define BASEHEIGHT 200
- // Much better for high resolution displays
--#define BASEWIDTH (320*2)
--#define BASEHEIGHT (200*2)
-+#define BASEWIDTH 800
-+#define BASEHEIGHT 600
-
- int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes = 0;
- byte *VGA_pagebase;
-@@ -56,7 +56,7 @@ void VID_Init (unsigned char *palette)
- Uint32 flags;
-
- // Load the SDL library
-- if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_CDROM) < 0)
-+ if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) < 0)
- Sys_Error("VID: Couldn't load SDL: %s", SDL_GetError());
-
- // Set up display mode (width and height)
diff --git a/ports/sdlquake/pkg_info b/ports/sdlquake/pkg_info
deleted file mode 100644
index 904cfe1..0000000
--- a/ports/sdlquake/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=sdlquake
-VERSION=1.0.9
-URL=http://www.libsdl.org/projects/quake/src/sdlquake-1.0.9.tar.gz
-LICENSE=GPL
-DEPENDS=(sdl)
-SHA1=fd34e025a55d1f95680d23603348c9f993f06545
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sdlquake/quake.html b/ports/sdlquake/quake.html
deleted file mode 100644
index 6e1f707..0000000
--- a/ports/sdlquake/quake.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
- <!--
- Copyright (c) 2011 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.
- -->
- <head>
- <title>Quake</title>
- </head>
- <body>
- <h1>Quake</h1>
- <embed name="nacl_module"
- id="Quake"
- width=800 height=600
- PS_EXIT_MESSAGE="exit"
- PS_STDERR="/dev/console1"
- src="quake.nmf"
- type="application/x-nacl" />
- <br />
- </body>
-</html>
diff --git a/ports/snes9x/build.sh b/ports/snes9x/build.sh
deleted file mode 100644
index 8df94d9..0000000
--- a/ports/snes9x/build.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-# 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.
-
-BUILD_DIR=${SRC_DIR}/unix
-
-EXECUTABLES=snes9x
-NACL_CONFIGURE_PATH=${SRC_DIR}/unix/configure
-EXTRA_CONFIGURE_ARGS="\
- --disable-gamepad \
- --disable-gzip \
- --disable-zip \
- --disable-jma \
- --disable-screenshot \
- --disable-netplay \
- --without-x \
- --enable-sound"
-export EXTRA_LIBS="${NACLPORTS_LDFLAGS}"
-EXTRA_LIBS+=" -lppapi_simple_cpp -lnacl_io -lppapi_cpp -lppapi"
-
-AutoconfStep() {
- echo "Autoconf..."
- autoconf
- PatchConfigure
- PatchConfigSub
-}
-
-ConfigureStep() {
- AutoconfStep
- DefaultConfigureStep
-}
-
-InstallStep(){
- MakeDir ${PUBLISH_DIR}
- install ${START_DIR}/snes9x.html ${PUBLISH_DIR}
- install ${START_DIR}/snes9x.js ${PUBLISH_DIR}
- install ${BUILD_DIR}/snes9x ${PUBLISH_DIR}/snes9x_${NACL_ARCH}${NACL_EXEEXT}
-
- python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${PUBLISH_DIR}/snes9x_*${NACL_EXEEXT} \
- -s ${PUBLISH_DIR} \
- -o ${PUBLISH_DIR}/snes9x.nmf
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- sed -i.bak 's/x-nacl/x-pnacl/' ${PUBLISH_DIR}/snes9x.js
- fi
-}
diff --git a/ports/snes9x/nacl.patch b/ports/snes9x/nacl.patch
deleted file mode 100644
index 445ee6e..0000000
--- a/ports/snes9x/nacl.patch
+++ /dev/null
@@ -1,1162 +0,0 @@
-diff --git a/port.h b/port.h
---- a/port.h
-+++ b/port.h
-@@ -331,7 +331,7 @@ void SetInfoDlgColor(unsigned char, unsigned char, unsigned char);
- #define TITLE "Snes9x"
- #endif
-
--#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__x86_64__) || defined(__alpha__) || defined(__MIPSEL__) || defined(_M_IX86) || defined(_M_X64)
-+#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__x86_64__) || defined(__alpha__) || defined(__MIPSEL__) || defined(_M_IX86) || defined(_M_X64) || defined(__native_client__)
- #define LSB_FIRST
- #define FAST_LSB_WORD_ACCESS
- #else
-diff --git a/unix/Makefile.in b/unix/Makefile.in
---- a/unix/Makefile.in
-+++ b/unix/Makefile.in
-@@ -2,14 +2,19 @@
- @S9XNETPLAY@
- @S9XZIP@
- @S9XJMA@
-+@S9XX11@
-
- # Fairly good and special-char-safe descriptor of the os being built on.
- OS = `uname -s -r -m|sed \"s/ /-/g\"|tr \"[A-Z]\" \"[a-z]\"|tr \"/()\" \"___\"`
- BUILDDIR = .
-
--OBJECTS = ../apu/apu.o ../apu/SNES_SPC.o ../apu/SNES_SPC_misc.o ../apu/SNES_SPC_state.o ../apu/SPC_DSP.o ../apu/SPC_Filter.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../movie.o ../obc1.o ../ppu.o ../reader.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o unix.o x11.o
-+OBJECTS = ../apu/apu.o ../apu/SNES_SPC.o ../apu/SNES_SPC_misc.o ../apu/SNES_SPC_state.o ../apu/SPC_DSP.o ../apu/SPC_Filter.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../movie.o ../obc1.o ../ppu.o ../reader.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o ../unix/unix.o ../unix/nacl.o
- DEFS = -DMITSHM
-
-+ifdef S9XX11
-+OBJECTS += ../unix/x11.o
-+endif
-+
- ifdef S9XDEBUGGER
- OBJECTS += ../debug.o ../fxdbg.o
- endif
-diff --git a/unix/configure.ac b/unix/configure.ac
---- a/unix/configure.ac
-+++ b/unix/configure.ac
-@@ -38,7 +38,7 @@ AC_DEFUN([AC_S9X_COMPILER_FLAG],
- return (argc);
- }
- ],
-- [snes9x_cv_option_$2="yes"], [snes9x_cv_option_$2="no"])
-+ [snes9x_cv_option_$2="yes"], [snes9x_cv_option_$2="no"], [AC_MSG_RESULT(skip for crosscompiling)])
- ])
-
- CXXFLAGS="[$]OLD_CXXFLAGS"
-@@ -58,15 +58,15 @@ AC_DEFUN([AC_S9X_COMPILER_FLAG],
-
- # Remove -g and -O2 flags manually.
-
--if test "x$CFLAGS" != "x"; then
-- CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-g//'`"
-- CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-O2//'`"
--fi
--
--if test "x$CXXFLAGS" != "x"; then
-- CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-g//'`"
-- CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-O2//'`"
--fi
-+#if test "x$CFLAGS" != "x"; then
-+# CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-g//'`"
-+# CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-O2//'`"
-+#fi
-+#
-+#if test "x$CXXFLAGS" != "x"; then
-+# CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-g//'`"
-+# CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-O2//'`"
-+#fi
-
- # Test what compiler flags we should use.
-
-@@ -259,12 +259,13 @@ AC_CHECK_FUNC([mkstemp],
- S9XDEFS="$S9XDEFS -DHAVE_MKSTEMP"
- ])
-
--# Check X11
-+# Check X11.
-+
-+S9XX11="#S9XX11=1"
-
- AC_PATH_XTRA
--if test "x$no_x" = "xyes"; then
-- AC_MSG_ERROR([X11 is required.])
--else
-+if test "x$no_x" != "xyes"; then
-+ S9XX11="S9XX11=1"
- S9XFLGS="$S9XFLGS $X_CFLAGS"
- S9XLIBS="$S9XLIBS $X_PRE_LIBS -lX11 -lXext $X_LIBS $X_EXTRA_LIBS"
- fi
-@@ -303,7 +304,7 @@ if test "x$snes9x_have_stdint_h" = "x"; then
- return (!(sizeof(void *) == sizeof(int)));
- }
- ],
-- [snes9x_ptr_is_int="yes"], [snes9x_ptr_is_int="no"])
-+ [snes9x_ptr_is_int="yes"], [snes9x_ptr_is_int="no"], [AC_MSG_RESULT(skip for crosscompiling)])
-
- if test "x$snes9x_ptr_is_int" = "xyes"; then
- AC_MSG_RESULT(yes)
-@@ -350,7 +351,7 @@ AC_DEFUN([AC_S9X_CHECK_SAR],
- return (i < 0 ? 0 : 1);
- }
- ],
-- [snes9x_sar_$1="yes"], [snes9x_sar_$1="no"])
-+ [snes9x_sar_$1="yes"], [snes9x_sar_$1="no"], [AC_MSG_RESULT(skip for crosscompiling)])
-
- CXXFLAGS="[$]OLD_CXXFLAGS"
-
-@@ -388,7 +389,7 @@ if test "x$enable_sound" = "xyes"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-- AC_MSG_WARN([Your OS is not Linux. Build without sound support.])
-+ AC_MSG_WARN([Your OS is not Linux. Build without Linux sound support.])
- enable_sound="no"
- fi
- fi
-@@ -406,7 +407,7 @@ fi
- # Output.
-
- S9XFLGS="$CXXFLAGS $CPPFLAGS $LDFLAGS $S9XFLGS"
--S9XLIBS="$LIBS $S9XLIBS"
-+S9XLIBS="$LIBS $EXTRA_LIBS $S9XLIBS"
-
- S9XFLGS="`echo \"$S9XFLGS\" | sed -e 's/ */ /g'`"
- S9XDEFS="`echo \"$S9XDEFS\" | sed -e 's/ */ /g'`"
-@@ -422,6 +423,7 @@ AC_SUBST(S9XDEBUGGER)
- AC_SUBST(S9XNETPLAY)
- AC_SUBST(S9XZIP)
- AC_SUBST(S9XJMA)
-+AC_SUBST(S9XX11)
-
- rm config.info 2>/dev/null
-
-diff --git a/unix/keycodes.h b/unix/keycodes.h
-new file mode 100644
---- /dev/null
-+++ b/unix/keycodes.h
-@@ -0,0 +1,271 @@
-+/* Copyright (c) 2013 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. */
-+
-+const char* kKeyCodeNames[] = {
-+ NULL, // 0
-+ NULL, // 1
-+ NULL, // 2
-+ "Cancel", // 3
-+ NULL, // 4
-+ NULL, // 5
-+ "Help", // 6
-+ NULL, // 7
-+ "BackSpace", // 8
-+ "Tab", // 9
-+ NULL, // 10
-+ NULL, // 11
-+ "Clear", // 12
-+ "Return", // 13
-+ "Enter", // 14
-+ NULL, // 15
-+ "Shift", // 16
-+ "Control", // 17
-+ "Alt", // 18
-+ "Pause", // 19
-+ "CapsLock", // 20
-+ "Kana", // 21
-+ "Eisu", // 22
-+ "Junja", // 23
-+ "Final", // 24
-+ "Hanja", // 25
-+ NULL, // 26
-+ "Escape", // 27
-+ "Convert", // 28
-+ "Nonconvert", // 29
-+ "Accept", // 30
-+ "Modechange", // 31
-+ "Space", // 32
-+ "PageUp", // 33
-+ "PageDown", // 34
-+ "End", // 35
-+ "Home", // 36
-+ "Left", // 37
-+ "Up", // 38
-+ "Right", // 39
-+ "Down", // 40
-+ "Select", // 41
-+ "Print", // 42
-+ "Execute", // 43
-+ "Printscreen", // 44
-+ "Insert", // 45
-+ "Delete", // 46
-+ NULL,
-+ "0", // 48
-+ "1", // 49
-+ "2", // 50
-+ "3", // 51
-+ "4", // 52
-+ "5", // 53
-+ "6", // 54
-+ "7", // 55
-+ "8", // 56
-+ "9", // 57
-+ "Colon", // 58
-+ "Semicolon", // 59
-+ "LessThan", // 60
-+ "Equals", // 61
-+ "GreaterThan", // 62
-+ "QuestionMark", // 63
-+ "At", // 64
-+ "A", // 65
-+ "B", // 66
-+ "C", // 67
-+ "D", // 68
-+ "E", // 69
-+ "F", // 70
-+ "G", // 71
-+ "H", // 72
-+ "I", // 73
-+ "J", // 74
-+ "K", // 75
-+ "L", // 76
-+ "M", // 77
-+ "N", // 78
-+ "O", // 79
-+ "P", // 80
-+ "Q", // 81
-+ "R", // 82
-+ "S", // 83
-+ "T", // 84
-+ "U", // 85
-+ "V", // 86
-+ "W", // 87
-+ "X", // 88
-+ "Y", // 89
-+ "Z", // 90
-+ "Win", // 91
-+ NULL,
-+ "ContextMenu", // 93
-+ NULL,
-+ "Sleep", // 95
-+ "Numpad0", // 96
-+ "Numpad1", // 97
-+ "Numpad2", // 98
-+ "Numpad3", // 99
-+ "Numpad4", // 100
-+ "Numpad5", // 101
-+ "Numpad6", // 102
-+ "Numpad7", // 103
-+ "Numpad8", // 104
-+ "Numpad9", // 105
-+ "Multiply", // 106
-+ "Add", // 107
-+ "Separator", // 108
-+ "Subtract", // 109
-+ "Decimal", // 110
-+ "Divide", // 111
-+ "F1", // 112
-+ "F2", // 113
-+ "F3", // 114
-+ "F4", // 115
-+ "F5", // 116
-+ "F6", // 117
-+ "F7", // 118
-+ "F8", // 119
-+ "F9", // 120
-+ "F10", // 121
-+ "F11", // 122
-+ "F12", // 123
-+ "F13", // 124
-+ "F14", // 125
-+ "F15", // 126
-+ "F16", // 127
-+ "F17", // 128
-+ "F18", // 129
-+ "F19", // 130
-+ "F20", // 131
-+ "F21", // 132
-+ "F22", // 133
-+ "F23", // 134
-+ "F24", // 135
-+ NULL, // 136
-+ NULL, // 137
-+ NULL, // 138
-+ NULL, // 139
-+ NULL, // 140
-+ NULL, // 141
-+ NULL, // 142
-+ NULL, // 143
-+ "NumLock", // 144
-+ "ScrollLock", // 145
-+ "WinOemFjJisho", // 146
-+ "WinOemFjMasshou", // 147
-+ "WinOemFjTouroku", // 148
-+ "WinOemFjLoya", // 149
-+ "WinOemFjRoya", // 150
-+ NULL, // 151
-+ NULL, // 152
-+ NULL, // 153
-+ NULL, // 154
-+ NULL, // 155
-+ NULL, // 156
-+ NULL, // 157
-+ NULL, // 158
-+ NULL, // 159
-+ "Circumflex", // 160
-+ "Exclamation", // 161
-+ "DoubleQuote", // 162
-+ "Hash", // 163
-+ "Dollar", // 164
-+ "Percent", // 165
-+ "Ampersand", // 166
-+ "Underscore", // 167
-+ "OpenParen", // 168
-+ "CloseParen", // 169
-+ "Asterisk", // 170
-+ "Plus", // 171
-+ "Pipe", // 172
-+ "HyphenMinus", // 173
-+ "OpenCurlyBracket", // 174
-+ "CloseCurlyBracket", // 175
-+ "Tilde", // 176
-+ NULL, // 177
-+ NULL, // 178
-+ NULL, // 179
-+ NULL, // 180
-+ "VolumeMute", // 181
-+ "VolumeDown", // 182
-+ "VolumeUp", // 183
-+ NULL, // 184
-+ NULL, // 185
-+ NULL, // 186
-+ NULL, // 187
-+ "Comma", // 188
-+ NULL, // 189
-+ "Period", // 190
-+ "Slash", // 191
-+ "BackQuote", // 192
-+ NULL, // 193
-+ NULL, // 194
-+ NULL, // 195
-+ NULL, // 196
-+ NULL, // 197
-+ NULL, // 198
-+ NULL, // 199
-+ NULL, // 200
-+ NULL, // 201
-+ NULL, // 202
-+ NULL, // 203
-+ NULL, // 204
-+ NULL, // 205
-+ NULL, // 206
-+ NULL, // 207
-+ NULL, // 208
-+ NULL, // 209
-+ NULL, // 210
-+ NULL, // 211
-+ NULL, // 212
-+ NULL, // 213
-+ NULL, // 214
-+ NULL, // 215
-+ NULL, // 216
-+ NULL, // 217
-+ NULL, // 218
-+ "OpenBracket", // 219
-+ "BackSlash", // 220
-+ "CloseBracket", // 221
-+ "Quote", // 222
-+ NULL, // 223
-+ "Meta", // 224
-+ "AltGr", // 225
-+ NULL, // 226
-+ "WinIcoHelp", // 227
-+ "WinIco00", // 228
-+ NULL, // 229
-+ "WinIcoClear", // 230
-+ NULL, // 231
-+ NULL, // 232
-+ "WinOemReset", // 233
-+ "WinOemJump", // 234
-+ "WinOemPa1", // 235
-+ "WinOemPa2", // 236
-+ "WinOemPa3", // 237
-+ "WinOemWsctrl", // 238
-+ "WinOemCusel", // 239
-+ "WinOemAttn", // 240
-+ "WinOemFinish", // 241
-+ "WinOemCopy", // 242
-+ "WinOemAuto", // 243
-+ "WinOemEnlw", // 244
-+ "WinOemBacktab", // 245
-+ "Attn", // 246
-+ "CrSel", // 247
-+ "ExSel", // 248
-+ "ErEOF", // 249
-+ "Play", // 250
-+ "Zoom", // 251
-+ NULL, // 252
-+ "PA1", // 253
-+ "WinOemClear", // 254
-+};
-+
-+static inline int StringToCode(const char* name) {
-+ const int kNumKeyCodeNames = sizeof(kKeyCodeNames)/sizeof(kKeyCodeNames[0]);
-+ for (int i = 0; i < kNumKeyCodeNames; ++i) {
-+ if (kKeyCodeNames[i] && strcmp(name, kKeyCodeNames[i]) == 0) {
-+ return i;
-+ }
-+ }
-+ return -1;
-+}
-diff --git a/unix/nacl.cpp b/unix/nacl.cpp
-new file mode 100644
---- /dev/null
-+++ b/unix/nacl.cpp
-@@ -0,0 +1,694 @@
-+/* Copyright (c) 2013 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. */
-+
-+#ifdef __native_client__
-+
-+#include <assert.h>
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <pthread.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <sys/mount.h>
-+#include <sys/stat.h>
-+#include <sys/types.h>
-+#include <unistd.h>
-+
-+#include <string>
-+#include <vector>
-+#include <utility>
-+
-+#include <ppapi/c/ppb_input_event.h>
-+#include <ppapi/cpp/audio.h>
-+#include <ppapi/cpp/audio_config.h>
-+#include <ppapi/cpp/instance.h>
-+#include <ppapi/cpp/input_event.h>
-+
-+#include "nacl_io/nacl_io.h"
-+#include "ppapi_simple/ps_context_2d.h"
-+#include "ppapi_simple/ps_event.h"
-+#include "ppapi_simple/ps_interface.h"
-+#include "ppapi_simple/ps_main.h"
-+
-+#include "snes9x.h"
-+#include "apu.h"
-+#include "blit.h"
-+#include "conffile.h"
-+#include "controls.h"
-+#include "display.h"
-+#include "logger.h"
-+#include "memmap.h"
-+#include "movie.h"
-+#include "ppu.h"
-+#include "ring_buffer.h"
-+
-+#include "keycodes.h"
-+
-+enum {
-+ VIDEOMODE_BLOCKY = 1,
-+ VIDEOMODE_TV,
-+ VIDEOMODE_SMOOTH,
-+ VIDEOMODE_SUPEREAGLE,
-+ VIDEOMODE_2XSAI,
-+ VIDEOMODE_SUPER2XSAI,
-+ VIDEOMODE_EPX,
-+ VIDEOMODE_HQ2X
-+};
-+
-+typedef void (* Blitter) (uint8 *, int, uint8 *, int, int, int);
-+
-+
-+// Consts
-+const int kSampleFrameCount = 1024;
-+const int kSampleSize = 4; // Always 16-bit stereo
-+const int kFilterBufferPitch = (SNES_WIDTH * 2) * 2;
-+const uint32 kMousePointerBit = 0x00008000;
-+const uint32 kKeyboardBit = 0x00000000;
-+const uint32 kMouseBit = 0x40000000;
-+const uint32 kJoystickBit = 0x80000000;
-+
-+const uint32_t kModifiersMask =
-+ PP_INPUTEVENT_MODIFIER_SHIFTKEY |
-+ PP_INPUTEVENT_MODIFIER_CONTROLKEY |
-+ PP_INPUTEVENT_MODIFIER_ALTKEY |
-+ PP_INPUTEVENT_MODIFIER_METAKEY;
-+const int kModifierShift = 8;
-+const uint32_t kKeyCodeMask = 0xff;
-+
-+
-+// Statics
-+static PSContext2D_t* s_context2d;
-+static uint8* s_snes_buffer;
-+static uint8* s_filter_buffer;
-+static int s_video_mode = VIDEOMODE_BLOCKY;
-+static bool s_no_repeat = true;
-+static int s_sample_frame_count;
-+static pp::Audio s_audio;
-+static pthread_mutex_t s_audio_mutex;
-+
-+
-+// Externs
-+typedef std::pair<std::string, std::string> strpair_t;
-+extern std::vector<strpair_t> keymaps;
-+
-+///////////////////////////////////////////////////////////////////////////////
-+
-+int snes9x_main(int argc, char *argv[]);
-+int snes9x_pepper_main(int argc, char* argv[]) {
-+ PSEventSetFilter(PSE_ALL);
-+
-+ umount("/");
-+ mount("", "/", "memfs", 0, NULL);
-+ mkdir("/mnt", 0777);
-+ mount("", "/mnt/html5fs", "html5fs", 0, "type=TEMPORARY");
-+ mkdir("/home", 0777);
-+ setenv("HOME", "/home", 1);
-+
-+ if (argc < 1) {
-+ fprintf(stderr, "Expect ROM filename as first argument!\n");
-+ exit(1);
-+ }
-+
-+ // Assume that argv[1] is the URL of the ROM.
-+ char* filename = argv[1];
-+ printf("Loading ROM: %s\n", filename);
-+
-+ char buffer[PATH_MAX];
-+ snprintf(buffer, PATH_MAX - 1, "/mnt/html5fs/%s", filename);
-+ buffer[PATH_MAX - 1] = 0;
-+
-+ printf("Setting argv[1] to \"%s\"\n", buffer);
-+ argv[1] = &buffer[0];
-+
-+ return snes9x_main(argc, argv);
-+}
-+
-+PPAPI_SIMPLE_REGISTER_MAIN(snes9x_pepper_main)
-+
-+void S9xExtraDisplayUsage() {
-+}
-+
-+void S9xParseDisplayArg(char **argv, int &i, int argc) {
-+ if (!strcasecmp(argv[i], "-setrepeat")) {
-+// s_no_repeat = FALSE;
-+ } else if (!strncasecmp(argv[i], "-v", 2)) {
-+ switch (argv[i][2]) {
-+ case '1': s_video_mode = VIDEOMODE_BLOCKY; break;
-+ case '2': s_video_mode = VIDEOMODE_TV; break;
-+ case '3': s_video_mode = VIDEOMODE_SMOOTH; break;
-+ case '4': s_video_mode = VIDEOMODE_SUPEREAGLE; break;
-+ case '5': s_video_mode = VIDEOMODE_2XSAI; break;
-+ case '6': s_video_mode = VIDEOMODE_SUPER2XSAI; break;
-+ case '7': s_video_mode = VIDEOMODE_EPX; break;
-+ case '8': s_video_mode = VIDEOMODE_HQ2X; break;
-+ }
-+ } else {
-+ S9xUsage();
-+ }
-+}
-+
-+const char * S9xParseDisplayConfig(ConfigFile &conf, int pass) {
-+ if (pass != 1)
-+ return "Unix/NaCl";
-+
-+ // NaCl needs to use 44100.
-+ Settings.SoundPlaybackRate = 44100;
-+
-+ if (!conf.GetBool("Unix::ClearAllControls", false)) {
-+ keymaps.push_back(strpair_t("K00:K", "Joypad1 Right"));
-+ keymaps.push_back(strpair_t("K00:Right", "Joypad1 Right"));
-+ keymaps.push_back(strpair_t("K00:H", "Joypad1 Left"));
-+ keymaps.push_back(strpair_t("K00:Left", "Joypad1 Left"));
-+ keymaps.push_back(strpair_t("K00:J", "Joypad1 Down"));
-+ keymaps.push_back(strpair_t("K00:N", "Joypad1 Down"));
-+ keymaps.push_back(strpair_t("K00:Down", "Joypad1 Down"));
-+ keymaps.push_back(strpair_t("K00:U", "Joypad1 Up"));
-+ keymaps.push_back(strpair_t("K00:Up", "Joypad1 Up"));
-+ keymaps.push_back(strpair_t("K00:Return", "Joypad1 Start"));
-+ keymaps.push_back(strpair_t("K00:space", "Joypad1 Select"));
-+ keymaps.push_back(strpair_t("K00:S+D", "Joypad1 ToggleTurbo A"));
-+ keymaps.push_back(strpair_t("K00:C+D", "Joypad1 ToggleSticky A"));
-+ keymaps.push_back(strpair_t("K00:D", "Joypad1 A"));
-+ keymaps.push_back(strpair_t("K00:S+C", "Joypad1 ToggleTurbo B"));
-+ keymaps.push_back(strpair_t("K00:C+C", "Joypad1 ToggleSticky B"));
-+ keymaps.push_back(strpair_t("K00:C", "Joypad1 B"));
-+ keymaps.push_back(strpair_t("K00:S+S", "Joypad1 ToggleTurbo X"));
-+ keymaps.push_back(strpair_t("K00:C+S", "Joypad1 ToggleSticky X"));
-+ keymaps.push_back(strpair_t("K00:S", "Joypad1 X"));
-+ keymaps.push_back(strpair_t("K00:S+X", "Joypad1 ToggleTurbo Y"));
-+ keymaps.push_back(strpair_t("K00:C+X", "Joypad1 ToggleSticky Y"));
-+ keymaps.push_back(strpair_t("K00:X", "Joypad1 Y"));
-+ keymaps.push_back(strpair_t("K00:S+A", "Joypad1 ToggleTurbo L"));
-+ keymaps.push_back(strpair_t("K00:S+V", "Joypad1 ToggleTurbo L"));
-+ keymaps.push_back(strpair_t("K00:C+A", "Joypad1 ToggleSticky L"));
-+ keymaps.push_back(strpair_t("K00:C+V", "Joypad1 ToggleSticky L"));
-+ keymaps.push_back(strpair_t("K00:A", "Joypad1 L"));
-+ keymaps.push_back(strpair_t("K00:V", "Joypad1 L"));
-+ keymaps.push_back(strpair_t("K00:S+Z", "Joypad1 ToggleTurbo R"));
-+ keymaps.push_back(strpair_t("K00:C+Z", "Joypad1 ToggleSticky R"));
-+ keymaps.push_back(strpair_t("K00:Z", "Joypad1 R"));
-+
-+ keymaps.push_back(strpair_t("K00:Numpad4", "Joypad2 Left"));
-+ keymaps.push_back(strpair_t("K00:Numpad6", "Joypad2 Right"));
-+ keymaps.push_back(strpair_t("K00:Numpad8", "Joypad2 Up"));
-+ keymaps.push_back(strpair_t("K00:Numpad2", "Joypad2 Down"));
-+ keymaps.push_back(strpair_t("K00:Enter", "Joypad2 Start"));
-+ keymaps.push_back(strpair_t("K00:Add", "Joypad2 Select"));
-+ keymaps.push_back(strpair_t("K00:PageUp", "Joypad2 A"));
-+ keymaps.push_back(strpair_t("K00:PageDown", "Joypad2 B"));
-+ keymaps.push_back(strpair_t("K00:Home", "Joypad2 X"));
-+ keymaps.push_back(strpair_t("K00:End", "Joypad2 Y"));
-+ keymaps.push_back(strpair_t("K00:Insert", "Joypad2 L"));
-+ keymaps.push_back(strpair_t("K00:Delete", "Joypad2 R"));
-+
-+ keymaps.push_back(strpair_t("K00:A+F4", "SoundChannel0"));
-+ keymaps.push_back(strpair_t("K00:C+F4", "SoundChannel0"));
-+ keymaps.push_back(strpair_t("K00:A+F5", "SoundChannel1"));
-+ keymaps.push_back(strpair_t("K00:C+F5", "SoundChannel1"));
-+ keymaps.push_back(strpair_t("K00:A+F6", "SoundChannel2"));
-+ keymaps.push_back(strpair_t("K00:C+F6", "SoundChannel2"));
-+ keymaps.push_back(strpair_t("K00:A+F7", "SoundChannel3"));
-+ keymaps.push_back(strpair_t("K00:C+F7", "SoundChannel3"));
-+ keymaps.push_back(strpair_t("K00:A+F8", "SoundChannel4"));
-+ keymaps.push_back(strpair_t("K00:C+F8", "SoundChannel4"));
-+ keymaps.push_back(strpair_t("K00:A+F9", "SoundChannel5"));
-+ keymaps.push_back(strpair_t("K00:C+F9", "SoundChannel5"));
-+ keymaps.push_back(strpair_t("K00:A+F10", "SoundChannel6"));
-+ keymaps.push_back(strpair_t("K00:C+F10", "SoundChannel6"));
-+ keymaps.push_back(strpair_t("K00:A+F11", "SoundChannel7"));
-+ keymaps.push_back(strpair_t("K00:C+F11", "SoundChannel7"));
-+ keymaps.push_back(strpair_t("K00:A+F12", "SoundChannelsOn"));
-+ keymaps.push_back(strpair_t("K00:C+F12", "SoundChannelsOn"));
-+
-+ keymaps.push_back(strpair_t("K00:S+1", "BeginRecordingMovie"));
-+ keymaps.push_back(strpair_t("K00:S+2", "EndRecordingMovie"));
-+ keymaps.push_back(strpair_t("K00:S+3", "LoadMovie"));
-+ keymaps.push_back(strpair_t("K00:A+F1", "SaveSPC"));
-+ keymaps.push_back(strpair_t("K00:C+F1", "SaveSPC"));
-+ keymaps.push_back(strpair_t("K00:F10", "LoadOopsFile"));
-+ keymaps.push_back(strpair_t("K00:A+F2", "LoadFreezeFile"));
-+ keymaps.push_back(strpair_t("K00:C+F2", "LoadFreezeFile"));
-+ keymaps.push_back(strpair_t("K00:F11", "LoadFreezeFile"));
-+ keymaps.push_back(strpair_t("K00:A+F3", "SaveFreezeFile"));
-+ keymaps.push_back(strpair_t("K00:C+F3", "SaveFreezeFile"));
-+ keymaps.push_back(strpair_t("K00:F12", "SaveFreezeFile"));
-+ keymaps.push_back(strpair_t("K00:F1", "QuickLoad000"));
-+ keymaps.push_back(strpair_t("K00:F2", "QuickLoad001"));
-+ keymaps.push_back(strpair_t("K00:F3", "QuickLoad002"));
-+ keymaps.push_back(strpair_t("K00:F4", "QuickLoad003"));
-+ keymaps.push_back(strpair_t("K00:F5", "QuickLoad004"));
-+ keymaps.push_back(strpair_t("K00:F6", "QuickLoad005"));
-+ keymaps.push_back(strpair_t("K00:F7", "QuickLoad006"));
-+ keymaps.push_back(strpair_t("K00:F8", "QuickLoad007"));
-+ keymaps.push_back(strpair_t("K00:F9", "QuickLoad008"));
-+ keymaps.push_back(strpair_t("K00:S+F1", "QuickSave000"));
-+ keymaps.push_back(strpair_t("K00:S+F2", "QuickSave001"));
-+ keymaps.push_back(strpair_t("K00:S+F3", "QuickSave002"));
-+ keymaps.push_back(strpair_t("K00:S+F4", "QuickSave003"));
-+ keymaps.push_back(strpair_t("K00:S+F5", "QuickSave004"));
-+ keymaps.push_back(strpair_t("K00:S+F6", "QuickSave005"));
-+ keymaps.push_back(strpair_t("K00:S+F7", "QuickSave006"));
-+ keymaps.push_back(strpair_t("K00:S+F8", "QuickSave007"));
-+ keymaps.push_back(strpair_t("K00:S+F9", "QuickSave008"));
-+
-+ keymaps.push_back(strpair_t("K00:ScrollLock", "Pause"));
-+ keymaps.push_back(strpair_t("K00:CS+Escape", "Reset"));
-+ keymaps.push_back(strpair_t("K00:S+Escape", "SoftReset"));
-+ keymaps.push_back(strpair_t("K00:Escape", "ExitEmu"));
-+ keymaps.push_back(strpair_t("K00:Tab", "EmuTurbo"));
-+ keymaps.push_back(strpair_t("K00:S+Tab", "ToggleEmuTurbo"));
-+ keymaps.push_back(strpair_t("K00:A+Equals", "IncEmuTurbo"));
-+ keymaps.push_back(strpair_t("K00:A+Subtract", "DecEmuTurbo"));
-+ keymaps.push_back(strpair_t("K00:C+Equals", "IncTurboSpeed"));
-+ keymaps.push_back(strpair_t("K00:C+Subtract", "DecTurboSpeed"));
-+ keymaps.push_back(strpair_t("K00:Equals", "IncFrameRate"));
-+ keymaps.push_back(strpair_t("K00:Subtract", "DecFrameRate"));
-+ keymaps.push_back(strpair_t("K00:S+Equals", "IncFrameTime"));
-+ keymaps.push_back(strpair_t("K00:S+Subtract", "DecFrameTime"));
-+ keymaps.push_back(strpair_t("K00:6", "SwapJoypads"));
-+ keymaps.push_back(strpair_t("K00:Printscreen", "Screenshot"));
-+
-+ keymaps.push_back(strpair_t("K00:1", "ToggleBG0"));
-+ keymaps.push_back(strpair_t("K00:2", "ToggleBG1"));
-+ keymaps.push_back(strpair_t("K00:3", "ToggleBG2"));
-+ keymaps.push_back(strpair_t("K00:4", "ToggleBG3"));
-+ keymaps.push_back(strpair_t("K00:5", "ToggleSprites"));
-+ keymaps.push_back(strpair_t("K00:9", "ToggleTransparency"));
-+ keymaps.push_back(strpair_t("K00:BackSpace", "ClipWindows"));
-+ keymaps.push_back(strpair_t("K00:A+Escape", "Debugger"));
-+
-+ keymaps.push_back(strpair_t("M00:B0", "{Mouse1 L,Superscope Fire,Justifier1 Trigger}"));
-+ keymaps.push_back(strpair_t("M00:B1", "{Justifier1 AimOffscreen Trigger,Superscope AimOffscreen}"));
-+ keymaps.push_back(strpair_t("M00:B2", "{Mouse1 R,Superscope Cursor,Justifier1 Start}"));
-+ keymaps.push_back(strpair_t("M00:Pointer", "Pointer Mouse1+Superscope+Justifier1"));
-+ keymaps.push_back(strpair_t("K00:BackQuote", "Superscope ToggleTurbo"));
-+ keymaps.push_back(strpair_t("K00:Slash", "Superscope Pause"));
-+ }
-+
-+ // s_no_repeat = !conf.GetBool("Unix/NaCl::SetKeyRepeat", TRUE);
-+
-+ if (conf.Exists("Unix/NaCl::VideoMode")) {
-+ s_video_mode = conf.GetUInt("Unix/NaCl::VideoMode", VIDEOMODE_BLOCKY);
-+ if (s_video_mode < 1 || s_video_mode > 8)
-+ s_video_mode = VIDEOMODE_BLOCKY;
-+ } else {
-+ s_video_mode = VIDEOMODE_BLOCKY;
-+ }
-+
-+ return "Unix/NaCl";
-+}
-+
-+const char * S9xSelectFilename(const char *def, const char *dir1, const
-+ char *ext1, const char *title) {
-+ printf("S9xSelectFilename(%s, %s, %s, %s)\n", def, dir1, ext1, title);
-+ return NULL;
-+}
-+
-+void S9xMessage(int type, int number, const char *message) {
-+ printf("S9xMessage \"%s\"\n", message);
-+ const int max = 36 * 3;
-+ static char buffer[max + 1];
-+
-+ fprintf(stdout, "%s\n", message);
-+ strncpy(buffer, message, max + 1);
-+ buffer[max] = 0;
-+ S9xSetInfoString(buffer);
-+}
-+
-+const char * S9xStringInput(const char *message) {
-+ printf("S9xStringInput \"%s\"\n", message);
-+ return NULL;
-+}
-+
-+void S9xSetTitle (const char *string) {
-+ printf("S9xSetTitle \"%s\"\n", string);
-+}
-+
-+
-+// Graphics stuff
-+void S9xInitDisplay(int argc, char **argv) {
-+ s_context2d = PSContext2DAllocate(PP_IMAGEDATAFORMAT_BGRA_PREMUL);
-+ S9xSetRenderPixelFormat(RGB565);
-+ S9xBlitFilterInit();
-+ S9xBlit2xSaIFilterInit();
-+ S9xBlitHQ2xFilterInit();
-+
-+ GFX.Pitch = SNES_WIDTH * 2 * 2;
-+ s_snes_buffer =
-+ (uint8 *) calloc(GFX.Pitch * ((SNES_HEIGHT_EXTENDED + 4) * 2), 1);
-+
-+ GFX.Screen = (uint16 *) (s_snes_buffer + (GFX.Pitch * 2 * 2));
-+
-+ s_filter_buffer =
-+ (uint8 *) calloc((SNES_WIDTH * 2) * 2 * (SNES_HEIGHT_EXTENDED * 2), 1);
-+
-+ S9xGraphicsInit();
-+}
-+
-+void S9xDeinitDisplay() {
-+ S9xTextMode();
-+ S9xBlitFilterDeinit();
-+ S9xBlit2xSaIFilterDeinit();
-+ S9xBlitHQ2xFilterDeinit();
-+ PSContext2DFree(s_context2d);
-+}
-+
-+static void Convert16To24(int width, int height);
-+void S9xPutImage (int width, int height) {
-+ PSContext2DGetBuffer(s_context2d);
-+ if (NULL == s_context2d->data)
-+ return;
-+
-+ static int prevWidth = 0, prevHeight = 0;
-+ int copyWidth, copyHeight;
-+ Blitter blitFn = NULL;
-+
-+ if (s_video_mode == VIDEOMODE_BLOCKY ||
-+ s_video_mode == VIDEOMODE_TV ||
-+ s_video_mode == VIDEOMODE_SMOOTH) {
-+ if ((width <= SNES_WIDTH) &&
-+ ((prevWidth != width) || (prevHeight != height)))
-+ S9xBlitClearDelta();
-+ }
-+
-+ if (width <= SNES_WIDTH) {
-+ if (height > SNES_HEIGHT_EXTENDED) {
-+ copyWidth = width * 2;
-+ copyHeight = height;
-+ blitFn = S9xBlitPixSimple2x1;
-+ } else {
-+ copyWidth = width * 2;
-+ copyHeight = height * 2;
-+
-+ switch (s_video_mode) {
-+ case VIDEOMODE_BLOCKY:
-+ blitFn = S9xBlitPixSimple2x2;
-+ break;
-+ case VIDEOMODE_TV:
-+ blitFn = S9xBlitPixTV2x2;
-+ break;
-+ case VIDEOMODE_SMOOTH:
-+ blitFn = S9xBlitPixSmooth2x2;
-+ break;
-+ case VIDEOMODE_SUPEREAGLE:
-+ blitFn = S9xBlitPixSuperEagle16;
-+ break;
-+ case VIDEOMODE_2XSAI:
-+ blitFn = S9xBlitPix2xSaI16;
-+ break;
-+ case VIDEOMODE_SUPER2XSAI:
-+ blitFn = S9xBlitPixSuper2xSaI16;
-+ break;
-+ case VIDEOMODE_EPX:
-+ blitFn = S9xBlitPixEPX16;
-+ break;
-+ case VIDEOMODE_HQ2X:
-+ blitFn = S9xBlitPixHQ2x16;
-+ break;
-+ }
-+ }
-+ } else if (height <= SNES_HEIGHT_EXTENDED) {
-+ copyWidth = width;
-+ copyHeight = height * 2;
-+
-+ switch (s_video_mode) {
-+ default:
-+ blitFn = S9xBlitPixSimple1x2;
-+ break;
-+ case VIDEOMODE_TV:
-+ blitFn = S9xBlitPixTV1x2;
-+ break;
-+ }
-+ } else {
-+ copyWidth = width;
-+ copyHeight = height;
-+ blitFn = S9xBlitPixSimple1x1;
-+ }
-+
-+ blitFn((uint8 *) GFX.Screen, GFX.Pitch, s_filter_buffer,
-+ kFilterBufferPitch, width, height);
-+
-+ if (height < prevHeight) {
-+ int p = kFilterBufferPitch >> 2;
-+ for (int y = SNES_HEIGHT * 2; y < SNES_HEIGHT_EXTENDED * 2; y++) {
-+ uint32 *d = (uint32 *) (s_filter_buffer + y * kFilterBufferPitch);
-+ for (int x = 0; x < p; x++)
-+ *d++ = 0;
-+ }
-+ }
-+
-+ Convert16To24(copyWidth, copyHeight);
-+ PSContext2DSwapBuffer(s_context2d);
-+
-+ prevWidth = width;
-+ prevHeight = height;
-+}
-+
-+static void Convert16To24(int width, int height) {
-+ // Draw centered in context2d canvas.
-+ int x_offset, y_offset;
-+
-+ if (s_context2d->width < width)
-+ width = s_context2d->width;
-+ else
-+ x_offset = (s_context2d->width - width) / 2;
-+
-+ if (s_context2d->height < height)
-+ height = s_context2d->height;
-+ else
-+ y_offset = (s_context2d->height - height) / 2;
-+
-+ for (int y = 0; y < height; y++) {
-+ uint16 *s = (uint16 *) (s_filter_buffer + y * kFilterBufferPitch);
-+ uint32 *d = (uint32 *) (s_context2d->data +
-+ (y + y_offset) * s_context2d->width +
-+ x_offset);
-+
-+ for (int x = 0; x < width; x++) {
-+ uint32 pixel = *s++;
-+ int alpha = 255;
-+ int red = ((pixel >> 11) & 0x1f) << 3;
-+ int green = ((pixel >> 6) & 0x1f) << 3;
-+ int blue = ( pixel & 0x1f) << 3;
-+ *d++ = (alpha << 24) | (red << 16) | (green << 8) | blue;
-+ }
-+ }
-+}
-+
-+// Control/Input stuff
-+void S9xProcessEvents(bool8 block) {
-+ PSEvent* ps_event;
-+ // Consume all available events.
-+ while ((ps_event = PSEventTryAcquire()) != NULL) {
-+ if (0 != PSContext2DHandleEvent(s_context2d, ps_event))
-+ return;
-+ if (ps_event->type == PSE_INSTANCE_HANDLEINPUT) {
-+ // Convert Pepper Simple event to a PPAPI C++ event
-+ pp::InputEvent event(ps_event->as_resource);
-+ switch (event.GetType()) {
-+ case PP_INPUTEVENT_TYPE_KEYDOWN:
-+ case PP_INPUTEVENT_TYPE_KEYUP: {
-+ pp::KeyboardInputEvent key(event);
-+ uint32_t modifiers = key.GetModifiers();
-+ uint32_t key_code = key.GetKeyCode();
-+ bool key_down = event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN;
-+ uint32 id = kKeyboardBit;
-+ id |= ((modifiers & kModifiersMask) << kModifierShift);
-+ id |= (key_code & kKeyCodeMask);
-+ S9xReportButton(id, key_down);
-+ break;
-+ }
-+ case PP_INPUTEVENT_TYPE_MOUSEDOWN:
-+ case PP_INPUTEVENT_TYPE_MOUSEUP: {
-+ pp::MouseInputEvent mouse(event);
-+ uint32 id = kMouseBit | (uint32) mouse.GetButton();
-+ bool mouse_down = event.GetType() == PP_INPUTEVENT_TYPE_MOUSEDOWN;
-+ S9xReportButton(id, mouse_down);
-+ break;
-+ }
-+ case PP_INPUTEVENT_TYPE_MOUSEMOVE: {
-+ pp::MouseInputEvent mouse(event);
-+ uint32 id = kMouseBit | kMousePointerBit;
-+ int16 x = mouse.GetPosition().x();
-+ int16 y = mouse.GetPosition().y();
-+ S9xReportPointer(id, x, y);
-+ break;
-+ }
-+ default:
-+ break;
-+ }
-+ }
-+ PSEventRelease(ps_event);
-+ }
-+}
-+
-+s9xcommand_t S9xGetDisplayCommandT(const char *n) {
-+ s9xcommand_t cmd;
-+
-+ cmd.type = S9xBadMapping;
-+ cmd.multi_press = 0;
-+ cmd.button_norpt = 0;
-+ cmd.port[0] = 0xff;
-+ cmd.port[1] = 0;
-+ cmd.port[2] = 0;
-+ cmd.port[3] = 0;
-+
-+ return cmd;
-+}
-+
-+char * S9xGetDisplayCommandName(s9xcommand_t cmd) {
-+ return strdup("None");
-+}
-+
-+bool8 S9xMapDisplayInput(const char *n, s9xcommand_t *cmd) {
-+ int i, d;
-+
-+ if (!isdigit(n[1]) || !isdigit(n[2]) || n[3] != ':')
-+ goto unrecog;
-+
-+ d = ((n[1] - '0') * 10 + (n[2] - '0')) << 24;
-+
-+ switch (n[0]) {
-+ case 'K': {
-+ d |= kKeyboardBit;
-+
-+ for (i = 4; n[i] != '\0' && n[i] != '+'; i++) ;
-+
-+ if (n[i] == '\0' || i == 4) {
-+ i = 4;
-+ } else {
-+ for (i = 4; n[i] != '+'; i++) {
-+ switch (n[i]) {
-+ case 'S':
-+ d |= PP_INPUTEVENT_MODIFIER_SHIFTKEY << kModifierShift;
-+ break;
-+ case 'C':
-+ d |= PP_INPUTEVENT_MODIFIER_CONTROLKEY << kModifierShift;
-+ break;
-+ case 'A':
-+ d |= PP_INPUTEVENT_MODIFIER_ALTKEY << kModifierShift;
-+ break;
-+ case 'M':
-+ d |= PP_INPUTEVENT_MODIFIER_METAKEY << kModifierShift;
-+ break;
-+ default:
-+ goto unrecog;
-+ }
-+ }
-+
-+ i++;
-+ }
-+
-+ int key_code;
-+ if ((key_code = StringToCode(n + i)) == -1)
-+ goto unrecog;
-+
-+ d |= key_code & 0xff;
-+
-+ return S9xMapButton(d, *cmd, false);
-+ }
-+
-+ case 'M': {
-+ char *c;
-+ int j;
-+
-+ d |= kMouseBit;
-+
-+ if (!strncmp(n + 4, "Pointer", 7)) {
-+ d |= kMousePointerBit;
-+
-+ if (n[11] == '\0')
-+ return S9xMapPointer(d, *cmd, false);
-+
-+ i = 11;
-+ } else if (n[4] == 'B') {
-+ i = 5;
-+ } else {
-+ goto unrecog;
-+ }
-+
-+ d |= j = strtol(n + i, &c, 10);
-+
-+ if ((c != NULL && *c != '\0') || j > kMousePointerBit - 1)
-+ goto unrecog;
-+
-+ if (d & kMousePointerBit)
-+ return S9xMapPointer(d, *cmd, false);
-+
-+ return S9xMapButton(d, *cmd, false);
-+ }
-+
-+ default:
-+ break;
-+ }
-+
-+unrecog:
-+ char *err = new char[strlen(n) + 34];
-+
-+ sprintf(err, "Unrecognized input device name '%s'", n);
-+ perror(err);
-+ delete [] err;
-+
-+ return false;
-+}
-+
-+// Sound stuff
-+static void S9xSoundCallback(void* user_data);
-+static void PepperSoundCallback(void* samples,
-+ uint32_t buffer_size,
-+ void* user_data);
-+void S9xOpenSoundDeviceNaCl() {
-+ pp::Instance instance(PSGetInstanceId());
-+ // Ask the browser/device for an appropriate sample frame count size.
-+ s_sample_frame_count =
-+ pp::AudioConfig::RecommendSampleFrameCount(
-+ &instance,
-+ PP_AUDIOSAMPLERATE_44100,
-+ kSampleFrameCount);
-+
-+ // Create an audio configuration resource.
-+ pp::AudioConfig audio_config = pp::AudioConfig(
-+ &instance,
-+ PP_AUDIOSAMPLERATE_44100,
-+ s_sample_frame_count);
-+
-+ // Create an audio resource.
-+ s_audio = pp::Audio(
-+ &instance,
-+ audio_config,
-+ PepperSoundCallback,
-+ NULL);
-+
-+ pthread_mutex_init(&s_audio_mutex, NULL);
-+ S9xSetSamplesAvailableCallback(S9xSoundCallback, NULL);
-+
-+ s_audio.StartPlayback();
-+}
-+
-+static void S9xSoundCallback(void* user_data) {
-+ pthread_mutex_lock(&s_audio_mutex);
-+ S9xFinalizeSamples();
-+ pthread_mutex_unlock(&s_audio_mutex);
-+}
-+
-+static void PepperSoundCallback(void* samples,
-+ uint32_t buffer_size,
-+ void* user_data) {
-+ pthread_mutex_lock(&s_audio_mutex);
-+ S9xMixSamples((uint8*)samples, buffer_size >> 1);
-+ pthread_mutex_unlock(&s_audio_mutex);
-+}
-+
-+
-+// Dummy functions
-+void S9xSetPalette() {}
-+void S9xTextMode() {}
-+void S9xGraphicsMode() {}
-+bool S9xDisplayPollButton(uint32 id, bool *pressed) { return false; }
-+bool S9xDisplayPollAxis (uint32 id, int16 *value) { return false; }
-+bool S9xDisplayPollPointer (uint32 id, int16 *x, int16 *y) { return false; }
-+
-+
-+#endif
-diff --git a/unix/unix.cpp b/unix/unix.cpp
---- a/unix/unix.cpp
-+++ b/unix/unix.cpp
-@@ -229,6 +229,14 @@
- #endif
- #endif
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+// Definition of timercmp taken from GLibC.
-+#define timercmp(a, b, CMP) \
-+ (((a)->tv_sec == (b)->tv_sec) ? \
-+ ((a)->tv_usec CMP (b)->tv_usec) : \
-+ ((a)->tv_sec CMP (b)->tv_sec))
-+#endif
-+
- typedef std::pair<std::string, std::string> strpair_t;
-
- ConfigFile::secvec_t keymaps;
-@@ -318,6 +326,10 @@ bool S9xDisplayPollButton (uint32, bool *);
- bool S9xDisplayPollAxis (uint32, int16 *);
- bool S9xDisplayPollPointer (uint32, int16 *, int16 *);
-
-+#ifdef __native_client__
-+void S9xOpenSoundDeviceNaCl();
-+#endif
-+
- static long log2 (long);
- static void SoundTrigger (void);
- static void InitTimer (void);
-@@ -1396,6 +1408,10 @@ static void InitTimer (void)
-
- bool8 S9xOpenSoundDevice (void)
- {
-+#ifdef __native_client__
-+ S9xOpenSoundDeviceNaCl();
-+#endif
-+
- #ifndef NOSOUND
- int J, K;
-
-@@ -1545,7 +1561,11 @@ static void sigbrkhandler (int)
- }
- #endif
-
-+#if defined(__native_client__)
-+int snes9x_main (int argc, char **argv)
-+#else
- int main (int argc, char **argv)
-+#endif
- {
- if (argc < 2)
- S9xUsage();
diff --git a/ports/snes9x/pkg_info b/ports/snes9x/pkg_info
deleted file mode 100644
index 7584454..0000000
--- a/ports/snes9x/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=snes9x
-VERSION=1.53
-URL=https://sites.google.com/site/bearoso/snes9x/snes9x-1.53-src.tar.bz2
-ARCHIVE_ROOT=snes9x-1.53-src
-LICENSE=CUSTOM
-SHA1=57be6480369f66b9aaaeb722789ce114f58ed1e2
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/snes9x/snes9x.html b/ports/snes9x/snes9x.html
deleted file mode 100644
index da2332e..0000000
--- a/ports/snes9x/snes9x.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE html>
-<html>
- <!--
- Copyright (c) 2013 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.
- -->
-<head>
- <title>Snes9x</title>
- <script type="text/javascript" src="snes9x.js"></script>
- <style>
- .icon {
- margin: 1px;
- text-align: center;
- }
- .circle {
- border-radius: 0.75em;
- display: inline-block;
- height: 1.5em;
- line-height: 1.5em;
- width: 1.5em;
- }
- .circle.dark {
- background-color: #483b8a;
- color: #949cc3;
- }
- .circle.light {
- background-color: #949cc3;
- color: #483b8a;
- }
- .capsule {
- font-size: 8px;
- color: #ccc;
- background-color: #353736;
- border-radius: 0.25em;
- display: inline-block;
- height: 0.6em;
- -webkit-transform: rotate(-40deg);
- width: 1.7em;
- }
- .shoulder {
- color: #483b8a;
- display: inline-block;
- height: 0.8em;
- width: 1.7em;
- background-color: #a1a3a2;
- line-height: 0.8em;
- }
- .shoulder.left {
- border-radius: 0.6em 0 0 0;
- }
- .shoulder.right {
- border-radius: 0 0.6em 0 0;
- }
- .dpad {
- background-color: #424345;
- display: inline-block;
- width: 1.3em;
- height: 1.3em;
- border: 0.2em transparent;
- border-radius: 0.3em 0.3em 0 0;
- }
- .dpad:after {
- border-bottom: 0.9em solid #5c5c5c;
- border-left: 0.45em solid transparent;
- border-right: 0.45em solid transparent;
- content: "";
- display: inline-block;
- height: 0.1em;
- width: 0;
- }
- .dpad.right {
- -webkit-transform: rotate(90deg);
- }
- .dpad.down {
- -webkit-transform: rotate(180deg);
- }
- .dpad.left {
- -webkit-transform: rotate(270deg);
- }
- table {
- border-collapse: collapse;
- font-family: sans-serif;
- font-size: 12px;
- text-align: center;
- margin-bottom: 1em;
- }
- tr {
- border-bottom: 1px solid #ccc;
- }
- th, td {
- border-right: 1px solid #ccc;
- padding: 2px;
- }
- .player {
- background-color: #283;
- border-radius: 0.5em;
- box-shadow: 0 -1px 0 rgba(0,0,0,0.25);
- color: #fff;
- display: inline-block;
- font-family: monospace;
- font-weight: bold;
- line-height: 0.8em;
- padding: 0.3em;
- }
- </style>
-</head>
-<body>
- <label for="romfile">Select ROM (*.smc): </label>
- <input type="file" id="romfile">
- <div id="listener"></div>
- <table>
- <thead>
- <td></td>
- <th><span class="icon dpad up"></span></th>
- <th><span class="icon dpad left"></span></th>
- <th><span class="icon dpad right"></span></th>
- <th><span class="icon dpad down"></span></th>
- <th><span class="icon capsule"></span>START</th>
- <th><span class="icon capsule"></span>SELECT</th>
- <th><span class="icon circle dark">A</span></th>
- <th><span class="icon circle dark">B</span></th>
- <th><span class="icon circle light">X</span></th>
- <th><span class="icon circle light">Y</span></th>
- <th><span class="icon shoulder left">L</span></th>
- <th><span class="icon shoulder right">R</span></th>
- </thead>
- <tr>
- <td><span class="player">P1</span></td>
- <td>U,Up</td>
- <td>H,Left</td>
- <td>K,Right</td>
- <td>J,N,Down</td>
- <td>Return</td>
- <td>Space</td>
- <td>D</td>
- <td>C</td>
- <td>S</td>
- <td>X</td>
- <td>A,V</td>
- <td>Z</td>
- </tr>
- <tr>
- <td><span class="player">P2</span></td>
- <td>KP 8</td>
- <td>KP 4</td>
- <td>KP 6</td>
- <td>KP 2</td>
- <td>KP Enter</td>
- <td>KP Add</td>
- <td>PgUp</td>
- <td>PgDn</td>
- <td>Home</td>
- <td>End</td>
- <td>Ins</td>
- <td>Del</td>
- </tr>
- </table>
- <table>
- <thead>
- <th></th>
- <th>Slot 1</th>
- <th>Slot 2</th>
- <th>Slot 3</th>
- <th>Slot 4</th>
- <th>Slot 5</th>
- <th>Slot 6</th>
- <th>Slot 7</th>
- <th>Slot 8</th>
- <th>Slot 9</th>
- </thead>
- <tr>
- <td>QuickLoad</td>
- <td>F1</td>
- <td>F2</td>
- <td>F3</td>
- <td>F4</td>
- <td>F5</td>
- <td>F6</td>
- <td>F7</td>
- <td>F8</td>
- <td>F9</td>
- </tr>
- <tr>
- <td>QuickSave</td>
- <td>Shift+F1</td>
- <td>Shift+F2</td>
- <td>Shift+F3</td>
- <td>Shift+F4</td>
- <td>Shift+F5</td>
- <td>Shift+F6</td>
- <td>Shift+F7</td>
- <td>Shift+F8</td>
- <td>Shift+F9</td>
- </tr>
- </table>
-</body>
-</html>
diff --git a/ports/snes9x/snes9x.js b/ports/snes9x/snes9x.js
deleted file mode 100644
index 242e1b5..0000000
--- a/ports/snes9x/snes9x.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-function domContentLoaded() {
- document.getElementById('romfile').addEventListener(
- 'change', handleFileSelect, false);
-}
-
-function handleFileSelect(evt) {
- var file = evt.target.files[0];
- var reader = new FileReader();
- var result = null;
-
- console.log('reader.readAsArrayBuffer');
- reader.onloadend = onLoadEnd;
- reader.onerror = errorHandler;
- reader.readAsArrayBuffer(file);
-
- function onLoadEnd(evt) {
- console.log('window.webkitRequestFileSystem');
- window.webkitRequestFileSystem(
- window.TEMPORARY, evt.result.size, onRequestQuotaSuccess, errorHandler);
- }
-
- function onRequestQuotaSuccess(fs) {
- console.log('fs.root.getFile');
- fs.root.getFile(file.name, {create: true}, onGetFileSuccess, errorHandler);
- }
-
- function onGetFileSuccess(fileEntry) {
- console.log('fileEntry.createWriter');
- fileEntry.createWriter(onCreateWriterSuccess, errorHandler);
- }
-
- function onCreateWriterSuccess(writer) {
- console.log('writer.write');
- writer.onwriteend = onWriteSuccess;
- writer.onerror = errorHandler;
- var blob = new Blob([result]);
- writer.write(blob);
- }
-
- function onWriteSuccess() {
- console.log('startGame: ' + file.name);
- startGame(file.name);
- }
-}
-
-function errorHandler(error) {
- console.log('Error: ' + error);
-}
-
-function startGame(filename) {
- // Width and height in pixels of the SNES screen.
- var snesWidth = 256;
- var snesHeight = 239;
-
- var nacl = document.createElement('embed');
- nacl.setAttribute('id', 'snes9x');
- nacl.setAttribute('width', snesWidth * 2); // Scale screen by 2x.
- nacl.setAttribute('height', snesHeight * 2);
- nacl.setAttribute('src', 'snes9x.nmf');
- nacl.setAttribute('type', 'application/x-nacl');
- nacl.setAttribute('ARG0', 'snes9x');
- nacl.setAttribute('ARG1', filename);
- nacl.setAttribute('ARG2', '-v1'); // Use "blocky" image scaling.
-
- // Remove previous embed element.
- document.getElementById('listener').innerHTML = '';
- document.getElementById('listener').appendChild(nacl);
-}
-
-document.addEventListener('DOMContentLoaded', domContentLoaded);
diff --git a/ports/speex/pkg_info b/ports/speex/pkg_info
deleted file mode 100644
index 3c1fbfb..0000000
--- a/ports/speex/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=speex
-VERSION=1.2rc1
-URL=http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
-LICENSE=BSD:COPYING
-DEPENDS=(libogg)
-# arm-nacl-clang crashes
-# https://code.google.com/p/nativeclient/issues/detail?id=4114
-DISABLED_TOOLCHAIN=(clang-newlib/arm emscripten)
-SHA1=52daa72572e844e5165315e208da539b2a55c5eb
diff --git a/ports/sqlite/build.sh b/ports/sqlite/build.sh
deleted file mode 100644
index 5dc151a..0000000
--- a/ports/sqlite/build.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (c) 2013 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.
-
-MAKE_TARGETS="CCLD=\$(CXX) all"
-NACLPORTS_CPPFLAGS+=" -DNACL_SDK_VERSION=$NACL_SDK_VERSION"
-if [ "${NACL_DEBUG}" = "1" ] ; then
- NACLPORTS_CPPFLAGS+=" -DSQLITE_DEBUG -DSQLITE_LOCK_TRACE"
-fi
-if [ "${NACL_SHARED}" = "1" ]; then
- EXECUTABLE_DIR=.libs
- NACLPORTS_LIBS+=" -ldl"
-else
- EXTRA_CONFIGURE_ARGS=--disable-dynamic-extensions
- EXECUTABLE_DIR=.
-fi
-
-EnableCliMain
-EXECUTABLES="sqlite3${NACL_EXEEXT}"
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
-
- local exe=${PUBLISH_DIR}/sqlite3_${NACL_ARCH}${NACL_EXEEXT}
-
- LogExecute cp ${EXECUTABLE_DIR}/sqlite3${NACL_EXEEXT} ${exe}
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- LogExecute ${PNACLFINALIZE} ${exe}
- fi
-
- pushd ${PUBLISH_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- -L${DESTDIR_LIB} \
- sqlite3*${NACL_EXEEXT} \
- -s . \
- -o sqlite.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py sqlite.nmf
- popd
-
- InstallNaClTerm ${PUBLISH_DIR}
-}
-
-RunTest() {
- naclport_test/test -g
-}
-
-TestStep() {
- MakeDir naclport_test
-
- if [[ ${NACL_ARCH} == "pnacl" ]]; then
- EXT=.bc
- else
- EXT=${NACL_EXEEXT}
- fi
-
- INCLUDES="-I${SRC_DIR} -I${GTEST_SRC}/include"
- LogExecute ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} -I${GTEST_SRC} \
- ${NACLPORTS_CFLAGS} -o gtest-all.o -c ${GTEST_SRC}/src/gtest-all.cc
-
- LogExecute ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} \
- ${NACLPORTS_CFLAGS} -o test.o -c ${START_DIR}/test.cc
-
- LogExecute ${NACLCXX} ${NACLPORTS_LDFLAGS} \
- -o naclport_test/test${EXT} test.o gtest-all.o sqlite3.o ${NACLPORTS_LIBS}
-
- [[ ${NACL_ARCH} == "pnacl" ]] && ${PNACLFINALIZE} \
- -o naclport_test/test${NACL_EXEEXT} naclport_test/test${EXT}
-
- echo "Running test"
-
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- local pexe=test${NACL_EXEEXT}
- (cd naclport_test;
- TranslateAndWriteLauncherScript ${pexe} x86-32 test.x86-32${EXT} \
- test)
- RunTest
- (cd naclport_test;
- TranslateAndWriteLauncherScript ${pexe} x86-64 test.x86-64${EXT} \
- test)
- RunTest
- echo "Tests OK"
- elif [ "$(uname -m)" = "${NACL_ARCH_ALT}" ]; then
- WriteLauncherScript naclport_test/test test${EXT}
- RunTest
- echo "Tests OK"
- fi
-}
diff --git a/ports/sqlite/nacl.patch b/ports/sqlite/nacl.patch
deleted file mode 100644
index 3fb67e3..0000000
--- a/ports/sqlite/nacl.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/shell.c b/shell.c
---- a/shell.c
-+++ b/shell.c
-@@ -2952,6 +2968,10 @@ int main(int argc, char **argv){
- main_init(&data);
- stdin_is_interactive = isatty(0);
-
-+#if defined __native_client__ && !defined PPAPI
-+ stdin_is_interactive = 1;
-+#endif
-+
- /* Make sure we have a valid signal handler early, before anything
- ** else is done.
- */
-diff --git a/sqlite3.c b/sqlite3.c
---- a/sqlite3.c
-+++ b/sqlite3.c
-@@ -22852,6 +22852,27 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
- #include <sys/mman.h>
- #endif
-
-+/* flock struct was added to PNaCl toolchain in 32 and
-+ * newlib toolchain in 33
-+ * TODO(sbc): remove this once 33 goes stable */
-+#if defined __native_client__ && !defined __GLIBC__
-+ #if defined __PNACL__ && NACL_SDK_VERSION < 32
-+ #define MISSING_FLOCK
-+ #elif !defined __PNACL__ && NACL_SDK_VERSION < 33
-+ #define MISSING_FLOCK
-+ #endif
-+#endif
-+
-+#ifdef MISSING_FLOCK
-+struct flock {
-+ short l_type;
-+ short l_whence;
-+ off_t l_start;
-+ off_t l_len;
-+ pid_t l_pid;
-+};
-+#endif
-+
-
- #if SQLITE_ENABLE_LOCKING_STYLE
- # include <sys/ioctl.h>
-@@ -29891,6 +29912,11 @@ SQLITE_API int sqlite3_os_init(void){
- ** array cannot be const.
- */
- static sqlite3_vfs aVfs[] = {
-+#if defined __native_client__
-+ // Give higher priority to "unix-dotfile" over "unix", because NaCl doesn't
-+ // support some POSIX fcntl operations (F_GETLK, F_SETLK).
-+ UNIXVFS("unix-dotfile", dotlockIoFinder ),
-+#endif
- #if SQLITE_ENABLE_LOCKING_STYLE && (OS_VXWORKS || defined(__APPLE__))
- UNIXVFS("unix", autolockIoFinder ),
- #else
diff --git a/ports/sqlite/pkg_info b/ports/sqlite/pkg_info
deleted file mode 100644
index 799412d..0000000
--- a/ports/sqlite/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=sqlite
-VERSION=3071601
-ARCHIVE_ROOT=sqlite-autoconf-3071601
-URL=http://www.sqlite.org/2013/sqlite-autoconf-3071601.tar.gz
-DEPENDS=(gtest readline nacl-spawn)
-SHA1=b0d9b3e2ca3c50f72e5921e9532130787871b7ae
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/sqlite/test.cc b/ports/sqlite/test.cc
deleted file mode 100644
index 3185ba9..0000000
--- a/ports/sqlite/test.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015 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.
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <sys/mount.h>
-#include <unistd.h>
-
-// the libary we are testing.
-#include <sqlite3.h>
-
-#include "nacl_io/nacl_io.h"
-
-#include "gtest/gtest.h"
-
-TEST(SqliteTest, InsertValues) {
- nacl_io_init();
- umount("/");
- ASSERT_EQ(mount( "", "/", "memfs", 0, NULL), 0);
-
- sqlite3 *db = NULL;
- ASSERT_EQ(sqlite3_open("/test.db", &db), SQLITE_OK);
- ASSERT_EQ(sqlite3_exec(db, "CREATE TABLE foo(bar INTEGER, baz INTEGER)", NULL,
- NULL, NULL), SQLITE_OK);
- EXPECT_EQ(sqlite3_exec(db, "INSERT INTO foo(bar, baz) VALUES (1, 2)",
- NULL, NULL, NULL), SQLITE_OK);
- EXPECT_EQ(sqlite3_exec(db, "INSERT INTO foo(bar, baz) VALUES (3, 4)",
- NULL, NULL, NULL), SQLITE_OK);
- ASSERT_EQ(sqlite3_close(db), SQLITE_OK);
-}
-
-int main(int argc, char** argv) {
- setenv("TERM", "xterm-256color", 0);
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/ports/stoken/build.sh b/ports/stoken/build.sh
deleted file mode 100644
index c3134cc..0000000
--- a/ports/stoken/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2016 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.
-
-EnableCliMain
-EnableGlibcCompat
-EXTRA_CONFIGURE_ARGS+=" --without-gtk --with-nettle"
-EXECUTABLES=stoken${NACL_EXEEXT}
-
-# Workaround for pthread link order problem (copied from libarchive).
-export LIBS="-lpthread -lm"
diff --git a/ports/stoken/pkg_info b/ports/stoken/pkg_info
deleted file mode 100644
index c595ff1..0000000
--- a/ports/stoken/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=stoken
-VERSION=0.90
-URL=http://downloads.sf.net/stoken/stoken-0.90.tar.gz
-LICENSE=LGPL2.1
-DEPENDS=(glibc-compat nacl-spawn libxml2 nettle)
-SHA1=15242a89d5a6025f465aba848348ac3a0a9ede88
diff --git a/ports/subversion/build.sh b/ports/subversion/build.sh
deleted file mode 100644
index db57048..0000000
--- a/ports/subversion/build.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2014 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.
-
-# subversion's build system seem to have a bug with out-of-tree builds
-# and parallel building that was causing occational flakes on the buildbots.
-# The mkdir-init target appears to be required before any object file can be
-# built but none of the object files seem to depend on this.
-OS_JOBS=1
-
-EXTRA_CONFIGURE_ARGS="--with-apr=${NACL_PREFIX}"
-EXTRA_CONFIGURE_ARGS+=" --with-apr-util=${NACL_PREFIX}"
-EXTRA_CONFIGURE_ARGS+=" --without-apxs"
-EXTRA_CONFIGURE_ARGS+=" --enable-all-static"
-
-EnableCliMain
-EnableGlibcCompat
diff --git a/ports/subversion/nacl.patch b/ports/subversion/nacl.patch
deleted file mode 100644
index 39e6895..0000000
--- a/ports/subversion/nacl.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -18377,10 +18377,11 @@ fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O dynamic module iteration functions" >&5
- $as_echo_n "checking for Mach-O dynamic module iteration functions... " >&6; }
- if test "$cross_compiling" = yes; then :
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "cannot run test program while cross compiling
--See \`config.log' for more details" "$LINENO" 5; }
-+# { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+#as_fn_error $? "cannot run test program while cross compiling
-+#See \`config.log' for more details" "$LINENO" 5; }
-+ echo skipping
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
diff --git a/ports/subversion/pkg_info b/ports/subversion/pkg_info
deleted file mode 100644
index 604eb09..0000000
--- a/ports/subversion/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=subversion
-VERSION=1.8.11
-URL=http://apache.mirrors.pair.com/subversion/subversion-1.8.11.tar.bz2
-LICENSE=APACHE
-DEPENDS=(apr apr-util sqlite zlib nacl-spawn)
-SHA1=161edaee328f4fdcfd2a7c10ecd3fbcd51c61275
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/tar/README.nacl b/ports/tar/README.nacl
deleted file mode 100644
index df60694..0000000
--- a/ports/tar/README.nacl
+++ /dev/null
@@ -1,7 +0,0 @@
-We are intentionally using an old version of GNU tar. nacl_io
-does not have openat as of January 2014 and more recent releases of
-GNU tar heavily uses it. Note that you should be able to remove
-nacl.patch if you can update the version of GNU tar.
-
-The build of this package failed with newlib, so currently this port
-is glibc only.
diff --git a/ports/tar/build.sh b/ports/tar/build.sh
deleted file mode 100644
index a1d213e..0000000
--- a/ports/tar/build.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2014 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.
-
-export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
-EXECUTABLES=src/tar${NACL_EXEEXT}
-
-# The default when cross compiling is to assume chown does not
-# follow symlinks, and the code that works around this in chown.c
-# does not compile under newlib (missing O_NOCTTY).
-export gl_cv_func_chown_follows_symlink=yes
-
-# The mtio.h we currently ship with the arm/glibc toolchain is not usable
-export ac_cv_header_sys_mtio_h=no
-
-EnableGlibcCompat
-
-if [ "${TOOLCHAIN}" = "glibc" -a "${NACL_ARCH}" != "arm" ]; then
- # TODO(sbc): remove this once we fix glibc issue:
- # https://code.google.com/p/nativeclient/issues/detail?id=4241
- NACLPORTS_CPPFLAGS+=" -D_FORTIFY_SOURCE=0"
-fi
-
-if [ "${NACL_ARCH}" = "arm" ]; then
- # The ARM compiler is a more recent version of gcc that generated a warnings
- # (which are errors due to Werror) unless we disable them.
- EXTRA_CONFIGURE_ARGS+=" --disable-gcc-warnings"
-fi
-
-if [ "${TOOLCHAIN}" = "pnacl" -o "${TOOLCHAIN}" = "clang-newlib" ]; then
- # correctly handle 'extern inline'
- NACLPORTS_CPPFLAGS+=" -std=gnu89"
-fi
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- cp src/tar${NACL_EXEEXT} ${PUBLISH_DIR}/tar_${NACL_ARCH}${NACL_EXEEXT}
- ChangeDir ${PUBLISH_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${PUBLISH_DIR}/tar_*${NACL_EXEEXT} \
- -s . \
- -o tar.nmf
-}
diff --git a/ports/tar/nacl.patch b/ports/tar/nacl.patch
deleted file mode 100644
index a4fdb7c..0000000
--- a/ports/tar/nacl.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -34537,7 +34537,6 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
- -Wswitch \
- -Wswitch-default \
- -Wsync-nand \
-- -Wsystem-headers \
- -Wtrampolines \
- -Wtrigraphs \
- -Wtype-limits \
-diff --git a/src/Makefile.in b/src/Makefile.in
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -873,7 +873,7 @@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
- LIBICONV = @LIBICONV@
- LIBINTL = @LIBINTL@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
- LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
- LIB_ACL = @LIB_ACL@
-diff --git a/src/extract.c b/src/extract.c
---- a/src/extract.c
-+++ b/src/extract.c
-@@ -357,6 +357,10 @@ set_stat (char const *file_name,
- check_time (file_name, ts[1]);
- }
- else if (typeflag != SYMTYPE || implemented (errno))
-+ /* TODO(bradnelson): Remove this when all mounts handle utime. */
-+#if defined(__native_client__)
-+ if (errno != ENOSYS && errno != EINVAL)
-+#endif
- utime_error (file_name);
- }
-
-diff --git a/src/tar.c b/src/tar.c
---- a/src/tar.c
-+++ b/src/tar.c
-@@ -42,6 +42,7 @@
- #include <closeout.h>
- #include <configmake.h>
- #include <exitfail.h>
-+#include <locale.h>
- #include <parse-datetime.h>
- #include <rmt.h>
- #include <rmt-command.h>
-@@ -1348,7 +1349,7 @@ static char const *const sort_mode_arg[] = {
- static int sort_mode_flag[] = {
- SAVEDIR_SORT_NONE,
- SAVEDIR_SORT_NAME,
-- SAVEDIR_SORT_INODE
-+ SAVEDIR_SORT_FASTREAD
- };
-
- ARGMATCH_VERIFY (sort_mode_arg, sort_mode_flag);
diff --git a/ports/tar/pkg_info b/ports/tar/pkg_info
deleted file mode 100644
index 19126de..0000000
--- a/ports/tar/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=tar
-VERSION=1.28
-URL=http://ftp.gnu.org/gnu/tar/tar-1.28.tar.bz2
-LICENSE=GPL
-DEPENDS=(nacl-spawn)
-# missing sysexits.h
-SHA1=668ea52014ef7e70afc4ff7324410ee32f2970ef
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/tcl/build.sh b/ports/tcl/build.sh
deleted file mode 100644
index 0b4d055..0000000
--- a/ports/tcl/build.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) 2014 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_CONFIGURE_PATH=${SRC_DIR}/unix/configure
-
-MAKE_TARGETS="binaries"
-INSTALL_TARGETS="install-binaries"
-
-# Disable fallbacks for broken libc's that kick in for
-# cross-compiles since autoconf can't run target binaries.
-# The fallbacks seem to be non-general.
-export tcl_cv_strtod_buggy=ok
-export ac_cv_func_strtod=yes
-export ac_cv_func_memmove=yes
-export tcl_cv_strtod_unbroken=ok
-
-# Prevent non-cross compile clean parts of the build from assuming the host
-# system influences things (needed for OSX).
-export tcl_cv_sys_version=Generic
-
-if [[ ${NACL_SHARED} == 1 ]]; then
- NACLPORTS_CFLAGS+=" -fPIC"
- # Without this some of the configure tests fail with:
- # ld: conftest: hidden symbol `main' in /tmp/ccQC0Erg.o is referenced by DSO
- export tcl_cv_cc_visibility_hidden=no
-fi
-
-EnableCliMain
-EnableGlibcCompat
-
-if [[ ${NACL_LIBC} == newlib ]]; then
- NACLPORTS_CPPFLAGS+=" -DHAVE_STRLCPY=1"
- EXTRA_CONFIGURE_ARGS+=" --enable-shared=no"
- EXTRA_CONFIGURE_ARGS+=" --enable-load=no"
- export tcl_cv_strtoul_unbroken=ok
-fi
diff --git a/ports/tcl/nacl.patch b/ports/tcl/nacl.patch
deleted file mode 100644
index 72c99cb..0000000
--- a/ports/tcl/nacl.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff --git a/unix/configure b/unix/configure
---- a/unix/configure
-+++ b/unix/configure
-@@ -10916,7 +10916,10 @@ _ACEOF
- fi
-
-
--if test "`uname -s`" = "Darwin" && test "${TCL_THREADS}" = 1 && \
-+# NOTE: Switching `uname -s` = "Darwin" to notDarwin here and several other
-+# locations. Use of this check for the system type causes a cross compile done
-+# on an osx system to try to include osx specific features in the target build.
-+if test "`uname -s`" = "notDarwin" && test "${TCL_THREADS}" = 1 && \
- test "`uname -r | awk -F. '{print $1}'`" -lt 7; then
- # prior to Darwin 7, realpath is not threadsafe, so don't
- # use it when threads are enabled, c.f. bug # 711232
-@@ -12522,7 +12525,7 @@ _ACEOF
-
- fi
-
-- if test "`uname -s`" = "Darwin" && \
-+ if test "`uname -s`" = "notDarwin" && \
- test "`uname -r | awk -F. '{print $1}'`" -gt 5; then
- # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
- # are actually MT-safe as they always return pointers
-@@ -17347,7 +17350,7 @@ fi
- # Darwin specific API checks and defines
- #--------------------------------------------------------------------
-
--if test "`uname -s`" = "Darwin" ; then
-+if test "`uname -s`" = "notDarwin" ; then
-
- for ac_func in getattrlist
- do
-@@ -19023,7 +19026,7 @@ _ACEOF
-
- DTRACE_SRC="\${DTRACE_SRC}"
- DTRACE_HDR="\${DTRACE_HDR}"
-- if test "`uname -s`" != "Darwin" ; then
-+ if test "`uname -s`" != "notDarwin" ; then
- DTRACE_OBJ="\${DTRACE_OBJ}"
- if test "`uname -s`" = "SunOS" -a "$SHARED_BUILD" = "0" ; then
- # Need to create an intermediate object file to ensure tclDTrace.o
-@@ -19139,9 +19142,9 @@ HTML_DIR='$(DISTDIR)/html'
- # AIX remembers this path and will attempt to use it at run-time to look
- # up the Tcl library.
-
--if test "`uname -s`" = "Darwin" ; then
-+if test "`uname -s`" = "notDarwin" ; then
-
-- if test "`uname -s`" = "Darwin" ; then
-+ if test "`uname -s`" = "notDarwin" ; then
- echo "$as_me:$LINENO: checking how to package libraries" >&5
- echo $ECHO_N "checking how to package libraries... $ECHO_C" >&6
- # Check whether --enable-framework or --disable-framework was given.
-diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c
---- a/unix/tclAppInit.c
-+++ b/unix/tclAppInit.c
-@@ -32,6 +32,10 @@ extern Tcl_PackageInitProc Tclxttest_Init;
- * #if checks for that #define and uses Tcl_AppInit if it does not exist.
- */
-
-+#if defined(__native_client__) && defined(__GLIBC__)
-+#define MODULE_SCOPE extern __attribute__ ((visibility ("default")))
-+#endif
-+
- #ifndef TCL_LOCAL_APPINIT
- #define TCL_LOCAL_APPINIT Tcl_AppInit
- #endif
-diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
---- a/unix/tclUnixCompat.c
-+++ b/unix/tclUnixCompat.c
-@@ -99,7 +99,8 @@ static Tcl_Mutex compatLock;
- #undef NEED_COPYPWD
- #undef NEED_COPYSTRING
-
--#if !defined(HAVE_GETGRNAM_R_5) && !defined(HAVE_GETGRNAM_R_4)
-+#if (!defined(HAVE_GETGRNAM_R_5) && !defined(HAVE_GETGRNAM_R_4)) \
-+ || (!defined(HAVE_GETGRGID_R_5) && !defined(HAVE_GETGRGID_R_4))
- #define NEED_COPYGRP 1
- static int CopyGrp(struct group *tgtPtr, char *buf, int buflen);
- #endif
diff --git a/ports/tcl/pkg_info b/ports/tcl/pkg_info
deleted file mode 100644
index 0b5afbf..0000000
--- a/ports/tcl/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=tcl
-ARCHIVE_ROOT=tcl8.6.1
-VERSION=8.6.1
-URL=http://prdownloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
-LICENSE=BSD
-DEPENDS=(glibc-compat nacl-spawn)
-SHA1=5c83d44152cc0496cc0847a2495f659502a30e40
diff --git a/ports/texinfo/build.sh b/ports/texinfo/build.sh
deleted file mode 100644
index 68ccd08..0000000
--- a/ports/texinfo/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2015 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.
-
-export ac_cv_func_sigaction=yes
-
-EnableCliMain
-EnableGlibcCompat
-
-if [ "${NACL_ARCH}" = "pnacl" ]; then
- export gl_cv_header_wchar_h_correct_inline=yes
-fi
diff --git a/ports/texinfo/pkg_info b/ports/texinfo/pkg_info
deleted file mode 100644
index c1a21ab..0000000
--- a/ports/texinfo/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=texinfo
-VERSION=6.0
-URL=http://ftp.gnu.org/gnu/texinfo/texinfo-6.0.tar.gz
-LICENSE="GPL v3"
-DEPENDS=(libtar nacl-spawn glibc-compat)
-SHA1=110d45256c4219c88dc2fdb8c9c1a20749e4e7c5
diff --git a/ports/texlive/build.sh b/ports/texlive/build.sh
deleted file mode 100644
index 7c8e8d1..0000000
--- a/ports/texlive/build.sh
+++ /dev/null
@@ -1,176 +0,0 @@
-# Copyright 2015 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.
-
-TLNET_URL=http://storage.googleapis.com/webports/mirror/texlive-20150523
-
-SCHEME="small"
-
-NACLPORTS_CFLAGS+=" -I${NACLPORTS_INCLUDE}"
-NACLPORTS_CXXFLAGS+=" -I${NACLPORTS_INCLUDE}"
-
-EXTRA_CONFIGURE_ARGS="--disable-native-texlive-build \
- --enable-cxx-runtime-hack \
- --disable-ipc \
- --disable-lcdf-typetools \
- --disable-luajittex \
- --disable-mktexmf-default \
- --disable-mktexpk-default \
- --disable-mktextfm-default \
- --disable-mkocp-default \
- --disable-mktexfmt-default \
- --disable-dependency-tracking \
- --disable-linked-scripts \
- --disable-shared \
- --disable-largefile \
- --with-banner-add=/NaCl \
- --without-x"
-
-export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
-
-EnableGlibcCompat
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- NACLPORTS_CFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
- NACLPORTS_CXXFLAGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
- NACLPORTS_LIBS+=" -lm"
-fi
-
-BuildHostBinaries() {
- local host_build=${WORK_DIR}/build_host
- if [ ! -x ${host_build}/texk/web2c/tangleboot ]; then
- Banner "Building texlive for host"
- MakeDir ${host_build}
- ChangeDir ${host_build}
- LIBS="" EXTRA_LIBS="" LogExecute ${SRC_DIR}/configure \
- --disable-all-pkgs --enable-web2c
- LIBS="" EXTRA_LIBS="" LogExecute make -j${OS_JOBS}
- cd -
- fi
- EXTRA_CONFIGURE_ARGS="${EXTRA_CONFIGURE_ARGS} \
- OTANGLE=${host_build}/texk/web2c/otangle \
- TIE=${host_build}/texk/web2c/tie \
- CTANGLE=${host_build}/texk/web2c/ctangle \
- CTANGLEBOOT=${host_build}/texk/web2c/ctangleboot \
- TANGLE=${host_build}/texk/web2c/tangle \
- TANGLEBOOT=${host_build}/texk/web2c/tangleboot"
-}
-
-ConfigureStep() {
- # We need to build a host version of TeX Live for tangle, ctangle, otangle,
- # and tie which are used during the NaCl build.
- # TODO(phosek): a better solution would be to distribute pexe's for these
- # tools which would be translated for the host and ran using sel_ldr
- BuildHostBinaries
-
- local build_host=$(${SRC_DIR}/build-aux/config.guess)
- EXTRA_CONFIGURE_ARGS="${EXTRA_CONFIGURE_ARGS} \
- --build=${build_host} \
- BUILDCC=cc \
- BUILDCXX=c++ \
- BUILDAR=ar \
- BUILDRANLIB=ranlib \
- BUILDLIBS="
-
- # TODO(phosek): we need to hardcode the package path because kpathsea which
- # is normally responsible for resolving paths requires fork/spawn and pipes;
- # once nacl_io has support for pipes, we could remove this bit
- sed -i "s+\$PACKAGEDIR+/packages/texlive.${NACL_ARCH}+g" \
- ${SRC_DIR}/texk/kpathsea/texmf.cnf
-
- export ac_exeext=${NACL_EXEEXT}
- DefaultConfigureStep
-}
-
-BuildStep() {
- export CONFIG_SITE
- DefaultBuildStep
-}
-
-InstallStep() {
- INSTALL_TARGETS="install-strip texlinks"
- DefaultInstallStep
- Remove ${DESTDIR}${PREFIX}/bin/mktexfmt
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- local ARCH_DIR=${PUBLISH_DIR}/${NACL_ARCH}
-
- ChangeDir ${PUBLISH_DIR}
- local INSTALL_TL="install-tl-unx.tar.gz"
- local INSTALL_TL_DIR=${ARCH_DIR}/install-tl
- TryFetch "${TLNET_URL}/${INSTALL_TL}" ${INSTALL_TL}
- MakeDir ${INSTALL_TL_DIR}
- tar -xf ${INSTALL_TL} --directory ${INSTALL_TL_DIR} --strip-components=1
- rm -rf ${INSTALL_TL}
-
- ${TOOLS_DIR}/template_expand.py ${START_DIR}/texlive.profile \
- texdir=${ARCH_DIR} scheme=${SCHEME} > ${INSTALL_TL_DIR}/texlive.profile
-
- LogExecute ${INSTALL_TL_DIR}/install-tl \
- -repository ${TLNET_URL} -profile ${INSTALL_TL_DIR}/texlive.profile
- rm -rf ${INSTALL_TL_DIR}
-
- if [ "${OS_NAME}" != "Darwin" ]; then
- local tl_executables=$(find ${ARCH_DIR}/share/bin -type f -executable)
- else
- local tl_executables=$(find ${ARCH_DIR}/share/bin -type f -perm +u+x)
- fi
-
- ChangeDir ${ARCH_DIR}/share
- rm -rf bin
- rm -rf readme-html.dir readme-txt.dir
- rm -rf tlpkg
- rm -rf index.html install-tl install-tl.log release-texlive.txt
- rm -rf LICENSE.CTAN LICENSE.TL README README.usergroups
- find . -name "*.log" -print0 | xargs -0 rm
- for f in $(find . -type l); do
- cp --remove-destination $(readlink -f $f) $f
- done
- cp ${SRC_DIR}/texk/kpathsea/texmf.cnf texmf-dist/web2c/texmf.cnf
- ChangeDir ${ARCH_DIR}
-
- # TODO(phosek): Undo all source tree changes except for those coming from
- # nacl.patch, this step could be removed once we get kpathsea to work.
- (cd ${SRC_DIR}; git reset --hard)
-
- # TODO(phosek): The code below could be potentially replaced by
- # PublishByArchForDevEnv, but there is a subtle difference in that we only
- # copy executables valid for the selected scheme (tl_executables) and
- # PublishByArchForDevEnv does not currently have an option to filter out
- # specified files.
- if [ "${OS_NAME}" != "Darwin" ]; then
- local executables=$(find ${DESTDIR}${PREFIX}/bin -type f -executable)
- else
- local executables=$(find ${DESTDIR}${PREFIX}/bin -type f -perm +u+x)
- fi
-
- for exe in ${executables}; do
- local name=$(basename ${exe})
- name=${name/%.nexe/}
- name=${name/%.pexe/}
- for tl_exe in ${tl_executables}; do
- if [ "${name}" == "$(basename ${tl_exe})" ]; then
- LogExecute cp $(readlink -f ${exe}) ${ARCH_DIR}/${name}
- if $NACLREADELF -V ${ARCH_DIR}/${name} &>/dev/null; then
- pushd ${ARCH_DIR}
- LogExecute cp ${name} ${name}_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${name}_${NACL_ARCH}${NACL_EXEEXT} -s . -o ${name}.nmf
- LogExecute rm ${name}_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute rm ${name}.nmf
- popd
- fi
- fi
- done
- done
-
- ChangeDir ${ARCH_DIR}
- LogExecute rm -f ${ARCH_DIR}.zip
- LogExecute zip -r ${ARCH_DIR}.zip .
-
- # Drop unzipped copy to reduce upload failures on the bots.
- ChangeDir ${PUBLISH_DIR}
- LogExecute rm -rf ${PUBLISH_DIR}/${ARCH_DIR}
-}
diff --git a/ports/texlive/nacl.patch b/ports/texlive/nacl.patch
deleted file mode 100644
index eb7a265..0000000
--- a/ports/texlive/nacl.patch
+++ /dev/null
@@ -1,882 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
-index a4cdad2..f12e8be 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -370,7 +370,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
- LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LIBTOOL = @LIBTOOL@
- LIPO = @LIPO@
- LN_S = @LN_S@
-diff --git a/configure b/configure
-index ce0b359..804c706 100755
---- a/configure
-+++ b/configure
-@@ -961,7 +961,9 @@ XMKMF
- CXX
- CXXFLAGS
- CCC
--CXXCPP'
-+CXXCPP
-+AR
-+RANLIB'
- ac_subdirs_all='texk/ptexenc
- texk/kpathsea
- auxdir/auxsub libs utils texk'
-@@ -21199,7 +21201,11 @@ else
- fi
- if $FT2_CONFIG --ftversion >/dev/null 2>&1; then
- FREETYPE2_INCLUDES=`$FT2_CONFIG --cflags`
-- FREETYPE2_LIBS=`$FT2_CONFIG --libs`
-+ if test "$enable_shared" = no; then
-+ FREETYPE2_LIBS=`$FT2_CONFIG --libs --static`
-+ else
-+ FREETYPE2_LIBS=`$FT2_CONFIG --libs`
-+ fi
- elif test "x$need_freetype2:$with_system_freetype2" = xyes:yes; then
- as_fn_error $? "did not find freetype-config required for system freetype2 library" "$LINENO" 5
- fi
-diff --git a/configure.ac b/configure.ac
-index 3144b05..904ff13 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -64,6 +64,8 @@ AC_PROG_MKDIR_P
- AC_PATH_XTRA
-
- AC_PROG_CXX
-+AC_PROG_AR
-+AC_PROG_RANLIB
-
- AC_PROG_LN_S
- AC_ARG_WITH([ln-s],
-diff --git a/libs/cairo/cairo-1.14.2/build/configure.ac.warnings b/libs/cairo/cairo-1.14.2/build/configure.ac.warnings
-index 74e6634..94d1f42 100644
---- a/libs/cairo/cairo-1.14.2/build/configure.ac.warnings
-+++ b/libs/cairo/cairo-1.14.2/build/configure.ac.warnings
-@@ -39,7 +39,7 @@ dnl options. Namely, the following:
- MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"
-
- dnl Also to turn various gcc/glibc-specific preprocessor checks
--MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2"
-+# MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2"
-
- # invalidate cached value if MAYBE_WARN has changed
- if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then
-diff --git a/libs/cairo/cairo-1.14.2/src/cairo-wideint-type-private.h b/libs/cairo/cairo-1.14.2/src/cairo-wideint-type-private.h
-index 84a3cba..83bf8c1 100644
---- a/libs/cairo/cairo-1.14.2/src/cairo-wideint-type-private.h
-+++ b/libs/cairo/cairo-1.14.2/src/cairo-wideint-type-private.h
-@@ -124,12 +124,20 @@ typedef struct _cairo_quorem64 {
- cairo_int64_t rem;
- } cairo_quorem64_t;
-
-+/*
-+ * TODO(phosek): nacl-clang declares __uint128_t (but not uint128_t), which
-+ * is a gcc extension. However, it does not provide a runtime support for
-+ * neither __uint128_t nor uint128_t in compiler-rt which causes an error
-+ * during linking. The following check is a temporary workaround.
-+ */
-+#if !defined(__native_client__) || !defined(__clang__)
- /* gcc has a non-standard name. */
- #if HAVE___UINT128_T && !HAVE_UINT128_T
- typedef __uint128_t uint128_t;
- typedef __int128_t int128_t;
- #define HAVE_UINT128_T 1
- #endif
-+#endif
-
- #if !HAVE_UINT128_T
-
-diff --git a/libs/freetype2/Makefile.am b/libs/freetype2/Makefile.am
-index 16637fa..75fc589 100644
---- a/libs/freetype2/Makefile.am
-+++ b/libs/freetype2/Makefile.am
-@@ -28,7 +28,7 @@ ft-config:
- rm -rf ft-build
- $(MKDIR_P) ft-build
- cd ft-build && \
-- CC='$(CC)' CONFIG_SITE=/dev/null CONFIG_SHELL='$(SHELL)' \
-+ CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' CONFIG_SITE=/dev/null CONFIG_SHELL='$(SHELL)' \
- $(SHELL) $(abs_srcdir)/$(FREETYPE_TREE)/configure \
- $(config_args) --disable-shared \
- --without-bzip2 \
-diff --git a/libs/freetype2/Makefile.in b/libs/freetype2/Makefile.in
-index fc421cf..d6223e2 100644
---- a/libs/freetype2/Makefile.in
-+++ b/libs/freetype2/Makefile.in
-@@ -592,7 +592,7 @@ ft-config:
- rm -rf ft-build
- $(MKDIR_P) ft-build
- cd ft-build && \
-- CC='$(CC)' CONFIG_SITE=/dev/null CONFIG_SHELL='$(SHELL)' \
-+ CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' CONFIG_SITE=/dev/null CONFIG_SHELL='$(SHELL)' \
- $(SHELL) $(abs_srcdir)/$(FREETYPE_TREE)/configure \
- $(config_args) --disable-shared \
- --without-bzip2 \
-diff --git a/libs/gmp/Makefile.in b/libs/gmp/Makefile.in
-index 70c0a4d..36e18c6 100644
---- a/libs/gmp/Makefile.in
-+++ b/libs/gmp/Makefile.in
-@@ -2458,36 +2458,36 @@ $(sec_pi1_div_sources):
- native/stamp-bases:
- cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-bases
- mp_bases.h: native/stamp-bases
-- $(AM_V_GEN)native/gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-bases$(EXEEXT) header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
- mp_bases.c: mp_bases.h
-- $(AM_V_GEN)native/gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-bases$(EXEEXT) table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-
- native/stamp-fac:
- cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-fac
- fac_table.h: native/stamp-fac
-- $(AM_V_GEN)native/gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-fac$(EXEEXT) $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-
- native/stamp-fib:
- cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-fib
- fib_table.h: native/stamp-fib
-- $(AM_V_GEN)native/gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-fib$(EXEEXT) header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
- fib_table.c: fib_table.h
-- $(AM_V_GEN)native/gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-fib$(EXEEXT) table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-
- native/stamp-jacobitab:
- cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-jacobitab
- jacobitab.h: native/stamp-jacobitab
-- $(AM_V_GEN)native/gen-jacobitab >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-jacobitab$(EXEEXT) >$@ || (rm -f $@; exit 1)
-
- native/stamp-psqr:
- cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-psqr
- perfsqr.h: native/stamp-psqr
-- $(AM_V_GEN)native/gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-psqr$(EXEEXT) $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >$@ || (rm -f $@; exit 1)
-
- native/stamp-trialdivtab:
- cd native && $(MAKE) $(AM_MAKEFLAGS) stamp-trialdivtab
- trialdivtab.h: native/stamp-trialdivtab
-- $(AM_V_GEN)native/gen-trialdivtab $(GMP_LIMB_BITS) 8000 >$@ || (rm -f $@; exit 1)
-+ $(AM_V_GEN)native/gen-trialdivtab$(EXEEXT) $(GMP_LIMB_BITS) 8000 >$@ || (rm -f $@; exit 1)
- config.force: $(reconfig_prereq)
- @if test -f $@; then :; else \
- trap 'rm -rf reconfig.lock' 1 2 13 15; \
-diff --git a/libs/gmp/configure b/libs/gmp/configure
-index aa35d22..de8d23f 100755
---- a/libs/gmp/configure
-+++ b/libs/gmp/configure
-@@ -7909,7 +7909,8 @@ if test "x$cross_compiling" = xyes; then :
- fi
- ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
- CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
--CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"
-+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS' \
-+AR='$BUILDAR' RANLIB='$BUILDRANLIB' LIBS='$BUILDLIBS'"
- fi
-
- # configure is writing to config.log, and then calls config.status.
-diff --git a/libs/icu/configure b/libs/icu/configure
-index 8979784..1cd5ffa 100755
---- a/libs/icu/configure
-+++ b/libs/icu/configure
-@@ -4270,7 +4270,7 @@ do
- *) icu_list=build ;;
- esac
- case $icu_arg in
-- CC=* | CFLAGS=* | CPPFLAGS=* | CXX=* | CXXFLAGS=* | LDFLAGS=*) ;;
-+ CC=* | CFLAGS=* | CPPFLAGS=* | CXX=* | CXXFLAGS=* | LDFLAGS=* | AR=* | ARFLAGS=* | RANLIB=* | LIBS=*) ;;
- *) continue ;;
- esac
- case $icu_arg in
-diff --git a/libs/icu/configure.ac b/libs/icu/configure.ac
-index d38a179..c412f11 100644
---- a/libs/icu/configure.ac
-+++ b/libs/icu/configure.ac
-@@ -61,7 +61,7 @@ do
- *) icu_list=build ;;
- esac
- case $icu_arg in
-- CC=* | CFLAGS=* | CPPFLAGS=* | CXX=* | CXXFLAGS=* | LDFLAGS=*) ;;
-+ CC=* | CFLAGS=* | CPPFLAGS=* | CXX=* | CXXFLAGS=* | LDFLAGS=* | AR=* | ARFLAGS=* | RANLIB=* | LIBS=*) ;;
- *) continue ;;
- esac
- case $icu_arg in
-diff --git a/libs/icu/icu-55.1/source/common/putilimp.h b/libs/icu/icu-55.1/source/common/putilimp.h
-index 3d2eeec..2e56d94 100644
---- a/libs/icu/icu-55.1/source/common/putilimp.h
-+++ b/libs/icu/icu-55.1/source/common/putilimp.h
-@@ -124,6 +124,13 @@ typedef size_t uintptr_t;
- /* glibc */
- # define U_TIMEZONE __timezone
- # endif
-+#elif U_PLATFORM == U_PF_BROWSER_NATIVE_CLIENT
-+# if defined(__GLIBC__)
-+ /* __timezone is only available in glibc */
-+# define U_TIMEZONE __timezone
-+# else
-+# define U_TIMEZONE _timezone
-+# endif
- #elif U_PLATFORM_USES_ONLY_WIN32_API
- # define U_TIMEZONE _timezone
- #elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__)
-diff --git a/libs/icu/icu-55.1/source/common/unicode/platform.h b/libs/icu/icu-55.1/source/common/unicode/platform.h
-index 4829000..284a46c 100644
---- a/libs/icu/icu-55.1/source/common/unicode/platform.h
-+++ b/libs/icu/icu-55.1/source/common/unicode/platform.h
-@@ -127,7 +127,7 @@
- * http://www.chromium.org/nativeclient
- * @internal
- */
--#define U_PF_BROWSER_NATIVE_CLIENT 4020
-+#define U_PF_BROWSER_NATIVE_CLIENT 5000
- /** Android is based on Linux. @internal */
- #define U_PF_ANDROID 4050
- /* Maximum value for Linux-based platform is 4499 */
-diff --git a/libs/icu/icu-55.1/source/configure b/libs/icu/icu-55.1/source/configure
-index 9f02e91..5070175 100755
---- a/libs/icu/icu-55.1/source/configure
-+++ b/libs/icu/icu-55.1/source/configure
-@@ -4283,6 +4283,12 @@ esac
- $as_echo_n "checking checking for executable suffix... " >&6; }
- case "${host}" in
- *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
-+ *-*-nacl*)
-+ case "$CC" in
-+ *pnacl*) EXEEXT=.pexe ;;
-+ *) EXEEXT=.nexe ;;
-+ esac
-+ ;;
- *) EXEEXT="" ;;
- esac
- ac_exeext=$EXEEXT
-@@ -5106,7 +5112,7 @@ powerpc*-*-linux*)
- else
- icu_cv_host_frag=mh-linux-va
- fi ;;
--*-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) icu_cv_host_frag=mh-linux ;;
-+*-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu|*-*-nacl) icu_cv_host_frag=mh-linux ;;
- i[34567]86-*-cygwin)
- if test "$GCC" = yes; then
- icu_cv_host_frag=mh-cygwin
-@@ -5866,7 +5872,7 @@ if [ "$GXX" = yes ]; then
- # and check that the compiler still works.
- if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then
- OLD_CXXFLAGS="${CXXFLAGS}"
-- CXXFLAGS="$CXXFLAGS --std=c++0x"
-+ CXXFLAGS="$CXXFLAGS --std=gnu++0x"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have a C++11 compiler" >&5
- $as_echo_n "checking if we have a C++11 compiler... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -5889,9 +5895,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cxx11_okay" >&5
- $as_echo "$cxx11_okay" >&6; }
- if [ $cxx11_okay = yes ]; then
-- { $as_echo "$as_me:${as_lineno-$LINENO}: Adding CXXFLAGS option --std=c++0x" >&5
--$as_echo "$as_me: Adding CXXFLAGS option --std=c++0x" >&6;}
-- UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x"
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: Adding CXXFLAGS option --std=gnu++0x" >&5
-+$as_echo "$as_me: Adding CXXFLAGS option --std=gnu++0x" >&6;}
-+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=gnu++0x"
- else
- CXXFLAGS="$OLD_CXXFLAGS"
- fi
-diff --git a/libs/icu/icu-55.1/source/configure.ac b/libs/icu/icu-55.1/source/configure.ac
-index b30c8d0..e8825ff 100644
---- a/libs/icu/icu-55.1/source/configure.ac
-+++ b/libs/icu/icu-55.1/source/configure.ac
-@@ -222,6 +222,12 @@ ICU_PROG_LINK
- AC_MSG_CHECKING(checking for executable suffix)
- case "${host}" in
- *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
-+ *-*-nacl*)
-+ case "$CC" in
-+ *pnacl*) EXEEXT=.pexe ;;
-+ *) EXEEXT=.nexe ;;
-+ esac
-+ ;;
- *) EXEEXT="" ;;
- esac
- ac_exeext=$EXEEXT
-@@ -477,13 +483,13 @@ if [[ "$GXX" = yes ]]; then
- # and check that the compiler still works.
- if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then
- OLD_CXXFLAGS="${CXXFLAGS}"
-- CXXFLAGS="$CXXFLAGS --std=c++0x"
-+ CXXFLAGS="$CXXFLAGS --std=gnu++0x"
- AC_MSG_CHECKING([[if we have a C++11 compiler]])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx11_okay=yes],[cxx11_okay=no])
- AC_MSG_RESULT($cxx11_okay)
- if [[ $cxx11_okay = yes ]]; then
-- AC_MSG_NOTICE([Adding CXXFLAGS option --std=c++0x])
-- UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x"
-+ AC_MSG_NOTICE([Adding CXXFLAGS option --std=gnu++0x])
-+ UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=gnu++0x"
- else
- CXXFLAGS="$OLD_CXXFLAGS"
- fi
-diff --git a/libs/icu/icu-55.1/source/data/Makefile.in b/libs/icu/icu-55.1/source/data/Makefile.in
-index 9bc96cc..1d807eb 100644
---- a/libs/icu/icu-55.1/source/data/Makefile.in
-+++ b/libs/icu/icu-55.1/source/data/Makefile.in
-@@ -47,7 +47,7 @@ endif
- ifeq ($(OS390BATCH),1)
- PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -z -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR)
- else
--PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR)
-+PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -w -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR)
- endif
- OS390_PDS_NAME = -z -L $(BATCH_STUB_TARGET)
-
-diff --git a/libs/luajit/configure b/libs/luajit/configure
-index e6cd0c8..0b21046 100755
---- a/libs/luajit/configure
-+++ b/libs/luajit/configure
-@@ -16430,7 +16430,8 @@ if test "x$cross_compiling" = xyes; then :
- fi
- ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
- CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
--CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"
-+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS' \
-+AR='$BUILDAR' RANLIB='$BUILDRANLIB' LIBS='$BUILDLIBS'"
- fi
-
- # configure is writing to config.log, and then calls config.status.
-diff --git a/m4/kpse-common.m4 b/m4/kpse-common.m4
-index 9c98f34..2c7908a 100644
---- a/m4/kpse-common.m4
-+++ b/m4/kpse-common.m4
-@@ -329,5 +329,6 @@ AS_IF([test "x$cache_file" != x/dev/null],
- [cache_file=config.cache])
- ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
- CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
--CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"])])
-+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS' \
-+AR='$BUILDAR' RANLIB='$BUILDRANLIB' LIBS='$BUILDLIBS'"])])
- ]) # KPSE_NATIVE_SUBDIRS
-diff --git a/m4/kpse-fontconfig-flags.m4 b/m4/kpse-fontconfig-flags.m4
-index dac61e8..d97856e 100644
---- a/m4/kpse-fontconfig-flags.m4
-+++ b/m4/kpse-fontconfig-flags.m4
-@@ -39,7 +39,11 @@ if test "x$with_fontconfig_includes:$with_fontconfig_libdir" != x:; then
- fi
- elif $PKG_CONFIG fontconfig; then
- kpse_cv_fontconfig_includes=`$PKG_CONFIG fontconfig --cflags`
-- kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs`
-+ if test "x$enable_shared" = xno; then
-+ kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs --static`
-+ else
-+ kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs`
-+ fi
- fi
- CPPFLAGS="$kpse_cv_fontconfig_includes $CPPFLAGS"
- LIBS="$kpse_cv_fontconfig_libs $LIBS"
-diff --git a/m4/kpse-freetype2-flags.m4 b/m4/kpse-freetype2-flags.m4
-index c00b24a..b0dbb86 100644
---- a/m4/kpse-freetype2-flags.m4
-+++ b/m4/kpse-freetype2-flags.m4
-@@ -30,7 +30,11 @@ AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
- AC_CHECK_TOOL([FT2_CONFIG], [freetype-config], [false])[]dnl
- if $FT2_CONFIG --ftversion >/dev/null 2>&1; then
- FREETYPE2_INCLUDES=`$FT2_CONFIG --cflags`
-- FREETYPE2_LIBS=`$FT2_CONFIG --libs`
-+ if test "x$enable_shared" = xno; then
-+ FREETYPE2_LIBS=`$FT2_CONFIG --libs --static`
-+ else
-+ FREETYPE2_LIBS=`$FT2_CONFIG --libs`
-+ fi
- elif test "x$need_freetype2:$with_system_freetype2" = xyes:yes; then
- AC_MSG_ERROR([did not find freetype-config required for system freetype2 library])
- fi
-diff --git a/texk/Makefile.in b/texk/Makefile.in
-index bf45686..c785988 100644
---- a/texk/Makefile.in
-+++ b/texk/Makefile.in
-@@ -336,7 +336,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LTLIBOBJS = @LTLIBOBJS@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
-diff --git a/texk/bibtex-x/Makefile.in b/texk/bibtex-x/Makefile.in
-index 6a0e564..b3ea841 100644
---- a/texk/bibtex-x/Makefile.in
-+++ b/texk/bibtex-x/Makefile.in
-@@ -502,7 +502,7 @@ KPATHSEA_LIBS = @KPATHSEA_LIBS@
- LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LIBTOOL = @LIBTOOL@
- LIPO = @LIPO@
- LN_S = @LN_S@
-diff --git a/texk/dvipdfm-x/Makefile.in b/texk/dvipdfm-x/Makefile.in
-index ad763f7..6687720 100644
---- a/texk/dvipdfm-x/Makefile.in
-+++ b/texk/dvipdfm-x/Makefile.in
-@@ -570,7 +570,7 @@ LIBPAPER_LIBS = @LIBPAPER_LIBS@
- LIBPNG_DEPEND = @LIBPNG_DEPEND@
- LIBPNG_INCLUDES = @LIBPNG_INCLUDES@
- LIBPNG_LIBS = @LIBPNG_LIBS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LIBTOOL = @LIBTOOL@
- LIPO = @LIPO@
- LN_S = @LN_S@
-diff --git a/texk/dvipdfm-x/pdfencrypt.c b/texk/dvipdfm-x/pdfencrypt.c
-index 480823c..5f95549 100644
---- a/texk/dvipdfm-x/pdfencrypt.c
-+++ b/texk/dvipdfm-x/pdfencrypt.c
-@@ -22,6 +22,9 @@
- #include <config.h>
- #endif
-
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#define _GNU_SOURCE
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -32,6 +35,9 @@
- #define getch _getch
- #else /* !WIN32 */
- #include <unistd.h>
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#include <termios.h>
-+#endif
- #endif /* WIN32 */
-
- #include "system.h"
-@@ -347,7 +353,7 @@ static void compute_user_password (void)
- memcpy(upwd_string, out_buf, MAX_STR_LEN);
- }
-
--#ifdef WIN32
-+#if defined(WIN32)
- static char *getpass (const char *prompt)
- {
- static char pwd_buf[128];
-@@ -366,6 +372,37 @@ static char *getpass (const char *prompt)
- fputs("\n", stderr);
- return pwd_buf;
- }
-+#elif defined(__native_client__) && defined(_NEWLIB_VERSION)
-+char *getpass (const char *prompt)
-+{
-+ struct termios s, t;
-+ static char *buf;
-+ static size_t bufsize;
-+ ssize_t nread;
-+
-+ if (tcgetattr (fileno (stdin), &t) != 0)
-+ return -1;
-+ s = t;
-+ t.c_lflag &= ~ECHO;
-+ if (tcsetattr (fileno (stdin), TCSAFLUSH, &t) != 0)
-+ return -1;
-+
-+ fprintf(stderr, "%s", prompt);
-+ fflush(stderr);
-+
-+ nread = __getline (&buf, &bufsize, stdin);
-+ if (buf != NULL) {
-+ if (nread < 0) {
-+ buf[0] = '\0';
-+ } else if (buf[nread -1] == '\n') {
-+ buf[nread - 1] = '\n';
-+ fprintf(stderr, "\n");
-+ }
-+ }
-+
-+ (void) tcsetattr (fileno (stdin), TCSAFLUSH, &s);
-+ return buf;
-+}
- #endif
-
- void pdf_enc_set_passwd (unsigned bits, unsigned perm, const char *owner_pw, const char *user_pw)
-diff --git a/texk/dvipsk/configure b/texk/dvipsk/configure
-index c685b09..e028dbc 100755
---- a/texk/dvipsk/configure
-+++ b/texk/dvipsk/configure
-@@ -17427,9 +17427,11 @@ if test "x$cross_compiling" = xyes; then :
- if test "x$cache_file" != x/dev/null; then :
- cache_file=config.cache
- fi
-+unset CONFIG_SITE
- ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
- CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
--CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"
-+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS' \
-+AR='$BUILDAR' RANLIB='$BUILDRANLIB' LIBS='$BUILDLIBS'"
- fi
-
- # configure is writing to config.log, and then calls config.status.
-diff --git a/texk/kpathsea/line.c b/texk/kpathsea/line.c
-index 6c66a30..a9d3b89 100644
---- a/texk/kpathsea/line.c
-+++ b/texk/kpathsea/line.c
-@@ -19,7 +19,7 @@
- #include <kpathsea/config.h>
- #include <kpathsea/line.h>
-
--#ifdef WIN32
-+#if defined(WIN32)
- #undef getc
- #undef ungetc
- #define getc win32_getc
-@@ -27,6 +27,10 @@
- #define FLOCKFILE(x)
- #define FUNLOCKFILE(x)
-
-+#elif defined(__native_client__) && defined(_NEWLIB_VERSION)
-+/* Newlib doesn't currently implement flockfile/funlockfile. */
-+#define FLOCKFILE(x)
-+#define FUNLOCKFILE(x)
- #else /* not WIN32 */
- /* By POSIX, getc() has to be thread-safe, which means (un)locking on
- every character read. It is much faster to lock the stream (once),
-diff --git a/texk/kpathsea/progname.c b/texk/kpathsea/progname.c
-index c4fe781..368efdf 100644
---- a/texk/kpathsea/progname.c
-+++ b/texk/kpathsea/progname.c
-@@ -66,6 +66,11 @@
- #define S_IXOTH 0001
- #endif
-
-+#if defined(__native_client__)
-+/* Unfortunately symlink support is not yet implemented in nacl_io. */
-+#undef S_ISLNK
-+#endif
-+
-
- #ifndef WIN32
- /* From a standalone program `ll' to expand symlinks written by Kimbo Mundy.
-diff --git a/texk/kpathsea/texmf.cnf b/texk/kpathsea/texmf.cnf
-index 1b0df4b..ae02111 100644
---- a/texk/kpathsea/texmf.cnf
-+++ b/texk/kpathsea/texmf.cnf
-@@ -51,23 +51,23 @@
- % Redistributors will probably want $SELFAUTODIR/share, i.e., /usr/share.
- % Kpathsea sets SELFAUTOLOC (the directory with the binary),
- % SELFAUTODIR (its parent), and SELFAUTOPARENT (its grandparent).
--TEXMFROOT = $SELFAUTOPARENT
-+TEXMFROOT = $PACKAGEDIR/share
-
- % The main tree of distributed packages and programs:
--TEXMFDIST = $TEXMFROOT/texmf-dist
-+TEXMFDIST = $PACKAGEDIR/share/texmf-dist
-
- % We used to have a separate /texmf tree with some core programs and files.
- % Keep the variable name.
--TEXMFMAIN = $TEXMFDIST
-+TEXMFMAIN = $PACKAGEDIR/share/texmf-dist
-
- % Local additions to the distribution trees.
--TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local
-+TEXMFLOCAL = $PACKAGEDIR/texmf-local
-
- % TEXMFSYSVAR, where *-sys store cached runtime data.
--TEXMFSYSVAR = $TEXMFROOT/texmf-var
-+TEXMFSYSVAR = $PACKAGEDIR/share/texmf-var
-
- % TEXMFSYSCONFIG, where *-sys store configuration data.
--TEXMFSYSCONFIG = $TEXMFROOT/texmf-config
-+TEXMFSYSCONFIG = $PACKAGEDIR/share/texmf-config
-
- % Per-user texmf tree(s) -- organized per the TDS, as usual. To define
- % more than one per-user tree, set this to a list of directories in
-@@ -330,7 +330,7 @@ TEXPSHEADERS.gsftopk = .;$TEXMF/{dvips,fonts/{enc,type1,type42,type3,truetype}}/
- % OSFONTDIR is to provide a convenient hook for allowing TeX to find
- % fonts installed on the system (outside of TeX). An empty default
- % value would add "//" to the search paths, so we give it a dummy value.
--OSFONTDIR = /please/set/osfontdir/in/the/environment
-+OSFONTDIR = $PACKAGEDIR/share/fonts
-
- % PostScript Type 1 outline fonts.
- T1FONTS = .;$TEXMF/fonts/type1//;$OSFONTDIR//
-@@ -375,7 +375,7 @@ FONTCIDMAPS=.;$TEXMF/fonts/cid//
- PDFTEXCONFIG = .;$TEXMF/pdftex/{$progname,}//
-
- % Used by DMP (ditroff-to-mpx), called by makempx -troff.
--TRFONTS = /usr{/local,}/share/groff/{current/font,site-font}/devps
-+TRFONTS = $PACKAGEDIR{/local,}/share/groff/{current/font,site-font}/devps
- MPSUPPORT = .;$TEXMF/metapost/support
-
- % For xdvi to find mime.types and .mailcap, if they do not exist in
-@@ -486,33 +486,7 @@ RUBYINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/ruby//
- % since we don't want to scatter ../'s throughout the value. Hence we
- % explicitly list every directory. Arguably more understandable anyway.
- %
--TEXMFCNF = {\
--$SELFAUTOLOC,\
--$SELFAUTOLOC/share/texmf-local/web2c,\
--$SELFAUTOLOC/share/texmf-dist/web2c,\
--$SELFAUTOLOC/share/texmf/web2c,\
--$SELFAUTOLOC/texmf-local/web2c,\
--$SELFAUTOLOC/texmf-dist/web2c,\
--$SELFAUTOLOC/texmf/web2c,\
--\
--$SELFAUTODIR,\
--$SELFAUTODIR/share/texmf-local/web2c,\
--$SELFAUTODIR/share/texmf-dist/web2c,\
--$SELFAUTODIR/share/texmf/web2c,\
--$SELFAUTODIR/texmf-local/web2c,\
--$SELFAUTODIR/texmf-dist/web2c,\
--$SELFAUTODIR/texmf/web2c,\
--\
--$SELFAUTOGRANDPARENT/texmf-local/web2c,\
--$SELFAUTOPARENT,\
--\
--$SELFAUTOPARENT/share/texmf-local/web2c,\
--$SELFAUTOPARENT/share/texmf-dist/web2c,\
--$SELFAUTOPARENT/share/texmf/web2c,\
--$SELFAUTOPARENT/texmf-local/web2c,\
--$SELFAUTOPARENT/texmf-dist/web2c,\
--$SELFAUTOPARENT/texmf/web2c\
--}
-+TEXMFCNF = $PACKAGEDIR/share;$PACKAGEDIR/share/texmf-dist/web2c;$PACKAGEDIR/texmf-local/web2c
- %
- % For reference, here is the old brace-using definition:
- %TEXMFCNF = {$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c}
-diff --git a/texk/kpathsea/xgetcwd.c b/texk/kpathsea/xgetcwd.c
-index dae50dd..77e18be 100644
---- a/texk/kpathsea/xgetcwd.c
-+++ b/texk/kpathsea/xgetcwd.c
-@@ -30,7 +30,7 @@ static void
- xchdir (string dirname)
- {
- if (chdir(dirname) != 0)
-- _PERROR(dirname);
-+ FATAL_PERROR(dirname);
- }
-
- #endif /* (not HAVE_GETCWD || GETCWD_FORKS) && not HAVE_GETWD */
-@@ -115,7 +115,7 @@ xgetcwd (void)
- }
- }
- if (!found)
-- LIB_FATAL2("No inode %d/device %d in parent directory",
-+ FATAL2("No inode %d/device %d in parent directory",
- cwd_stat.st_ino, cwd_stat.st_dev);
-
- xclosedir(parent_dir);
-diff --git a/texk/kpathsea/xstat.h b/texk/kpathsea/xstat.h
-index 59347ba..b46dfb4 100644
---- a/texk/kpathsea/xstat.h
-+++ b/texk/kpathsea/xstat.h
-@@ -24,6 +24,11 @@
- #include <kpathsea/c-stat.h>
- #include <kpathsea/types.h>
-
-+#if defined(__native_client__)
-+/* Unfortunately symlink support is not yet implemented in nacl_io. */
-+#undef S_ISLNK
-+#endif
-+
- /* Two files are indistinguishable if they are on the same device
- and have the same inode. This checks two stat buffers for that. Cf.
- the `same_file_p' routine in file-p.c, declared in kpathlib.h. */
-diff --git a/texk/texlive/tl_scripts/texlinks.sh b/texk/texlive/tl_scripts/texlinks.sh
-index 91540ea..f86ff60 100755
---- a/texk/texlive/tl_scripts/texlinks.sh
-+++ b/texk/texlive/tl_scripts/texlinks.sh
-@@ -189,7 +189,7 @@ search_symlinkdir()
- kpsewhich=`check_for_binary kpsewhich`
- test -z "$kpsewhich" && return 1
- symlinkdir=`echo $kpsewhich | sed 's@/*kpsewhich$@@'`
-- kpseaccess -w "$symlinkdir" || return 1
-+ [ -w "$symlinkdir" ] || return 1
- touch "$symlinkdir/tl$$"
- if test -f "$selfautoloc/tl$$"; then
- rm -f "$symlinkdir/tl$$"
-@@ -249,7 +249,7 @@ main()
- silent=false
- thisdir=`pwd`
- : ${KPSE_DOT=$thisdir}; export KPSE_DOT
-- selfautoloc=`kpsewhich --expand-var='$SELFAUTOLOC'`
-+ selfautoloc=`cd \`dirname $0\` && pwd`
- while
- case $1 in
- --h*|-h)
-@@ -269,8 +269,6 @@ main()
- do test $# -gt 0 && shift; done
- dirs="$*"
-
-- # if no cnf_file from command-line, look it up with kpsewhich:
-- test -z "$cnf_file" && cnf_file=`kpsewhich --format='web2c files' $cnf`
- test -f "$cnf_file" || abort "config file \`$cnf' not found"
-
-
-@@ -285,7 +283,7 @@ main()
- if test $multiplatform = true; then
- case $selfautoloc in
- */bin) dirs=$selfautoloc;;
-- *) parent=`kpsewhich --expand-var='$SELFAUTODIR'`
-+ *) parent=`dirname $selfautoloc`
- dirs=`find $parent -type f -name kpsewhich -print \
- | sed 's@/kpsewhich$@@'`;;
- esac
-@@ -295,7 +293,7 @@ main()
- fi
-
- for d in $dirs; do
-- kpseaccess -w $d \
-+ [ -w $d ] \
- || { errmsg "$d: no write permissions. Skipping..."; continue; }
- # cnf_file_ln.$$ has lines with "format engine" pairs
- set x `cat cnf_file_ln.$$`; shift
-diff --git a/texk/web2c/Makefile.in b/texk/web2c/Makefile.in
-index f67aee1..c6b5a8a 100644
---- a/texk/web2c/Makefile.in
-+++ b/texk/web2c/Makefile.in
-@@ -1930,7 +1930,7 @@ LIBOBJS = @LIBOBJS@
- LIBPNG_DEPEND = @LIBPNG_DEPEND@
- LIBPNG_INCLUDES = @LIBPNG_INCLUDES@
- LIBPNG_LIBS = @LIBPNG_LIBS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ $(EXTRA_LIBS)
- LIBSYNCTEX = @LIBSYNCTEX@
- LIBTOOL = @LIBTOOL@
- LIPO = @LIPO@
-diff --git a/texk/web2c/configure b/texk/web2c/configure
-index 79bf895..d2424d1 100755
---- a/texk/web2c/configure
-+++ b/texk/web2c/configure
-@@ -19837,7 +19837,11 @@ else
- kpse_save_CPPFLAGS=$CPPFLAGS
- kpse_save_LIBS=$LIBS
- kpse_cv_fontconfig_includes=
--kpse_cv_fontconfig_libs='-lfontconfig'
-+if test "x$enable_shared" = xno; then
-+ kpse_cv_fontconfig_libs='-lfontconfig -lexpat -lfreetype -lbz2 -lpng16 -lz -lpthread -lm'
-+else
-+ kpse_cv_fontconfig_libs='-lfontconfig'
-+fi
- if test "x$with_fontconfig_includes:$with_fontconfig_libdir" != x:; then
- if test "x$with_fontconfig_includes" != x; then
- kpse_cv_fontconfig_includes="-I$with_fontconfig_includes"
-@@ -19847,7 +19851,11 @@ if test "x$with_fontconfig_includes:$with_fontconfig_libdir" != x:; then
- fi
- elif $PKG_CONFIG fontconfig; then
- kpse_cv_fontconfig_includes=`$PKG_CONFIG fontconfig --cflags`
-- kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs`
-+ if test "x$enable_shared" = xno; then
-+ kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs --static`
-+ else
-+ kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs`
-+ fi
- fi
- CPPFLAGS="$kpse_cv_fontconfig_includes $CPPFLAGS"
- LIBS="$kpse_cv_fontconfig_libs $LIBS"
-@@ -27557,9 +27565,11 @@ if test "x$cross_compiling" = xyes; then :
- if test "x$cache_file" != x/dev/null; then :
- cache_file=config.cache
- fi
-+unset CONFIG_SITE
- ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
- CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
--CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"
-+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS' \
-+AR='$BUILDAR' RANLIB='$BUILDRANLIB' LIBS='$BUILDLIBS'"
- fi
-
- # configure is writing to config.log, and then calls config.status.
-diff --git a/texk/web2c/luatexdir/lua/loslibext.c b/texk/web2c/luatexdir/lua/loslibext.c
-index 5a20a63..94e7f6f 100644
---- a/texk/web2c/luatexdir/lua/loslibext.c
-+++ b/texk/web2c/luatexdir/lua/loslibext.c
-@@ -125,7 +125,7 @@
- for the patch and the persistence in tracking this down.
- */
-
--#ifdef _WIN32
-+#if defined(_WIN32)
- # include <process.h>
- # define spawn_command(a,b,c) c ? \
- _spawnvpe(_P_WAIT,(const char *)a,(const char* const*)b,(const char* const*)c) : \
-@@ -196,7 +196,11 @@ static int exec_command(const char *file, char *const *av, char *const *envp)
- free(path);
- path = NULL;
- if (errno == E2BIG || errno == ENOEXEC ||
-+#if !defined(__native_client__)
- errno == ENOMEM || errno == ETXTBSY)
-+#else
-+ errno == ENOMEM)
-+#endif
- break; /* Report this as an error, no more search */
-
- searchpath = esp + 1;
-@@ -262,8 +266,10 @@ static int spawn_command(const char *file, char *const *av, char *const *envp)
- switch (errno) {
- case E2BIG:
- exit(INVALID_RET_E2BIG);
-+#if !defined(__native_client__)
- case ETXTBSY:
- exit(INVALID_RET_ETXTBSY);
-+#endif
- case ENOENT:
- exit(INVALID_RET_ENOENT);
- case ENOEXEC:
-@@ -569,8 +575,10 @@ static int os_spawn(lua_State * L)
- do_error_return(strerror(ENOEXEC), i);
- } else if (i == INVALID_RET_ENOMEM) {
- do_error_return(strerror(ENOMEM), i);
-+#if !defined(__native_client__)
- } else if (i == INVALID_RET_ETXTBSY) {
- do_error_return(strerror(ETXTBSY), i);
-+#endif
- } else if (i == INVALID_RET_UNKNOWN) {
- do_error_return("execution failed", i);
- } else if (i == INVALID_RET_INTR) {
-@@ -835,7 +843,7 @@ static int ex_uname(lua_State * L)
- }
-
-
--#if (! defined (_WIN32)) && (! defined (__SUNOS__))
-+#if (! defined (_WIN32)) && (! defined (__SUNOS__)) && (! defined(__native_client__))
- static int os_times(lua_State * L)
- {
- struct tms r;
-@@ -1028,7 +1036,7 @@ void open_oslibext(lua_State * L, int safer)
- lua_setfield(L, -2, "name");
- lua_pushcfunction(L, ex_uname);
- lua_setfield(L, -2, "uname");
--#if (! defined (_WIN32)) && (! defined (__SUNOS__))
-+#if (! defined (_WIN32)) && (! defined (__SUNOS__)) && (! defined(__native_client__))
- lua_pushcfunction(L, os_times);
- lua_setfield(L, -2, "times");
- #endif
-diff --git a/texk/web2c/luatexdir/luasocket/src/serial.c b/texk/web2c/luatexdir/luasocket/src/serial.c
-index acee671..22bb1a3 100644
---- a/texk/web2c/luatexdir/luasocket/src/serial.c
-+++ b/texk/web2c/luatexdir/luasocket/src/serial.c
-@@ -164,7 +164,7 @@ static int global_create(lua_State *L) {
- p_unix un = (p_unix) lua_newuserdata(L, sizeof(t_unix));
-
- /* open serial device */
--#ifdef __MINGW32__
-+#if defined(__MINGW32__) || (defined(__native_client__) && defined(_NEWLIB_VERSION))
- t_socket sock = open(path, O_RDWR);
- #else
- t_socket sock = open(path, O_NOCTTY|O_RDWR);
-diff --git a/texk/xdvik/configure b/texk/xdvik/configure
-index 2f2d1b7..6ef4a86 100755
---- a/texk/xdvik/configure
-+++ b/texk/xdvik/configure
-@@ -21327,7 +21327,8 @@ if test "x$cross_compiling" = xyes; then :
- fi
- ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
- CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
--CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"
-+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS' \
-+AR='$BUILDAR' RANLIB='$BUILDRANLIB' LIBS='$BUILDLIBS'"
- fi
-
- # configure is writing to config.log, and then calls config.status.
diff --git a/ports/texlive/pkg_info b/ports/texlive/pkg_info
deleted file mode 100644
index 3a16467..0000000
--- a/ports/texlive/pkg_info
+++ /dev/null
@@ -1,12 +0,0 @@
-NAME=texlive
-VERSION=2015
-ARCHIVE_ROOT=texlive-20150521-source
-URL=ftp://tug.org/texlive/historic/2015/texlive-20150521-source.tar.xz
-LICENSE=GPL
-# Disabled on arm due to issue 3205
-DISABLED_ARCH=(arm pnacl)
-DEPENDS=(fontconfig glibc-compat nacl-spawn)
-SHA1=a32df8d5d6b61f87f7dab907e864fb51b14f4143
-# Disabled on OSX due to build errors
-BUILD_OS=linux
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/texlive/texlive.profile b/ports/texlive/texlive.profile
deleted file mode 100644
index 7686e14..0000000
--- a/ports/texlive/texlive.profile
+++ /dev/null
@@ -1,21 +0,0 @@
-selected_scheme scheme-%(scheme)s
-TEXDIR %(texdir)s/share
-TEXMFCONFIG ~/.texlive2015/texmf-config
-TEXMFHOME ~/texmf
-TEXMFLOCAL %(texdir)s/texmf-local
-TEXMFSYSCONFIG %(texdir)s/share/texmf-config
-TEXMFSYSVAR %(texdir)s/share/texmf-var
-TEXMFVAR ~/.texlive2015/texmf-var
-option_doc 0
-option_file_assocs 0
-option_fmt 1
-option_letter 0
-option_menu_integration 0
-option_path 0
-option_post_code 0
-option_src 0
-option_sys_bin /bin
-option_sys_info /usr/share/info
-option_sys_man /usr/share/man
-option_write18_restricted 1
-portable 0
diff --git a/ports/thttpd/Makefile b/ports/thttpd/Makefile
deleted file mode 100644
index da0c9a5..0000000
--- a/ports/thttpd/Makefile
+++ /dev/null
@@ -1,141 +0,0 @@
-# Generated automatically from Makefile.in by configure.
-# Makefile.in for thttpd
-#
-# Copyright © 1995,1998 by Jef Poskanzer <jef@mail.acme.com>.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-
-# Various configurable paths (remember to edit Makefile.in, not Makefile)
-
-# Top level hierarchy.
-prefix = /usr/local
-exec_prefix = ${prefix}
-# Pathname of directory to install the binary.
-BINDIR = ${exec_prefix}/sbin
-# Pathname of directory to install the man page.
-MANDIR = ${prefix}/man
-# Pathname of directory to install the CGI programs.
-WEBDIR = $(prefix)/www
-
-# CONFIGURE: The group that the web directory belongs to. This is so that
-# the makeweb program can be installed set-group-id to that group, and make
-# subdirectories. If you're not going to use makeweb, ignore this.
-WEBGROUP = www
-
-# CONFIGURE: Directory for CGI executables.
-CGIBINDIR = $(WEBDIR)/cgi-bin
-
-# You shouldn't need to edit anything below here.
-
-CC = $(NACLCC)
-CXX = $(NACLCXX)
-CCOPT = -O0
-DEFS = -DHAVE_DAEMON=1 -DHAVE__PROGNAME=1 -DHAVE_GRP_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBCRYPT=1 -DHAVE_STRERROR=1 -DHAVE_VSNPRINTF=1 -DHAVE_SETSID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_SIGSET=1 -DHAVE_ATOLL=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_SELECT=1 -DHAVE_TM_GMTOFF=1 -DHAVE_INT64T=1 -DHAVE_SOCKLENT=1
-INCLS = -I. $(NACLPORTS_CPPFLAGS)
-CFLAGS = $(CCOPT) $(DEFS) $(NACLPORTS_CFLAGS) $(INCLS)
-LDFLAGS = $(NACLPORTS_LDFLAGS) -lcrypt -ljsoncpp $(NACLPORTS_LIBS) -pthread
-LIBS =
-NETLIBS =
-INSTALL = /usr/bin/install -c
-
-.c.o:
- @rm -f $@
- $(CC) $(CFLAGS) -c $*.c
-
-.cpp.o:
- @rm -f $@
- $(CXX) $(CFLAGS) -c $*.cpp
-
-SRC = thttpd.c libhttpd.c fdwatch.c mmc.c timers.c match.c tdate_parse.c
-SRCP = syslog.cpp
-
-OBJ = $(SRC:.c=.o)
-OBJP = $(SRCP:.cpp=.o)
-
-ALL = thttpd
-
-GENHDR = mime_encodings.h mime_types.h
-
-CLEANFILES = $(ALL) $(OBJP) $(OBJ) $(GENSRC) $(GENHDR)
-
-all: this
-this: $(ALL)
-
-thttpd: $(OBJ) $(OBJP)
- @rm -f $@
- $(CXX) $(CFLAGS) -o $@ $(OBJ) $(OBJP) $(LDFLAGS) $(LIBS) $(NETLIBS)
-
-mime_encodings.h: mime_encodings.txt
- rm -f mime_encodings.h
- sed < mime_encodings.txt > mime_encodings.h \
- -e 's/#.*//' -e 's/[ ]*$$//' -e '/^$$/d' \
- -e 's/[ ][ ]*/", 0, "/' -e 's/^/{ "/' -e 's/$$/", 0 },/'
-
-mime_types.h: mime_types.txt
- rm -f mime_types.h
- sed < mime_types.txt > mime_types.h \
- -e 's/#.*//' -e 's/[ ]*$$//' -e '/^$$/d' \
- -e 's/[ ][ ]*/", 0, "/' -e 's/^/{ "/' -e 's/$$/", 0 },/'
-
-
-install: installthis install-man
-
-installthis:
- -mkdir -p $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 555 -o bin -g bin thttpd $(DESTDIR)$(BINDIR)
-
-install-man:
- -mkdir -p $(DESTDIR)$(MANDIR)/man8
- $(INSTALL) -m 444 -o bin -g bin thttpd.8 $(DESTDIR)$(MANDIR)/man8
-
-
-clean:
- rm -f $(CLEANFILES)
-
-distclean:
- rm -f $(CLEANFILES) Makefile config.cache config.log config.status tags
-
-tags:
- ctags -wtd *.c *.h
-
-tar:
- @name=`sed -n -e '/SERVER_SOFTWARE/!d' -e 's,.*thttpd/,thttpd-,' -e 's, .*,,p' version.h` ; \
- rm -rf $$name ; \
- mkdir $$name ; \
- tar cf - `cat FILES` | ( cd $$name ; tar xfBp - ) ; \
- chmod 644 $$name/Makefile.in $$name/config.h $$name/mime_encodings.txt $$name/mime_types.txt ; \
- chmod 755 $$name/cgi-bin $$name/cgi-src $$name/contrib $$name/contrib/redhat-rpm $$name/extras $$name/scripts ; \
- tar cf $$name.tar $$name ; \
- rm -rf $$name ; \
- gzip $$name.tar
-
-thttpd.o: config.h version.h libhttpd.h fdwatch.h mmc.h timers.h match.h \
- my_syslog.h
-libhttpd.o: config.h version.h libhttpd.h mime_encodings.h mime_types.h \
- mmc.h timers.h match.h tdate_parse.h my_syslog.h
-syslog.o: my_syslog.h
-fdwatch.o: fdwatch.h
-mmc.o: mmc.h libhttpd.h my_syslog.h
-timers.o: timers.h
-match.o: match.h
-tdate_parse.o: tdate_parse.h
diff --git a/ports/thttpd/build.sh b/ports/thttpd/build.sh
deleted file mode 100644
index 8b1aff8..0000000
--- a/ports/thttpd/build.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-# 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.
-
-BUILD_DIR=${SRC_DIR}
-
-EnableCliMain
-
-ConfigureStep() {
- ChangeDir ${SRC_DIR}
- FILES="
-my_syslog.h
-syslog.cpp
-Makefile"
- for FILE in $FILES; do
- cp -f ${START_DIR}/${FILE} .
- done
-
- LogExecute make -j${OS_JOBS} clean
-}
-
-BuildStep() {
- # export the nacl tools
- # The checked-in Makefile has more configuration for this example.
- SetupCrossEnvironment
- export NACLPORTS_CPPFLAGS
- export NACLPORTS_CFLAGS
- export NACLPORTS_LDFLAGS
- export NACLPORTS_LIBS
- LogExecute make -j${OS_JOBS} thttpd
-}
-
-InstallStep() {
- MakeDir ${PUBLISH_DIR}
- install ${START_DIR}/thttpd.html ${PUBLISH_DIR}
- install ${START_DIR}/nacl.js ${PUBLISH_DIR}
- install ${START_DIR}/json2min.js ${PUBLISH_DIR}
- cp ${BUILD_DIR}/thttpd ${BUILD_DIR}/thttpd_${NACL_ARCH}${NACL_EXEEXT}
- install ${BUILD_DIR}/thttpd_${NACL_ARCH}${NACL_EXEEXT} ${PUBLISH_DIR}/
- ChangeDir ${PUBLISH_DIR}
-
- CMD="$NACL_SDK_ROOT/tools/create_nmf.py \
- -o thttpd.nmf -s . \
- thttpd_*${NACL_EXEEXT}"
-
- LogExecute $CMD
-}
diff --git a/ports/thttpd/json2min.js b/ports/thttpd/json2min.js
deleted file mode 100644
index 318b25e..0000000
--- a/ports/thttpd/json2min.js
+++ /dev/null
@@ -1,26 +0,0 @@
-
-var JSON;if(!JSON){JSON={};}
-(function(){'use strict';function f(n){return n<10?'0'+n:n;}
-if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
-f(this.getUTCMonth()+1)+'-'+
-f(this.getUTCDate())+'T'+
-f(this.getUTCHours())+':'+
-f(this.getUTCMinutes())+':'+
-f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
-var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
-function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
-if(typeof rep==='function'){value=rep.call(holder,key,value);}
-switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
-gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
-v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
-if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
-v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
-if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
-rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
-return str('',{'':value});};}
-if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
-return reviver.call(holder,key,value);}
-text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
-('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
-if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
-throw new SyntaxError('JSON.parse');};}}());
\ No newline at end of file
diff --git a/ports/thttpd/my_syslog.h b/ports/thttpd/my_syslog.h
deleted file mode 100644
index c1de23c..0000000
--- a/ports/thttpd/my_syslog.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __MYSYSLOG_H__
-#define __MYSYSLOG_H__
-
-#define LOG_INFO 1
-#define LOG_WARN 2
-#define LOG_WARNING 2
-#define LOG_ERR 3
-#define LOG_CRIT 4
-#define LOG_NOTICE 5
-#define LOG_DEBUG 5
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-void syslog(int level, const char* message, ...);
-void network_error();
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __MYSYSLOG_H__
-
diff --git a/ports/thttpd/nacl.js b/ports/thttpd/nacl.js
deleted file mode 100644
index 104e166..0000000
--- a/ports/thttpd/nacl.js
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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.
- */
-
-/* jshint evil: true */
-/* globals $, FileError */
-
-'use strict';
-
-var uploadURL = 'http://localhost:8006/tmp/';
-
-function moduleDidLoad() {
- $("#status_field").text("SUCCESS");
-}
-
-function is_array(input) {
- return typeof(input) == 'object' && (input instanceof Array);
-}
-
-function escapeHTML(szHTML) {
- return szHTML.split("&").join("&").split( "<").join("<").split(">")
- .join(">").split("\n").join("<br />").replace(" ", " ")
- .replace("\t", " ");
-}
-
-
-function handleMessage(message_event) {
- if (message_event.data === null || message_event.data == "null") {
- console.log("warning: null message");
- return;
- }
- console.log(message_event.data);
- var data = eval('('+message_event.data+')');
- if (data === null) {
- console.log("warning: null data");
- return;
- }
-
- if (data.result && data.type == "network error") {
- $("#status_field").html("Failure");
- $("#log").html("Network initialization error. Please supply the following" +
- " flags to chrome: --enable-nacl --allow-nacl-socket-api=localhost");
- } else {
- $("#log").html("<pre>" + message_event.data + "</pre>");
- }
-}
-
-function uploadFile(file) {
- (function(f) {
- window.fs.root.getFile(file.name, {create: true, exclusive: true},
- function(fileEntry) {
- fileEntry.createWriter(function(fileWriter) {
- fileWriter.write(f); // Note: write() can take a File or Blob object.
- var url = uploadURL + file.name;
- $("#log").html("File uploaded! Checkout at <a target=\"_blank\" href=\"" +
- url + "\">" + url + "</a>");
- }, errorHandler);
- }, errorHandler);
- })(file);
-}
-
-function handleFileSelect(evt) {
- var files = evt.srcElement.files;
- for (var i = 0; i < files.length; i++) {
- uploadFile(files[i]);
- }
-}
-
-function toArray(list) {
- return Array.prototype.slice.call(list || [], 0);
-}
-
-function onInitFs(fs) {
- console.log('opened fs: ' + fs.name);
-
- fs.root.getDirectory("/", {}, function (dir) { // readdir
- var dirReader = dir.createReader();
- var handleEntries = function(results) {
- if (results.length === 0)
- return;
- results = toArray(results);
- results.forEach(function(entry, i) {
- var url = uploadURL + entry.name;
- $("#listing").append('<a target="_blank" href="' + url + '">' + entry.name + "</a><br>\n");
- });
- dirReader.readEntries(handleEntries);
- };
- dirReader.readEntries(handleEntries);
- });
- window.fs = fs;
-}
-
-function errorHandler(e) {
- var msg = '';
-
- switch (e.code) {
- case FileError.QUOTA_EXCEEDED_ERR:
- msg = 'QUOTA_EXCEEDED_ERR';
- break;
- case FileError.NOT_FOUND_ERR:
- msg = 'NOT_FOUND_ERR';
- break;
- case FileError.SECURITY_ERR:
- msg = 'SECURITY_ERR';
- break;
- case FileError.INVALID_MODIFICATION_ERR:
- msg = 'INVALID_MODIFICATION_ERR';
- break;
- case FileError.INVALID_STATE_ERR:
- msg = 'INVALID_STATE_ERR';
- break;
- default:
- msg = 'Unknown Error';
- break;
- }
- $("#log").html("Error uploading file.");
- console.log('Error: ' + msg);
-}
-
-$(document).ready(function() {
- window.URL = window.URL || window.webkitURL;
- window.requestFileSystem = window.requestFileSystem ||
- window.webkitRequestFileSystem;
- navigator.webkitPersistentStorage.requestQuota(1024*1024,
- function(grantedBytes) {
- window.requestFileSystem(window.TEMPORARY, grantedBytes, onInitFs,
- errorHandler);
- }, function(e) {
- console.log('Error', e);
- });
-
- var listener = document.getElementById('listener');
- listener.addEventListener('load', moduleDidLoad, true);
- listener.addEventListener('message', handleMessage, true);
-
- document.getElementById('upfile').addEventListener(
- 'change', handleFileSelect, false);
-});
diff --git a/ports/thttpd/nacl.patch b/ports/thttpd/nacl.patch
deleted file mode 100644
index 5f9fc6d..0000000
--- a/ports/thttpd/nacl.patch
+++ /dev/null
@@ -1,999 +0,0 @@
-diff --git a/fdwatch.c b/fdwatch.c
---- a/fdwatch.c
-+++ b/fdwatch.c
-@@ -31,7 +31,7 @@
- #include <string.h>
- #include <sys/time.h>
- #include <sys/resource.h>
--#include <syslog.h>
-+#include "my_syslog.h"
- #include <fcntl.h>
-
- #ifndef MIN
-@@ -788,7 +788,6 @@ select_watch( long timeout_msecs )
- }
- if ( r <= 0 )
- return r;
--
- ridx = 0;
- for ( idx = 0; idx < nselect_fds; ++idx )
- if ( select_check_fd( select_fds[idx] ) )
-diff --git a/fdwatch.h b/fdwatch.h
---- a/fdwatch.h
-+++ b/fdwatch.h
-@@ -54,6 +54,9 @@
- #define INFTIM -1
- #endif /* INFTIM */
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- /* Figure out how many file descriptors the system allows, and
- ** initialize the fdwatch data structures. Returns -1 on failure.
- */
-@@ -81,5 +84,8 @@ extern void* fdwatch_get_next_client_data( void );
-
- /* Generate debugging statistics syslog message. */
- extern void fdwatch_logstats( long secs );
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* _FDWATCH_H_ */
-diff --git a/libhttpd.c b/libhttpd.c
---- a/libhttpd.c
-+++ b/libhttpd.c
-@@ -28,6 +28,7 @@
-
- #include "config.h"
- #include "version.h"
-+#include "my_syslog.h"
-
- #ifdef SHOW_SERVER_VERSION
- #define EXPOSED_SERVER_SOFTWARE SERVER_SOFTWARE
-@@ -51,7 +52,6 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <syslog.h>
- #include <unistd.h>
- #include <stdarg.h>
-
-@@ -742,10 +742,10 @@ send_response( httpd_conn* hc, int status, char* title, char* extraheads, char*
- hc, status, title, "", extraheads, "text/html; charset=%s", (off_t) -1,
- (time_t) 0 );
- (void) my_snprintf( buf, sizeof(buf), "\
--<HTML>\n\
--<HEAD><TITLE>%d %s</TITLE></HEAD>\n\
--<BODY BGCOLOR=\"#cc9999\" TEXT=\"#000000\" LINK=\"#2020ff\" VLINK=\"#4040cc\">\n\
--<H2>%d %s</H2>\n",
-+<html>\n\
-+<head><title>%d %s</title></head>\n\
-+<body bgcolor=\"#cc9999\" text=\"#000000\" link=\"#2020ff\" vlink=\"#4040cc\">\n\
-+<h2>%d %s</h2>\n",
- status, title, status, title );
- add_response( hc, buf );
- defang( arg, defanged_arg, sizeof(defanged_arg) );
-@@ -769,10 +769,10 @@ send_response_tail( httpd_conn* hc )
- char buf[1000];
-
- (void) my_snprintf( buf, sizeof(buf), "\
--<HR>\n\
--<ADDRESS><A HREF=\"%s\">%s</A></ADDRESS>\n\
--</BODY>\n\
--</HTML>\n",
-+<hr />\n\
-+<address><a href=\"%s\">%s</a></address>\n\
-+</body>\n\
-+</html>\n",
- SERVER_ADDRESS, EXPOSED_SERVER_SOFTWARE );
- add_response( hc, buf );
- }
-@@ -1578,27 +1578,7 @@ expand_symlinks( char* path, char** restP, int no_symlink_check, int tildemapped
- restlen = 0;
- }
-
-- /* Try reading the current filename as a symlink */
-- if ( checked[0] == '\0' )
-- continue;
-- linklen = readlink( checked, link, sizeof(link) - 1 );
-- if ( linklen == -1 )
-- {
-- if ( errno == EINVAL )
-- continue; /* not a symlink */
-- if ( errno == EACCES || errno == ENOENT || errno == ENOTDIR )
-- {
-- /* That last component was bogus. Restore and return. */
-- *restP = r - ( prevrestlen - restlen );
-- if ( prevcheckedlen == 0 )
-- (void) strcpy( checked, "." );
-- else
-- checked[prevcheckedlen] = '\0';
-- return checked;
-- }
-- syslog( LOG_ERR, "readlink %.80s - %m", checked );
-- return (char*) 0;
-- }
-+ continue; // not a symlink
- ++nlinks;
- if ( nlinks > MAX_LINKS )
- {
-@@ -1691,22 +1671,15 @@ httpd_get_conn( httpd_server* hs, int listen_fd, httpd_conn* hc )
- }
-
- /* Accept the new connection. */
-- sz = sizeof(sa);
-+ sz = sizeof(sa.sa);
- hc->conn_fd = accept( listen_fd, &sa.sa, &sz );
-- if ( hc->conn_fd < 0 )
-+ if ( hc->conn_fd == -1 )
- {
- if ( errno == EWOULDBLOCK )
- return GC_NO_MORE;
- syslog( LOG_ERR, "accept - %m" );
- return GC_FAIL;
- }
-- if ( ! sockaddr_check( &sa ) )
-- {
-- syslog( LOG_ERR, "unknown sockaddr family" );
-- close( hc->conn_fd );
-- hc->conn_fd = -1;
-- return GC_FAIL;
-- }
- (void) fcntl( hc->conn_fd, F_SETFD, 1 );
- hc->hs = hs;
- (void) memset( &hc->client_addr, 0, sizeof(hc->client_addr) );
-@@ -2697,7 +2670,9 @@ ls( httpd_conn* hc )
- char* timestr;
- ClientData client_data;
-
-- dirp = opendir( hc->expnfilename );
-+ char buf[1000];
-+ stat( hc->expnfilename, &sb);
-+ dirp = opendir( hc->expnfilename );
- if ( dirp == (DIR*) 0 )
- {
- syslog( LOG_ERR, "opendir %.80s - %m", hc->expnfilename );
-@@ -2723,59 +2698,34 @@ ls( httpd_conn* hc )
- return -1;
- }
- ++hc->hs->cgi_count;
-- r = fork( );
-- if ( r < 0 )
-- {
-- syslog( LOG_ERR, "fork - %m" );
-- closedir( dirp );
-- httpd_send_err(
-- hc, 500, err500title, "", err500form, hc->encodedurl );
-- return -1;
-- }
-- if ( r == 0 )
-- {
-- /* Child process. */
-- sub_process = 1;
-- httpd_unlisten( hc->hs );
-+
-+ syslog( LOG_INFO, "before send_mime\n");
- send_mime(
- hc, 200, ok200title, "", "", "text/html; charset=%s",
- (off_t) -1, hc->sb.st_mtime );
- httpd_write_response( hc );
--
--#ifdef CGI_NICE
-- /* Set priority. */
-- (void) nice( CGI_NICE );
--#endif /* CGI_NICE */
--
-- /* Open a stdio stream so that we can use fprintf, which is more
-- ** efficient than a bunch of separate write()s. We don't have
-- ** to worry about double closes or file descriptor leaks cause
-- ** we're in a subprocess.
-- */
-- fp = fdopen( hc->conn_fd, "w" );
-- if ( fp == (FILE*) 0 )
-- {
-- syslog( LOG_ERR, "fdopen - %m" );
-- httpd_send_err(
-- hc, 500, err500title, "", err500form, hc->encodedurl );
-- httpd_write_response( hc );
-- closedir( dirp );
-- exit( 1 );
-- }
--
-- (void) fprintf( fp, "\
--<HTML>\n\
--<HEAD><TITLE>Index of %.80s</TITLE></HEAD>\n\
--<BODY BGCOLOR=\"#99cc99\" TEXT=\"#000000\" LINK=\"#2020ff\" VLINK=\"#4040cc\">\n\
--<H2>Index of %.80s</H2>\n\
--<PRE>\n\
-+ syslog( LOG_INFO, "after write_response\n");
-+
-+ const char* format_s1 = "\
-+<html>\n\
-+<head><title>Index of %.80s</title></head>\n\
-+<body bgcolor=\"#99cc99\" text=\"#000000\" link=\"#2020ff\" vlink=\"#4040cc\">\n\
-+<h2>Index of %.80s</h2>\n\
-+<pre>\n\
- mode links bytes last-changed name\n\
--<HR>",
-- hc->encodedurl, hc->encodedurl );
-+<hr />\n";
-+ char* str = (char*) malloc(strlen(hc->encodedurl) * 2 + strlen(format_s1));
-+ if (str) {
-+ sprintf( str, format_s1, hc->encodedurl, hc->encodedurl );
-+ write(hc->conn_fd, str, strlen(str));
-+ free(str);
-+ str = NULL;
-+ }
-
- /* Read in names. */
- nnames = 0;
-- while ( ( de = readdir( dirp ) ) != 0 ) /* dirent or direct */
-+ char* str_l = (char*) malloc(1024);
-+ while ( ( de = readdir( dirp ) ) != 0 ) // dirent or direct
- {
- if ( nnames >= maxnames )
- {
-@@ -2810,6 +2760,7 @@ mode links bytes last-changed name\n\
- qsort( nameptrs, nnames, sizeof(*nameptrs), name_compare );
-
- /* Generate output. */
-+ syslog( LOG_INFO, "before output (%d names)", nnames);
- for ( i = 0; i < nnames; ++i )
- {
- httpd_realloc_str(
-@@ -2839,9 +2790,8 @@ mode links bytes last-changed name\n\
- &encrname, &maxencrname, 3 * strlen( rname ) + 1 );
- strencode( encrname, maxencrname, rname );
-
-- if ( stat( name, &sb ) < 0 || lstat( name, &lsb ) < 0 )
-+ if ( stat( name, &sb ) < 0 )
- continue;
--
- linkprefix = "";
- link[0] = '\0';
- /* Break down mode word. First the file type. */
-@@ -2917,41 +2867,24 @@ mode links bytes last-changed name\n\
- }
-
- /* And print. */
-- (void) fprintf( fp,
-- "%s %3ld %10lld %s <A HREF=\"/%.500s%s\">%.80s</A>%s%s%s\n",
-- modestr, (long) lsb.st_nlink, (int64_t) lsb.st_size,
-- timestr, encrname, S_ISDIR(sb.st_mode) ? "/" : "",
-- nameptrs[i], linkprefix, link, fileclass );
-+ if (str_l) {
-+ sprintf( str_l,
-+ "%s %3ld %10lld %s <a href=\"/%.500s%s\">%.80s</a>%s%s%s\n",
-+ modestr, (long) lsb.st_nlink, (int64_t) lsb.st_size,
-+ timestr, encrname, S_ISDIR(sb.st_mode) ? "/" : "",
-+ nameptrs[i], linkprefix, link, fileclass );
-+ syslog( LOG_INFO, "writing file entry: %d chars\n", strlen(str_l));
-+ write( hc->conn_fd, str_l, strlen(str_l) );
- }
--
-- (void) fprintf( fp, "</PRE></BODY>\n</HTML>\n" );
-- (void) fclose( fp );
-- exit( 0 );
-+ }
-+ free(str_l);
-+ const char* endstr = "</pre></body>\n</html>\n";
-+ write( hc->conn_fd, endstr, strlen(endstr) );
- }
-
-- /* Parent process. */
-- closedir( dirp );
-- syslog( LOG_INFO, "spawned indexing process %d for directory '%.200s'", r, hc->expnfilename );
--#ifdef CGI_TIMELIMIT
-- /* Schedule a kill for the child process, in case it runs too long */
-- client_data.i = r;
-- if ( tmr_create( (struct timeval*) 0, cgi_kill, client_data, CGI_TIMELIMIT * 1000L, 0 ) == (Timer*) 0 )
-- {
-- syslog( LOG_CRIT, "tmr_create(cgi_kill ls) failed" );
-- exit( 1 );
-- }
--#endif /* CGI_TIMELIMIT */
- hc->status = 200;
- hc->bytes_sent = CGI_BYTECOUNT;
- hc->should_linger = 0;
-- }
-- else
-- {
-- closedir( dirp );
-- httpd_send_err(
-- hc, 501, err501title, "", err501form, httpd_method_str( hc->method ) );
-- return -1;
-- }
-
- return 0;
- }
-@@ -3465,24 +3398,6 @@ cgi_child( httpd_conn* hc )
- (void) dup2( hc->conn_fd, STDERR_FILENO );
- }
-
-- /* At this point we would like to set close-on-exec again for hc->conn_fd
-- ** (see previous comments on Linux's broken behavior re: close-on-exec
-- ** and dup.) Unfortunately there seems to be another Linux problem, or
-- ** perhaps a different aspect of the same problem - if we do this
-- ** close-on-exec in Linux, the socket stays open but stderr gets
-- ** closed - the last fd duped from the socket. What a mess. So we'll
-- ** just leave the socket as is, which under other OSs means an extra
-- ** file descriptor gets passed to the child process. Since the child
-- ** probably already has that file open via stdin stdout and/or stderr,
-- ** this is not a problem.
-- */
-- /* (void) fcntl( hc->conn_fd, F_SETFD, 1 ); */
--
--#ifdef CGI_NICE
-- /* Set priority. */
-- (void) nice( CGI_NICE );
--#endif /* CGI_NICE */
--
- /* Split the program into directory and binary, so we can chdir()
- ** to the program's own directory. This isn't in the CGI 1.1
- ** spec, but it's what other HTTP servers do.
-@@ -3674,8 +3589,7 @@ really_start_request( httpd_conn* hc, struct timeval* nowP )
- if ( ! ( hc->sb.st_mode & S_IROTH ) )
- {
- syslog(
-- LOG_INFO,
-- "%.80s URL \"%.80s\" tried to index a directory with indexing disabled",
-+ LOG_INFO, "%.80s URL \"%.80s\" tried to index a directory with indexing disabled",
- httpd_ntoa( &hc->client_addr ), hc->encodedurl );
- httpd_send_err(
- hc, 403, err403title, "",
-@@ -3692,10 +3606,12 @@ really_start_request( httpd_conn* hc, struct timeval* nowP )
- if ( ! check_referer( hc ) )
- return -1;
- /* Ok, generate an index. */
-+
- return ls( hc );
- #else /* GENERATE_INDEXES */
- syslog(
-- LOG_INFO, "%.80s URL \"%.80s\" tried to index a directory",
-+ LOG_INFO,
-+ "%.80s URL \"%.80s\" tried to index a directory",
- httpd_ntoa( &hc->client_addr ), hc->encodedurl );
- httpd_send_err(
- hc, 403, err403title, "",
-@@ -3752,7 +3668,7 @@ really_start_request( httpd_conn* hc, struct timeval* nowP )
- {
- syslog(
- LOG_NOTICE,
-- "%.80s URL \"%.80s\" tried to retrieve an auth file",
-+ "%.80s URL \"%.80s\" tried to retrieve an auth file",
- httpd_ntoa( &hc->client_addr ), hc->encodedurl );
- httpd_send_err(
- hc, 403, err403title, "",
-@@ -3767,7 +3683,7 @@ really_start_request( httpd_conn* hc, struct timeval* nowP )
- {
- syslog(
- LOG_NOTICE,
-- "%.80s URL \"%.80s\" tried to retrieve an auth file",
-+ "%.80s URL \"%.80s\" tried to retrieve an auth file",
- httpd_ntoa( &hc->client_addr ), hc->encodedurl );
- httpd_send_err(
- hc, 403, err403title, "",
-@@ -3791,6 +3707,9 @@ really_start_request( httpd_conn* hc, struct timeval* nowP )
- ** trying to either serve or run a non-CGI file as CGI. Either case
- ** is prohibited.
- */
-+ /* nacl_io's http filesystem marks all files as executable so this check
-+ * will generate false positives */
-+#ifndef __native_client__
- if ( hc->sb.st_mode & S_IXOTH )
- {
- syslog(
-@@ -3802,6 +3721,7 @@ really_start_request( httpd_conn* hc, struct timeval* nowP )
- hc->encodedurl );
- return -1;
- }
-+#endif
- if ( hc->pathinfo[0] != '\0' )
- {
- syslog(
-@@ -3942,14 +3862,6 @@ make_log_entry( httpd_conn* hc, struct timeval* nowP )
- (void) my_snprintf( date, sizeof(date),
- "%s %c%04d", date_nozone, sign, zone );
- /* And write the log entry. */
-- (void) fprintf( hc->hs->logfp,
-- "%.80s - %.80s [%s] \"%.80s %.300s %.80s\" %d %s \"%.200s\" \"%.200s\"\n",
-- httpd_ntoa( &hc->client_addr ), ru, date,
-- httpd_method_str( hc->method ), url, hc->protocol,
-- hc->status, bytes, hc->referer, hc->useragent );
--#ifdef FLUSH_LOG_EVERY_TIME
-- (void) fflush( hc->hs->logfp );
--#endif
- }
- else
- syslog( LOG_INFO,
-diff --git a/libhttpd.h b/libhttpd.h
---- a/libhttpd.h
-+++ b/libhttpd.h
-@@ -164,7 +164,9 @@ typedef struct {
- #define CHST_CRLFCR 10
- #define CHST_BOGUS 11
-
--
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- /* Initializes. Does the socket(), bind(), and listen(). Returns an
- ** httpd_server* which includes a socket fd that you can select() on.
- ** Return (httpd_server*) 0 on error.
-@@ -280,5 +282,8 @@ extern int httpd_write_fully( int fd, const void* buf, size_t nbytes );
-
- /* Generate debugging statistics syslog message. */
- extern void httpd_logstats( long secs );
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* _LIBHTTPD_H_ */
-diff --git a/match.h b/match.h
---- a/match.h
-+++ b/match.h
-@@ -28,9 +28,15 @@
- #ifndef _MATCH_H_
- #define _MATCH_H_
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- /* Simple shell-style filename pattern matcher. Only does ? * and **, and
- ** multiple patterns separated by |. Returns 1 or 0.
- */
- extern int match( const char* pattern, const char* string );
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* _MATCH_H_ */
-diff --git a/mmc.c b/mmc.c
---- a/mmc.c
-+++ b/mmc.c
-@@ -35,8 +35,8 @@
- #include <stdio.h>
- #include <time.h>
- #include <fcntl.h>
--#include <syslog.h>
- #include <errno.h>
-+#include "my_syslog.h"
-
- #ifdef HAVE_MMAP
- #include <sys/mman.h>
-@@ -522,10 +522,6 @@ hash( ino_t ino, dev_t dev, off_t size, time_t ctime )
- void
- mmc_logstats( long secs )
- {
-- syslog(
-- LOG_INFO, " map cache - %d allocated, %d active (%lld bytes), %d free; hash size: %d; expire age: %ld",
-- alloc_count, map_count, (int64_t) mapped_bytes, free_count, hash_size,
-- expire_age );
- if ( map_count + free_count != alloc_count )
- syslog( LOG_ERR, "map counts don't add up!" );
- }
-diff --git a/mmc.h b/mmc.h
---- a/mmc.h
-+++ b/mmc.h
-@@ -28,6 +28,9 @@
- #ifndef _MMC_H_
- #define _MMC_H_
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- /* Returns an mmap()ed area for the given file, or (void*) 0 on errors.
- ** If you have a stat buffer on the file, pass it in, otherwise pass 0.
- ** Same for the current time.
-@@ -51,5 +54,8 @@ extern void mmc_destroy( void );
-
- /* Generate debugging statistics syslog message. */
- extern void mmc_logstats( long secs );
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* _MMC_H_ */
-diff --git a/tdate_parse.h b/tdate_parse.h
---- a/tdate_parse.h
-+++ b/tdate_parse.h
-@@ -28,6 +28,12 @@
- #ifndef _TDATE_PARSE_H_
- #define _TDATE_PARSE_H_
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- extern time_t tdate_parse( char* str );
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* _TDATE_PARSE_H_ */
-diff --git a/thttpd.c b/thttpd.c
---- a/thttpd.c
-+++ b/thttpd.c
-@@ -28,6 +28,7 @@
-
- #include "config.h"
- #include "version.h"
-+#include "my_syslog.h"
-
- #include <sys/param.h>
- #include <sys/types.h>
-@@ -48,7 +49,6 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <syslog.h>
- #ifdef TIME_WITH_SYS_TIME
- #include <time.h>
- #endif
-@@ -68,7 +68,6 @@
- typedef long long int64_t;
- #endif
-
--
- static char* argv0;
- static int debug;
- static unsigned short port;
-@@ -179,7 +178,6 @@ handle_term( int sig )
-
- shut_down();
- syslog( LOG_NOTICE, "exiting due to signal %d", sig );
-- closelog();
- exit( 1 );
- }
-
-@@ -269,8 +267,7 @@ handle_usr1( int sig )
- ** main loop won't wake up until the next new connection.
- */
- shut_down();
-- syslog( LOG_NOTICE, "exiting" );
-- closelog();
-+ syslog( LOG_NOTICE, "exiting USR1" );
- exit( 0 );
- }
-
-@@ -281,7 +278,7 @@ handle_usr1( int sig )
- }
-
-
--/* SIGUSR2 says to generate the stats syslogs immediately. */
-+/* SIGUSR2 says to generate the stats immediately. */
- static void
- handle_usr2( int sig )
- {
-@@ -345,14 +342,13 @@ re_open_logfile( void )
- syslog( LOG_CRIT, "re-opening %.80s - %m", logfile );
- return;
- }
-- (void) fcntl( fileno( logfp ), F_SETFD, 1 );
- httpd_set_logfp( hs, logfp );
- }
- }
-
-
- int
--main( int argc, char** argv )
-+main( int argc, char** argv )
- {
- char* cp;
- struct passwd* pwd;
-@@ -370,13 +366,11 @@ main( int argc, char** argv )
- struct timeval tv;
-
- argv0 = argv[0];
--
- cp = strrchr( argv0, '/' );
- if ( cp != (char*) 0 )
- ++cp;
- else
- cp = argv0;
-- openlog( cp, LOG_NDELAY|LOG_PID, LOG_FACILITY );
-
- /* Handle command-line arguments. */
- parse_args( argc, argv );
-@@ -409,7 +403,6 @@ main( int argc, char** argv )
- if ( pwd == (struct passwd*) 0 )
- {
- syslog( LOG_CRIT, "unknown user - '%.80s'", user );
-- (void) fprintf( stderr, "%s: unknown user - '%s'\n", argv0, user );
- exit( 1 );
- }
- uid = pwd->pw_uid;
-@@ -432,15 +425,12 @@ main( int argc, char** argv )
- if ( logfp == (FILE*) 0 )
- {
- syslog( LOG_CRIT, "%.80s - %m", logfile );
-- perror( logfile );
- exit( 1 );
- }
- if ( logfile[0] != '/' )
- {
- syslog( LOG_WARNING, "logfile is not an absolute path, you may not be able to re-open it" );
-- (void) fprintf( stderr, "%s: logfile is not an absolute path, you may not be able to re-open it\n", argv0 );
- }
-- (void) fcntl( fileno( logfp ), F_SETFD, 1 );
- if ( getuid() == 0 )
- {
- /* If we are root then we chown the log file to the user we'll
-@@ -449,7 +439,6 @@ main( int argc, char** argv )
- if ( fchown( fileno( logfp ), uid, gid ) < 0 )
- {
- syslog( LOG_WARNING, "fchown logfile - %m" );
-- perror( "fchown logfile" );
- }
- }
- }
-@@ -463,7 +452,6 @@ main( int argc, char** argv )
- if ( chdir( dir ) < 0 )
- {
- syslog( LOG_CRIT, "chdir - %m" );
-- perror( "chdir" );
- exit( 1 );
- }
- }
-@@ -477,13 +465,13 @@ main( int argc, char** argv )
- if ( chdir( pwd->pw_dir ) < 0 )
- {
- syslog( LOG_CRIT, "chdir - %m" );
-- perror( "chdir" );
- exit( 1 );
- }
- }
- #endif /* USE_USER_DIR */
-
- /* Get current directory. */
-+
- (void) getcwd( cwd, sizeof(cwd) - 1 );
- if ( cwd[strlen( cwd ) - 1] != '/' )
- (void) strcat( cwd, "/" );
-@@ -498,28 +486,6 @@ main( int argc, char** argv )
- (void) fclose( stdout );
- (void) fclose( stderr );
-
-- /* Daemonize - make ourselves a subprocess. */
--#ifdef HAVE_DAEMON
-- if ( daemon( 1, 1 ) < 0 )
-- {
-- syslog( LOG_CRIT, "daemon - %m" );
-- exit( 1 );
-- }
--#else /* HAVE_DAEMON */
-- switch ( fork() )
-- {
-- case 0:
-- break;
-- case -1:
-- syslog( LOG_CRIT, "fork - %m" );
-- exit( 1 );
-- default:
-- exit( 0 );
-- }
--#ifdef HAVE_SETSID
-- (void) setsid();
--#endif /* HAVE_SETSID */
--#endif /* HAVE_DAEMON */
- }
- else
- {
-@@ -561,7 +527,6 @@ main( int argc, char** argv )
- if ( chroot( cwd ) < 0 )
- {
- syslog( LOG_CRIT, "chroot - %m" );
-- perror( "chroot" );
- exit( 1 );
- }
- /* If we're logging and the logfile's pathname begins with the
-@@ -582,7 +547,6 @@ main( int argc, char** argv )
- else
- {
- syslog( LOG_WARNING, "logfile is not within the chroot tree, you will not be able to re-open it" );
-- (void) fprintf( stderr, "%s: logfile is not within the chroot tree, you will not be able to re-open it\n", argv0 );
- }
- }
- (void) strcpy( cwd, "/" );
-@@ -590,7 +554,6 @@ main( int argc, char** argv )
- if ( chdir( cwd ) < 0 )
- {
- syslog( LOG_CRIT, "chroot chdir - %m" );
-- perror( "chroot chdir" );
- exit( 1 );
- }
- }
-@@ -601,7 +564,6 @@ main( int argc, char** argv )
- if ( chdir( data_dir ) < 0 )
- {
- syslog( LOG_CRIT, "data_dir chdir - %m" );
-- perror( "data_dir chdir" );
- exit( 1 );
- }
- }
-@@ -637,14 +599,18 @@ main( int argc, char** argv )
- /* Initialize the HTTP layer. Got to do this before giving up root,
- ** so that we can bind to a privileged port.
- */
-+ syslog( LOG_INFO, "before httpd_initialize");
- hs = httpd_initialize(
- hostname,
- gotv4 ? &sa4 : (httpd_sockaddr*) 0, gotv6 ? &sa6 : (httpd_sockaddr*) 0,
- port, cgi_pattern, cgi_limit, charset, p3p, max_age, cwd, no_log, logfp,
- no_symlink_check, do_vhost, do_global_passwd, url_pattern,
- local_pattern, no_empty_referers );
-- if ( hs == (httpd_server*) 0 )
-- exit( 1 );
-+ if ( hs == (httpd_server*) 0 ) {
-+ network_error();
-+ usleep(100);
-+ exit( 1 );
-+ }
-
- /* Set up the occasional timer. */
- if ( tmr_create( (struct timeval*) 0, occasional, JunkClientData, OCCASIONAL_TIME * 1000L, 1 ) == (Timer*) 0 )
-@@ -753,14 +719,15 @@ main( int argc, char** argv )
- }
-
- /* Do the fd watch. */
-- num_ready = fdwatch( tmr_mstimeout( &tv ) );
-+ num_ready = fdwatch( INFTIM );
- if ( num_ready < 0 )
- {
-- if ( errno == EINTR || errno == EAGAIN )
-+ if ( errno == EINTR || errno == EAGAIN)
- continue; /* try again */
- syslog( LOG_ERR, "fdwatch - %m" );
- exit( 1 );
- }
-+ // if (num_ready == -2) num_ready = 0;
- (void) gettimeofday( &tv, (struct timezone*) 0 );
-
- if ( num_ready == 0 )
-@@ -794,7 +761,7 @@ main( int argc, char** argv )
-
- /* Find the connections that need servicing. */
- while ( ( c = (connecttab*) fdwatch_get_next_client_data() ) != (connecttab*) -1 )
-- {
-+ {
- if ( c == (connecttab*) 0 )
- continue;
- hc = c->hc;
-@@ -802,13 +769,22 @@ main( int argc, char** argv )
- /* Something went wrong. */
- clear_connection( c, &tv );
- else
-- switch ( c->conn_state )
-+ {
-+ syslog( LOG_INFO, "serving connection %d", c->hc);
-+ switch ( c->conn_state )
- {
-- case CNST_READING: handle_read( c, &tv ); break;
-- case CNST_SENDING: handle_send( c, &tv ); break;
-- case CNST_LINGERING: handle_linger( c, &tv ); break;
-+ case CNST_READING:
-+ handle_read( c, &tv );
-+ break;
-+ case CNST_SENDING:
-+ handle_send( c, &tv );
-+ break;
-+ case CNST_LINGERING:
-+ handle_linger( c, &tv );
-+ break;
- }
-- }
-+ }
-+ }
- tmr_run( &tv );
-
- if ( got_usr1 && ! terminate )
-@@ -825,10 +801,8 @@ main( int argc, char** argv )
- }
- }
-
-- /* The main loop terminated. */
- shut_down();
- syslog( LOG_NOTICE, "exiting" );
-- closelog();
- exit( 0 );
- }
-
-@@ -876,9 +850,9 @@ parse_args( int argc, char** argv )
- hostname = (char*) 0;
- logfile = (char*) 0;
- pidfile = (char*) 0;
-- user = DEFAULT_USER;
-- charset = DEFAULT_CHARSET;
-- p3p = "";
-+ user = (char*) DEFAULT_USER;
-+ charset = (char*) DEFAULT_CHARSET;
-+ p3p = (char*) "";
- max_age = -1;
- argn = 1;
- while ( argn < argc && argv[argn][0] == '-' )
-@@ -1225,7 +1199,6 @@ e_strdup( char* oldstr )
- if ( newstr == (char*) 0 )
- {
- syslog( LOG_CRIT, "out of memory copying a string" );
-- (void) fprintf( stderr, "%s: out of memory copying a string\n", argv0 );
- exit( 1 );
- }
- return newstr;
-@@ -1255,9 +1228,6 @@ lookup_hostname( httpd_sockaddr* sa4P, size_t sa4_len, int* gotv4P, httpd_sockad
- syslog(
- LOG_CRIT, "getaddrinfo %.80s - %.80s",
- hostname, gai_strerror( gaierr ) );
-- (void) fprintf(
-- stderr, "%s: getaddrinfo %s - %s\n",
-- argv0, hostname, gai_strerror( gaierr ) );
- exit( 1 );
- }
-
-@@ -1337,22 +1307,14 @@ lookup_hostname( httpd_sockaddr* sa4P, size_t sa4_len, int* gotv4P, httpd_sockad
- syslog(
- LOG_CRIT, "gethostbyname %.80s - %.80s",
- hostname, hstrerror( h_errno ) );
-- (void) fprintf(
-- stderr, "%s: gethostbyname %s - %s\n",
-- argv0, hostname, hstrerror( h_errno ) );
- #else /* HAVE_HSTRERROR */
- syslog( LOG_CRIT, "gethostbyname %.80s failed", hostname );
-- (void) fprintf(
-- stderr, "%s: gethostbyname %s failed\n", argv0, hostname );
- #endif /* HAVE_HSTRERROR */
- exit( 1 );
- }
- if ( he->h_addrtype != AF_INET )
- {
- syslog( LOG_CRIT, "%.80s - non-IP network address", hostname );
-- (void) fprintf(
-- stderr, "%s: %s - non-IP network address\n",
-- argv0, hostname );
- exit( 1 );
- }
- (void) memmove(
-@@ -1412,11 +1374,7 @@ read_throttlefile( char* throttlefile )
- min_limit = 0;
- else
- {
-- syslog( LOG_CRIT,
-- "unparsable line in %.80s - %.80s", throttlefile, buf );
-- (void) fprintf( stderr,
-- "%s: unparsable line in %.80s - %.80s\n",
-- argv0, throttlefile, buf );
-+ syslog( LOG_CRIT, "unparsable line in %.80s - %.80s", throttlefile, buf );
- continue;
- }
-
-@@ -1442,9 +1400,6 @@ read_throttlefile( char* throttlefile )
- if ( throttles == (throttletab*) 0 )
- {
- syslog( LOG_CRIT, "out of memory allocating a throttletab" );
-- (void) fprintf(
-- stderr, "%s: out of memory allocating a throttletab\n",
-- argv0 );
- exit( 1 );
- }
- }
-@@ -1545,13 +1500,13 @@ handle_newconnect( struct timeval* tvP, int listen_fd )
- }
-
- /* Get the connection. */
-+ syslog( LOG_INFO, "before get_conn(%d)", listen_fd );
- switch ( httpd_get_conn( hs, listen_fd, c->hc ) )
- {
- /* Some error happened. Run the timers, then the
- ** existing connections. Maybe the error will clear.
- */
- case GC_FAIL:
-- tmr_run( tvP );
- return 0;
-
- /* No more connections to accept for now. */
-@@ -1572,7 +1527,7 @@ handle_newconnect( struct timeval* tvP, int listen_fd )
-
- /* Set the connection file descriptor to no-delay mode. */
- httpd_set_ndelay( c->hc->conn_fd );
--
-+
- fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ );
-
- ++stats_connections;
-@@ -1594,7 +1549,7 @@ handle_read( connecttab* c, struct timeval* tvP )
- {
- if ( hc->read_size > 5000 )
- {
-- httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" );
-+ httpd_send_err( hc, 400, httpd_err400title, (char*) "", httpd_err400form, (char*) "" );
- finish_connection( c, tvP );
- return;
- }
-@@ -2021,26 +1976,7 @@ clear_connection( connecttab* c, struct timeval* tvP )
- c->linger_timer = (Timer*) 0;
- c->hc->should_linger = 0;
- }
-- if ( c->hc->should_linger )
-- {
-- if ( c->conn_state != CNST_PAUSING )
-- fdwatch_del_fd( c->hc->conn_fd );
-- c->conn_state = CNST_LINGERING;
-- shutdown( c->hc->conn_fd, SHUT_WR );
-- fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ );
-- client_data.p = c;
-- if ( c->linger_timer != (Timer*) 0 )
-- syslog( LOG_ERR, "replacing non-null linger_timer!" );
-- c->linger_timer = tmr_create(
-- tvP, linger_clear_connection, client_data, LINGER_TIME, 0 );
-- if ( c->linger_timer == (Timer*) 0 )
-- {
-- syslog( LOG_CRIT, "tmr_create(linger_clear_connection) failed" );
-- exit( 1 );
-- }
-- }
-- else
-- really_clear_connection( c, tvP );
-+ really_clear_connection( c, tvP );
- }
-
-
-@@ -2144,7 +2080,7 @@ show_stats( ClientData client_data, struct timeval* nowP )
- #endif /* STATS_TIME */
-
-
--/* Generate debugging statistics syslog messages for all packages. */
-+/* Generate debugging statistics messages for all packages. */
- static void
- logstats( struct timeval* nowP )
- {
-@@ -2164,7 +2100,7 @@ logstats( struct timeval* nowP )
- stats_secs = 1; /* fudge */
- stats_time = now;
- syslog( LOG_INFO,
-- "up %ld seconds, stats for %ld seconds:", up_secs, stats_secs );
-+ " up %ld seconds, stats for %ld seconds:", up_secs, stats_secs );
-
- thttpd_logstats( stats_secs );
- httpd_logstats( stats_secs );
-@@ -2174,7 +2110,7 @@ logstats( struct timeval* nowP )
- }
-
-
--/* Generate debugging statistics syslog message. */
-+/* Generate debugging statistics message. */
- static void
- thttpd_logstats( long secs )
- {
-diff --git a/timers.c b/timers.c
---- a/timers.c
-+++ b/timers.c
-@@ -29,7 +29,7 @@
-
- #include <stdlib.h>
- #include <stdio.h>
--#include <syslog.h>
-+#include "my_syslog.h"
-
- #include "timers.h"
-
-diff --git a/timers.h b/timers.h
---- a/timers.h
-+++ b/timers.h
-@@ -64,6 +64,9 @@ typedef struct TimerStruct {
- int hash;
- } Timer;
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- /* Initialize the timer package. */
- extern void tmr_init( void );
-
-@@ -105,5 +108,8 @@ extern void tmr_destroy( void );
-
- /* Generate debugging statistics syslog message. */
- extern void tmr_logstats( long secs );
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* _TIMERS_H_ */
diff --git a/ports/thttpd/pkg_info b/ports/thttpd/pkg_info
deleted file mode 100644
index 3952503..0000000
--- a/ports/thttpd/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=thttpd
-VERSION=2.25b
-URL=http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
-LICENSE=BSD
-DISABLED_LIBC=(newlib)
-DEPENDS=(jsoncpp nacl-spawn)
-SHA1=cd0e823233ad73e34ee1c9b871b01050feb9db52
diff --git a/ports/thttpd/syslog.cpp b/ports/thttpd/syslog.cpp
deleted file mode 100644
index c95525b..0000000
--- a/ports/thttpd/syslog.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-#include <cstdarg>
-#include <cstdio>
-#include <cstring>
-
-#include "json/json.h"
-#include "my_syslog.h"
-#include <ppapi/c/pp_var.h>
-#include <ppapi_simple/ps.h>
-#include <ppapi_simple/ps_interface.h>
-
-#define MAX_FMT_SIZE 4096
-char formatted_string[MAX_FMT_SIZE];
-
-void syslog(int level, const char* message, ...) {
- switch (level) {
- case LOG_INFO:
- fprintf(stderr, "INFO: ");
- break;
- case LOG_WARN:
- fprintf(stderr, "WARN: ");
- break;
- case LOG_ERR:
- fprintf(stderr, "ERR: ");
- break;
- case LOG_CRIT:
- fprintf(stderr, "CRIT: ");
- break;
- }
- va_list argptr;
- va_start(argptr, message);
- vsprintf(formatted_string, message, argptr);
- va_end(argptr);
- fprintf(stderr, "%s", formatted_string);
- if (strlen(message) > 0 && message[strlen(message) - 1] != '\n') {
- fprintf(stderr, "\n");
- }
-}
-
-extern "C" {
-
-void network_error() {
- Json::Value writerRoot;
- writerRoot["result"] = 1;
- writerRoot["type"] = "network error";
- Json::StyledWriter writer;
- std::string msg(writer.write(writerRoot));
- struct PP_Var var = PSInterfaceVar()->VarFromUtf8(msg.data(), msg.length());
- PSInterfaceMessaging()->PostMessage(PSGetInstanceId(), var);
- PSInterfaceVar()->Release(var);
-}
-}
diff --git a/ports/thttpd/thttpd.html b/ports/thttpd/thttpd.html
deleted file mode 100644
index 276069d..0000000
--- a/ports/thttpd/thttpd.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Thttpd test</title>
-
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script type="text/javascript" src="json2min.js"></script>
- <script type="text/javascript" src="nacl.js"></script>
-</head>
-<body>
-
-<p>
- <div id="listener">
- <embed name="nacl_module"
- id="thttpd"
- width="1" height="1"
- src="thttpd.nmf"
- type="application/x-nacl"
- ARG1="-D"
- ARG2="-p"
- ARG3="8006"
- PS_VERBOSITY="3"
- />
- </div>
-</p>
-
-<div id="status_field">NO-STATUS</div>
-
-<input type="file" id="upfile" multiple="multiple" />
-
-<h2>Files currently available:</h2>
-<div id="listing"></div>
-
-<div id="log"></div>
-</body>
-</html>
diff --git a/ports/tiff/build.sh b/ports/tiff/build.sh
deleted file mode 100644
index 232e1dc..0000000
--- a/ports/tiff/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) 2011 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.
-
-NACLPORTS_LIBS="-lm"
-EXTRA_CONFIGURE_ARGS="--disable-jpeg"
diff --git a/ports/tiff/pkg_info b/ports/tiff/pkg_info
deleted file mode 100644
index 936da69..0000000
--- a/ports/tiff/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=tiff
-VERSION=4.0.3
-URL=http://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz
-LICENSE=BSD:COPYRIGHT
-SHA1=652e97b78f1444237a82cbcfe014310e776eb6f0
diff --git a/ports/tinyxml/build.sh b/ports/tinyxml/build.sh
deleted file mode 100644
index 82c0ef7..0000000
--- a/ports/tinyxml/build.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2011 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.
-
-BUILD_DIR=${SRC_DIR}
-
-EXECUTABLES=xmltest
-
-# Workaround for arm-gcc bug:
-# https://code.google.com/p/nativeclient/issues/detail?id=3205
-# TODO(sbc): remove this once the issue is fixed
-if [ "${NACL_ARCH}" = "arm" ]; then
- NACLPORTS_CPPFLAGS+=" -mfpu=vfp"
-fi
-
-ConfigureStep() {
- LogExecute make clean
-}
-
-BuildStep() {
- SetupCrossEnvironment
- CFLAGS="${CPPFLAGS} ${CFLAGS}"
- CXXFLAGS="${CPPFLAGS} ${CXXFLAGS}"
- echo $CFLAGS
- LogExecute make libtinyxml.a xmltest
-}
-
-TestStep() {
- if [ "${NACL_ARCH}" = "pnacl" ]; then
- return
- fi
-
- LogExecute ./xmltest.sh
-}
-
-InstallStep() {
- # copy libs and headers manually
- MakeDir ${DESTDIR_LIB}
- MakeDir ${DESTDIR_INCLUDE}/${PACKAGE_NAME}
- LogExecute cp *.h ${DESTDIR_INCLUDE}/${PACKAGE_NAME}/
- LogExecute cp *.a ${DESTDIR_LIB}/
-}
diff --git a/ports/tinyxml/nacl.patch b/ports/tinyxml/nacl.patch
deleted file mode 100644
index 63333fd..0000000
--- a/ports/tinyxml/nacl.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -19,11 +19,11 @@ TINYXML_USE_STL := NO
-
- #****************************************************************************
-
--CC := gcc
--CXX := g++
--LD := g++
--AR := ar rc
--RANLIB := ranlib
-+CC ?= gcc
-+CXX ?= g++
-+CCLD ?= ${CXX}
-+AR ?= ar
-+RANLIB ?= ranlib
-
- DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG
- RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3
-@@ -35,15 +35,16 @@ RELEASE_CXXFLAGS := ${RELEASE_CFLAGS}
-
- DEBUG_LDFLAGS := -g
- RELEASE_LDFLAGS :=
-+ARFLAGS ?= rc
-
- ifeq (YES, ${DEBUG})
-- CFLAGS := ${DEBUG_CFLAGS}
-- CXXFLAGS := ${DEBUG_CXXFLAGS}
-- LDFLAGS := ${DEBUG_LDFLAGS}
-+ CFLAGS := ${CFLAGS} ${DEBUG_CFLAGS}
-+ CXXFLAGS := ${CXXFLAGS} ${DEBUG_CXXFLAGS}
-+ LDFLAGS := ${LDFLAGS} ${DEBUG_LDFLAGS}
- else
-- CFLAGS := ${RELEASE_CFLAGS}
-- CXXFLAGS := ${RELEASE_CXXFLAGS}
-- LDFLAGS := ${RELEASE_LDFLAGS}
-+ CFLAGS := ${CFLAGS} ${RELEASE_CFLAGS}
-+ CXXFLAGS := ${CXXFLAGS} ${RELEASE_CXXFLAGS}
-+ LDFLAGS := ${LDFLAGS} ${RELEASE_LDFLAGS}
- endif
-
- ifeq (YES, ${PROFILE})
-@@ -82,6 +83,7 @@ CXXFLAGS := ${CXXFLAGS} ${DEFS}
- #****************************************************************************
-
- OUTPUT := xmltest
-+LIBRARY := libtinyxml.a
-
- all: ${OUTPUT}
-
-@@ -90,11 +92,12 @@ all: ${OUTPUT}
- # Source files
- #****************************************************************************
-
--SRCS := tinyxml.cpp tinyxmlparser.cpp xmltest.cpp tinyxmlerror.cpp tinystr.cpp
-+LIB_SRCS := tinyxml.cpp tinyxmlparser.cpp tinyxmlerror.cpp tinystr.cpp
-
- # Add on the sources for libraries
--SRCS := ${SRCS}
-+SRCS := ${LIB_SRCS} xmltest.cpp
-
-+LIB_OBJS := $(addsuffix .o,$(basename ${LIB_SRCS}))
- OBJS := $(addsuffix .o,$(basename ${SRCS}))
-
- #****************************************************************************
-@@ -102,7 +105,10 @@ OBJS := $(addsuffix .o,$(basename ${SRCS}))
- #****************************************************************************
-
- ${OUTPUT}: ${OBJS}
-- ${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
-+ ${CCLD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
-+
-+${LIBRARY}: ${LIB_OBJS}
-+ ${AR} ${ARFLAGS} $@ $^
-
- #****************************************************************************
- # common rules
-@@ -119,7 +125,7 @@ dist:
- bash makedistlinux
-
- clean:
-- -rm -f core ${OBJS} ${OUTPUT}
-+ -rm -f core ${OBJS} ${OUTPUT} ${LIBRARY}
-
- depend:
- #makedepend ${INCS} ${SRCS}
diff --git a/ports/tinyxml/pkg_info b/ports/tinyxml/pkg_info
deleted file mode 100644
index 97e7c02..0000000
--- a/ports/tinyxml/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=tinyxml
-VERSION=2.6.2
-ARCHIVE_ROOT=tinyxml
-URL=http://download.sf.net/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.tar.gz
-LICENSE=CUSTOM:readme.txt
-SHA1=cba3f50dd657cb1434674a03b21394df9913d764
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/tk/build.sh b/ports/tk/build.sh
deleted file mode 100644
index 5c1047f..0000000
--- a/ports/tk/build.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (c) 2014 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_CONFIGURE_PATH=${SRC_DIR}/unix/configure
-
-NACLPORTS_LIBS+=" -lX11 -lxcb -lXau"
-
-EXTRA_CONFIGURE_ARGS+=" --with-tcl=${NACLPORTS_LIBDIR}"
-
-if [ "${NACL_ARCH}" = "pnacl" ]; then
- EXTRA_CONFIGURE_ARGS+=" --disable-load"
-fi
-
-# Disable fallbacks for broken libc's that kick in for
-# cross-compiles since autoconf can't run target binaries.
-# The fallbacks seem to be non-general.
-export tcl_cv_strtod_buggy=ok
-
-EnableCliMain
-EnableGlibcCompat
-
-# Ideally we would only add this flag for newlib builds but
-# linking of the shared library currently fails because it
-# tries to link libppapi_stub.a which is not built with -fPIC.
-EXTRA_CONFIGURE_ARGS+=" --disable-shared"
diff --git a/ports/tk/nacl.patch b/ports/tk/nacl.patch
deleted file mode 100644
index 7a83984..0000000
--- a/ports/tk/nacl.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
---- a/unix/tkAppInit.c
-+++ b/unix/tkAppInit.c
-@@ -26,6 +26,10 @@ extern Tcl_PackageInitProc Tktest_Init;
- * #if checks for that #define and uses Tcl_AppInit if it doesn't exist.
- */
-
-+#if defined(__native_client__) && defined(__GLIBC__)
-+#define MODULE_SCOPE extern __attribute__ ((visibility ("default")))
-+#endif
-+
- #ifndef TK_LOCAL_APPINIT
- #define TK_LOCAL_APPINIT Tcl_AppInit
- #endif
diff --git a/ports/tk/pkg_info b/ports/tk/pkg_info
deleted file mode 100644
index 4a5ae01..0000000
--- a/ports/tk/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=tk
-ARCHIVE_ROOT=tk8.6.1
-VERSION=8.6.1
-URL=http://prdownloads.sourceforge.net/tcl/tk8.6.1-src.tar.gz
-LICENSE=BSD
-DEPENDS=(glibc-compat tcl libx11 nacl-spawn)
-SHA1=ecfcc20833c04d6890b14a7920a04d16f2123a51
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/toybox/README.nacl b/ports/toybox/README.nacl
deleted file mode 100644
index 04f9711..0000000
--- a/ports/toybox/README.nacl
+++ /dev/null
@@ -1,7 +0,0 @@
-This is a simple port of ToyBox. Many commands have been disabled.
-
-Additionally, where toysh would normally fork itself when running
-internal commands, here it will utilize a setjmp trampoline. This can
-result in loss of memory if there are persistent errors.
-
-To spawn a shell, append ?arg1=sh to the URL.
diff --git a/ports/toybox/build.sh b/ports/toybox/build.sh
deleted file mode 100644
index d8e25da..0000000
--- a/ports/toybox/build.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES="toybox"
-
-# Toybox wants to build in its current directory.
-BUILD_DIR=${SRC_DIR}
-
-NACLPORTS_CPPFLAGS+=" -DBYTE_ORDER=LITTLE_ENDIAN"
-NACLPORTS_CPPFLAGS+=" -Dpipe=nacl_spawn_pipe"
-
-export HOSTCC=cc
-
-EnableCliMain
-EnableGlibcCompat
-
-ConfigureStep() {
- LogExecute cp ${START_DIR}/toybox.config ${SRC_DIR}/.config
-}
-
-BuildStep() {
- # We can't use NACL_CROSS_PREFIX without also redefining the CC and HOSTCC
- # variables.
- if [[ "${NACLCC}" = *clang ]]; then
- CC=clang
- else
- CC=gcc
- fi
-
- export CROSS_COMPILE="${NACL_CROSS_PREFIX}-"
- export LDFLAGS="${NACLPORTS_LDFLAGS}"
- export CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}"
- export LIBS="${NACLPORTS_LIBS}"
- export CC
- LogExecute make clean
- DefaultBuildStep
-}
-
-InstallStep() {
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/toybox"
- MakeDir ${ASSEMBLY_DIR}
-
- cp ${BUILD_DIR}/toybox ${ASSEMBLY_DIR}/toybox_${NACL_ARCH}${NACL_EXEEXT}
-
- ChangeDir ${ASSEMBLY_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${ASSEMBLY_DIR}/toybox_*${NACL_EXEEXT} \
- -s . \
- -o toybox.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py toybox.nmf
-
- InstallNaClTerm ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR}
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip toybox-${VERSION}.zip toybox
-}
diff --git a/ports/toybox/icon_128.png b/ports/toybox/icon_128.png
deleted file mode 100644
index 3d64fe2..0000000
--- a/ports/toybox/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/toybox/icon_16.png b/ports/toybox/icon_16.png
deleted file mode 100644
index 18a9194..0000000
--- a/ports/toybox/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/toybox/icon_48.png b/ports/toybox/icon_48.png
deleted file mode 100644
index 4e09775..0000000
--- a/ports/toybox/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/toybox/manifest.json b/ports/toybox/manifest.json
deleted file mode 100644
index 2015fbc..0000000
--- a/ports/toybox/manifest.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "ToyBox",
- "description": "ToyBox console application running using NativeClient",
- "version": "0.0.0.1",
- "manifest_version": 2,
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "launch": {
- "local_path": "toybox.html"
- }
- }
-}
diff --git a/ports/toybox/nacl.patch b/ports/toybox/nacl.patch
deleted file mode 100644
index 2b76459..0000000
--- a/ports/toybox/nacl.patch
+++ /dev/null
@@ -1,845 +0,0 @@
-diff --git a/.config b/.config
---- a/.config
-+++ b/.config
-@@ -1,81 +1,81 @@
- #
- # Automatically generated make config: don't edit
- # ToyBox version: KCONFIG_VERSION
--# Mon Nov 18 07:48:07 2013
-+# Fri Jan 3 14:13:06 2014
- #
- CONFIG_TOYBOX_CONTAINER=y
-
- #
- # LSB commands
- #
--CONFIG_DMESG=y
--CONFIG_HOSTNAME=y
--CONFIG_KILLALL=y
--CONFIG_MD5SUM=y
--CONFIG_MD5SUM_SHA1SUM=y
--CONFIG_MKNOD=y
-+# CONFIG_DMESG is not set
-+# CONFIG_HOSTNAME is not set
-+# CONFIG_KILLALL is not set
-+# CONFIG_MD5SUM is not set
-+# CONFIG_MD5SUM_SHA1SUM is not set
-+# CONFIG_MKNOD is not set
- CONFIG_MKTEMP=y
--CONFIG_PASSWD=y
--CONFIG_PIDOF=y
-+# CONFIG_PASSWD is not set
-+# CONFIG_PIDOF is not set
- CONFIG_SEQ=y
--CONFIG_SYNC=y
--CONFIG_UMOUNT=y
-+# CONFIG_SYNC is not set
-+# CONFIG_UMOUNT is not set
-
- #
- # Other commands
- #
--CONFIG_ACPI=y
--CONFIG_BLKID=y
-+# CONFIG_ACPI is not set
-+# CONFIG_BLKID is not set
- CONFIG_BZCAT=y
- CONFIG_CATV=y
--CONFIG_CHROOT=y
--CONFIG_CHVT=y
-+# CONFIG_CHROOT is not set
-+# CONFIG_CHVT is not set
- CONFIG_CLEAR=y
- CONFIG_COUNT=y
- CONFIG_DOS2UNIX=y
--CONFIG_EJECT=y
-+# CONFIG_EJECT is not set
- # CONFIG_FALLOCATE is not set
--CONFIG_FREE=y
-+# CONFIG_FREE is not set
- # CONFIG_HELLO is not set
- CONFIG_HELP=y
--CONFIG_INSMOD=y
--CONFIG_LOGIN=y
--CONFIG_LOSETUP=y
--CONFIG_LSMOD=y
--CONFIG_LSUSB=y
--CONFIG_MKSWAP=y
--CONFIG_MODINFO=y
--CONFIG_MOUNTPOINT=y
--CONFIG_NETCAT=y
--CONFIG_NETCAT_LISTEN=y
--CONFIG_ONEIT=y
--CONFIG_PIVOT_ROOT=y
--CONFIG_PMAP=y
-+# CONFIG_INSMOD is not set
-+# CONFIG_LOGIN is not set
-+# CONFIG_LOSETUP is not set
-+# CONFIG_LSMOD is not set
-+# CONFIG_LSUSB is not set
-+# CONFIG_MKSWAP is not set
-+# CONFIG_MODINFO is not set
-+# CONFIG_MOUNTPOINT is not set
-+# CONFIG_NETCAT is not set
-+# CONFIG_NETCAT_LISTEN is not set
-+# CONFIG_ONEIT is not set
-+# CONFIG_PIVOT_ROOT is not set
-+# CONFIG_PMAP is not set
- CONFIG_PRINTENV=y
- CONFIG_PWDX=y
--CONFIG_READAHEAD=y
--CONFIG_READLINK=y
--CONFIG_REALPATH=y
--CONFIG_REBOOT=y
-+# CONFIG_READAHEAD is not set
-+# CONFIG_READLINK is not set
-+# CONFIG_REALPATH is not set
-+# CONFIG_REBOOT is not set
- CONFIG_REV=y
--CONFIG_RMMOD=y
--CONFIG_SETSID=y
--CONFIG_STAT=y
--CONFIG_SWAPOFF=y
--CONFIG_SWAPON=y
--CONFIG_SWITCH_ROOT=y
-+# CONFIG_RMMOD is not set
-+# CONFIG_SETSID is not set
-+# CONFIG_STAT is not set
-+# CONFIG_SWAPOFF is not set
-+# CONFIG_SWAPON is not set
-+# CONFIG_SWITCH_ROOT is not set
- CONFIG_TAC=y
--CONFIG_TASKSET=y
--CONFIG_TIMEOUT=y
-+# CONFIG_TASKSET is not set
-+# CONFIG_TIMEOUT is not set
- CONFIG_TRUNCATE=y
--CONFIG_UNSHARE=y
--CONFIG_UPTIME=y
-+# CONFIG_UNSHARE is not set
-+# CONFIG_UPTIME is not set
- CONFIG_USLEEP=y
--CONFIG_VCONFIG=y
--CONFIG_VMSTAT=y
--CONFIG_W=y
-+# CONFIG_VCONFIG is not set
-+# CONFIG_VMSTAT is not set
-+# CONFIG_W is not set
- CONFIG_WHICH=y
--CONFIG_WHOAMI=y
-+# CONFIG_WHOAMI is not set
- CONFIG_YES=y
-
- #
-@@ -89,10 +89,10 @@ CONFIG_YES=y
- # CONFIG_DUMPLEASES is not set
- # CONFIG_EXPR is not set
- # CONFIG_FDISK is not set
--# CONFIG_FIND is not set
-+CONFIG_FIND=y
- # CONFIG_FSCK is not set
- # CONFIG_GROUPADD is not set
--CONFIG_IFCONFIG=y
-+# CONFIG_IFCONFIG is not set
- # CONFIG_INIT is not set
- # CONFIG_KLOGD is not set
- # CONFIG_KLOGD_SOURCE_RING_BUFFER is not set
-@@ -112,20 +112,20 @@ CONFIG_IFCONFIG=y
- # CONFIG_PGREP is not set
- # CONFIG_PS is not set
- # CONFIG_ROUTE is not set
--# CONFIG_SED is not set
--# CONFIG_SH is not set
--# CONFIG_SH_TTY is not set
--# CONFIG_SH_PROFILE is not set
-+CONFIG_SED=y
-+CONFIG_SH=y
-+CONFIG_SH_TTY=y
-+CONFIG_SH_PROFILE=y
- # CONFIG_SH_JOBCTL is not set
- # CONFIG_SH_FLOWCTL is not set
--# CONFIG_SH_QUOTES is not set
--# CONFIG_SH_WILDCARDS is not set
-+CONFIG_SH_QUOTES=y
-+CONFIG_SH_WILDCARDS=y
- # CONFIG_SH_PROCARGS is not set
--# CONFIG_SH_ENVVARS is not set
--# CONFIG_SH_LOCALS is not set
--# CONFIG_SH_ARRAYS is not set
-+CONFIG_SH_ENVVARS=y
-+CONFIG_SH_LOCALS=y
-+CONFIG_SH_ARRAYS=y
- # CONFIG_SH_PIPES is not set
--# CONFIG_SH_BUILTINS is not set
-+CONFIG_SH_BUILTINS=y
- # CONFIG_EXIT is not set
- # CONFIG_CD is not set
- # CONFIG_CD_P is not set
-@@ -145,7 +145,7 @@ CONFIG_IFCONFIG=y
- CONFIG_BASENAME=y
- CONFIG_CAL=y
- CONFIG_CAT=y
--CONFIG_CHGRP=y
-+# CONFIG_CHGRP is not set
- CONFIG_CHMOD=y
- CONFIG_CKSUM=y
- CONFIG_CMP=y
-@@ -155,9 +155,9 @@ CONFIG_CP_MORE=y
- CONFIG_CP_MV=y
- CONFIG_CP_MV_MORE=y
- CONFIG_CUT=y
--CONFIG_DATE=y
--CONFIG_DF=y
--CONFIG_DF_PEDANTIC=y
-+# CONFIG_DATE is not set
-+# CONFIG_DF is not set
-+# CONFIG_DF_PEDANTIC is not set
- CONFIG_DIRNAME=y
- CONFIG_DU=y
- CONFIG_ECHO=y
-@@ -166,24 +166,24 @@ CONFIG_EXPAND=y
- CONFIG_FALSE=y
- CONFIG_GREP=y
- CONFIG_HEAD=y
--CONFIG_ID=y
--CONFIG_ID_GROUPS=y
--CONFIG_KILL=y
--CONFIG_LINK=y
-+# CONFIG_ID is not set
-+# CONFIG_ID_GROUPS is not set
-+# CONFIG_KILL is not set
-+# CONFIG_LINK is not set
- CONFIG_LN=y
--CONFIG_LOGNAME=y
-+# CONFIG_LOGNAME is not set
- CONFIG_LS=y
- CONFIG_LS_COLOR=y
- CONFIG_MKDIR=y
--CONFIG_MKFIFO=y
--CONFIG_NICE=y
-+# CONFIG_MKFIFO is not set
-+# CONFIG_NICE is not set
- CONFIG_NL=y
--CONFIG_NOHUP=y
-+# CONFIG_NOHUP is not set
- CONFIG_OD=y
- CONFIG_PASTE=y
- CONFIG_PATCH=y
- CONFIG_PWD=y
--CONFIG_RENICE=y
-+# CONFIG_RENICE is not set
- CONFIG_RM=y
- CONFIG_RMDIR=y
- CONFIG_SLEEP=y
-@@ -194,18 +194,18 @@ CONFIG_SORT_FLOAT=y
- CONFIG_SPLIT=y
- CONFIG_TAIL=y
- CONFIG_TAIL_SEEK=y
--CONFIG_TEE=y
--CONFIG_TIME=y
--CONFIG_TOUCH=y
-+# CONFIG_TEE is not set
-+# CONFIG_TIME is not set
-+# CONFIG_TOUCH is not set
- CONFIG_TRUE=y
--CONFIG_TTY=y
-+# CONFIG_TTY is not set
- CONFIG_UNAME=y
--CONFIG_UNIQ=y
-+# CONFIG_UNIQ is not set
- CONFIG_UNLINK=y
- CONFIG_UUDECODE=y
- CONFIG_UUENCODE=y
- CONFIG_WC=y
--CONFIG_WHO=y
-+# CONFIG_WHO is not set
- CONFIG_XARGS=y
- # CONFIG_XARGS_PEDANTIC is not set
-
-@@ -222,5 +222,5 @@ CONFIG_TOYBOX_FLOAT=y
- CONFIG_TOYBOX_HELP=y
- CONFIG_TOYBOX_HELP_DASHDASH=y
- CONFIG_TOYBOX_I18N=y
--# CONFIG_TOYBOX_FREE is not set
-+CONFIG_TOYBOX_FREE=y
- # CONFIG_TOYBOX_DEBUG is not set
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -8,7 +8,7 @@
- # Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned.
- CFLAGS="$CFLAGS -funsigned-char"
-
--[ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections -fno-asynchronous-unwind-tables"
-+[ -z "$OPTIMIZE" ] && OPTIMIZE="-ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables"
- [ -z "$CC" ] && CC=cc
- [ -z "$STRIP" ] && STRIP=strip
-
-diff --git a/lib/getmountlist.c b/lib/getmountlist.c
---- a/lib/getmountlist.c
-+++ b/lib/getmountlist.c
-@@ -5,13 +5,18 @@
-
- #include "toys.h"
-
-+#ifndef __native_client__
- #include <mntent.h>
-+#endif
-
- // Get list of mounted filesystems, including stat and statvfs info.
- // Returns a reversed list, which is good for finding overmounts and such.
-
- struct mtab_list *xgetmountlist(char *path)
- {
-+#ifdef __native_client__
-+ perror_exit("can't obtain mountlist on native client");
-+#else
- struct mtab_list *mtlist, *mt;
- struct mntent *me;
- FILE *fp;
-@@ -40,4 +45,5 @@ struct mtab_list *xgetmountlist(char *path)
- endmntent(fp);
-
- return mtlist;
-+#endif
- }
-diff --git a/lib/lib.h b/lib/lib.h
---- a/lib/lib.h
-+++ b/lib/lib.h
-@@ -151,6 +151,7 @@ int yesno(char *prompt, int def);
- // net.c
- int xsocket(int domain, int type, int protocol);
-
-+#ifndef __native_client__
- // getmountlist.c
- struct mtab_list {
- struct mtab_list *next;
-@@ -160,6 +161,7 @@ struct mtab_list {
- char *device;
- char type[0];
- };
-+#endif
-
- struct mtab_list *xgetmountlist(char *path);
-
-diff --git a/lib/password.c b/lib/password.c
---- a/lib/password.c
-+++ b/lib/password.c
-@@ -7,6 +7,10 @@
- #include "xregcomp.h"
- #include <time.h>
-
-+#ifdef __native_client__
-+#define LOGIN_NAME_MAX 256
-+#endif
-+
- int get_salt(char *salt, char *algo)
- {
- int i, len = 0, offset = 0;
-diff --git a/lib/pending.c b/lib/pending.c
---- a/lib/pending.c
-+++ b/lib/pending.c
-@@ -57,7 +57,7 @@ void daemonize(void)
- if (pid < 0) perror_exit("DAEMON: failed to fork");
- if (pid) exit(EXIT_SUCCESS);
-
-- setsid();
-+ //setsid();
- dup2(fd, 0);
- dup2(fd, 1);
- dup2(fd, 2);
-diff --git a/lib/portability.c b/lib/portability.c
---- a/lib/portability.c
-+++ b/lib/portability.c
-@@ -6,7 +6,7 @@
-
- #include "toys.h"
-
--#if defined(__APPLE__) || defined(__ANDROID__)
-+#if defined(__APPLE__) || defined(__ANDROID__) || defined(__native_client__)
- ssize_t getdelim(char **linep, size_t *np, int delim, FILE *stream)
- {
- int ch;
-@@ -61,7 +61,7 @@ ssize_t getline(char **linep, size_t *np, FILE *stream)
- }
- #endif
-
--#if defined(__APPLE__)
-+#if defined(__APPLE__) || defined(__native_client__)
- extern char **environ;
-
- int clearenv(void)
-@@ -70,3 +70,156 @@ int clearenv(void)
- return 0;
- }
- #endif
-+
-+#if defined(__native_client__)
-+#ifndef AT_FDCWD
-+/* Laster headers include openat() declaration but not the others */
-+int openat(int dirfd, const char *pathname, int flags, ...)
-+ __attribute__((weak));
-+#endif
-+int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags)
-+ __attribute__((weak));
-+int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags)
-+ __attribute__((weak));
-+int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz)
-+ __attribute__((weak));
-+int unlinkat(int dirfd, const char *pathname, int flags)
-+ __attribute__((weak));
-+int faccessat(int dirfd, const char *pathname, int mode, int flags)
-+ __attribute__((weak));
-+DIR *fdopendir(int dirfd)
-+ __attribute__((weak));
-+
-+int mkdirat(int dirfd, const char *pathname, mode_t mode)
-+ __attribute__((weak));
-+int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev)
-+ __attribute__((weak));
-+int fchownat(int dirfd, const char *pathname, uid_t owner,
-+ gid_t group, int flags)
-+ __attribute__((weak));
-+int symlinkat(const char *oldpath, int dirfd, const char *newpath)
-+ __attribute__((weak));
-+int linkat(int dirfd, const char *oldpath,
-+ int newdirfd, const char *newpath, int flags)
-+ __attribute__((weak));
-+
-+#define _AT_WRAP_START(A) \
-+ int fchdir_err = 0; \
-+ char *save = xgetcwd(); \
-+ if (!save) perror_exit("fd_wrapper_"A); \
-+ if (dirfd != AT_FDCWD) fchdir_err = fchdir(dirfd);
-+
-+#define _AT_WRAP_END(A) \
-+ if (dirfd != AT_FDCWD) chdir(save); \
-+ free(save);
-+
-+int openat(int dirfd, const char *pathname, int flags, ...) {
-+ _AT_WRAP_START("openat")
-+ int fd = open(pathname, flags);
-+ _AT_WRAP_END("openat")
-+ return fd;
-+}
-+
-+int fstatat(int dirfd, const char *pathname, struct stat *buf, int flags) {
-+ // We are going to ignore flags here.
-+ //if (flags) perror_exit("fstatat_flags");
-+ _AT_WRAP_START("fstatat")
-+ int result;
-+ if (flags & AT_SYMLINK_NOFOLLOW)
-+ result = lstat(pathname, buf);
-+ else
-+ result = stat(pathname, buf);
-+ _AT_WRAP_END("fstatat")
-+ return result;
-+}
-+
-+int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags) {
-+ // We are going to ignore flags here.
-+ //if (flags) perror_exit("fchmodat_flags");
-+ _AT_WRAP_START("fchmodat")
-+ int result = chmod(pathname, mode);
-+ _AT_WRAP_END("fchmodat")
-+ return result;
-+}
-+
-+int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz) {
-+ _AT_WRAP_START("readlinkat")
-+ int result = readlink(pathname, buf, bufsiz);
-+ _AT_WRAP_END("readlinkat")
-+ return result;
-+}
-+
-+int unlinkat(int dirfd, const char *pathname, int flags) {
-+ // We are going to ignore flags here.
-+ //if (flags) perror_exit("unlinkat_flags");
-+ _AT_WRAP_START("unlinkat")
-+ int result;
-+ if(flags & AT_REMOVEDIR) {
-+ result = rmdir(pathname);
-+ } else {
-+ result = unlink(pathname);
-+ }
-+ _AT_WRAP_END("unlinkat")
-+ return result;
-+}
-+
-+int faccessat(int dirfd, const char *pathname, int mode, int flags) {
-+ //if (flags) perror_exit("faccessat_flags");
-+ _AT_WRAP_START("faccessat")
-+ int result = access(pathname, mode);
-+ _AT_WRAP_END("faccessat")
-+ return result;
-+}
-+
-+DIR *fdopendir(int dirfd) {
-+ _AT_WRAP_START("fdopendir")
-+ DIR *dir;
-+ if (fchdir_err) {
-+ perror("fdopendir: ");
-+ }
-+ dir = opendir(".");
-+ _AT_WRAP_END("fdopendir")
-+ return dir;
-+}
-+
-+int mkdirat(int dirfd, const char *pathname, mode_t mode) {
-+ _AT_WRAP_START("mkdirat")
-+ int result = mkdir(pathname, mode);
-+ _AT_WRAP_END("mkdirat")
-+ return result;
-+}
-+
-+int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev) {
-+ error_exit("mknod not supported");
-+}
-+
-+int fchownat(int dirfd, const char *pathname, uid_t owner,
-+ gid_t group, int flags) {
-+ _AT_WRAP_START("fchownat")
-+ int result = chown(pathname, owner, group);
-+ _AT_WRAP_END("fchownat")
-+ return result;
-+}
-+
-+int symlinkat(const char *oldpath, int dirfd, const char *newpath) {
-+ _AT_WRAP_START("symlinkat")
-+ int result = symlink(oldpath, newpath);
-+ _AT_WRAP_END("symlinkat")
-+ return result;
-+}
-+
-+int linkat(int olddirfd, const char *oldpath,
-+ int newdirfd, const char *newpath, int flags) {
-+ int result;
-+ if ((oldpath[0] == '/') && (newpath[0] == '/')) {
-+ result = link(oldpath, newpath);
-+ } else {
-+ errno = EINVAL;
-+ result = -1;
-+ }
-+ // We do not support double linking.
-+ return result;
-+}
-+
-+
-+#endif
-diff --git a/lib/portability.h b/lib/portability.h
---- a/lib/portability.h
-+++ b/lib/portability.h
-@@ -15,7 +15,7 @@
-
- // Test for gcc (using compiler builtin #define)
-
--#ifdef __GNUC__
-+#if defined(__GNUC__) && !defined(__native_client__)
- #define noreturn __attribute__((noreturn))
- #else
- #define noreturn
-@@ -26,7 +26,16 @@
-
- // This isn't in the spec, but it's how we determine what libc we're using.
-
-+// Include sys/types.h so that we can later check for _NEWLIB_VERSION.
-+#if defined(__native_client__)
-+#include <sys/types.h>
-+#endif
-+
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+#include <sys/features.h>
-+#else
- #include <features.h>
-+#endif
-
- // Various constants old build environments might not have even if kernel does
-
-@@ -68,7 +77,7 @@ char *strptime(const char *buf, const char *format, struct tm *tm);
- ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
-
- // When building under obsolete glibc (Ubuntu 8.04-ish), hold its hand a bit.
--#elif __GLIBC__ == 2 && __GLIBC_MINOR__ < 10
-+#elif __GLIBC__ == 2 && __GLIBC_MINOR__ < 10 && !defined(__native_client__)
- #define fstatat fstatat64
- int fstatat64(int dirfd, const char *pathname, void *buf, int flags);
- int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz);
-@@ -102,7 +111,7 @@ int utimensat(int fd, const char *path, const struct timespec times[2], int flag
-
- // Work out how to do endianness
-
--#ifndef __APPLE__
-+#if !defined(__APPLE__) && !defined(__native_client__)
- #include <byteswap.h>
- #include <endian.h>
-
-diff --git a/lib/xwrap.c b/lib/xwrap.c
---- a/lib/xwrap.c
-+++ b/lib/xwrap.c
-@@ -224,7 +224,8 @@ off_t xlseek(int fd, off_t offset, int whence)
-
- char *xgetcwd(void)
- {
-- char *buf = getcwd(NULL, 0);
-+ char *buf = xmalloc(sizeof(char) * (PATH_MAX+1));
-+ buf = getcwd(buf, PATH_MAX+1);
- if (!buf) perror_exit("xgetcwd");
-
- return buf;
-@@ -353,7 +354,11 @@ error:
- // Resolve all symlinks, returning malloc() memory.
- char *xrealpath(char *path)
- {
-+#ifdef __native_client__
-+ char *new = strdup(path);
-+#else
- char *new = realpath(path, NULL);
-+#endif
- if (!new) perror_exit("realpath '%s'", path);
- return new;
- }
-diff --git a/scripts/install.c b/scripts/install.c
---- a/scripts/install.c
-+++ b/scripts/install.c
-@@ -3,6 +3,9 @@
- * Copyright 2006 Rob Landley <rob@landley.net>
- */
-
-+#define _SKIP_LIBC_HEADERS
-+#include <setjmp.h>
-+#include <stdio.h>
- #include "toys.h"
-
- #undef NEWTOY
-diff --git a/scripts/make.sh b/scripts/make.sh
---- a/scripts/make.sh
-+++ b/scripts/make.sh
-@@ -165,6 +165,7 @@ echo "Library probe..."
- OPTLIBS="$(for i in util crypt m; do echo "int main(int argc, char *argv[]) {return 0;}" | ${CROSS_COMPILE}${CC} -xc - -o /dev/null -Wl,--as-needed -l$i > /dev/null 2>/dev/null && echo -l$i; done)"
-
- echo "Compile toybox..."
-+OPTLIBS="${LIBS}"
-
- do_loudly()
- {
-@@ -172,7 +173,7 @@ do_loudly()
- "$@"
- }
-
--do_loudly ${CROSS_COMPILE}${CC} $CFLAGS -I . -o toybox_unstripped $OPTIMIZE \
-+do_loudly ${CROSS_COMPILE}${CC} $CFLAGS $LDFLAGS -I . -o toybox_unstripped $OPTIMIZE \
- main.c lib/*.c $TOYFILES -Wl,--as-needed $OPTLIBS || exit 1
- do_loudly ${CROSS_COMPILE}${STRIP} toybox_unstripped -o toybox || exit 1
- # gcc 4.4's strip command is buggy, and doesn't set the executable bit on
-diff --git a/toys.h b/toys.h
---- a/toys.h
-+++ b/toys.h
-@@ -5,6 +5,8 @@
-
- #include "generated/config.h"
-
-+#ifndef _SKIP_LIBC_HEADERS
-+
- #include "lib/portability.h"
-
- #include <ctype.h>
-@@ -16,12 +18,16 @@
- #include <limits.h>
- #include <libgen.h>
- #include <math.h>
-+#ifndef __native_client__
- #include <pty.h>
-+#endif
- #include <pwd.h>
- #include <sched.h>
- #include <setjmp.h>
- #include <sched.h>
-+#ifndef __native_client__
- #include <shadow.h>
-+#endif
- #include <stdarg.h>
- #include <stddef.h>
- #include <stdint.h>
-@@ -34,10 +40,13 @@
- #include <sys/mount.h>
- #include <sys/resource.h>
- #include <sys/stat.h>
-+#ifndef __native_client__
- #include <sys/statfs.h>
- #include <sys/statvfs.h>
- #include <sys/sysinfo.h>
- #include <sys/swap.h>
-+#endif
-+#include <sys/termios.h>
- #include <sys/time.h>
- #include <sys/times.h>
- #include <sys/types.h>
-@@ -47,7 +56,9 @@
- #include <time.h>
- #include <unistd.h>
- #include <utime.h>
-+#ifndef __native_client__
- #include <utmpx.h>
-+#endif
-
- // Internationalization support
-
-@@ -59,7 +70,9 @@
-
- #include <arpa/inet.h>
- #include <netdb.h>
-+#ifndef __native_client__
- #include <net/if.h>
-+#endif
- #include <netinet/in.h>
- #include <netinet/tcp.h>
- #include <poll.h>
-@@ -69,6 +82,8 @@
- #include "lib/lib.h"
- #include "toys/e2fs.h"
-
-+#endif // _SKIP_LIBC_HEADERS
-+
- // Get list of function prototypes for all enabled command_main() functions.
-
- #define NEWTOY(name, opts, flags) void name##_main(void);
-@@ -76,7 +91,9 @@
- #include "generated/newtoys.h"
- #include "generated/oldtoys.h"
- #include "generated/flags.h"
-+#ifndef _SKIP_LIBC_HEADERS
- #include "generated/globals.h"
-+#endif
-
- // These live in main.c
-
-diff --git a/toys/other/stat.c b/toys/other/stat.c
---- a/toys/other/stat.c
-+++ b/toys/other/stat.c
-@@ -40,7 +40,9 @@ GLOBALS(
-
- union {
- struct stat st;
-+#ifndef __native_client__
- struct statfs sf;
-+#endif
- } stat;
- struct passwd *user_name;
- struct group *group_name;
-diff --git a/toys/other/timeout.c b/toys/other/timeout.c
---- a/toys/other/timeout.c
-+++ b/toys/other/timeout.c
-@@ -33,7 +33,9 @@ GLOBALS(
- int nextsig;
- pid_t pid;
- struct timeval ktv;
-+#ifndef __native_client__
- struct itimerval itv;
-+#endif
- )
-
- static void handler(int i)
-diff --git a/toys/pending/sh.c b/toys/pending/sh.c
---- a/toys/pending/sh.c
-+++ b/toys/pending/sh.c
-@@ -177,6 +177,10 @@ config CD_P
- #define FOR_sh
- #include "toys.h"
-
-+#if defined(__native_client__)
-+# include <spawn.h>
-+#endif
-+
- GLOBALS(
- char *command;
- )
-@@ -291,7 +295,11 @@ static void run_pipeline(struct pipeline *line)
-
- tl = toy_find(cmd->argv[0]);
- // Is this command a builtin that should run in this process?
-+#ifdef __native_client__
-+ if (tl) {
-+#else
- if (tl && (tl->flags & TOYFLAG_NOFORK)) {
-+#endif
- struct toy_context temp;
- jmp_buf rebound;
-
-@@ -311,10 +319,15 @@ static void run_pipeline(struct pipeline *line)
- } else {
- int status;
-
-+#ifdef __native_client__
-+ cmd->pid = spawnve(P_NOWAIT, cmd->argv[0], cmd->argv, NULL);
-+ if (cmd->pid <= 0) xprintf("error spawning %s\n", cmd->argv[0]);
-+ else waitpid(cmd->pid, &status, 0);
-+#else
- cmd->pid = vfork();
- if (!cmd->pid) xexec(cmd->argv);
- else waitpid(cmd->pid, &status, 0);
--
-+#endif
- if (CFG_SH_FLOWCTL || CFG_SH_PIPES) {
- if (WIFEXITED(status)) cmd->pid = WEXITSTATUS(status);
- if (WIFSIGNALED(status)) cmd->pid = WTERMSIG(status);
-@@ -382,7 +395,12 @@ void sh_main(void)
- for (;;) {
- char *command = 0;
- if (!f) xputc('$');
-- if (1 > getline(&command, &cmdlen, f ? f : stdin)) break;
-+ if (1 > getline(&command, &cmdlen, f ? f : stdin))
-+#ifdef __native_client__ // Here we want to continue cycling until explicit exit.
-+ continue;
-+#else
-+ break;
-+#endif
- handle(command);
- free(command);
- }
-diff --git a/toys/posix/cp.c b/toys/posix/cp.c
---- a/toys/posix/cp.c
-+++ b/toys/posix/cp.c
-@@ -232,18 +232,24 @@ int cp_node(struct dirtree *try)
-
- // Inability to set these isn't fatal, some require root access.
-
-+#ifndef __native_client__
- times[0] = try->st.st_atim;
- times[1] = try->st.st_mtim;
-+#endif
-
- // If we can't get a filehandle to the actual object, use racy functions
- if (fdout == AT_FDCWD) {
- fchownat(cfd, catch, try->st.st_uid, try->st.st_gid,
- AT_SYMLINK_NOFOLLOW);
-+#ifndef __native_client__
- utimensat(cfd, catch, times, AT_SYMLINK_NOFOLLOW);
-+#endif
- // permission bits already correct for mknod, don't apply to symlink
- } else {
- fchown(fdout, try->st.st_uid, try->st.st_gid);
-+#ifndef __native_client__
- futimens(fdout, times);
-+#endif
- fchmod(fdout, try->st.st_mode);
- }
- }
-diff --git a/toys/posix/ls.c b/toys/posix/ls.c
---- a/toys/posix/ls.c
-+++ b/toys/posix/ls.c
-@@ -97,10 +97,15 @@ static char *getusername(uid_t uid)
-
- static char *getgroupname(gid_t gid)
- {
-+#ifdef __native_client__
-+ static char* gr_name = "nacl";
-+ return gr_name;
-+#else
- struct group *gr = getgrgid(gid);
-
- sprintf(TT.gid_buf, "%u", (unsigned)gid);
- return gr ? gr->gr_name : TT.gid_buf;
-+#endif
- }
-
- // Figure out size of printable entry fields for display indent/wrap
diff --git a/ports/toybox/pkg_info b/ports/toybox/pkg_info
deleted file mode 100644
index 03625b5..0000000
--- a/ports/toybox/pkg_info
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME=toybox
-VERSION=0.4.7
-URL=http://www.landley.net/toybox/downloads/toybox-0.4.7.tar.bz2
-LICENSE=BSD
-DEPENDS=(glibc-compat nacl-spawn)
-# Doesn't currently build on mac due to sed errors script/make.sh
-BUILD_OS=linux
-SHA1=c5e7b31a81dde474d17455535b76957ab48f2bbb
-# glibc/arm: missing IUCLC (termio.h)
-# https://code.google.com/p/nativeclient/issues/detail?id=4235
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
diff --git a/ports/toybox/toybox.config b/ports/toybox/toybox.config
deleted file mode 100644
index 842a7a3..0000000
--- a/ports/toybox/toybox.config
+++ /dev/null
@@ -1,226 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# ToyBox version: KCONFIG_VERSION
-# Fri Jan 3 14:13:06 2014
-#
-CONFIG_TOYBOX_CONTAINER=y
-
-#
-# LSB commands
-#
-# CONFIG_DMESG is not set
-# CONFIG_HOSTNAME is not set
-# CONFIG_KILLALL is not set
-# CONFIG_MD5SUM is not set
-# CONFIG_MD5SUM_SHA1SUM is not set
-# CONFIG_MKNOD is not set
-CONFIG_MKTEMP=y
-# CONFIG_PASSWD is not set
-# CONFIG_PIDOF is not set
-CONFIG_SEQ=y
-# CONFIG_SYNC is not set
-# CONFIG_UMOUNT is not set
-
-#
-# Other commands
-#
-# CONFIG_ACPI is not set
-# CONFIG_BLKID is not set
-CONFIG_BZCAT=y
-CONFIG_CATV=y
-# CONFIG_CHROOT is not set
-# CONFIG_CHVT is not set
-CONFIG_CLEAR=y
-CONFIG_COUNT=y
-CONFIG_DOS2UNIX=y
-# CONFIG_EJECT is not set
-# CONFIG_FALLOCATE is not set
-# CONFIG_FREE is not set
-# CONFIG_HELLO is not set
-CONFIG_HELP=y
-# CONFIG_INSMOD is not set
-# CONFIG_LOGIN is not set
-# CONFIG_LOSETUP is not set
-# CONFIG_LSMOD is not set
-# CONFIG_LSUSB is not set
-# CONFIG_MKSWAP is not set
-# CONFIG_MODINFO is not set
-# CONFIG_MOUNTPOINT is not set
-# CONFIG_NETCAT is not set
-# CONFIG_NETCAT_LISTEN is not set
-# CONFIG_ONEIT is not set
-# CONFIG_PIVOT_ROOT is not set
-# CONFIG_PMAP is not set
-CONFIG_PRINTENV=y
-CONFIG_PWDX=y
-# CONFIG_READAHEAD is not set
-# CONFIG_READLINK is not set
-# CONFIG_REALPATH is not set
-# CONFIG_REBOOT is not set
-CONFIG_REV=y
-# CONFIG_RMMOD is not set
-# CONFIG_SETSID is not set
-# CONFIG_STAT is not set
-# CONFIG_SWAPOFF is not set
-# CONFIG_SWAPON is not set
-# CONFIG_SWITCH_ROOT is not set
-CONFIG_TAC=y
-# CONFIG_TASKSET is not set
-# CONFIG_TIMEOUT is not set
-CONFIG_TRUNCATE=y
-# CONFIG_UNSHARE is not set
-# CONFIG_UPTIME is not set
-CONFIG_USLEEP=y
-# CONFIG_VCONFIG is not set
-# CONFIG_VMSTAT is not set
-# CONFIG_W is not set
-CONFIG_WHICH=y
-# CONFIG_WHOAMI is not set
-CONFIG_YES=y
-
-#
-# pending
-#
-# CONFIG_CPIO is not set
-# CONFIG_DD is not set
-# CONFIG_DHCP is not set
-# CONFIG_DHCPD is not set
-# CONFIG_DEBUG_DHCP is not set
-# CONFIG_DUMPLEASES is not set
-# CONFIG_EXPR is not set
-# CONFIG_FDISK is not set
-CONFIG_FIND=y
-# CONFIG_FSCK is not set
-# CONFIG_GROUPADD is not set
-# CONFIG_IFCONFIG is not set
-# CONFIG_INIT is not set
-# CONFIG_KLOGD is not set
-# CONFIG_KLOGD_SOURCE_RING_BUFFER is not set
-# CONFIG_LOGGER is not set
-# CONFIG_LSPCI is not set
-# CONFIG_LSPCI_TEXT is not set
-# CONFIG_MDEV is not set
-# CONFIG_MDEV_CONF is not set
-# CONFIG_MKE2FS is not set
-# CONFIG_MKE2FS_JOURNAL is not set
-# CONFIG_MKE2FS_GEN is not set
-# CONFIG_MKE2FS_LABEL is not set
-# CONFIG_MKE2FS_EXTENDED is not set
-# CONFIG_MKPASSWD is not set
-# CONFIG_NBD_CLIENT is not set
-# CONFIG_NETSTAT is not set
-# CONFIG_PGREP is not set
-# CONFIG_PS is not set
-# CONFIG_ROUTE is not set
-CONFIG_SED=y
-CONFIG_SH=y
-CONFIG_SH_TTY=y
-CONFIG_SH_PROFILE=y
-# CONFIG_SH_JOBCTL is not set
-# CONFIG_SH_FLOWCTL is not set
-CONFIG_SH_QUOTES=y
-CONFIG_SH_WILDCARDS=y
-# CONFIG_SH_PROCARGS is not set
-CONFIG_SH_ENVVARS=y
-CONFIG_SH_LOCALS=y
-CONFIG_SH_ARRAYS=y
-# CONFIG_SH_PIPES is not set
-CONFIG_SH_BUILTINS=y
-# CONFIG_EXIT is not set
-# CONFIG_CD is not set
-# CONFIG_CD_P is not set
-# CONFIG_SU is not set
-# CONFIG_SYSLOGD is not set
-# CONFIG_TEST is not set
-# CONFIG_TFTPD is not set
-# CONFIG_TOP is not set
-# CONFIG_TRACEROUTE is not set
-# CONFIG_USERADD is not set
-# CONFIG_WATCH is not set
-# CONFIG_XZCAT is not set
-
-#
-# Posix commands
-#
-CONFIG_BASENAME=y
-CONFIG_CAL=y
-CONFIG_CAT=y
-# CONFIG_CHGRP is not set
-CONFIG_CHMOD=y
-CONFIG_CKSUM=y
-CONFIG_CMP=y
-CONFIG_COMM=y
-CONFIG_CP=y
-CONFIG_CP_MORE=y
-CONFIG_CP_MV=y
-CONFIG_CP_MV_MORE=y
-CONFIG_CUT=y
-# CONFIG_DATE is not set
-# CONFIG_DF is not set
-# CONFIG_DF_PEDANTIC is not set
-CONFIG_DIRNAME=y
-CONFIG_DU=y
-CONFIG_ECHO=y
-CONFIG_ENV=y
-CONFIG_EXPAND=y
-CONFIG_FALSE=y
-CONFIG_GREP=y
-CONFIG_HEAD=y
-# CONFIG_ID is not set
-# CONFIG_ID_GROUPS is not set
-# CONFIG_KILL is not set
-# CONFIG_LINK is not set
-CONFIG_LN=y
-# CONFIG_LOGNAME is not set
-CONFIG_LS=y
-CONFIG_LS_COLOR=y
-CONFIG_MKDIR=y
-# CONFIG_MKFIFO is not set
-# CONFIG_NICE is not set
-CONFIG_NL=y
-# CONFIG_NOHUP is not set
-CONFIG_OD=y
-CONFIG_PASTE=y
-CONFIG_PATCH=y
-CONFIG_PWD=y
-# CONFIG_RENICE is not set
-CONFIG_RM=y
-CONFIG_RMDIR=y
-CONFIG_SLEEP=y
-CONFIG_SLEEP_FLOAT=y
-CONFIG_SORT=y
-CONFIG_SORT_BIG=y
-CONFIG_SORT_FLOAT=y
-CONFIG_SPLIT=y
-CONFIG_TAIL=y
-CONFIG_TAIL_SEEK=y
-# CONFIG_TEE is not set
-# CONFIG_TIME is not set
-# CONFIG_TOUCH is not set
-CONFIG_TRUE=y
-# CONFIG_TTY is not set
-CONFIG_UNAME=y
-# CONFIG_UNIQ is not set
-CONFIG_UNLINK=y
-CONFIG_UUDECODE=y
-CONFIG_UUENCODE=y
-CONFIG_WC=y
-# CONFIG_WHO is not set
-CONFIG_XARGS=y
-# CONFIG_XARGS_PEDANTIC is not set
-
-#
-#
-#
-
-#
-# Toybox global settings
-#
-CONFIG_TOYBOX=y
-CONFIG_TOYBOX_SUID=y
-CONFIG_TOYBOX_FLOAT=y
-CONFIG_TOYBOX_HELP=y
-CONFIG_TOYBOX_HELP_DASHDASH=y
-CONFIG_TOYBOX_I18N=y
-CONFIG_TOYBOX_FREE=y
-# CONFIG_TOYBOX_DEBUG is not set
diff --git a/ports/tree/build.sh b/ports/tree/build.sh
deleted file mode 100644
index 1259682..0000000
--- a/ports/tree/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2015 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.
-
-BUILD_DIR=${SRC_DIR}
-EXECUTABLES="tree"
-INSTALL_TARGETS="install prefix=${DESTDIR}/${PREFIX}"
-
-EnableCliMain
-
-BuildStep() {
- LogExecute make clean
- LogExecute make -j${OS_JOBS} CC="${NACLCC}" CFLAGS=" -c \
- ${NACLPORTS_CFLAGS}" LDFLAGS="${NACLPORTS_LDFLAGS}" tree
-}
diff --git a/ports/tree/nacl.patch b/ports/tree/nacl.patch
deleted file mode 100644
index 3146eec..0000000
--- a/ports/tree/nacl.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -26,7 +26,7 @@ BINDIR=${prefix}/bin
- MAN=tree.1
- MANDIR=${prefix}/man/man1
- OBJS=tree.o unix.o html.o xml.o json.o hash.o color.o
--
-+OBJS+=strverscmp.o
- # Uncomment options below for your particular OS:
-
- # Linux defaults:
diff --git a/ports/tree/pkg_info b/ports/tree/pkg_info
deleted file mode 100644
index 5bedfa9..0000000
--- a/ports/tree/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=tree
-VERSION=1.7.0
-URL=ftp://mama.indstate.edu/linux/tree/tree-1.7.0.tgz
-LICENSE=GPL
-DEPENDS=(nacl-spawn)
-SHA1=35bd212606e6c5d60f4d5062f4a59bb7b7b25949
diff --git a/ports/twm/build.sh b/ports/twm/build.sh
deleted file mode 100644
index 7faa107..0000000
--- a/ports/twm/build.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXECUTABLES="twm${NACL_EXEEXT}"
-
-NACLPORTS_LIBS+="\
- -lXext -lXmu -lSM -lICE -lXt -lX11 -lxcb -lXau"
-
-EnableCliMain
-EnableGlibcCompat
-
-if [ "${TOOLCHAIN}" = "pnacl" -o "${TOOLCHAIN}" = "clang-newlib" ]; then
- NACLPORTS_CFLAGS+=" -Wno-return-type -Wno-parentheses -Wno-dangling-else"
- NACLPORTS_CPPFLAGS+=" -std=gnu89"
-fi
-
-BuildStep() {
- RC=deftwmrc.c
- rm -f ${RC}
- echo 'char *defTwmrc[] = {' >>${RC}
- sed -e '/^#/d' -e 's/"/\\"/g' -e 's/^/ "/' -e 's/$/",/' \
- ${SRC_DIR}/system.twmrc >>${RC}
- echo ' (char *) 0 };' >>${RC}
-
- LogExecute flex ${SRC_DIR}/lex.l
- LogExecute bison --defines=gram.h ${SRC_DIR}/gram.y
- SetupCrossEnvironment
- LogExecute ${CC} ${CPPFLAGS} ${CFLAGS} -o twm ${SRC_DIR}/*.c *.c -I. \
- -I${SRC_DIR} ${LDFLAGS} ${LIBS}
- LogExecute ${CC} ${CPPFLAGS} ${CFLAGS} -o twm${NACL_EXEEXT} ${SRC_DIR}/*.c\
- *.c -I. -I${SRC_DIR} ${LDFLAGS} ${LIBS}
-}
-
-InstallStep() {
- MakeDir ${DESTDIR_BIN}
- LogExecute cp -f ${BUILD_DIR}/twm${NACL_EXEEXT} ${DESTDIR_BIN}/twm
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- LogExecute cp -f ${BUILD_DIR}/twm${NACL_EXEEXT} twm_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py\
- twm_*${NACL_EXEEXT} -s . -o twm.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py -n twm twm.nmf
- InstallNaClTerm .
- LogExecute cp -f ${START_DIR}/*.js .
-}
diff --git a/ports/twm/pkg_info b/ports/twm/pkg_info
deleted file mode 100644
index 445c449..0000000
--- a/ports/twm/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=twm
-ARCHIVE_ROOT=twm
-VERSION=X11R6-xc-fix13
-URL=http://xwinman.org/archive/twm/twm-X11R6-xc-fix13.tar.gz
-LICENSE=GPL
-DEPENDS=(glibc-compat xbitmaps libx11 libxcb libxmu libxext libxau libxt libice libsm nacl-spawn)
-SHA1=c89b1c4e094826a32c9d9e4b7a7b4e9877025a1f
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/twm/twm.js b/ports/twm/twm.js
deleted file mode 100644
index 453fecc..0000000
--- a/ports/twm/twm.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 2015 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.
- */
-
-NaClTerm.nmf = 'twm.nmf';
-NaClTerm.env = [
- 'NACL_SPAWN_MODE=embed',
- 'NACL_EMBED_WIDTH=100%',
- 'NACL_EMBED_HEIGHT=100%',
- 'DISPLAY=:42',
-];
-
-document.title = 'twm';
diff --git a/ports/unzip/build.sh b/ports/unzip/build.sh
deleted file mode 100644
index 1860ac8..0000000
--- a/ports/unzip/build.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2014 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.
-
-BUILD_DIR=${SRC_DIR}
-
-EnableCliMain
-
-NACLPORTS_CPPFLAGS+=" -DHAVE_TERMIOS_H -DNO_CHMOD -DNO_FCHMOD -DNO_LCHMOD"
-
-EXECUTABLES="funzip unzip unzipsfx"
-
-BuildStep() {
- make -f unix/Makefile clean
- # "generic" target, which runs unix/configure, is
- # suggested. However, this target does not work well with NaCl. For
- # example, it does not allow us to overwrite LFLAGS1, it sets the
- # results of uname command, etc.
- #
- # We use NACLCXX as the linker because we link some C++ libraries
- # (e.g., libppapi).
- make -j${OS_JOBS} -f unix/Makefile unzips \
- CC=${NACLCC} LD=${NACLCXX} \
- CFLAGS="${NACLPORTS_CPPFLAGS} ${NACLPORTS_CFLAGS}" \
- LFLAGS1="${NACLPORTS_LDFLAGS}" LF2="${NACLPORTS_LIBS}"
-}
-
-InstallStep() {
- LogExecute make -f unix/Makefile install prefix=${DESTDIR}/${PREFIX}
-}
-
-TestStep() {
- if [ "${TOOLCHAIN}" = "pnacl" ]; then
- return
- fi
- TESTZIP=testmake.zip
- LogExecute ./unzip.sh -bo ${TESTZIP} testmake.zipinfo
- CheckHash testmake.zipinfo f0d76aa12768455728f4bb0f42ceab64aaddfae8
-}
-
-PublishStep() {
- PublishMultiArch unzip unzip
-}
diff --git a/ports/unzip/nacl.patch b/ports/unzip/nacl.patch
deleted file mode 100644
index d9ddd61..0000000
--- a/ports/unzip/nacl.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-diff --git a/fileio.c b/fileio.c
---- a/fileio.c
-+++ b/fileio.c
-@@ -1822,8 +1822,15 @@ time_t dos_to_unix_time(dosdatetime)
- /* tzset was already called at start of process_zipfiles() */
- /* tzset(); */ /* set `timezone' variable */
- #ifndef __BEOS__ /* BeOS DR8 has no timezones... */
-+ /* TODO(hamaji): remove once this gets fixed:
-+ * https://code.google.com/p/nativeclient/issues/detail?id=3737
-+ */
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
-+ m_time += _timezone; /* seconds WEST of GMT: add */
-+#else
- m_time += timezone; /* seconds WEST of GMT: add */
- #endif
-+#endif
- #endif /* ?(BSD || MTS || __GO32__) */
- #endif /* ?WIN32 */
- TTrace((stderr, " m_time after timezone = %lu\n", (ulg)m_time));
-diff --git a/process.c b/process.c
---- a/process.c
-+++ b/process.c
-@@ -729,7 +729,8 @@ static int do_seekable(__G__ lastchance) /* return PK-type error code */
- if (open_input_file(__G)) /* this should never happen, given */
- return PK_NOZIP; /* the stat() test above, but... */
-
--#ifdef DO_SAFECHECK_2GB
-+ /* nacl_io's HTTP FS does not support lseek so this check will fail */
-+#if defined(DO_SAFECHECK_2GB) && !defined(__native_client__)
- /* Need more care: Do not trust the size returned by stat() but
- determine it by reading beyond the end of the file. */
- G.ziplen = file_size(G.zipfd);
-diff --git a/unix/unix.c b/unix/unix.c
---- a/unix/unix.c
-+++ b/unix/unix.c
-@@ -1242,6 +1242,11 @@ void close_outfile(__G) /* GRR: change to return PK-style warning level */
- fclose(G.outfile);
- #endif /* !NO_FCHOWN && !NO_FCHMOD */
-
-+ /*
-+ * TODO(bradnelson): Remove this once utime work under newlib.
-+ * See: crbug.com/387487
-+ */
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- /* skip restoring time stamps on user's request */
- if (uO.D_flag <= 1) {
- /* set the file's access and modification times */
-@@ -1254,6 +1259,7 @@ void close_outfile(__G) /* GRR: change to return PK-style warning level */
- strerror(errno)));
- }
- }
-+#endif
-
- #if (defined(NO_FCHOWN) || defined(NO_FCHMOD))
- /*---------------------------------------------------------------------------
-diff --git a/unix/unxcfg.h b/unix/unxcfg.h
---- a/unix/unxcfg.h
-+++ b/unix/unxcfg.h
-@@ -200,7 +200,7 @@ typedef struct stat z_stat;
- #if (!defined(NO_LCHOWN) || !defined(NO_LCHMOD))
- # define SET_SYMLINK_ATTRIBS
- #endif
--#ifdef MTS
-+#if defined(MTS) || defined(__native_client__)
- # ifdef SET_DIR_ATTRIB
- # undef SET_DIR_ATTRIB
- # endif
diff --git a/ports/unzip/pkg_info b/ports/unzip/pkg_info
deleted file mode 100644
index 3c323b9..0000000
--- a/ports/unzip/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=unzip
-VERSION=6.0
-URL=http://download.sf.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.zip
-ARCHIVE_ROOT=unzip60
-DEPENDS=(nacl-spawn)
-LICENSE=CUSTOM:LICENSE
-SHA1=7736e6306f1bb8e51f894ca4670e94181a0f6de3
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/videoproto/pkg_info b/ports/videoproto/pkg_info
deleted file mode 100644
index 748fe7a..0000000
--- a/ports/videoproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=videoproto
-VERSION=2.3.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/videoproto-2.3.1.tar.bz2
-LICENSE=GPL
-SHA1=bb8b366687a7f345e3a8697bac516cb436cbf4b2
diff --git a/ports/vim/background.js b/ports/vim/background.js
deleted file mode 100644
index 7bd1df0..0000000
--- a/ports/vim/background.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-'use strict';
-
-function fsErrorHandler(error) {
- // TODO(sbc): Add popup that tells the user there was an error.
- console.log('Filesystem error: ' + error);
-}
-
-/**
- * Copyies one FileEntry object to another. This is used to copy from
- * the TEMPORARAY filesystem in which the lauched files is edited back
- * to the entry that was passed at launch time.
- */
-function copyFile(srcFile, destFile) {
- console.log('copyFile: ' + srcFile.name + ' -> ' + destFile.name);
-
- srcFile.file(function(file) {
- destFile.createWriter(function(writer) {
- writer.onerror = fsErrorHandler;
- var doneTruncate = false;
- writer.onwriteend = function(e) {
- if (!doneTruncate) {
- console.log('done truncate');
- doneTruncate = true;
- writer.seek(0);
- writer.write(file);
- } else {
- console.log('done write');
- console.log(e);
- }
- };
- writer.truncate(file.size);
- }, fsErrorHandler);
- }, fsErrorHandler);
-}
-
-function saveFile(saveFileEntry) {
- window.webkitRequestFileSystem(window.TEMPORARAY, 0, function(tmpFS) {
- tmpFS.root.getFile(saveFileEntry.name, {create: false},
- function(tmpFileEntry) {
- copyFile(tmpFileEntry, saveFileEntry);
- }
- );
- });
-}
-
-function launchVim(fileEntry) {
- function onWindowCreated(win) {
- win.contentWindow.fileEntryToLoad = fileEntry;
- if (fileEntry) {
- console.log('Lauching vim with item: ' + fileEntry);
- } else {
- console.log('Lauching vim without items');
- }
-
- function onWindowClosed() {
- console.log('onWindowClosed');
-
- if (win.contentWindow.fileEntryToSave) {
- saveFile(win.contentWindow.fileEntryToSave);
- }
- }
-
- win.onClosed.addListener(onWindowClosed);
- }
-
- var props = {
- width: 600,
- height: 600
- };
-
- chrome.app.window.create('vim_app.html', props, onWindowCreated);
-}
-
-function onLaunchedListener(launchData) {
- var fileEntry;
- if (launchData.items) {
- fileEntry = launchData.items[0].entry;
- }
- launchVim(fileEntry);
-}
-
-chrome.app.runtime.onLaunched.addListener(onLaunchedListener);
diff --git a/ports/vim/build.sh b/ports/vim/build.sh
deleted file mode 100644
index 657dabc..0000000
--- a/ports/vim/build.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (c) 2013 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.
-
-BUILD_DIR=${SRC_DIR}
-EXTRA_CONFIGURE_ARGS+="--enable-gui=no --with-tlib=ncurses"
-EXTRA_CONFIGURE_ARGS+=" --prefix=/usr --exec-prefix=/usr"
-EXECUTABLES=src/vim${NACL_EXEEXT}
-EnableCliMain
-
-ConfigureStep() {
- # These settings are required by vim's configure when cross compiling.
- # These are the standard valued detected when configuring for linux/glibc.
- export vim_cv_toupper_broken=no
- export vim_cv_terminfo=yes
- export vim_cv_tty_mode=0620
- export vim_cv_tty_group=world
- export vim_cv_getcwd_broken=no
- export vim_cv_stat_ignores_slash=no
- export vim_cv_memmove_handles_overlap=yes
- export ac_cv_func_getrlimit=no
- if [ "${NACL_DEBUG}" == "1" ]; then
- export STRIP=echo
- else
- export STRIP=${NACLSTRIP}
- fi
- DefaultConfigureStep
- # Vim's build doesn't support building outside the source tree.
- # Do a clean to make rebuild after failure predictable.
- LogExecute make clean
-}
-
-InstallStep() {
- DefaultInstallStep
- LogExecute mv ${INSTALL_DIR}/usr ${INSTALL_DIR}${PREFIX}
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR="${PUBLISH_DIR}/vim"
-
- MakeDir ${ASSEMBLY_DIR}/vimtar/usr
- ChangeDir ${ASSEMBLY_DIR}/vimtar
- LogExecute cp -a ${INSTALL_DIR}${PREFIX}/* ./usr/
- LogExecute cp usr/bin/vim${NACL_EXEEXT} ../vim_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute cp $SRC_DIR/runtime/vimrc_example.vim usr/share/vim/vimrc
- LogExecute rm -rf usr/bin
- LogExecute rm -rf usr/share/man
- tar cf ${ASSEMBLY_DIR}/vim.tar .
- Remove ${ASSEMBLY_DIR}/vimtar
- shasum ${ASSEMBLY_DIR}/vim.tar > ${ASSEMBLY_DIR}/vim.tar.hash
- cd ${ASSEMBLY_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- vim_*${NACL_EXEEXT} \
- -s . \
- -o vim.nmf
- LogExecute python ${TOOLS_DIR}/create_term.py vim.nmf
-
- GenerateManifest ${START_DIR}/manifest.json ${ASSEMBLY_DIR}
- InstallNaClTerm ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/background.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/vim.html ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/vim_app.html ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/vim.js ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_16.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_48.png ${ASSEMBLY_DIR}
- LogExecute cp ${START_DIR}/icon_128.png ${ASSEMBLY_DIR}
- ChangeDir ${PUBLISH_DIR}
- CreateWebStoreZip vim-${VERSION}.zip vim
-}
diff --git a/ports/vim/diff_skip.txt b/ports/vim/diff_skip.txt
deleted file mode 100644
index 1d41c6d..0000000
--- a/ports/vim/diff_skip.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-src/auto/config.h
-src/auto/config.mk
diff --git a/ports/vim/icon_128.png b/ports/vim/icon_128.png
deleted file mode 100644
index 7108a2b..0000000
--- a/ports/vim/icon_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/vim/icon_16.png b/ports/vim/icon_16.png
deleted file mode 100644
index eeadde8..0000000
--- a/ports/vim/icon_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/vim/icon_48.png b/ports/vim/icon_48.png
deleted file mode 100644
index 483b42f..0000000
--- a/ports/vim/icon_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/vim/manifest.json b/ports/vim/manifest.json
deleted file mode 100644
index 03e6b20..0000000
--- a/ports/vim/manifest.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "name": "Vim",
- "description": "Vim console application running using NativeClient",
- "version": "7.4.0.%(version)s",
- "manifest_version": 2,
- "icons": {
- "16": "icon_16.png",
- "48": "icon_48.png",
- "128": "icon_128.png"
- },
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "file_handlers": {
- "edit": {
- "types": [
- "text/*"
- ],
- "extensions": [
- "json",
- "txt",
- "js",
- "html",
- "h",
- "c",
- "cc",
- "cpp",
- "java"
- ],
- "title": "Edit with Vim"
- }
- },
- "permissions": [
- {"fileSystem": ["write"]},
- "clipboardRead",
- "clipboardWrite",
- "storage",
- "unlimitedStorage"
- ]
-}
diff --git a/ports/vim/nacl.patch b/ports/vim/nacl.patch
deleted file mode 100644
index e9dc714..0000000
--- a/ports/vim/nacl.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-diff --git a/src/Makefile b/src/Makefile
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -1737,7 +1737,7 @@ $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h
- sh $(srcdir)/link.sh
-
- xxd/xxd$(EXEEXT): xxd/xxd.c
-- cd xxd; CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
-+ cd xxd; CC="$(CC)" EXEEXT="$(EXEEXT)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
- $(MAKE) -f Makefile
-
- # Build the language specific files if they were unpacked.
-diff --git a/src/auto/configure b/src/auto/configure
---- a/src/auto/configure
-+++ b/src/auto/configure
-@@ -13006,16 +13006,16 @@ $as_echo "yes" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
- $as_echo "no" >&6; }
- fi
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_FORTIFY_SOURCE=1" >&5
--$as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; }
-- if test "$gccmajor" -gt "3"; then
-- CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
--$as_echo "yes" >&6; }
-- else
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
--$as_echo "no" >&6; }
-- fi
-+# { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_FORTIFY_SOURCE=1" >&5
-+#$as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; }
-+# if test "$gccmajor" -gt "3"; then
-+# CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'`
-+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+#$as_echo "yes" >&6; }
-+# else
-+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+#$as_echo "no" >&6; }
-+# fi
- fi
-
-
-diff --git a/src/main.c b/src/main.c
---- a/src/main.c
-+++ b/src/main.c
-@@ -14,6 +14,10 @@
- # include <spawno.h> /* special MS-DOS swapping library */
- #endif
-
-+#ifdef __native_client__
-+#include <nacl_main.h>
-+#endif
-+
- #ifdef __CYGWIN__
- # ifndef WIN32
- # include <cygwin/version.h>
-@@ -165,6 +169,11 @@ main
- int argc;
- char **argv;
- {
-+#ifdef __native_client__
-+ if (nacl_startup_untar(argv[0], "vim.tar", "/"))
-+ return 1;
-+#endif
-+
- char_u *fname = NULL; /* file name from command line */
- mparm_T params; /* various parameters passed between
- * main() and other functions. */
-diff --git a/src/memfile.c b/src/memfile.c
---- a/src/memfile.c
-+++ b/src/memfile.c
-@@ -639,7 +639,8 @@ mf_sync(mfp, flags)
- # endif
- /* OpenNT is strictly POSIX (Benzinger) */
- /* Tandem/Himalaya NSK-OSS doesn't have sync() */
--# if defined(__OPENNT) || defined(__TANDEM)
-+ /* TODO(sbc): remove once nacl_io provides sync() */
-+# if defined(__OPENNT) || defined(__TANDEM) || defined(__native_client__)
- fflush(NULL);
- # else
- sync();
-diff --git a/src/xxd/Makefile b/src/xxd/Makefile
---- a/src/xxd/Makefile
-+++ b/src/xxd/Makefile
-@@ -1,7 +1,7 @@
- # The most simplistic Makefile
-
--xxd: xxd.c
-- $(CC) $(CFLAGS) $(LDFLAGS) -DUNIX -o xxd xxd.c
-+xxd$(EXEEXT): xxd.c
-+ $(CC) $(CFLAGS) $(LDFLAGS) -DUNIX -o xxd$(EXEEXT) xxd.c
-
- clean:
- rm -f xxd xxd.o
diff --git a/ports/vim/pkg_info b/ports/vim/pkg_info
deleted file mode 100644
index 21ad3ce..0000000
--- a/ports/vim/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=vim
-VERSION=7.4
-ARCHIVE_ROOT=vim74
-URL=http://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
-LICENSE=CUSTOM:runtime/doc/uganda.txt
-BUILD_OS=linux
-DEPENDS=(ncurses libtar nacl-spawn)
-# missing 'mblen' and 'sysinfo'
-SHA1=601abf7cc2b5ab186f40d8790e542f86afca86b7
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/vim/vim.html b/ports/vim/vim.html
deleted file mode 100644
index c4499d2..0000000
--- a/ports/vim/vim.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>vim</title>
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="vim.js"></script>
-
- <style type="text/css">
- #terminal {
- width: 90%;
- height: 500px;
- position: relative;
- }
- </style>
- </head>
- <body>
- <h1>Vim for Native Client</h1>
- <label for="infile">Select file to edit: </label>
- <input type="file" id="infile">
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/vim/vim.js b/ports/vim/vim.js
deleted file mode 100644
index ffb0696..0000000
--- a/ports/vim/vim.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2013 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.
- */
-
-/* globals NaClTerm, lib */
-
-'use strict';
-
-NaClTerm.nmf = 'vim.nmf';
-
-function log(message) {
- console.log(message);
-}
-
-function fsErrorHandler(error) {
- // TODO(sbc): Add popup that tells the user there was an error.
- log('Filesystem error: ' + error);
-}
-
-function runVim() {
- NaClTerm.init();
-}
-
-function runVimWithFile(file) {
- log('runVimWithFile: ' + file.name);
- window.tempFS.root.getFile(file.name, {create: true},
- function(fileEntry) {
- window.tmpFileEntry = fileEntry;
- fileEntry.createWriter(function(fileWriter) {
- // Note: write() can take a File or Blob object.
- fileWriter.write(file);
- log('File written to temporary filesystem\n');
- NaClTerm.argv = ['/tmp/' + file.name];
- runVim();
- }, fsErrorHandler);
- }, fsErrorHandler);
-}
-
-function runVimWithFileEntry(fileEntry) {
- window.fileEntryToSave = fileEntry;
- fileEntry.file(function(file) {
- runVimWithFile(file);
- });
-}
-
-function uploadDidChange(event) {
- var file = event.target.files[0];
- runVimWithFile(file);
-}
-
-function onInitFS(fs) {
- log('onInitFS');
- window.tempFS = fs;
-
- // Once the temp filesystem is initialised we launch vim.
- // For packaged apps the fileEntryToLoad attribute will be set if the
- // user launched us with a fileEntry. Otherwise we fallback to asking
- // them using chooseEntry.
- if (window.fileEntryToLoad !== undefined) {
- // We have fileEntry already.
- runVimWithFileEntry(window.fileEntryToLoad);
- } else if (chrome.fileSystem) {
- // We have access the fileSystem API, so ask the user
- // to select a file.
- chrome.fileSystem.chooseEntry(function(fileEntry) {
- if (fileEntry) {
- runVimWithFileEntry(fileEntry);
- } else {
- runVim();
- }
- });
- } else {
- // Fall back to using html file selection.
- var upload = document.getElementById('infile');
- if (upload !== null) {
- upload.addEventListener('change', uploadDidChange, false);
- } else {
- runVim();
- }
- }
-}
-
-function onInit() {
- navigator.webkitPersistentStorage.requestQuota(1024 * 1024,
- function(bytes) {
- window.webkitRequestFileSystem(window.TEMPORARAY, bytes, onInitFS);
- },
- function() {
- log('Failed to allocate space!\n');
- // Start the terminal even if FS failed to init.
- runVim();
- }
- );
-}
-
-window.onload = function() {
- lib.init(function() {
- onInit();
- });
-};
diff --git a/ports/vim/vim_app.html b/ports/vim/vim_app.html
deleted file mode 100644
index bf759f4..0000000
--- a/ports/vim/vim_app.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>vim</title>
- <script type="text/javascript" src="hterm.concat.js"></script>
- <script type="text/javascript" src="pipeserver.js"></script>
- <script type="text/javascript" src="naclprocess.js"></script>
- <script type="text/javascript" src="naclterm.js"></script>
- <script type="text/javascript" src="vim.js"></script>
-
- <style type="text/css">
- body {
- position: absolute;
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- overflow: hidden;
- }
- #terminal {
- display: block;
- position: static;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="terminal"></div>
- </body>
-</html>
diff --git a/ports/wireshark/README.nacl b/ports/wireshark/README.nacl
deleted file mode 100644
index 5b024ab..0000000
--- a/ports/wireshark/README.nacl
+++ /dev/null
@@ -1,4 +0,0 @@
-This port of wireshark builds a modified version of tshark without packet
-capture support. However, it can still be useful for processing raw capture
-files. In this version, the -o option has been overwritten to allow writing
-the text output to an output file instead of the standard output.
diff --git a/ports/wireshark/build.sh b/ports/wireshark/build.sh
deleted file mode 100644
index 1f584c3..0000000
--- a/ports/wireshark/build.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2015 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.
-
-if [ "${TOOLCHAIN}" = "pnacl" -o "${TOOLCHAIN}" = "clang-newlib" ]; then
- export CC_FOR_BUILD=clang
-else
- export CC_FOR_BUILD=gcc
-fi
-
-EnableCliMain
-
-EXECUTABLES="tshark${NACL_EXEEXT}"
-
-EXTRA_CONFIGURE_ARGS="
---enable-extra-compiler-warnings
---disable-wireshark
---disable-editcap
---disable-capinfos
---disable-captype
---disable-mergecap
---disable-reordercap
---disable-text2pcap
---disable-dftest
---disable-randpkt
---disable-dumpcap
---disable-rawshark
---disable-ipv6
---without-gcrypt
---without-plugins
---without-pcap
---without-zlib
---disable-glibtest
---disable-gtktest
-"
diff --git a/ports/wireshark/nacl.patch b/ports/wireshark/nacl.patch
deleted file mode 100644
index 6c689db..0000000
--- a/ports/wireshark/nacl.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-diff --git a/capture-pcap-util.c b/capture-pcap-util.c
-index 2cc7a49..179b83d 100644
---- a/capture-pcap-util.c
-+++ b/capture-pcap-util.c
-@@ -568,7 +568,7 @@ static struct dlt_choice dlt_choices[] = {
- DLT_CHOICE_SENTINEL
- };
-
--#if !defined(HAVE_PCAP_DATALINK_NAME_TO_VAL)
-+#if !defined(__native_client__) && !defined(HAVE_PCAP_DATALINK_NAME_TO_VAL)
- static int
- pcap_datalink_name_to_val(const char *name)
- {
-@@ -583,7 +583,7 @@ pcap_datalink_name_to_val(const char *name)
- }
- #endif /* defined(HAVE_PCAP_DATALINK_NAME_TO_VAL) */
-
--#if !defined(HAVE_PCAP_DATALINK_VAL_TO_NAME)
-+#if !defined(__native_client__) && !defined(HAVE_PCAP_DATALINK_VAL_TO_NAME)
- static const char *
- pcap_datalink_val_to_name(int dlt)
- {
-diff --git a/dumpcap.c b/dumpcap.c
-index bcfd02e..d1ec43c 100644
---- a/dumpcap.c
-+++ b/dumpcap.c
-@@ -808,7 +808,7 @@ set_pcap_linktype(pcap_t *pcap_h, int linktype,
-
- if (linktype == -1)
- return TRUE; /* just use the default */
--#ifdef HAVE_PCAP_SET_DATALINK
-+#if defined(HAVE_PCAP_SET_DATALINK) || defined(__native_client__)
- if (pcap_set_datalink(pcap_h, linktype) == 0)
- return TRUE; /* no error */
- set_linktype_err_str = pcap_geterr(pcap_h);
-diff --git a/epan/filesystem.c b/epan/filesystem.c
-index 053711d..846a614 100644
---- a/epan/filesystem.c
-+++ b/epan/filesystem.c
-@@ -386,6 +386,9 @@ init_progfile_dir(const char *arg0
- * Get the current directory, and combine it
- * with that directory.
- */
-+#ifdef __native_client__
-+ path_max = PATH_MAX;
-+#else
- path_max = pathconf(".", _PC_PATH_MAX);
- if (path_max == -1) {
- /*
-@@ -395,6 +398,7 @@ init_progfile_dir(const char *arg0
- return g_strdup_printf("pathconf failed: %s\n",
- g_strerror(errno));
- }
-+#endif
- curdir = (char *)g_malloc(path_max);
- if (getcwd(curdir, path_max) == NULL) {
- /*
-diff --git a/tshark.c b/tshark.c
-index b366ce5..4a5601a 100644
---- a/tshark.c
-+++ b/tshark.c
-@@ -167,7 +167,12 @@ static void report_counts_siginfo(int);
-
- #else /* HAVE_LIBPCAP */
-
-+#ifdef __native_client__
-+static char *pcap_output_file_name;
-+static char *text_output_file_name;
-+#else
- static char *output_file_name;
-+#endif
-
- #endif /* HAVE_LIBPCAP */
-
-@@ -316,6 +321,11 @@ print_usage(gboolean print_ver)
- fprintf(output, " -x add output of hex and ASCII dump (Packet Bytes)\n");
- fprintf(output, " -T pdml|ps|psml|text|fields\n");
- fprintf(output, " format of text output (def: text)\n");
-+#ifdef __native_client__
-+ fprintf(output, " -o <outfile> write text output to \"outfile\"\n)");
-+ fprintf(output, " (or to the standard output if unspecified)");
-+ fprintf(output, " (note: currently only implemented for psml and pdml)");
-+#endif
- fprintf(output, " -e <field> field to print if -Tfields selected (e.g. tcp.port, col.Info);\n");
- fprintf(output, " this option can be repeated to print multiple fields\n");
- fprintf(output, " -E<fieldsoption>=<value> set options for output when -Tfields selected:\n");
-@@ -340,7 +350,9 @@ print_usage(gboolean print_ver)
- fprintf(output, "Miscellaneous:\n");
- fprintf(output, " -h display this help and exit\n");
- fprintf(output, " -v display version info and exit\n");
-+#ifndef __native_client__
- fprintf(output, " -o <name>:<value> ... override preference setting\n");
-+#endif
- fprintf(output, " -K <keytab> keytab file to use for kerberos decryption\n");
- fprintf(output, " -G [report] dump one of several available reports and exit\n");
- fprintf(output, " default report=\"fields\"\n");
-@@ -1237,7 +1249,11 @@ main(int argc, char *argv[])
- * Output file name, if we're reading a file and writing to another
- * file.
- */
-+#ifdef __native_client__
-+ pcap_output_file_name = optarg;
-+#else
- output_file_name = optarg;
-+#endif
- } else {
- capture_option_specified = TRUE;
- arg_error = TRUE;
-@@ -1361,6 +1377,11 @@ main(int argc, char *argv[])
- return 1;
- }
- break;
-+#ifdef __native_client__
-+ case 'o': /* Write text output to output file */
-+ text_output_file_name = optarg;
-+ break;
-+#else
- case 'o': /* Override preference from command line */
- switch (prefs_set_pref(optarg)) {
-
-@@ -1379,6 +1400,7 @@ main(int argc, char *argv[])
- break;
- }
- break;
-+#endif
- case 'q': /* Quiet */
- quiet = TRUE;
- break;
-@@ -1935,8 +1957,12 @@ main(int argc, char *argv[])
- global_capture_opts.has_autostop_packets ? global_capture_opts.autostop_packets : 0,
- global_capture_opts.has_autostop_filesize ? global_capture_opts.autostop_filesize : 0);
- #else
-+#ifdef __native_client__
-+ err = load_cap_file(&cfile, pcap_output_file_name, out_file_type, out_file_name_res, 0, 0);
-+#else
- err = load_cap_file(&cfile, output_file_name, out_file_type, out_file_name_res, 0, 0);
- #endif
-+#endif
- }
- CATCH(OutOfMemoryError) {
- fprintf(stderr,
-@@ -3364,10 +3390,27 @@ write_preamble(capture_file *cf)
- return print_preamble(print_stream, cf ? cf->filename : NULL);
-
- case WRITE_XML:
-+#ifdef __native_client__
-+ {
-+ FILE * fp;
-+ if (text_output_file_name) {
-+ fp = fopen(text_output_file_name, "w");
-+ } else {
-+ fp = stdout;
-+ }
-+ if (print_details) {
-+ write_pdml_preamble(fp, cf ? cf->filename : NULL);
-+ } else {
-+ write_psml_preamble(fp);
-+ }
-+ fclose(fp);
-+ }
-+#else
- if (print_details)
- write_pdml_preamble(stdout, cf ? cf->filename : NULL);
- else
- write_psml_preamble(stdout);
-+#endif
- return !ferror(stdout);
-
- case WRITE_FIELDS:
-@@ -3639,7 +3682,20 @@ print_packet(capture_file *cf, epan_dissect_t *edt)
- break;
-
- case WRITE_XML:
-+#ifdef __native_client__
-+ {
-+ FILE * fp;
-+ if (text_output_file_name) {
-+ fp = fopen(text_output_file_name, "a+");
-+ } else {
-+ fp = stdout;
-+ }
-+ proto_tree_write_psml(edt, fp);
-+ fclose(fp);
-+ }
-+#else
- proto_tree_write_psml(edt, stdout);
-+#endif
- return !ferror(stdout);
- case WRITE_FIELDS: /*No non-verbose "fields" format */
- g_assert_not_reached();
-@@ -3673,8 +3729,22 @@ print_packet(capture_file *cf, epan_dissect_t *edt)
- break;
-
- case WRITE_XML:
-+#ifdef __native_client__
-+ {
-+ FILE * fp;
-+ if (text_output_file_name) {
-+ fp = fopen(text_output_file_name, "a+");
-+ } else {
-+ fp = stdout;
-+ }
-+ proto_tree_write_pdml(edt, fp);
-+ printf("\n");
-+ fclose(fp);
-+ }
-+#else
- proto_tree_write_pdml(edt, stdout);
- printf("\n");
-+#endif
- return !ferror(stdout);
- case WRITE_FIELDS:
- proto_tree_write_fields(output_fields, edt, &cf->cinfo, stdout);
-@@ -3704,10 +3774,27 @@ write_finale(void)
- return print_finale(print_stream);
-
- case WRITE_XML:
-+#ifdef __native_client__
-+ {
-+ FILE * fp;
-+ if (text_output_file_name) {
-+ fp = fopen(text_output_file_name, "a+");
-+ } else {
-+ fp = stdout;
-+ }
-+ if (print_details) {
-+ write_pdml_finale(fp);
-+ } else {
-+ write_psml_finale(fp);
-+ }
-+ fclose(fp);
-+ }
-+#else
- if (print_details)
- write_pdml_finale(stdout);
- else
- write_psml_finale(stdout);
-+#endif
- return !ferror(stdout);
-
- case WRITE_FIELDS:
diff --git a/ports/wireshark/pkg_info b/ports/wireshark/pkg_info
deleted file mode 100644
index 43b5313..0000000
--- a/ports/wireshark/pkg_info
+++ /dev/null
@@ -1,8 +0,0 @@
-NAME=wireshark
-VERSION=1.10.11
-URL=https://www.wireshark.org/download/src/all-versions/wireshark-1.10.11.tar.bz2
-LICENSE=GPL2
-DISABLED_LIBC=(glibc)
-DEPENDS=(glib nacl-spawn)
-SHA1=f8c75b65d79fc597a7a2468cf01d4e3061997ebf
-DISABLED_TOOLCHAIN=(emscripten pnacl)
diff --git a/ports/x264/build.sh b/ports/x264/build.sh
deleted file mode 100644
index d11f094..0000000
--- a/ports/x264/build.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-BUILD_DIR=${SRC_DIR}
-EXECUTABLES=x264${NACL_EXEEXT}
-EXTRA_CONFIGURE_ARGS="--enable-static --disable-asm --disable-thread"
-
-if [ "${NACL_SHARED}" = "1" ]; then
- EXTRA_CONFIGURE_ARGS+=" --enable-shared"
-fi
-
-ConfigureStep() {
- DefaultConfigureStep
- LogExecute make clean
-}
diff --git a/ports/x264/nacl.patch b/ports/x264/nacl.patch
deleted file mode 100644
index 6ff680b..0000000
--- a/ports/x264/nacl.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff --git a/common/cpu.c b/common/cpu.c
---- a/common/cpu.c
-+++ b/common/cpu.c
-@@ -93,7 +93,7 @@ const x264_cpu_name_t x264_cpu_names[] =
- {"", 0},
- };
-
--#if (ARCH_PPC && SYS_LINUX) || (ARCH_ARM && !HAVE_NEON)
-+#if (ARCH_PPC && SYS_LINUX) || (ARCH_ARM && HAVE_ARMV6 && !HAVE_NEON)
- #include <signal.h>
- #include <setjmp.h>
- static sigjmp_buf jmpbuf;
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -547,6 +547,16 @@ case $host_os in
- LDFLAGSCLI="$LDFLAGSCLI -lshell32"
- [ $compiler = GNU ] && RC="${RC-${cross_prefix}windres}" || RC="${RC-rc}"
- ;;
-+ *nacl*)
-+ SYS="NACL"
-+ define HAVE_MALLOC_H
-+ if [[ $(basename ${CC}) =~ pnacl-* ]]; then
-+ EXE=.pexe
-+ else
-+ EXE=.nexe
-+ fi
-+ libm="-lm"
-+ ;;
- sunos*|solaris*)
- SYS="SunOS"
- define HAVE_MALLOC_H
-@@ -773,11 +783,14 @@ ASFLAGS="$ASFLAGS -DSTACK_ALIGNMENT=$stack_alignment"
- if [ $compiler = GNU ]; then
- echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
- $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
-+ # there is no pnacl-strings binary.
-+ if [[ ! $(basename ${CC}) =~ pnacl-* ]]; then
- if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then
- define WORDS_BIGENDIAN
- elif !(${cross_prefix}strings -a conftest.o | grep -q EGIB && ${cross_prefix}strings -a conftest.o | grep -q naidnePF) ; then
- die "endian test failed"
- fi
-+ fi
- fi
-
- # autodetect options that weren't forced nor disabled
diff --git a/ports/x264/pkg_info b/ports/x264/pkg_info
deleted file mode 100644
index 12515de..0000000
--- a/ports/x264/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=x264
-VERSION=snapshot-20140829-2245-stable
-URL=http://downloads.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20140829-2245-stable.tar.bz2
-LICENSE=GPL2
-SHA1=3c749f5264b1eb5913fbe5a2182167d388628d83
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/xaos/build.sh b/ports/xaos/build.sh
deleted file mode 100644
index 4a258f8..0000000
--- a/ports/xaos/build.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-# 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.
-
-EXECUTABLES=bin/xaos
-NACL_CPPFLAGS+=" -D__NO_MATH_INLINES=1"
-
-# xaos does not work with a build dir which is separate from the src dir
-BUILD_DIR=${SRC_DIR}
-
-NACLPORTS_LDFLAGS+=" -Wl,--undefined=PPP_GetInterface \
- -Wl,--undefined=PPP_ShutdownModule \
- -Wl,--undefined=PPP_InitializeModule \
- -Wl,--undefined=original_main"
-
-NACLPORTS_LIBS="-lppapi -lpthread -l${NACL_CXX_LIB} -lm"
-
-PatchStep() {
- DefaultPatchStep
- echo "copy nacl driver"
- cp -r "${START_DIR}/nacl-ui-driver" "${SRC_DIR}/src/ui/ui-drv/nacl"
-}
-
-ConfigureStep() {
- # xaos takes care of defining NDEBUG itself
- NACLPORTS_CFLAGS="${NACLPORTS_CFLAGS/-DNDEBUG/}"
-
- echo "running autoconf"
- LogExecute rm ./configure
- LogExecute autoconf
-
- SetupCrossEnvironment
- LogExecute ./configure --with-png=no --with-long-double=no \
- --host=nacl --with-x11-driver=no --with-sffe=no
-}
-
-BuildStep() {
- SetupCrossEnvironment
- DefaultBuildStep
-}
-
-InstallStep() {
- return
-}
-
-PublishStep() {
- MakeDir ${PUBLISH_DIR}
- LogExecute install ${START_DIR}/xaos.html ${PUBLISH_DIR}
- LogExecute install ${BUILD_DIR}/bin/xaos \
- ${PUBLISH_DIR}/xaos_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute install ${BUILD_DIR}/help/xaos.hlp ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- xaos*${NACL_EXEEXT} -s . -o xaos.nmf
-}
diff --git a/ports/xaos/nacl-ui-driver/Makefile.in b/ports/xaos/nacl-ui-driver/Makefile.in
deleted file mode 100644
index ad5b1b9..0000000
--- a/ports/xaos/nacl-ui-driver/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-CC = @CC@
-CFLAGS = @CFLAGS@
-LIBS = @LIBS@ -lm
-LFLAGS = @LDFLAGS@
-#AR = @AR@
-RANLIB = @RANLIB@
-
-SRCS = ui_nacl.c ppapi.c
-
-OBJS = $(SRCS:.c=.o)
-
-TLIB = @LIBPATH@/libuinacl.a
-
-
-all: $(TLIB)
-
-$(TLIB):$(OBJS)
- rm -f $@
- $(AR) rc $@ $^
- $(RANLIB) $@
-
-clean:
- rm -f $(TLIB)
- rm -f *.[oas]
- rm -f *~
- rm -f core
-
-distclean:clean
- rm Makefile
-
-#dep:
-# rm -f .depend
-# make .depend
-#
-#.depend:
-# echo '# Program dependencies' >.depend
-# gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(OBJS)) >>.depend
-#
-#include .depend
diff --git a/ports/xaos/nacl-ui-driver/ppapi.c b/ports/xaos/nacl-ui-driver/ppapi.c
deleted file mode 100644
index ed3673e..0000000
--- a/ports/xaos/nacl-ui-driver/ppapi.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (c) 2011 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.
- */
-#include "aconfig.h"
-
-/*includes */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pthread.h>
-
-#include "ppapi/c/pp_completion_callback.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_module.h"
-#include "ppapi/c/pp_point.h"
-#include "ppapi/c/pp_var.h"
-
-#include "ppapi/c/ppb.h"
-#include "ppapi/c/ppb_core.h"
-#include "ppapi/c/ppb_input_event.h"
-#include "ppapi/c/ppb_graphics_2d.h"
-#include "ppapi/c/ppb_image_data.h"
-#include "ppapi/c/ppb_instance.h"
-#include "ppapi/c/ppb_view.h"
-
-#include "ppapi/c/ppp.h"
-#include "ppapi/c/ppp_input_event.h"
-#include "ppapi/c/ppp_instance.h"
-
-#include "ui_nacl.h"
-
-#define kMaxEvents 1024
-/* chrome cananot handle all that many refreshs */
-#define kRefreshInterval 40
-
-static struct {
- pthread_mutex_t mutex;
- pthread_cond_t condvar;
- int tail;
- int num;
- struct PpapiEvent* queue[kMaxEvents];
-} EventQueue;
-
-static struct {
- pthread_mutex_t flush_mutex;
- int width;
- int height;
-
- void* image_data;
- /* TODO make this atomic */
- int dirty;
- PP_Resource image;
- PP_Resource device;
-} Video;
-
-/* zero initialized */
-static struct {
- PPB_Core* if_core;
- PPB_Graphics2D* if_graphics_2d;
- PPB_ImageData* if_image_data;
- PPB_InputEvent* if_input_event;
- PPB_Instance* if_instance;
- PPB_MouseInputEvent* if_mouse_input_event;
- PPB_View* if_view;
-
- PP_Module module;
- PP_Instance instance;
- pthread_t tid;
- int num_instances;
- int num_viewchanges;
-} Global;
-
-int GetWidth() {
- return Video.width;
-}
-
-int GetHeight() {
- return Video.height;
-}
-
-extern int original_main(int argc, char* argv[]);
-
-static void* ThreadForRunningXaosMain(void* arg) {
- char* argv[] = {"xaos", 0};
- NaClLog(LOG_INFO, "Xaos main started\n");
- original_main(1, argv);
- NaClLog(LOG_INFO, "Xaos main stopped\n");
- return 0;
-}
-
-extern struct PP_CompletionCallback ScreenUpdateCallback;
-
-static void ScheduleScreenRefresh() {
- Global.if_core->CallOnMainThread(kRefreshInterval, ScreenUpdateCallback, 0);
-}
-
-static void FlushCallbackFun(void* user_data, int32_t result) {
- /* it is now safe to use the video buffer */
- Video.dirty = 0;
- pthread_mutex_unlock(&Video.flush_mutex);
- ScheduleScreenRefresh();
-}
-
-void CopyImageDataToVideo(void* data) {
- pthread_mutex_lock(&Video.flush_mutex);
- Video.dirty = 1;
- memcpy(Video.image_data, data, Video.width * Video.height * BYTES_PER_PIXEL);
-
- /* Set alpha to 0xff. xaos generates zeros here */
- int* pixels = (int*)Video.image_data;
- int i;
- for (i = 0; i < Video.width * Video.height; i++) {
- pixels[i] |= 0xff000000;
- }
-
- /* do not let anybody write into video buffer while flush in progress*/
- pthread_mutex_unlock(&Video.flush_mutex);
-}
-
-struct PP_CompletionCallback FlushCallback = {FlushCallbackFun, NULL};
-
-void ScreenUpdateCallbackFun(void* user_data, int32_t result) {
- if (!Video.dirty) {
- ScheduleScreenRefresh();
- return;
- }
-
- NaClLog(LOG_TRACE, "ScreenUpdateCallbackFun\n");
- pthread_mutex_lock(&Video.flush_mutex);
- struct PP_Point top_left = PP_MakePoint(0, 0);
- Global.if_graphics_2d->PaintImageData(Video.device, Video.image, &top_left,
- NULL);
-
- Global.if_graphics_2d->Flush(Video.device, FlushCallback);
-}
-
-struct PP_CompletionCallback ScreenUpdateCallback = {ScreenUpdateCallbackFun,
- NULL};
-
-static void InitEvents() {
- NaClLog(LOG_INFO, "initialize event queue\n");
- pthread_mutex_init(&EventQueue.mutex, NULL);
- pthread_cond_init(&EventQueue.condvar, NULL);
-}
-
-static void InitScreenRefresh(PP_Instance instance,
- const struct PP_Size* size) {
- NaClLog(LOG_INFO, "initialize screen refresh %dx%d\n", size->width,
- size->height);
- /* NOTE: these limits are not tight but there seem to be some
- not so well documented limitations inside xaos */
- CHECK(size->width <= 640);
- CHECK(size->height <= 480);
-
- Video.width = size->width;
- Video.height = size->height;
-
- NaClLog(LOG_INFO, "create PPAPI graphics device\n");
- Video.device = Global.if_graphics_2d->Create(instance, size, PP_TRUE);
- CHECK(Video.device != 0);
- NaClLog(LOG_INFO, "create PPAPI image");
- CHECK(Global.if_instance->BindGraphics(Global.instance, Video.device));
- Video.image = Global.if_image_data->Create(
- instance, PP_IMAGEDATAFORMAT_BGRA_PREMUL, size, PP_TRUE);
- CHECK(Video.image != 0);
- NaClLog(LOG_INFO, "map image into shared memory\n");
- Video.image_data = (void*)Global.if_image_data->Map(Video.image);
- CHECK(Video.image_data != NULL);
- NaClLog(LOG_INFO, "map is %p\n", Video.image_data);
-
- /* assert some simplifying assumptions */
- struct PP_ImageDataDesc desc;
- Global.if_image_data->Describe(Video.image, &desc);
- CHECK(desc.stride == size->width * BYTES_PER_PIXEL);
-
- pthread_mutex_init(&Video.flush_mutex, NULL);
-
- ScheduleScreenRefresh();
-}
-
-static void Init(PP_Instance instance, const struct PP_Size* size) {
- InitEvents();
- Global.if_input_event->RequestInputEvents(instance,
- PP_INPUTEVENT_CLASS_MOUSE);
- NaClLog(LOG_INFO, "allocate xaos video buffers\n");
- /* HORRIBLE HACK - TO AVOID SOME MEMORY CORRUPTION PROBLEMS */
- malloc(1024 * 1024);
- Global.instance = instance;
- InitScreenRefresh(instance, size);
-
- NaClLog(LOG_INFO, "spawn xaos main thread\n");
- int rv = pthread_create(&Global.tid, NULL, ThreadForRunningXaosMain, 0);
- if (rv != 0) {
- NaClLog(LOG_FATAL, "cannot spawn xaos thread\n");
- }
-}
-
-static PP_Bool DidCreate(PP_Instance instance,
- uint32_t argc,
- const char** argn,
- const char** argv) {
- NaClLog(LOG_INFO, "DidCreate\n");
- if (Global.num_instances != 0) {
- NaClLog(LOG_FATAL, "only one instance supported\n");
- }
- ++Global.num_instances;
-
- return PP_TRUE;
-}
-
-static void DidDestroy(PP_Instance instance) {
- NaClLog(LOG_INFO, "DidDestroy\n");
- /* ignore this for now */
-}
-
-static void DidChangeView(PP_Instance instance, PP_Resource view) {
- ++Global.num_viewchanges;
- struct PP_Rect position;
- Global.if_view->GetRect(view, &position);
-
- const int width = position.size.width;
- const int height = position.size.height;
-
- NaClLog(LOG_INFO, "DidChangeView [%d] %d %d\n", Global.num_viewchanges, width,
- height);
-
- if (Global.num_viewchanges > 1) {
- NaClLog(LOG_INFO, "only first view change has any effect\n");
- return;
- }
-
- Init(instance, &position.size);
-}
-
-static void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) {
- NaClLog(LOG_INFO, "DidChangeFocus\n");
- /* force a refresh */
- Video.dirty = 1;
-}
-
-static PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource input_event) {
- NaClLog(LOG_TRACE, "HandleInputEvent\n");
- if (!Global.if_mouse_input_event->IsMouseInputEvent(input_event)) {
- return PP_FALSE;
- }
-
- // XaoS has problems with Buttons numbered higher than the right button
- if (Global.if_mouse_input_event->GetButton(input_event) > 2) {
- return PP_FALSE;
- }
-
- struct PpapiEvent* event = (struct PpapiEvent*)malloc(sizeof *event);
- event->type = Global.if_input_event->GetType(input_event);
- event->button = Global.if_mouse_input_event->GetButton(input_event);
- event->position = Global.if_mouse_input_event->GetPosition(input_event);
- event->clicks = Global.if_mouse_input_event->GetClickCount(input_event);
-
- pthread_mutex_lock(&EventQueue.mutex);
- if (EventQueue.num >= kMaxEvents) {
- NaClLog(LOG_ERROR, "dropping events because of overflow\n");
- } else {
- NaClLog(LOG_TRACE, "queue input event\n");
- int head = (EventQueue.tail + EventQueue.num) % kMaxEvents;
- EventQueue.queue[head] = event;
- ++EventQueue.num;
- if (EventQueue.num >= kMaxEvents)
- EventQueue.num -= kMaxEvents;
- pthread_cond_signal(&EventQueue.condvar);
- }
-
- pthread_mutex_unlock(&EventQueue.mutex);
- return PP_TRUE;
-}
-
-struct PpapiEvent* GetEvent(int wait) {
- struct PpapiEvent* event = NULL;
- pthread_mutex_lock(&EventQueue.mutex);
- if (EventQueue.num == 0 && wait) {
- pthread_cond_wait(&EventQueue.condvar, &EventQueue.mutex);
- }
-
- if (EventQueue.num > 0) {
- event = EventQueue.queue[EventQueue.tail];
- ++EventQueue.tail;
- if (EventQueue.tail >= kMaxEvents)
- EventQueue.tail -= kMaxEvents;
- --EventQueue.num;
- }
- pthread_mutex_unlock(&EventQueue.mutex);
- return event;
-}
-
-static PP_Bool HandleDocumentLoad(PP_Instance instance,
- PP_Resource url_loader) {
- NaClLog(LOG_INFO, "HandleDocumentLoad\n");
- /* ignore this for now */
- return PP_TRUE;
-}
-
-struct PP_Var GetInstanceObject(PP_Instance instance) {
- struct PP_Var var = {PP_VARTYPE_UNDEFINED};
- NaClLog(LOG_INFO, "GetInstanceObject\n");
- /* ignore this for now */
- return var;
-}
-/* ====================================================================== */
-PP_EXPORT int32_t PPP_InitializeModule(PP_Module module_id,
- PPB_GetInterface get_browser_interface) {
- NaClLog(LOG_INFO, "PPP_InitializeModule\n");
- Global.module = module_id;
- Global.if_core = (PPB_Core*)get_browser_interface(PPB_CORE_INTERFACE);
- CHECK(Global.if_core != 0);
- Global.if_instance =
- (PPB_Instance*)get_browser_interface(PPB_INSTANCE_INTERFACE);
- CHECK(Global.if_instance != 0);
- Global.if_image_data =
- (PPB_ImageData*)get_browser_interface(PPB_IMAGEDATA_INTERFACE);
- CHECK(Global.if_image_data != 0);
- Global.if_graphics_2d =
- (PPB_Graphics2D*)get_browser_interface(PPB_GRAPHICS_2D_INTERFACE);
- CHECK(Global.if_graphics_2d != 0);
- Global.if_input_event =
- (PPB_InputEvent*)get_browser_interface(PPB_INPUT_EVENT_INTERFACE);
- CHECK(Global.if_input_event != 0);
- Global.if_mouse_input_event = (PPB_MouseInputEvent*)get_browser_interface(
- PPB_MOUSE_INPUT_EVENT_INTERFACE);
- CHECK(Global.if_input_event != 0);
- Global.if_view = (PPB_View*)get_browser_interface(PPB_VIEW_INTERFACE);
- CHECK(Global.if_view != 0);
- return PP_OK;
-}
-
-PP_EXPORT void PPP_ShutdownModule() {
- NaClLog(LOG_INFO, "PPP_ShutdownModule\n");
-}
-
-static PPP_Instance GlobalInstanceInterface = {DidCreate,
- DidDestroy,
- DidChangeView,
- DidChangeFocus,
- HandleDocumentLoad};
-
-static PPP_InputEvent GlobalInputEventInterface = {HandleInputEvent};
-
-PP_EXPORT const void* PPP_GetInterface(const char* interface_name) {
- NaClLog(LOG_INFO, "PPP_GetInterface\n");
- if (0 == strncmp(PPP_INSTANCE_INTERFACE, interface_name,
- strlen(PPP_INSTANCE_INTERFACE))) {
- return &GlobalInstanceInterface;
- }
- if (0 == strncmp(PPP_INPUT_EVENT_INTERFACE, interface_name,
- strlen(PPP_INPUT_EVENT_INTERFACE))) {
- return &GlobalInputEventInterface;
- }
- return NULL;
-}
diff --git a/ports/xaos/nacl-ui-driver/ui_nacl.c b/ports/xaos/nacl-ui-driver/ui_nacl.c
deleted file mode 100644
index a370a03..0000000
--- a/ports/xaos/nacl-ui-driver/ui_nacl.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2011 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.
- */
-
-#include "aconfig.h"
-#include "fconfig.h"
-
-#include "ui_nacl.h"
-
-/*includes */
-#include <ui.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-char* getcwd(char* buf, size_t size) {
- NaClLog(LOG_INFO, "getcwd\n");
- strcpy(buf, "/tmp");
- return buf;
-}
-
-int kill() {
- NaClLog(LOG_INFO, "kill\n");
- return -1;
-}
-
-#ifdef NDEBUG
-static int log_level = LOG_INFO;
-#else
-static int log_level = LOG_TRACE;
-#endif
-
-void NaClLog(int level, char* fmt, ...) {
- if (level > log_level)
- return;
- va_list ap;
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
-}
-
-struct {
- void* buffers[2];
- int current_buffer;
-} VideoBuffers;
-
-static void nacl_setpalette(ui_palette pal, int start, int end) {
- NaClLog(LOG_INFO, "nacl_setpalette\n");
-}
-
-static void nacl_print(int x, int y, CONST char* text) {
- if (text[0]) {
- NaClLog(LOG_INFO, "nacl_print [%s]\n", text);
- }
-}
-
-static void nacl_flush(void) {
- void* data = VideoBuffers.buffers[VideoBuffers.current_buffer];
- NaClLog(LOG_TRACE, "nacl_flush %d\n", VideoBuffers.current_buffer);
- if (!data)
- return;
- CopyImageDataToVideo(data);
-}
-
-static void nacl_display() {
- NaClLog(LOG_TRACE, "nacl_display\n");
- nacl_flush();
-}
-
-static void nacl_flip_buffers() {
- NaClLog(LOG_TRACE, "nacl_flip_buffers\n");
- VideoBuffers.current_buffer ^= 1;
-}
-
-static void nacl_free_buffers(char* b1, char* b2) {
- NaClLog(LOG_INFO, "nacl_free_buffers\n");
-}
-
-static int nacl_alloc_buffers(char** b1, char** b2) {
- NaClLog(LOG_INFO, "nacl_alloc_buffers\n");
- const int image_byte_size = GetHeight() * GetWidth() * BYTES_PER_PIXEL;
-
- NaClLog(LOG_INFO, "allocate xaos video buffers (size %d)\n", image_byte_size);
- VideoBuffers.buffers[0] = malloc(image_byte_size * 2);
- VideoBuffers.buffers[1] = malloc(image_byte_size * 2);
-
- CHECK(VideoBuffers.buffers[0] != NULL && VideoBuffers.buffers[1] != NULL);
- NaClLog(LOG_INFO, "buffer1 %p\n", VideoBuffers.buffers[0]);
- NaClLog(LOG_INFO, "buffer0 %p\n", VideoBuffers.buffers[1]);
- VideoBuffers.current_buffer = 0;
-
- *b1 = VideoBuffers.buffers[0];
- *b2 = VideoBuffers.buffers[1];
- return GetWidth() * BYTES_PER_PIXEL; /* scanline size */
-}
-
-static void nacl_getsize(int* w, int* h) {
- NaClLog(LOG_INFO, "nacl_getsize %d %d\n", GetWidth(), GetHeight());
- *w = GetWidth();
- *h = GetHeight();
-}
-
-static unsigned ButtonToMask(int button) {
- if (button == 0)
- return BUTTON1;
- if (button == 1)
- return BUTTON2;
- if (button == 2)
- return BUTTON3;
- NaClLog(LOG_ERROR, "unexpected button %d\n", button);
- return 0;
-}
-
-static void nacl_processevents(int wait, int* mx, int* my, int* mb, int* k) {
- static unsigned int mousebuttons = 0;
- static unsigned int mousex = 100;
- static unsigned int mousey = 0;
- static int iflag = 0; /* FIXEM*/
-
- struct PpapiEvent* event = GetEvent(wait);
- if (event != NULL) {
- /* only support mouse events for now */
- switch (event->type) {
- default:
- break;
- case PP_INPUTEVENT_TYPE_MOUSEDOWN:
- mousebuttons |= ButtonToMask(event->button);
- break;
- case PP_INPUTEVENT_TYPE_MOUSEUP:
- mousebuttons &= ~ButtonToMask(event->button);
- break;
- case PP_INPUTEVENT_TYPE_MOUSEMOVE:
- mousex = event->position.x;
- mousey = event->position.y;
- break;
- }
- free(event);
- }
-
- *mx = mousex;
- *my = mousey;
- *mb = mousebuttons;
- *k = iflag;
-}
-
-static void nacl_getmouse(int* x, int* y, int* b) {
- NaClLog(LOG_INFO, "nacl_getmouse\n");
-}
-
-static void nacl_mousetype(int type) {
- NaClLog(LOG_INFO, "nacl_mousetype\n");
-}
-
-/* ====================================================================== */
-
-static int nacl_init() {
- NaClLog(LOG_INFO, "nacl_init\n");
- return 1; /*1 for success 0 for fail */
-}
-
-static void nacl_uninitialise() {
- NaClLog(LOG_INFO, "nacl_uninitialise\n");
-}
-
-static struct params params[] = {
- {"", P_HELP, NULL, "Template driver options:"},
- // {"-flag", P_SWITCH, &variable, "Example flag..."},
- {NULL, 0, NULL, NULL}};
-
-struct ui_driver nacl_driver = {
- "Native Client",
- nacl_init,
- nacl_getsize,
- nacl_processevents,
- nacl_getmouse,
- nacl_uninitialise,
- NULL, /* nacl_set_color, You should implement just one */
- nacl_setpalette, /* nacl_setpalette, of these and add NULL as second */
- nacl_print,
- nacl_display,
- nacl_alloc_buffers,
- nacl_free_buffers,
- nacl_flip_buffers,
- NULL, /* nacl_mousetype. This should be NULL */
- nacl_flush, /* flush */
- 8, /* text width */
- 8, /* text height */
- params, /* params */
- 0, /* flags...see ui.h */
- 0.0, 0.0, /* width/height of screen in centimeters */
- 0, 0, /* resolution of screen for windowed systems */
- UI_TRUECOLOR, /* Image type */
- 0, 255, 255, /* start, end of palette and maximum allocatable */
- 0x00ff0000, /* Rgb mask */
- 0x0000ff00, /* rGb mask */
- 0x000000ff /* rgB mask */
-};
diff --git a/ports/xaos/nacl-ui-driver/ui_nacl.h b/ports/xaos/nacl-ui-driver/ui_nacl.h
deleted file mode 100644
index 46703fe..0000000
--- a/ports/xaos/nacl-ui-driver/ui_nacl.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011 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.
- */
-
-#ifndef UI_NACL_H
-
-#include "ppapi/c/ppb_input_event.h"
-
-
-#define BITS_PER_PIXEL 32
-#define BYTES_PER_PIXEL (BITS_PER_PIXEL/8)
-
-/* Get screen width and height */
-int GetWidth();
-int GetHeight();
-
-/* flush video buffer to screen */
-void CopyImageDataToVideo(void* data);
-
-
-struct PpapiEvent {
- PP_InputEvent_Type type;
- PP_InputEvent_MouseButton button;
- struct PP_Point position;
- int clicks;
-};
-
-/* get next ppapi event to process, may block if wait == 1 */
-struct PpapiEvent* GetEvent(int wait);
-
-#define CHECK(cond) do { \
- if (!(cond)) { fputs("ABORT: " #cond "\n", stderr); abort(); } \
-} while(0)
-
-#define LOG_TRACE 3
-#define LOG_INFO 2
-#define LOG_ERROR 1
-#define LOG_FATAL 0
-
-void NaClLog(int level, char* fmt, ...);
-
-#endif /* UI_NACL_H */
diff --git a/ports/xaos/nacl.patch b/ports/xaos/nacl.patch
deleted file mode 100644
index 3c85263..0000000
--- a/ports/xaos/nacl.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -42,6 +42,7 @@ x11_linked=no
- x_driver_test=yes
- gtk_driver_test=no
- aa_driver_test=no
-+nacl_driver_test=yes
- win32_driver_test=yes
- long_double=yes
- pthread=no
-@@ -231,6 +232,10 @@ AC_DEFUN([AC_AALIB], [
- ])
-
-
-+if test "$nacl_driver_test" = yes; then
-+ nacl_driver=true
-+fi
-+
- if test "$aa_driver_test" = yes; then
- OLDLIBS="$LIBS"
- OLDCFLAGS="$CFLAGS"
-@@ -372,6 +377,16 @@ if test "x$aa_driver" = xtrue; then
- fi
- fi
-
-+if test "$nacl_driver_test" = yes; then
-+if test "x$nacl_driver" = xtrue; then
-+ drivers=yes
-+ AC_DEFINE(NACL_DRIVER)
-+ DRIVERDIRS="$DRIVERDIRS ui/ui-drv/nacl"
-+ DRIVERLIBS="$DRIVERLIBS lib/libuinacl.a"
-+ echo " nacl-lib"
-+fi
-+fi
-+
- if test "$gtk_driver_test" = yes; then
- if test "x$gtk_driver" = xtrue; then
- drivers=yes
-@@ -490,6 +505,7 @@ AC_CONFIG_FILES([src/i18n/Makefile.in
- Makefile src/Makefile src/i18n/Makefile src/engine/Makefile
- src/util/Makefile src/ui/Makefile src/filter/Makefile src/ui-hlp/Makefile
- src/ui/ui-drv/aa/Makefile
-+ src/ui/ui-drv/nacl/Makefile
- src/ui/ui-drv/x11/Makefile src/ui/ui-drv/win32/Makefile
- doc/Makefile help/Makefile src/ui/ui-drv/gtk/Makefile src/sffe/Makefile
- ])
-diff --git a/src/include/config/config.autoconf b/src/include/config/config.autoconf
---- a/src/include/config/config.autoconf
-+++ b/src/include/config/config.autoconf
-@@ -2,6 +2,14 @@
- #define CONFIG_H
- #define HOMEDIR
-
-+#ifdef __native_client__
-+#define HAVE_GETTIMEOFDAY 1
-+#define HAVE_UNISTD_H 1
-+#define HAVE_UNISTD_H 1
-+#define MAIN_FUNCTION original_main
-+#define NOASSEMBLY
-+#endif
-+
- #ifdef __BEOS__
- #define MAIN_FUNCTION be_main
- #ifdef __POWERPC__
-diff --git a/src/ui/drivers.c b/src/ui/drivers.c
---- a/src/ui/drivers.c
-+++ b/src/ui/drivers.c
-@@ -27,6 +27,7 @@ extern const struct ui_driver svga_driver, x11_driver, dog_driver,
- osx_fullscreen_driver, os2vio_driver, cocoa_driver, qt_driver,
- cocoa_fullscreen_driver, be_driver, be_direct_driver, be_screen_driver,
- aalib_driver, gtk_driver, ggi_driver, win32_driver, dxw_driver,
-+ nacl_driver,
- dxf_driver, DGA_driver;
- const struct ui_driver *const drivers[] = {
- #ifdef WIN32_DRIVER
-@@ -36,6 +37,9 @@ const struct ui_driver *const drivers[] = {
- &dxw_driver,
- &dxf_driver,
- #endif
-+// #ifdef NACL_DRIVER
-+ &nacl_driver,
-+//#endif
- #ifdef SVGA_DRIVER
- &svga_driver,
- #endif
-diff --git a/src/util/timers.c b/src/util/timers.c
---- a/src/util/timers.c
-+++ b/src/util/timers.c
-@@ -220,6 +220,7 @@ static int plan9_msec(void)
- #ifndef HAVE_FTIME
- #ifndef _plan9_
- #ifndef _MAC
-+#ifndef __native_client__
- #error I am unable to get time in milisecond. Please edit timers.c and make tl_update_time and tl_lookup_timer to work for your architecture and send me then back(to hubicka@paru.cas.cz). You will need also define timers.h and change type of lasttime.
- #endif
- #endif
-@@ -227,6 +228,7 @@ static int plan9_msec(void)
- #endif
- #endif
- #endif
-+#endif
-
-
- #ifdef USE_ALLEGRO
diff --git a/ports/xaos/pkg_info b/ports/xaos/pkg_info
deleted file mode 100644
index 470f305..0000000
--- a/ports/xaos/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=xaos
-VERSION=3.6
-URL=http://downloads.sf.net/xaos/xaos-3.6.tar.gz
-LICENSE=GPL
-SHA1=0c68d25c4f9c8eaf557e37d9e4586a04ab56d7a0
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/xaos/xaos.html b/ports/xaos/xaos.html
deleted file mode 100644
index a3a5aba..0000000
--- a/ports/xaos/xaos.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
- <!--
- Copyright (c) 2011 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.
- -->
- <head>
- <title>XaoS NativeClient Demo</title>
- </head>
- <body>
- <h1>Xaos NativeClient Demo</h1>
-
- <!-- Note xaos seems to have problems with larger dimension -->
- <embed
- width=640
- height=480
- src="xaos.nmf"
- type="application/x-nacl" />
-
- <p>
- This is fairly rough port of Xaos - only mouse events are supported.
- <br />
- Left button zooms in, right button zooms out.
- </p>
- <p>
- XaoS is a GPL'ed open source project:
- <a href="http://matek.hu/xaos/doku.php?id=documentation:manual:gpl"> license</a>,
- <a href="http://matek.hu/xaos/doku.php?id=downloads:main">
- source</a>.
- </p>
- The patches used to create this demo can be found
- <a href="https://chromium.googlesource.com/webports/+/master/ports/xaos">
- here</a>.
- </body>
-</HTML>
diff --git a/ports/xbitmaps/build.sh b/ports/xbitmaps/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/xbitmaps/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/xbitmaps/pkg_info b/ports/xbitmaps/pkg_info
deleted file mode 100644
index 493a53c..0000000
--- a/ports/xbitmaps/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=xbitmaps
-VERSION=1.1.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/xbitmaps-1.1.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-SHA1=578afff7e4912192b524c25254cf7f54c16e57d8
diff --git a/ports/xcb-proto/pkg_info b/ports/xcb-proto/pkg_info
deleted file mode 100644
index 2cf4f22..0000000
--- a/ports/xcb-proto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=xcb-proto
-VERSION=1.7.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/xcb-proto-1.7.1.tar.bz2
-LICENSE=GPL
-SHA1=82a568559235fc6e26d0a38911c5ea18f8e8455c
diff --git a/ports/xcb-util/build.sh b/ports/xcb-util/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/xcb-util/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/xcb-util/pkg_info b/ports/xcb-util/pkg_info
deleted file mode 100644
index c214ad9..0000000
--- a/ports/xcb-util/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=xcb-util
-VERSION=0.3.9
-URL=http://xcb.freedesktop.org/dist/xcb-util-0.3.9.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat libxcb)
-SHA1=02060d8e2e70838fc41cd3a27c7f2909090d8c20
diff --git a/ports/xcmiscproto/pkg_info b/ports/xcmiscproto/pkg_info
deleted file mode 100644
index d11ca70..0000000
--- a/ports/xcmiscproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=xcmiscproto
-VERSION=1.2.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/xcmiscproto-1.2.2.tar.bz2
-LICENSE=GPL
-SHA1=59ae9ec6414964440bf654b207618e5dd66a32fb
diff --git a/ports/xextproto/pkg_info b/ports/xextproto/pkg_info
deleted file mode 100644
index b1ef24b..0000000
--- a/ports/xextproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=xextproto
-VERSION=7.2.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/xextproto-7.2.1.tar.bz2
-LICENSE=GPL
-SHA1=f969e02009adf2d51fd1ba4583a859984728a461
diff --git a/ports/xeyes/build.sh b/ports/xeyes/build.sh
deleted file mode 100644
index 270be22..0000000
--- a/ports/xeyes/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2014 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.
-
-NACLPORTS_LIBS="-lSM -lICE -lxcb -lXau"
-
-EnableCliMain
-EnableGlibcCompat
diff --git a/ports/xeyes/pkg_info b/ports/xeyes/pkg_info
deleted file mode 100644
index 4d5da63..0000000
--- a/ports/xeyes/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=xeyes
-VERSION=1.0.1
-URL=http://xorg.freedesktop.org/releases/individual/app/xeyes-1.0.1.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat nacl-spawn libx11 libxt libxext libxmu)
-SHA1=49dea108cb2a825e5dfd517d34dd2a4d1608ccbc
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/xfonts/build.sh b/ports/xfonts/build.sh
deleted file mode 100644
index 3e33479..0000000
--- a/ports/xfonts/build.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) 2014 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.
-
-BuildStep() {
- return
-}
-
-InstallStep() {
- MakeDir ${PUBLISH_DIR}
- ChangeDir ${PUBLISH_DIR}
-
- LogExecute rm -rf share
- MakeDir share/fonts
- LogExecute cp -fR ${NACL_PREFIX}/share/fonts ${PUBLISH_DIR}/share/
- for dir in $(find ${PUBLISH_DIR}/share/fonts/X11 -type d); do
- LogExecute mkfontscale "$dir"
- LogExecute mkfontdir "$dir"
- done
-
- LogExecute tar cf xorg-fonts.tar share/
- LogExecute shasum xorg-fonts.tar > xorg-fonts.tar.hash
-
- # Generate Fontconfig files
- if [ ${TOOLCHAIN} != "pnacl" ]; then
- local CACHE_OUT_DIR="${PUBLISH_DIR}/${NACL_ARCH}"
- MakeDir ${CACHE_OUT_DIR}/webports-dummydir/var/cache/fontconfig/
- ChangeDir ${CACHE_OUT_DIR}
- LogExecute ${NACL_SDK_ROOT}/tools/sel_ldr.py --\
- ${NACL_PREFIX}/bin/fc-cache${NACL_EXEEXT} -sfv ./share/fonts\
- -y ${CACHE_OUT_DIR}
- LogExecute tar -cf xorg-fonts-cache-${NACL_ARCH}.tar webports-dummydir/
- LogExecute shasum xorg-fonts-cache-${NACL_ARCH}.tar >\
- xorg-fonts-cache-${NACL_ARCH}.tar.hash
- LogExecute rm -rf webports-dummydir
- fi
-
- LogExecute rm -rf share
-}
diff --git a/ports/xfonts/pkg_info b/ports/xfonts/pkg_info
deleted file mode 100644
index 6a1bfd8..0000000
--- a/ports/xfonts/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=xfonts
-VERSION=0.1
-# Disabled on OSX due to lack of mkfontdir (affecting all the fonts).
-BUILD_OS=linux
-DEPENDS=(font-adobe-75dpi font-adobe-100dpi font-adobe-utopia-75dpi font-adobe-utopia-100dpi font-adobe-utopia-type1 font-alias font-bh-75dpi font-bh-100dpi font-bh-lucidatypewriter-75dpi font-bh-lucidatypewriter-100dpi font-bh-ttf font-bh-type1 font-bitstream-75dpi font-bitstream-100dpi font-bitstream-type1 font-cronyx-cyrillic font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 font-isas-misc font-jis-misc font-micro-misc font-misc-cyrillic font-misc-ethiopic font-misc-meltho font-misc-misc font-mutt-misc font-schumacher-misc font-screen-cyrillic font-sony-misc font-sun-misc font-util font-winitzki-cyrillic font-xfree86-type1 fontconfig)
-# Disabled on glibc/arm because of an issue running fc-cache.nexe under sel_ldr.py
-DISABLED_TOOLCHAIN=(emscripten glibc/arm)
diff --git a/ports/xineramaproto/pkg_info b/ports/xineramaproto/pkg_info
deleted file mode 100644
index b73935a..0000000
--- a/ports/xineramaproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=xineramaproto
-VERSION=1.2.1
-URL=http://www.x.org/releases/X11R7.7/src/everything/xineramaproto-1.2.1.tar.bz2
-LICENSE=GPL
-SHA1=818bffc16139d6e3de4344c83f00c495d3536753
diff --git a/ports/xkbcomp/build.sh b/ports/xkbcomp/build.sh
deleted file mode 100644
index 86c5b7c..0000000
--- a/ports/xkbcomp/build.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXTRA_CONFIGURE_ARGS+=" --datarootdir=/share"
-
-NACLPORTS_LIBS+=" -lX11 -lxcb -lXau"
-
-EnableCliMain
-EnableGlibcCompat
-
-InstallStep() {
- DefaultInstallStep
- LogExecute mv ${DESTDIR}/share ${DESTDIR}${PREFIX}/
-}
diff --git a/ports/xkbcomp/nacl.patch b/ports/xkbcomp/nacl.patch
deleted file mode 100644
index 796e91e..0000000
--- a/ports/xkbcomp/nacl.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/xkbcomp.c b/xkbcomp.c
---- a/xkbcomp.c
-+++ b/xkbcomp.c
-@@ -873,6 +873,10 @@ GetDisplay(char *program, char *dpyName)
- extern int yydebug;
- #endif
-
-+#if defined(__native_client__)
-+# include "nacl_main.h"
-+#endif
-+
- int
- main(int argc, char *argv[])
- {
-@@ -883,6 +887,11 @@ main(int argc, char *argv[])
- XkbFileInfo result;
- Status status;
-
-+#if defined(__native_client__)
-+ /* Attempt to untar xorg stuff if available. */
-+ nacl_startup_untar(argv[0], "xorg-xkb.tar", "/");
-+#endif
-+
- yyin = stdin;
- uSetEntryFile(NullString);
- uSetDebugFile(NullString);
diff --git a/ports/xkbcomp/pkg_info b/ports/xkbcomp/pkg_info
deleted file mode 100644
index b0f71f1..0000000
--- a/ports/xkbcomp/pkg_info
+++ /dev/null
@@ -1,10 +0,0 @@
-NAME=xkbcomp
-VERSION=1.2.4
-URL=http://www.x.org/releases/X11R7.7/src/everything/xkbcomp-1.2.4.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat nacl-spawn libx11 libxkbfile xproto libxcb libxau)
-# TODO(bradnelson): Fix it.
-# Disabled on OSX, doesn't build.
-BUILD_OS=linux
-SHA1=695d2f2824884d9e54aa1419282ae167fdea163b
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/xkeyboard-config/build.sh b/ports/xkeyboard-config/build.sh
deleted file mode 100644
index 334bcb8..0000000
--- a/ports/xkeyboard-config/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EXTRA_CONFIGURE_ARGS="--disable-runtime-deps"
diff --git a/ports/xkeyboard-config/nacl.patch b/ports/xkeyboard-config/nacl.patch
deleted file mode 100644
index ba1bda8..0000000
--- a/ports/xkeyboard-config/nacl.patch
+++ /dev/null
@@ -1,505 +0,0 @@
-diff --git a/keycodes/xfree86 b/keycodes/xfree86
---- a/keycodes/xfree86
-+++ b/keycodes/xfree86
-@@ -3,9 +3,9 @@
-
- default xkb_keycodes "xfree86" {
- include "xfree86(basic)"
-- <BKSL> = 51;
-+ <BKSL> = 220;
- alias <AC12> = <BKSL>;
-- <LSGT> = 94;
-+ //<LSGT> = 94;
- };
-
- xkb_keycodes "basic" {
-@@ -13,363 +13,134 @@ xkb_keycodes "basic" {
- minimum= 8;
- maximum= 255;
-
-- <TLDE> = 49;
-+ <TLDE> = 192;
- alias <AE00> = <TLDE>; // Some geometries use AE00
-- <AE01> = 10;
-- <AE02> = 11;
-- <AE03> = 12;
-- <AE04> = 13;
-- <AE05> = 14;
-- <AE06> = 15;
-- <AE07> = 16;
-- <AE08> = 17;
-- <AE09> = 18;
-- <AE10> = 19;
-- <AE11> = 20;
-- <AE12> = 21;
-- <BKSP> = 22;
--
-- <TAB> = 23;
-- <AD01> = 24;
-- <AD02> = 25;
-- <AD03> = 26;
-- <AD04> = 27;
-- <AD05> = 28;
-- <AD06> = 29;
-- <AD07> = 30;
-- <AD08> = 31;
-- <AD09> = 32;
-- <AD10> = 33;
-- <AD11> = 34;
-- <AD12> = 35;
-- <RTRN> = 36;
--
-- <CAPS> = 66;
-- <AC01> = 38;
-- <AC02> = 39;
-- <AC03> = 40;
-- <AC04> = 41;
-- <AC05> = 42;
-- <AC06> = 43;
-- <AC07> = 44;
-- <AC08> = 45;
-- <AC09> = 46;
-- <AC10> = 47;
-- <AC11> = 48;
--
-- <LFSH> = 50;
-- <AB01> = 52;
-- <AB02> = 53;
-- <AB03> = 54;
-- <AB04> = 55;
-- <AB05> = 56;
-- <AB06> = 57;
-- <AB07> = 58;
-- <AB08> = 59;
-- <AB09> = 60;
-- <AB10> = 61;
-- <RTSH> = 62;
--
-- <LALT> = 64;
-- <LCTL> = 37;
-- <SPCE> = 65;
-- <RCTL> = 109;
-- <RALT> = 113;
-+ <AE01> = 49;
-+ <AE02> = 50;
-+ <AE03> = 51;
-+ <AE04> = 52;
-+ <AE05> = 53;
-+ <AE06> = 54;
-+ <AE07> = 55;
-+ <AE08> = 56;
-+ <AE09> = 57;
-+ <AE10> = 48;
-+ <AE11> = 189;
-+ <AE12> = 187;
-+ <BKSP> = 8;
-+
-+ <TAB> = 9;
-+ <AD01> = 81;
-+ <AD02> = 87;
-+ <AD03> = 69;
-+ <AD04> = 82;
-+ <AD05> = 84;
-+ <AD06> = 89;
-+ <AD07> = 85;
-+ <AD08> = 73;
-+ <AD09> = 79;
-+ <AD10> = 80;
-+ <AD11> = 219;
-+ <AD12> = 221;
-+ <RTRN> = 13;
-+
-+ <CAPS> = 20;
-+ <AC01> = 65;
-+ <AC02> = 83;
-+ <AC03> = 68;
-+ <AC04> = 70;
-+ <AC05> = 71;
-+ <AC06> = 72;
-+ <AC07> = 74;
-+ <AC08> = 75;
-+ <AC09> = 76;
-+ <AC10> = 186;
-+ <AC11> = 222;
-+
-+ <LFSH> = 16;
-+ <AB01> = 90;
-+ <AB02> = 88;
-+ <AB03> = 67;
-+ <AB04> = 86;
-+ <AB05> = 66;
-+ <AB06> = 78;
-+ <AB07> = 77;
-+ <AB08> = 188;
-+ <AB09> = 190;
-+ <AB10> = 191;
-+// <RTSH> = 16;
-+
-+ <LALT> = 18;
-+ <LCTL> = 17;
-+ <SPCE> = 32;
-+// <RCTL> = 17;
-+// <RALT> = 18;
- // Microsoft keyboard extra keys
-- <LWIN> = 115;
-- <RWIN> = 116;
-- <MENU> = 117;
--
-- <ESC> = 9;
-- <FK01> = 67;
-- <FK02> = 68;
-- <FK03> = 69;
-- <FK04> = 70;
-- <FK05> = 71;
-- <FK06> = 72;
-- <FK07> = 73;
-- <FK08> = 74;
-- <FK09> = 75;
-- <FK10> = 76;
-- <FK11> = 95;
-- <FK12> = 96;
--
-- <PRSC> = 111;
-- <SYRQ> = 92;
-- <SCLK> = 78;
-- <PAUS> = 110;
-- <BRK> = 114;
--
-- <INS> = 106;
-- <HOME> = 97;
-- <PGUP> = 99;
-- <DELE> = 107;
-- <END> = 103;
-- <PGDN> = 105;
--
-- <UP> = 98;
-- <LEFT> = 100;
-- <DOWN> = 104;
-- <RGHT> = 102;
--
-- <NMLK> = 77;
-- <KPDV> = 112;
-- <KPMU> = 63;
-- <KPSU> = 82;
--
-- <KP7> = 79;
-- <KP8> = 80;
-- <KP9> = 81;
-- <KPAD> = 86;
--
-- <KP4> = 83;
-- <KP5> = 84;
-- <KP6> = 85;
--
-- <KP1> = 87;
-- <KP2> = 88;
-- <KP3> = 89;
-- <KPEN> = 108;
--
-- <KP0> = 90;
-- <KPDL> = 91;
-- <KPEQ> = 126;
--
-- <FK13> = 118;
-- <FK14> = 119;
-- <FK15> = 120;
-- <FK16> = 121;
-- <FK17> = 122;
-- <KPDC> = 123;
--
-- // Keys that are generated on Japanese keyboards
--
-- alias <HZTG> = <TLDE>; // Hankaku_Zenkaku toggle
-- <HKTG> = 208; // Hiragana_Katakana toggle
-- <AB11> = 211; // backslash/underscore
-- <XFER> = 129; // Henkan
-- <NFER> = 131; // Muhenkan
-- <AE13> = 133; // Yen
-- <EISU> = 210; // Alphanumeric mode on macintosh
-- <KANA> = 209; // Kana mode on macintosh
--
-- // Keys that are generated on Korean keyboards
--
-- alias <HNGL> = <FK16>; // Hangul Latin toggle
-- alias <HJCV> = <FK17>; // Hangul to Hanja conversion
--
-- // Extended keys that may be generated on "Internet" keyboards.
-- // These are not standardised, hence the meaningless names.
-- // The entries commented out are never generated because the raw codes
-- // in those positions are already used for well-defined keys.
--
-- alias <I01> = <XFER>;
-- <I02> = 130;
-- alias <I03> = <NFER>;
-- <I04> = 132;
-- alias <I05> = <AE13>;
-- <I06> = 134;
-- <I07> = 135;
-- <I08> = 136;
-- <I09> = 137;
-- <I0A> = 138;
-- <I0B> = 139;
-- <I0C> = 140;
-- <I0D> = 141;
-- <I0E> = 142;
-- <I0F> = 143;
-- <I10> = 144;
-- <I11> = 145;
-- <I12> = 146;
-- <I13> = 147;
-- <I14> = 148;
-- <I15> = 149;
-- <I16> = 150;
-- <I17> = 151;
-- <I18> = 152;
-- <I19> = 153;
-- <I1A> = 154;
-- <I1B> = 155;
-- // <I1C> = 156; <META>
-- // <I1D> = 157; <K59>
-- <I1E> = 158;
-- <I1F> = 159;
-- <I20> = 160;
-- <I21> = 161;
-- <I22> = 162;
-- <I23> = 163;
-- <I24> = 164;
-- <I25> = 165;
-- <I26> = 166;
-- <I27> = 167;
-- <I28> = 168;
-- <I29> = 169;
-- // <I2A> = 170; <K5A>
-- <I2B> = 171;
-- <I2C> = 172;
-- <I2D> = 173;
-- <I2E> = 174;
-- <I2F> = 175;
-- <I30> = 176;
-- <I31> = 177;
-- <I32> = 178;
-- <I33> = 179;
-- <I34> = 180;
-- // <I35> = 181; <K5B>
-- // <I36> = 182; <K5D>
-- // <I37> = 183; <K5E>
-- // <I38> = 184; <K5F>
-- <I39> = 185;
-- <I3A> = 186;
-- <I3B> = 187;
-- <I3C> = 188;
-- // <I3D> = 189; <K62>
-- // <I3E> = 190; <K63>
-- // <I3F> = 191; <K64>
-- // <I40> = 192; <K65>
-- // <I41> = 193; <K66>
-- <I42> = 194;
-- <I43> = 195;
-- <I44> = 196;
-- <I45> = 197;
-- // <I46> = 198; <K67>
-- // <I47> = 199; <K68>
-- // <I48> = 200; <K69>
-- // <I49> = 201; <K6A>
-- <I4A> = 202;
-- // <I4B> = 203; <K6B>
-- // <I4C> = 204; <K6C>
-- // <I4D> = 205; <K6D>
-- // <I4E> = 206; <K6E>
-- // <I4F> = 207; <K6F>
-- // <I50> = 208; <K70>
-- // <I51> = 209; <K71>
-- // <I52> = 210; <K72>
-- // <I53> = 211; <K73>
-- <I54> = 212;
-- <I55> = 213;
-- <I56> = 214;
-- <I57> = 215;
-- <I58> = 216;
-- <I59> = 217;
-- <I5A> = 218;
-- // <I5B> = 219; <K74>
-- // <I5C> = 220; <K75>
-- // <I5D> = 221; <K76>
-- <I5E> = 222;
-- <I5F> = 223;
-- <I60> = 224;
-- <I61> = 225;
-- <I62> = 226;
-- <I63> = 227;
-- <I64> = 228;
-- <I65> = 229;
-- <I66> = 230;
-- <I67> = 231;
-- <I68> = 232;
-- <I69> = 233;
-- <I6A> = 234;
-- <I6B> = 235;
-- <I6C> = 236;
-- <I6D> = 237;
-- <I6E> = 238;
-- <I6F> = 239;
-- <I70> = 240;
-- <I71> = 241;
-- <I72> = 242;
-- <I73> = 243;
-- <I74> = 244;
-- <I75> = 245;
-- <I76> = 246;
-- <I77> = 247;
-- <I78> = 248;
-- <I79> = 249;
-- <I7A> = 250;
-- <I7B> = 251;
-- <I7C> = 252;
-- <I7D> = 253;
-- <I7E> = 254;
-- <I7F> = 255;
--
-- // MacBooks generate 0x65 for the lower brightness key
-- <II65> = 101;
--
-- // Required for apple/logitech_g15 keyboard
-- <II5D> = 93;
--
-- // Codes generated for scancodes 0x59-0x5f, 0x62-0x76
-- <K59> = 157; // <I1D>
-- <K5A> = 170; // <I2A>
-- <K5B> = 181; // <I35>
-- alias <K5C> = <KPEQ>;
-- <K5D> = 182; // <I36>
-- <K5E> = 183; // <I37>
-- <K5F> = 184; // <I38>
-- <K62> = 189; // <I3D>
-- <K63> = 190; // <I3E>
-- <K64> = 191; // <I3F>
-- <K65> = 192; // <I40>
-- <K66> = 193; // <I41>
-- <K67> = 198; // <I46>
-- <K68> = 199; // <I47>
-- <K69> = 200; // <I48>
-- <K6A> = 201; // <I49>
-- <K6B> = 203; // <I4B>
-- <K6C> = 204; // <I4C>
-- <K6D> = 205; // <I4D>
-- <K6E> = 206; // <I4E>
-- <K6F> = 207; // <I4F>
-- alias <K70> = <HKTG>; // <I50>
-- alias <K71> = <KANA>; // <I51>
-- alias <K72> = <EISU>; // <I52>
-- alias <K73> = <AB11>; // <I53>
-- <K74> = 219; // <I5B>
-- <K75> = 220; // <I5C>
-- <K76> = 221; // <I5D>
--
-- // Solaris compatibility
--
-- alias <LMTA> = <LWIN>;
-- alias <RMTA> = <RWIN>;
-- alias <COMP> = <MENU>;
-- alias <POWR> = <I0C>;
-- alias <MUTE> = <I0D>;
-- alias <VOL-> = <I0E>;
-- alias <VOL+> = <I0F>;
-- alias <HELP> = <I10>;
-- alias <STOP> = <I11>;
-- alias <AGAI> = <I12>;
-- alias <PROP> = <I13>;
-- alias <UNDO> = <I14>;
-- alias <FRNT> = <I15>;
-- alias <COPY> = <I16>;
-- alias <OPEN> = <I17>;
-- alias <PAST> = <I18>;
-- alias <FIND> = <I19>;
-- alias <CUT> = <I1A>;
-- alias <OUTP> = <I56>;
-- alias <KITG> = <I57>;
-- alias <KIDN> = <I58>;
-- alias <KIUP> = <I59>;
--
-- // Other codes never generated. The XFree86 ddx never generates
-- // these codes.
-- // Thus we can use them as fake keys
-- <MDSW> = 8;
-- <LVL3> = 124; // <U7C>
-- <ALT> = 125; // <U7D>
-- <META> = 156; // <I1C>
-- <SUPR> = 127; // <U7F>
-- <HYPR> = 128; // <U80>
--
-- indicator 1 = "Caps Lock";
-- indicator 2 = "Num Lock";
-- indicator 3 = "Scroll Lock";
--
-- alias <ALGR> = <RALT>;
--
-- // For Brazilian ABNT2
-- alias <KPPT> = <I06>;
-+// <LWIN> = 207; // 311;
-+// <RWIN> = 208; // 312;
-+// <MENU> = 209; // 319;
-+
-+ <ESC> = 27;
-+ <FK01> = 112;
-+ <FK02> = 113;
-+ <FK03> = 114;
-+ <FK04> = 115;
-+ <FK05> = 116;
-+ <FK06> = 117;
-+ <FK07> = 118;
-+ <FK08> = 119;
-+ <FK09> = 120;
-+ <FK10> = 121;
-+ <FK11> = 122;
-+ <FK12> = 123;
-+
-+// <PRSC> = 222; // 316;
-+// <SYRQ> = 223; // 317;
-+// <SCLK> = 224; // 302;
-+// <PAUS> = 19;
-+// <BRK> = 225; // 318;
-+
-+// <INS> = 226; // 277;
-+ <HOME> = 36;
-+ <PGUP> = 33;
-+// <DELE> = 229; // 127;
-+ <END> = 35;
-+ <PGDN> = 34;
-+
-+ <UP> = 38;
-+ <LEFT> = 37;
-+ <DOWN> = 40;
-+ <RGHT> = 39;
-+
-+// <NMLK> = 236; // 300;
-+// <KPDV> = 112;
-+// <KPMU> = 63;
-+// <KPSU> = 82;
-+
-+// <KP7> = 79;
-+// <KP8> = 80;
-+// <KP9> = 81;
-+// <KPAD> = 86;
-+
-+// <KP4> = 83;
-+// <KP5> = 84;
-+// <KP6> = 85;
-+
-+// <KP1> = 87;
-+// <KP2> = 88;
-+// <KP3> = 89;
-+// <KPEN> = 108;
-+
-+// <KP0> = 90;
-+// <KPDL> = 91;
-+// <KPEQ> = 126;
-+
-+// <FK13> = 118;
-+// <FK14> = 119;
-+// <FK15> = 120;
-+// <FK16> = 121;
-+// <FK17> = 122;
-+// <KPDC> = 123;
- };
-
- // What keyboard is this?
diff --git a/ports/xkeyboard-config/pkg_info b/ports/xkeyboard-config/pkg_info
deleted file mode 100644
index afae83c..0000000
--- a/ports/xkeyboard-config/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=xkeyboard-config
-VERSION=2.6
-URL=http://www.x.org/releases/X11R7.7/src/everything/xkeyboard-config-2.6.tar.bz2
-LICENSE=GPL
-# No mac support, due to lack of local xkbcomp install.
-BUILD_OS=linux
-SHA1=9a07cf04b1a7a13be7a86ce37c9f7efe1ec5fbc2
diff --git a/ports/xorg-server/Makefile.am b/ports/xorg-server/Makefile.am
deleted file mode 100644
index bdf3160..0000000
--- a/ports/xorg-server/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-INCLUDES = \
- @KDRIVE_PURE_INCS@ \
- @KDRIVE_CFLAGS@
-
-bin_PROGRAMS = Xsdl
-
-Xsdl_SOURCES = sdl.c
-
-Xsdl_LDADD = \
- @KDRIVE_LIBS@
-
-Xsdl_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@
-
-Xsdl_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
-
-relink:
- rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
diff --git a/ports/xorg-server/README b/ports/xorg-server/README
deleted file mode 100644
index c889069..0000000
--- a/ports/xorg-server/README
+++ /dev/null
@@ -1,13 +0,0 @@
-This port of xorg-server is an amalgam of stock X11R7.7 and an android
-SDL port of an earlier version from:
- https://github.com/pelya/xserver-xsdl.git
- at 3cce1acc1f943ded8491e1be814aebfce6e09023
-From which we've borrowed:
- sdl.c
- Makefile.am
-
-The port has been modified to:
- - Remove android-ism.
- - Work with the autoconf build instead of an ant build (by only
- cherry-picking the SDL work without other changes).
- - Ignore unicode and pass along raw key events.
diff --git a/ports/xorg-server/Xsdl.js b/ports/xorg-server/Xsdl.js
deleted file mode 100644
index 8553c71..0000000
--- a/ports/xorg-server/Xsdl.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-NaClTerm.nmf = 'Xsdl.nmf';
-NaClTerm.argv = [
- '-screen', '1024x768x32', '-ac', '-br', '-noreset', ':42'
-];
-NaClTerm.env = [
- 'NACL_SPAWN_MODE=embed',
- 'NACL_EMBED_WIDTH=100%',
- 'NACL_EMBED_HEIGHT=100%',
-];
diff --git a/ports/xorg-server/background.js b/ports/xorg-server/background.js
deleted file mode 100644
index c3dac58..0000000
--- a/ports/xorg-server/background.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-'use strict';
-
-function onLaunched(launchData) {
- chrome.app.window.create('Xsdl.html', {
- width: 1024,
- height: 768,
- minWidth: 1024,
- minHeight: 768,
- maxWidth: 1024,
- maxHeight: 768,
- id: 'Xsdl',
- });
-}
-
-chrome.app.runtime.onLaunched.addListener(onLaunched);
diff --git a/ports/xorg-server/build.sh b/ports/xorg-server/build.sh
deleted file mode 100755
index 192f50e..0000000
--- a/ports/xorg-server/build.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2014 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.
-
-NACLPORTS_CPPFLAGS+=" -I${NACLPORTS_INCLUDE}/pixman-1"
-NACLPORTS_CPPFLAGS+=" -DFASYNC=O_NONBLOCK -DFNDELAY=O_NONBLOCK"
-
-EXECUTABLES=hw/kdrive/sdl/Xsdl${NACL_EXEEXT}
-
-EnableCliMain
-EnableGlibcCompat
-
-EXTRA_CONFIGURE_ARGS+=" --disable-glx"
-EXTRA_CONFIGURE_ARGS+=" --enable-xfree86-utils=no"
-EXTRA_CONFIGURE_ARGS+=" --enable-pciaccess=no"
-EXTRA_CONFIGURE_ARGS+=" --enable-kdrive"
-EXTRA_CONFIGURE_ARGS+=" --enable-local-transport=no"
-EXTRA_CONFIGURE_ARGS+=" --enable-unix-transport=no"
-EXTRA_CONFIGURE_ARGS+=" --enable-static=yes"
-EXTRA_CONFIGURE_ARGS+=" --enable-shared=no"
-EXTRA_CONFIGURE_ARGS+=" --enable-unit-tests=no"
-EXTRA_CONFIGURE_ARGS+=" --enable-ipv6=no"
-EXTRA_CONFIGURE_ARGS+=" --datarootdir=/share"
-EXTRA_CONFIGURE_ARGS+=" --with-fontrootdir=/share/fonts/X11"
-EXTRA_CONFIGURE_ARGS+=" --with-xkb-bin-directory="
-
-if [ "${NACL_LIBC}" = "newlib" ]; then
- EXTRA_CONFIGURE_ARGS+=" --enable-xvfb=no"
- EXTRA_CONFIGURE_ARGS+=" --enable-xorg=no"
-fi
-
-NACLPORTS_CPPFLAGS+=" -Dmain=SDL_main"
-NACLPORTS_LDFLAGS+=" -Wl,--undefined=nacl_startup_untar"
-NACLPORTS_LDFLAGS+=" -Wl,--undefined=SDL_main"
-NACLPORTS_LIBS+=" -lSDLmain -lSDL -lRegal -lglslopt -lppapi_gles2 -lm"
-
-PatchStep() {
- DefaultPatchStep
- MakeDir ${SRC_DIR}/hw/kdrive/sdl
- LogExecute cp ${START_DIR}/sdl.c \
- ${START_DIR}/Makefile.am \
- ${SRC_DIR}/hw/kdrive/sdl/
-}
-
-ConfigureStep() {
- ChangeDir ${SRC_DIR}
- autoreconf --force -v --install
- # Without this xorg-server's configure script will run -print-program-path=ld
- # which gives the wrong anser for PNaCl
- export LD=${NACLLD}
- export GL_CFLAGS=" "
- export GL_LIBS="-lRegal"
- ChangeDir ${BUILD_DIR}
- DefaultConfigureStep
-}
-
-InstallStep() {
- Banner "Publishing to ${PUBLISH_DIR}"
- MakeDir ${PUBLISH_DIR}
- local ASSEMBLY_DIR=${PUBLISH_DIR}/xorg-server
- MakeDir ${ASSEMBLY_DIR}
-
- ChangeDir ${ASSEMBLY_DIR}
-
- PublishMultiArch hw/kdrive/sdl/Xsdl${NACL_EXEEXT} Xsdl xorg-server
-
- # Bash is already platform specific split, copy the whole thing.
- local BASH_DIR=${NACL_PACKAGES_PUBLISH}/bash/${TOOLCHAIN}
- LogExecute cp -fR ${BASH_DIR}/* ${ASSEMBLY_DIR}
-
- LogExecute cp ${NACLPORTS_BIN}/xkbcomp${NACL_EXEEXT} \
- ${ASSEMBLY_DIR}/xkbcomp_${NACL_ARCH}${NACL_EXEEXT}
- LogExecute python ${NACL_SDK_ROOT}/tools/create_nmf.py \
- ${ASSEMBLY_DIR}/xkbcomp_*${NACL_EXEEXT} \
- -s . \
- -o xkbcomp.nmf
-
- # Install the HTML/JS for the terminal.
- LogExecute python ${TOOLS_DIR}/create_term.py -i whitelist.js Xsdl.nmf
- InstallNaClTerm ${ASSEMBLY_DIR}
-
- for f in manifest.json \
- background.js \
- xorg_16.png \
- xorg_48.png \
- xorg_128.png \
- whitelist.js \
- Xsdl.js; do
- LogExecute cp ${START_DIR}/${f} .
- done
-
- ChangeDir ${NACL_PREFIX}
- LogExecute tar cvf ${ASSEMBLY_DIR}/xorg-xkb.tar share/X11/xkb
- LogExecute shasum ${ASSEMBLY_DIR}/xorg-xkb.tar > \
- ${ASSEMBLY_DIR}/xorg-xkb.tar.hash
- local XFONTS_DIR=${NACL_PACKAGES_PUBLISH}/xfonts/${TOOLCHAIN}
- LogExecute cp ${XFONTS_DIR}/xorg-fonts.tar ${ASSEMBLY_DIR}/
- LogExecute cp ${XFONTS_DIR}/xorg-fonts.tar.hash ${ASSEMBLY_DIR}/
-
- ChangeDir ${PUBLISH_DIR}
- LogExecute zip -r xorg-server.zip xorg-server
-}
diff --git a/ports/xorg-server/manifest.json b/ports/xorg-server/manifest.json
deleted file mode 100644
index 7395488..0000000
--- a/ports/xorg-server/manifest.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "xorg-server",
- "description": "xorg-server on top of SDL",
- "version": "0.0.0.1",
- "manifest_version": 2,
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- },
- "icons": {
- "16": "xorg_16.png",
- "48": "xorg_48.png",
- "128": "xorg_128.png"
- },
- "permissions": [
- "storage",
- "unlimitedStorage",
- "*://webports.storage.googleapis.com/*",
- {
- "socket": [
- "tcp-listen:*:*",
- "tcp-connect",
- "resolve-host",
- "udp-bind:*:*",
- "udp-send-to:*:*"
- ]
- }
- ]
-}
diff --git a/ports/xorg-server/nacl.patch b/ports/xorg-server/nacl.patch
deleted file mode 100644
index b782fe8..0000000
--- a/ports/xorg-server/nacl.patch
+++ /dev/null
@@ -1,358 +0,0 @@
-diff --git a/Xext/shm.c b/Xext/shm.c
---- a/Xext/shm.c
-+++ b/Xext/shm.c
-@@ -33,8 +33,10 @@ in this Software without prior written authorization from The Open Group.
- #endif
-
- #include <sys/types.h>
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- #include <sys/ipc.h>
- #include <sys/shm.h>
-+#endif
- #include <unistd.h>
- #include <sys/stat.h>
- #include <X11/X.h>
-@@ -317,6 +319,7 @@ ProcShmQueryVersion(ClientPtr client)
- static int
- shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
- {
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- int uid, gid;
- mode_t mask;
- int uidset = 0, gidset = 0;
-@@ -374,11 +377,15 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
- mask |= S_IWOTH;
- }
- return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1;
-+#else
-+ return -1;
-+#endif
- }
-
- static int
- ProcShmAttach(ClientPtr client)
- {
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- SHMSTAT_TYPE buf;
- ShmDescPtr shmdesc;
-
-@@ -428,12 +435,16 @@ ProcShmAttach(ClientPtr client)
- if (!AddResource(stuff->shmseg, ShmSegType, (pointer) shmdesc))
- return BadAlloc;
- return Success;
-+#else
-+ return BadAlloc;
-+#endif
- }
-
- /*ARGSUSED*/ static int
- ShmDetachSegment(pointer value, /* must conform to DeleteType */
- XID shmseg)
- {
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- ShmDescPtr shmdesc = (ShmDescPtr) value;
- ShmDescPtr *prev;
-
-@@ -443,6 +454,7 @@ ShmDetachSegment(pointer value, /* must conform to DeleteType */
- for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next);
- *prev = shmdesc->next;
- free(shmdesc);
-+#endif
- return Success;
- }
-
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -2228,6 +2228,7 @@ hw/kdrive/fake/Makefile
- hw/kdrive/fbdev/Makefile
- hw/kdrive/linux/Makefile
- hw/kdrive/src/Makefile
-+hw/kdrive/sdl/Makefile
- test/Makefile
- test/xi2/Makefile
- xserver.ent
-diff --git a/dix/main.c b/dix/main.c
---- a/dix/main.c
-+++ b/dix/main.c
-@@ -117,6 +117,10 @@ Equipment Corporation.
-
- extern void Dispatch(void);
-
-+#if defined(__native_client__)
-+# include "nacl_main.h"
-+#endif
-+
- #ifdef XQUARTZ
- #include <pthread.h>
-
-@@ -130,11 +134,24 @@ int
- dix_main(int argc, char *argv[], char *envp[])
- #else
- int
-+# if defined(__native_client__)
-+__attribute__ (( visibility("default") ))
-+main(int argc, char *argv[])
-+# else
- main(int argc, char *argv[], char *envp[])
-+# endif
- #endif
- {
- int i;
- HWEventQueueType alwaysCheckForInput[2];
-+#if defined(__native_client__)
-+ char **envp = environ;
-+ unsetenv("NACL_SPAWN_MODE");
-+ if (nacl_startup_untar(argv[0], "xorg-xkb.tar", "/"))
-+ return 1;
-+ if (nacl_startup_untar(argv[0], "xorg-fonts.tar", "/"))
-+ return 1;
-+#endif
-
- display = "0";
-
-diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am
---- a/hw/kdrive/Makefile.am
-+++ b/hw/kdrive/Makefile.am
-@@ -15,6 +15,7 @@ LINUX_SUBDIRS = linux
- endif
-
- SERVER_SUBDIRS = \
-+ sdl \
- $(FBDEV_SUBDIRS) \
- $(XEPHYR_SUBDIRS) \
- $(XFAKE_SUBDIRS)
-@@ -24,7 +25,7 @@ SUBDIRS = \
- $(LINUX_SUBDIRS) \
- $(SERVER_SUBDIRS)
-
--DIST_SUBDIRS = fbdev ephyr src linux fake
-+DIST_SUBDIRS = fbdev ephyr src linux fake sdl
-
- relink:
- $(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done
-diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
---- a/hw/xfree86/common/xf86Configure.c
-+++ b/hw/xfree86/common/xf86Configure.c
-@@ -27,6 +27,8 @@
- #include <xorg-config.h>
- #endif
-
-+#include <errno.h>
-+
- #include "xf86.h"
- #include "xf86Config.h"
- #include "xf86_OSlib.h"
-diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
---- a/hw/xfree86/common/xf86Events.c
-+++ b/hw/xfree86/common/xf86Events.c
-@@ -53,6 +53,7 @@
- #include <xorg-config.h>
- #endif
-
-+#include <errno.h>
- #include <X11/X.h>
- #include <X11/Xpoll.h>
- #include <X11/Xproto.h>
-diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
---- a/hw/xfree86/os-support/bus/Pci.h
-+++ b/hw/xfree86/os-support/bus/Pci.h
-@@ -135,7 +135,7 @@
- #define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
- #define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u)
-
--#if defined(linux)
-+#if defined(linux) || defined(__native_client__)
- #define osPciInit(x) do {} while (0)
- #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
- defined(__OpenBSD__) || defined(__NetBSD__) || \
-diff --git a/include/do-not-use-config.h.in b/include/do-not-use-config.h.in
---- a/include/do-not-use-config.h.in
-+++ b/include/do-not-use-config.h.in
-@@ -705,6 +705,9 @@
- /* Define for large files, on AIX-style hosts. */
- #undef _LARGE_FILES
-
-+/* Defined if needed to expose struct msghdr.msg_control */
-+#undef _XOPEN_SOURCE
-+
- /* Define to 1 if unsigned long is 64 bits. */
- #undef _XSERVER64
-
-diff --git a/include/servermd.h b/include/servermd.h
---- a/include/servermd.h
-+++ b/include/servermd.h
-@@ -279,6 +279,13 @@ SOFTWARE.
- #define GLYPHPADBYTES 4
- #endif
-
-+/* nacl on ARM/PNaCl */
-+#if (defined(__native_client__) && defined(__arm__)) || defined(__pnacl__)
-+#define IMAGE_BYTE_ORDER LSBFirst
-+#define BITMAP_BIT_ORDER LSBFirst
-+#define GLYPHPADBYTES 4
-+#endif
-+
- /* linux on IBM S/390 */
- #if defined (linux) && defined (__s390__)
- #define IMAGE_BYTE_ORDER MSBFirst
-diff --git a/os/access.c b/os/access.c
---- a/os/access.c
-+++ b/os/access.c
-@@ -113,7 +113,7 @@ SOFTWARE.
- #endif
- #endif
-
--#if defined(SVR4) || (defined(SYSV) && defined(__i386__)) || defined(__GNU__)
-+#if !defined(SIOCGIFCONF) && !defined(WIN32)
- #include <sys/utsname.h>
- #endif
- #if defined(SYSV) && defined(__i386__)
-diff --git a/os/utils.c b/os/utils.c
---- a/os/utils.c
-+++ b/os/utils.c
-@@ -247,6 +247,7 @@ static Bool nolock = FALSE;
- void
- LockServer(void)
- {
-+#if !defined(__native_client__)
- char tmp[PATH_MAX], pid_str[12];
- int lfd, i, haslock, l_pid, t;
- const char *tmppath = LOCK_DIR;
-@@ -364,6 +365,7 @@ LockServer(void)
- if (!haslock)
- FatalError("Could not create server lock file: %s\n", LockFile);
- StillLocking = FALSE;
-+#endif
- }
-
- /*
-@@ -1093,6 +1095,7 @@ XNFstrdup(const char *s)
- void
- SmartScheduleStopTimer(void)
- {
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- struct itimerval timer;
-
- if (SmartScheduleDisable)
-@@ -1102,11 +1105,13 @@ SmartScheduleStopTimer(void)
- timer.it_value.tv_sec = 0;
- timer.it_value.tv_usec = 0;
- (void) setitimer(ITIMER_REAL, &timer, 0);
-+#endif
- }
-
- void
- SmartScheduleStartTimer(void)
- {
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- struct itimerval timer;
-
- if (SmartScheduleDisable)
-@@ -1116,6 +1121,7 @@ SmartScheduleStartTimer(void)
- timer.it_value.tv_sec = 0;
- timer.it_value.tv_usec = SmartScheduleInterval * 1000;
- setitimer(ITIMER_REAL, &timer, 0);
-+#endif
- }
-
- static void
-@@ -1209,9 +1215,25 @@ OsAbort(void)
- * as well. As it is now, xkbcomp messages don't end up in the log file.
- */
-
-+#if defined(__native_client__)
-+#include <spawn.h>
-+#endif
-+
- int
- System(const char *command)
- {
-+#if defined(__native_client__)
-+ int pid, p;
-+ int status;
-+
-+ const char *args[] = {
-+ "bash", "-c", command, NULL,
-+ };
-+
-+ pid = spawnve(P_NOWAIT, "bash", args, NULL);
-+ p = waitpid(pid, &status, 0);
-+ return p == -1 ? -1 : status;
-+#else
- int pid, p;
- void (*csig) (int);
- int status;
-@@ -1249,6 +1271,7 @@ System(const char *command)
- }
-
- return p == -1 ? -1 : status;
-+#endif
- }
-
- static struct pid {
-diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
---- a/xkb/ddxLoad.c
-+++ b/xkb/ddxLoad.c
-@@ -179,7 +179,7 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb,
- const char *xkbbindir = emptystring;
- const char *xkbbindirsep = emptystring;
-
--#ifdef WIN32
-+#if defined(WIN32) || defined(__native_client__)
- /* WIN32 has no popen. The input must be stored in a file which is
- used as input for xkbcomp. xkbcomp does not read from stdin. */
- char tmpname[PATH_MAX];
-@@ -192,6 +192,10 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb,
-
- OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir));
-
-+#if defined(__native_client__)
-+ strcpy(tmpname, "/tmp");
-+ strcat(tmpname, "/xkb_XXXXXX");
-+#endif
- #ifdef WIN32
- strcpy(tmpname, Win32TempDir());
- strcat(tmpname, "\\xkb_XXXXXX");
-@@ -233,7 +237,7 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb,
- return FALSE;
- }
-
--#ifndef WIN32
-+#if !defined(WIN32) && !defined(__native_client__)
- out = Popen(buf, "w");
- #else
- out = fopen(tmpname, "w");
-@@ -247,7 +251,7 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb,
- }
- #endif
- XkbWriteXKBKeymapForNames(out, names, xkb, want, need);
--#ifndef WIN32
-+#if !defined(WIN32) && !defined(__native_client__)
- if (Pclose(out) == 0)
- #else
- if (fclose(out) == 0 && System(buf) >= 0)
-@@ -259,20 +263,20 @@ XkbDDXCompileKeymapByNames(XkbDescPtr xkb,
- strlcpy(nameRtrn, keymap, nameRtrnLen);
- }
- free(buf);
--#ifdef WIN32
-+#if defined(WIN32) || defined(__native_client__)
- unlink(tmpname);
- #endif
- return TRUE;
- }
- else
- LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
--#ifdef WIN32
-+#if defined(WIN32) || defined(__native_client__)
- /* remove the temporary file */
- unlink(tmpname);
- #endif
- }
- else {
--#ifndef WIN32
-+#if !defined(WIN32) && !defined(__native_client__)
- LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n");
- #else
- LogMessage(X_ERROR, "Could not open file %s\n", tmpname);
diff --git a/ports/xorg-server/pkg_info b/ports/xorg-server/pkg_info
deleted file mode 100644
index be8209e..0000000
--- a/ports/xorg-server/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=xorg-server
-VERSION=1.12.2
-URL=http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat pixman libxext libx11 glproto regal fixesproto damageproto xcmiscproto bigreqsproto randrproto renderproto fontsproto videoproto compositeproto recordproto scrnsaverproto resourceproto xineramaproto libxkbfile libxfont libpciaccess sdl pixman openssl nacl-spawn libtar xkbcomp bash xkeyboard-config xfonts)
-# No mac support, due to libx11.
-BUILD_OS=linux
-SHA1=2edb151d39571dc0fcdedc299ea0a77fe6bfc076
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/xorg-server/sdl.c b/ports/xorg-server/sdl.c
deleted file mode 100644
index b64cffb..0000000
--- a/ports/xorg-server/sdl.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
- * Copyright © 2004 PillowElephantBadgerBankPond
- * Copyright © 2014 Sergii Pylypenko
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of PillowElephantBadgerBankPond not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. PillowElephantBadgerBankPond makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * PillowElephantBadgerBankPond DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL PillowElephantBadgerBankPond BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * It's really not my fault - see it was the elephants!!
- * - jaymz
- *
- */
-#ifdef HAVE_CONFIG_H
-#include "kdrive-config.h"
-#endif
-#include "kdrive.h"
-#include <SDL/SDL.h>
-#include <X11/keysym.h>
-#include <sys/wait.h>
-#include <pthread.h>
-
-#ifdef __ANDROID__
-#include <SDL/SDL_screenkeyboard.h>
-#include <android/log.h>
-
-// DEBUG
-//#define printf(...)
-#define printf(...) __android_log_print(ANDROID_LOG_INFO, "XSDL", __VA_ARGS__)
-#endif
-
-static void xsdlFini(void);
-static Bool sdlScreenInit(KdScreenInfo *screen);
-static Bool sdlFinishInitScreen(ScreenPtr pScreen);
-static Bool sdlCreateRes(ScreenPtr pScreen);
-
-static void sdlKeyboardFini(KdKeyboardInfo *ki);
-static Status sdlKeyboardInit(KdKeyboardInfo *ki);
-static Status sdlKeyboardEnable (KdKeyboardInfo *ki);
-static void sdlKeyboardDisable (KdKeyboardInfo *ki);
-static void sdlKeyboardLeds (KdKeyboardInfo *ki, int leds);
-static void sdlKeyboardBell (KdKeyboardInfo *ki, int volume, int frequency, int duration);
-
-static Bool sdlMouseInit(KdPointerInfo *pi);
-static void sdlMouseFini(KdPointerInfo *pi);
-static Status sdlMouseEnable (KdPointerInfo *pi);
-static void sdlMouseDisable (KdPointerInfo *pi);
-static int execute_command(const char * command, const char *mode, char * data, int datalen);
-static int UnicodeToUtf8(int src, char * dest);
-static void send_unicode(int unicode);
-
-KdKeyboardInfo *sdlKeyboard = NULL;
-KdPointerInfo *sdlPointer = NULL;
-
-KdKeyboardDriver sdlKeyboardDriver = {
- .name = "keyboard",
- .Init = sdlKeyboardInit,
- .Fini = sdlKeyboardFini,
- .Enable = sdlKeyboardEnable,
- .Disable = sdlKeyboardDisable,
- .Leds = sdlKeyboardLeds,
- .Bell = sdlKeyboardBell,
-};
-
-KdPointerDriver sdlMouseDriver = {
- .name = "mouse",
- .Init = sdlMouseInit,
- .Fini = sdlMouseFini,
- .Enable = sdlMouseEnable,
- .Disable = sdlMouseDisable,
-};
-
-
-KdCardFuncs sdlFuncs = {
- .scrinit = sdlScreenInit, /* scrinit */
- .finishInitScreen = sdlFinishInitScreen, /* finishInitScreen */
- .createRes = sdlCreateRes, /* createRes */
-};
-
-int mouseState = 0;
-
-enum { NUMRECTS = 32, FULLSCREEN_REFRESH_TIME = 1000 };
-//Uint32 nextFullScreenRefresh = 0;
-
-typedef struct
-{
- SDL_Surface *screen;
- Rotation randr;
- Bool shadow;
-} SdlDriver;
-
-//#undef RANDR
-
-Bool
-sdlMapFramebuffer (KdScreenInfo *screen)
-{
- SdlDriver *driver = screen->driver;
- KdPointerMatrix m;
-
- if (driver->randr != RR_Rotate_0)
- driver->shadow = TRUE;
- else
- driver->shadow = FALSE;
-
- KdComputePointerMatrix (&m, driver->randr, screen->width, screen->height);
-
- KdSetPointerMatrix (&m);
-
- screen->width = driver->screen->w;
- screen->height = driver->screen->h;
-
- printf("%s: shadow %d\n", __func__, driver->shadow);
-
- if (driver->shadow)
- {
- if (!KdShadowFbAlloc (screen,
- driver->randr & (RR_Rotate_90|RR_Rotate_270)))
- return FALSE;
- }
- else
- {
- screen->fb.byteStride = driver->screen->pitch;
- screen->fb.pixelStride = driver->screen->w;
- screen->fb.frameBuffer = (CARD8 *) (driver->screen->pixels);
- }
-
- return TRUE;
-}
-
-static void
-sdlSetScreenSizes (ScreenPtr pScreen)
-{
- KdScreenPriv(pScreen);
- KdScreenInfo *screen = pScreenPriv->screen;
- SdlDriver *driver = screen->driver;
-
- if (driver->randr & (RR_Rotate_0|RR_Rotate_180))
- {
- pScreen->width = driver->screen->w;
- pScreen->height = driver->screen->h;
- pScreen->mmWidth = screen->width_mm;
- pScreen->mmHeight = screen->height_mm;
- }
- else
- {
- pScreen->width = driver->screen->h;
- pScreen->height = driver->screen->w;
- pScreen->mmWidth = screen->height_mm;
- pScreen->mmHeight = screen->width_mm;
- }
-}
-
-static Bool
-sdlUnmapFramebuffer (KdScreenInfo *screen)
-{
- KdShadowFbFree (screen);
- return TRUE;
-}
-
-static Bool sdlScreenInit(KdScreenInfo *screen)
-{
- SdlDriver *driver=calloc(1, sizeof(SdlDriver));
- printf("%s\n", __func__);
- if (!screen->width || !screen->height)
- {
- screen->width = 640;
- screen->height = 480;
- }
- if (!screen->fb.depth)
- screen->fb.depth = 4;
- printf("Attempting for %dx%d/%dbpp mode\n", screen->width, screen->height, screen->fb.depth);
- driver->screen = SDL_SetVideoMode(screen->width, screen->height, screen->fb.depth, 0);
- if(driver->screen == NULL)
- return FALSE;
- driver->randr = screen->randr;
- screen->driver = driver;
- printf("Set %dx%d/%dbpp mode\n", driver->screen->w, driver->screen->h, driver->screen->format->BitsPerPixel);
- screen->width = driver->screen->w;
- screen->height = driver->screen->h;
- screen->fb.depth = driver->screen->format->BitsPerPixel;
- screen->fb.visuals = (1<<TrueColor);
- screen->fb.redMask = driver->screen->format->Rmask;
- screen->fb.greenMask = driver->screen->format->Gmask;
- screen->fb.blueMask = driver->screen->format->Bmask;
- screen->fb.bitsPerPixel = driver->screen->format->BitsPerPixel;
- //screen->fb.shadow = FALSE;
- screen->rate=30; // 60 is too intense for CPU
-
- SDL_WM_SetCaption("Freedesktop.org X server (SDL)", NULL);
-
- SDL_EnableUNICODE(1);
-
- return sdlMapFramebuffer (screen);
-}
-
-static void sdlShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf)
-{
- KdScreenPriv(pScreen);
- KdScreenInfo *screen = pScreenPriv->screen;
- SdlDriver *driver = screen->driver;
- pixman_box16_t * rects;
- int amount, i;
- int updateRectsPixelCount = 0;
-
- //printf("sdlShadowUpdate: time %d", SDL_GetTicks());
-
- if (driver->shadow)
- {
- ShadowUpdateProc update;
- if (driver->randr)
- {
- /*
- if (driver->screen->format->BitsPerPixel == 16)
- {
- switch (driver->randr) {
- case RR_Rotate_90:
- update = shadowUpdateRotate16_90YX;
- break;
- case RR_Rotate_180:
- update = shadowUpdateRotate16_180;
- break;
- case RR_Rotate_270:
- update = shadowUpdateRotate16_270YX;
- break;
- default:
- update = shadowUpdateRotate16;
- break;
- }
- } else
- */
- update = shadowUpdateRotatePacked;
- }
- else
- update = shadowUpdatePacked;
-
- update(pScreen, pBuf);
- }
-
- rects = pixman_region_rectangles(&pBuf->pDamage->damage, &amount);
- for ( i = 0; i < amount; i++ )
- {
- updateRectsPixelCount += (pBuf->pDamage->damage.extents.x2 - pBuf->pDamage->damage.extents.x1) *
- (pBuf->pDamage->damage.extents.y2 - pBuf->pDamage->damage.extents.y1);
- }
- // Each subrect is copied into temp buffer before uploading to OpenGL texture,
- // so if total area of pixels copied is more than 1/3 of the whole screen area,
- // there will be performance hit instead of optimization.
-
- if ( amount > NUMRECTS || updateRectsPixelCount * 3 > driver->screen->w * driver->screen->h )
- {
- //printf("SDL_Flip\n");
- SDL_Flip(driver->screen);
- //nextFullScreenRefresh = 0;
- }
- else
- {
- SDL_Rect updateRects[NUMRECTS];
- //if ( ! nextFullScreenRefresh )
- // nextFullScreenRefresh = SDL_GetTicks() + FULLSCREEN_REFRESH_TIME;
- for ( i = 0; i < amount; i++ )
- {
- updateRects[i].x = rects[i].x1;
- updateRects[i].y = rects[i].y1;
- updateRects[i].w = rects[i].x2 - rects[i].x1;
- updateRects[i].h = rects[i].y2 - rects[i].y1;
- //printf("sdlShadowUpdate: rect %d: %04d:%04d:%04d:%04d", i, rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
- }
- //printf("SDL_UpdateRects %d\n", amount);
- SDL_UpdateRects(driver->screen, amount, updateRects);
- }
-}
-
-static void *sdlShadowWindow (ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure)
-{
- KdScreenPriv(pScreen);
- KdScreenInfo *screen = pScreenPriv->screen;
- SdlDriver *driver = screen->driver;
-
-// if (!pScreenPriv->enabled)
-// return NULL;
-
- *size = driver->screen->pitch;
-
- //printf("%s\n", __func__);
-
- return (void *)((CARD8 *)driver->screen->pixels + row * (*size) + offset);
-}
-
-
-static Bool sdlCreateRes(ScreenPtr pScreen)
-{
- KdScreenPriv(pScreen);
- KdScreenInfo *screen = pScreenPriv->screen;
- SdlDriver *driver = screen->driver;
- Bool oldShadow = screen->fb.shadow;
-
- printf("%s\n", __func__);
-
- // Hack: Kdrive assumes we have dumb videobuffer, which updates automatically,
- // and does not call update callback if shadow flag is not set.
- screen->fb.shadow = TRUE;
- KdShadowSet (pScreen, driver->randr, sdlShadowUpdate, sdlShadowWindow);
- screen->fb.shadow = oldShadow;
-
- return TRUE;
-}
-
-
-#ifdef RANDR
-static Bool sdlRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
-{
- KdScreenPriv(pScreen);
- KdScreenInfo *screen = pScreenPriv->screen;
- SdlDriver *driver = screen->driver;
- RRScreenSizePtr pSize;
- Rotation randr;
- int n;
-
- printf("%s", __func__);
-
- *rotations = RR_Rotate_All|RR_Reflect_All;
-
- for (n = 0; n < pScreen->numDepths; n++)
- if (pScreen->allowedDepths[n].numVids)
- break;
- if (n == pScreen->numDepths)
- return FALSE;
-
- pSize = RRRegisterSize (pScreen,
- screen->width,
- screen->height,
- screen->width_mm,
- screen->height_mm);
-
- randr = KdSubRotation (driver->randr, screen->randr);
-
- RRSetCurrentConfig (pScreen, randr, 0, pSize);
-
- return TRUE;
-}
-
-static Bool sdlRandRSetConfig (ScreenPtr pScreen,
- Rotation randr,
- int rate,
- RRScreenSizePtr pSize)
-{
- KdScreenPriv(pScreen);
- KdScreenInfo *screen = pScreenPriv->screen;
- SdlDriver *driver = screen->driver;
- Bool wasEnabled = pScreenPriv->enabled;
- SdlDriver oldDriver;
- int oldwidth;
- int oldheight;
- int oldmmwidth;
- int oldmmheight;
-
- if (wasEnabled)
- KdDisableScreen (pScreen);
-
- oldDriver = *driver;
-
- oldwidth = screen->width;
- oldheight = screen->height;
- oldmmwidth = pScreen->mmWidth;
- oldmmheight = pScreen->mmHeight;
-
- /*
- * Set new configuration
- */
-
- driver->randr = KdAddRotation (screen->randr, randr);
-
- printf("%s driver->randr %d", __func__, driver->randr);
-
- sdlUnmapFramebuffer (screen);
-
- if (!sdlMapFramebuffer (screen))
- goto bail4;
-
- KdShadowUnset (screen->pScreen);
-
- if (!sdlCreateRes (screen->pScreen))
- goto bail4;
-
- sdlSetScreenSizes (screen->pScreen);
-
- /*
- * Set frame buffer mapping
- */
- (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap (pScreen),
- pScreen->width,
- pScreen->height,
- screen->fb.depth,
- screen->fb.bitsPerPixel,
- screen->fb.byteStride,
- screen->fb.frameBuffer);
-
- /* set the subpixel order */
-
- KdSetSubpixelOrder (pScreen, driver->randr);
- if (wasEnabled)
- KdEnableScreen (pScreen);
-
- return TRUE;
-
-bail4:
- sdlUnmapFramebuffer (screen);
- *driver = oldDriver;
- (void) sdlMapFramebuffer (screen);
- pScreen->width = oldwidth;
- pScreen->height = oldheight;
- pScreen->mmWidth = oldmmwidth;
- pScreen->mmHeight = oldmmheight;
-
- if (wasEnabled)
- KdEnableScreen (pScreen);
- return FALSE;
-}
-
-static Bool sdlRandRInit (ScreenPtr pScreen)
-{
- rrScrPrivPtr pScrPriv;
-
- printf("%s", __func__);
-
- if (!RRScreenInit (pScreen))
- return FALSE;
-
- pScrPriv = rrGetScrPriv(pScreen);
- pScrPriv->rrGetInfo = sdlRandRGetInfo;
- pScrPriv->rrSetConfig = sdlRandRSetConfig;
- return TRUE;
-}
-#endif
-
-
-static Bool sdlFinishInitScreen(ScreenPtr pScreen)
-{
- if (!shadowSetup (pScreen))
- return FALSE;
-
-#ifdef RANDR
- if (!sdlRandRInit (pScreen))
- return FALSE;
-#endif
- return TRUE;
-}
-
-static void sdlKeyboardFini(KdKeyboardInfo *ki)
-{
- printf("sdlKeyboardFini() %p\n", ki);
- sdlKeyboard = NULL;
-}
-
-static Status sdlKeyboardInit(KdKeyboardInfo *ki)
-{
- ki->minScanCode = 8;
- ki->maxScanCode = 255;
- ki->name = strdup("Android keyboard");
-
- sdlKeyboard = ki;
- printf("sdlKeyboardInit() %p\n", ki);
- return Success;
-}
-
-static Status sdlKeyboardEnable (KdKeyboardInfo *ki)
-{
- return Success;
-}
-
-static void sdlKeyboardDisable (KdKeyboardInfo *ki)
-{
-}
-
-static void sdlKeyboardLeds (KdKeyboardInfo *ki, int leds)
-{
-}
-
-static void sdlKeyboardBell (KdKeyboardInfo *ki, int volume, int frequency, int duration)
-{
-}
-
-static Status sdlMouseInit (KdPointerInfo *pi)
-{
- pi->nButtons = 7;
- pi->name = strdup("Android touchscreen and stylus");
- sdlPointer = pi;
- printf("sdlMouseInit() %p\n", pi);
- return Success;
-}
-
-static void sdlMouseFini(KdPointerInfo *pi)
-{
- printf("sdlMouseFini() %p\n", pi);
- sdlPointer = NULL;
-}
-
-static Status sdlMouseEnable (KdPointerInfo *pi)
-{
- return Success;
-}
-
-static void sdlMouseDisable (KdPointerInfo *pi)
-{
- return;
-}
-
-
-void InitCard(char *name)
-{
- KdCardInfoAdd (&sdlFuncs, 0);
- printf("InitCard: %s\n", name);
-}
-
-void InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
-{
- KdInitOutput(pScreenInfo, argc, argv);
- printf("InitOutput()\n");
-}
-
-void InitInput(int argc, char **argv)
-{
- KdPointerInfo *pi;
- KdKeyboardInfo *ki;
-
- KdAddKeyboardDriver(&sdlKeyboardDriver);
- KdAddPointerDriver(&sdlMouseDriver);
-
- ki = KdParseKeyboard("keyboard");
- KdAddKeyboard(ki);
- pi = KdParsePointer("mouse");
- KdAddPointer(pi);
-
- KdInitInput();
-}
-
-#ifdef DDXBEFORERESET
-void ddxBeforeReset(void)
-{
-}
-#endif
-
-void ddxUseMsg(void)
-{
- KdUseMsg();
-}
-
-int ddxProcessArgument(int argc, char **argv, int i)
-{
- return KdProcessArgument(argc, argv, i);
-}
-
-static void sdlPollInput(void)
-{
- static int buttonState=0;
- static int pressure = 0;
- SDL_Event event;
-
- //printf("sdlPollInput() %d\n", SDL_GetTicks());
-
- while ( SDL_PollEvent(&event) ) {
- switch (event.type) {
- case SDL_MOUSEMOTION:
- //printf("SDL_MOUSEMOTION pressure %d\n", pressure);
- KdEnqueuePointerEvent(sdlPointer, mouseState, event.motion.x, event.motion.y, pressure);
- break;
- case SDL_MOUSEBUTTONDOWN:
- switch(event.button.button)
- {
- case SDL_BUTTON_LEFT:
- buttonState = KD_BUTTON_1;
- break;
- case SDL_BUTTON_MIDDLE:
- buttonState = KD_BUTTON_2;
- break;
- case SDL_BUTTON_RIGHT:
- buttonState = KD_BUTTON_3;
- break;
- case SDL_BUTTON_WHEELUP:
- buttonState = KD_BUTTON_4;
- break;
- case SDL_BUTTON_WHEELDOWN:
- buttonState = KD_BUTTON_5;
- break;
- /*
- case SDL_BUTTON_X1:
- buttonState = KD_BUTTON_6;
- break;
- case SDL_BUTTON_X2:
- buttonState = KD_BUTTON_7;
- break;
- */
- default:
- buttonState = 1 << (event.button.button - 1);
- break;
- }
- mouseState |= buttonState;
- KdEnqueuePointerEvent(sdlPointer, mouseState|KD_MOUSE_DELTA, 0, 0, pressure);
- break;
- case SDL_MOUSEBUTTONUP:
- switch(event.button.button)
- {
- case SDL_BUTTON_LEFT:
- buttonState = KD_BUTTON_1;
- pressure = 0;
- break;
- case SDL_BUTTON_MIDDLE:
- buttonState = KD_BUTTON_2;
- break;
- case SDL_BUTTON_RIGHT:
- buttonState = KD_BUTTON_3;
- break;
- case SDL_BUTTON_WHEELUP:
- buttonState = KD_BUTTON_4;
- break;
- case SDL_BUTTON_WHEELDOWN:
- buttonState = KD_BUTTON_5;
- break;
- /*
- case SDL_BUTTON_X1:
- buttonState = KD_BUTTON_6;
- break;
- case SDL_BUTTON_X2:
- buttonState = KD_BUTTON_7;
- break;
- */
- default:
- buttonState = 1 << (event.button.button - 1);
- break;
- }
- mouseState &= ~buttonState;
- KdEnqueuePointerEvent(sdlPointer, mouseState|KD_MOUSE_DELTA, 0, 0, pressure);
- break;
- case SDL_KEYDOWN:
- case SDL_KEYUP:
- //printf("Key sym %d scancode %d unicode %d", event.key.keysym.sym, event.key.keysym.scancode, event.key.keysym.unicode);
-#ifdef __ANDROID__
- if (event.key.keysym.sym == SDLK_HELP)
- {
- if(event.type == SDL_KEYUP)
- SDL_ANDROID_ToggleScreenKeyboardWithoutTextInput();
- }
- else
-#endif
- if (event.key.keysym.sym == SDLK_UNDO)
- {
- if(event.type == SDL_KEYUP)
- {
- // Send Ctrl-Z
- KdEnqueueKeyboardEvent (sdlKeyboard, 37, 0); // LCTRL
- KdEnqueueKeyboardEvent (sdlKeyboard, 52, 0); // Z
- KdEnqueueKeyboardEvent (sdlKeyboard, 52, 1); // Z
- KdEnqueueKeyboardEvent (sdlKeyboard, 37, 1); // LCTRL
- }
- }
-/*
- * On some platforms (OSX) keystrokes like (Alt-X) have a unicode
- * character associated with them: ≈.
- * OSX makes the choice to propagate this character with key events.
- * Multi-byte IMEs likely do the same, but without a keycode.
- *
- * The Android port this was based on uses the approach of shelling
- * out to xset using the clipboard as a mechanism to emit unicode reliably.
- * Unfortunately our NaCl port doesn't yet have this utility.
- * Additionally, even if it did, it is unclear if passing along all unicode
- * this way is desirable, as for instance this blocks Emacs from receiving
- * Alt-X. For Android it was clear cut that using the Android IME would be
- * preferred over the remote one, but this is less clear on the desktop.
- *
- * Sending only raw key codes for now.
- */
-#if !defined(__native_client__)
- else if((event.key.keysym.unicode & 0xFF80) != 0)
- {
- send_unicode (event.key.keysym.unicode);
- }
-#endif
- else
- KdEnqueueKeyboardEvent (sdlKeyboard, event.key.keysym.scancode, event.type==SDL_KEYUP);
- // Force SDL screen update, so SDL virtual on-screen buttons will change their images
- {
- SDL_Rect r = {0, 0, 1, 1};
- SDL_UpdateRects(SDL_GetVideoSurface(), 1, &r);
- }
- break;
- case SDL_JOYAXISMOTION:
- if (event.jaxis.which == 0 && event.jaxis.axis == 4 && pressure != event.jaxis.value)
- {
- pressure = event.jaxis.value;
- if (mouseState & KD_BUTTON_1)
- KdEnqueuePointerEvent(sdlPointer, mouseState|KD_MOUSE_DELTA, 0, 0, pressure);
- }
- break;
- case SDL_ACTIVEEVENT:
- // We need this to re-init OpenGL and redraw screen
- // And we need to also call this when OpenGL context was destroyed
- // Oherwise SDL will stuck and we will get a permanent black screen
- SDL_Flip(SDL_GetVideoSurface());
- break;
- //case SDL_QUIT:
- /* this should never happen */
- //SDL_Quit(); // SDL_Quit() on Android is buggy
- }
- }
- /*
- if ( nextFullScreenRefresh && nextFullScreenRefresh < SDL_GetTicks() )
- {
- //printf("SDL_Flip from sdlPollInput");
- SDL_Flip(SDL_GetVideoSurface());
- nextFullScreenRefresh = 0;
- }
- */
-}
-
-static int xsdlInit(void)
-{
- printf("Calling SDL_Init()\n");
- SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
- SDL_JoystickOpen(0); // Receive pressure events
- return 0;
-}
-
-
-static void xsdlFini(void)
-{
- //SDL_Quit(); // SDL_Quit() on Android is buggy
-}
-
-void
-CloseInput (void)
-{
- KdCloseInput ();
-}
-
-KdOsFuncs sdlOsFuncs={
- .Init = xsdlInit,
- .Fini = xsdlFini,
- .pollEvents = sdlPollInput,
-};
-
-void OsVendorInit (void)
-{
- KdOsInit (&sdlOsFuncs);
-}
-
-static void *send_unicode_thread(void *param)
-{
- // International text input - copy symbol to clipboard, and send copypaste key
- int unicode = (int)param;
- char cmd[1024] = "";
- char c[5] = "";
- sprintf (cmd, "127.0.0.1:%s", display);
- setenv ("DISPLAY", cmd, 1);
- UnicodeToUtf8 (unicode, c);
- //sprintf(cmd, "echo '%s' | %s/usr/bin/xsel -b -i >/dev/null 2>&1", c, getenv("APPDIR"));
- //sprintf(cmd, "echo '%s' >/dev/null 2>&1", c);
- //sprintf(cmd, "%s/usr/bin/xsel -b", getenv("APPDIR"));
- //printf("Launching cmd: %s", cmd);
- //int ret = system(cmd);
- //printf("Cmd ret: %d", ret);
- sprintf(cmd, "%s/usr/bin/xsel -b -i >/dev/null 2>&1", getenv("APPDIR"));
- execute_command(cmd, "w", c, 5);
- KdEnqueueKeyboardEvent (sdlKeyboard, 37, 0); // LCTRL
- KdEnqueueKeyboardEvent (sdlKeyboard, 55, 0); // V
- KdEnqueueKeyboardEvent (sdlKeyboard, 55, 1); // V
- KdEnqueueKeyboardEvent (sdlKeyboard, 37, 1); // LCTRL
- return NULL;
-}
-
-void send_unicode(int unicode)
-{
- pthread_t thread_id;
- pthread_attr_t attr;
- pthread_attr_init (&attr);
- pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
- pthread_create (&thread_id, &attr, &send_unicode_thread, (void *)unicode);
- pthread_attr_destroy (&attr);
-}
-
-int execute_command(const char * command, const char *mode, char * data, int datalen)
-{
- FILE *cmd;
- int ret;
- //printf ("Starting child command: %s, mode %s data: '%s'", command, mode, data);
- cmd = popen (command, mode);
- if (!cmd) {
- printf ("Error while starting child command: %s", command);
- return -1;
- }
- if (mode[0] == 'w')
- fputs (data, cmd);
- else
- {
- datalen--;
- while (datalen > 0 && fgets (data, datalen, cmd))
- {
- int count = strlen (data);
- data += count;
- datalen -= count;
- }
- data[0] = 0;
- }
- ret = WEXITSTATUS (pclose (cmd));
- //printf ("Child command returned %d", ret);
- return ret;
-}
-
-int UnicodeToUtf8(int src, char * dest)
-{
- int len = 0;
- if ( src <= 0x007f) {
- *dest++ = (char)src;
- len = 1;
- } else if (src <= 0x07ff) {
- *dest++ = (char)0xc0 | (src >> 6);
- *dest++ = (char)0x80 | (src & 0x003f);
- len = 2;
- } else if (src == 0xFEFF) {
- // nop -- zap the BOM
- } else if (src >= 0xD800 && src <= 0xDFFF) {
- // surrogates not supported
- } else if (src <= 0xffff) {
- *dest++ = (char)0xe0 | (src >> 12);
- *dest++ = (char)0x80 | ((src >> 6) & 0x003f);
- *dest++ = (char)0x80 | (src & 0x003f);
- len = 3;
- } else if (src <= 0xffff) {
- *dest++ = (char)0xf0 | (src >> 18);
- *dest++ = (char)0x80 | ((src >> 12) & 0x3f);
- *dest++ = (char)0x80 | ((src >> 6) & 0x3f);
- *dest++ = (char)0x80 | (src & 0x3f);
- len = 4;
- } else {
- // out of Unicode range
- }
- *dest = 0;
- return len;
-}
diff --git a/ports/xorg-server/whitelist.js b/ports/xorg-server/whitelist.js
deleted file mode 100644
index 5a988af..0000000
--- a/ports/xorg-server/whitelist.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- */
-
-NaClProcessManager.nmfWhitelist = [
- 'bash',
- 'Xsdl',
- 'xkbcomp',
-];
diff --git a/ports/xorg-server/xorg_128.png b/ports/xorg-server/xorg_128.png
deleted file mode 100644
index fe330b0..0000000
--- a/ports/xorg-server/xorg_128.png
+++ /dev/null
Binary files differ
diff --git a/ports/xorg-server/xorg_16.png b/ports/xorg-server/xorg_16.png
deleted file mode 100644
index 828f45d..0000000
--- a/ports/xorg-server/xorg_16.png
+++ /dev/null
Binary files differ
diff --git a/ports/xorg-server/xorg_48.png b/ports/xorg-server/xorg_48.png
deleted file mode 100644
index 1c9fdc0..0000000
--- a/ports/xorg-server/xorg_48.png
+++ /dev/null
Binary files differ
diff --git a/ports/xproto/nacl.patch b/ports/xproto/nacl.patch
deleted file mode 100644
index 6a4046d..0000000
--- a/ports/xproto/nacl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/Xfuncs.h b/Xfuncs.h
---- a/Xfuncs.h
-+++ b/Xfuncs.h
-@@ -44,7 +44,7 @@ void bcopy();
- # define bcmp(b1,b2,len) memcmp(b1, b2, len)
- # else
- # include <string.h>
--# if defined(__SCO__) || defined(__sun) || defined(__UNIXWARE__) || defined(__CYGWIN__)
-+# if defined(__SCO__) || defined(__sun) || defined(__UNIXWARE__) || defined(__CYGWIN__) || defined(__native_client__)
- # include <strings.h>
- # endif
- # define _XFUNCS_H_INCLUDED_STRING_H
-diff --git a/Xos.h b/Xos.h
---- a/Xos.h
-+++ b/Xos.h
-@@ -60,7 +60,7 @@ in this Software without prior written authorization from The Open Group.
- */
-
- # include <string.h>
--# if defined(__SCO__) || defined(__UNIXWARE__) || defined(__sun) || defined(__CYGWIN__)
-+# if defined(__SCO__) || defined(__UNIXWARE__) || defined(__sun) || defined(__CYGWIN__) || defined(__native_client__)
- # include <strings.h>
- # else
- # ifndef index
diff --git a/ports/xproto/pkg_info b/ports/xproto/pkg_info
deleted file mode 100644
index 3e8bb8c..0000000
--- a/ports/xproto/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=xproto
-VERSION=7.0.23
-URL=http://www.x.org/releases/X11R7.7/src/everything/xproto-7.0.23.tar.bz2
-LICENSE=GPL
-SHA1=5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2
diff --git a/ports/xtrans/build.sh b/ports/xtrans/build.sh
deleted file mode 100644
index 6023088..0000000
--- a/ports/xtrans/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2014 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.
-
-EnableGlibcCompat
diff --git a/ports/xtrans/nacl.patch b/ports/xtrans/nacl.patch
deleted file mode 100644
index a311b1c..0000000
--- a/ports/xtrans/nacl.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-diff --git a/Xtranslcl.c b/Xtranslcl.c
---- a/Xtranslcl.c
-+++ b/Xtranslcl.c
-@@ -416,13 +416,17 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
- * wait for server to respond
- */
-
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- savef = signal(SIGALRM, _dummy);
- alarm_time = alarm (30); /* CONNECT_TIMEOUT */
-+#endif
-
- ret = read(fd, buf, 1);
-
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- (void) alarm(alarm_time);
- (void) signal(SIGALRM, savef);
-+#endif
-
- if (ret != 1) {
- prmsg(1,
-@@ -1036,13 +1040,17 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
- ctlbuf.buf = (caddr_t)&temp;
- fl = 0;
-
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- savef = signal(SIGALRM, _dummy);
- alarm_time = alarm(10);
-+#endif
-
- ret = getmsg(server, &ctlbuf, 0, &fl);
-
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- (void) alarm(alarm_time);
- (void) signal(SIGALRM, savef);
-+#endif
-
- if (ret < 0) {
- prmsg(1,"SCOOpenClient: error from getmsg\n");
-diff --git a/Xtranssock.c b/Xtranssock.c
---- a/Xtranssock.c
-+++ b/Xtranssock.c
-@@ -412,7 +412,8 @@ TRANS(SocketOpen) (int i, int type)
-
- if ((ciptr->fd = socket(Sockettrans2devtab[i].family, type,
- Sockettrans2devtab[i].protocol)) < 0
--#ifndef WIN32
-+/* TODO(bradnelson): Drop this if we decide to support this sysconf value for newlib. */
-+#if !defined(WIN32) && !(defined(__native_client__) && defined(_NEWLIB_VERSION))
- #if (defined(X11_t) && !defined(USE_POLL)) || defined(FS_t) || defined(FONT_t)
- || ciptr->fd >= sysconf(_SC_OPEN_MAX)
- #endif
-diff --git a/Xtransutil.c b/Xtransutil.c
---- a/Xtransutil.c
-+++ b/Xtransutil.c
-@@ -390,15 +390,19 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
- */
-
- nameserver_timedout = 0;
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- signal (SIGALRM, nameserver_lost);
- alarm (4);
-+#endif
- if (setjmp(env) == 0) {
- #endif
- hostp = _XGethostbyaddr (address, addresslen, family, hparams);
- #ifdef SIGALRM
- }
-+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
- alarm (0);
- #endif
-+#endif
- if (hostp != NULL)
- addr = hostp->h_name;
- else
diff --git a/ports/xtrans/pkg_info b/ports/xtrans/pkg_info
deleted file mode 100644
index 82c96c8..0000000
--- a/ports/xtrans/pkg_info
+++ /dev/null
@@ -1,9 +0,0 @@
-NAME=xtrans
-VERSION=1.2.7
-URL=http://www.x.org/releases/X11R7.7/src/everything/xtrans-1.2.7.tar.bz2
-LICENSE=GPL
-DEPENDS=(glibc-compat)
-SHA1=b6ed421edf577816f6e641e1846dc0bff337676c
-# glibc/arm: FIONREAD missing:
-# https://code.google.com/p/nativeclient/issues/detail?id=4233
-DISABLED_TOOLCHAIN=(glibc/arm)
diff --git a/ports/xz/build.sh b/ports/xz/build.sh
deleted file mode 100644
index c0a67c5..0000000
--- a/ports/xz/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright 2015 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.
-
-export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
-
-NACLPORTS_LIBS+="-pthread -lnacl_io -l${NACL_CXX_LIB}"
-
-EnableGlibcCompat
diff --git a/ports/xz/pkg_info b/ports/xz/pkg_info
deleted file mode 100644
index 3023a71..0000000
--- a/ports/xz/pkg_info
+++ /dev/null
@@ -1,6 +0,0 @@
-NAME=xz
-VERSION=5.2.0
-URL=http://tukaani.org/xz/xz-5.2.0.tar.xz
-LICENSE=GPL
-SHA1=586e4a49330b3a483d95965bac295120bd2e8917
-DEPENDS=(glibc-compat nacl-spawn)
diff --git a/ports/yajl/build.sh b/ports/yajl/build.sh
deleted file mode 100644
index 75a00ab..0000000
--- a/ports/yajl/build.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2011 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.
-
-EXECUTABLES=test/yajl_test
-EXTRA_CMAKE_ARGS="-DBUILD_SHARED=${NACL_SHARED}"
-
-TestStep() {
- local script=${BUILD_DIR}/test/yajl_test.sh
- (cd "${SRC_DIR}/test" && ./run_tests.sh "${script}")
-
- if [[ ${NACL_ARCH} == pnacl ]]; then
- # Re-run the tests with the x86-32 and arm translated binaries
- WriteLauncherScript ${script} yajl_test.x86-32.nexe
- (cd "${SRC_DIR}/test" && ./run_tests.sh "${script}")
- if [[ ${SEL_LDR_SUPPORTS_ARM} == 1 ]]; then
- WriteLauncherScript ${script} yajl_test.arm.nexe
- (cd "${SRC_DIR}/test" && ./run_tests.sh "${script}")
- fi
- fi
-}
-
-# Override configure step to force it use CMake. Without
-# this the default configure step will see the ruby ./configure
-# script at the top level of yajl (which doesn't work) and
-# try to run that.
-ConfigureStep() {
- ConfigureStep_CMake
-}
diff --git a/ports/yajl/nacl.patch b/ports/yajl/nacl.patch
deleted file mode 100644
index c3916c5..0000000
--- a/ports/yajl/nacl.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -37,20 +37,22 @@ SET(LIBRARY_OUTPUT_PATH ${libDir})
-
- ADD_LIBRARY(yajl_s STATIC ${SRCS} ${HDRS} ${PUB_HDRS})
-
--ADD_LIBRARY(yajl SHARED ${SRCS} ${HDRS} ${PUB_HDRS})
-+IF(BUILD_SHARED)
-+ ADD_LIBRARY(yajl SHARED ${SRCS} ${HDRS} ${PUB_HDRS})
-
--#### setup shared library version number
--SET_TARGET_PROPERTIES(yajl PROPERTIES
-- DEFINE_SYMBOL YAJL_SHARED
-- SOVERSION ${YAJL_MAJOR}
-- VERSION ${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO})
--
--#### ensure a .dylib has correct absolute installation paths upon installation
--IF(APPLE)
-- MESSAGE("INSTALL_NAME_DIR: ${CMAKE_INSTALL_PREFIX}/lib")
-+ #### setup shared library version number
- SET_TARGET_PROPERTIES(yajl PROPERTIES
-- INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
--ENDIF(APPLE)
-+ DEFINE_SYMBOL YAJL_SHARED
-+ SOVERSION ${YAJL_MAJOR}
-+ VERSION ${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO})
-+
-+ #### ensure a .dylib has correct absolute installation paths upon installation
-+ IF(APPLE)
-+ MESSAGE("INSTALL_NAME_DIR: ${CMAKE_INSTALL_PREFIX}/lib")
-+ SET_TARGET_PROPERTIES(yajl PROPERTIES
-+ INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
-+ ENDIF(APPLE)
-+ENDIF(BUILD_SHARED)
-
- #### build up an sdk as a post build step
-
-@@ -78,7 +80,9 @@ INCLUDE_DIRECTORIES(${incDir}/..)
- IF(NOT WIN32)
- # at build time you may specify the cmake variable LIB_SUFFIX to handle
- # 64-bit systems which use 'lib64'
-- INSTALL(TARGETS yajl LIBRARY DESTINATION lib${LIB_SUFFIX})
-+ IF(BUILD_SHARED)
-+ INSTALL(TARGETS yajl LIBRARY DESTINATION lib${LIB_SUFFIX})
-+ ENDIF(BUILD_SHARED)
- INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX})
- INSTALL(FILES ${PUB_HDRS} DESTINATION include/yajl)
- INSTALL(FILES ${incDir}/yajl_version.h DESTINATION include/yajl)
-diff --git a/test/run_tests.sh b/test/run_tests.sh
---- a/test/run_tests.sh
-+++ b/test/run_tests.sh
-@@ -68,6 +68,8 @@ for file in cases/*.json ; do
- # parse with a read buffer size ranging from 1-31 to stress stream parsing
- while [ $iter -lt 32 ] && [ $success = "SUCCESS" ] ; do
- $testBin $allowPartials $allowComments $allowGarbage $allowMultiple -b $iter < $file > ${file}.test 2>&1
-+ # sel_ldr poops out extra text to stderr.
-+ sed -i.bak -e"/^DEBUG MODE ENABLED/d" ${file}.test
- diff ${DIFF_FLAGS} ${file}.gold ${file}.test > ${file}.out
- if [ $? -eq 0 ] ; then
- if [ $iter -eq 31 ] ; then : $(( testsSucceeded += 1)) ; fi
diff --git a/ports/yajl/pkg_info b/ports/yajl/pkg_info
deleted file mode 100644
index 458f45f..0000000
--- a/ports/yajl/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=yajl
-VERSION=2.0.4
-URL=http://github.com/lloyd/yajl/archive/2.0.4/yajl-2.0.4.zip
-LICENSE=BSD
-# undefined __isinf
-SHA1=7751068e7b6b1859aeb7e6e2f5c534e84a9610f6
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/zeromq/README.nacl b/ports/zeromq/README.nacl
deleted file mode 100644
index 9fb80b0..0000000
--- a/ports/zeromq/README.nacl
+++ /dev/null
@@ -1,8 +0,0 @@
-This is a preliminary port of ZeroMQ; because of port and socket permissions
-this will not be particularly useful for all use cases to which ZeroMQ would
-normally be applied, but it will compile and enable local communication
-internal to a process.
-
-Future revisions and integration with nacl_io may enable it to be used as a
-websocket provider, easing communication between C/C++/Python libraries with
-websockets to the browser.
diff --git a/ports/zeromq/build.sh b/ports/zeromq/build.sh
deleted file mode 100644
index dfd5df5..0000000
--- a/ports/zeromq/build.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2011 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.
-
-export LIBS="-lnacl_io"
-
-EnableGlibcCompat
-
-if [ "${NACL_ARCH}" = "pnacl" ]; then
- NACLPORTS_CPPFLAGS+=" -DBYTE_ORDER=LITTLE_ENDIAN"
-fi
-
-NACLPORTS_CPPFLAGS+=" -DZMQ_FORCE_MUTEXES"
-
-ConfigureStep() {
- export CROSS_COMPILE=true
- EXTRA_CONFIGURE_ARGS+=" --disable-shared --enable-static --with-poller=poll"
- DefaultConfigureStep
-}
diff --git a/ports/zeromq/nacl.patch b/ports/zeromq/nacl.patch
deleted file mode 100644
index 3406762..0000000
--- a/ports/zeromq/nacl.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -338,9 +338,9 @@ top_build_prefix = @top_build_prefix@
- top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
- ACLOCAL_AMFLAGS = -I config
--@BUILD_PGM_FALSE@SUBDIRS = src doc perf tests tools
--@BUILD_PGM_TRUE@SUBDIRS = foreign/openpgm src doc perf tests tools
--DIST_SUBDIRS = foreign/openpgm src doc perf tests tools builds/msvc
-+@BUILD_PGM_FALSE@SUBDIRS = src
-+@BUILD_PGM_TRUE@SUBDIRS = src
-+DIST_SUBDIRS = src
- EXTRA_DIST = \
- autogen.sh \
- version.sh \
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -7032,7 +7032,7 @@ irix5* | irix6* | nonstopux*)
- ;;
-
- # This must be glibc/ELF.
--linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
-+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | nacl* | nacl*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-@@ -12488,6 +12488,17 @@ uts4*)
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-+nacl)
-+ if $CC -v 2>&1 | grep -q enable-shared; then
-+ dynamic_linker="GNU/NaCl ld.so"
-+ version_type=linux
-+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-+ soname_spec='${libname}${release}${shared_ext}$major'
-+ else
-+ dynamic_linker=no
-+ fi
-+ ;;
-+
- *)
- dynamic_linker=no
- ;;
-@@ -16320,6 +16331,17 @@ uts4*)
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-+nacl)
-+ if $CC -v 2>&1 | grep -q enable-shared; then
-+ dynamic_linker="GNU/NaCl ld.so"
-+ version_type=linux
-+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-+ soname_spec='${libname}${release}${shared_ext}$major'
-+ else
-+ dynamic_linker=no
-+ fi
-+ ;;
-+
- *)
- dynamic_linker=no
- ;;
-@@ -16975,7 +16997,9 @@ CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
-
- # OS-specific tests
- case "${host_os}" in
-- *linux*)
-+ *linux* | *nacl*)
-+ libzmq_pedantic="no"
-+ libzmq_werror="no"
- # Define on Linux to enable all library features. Define if using a gnu compiler
- if test "x$GXX" = "xyes"; then
- CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
-diff --git a/src/signaler.cpp b/src/signaler.cpp
---- a/src/signaler.cpp
-+++ b/src/signaler.cpp
-@@ -71,6 +71,7 @@
- #include "windows.hpp"
- #else
- #include <unistd.h>
-+#include <netinet/in.h>
- #include <netinet/tcp.h>
- #include <unistd.h>
- #include <sys/types.h>
-diff --git a/src/tcp_address.cpp b/src/tcp_address.cpp
---- a/src/tcp_address.cpp
-+++ b/src/tcp_address.cpp
-@@ -205,6 +205,58 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_)
-
- #endif
-
-+#ifdef __native_client__
-+
-+// TODO(sbc): Remove these functions when #315197 is closed.
-+
-+int gethostname(char *name, size_t len) {
-+ strncpy(name, "localhost", len);
-+ return 0;
-+}
-+
-+int getaddrinfo(const char *node, const char *service,
-+ const struct addrinfo *hints,
-+ struct addrinfo **res) {
-+ struct hostent* h = gethostbyname(node);
-+ if (!h)
-+ return EAI_FAIL;
-+
-+ struct sockaddr_in* addr = (struct sockaddr_in*) malloc(sizeof(struct sockaddr_in));
-+ addr->sin_family = h->h_addrtype;
-+ addr->sin_port = htons(atoi(service));
-+ memcpy(&addr->sin_addr, h->h_addr_list[0], h->h_length);
-+
-+ struct addrinfo* info = (struct addrinfo*) malloc(sizeof(struct addrinfo));
-+ info->ai_flags = 0;
-+ info->ai_family = addr->sin_family;
-+ info->ai_socktype = hints->ai_socktype;
-+ info->ai_protocol = hints->ai_protocol;
-+ info->ai_canonname = h->h_name;
-+ info->ai_addrlen = sizeof(*addr);
-+ info->ai_addr = (struct sockaddr*)addr;
-+ info->ai_next = NULL;
-+ *res = info;
-+ return 0;
-+}
-+
-+int getnameinfo(const struct sockaddr *sa, socklen_t salen,
-+ char *host, socklen_t hostlen,
-+ char *serv, socklen_t servlen, unsigned int flags) {
-+ if (sa->sa_family != AF_INET)
-+ return -1;
-+ const struct sockaddr_in* addr = (const struct sockaddr_in*)sa;
-+ if (host)
-+ strncpy(host, inet_ntoa(addr->sin_addr), hostlen);
-+ if (serv)
-+ snprintf(serv, servlen, "%d", ntohs(addr->sin_port));
-+ return 0;
-+}
-+
-+void freeaddrinfo(struct addrinfo *res) {
-+ free(res->ai_addr);
-+ free(res);
-+}
-+#endif
- int zmq::tcp_address_t::resolve_interface (const char *interface_, bool ipv6_)
- {
- // Initialize temporary output pointers with storage address.
-diff --git a/src/thread.cpp b/src/thread.cpp
---- a/src/thread.cpp
-+++ b/src/thread.cpp
-@@ -67,7 +67,7 @@ extern "C"
- {
- static void *thread_routine (void *arg_)
- {
--#if !defined ZMQ_HAVE_OPENVMS && !defined ZMQ_HAVE_ANDROID
-+#if !defined ZMQ_HAVE_OPENVMS && !defined ZMQ_HAVE_ANDROID && !defined __native_client__
- // Following code will guarantee more predictable latencies as it'll
- // disallow any signal handling in the I/O thread.
- sigset_t signal_set;
diff --git a/ports/zeromq/pkg_info b/ports/zeromq/pkg_info
deleted file mode 100644
index c4bd1de..0000000
--- a/ports/zeromq/pkg_info
+++ /dev/null
@@ -1,7 +0,0 @@
-NAME=zeromq
-VERSION=4.0.3
-URL=http://download.zeromq.org/zeromq-4.0.3.tar.gz
-LICENSE=LGPL3
-DEPENDS=(glibc-compat)
-SHA1=a363ddfff75f73976f656b3ba48f32544b214075
-DISABLED_TOOLCHAIN=(emscripten)
diff --git a/ports/zlib/build.sh b/ports/zlib/build.sh
deleted file mode 100644
index a2e6f77..0000000
--- a/ports/zlib/build.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (c) 2011 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.
-
-# zlib doesn't support custom build directories so we have
-# to build directly in the source dir.
-BUILD_DIR=${SRC_DIR}
-EXECUTABLES="minigzip${NACL_EXEEXT} example${NACL_EXEEXT}"
-if [ "${NACL_SHARED}" = "1" ]; then
- EXECUTABLES+=" libz.so.1"
-fi
-
-ConfigureStep() {
- local CONFIGURE_FLAGS="--prefix='${PREFIX}'"
- if [ "${TOOLCHAIN}" = "emscripten" ]; then
- # The emscripten toolchain will happily accept -shared (although it
- # emits a warning if the output name ends with .so). This means that
- # zlib's configure script tries to build shared as well as static
- # libraries until we explicitly disable shared libraries like this.
- CONFIGURE_FLAGS+=" --static"
- fi
- LogExecute rm -f libz.*
- SetupCrossEnvironment
- CFLAGS="${CPPFLAGS} ${CFLAGS}"
- CXXFLAGS="${CPPFLAGS} ${CXXFLAGS}"
- CHOST=${NACL_CROSS_PREFIX} LogExecute ./configure ${CONFIGURE_FLAGS}
-}
-
-RunMinigzip() {
- echo "Running minigzip test"
- export SEL_LDR_LIB_PATH=.
- if echo "hello world" | ./minigzip | ./minigzip -d; then
- echo ' *** minigzip test OK ***'
- else
- echo ' *** minigzip test FAILED ***'
- exit 1
- fi
- unset SEL_LDR_LIB_PATH
-}
-
-RunExample() {
- echo "Running exmple test"
- export SEL_LDR_LIB_PATH=.
- # This second test does not yet work on nacl (gzopen fails)
- if ./example; then \
- echo ' *** zlib test OK ***'; \
- else \
- echo ' *** zlib test FAILED ***'; \
- exit 1
- fi
- unset SEL_LDR_LIB_PATH
-}
-
-TestStep() {
- RunExample
- RunMinigzip
- if [[ ${NACL_ARCH} == pnacl ]]; then
- # Run the minigzip tests again but with x86-32 and arm translations
- WriteLauncherScript minigzip minigzip.x86-32.nexe
- RunMinigzip
- if [[ ${SEL_LDR_SUPPORTS_ARM} == 1 ]]; then
- WriteLauncherScript minigzip minigzip.arm.nexe
- RunMinigzip
- fi
- fi
-}
diff --git a/ports/zlib/diff_skip.txt b/ports/zlib/diff_skip.txt
deleted file mode 100644
index 7e73deb..0000000
--- a/ports/zlib/diff_skip.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-zconf.h
diff --git a/ports/zlib/nacl.patch b/ports/zlib/nacl.patch
deleted file mode 100644
index 720f3b8..0000000
--- a/ports/zlib/nacl.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -188,6 +188,13 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
- *BSD | *bsd* | DragonFly)
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
- LDCONFIG="ldconfig -m" ;;
-+ pnacl)
-+ EXE='.pexe' ;;
-+ nacl)
-+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
-+ EXE='.nexe' ;;
-+ emscripten)
-+ EXE='.js' ;;
- CYGWIN* | Cygwin* | cygwin* | OS/2*)
- EXE='.exe' ;;
- MINGW* | mingw*)
diff --git a/ports/zlib/pkg_info b/ports/zlib/pkg_info
deleted file mode 100644
index 22f1701..0000000
--- a/ports/zlib/pkg_info
+++ /dev/null
@@ -1,5 +0,0 @@
-NAME=zlib
-VERSION=1.2.8
-URL=http://www.zlib.net/zlib-1.2.8.tar.gz
-LICENSE=CUSTOM:README
-SHA1=a4d316c404ff54ca545ea71a27af7dbc29817088
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 01de8c2..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-colorama==0.3.3
-coverage==3.7.1
-mock==1.0.1
-nose-timer==0.3.0
-nose==1.3.4
-pylint==1.4.4
-rednose==0.4.1
-termcolor==1.1.0
-yapf==0.1.8