[build] removing nlbuild-autotools for subtree replacement

This commit is contained in:
Jonathan Hui
2018-04-11 08:59:23 -07:00
parent 13b0de60e5
commit 05e8108c75
89 changed files with 0 additions and 34785 deletions
-1
View File
@@ -1 +0,0 @@
1.4
@@ -1 +0,0 @@
.local-version
-63
View File
@@ -1,63 +0,0 @@
1.4 (2017-06-15)
* Remove package archives and prebuilt in-package binaries.
* Ensure that GNU tool build process is completely self-sufficient
and has no dependencies on installed host binaries.
* Add support for generating versioned core and prebuilt package binary
distirubtions.
* Ensure that 'bootstrap' can work with either prebuilt in-package
binaries or with installed host binaries.
1.3.1 (2017-05-10)
* Specify the correct m4 URL.
1.3 (2016-12-05)
* Added the support for detection of supported C++ version.
1.2.2 (2016-08-29)
* Use the arguments passed, as designed and intended, to
NL_PROG_LNDIR rather than hard-coded values for the GNU cp
fallback.
1.2.1 (2016-07-13)
* Make the 'pretty' and 'pretty-check' targets dependent on
$(PRETTY_FILES) and then iterate on a filtered version of $(^) so
that make's VPATH engine can be leveraged to find sources and
headers that are not in directly stat-able paths listed in
$(PRETTY_FILES).
1.2 (2016-06-01)
* Added support for coding style formatting and checking targets.
1.1.2 (2016-03-19)
* Improve the code coverage generation process to cover an entire
project's source.
1.1.1 (2015-12-10)
* Properly handle package optionality when using pkg-config to
detect external packages.
1.1 (2015-11-10)
* Added support for a recursive 'install-headers' target to allow
packages that wish to leverage it to install their public headers
and only their public headers to DESTDIR on 'make install-headers'
without performing any additional build actions.
1.0.1 (2015-10-27)
* Refactored NL_WITH_PACKAGE into NL_WITH_REQUIRED_EXTERNAL_PACKAGE,
NL_WITH_OPTIONAL_EXTERNAL_PACKAGE, NL_WITH_REQUIRED_INTERNAL_PACKAGE,
and NL_WITH_OPTIONAL_INTERNAL_PACKAGE.
1.0 (2015-03-19)
* Initial revision with GNU m4 1.4.17, autoconf 2.68, automake 1.14.1,
libtool 2.4.2, make 3.82, and coreutils 8.21.
-27
View File
@@ -1,27 +0,0 @@
Want to contribute? Great! First, read this page (including the small print at the end).
### Before you contribute
Before we can use your code, you must sign the
[Google Individual Contributor License Agreement]
(https://cla.developers.google.com/about/google-individual)
(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.
### Code reviews
All submissions, including submissions by project members, require review. We
use Github pull requests for this purpose.
### The small print
Contributions made by corporations are covered by a different agreement than
the one above, the
[Software Grant and Corporate Contributor License Agreement]
(https://cla.developers.google.com/about/google-corporate).
-129
View File
@@ -1,129 +0,0 @@
#
# Copyright 2017 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This make file header defines common variables, rules, and
# targets for maintaining nlbuild-autotools distributions.
#
.DEFAULT_GOAL = all
#
# This package
#
PACKAGE := nlbuild-autotools
#
# Tools
#
CAT ?= cat
CHMOD ?= chmod
CMP ?= cmp
FIND ?= find
GZIP ?= gzip
MKDIR ?= mkdir
MV ?= mv
RM ?= rm
SED ?= sed
TAR ?= tar
XZ ?= xz
dist_tar_ARCHIVE = $(TAR) -chof -
dist_tgz_ARCHIVE = $(dist_tar_ARCHIVE)
dist_tgz_COMPRESS = $(GZIP) --best -c
dist_txz_ARCHIVE = $(dist_tar_ARCHIVE)
dist_txz_COMPRESS = $(XZ) --extreme -c
TGZ_EXTENSION := .tar.gz
TXZ_EXTENSION := .tar.xz
DIST_TARGETS ?= dist-tgz dist-txz
DIST_ARCHIVES = $(dist_tgz_TARGETS) $(dist_txz_TARGETS)
#
# Verbosity
#
NL_DEFAULT_VERBOSITY = 0
NL_V_AT = $(NL_V_AT_$(V))
NL_V_AT_ = $(NL_V_AT_$(NL_DEFAULT_VERBOSITY))
NL_V_AT_0 = @
NL_V_AT_1 =
NL_V_MAKE = $(NL_V_MAKE_$(V))
NL_V_MAKE_ = $(NL_V_MAKE_$(NL_DEFAULT_VERBOSITY))
NL_V_MAKE_0 = @echo " MAKE $(@)";
NL_V_MAKE_1 =
NL_V_MKDIR_P = $(NL_V_MKDIR_P_$(V))
NL_V_MKDIR_P_ = $(NL_V_MKDIR_P_$(NL_DEFAULT_VERBOSITY))
NL_V_MKDIR_P_0 = @echo " MKDIR $(1)";
NL_V_MKDIR_P_1 =
NL_V_RMDIR = $(NL_V_RMDIR_$(V))
NL_V_RMDIR_ = $(NL_V_RMDIR_$(NL_DEFAULT_VERBOSITY))
NL_V_RMDIR_0 = @echo " RMDIR $(1)";
NL_V_RMDIR_1 =
NL_V_TGZ = $(NL_V_TGZ_$(V))
NL_V_TGZ_ = $(NL_V_TGZ_$(NL_DEFAULT_VERBOSITY))
NL_V_TGZ_0 = @echo " TGZ $(@)";
NL_V_TGZ_1 =
NL_V_TXZ = $(NL_V_TXZ_$(V))
NL_V_TXZ_ = $(NL_V_TXZ_$(NL_DEFAULT_VERBOSITY))
NL_V_TXZ_0 = @echo " TXZ $(@)";
NL_V_TXZ_1 =
#
# nl-create-dir <directory>
#
# Create the specified directory, including any parent directories
# that may not exist.
#
define nl-create-dir
$(NL_V_AT)echo " MKDIR $(1)"; \
$(MKDIR) -p "$(1)"
endef # nl-create-dir
#
# nl-remove-dir <directory>
#
# If the specified directory exists, then ensure all of the
# directories are writable by the current user, and then forcibly
# remove the directory and all of its contents, sleeping for five (5)
# seconds and failure before trying the removal again.
#
define nl-remove-dir
$(NL_V_RMDIR) \
if [ -d "$(1)" ]; then \
$(FIND) "$(1)" -type d ! -perm -200 -exec $(CHMOD) u+w {} ';' \
&& $(RM) -rf "$(1)" \
|| { sleep 5 && $(RM) -rf "$(1)"; }; \
fi
endef # nl-remove-dir
clean-local:
$(NL_V_AT)$(RM) -f *~ "#"*
help:
@echo "This make file shold not be needed for end users and system "
@echo "integrators of $(PACKAGE). It should only be needed by "
@echo "maintainers producing distributions of $(PACKAGE)."
-202
View File
@@ -1,202 +0,0 @@
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.
-86
View File
@@ -1,86 +0,0 @@
.default-version
.gitignore
CHANGES
CONTRIBUTING.md
LICENSE
MANIFEST
Makefile
README.md
autoconf/ar-lib
autoconf/compile
autoconf/config.guess
autoconf/config.sub
autoconf/depcomp
autoconf/install-sh
autoconf/ltmain.sh
autoconf/m4/ax_check_compiler.m4
autoconf/m4/ax_check_file.m4
autoconf/m4/ax_check_preprocessor.m4
autoconf/m4/ax_compare_version.m4
autoconf/m4/ax_cxx_compile_stdcxx.m4
autoconf/m4/ax_cxx_compile_stdcxx_0x.m4
autoconf/m4/ax_cxx_compile_stdcxx_11.m4
autoconf/m4/ax_cxx_compile_stdcxx_14.m4
autoconf/m4/ax_jni_include_dir.m4
autoconf/m4/ax_prog_doxygen.m4
autoconf/m4/ax_pthread.m4
autoconf/m4/libtool.m4
autoconf/m4/ltoptions.m4
autoconf/m4/ltsugar.m4
autoconf/m4/ltversion.m4
autoconf/m4/lt~obsolete.m4
autoconf/m4/nl_enable_coverage.m4
autoconf/m4/nl_enable_coverage_reporting.m4
autoconf/m4/nl_enable_debug.m4
autoconf/m4/nl_enable_docs.m4
autoconf/m4/nl_enable_optimization.m4
autoconf/m4/nl_enable_tests.m4
autoconf/m4/nl_enable_werror.m4
autoconf/m4/nl_filtered_canonical.m4
autoconf/m4/nl_prog_lndir.m4
autoconf/m4/nl_werror.m4
autoconf/m4/nl_with_package.m4
autoconf/m4/pkg.m4
autoconf/missing
autoconf/mkinstalldirs
autoconf/py-compile
autoconf/test-driver
automake/post.am
automake/post/rules.am
automake/post/rules/coverage.am
automake/post/rules/headers.am
automake/post/rules/pretty.am
automake/pre.am
automake/pre/macros.am
automake/pre/macros/constants.am
automake/pre/macros/coverage.am
automake/pre/macros/paths.am
automake/pre/macros/pretty.am
automake/pre/macros/subdirs.am
automake/pre/macros/verbosity.am
etc/lcov.config
examples/Doxyfile.in
examples/Makefile-doc.am
examples/Makefile-fps.am
examples/Makefile-src.am
examples/Makefile-tests.am
examples/Makefile-toplevel.am
examples/bootstrap
examples/configure.ac
scripts/bootstrap
scripts/bootstrap-configure
scripts/mkskeleton
scripts/mkversion
tools/packages/autoconf/autoconf.url
tools/packages/autoconf/autoconf.version
tools/packages/automake/automake.url
tools/packages/automake/automake.version
tools/packages/coreutils/coreutils.url
tools/packages/coreutils/coreutils.version
tools/packages/libtool/libtool.url
tools/packages/libtool/libtool.version
tools/packages/m4/m4.url
tools/packages/m4/m4.version
tools/packages/make/make.url
tools/packages/make/make.version
-225
View File
@@ -1,225 +0,0 @@
#
# Copyright 2017 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This make file supports generating distributions of
# nlbuild-autotools.
#
include Common.mak
#
# Build directories
#
builddir := .
top_builddir := .
abs_builddir := $(CURDIR)
abs_top_builddir := $(CURDIR)
#
# Source directories
#
srcdir := .
top_srcdir := .
abs_srcdir := $(CURDIR)
abs_top_srcdir := $(CURDIR)
distdir = $(PACKAGE)-$(VERSION)
dist_tgz_TARGETS = $(distdir)$(TGZ_EXTENSION)
dist_txz_TARGETS = $(distdir)$(TXZ_EXTENSION)
DISTFILES := $(shell $(CAT) MANIFEST)
#
# Package version files:
#
# .default-version - The default package version. This file is ALWAYS checked
# in and should always represent the current baseline
# version of the package.
#
# .dist-version - The distributed package version. This file is NEVER
# checked in within the upstream repository, is auto-
# generated, and is only found in the package distribution.
#
# .local-version - The current source code controlled package version. This
# file is NEVER checked in within the upstream repository,
# is auto-generated, and can always be found in both the
# build tree and distribution.
#
# When present, the .local-version file is preferred first, the
# .dist-version second, and the .default-version last.
#
VERSION_FILE := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version))
PACKAGE_VERSION ?= $(shell $(CAT) $(VERSION_FILE) 2> /dev/null)
VERSION = $(PACKAGE_VERSION)
#
# Verbosity
#
_NL_V_COPY = $(_NL_V_COPY_$(V))
_NL_V_COPY_ = $(_NL_V_COPY_$(NL_DEFAULT_VERBOSITY))
_NL_V_COPY_0 = @for file in $(DISTFILES); do echo " COPY $${file}"; done;
_NL_V_COPY_1 =
_NL_V_MAKE = $(_NL_V_MAKE_$(V))
_NL_V_MAKE_ = $(_NL_V_MAKE_$(NL_DEFAULT_VERBOSITY))
_NL_V_MAKE_0 = @echo " MAKE dist-hook";
_NL_V_MAKE_1 =
#
# check-file <macro suffix>
#
# Check whether a file, referenced by the $(@) variable, should be
# updated / regenerated based on its dependencies, referenced by the
# $(<) variable by running the make macro check-file-<macro suffix>.
#
# The $(<) is passed as the first argument if the macro wants to process
# it and the prospective new output file, which the macro MUST
# generate, as the second.
#
# This macro will ensure that any required parent directories are created
# prior to invoking check-file-<macro suffix>.
#
# This macro is similar to and inspired by that from Linux Kbuild and
# elsewhere.
#
# <macro suffix> - The name, suffixed to "check-file-", which indicates
# the make macro to invoke.
#
#
define check-file
$(NL_V_AT)set -e; \
echo ' CHECK $(@)'; \
$(MKDIR) -p $(dir $(@)); \
$(call check-file-$(1),$(<),$(@).N); \
if [ -r "$(@)" ] && $(CMP) -s "$(@)" "$(@).N"; then \
$(RM) -f "$(@).N"; \
else \
echo ' GEN $(@)'; \
$(MV) -f "$(@).N" "$(@)"; \
fi
endef # check-file
#
# check-file-.local-version
#
# Speculatively regenerate .local-version and check to see if it needs
# to be updated.
#
# If PACKAGE_VERSION has been supplied anywhere other than in this file
# (which is implicitly the contents of .local-version), then use that;
# otherwise, attempt to generate it from the SCM system.
#
# This is called from $(call check-file,.local-version).
#
define check-file-.local-version
if [ "$(origin PACKAGE_VERSION)" != "file" ]; then \
echo "$(PACKAGE_VERSION)" > "$(2)"; \
else \
$(abs_top_srcdir)/scripts/mkversion \
-b "$(PACKAGE_VERSION)" "$(top_srcdir)" \
> "$(2)"; \
fi
endef
#
# check-file-.dist-version
#
# Speculatively regenerate .dist-version and check to see if it needs
# to be updated.
#
# This is called from $(call check-file,.dist-version).
#
define check-file-.dist-version
$(CAT) "$(1)" > "$(2)"
endef
#
# Version file regeneration rules.
#
.PHONY: force
$(builddir)/.local-version: $(srcdir)/.default-version force
$(distdir)/.dist-version: $(builddir)/.local-version force
$(distdir)/.dist-version $(builddir)/.local-version:
$(call check-file,$(@F))
all: .local-version
dist-hook: $(distdir)/.dist-version
#
# Stage the distribution files to a distribution directory
#
stage: $(DISTFILES) .local-version
$(call nl-remove-dir,$(distdir))
$(call nl-create-dir,$(distdir))
$(_NL_V_MAKE)$(MAKE) -s distdir="$(distdir)" dist-hook
$(_NL_V_COPY)(cd $(abs_top_srcdir); $(dist_tar_ARCHIVE) $(DISTFILES) | (cd $(abs_builddir)/$(distdir); $(TAR) xfBp -))
#
# Produce an architecture-independent distribution using a tar archive
# with gzip compression
#
$(dist_tgz_TARGETS): stage
$(NL_V_TGZ)$(dist_tgz_ARCHIVE) $(distdir) | $(dist_tgz_COMPRESS) > "$(@)"
#
# Produce an architecture-independent distribution using a tar archive
# with xz compression
#
$(dist_txz_TARGETS): stage
$(NL_V_TXZ)$(dist_txz_ARCHIVE) $(distdir) | $(dist_txz_COMPRESS) > "$(@)"
#
# Produce an architecture-independent distribution of the
# nlbuild-autotools core.
#
dist: $(DIST_TARGETS) .local-version
$(call nl-remove-dir,$(distdir))
dist-tgz: $(dist_tgz_TARGETS)
dist-txz: $(dist_txz_TARGETS)
#
# Produce prebuilt GNU autotools binaries for the architecture of the
# CURRENT build machine and install them in THIS nlbuild-autotools
# package.
#
.PHONY: tools
tools:
$(NL_V_MAKE)$(MAKE) -C tools $(@)
#
# Produce prebuilt GNU autotools architecture-dependent and -independent
# binaries for the architecture of the CURRENT build machine and PACKAGE
# them up for EXTERNAL distribution.
#
toolsdist: .local-version
$(NL_V_MAKE)$(MAKE) -C tools $(@)
clean: clean-local
$(NL_V_MAKE)$(MAKE) -C tools $(@)
-180
View File
@@ -1,180 +0,0 @@
Nest Labs Build - GNU Autotools
===============================
# Introduction
The Nest Labs Build - GNU Autotools (nlbuild-autotools) provides a
customized, turnkey build system framework, based on GNU autotools, for
standalone Nest Labs (or other) software packages that need to support
not only building on and targeting against standalone build host
systems but also embedded target systems using GCC-based or
-compatible toolchains.
# Users and System Integrators
## Getting Started
This project is typically subtreed (or git submoduled) into a target
project repository and serves as the seed for that project's build
system.
Assuming that you already have a project repository established in
git, perform the following in your project repository:
```
1. % git remote add nlbuild-autotools ssh://<PATH_TO_REPOSITORY>/nlbuild-autotools.git
2. % git fetch nlbuild-autotools
```
You can place the nlbuild-autotools package anywhere in your project;
however, by convention, "third_party/nlbuild-autotools/repo" is recommended:
```
3. % mkdir third_party
4. % git subtree add --prefix=third_party/nlbuild-autotools/repo --squash --message="Add subtree mirror of repository 'ssh://<PATH_TO_REPOSITORY>/nlbuild-autotools.git' branch 'master' at commit 'HEAD'." nlbuild-autotools HEAD
```
At this point, you now have the nlbuild-autotools package integrated
into your project. The next step is using the
nlbuild-autotools-provided examples as templates. To do this, a
convenience script has been provided that will get you started. You
can tune and customize the results, as needed, for your project. From
the top level of your project tree:
```
5. % third_party/nlbuild-autotools/repo/scripts/mkskeleton -I third_party/nlbuild-autotools/repo --package-description "My Fantastic Package" --package-name "mfp"
```
## Supported Build Host Systems
For Linux users, you likely already have GNU autotools installed through your system's distribution (e.g. Ubuntu). However, if your GNU autotools packages are incomplete or downrevision relative to what's required from nlbuild-autotools, nlbuild-autotools can be built and installed or can be downloaded and expanded in your local nlbuild-autotools tree.
The nlbuild-autotools system supports and has been tested against the
following POSIX-based build host systems:
* i686-pc-cygwin
* i686-pc-linux-gnu
* x86_64-apple-darwin
* x86_64-unknown-linux-gnu
### Build and Install
Simply invoke `make tools` at the top-level of your nlbuild-autotools tree.
### Download and Expand
Alongside nlbuild-autotools distributions are pre-built
architecture-independent and -dependent distributions of the form:
* nlbuild-autotools-common-_version_.tar.{gz,xz}
* nlbuild-autotools-_host_-_version_.tar.{gz,xz}
Find and download the appropriate pair of nlbuild-autotools-common and
nlbuild-autotools-_host_ for your system and then expand them from the
top-level of your nlbuild-autotools tree with a command similar to the
following example:
```
% tar --directory tools/host -zxvf nlbuild-autotools-common-1.1.tar.gz
% tar --directory tools/host -zxvf nlbuild-autotools-x86_64-unknown-linux-gnu-1.1.tar.gz
```
Please see the [FAQ](#FAQ) section for more background on why this package
provides options for these pre-built tools.
## Package Organization
The nlbuild-autotools package is laid out as follows:
| Directory | Description |
|--------------------------------------|------------------------------------------------------------------------------------------|
| autoconf/ | GNU autoconf infrastructure provided by nlbuild-autotools. |
| autoconf/m4/ | GNU m4 macros for configure.ac provided by nlbuild-autotools. |
| automake/ | GNU automake Makefile.am header and footer infrastructure provided by nlbuild-autotools. |
| automake/post/ | GNU automake Makefile.am footers. |
| automake/post.am | GNU automake Makefile.am footer included by every makefile. |
| automake/pre/ | GNU automake Makefile.am headers. |
| automake/pre.am | GNU automake Makefile.am header included by every makefile. |
| examples/ | Example template files for starting your own nlbuild-autotools-based project. |
| scripts/ | Automation scripts for regenerating the build system and for managing package versions. |
| tools/ | Qualified packages of and pre-built instances of GNU autotools. |
| tools/host/ | Pre-built instances of GNU autotools (if installed). |
| tools/host/i686-pc-cygwin/ | Pre-built instances of GNU autotools for 32-bit Cygwin (if installed). |
| tools/host/i686-pc-linux-gnu/ | Pre-built instances of GNU autotools for 32-bit Linux (if installed). |
| tools/host/x86_64-apple-darwin/ | Pre-built instances of GNU autotools for 64-bit Mac OS X (if installed). |
| tools/host/x86_64-unknown-linux-gnu/ | Pre-built instances of GNU autotools for 64-bit Linux (if installed). |
| tools/packages/ | Qualified packages for GNU autotools. |
# FAQ {#FAQ}
Q: Why does nlbuild-autotools have an option for its own built versions
of GNU autotools rather than leveraging whatever versions exist on
the build host system?
A: Some build host systems such as Mac OS X may not have GNU autotools
at all. Other build host systems, such as Linux, may have different
distributions or different versions of those distributions in which
the versions of GNU autotools are apt to be different.
This differences lead to different primary and secondary autotools
output and, as a consequence, a divergent user and support
experience. To avoid this, this package provides a pre-built,
qualified set of GNU autotools along with a comprehensive,
standalone set of scripts to drive them without reliance on those
versions of the tools on the build host system.
## Maintainers
If you are maintaining nlbuild-autotools, you have several key things to know:
1. Generating nlbuild-autotools distributions
2. Generating optional nlbuild-autotools prebuilt binary distributions.
3. Upgrading GNU autotools packages.
### Generating Distributions
To generate a nlbuild-autotools distribution, simply invoke:
```
% make dist
```
The package version will come from tags in the source code control
system, if available; otherwise, from '.default-version'. The version
can be overridden from the PACKAGE_VERSION or VERSION environment
variables.
The resulting archive will be at the top of the package build
directory.
### Generating Optional Prebuilt Binary Distributions
To generate an optional nlbuild-autotools prebuilt binary
distribution, simply invoke:
```
% make toolsdist
```
The package version will come from the source code control system, if
available; otherwise, from `.default-version`. The version can be
overridden from the _PACKAGE_VERSION_ or _VERSION_ environment variables.
The resulting archives will be at the top of the package build
directory.
### Upgrading GNU Autotools Packages
To change or upgrade GNU autotools packages used by nlbuild-autotools,
edit the metadata for each package in tools/packages/_package_/
_package_.{url,version}.
# Versioning
nlbuild-autools follows the [Semantic Versioning guidelines](http://semver.org/)
for release cycle transparency and to maintain backwards compatibility.
# License
nlbuild-autools is released under the [Apache License, Version 2.0 license](https://opensource.org/licenses/Apache-2.0).
See the `LICENSE` file for more information.
-270
View File
@@ -1,270 +0,0 @@
#! /bin/sh
# Wrapper for Microsoft lib.exe
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2013 Free Software Foundation, Inc.
# Written by Peter Rosin <[email protected]>.
#
# 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, 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 file is maintained in Automake, please report
# bugs to <[email protected]> or send patches to
# <[email protected]>.
# func_error message
func_error ()
{
echo "$me: $1" 1>&2
exit 1
}
file_conv=
# func_file_conv build_file
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv in
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_at_file at_file operation archive
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
# for each of them.
# When interpreting the content of the @FILE, do NOT use func_file_conv,
# since the user would need to supply preconverted file names to
# binutils ar, at least for MinGW.
func_at_file ()
{
operation=$2
archive=$3
at_file_contents=`cat "$1"`
eval set x "$at_file_contents"
shift
for member
do
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
done
}
case $1 in
'')
func_error "no command. Try '$0 --help' for more information."
;;
-h | --h*)
cat <<EOF
Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
Members may be specified in a file named with @FILE.
EOF
exit $?
;;
-v | --v*)
echo "$me, version $scriptversion"
exit $?
;;
esac
if test $# -lt 3; then
func_error "you must specify a program, an action and an archive"
fi
AR=$1
shift
while :
do
if test $# -lt 2; then
func_error "you must specify a program, an action and an archive"
fi
case $1 in
-lib | -LIB \
| -ltcg | -LTCG \
| -machine* | -MACHINE* \
| -subsystem* | -SUBSYSTEM* \
| -verbose | -VERBOSE \
| -wx* | -WX* )
AR="$AR $1"
shift
;;
*)
action=$1
shift
break
;;
esac
done
orig_archive=$1
shift
func_file_conv "$orig_archive"
archive=$file
# strip leading dash in $action
action=${action#-}
delete=
extract=
list=
quick=
replace=
index=
create=
while test -n "$action"
do
case $action in
d*) delete=yes ;;
x*) extract=yes ;;
t*) list=yes ;;
q*) quick=yes ;;
r*) replace=yes ;;
s*) index=yes ;;
S*) ;; # the index is always updated implicitly
c*) create=yes ;;
u*) ;; # TODO: don't ignore the update modifier
v*) ;; # TODO: don't ignore the verbose modifier
*)
func_error "unknown action specified"
;;
esac
action=${action#?}
done
case $delete$extract$list$quick$replace,$index in
yes,* | ,yes)
;;
yesyes*)
func_error "more than one action specified"
;;
*)
func_error "no action specified"
;;
esac
if test -n "$delete"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
for member
do
case $1 in
@*)
func_at_file "${1#@}" -REMOVE "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
;;
esac
done
elif test -n "$extract"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
if test $# -gt 0; then
for member
do
case $1 in
@*)
func_at_file "${1#@}" -EXTRACT "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
;;
esac
done
else
$AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
do
$AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
done
fi
elif test -n "$quick$replace"; then
if test ! -f "$orig_archive"; then
if test -z "$create"; then
echo "$me: creating $orig_archive"
fi
orig_archive=
else
orig_archive=$archive
fi
for member
do
case $1 in
@*)
func_file_conv "${1#@}"
set x "$@" "@$file"
;;
*)
func_file_conv "$1"
set x "$@" "$file"
;;
esac
shift
shift
done
if test -n "$orig_archive"; then
$AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
else
$AR -NOLOGO -OUT:"$archive" "$@" || exit $?
fi
elif test -n "$list"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
$AR -NOLOGO -LIST "$archive" || exit $?
fi
-310
View File
@@ -1,310 +0,0 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-01-04.17; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
# Software Foundation, Inc.
# Written by Tom Tromey <[email protected]>.
#
# 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, 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 file is maintained in Automake, please report
# bugs to <[email protected]> or send patches to
# <[email protected]>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l*)
lib=${1#-l}
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
set x "$@" "$dir/$lib.dll.lib"
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
set x "$@" "$dir/$lib.lib"
break
fi
done
IFS=$save_IFS
test "$found" != yes && set x "$@" "$lib.lib"
shift
;;
-L*)
func_file_conv "${1#-L}"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <[email protected]>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-791
View File
@@ -1,791 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# 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, 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.
# Originally written by Alexandre Oliva <[email protected]>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <[email protected]>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
-527
View File
@@ -1,527 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-01-19.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# 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
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for `test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
File diff suppressed because it is too large Load Diff
@@ -1,108 +0,0 @@
#
# Copyright 2014-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# _AX_CHECK_COMPILER_OPTION_WITH_VAR(language, variable, option)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# variable - The variable to add the checked compiler option to.
# option - The compiler flag to check.
#
# Add, if supported, the specified compiler flag for the compiler selected
# for the specified language to the provided variable.
# ----------------------------------------------------------------------------
AC_DEFUN([_AX_CHECK_COMPILER_OPTION_WITH_VAR],
[
AC_LANG_PUSH($1)
AC_MSG_CHECKING([whether the _AC_LANG compiler understands $3])
SAVE_[]_AC_LANG_PREFIX[]FLAGS=${_AC_LANG_PREFIX[]FLAGS}
SAVE_$2=${$2}
_AC_LANG_PREFIX[]FLAGS=$3
AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); _AC_LANG_PREFIX[]FLAGS="${SAVE_[]_AC_LANG_PREFIX[]FLAGS}"; $2="${SAVE_$2} $3",AC_MSG_RESULT([no]); _AC_LANG_PREFIX[]FLAGS=${SAVE_[]_AC_LANG_PREFIX[]FLAGS}; $2=${SAVE_$2});
unset SAVE_[]_AC_LANG_PREFIX[]FLAGS
unset SAVE_$2
AC_LANG_POP($1)
])
#
# _AX_CHECK_COMPILER_OPTION(language, option)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# option - The compiler flag to check.
#
# Add, if supported, the specified compiler flag for the compiler selected
# for the specified language.
# ----------------------------------------------------------------------------
AC_DEFUN([_AX_CHECK_COMPILER_OPTION],
[
AC_LANG_PUSH($1)
AC_MSG_CHECKING([whether the _AC_LANG compiler understands $2])
SAVE_[]_AC_LANG_PREFIX[]FLAGS=${_AC_LANG_PREFIX[]FLAGS}
_AC_LANG_PREFIX[]FLAGS=$2
AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); _AC_LANG_PREFIX[]FLAGS="${SAVE_[]_AC_LANG_PREFIX[]FLAGS} $2",AC_MSG_RESULT([no]); _AC_LANG_PREFIX[]FLAGS=${SAVE_[]_AC_LANG_PREFIX[]FLAGS});
unset SAVE_[]_AC_LANG_PREFIX[]FLAGS
AC_LANG_POP($1)
])
#
# AX_CHECK_COMPILER_OPTION(language, [variable,] option)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# variable - If supplied, the variable to add the checked compiler option
# to.
# option - The compiler flag to check.
#
# Add, if supported, the specified compiler flag for the compiler selected
# for the specified language, optionally saving it to the specified variable.
# ----------------------------------------------------------------------------
AC_DEFUN([AX_CHECK_COMPILER_OPTION],
[
ifelse($#,
3,
[_AX_CHECK_COMPILER_OPTION_WITH_VAR($1, $2, $3)],
[_AX_CHECK_COMPILER_OPTION($1, $2)])
])
#
# AX_CHECK_COMPILER_OPTIONS(language, [variable,] option ...)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# variable - If supplied, the variable to add the checked compiler option
# to.
# options - The compiler flags to check.
#
# Add, if supported, the specified compiler flags for the compiler selected
# for the specified language, optionally saving it to the specified variable.
# ----------------------------------------------------------------------------
AC_DEFUN([AX_CHECK_COMPILER_OPTIONS],
[
ifelse($#,
3,
[
for ax_compiler_option in [$3]; do
_AX_CHECK_COMPILER_OPTION_WITH_VAR([$1], [$2], $ax_compiler_option)
done
],
[
for ax_compiler_option in [$2]; do
_AX_CHECK_COMPILER_OPTION([$1], $ax_compiler_option)
done
])
])
@@ -1,42 +0,0 @@
#
# Copyright 2014-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file implements a GNU M4 autoconf macro for checking for
# the existence of files.
#
# The autoconf version of AC_CHECK_FILE is absolutely broken in
# that it cannot check for files when cross-compiling even though
# the only thing it relies upon is a shell file readability
# check.
#
# AX_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------------------------
#
# Check for the existence of FILE.
AC_DEFUN([AX_CHECK_FILE],
[AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
AC_CACHE_CHECK([for $1], [ac_File],
[if test -r "$1"; then
AS_VAR_SET([ac_File], [yes])
else
AS_VAR_SET([ac_File], [no])
fi])
AS_VAR_IF([ac_File], [yes], [$2], [$3])
AS_VAR_POPDEF([ac_File])dnl
])# AX_CHECK_FILE
@@ -1,116 +0,0 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a number of GNU autoconf M4-style macros
# for checking language-specific preprocessor options.
#
#
# _AX_CHECK_PREPROCESSOR_OPTION_WITH_VAR(language, variable, option)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# variable - The variable to add the checked preprocessor option to.
# option - The preprocessor flag to check.
#
# Add, if supported, the specified preprocessor flag for the preprocessor
# selected for the specified language to the provided variable.
# ----------------------------------------------------------------------------
AC_DEFUN([_AX_CHECK_PREPROCESSOR_OPTION_WITH_VAR],
[
AC_LANG_PUSH($1)
AC_MSG_CHECKING([whether the _AC_LANG preprocessor understands $3])
SAVE_CPPFLAGS=${CPPFLAGS}
SAVE_$2=${$2}
CPPFLAGS=$3
AC_TRY_CPP(,AC_MSG_RESULT([yes]); CPPFLAGS="${SAVE_CPPFLAGS}"; $2="${SAVE_$2} $3",AC_MSG_RESULT([no]); CPPFLAGS=${SAVE_CPPFLAGS}; $2=${SAVE_$2});
unset SAVE_CPPFLAGS
unset SAVE_$2
AC_LANG_POP($1)
])
#
# _AX_CHECK_PREPROCESSOR_OPTION(language, option)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# option - The preprocessor flag to check.
#
# Add, if supported, the specified preprocessor flag for the preprocessor
# selected for the specified language.
# ----------------------------------------------------------------------------
AC_DEFUN([_AX_CHECK_PREPROCESSOR_OPTION],
[
AC_LANG_PUSH($1)
AC_MSG_CHECKING([whether the _AC_LANG preprocessor understands $2])
SAVE_CPPFLAGS=${CPPFLAGS}
CPPFLAGS=$2
AC_TRY_CPP(,AC_MSG_RESULT([yes]); CPPFLAGS="${SAVE_CPPFLAGS} $2",AC_MSG_RESULT([no]); CPPFLAGS=${SAVE_CPPFLAGS});
unset SAVE_CPPFLAGS
AC_LANG_POP($1)
])
#
# AX_CHECK_PREPROCESSOR_OPTION(language, [variable,] option)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# variable - If supplied, the variable to add the checked preprocessor option
# to.
# option - The preprocessor flag to check.
#
# Add, if supported, the specified preprocessor flag for the preprocessor
# selected for the specified language, optionally saving it to the specified
# variable.
# ----------------------------------------------------------------------------
AC_DEFUN([AX_CHECK_PREPROCESSOR_OPTION],
[
ifelse($#,
3,
[_AX_CHECK_PREPROCESSOR_OPTION_WITH_VAR($1, $2, $3)],
[_AX_CHECK_PREPROCESSOR_OPTION($1, $2)])
])
#
# AX_CHECK_PREPROCESSOR_OPTIONS(language, [variable,] option ...)
#
# language - The autoconf language (C, C++, Objective C, Objective C++,
# etc.).
# variable - If supplied, the variable to add the checked preprocessor option
# to.
# options - The preprocessor flags to check.
#
# Add, if supported, the specified preprocessor flags for the preprocessor
# selected for the specified language, optionally saving it to the specified
# variable.
# ----------------------------------------------------------------------------
AC_DEFUN([AX_CHECK_PREPROCESSOR_OPTIONS],
[
ifelse($#,
3,
[
for ax_preprocessor_option in [$3]; do
_AX_CHECK_PREPROCESSOR_OPTION_WITH_VAR([$1], [$2], $ax_preprocessor_option)
done
],
[
for ax_preprocessor_option in [$2]; do
_AX_CHECK_PREPROCESSOR_OPTION([$1], $ax_preprocessor_option)
done
])
])
@@ -1,177 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
#
# DESCRIPTION
#
# This macro compares two version strings. Due to the various number of
# minor-version numbers that can exist, and the fact that string
# comparisons are not compatible with numeric comparisons, this is not
# necessarily trivial to do in a autoconf script. This macro makes doing
# these comparisons easy.
#
# The six basic comparisons are available, as well as checking equality
# limited to a certain number of minor-version levels.
#
# The operator OP determines what type of comparison to do, and can be one
# of:
#
# eq - equal (test A == B)
# ne - not equal (test A != B)
# le - less than or equal (test A <= B)
# ge - greater than or equal (test A >= B)
# lt - less than (test A < B)
# gt - greater than (test A > B)
#
# Additionally, the eq and ne operator can have a number after it to limit
# the test to that number of minor versions.
#
# eq0 - equal up to the length of the shorter version
# ne0 - not equal up to the length of the shorter version
# eqN - equal up to N sub-version levels
# neN - not equal up to N sub-version levels
#
# When the condition is true, shell commands ACTION-IF-TRUE are run,
# otherwise shell commands ACTION-IF-FALSE are run. The environment
# variable 'ax_compare_version' is always set to either 'true' or 'false'
# as well.
#
# Examples:
#
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
#
# would both be true.
#
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
#
# would both be false.
#
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
#
# would be true because it is only comparing two minor versions.
#
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
#
# would be true because it is only comparing the lesser number of minor
# versions of the two values.
#
# Note: The characters that separate the version numbers do not matter. An
# empty string is the same as version 0. OP is evaluated by autoconf, not
# configure, so must be a string, not a variable.
#
# The author would like to acknowledge Guido Draheim whose advice about
# the m4_case and m4_ifvaln functions make this macro only include the
# portions necessary to perform the specific comparison specified by the
# OP argument in the final configure script.
#
# LICENSE
#
# Copyright (c) 2008 Tim Toolan <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 11
dnl #########################################################################
AC_DEFUN([AX_COMPARE_VERSION], [
AC_REQUIRE([AC_PROG_AWK])
# Used to indicate true or false condition
ax_compare_version=false
# Convert the two version strings to be compared into a format that
# allows a simple string comparison. The end result is that a version
# string of the form 1.12.5-r617 will be converted to the form
# 0001001200050617. In other words, each number is zero padded to four
# digits, and non digits are removed.
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g'`
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g'`
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
dnl # then the first line is used to determine if the condition is true.
dnl # The sed right after the echo is to remove any indented white space.
m4_case(m4_tolower($2),
[lt],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
],
[gt],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
],
[le],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
],
[ge],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
],[
dnl Split the operator from the subversion count if present.
m4_bmatch(m4_substr($2,2),
[0],[
# A count of zero means use the length of the shorter version.
# Determine the number of characters in A and B.
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
# Set A to no more than B's length and B to no more than A's length.
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
],
[[0-9]+],[
# A count greater than zero means use only that many subversions
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
],
[.+],[
AC_WARNING(
[illegal OP numeric parameter: $2])
],[])
# Pad zeros at end of numbers to make same length.
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
B="$B`echo $A | sed 's/./0/g'`"
A="$ax_compare_version_tmp_A"
# Check for equality or inequality as necessary.
m4_case(m4_tolower(m4_substr($2,0,2)),
[eq],[
test "x$A" = "x$B" && ax_compare_version=true
],
[ne],[
test "x$A" != "x$B" && ax_compare_version=true
],[
AC_WARNING([illegal OP parameter: $2])
])
])
AS_VAR_POPDEF([A])dnl
AS_VAR_POPDEF([B])dnl
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
if test "$ax_compare_version" = "true" ; then
m4_ifvaln([$4],[$4],[:])dnl
m4_ifvaln([$5],[else $5])dnl
fi
]) dnl AX_COMPARE_VERSION
@@ -1,562 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
# -std=c++11). If neither is specified, you get whatever works, with
# preference for an extended mode.
#
# The third argument, if specified 'mandatory' or if left unspecified,
# indicates that baseline support for the specified C++ standard is
# required and that the macro should error out if no mode with that
# support is found. If specified 'optional', then configuration proceeds
# regardless, after defining HAVE_CXX${VERSION} if and only if a
# supporting mode is found.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <[email protected]>
# Copyright (c) 2012 Zack Weinberg <[email protected]>
# Copyright (c) 2013 Roy Stogner <[email protected]>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <[email protected]>
# Copyright (c) 2015 Paul Norman <[email protected]>
# Copyright (c) 2015 Moritz Klammler <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 4
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
m4_if([$1], [11], [],
[$1], [14], [],
[$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])],
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$2], [], [],
[$2], [ext], [],
[$2], [noext], [],
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
[$3], [optional], [ax_cxx_compile_cxx$1_required=false],
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
AC_LANG_PUSH([C++])dnl
ac_success=no
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
ax_cv_cxx_compile_cxx$1,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[ax_cv_cxx_compile_cxx$1=yes],
[ax_cv_cxx_compile_cxx$1=no])])
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
ac_success=yes
fi
m4_if([$2], [noext], [], [dnl
if test x$ac_success = xno; then
for switch in -std=gnu++$1 -std=gnu++0x; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
fi])
m4_if([$2], [ext], [], [dnl
if test x$ac_success = xno; then
dnl HP's aCC needs +std=c++11 according to:
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
dnl Cray's crayCC needs "-h std=c++11"
for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
fi])
AC_LANG_POP([C++])
if test x$ax_cxx_compile_cxx$1_required = xtrue; then
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
fi
fi
if test x$ac_success = xno; then
HAVE_CXX$1=0
AC_MSG_NOTICE([No compiler with C++$1 support was found])
else
HAVE_CXX$1=1
AC_DEFINE(HAVE_CXX$1,1,
[define if the compiler supports basic C++$1 syntax])
fi
AC_SUBST(HAVE_CXX$1)
])
dnl Test body for checking C++11 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
)
dnl Test body for checking C++14 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
)
dnl Tests for new features in C++11
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual void f() {}
};
struct Derived : public Base
{
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check<void> single_type;
typedef check<check<void>> double_type;
typedef check<check<check<void>>> triple_type;
typedef check<check<check<check<void>>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same<T, T>
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same<int, decltype(0)>::value == true, "");
static_assert(is_same<int, decltype(c)>::value == false, "");
static_assert(is_same<int, decltype(v)>::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same<int, decltype(ac)>::value == true, "");
static_assert(is_same<int, decltype(av)>::value == true, "");
static_assert(is_same<int, decltype(sumi)>::value == true, "");
static_assert(is_same<int, decltype(sumf)>::value == false, "");
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template <int...>
struct sum;
template <int N0, int... N1toN>
struct sum<N0, N1toN...>
{
static constexpr auto value = N0 + sum<N1toN...>::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template<typename T>
using member = typename T::member_type;
template<typename T>
void func(...) {}
template<typename T>
void func(member<T>*) {}
void test();
void test() { func<foo>(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
]])
dnl Tests for new features in C++14
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
// If the compiler admits that it is not ready for C++14, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201402L
#error "This is not a C++14 compiler"
#else
namespace cxx14
{
namespace test_polymorphic_lambdas
{
int
test()
{
const auto lambda = [](auto&&... args){
const auto istiny = [](auto x){
return (sizeof(x) == 1UL) ? 1 : 0;
};
const int aretiny[] = { istiny(args)... };
return aretiny[0];
};
return lambda(1, 1L, 1.0f, '1');
}
}
namespace test_binary_literals
{
constexpr auto ivii = 0b0000000000101010;
static_assert(ivii == 42, "wrong value");
}
namespace test_generalized_constexpr
{
template < typename CharT >
constexpr unsigned long
strlen_c(const CharT *const s) noexcept
{
auto length = 0UL;
for (auto p = s; *p; ++p)
++length;
return length;
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("x") == 1UL, "");
static_assert(strlen_c("test") == 4UL, "");
static_assert(strlen_c("another\0test") == 7UL, "");
}
namespace test_lambda_init_capture
{
int
test()
{
auto x = 0;
const auto lambda1 = [a = x](int b){ return a + b; };
const auto lambda2 = [a = lambda1(x)](){ return a; };
return lambda2();
}
}
namespace test_digit_seperators
{
constexpr auto ten_million = 100'000'000;
static_assert(ten_million == 100000000, "");
}
namespace test_return_type_deduction
{
auto f(int& x) { return x; }
decltype(auto) g(int& x) { return x; }
template < typename T1, typename T2 >
struct is_same
{
static constexpr auto value = false;
};
template < typename T >
struct is_same<T, T>
{
static constexpr auto value = true;
};
int
test()
{
auto x = 0;
static_assert(is_same<int, decltype(f(x))>::value, "");
static_assert(is_same<int&, decltype(g(x))>::value, "");
return x;
}
}
} // namespace cxx14
#endif // __cplusplus >= 201402L
]])
@@ -1,111 +0,0 @@
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_0x.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_0X
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++0x
# standard.
#
# This macro is deprecated and has been superseded by the
# AX_CXX_COMPILE_STDCXX_11 macro which should be used instead.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 10
AU_ALIAS([AC_CXX_COMPILE_STDCXX_0X], [AX_CXX_COMPILE_STDCXX_0X])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
AC_OBSOLETE([$0], [; use AX_CXX_COMPILE_STDCXX_11 instead])
AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
ax_cv_cxx_compile_cxx0x_native,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_native=yes, ax_cv_cxx_compile_cxx0x_native=no)
AC_LANG_RESTORE
])
AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
ax_cv_cxx_compile_cxx0x_cxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXX="$CXX"
CXX="$CXX -std=c++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_cxx=yes, ax_cv_cxx_compile_cxx0x_cxx=no)
CXX="$ac_save_CXX"
AC_LANG_RESTORE
])
AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
ax_cv_cxx_compile_cxx0x_gxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXX="$CXX"
CXX="$CXX -std=gnu++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_gxx=yes, ax_cv_cxx_compile_cxx0x_gxx=no)
CXX="$ac_save_CXX"
AC_LANG_RESTORE
])
if test "$ax_cv_cxx_compile_cxx0x_native" = yes ||
test "$ax_cv_cxx_compile_cxx0x_cxx" = yes ||
test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then
AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
fi
])
@@ -1,39 +0,0 @@
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++11
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++11. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <[email protected]>
# Copyright (c) 2012 Zack Weinberg <[email protected]>
# Copyright (c) 2013 Roy Stogner <[email protected]>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <[email protected]>
# Copyright (c) 2015 Paul Norman <[email protected]>
# Copyright (c) 2015 Moritz Klammler <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 17
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
@@ -1,34 +0,0 @@
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++14
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++14. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2015 Moritz Klammler <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 4
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])])
@@ -1,130 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_JNI_INCLUDE_DIR
#
# DESCRIPTION
#
# AX_JNI_INCLUDE_DIR finds include directories needed for compiling
# programs using the JNI interface.
#
# JNI include directories are usually in the Java distribution. This is
# deduced from the value of $JAVA_HOME, $JAVAC, or the path to "javac", in
# that order. When this macro completes, a list of directories is left in
# the variable JNI_INCLUDE_DIRS.
#
# Example usage follows:
#
# AX_JNI_INCLUDE_DIR
#
# for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
# do
# CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
# done
#
# If you want to force a specific compiler:
#
# - at the configure.in level, set JAVAC=yourcompiler before calling
# AX_JNI_INCLUDE_DIR
#
# - at the configure level, setenv JAVAC
#
# Note: This macro can work with the autoconf M4 macros for Java programs.
# This particular macro is not part of the original set of macros.
#
# LICENSE
#
# Copyright (c) 2008 Don Anderson <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 10
AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
AC_DEFUN([AX_JNI_INCLUDE_DIR],[
JNI_INCLUDE_DIRS=""
if test "x$JAVA_HOME" != x; then
_JTOPDIR="$JAVA_HOME"
else
if test "x$JAVAC" = x; then
JAVAC=javac
fi
AC_PATH_PROG([_ACJNI_JAVAC], [$JAVAC], [no])
if test "x$_ACJNI_JAVAC" = xno; then
AC_MSG_ERROR([cannot find JDK; try setting \$JAVAC or \$JAVA_HOME])
fi
_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
fi
case "$host_os" in
darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
_JINC="$_JTOPDIR/Headers";;
*) _JINC="$_JTOPDIR/include";;
esac
_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])
_AS_ECHO_LOG([_JINC=$_JINC])
# On Mac OS X 10.6.4, jni.h is a symlink:
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
# -> ../../CurrentJDK/Headers/jni.h.
#
# Override AC_CHECK_FILE with our own AX_CHECK_FILE to fix
# cross-compilation issues.
AX_CHECK_FILE([$_JINC/jni.h],
[JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC"],
[_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
AX_CHECK_FILE([$_JTOPDIR/include/jni.h],
[JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include"],
AC_MSG_ERROR([cannot find JDK header files]))
])
# get the likely subdirectories for system specific java includes
case "$host_os" in
bsdi*) _JNI_INC_SUBDIRS="bsdos";;
freebsd*) _JNI_INC_SUBDIRS="freebsd";;
linux*) _JNI_INC_SUBDIRS="linux genunix";;
osf*) _JNI_INC_SUBDIRS="alpha";;
solaris*) _JNI_INC_SUBDIRS="solaris";;
mingw*) _JNI_INC_SUBDIRS="win32";;
cygwin*) _JNI_INC_SUBDIRS="win32";;
*) _JNI_INC_SUBDIRS="genunix";;
esac
# add any subdirectories that are present
for JINCSUBDIR in $_JNI_INC_SUBDIRS
do
if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
fi
done
])
# _ACJNI_FOLLOW_SYMLINKS <path>
# Follows symbolic links on <path>,
# finally setting variable _ACJNI_FOLLOWED
# ----------------------------------------
AC_DEFUN([_ACJNI_FOLLOW_SYMLINKS],[
# find the include directory relative to the javac executable
_cur="$1"
while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do
AC_MSG_CHECKING([symlink for $_cur])
_slink=`ls -ld "$_cur" | sed 's/.* -> //'`
case "$_slink" in
/*) _cur="$_slink";;
# 'X' avoids triggering unwanted echo options.
*) _cur=`echo "X$_cur" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$_slink";;
esac
AC_MSG_RESULT([$_cur])
done
_ACJNI_FOLLOWED="$_cur"
])# _ACJNI
@@ -1,532 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html
# ===========================================================================
#
# SYNOPSIS
#
# DX_INIT_DOXYGEN(PROJECT-NAME, DOXYFILE-PATH, [OUTPUT-DIR])
# DX_DOXYGEN_FEATURE(ON|OFF)
# DX_DOT_FEATURE(ON|OFF)
# DX_HTML_FEATURE(ON|OFF)
# DX_CHM_FEATURE(ON|OFF)
# DX_CHI_FEATURE(ON|OFF)
# DX_MAN_FEATURE(ON|OFF)
# DX_RTF_FEATURE(ON|OFF)
# DX_XML_FEATURE(ON|OFF)
# DX_PDF_FEATURE(ON|OFF)
# DX_PS_FEATURE(ON|OFF)
#
# DESCRIPTION
#
# The DX_*_FEATURE macros control the default setting for the given
# Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for
# generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML
# help (for MS users), 'CHI' for generating a seperate .chi file by the
# .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate
# output formats. The environment variable DOXYGEN_PAPER_SIZE may be
# specified to override the default 'a4wide' paper size.
#
# By default, HTML, PDF and PS documentation is generated as this seems to
# be the most popular and portable combination. MAN pages created by
# Doxygen are usually problematic, though by picking an appropriate subset
# and doing some massaging they might be better than nothing. CHM and RTF
# are specific for MS (note that you can't generate both HTML and CHM at
# the same time). The XML is rather useless unless you apply specialized
# post-processing to it.
#
# The macros mainly control the default state of the feature. The use can
# override the default by specifying --enable or --disable. The macros
# ensure that contradictory flags are not given (e.g.,
# --enable-doxygen-html and --enable-doxygen-chm,
# --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each
# feature will be automatically disabled (with a warning) if the required
# programs are missing.
#
# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN
# with the following parameters: a one-word name for the project for use
# as a filename base etc., an optional configuration file name (the
# default is 'Doxyfile', the same as Doxygen's default), and an optional
# output directory name (the default is 'doxygen-doc').
#
# Automake Support
#
# The following is a template aminclude.am file for use with Automake.
# Make targets and variables values are controlled by the various
# DX_COND_* conditionals set by autoconf.
#
# The provided targets are:
#
# doxygen-doc: Generate all doxygen documentation.
#
# doxygen-run: Run doxygen, which will generate some of the
# documentation (HTML, CHM, CHI, MAN, RTF, XML)
# but will not do the post processing required
# for the rest of it (PS, PDF, and some MAN).
#
# doxygen-man: Rename some doxygen generated man pages.
#
# doxygen-ps: Generate doxygen PostScript documentation.
#
# doxygen-pdf: Generate doxygen PDF documentation.
#
# Note that by default these are not integrated into the automake targets.
# If doxygen is used to generate man pages, you can achieve this
# integration by setting man3_MANS to the list of man pages generated and
# then adding the dependency:
#
# $(man3_MANS): doxygen-doc
#
# This will cause make to run doxygen and generate all the documentation.
#
# The following variable is intended for use in Makefile.am:
#
# DX_CLEANFILES = everything to clean.
#
# Then add this variable to MOSTLYCLEANFILES.
#
# ----- begin aminclude.am -------------------------------------
#
# ## --------------------------------- ##
# ## Format-independent Doxygen rules. ##
# ## --------------------------------- ##
#
# if DX_COND_doc
#
# ## ------------------------------- ##
# ## Rules specific for HTML output. ##
# ## ------------------------------- ##
#
# if DX_COND_html
#
# DX_CLEAN_HTML = @DX_DOCDIR@/html
#
# endif DX_COND_html
#
# ## ------------------------------ ##
# ## Rules specific for CHM output. ##
# ## ------------------------------ ##
#
# if DX_COND_chm
#
# DX_CLEAN_CHM = @DX_DOCDIR@/chm
#
# if DX_COND_chi
#
# DX_CLEAN_CHI = @DX_DOCDIR@/@[email protected]
#
# endif DX_COND_chi
#
# endif DX_COND_chm
#
# ## ------------------------------ ##
# ## Rules specific for MAN output. ##
# ## ------------------------------ ##
#
# if DX_COND_man
#
# DX_CLEAN_MAN = @DX_DOCDIR@/man
#
# endif DX_COND_man
#
# ## ------------------------------ ##
# ## Rules specific for RTF output. ##
# ## ------------------------------ ##
#
# if DX_COND_rtf
#
# DX_CLEAN_RTF = @DX_DOCDIR@/rtf
#
# endif DX_COND_rtf
#
# ## ------------------------------ ##
# ## Rules specific for XML output. ##
# ## ------------------------------ ##
#
# if DX_COND_xml
#
# DX_CLEAN_XML = @DX_DOCDIR@/xml
#
# endif DX_COND_xml
#
# ## ----------------------------- ##
# ## Rules specific for PS output. ##
# ## ----------------------------- ##
#
# if DX_COND_ps
#
# DX_CLEAN_PS = @DX_DOCDIR@/@[email protected]
#
# DX_PS_GOAL = doxygen-ps
#
# doxygen-ps: @DX_DOCDIR@/@[email protected]
#
# @DX_DOCDIR@/@[email protected]: @DX_DOCDIR@/@[email protected]
# cd @DX_DOCDIR@/latex; \
# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
# $(DX_LATEX) refman.tex; \
# $(MAKEINDEX_PATH) refman.idx; \
# $(DX_LATEX) refman.tex; \
# countdown=5; \
# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
# refman.log > /dev/null 2>&1 \
# && test $$countdown -gt 0; do \
# $(DX_LATEX) refman.tex; \
# countdown=`expr $$countdown - 1`; \
# done; \
# $(DX_DVIPS) -o ../@[email protected] refman.dvi
#
# endif DX_COND_ps
#
# ## ------------------------------ ##
# ## Rules specific for PDF output. ##
# ## ------------------------------ ##
#
# if DX_COND_pdf
#
# DX_CLEAN_PDF = @DX_DOCDIR@/@[email protected]
#
# DX_PDF_GOAL = doxygen-pdf
#
# doxygen-pdf: @DX_DOCDIR@/@[email protected]
#
# @DX_DOCDIR@/@[email protected]: @DX_DOCDIR@/@[email protected]
# cd @DX_DOCDIR@/latex; \
# rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
# $(DX_PDFLATEX) refman.tex; \
# $(DX_MAKEINDEX) refman.idx; \
# $(DX_PDFLATEX) refman.tex; \
# countdown=5; \
# while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
# refman.log > /dev/null 2>&1 \
# && test $$countdown -gt 0; do \
# $(DX_PDFLATEX) refman.tex; \
# countdown=`expr $$countdown - 1`; \
# done; \
# mv refman.pdf ../@[email protected]
#
# endif DX_COND_pdf
#
# ## ------------------------------------------------- ##
# ## Rules specific for LaTeX (shared for PS and PDF). ##
# ## ------------------------------------------------- ##
#
# if DX_COND_latex
#
# DX_CLEAN_LATEX = @DX_DOCDIR@/latex
#
# endif DX_COND_latex
#
# .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
#
# .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
#
# doxygen-run: @DX_DOCDIR@/@[email protected]
#
# doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
#
# @DX_DOCDIR@/@[email protected]: $(DX_CONFIG) $(pkginclude_HEADERS)
# rm -rf @DX_DOCDIR@
# $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
#
# DX_CLEANFILES = \
# @DX_DOCDIR@/@[email protected] \
# -r \
# $(DX_CLEAN_HTML) \
# $(DX_CLEAN_CHM) \
# $(DX_CLEAN_CHI) \
# $(DX_CLEAN_MAN) \
# $(DX_CLEAN_RTF) \
# $(DX_CLEAN_XML) \
# $(DX_CLEAN_PS) \
# $(DX_CLEAN_PDF) \
# $(DX_CLEAN_LATEX)
#
# endif DX_COND_doc
#
# ----- end aminclude.am ---------------------------------------
#
# LICENSE
#
# Copyright (c) 2009 Oren Ben-Kiki <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 12
## ----------##
## Defaults. ##
## ----------##
DX_ENV=""
AC_DEFUN([DX_FEATURE_doc], ON)
AC_DEFUN([DX_FEATURE_dot], OFF)
AC_DEFUN([DX_FEATURE_man], OFF)
AC_DEFUN([DX_FEATURE_html], ON)
AC_DEFUN([DX_FEATURE_chm], OFF)
AC_DEFUN([DX_FEATURE_chi], OFF)
AC_DEFUN([DX_FEATURE_rtf], OFF)
AC_DEFUN([DX_FEATURE_xml], OFF)
AC_DEFUN([DX_FEATURE_pdf], ON)
AC_DEFUN([DX_FEATURE_ps], ON)
## --------------- ##
## Private macros. ##
## --------------- ##
# DX_ENV_APPEND(VARIABLE, VALUE)
# ------------------------------
# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
# DX_DIRNAME_EXPR
# ---------------
# Expand into a shell expression prints the directory part of a path.
AC_DEFUN([DX_DIRNAME_EXPR],
[[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
# -------------------------------------
# Expands according to the M4 (static) status of the feature.
AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
# ----------------------------------
# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
AC_DEFUN([DX_REQUIRE_PROG], [
AC_PATH_TOOL([$1], [$2])
if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
fi
])
# DX_TEST_FEATURE(FEATURE)
# ------------------------
# Expand to a shell expression testing whether the feature is active.
AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
# -------------------------------------------------
# Verify that a required features has the right state before trying to turn on
# the DX_CURRENT_FEATURE.
AC_DEFUN([DX_CHECK_DEPEND], [
test "$DX_FLAG_$1" = "$2" \
|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
requires, contradicts) doxygen-DX_CURRENT_FEATURE])
])
# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
# ----------------------------------------------------------
# Turn off the DX_CURRENT_FEATURE if the required feature is off.
AC_DEFUN([DX_CLEAR_DEPEND], [
test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
])
# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
# CHECK_DEPEND, CLEAR_DEPEND,
# REQUIRE, DO-IF-ON, DO-IF-OFF)
# --------------------------------------------
# Parse the command-line option controlling a feature. CHECK_DEPEND is called
# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
# otherwise CLEAR_DEPEND is called to turn off the default state if a required
# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
AC_DEFUN([DX_ARG_ABLE], [
AC_DEFUN([DX_CURRENT_FEATURE], [$1])
AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
AC_ARG_ENABLE(doxygen-$1,
[AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
[--enable-doxygen-$1]),
DX_IF_FEATURE([$1], [don't $2], [$2]))],
[
case "$enableval" in
#(
y|Y|yes|Yes|YES)
AC_SUBST([DX_FLAG_$1], 1)
$3
;; #(
n|N|no|No|NO)
AC_SUBST([DX_FLAG_$1], 0)
;; #(
*)
AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
;;
esac
], [
AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
$4
])
if DX_TEST_FEATURE([$1]); then
$5
:
fi
AM_CONDITIONAL(DX_COND_$1, DX_TEST_FEATURE([$1]))
if DX_TEST_FEATURE([$1]); then
$6
:
else
$7
:
fi
])
## -------------- ##
## Public macros. ##
## -------------- ##
# DX_XXX_FEATURE(DEFAULT_STATE)
# -----------------------------
AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
AC_DEFUN([DX_DOT_FEATURE], [AC_DEFUN([DX_FEATURE_dot], [$1])])
AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
# ---------------------------------------------------------
# PROJECT also serves as the base name for the documentation files.
# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
AC_DEFUN([DX_INIT_DOXYGEN], [
# Files:
AC_SUBST([DX_PROJECT], [$1])
AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
# Environment variables used inside doxygen.cfg:
DX_ENV_APPEND(SRCDIR, $srcdir)
DX_ENV_APPEND(PROJECT, $DX_PROJECT)
DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
# Doxygen itself:
DX_ARG_ABLE(doc, [generate any doxygen documentation],
[],
[],
[DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
DX_REQUIRE_PROG([DX_PERL], perl)],
[DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
# Dot for graphics:
DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_DOT], dot)],
[DX_ENV_APPEND(HAVE_DOT, YES)
DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
[DX_ENV_APPEND(HAVE_DOT, NO)])
# Man pages generation:
DX_ARG_ABLE(man, [generate doxygen manual pages],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[],
[DX_ENV_APPEND(GENERATE_MAN, YES)],
[DX_ENV_APPEND(GENERATE_MAN, NO)])
# RTF file generation:
DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[],
[DX_ENV_APPEND(GENERATE_RTF, YES)],
[DX_ENV_APPEND(GENERATE_RTF, NO)])
# XML file generation:
DX_ARG_ABLE(xml, [generate doxygen XML documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[],
[DX_ENV_APPEND(GENERATE_XML, YES)],
[DX_ENV_APPEND(GENERATE_XML, NO)])
# (Compressed) HTML help generation:
DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_HHC], hhc)],
[DX_ENV_APPEND(HHC_PATH, $DX_HHC)
DX_ENV_APPEND(GENERATE_HTML, YES)
DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
[DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
# Seperate CHI file generation.
DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
[DX_CHECK_DEPEND(chm, 1)],
[DX_CLEAR_DEPEND(chm, 1)],
[],
[DX_ENV_APPEND(GENERATE_CHI, YES)],
[DX_ENV_APPEND(GENERATE_CHI, NO)])
# Plain HTML pages generation:
DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
[DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
[DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
[],
[DX_ENV_APPEND(GENERATE_HTML, YES)],
[DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
# PostScript file generation:
DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_LATEX], latex)
DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
DX_REQUIRE_PROG([DX_DVIPS], dvips)
DX_REQUIRE_PROG([DX_EGREP], egrep)])
# PDF file generation:
DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
[DX_CHECK_DEPEND(doc, 1)],
[DX_CLEAR_DEPEND(doc, 1)],
[DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
DX_REQUIRE_PROG([DX_EGREP], egrep)])
# LaTeX generation for PS and/or PDF:
AM_CONDITIONAL(DX_COND_latex, DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf))
if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
DX_ENV_APPEND(GENERATE_LATEX, YES)
else
DX_ENV_APPEND(GENERATE_LATEX, NO)
fi
# Paper size for PS and/or PDF:
AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
[a4wide (default), a4, letter, legal or executive])
case "$DOXYGEN_PAPER_SIZE" in
#(
"")
AC_SUBST(DOXYGEN_PAPER_SIZE, "")
;; #(
a4wide|a4|letter|legal|executive)
DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
;; #(
*)
AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
;;
esac
#For debugging:
#echo DX_FLAG_doc=$DX_FLAG_doc
#echo DX_FLAG_dot=$DX_FLAG_dot
#echo DX_FLAG_man=$DX_FLAG_man
#echo DX_FLAG_html=$DX_FLAG_html
#echo DX_FLAG_chm=$DX_FLAG_chm
#echo DX_FLAG_chi=$DX_FLAG_chi
#echo DX_FLAG_rtf=$DX_FLAG_rtf
#echo DX_FLAG_xml=$DX_FLAG_xml
#echo DX_FLAG_pdf=$DX_FLAG_pdf
#echo DX_FLAG_ps=$DX_FLAG_ps
#echo DX_ENV=$DX_ENV
])
@@ -1,485 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise). (This
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <[email protected]>
# Copyright (c) 2011 Daniel Richard G. <[email protected]>
#
# 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 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, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 23
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on Tru64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
CC="$ax_pthread_save_CC"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
# (Note: HP C rejects this with "bad form for `-t' option")
# -pthreads: Solaris/gcc (Note: HP C also rejects)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case $host_os in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (N.B.: The stubs are missing
# pthread_cleanup_push, or rather a function called by this macro,
# so we could check for that, but who knows whether they'll stub
# that too in a future libc.) So we'll check first for the
# standard Solaris way of linking pthreads (-mt -lpthread).
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
;;
esac
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $host_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
# Are we compiling with Clang?
AC_CACHE_CHECK([whether $CC is Clang],
[ax_cv_PTHREAD_CLANG],
[ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
AX_PTHREAD_CC_IS_CLANG
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
ax_pthread_clang_warning=no
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
PTHREAD_CFLAGS="-pthread"
PTHREAD_LIBS=
ax_pthread_ok=yes
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-mt,pthread)
AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
PTHREAD_CFLAGS="-mt"
PTHREAD_LIBS="-lpthread"
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
# if $ax_pthread_check_cond
# error "$ax_pthread_check_macro must be defined"
# endif
static void routine(void *a) { a = 0; }
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
AC_MSG_RESULT([$ax_pthread_ok])
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$ax_pthread_ok" = "xyes"; then
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_CACHE_CHECK([for joinable pthread attribute],
[ax_cv_PTHREAD_JOINABLE_ATTR],
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $ax_pthread_attr; return attr /* ; */])],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
[])
done
])
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $host_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
])
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
test "x$ax_pthread_special_flags_added" != "xyes"],
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes])
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != "xyes"; then
case $host_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
;;
esac
fi
fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD
File diff suppressed because it is too large Load Diff
@@ -1,384 +0,0 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])
@@ -1,123 +0,0 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file 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.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])
@@ -1,23 +0,0 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file 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.
# @configure_input@
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
@@ -1,98 +0,0 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file 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.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
@@ -1,107 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro that adds an
# --enable-coverage configuration option to the package and
# controls whether the package will be built for code coverage.
#
#
# NL_ENABLE_COVERAGE(default)
#
# default - Whether the option should be enabled (yes) or disabled (no)
# by default.
#
# Adds an --enable-coverage configuration option to the package with a
# default value of 'default' (should be either 'no' or 'yes') and controls
# whether the package will be built with or without code coverage.
#
# The value 'nl_cv_build_coverage' will be set to the result. In
# addition, NL_COVERAGE_CPPFLAGS and NL_COVERAGE_LDFLAGS will be set
# to the appropriate values to pass to the compiler and linker,
# respectively.
#
# NOTE: This is only supported at present for GCC or GCC-compatible
# toolchains.
#
# NOTE: The behavior of this is influenced by nl_cv_build_optimized from
# NL_DISABLE_OPTIMIZATION
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_ENABLE_COVERAGE],
[
# Check whether or not a default value has been passed in.
m4_case([$1],
[yes],[],
[no],[],
[m4_fatal([$0: invalid default value '$1'; must be 'yes' or 'no'])])
AC_CACHE_CHECK([whether to build code-coverage instances of programs and libraries],
nl_cv_build_coverage,
[
AC_ARG_ENABLE(coverage,
[AS_HELP_STRING([--enable-coverage],[Enable the generation of code-coverage instances @<:@default=$1@:>@.])],
[
case "${enableval}" in
no|yes)
nl_cv_build_coverage=${enableval}
if test "${nl_cv_build_optimized}" = "yes"; then
AC_MSG_ERROR([both --enable-optimization and --enable-coverage cannot used. Please, choose one or the other to enable.])
fi
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-coverage])
;;
esac
],
[
if test "${nl_cv_build_optimized}" = "yes"; then
AC_MSG_WARN([--enable-optimization was specified, coverage disabled])
nl_cv_build_coverage=no
else
nl_cv_build_coverage=$1
fi
])
if test "${nl_cv_build_coverage}" = "yes"; then
if test "${GCC}" != "yes"; then
AC_MSG_ERROR([GCC or a GCC-compatible toolchain is required for --enable-coverage])
else
NL_COVERAGE_CPPFLAGS="--coverage"
NL_COVERAGE_LDFLAGS="-lgcov"
fi
fi
])
])
@@ -1,149 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro that adds an
# --enable-coverage configuration option to the package and
# controls whether the package will be built for code coverage
# reporting, using the LCOV package.
#
#
# NL_ENABLE_COVERAGE_REPORTS(default)
#
# default - Whether the option should be automatic (auto), enabled
# (yes), or disabled (no) by default.
#
# Adds an --enable-coverage-reports configuration option to the
# package with a default value of 'default' (should be 'auto', 'no' or
# 'yes') and controls whether the package will be built with or
# without code coverage reports, using the LCOV package.
#
# The value 'nl_cv_build_coverage_reports' will be set to the result. In
# addition, LCOV will be set to the path of the 'lcov' tool and GENHTML will be set to the path of the 'genhtml' tool.
#
# NOTE: The behavior of this is influenced by nl_cv_build_coverage from
# NL_ENABLE_COVERAGE.
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_ENABLE_COVERAGE_REPORTS],
[
# Check whether or not a default value has been passed in.
m4_case([$1],
[auto],[],
[yes],[],
[no],[],
[m4_fatal([$0: invalid default value '$1'; must be 'auto', 'yes' or 'no'])])
# Check for the presence of lcov and genhtml, required
# to build and generate the coverage reports.
AC_PATH_PROG(LCOV, lcov)
AC_PATH_PROG(GENHTML, genhtml)
AC_CACHE_CHECK([whether to build graphical code coverage reports],
nl_cv_build_coverage_reports,
[
AC_ARG_ENABLE(coverage-reports,
[AS_HELP_STRING([--enable-coverage-reports],[Enable the generation of code coverage reports (requires lcov) @<:@default=$1@:>@.])],
[
case "${enableval}" in
auto|no|yes)
nl_cv_build_coverage_reports=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-coverage])
;;
esac
],
[
nl_cv_build_coverage_reports=$1
])
# If coverage is not enabled, then coverage reports
# defaults to 'no' if it is 'auto' or fails if it is
# 'yes'. Otherwise, availability of lcov and genhtml
# condition behavior. Lack of availability for 'yes'
# results in failure; however, for 'auto' then coverage
# reports default to 'no'.
case "${nl_cv_build_coverage}" in
no)
case "${nl_cv_build_coverage_reports}" in
auto)
nl_cv_build_coverage_reports="no"
;;
yes)
AC_MSG_ERROR([--enable-coverage must be asserted to use --enable-coverage-reports.])
;;
no)
;;
esac
;;
yes)
case "${nl_cv_build_coverage_reports}" in
auto)
# Both lcov and genhtml must exist to successfully
# enable coverage reports.
if test "x${LCOV}" = "x" || test "x${GENHTML}" = "x"; then
nl_cv_build_coverage_reports="no"
else
nl_cv_build_coverage_reports="yes"
fi
;;
yes)
# Both lcov and genhtml must exist to successfully
# enable coverage reports. Since the default or user
# ask is 'yes', we must fail if lcov or genhtml cannot
# be found.
if test "x${LCOV}" = "x"; then
AC_MSG_ERROR([Cannot find 'lcov'. You must have the lcov package installed to use coverage reports.])
elif test "x${GENHTML}" = "x"; then
AC_MSG_ERROR([Cannot find 'genhtml'. You must have the lcov package installed to use coverage reports.])
elif test "${nl_cv_build_coverage_reports}" = "auto"; then
nl_cv_build_coverage_reports="yes"
fi
;;
no)
;;
esac
;;
esac
])
])
@@ -1,79 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro that adds an
# --enable-debug configuration option to the package and controls
# whether the package will be built for debug instances of programs
# and libraries.
#
#
# NL_ENABLE_DEBUG(default)
#
# default - Whether the option should be enabled (yes) or disabled (no)
# by default.
#
# Adds an --enable-debug configuration option to the package with a
# default value of 'default' (should be either 'no' or 'yes') and controls
# whether the package will be built with or without -DDEBUG enabled.
#
# The value 'nl_cv_build_debug' will be set to the result. In
# addition, the contents of CFLAGS, CXXFLAGS, OBJCFLAGS, and
# OBJCXXFLAGS may be altered by the use of this macro, adding -DDEBUG
# if this option is asserted.
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_ENABLE_DEBUG],
[
# Check whether or not a default value has been passed in.
m4_case([$1],
[yes],[],
[no],[],
[m4_fatal([$0: invalid default value '$1'; must be 'yes' or 'no'])])
AC_CACHE_CHECK([whether to build debug instances of programs and libraries],
nl_cv_build_debug,
[
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[Enable the generation of debug instances @<:@default=$1@:>@.])],
[
case "${enableval}" in
no|yes)
nl_cv_build_debug=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-debug])
;;
esac
],
[
nl_cv_build_debug=$1
])
if test "${nl_cv_build_debug}" = "yes"; then
CFLAGS="${CFLAGS} -DDEBUG"
CXXFLAGS="${CXXFLAGS} -DDEBUG"
OBJCFLAGS="${OBJCFLAGS} -DDEBUG"
OBJCXXFLAGS="${OBJCXXFLAGS} -DDEBUG"
fi
])
])
@@ -1,117 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro that adds an
# --disable-docs configuration option to the package and controls
# whether the package will be built with or without documentation.
#
#
# NL_ENABLE_DOCS(default, dot_default)
#
# default - Whether the option should be automatic (auto), enabled
# (yes), disabled (no) by default.
# dot_default - Whether Doxygen should use (YES) or not use (NO)
# GraphViz dot.
#
# Adds an --disable-docs configuration option to the package with a
# default value of 'default' (should be 'auto', 'no' or 'yes') and
# controls whether the package will be built with or without Doxygen-based
# documentation.
#
# The value 'nl_cv_build_docs' will be set to the result. In addition:
#
# DOXYGEN - Will be set to the path of the Doxygen executable.
# DOT - Will be set to the path of the GraphViz dot
# executable.
# DOXYGEN_USE_DOT - Will be set to 'NO' or 'YES' depending on whether
# GraphViz dot is available.
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_ENABLE_DOCS],
[
# Check whether or not the 'default' value is sane.
m4_case([$1],
[auto],[],
[yes],[],
[no],[],
[m4_fatal([$0: invalid default value '$1'; must be 'auto', 'yes' or 'no'])])
# Check whether or not the 'dot_default' value is sane.
m4_case([$2],
[YES],[],
[NO],[],
[m4_fatal([$0: invalid default value '$2'; must be 'YES' or 'NO'])])
DOXYGEN_USE_DOT=$2
AC_ARG_VAR(DOXYGEN, [Doxygen executable])
AC_ARG_VAR(DOT, [GraphViz 'dot' executable, which may be used, when present, to generate Doxygen class graphs])
AC_PATH_PROG(DOXYGEN, doxygen)
AC_PATH_PROG(DOT, dot)
AC_CACHE_CHECK([whether to build documentation],
nl_cv_build_docs,
[
AC_ARG_ENABLE(docs,
[AS_HELP_STRING([--disable-docs],[Enable building documentation (requires Doxygen) @<:@default=$1@:>@.])],
[
case "${enableval}" in
auto|no|yes)
nl_cv_build_docs=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --disable-docs])
;;
esac
],
[nl_cv_build_docs=$1])
if test "x${DOXYGEN}" != "x"; then
nl_cv_have_doxygen=yes
else
nl_cv_have_doxygen=no
fi
if test "${nl_cv_build_docs}" = "auto"; then
if test "${nl_cv_have_doxygen}" = "no"; then
nl_cv_build_docs=no
else
nl_cv_build_docs=yes
fi
fi
if test "${nl_cv_build_docs}" = "yes"; then
if test "${nl_cv_have_doxygen}" = "no"; then
AC_MSG_ERROR([Building docs was explicitly requested but Doxygen cannot be found])
elif test "${nl_cv_have_doxygen}" = "yes"; then
if test "x${DOT}" != "x"; then
DOXYGEN_USE_DOT=YES
fi
fi
fi
])
AC_SUBST(DOXYGEN_USE_DOT)
])
@@ -1,92 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro that adds an
# --enable-optimization configuration option to the package and
# controls whether the package will be built with or without code
# optimization.
#
#
# NL_ENABLE_OPTIMIZATION(default)
#
# default - Whether the option should be enabled (yes) or disabled (no)
# by default.
#
# Adds an --enable-optimization configuration option to the package with a
# default value of 'default' (should be either 'no' or 'yes') and controls
# whether the package will be built with or without code optimization.
#
# The value 'nl_cv_build_optimized' will be set to the result. In
# addition, the contents of CFLAGS, CXXFLAGS, OBJCFLAGS, and OBJCXXFLAGS may
# be altered by the use of this macro, converting -O<something> to -O0.
#
# NOTE: The behavior of this is influenced by nl_cv_build_coverage from
# NL_ENABLE_COVERAGE
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_ENABLE_OPTIMIZATION],
[
# Check whether or not a default value has been passed in.
m4_case([$1],
[yes],[],
[no],[],
[m4_fatal([$0: invalid default value '$1'; must be 'yes' or 'no'])])
AC_CACHE_CHECK([whether to build code-optimized instances of programs and libraries],
nl_cv_build_optimized,
[
AC_ARG_ENABLE(optimization,
[AS_HELP_STRING([--enable-optimization],[Enable the generation of code-optimized instances @<:@default=$1@:>@.])],
[
case "${enableval}" in
no|yes)
nl_cv_build_optimized=${enableval}
if test "${nl_cv_build_coverage}" = "yes" && test "${nl_cv_build_optimized}" = "yes"; then
AC_MSG_ERROR([both --enable-optimization and --enable-coverage cannot used. Please, choose one or the other to enable.])
fi
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-optimized])
;;
esac
],
[
if test "${nl_cv_build_coverage}" = "yes"; then
AC_MSG_WARN([--enable-coverage was specified, optimization disabled])
nl_cv_build_optimized=no
else
nl_cv_build_optimized=$1
fi
])
if test "${nl_cv_build_optimized}" = "no"; then
CFLAGS="`echo ${CFLAGS} | sed -e 's,-O[[[:alnum:]]]*,-O0,g'`"
CXXFLAGS="`echo ${CXXFLAGS} | sed -e 's,-O[[[:alnum:]]]*,-O0,g'`"
OBJCFLAGS="`echo ${OBJCFLAGS} | sed -e 's,-O[[[:alnum:]]]*,-O0,g'`"
OBJCXXFLAGS="`echo ${OBJCXXFLAGS} | sed -e 's,-O[[[:alnum:]]]*,-O0,g'`"
fi
])
])
@@ -1,71 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro that adds an
# --enable-tests configuration option to the package and controls
# whether the package will be built with or without unit and
# integration tests.
#
#
# NL_ENABLE_TESTS(default)
#
# default - Whether the option should be enabled (yes) or disabled (no)
# by default.
#
# Adds an --enable-tests configuration option to the package with a
# default value of 'default' (should be either 'no' or 'yes') and
# controls whether the package will be built with or without unit and
# integration tests.
#
# The value 'nl_cv_build_tests' will be set to the result.
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_ENABLE_TESTS],
[
# Check whether or not a default value has been passed in.
m4_case([$1],
[yes],[],
[no],[],
[m4_fatal([$0: invalid default value '$1'; must be 'yes' or 'no'])])
AC_CACHE_CHECK([whether to build tests],
nl_cv_build_tests,
[
AC_ARG_ENABLE(tests,
[AS_HELP_STRING([--enable-tests],[Enable building of tests @<:@default=$1@:>@.])],
[
case "${enableval}" in
no|yes)
nl_cv_build_tests=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-tests])
;;
esac
],
[
nl_cv_build_tests=$1
])
])
])
@@ -1,78 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro that adds an
# --enable-warnings-as-errors configuration option to the package
# and controls whether the package will be built to treat all
# compilation warnings as errors. #
#
# NL_ENABLE_WERROR(default)
#
# default - Whether the option should be enabled (yes) or disabled (no)
# by default.
#
# Adds an --enable-warnings-as-errors configuration option to the
# package with a default value of 'default' (should be either 'no' or
# 'yes') and controls whether the package will be built with or
# without -Werror enabled.
#
# The value 'nl_cv_warnings_as_errors' will be set to the result. In
# addition, the variable NL_WERROR_CPPFLAGS will be set to the
# compiler-specific flag necessary to assert this option.
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_ENABLE_WERROR],
[
# Check whether or not a default value has been passed in.
m4_case([$1],
[yes],[],
[no],[],
[m4_fatal([$0: invalid default value '$1'; must be 'yes' or 'no'])])
AC_CACHE_CHECK([whether to treat all compilation warnings as errors],
nl_cv_warnings_as_errors,
[
AC_ARG_ENABLE(warnings-as-errors,
[AS_HELP_STRING([--enable-warnings-as-errors],[Treat all compilation warnings as errors @<:@default=$1@:>@.])],
[
case "${enableval}" in
no|yes)
nl_cv_warnings_as_errors=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-warnings-as-errors])
;;
esac
],
[
nl_cv_warnings_as_errors=$1
])
])
if test "${nl_cv_warnings_as_errors}" = "yes"; then
AX_CHECK_COMPILER_OPTION([C], NL_WERROR_CPPFLAGS, [-Werror])
if test "x${NL_WERROR_CPPFLAGS}" = "x"; then
AC_MSG_ERROR([Could not determine how to treat warnings as errors for your compiler ${CC}])
fi
fi
])
@@ -1,97 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro for filtering
# the autoconf canonical build, host, or target.
#
# Mac OS X / Darwin ends up putting some versioning cruft on the
# end of its tuples that most users of these variables rarely
# care about.
#
#
# _NL_FILTERED_CANONICAL(name)
#
# name - The existing autoconf variable to filter
#
# Mac OS X / Darwin ends up putting some versioning cruft on the end
# of its tuples that most users of these variables rarely care about.
#
# This filters such versioning cruft from the variable 'name'
# generated from AC_CANONICAL_<NAME> and saves it in
# 'nl_filtered_<name>'.
#
_NL_FILTERED_CANONICAL(name)
AC_DEFUN([_NL_FILTERED_CANONICAL],
[
AC_CACHE_CHECK([filtered $1 system type],
nl_cv_filtered_$1,
nl_cv_filtered_$1=`echo ${$1} | sed -e 's/[[[[:digit:].]]]*$//g'`
nl_filtered_$1=${nl_cv_filtered_$1})
])
#
# NL_FILTERED_CANONICAL_BUILD
#
# Mac OS X / Darwin ends up putting some versioning cruft on the end
# of its tuples that most users of these variables rarely care about.
#
# This filters such versioning cruft from the variable 'build'
# generated from AC_CANONICAL_BUILD and saves it in
# 'nl_filtered_build'.
#
NL_FILTERED_CANONICAL_BUILD
AC_DEFUN([NL_FILTERED_CANONICAL_BUILD],
[
AC_REQUIRE([AC_CANONICAL_BUILD])
_NL_FILTERED_CANONICAL(build)
])
#
# NL_FILTERED_CANONICAL_HOST
#
# Mac OS X / Darwin ends up putting some versioning cruft on the end
# of its tuples that most users of these variables rarely care about.
#
# This filters such versioning cruft from the variable 'host'
# generated from AC_CANONICAL_HOST and saves it in
# 'nl_filtered_build'.
#
NL_FILTERED_CANONICAL_HOST
AC_DEFUN([NL_FILTERED_CANONICAL_HOST],
[
AC_REQUIRE([AC_CANONICAL_HOST])
_NL_FILTERED_CANONICAL(host)
])
#
# NL_FILTERED_CANONICAL_TARGET
#
# Mac OS X / Darwin ends up putting some versioning cruft on the end
# of its tuples that most users of these variables rarely care about.
#
# This filters such versioning cruft from the variable 'target'
# generated from AC_CANONICAL_TARGET and saves it in
# 'nl_filtered_target'.
#
NL_FILTERED_CANONICAL_TARGET
AC_DEFUN([NL_FILTERED_CANONICAL_TARGET],
[
AC_REQUIRE([AC_CANONICAL_TARGET])
_NL_FILTERED_CANONICAL(target)
])
@@ -1,76 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro for checking
# for a build host-based tool that can shadow a directory using
# symbolic links, ostensibly either GNU cp or X11 lndir.
#
AC_DEFUN([_NL_CHECK_CP_RS],
[
$1 -Rs 2>&1 | grep 'missing file operand' > /dev/null
])
AC_DEFUN([_NL_CHECK_LNDIR],
[
$1 -silent 2>&1 | grep 'usage: lndir' > /dev/null
])
#
# NL_PROG_LNDIR([fallback GNU cp path to test, fallback GNU cp path to set])
#
# test path - The fallback GNU cp path and arguments to test if a system
# GNU cp cannot be found.
# set path - The fallback GNU cp path and arguments to set to LNDIR if
# the test path succeeds.
#
# Determine and assign to LNDIR, a build host-based tool that can shadow
# a directory using symbolic links, attempting either GNU cp or X11 lndir
# as preferred defaults.
#
# If the host doesn't have GNU cp natively, the caller can specify
# both a GNU cp path to test and a GNU cp path to set if the test path
# was successful.
#
# ----------------------------------------------------------------------------
AC_DEFUN([NL_PROG_LNDIR],
[
AC_ARG_VAR(LNDIR, [Program and arguments to create a shadow directory of symbolic links to another directory tree (e.g. 'cp -Rs')])
AC_MSG_CHECKING([how to shadow a directory tree])
if test "x${LNDIR}" = "x"; then
if `_NL_CHECK_CP_RS(cp)`; then
LNDIR="cp -Rs"
elif `_NL_CHECK_LNDIR(lndir)`; then
LNDIR="lndir -silent"
elif `_NL_CHECK_CP_RS($1)`; then
LNDIR="$2 -Rs"
else
AC_MSG_ERROR([Cannot determine how to shadow a directory tree. Neither 'cp -Rs' nor 'lndir -silent' appear to be available or functional. Please consider installing or making available in your PATH one of: GNU coreutils <http://www.gnu.org/software/coreutils/>, XQuartz (Mac OS X-only) <http://xquartz.macosforge.org/>, or lndir <http://www.mit.edu/afs/sipb/project/sipbsrc/rt/lndir/>.])
fi
fi
AC_MSG_RESULT(${LNDIR})
AC_SUBST(LNDIR)
])
@@ -1,104 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines GNU autoconf M4-style macros that ensure the
# -Werror compiler option for GCC-based or -compatible compilers
# do not break some autoconf tests (see
# http://lists.gnu.org/archive/html/autoconf-patches/2008-09/msg00014.html).
#
# If -Werror has been passed transform it into -Wno-error for
# CPPFLAGS, CFLAGS, CXXFLAGS, OBJCFLAGS, and OBJCXXFLAGS with
# NL_SAVE_WERROR. Transform them back again with
# NL_RESTORE_WERROR.
#
#
# _NL_SAVE_WERROR_FOR_VAR(variable)
#
# variable - The compiler flags variable to scan for the presence of
# -Werror and, if present, transform to -Wno-error.
#
# This transforms, for the specified compiler flags variable, -Werror
# to -Wno-error, if it was it present. The original state may be
# restored by invoking _NL_RESTORE_WERROR_FOR_VAR([variable]).
#
#------------------------------------------------------------------------------
AC_DEFUN([_NL_SAVE_WERROR_FOR_VAR],
[
if echo "${$1}" | grep -q '\-Werror'; then
$1="`echo ${$1} | sed -e 's,-Werror\([[[:space:]]]\),-Wno-error\1,g'`"
nl_had_$1_werror=yes
else
nl_had_$1_werror=no
fi
])
#
# _NL_RESTORE_WERROR_FOR_VAR(variable)
#
# variable - The compiler flag for which to restore -Wno-error back
# to -Werror if it was originally passed in by the user as
# such.
#
# This restores, for the specified compiler flags variable, -Werror
# from -Wno-error, if it was initially set as -Werror at the time
# _NL_SAVE_WERROR_FOR_VAR([variable]) was invoked.
#
#------------------------------------------------------------------------------
AC_DEFUN([_NL_RESTORE_WERROR_FOR_VAR],
[
if test "${nl_had_$1_werror}" = "yes"; then
$1="`echo ${$1} | sed -e 's,-Wno-error\([[[:space:]]]\),-Werror\1,g'`"
fi
unset nl_had_$1_werror
])
#
# NL_SAVE_WERROR
#
# This transforms, for each of CFLAGS, CXXFLAGS, OBJCFLAGS, and
# OBJCXXFLAGS, -Werror to -Wno-error, if it was it present. The
# original state may be restored by invoking NL_RESTORE_WERROR.
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_SAVE_WERROR],
[
_NL_SAVE_WERROR_FOR_VAR([CPPFLAGS])
_NL_SAVE_WERROR_FOR_VAR([CFLAGS])
_NL_SAVE_WERROR_FOR_VAR([CXXFLAGS])
_NL_SAVE_WERROR_FOR_VAR([OBJCFLAGS])
_NL_SAVE_WERROR_FOR_VAR([OBJCXXFLAGS])
])
#
# NL_RESTORE_WERROR
#
# This restores, for each of OBJCXXFLAGS, OBJCFLAGS, CXXFLAGS, and
# CFLAGS, -Werror from -Wno-error, if it was initially set as -Werror
# at the time NL_SAVE_WERROR was invoked.
#
#------------------------------------------------------------------------------
AC_DEFUN([NL_RESTORE_WERROR],
[
_NL_RESTORE_WERROR_FOR_VAR([OBJCXXFLAGS])
_NL_RESTORE_WERROR_FOR_VAR([OBJCFLAGS])
_NL_RESTORE_WERROR_FOR_VAR([CXXFLAGS])
_NL_RESTORE_WERROR_FOR_VAR([CFLAGS])
_NL_RESTORE_WERROR_FOR_VAR([CPPFLAGS])
])
@@ -1,755 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines a GNU autoconf M4-style macro for checking
# the presence and viability of both required and optional
# dependent packages, which may be internal or external to the
# current package.
#
# Five (5) macros are made available:
#
# * NL_WITH_REQUIRED_EXTERNAL_PACKAGE
# * NL_WITH_OPTIONAL_EXTERNAL_PACKAGE
# * NL_WITH_REQUIRED_INTERNAL_PACKAGE
# * NL_WITH_OPTIONAL_INTERNAL_PACKAGE
# * NL_WITH_PACKAGE
#
# Note, however, that NL_WITH_PACKAGE is deprecated and maps to
# NL_WITH_REQUIRED_INTERNAL_PACKAGE.
#
# _NL_ARG_WITH_INCLUDES_OR_LIBS(PACKAGE-DISPOSITION,
# PACKAGE-SOURCE,
# PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME,
# PACKAGE-WITH-OPTION,
# PLURAL-WITH-OPTION-HELP-WORD,
# WITH-DIR-VARIABLE-MODIFIER)
# ----------------------------------------------------------------------------
# This is a wrapper around AC_ARG_WITH that provides the ability to
# optionally specify a dependent package include and link library
# directories independently as
# --with-<PACKAGE-SUCCINCT-NAME>-<PACKAGE-WITH-OPTION>=<DIR>.
#
# If the package is specified as required, the use of
# --without-<PACKAGE-SUCCINCT-NAME> or the use of
# --with-<PACKAGE-SUCCINCT-NAME>=no will result in a fatal error.
#
# At the successful conclusion of the execution of the macro,
# two variables will be defined:
#
# * nl_with_<PACKAGE-SUCCINCT-NAME>
# * <PACKAGE-SUCCINT-NAME>_<WITH-DIR-VARIABLE-MODIFIER>_dir
#
# The package disposition and source are specified by:
#
# PACKAGE-DISPOSITION : This may be either 'required' if the dependent
# package is required or 'optional' if
# not.
# PACKAGE-SOURCE : This may be either 'internal' if the dependent
# package may be provided either
# internally or externally to the current
# package or 'external' if the dependent
# package may only be provided outside of
# the current package. This also serves as
# the default value for where the
# configuration script expects to find the
# package.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
# ----------------------------------------------------------------------------
AC_DEFUN([_NL_ARG_WITH_INCLUDES_OR_LIBS],
[
dnl Check whether or not the package is required
m4_case([$1],
[required],[],
[optional],[],
[m4_fatal([$0: invalid disposition value '$1'; must be 'required' or 'optional'])])
dnl Check whether or not the package is internal
m4_case([$2],
[internal],[],
[external],[],
[m4_fatal([$0: invalid source value '$2'; must be 'internal' or 'external'])])
AC_ARG_WITH($5-$6,
AS_HELP_STRING([--with-$5-$6=DIR],
[Specify location of $1 $3 $7 @<:@default=$2@:>@.]),
[
if test "${withval}" = "no"; then
m4_if([$1],
[required],
[AC_MSG_ERROR([${PACKAGE_NAME} requires the $3 package.])],
[nl_with_$5=${withval}])
fi
if test "x${$5_dir}" != "x"; then
AC_MSG_WARN([overriding --with-$5=${$5_dir}])
fi
if test "${withval}" = "internal"; then
$5_$8_dir=${withval}
nl_with_$5=${withval}
else
$5_$8_dir=${withval}
nl_with_$5=external
fi
],
[
$5_$8_dir=;
if test "x${nl_with_$5}" = "x"; then
nl_with_$5=$2
fi
])
])
# _NL_ARG_WITH_INCLUDES(PACKAGE-DISPOSITION,
# PACKAGE-SOURCE,
# PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME)
# ----------------------------------------------------------------------------
# This is a wrapper around AC_ARG_WITH that provides the ability to
# optionally specify a dependent package include directory
# independently as --with-<PACKAGE-SUCCINCT-NAME>-includes=<DIR>.
#
# If the package is specified as required, the use of
# --without-<PACKAGE-SUCCINCT-NAME>-includes or the use of
# --with-<PACKAGE-SUCCINCT-NAME>-includes=no will result in a fatal error.
#
# At the successful conclusion of the execution of the macro,
# two variables will be defined:
#
# * nl_with_<PACKAGE-SUCCINCT-NAME>
# * <PACKAGE-SUCCINT-NAME>_header_dir
#
# The package disposition and source are specified by:
#
# PACKAGE-DISPOSITION : This may be either 'required' if the dependent
# package is required or 'optional' if
# not.
# PACKAGE-SOURCE : This may be either 'internal' if the dependent
# package may be provided either
# internally or externally to the current
# package or 'external' if the dependent
# package may only be provided outside of
# the current package. This also serves as
# the default value for where the
# configuration script expects to find the
# package.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
# ----------------------------------------------------------------------------
AC_DEFUN([_NL_ARG_WITH_INCLUDES],
[
_NL_ARG_WITH_INCLUDES_OR_LIBS([$1], [$2], [$3], [$4], [$5], [includes], [headers], [header])dnl
])
# _NL_ARG_WITH_LIBS(PACKAGE-DISPOSITION,
# PACKAGE-SOURCE,
# PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME)
# ----------------------------------------------------------------------------
# This is a wrapper around AC_ARG_WITH that provides the ability to
# optionally specify a dependent package link library directory
# independently as --with-<PACKAGE-SUCCINCT-NAME>-libs=<DIR>.
#
# If the package is specified as required, the use of
# --without-<PACKAGE-SUCCINCT-NAME>-libs or the use of
# --with-<PACKAGE-SUCCINCT-NAME>-libs=no will result in a fatal error.
#
# At the successful conclusion of the execution of the macro,
# two variables will be defined:
#
# * nl_with_<PACKAGE-SUCCINCT-NAME>
# * <PACKAGE-SUCCINT-NAME>_library_dir
#
# The package disposition and source are specified by:
#
# PACKAGE-DISPOSITION : This may be either 'required' if the dependent
# package is required or 'optional' if
# not.
# PACKAGE-SOURCE : This may be either 'internal' if the dependent
# package may be provided either
# internally or externally to the current
# package or 'external' if the dependent
# package may only be provided outside of
# the current package. This also serves as
# the default value for where the
# configuration script expects to find the
# package.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
# ----------------------------------------------------------------------------
AC_DEFUN([_NL_ARG_WITH_LIBS],
[
_NL_ARG_WITH_INCLUDES_OR_LIBS([$1], [$2], [$3], [$4], [$5], [libs], [libraries], [library])dnl
])
# _NL_ARG_WITH_PACKAGE(PACKAGE-DISPOSITION,
# PACKAGE-SOURCE,
# PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME)
# ----------------------------------------------------------------------------
# This is a wrapper around AC_ARG_WITH that provides the ability to
# optionally specify a dependent package as
# --with-<PACKAGE-SUCCINCT-NAME>=<DIR> or to independently specify the
# include and link library directories independently as
# --with-<PACKAGE-SUCCINCT-NAME>-includes=<DIR> and
# --with-<PACKAGE-SUCCINCT-NAME>-libs=<DIR>.
#
# If the package is specified as required, the use of
# --without-<PACKAGE-SUCCINCT-NAME>* or the use of
# --with-<PACKAGE-SUCCINCT-NAME>*=no will result in a fatal error.
#
# At the successful conclusion of the execution of the macro,
# two or more variables will be defined:
#
# * nl_with_<PACKAGE-SUCCINCT-NAME>
# * <PACKAGE-SUCCINT-NAME>_dir
# * <PACKAGE-SUCCINT-NAME>_header_dir
# * <PACKAGE-SUCCINT-NAME>_library_dir
#
# The package disposition and source are specified by:
#
# PACKAGE-DISPOSITION : This may be either 'required' if the dependent
# package is required or 'optional' if
# not.
# PACKAGE-SOURCE : This may be either 'internal' if the dependent
# package may be provided either
# internally or externally to the current
# package or 'external' if the dependent
# package may only be provided outside of
# the current package. This also serves as
# the default value for where the
# configuration script expects to find the
# package.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
# ----------------------------------------------------------------------------
AC_DEFUN([_NL_ARG_WITH_PACKAGE],
[
AC_ARG_WITH($5,
AS_HELP_STRING([--with-$5=DIR],
[Specify location of the $1 $3 headers and libraries @<:@default=$2@:>@.]),
[
if test "${withval}" = "no"; then
m4_if([$1],
[required],
[AC_MSG_ERROR([${PACKAGE_NAME} requires the $3 package.])],
[nl_with_$5=${withval}])
elif test "${withval}" = "internal"; then
$5_dir=${withval}
nl_with_$5=${withval}
else
$5_dir=${withval}
nl_with_$5=external
fi
],
[$5_dir=; nl_with_$5=$2])
# Allow users to specify external headers and libraries independently.
_NL_ARG_WITH_INCLUDES([$1], [$2], [$3], [$4], [$5])dnl
_NL_ARG_WITH_LIBS([$1], [$2], [$3], [$4], [$5])dnl
])
# _NL_WITH_PACKAGE(PACKAGE-DISPOSITION,
# PACKAGE-SOURCE,
# PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME,
# [DEFAULT-PACKAGE-LIBS],
# [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
# [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
# ----------------------------------------------------------------------------
# This macro is used to test for the presence, with pkg-config if it
# is available, of the specified, optional or required dependent
# package. The dependent package may be provided externally or may
# exist within the current package itself.
#
# If the package is specified as required, failure to find the
# dependent package will result in a fatal error.
#
# At the successful conclusion of the execution of the macro, three
# variables will be defined:
#
# * <PACKAGE-VARIABLE-PREFIX>_CPPFLAGS
# * <PACKAGE-VARIABLE-PREFIX>_LDFLAGS
# * <PACKAGE-VARIABLE-PREFIX>_LIBS
#
# In addition, the variable:
#
# * nl_with_<PACKAGE-SUCCINCT-NAME>
#
# will unconditionally be set to the source of the package if it is to
# be used and is found; otherwise, 'no' if it is not to be used.
#
# The package disposition and source are specified by:
#
# PACKAGE-DISPOSITION : This may be either 'required' if the dependent
# package is required or 'optional' if
# not.
# PACKAGE-SOURCE : This may be either 'internal' if the dependent
# package may be provided either
# internally or externally to the current
# package or 'external' if the dependent
# package may only be provided outside of
# the current package. This also serves as
# the default value for where the
# configuration script expects to find the
# package.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
#
# In addition, if any additional, default link libraries are required
# for use with the package, these are specified as:
#
# DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
# the package. These are used if pkg-config is
# not available or cannot identify any
# such libraries. For example, '-lmgsp'.
#
# If the package is specified, either internally or externally, optional
# actions are run.
#
# ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
# is not external.
# ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
# is not internal.
# ----------------------------------------------------------------------------
AC_DEFUN([_NL_WITH_PACKAGE],
[
# Influential external variables for the package support
AC_ARG_VAR($4_CPPFLAGS, [$3 C preprocessor flags])
AC_ARG_VAR($4_LDFLAGS, [$3 linker flags])
AC_ARG_VAR($4_LIBS, [$3 linker libraries])
# Allow the user to specify both external headers and libraries
# together (or internal).
_NL_ARG_WITH_PACKAGE([$1], [$2], [$3], [$4], [$5])dnl
if test "${nl_with_$5}" == "no"; then
AC_MSG_CHECKING([whether to use the $3 package])
AC_MSG_RESULT([${nl_with_$5}])
else
AC_MSG_CHECKING([source of the $3 package])
AC_MSG_RESULT([${nl_with_$5}])
# If the user has selected or has defaulted into the internal $3
# package, set the values appropriately. Otherwise, run through the
# usual routine.
if test "${nl_with_$5}" = "internal"; then
$7
else
# We always prefer checking the values of the various '--with-$5-...'
# options first to using pkg-config because the former might be used
# in a cross-compilation environment on a system that also contains
# pkg-config. In such a case, the user wants what he/she specified
# rather than what pkg-config indicates.
if test "x${$5_dir}" != "x" -o "x${$5_header_dir}" != "x" -o "x${$5_library_dir}" != "x"; then
if test "x${$5_dir}" != "x"; then
if test -d "${$5_dir}"; then
if test -d "${$5_dir}/include"; then
$4_CPPFLAGS="-I${$5_dir}/include"
else
$4_CPPFLAGS="-I${$5_dir}"
fi
if test -d "${$5_dir}/lib"; then
$4_LDFLAGS="-L${$5_dir}/lib"
else
$4_LDFLAGS="-L${$5_dir}"
fi
else
AC_MSG_ERROR([No such directory ${$5_dir}])
fi
fi
if test "x${$5_header_dir}" != "x"; then
if test -d "${$5_header_dir}"; then
$4_CPPFLAGS="-I${$5_header_dir}"
else
AC_MSG_ERROR([No such directory ${$5_header_dir}])
fi
fi
if test "x${$5_library_dir}" != "x"; then
if test -d "${$5_library_dir}"; then
$4_LDFLAGS="-L${$5_library_dir}"
else
AC_MSG_ERROR([No such directory ${$5_library_dir}])
fi
fi
$4_LIBS="${$4_LDFLAGS} $6"
elif test "x${PKG_CONFIG}" != "x"; then
if ${PKG_CONFIG} --exists "$5"; then
$4_CPPFLAGS="`${PKG_CONFIG} --cflags $5`"
$4_LDFLAGS="`${PKG_CONFIG} --libs-only-L $5`"
$4_LIBS="`${PKG_CONFIG} --libs-only-l $5`"
else
m4_if([$1],
[required],
[AC_MSG_ERROR([Cannot find the $5 package with ${PKG_CONFIG}. ${PACKAGE_NAME} requires the $5 package. Try installing the package or use the relevant --with options to configure.])],
[nl_with_$5="no"])
fi
else
m4_if([$1],
[required],
[AC_MSG_ERROR([Cannot find the $3 package. ${PACKAGE_NAME} requires the $3 package.])],
[nl_with_$5="no"])
fi
fi
AC_SUBST($4_CPPFLAGS)
AC_SUBST($4_LDFLAGS)
AC_SUBST($4_LIBS)
if test "${nl_with_$5}" != "internal" -a "${nl_with_$5}" != "no"; then
nl_saved_CPPFLAGS="${CPPFLAGS}"
nl_saved_LDFLAGS="${LDFLAGS}"
nl_saved_LIBS="${LIBS}"
CPPFLAGS="${CPPFLAGS} ${$4_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${$4_LDFLAGS}"
LIBS="${LIBS} ${$4_LIBS}"
$8
CPPFLAGS="${nl_saved_CPPFLAGS}"
LDFLAGS="${nl_saved_LDFLAGS}"
LIBS="${nl_saved_LIBS}"
fi
fi
])
# NL_WITH_REQUIRED_EXTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME,
# [DEFAULT-PACKAGE-LIBS],
# [ACTIONS-TO-RUN])
# ----------------------------------------------------------------------------
# This macro is used to test for the presence, with pkg-config if it
# is available, of the specified, required external dependent package.
#
# Failure to find the dependent package will result in a fatal error.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
#
# In addition, if any additional, default link libraries are required
# for use with the package, these are specified as:
#
# DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
# the package. These are used if pkg-config is
# not available or cannot identify any
# such libraries. For example, '-lmgsp'.
#
# If the package is specified, optional actions are run.
#
# ACTIONS-TO-RUN-IF-FOUND : Optional actions to run if the package is found.
# ----------------------------------------------------------------------------
AC_DEFUN([NL_WITH_REQUIRED_EXTERNAL_PACKAGE],
[
_NL_WITH_PACKAGE([required], [external], [$1], [$2], [$3], [$4], [:], [$5])dnl
])
# NL_WITH_OPTIONAL_EXTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME,
# [DEFAULT-PACKAGE-LIBS],
# [ACTIONS-TO-RUN])
# ----------------------------------------------------------------------------
# This macro is used to test for the presence, with pkg-config if it
# is available, of the specified, optional external dependent package.
#
# Failure to find the dependent package will NOT result in a fatal error.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
#
# In addition, if any additional, default link libraries are required
# for use with the package, these are specified as:
#
# DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
# the package. These are used if pkg-config is
# not available or cannot identify any
# such libraries. For example, '-lmgsp'.
#
# If the package is specified, optional actions are run.
#
# ACTIONS-TO-RUN-IF-FOUND : Optional actions to run if the package is found.
# ----------------------------------------------------------------------------
AC_DEFUN([NL_WITH_OPTIONAL_EXTERNAL_PACKAGE],
[
_NL_WITH_PACKAGE([optional], [external], [$1], [$2], [$3], [$4], [:], [$5])dnl
])
# NL_WITH_REQUIRED_INTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME,
# [DEFAULT-PACKAGE-LIBS],
# [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
# [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
# ----------------------------------------------------------------------------
# This macro is used to test for the presence, with pkg-config if it
# is available, of the specified, required dependent package. The dependent
# package may be provided externally or may exist within the current
# package itself.
#
# Failure to find the dependent package will result in a fatal error.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
#
# In addition, if any additional, default link libraries are required
# for use with the package, these are specified as:
#
# DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
# the package. These are used if pkg-config is
# not available or cannot identify any
# such libraries. For example, '-lmgsp'.
#
# If the package is specified, either internally or externally, optional
# actions are run.
#
# ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
# is not external.
# ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
# is not internal.
# ----------------------------------------------------------------------------
AC_DEFUN([NL_WITH_REQUIRED_INTERNAL_PACKAGE],
[
_NL_WITH_PACKAGE([required], [internal], [$1], [$2], [$3], [$4], [$5], [$6])dnl
])
# NL_WITH_OPTIONAL_INTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
# PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME,
# [DEFAULT-PACKAGE-LIBS],
# [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
# [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
# ----------------------------------------------------------------------------
# This macro is used to test for the presence, with pkg-config if it
# is available, of the specified, optional dependent package. The dependent
# package may be provided externally or may exist within the current
# package itself.
#
# Failure to find the dependent package will NOT result in a fatal error.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
#
# In addition, if any additional, default link libraries are required
# for use with the package, these are specified as:
#
# DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
# the package. These are used if pkg-config is
# not available or cannot identify any
# such libraries. For example, '-lmgsp'.
#
# If the package is specified, either internally or externally, optional
# actions are run.
#
# ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
# is not external.
# ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
# is not internal.
# ----------------------------------------------------------------------------
AC_DEFUN([NL_WITH_OPTIONAL_INTERNAL_PACKAGE],
[
_NL_WITH_PACKAGE([optional], [internal], [$1], [$2], [$3], [$4], [$5], [$6])dnl
])
# NL_WITH_PACKAGE(PACKAGE-PRETTY-NAME, PACKAGE-VARIABLE-PREFIX,
# PACKAGE-SUCCINCT-NAME, [DEFAULT-PACKAGE-LIBS],
# [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
# [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
# ----------------------------------------------------------------------------
# This macro is used to test for the presence, with pkg-config if it
# is available, of the specified dependent package. The dependent
# package may be provided externally or may exist within the current
# package itself.
#
# The dependent package is specified in three forms:
#
# PACKAGE-PRETTY-NAME : The human-readable name by which the package
# will be referred for any diagnostic output. For
# example, "My Great Software Package".
# PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
# defined as a result of running this macro for the
# packages. For example, "MGSP" here is transformed
# into MGSP_CPPFLAGS.
# PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
# in temporary variables and on the
# configure command line. For example,
# "mgsp" here is used for --with-mgsp=DIR
# or 'pkg-config --cflags mgsp'.
#
# In addition, if any additional, default link libraries are required
# for use with the package, these are specified as:
#
# DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
# the package. These are used if pkg-config is
# not available or cannot identify any
# such libraries. For example, '-lmgsp'.
#
# If the package is specified, either internally or externally, optional
# actions are run.
#
# ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
# is not external.
# ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
# is not internal.
# ----------------------------------------------------------------------------
AC_DEFUN([NL_WITH_PACKAGE],
[
m4_warn(obsolete, [$0: this macro has been deprecated. Consider using NL_WITH_REQUIRED_INTERNAL_PACKAGE instead.])
NL_WITH_REQUIRED_INTERNAL_PACKAGE([$1], [$2], [$3], [$4], [$5], [$6])dnl
])
-159
View File
@@ -1,159 +0,0 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <[email protected]>.
#
# 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.
#
# 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.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES
-215
View File
@@ -1,215 +0,0 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <[email protected]>, 1996.
# 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, 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.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <[email protected]>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
@@ -1,162 +0,0 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2009-04-28.21; # UTC
# Original author: Noah Friedman <[email protected]>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <[email protected]> or send patches to
# <[email protected]>.
nl='
'
IFS=" "" $nl"
errstatus=0
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <[email protected]>."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp=$pathcomp/
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
-170
View File
@@ -1,170 +0,0 @@
#!/bin/sh
# py-compile - Compile a Python program
scriptversion=2011-06-08.12; # UTC
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
# 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, 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 file is maintained in Automake, please report
# bugs to <[email protected]> or send patches to
# <[email protected]>.
if [ -z "$PYTHON" ]; then
PYTHON=python
fi
me=py-compile
usage_error ()
{
echo "$me: $*" >&2
echo "Try '$me --help' for more information." >&2
exit 1
}
basedir=
destdir=
while test $# -ne 0; do
case "$1" in
--basedir)
if test $# -lt 2; then
usage_error "option '--basedir' requires an argument"
else
basedir=$2
fi
shift
;;
--destdir)
if test $# -lt 2; then
usage_error "option '--destdir' requires an argument"
else
destdir=$2
fi
shift
;;
-h|--help)
cat <<\EOF
Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
Byte compile some python scripts FILES. Use --destdir to specify any
leading directory path to the FILES that you don't want to include in the
byte compiled file. Specify --basedir for any additional path information you
do want to be shown in the byte compiled file.
Example:
py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py
Report bugs to <[email protected]>.
EOF
exit $?
;;
-v|--version)
echo "$me $scriptversion"
exit $?
;;
--)
shift
break
;;
-*)
usage_error "unrecognized option '$1'"
;;
*)
break
;;
esac
shift
done
files=$*
if test -z "$files"; then
usage_error "no files given"
fi
# if basedir was given, then it should be prepended to filenames before
# byte compilation.
if [ -z "$basedir" ]; then
pathtrans="path = file"
else
pathtrans="path = os.path.join('$basedir', file)"
fi
# if destdir was given, then it needs to be prepended to the filename to
# byte compile but not go into the compiled file.
if [ -z "$destdir" ]; then
filetrans="filepath = path"
else
filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
fi
$PYTHON -c "
import sys, os, py_compile, imp
files = '''$files'''
sys.stdout.write('Byte-compiling python modules...\n')
for file in files.split():
$pathtrans
$filetrans
if not os.path.exists(filepath) or not (len(filepath) >= 3
and filepath[-3:] == '.py'):
continue
sys.stdout.write(file)
sys.stdout.flush()
if hasattr(imp, 'get_tag'):
py_compile.compile(filepath, imp.cache_from_source(filepath), path)
else:
py_compile.compile(filepath, filepath + 'c', path)
sys.stdout.write('\n')" || exit $?
# this will fail for python < 1.5, but that doesn't matter ...
$PYTHON -O -c "
import sys, os, py_compile, imp
# pypy does not use .pyo optimization
if hasattr(sys, 'pypy_translation_info'):
sys.exit(0)
files = '''$files'''
sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
for file in files.split():
$pathtrans
$filetrans
if not os.path.exists(filepath) or not (len(filepath) >= 3
and filepath[-3:] == '.py'):
continue
sys.stdout.write(file)
sys.stdout.flush()
if hasattr(imp, 'get_tag'):
py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
else:
py_compile.compile(filepath, filepath + 'o', path)
sys.stdout.write('\n')" 2>/dev/null || :
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
-139
View File
@@ -1,139 +0,0 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2013-07-13.22; # UTC
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# 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, 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 file is maintained in Automake, please report
# bugs to <[email protected]> or send patches to
# <[email protected]>.
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <<END
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
enable_hard_errors=yes
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
--version) echo "test-driver $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
*) break;;
esac
shift
done
missing_opts=
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
if test x"$missing_opts" != x; then
usage_error "the following mandatory options are missing:$missing_opts"
fi
if test $# -eq 0; then
usage_error "missing argument"
fi
if test $color_tests = yes; then
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
red='' # Red.
grn='' # Green.
lgn='' # Light green.
blu='' # Blue.
mgn='' # Magenta.
std='' # No color.
else
red= grn= lgn= blu= mgn= std=
fi
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
trap "st=129; $do_exit" 1
trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
estatus=1
fi
case $estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
-23
View File
@@ -1,23 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the generic "tail" or post automake header that may
# be included in any automakefile used in the build tree.
#
include $(abs_top_nlbuild_autotools_dir)/automake/post/rules.am
@@ -1,25 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the automake footer for all common
# (i.e. non-toolchain-specific) rules.
#
include $(abs_top_nlbuild_autotools_dir)/automake/post/rules/coverage.am
include $(abs_top_nlbuild_autotools_dir)/automake/post/rules/pretty.am
include $(abs_top_nlbuild_autotools_dir)/automake/post/rules/headers.am
@@ -1,39 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the automake footer for all code-coverage related
# targets and rules.
#
# This represents the minimum integration with GNU autotools
# (automake in particular) such that 'make coverage' may be invoked
# at the top of the tree and all the prerequisites occur such
# that it executes successfully with no intervening make target
# invocations. The 'check-am' and '$(BUILT_SOURCES)' are the key
# automake-specific dependencies to ensure that happens.
#
.PHONY: coverage coverage-recursive
coverage: coverage-recursive
coverage: check-am
coverage: $(BUILT_SOURCES)
coverage-recursive:
$(nl-make-subdirs)
@@ -1,45 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the automake footer for installing header files
# independently of the rest of a package.
#
# Packages that wish to avail themselves of this target may wish
# to add the following goals and dependencies:
#
# install-headers: install-includeHEADERS
#
# in places where the package uses and defines 'include_HEADERS' or
#
# install-headers: install-data
#
# where the package uses and defines a more complex 'dist_*_HEADERS'.
#
# This represents the minimum integration with GNU autotools
# (automake inparticular) such that 'make install-headers' may be
# invoked at the top of the tree and all the prerequisites occur
# such that it executes successfully with no intervening make
# target invocations.
#
.PHONY: install-headers install-headers-recursive
install-headers: install-headers-recursive
install-headers-recursive:
$(nl-make-subdirs)
@@ -1,79 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the automake footer for all coding style-related
# targets and rules.
#
# The recursive target 'pretty', invoked against '$(PRETTY_SUBDIRS)',
# is intended to reformat a collection of source files, defined by
# '$(PRETTY_FILES)' using the program '$(PRETTY)' with the arguments
# '$(PRETTY_ARGS)'.
#
# The recursive target 'pretty-check' (and its alias 'lint'),
# invoked against '$(PRETTY_SUBDIRS)', is intended to only check
# but NOT reformat a collection of source files, defined by
# '$(PRETTY_FILES)' using the program '$(PRETTY_CHECK)' with the
# arguments '$(PRETTY_CHECK_ARGS)'.
#
# This represents the minimum integration with GNU autotools
# (automake inparticular) such that 'make pretty' and 'make
# pretty-check' may be invoked at the top of the tree and all
# the prerequisites occur such that it executes successfully
# with no intervening make target invocations. '$(BUILT_SOURCES)'
# are the key automake-specific dependencies to ensure that happens.
#
# nl-make-pretty <TERSE OUTPUT COMMAND> <COMMAND> <COMMAND ARGUMENTS> <PATHS>
#
# This function iterates over PATHS, invoking COMMAND with
# COMMAND ARGUEMENTS on each file. If a non-verbose make has been
# requested TERSE OUTPUT COMMAND is emitted to standard output.
define nl-make-pretty
$(AM_V_at)for file in $(4); do \
$(1) \
if test -f $${file}; then d=.; else d=$(srcdir); fi; \
$(2) $(3) $${d}/$${file} \
|| exit 1; \
done
endef
.PHONY: pretty pretty-recursive pretty-check pretty-check-recursive lint
pretty: pretty-recursive
pretty pretty-check: $(BUILT_SOURCES)
# Map the build action 'lint' to the more vernacular 'pretty-check'.
lint: pretty-check
pretty-check: pretty-check-recursive
pretty-recursive pretty-check-recursive:
$(call nl-make-subdirs-with-dirs,$(PRETTY_SUBDIRS))
pretty: $(PRETTY_FILES)
ifneq ($(PRETTY),)
$(call nl-make-pretty,$(AM_V_PRETTY),$(PRETTY),$(PRETTY_ARGS),$(filter-out $(@)-recursive,$(PRETTY_FILES)))
endif
pretty-check: $(PRETTY_FILES)
ifneq ($(PRETTY_CHECK),)
$(call nl-make-pretty,$(AM_V_PRETTY_CHECK),$(PRETTY_CHECK),$(PRETTY_CHECK_ARGS),$(filter-out $(@)-recursive,$(PRETTY_FILES)))
endif
-23
View File
@@ -1,23 +0,0 @@
#
# Copyright 2014-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the generic "head" or pre automake header that may
# be included in any automakefile used in the build tree.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros.am
@@ -1,85 +0,0 @@
#
# Copyright 2014-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines automake macros common to all other automake
# headers and files.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/constants.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/paths.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/pretty.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/verbosity.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/coverage.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/subdirs.am
#
# create-directory
#
# Create the directory with the name of the $(@) variable.
#
define create-directory
$(AM_V_MKDIR_P)$(MKDIR_P) $(@)
endef # create-directory
#
# create-link
#
# Create the symbolic link with the source of the $(<) variable and
# the destination of the $(@) variable.
#
define create-link
$(AM_V_LN_S)$(LN_S) $(<) $(@)
endef # create-link
#
# check-file <macro suffix>
#
# Check whether a file, referenced by the $(@) variable, should be
# updated / regenerated based on its dependencies, referenced by the
# $(<) variable by running the make macro check-file-<macro suffix>.
#
# The $(<) is passed as the first argument if the macro wants to process
# it and the prospective new output file, which the macro MUST
# generate, as the second.
#
# This macro will ensure that any required parent directories are created
# prior to invoking check-file-<macro suffix>.
#
# This macro is similar to and inspired by that from Linux Kbuild and
# elsewhere.
#
# <macro suffix> - The name, suffixed to "check-file-", which indicates
# the make macro to invoke.
#
#
define check-file
$(AM_V_at)set -e; \
echo ' CHECK $(@)'; \
$(MKDIR_P) $(dir $(@)); \
$(call check-file-$(1),$(<),$(@).N); \
if [ -r "$(@)" ] && $(CMP) -s "$(@)" "$(@).N"; then \
rm -f "$(@).N"; \
else \
echo ' GEN $(@)'; \
mv -f "$(@).N" "$(@)"; \
fi
endef # check-file
@@ -1,30 +0,0 @@
#
# Copyright 2010-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines automake file constants common to all other
# automake headers and files.
#
#
# Character constants for those make does not otherwise handle well or
# naturally.
#
# Path separator
Slash := /
@@ -1,106 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines automake variables and macros common to all
# other automake headers and files for code coverage.
#
# Suffixes
#
# Suffix for the code coverage report "bundle".
#
NL_COVERAGE_BUNDLE_SUFFIX = .lcov
#
# Suffix for the lcov "info" file inside the code coverage report bundle.
#
NL_COVERAGE_INFO_SUFFIX = .info
#
# Verbosity macros and flags
#
NL_V_LCOV = $(nl__v_LCOV_$(V))
nl__v_LCOV_ = $(nl__v_LCOV_$(AM_DEFAULT_VERBOSITY))
nl__v_LCOV_0 = @echo " LCOV $(@)";
nl__v_LCOV_1 =
NL_V_LCOV_FLAGS = $(nl__v_LCOV_FLAGS_$(V))
nl__v_LCOV_FLAGS_ = $(nl__v_LCOV_FLAGS_$(AM_DEFAULT_VERBOSITY))
nl__v_LCOV_FLAGS_0 = --quiet
nl__v_LCOV_FLAGS_1 =
NL_V_GENHTML = $(nl__v_GENHTML_$(V))
nl__v_GENHTML_ = $(nl__v_GENHTML_$(AM_DEFAULT_VERBOSITY))
nl__v_GENHTML_0 = @echo " GENHTML $(@)";
nl__v_GENHTML_1 =
NL_V_GENHTML_FLAGS = $(nl__v_GENHTML_FLAGS_$(V))
nl__v_GENHTML_FLAGS_ = $(nl__v_GENHTML_FLAGS_$(AM_DEFAULT_VERBOSITY))
nl__v_GENHTML_FLAGS_0 = --quiet
nl__v_GENHTML_FLAGS_1 =
#
# generate-coverage-report <directory>
#
# Capture, using lcov, a coverage report from the specified directory 'directory'
# with an final output "info" file as specified by the target variable.
#
# <directory> - The directory from which lcov should search for coverage data (*.gcno & *.gcda)
#
# - create baseline coverage data file (base.info) with '-i|--initial' option
# - create test coverage data file (test.info)
# - combine baseline and test coverage data to create the final "info" file
#
# Then, on success, generate an HTML-based coverage report using genhtml.
#
define generate-coverage-report
$(NL_V_LCOV)$(LCOV) $(NL_V_LCOV_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" --initial --capture --directory "$(1)" --output-file "base.info"
$(NL_V_LCOV)$(LCOV) $(NL_V_LCOV_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" --capture --directory "$(1)" --output-file "test.info"
$(NL_V_LCOV)$(LCOV) $(NL_V_LCOV_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" --add-tracefile "base.info" --add-tracefile "test.info" --output-file "$(@)"
$(NL_V_GENHTML)$(GENHTML) $(NL_V_GENHTML_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" "$(@)" --output-directory "$(@D)"
endef # generate-coverage-report
#
# generate-coverage-report-with-filter <directory> <remove_filter>
#
# Capture, using lcov, a coverage report from the specified directory 'directory' and a filter 'remove_filter'
# with an final output "info" file as specified by the target variable.
#
# <directory> - The directory from which lcov should search for coverage data (*.gcno & *.gcda)
#
# <remove_filter> - The filter is a whitespace-separated list of shell wildcard patterns. (note that they may need to be escaped accordingly to prevent
# the shell from expanding them first). Every file entry in tracefile which matches at least one of those patterns will be removed.
#
# - create baseline coverage data file (base.info) with '-i|--initial' option
# - create test coverage data file (test.info)
# - combine baseline and test coverage data to create the final "info" file
# - remove particular coverage data specifiled by the remove_filter (no change if remove_filter is null)
#
# Then, on success, generate an HTML-based coverage report using genhtml.
#
define generate-coverage-report-with-filter
$(NL_V_LCOV)$(LCOV) $(NL_V_LCOV_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" --initial --capture --directory "$(1)" --output-file "base.info"
$(NL_V_LCOV)$(LCOV) $(NL_V_LCOV_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" --capture --directory "$(1)" --output-file "test.info"
$(NL_V_LCOV)$(LCOV) $(NL_V_LCOV_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" --add-tracefile "base.info" --add-tracefile "test.info" --output-file "$(@)"
$(NL_V_LCOV)$(LCOV) $(NL_V_LCOV_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" --remove "$(@)" $(foreach pattern,$(2),"$(pattern)") --output-file "$(@)"
$(NL_V_GENHTML)$(GENHTML) $(NL_V_GENHTML_FLAGS) --config-file="$(abs_top_nlbuild_autotools_dir)/etc/lcov.config" "$(@)" --output-directory "$(@D)"
endef # generate-coverage-report-with-filter
@@ -1,42 +0,0 @@
#
# Copyright 2010-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines automake macros for manipulating and querying
# paths.
#
# Deslashify <path> ...
#
# Ensure that there is NO trailing directory delimiter at the end of
# the specified path.
Deslashify = $(patsubst %$(Slash),%,$(1))
# Slashify <path> ...
#
# Ensure that there is a single trailing directory delimiter at the
# end of the specified path.
Slashify = $(addsuffix $(Slash),$(call Deslashify,$(1)))
#
# IsRealPath <path>
#
# If the path is a real rather than symbolic link path, the path is returned.
IsRealPath = $(if $(patsubst $(realpath $(1)),,$(abspath $(1))),,$(1))
@@ -1,52 +0,0 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines automake variables for performing coding
# style formatting and checking.
#
AM_V_PRETTY = $(am__v_PRETTY_$(V))
am__v_PRETTY_ = $(am__v_PRETTY_$(AM_DEFAULT_VERBOSITY))
am__v_PRETTY_0 = echo " PRETTY $${file}";
am__v_PRETTY_1 =
AM_V_PRETTY_CHECK = $(am__v_PRETTY_CHECK_$(V))
am__v_PRETTY_CHECK_ = $(am__v_PRETTY_CHECK_$(AM_DEFAULT_VERBOSITY))
am__v_PRETTY_CHECK_0 = echo " PRETTY $${file}";
am__v_PRETTY_CHECK_1 =
# PRETTY_FILES
#
# This defines the collection of files against which the PRETTY and
# PRETTY_CHECK profiles will be invoked for the 'pretty' and
# 'pretty-check' targets, respectively.
#
# This defaults to SOURCES and HEADERS and may be overriden or
# appended to.
PRETTY_FILES ?= $(SOURCES) $(HEADERS)
# PRETTY_SUBDIRS
#
# This defines the subdirectories for which the recursive 'pretty' and
# 'pretty-check' targets will run against.
#
# This defaults to SUBDIRS and may be overridden or appended to.
PRETTY_SUBDIRS ?= $(SUBDIRS)
@@ -1,78 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines automake variables and macros common to all
# other automake headers and files for invoking make in a list
# of subdirectories with a list of target goals.
#
#
# nl-make-subdirs-with-dirs-and-goals <subdirectories> <goals>
#
# This iteratively invokes make with the provided target goals in each
# subdirectory specified.
#
# subdirectories A space-delimited list of subdirectories in which to
# invoke make with the provided target goals.
#
# goals A space-delimited list of target goals to
# attempt to make in each specified subdirectory.
#
define nl-make-subdirs-with-dirs-and-goals
+$(AM_V_at)for subdir in $(1); do \
echo "Making $(2) in $${subdir}"; \
$(MAKE) -C "$${subdir}" $(AM_MAKEFLAGS) $(2) \
|| exit 1; \
done
endef # nl-make-subdirs-with-dirs-and-goals
#
# nl-make-subdirs-with-dirs <subdirectories>
#
# This iteratively invokes make with the target goals defined in
# MAKECMDGOALS in each subdirectory specified.
#
# subdirectories A space-delimited list of subdirectories in which to
# invoke make with the provided target goals.
#
define nl-make-subdirs-with-dirs
$(call nl-make-subdirs-with-dirs-and-goals,$(1),$(MAKECMDGOALS))
endef # nl-make-subdirs-with-dirs
#
# nl-make-subdirs-with-goals <goals>
#
# This iteratively invokes make with the provided target goals in the
# subdirectories defined in SUBDIRS.
#
# goals A space-delimited list of target goals to
# attempt to make in SUBDIRS.
#
define nl-make-subdirs-with-goals
$(call nl-make-subdirs-with-dirs-and-goals,$(SUBDIRS),$(1))
endef # nl-make-subdirs-with-goals
#
# nl-make-subdirs
#
# This iteratively invokes make with the target goals defined in
# MAKECMDGOALS in the subdirectories defined in SUBDIRS.
#
define nl-make-subdirs
$(call nl-make-subdirs-with-dirs-and-goals,$(SUBDIRS),$(MAKECMDGOALS))
endef # nl-make-subdirs
@@ -1,35 +0,0 @@
#
# Copyright 2014-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file defines automake variables common to all other
# automake headers and files for silent-rules-style (V=[0|1]) build
# verbosity output.
#
AM_V_LN_S = $(am__v_LN_S_$(V))
am__v_LN_S_ = $(am__v_LN_S_$(AM_DEFAULT_VERBOSITY))
am__v_LN_S_0 = @echo " LN $(@)";
am__v_LN_S_1 =
AM_V_MKDIR_P = $(am__v_MKDIR_P_$(V))
am__v_MKDIR_P_ = $(am__v_MKDIR_P_$(AM_DEFAULT_VERBOSITY))
am__v_MKDIR_P_0 = @echo " MKDIR $(@)";
am__v_MKDIR_P_1 =
-148
View File
@@ -1,148 +0,0 @@
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is an lcov configuration file based on the default
# from /etc/lcovrc. The key difference is the inclusion of
# 'genhtml_branch_coverage = 1' and lcov_branch_coverage = 1' to
# ensure that branch coverage is reported.
#
# External style sheet file
#genhtml_css_file = gcov.css
# Coverage rate limits
genhtml_hi_limit = 90
genhtml_med_limit = 75
# Width of line coverage field in source code view
genhtml_line_field_width = 12
# Width of branch coverage field in source code view
genhtml_branch_field_width = 16
# Width of overview image
genhtml_overview_width = 80
# Resolution of overview navigation
genhtml_nav_resolution = 4
# Offset for source code navigation
genhtml_nav_offset = 10
# Do not remove unused test descriptions if non-zero
genhtml_keep_descriptions = 0
# Do not remove prefix from directory names if non-zero
genhtml_no_prefix = 0
# Do not create source code view if non-zero
genhtml_no_source = 0
# Specify size of tabs
genhtml_num_spaces = 8
# Highlight lines with converted-only data if non-zero
genhtml_highlight = 0
# Include color legend in HTML output if non-zero
genhtml_legend = 0
# Include HTML file at start of HTML output
#genhtml_html_prolog = prolog.php
# Include HTML file at end of HTML output
#genhtml_html_epilog = epilog.php
# Use custom HTML file extension
#genhtml_html_extension = html
# Compress all generated html files with gzip.
#genhtml_html_gzip = 1
# Include sorted overview pages
genhtml_sort = 1
# Include function coverage data display
#genhtml_function_coverage = 1
# Include branch coverage data display
genhtml_branch_coverage = 1
# Specify the character set of all generated HTML pages
genhtml_charset=UTF-8
# Allow HTML markup in test case description text if non-zero
genhtml_desc_html=0
# Location of the gcov tool
#geninfo_gcov_tool = gcov
# Adjust test names if non-zero
#geninfo_adjust_testname = 0
# Calculate a checksum for each line if non-zero
geninfo_checksum = 0
# Enable libtool compatibility mode if non-zero
geninfo_compat_libtool = 0
# Specify whether to capture coverage data for external source
# files
#geninfo_external = 1
# Use gcovs --all-blocks option if non-zero
#geninfo_gcov_all_blocks = 1
# Specify compatiblity modes (same as --compat option
# of geninfo)
#geninfo_compat = libtool=on, hammer=auto, split_crc=auto
# Adjust path to source files by removing or changing path
# components that match the specified pattern (Perl regular
# expression format)
#geninfo_adjust_src_path = /tmp/build => /usr/src
# Specify if geninfo should try to automatically determine
# the base-directory when collecting coverage data.
geninfo_auto_base = 1
# Directory containing gcov kernel files
lcov_gcov_dir = /proc/gcov
# Location for temporary directories
lcov_tmp_dir = /tmp
# Show full paths during list operation if non-zero
lcov_list_full_path = 0
# Specify the maximum width for list output. This value is
# ignored when lcov_list_full_path is non-zero.
lcov_list_width = 80
# Specify the maximum percentage of file names which may be
# truncated when choosing a directory prefix in list output.
# This value is ignored when lcov_list_full_path is non-zero.
lcov_list_truncate_max = 20
# Specify if function coverage data should be collected and
# processed.
lcov_function_coverage = 1
# Specify if branch coverage data should be collected and
# processed.
lcov_branch_coverage = 1
File diff suppressed because it is too large Load Diff
@@ -1,102 +0,0 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the GNU automake template for the @PACKAGE_DESCRIPTION@
# in-package, documentation.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
EXTRA_DIST = \
$(srcdir)/Doxyfile.in \
$(NULL)
#
# Override autotool's default notion of the package version variables.
# This ensures that when we create a doc distribution that the
# version is always the current version, not the version when the
# package was bootstrapped.
#
PACKAGE_VERSION = $(shell cat $(top_builddir)/.local-version)
VERSION = $(PACKAGE_VERSION)
docdistdir ?= .
@PACKAGE_SHORT_LOWER@_docdist_alias = \
$(PACKAGE_TARNAME)-docs
@PACKAGE_SHORT_LOWER@_docdist_name = \
$(@PACKAGE_SHORT_LOWER@_docdist_alias)-$(VERSION)
@PACKAGE_SHORT_LOWER@_docdist_archive = \
$(docdistdir)/$(@PACKAGE_SHORT_LOWER@_docdist_name).tar.gz
CLEANFILES = \
Doxyfile \
$(@PACKAGE_SHORT_LOWER@_docdist_archive) \
$(NULL)
if @PACKAGE_SHORT_UPPER@_BUILD_DOCS
all-local: html/index.html
#
# We choose to manually transform Doxyfile.in into Doxyfile here in
# the makefile rather than in the configure script so that we can take
# advantage of live, at build time (rather than at configure time),
# updating of the package version number.
#
Doxyfile: $(srcdir)/Doxyfile.in Makefile
$(AM_V_GEN)$(SED) \
-e "s,\@DOXYGEN_USE_DOT\@,$(DOXYGEN_USE_DOT),g" \
-e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
-e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
-e "s,\@PERL\@,$(PERL),g" \
-e "s,\@abs_builddir\@,$(abs_builddir),g" \
-e "s,\@abs_srcdir\@,$(abs_srcdir),g" \
-e "s,\@abs_top_builddir\@,$(abs_top_builddir),g" \
-e "s,\@abs_top_srcdir\@,$(abs_top_srcdir),g" \
< "$(srcdir)/Doxyfile.in" > "$(@)"
html/index.html: Doxyfile
$(AM_V_GEN)$(DOXYGEN) $(<)
#
# Addition rules and commands to create a documentation-only
# distribution of @PACKAGE_SHORT_LOWER@
#
$(@PACKAGE_SHORT_LOWER@_docdist_name): html/index.html
$(AM_V_at)rm -f -r $(@)
$(call create-directory)
$(AM_V_at)cp -R html $(@)
$(@PACKAGE_SHORT_LOWER@_docdist_archive): $(@PACKAGE_SHORT_LOWER@_docdist_name)
$(AM_V_at)echo " TAR $(@)"
$(AM_V_at)tardir="$(<)" && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c > "$(@)" && rm -rf $(<)
docdist $(@PACKAGE_SHORT_LOWER@_docdist_alias): $(@PACKAGE_SHORT_LOWER@_docdist_archive)
clean-local:
$(AM_V_at)rm -f -r html
endif # @PACKAGE_SHORT_UPPER@_BUILD_DOCS
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
@@ -1,28 +0,0 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the GNU automake template for the @PACKAGE_DESCRIPTION@
# first-party (e.g. Nest Labs) software directory.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
SUBDIRS = \
$(NULL)
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
@@ -1,42 +0,0 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the GNU automake template for the @PACKAGE_DESCRIPTION@.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
lib_LIBRARIES = lib@[email protected]
lib@PACKAGE_SHORT_LOWER@_a_CPPFLAGS = \
-I$(top_srcdir)/include \
$(NULL)
lib@PACKAGE_SHORT_LOWER@_a_SOURCES = @[email protected]
include_HEADERS = \
@[email protected] \
$(NULL)
install-headers: install-includeHEADERS
if @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
endif # @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
@@ -1,107 +0,0 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the GNU automake template for the @PACKAGE_DESCRIPTION@
# unit tests.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
#
# Local headers to build against and distribute but not to install
# since they are not part of the package.
#
noinst_HEADERS = \
@[email protected] \
$(NULL)
#
# Other files we do want to distribute with the package.
#
EXTRA_DIST = \
$(NULL)
if @PACKAGE_SHORT_UPPER@_BUILD_TESTS
# C preprocessor option flags that will apply to all compiled objects in this
# makefile.
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
$(NULL)
COMMON_LDADD = \
-L${top_builddir}/src -l@PACKAGE_SHORT_LOWER@
$(NULL)
# Test applications that should be run when the 'check' target is run.
check_PROGRAMS = \
@PACKAGE_SHORT_LOWER@-test \
@PACKAGE_SHORT_LOWER@-test-cxx \
$(NULL)
# Test applications and scripts that should be built and run when the
# 'check' target is run.
TESTS = \
$(check_PROGRAMS) \
$(NULL)
# The additional environment variables and their values that will be
# made available to all programs and scripts in TESTS.
TESTS_ENVIRONMENT = \
$(NULL)
# Source, compiler, and linker options for test programs.
@PACKAGE_SHORT_LOWER@_test_LDADD = $(COMMON_LDADD)
@PACKAGE_SHORT_LOWER@_test_SOURCES = @[email protected]
@PACKAGE_SHORT_LOWER@_test_cxx_LDADD = $(COMMON_LDADD)
@PACKAGE_SHORT_LOWER@_test_cxx_SOURCES = @[email protected]
if @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE
CLEANFILES = $(wildcard *.gcda *.gcno)
if @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE_REPORTS
# The bundle should positively be qualified with the absolute build
# path. Otherwise, VPATH will get auto-prefixed to it if there is
# already such a directory in the non-colocated source tree.
@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE = ${abs_builddir}/${PACKAGE}${NL_COVERAGE_BUNDLE_SUFFIX}
@PACKAGE_SHORT_UPPER@_COVERAGE_INFO = ${@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE}/${PACKAGE}${NL_COVERAGE_INFO_SUFFIX}
$(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE):
$(call create-directory)
$(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO): check | $(dir $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO))
$(call generate-coverage-report,${top_builddir})
coverage: $(@PACKAGE_SHORT_UPPER@_COVERAGE_INFO)
clean-local: clean-local-coverage
.PHONY: clean-local-coverage
clean-local-coverage:
-$(AM_V_at)rm -rf $(@PACKAGE_SHORT_UPPER@_COVERAGE_BUNDLE)
endif # @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE_REPORTS
endif # @PACKAGE_SHORT_UPPER@_BUILD_COVERAGE
endif # @PACKAGE_SHORT_UPPER@_BUILD_TESTS
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
@@ -1,153 +0,0 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the GNU automake template for the @PACKAGE_DESCRIPTION@.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
AM_MAKEFLAGS = --no-print-directory
SUBDIRS = \
include \
src \
tests \
doc \
$(NULL)
EXTRA_DIST = \
.default-version \
bootstrap \
bootstrap-configure \
$(srcdir)/third_party/nlbuild-autotools \
$(NULL)
BUILT_SOURCES = \
.local-version \
$(NULL)
dist_doc_DATA = \
$(NULL)
DISTCLEANFILES = \
.local-version \
$(NULL)
#
# Package version files:
#
# .default-version - The default package version. This file is ALWAYS checked
# in and should always represent the current baseline
# version of the package.
#
# .dist-version - The distributed package version. This file is NEVER
# checked in within the upstream repository, is auto-
# generated, and is only found in the package distribution.
#
# .local-version - The current source code controlled package version. This
# file is NEVER checked in within the upstream repository,
# is auto-generated, and can always be found in both the
# build tree and distribution.
#
# When present, the .local-version file is preferred first, the
# .dist-version second, and the .default-version last.
#
VERSION_FILE := $(if $(wildcard $(builddir)/.local-version),$(builddir)/.local-version,$(if $(wildcard $(srcdir)/.dist-version),$(srcdir)/.dist-version,$(srcdir)/.default-version))
#
# Override autotool's default notion of the package version variables.
# This ensures that when we create a source distribution that the
# version is always the current version, not the version when the
# package was bootstrapped.
#
@PACKAGE_SHORT_UPPER@_VERSION ?= $(shell cat $(VERSION_FILE) 2> /dev/null)
PACKAGE_VERSION = $(@PACKAGE_SHORT_UPPER@_VERSION)
VERSION = $(PACKAGE_VERSION)
#
# check-file-.local-version
#
# Speculatively regenerate .local-version and check to see if it needs
# to be updated.
#
# If @PACKAGE_SHORT_UPPER@_VERSION has been supplied anywhere other than in this file
# (which is implicitly the contents of .local-version), then use that;
# otherwise, attempt to generate it from the SCM system.
#
# This is called from $(call check-file,.local-version).
#
define check-file-.local-version
if [ "$(origin @PACKAGE_SHORT_UPPER@_VERSION)" != "file" ]; then \
echo "$(@PACKAGE_SHORT_UPPER@_VERSION)" > "$(2)"; \
else \
$(abs_top_nlbuild_autotools_dir)/scripts/mkversion \
-b "$(@PACKAGE_SHORT_UPPER@_VERSION)" "$(top_srcdir)" \
> "$(2)"; \
fi
endef
#
# check-file-.dist-version
#
# Speculatively regenerate .dist-version and check to see if it needs
# to be updated.
#
# This is called from $(call check-file,.dist-version).
#
define check-file-.dist-version
cat "$(1)" > "$(2)"
endef
#
# A convenience target to allow package users to easily rerun the
# package configuration according to the current configuration.
#
.PHONY: reconfigure
reconfigure: $(builddir)/config.status
$(AM_V_at)$(<) --recheck
#
# Version file regeneration rules.
#
.PHONY: force
$(builddir)/.local-version: $(srcdir)/.default-version force
$(distdir)/.dist-version: $(builddir)/.local-version force
$(distdir)/.dist-version $(builddir)/.local-version:
$(call check-file,$(@F))
dist distcheck: $(BUILT_SOURCES)
dist-hook: $(distdir)/.dist-version
#
# Top-level convenience target for making a documentation-only
# distribution whose results appear at the top level of the build tree
# in the same fashion that the distribution would be for 'make dist'.
#
.PHONY: docdist
docdist: $(BUILT_SOURCES)
$(MAKE) -C doc docdistdir=$(abs_builddir) $(@)
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
-36
View File
@@ -1,36 +0,0 @@
#!/bin/sh
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is a trampoline script to the nlbuild-autotools
# bootstrap script and augments it by providing the path to the
# nlbuild-autotools repository for this project.
#
# Set this to the relative location of nlbuild-autotools to this script
nlbuild_autotools_stem="third_party/nlbuild-autotools/repo"
# Establish some key directories
srcdir=`dirname ${0}`
abs_srcdir=`pwd`
abs_top_srcdir="${abs_srcdir}"
exec ${srcdir}/${nlbuild_autotools_stem}/scripts/bootstrap -I "${abs_top_srcdir}/${nlbuild_autotools_stem}" $*
-382
View File
@@ -1,382 +0,0 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is the GNU autoconf input source file for
# @PACKAGE_DESCRIPTION@.
#
#
# Declare autoconf version requirements
#
AC_PREREQ([2.68])
#
# Initialize autoconf for the package
#
AC_INIT([@PACKAGE_SHORT_UPPER@],
m4_esyscmd([@NLBUILD_AUTOTOOLS_STEM@/scripts/mkversion -b `cat .default-version` .]),
[@PACKAGE_EMAIL@],
[@PACKAGE_SHORT_LOWER@],
[@PACKAGE_URL@])
# Tell the rest of the build system the absolute path where the
# nlbuild-autotools repository is rooted at.
AC_SUBST(nlbuild_autotools_stem,[@NLBUILD_AUTOTOOLS_STEM@])
AC_SUBST(abs_top_nlbuild_autotools_dir,[\${abs_top_srcdir}/\${nlbuild_autotools_stem}])
#
# @PACKAGE_SHORT_UPPER@ interface current, revision, and age versions.
#
# Maintainters: Please manage these fields as follows:
#
# Interfaces removed: CURRENT++, AGE = 0, REVISION = 0
# Interfaces added: CURRENT++, AGE++, REVISION = 0
# No interfaces changed: REVISION++
#
#
AC_SUBST(LIB@PACKAGE_SHORT_UPPER@_VERSION_CURRENT, [1])
AC_SUBST(LIB@PACKAGE_SHORT_UPPER@_VERSION_AGE, [0])
AC_SUBST(LIB@PACKAGE_SHORT_UPPER@_VERSION_REVISION, [0])
AC_SUBST(LIB@PACKAGE_SHORT_UPPER@_VERSION_INFO, [${LIB@PACKAGE_SHORT_UPPER@_VERSION_CURRENT}:${LIB@PACKAGE_SHORT_UPPER@_VERSION_REVISION}:${LIB@PACKAGE_SHORT_UPPER@_VERSION_AGE}])
#
# Check the sanity of the source directory by checking for the
# presence of a key watch file
#
AC_CONFIG_SRCDIR([include/@[email protected]])
#
# Tell autoconf where to find auxilliary build tools (e.g. config.guess,
# install-sh, missing, etc.)
#
AC_CONFIG_AUX_DIR([@NLBUILD_AUTOTOOLS_STEM@/autoconf])
#
# Tell autoconf where to find auxilliary M4 macros
#
AC_CONFIG_MACRO_DIR([@NLBUILD_AUTOTOOLS_STEM@/autoconf/m4])
#
# Tell autoconf what file the package is using to aggregate C preprocessor
# defines.
#
AC_CONFIG_HEADERS([include/@[email protected]])
#
# Figure out what the canonical build, host and target tuples are.
#
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
#
# Mac OS X / Darwin ends up putting some versioning cruft on the end of its
# tuple that we don't care about in this script. Create "clean" variables
# devoid of it.
#
NL_FILTERED_CANONICAL_BUILD
NL_FILTERED_CANONICAL_HOST
NL_FILTERED_CANONICAL_TARGET
#
# Configure automake with the desired options, indicating that this is not
# a native GNU package, that we want "silent" build rules, and that we want
# objects built in the same subdirectory as their source rather than collapsed
# together at the top-level directory.
#
# Disable silent build rules by either passing --disable-silent-rules to
# configure or passing V=1 to make
#
AM_INIT_AUTOMAKE([1.14 foreign silent-rules subdir-objects tar-pax])
#
# Silent build rules requires at least automake-1.11. Employ
# techniques for not breaking earlier versions of automake.
#
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_SILENT_RULES([yes])
#
# Enable maintainer mode to prevent the package from constantly trying
# to rebuild configure, Makefile.in, etc. Rebuilding such files rarely,
# if ever, needs to be done "in the field".
#
# Use the included 'bootstrap' script instead when necessary.
#
AM_MAINTAINER_MODE
#
# Checks for build host programs
#
# If we are cross-compiling and we are on an embedded target that
# doesn't support independent, standalone executables, then all
# compiler tests that attempt to create an executable will fail. In
# such circumstances, set AC_NO_EXECUTABLES (see http://sourceware.org/
# ml/newlib/2006/msg00353.html).
AC_MSG_CHECKING([whether to disable executable checking])
if test "$cross_compiling" = yes; then
AC_NO_EXECUTABLES
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
# Passing -Werror to GCC-based or -compatible compilers breaks some
# autoconf tests (see
# http://lists.gnu.org/archive/html/autoconf-patches/2008-09/msg00014.html).
#
# If -Werror has been passed transform it into -Wno-error. We'll
# transform it back later with NL_RESTORE_WERROR.
NL_SAVE_WERROR
# Check for compilers.
#
# These should be checked BEFORE we check for and, implicitly,
# initialize libtool such that libtool knows what languages it has to
# work with.
AC_PROG_CPP
AC_PROG_CPP_WERROR
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_CXXCPP
AC_PROG_CXX
AC_PROG_CXX_C_O
# Check for other compiler toolchain tools.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib)
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_CHECK_TOOL(STRIP, strip)
# Check for other host tools.
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROG(CMP, cmp)
AC_PATH_PROG(PERL, perl)
#
# Checks for specific compiler characteristics
#
#
# Common compiler flags we would like to have.
#
# -Wall CC, CXX
#
PROSPECTIVE_CFLAGS="-Wall"
PROSPECTIVE_CXXFLAGS=""
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CFLAGS} ${PROSPECTIVE_CXXFLAGS})
# Check for and initialize libtool
LT_INIT
#
# Debug instances
#
AC_MSG_NOTICE([checking whether to build debug instances])
# Debug
NL_ENABLE_DEBUG([no])
AM_CONDITIONAL([@PACKAGE_SHORT_UPPER@_BUILD_DEBUG], [test "${nl_cv_build_debug}" = "yes"])
#
# Code coverage and compiler optimization
#
# Coverage
NL_ENABLE_COVERAGE([no])
AM_CONDITIONAL([@PACKAGE_SHORT_UPPER@_BUILD_COVERAGE], [test "${nl_cv_build_coverage}" = "yes"])
NL_ENABLE_COVERAGE_REPORTS([auto])
AM_CONDITIONAL([@PACKAGE_SHORT_UPPER@_BUILD_COVERAGE_REPORTS], [test "${nl_cv_build_coverage_reports}" = "yes"])
# Optimization
NL_ENABLE_OPTIMIZATION([yes])
AM_CONDITIONAL([@PACKAGE_SHORT_UPPER@_BUILD_OPTIMIZED], [test "${nl_cv_build_optimized}" = "yes"])
#
# Tests
#
AC_MSG_NOTICE([checking whether to build tests])
# Tests
NL_ENABLE_TESTS([yes])
AM_CONDITIONAL([@PACKAGE_SHORT_UPPER@_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"])
#
# Documentation
#
# Determine whether or not documentation (via Doxygen) should be built
# or not, with 'auto' as the default and establish a default support
# value for GraphViz 'dot' support.
NL_ENABLE_DOCS([auto],[NO])
AM_CONDITIONAL(@PACKAGE_SHORT_UPPER@_BUILD_DOCS, [test "${nl_cv_build_docs}" = "yes"])
#
# Checks for libraries and packages.
#
# At minimum, the following packages are optional, depending on
# configuration:
#
# * TBD
#
AC_MSG_NOTICE([checking required package dependencies])
# NL_WITH_PACKAGE(...)
# Check if the build host has pkg-config
AC_PATH_PROG([PKG_CONFIG],[pkg-config])
#
# Check for headers
#
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([string.h])
#
# Check for types and structures
#
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
#
# Checks for library functions
#
if test "${ac_no_link}" != "yes"; then
AC_CHECK_FUNCS([memcpy])
fi
# Add any code coverage CPPFLAGS and LDFLAGS
CPPFLAGS="${CPPFLAGS} ${NL_COVERAGE_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${NL_COVERAGE_LDFLAGS}"
# At this point, we can restore the compiler flags to whatever the
# user passed in, now that we're clear of an -Werror issues by
# transforming -Wno-error back to -Werror.
NL_RESTORE_WERROR
#
# Identify the various makefiles and auto-generated files for the package
#
AC_CONFIG_FILES([
Makefile
third_party/Makefile
src/Makefile
tests/Makefile
doc/Makefile
])
#
# Generate the auto-generated files for the package
#
AC_OUTPUT
#
# Summarize the package configuration
#
AC_MSG_NOTICE([
Configuration Summary
---------------------
Package : ${PACKAGE_NAME}
Version : ${PACKAGE_VERSION}
Interface : ${LIB@PACKAGE_SHORT_UPPER@_VERSION_INFO//:/.}
Build system : ${build}
Host system : ${host}
Target system : ${target}
Target architecture : ${target_cpu}
Target OS : ${target_os}
Cross compiling : ${cross_compiling}
Build shared libraries : ${enable_shared}
Build static libraries : ${enable_static}
Build debug libraries : ${nl_cv_build_debug}
Build optimized libraries : ${nl_cv_build_optimized}
Build coverage libraries : ${nl_cv_build_coverage}
Build coverage reports : ${nl_cv_build_coverage_reports}
Lcov : ${LCOV:--}
Genhtml : ${GENHTML:--}
Build tests : ${nl_cv_build_tests}
Prefix : ${prefix}
Shadow directory program : ${LNDIR}
Documentation support : ${nl_cv_build_docs}
Doxygen : ${DOXYGEN:--}
GraphViz dot : ${DOT:--}
PERL : ${PERL:--}
C Preprocessor : ${CPP}
C Compiler : ${CC}
C++ Preprocessor : ${CXXCPP}
C++ Compiler : ${CXX}
Archiver : ${AR}
Archive Indexer : ${RANLIB}
Symbol Stripper : ${STRIP}
Object Copier : ${OBJCOPY}
C Preprocessor flags : ${CPPFLAGS:--}
C Compile flags : ${CFLAGS:--}
C++ Compile flags : ${CXXFLAGS:--}
Link flags : ${LDFLAGS:--}
Link libraries : ${LIBS}
])
-284
View File
@@ -1,284 +0,0 @@
#!/bin/sh
#
# Copyright 2014-2017 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is a convenience script that will bootstrap the GNU
# autotools system for a project after any build system changes.
#
#
# usage
#
# Display program usage.
#
usage() {
name=`basename $0`
echo "Usage: ${name} [ options ] [ -w <what> ]"
if [ $1 -ne 0 ]; then
echo "Try '${name} -h' for more information."
fi
if [ $1 -ne 1 ]; then
echo ""
echo " -h, --help Print this help, then exit."
echo " -I DIR Specify directory DIR as the root of the "
echo " nlbuild-autotools repository."
echo " -v, --verbose Verbosely report bootstrap progress."
echo " -w, --what WHAT Specify what part of the package should be "
echo " bootstrapped: all, config, make, or none "
echo " (default: all)."
echo ""
fi
exit $1
}
#
# removetmp
#
# Remove temporary files and directories used during the run of this
# script.
#
removetmp() {
if [ -n "${LIBTOOLIZE}" ] && [ "${LIBTOOLIZE}" = "${BOOTSTRAP_TMPDIR}/libtoolize" ]; then
rm -f "${LIBTOOLIZE}"
fi
if [ -n "${AUTOM4TE_CFG}" ]; then
rm -f "${AUTOM4TE_CFG}"
fi
rm -r -f "${BOOTSTRAP_TMPDIR}"
}
what="all"
verbose=
nlbuild_autotools_dir=
# Parse out any command line options
while [ ${#} -gt 0 ]; do
case ${1} in
-h|--help)
usage 0
;;
-I)
nlbuild_autotools_dir="${2}"
shift 2
;;
-v|--verbose)
verbose="--verbose"
shift 1
;;
-w|--what)
case "${2}" in
all|make*|conf*|none)
what="${2}"
shift 2
;;
*)
echo "Unknown what value '${2}'."
usage 1
;;
esac
;;
*)
usage 1
;;
esac
done
# Check to ensure that the location of the nlbuild-autotools directory
# is sane.
if [ -z "${nlbuild_autotools_dir}" ]; then
echo "$0: No -I option specified. Please provide the location of the nlbuild-autotools directory."
exit 1
elif [ ! -d "${nlbuild_autotools_dir}" ]; then
echo "$0: No such directory: ${nlbuild_autotools_dir}. Please provide a valid path to the nlbuild-autotools directory."
exit 1
fi
# Establish some key directories
srcdir=`dirname ${0}`
abs_srcdir=`pwd`
abs_top_srcdir="${abs_srcdir}"
abs_top_hostdir="${nlbuild_autotools_dir}/tools/host"
# Figure out what sort of build host we are running on, stripping off
# any trailing version number information typically included on Darwin
# / Mac OS X.
host=`${nlbuild_autotools_dir}/autoconf/config.guess | sed -e 's/[[:digit:].]*$//g'`
# If possible, attempt to be self-sufficient, relying on GNU autotools
# executables installed along with the SDK itself.
if [ -d "${abs_top_hostdir}/${host}/bin" ]; then
export PATH="${abs_top_hostdir}/${host}/bin:${PATH}"
fi
if [ -d "${abs_top_hostdir}/bin" ]; then
export PATH="${abs_top_hostdir}/bin:${PATH}"
fi
export ACLOCAL=`which aclocal`
export AUTOCONF="`which autoconf`"
export AUTOHEADER="`which autoheader`"
export AUTOM4TE="`which autom4te`"
export AUTOMAKE="`which automake`"
export LIBTOOLIZE="`which libtoolize || which glibtoolize`"
export M4=`which m4`
# Establish, if necessary, some SDK-specific directories needed to
# override various paths in GNU autotools that otherwise expect to be
# absolute (e.g. /usr/share, etc.).
if [ -d "${abs_top_hostdir}/share" ]; then
if [ -d "${abs_top_hostdir}/share/autoconf" ]; then
export AC_MACRODIR="${abs_top_hostdir}/share/autoconf"
export autom4te_perllibdir="${abs_top_hostdir}/share/autoconf"
fi
if [ -d "${abs_top_hostdir}/share/automake-1.14" ]; then
export PERL5LIB="${abs_top_hostdir}/share/automake-1.14:${PERL5LIB}"
make_action_options="--libdir ${abs_top_hostdir}/share/automake-1.14"
fi
if [ -d "${abs_top_hostdir}/share/aclocal-1.14" ]; then
local_action_options="--automake-acdir=${abs_top_hostdir}/share/aclocal-1.14 ${local_action_options}"
fi
if [ -d "${abs_top_hostdir}/share/aclocal" ]; then
local_action_options="--system-acdir=${abs_top_hostdir}/share/aclocal ${local_action_options}"
fi
fi
# Both autom4te.cfg and libtoolize, as installed from source, want to
# use absolute file system paths that cannot be
# overridden. Consequently, we create temporary, local versions of
# these, patched up with SDK-specific paths.
BOOTSTRAP_TMPDIR="`mktemp -d /tmp/tmp.bootstrapXXXXXX`"
trap "removetmp" 1 2 3 9 15
#
# Generate any temporary files that need to be patched at run time
# with the location of the SDK tree, including:
#
# - The autom4te configuration file
# - The libtoolize executable script
#
if [ -r "${abs_top_hostdir}/share/autoconf/autom4te.cfg" ]; then
export AUTOM4TE_CFG="${BOOTSTRAP_TMPDIR}/autom4te.cfg"
sed -e "s,//share/autoconf,${abs_top_hostdir}/share/autoconf,g" < "${abs_top_hostdir}/share/autoconf/autom4te.cfg" > "${AUTOM4TE_CFG}"
fi
if [ -r "${abs_top_hostdir}/${host}/bin/libtoolize" ]; then
export LIBTOOLIZE="${BOOTSTRAP_TMPDIR}/libtoolize"
sed -e "s,//share/libtool,${abs_top_hostdir}/share/libtool,g" -e "s,//share/aclocal,${abs_top_hostdir}/share/aclocal,g" < "${abs_top_hostdir}/${host}/bin/libtoolize" > "${LIBTOOLIZE}"
chmod 775 "${LIBTOOLIZE}"
fi
if [ -n "${verbose}" ]; then
echo PATH="${PATH}"
echo ACLOCAL="${ACLOCAL}"
echo AUTOCONF="${AUTOCONF}"
echo AUTOHEADER="${AUTOHEADER}"
echo AUTOM4TE="${AUTOM4TE}"
echo AUTOMAKE="${AUTOMAKE}"
echo LIBTOOLIZE="${LIBTOOLIZE}"
echo M4="${M4}"
echo AC_MACRODIR="${AC_MACRODIR}"
echo AUTOM4TE_CFG="${AUTOM4TE_CFG}"
echo PERL5LIB="${PERL5LIB}"
echo autom4te_perllibdir="${autom4te_perllibdir}"
echo local_action_options="${local_action_options}"
echo make_action_options="${make_action_options}"
fi
# Set up the default actions for each bootstrap stage.
local_action="${ACLOCAL} ${verbose} ${local_action_options}"
header_action="${AUTOHEADER} ${verbose}"
tool_action="${LIBTOOLIZE} ${verbose} --automake --copy --force"
make_action="${AUTOMAKE} ${verbose} ${make_action_options} --add-missing --copy"
config_action="${AUTOCONF} ${verbose}"
# Determine what needs to be short-circuited based on the
# user-specified "what".
case "${what}" in
all)
;;
conf*)
local_action=true
header_action=true
tool_action=true
make_action=true
;;
make*)
local_action=true
header_action=true
config_action=true
;;
none)
local_action=true
header_action=true
tool_action=true
make_action=true
config_action=true
;;
esac
# Bootstrap the package.
${local_action} && ${tool_action} && ${header_action} && ${make_action} && ${config_action}
# Clean up any temporary files created.
removetmp
@@ -1,55 +0,0 @@
#!/bin/sh
#
# Copyright 2014-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file implements a script which, when run from a project
# build directory (either disparate or colocated with the
# source), will attempt to clean the build directory, rebootstrap
# the package, and then rerun the configuration script for the
# package with the provided arguments.
#
# This script is particularly useful when you are changing the
# configuration script and testing those changes.
#
srcdir=`dirname ${0}`
builddir=.
# Bring the package build back to a pristine state.
if [ -f config.status ]; then
make maintainer-clean
fi
# Change directories to the package source and rebootstrap the package.
pushd ${srcdir}
./bootstrap
bootstrap_status=$?
popd
# If the package was successfully bootstrapped, configure it.
if [ ${bootstrap_status} -eq 0 ]; then
${srcdir}/configure $*
else
exit ${bootstrap_status}
fi
-237
View File
@@ -1,237 +0,0 @@
#!/bin/bash
#
# Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is a convenience script that will create a skeleton
# build layout using the nlbuild-autotools package.
#
YEAR=`date "+%Y"`
NAME=""
DESCRIPTION=""
DIR=""
VERSION="1.0"
verbose=1
#
# usage
#
# Display program usage.
#
usage() {
name=`basename $0`
echo "Usage: ${name} [ options ]"
if [ $1 -ne 0 ]; then
echo "Try '${name} -h' for more information."
fi
if [ $1 -ne 1 ]; then
echo ""
echo " -h, --help Print this help, then exit."
echo " -I DIR Specify directory DIR as the root of the "
echo " nlbuild-autotools repository."
echo " -v, --verbose Verbosely report mkskeleton progress (default: yes)."
echo " --package-description DESC Specify description DESC as a the "
echo " package description."
echo " --package-name NAME Specify name NAME as the package name."
echo " --package-version VERSION Specify version VERSION as the initial "
echo " version for the package (default: ${VERSION})."
echo " --package-year YEAR Specify year YEAR as the creation "
echo " year for the package (default: ${YEAR})."
echo " -q, --quiet Do not verbosely report mkskeleton progress (default: no)."
echo ""
fi
exit $1
}
#
# log
#
log() {
if [ ! -z ${verbose} ] && [ ${verbose} -eq 1 ]; then
echo $*
fi
}
transform() {
local from="${1}"
local to="${2}"
sed \
-e "s,\@NLBUILD_AUTOTOOLS_STEM\@,${DIR},g" \
-e "s,\@PACKAGE_DESCRIPTION\@,${DESCRIPTION},g" \
-e "s,\@PACKAGE_SHORT_LOWER\@,${LOWER},g" \
-e "s,\@PACKAGE_SHORT_UPPER\@,${UPPER},g" \
-e "s,\@PACKAGE_YEAR\@,${YEAR},g" \
< "${from}" > "${to}"
}
populate() {
local nlbuild="${1}"
local perm=${2}
local file="${3}"
local directory="${4}"
local stem="${file%.*}"
local extension="${file##*.}"
local from
local to
if [ -r "${nlbuild}/examples/${file}" ]; then
from="${nlbuild}/examples/${file}"
elif [ -r "${nlbuild}/examples/${stem}-${directory}.${extension}" ]; then
from="${nlbuild}/examples/${stem}-${directory}.${extension}"
elif [ "${directory}" = "." ] && [ -r "${nlbuild}/examples/${stem}-toplevel.${extension}" ]; then
from="${nlbuild}/examples/${stem}-toplevel.${extension}"
else
echo "Cannot find an example file \"${file}\" for directory \"${directory}\"."
exit 1
fi
to="${directory}/${file}"
log "Creating \"${to}\"..."
transform "${from}" "${to}"
if [ $? = 0 ]; then
chmod ${perm} "${to}"
fi
}
#
# link
#
link() {
local nlbuild="${1}"
local perm=${2}
local source="${3}"
local directory="${4}"
local from="${nlbuild}/scripts/${source}"
local to="${directory}/${source}"
log "Creating \"${to}\"..."
ln -sf "${from}" "${to}"
}
# Parse out any command line options
while [ ${#} -gt 0 ]; do
if [ ${1} == "-h" ] || [ ${1} == "--help" ]; then
usage 0
elif [ ${1} == "-I" ]; then
DIR="${2}"
shift 2
elif [ ${1} == "--package-description" ]; then
DESCRIPTION="${2}"
shift 2
elif [ ${1} == "--package-name" ]; then
NAME="${2}"
shift 2
UPPER="`echo ${NAME} | tr '[[:lower:]]' '[[:upper:]]'`"
LOWER="`echo ${NAME} | tr '[[:upper:]]' '[[:lower:]]'`"
elif [ ${1} == "--package-version" ]; then
VERSION="${2}"
shift 2
elif [ ${1} == "--package-year" ]; then
YEAR="${2}"
shift 2
elif [ ${1} == "-q" ] || [ ${1} == "--quiet" ]; then
verbose=0
shift 1
elif [ ${1} == "-v" ] || [ ${1} == "--verbose" ]; then
verbose=1
shift 1
else
usage 1
fi
done
# Sanity check the command line arguments
if [ -z "${DIR}" ]; then
echo "$0: No -I option specified. Please provide the location of the nlbuild-autotools directory."
exit 1
fi
if [ -z "${DESCRIPTION}" ]; then
echo "$0: Please provide a package description via --package-description."
exit 1
fi
if [ -z "${NAME}" ]; then
echo "$0: Please provide a package name via --package-name."
exit 1
fi
if [ -z "${VERSION}" ]; then
echo "$0: Please provide a package default version via --package-version."
exit 1
fi
if [ -z "${YEAR}" ]; then
echo "$0: Please provide a package creation year via --package-year."
exit 1
fi
# Create the skeleton directories
DIRS="doc third_party include src tests"
for dir in ${DIRS}; do
log "Creating \"${dir}\"..."
mkdir -p "${dir}"
done
# Populate the skeleton directories
populate "${DIR}" 664 configure.ac .
populate "${DIR}" 775 bootstrap .
populate "${DIR}" 664 Makefile.am .
populate "${DIR}" 664 Makefile.am doc
populate "${DIR}" 664 Doxyfile.in doc
populate "${DIR}" 664 Makefile.am third_party
populate "${DIR}" 664 Makefile.am src
populate "${DIR}" 664 Makefile.am tests
link "${DIR}" 775 bootstrap-configure .
# Create the default package version
log "Creating default version ${VERSION}..."
echo "${VERSION}" > ".default-version"
-245
View File
@@ -1,245 +0,0 @@
#!/bin/bash
#
# Copyright 2011-2016 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file attempts to find and generate a package version
# including, if necessary, the number of commits from the last
# GIT tag and the current GIT hash corresponding to HEAD for the
# current branch.
#
# This is largely cobbled together from similar scripts in other
# packages that are maintained in GIT (linux, u-boot, parted, etc.).
#
# This can produce version information such as:
#
# 1.0.1
# 1.0.1-dirty
# 1.0.1-00032-gab50dbb
# 1.0.1-00032-gab50dbb-dirty
#
# Constants
ROOTDIR=${PREFIX}/
BINDIR=${ROOTDIR}bin
DATADIR=${ROOTDIR}share
DEVICEDIR=${ROOTDIR}dev
CONFDIR=${ROOTDIR}etc
LIBDIR=${ROOTDIR}lib
LIBEXECDIR=${ROOTDIR}libexec
VARDIR=${ROOTDIR}var
LOGDIR=${VARDIR}/log
MANDIR=${ROOTDIR}man
SBINDIR=${ROOTDIR}sbin
USRDIR=${ROOTDIR}usr
USRBINDIR=${USRDIR}/bin
USRDATADIR=${USRDIR}/share
USRLIBDIR=${USRDIR}/lib
USRLIBEXECDIR=${USRDIR}/libexec
USRSBINDIR=${USRDIR}/sbin
AWK=${USRBINDIR}/awk
BASENAME=${USRBINDIR}/basename
CAT=${BINDIR}/cat
ECHO="${BINDIR}/echo"
NULL=${DEVICEDIR}/null
PRINTF=${USRBINDIR}/printf
RM=${BINDIR}/rm
SED=${BINDIR}/sed
VERSION=""
#
# usage <status>
#
# Description:
# This routine prints out the proper command line usage for this
# program and then exits with the specified status.
#
# Input(s):
# status - Exit status to exit the program with.
#
# Returns:
# This subroutine does not return.
#
usage() {
local name=`${BASENAME} ${0}`
${ECHO} "Usage: ${name} [options] [ <project root> ]"
if [ ${1} -ne 0 ]; then
${ECHO} "Try '${name} -h' for more information."
fi
if [ ${1} -ne 1 ]; then
${CAT} << EOF
-b, --build-version=VERSION Specify VERSION as the build version to generate
extra build information against.
-h, --help Print this help, then exit.
EOF
fi
exit ${1}
}
#
# gitversion <string> <directory> <version>
#
# Description:
# This routine prints out any GIT version information appended to the
# end of the package version, including the number of commits from
# the last GIT tag and the current GIT hash corresponding to HEAD
# for the current branch.
#
# Input(s):
# string - The current version string which may be empty.
# directory - The current directory.
# version - The optional current package version.
#
# Returns:
# N/A
#
gitversion() {
local string="${1}"
local dir="${2}"
local version="${3}"
local head
local exact
local dtag
local gitversion
# Retrieve the shortened, unique GIT hash associated with the
# 'HEAD' GIT object
head=`test -d .git && git rev-parse --verify --short HEAD 2> ${NULL}`
# If we found a hash, we are actually in a GIT repository; continue.
if [ -n "${head}" ]; then
# Check to see if we have a position in GIT that is
# exactly at an existing tag (e.g. 1.0.2). If we are,
# just use it and add a dirty qualifier. Otherwise,
# work through the logic to determine how far off the
# tag the tree is.
exact="`git describe --exact-match 2> ${NULL}`"
if [ -z "${exact}" ] || [ -n "${version}" ] && [ "${version}" != "${exact}" ]; then
dtag="`git describe 2> ${NULL}`"
# If we are n commits away from a tag, then
# print n and a shortened version of the
# hash. Otherwise, just print the hash.
#
# If we are at an exact version, then there
# won't be a delta or a hash, just use the
# exact tag.
if [ -n "${dtag}" ]; then
if [ "${dtag}" == "${exact}" ]; then
gitversion="${dtag}"
else
gitversion=`${PRINTF} "${dtag}" | ${AWK} -F '-' '{printf("%s-%05d-%s", $(NF-2),$(NF-1),$(NF))}' 2> ${NULL}`
fi
else
gitversion=`${PRINTF} "g${head}"`
fi
else
gitversion="${exact}"
fi
# Update the index if we are in a writable directory
# so that we can successfully check for a dirty (has
# uncommitted changes or unresolved merges) tree.
if [ -w "${dir}" ]; then
git update-index --refresh --unmerged > ${NULL}
fi
# Now check for such a dirty tree and add to the "string"
# if we found one.
if git diff-index --name-only HEAD | read dummy; then
if [ -n "${gitversion}" ]; then
gitversion="${gitversion}-dirty"
else
gitversion="dirty"
fi
fi
else
gitversion="${version}"
fi
if [ -n "${string}" ] && [ -n "${gitversion}" ]; then
string="${string}-${gitversion}"
else
string="${gitversion}"
fi
${PRINTF} "${string}"
}
#
# Main Program Body
#
while [ ${#} -gt 0 ]; do
if [ ${1:0:1} == "-" ]; then
if [ "${1}" == "-h" ] || [ "${1}" == "--help" ]; then
usage 0
elif [ "${1}" == "-b" ] || [ "${1}" == "--build-version" ]; then
version="${2}"
shift 2
else
${ECHO} "Unknown argument '${1}'."
usage 1
fi
else
break
fi
done
if [ ${#} -gt 1 ]; then
usage 1
elif [ ${#} -eq 1 ]; then
tree="${1}"
else
tree="."
fi
if [ "${tree}" != "." ]; then
cd "${tree}"
fi
VERSION="`gitversion \"${VERSION}\" . ${version}`"
${PRINTF} "${VERSION}"
-139
View File
@@ -1,139 +0,0 @@
#
# Copyright 2017 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This make file supports generating prebuilt architecture
# -independent and -dependent distributions of nlbuild-autotools
# binaries for the architeture of the current build host.
#
include ../Common.mak
#
# Build directories
#
builddir := .
top_builddir := ..
abs_builddir := $(CURDIR)
abs_top_builddir := $(abspath $(top_builddir))
#
# Source directories
#
srcdir := .
top_srcdir := ..
abs_srcdir := $(CURDIR)
abs_top_srcdir := $(abspath $(top_srcdir))
# Figure out what sort of build host we are running on, stripping off
# any trailing version number information typically included on Darwin
# / Mac OS X.
host := $(shell $(top_srcdir)/autoconf/config.guess | $(SED) -e 's/[[:digit:].]*$$//g')
distdir = $(PACKAGE)-$(VERSION)
dist_tgz_TARGETS = ${top_builddir}/${PACKAGE}-common-$(VERSION)$(TGZ_EXTENSION) \
${top_builddir}/${PACKAGE}-${host}-$(VERSION)$(TGZ_EXTENSION)
dist_txz_TARGETS = ${top_builddir}/${PACKAGE}-common-$(VERSION)$(TXZ_EXTENSION) \
${top_builddir}/${PACKAGE}-${host}-$(VERSION)$(TXZ_EXTENSION)
dist_common_DIRS = share include
dist_arch_DIRS = $(host)
PACKAGE_VERSION = $(shell $(CAT) $(top_builddir)/.local-version)
VERSION = $(PACKAGE_VERSION)
DIST_TMPDIR := $(shell mktemp -u -p /tmp -d tmp.$(PACKAGE)-$(VERSION)XXXXXX)
TOOLS_TMPDIR := $(shell mktemp -u -p /tmp -d tmp.$(PACKAGE)-$(VERSION)XXXXXX)
#
# Verbosity
#
_NL_V_BUILD = $(_NL_V_BUILD_$(V))
_NL_V_BUILD_ = $(_NL_V_BUILD_$(NL_DEFAULT_VERBOSITY))
_NL_V_BUILD_0 = @echo " BUILD";
_NL_V_BUILD_1 =
dist-tgz: $(dist_tgz_TARGETS)
dist-txz: $(dist_txz_TARGETS)
#
# Produce prebuilt GNU autotools binaries for the architecture of the
# current build machine and install them in this nlbuild-autotools
# package.
#
tools:
$(call nl-remove-dir,$(TOOLS_TMPDIR))
$(call nl-create-dir,$(TOOLS_TMPDIR))
$(_NL_V_BUILD)${srcdir}/packages/build --arch ${host} --srcdir ${abs_srcdir}/packages --builddir "${TOOLS_TMPDIR}" --destdir "${abs_top_srcdir}/tools/host"
$(call nl-remove-dir,$(TOOLS_TMPDIR))
#
# Produce prebuilt GNU autotools architecture-dependent and -independent
# binaries for the architecture of the current build machine and package
# them up for distribution.
#
dist toolsdist: $(DIST_TARGETS)
$(call nl-remove-dir,$(DIST_TMPDIR))
#
# Stage the distribution files to a distribution directory
#
stage:
$(call nl-remove-dir,$(DIST_TMPDIR))
$(call nl-create-dir,$(DIST_TMPDIR))
$(_NL_V_BUILD)${srcdir}/packages/build --arch ${host} --srcdir ${abs_srcdir}/packages --builddir "${DIST_TMPDIR}" --destdir "${DIST_TMPDIR}"
#
# Produce prebuilt GNU autotools architecture-independent binaries for
# the architecture of the current build machine and package them up
# for distribution in tar-gzip format.
#
${top_builddir}/${PACKAGE}-common-$(VERSION)$(TGZ_EXTENSION): stage
$(NL_V_TGZ)$(dist_tgz_ARCHIVE) --directory ${DIST_TMPDIR} $(dist_common_DIRS) | $(dist_tgz_COMPRESS) > "$(@)"
#
# Produce prebuilt GNU autotools architecture-dependent binaries for
# the architecture of the current build machine and package them up
# for distribution in tar-gzip format.
#
${top_builddir}/${PACKAGE}-${host}-$(VERSION)$(TGZ_EXTENSION): stage
$(NL_V_TGZ)$(dist_tgz_ARCHIVE) --directory ${DIST_TMPDIR} $(dist_arch_DIRS) | $(dist_tgz_COMPRESS) > "$(@)"
#
# Produce prebuilt GNU autotools architecture-independent binaries for
# the architecture of the current build machine and package them up
# for distribution in tar-xz format.
#
${top_builddir}/${PACKAGE}-common-$(VERSION)$(TXZ_EXTENSION): stage
$(NL_V_TXZ)$(dist_txz_ARCHIVE) --directory ${DIST_TMPDIR} $(dist_common_DIRS) | $(dist_txz_COMPRESS) > "$(@)"
#
# Produce prebuilt GNU autotools architecture-dependent binaries for
# the architecture of the current build machine and package them up
# for distribution in tar-xz format.
#
${top_builddir}/${PACKAGE}-${host}-$(VERSION)$(TXZ_EXTENSION): stage
$(NL_V_TXZ)$(dist_txz_ARCHIVE) --directory ${DIST_TMPDIR} $(dist_arch_DIRS) | $(dist_txz_COMPRESS) > "$(@)"
clean: clean-local
@@ -1 +0,0 @@
ftp://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.68.tar.gz
@@ -1 +0,0 @@
2.68
@@ -1 +0,0 @@
ftp://ftp.gnu.org/pub/gnu/automake/automake-1.14.1.tar.gz
@@ -1 +0,0 @@
1.14.1
-490
View File
@@ -1,490 +0,0 @@
#!/bin/sh
#
# Copyright 2014-2017 Nest Labs Inc. All Rights Reserved.
#
# 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.
#
#
# Description:
# This file is a convenience script for building, for the current
# build host system, the minimal, core set of GNU autotools on
# which other projects' build systems depend.
#
EXTENSIONS="tar.gz tar.xz"
VERBOSE=0
stem=tools/packages
abs_srcdir=`pwd`
abs_top_srcdir=`echo ${abs_srcdir} | sed -e s,/${stem},,g`
abs_top_hostdir="${abs_top_srcdir}/tools/host"
#
# usage
#
# Display program usage.
#
usage() {
name=`basename ${0}`
echo "Usage: ${name} [ options ] [ -- <package> ... ]"
if [ $1 -ne 0 ]; then
echo "Try '${name} -h' for more information."
fi
if [ $1 -ne 1 ]; then
echo ""
echo " --arch ARCH Build the package for ARCH host architecture."
echo " -h, --help Print this help, then exit."
echo " --builddir DIR Build the packages in DIR."
echo " --destdir DIR Install the built tools to directory DIR."
echo " --srcdir DIR Find package, version, and URL metadata in DIR."
echo " -v, --verbose Enable verbose output."
echo ""
fi
exit $1
}
#
# error <...>
#
# Display to standard error the specified arguments
#
error() {
echo "${*}" >&2
}
#
# verbose <...>
#
# Display to standard error the specified arguments
#
verbose() {
echo "${*}" >&2
}
#
# separator
#
# Display to standard error a log separator.
#
separator() {
verbose "--------------------------------------------------------------------------------"
}
#
# trailer
#
# Display to standard error a log trailer.
#
trailer() {
verbose "================================================================================"
}
#
# banner <message ...>
#
# Display to standard error a log banner with a message.
#
banner() {
trailer
verbose "${*}"
}
#
# subbanner <message ...>
#
# Display to standard error a log subbanner with a message.
#
subbanner() {
separator
verbose "${*}"
}
#
# find_archive <subdir> <package> <extensions...>
#
# Attempt to find the specified package archive in the provided
# subdirectory matching one of the specified extensions.
#
find_archive() {
local subdir="${1}"
local package="${2}"
local archive
shift 2
for extension in ${*}; do
local maybe_archive="${subdir}/${package}.${extension}"
verbose " FIND ${maybe_archive}"
if [ -r "${maybe_archive}" ]; then
archive="${maybe_archive}"
break
fi
done
echo "${archive}"
}
#
# find_versioned_or_nonversioned_archive <subdir> <package> <version> <extensions...>
#
# Attempt to find the specified version-qualified or non-qualified
# package archive in the provided subdirectory matching one of the
# specified extensions.
#
find_versioned_or_nonverioned_archive() {
local subdir="${1}"
local package="${2}"
local version="${3}"
local fqpackage="${package}-${version}"
local archive
shift 3
archive="`find_archive ${subdir} ${fqpackage} ${*}`"
if [ -z "${archive}" ]; then
archive="`find_archive ${subdir} ${package} ${*}`"
fi
echo "${archive}"
}
#
# fetch_url_with_command <fetchdir> <url> <command ...>
#
# Attempt to fetch the specified URL to the provided directory with
# the provided command.
#
fetch_url_with_command() {
local fetchdir="${1}"
local url="${2}"
local curdir="`pwd`"
shift 2
cd "${fetchdir}"
${*} "${url}"
if [ ${?} -ne 0 ]; then
error "Failed to fetch ${url} with ${1}."
fi
cd "${curdir}"
}
#
# fetch_url <fetchdir> <url>
#
# Attempt to fetch the specified URL to the provided directory with
# either wget or curl.
#
fetch_url() {
local fetchdir="${1}"
local url="${2}"
# Try to fetch the package using wget or curl
fetch_url_with_command "${fetchdir}" "${url}" wget --quiet ||
fetch_url_with_command "${fetchdir}" "${url}" curl --silent --remote-name
}
#
# fetch_package <finddir> <fetchdir> <package> <version> <url>
#
# Attempt to fetch the specified package version to <fetchdir>, if a
# local archive does not already exist in <finddir> or <fetchdir>,
# from the provided URL.
#
fetch_package() {
local finddir="${1}"
local fetchdir="${2}"
local package="${3}"
local version="${4}"
local url="${5}"
local fqpackage="${package}-${version}"
# Check whether a local archive already exists in <finddir> or <fetchdir>.
archive="`find_versioned_or_nonverioned_archive ${finddir} ${package} ${version} ${EXTENSIONS}`"
if [ -z "${archive}" ]; then
archive="`find_versioned_or_nonverioned_archive ${fetchdir} ${package} ${version} ${EXTENSIONS}`"
fi
# If no archive was found, attempt to fetch it.
if [ -z "${archive}" ]; then
verbose " FETCH ${url}"
fetch_url "${fetchdir}" "${url}"
else
error "No, found ${archive} locally."
fi
}
#
# removetmp
#
# Remove temporary files and directories used during the run of this
# script.
#
removetmp() {
rm -f "${LIBTOOLIZE}"
if [ -n "${AUTOM4TE_CFG}" ]; then
rm -f "${AUTOM4TE_CFG}"
fi
}
#
# build_package <package> <version> <host> <archivedir> <builddir> <destdir>
#
# Build the specified package version for <host> in <builddir> from
# the archive found in <archivedir> and install it into the specified
# destination directory, <destdir>.
#
build_package() {
local package="${1}"
local version="${2}"
local host="${3}"
local archivedir="${4}"
local builddir="${5}"
local destdir="${6}"
local fqpackage="${package}-${version}"
local curdir=`pwd`
local archive
verbose " CHECK ${package}"
archive="`find_versioned_or_nonverioned_archive ${archivedir} ${package} ${version} ${EXTENSIONS}`"
if [ -z "${archive}" ]; then
error "Could not find an archive for ${package}."
exit 1
fi
if [ ! -d "${archivedir}/${fqpackage}" ]; then
verbose " TAR ${archive}"
tar --directory "${archivedir}" -xf "${archive}" || exit ${?}
fi
# If possible, attempt to be self-sufficient, relying on GNU autotools
# executables installed along with the SDK itself.
if [ -d "${destdir}/${host}/bin" ]; then
export PATH="${destdir}/${host}/bin:${PATH}"
fi
if [ -d "${destdir}/bin" ]; then
export PATH="${destdir}/bin:${PATH}"
fi
export ACLOCAL=`which aclocal`
export AUTOCONF="`which autoconf`"
export AUTOHEADER="`which autoheader`"
export AUTOM4TE="`which autom4te`"
export AUTOMAKE="`which automake`"
export LIBTOOLIZE="`which libtoolize || which glibtoolize`"
export M4=`which m4`
# Establish, if necessary, some SDK-specific directories needed to
# override various paths in GNU autotools that otherwise expect to be
# absolute (e.g. /usr/share, etc.).
if [ -d "${destdir}/share" ]; then
if [ -d "${destdir}/share/autoconf" ]; then
export AC_MACRODIR="${destdir}/share/autoconf"
export autom4te_perllibdir="${destdir}/share/autoconf"
fi
if [ -d "${destdir}/share/automake-1.14" ]; then
export PERL5LIB="${destdir}/share/automake-1.14:${PERL5LIB}"
fi
fi
trap "removetmp" 1 2 3 9 15
#
# Generate any temporary files that need to be patched at run time
# with the location of the SDK tree, including:
#
# - The autom4te configuration file
# - The libtoolize executable script
#
if [ -r "${destdir}/share/autoconf/autom4te.cfg" ]; then
export AUTOM4TE_CFG="${destdir}/autom4te.cfg"
sed -e "s,//share/autoconf,${destdir}/share/autoconf,g" < "${destdir}/share/autoconf/autom4te.cfg" > "${AUTOM4TE_CFG}"
fi
if [ -r "${destdir}/${host}/bin/libtoolize" ]; then
export LIBTOOLIZE="${destdir}/libtoolize"
sed -e "s,//share/libtool,${destdir}/share/libtool,g" -e "s,//share/aclocal,${destdir}/share/aclocal,g" < "${destdir}/${host}/bin/libtoolize" > "${LIBTOOLIZE}"
chmod 775 "${LIBTOOLIZE}"
fi
# Configure the package
if [ ${VERBOSE} -gt 0 ]; then
CONFIGURE_FLAGS=""
else
CONFIGURE_FLAGS="--quiet"
fi
verbose " CONFIG ${package}"
cd "${builddir}"
${archivedir}/${fqpackage}/configure ${CONFIGURE_FLAGS} --prefix=/ --exec-prefix=/${host} || exit ${?}
cd "${curdir}"
# Build the package
verbose " MAKE ${package}"
make V=${VERBOSE} -C "${builddir}" all || exit ${?}
# Install / stage the package
verbose " INSTALL ${package}"
make V=${VERBOSE} -C "${builddir}" DESTDIR="${destdir}" install-strip || exit ${?}
# Remove any temporary files created.
removetmp
}
# Parse out any command line options
while [ ${#} -gt 0 ]; do
case ${1} in
--arch)
ARCH=${2}
shift 2
;;
-h|--help)
usage 0
;;
--builddir)
BUILDDIR=${2}
shift 2
;;
--destdir)
DESTDIR=${2}
shift 2
;;
--srcdir)
SRCDIR=${2}
shift 2
;;
-v|--verbose)
$((VERBOSE++))
shift 1
;;
--)
shift 1
break
;;
*)
usage 1
;;
esac
done
# If the architecture is not specified, fail.
if [ -z "${ARCH}" ]; then
error "The host architecture was not specified via --arch."
usage 1
fi
# If the --builddir option wasn't specified, then provide a default.
if [ -z "${BUILDDIR}" ]; then
BUILDDIR="`pwd`"
fi
# If the --destdir option wasn't specified, then provide a default.
if [ -z "${DESTDIR}" ]; then
DESTDIR=${abs_top_hostdir}
fi
# If the --srcdir option wasn't specified, then provide a default.
if [ -z "${SRCDIR}" ]; then
SRCDIR="`pwd`"
fi
# Determine what packages to build
if [ ${#} -gt 0 ]; then
PACKAGES="${*}"
else
PACKAGES="`cat ${SRCDIR}/packages`"
fi
# Build each package
banner "Building GNU autotools for ${ARCH}..."
for package in ${PACKAGES}; do
url="`cat ${SRCDIR}/${package}/${package}.url`"
version="`cat ${SRCDIR}/${package}/${package}.version`"
# Fetch, if necessary, the package from the canonical source location.
subbanner " CHECK ${package}"
fetch_package "${SRCDIR}/${package}" "${BUILDDIR}" "${package}" "${version}" "${url}"
# Build and install the package.
verbose " MKDIR ${BUILDDIR}/build/${ARCH}/${package}-${version}"
mkdir -p "${BUILDDIR}/build/${ARCH}/${package}-${version}" || exit ${?}
build_package "${package}" "${version}" "${ARCH}" "${BUILDDIR}" "${BUILDDIR}/build/${ARCH}/${package}-${version}" "${DESTDIR}"
done
trailer
@@ -1 +0,0 @@
ftp://ftp.gnu.org/pub/gnu/coreutils/coreutils-8.21.tar.xz
@@ -1 +0,0 @@
8.21
@@ -1 +0,0 @@
ftp://ftp.gnu.org/pub/gnu/libtool/libtool-2.4.2.tar.gz
@@ -1 +0,0 @@
2.4.2
@@ -1 +0,0 @@
ftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.17.tar.gz
@@ -1 +0,0 @@
1.4.17
@@ -1 +0,0 @@
ftp://ftp.gnu.org/pub/gnu/make/make-3.82.tar.gz
@@ -1 +0,0 @@
3.82
@@ -1,6 +0,0 @@
m4
autoconf
automake
libtool
make
coreutils