diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a3ea2eaca99..3a782f09ff5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,12 +20,14 @@ jobs: bin/codecov --token "$CODECOV_TOKEN" scancode: | - bin/py.test --reruns=3 -vvs --test-suite=all tests/scancode \ + bin/py.test --reruns=3 -vvs --test-suite=all \ + tests/scancode \ --cov=src --cov-report=term --cov-report=xml bin/codecov --token "$CODECOV_TOKEN" cluecode: | - bin/py.test -n 2 --reruns=3 -vvs --test-suite=all tests/cluecode \ + bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \ + tests/cluecode \ --cov=src --cov-report=term --cov-report=xml bin/codecov --token "$CODECOV_TOKEN" @@ -33,16 +35,23 @@ jobs: bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \ --ignore=tests/licensedcode/test_zzzz_cache.py \ --ignore=tests/licensedcode/test_detection_datadriven1.py \ + --ignore=tests/licensedcode/test_detection_datadriven2.py \ tests/licensedcode \ --cov=src --cov-report=term --cov-report=xml bin/codecov --token "$CODECOV_TOKEN" - license_main: | + license_datadriven1: | bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \ tests/licensedcode/test_detection_datadriven1.py \ --cov=src --cov-report=term --cov-report=xml bin/codecov --token "$CODECOV_TOKEN" + license_datadriven2: | + bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \ + tests/licensedcode/test_detection_datadriven2.py \ + --cov=src --cov-report=term --cov-report=xml + bin/codecov --token "$CODECOV_TOKEN" + license_cache: | bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \ tests/licensedcode/test_zzzz_cache.py \ @@ -60,7 +69,6 @@ jobs: scancode: Scripts\py.test -vvs --reruns=3 tests\scancode lic_cluecode: Scripts\py.test -vvs --reruns=3 tests\cluecode tests\licensedcode - - template: etc/ci/azure-mac.yml parameters: job_name: macos1013_py27 diff --git a/etc/scripts/buildrules.py b/etc/scripts/buildrules.py index b34f9b820f1..d573fd5fb21 100644 --- a/etc/scripts/buildrules.py +++ b/etc/scripts/buildrules.py @@ -30,6 +30,7 @@ import io import os +import attr import click click.disable_unicode_literals_warning = True from license_expression import Licensing @@ -40,6 +41,27 @@ from licensedcode import match_hash +@attr.attrs(slots=True) +class LicenseRule(object): + data = attr.ib() + text = attr.ib() + raw_data = attr.ib(default=None) + + def __attrs_post_init__(self, *args, **kwargs): + self.raw_data = rdat = '\n'.join(self.data).strip() + self.text = '\n'.join(self.text).strip() + + # validate YAML syntax + try: + self.data = saneyaml.load(rdat) + except: + print('########################################################') + print('Invalid YAML:') + print(rdat) + print('########################################################') + raise + + def load_data(location='00-new-licenses.txt'): with io.open(location, encoding='utf-8') as o: lines = o.read().splitlines(False) @@ -50,22 +72,26 @@ def load_data(location='00-new-licenses.txt'): text = [] in_data = False in_text = False - for ln, line in enumerate(lines): + last_lines = [] + for ln, line in enumerate(lines, 1): + last_lines.append(': '.join([str(ln), line])) if line == '----------------------------------------': - if not (ln == 0 or in_text): - raise Exception('Invalid structure: #{ln}: {line}'.format(**locals())) + if not (ln == 1 or in_text): + raise Exception('Invalid structure: #{ln}: {line}\n'.format(**locals()) + + '\n'.join(last_lines[-10:])) in_data = True in_text = True if data and ''.join(text).strip(): - rules.append((data, text)) + rules.append(LicenseRule(data, text)) data = [] text = [] continue if line == '---': if not in_data: - raise Exception('Invalid structure: #{ln}: {line}'.format(**locals())) + raise Exception('Invalid structure: #{ln}: {line}\n'.format(**locals()) + + '\n'.join(last_lines[-10:])) in_data = False in_text = True @@ -84,12 +110,15 @@ def load_data(location='00-new-licenses.txt'): def rule_exists(text): """ - Return the matched rule if the text is an existing rule matched exactly, False otherwise. + Return the matched rule identifier if the text is an existing rule matched + exactly, False otherwise. """ idx = cache.get_index() matches = idx.match(query_string=text) - if len(matches) != 1: + if not matches: + return False + if len(matches) > 1: return False match = matches[0] if match.matcher == match_hash.MATCH_HASH: @@ -101,7 +130,13 @@ def find_rule_base_loc(license_expression): Return a new, unique and non-existing base name location suitable to create a new rule. """ - template = license_expression.lower().strip().replace(' ', '_').replace('(', '').replace(')', '') + '_{}' + template = (license_expression + .lower() + .strip() + .replace(' ', '_') + .replace('(', '') + .replace(')', '') + +'_{}') idx = 1 while True: base_name = template.format(idx) @@ -130,48 +165,45 @@ def cli(licenses_file): ---------------------------------------- """ - rule_data = load_data(licenses_file) + rules_data = load_data(licenses_file) rules_tokens = set() licenses = cache.get_licenses_db() licensing = Licensing(licenses.values()) print() - for data, text in rule_data: - rdat = '\n'.join(data) - rtxt = '\n'.join(text) - existing = rule_exists(rtxt) + for rule in rules_data: + existing = rule_exists(rule.text) if existing: - print('Skipping existing rule:', existing, 'with text:\n', rtxt[:50].strip(), '...') + print('Skipping existing rule:', existing, 'with text:\n', rule.text[:50].strip(), '...') continue - # validate YAML syntax - parsed = saneyaml.load(rdat) - if parsed.get('is_negative'): - license_expression = 'not-a-license' + if rule.data.get('is_negative'): + base_name = 'not-a-license' else: - _, _, license_expression = data[0].partition(': ') - license_expression = license_expression.strip() + license_expression = rule.data.get('license_expression') if not license_expression: - raise Exception('Missing license_expression for text:', rtxt) + raise Exception('Missing license_expression for text:', rule) licensing.parse(license_expression, validate=True, simple=True) + base_name = license_expression - base_loc = find_rule_base_loc(license_expression) + base_loc = find_rule_base_loc(base_name) data_file = base_loc + '.yml' with io.open(data_file, 'w', encoding='utf-8') as o: - o.write(rdat) + o.write(rule.raw_data) text_file = base_loc + '.RULE' with io.open(text_file, 'w', encoding='utf-8') as o: - o.write(rtxt) + o.write(rule.text) + rule = models.Rule(data_file=data_file, text_file=text_file) rule_tokens = tuple(rule.tokens()) if rule_tokens in rules_tokens: # cleanup os.remove(text_file) os.remove(data_file) - print('Skipping already added rule with text for:', license_expression) + print('Skipping already added rule with text for:', base_name) else: rules_tokens.add(rule_tokens) rule.dump() diff --git a/plugins-builtin/extractcode-7z-system_provided/MANIFEST.in b/plugins-builtin/extractcode-7z-system_provided/MANIFEST.in index 2e71af08a6c..a2d12eba4a8 100644 --- a/plugins-builtin/extractcode-7z-system_provided/MANIFEST.in +++ b/plugins-builtin/extractcode-7z-system_provided/MANIFEST.in @@ -3,6 +3,7 @@ graft src include setup.py include setup.cfg include .gitignore +include LICENSE.txt include README.md include MANIFEST.in diff --git a/plugins-builtin/extractcode-7z-system_provided/setup.py b/plugins-builtin/extractcode-7z-system_provided/setup.py index 650dc5de6fd..b10c3c935d1 100644 --- a/plugins-builtin/extractcode-7z-system_provided/setup.py +++ b/plugins-builtin/extractcode-7z-system_provided/setup.py @@ -16,7 +16,7 @@ desc = '''A ScanCode path provider plugin to provide system package provided sevenzip binary.''' setup( - name='extractcode-7z', + name='extractcode-7z-system-provided', version='9.38.2', license='lgpl-2.1 and unrar and brian-gladman-3-clause', description=desc, diff --git a/plugins-builtin/extractcode-7z-system_provided/src/extractcode_7z/__init__.py b/plugins-builtin/extractcode-7z-system_provided/src/extractcode_7z/__init__.py index 7c395256411..119fe30531f 100644 --- a/plugins-builtin/extractcode-7z-system_provided/src/extractcode_7z/__init__.py +++ b/plugins-builtin/extractcode-7z-system_provided/src/extractcode_7z/__init__.py @@ -26,41 +26,39 @@ from __future__ import unicode_literals import platform -from os.path import abspath -from os.path import dirname -from os.path import join +from os import path from plugincode.location_provider import LocationProviderPlugin -from plugincode.location_provider import location_provider_impl class SevenzipPaths(LocationProviderPlugin): - -def get_locations(self): - curr_dir = dirname(abspath(__file__)) - distribution=platform.linux_distribution()[0] - - # List of various major distributions consisting of flavors + def get_locations(self): + """ + Return a mapping of {location key: location} providing the installation + locations of the 7zip exe and shared libraries as installed on various + Linux distros or on FreeBSD. + """ + mainstream_system = platform.system().lower() + if mainstream_system == 'linux': + distribution = platform.linux_distribution()[0].lower() + debian_based_distro = ['ubuntu', 'mint', 'debian'] + rpm_based_distro = ['fedora', 'redhat'] - debian_based_distro=['Ubuntu','Mint','debian'] - - rpm_based_distro=['Fedora','redhat'] + if distribution in debian_based_distro: + lib_dir = '/usr/lib/p7zip' - if distribution in debian_based_distro: - - lib_dir = '/usr/lib/p7zip' - - elif distribution in rpm_based_distro: - - lib_dir = '/usr/libexec/p7zip' + elif distribution in rpm_based_distro: + lib_dir = '/usr/libexec/p7zip' - else - lib_dir = '/usr' + else: + raise Exception('Unsupported system: {}'.format(distribution)) + elif mainstream_system == 'freebsd': + lib_dir = '/usr/local/libexec/p7zip' locations = { 'extractcode.sevenzip.libdir': lib_dir, - 'extractcode.sevenzip.exe': join(lib_dir, '7z'), + 'extractcode.sevenzip.exe': path.join(lib_dir, '7z'), } return locations diff --git a/plugins-builtin/extractcode-libarchive-system_provided/src/extractcode_libarchive/__init__.py b/plugins-builtin/extractcode-libarchive-system_provided/src/extractcode_libarchive/__init__.py index b050ef28e65..3b32427e9d3 100644 --- a/plugins-builtin/extractcode-libarchive-system_provided/src/extractcode_libarchive/__init__.py +++ b/plugins-builtin/extractcode-libarchive-system_provided/src/extractcode_libarchive/__init__.py @@ -25,39 +25,43 @@ from __future__ import absolute_import from __future__ import unicode_literals -from os.path import abspath -from os.path import dirname -from os.path import join +from os import path +import platform from plugincode.location_provider import LocationProviderPlugin -from plugincode.location_provider import location_provider_impl -import platform class LibarchivePaths(LocationProviderPlugin): - def get_locations(self): - curr_dir = dirname(abspath(__file__)) - distribution=platform.linux_distribution()[0] - - # List of various major distributions consisting of flavors - debian_based_distro=['Ubuntu','Mint','debian'] - - rpm_based_distro=['Fedora','redhat'] - - if distribution in debian_based_distro: - - lib_dir = '/usr/lib/x86_64-linux-gnu' - - elif distribution in rpm_based_distro: - - lib_dir = '/usr/lib64' - - else: - #User defined if installation directory differs - lib_dir = '/usr' - - locations = { - 'extractcode.libarchive.libdir': lib_dir, - 'extractcode.libarchive.dll': join(lib_dir, 'libarchive.so.13'), - } - return locations + def get_locations(self): + """ + Return a mapping of {location key: location} providing the installation + locations of the libarchive shared library as installed on various Linux + distros or on FreeBSD. + """ + system_arch = platform.machine() + mainstream_system = platform.system().lower() + if mainstream_system == 'linux': + distribution = platform.linux_distribution()[0].lower() + debian_based_distro = ['ubuntu', 'mint', 'debian'] + rpm_based_distro = ['fedora', 'redhat'] + + if distribution in debian_based_distro: + lib_dir = '/usr/lib/'+system_arch+'-linux-gnu' + + elif distribution in rpm_based_distro: + lib_dir = '/usr/lib64' + + else: + raise Exception('Unsupported system: {}'.format(distribution)) + + elif mainstream_system == 'freebsd': + if path.isdir('/usr/local/'): + lib_dir = '/usr/local/lib' + else: + lib_dir = '/usr/lib' + + locations = { + 'extractcode.libarchive.libdir': lib_dir, + 'extractcode.libarchive.dll': path.join(lib_dir, 'libarchive.so'), + } + return locations diff --git a/plugins-builtin/typecode-libmagic-system_provided/src/typecode_libmagic/__init__.py b/plugins-builtin/typecode-libmagic-system_provided/src/typecode_libmagic/__init__.py index 5b8fce0a0e2..2632395a652 100644 --- a/plugins-builtin/typecode-libmagic-system_provided/src/typecode_libmagic/__init__.py +++ b/plugins-builtin/typecode-libmagic-system_provided/src/typecode_libmagic/__init__.py @@ -25,40 +25,51 @@ from __future__ import absolute_import from __future__ import unicode_literals -from os.path import abspath -from os.path import dirname -from os.path import join +from os import path +import platform from plugincode.location_provider import LocationProviderPlugin -from plugincode.location_provider import location_provider_impl -import platform class LibmagicPaths(LocationProviderPlugin): - def get_locations(self): - - distribution = platform.linux_distribution()[0] + def get_locations(self): + """ + Return a mapping of {location key: location} providing the installation + locations of the libmagic shared library as installed on various Linux + distros or on FreeBSD. + """ + system_arch = platform.machine() + mainstream_system = platform.system().lower() + if mainstream_system == 'linux': + distribution = platform.linux_distribution()[0].lower() + debian_based_distro = ['ubuntu', 'mint', 'debian'] + rpm_based_distro = ['fedora', 'redhat'] + + if distribution in debian_based_distro: + data_dir = '/usr/lib/file' + lib_dir = '/usr/lib/'+system_arch+'-linux-gnu' + + elif distribution in rpm_based_distro: + data_dir = '/usr/share/misc' + lib_dir = '/usr/lib64' + + else: + raise Exception('Unsupported system: {}'.format(distribution)) + + lib_dll = path.join(lib_dir, 'libmagic.so'); - debian_based_distro = ['Ubuntu','Mint','debian'] - rpm_based_distro = ['Fedora','redhat'] - - if distribution in debian_based_distro: - - data_dir = '/usr/lib/file' - lib_dir = '/usr/lib/x86_64-linux-gnu' - - elif distribution in rpm_based_distro: - - data_dir = '/usr/share/misc' - lib_dir = '/usr/lib64' + elif mainstream_system == 'freebsd': + if path.isdir('/usr/local/'): + lib_dir = '/usr/local' + else: + lib_dir = '/usr' - else: - data_dir = '/usr' - lib_dir = '/usr' + lib_dll = path.join(lib_dir, 'lib/libmagic.so') + data_dir = path.join(lib_dir,'share/file') - locations = { - 'typecode.libmagic.libdir': lib_dir, - 'typecode.libmagic.dll': join(lib_dir, 'libmagic.so.1'), - 'typecode.libmagic.db': join(data_dir, 'magic.mgc'), - } - return locations + locations = { + 'typecode.libmagic.libdir': lib_dir, + 'typecode.libmagic.dll': lib_dll, + 'typecode.libmagic.db': path.join(data_dir, 'magic.mgc'), + } + return locations diff --git a/plugins/scancode-dwarf/.gitignore b/plugins/scancode-compiledcode/.gitignore similarity index 100% rename from plugins/scancode-dwarf/.gitignore rename to plugins/scancode-compiledcode/.gitignore diff --git a/plugins/scancode-dwarf/NOTICE b/plugins/scancode-compiledcode/NOTICE similarity index 100% rename from plugins/scancode-dwarf/NOTICE rename to plugins/scancode-compiledcode/NOTICE diff --git a/plugins/scancode-compiledcode/README.md b/plugins/scancode-compiledcode/README.md new file mode 100644 index 00000000000..93a0038d29e --- /dev/null +++ b/plugins/scancode-compiledcode/README.md @@ -0,0 +1,26 @@ +A ScanCode scan plugin to get lkmclue, dwarf, gwt, cpp includes, code/comments lines generated code and elf info. + +--cpp-includes: +--dwarf: +--elf: +--generatedcode: +--gwt: +--javaclass: +--makedepend: +--codecommentlines: + +To start the test case, please run: +1. ./configure +2. source bin/activate +3. pip install -e plugins/scancode-dwarfdump-manylinux1_x86_64 -e plugins/scancode-ctags-manylinux1_x86_64 -e plugins/scancode-readelf-manylinux1_x86_64 -e plugins/scancode-compiledcode +4. pytest -vvs plugins/scancode-compiledcode/tests/test_lkmclue.py + pytest -vvs plugins/scancode-compiledcode/tests/test_elf.py + pytest -vvs plugins/scancode-compiledcode/tests/test_cpp_includes.py + pytest -vvs plugins/scancode-compiledcode/tests/test_dwarf.py + pytest -vvs plugins/scancode-compiledcode/tests/test_gwt.py + pytest -vvs plugins/scancode-compiledcode/tests/test_makedepend.py + pytest -vvs plugins/scancode-compiledcode/tests/test_javaclass.py + pytest -vvs plugins/scancode-compiledcode/tests/test_generatedcode.py + pytest -vvs plugins/scancode-compiledcode/tests/test_sourcecode.py + +Note that in step3, the path depends on your OS versions, please update according to your real os enviroment. \ No newline at end of file diff --git a/plugins/scancode-dwarf/apache-2.0.LICENSE b/plugins/scancode-compiledcode/apache-2.0.LICENSE similarity index 100% rename from plugins/scancode-dwarf/apache-2.0.LICENSE rename to plugins/scancode-compiledcode/apache-2.0.LICENSE diff --git a/plugins/scancode-dwarf/setup.cfg b/plugins/scancode-compiledcode/setup.cfg similarity index 100% rename from plugins/scancode-dwarf/setup.cfg rename to plugins/scancode-compiledcode/setup.cfg diff --git a/plugins/scancode-lkmclue/setup.py b/plugins/scancode-compiledcode/setup.py similarity index 60% rename from plugins/scancode-lkmclue/setup.py rename to plugins/scancode-compiledcode/setup.py index b19c50ce14b..fa0b72a8cde 100644 --- a/plugins/scancode-lkmclue/setup.py +++ b/plugins/scancode-compiledcode/setup.py @@ -13,24 +13,25 @@ from setuptools import setup -desc = '''A ScanCode scan plugin to get Linux lkmclue and elf info.''' +desc = '''A ScanCode scan plugin to get lkmclue, dwarf, gwt, cpp includes, code/comments lines generated code and elf info.''' setup( - name='scancode-lkmclue', + name='scancode-compiledcode', version='1.0.0', license='Apache-2.0 with ScanCode acknowledgment', description=desc, long_description=desc, author='nexB', author_email='info@aboutcode.org', - url='https://github.com/nexB/scancode-toolkit/plugins/scancode-lkmclue', + url='https://github.com/nexB/scancode-toolkit/plugins/scancode-compiledcode', packages=find_packages('src'), package_dir={'': 'src'}, py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')], include_package_data=True, zip_safe=False, classifiers=[ - # complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers + # complete classifier list: + # http://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', @@ -39,17 +40,25 @@ 'Topic :: Utilities', ], keywords=[ - 'open source', 'scancode', 'lkmclue', 'elf' + 'open source', 'scancode', 'dwarf', 'lkmclue', 'elf', 'cpp includes', 'gwt', 'generatedcode', 'codecommentlines' ], install_requires=[ 'scancode-toolkit', 'attr', 'scancode-ctags', + 'scancode-dwarfdump', ], entry_points={ 'scancode_scan': [ 'scancode-lkmclue = lkmclue:LKMClueScanner', 'scancode-elf = elf:ELFScanner', + 'scancode-cppincludes = cppincludes:CPPIncludesScanner', + 'scancode-dwarf = dwarf:DwarfScanner', + 'scancode-gwt = gwt:GWTScanner', + 'scancode-makedepend = makedepend:MakeDependScanner', + 'scancode-javaclass = javaclass:JavaClassScanner', + 'scancode-generatedcode = generatedcode:GeneratedCodeScanner', + 'scancode-codecommentlines = sourcecode:CodeCommentLinesScanner', ], } diff --git a/plugins/scancode-compiledcode/src/cppincludes/__init__.py b/plugins/scancode-compiledcode/src/cppincludes/__init__.py new file mode 100644 index 00000000000..13e7b6c38cd --- /dev/null +++ b/plugins/scancode-compiledcode/src/cppincludes/__init__.py @@ -0,0 +1,86 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +import re +from collections import OrderedDict +from functools import partial +from itertools import chain + +import attr + +from textcode import analysis +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP +from typecode import contenttype + + +@scan_impl +class CPPIncludesScanner(ScanPlugin): + """ + Collect the #includes statements in a C/C++ file. + """ + resource_attributes = OrderedDict( + cpp_includes=attr.ib(default=attr.Factory(list), repr=False), + ) + + options = [ + CommandLineOption(('--cpp-includes',), + is_flag=True, default=False, + help='Collect the #includes statements in a C/C++ file.', + help_group=SCAN_GROUP, + sort_order=100), + ] + + def is_enabled(self, cpp_includes, **kwargs): + return cpp_includes + + def get_scanner(self, **kwargs): + return cpp_includes + + +def cpp_includes_re(): + return re.compile( + '(?:[\t ]*#[\t ]*' + '(?:include|import)' + '[\t ]+)' + '''(["'<][a-zA-Z0-9_\-/\. ]*)''' + '''(?:["'>"])''' + ) + + +def cpp_includes(location, **kwargs): + """Collect the #includes statements in a C/C++ file.""" + T = contenttype.get_type(location) + if not T.is_c_source: + return + results = [] + for line in analysis.unicode_text_lines(location): + for inc in cpp_includes_re().findall(line): + results.append(inc) + return dict(cpp_includes=results) diff --git a/plugins/scancode-dwarf/src/scandwarf/__init__.py b/plugins/scancode-compiledcode/src/dwarf/__init__.py similarity index 98% rename from plugins/scancode-dwarf/src/scandwarf/__init__.py rename to plugins/scancode-compiledcode/src/dwarf/__init__.py index 317b6ffd3c7..379c5161dab 100644 --- a/plugins/scancode-dwarf/src/scandwarf/__init__.py +++ b/plugins/scancode-compiledcode/src/dwarf/__init__.py @@ -38,8 +38,8 @@ from scancode import SCAN_GROUP from typecode import contenttype -from scandwarf import dwarf -from scandwarf import dwarf2 +from dwarf import dwarf +from dwarf import dwarf2 @scan_impl diff --git a/plugins/scancode-dwarf/src/scandwarf/dwarf.py b/plugins/scancode-compiledcode/src/dwarf/dwarf.py similarity index 100% rename from plugins/scancode-dwarf/src/scandwarf/dwarf.py rename to plugins/scancode-compiledcode/src/dwarf/dwarf.py diff --git a/plugins/scancode-dwarf/src/scandwarf/dwarf2.py b/plugins/scancode-compiledcode/src/dwarf/dwarf2.py similarity index 100% rename from plugins/scancode-dwarf/src/scandwarf/dwarf2.py rename to plugins/scancode-compiledcode/src/dwarf/dwarf2.py diff --git a/plugins/scancode-lkmclue/src/elf/__init__.py b/plugins/scancode-compiledcode/src/elf/__init__.py similarity index 96% rename from plugins/scancode-lkmclue/src/elf/__init__.py rename to plugins/scancode-compiledcode/src/elf/__init__.py index 7ea2f70a1d1..b602766e281 100644 --- a/plugins/scancode-lkmclue/src/elf/__init__.py +++ b/plugins/scancode-compiledcode/src/elf/__init__.py @@ -53,7 +53,7 @@ class ELFScanner(ScanPlugin): options = [ CommandLineOption(('--elf',), is_flag=True, default=False, - help=' Collect the names of shared objects/libraries needed by an Elf binary file.', + help='Collect the names of shared objects/libraries needed by an Elf binary file.', help_group=SCAN_GROUP, sort_order=100), ] diff --git a/plugins/scancode-lkmclue/src/elf/elf.py b/plugins/scancode-compiledcode/src/elf/elf.py similarity index 100% rename from plugins/scancode-lkmclue/src/elf/elf.py rename to plugins/scancode-compiledcode/src/elf/elf.py diff --git a/plugins/scancode-compiledcode/src/generatedcode/__init__.py b/plugins/scancode-compiledcode/src/generatedcode/__init__.py new file mode 100644 index 00000000000..8e952446d97 --- /dev/null +++ b/plugins/scancode-compiledcode/src/generatedcode/__init__.py @@ -0,0 +1,125 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + + +from collections import OrderedDict +from collections import namedtuple +from functools import partial +from itertools import chain +from itertools import islice +import re + +import attr + +import commoncode.text + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP +from textcode import analysis +from typecode import contenttype + + +@scan_impl +class GeneratedCodeScanner(ScanPlugin): + """ + Parse the snippet that is possibly generated code. + """ + resource_attributes = OrderedDict( + generatedcode=attr.ib(default=attr.Factory(list), repr=False), + ) + + options = [ + CommandLineOption(('--generatedcode',), + is_flag=True, default=False, + help='Get the snippet that is possibly generated code.', + help_group=SCAN_GROUP, + sort_order=100), + ] + + def is_enabled(self, generatedcode, **kwargs): + return generatedcode + + def get_scanner(self, **kwargs): + return generatedcode_scan + + +generated_keywords = ( + 'generated by', + 'auto-generated', + 'automatically generated', + # Apache Axis + 'auto-generated from WSDL', + # jni javahl and others + 'do not edit this file', + # jni javahl + 'it is machine generated', + 'by hibernate tools', + 'generated from idl', + # castor generated files + 'following schema fragment specifies the', + # Tomcat JSPC + 'automatically created by', + # in GNU Classpath + 'This file was automatically generated by gnu.localegen from CLDR', + 'This document is automatically generated by gnu.supplementgen', + # linux kernel/u-boot + 'This was automagically generated from', + # Angular + 'THIS CODE IS GENERATED', +) + + +max_lines = 150 + + +def generatedcode_scan(location, **kwargs): + ''' + Return a line of extracted text from a file if that file is likely + generated source code. + + for each of the the first few lines of a source code file + if generated keywords are found in the line as lowercase + yield the line text as a 'potentially_ generated' annotation + ''' + T = contenttype.get_type(location) + if not T.is_text: + return + + results = [] + with open(location, 'rb') as filein: + for line in islice(filein, max_lines): + text = commoncode.text.toascii(line.strip()) + textl = text.lower() + if any(kw in textl for kw in generated_keywords): + # yield only the first 100 chars + if len(text) > 100: + results.append(text[:100]) + else: + results.append(text) + return dict(generatedcode=results) diff --git a/plugins/scancode-compiledcode/src/gwt/__init__.py b/plugins/scancode-compiledcode/src/gwt/__init__.py new file mode 100644 index 00000000000..da21195dd0d --- /dev/null +++ b/plugins/scancode-compiledcode/src/gwt/__init__.py @@ -0,0 +1,129 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from collections import OrderedDict +from collections import namedtuple +from functools import partial +from itertools import chain +import re + +import attr + +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP +from textcode import analysis +from typecode import contenttype + + +@scan_impl +class GWTScanner(ScanPlugin): + """ + Parse GWT (Google Web Toolkit) ".symbolMap" files to extract compilation/debug + symbols. Used to infer the relationship between the compiled JavaScript and + the original Java Source code. + """ + resource_attributes = OrderedDict( + gwt=attr.ib(default=attr.Factory(list), repr=False), + ) + + options = [ + CommandLineOption(('--gwt',), + is_flag=True, default=False, + help='Parse GWT (Google Web Toolkit) ".symbolMap" files to extract compilation/debug symbols. Used to infer the relationship between the compiled JavaScript and the original Java Source code.', + help_group=SCAN_GROUP, + sort_order=100), + ] + + def is_enabled(self, gwt, **kwargs): + return gwt + + def get_scanner(self, **kwargs): + return gwt_scan + + +# maps actual header names to our field names +gwt_headers = ( + 'jsName', + 'jsniIdent', + 'className', + 'memberName', + 'sourceUri', + 'sourceLine', +) + +GwtSymbol = namedtuple('GwtSymbol', gwt_headers) + + +def is_symbol_map(location): + return location.lower().endswith('.symbolmap') + + +def gwt_scan(location, **kwargs): + """ + return symbols extracted for a .symbolmap location. Symbol maps + are produced by GWT compilation. + See: + http://code.google.com/p/google-web-toolkit/wiki/WebModeExceptions#Resymbolization_/_Deobfuscation + "Symbol maps can be generated at compile time using the -extra GWT + compiler argument, e.g. -extra war/WEB-INF/classes/" + These files are like a CSV location with # python like comment lines. + See as a good base to understand the format: + http://code.google.com/p/speedtracer/source/browse/trunk/src/client/ui/src/com/google/speedtracer/client/GwtSymbolMapParser.java?r=84 + Another format is compressed: this is not handled here yet: + http://code.google.com/p/speedtracer/source/browse/trunk/src/client/ui/src/com/google/speedtracer/client/CompactGwtSymbolMapParser.java?spec=svn84&r=84 + See also for general JS map parsing: https://github.com/pombredanne/python-sourcemap-1/blob/master/smap.py + """ + results = [] + if is_symbol_map(location): + with open(location, 'rU') as symap_file: + for line in symap_file: + line = line.strip() + if not line: + continue + if line.startswith('#'): + # header line + if any(x in line for x in gwt_headers): + pass + else: + # ignore other comment lines + pass + continue + + gwts = GwtSymbol(*line.split(',')) + # remove possible jar:file: prefix + clean_path = gwts.sourceUri.replace('jar:file:', '') + # remove possible c: or drive name from windows paths. they + # are useless + clean_path = '/'.join([x for x in clean_path.split('/') + if ':' not in x]) + results.append(dict(jsName=gwts.jsName, + jsniIdent=gwts.jsniIdent, + className=gwts.className, + memberName=gwts.memberName, clean_path=clean_path, sourceLine=gwts.sourceLine)) + return dict(gwt=results) diff --git a/plugins/scancode-compiledcode/src/javaclass/__init__.py b/plugins/scancode-compiledcode/src/javaclass/__init__.py new file mode 100644 index 00000000000..68ff86c0848 --- /dev/null +++ b/plugins/scancode-compiledcode/src/javaclass/__init__.py @@ -0,0 +1,179 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from StringIO import StringIO + +from collections import OrderedDict +from functools import partial +from itertools import chain +from struct import unpack +import os +import sys + +import attr + +from commoncode import fileutils +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP +from typecode import contenttype + +from sourcecode import kernel + +from javaclass import javaclass +from javaclass.javaclass import * + + +@scan_impl +class JavaClassScanner(ScanPlugin): + """ + Scan java class information from the resource. + """ + resource_attributes = OrderedDict( + javaclass=attr.ib(default=attr.Factory(OrderedDict), repr=False), + ) + + options = [ + CommandLineOption(('--javaclass',), + is_flag=True, default=False, + help='Collect java class metadata', + help_group=SCAN_GROUP, + sort_order=100), + ] + + def is_enabled(self, javaclass, **kwargs): + return javaclass + + def get_scanner(self, **kwargs): + return scan_javaclass + + +def scan_javaclass(location, **kwargs): + """ + Return a mapping content of a class fie + """ + T = contenttype.get_type(location) + if not T.is_java_class: + return + + javaclass_data = OrderedDict() + SHOW_CONSTS = 1 + data = open(location, 'rb').read() + f = StringIO(data) + c = javaclass.Class(f) + + javaclass_data['Version'] = 'Version: %i.%i (%s)' % ( c.version[1], c.version[0], getJavacVersion(c.version)) + + if SHOW_CONSTS: + javaclass_data['Constants Pool'] = str(len(c.constants)) + constants = OrderedDict() + for i in range(1, len(c.constants)): + const = c.constants[i] + + # part of #711 + # this may happen because of "self.constants.append(None)" in Class.__init__: + # double and long constants take 2 slots, we must skip the 'None' one + if not const: continue + + constant_data = OrderedDict() + if const[0] == CONSTANT_Fieldref: + constant_data['Field'] = str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_Methodref: + constant_data['Method'] = str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_InterfaceMethodref: + constant_data['InterfaceMethod'] = str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_String: + constant_data['String'] = str(const[1]) + + elif const[0] == CONSTANT_Float: + constant_data['Float'] = str(const[1]) + + elif const[0] == CONSTANT_Integer: + constant_data['Integer'] = str(const[1]) + + elif const[0] == CONSTANT_Double: + constant_data['Double'] = str(const[1]) + + elif const[0] == CONSTANT_Long: + constant_data['Long'] = str(const[1]) + + # elif const[0] == CONSTANT_NameAndType: + # print 'NameAndType\t\t FIXME!!!' + + elif const[0] == CONSTANT_Utf8: + constant_data['Utf8'] = str(const[1]) + + elif const[0] == CONSTANT_Class: + constant_data['Class'] = str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_NameAndType: + constant_data['NameAndType'] = str(const[1]) + ', ' + str(const[2]) + else: + constant_data['Unknown(' + str(const[0]) + ')'] = str(const[1]) + + constants[i] = constant_data + + javaclass_data['Constants'] = constants + + + access =[] + if c.access & ACC_INTERFACE: + access.append('Interface ') + if c.access & ACC_SUPER_OR_SYNCHRONIZED: + access.append('Superclass ') + if c.access & ACC_FINAL: + access.append('Final ') + if c.access & ACC_PUBLIC: + access.append('Public ') + if c.access & ACC_ABSTRACT: + access.append('Abstract ') + if access: + javaclass_data['Access'] = ', '.join(access) + + methods = [] + for meth in c.methods: + methods.append(str(meth)) + if methods: + javaclass_data['Methods'] = methods + + javaclass_data['Class'] = c.name + + javaclass_data['Super Class'] = c.superClass + + interfaces = [] + for inter in c.interfaces: + interfaces.append(str(inter)) + if interfaces: + javaclass_data['Interfaces'] = interfaces + + return OrderedDict( + javaclass=javaclass_data, + ) diff --git a/plugins/scancode-compiledcode/src/javaclass/javaclass.ABOUT b/plugins/scancode-compiledcode/src/javaclass/javaclass.ABOUT new file mode 100644 index 00000000000..c3f38570198 --- /dev/null +++ b/plugins/scancode-compiledcode/src/javaclass/javaclass.ABOUT @@ -0,0 +1,13 @@ +about_resource: . +name: javaclass +download_url: http://www.jsnp.net/code/javaclass-latest.tar.gz +date: 2008-10-10 +description: A python library for parsing Java class files. + Suitable for performing static analysis on Java programs. Includes + demonstration programs classdiff.py and jardiff.py for comparing API + differences between Java class files and jar files. +license_expression: bsd-new +license_file: javaclass.LICENSE +notes: this has been patched to add support the latest JVM specifications + and fix some bugs. + The code was at http://web.archive.org/web/20130911180346/http://www.jsnp.net/code/javaclass-latest.tar.gz \ No newline at end of file diff --git a/plugins/scancode-compiledcode/src/javaclass/javaclass.LICENSE b/plugins/scancode-compiledcode/src/javaclass/javaclass.LICENSE new file mode 100644 index 00000000000..e27279fbcf2 --- /dev/null +++ b/plugins/scancode-compiledcode/src/javaclass/javaclass.LICENSE @@ -0,0 +1,17 @@ +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of this product nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/plugins/scancode-compiledcode/src/javaclass/javaclass.py b/plugins/scancode-compiledcode/src/javaclass/javaclass.py new file mode 100644 index 00000000000..bc92492f0e1 --- /dev/null +++ b/plugins/scancode-compiledcode/src/javaclass/javaclass.py @@ -0,0 +1,589 @@ + +from __future__ import absolute_import + +import sys +import os +from struct import unpack +from StringIO import StringIO + + +""" +A python lib for parsing Java class files, suitable for static +analysis of Java programs. + +Can also be run as a standalone program to print out information +about a class. + +(C)opyright 2006 Jason Petrone +All Rights Reserved + +""" + +__author__ = 'Jason Petrone ' +__version__ = '1.0' + +# Class file format documented at: +# http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html + +CONSTANT_Class = 7 +CONSTANT_Fieldref = 9 +CONSTANT_Methodref = 10 +CONSTANT_InterfaceMethodref = 11 +CONSTANT_String = 8 +CONSTANT_Integer = 3 +CONSTANT_Float = 4 +CONSTANT_Long = 5 +CONSTANT_Double = 6 +CONSTANT_NameAndType = 12 +CONSTANT_Utf8 = 1 + +ACC_DEFAULT = 0x0000 +ACC_PUBLIC = 0x0001 +ACC_PRIVATE = 0x0002 +ACC_PROTECTED = 0x0004 +ACC_STATIC = 0x0008 +ACC_FINAL = 0x0010 +ACC_SUPER_OR_SYNCHRONIZED = 0x0020 +ACC_VOLATILE = 0x0040 +ACC_NATIVE = 0x0100 +ACC_INTERFACE = 0x0200 +ACC_ABSTRACT = 0x0400 +ACC_STRICT = 0x0800 + +ACCESS_MASK = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED + + +def getJavacVersion(versionNum): + """ + Convert a Java class file tuple (minor, major) to a string + representing the corresponding javac version. E.g. 48.0 -> 1.4 + """ + if type(versionNum) in [tuple, list]: + versionNum = '%i.%i' % (versionNum[1], versionNum[0]) + + # todo: add support for Java 6 and 7 formats + versions = { + '51.0': '1.7', + '50.0': '1.6', + '49.0': '1.5', + '48.0': '1.4', + '47.0': '1.3', + '46.0': '1.2', + '45.3': '1.1', + } + try: + return versions[versionNum] + except KeyError: + return '%s?' % (versionNum) + + +def _canonicalize(name, package=''): + """ + If name is in package, will strip package component. + """ + name = name.replace('/', '.') + if name.startswith('java.lang.'): + return name[len('java.lang.'):] + i = name.rfind('.') + if i != -1 and package + '.' == name[:i + 1]: + return name[i + 1:] + else: + return name + + +def fmtAccessFlags(flags, isClass=0): + """ + Convert an access flags constant to a list of human readable + properties. + """ + l = [] + if flags & ACC_PUBLIC: + l.append('public') + if flags & ACC_PRIVATE: + l.append('private') + if flags & ACC_PROTECTED: + l.append('protected') + if flags & ACC_FINAL: + l.append('final') + if flags & ACC_NATIVE: + l.append('native') + if flags & ACC_STATIC: + l.append('static') + if flags & ACC_SUPER_OR_SYNCHRONIZED: + if not isClass: + l.append('synchronized') + # l.append('super') # what is this? + pass + + # added as part of #711 + if flags & ACC_STRICT: + l.append('strictfp') + if flags & ACC_INTERFACE: + l.append('interface') + if flags & ACC_ABSTRACT: + l.append('abstract') + return ' '.join(l) + + +def getAccessFromFlags(flags): + """ + Variant of fmtAccessFlags that returns only one + of (public, private, protected) and not the other flags (final, native, + static) + """ + if flags & ACC_PUBLIC: + return 'public' + if flags & ACC_PRIVATE: + return 'private' + if flags & ACC_PROTECTED: + return 'protected' + return 'default' + + +class MethodDesc: + def __init__(self, descStr): + self.args = [] + self.descStr = descStr + desc = list(descStr) + self.args = _parseArgs(desc) + self.returnType = ''.join(desc) + + +def _parseArgs(desc, count=-1): + args = [] + while len(desc) and len(args) != count: + c = desc.pop(0) + if c == ')': + break + + elif c == '(': + pass + + elif c in ['B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z']: + args.append(c) + + elif c == 'L': + s = c + while c != ';': + c = desc.pop(0) + s += c + args.append(s) + + elif c == '[': + dim = 1 + while desc[0] == '[': + dim += 1 + desc.pop(0) + s = _parseArgs(desc, 1)[0] + # desc = desc[len(s):] + args.append(('[' * dim) + s) + + return args + + +def _fmtType(desc, pkg=''): + """ + Convert a Java type code into a human readable string. + """ + types = {'B':'byte', 'C':'char', 'D':'double', 'F':'float', 'I':'int', + 'J':'long', 'S':'short', 'Z':'boolean', 'V':'void'} + + dim = 0 + for i in range(len(desc)): + if desc[i] == '[': + dim += 1 + else: + break + + array = dim * '[]' + desc = desc[dim:] + + try: + return '%s%s' % (types[desc], array) + except KeyError: + # class + pass + + if desc.startswith('L'): + name = desc[1:] + name = name[:-1] # strip ; + name = _canonicalize(name, pkg) + return '%s%s' % (name, array) + else: + raise Exception('UNKNOWN TYPE: ' + desc) + + +class Method: + """ + Represents a Java method. + The bytecode for the method is stored under the key "Code" in attrs. + """ + def __init__(self, klass, access, name, desc, attrs): + self.klass = klass + self.access = access + self.obj = None + self.name = name + self.desc = desc + self.attrs = attrs + d = MethodDesc(desc) + self.args = d.args + self.returnType = d.returnType + + if self.name == '': + # constructor + name = _canonicalize(self.klass.name, self.klass.package) + + args = ', '.join([_fmtType(x, self.klass.package) for x in self.args]) + self.methsig = ('%s %s %s(%s)' % + (fmtAccessFlags(self.access), _fmtType(self.returnType, + self.klass.package), name, args)) + # default access results in leading space + self.methsig = self.methsig.strip() + + def __hash__(self): + return hash(self.methsig) + + def __eq__(self, obj): + return self.methsig == obj.methsig + + # def __eq__(self, obj): + # return self.klass.name == obj.klass.name \ + # and self.name == obj.name \ + # and self.args == obj.args + + def __repr__(self): + return self.methsig + + +class Field: + + def __init__(self, klass, access, name, desc, attrs): + # print 'FIELD ' + str([klass, access, name, desc, attrs]) + self.klass = klass + self.access = access + self.name = name + self.desc = desc + self.attrs = attrs + if attrs.has_key('ConstantValue'): + self.value = attrs['ConstantValue'] + else: + self.value = None + self.fieldsig = ('%s %s %s' % + (fmtAccessFlags(access), _fmtType(desc), + _canonicalize(self.name, self.klass.package))) + # default access results in leading space + self.fieldsig = self.fieldsig.strip() + + def __eq__(self, obj): + for x in dir(self): + if x.startswith('__') or x == 'klass': + continue + if self.__dict__[x] != obj.__dict__[x]: + return 0 + return 1 + + def __str__(self): + return self.fieldsig + + +class FieldRef: + def __init__(self, klass, name, desc): + self.klass = klass + self.name = name + self.desc = desc + + +class MethodRef: + def __init__(self, _class, name, desc): + self._class = _class + self.name = name + self.desc = desc + self.args = _parseArgs(desc) + + def __repr__(self): + return self.desc + ' ' + self._class + '.' + self.name + + +class Class: + def __init__(self, f): + """ + Load a java class from file object "f" + """ + print(f.read(4)) # magic + self.version = unpack('>HH', f.read(4)) + + # print unpack('>H', f.read(2)) + + [constCount] = unpack('>H', f.read(2)) + self.constants = [[CONSTANT_Utf8, 'reserved']] + i = 1 + + while i < constCount: + [tag] = unpack('b', f.read(1)) + + if tag == CONSTANT_Class: + self.constants.append([tag, unpack('>H', f.read(2))[0]]) + + elif (tag == CONSTANT_Fieldref or + tag == CONSTANT_Methodref or + tag == CONSTANT_InterfaceMethodref): + + self.constants.append([tag] + list(unpack('>HH', f.read(4)))) + + elif tag == CONSTANT_String: + self.constants.append([tag] + list(unpack('>H', f.read(2)))) + + elif tag == CONSTANT_Float: + self.constants.append([tag] + list(unpack('>f', f.read(4)))) + + elif tag == CONSTANT_Integer: + self.constants.append([tag] + list(unpack('>i', f.read(4)))) + + elif tag == CONSTANT_Double: + [val] = unpack('>d', f.read(8)) + self.constants.append([tag] + [val]) + # takes up 2 constant pool spots + self.constants.append(None) # this needs to be considered in dumpClass! + i += 1 + elif tag == CONSTANT_Long: + [hi] = unpack('>l', f.read(4)) + [lo] = unpack('>l', f.read(4)) + self.constants.append([tag, ((long(hi) << 4) + lo)]) + # takes up 2 constant pool spots + self.constants.append(None) # this needs to be considered in dumpClass! + i += 1 + elif tag == CONSTANT_NameAndType: + self.constants.append([tag] + list(unpack('>HH', f.read(4)))) + elif tag == CONSTANT_Utf8: + [length] = unpack('>H', f.read(2)) + s = f.read(length) + self.constants.append([tag, s]) + else: + raise Exception('UNKNOWN CONST TAG! ' + str(tag) + ' at ' + hex(f.tell())) + i += 1 + + [self.access] = unpack('>H', f.read(2)) + [className] = unpack('>H', f.read(2)) + self.name = self.constants[self.constants[className][1]][1] + self.package = os.path.dirname(self.name).replace('/', '.') + # print self.version + [className] = unpack('>H', f.read(2)) + + + # added as part of #711: java.lang.Object is an exceptional case + if self.name != 'java/lang/Object': + self.superClass = self.constants[self.constants[className][1]][1] + else: + self.superClass = '' + + # interfaces + [count] = unpack('>H', f.read(2)) + self.interfaces = [] + for i in range(count): + [index] = unpack('>H', f.read(2)) + index = self.constants[index][1] + iname = self.constants[index][1] + iname = _canonicalize(iname, self.package) + self.interfaces.append(iname) + + # build class signature + access = fmtAccessFlags(self.access, isClass=1) + name = self.name.replace('/', '.') + name = _canonicalize(name, self.package) + self.classSig = '%s class %s' % (access, name) + if self.superClass != 'java/lang/Object': + s = _canonicalize(self.superClass, self.package) + self.classSig += ' extends %s' % (s) + self.classSig = self.classSig.strip() + if self.interfaces: + self.classSig += ' implements ' + ', '.join(self.interfaces) + + # fields + [count] = unpack('>H', f.read(2)) + self.fields = [] + for i in range(count): + [access, name, desc, acount] = unpack('>HHHH', f.read(8)) + attrs = {} + for _ in range(acount): + [aname, alen] = unpack('>HI', f.read(6)) + aname = self.constants[aname][1] + attrs[aname] = f.read(alen) + name = self.constants[name][1] + desc = self.constants[desc][1] + self.fields.append(Field(self, access, name, desc, attrs)) + + # methods + methods = [] + [count] = unpack('>H', f.read(2)) + for i in range(count): + [access, name, desc, acount] = unpack('>HHHH', f.read(8)) + attrs = {} + for _ in range(acount): + [aname, alen] = unpack('>HI', f.read(6)) + aname = self.constants[aname][1] + attrs[aname] = f.read(alen) + name = self.constants[name][1] + desc = self.constants[desc][1] + methods.append(Method(self, access, name, desc, attrs)) + + # attributes + [count] = unpack('>H', f.read(2)) + attrs = {} + for _ in range(count): + [aname, alen] = unpack('>HI', f.read(6)) + attrs[self.getConst(aname)] = f.read(alen) + self.attrs = attrs + self.methods = methods + + def isPublic(self): + return self.access & ACC_PUBLIC + + def isPrivate(self): + return self.access & ACC_PRIVATE + + def isProtected(self): + return self.access & ACC_PROTECTED + + def getConst(self, index): + c = self.constants[index] + if c[0] == CONSTANT_String: + data = self.constants[c[1]][1] + return data + + elif c[0] in [CONSTANT_Methodref, CONSTANT_InterfaceMethodref]: + classi = self.constants[c[1]][1] + _class = self.constants[classi][1] + namei = self.constants[c[2]][1] + name = self.constants[namei][1] + typei = self.constants[c[2]][2] + typ = self.constants[typei][1] + return MethodRef(_class, name, typ) + + elif c[0] == CONSTANT_Class: + return self.constants[c[1]][1] + + elif c[0] == CONSTANT_Fieldref: + [var, typ] = self.getConst(c[2]) + return FieldRef(self.getConst(c[1]), var, type) + + elif c[0] == CONSTANT_NameAndType: + return [self.getConst(c[1]), self.getConst(c[2])] + + elif c[0] == CONSTANT_Utf8: + return c[1] + + elif c[0] == CONSTANT_Double: + return c[1] + + elif c[0] == CONSTANT_Float: + return c[1] + + else: + raise Exception('UNHANDLED CONST: ' + str([c[0], c[1]])) + + def __str__(self): + return self.classSig + + +def dumpClass(path): + """ + Print out information about a class. + """ + SHOW_CONSTS = 1 + data = open(path, 'rb').read() + f = StringIO(data) + c = Class(f) + # print file name + print 'Version: %i.%i (%s)' \ + % (c.version[1], c.version[0], getJavacVersion(c.version)) + + if SHOW_CONSTS: + print 'Constants Pool: ' + str(len(c.constants)) + for i in range(1, len(c.constants)): + const = c.constants[i] + + # part of #711 + # this may happen because of "self.constants.append(None)" in Class.__init__: + # double and long constants take 2 slots, we must skip the 'None' one + if not const: continue + + + sys.stdout.write(' ' + str(i) + '\t') + if const[0] == CONSTANT_Fieldref: + print 'Field\t\t' + str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_Methodref: + print 'Method\t\t' + str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_InterfaceMethodref: + print 'InterfaceMethod\t\t' + str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_String: + print 'String\t\t' + str(const[1]) + elif const[0] == CONSTANT_Float: + print 'Float\t\t' + str(const[1]) + + elif const[0] == CONSTANT_Integer: + print 'Integer\t\t' + str(const[1]) + + elif const[0] == CONSTANT_Double: + print 'Double\t\t' + str(const[1]) + + elif const[0] == CONSTANT_Long: + print 'Long\t\t' + str(const[1]) + + # elif const[0] == CONSTANT_NameAndType: + # print 'NameAndType\t\t FIXME!!!' + + elif const[0] == CONSTANT_Utf8: + print 'Utf8\t\t' + str(const[1]) + + elif const[0] == CONSTANT_Class: + print 'Class\t\t' + str(c.constants[const[1]][1]) + + elif const[0] == CONSTANT_NameAndType: + print 'NameAndType\t\t' + str(const[1]) + '\t\t' + str(const[2]) + + else: + print 'Unknown(' + str(const[0]) + ')\t\t' + str(const[1]) + + + print 'Attributes: ' + + sys.stdout.write('Interfaces: ') + + sys.stdout.write('Access: ' + hex(c.access)) + sys.stdout.write(' [ ') + if c.access & ACC_INTERFACE: + sys.stdout.write('Interface ') + if c.access & ACC_SUPER_OR_SYNCHRONIZED: + sys.stdout.write('Superclass ') + if c.access & ACC_FINAL: + sys.stdout.write('Final ') + if c.access & ACC_PUBLIC: + sys.stdout.write('Public ') + if c.access & ACC_ABSTRACT: + sys.stdout.write('Abstract ') + print ']' + + print 'Methods: ' + for meth in c.methods: + print ' ' + str(meth) + + print 'Class: ' + c.name + + print 'Super Class: ' + c.superClass + + print 'Interfaces: ', + for inter in c.interfaces: + print inter + ", ", + + + +if __name__ == '__main__': + if len(sys.argv) < 2: + print 'Usage %s: [b.class] ...' % (sys.argv[0]) + sys.exit(-1) + + for x in sys.argv[1:]: + dumpClass(x) diff --git a/plugins/scancode-lkmclue/src/lkmclue/__init__.py b/plugins/scancode-compiledcode/src/lkmclue/__init__.py similarity index 100% rename from plugins/scancode-lkmclue/src/lkmclue/__init__.py rename to plugins/scancode-compiledcode/src/lkmclue/__init__.py diff --git a/plugins/scancode-compiledcode/src/makedepend/__init__.py b/plugins/scancode-compiledcode/src/makedepend/__init__.py new file mode 100644 index 00000000000..b174fd368fa --- /dev/null +++ b/plugins/scancode-compiledcode/src/makedepend/__init__.py @@ -0,0 +1,135 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + + +from __future__ import absolute_import +from __future__ import unicode_literals + +from collections import OrderedDict +from functools import partial +from itertools import chain + +import attr + +from commoncode import fileutils +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP +from typecode import contenttype + + +@scan_impl +class MakeDependScanner(ScanPlugin): + """ + Parse generated make depend files to find sources corresponding binaries. + """ + resource_attributes = OrderedDict( + makedepend=attr.ib(default=attr.Factory(OrderedDict), repr=False), + ) + + options = [ + CommandLineOption(('--makedepend',), + is_flag=True, default=False, + help='Parse generated make depend files to find sources corresponding binaries.', + help_group=SCAN_GROUP, + sort_order=100), + ] + + def is_enabled(self, makedepend, **kwargs): + return makedepend + + def get_scanner(self, **kwargs): + return makedepend_scan + + +def is_make_depend(location): + return location.endswith('.d') + + +def makedepend_scan(location, **kwargs): + """ + Return path of the .o location and the list of the source location paths + that were built in the .o given the location of the .d location generated + by makedepend + """ + obj_path = '' + src_paths = [] + if is_make_depend(location): + file_name = fileutils.resource_name(fileutils.as_posixpath(location)) + + with open(location, 'rU') as dfile: + for line in dfile: + line = line.strip() + + if not line or line == "\\": + continue + + if ":" in line and obj_path: + break + + if ":" in line: + left, right = line.split(":") + left = left.strip() + # Assuming there is no space in the filename and that + # several files may exist on the left side, space + # separated FIXME: we should use a proper makefile parser + if " " in left: + left_files = [] + for f in left.split(): + if (f not in left_files + and f != file_name + and not f.endswith(file_name) + and not f.endswith('.d')): + left_files.append(f) + + lenf = len(left_files) + + if lenf >= 1: + obj_path = left_files[0] + else: + obj_path = left + + right = right.strip() + right = right.rstrip("\\") + right = right.strip() + + if right: + for r in right.split(): + src_paths.append(r) + + else: + line = line.strip() + line = line.rstrip("\\") + line = line.strip() + if line and not line.endswith('.d'): + # FIXME: we assume no spaces in filenames: use a make + # parser + for p in line.split(): + src_paths.append(p) + if obj_path and src_paths: + makedepend_result = OrderedDict() + makedepend_result[obj_path] = src_paths + return OrderedDict(makedepend=makedepend_result) + diff --git a/plugins/scancode-compiledcode/src/sourcecode/__init__.py b/plugins/scancode-compiledcode/src/sourcecode/__init__.py new file mode 100644 index 00000000000..ef6f146806f --- /dev/null +++ b/plugins/scancode-compiledcode/src/sourcecode/__init__.py @@ -0,0 +1,82 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import unicode_literals + +from collections import OrderedDict +from functools import partial +from itertools import chain + +import attr + +from commoncode import fileutils +from plugincode.scan import ScanPlugin +from plugincode.scan import scan_impl +from scancode import CommandLineOption +from scancode import SCAN_GROUP +from typecode import contenttype + +from sourcecode import kernel +from sourcecode.metrics import file_lines_count + + +@scan_impl +class CodeCommentLinesScanner(ScanPlugin): + """ + Scan the number of lines of code and lines of the comments. + """ + resource_attributes = OrderedDict( + codelines=attr.ib(default=attr.Factory(int), repr=False), + commentlines=attr.ib(default=attr.Factory(int), repr=False), + + ) + + options = [ + CommandLineOption(('--codecommentlines',), + is_flag=True, default=False, + help=' Scan the number of lines of code and lines of the comments.', + help_group=SCAN_GROUP, + sort_order=100), + ] + + def is_enabled(self, codecommentlines, **kwargs): + return codecommentlines + + def get_scanner(self, **kwargs): + return get_codecommentlines + + +def get_codecommentlines(location, **kwargs): + """ + Return the cumulative number of lines of code in the whole directory tree + at `location`. Use 0 if `location` is not a source file. + """ + codelines = 0 + commentlines = 0 + codelines, commentlines = file_lines_count(location) + return OrderedDict( + codelines=codelines, + commentlines=commentlines + ) diff --git a/plugins/scancode-lkmclue/src/sourcecode/classify.py b/plugins/scancode-compiledcode/src/sourcecode/classify.py similarity index 100% rename from plugins/scancode-lkmclue/src/sourcecode/classify.py rename to plugins/scancode-compiledcode/src/sourcecode/classify.py diff --git a/plugins/scancode-lkmclue/src/sourcecode/kernel.py b/plugins/scancode-compiledcode/src/sourcecode/kernel.py similarity index 100% rename from plugins/scancode-lkmclue/src/sourcecode/kernel.py rename to plugins/scancode-compiledcode/src/sourcecode/kernel.py diff --git a/plugins/scancode-lkmclue/src/sourcecode/metrics.py b/plugins/scancode-compiledcode/src/sourcecode/metrics.py similarity index 100% rename from plugins/scancode-lkmclue/src/sourcecode/metrics.py rename to plugins/scancode-compiledcode/src/sourcecode/metrics.py diff --git a/plugins/scancode-lkmclue/src/sourcecode/source.py b/plugins/scancode-compiledcode/src/sourcecode/source.py similarity index 100% rename from plugins/scancode-lkmclue/src/sourcecode/source.py rename to plugins/scancode-compiledcode/src/sourcecode/source.py diff --git a/plugins/scancode-compiledcode/tests/data/cppincludes/expected.json b/plugins/scancode-compiledcode/tests/data/cppincludes/expected.json new file mode 100644 index 00000000000..0d4c908012f --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/cppincludes/expected.json @@ -0,0 +1,178 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--cpp-includes": true, + "--json": "" + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 7 + } + } + ], + "files": [ + { + "path": "cppincludes", + "type": "directory", + "cpp_includes": [], + "scan_errors": [] + }, + { + "path": "cppincludes/expected.json", + "type": "file", + "cpp_includes": [], + "scan_errors": [] + }, + { + "path": "cppincludes/test1.c", + "type": "file", + "cpp_includes": [ + " +#endif +#include +#include +#include sdfs +#include sdfdsf +#include +# include fdsfsdf +# include sd +#include sdfsdf +#include fsdfsdfsd +# include + #include + +#include + fsdfsdfsd# fds include + fsdfsdfsd# fds include ewr + + fsdfsdfsd# include +#include +#include + +#include "if_athvar.h" +#include "ah_desc.h" + +#include "amrr.h" + +#define AMRR_DEBUG +#ifdef AMRR_DEBUG +#define DPRINTF(sc, _fmt, ...) do { \ + if (sc->sc_debug & 0x10) \ + printk(_fmt, __VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(sc, _fmt, ...) +#endif + +static int ath_rateinterval = 1000; /* rate ctl interval (ms) */ +static int ath_rate_max_success_threshold = 10; +static int ath_rate_min_success_threshold = 1; + +static void ath_ratectl(unsigned long); +static void ath_rate_update(struct ath_softc *, struct ieee80211_node *, int); +static void ath_rate_ctl_start(struct ath_softc *, struct ieee80211_node *); +static void ath_rate_ctl(void *, struct ieee80211_node *); + +static void +ath_rate_node_init(struct ath_softc *sc, struct ath_node *an) +{ + /* NB: assumed to be zero'd by caller */ + ath_rate_update(sc, &an->an_node, 0); +} + +static void +ath_rate_node_cleanup(struct ath_softc *sc, struct ath_node *an) +{ +} + +static void +ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, + int shortPreamble, size_t frameLen, + u_int8_t *rix, int *try0, u_int8_t *txrate) +{ + struct amrr_node *amn = ATH_NODE_AMRR(an); + + *rix = amn->amn_tx_rix0; + *try0 = amn->amn_tx_try0; + if (shortPreamble) + *txrate = amn->amn_tx_rate0sp; + else + *txrate = amn->amn_tx_rate0; +} + +static void +ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an, + struct ath_desc *ds, int shortPreamble, size_t frame_size, u_int8_t rix) +{ + struct amrr_node *amn = ATH_NODE_AMRR(an); + + ath_hal_setupxtxdesc(sc->sc_ah, ds + , amn->amn_tx_rate1sp, amn->amn_tx_try1 /* series 1 */ + , amn->amn_tx_rate2sp, amn->amn_tx_try2 /* series 2 */ + , amn->amn_tx_rate3sp, amn->amn_tx_try3 /* series 3 */ + ); +} + +static void +ath_rate_tx_complete(struct ath_softc *sc, + struct ath_node *an, const struct ath_desc *ds) +{ + struct amrr_node *amn = ATH_NODE_AMRR(an); + int sr = ds->ds_txstat.ts_shortretry; + int lr = ds->ds_txstat.ts_longretry; + int retry_count = sr + lr; + + amn->amn_tx_try0_cnt++; + if (retry_count == 1) { + amn->amn_tx_try1_cnt++; + } else if (retry_count == 2) { + amn->amn_tx_try1_cnt++; + amn->amn_tx_try2_cnt++; + } else if (retry_count == 3) { + amn->amn_tx_try1_cnt++; + amn->amn_tx_try2_cnt++; + amn->amn_tx_try3_cnt++; + } else if (retry_count > 3) { + amn->amn_tx_try1_cnt++; + amn->amn_tx_try2_cnt++; + amn->amn_tx_try3_cnt++; + amn->amn_tx_failure_cnt++; + } +} + +static void +ath_rate_newassoc(struct ath_softc *sc, struct ath_node *an, int isnew) +{ + if (isnew) + ath_rate_ctl_start(sc, &an->an_node); +} + +static void +node_reset (struct amrr_node *amn) +{ + amn->amn_tx_try0_cnt = 0; + amn->amn_tx_try1_cnt = 0; + amn->amn_tx_try2_cnt = 0; + amn->amn_tx_try3_cnt = 0; + amn->amn_tx_failure_cnt = 0; + amn->amn_success = 0; + amn->amn_recovery = 0; + amn->amn_success_threshold = ath_rate_min_success_threshold; +} + + +/** + * The code below assumes that we are dealing with hardware multi rate retry + * I have no idea what will happen if you try to use this module with another + * type of hardware. Your machine might catch fire or it might work with + * horrible performance... + */ +static void +ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate) +{ + struct ath_node *an = ATH_NODE(ni); + struct amrr_node *amn = ATH_NODE_AMRR(an); + const HAL_RATE_TABLE *rt = sc->sc_currates; + u_int8_t rix; + + KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + + DPRINTF(sc, "%s: set xmit rate for %s to %dM\n", + __func__, ether_sprintf(ni->ni_macaddr), + ni->ni_rates.rs_nrates > 0 ? + (ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL) / 2 : 0); + + ni->ni_txrate = rate; + /* + * Before associating a node has no rate set setup + * so we can't calculate any transmit codes to use. + * This is ok since we should never be sending anything + * but management frames and those always go at the + * lowest hardware rate. + */ + if (ni->ni_rates.rs_nrates > 0) { + amn->amn_tx_rix0 = + sc->sc_rixmap[ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL]; + amn->amn_tx_rate0 = rt->info[amn->amn_tx_rix0].rateCode; + amn->amn_tx_rate0sp = amn->amn_tx_rate0 | + rt->info[amn->amn_tx_rix0].shortPreamble; + if (sc->sc_mrretry) { + amn->amn_tx_try0 = 1; + amn->amn_tx_try1 = 1; + amn->amn_tx_try2 = 1; + amn->amn_tx_try3 = 1; + if (--rate >= 0) { + rix = sc->sc_rixmap[ni->ni_rates.rs_rates[rate]&IEEE80211_RATE_VAL]; + amn->amn_tx_rate1 = rt->info[rix].rateCode; + amn->amn_tx_rate1sp = amn->amn_tx_rate1 | + rt->info[rix].shortPreamble; + } else { + amn->amn_tx_rate1 = amn->amn_tx_rate1sp = 0; + } + if (--rate >= 0) { + rix = sc->sc_rixmap[ni->ni_rates.rs_rates[rate]&IEEE80211_RATE_VAL]; + amn->amn_tx_rate2 = rt->info[rix].rateCode; + amn->amn_tx_rate2sp = amn->amn_tx_rate2 | + rt->info[rix].shortPreamble; + } else { + amn->amn_tx_rate2 = amn->amn_tx_rate2sp = 0; + } + if (rate > 0) { + /* NB: only do this if we didn't already do it above */ + amn->amn_tx_rate3 = rt->info[0].rateCode; + amn->amn_tx_rate3sp = amn->amn_tx_rate3 | + rt->info[0].shortPreamble; + } else { + amn->amn_tx_rate3 = amn->amn_tx_rate3sp = 0; + } + } else { + amn->amn_tx_try0 = ATH_TXMAXTRY; + /* theorically, these statements are useless because + * the code which uses them tests for an_tx_try0 == ATH_TXMAXTRY + */ + amn->amn_tx_try1 = 0; + amn->amn_tx_try2 = 0; + amn->amn_tx_try3 = 0; + amn->amn_tx_rate1 = amn->amn_tx_rate1sp = 0; + amn->amn_tx_rate2 = amn->amn_tx_rate2sp = 0; + amn->amn_tx_rate3 = amn->amn_tx_rate3sp = 0; + } + } + node_reset(amn); +} + +/* + * Set the starting transmit rate for a node. + */ +static void +ath_rate_ctl_start(struct ath_softc *sc, struct ieee80211_node *ni) +{ +#define RATE(_ix) (ni->ni_rates.rs_rates[(_ix)] & IEEE80211_RATE_VAL) + struct ieee80211vap *vap = ni->ni_vap; + int srate; + + KASSERT(ni->ni_rates.rs_nrates > 0, ("no rates")); + if (vap->iv_fixed_rate == -1) { + /* + * No fixed rate is requested. For 11b start with + * the highest negotiated rate; otherwise, for 11g + * and 11a, we start "in the middle" at 24Mb or 36Mb. + */ + srate = ni->ni_rates.rs_nrates - 1; + if (sc->sc_curmode != IEEE80211_MODE_11B) { + /* + * Scan the negotiated rate set to find the + * closest rate. + */ + /* NB: the rate set is assumed sorted */ + for (; srate >= 0 && RATE(srate) > 72; srate--); + KASSERT(srate >= 0, ("bogus rate set")); + } + } else { + /* + * A fixed rate is to be used; ic_fixed_rate is an + * index into the supported rate set. Convert this + * to the index into the negotiated rate set for + * the node. We know the rate is there because the + * rate set is checked when the station associates. + */ + srate = ni->ni_rates.rs_nrates - 1; + for (; srate >= 0 && RATE(srate) != vap->iv_fixed_rate; srate--); + KASSERT(srate >= 0, + ("fixed rate %d not in rate set", vap->iv_fixed_rate)); + } + ath_rate_update(sc, ni, srate); +#undef RATE +} + +static void +ath_rate_cb(void *arg, struct ieee80211_node *ni) +{ + ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg); +} + +/* + * Reset the rate control state for each 802.11 state transition. + */ +static void +ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ath_softc *sc = ic->ic_dev->priv; + struct amrr_softc *asc = (struct amrr_softc *) sc->sc_rc; + struct ieee80211_node *ni; + + if (state == IEEE80211_S_INIT) { + del_timer(&asc->timer); + return; + } + if (ic->ic_opmode == IEEE80211_M_STA) { + /* + * Reset local xmit state; this is really only + * meaningful when operating in station mode. + */ + ni = vap->iv_bss; + if (state == IEEE80211_S_RUN) + ath_rate_ctl_start(sc, ni); + else + ath_rate_update(sc, ni, 0); + } else { + /* + * When operating as a station the node table holds + * the AP's that were discovered during scanning. + * For any other operating mode we want to reset the + * tx rate state of each node. + */ + ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL); + ath_rate_update(sc, vap->iv_bss, 0); + } + if (vap->iv_fixed_rate == -1 && state == IEEE80211_S_RUN) { + int interval; + /* + * Start the background rate control thread if we + * are not configured to use a fixed xmit rate. + */ + interval = ath_rateinterval; + if (ic->ic_opmode == IEEE80211_M_STA) + interval /= 2; + mod_timer(&asc->timer, jiffies + ((HZ * interval) / 1000)); + } +} + +/* + * Examine and potentially adjust the transmit rate. + */ +static void +ath_rate_ctl(void *arg, struct ieee80211_node *ni) +{ + struct ath_softc *sc = arg; + struct amrr_node *amn = ATH_NODE_AMRR(ATH_NODE (ni)); + int old_rate; + +#define is_success(amn) (amn->amn_tx_try1_cnt < (amn->amn_tx_try0_cnt / 10)) +#define is_enough(amn) (amn->amn_tx_try0_cnt > 10) +#define is_failure(amn) (amn->amn_tx_try1_cnt > (amn->amn_tx_try0_cnt / 3)) +#define is_max_rate(ni) ((ni->ni_txrate + 1) >= ni->ni_rates.rs_nrates) +#define is_min_rate(ni) (ni->ni_txrate == 0) + + old_rate = ni->ni_txrate; + + DPRINTF (sc, "cnt0: %d cnt1: %d cnt2: %d cnt3: %d -- threshold: %d\n", + amn->amn_tx_try0_cnt, + amn->amn_tx_try1_cnt, + amn->amn_tx_try2_cnt, + amn->amn_tx_try3_cnt, + amn->amn_success_threshold); + if (is_success(amn) && is_enough(amn)) { + amn->amn_success++; + if (amn->amn_success == amn->amn_success_threshold && + !is_max_rate(ni)) { + amn->amn_recovery = 1; + amn->amn_success = 0; + ni->ni_txrate++; + DPRINTF(sc, "increase rate to %d\n", ni->ni_txrate); + } else + amn->amn_recovery = 0; + } else if (is_failure(amn)) { + amn->amn_success = 0; + if (!is_min_rate(ni)) { + if (amn->amn_recovery) { + /* recovery failure. */ + amn->amn_success_threshold *= 2; + amn->amn_success_threshold = min(amn->amn_success_threshold, + (u_int)ath_rate_max_success_threshold); + DPRINTF(sc, "decrease rate recovery thr: %d\n", + amn->amn_success_threshold); + } else { + /* simple failure. */ + amn->amn_success_threshold = ath_rate_min_success_threshold; + DPRINTF(sc, "decrease rate normal thr: %d\n", + amn->amn_success_threshold); + } + amn->amn_recovery = 0; + ni->ni_txrate--; + } else + amn->amn_recovery = 0; + } + if (is_enough(amn) || old_rate != ni->ni_txrate) { + /* reset counters. */ + amn->amn_tx_try0_cnt = 0; + amn->amn_tx_try1_cnt = 0; + amn->amn_tx_try2_cnt = 0; + amn->amn_tx_try3_cnt = 0; + amn->amn_tx_failure_cnt = 0; + } + if (old_rate != ni->ni_txrate) + ath_rate_update(sc, ni, ni->ni_txrate); +} + +static void +ath_ratectl(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc; + struct ieee80211com *ic = &sc->sc_ic; + int interval; + + if (dev->flags & IFF_RUNNING) { + sc->sc_stats.ast_rate_calls++; + + if (ic->ic_opmode == IEEE80211_M_STA) { + struct ieee80211vap *tmpvap; + TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { + ath_rate_ctl(sc, tmpvap->iv_bss); /* NB: no reference */ + } + } else + ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_ctl, sc); + } + interval = ath_rateinterval; + if (ic->ic_opmode == IEEE80211_M_STA) + interval /= 2; + asc->timer.expires = jiffies + ((HZ * interval) / 1000); + add_timer(&asc->timer); +} + +static struct ath_ratectrl * +ath_rate_attach(struct ath_softc *sc) +{ + struct amrr_softc *asc; + + _MOD_INC_USE(THIS_MODULE, return NULL); + asc = kmalloc(sizeof(struct amrr_softc), GFP_ATOMIC); + if (asc == NULL) { + _MOD_DEC_USE(THIS_MODULE); + return NULL; + } + asc->arc.arc_space = sizeof(struct amrr_node); + asc->arc.arc_vap_space = 0; + init_timer(&asc->timer); + asc->timer.data = (unsigned long) sc->sc_dev; + asc->timer.function = ath_ratectl; + + return &asc->arc; +} + +static void +ath_rate_detach(struct ath_ratectrl *arc) +{ + struct amrr_softc *asc = (struct amrr_softc *) arc; + + del_timer(&asc->timer); + kfree(asc); + _MOD_DEC_USE(THIS_MODULE); +} + +static int minrateinterval = 500; /* 500ms */ +static int maxint = 0x7fffffff; /* 32-bit big */ +static int min_threshold = 1; + +/* + * Static (i.e. global) sysctls. + */ + +static ctl_table ath_rate_static_sysctls[] = { + { .ctl_name = CTL_AUTO, + .procname = "interval", + .mode = 0644, + .data = &ath_rateinterval, + .maxlen = sizeof(ath_rateinterval), + .extra1 = &minrateinterval, + .extra2 = &maxint, + .proc_handler = proc_dointvec_minmax + }, + { .ctl_name = CTL_AUTO, + .procname = "max_success_threshold", + .mode = 0644, + .data = &ath_rate_max_success_threshold, + .maxlen = sizeof(ath_rate_max_success_threshold), + .extra1 = &min_threshold, + .extra2 = &maxint, + .proc_handler = proc_dointvec_minmax + }, + { .ctl_name = CTL_AUTO, + .procname = "min_success_threshold", + .mode = 0644, + .data = &ath_rate_min_success_threshold, + .maxlen = sizeof(ath_rate_min_success_threshold), + .extra1 = &min_threshold, + .extra2 = &maxint, + .proc_handler = proc_dointvec_minmax + }, + { 0 } +}; +static ctl_table ath_rate_table[] = { + { .ctl_name = CTL_AUTO, + .procname = "rate", + .mode = 0555, + .child = ath_rate_static_sysctls + }, { 0 } +}; +static ctl_table ath_ath_table[] = { + { .ctl_name = DEV_ATH, + .procname = "ath", + .mode = 0555, + .child = ath_rate_table + }, { 0 } +}; +static ctl_table ath_root_table[] = { + { .ctl_name = CTL_DEV, + .procname = "dev", + .mode = 0555, + .child = ath_ath_table + }, { 0 } +}; +static struct ctl_table_header *ath_sysctl_header; + +static struct ieee80211_rate_ops ath_rate_ops = { + .ratectl_id = IEEE80211_RATE_AMRR, + .node_init = ath_rate_node_init, + .node_cleanup = ath_rate_node_cleanup, + .findrate = ath_rate_findrate, + .setupxtxdesc = ath_rate_setupxtxdesc, + .tx_complete = ath_rate_tx_complete, + .newassoc = ath_rate_newassoc, + .newstate = ath_rate_newstate, + .attach = ath_rate_attach, + .detach = ath_rate_detach, +}; + +#include "release.h" +static char *version = "0.1 (" RELEASE_VERSION ")"; +static char *dev_info = "ath_rate_amrr"; + +MODULE_AUTHOR("INRIA, Mathieu Lacage"); +MODULE_DESCRIPTION("AMRR Rate control algorithm"); +#ifdef MODULE_VERSION +MODULE_VERSION(RELEASE_VERSION); +#endif +#ifdef MODULE_LICENSE +MODULE_LICENSE("Dual BSD/GPL"); +#endif + +static int __init +init_ath_rate_amrr(void) +{ + int ret; + printk(KERN_INFO "%s: %s\n", dev_info, version); + + ret = ieee80211_rate_register(&ath_rate_ops); + if (ret) + return ret; + + ath_sysctl_header = ATH_REGISTER_SYSCTL_TABLE(ath_root_table); + return (0); +} +module_init(init_ath_rate_amrr); + +static void __exit +exit_ath_rate_amrr(void) +{ + if (ath_sysctl_header != NULL) + unregister_sysctl_table(ath_sysctl_header); + ieee80211_rate_unregister(&ath_rate_ops); + + printk(KERN_INFO "%s: unloaded\n", dev_info); +} +module_exit(exit_ath_rate_amrr); diff --git a/plugins/scancode-compiledcode/tests/data/cppincludes/test2.c b/plugins/scancode-compiledcode/tests/data/cppincludes/test2.c new file mode 100644 index 00000000000..b7efed29f7b --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/cppincludes/test2.c @@ -0,0 +1,31 @@ +//========================================================================== +// +// tests/ping_lo_test.c +// +// Simple test of PING (ICMP) and networking support +// +//========================================================================== +//####BSDCOPYRIGHTBEGIN####FLASH_ERR_OK +// +// ------------------------------------------- +// +// Portions of this software may have been derived from OpenBSD or other sources, +// and are covered by the appropriate copyright disclaimers included herein. +// +// ------------------------------------------- +// +//####BSDCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): gthomas, sorin@netappi.com +// Contributors: gthomas, sorin@netappi.com, andrew.lunn@ascom.ch +// Date: 2000-01-10 +// Purpose: +// Description: FLASH_ERR_OK +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== +#include <stddef.h> diff --git a/plugins/scancode-compiledcode/tests/data/cppincludes/test3.cpp b/plugins/scancode-compiledcode/tests/data/cppincludes/test3.cpp new file mode 100644 index 00000000000..cfca5233dc2 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/cppincludes/test3.cpp @@ -0,0 +1,415 @@ + +#include "stacktrace.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "lhn_defines.h" + +typedef char *string_t ; + + +#ifndef __PRIPTR_PREFIX +# if __WORDSIZE == 64 +# define __PRIPTR_PREFIX "l" +# else +# define __PRIPTR_PREFIX +# endif +#endif + +uint32_t string_length( + string_t const s +) { + return strlen(s) ; +} + +string_t string_copy( + string_t const s +) { + uint32_t const len = string_length(s) + 1 ; + string_t t = (char *)malloc(len) ; + memcpy(t, s, len) ; + return t ; +} + +void string_free( + string_t const s +) { + free(s) ; +} + +typedef struct libmap { + uintptr_t start ; + uintptr_t end ; + string_t path ; +} *map_t ; +static map_t map ; +static int32_t nmaps ; + + +static int +readmaps(map_t map, const uint32_t maxmaps) +{ + char mapfile[1024] ; + FILE *mf ; + char line[256] ; + char *start ; + char *end ; + char *mode ; + char *path ; + char *c ; + uint32_t entries = 0 ; + + sprintf(mapfile, "/proc/%d/maps", getpid()) ; + if ((mf = fopen(mapfile, "ro")) == NULL) { + return 0 ; + } + + while (fgets(line, 256, mf)) { + c = line ; + start = c ; + while (*c != '-') { + c++ ; + } + *c++ = '\0' ; + end = c ; + while (*c != ' ') { + c++ ; + } + *c++ = '\0' ; + mode = c ; + while (*c != ' ') { + c++ ; + } + *c++ = '\0' ; + if (mode[0] != 'r' || mode[1] != '-' || mode[2] != 'x' || mode[3] != 'p') { + continue ; + } + while (*c != '/') { + c++ ; + } + path = c ; + while (*c != '\n' && *c != ' ') { + c++ ; + } + *c = '\0' ; + + if (sscanf(start, "%" __PRIPTR_PREFIX "x", &map[entries].start) != 1) { + continue ; + } + if (sscanf(end, "%" __PRIPTR_PREFIX "x", &map[entries].end) != 1) { + continue ; + } + map[entries].path = string_copy((string_t)path) ; + entries++ ; + if (entries == maxmaps) { + break ; + } + } + + fclose(mf) ; + return entries ; +} + + +#define SIGACTION_LIBC_OFFSET 0x2e868 +#define LHN_LIBC_NAME "/lib/libc-2.2.4.so" +static +int addr2line_obj_dump( + struct pcset *basepc, + struct pcset *sigpc, + struct pcset *syssigpc, + char *info +) { + char exec[1024] ; + char file[1024] ; + char func[1024] ; + uintptr_t offset ; + FILE *ap ; + char *slashptr ; + + offset = (uintptr_t)basepc->pc - basepc->start ; + if (basepc->obj) { + sprintf(exec, "/usr/bin/addr2line --functions -C -e %s 0x%" __PRIPTR_PREFIX "x", basepc->obj, offset) ; + } + else { + sprintf(exec, "/usr/bin/addr2line --functions -C -e /proc/%d/exe 0x%" __PRIPTR_PREFIX "x", getpid(), offset) ; + } + + ap = popen(exec, "r") ; + fgets(func, sizeof(func), ap) ; + fgets(file, sizeof(file), ap) ; + fclose(ap) ; + + if (strchr(func, '\n')) { + *strchr(func, '\n') = 0 ; + } + + if (strchr(file, '\n')) { + *strchr(file, '\n') = 0 ; + } + + + if (!strcmp(file, "??:0") && !strcmp(func, "??")) { + if (basepc->obj) { + sprintf(exec, "/usr/bin/addr2line --functions -C -e %s 0x%" __PRIPTR_PREFIX "x", basepc->obj, (uintptr_t)basepc->pc) ; + } + else { + sprintf(exec, "/usr/bin/addr2line --functions -C -e /proc/%d/exe 0x%" __PRIPTR_PREFIX "x", getpid(), (uintptr_t)basepc->pc) ; + } + + ap = popen(exec, "r") ; + fgets(func, sizeof(func), ap) ; + fgets(file, sizeof(file), ap) ; + fclose(ap) ; + + if (strchr(func, '\n')) { + *strchr(func, '\n') = 0 ; + } + + if (strchr(file, '\n')) { + *strchr(file, '\n') = 0 ; + } + } + + slashptr = strrchr(file, '/') ; + if (((slashptr && !strcmp(++slashptr, "sigaction.c:149")) + + || ((offset == SIGACTION_LIBC_OFFSET) && !strcmp(basepc->obj, LHN_LIBC_NAME)) + + || (!strcmp(func, "__pthread_sighandler")) + + || (!strcmp(func, "__restore"))) + && sigpc && sigpc->pc) { + if (!addr2line_obj_dump(sigpc, NULL, NULL, info) && syssigpc && syssigpc->pc) { + (void)addr2line_obj_dump(syssigpc, NULL, NULL, info) ; + basepc->pc = syssigpc->pc ; + } + else { + basepc->pc = sigpc->pc ; + } + } + else { + sprintf(info, "%s %s", file, func) ; + } + + if (!strcmp(info, "??:0 ??")) { + return 0 ; + } else { + return 1 ; + } +} + +void stacktrace_dump(stacktrace_t *s) { + unsigned i ; + char info[1024] ; + bool foundinfo ; + struct pcset pcs ; + + + memset(&pcs, 0, sizeof(pcs)) ; + pcs.pc = (void *)stacktrace_dump ; + if (!addr2line_obj_dump(&pcs, NULL, NULL, info)) { + return ; + } + + LHN_PRINT(0,0,"STACKTRACE:dump\n") + for (i=0; ibasepc[i].pc) { + break ; + } + + if (!addr2line_obj_dump(&s->basepc[i], &s->sigpc[i], &s->syssigpc[i], info)) { + foundinfo = false ; + } + + if (foundinfo) { + LHN_PRINT(0,0," frame=%02d pc=0x%0*" __PRIPTR_PREFIX "x %s\n", i, (int)sizeof(uintptr_t)*2, (uintptr_t)s->basepc[i].pc, info) ; + } + else { + LHN_PRINT(0,0," frame=%02d pc=0x%0*" __PRIPTR_PREFIX "x unknown\n", i, (int)sizeof(uintptr_t)*2, (uintptr_t)s->basepc[i].pc) ; + } + } +} + +void stacktrace_close(void) { + int i ; + if (map) { + for (i=0; ibasepc, 0, STACKTRACE_NITEMS*sizeof(struct pcset)) ; + memset(s->sigpc, 0, STACKTRACE_NITEMS*sizeof(struct pcset)) ; + + bcount = backtrace(addr, STACKTRACE_NITEMS) ; + GETFRAMES(STACKTRACE_NITEMS) ; + if (!count) { + count = STACKTRACE_NITEMS ; + } + else { + count = (count >= STACKTRACE_NITEMS) ? STACKTRACE_NITEMS : (count+1) ; + } + + + if (!map) { + map = (map_t)malloc(sizeof(map[0]) * STACKTRACE_NMAPS) ; + } + + memset(map, 0, sizeof(*map)*STACKTRACE_NMAPS) ; + nmaps = readmaps(map, STACKTRACE_NMAPS) ; + + for (framecount = 0; framecountbasepc[framecount].pc = addr[framecount] ; + for (mapidx = 0; mapidx < nmaps; mapidx++) { + if (((uintptr_t)s->basepc[framecount].pc >= map[mapidx].start) + && ((uintptr_t)s->basepc[framecount].pc <= map[mapidx].end)) { + s->basepc[framecount].obj = (char *)map[mapidx].path ; + s->basepc[framecount].start = map[mapidx].start ; + + if (!frame[framecount]) + break ; + + void **vvp = (void **)frame[framecount] ; + void *vp = *vvp ; + int limit = ((uintptr_t)vp - (uintptr_t)vvp) / 4 ; + + if (limit < 190 || !vp) + break ; + + + s->sigpc[framecount].pc = *(void **)((uintptr_t)frame[framecount]+(EIP_IN_SIGNAL_FRAME*sizeof(void *))) ; + for (amapidx = 0 ; amapidx < nmaps ; amapidx++) { + if (((uintptr_t)s->sigpc[framecount].pc >= map[amapidx].start) + && ((uintptr_t)s->sigpc[framecount].pc <= map[amapidx].end)) { + s->sigpc[framecount].obj = (char *)map[amapidx].path ; + s->sigpc[framecount].start = map[amapidx].start ; + break ; + } + } + + + s->syssigpc[framecount].pc = *(void **)((uintptr_t)frame[framecount]+(EIP_IN_SYSTEM_SIGNAL_FRAME*sizeof(void *))) ; + for (amapidx = 0 ; amapidx < nmaps ; amapidx++) { + if (((uintptr_t)s->syssigpc[framecount].pc >= map[amapidx].start) + && ((uintptr_t)s->syssigpc[framecount].pc <= map[amapidx].end)) { + s->syssigpc[framecount].obj = (char *)map[amapidx].path ; + s->syssigpc[framecount].start = map[amapidx].start ; + break ; + } + } + break ; + } + } + } +} diff --git a/plugins/scancode-compiledcode/tests/data/cppincludes/test4.c b/plugins/scancode-compiledcode/tests/data/cppincludes/test4.c new file mode 100644 index 00000000000..ed458945736 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/cppincludes/test4.c @@ -0,0 +1,1047 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +#include + +#if HAVE_STDLIB_H +#include +#endif +#if HAVE_UNISTD_H +#include +#endif +#if HAVE_STRING_H +#include +#else +#include +#endif +#include +#if HAVE_SYS_WAIT_H +#include +#endif +#if HAVE_WINSOCK_H +#include +#else +#include +#endif +#if HAVE_SYS_SOCKIO_H +#include +#endif +#if HAVE_NETINET_IN_H +#include +#endif +#include +#if HAVE_SYS_TIME_H +# include +# if TIME_WITH_SYS_TIME +# include +# endif +#else +# include +#endif +#if HAVE_SYS_SELECT_H +#include +#endif +#if HAVE_SYS_PARAM_H +#include +#endif +#if HAVE_SYSLOG_H +#include +#endif +#if HAVE_SYS_IOCTL_H +#include +#endif +#if HAVE_NET_IF_H +#include +#endif +#if HAVE_NETDB_H +#include +#endif +#if HAVE_ARPA_INET_H +#include +#endif +#if HAVE_FCNTL_H +#include +#endif +#if HAVE_PROCESS_H +#include +#endif +#include +#include + +#include + +#include "asn1.h" +#include "snmp_api.h" +#include "snmp_impl.h" +#include "snmp_client.h" +#include "mib.h" +#include "snmp.h" +#include "system.h" +#include "version.h" +#include "snmptrapd_handlers.h" +#include "snmptrapd_log.h" +#include "read_config.h" +#include "snmp_debug.h" +#include "snmp_logging.h" +#include "callback.h" +#include "snmpusm.h" +#include "tools.h" +#include "lcd_time.h" +#include "transform_oids.h" +#include "snmpv3.h" +#include "default_store.h" + +#define DS_APP_NUMERIC_IP 1 + +#ifndef BSD4_3 +#define BSD4_2 +#endif + +#ifndef FD_SET + +typedef long fd_mask; +#define NFDBITS (sizeof(fd_mask) * NBBY) + +#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) +#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) memset((p), 0, sizeof(*(p))) +#endif + +char *logfile = 0; +int Print = 0; +int Syslog = 0; +int Event = 0; +int dropauth = 0; +int running = 1; +int reconfig = 0; + +const char *trap1_std_str = "%.4y-%.2m-%.2l %.2h:%.2j:%.2k %B [%b] (via %A [%a]): %N\n\t%W Trap (%q) Uptime: %#T\n%v\n", + *trap2_std_str = "%.4y-%.2m-%.2l %.2h:%.2j:%.2k %B [%b]:\n%v\n"; +char *trap1_fmt_str = NULL, + *trap2_fmt_str = NULL; + + + + +#ifndef LOG_CONS +#define LOG_CONS 0 +#endif +#ifndef LOG_PID +#define LOG_PID 0 +#endif +#ifndef LOG_LOCAL0 +#define LOG_LOCAL0 0 +#endif +#ifndef LOG_LOCAL1 +#define LOG_LOCAL1 0 +#endif +#ifndef LOG_LOCAL2 +#define LOG_LOCAL2 0 +#endif +#ifndef LOG_LOCAL3 +#define LOG_LOCAL3 0 +#endif +#ifndef LOG_LOCAL4 +#define LOG_LOCAL4 0 +#endif +#ifndef LOG_LOCAL5 +#define LOG_LOCAL5 0 +#endif +#ifndef LOG_LOCAL6 +#define LOG_LOCAL6 0 +#endif +#ifndef LOG_LOCAL7 +#define LOG_LOCAL7 0 +#endif +#ifndef LOG_DAEMON +#define LOG_DAEMON 0 +#endif + + + +int Facility = LOG_LOCAL0; + +struct timeval Now; + +void init_syslog(void); + +void update_config (void); + +#ifdef WIN32 +void openlog(const char *app, int options, int fac) { +} + +void syslog(int level, const char *fmt, ...) { +} +#endif + +const char * +trap_description(int trap) +{ + switch(trap){ + case SNMP_TRAP_COLDSTART: + return "Cold Start"; + case SNMP_TRAP_WARMSTART: + return "Warm Start"; + case SNMP_TRAP_LINKDOWN: + return "Link Down"; + case SNMP_TRAP_LINKUP: + return "Link Up"; + case SNMP_TRAP_AUTHFAIL: + return "Authentication Failure"; + case SNMP_TRAP_EGPNEIGHBORLOSS: + return "EGP Neighbor Loss"; + case SNMP_TRAP_ENTERPRISESPECIFIC: + return "Enterprise Specific"; + default: + return "Unknown Type"; + } +} + + +struct snmp_pdu * +snmp_clone_pdu2(struct snmp_pdu *pdu, + int command) +{ + struct snmp_pdu *newpdu = snmp_clone_pdu(pdu); + if (newpdu) newpdu->command = command; + return newpdu; +} + +static oid risingAlarm[] = {1, 3, 6, 1, 6, 3, 2, 1, 1, 3, 1}; +static oid fallingAlarm[] = {1, 3, 6, 1, 6, 3, 2, 1, 1, 3, 2}; +static oid unavailableAlarm[] = {1, 3, 6, 1, 6, 3, 2, 1, 1, 3, 3}; + +void +event_input(struct variable_list *vp) +{ + int eventid; + oid variable[MAX_OID_LEN]; + int variablelen; + u_long destip; + int sampletype; + int value; + int threshold; + + oid *op; + + vp = vp->next_variable; + if (vp->val_len != sizeof(risingAlarm) + || !memcmp(vp->val.objid, risingAlarm, sizeof(risingAlarm))) + eventid = 1; + else if (vp->val_len != sizeof(risingAlarm) + || !memcmp(vp->val.objid, fallingAlarm, sizeof(fallingAlarm))) + eventid = 2; + else if (vp->val_len != sizeof(risingAlarm) + || !memcmp(vp->val.objid, unavailableAlarm, sizeof(unavailableAlarm))) + eventid = 3; + else { + fprintf(stderr, "unknown event\n"); + eventid = 0; + } + + vp = vp->next_variable; + memmove(variable, vp->val.objid, vp->val_len * sizeof(oid)); + variablelen = vp->val_len; + op = vp->name + 22; + destip = 0; + destip |= (*op++) << 24; + destip |= (*op++) << 16; + destip |= (*op++) << 8; + destip |= *op++; + + vp = vp->next_variable; + sampletype = *vp->val.integer; + + vp = vp->next_variable; + value= *vp->val.integer; + + vp = vp->next_variable; + threshold = *vp->val.integer; + + printf("%d: 0x%02lX %d %d %d\n", eventid, destip, sampletype, value, threshold); + +} + +void send_handler_data(FILE *file, struct hostent *host, + struct snmp_pdu *pdu) +{ + struct variable_list tmpvar, *vars; + struct sockaddr_in *pduIp = (struct sockaddr_in *)&(pdu->address); + static oid trapoids[] = {1,3,6,1,6,3,1,1,5,0}; + static oid snmpsysuptime[] = {1,3,6,1,2,1,1,3,0}; + static oid snmptrapoid[] = {1,3,6,1,6,3,1,1,4,1,0}; + static oid snmptrapent[] = {1,3,6,1,6,3,1,1,4,3,0}; + static oid snmptrapaddr[] = {1,3,6,1,6,3,18,1,3,0}; + static oid snmptrapcom[] = {1,3,6,1,6,3,18,1,4,0}; + oid enttrapoid[MAX_OID_LEN]; + int enttraplen = pdu->enterprise_length; + char varbuf[2048]; + + fprintf(file,"%s\n%s\n", + host ? host->h_name : inet_ntoa(pduIp->sin_addr), + inet_ntoa(pduIp->sin_addr)); + if (pdu->command == SNMP_MSG_TRAP){ + + + tmpvar.val.integer = (long *) &pdu->time; + tmpvar.val_len = sizeof(pdu->time); + tmpvar.type = ASN_TIMETICKS; + sprint_variable(varbuf, snmpsysuptime, sizeof(snmpsysuptime)/sizeof(snmpsysuptime[0]), &tmpvar); + fprintf(file,"%s\n",varbuf); + tmpvar.type = ASN_OBJECT_ID; + if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) { + memcpy(enttrapoid, pdu->enterprise, sizeof(oid)*enttraplen); + if (enttrapoid[enttraplen-1] != 0) enttrapoid[enttraplen++] = 0; + enttrapoid[enttraplen++] = pdu->specific_type; + tmpvar.val.objid = enttrapoid; + tmpvar.val_len = enttraplen*sizeof(oid); + } + else { + trapoids[9] = pdu->trap_type+1; + tmpvar.val.objid = trapoids; + tmpvar.val_len = 10*sizeof(oid); + } + sprint_variable(varbuf, snmptrapoid, sizeof(snmptrapoid)/sizeof(snmptrapoid[0]), &tmpvar); + fprintf(file,"%s\n",varbuf); + } + + for(vars = pdu->variables; vars; vars = vars->next_variable) { + sprint_variable(varbuf, vars->name, vars->name_length, vars); + fprintf(file,"%s\n",varbuf); + } + if (pdu->command == SNMP_MSG_TRAP){ + + + tmpvar.val.string = (u_char *)&((struct sockaddr_in*)&pdu->agent_addr)->sin_addr.s_addr; + tmpvar.val_len = 4; + tmpvar.type = ASN_IPADDRESS; + sprint_variable(varbuf, snmptrapaddr, sizeof(snmptrapaddr)/sizeof(snmptrapaddr[0]), &tmpvar); + fprintf(file,"%s\n",varbuf); + tmpvar.val.string = pdu->community; + tmpvar.val_len = pdu->community_len; + tmpvar.type = ASN_OCTET_STR; + sprint_variable(varbuf, snmptrapcom, sizeof(snmptrapcom)/sizeof(snmptrapcom[0]), &tmpvar); + fprintf(file,"%s\n",varbuf); + tmpvar.val.objid = pdu->enterprise; + tmpvar.val_len = pdu->enterprise_length*sizeof(oid); + tmpvar.type = ASN_OBJECT_ID; + sprint_variable(varbuf, snmptrapent, sizeof(snmptrapent)/sizeof(snmptrapent[0]), &tmpvar); + fprintf(file,"%s\n",varbuf); + } +} + +void do_external(char *cmd, + struct hostent *host, + struct snmp_pdu *pdu) +{ + FILE *file; + int oldquick, result; + + DEBUGMSGTL(("snmptrapd", "Running: %s\n", cmd)); + oldquick = snmp_get_quick_print(); + snmp_set_quick_print(1); + if (cmd) { +#ifndef WIN32 + int fd[2]; + int pid; + + if (pipe(fd)) { + snmp_log_perror("pipe"); + } + if ((pid = fork()) == 0) { + + close(0); + if (dup(fd[0]) != 0) { + snmp_log_perror("dup"); + } + close(fd[1]); + close(fd[0]); + system(cmd); + exit(0); + } else if (pid > 0) { + file = fdopen(fd[1],"w"); + send_handler_data(file, host, pdu); + fclose(file); + close(fd[0]); + close(fd[1]); + if (waitpid(pid, &result,0) < 0) { + snmp_log_perror("waitpid"); + } + } else { + snmp_log_perror("fork"); + } +#else + char command_buf[128]; + char file_buf[L_tmpnam]; + + tmpnam(file_buf); + file = fopen(file_buf, "w"); + if (!file) { + fprintf(stderr, "fopen: %s: %s\n", file_buf, strerror(errno)); + } + else { + send_handler_data(file, host, pdu); + fclose(file); + sprintf(command_buf, "%s < %s", cmd, file_buf); + result = system(command_buf); + if (result == -1) + fprintf(stderr, "system: %s: %s\n", command_buf, strerror(errno)); + else if (result) + fprintf(stderr, "system: %s: %d\n", command_buf, result); + remove(file_buf); + } +#endif + } + snmp_set_quick_print(oldquick); +} + +int snmp_input(int op, + struct snmp_session *session, + int reqid, + struct snmp_pdu *pdu, + void *magic) +{ + char out_bfr[SPRINT_MAX_LEN]; + struct variable_list *vars; + struct sockaddr_in *pduIp = (struct sockaddr_in *)&(pdu->address); + char buf[64], oid_buf [SPRINT_MAX_LEN], *cp; + struct snmp_pdu *reply; + struct hostent *host; + int varbufidx; + char varbuf[SPRINT_MAX_LEN]; + static oid trapoids[10] = {1,3,6,1,6,3,1,1,5}; + static oid snmptrapoid2[11] = {1,3,6,1,6,3,1,1,4,1,0}; + struct variable_list tmpvar; + char *Command = NULL; + tmpvar.type = ASN_OBJECT_ID; + + if (op == RECEIVED_MESSAGE){ + if (pdu->command == SNMP_MSG_TRAP){ + oid trapOid[MAX_OID_LEN]; + int trapOidLen = pdu->enterprise_length; + struct sockaddr_in *agentIp = (struct sockaddr_in *)&pdu->agent_addr; + if( ds_get_boolean(DS_APPLICATION_ID, DS_APP_NUMERIC_IP) ) + host = NULL; + else + host = gethostbyaddr ((char *)&agentIp->sin_addr, + sizeof (agentIp->sin_addr), AF_INET); + if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) { + memcpy(trapOid, pdu->enterprise, sizeof(oid)*trapOidLen); + if (trapOid[trapOidLen-1] != 0) trapOid[trapOidLen++] = 0; + trapOid[trapOidLen++] = pdu->specific_type; + } + if (Print && (pdu->trap_type != SNMP_TRAP_AUTHFAIL || dropauth == 0)) { + if (trap1_fmt_str == NULL || trap1_fmt_str[0] == '\0') + (void) format_plain_trap (out_bfr, SPRINT_MAX_LEN, pdu); + else + (void) format_trap (out_bfr, SPRINT_MAX_LEN, trap1_fmt_str, pdu); + snmp_log(LOG_INFO, "%s", out_bfr); + } + if (Syslog && (pdu->trap_type != SNMP_TRAP_AUTHFAIL || dropauth == 0)) { + varbufidx=0; + varbuf[varbufidx++]=','; varbuf[varbufidx++]=' '; + varbuf[varbufidx]='\0'; + + for(vars = pdu->variables; vars; vars = vars->next_variable) { + sprint_variable(varbuf+varbufidx, vars->name, + vars->name_length, vars); + + + varbufidx += strlen(varbuf+varbufidx); + + varbuf[varbufidx++]=','; + varbuf[varbufidx++]=' '; + varbuf[varbufidx]='\0'; + } + if ( varbufidx ) { + varbufidx -= 2; varbuf[varbufidx]='\0'; + } + if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) { + sprint_objid(oid_buf, trapOid, trapOidLen); + cp = strrchr(oid_buf, '.'); + if (cp) cp++; + else cp = oid_buf; + syslog(LOG_WARNING, "%s: %s Trap (%s) Uptime: %s%s", + inet_ntoa(agentIp->sin_addr), + trap_description(pdu->trap_type), cp, + uptime_string(pdu->time, buf), varbuf); + } else { + syslog(LOG_WARNING, "%s: %s Trap (%ld) Uptime: %s%s", + inet_ntoa(agentIp->sin_addr), + trap_description(pdu->trap_type), pdu->specific_type, + uptime_string(pdu->time, buf), varbuf); + } + } + if (pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) + Command = snmptrapd_get_traphandler(trapOid, trapOidLen); + else { + trapoids[9] = pdu->trap_type+1; + Command = snmptrapd_get_traphandler(trapoids, 10); + } + if (Command) + do_external(Command, host, pdu); + } else if (pdu->command == SNMP_MSG_TRAP2 + || pdu->command == SNMP_MSG_INFORM){ + if( ds_get_boolean(DS_APPLICATION_ID, DS_APP_NUMERIC_IP) ) + host = NULL; + else + host = gethostbyaddr ((char *)&pduIp->sin_addr, + sizeof (pduIp->sin_addr), AF_INET); + if (Print) { + if (trap2_fmt_str == NULL || trap2_fmt_str[0] == '\0') + (void) format_trap (out_bfr, SPRINT_MAX_LEN, + trap2_std_str, pdu); + else + (void) format_trap (out_bfr, SPRINT_MAX_LEN, + trap2_fmt_str, pdu); + snmp_log(LOG_INFO, "%s", out_bfr); + } + if (Syslog) { + varbufidx=0; + varbuf[varbufidx]='\0'; + + for (vars = pdu->variables; vars; vars = vars->next_variable) { + sprint_variable(varbuf+varbufidx, vars->name, + vars->name_length, vars); + + + varbufidx += strlen(varbuf+varbufidx); + + varbuf[varbufidx++]=','; + varbuf[varbufidx++]=' '; + varbuf[varbufidx]='\0'; + } + if ( varbufidx ) { + varbufidx -= 2; varbuf[varbufidx]='\0'; + } + if( ds_get_boolean(DS_APPLICATION_ID, DS_APP_NUMERIC_IP) ) + host = NULL; + else + host = gethostbyaddr ((char *)&pduIp->sin_addr, + sizeof (pduIp->sin_addr), AF_INET); + syslog(LOG_WARNING, "%s [%s]: Trap %s", + host ? host->h_name : inet_ntoa(pduIp->sin_addr), + inet_ntoa(pduIp->sin_addr), varbuf); + } + if (Event) { + event_input(pdu->variables); + } + for(vars = pdu->variables; + vars && + snmp_oid_compare(vars->name, vars->name_length, snmptrapoid2, + sizeof(snmptrapoid2)/sizeof(oid)); + vars = vars->next_variable); + if (vars && vars->type == ASN_OBJECT_ID) { + Command = snmptrapd_get_traphandler(vars->val.objid, + vars->val_len/sizeof(oid)); + if (Command) + do_external(Command, host, pdu); + } + if (pdu->command == SNMP_MSG_INFORM){ + if (!(reply = snmp_clone_pdu2(pdu, SNMP_MSG_RESPONSE))){ + fprintf(stderr, "Couldn't clone PDU for response\n"); + return 1; + } + reply->errstat = 0; + reply->errindex = 0; + reply->address = pdu->address; + if (!snmp_send(session, reply)){ + snmp_sess_perror("snmptrapd: Couldn't respond to inform pdu", session); + snmp_free_pdu(reply); + } + } + } + } else if (op == TIMED_OUT){ + fprintf(stderr, "Timeout: This shouldn't happen!\n"); + } + return 1; +} + + +static void parse_trap1_fmt(const char *token, char *line) +{ + trap1_fmt_str = strdup(line); +} + + +static void free_trap1_fmt(void) +{ + if (trap1_fmt_str != trap1_std_str) free ((char *)trap1_fmt_str); + trap1_fmt_str = NULL; +} + + +static void parse_trap2_fmt(const char *token, char *line) +{ + trap2_fmt_str = strdup(line); +} + + +static void free_trap2_fmt(void) +{ + if (trap2_fmt_str != trap2_std_str) free ((char *)trap2_fmt_str); + trap2_fmt_str = NULL; +} + + +void usage(void) +{ + fprintf(stderr,"Usage: snmptrapd [-h|-H|-V] [-D] [-p #] [-P] [-s] [-f] [-l [d0-7]] [-e] [-d] [-n] [-a] [-m ] [-M Local port to listen from\n\ + -P Print to standard output\n\ + -F \"...\" Use custom format for logging to standard output\n\ + -u PIDFILE create PIDFILE with process id\n\ + -e Print Event # (rising/falling alarm], etc.\n\ + -s Log syslog\n\ + -f Stay in foreground (don't fork)\n\ + -l [d0-7 ] Set syslog Facility to log daemon[d], log local 0(default) [1-7]\n\ + -d Dump input/output packets\n\ + -n Use numeric IP addresses instead of host names (no DNS)\n\ + -a Ignore Authentication Failture traps.\n\ + -c CONFFILE Read CONFFILE as a configuration file.\n\ + -C Don't read the default configuration files.\n\ + -m Use MIBS list instead of the default mib list.\n\ + -M Use MIBDIRS as the location to look for mibs.\n\ + -O Toggle various options controlling output display\n"); + snmp_out_toggle_options_usage("\t\t ", stderr); +} + +RETSIGTYPE term_handler(int sig) +{ + running = 0; +} + +#ifdef SIGHUP +RETSIGTYPE hup_handler(int sig) +{ + reconfig = 1; + signal(SIGHUP, hup_handler); +} +#endif + +int main(int argc, char *argv[]) +{ + struct snmp_session sess, *session = &sess, *ss; + int arg; + int count, numfds, block; + fd_set fdset; + struct timeval timeout, *tvp; + int local_port = SNMP_TRAP_PORT; + int dofork=1; + char *cp; + int tcp=0; + char *trap1_fmt_str_remember = NULL; +#if HAVE_GETPID + FILE *PID; + char *pid_file = NULL; +#endif + +#ifdef notused + in_addr_t myaddr; + oid src[MAX_OID_LEN], dst[MAX_OID_LEN], context[MAX_OID_LEN]; + int srclen, dstlen, contextlen; + char ctmp[300]; +#endif + + + register_config_handler("snmptrapd", "traphandle", + snmptrapd_traphandle, NULL, + "oid|\"default\" program [args ...] "); + register_config_handler("snmptrapd", "createUser", + usm_parse_create_usmUser, NULL, + "username (MD5|SHA) passphrase [DES passphrase]"); + register_config_handler("snmptrapd", "usmUser", + usm_parse_config_usmUser, NULL, NULL); + register_config_handler("snmptrapd", "format1", + parse_trap1_fmt, free_trap1_fmt, + "format"); + register_config_handler("snmptrapd", "format2", + parse_trap2_fmt, free_trap2_fmt, + "format"); + + + snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, + usm_store_users, NULL); + +#ifdef WIN32 + setvbuf (stdout, NULL, _IONBF, BUFSIZ); +#else + setvbuf (stdout, NULL, _IOLBF, BUFSIZ); +#endif + + + + while ((arg = getopt(argc, argv, "VdnqRD:p:m:M:Po:O:esSafl:Hu:c:CF:T:")) != EOF){ + switch(arg) { + case 'V': + fprintf(stderr,"UCD-snmp version: %s\n", VersionInfo); + exit(0); + break; + case 'd': + snmp_set_dump_packet(1); + break; + case 'q': + snmp_set_quick_print(1); + break; + case 'D': + debug_register_tokens(optarg); + snmp_set_do_debugging(1); + break; + case 'p': + local_port = atoi(optarg); + break; + case 'm': + setenv("MIBS", optarg, 1); + break; + case 'M': + setenv("MIBDIRS", optarg, 1); + break; + case 'T': + if (strcasecmp(optarg,"TCP") == 0) { + tcp = 1; + } else if (strcasecmp(optarg,"UDP") == 0) { + tcp = 0; + } else { + fprintf(stderr,"Unknown transport \"%s\" after -T flag.\n", optarg); + exit(1); + } + break; + case 'O': + cp = snmp_out_toggle_options(optarg); + if (cp != NULL) { + fprintf(stderr, "Unknow output option passed to -O: %c\n", *cp); + usage(); + exit(1); + } + break; + case 'P': + dofork = 0; + snmp_enable_stderrlog(); + Print++; + break; + + case 'o': + Print++; + logfile = optarg; + snmp_enable_filelog(optarg, 0); + break; + + case 'e': + Event++; + break; + case 's': + Syslog++; + break; + case 'S': + snmp_set_suffix_only(2); + break; + case 'a': + dropauth = 1; + break; + case 'f': + dofork = 0; + break; + case 'l': + switch(*optarg) { + case 'd': + Facility = LOG_DAEMON; break; + case '0': + Facility = LOG_LOCAL0; break; + case '1': + Facility = LOG_LOCAL1; break; + case '2': + Facility = LOG_LOCAL2; break; + case '3': + Facility = LOG_LOCAL3; break; + case '4': + Facility = LOG_LOCAL4; break; + case '5': + Facility = LOG_LOCAL5; break; + case '6': + Facility = LOG_LOCAL6; break; + case '7': + Facility = LOG_LOCAL7; break; + default: + fprintf(stderr,"invalid syslog facility: -l %c\n", *optarg); + usage(); + exit (1); + break; + } + break; + case 'H': + init_snmp("snmptrapd"); + fprintf(stderr, "Configuration directives understood:\n"); + read_config_print_usage(" "); + exit(0); + +#if HAVE_GETPID + case 'u': + pid_file = optarg; + break; +#endif + + case 'c': + ds_set_string(DS_LIBRARY_ID, DS_LIB_OPTIONALCONFIG, optarg); + break; + + case 'C': + ds_set_boolean(DS_LIBRARY_ID, DS_LIB_DONT_READ_CONFIGS, 1); + break; + + case 'n': + ds_set_boolean(DS_APPLICATION_ID, DS_APP_NUMERIC_IP, 1); + break; + + case 'F': + trap1_fmt_str_remember = optarg; + break; + + default: + fprintf(stderr,"invalid option: -%c\n", arg); + usage(); + exit (1); + break; + } + } + + if (optind != argc) { + usage(); + exit(1); + } + + if (!Print) Syslog = 1; + + + init_snmp("snmptrapd"); + if (trap1_fmt_str_remember) { + free_trap1_fmt(); + trap1_fmt_str = strdup(trap1_fmt_str_remember); + } + +#ifndef WIN32 + + if (dofork) { + int fd; + + switch (fork()) { + case -1: + fprintf(stderr,"bad fork - %s\n",strerror(errno)); + _exit(1); + + case 0: + + if (setsid() == -1) { + fprintf(stderr,"bad setsid - %s\n",strerror(errno)); + _exit(1); + } + + + fd=open("/dev/null", O_RDWR); + dup2(fd, STDIN_FILENO); + dup2(fd, STDOUT_FILENO); + dup2(fd, STDERR_FILENO); + close(fd); + break; + + default: + _exit(0); + } + } +#endif +#if HAVE_GETPID + if (pid_file != NULL) { + if ((PID = fopen(pid_file, "w")) == NULL) { + snmp_log_perror("fopen"); + exit(1); + } + fprintf(PID, "%d\n", (int)getpid()); + fclose(PID); + } +#endif + + if (Syslog) { + + init_syslog(); + } + if (Print) { + struct tm *tm; + time_t timer; + time (&timer); + tm = localtime (&timer); + snmp_log(LOG_INFO, + "%.4d-%.2d-%.2d %.2d:%.2d:%.2d UCD-snmp version %s Started.\n", + tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + VersionInfo); + } + + + snmp_sess_init(session); + session->peername = SNMP_DEFAULT_PEERNAME; + session->version = SNMP_DEFAULT_VERSION; + + session->community_len = SNMP_DEFAULT_COMMUNITY_LEN; + + session->retries = SNMP_DEFAULT_RETRIES; + session->timeout = SNMP_DEFAULT_TIMEOUT; + + session->local_port = local_port; + + session->callback = snmp_input; + session->callback_magic = NULL; + session->authenticator = NULL; + sess.isAuthoritative = SNMP_SESS_UNKNOWNAUTH; + if (tcp) + session->flags |= SNMP_FLAGS_STREAM_SOCKET; + + SOCK_STARTUP; + ss = snmp_open( session ); + if (ss == NULL){ + snmp_sess_perror("snmptrapd", session); + if (Syslog) { + syslog(LOG_ERR,"couldn't open snmp - %m"); + } + SOCK_CLEANUP; + exit(1); + } + + signal(SIGTERM, term_handler); +#ifdef SIGHUP + signal(SIGHUP, hup_handler); +#endif + signal(SIGINT, term_handler); + + while (running) { + if (reconfig) { + if (Print) { + struct tm *tm; + time_t timer; + time (&timer); + tm = localtime (&timer); + printf("%.4d-%.2d-%.2d %.2d:%.2d:%.2d UCD-snmp version %s Reconfigured.\n", + tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + VersionInfo); + } + if (Syslog) + syslog(LOG_INFO, "Snmptrapd reconfiguring"); + update_config(); + if (trap1_fmt_str_remember) { + free_trap1_fmt(); + trap1_fmt_str = strdup(trap1_fmt_str_remember); + } + reconfig = 0; + } + numfds = 0; + FD_ZERO(&fdset); + block = 0; + tvp = &timeout; + timerclear(tvp); + tvp->tv_sec = 5; + snmp_select_info(&numfds, &fdset, tvp, &block); + if (block == 1) + tvp = NULL; + count = select(numfds, &fdset, 0, 0, tvp); + gettimeofday(&Now, 0); + if (count > 0){ + snmp_read(&fdset); + } else switch(count){ + case 0: + snmp_timeout(); + break; + case -1: + if (errno == EINTR) + continue; + snmp_log_perror("select"); + running = 0; + break; + default: + fprintf(stderr, "select returned %d\n", count); + running = 0; + } + } + + if (Print) { + struct tm *tm; + time_t timer; + time (&timer); + tm = localtime (&timer); + printf("%.4d-%.2d-%.2d %.2d:%.2d:%.2d UCD-snmp version %s Stopped.\n", + tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + VersionInfo); + } + if (Syslog) + syslog(LOG_INFO, "Stopping snmptrapd"); + + snmp_close(ss); + snmp_shutdown("snmptrapd"); + SOCK_CLEANUP; + return 0; +} + +void +init_syslog(void) +{ + + + + + openlog("snmptrapd", LOG_CONS|LOG_PID, Facility); + syslog(LOG_INFO, "Starting snmptrapd %s", VersionInfo); +} + + + + + + + + +void update_config(void) +{ + free_config(); + read_configs(); +} + + +#if !defined(HAVE_GETDTABLESIZE) && !defined(WIN32) +#include +int getdtablesize(void) +{ + struct rlimit rl; + getrlimit(RLIMIT_NOFILE, &rl); + return( rl.rlim_cur ); +} +#endif diff --git a/plugins/scancode-compiledcode/tests/data/cppincludes/test5.c b/plugins/scancode-compiledcode/tests/data/cppincludes/test5.c new file mode 100644 index 00000000000..cb7f3fa0052 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/cppincludes/test5.c @@ -0,0 +1,1117 @@ + + + + + + + + + + + + + + + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + + + + + +#include +#include +#include +#include "util_funcs.h" + + + + +#include "diskio.h" + +#define CACHE_TIMEOUT 10 +static time_t cache_time = 0; + +#ifdef solaris2 +#include + +#define MAX_DISKS 128 + +static kstat_ctl_t *kc; +static kstat_t *ksp; +static kstat_io_t kio; +static int cache_disknr = -1; +#endif + +#if defined(aix4) || defined(aix5) + + + +#include +static perfstat_disk_t *ps_disk; +static int ps_numdisks; +#endif + +#if defined(bsdi3) || defined(bsdi4) +#include +#include +#include +#include +#endif + +#if defined (freebsd4) || defined(freebsd5) +#include +#if __FreeBSD_version >= 500101 +#include +#else +#include +#endif +#include + +#include + +#define DISKIO_SAMPLE_INTERVAL 5 + +#endif + +#if defined(freebsd5) && __FreeBSD_version >= 500107 + #define GETDEVS(x) devstat_getdevs(NULL, (x)) +#else + #define GETDEVS(x) getdevs((x)) +#endif + +#if defined (darwin) +#include +#include +#include +#include +#include + +static mach_port_t masterPort; +#endif + +static char type[20]; +void diskio_parse_config(const char *, char *); + +#if defined (freebsd4) || defined(freebsd5) +void devla_getstats(unsigned int regno, void *dummy); +#endif + +FILE *file; + + + + + + + + + + + + + + + + + + + +void +init_diskio(void) +{ + + + + + + + + + + + + + struct variable2 diskio_variables[] = { + {DISKIO_INDEX, ASN_INTEGER, RONLY, var_diskio, 1, {1}}, + {DISKIO_DEVICE, ASN_OCTET_STR, RONLY, var_diskio, 1, {2}}, + {DISKIO_NREAD, ASN_COUNTER, RONLY, var_diskio, 1, {3}}, + {DISKIO_NWRITTEN, ASN_COUNTER, RONLY, var_diskio, 1, {4}}, + {DISKIO_READS, ASN_COUNTER, RONLY, var_diskio, 1, {5}}, + {DISKIO_WRITES, ASN_COUNTER, RONLY, var_diskio, 1, {6}}, + {DISKIO_LA1, ASN_INTEGER, RONLY, var_diskio, 1, {9}}, + {DISKIO_LA5, ASN_INTEGER, RONLY, var_diskio, 1, {10}}, + {DISKIO_LA15, ASN_INTEGER, RONLY, var_diskio, 1, {11}} + }; + + + + + + oid diskio_variables_oid[] = + { 1, 3, 6, 1, 4, 1, 2021, 13, 15, 1, 1 }; + + + + + + + + + + + + + REGISTER_MIB("diskio", diskio_variables, variable2, + diskio_variables_oid); + + + + + snmpd_register_config_handler("diskio", diskio_parse_config, + NULL, "diskio [device-type]"); + +#ifdef solaris2 + kc = kstat_open(); + + if (kc == NULL) + snmp_log(LOG_ERR, "diskio: Couln't open kstat\n"); +#endif + +#ifdef darwin + + + + IOMasterPort(bootstrap_port, &masterPort); +#endif + +#if defined(aix4) || defined(aix5) + + + + ps_numdisks = 0; + ps_disk = NULL; +#endif + +#if defined (freebsd4) || defined(freebsd5) + devla_getstats(0, NULL); + + snmp_alarm_register(DISKIO_SAMPLE_INTERVAL, SA_REPEAT, devla_getstats, NULL); +#endif + +} + +void +diskio_parse_config(const char *token, char *cptr) +{ + + copy_word(cptr, type); +} + +#ifdef solaris2 +int +get_disk(int disknr) +{ + time_t now; + int i = 0; + kstat_t *tksp; + + now = time(NULL); + if (disknr == cache_disknr && cache_time + CACHE_TIMEOUT > now) { + return 1; + } + + + + + + + + for (tksp = kc->kc_chain; tksp != NULL; tksp = tksp->ks_next) { + if (tksp->ks_type == KSTAT_TYPE_IO + && !strcmp(tksp->ks_class, "disk")) { + if (i == disknr) { + if (kstat_read(kc, tksp, &kio) == -1) + snmp_log(LOG_ERR, "diskio: kstat_read failed\n"); + ksp = tksp; + cache_time = now; + cache_disknr = disknr; + return 1; + } else { + i++; + } + } + } + return 0; +} + + +u_char * +var_diskio(struct variable * vp, + oid * name, + size_t * length, + int exact, size_t * var_len, WriteMethod ** write_method) +{ + + + + static long long_ret; + + if (header_simple_table + (vp, name, length, exact, var_len, write_method, MAX_DISKS)) + return NULL; + + + if (get_disk(name[*length - 1] - 1) == 0) + return NULL; + + + + + + switch (vp->magic) { + case DISKIO_INDEX: + long_ret = (long) name[*length - 1]; + return (u_char *) & long_ret; + case DISKIO_DEVICE: + *var_len = strlen(ksp->ks_name); + return (u_char *) ksp->ks_name; + case DISKIO_NREAD: + long_ret = (uint32_t) kio.nread; + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: + long_ret = (uint32_t) kio.nwritten; + return (u_char *) & long_ret; + case DISKIO_READS: + long_ret = (uint32_t) kio.reads; + return (u_char *) & long_ret; + case DISKIO_WRITES: + long_ret = (uint32_t) kio.writes; + return (u_char *) & long_ret; + + default: + ERROR_MSG("diskio.c: don't know how to handle this request."); + } + + + + return NULL; +} +#endif + +#if defined(bsdi3) || defined(bsdi4) +static int ndisk; +static struct diskstats *dk; +static char **dkname; + +static int +getstats(void) +{ + time_t now; + int mib[2]; + char *t, *tp; + int size, dkn_size, i; + + now = time(NULL); + if (cache_time + CACHE_TIMEOUT > now) { + return 1; + } + mib[0] = CTL_HW; + mib[1] = HW_DISKSTATS; + size = 0; + if (sysctl(mib, 2, NULL, &size, NULL, 0) < 0) { + perror("Can't get size of HW_DISKSTATS mib"); + return 0; + } + if (ndisk != size / sizeof(*dk)) { + if (dk) + free(dk); + if (dkname) { + for (i = 0; i < ndisk; i++) + if (dkname[i]) + free(dkname[i]); + free(dkname); + } + ndisk = size / sizeof(*dk); + if (ndisk == 0) + return 0; + dkname = malloc(ndisk * sizeof(char *)); + mib[0] = CTL_HW; + mib[1] = HW_DISKNAMES; + if (sysctl(mib, 2, NULL, &dkn_size, NULL, 0) < 0) { + perror("Can't get size of HW_DISKNAMES mib"); + return 0; + } + tp = t = malloc(dkn_size); + if (sysctl(mib, 2, t, &dkn_size, NULL, 0) < 0) { + perror("Can't get size of HW_DISKNAMES mib"); + return 0; + } + for (i = 0; i < ndisk; i++) { + dkname[i] = strdup(tp); + tp += strlen(tp) + 1; + } + free(t); + dk = malloc(ndisk * sizeof(*dk)); + } + mib[0] = CTL_HW; + mib[1] = HW_DISKSTATS; + if (sysctl(mib, 2, dk, &size, NULL, 0) < 0) { + perror("Can't get HW_DISKSTATS mib"); + return 0; + } + cache_time = now; + return 1; +} + +u_char * +var_diskio(struct variable * vp, + oid * name, + size_t * length, + int exact, size_t * var_len, WriteMethod ** write_method) +{ + static long long_ret; + unsigned int indx; + + if (getstats() == 0) + return 0; + + if (header_simple_table + (vp, name, length, exact, var_len, write_method, ndisk)) + return NULL; + + indx = (unsigned int) (name[*length - 1] - 1); + if (indx >= ndisk) + return NULL; + + switch (vp->magic) { + case DISKIO_INDEX: + long_ret = (long) indx + 1; + return (u_char *) & long_ret; + case DISKIO_DEVICE: + *var_len = strlen(dkname[indx]); + return (u_char *) dkname[indx]; + case DISKIO_NREAD: + long_ret = + (signed long) (dk[indx].dk_sectors * dk[indx].dk_secsize); + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: + return NULL; + case DISKIO_READS: + long_ret = (signed long) dk[indx].dk_xfers; + return (u_char *) & long_ret; + case DISKIO_WRITES: + return NULL; + + default: + ERROR_MSG("diskio.c: don't know how to handle this request."); + } + return NULL; +} +#endif + +#if defined(freebsd4) || defined(freebsd5) + + + +struct dev_la { + struct timeval prev; + double la1,la5,la15; + char name[DEVSTAT_NAME_LEN+5]; + }; + +static struct dev_la *devloads = NULL; +static int ndevs = 0; + +double devla_timeval_diff(struct timeval *t1, struct timeval *t2) { + + double dt1 = (double) t1->tv_sec + (double) t1->tv_usec * 0.000001; + double dt2 = (double) t2->tv_sec + (double) t2->tv_usec * 0.000001; + + return dt2-dt1; + + } + +void devla_getstats(unsigned int regno, void *dummy) { + + static struct statinfo *lastat = NULL; + int i; + double busy_time, busy_percent; + static double expon1, expon5, expon15; + char current_name[DEVSTAT_NAME_LEN+5]; + + if (lastat == NULL) { + lastat = (struct statinfo *) malloc(sizeof(struct statinfo)); + if (lastat != NULL) + lastat->dinfo = (struct devinfo *) malloc(sizeof(struct devinfo)); + if (lastat == NULL || lastat->dinfo == NULL) { + SNMP_FREE(lastat); + ERROR_MSG("Memory alloc failure - devla_getstats()\n"); + return; + } + } + memset(lastat->dinfo, 0, sizeof(struct devinfo)); + + if ((GETDEVS(lastat)) == -1) { + ERROR_MSG("can't do getdevs()\n"); + return; + } + + if (ndevs != 0) { + for (i=0; i < ndevs; i++) { + snprintf(current_name, sizeof(current_name), "%s%d", + lastat->dinfo->devices[i].device_name, lastat->dinfo->devices[i].unit_number); + if (strcmp(current_name, devloads[i].name)) { + ndevs = 0; + free(devloads); + } + } + } + + if (ndevs == 0) { + ndevs = lastat->dinfo->numdevs; + devloads = (struct dev_la *) malloc(ndevs * sizeof(struct dev_la)); + bzero(devloads, ndevs * sizeof(struct dev_la)); + for (i=0; i < ndevs; i++) { + memcpy(&devloads[i].prev, &lastat->dinfo->devices[i].busy_time, sizeof(struct timeval)); + snprintf(devloads[i].name, sizeof(devloads[i].name), "%s%d", + lastat->dinfo->devices[i].device_name, lastat->dinfo->devices[i].unit_number); + } + expon1 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)60))); + expon5 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)300))); + expon15 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)900))); + } + + for (i=0; idinfo->devices[i].busy_time); + busy_percent = busy_time * 100 / DISKIO_SAMPLE_INTERVAL; + devloads[i].la1 = devloads[i].la1 * expon1 + busy_percent * (1 - expon1); + + devloads[i].la5 = devloads[i].la5 * expon5 + busy_percent * (1 - expon5); + devloads[i].la15 = devloads[i].la15 * expon15 + busy_percent * (1 - expon15); + memcpy(&devloads[i].prev, &lastat->dinfo->devices[i].busy_time, sizeof(struct timeval)); + } + + } + + + +static int ndisk; +static struct statinfo *stat; +FILE *file; + +static int +getstats(void) +{ + time_t now; + int i; + + now = time(NULL); + if (cache_time + CACHE_TIMEOUT > now) { + return 0; + } + if (stat == NULL) { + stat = (struct statinfo *) malloc(sizeof(struct statinfo)); + if (stat != NULL) + stat->dinfo = (struct devinfo *) malloc(sizeof(struct devinfo)); + if (stat == NULL || stat->dinfo == NULL) { + SNMP_FREE(stat); + ERROR_MSG("Memory alloc failure - getstats\n"); + return 1; + } + } + memset(stat->dinfo, 0, sizeof(struct devinfo)); + + if (GETDEVS(stat) == -1) { + fprintf(stderr, "Can't get devices:%s\n", devstat_errbuf); + return 1; + } + ndisk = stat->dinfo->numdevs; + + for (i = 0; i < ndisk; i++) { + char *cp = stat->dinfo->devices[i].device_name; + int len = strlen(cp); + if (len > DEVSTAT_NAME_LEN - 3) + len -= 3; + cp += len; + sprintf(cp, "%d", stat->dinfo->devices[i].unit_number); + } + cache_time = now; + return 0; +} + +u_char * +var_diskio(struct variable * vp, + oid * name, + size_t * length, + int exact, size_t * var_len, WriteMethod ** write_method) +{ + static long long_ret; + unsigned int indx; + + if (getstats() == 1) { + return NULL; + } + + + if (header_simple_table + (vp, name, length, exact, var_len, write_method, ndisk)) { + return NULL; + } + + indx = (unsigned int) (name[*length - 1] - 1); + + if (indx >= ndisk) + return NULL; + + switch (vp->magic) { + case DISKIO_INDEX: + long_ret = (long) indx + 1;; + return (u_char *) & long_ret; + case DISKIO_DEVICE: + *var_len = strlen(stat->dinfo->devices[indx].device_name); + return (u_char *) stat->dinfo->devices[indx].device_name; + case DISKIO_NREAD: +#if defined(freebsd5) && __FreeBSD_version >= 500107 + long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ]; +#else + long_ret = (signed long) stat->dinfo->devices[indx].bytes_read; +#endif + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: +#if defined(freebsd5) && __FreeBSD_version >= 500107 + long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE]; +#else + long_ret = (signed long) stat->dinfo->devices[indx].bytes_written; +#endif + return (u_char *) & long_ret; + case DISKIO_READS: +#if defined(freebsd5) && __FreeBSD_version >= 500107 + long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ]; +#else + long_ret = (signed long) stat->dinfo->devices[indx].num_reads; +#endif + return (u_char *) & long_ret; + case DISKIO_WRITES: +#if defined(freebsd5) && __FreeBSD_version >= 500107 + long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE]; +#else + long_ret = (signed long) stat->dinfo->devices[indx].num_writes; +#endif + return (u_char *) & long_ret; + case DISKIO_LA1: + long_ret = devloads[indx].la1; + return (u_char *) & long_ret; + case DISKIO_LA5: + long_ret = devloads[indx].la5; + return (u_char *) & long_ret; + case DISKIO_LA15: + long_ret = devloads[indx].la15; + return (u_char *) & long_ret; + + default: + ERROR_MSG("diskio.c: don't know how to handle this request."); + } + return NULL; +} +#endif + + +#ifdef linux + +#define DISK_INCR 2 + +typedef struct linux_diskio +{ + int major; + int minor; + unsigned long blocks; + char name[256]; + unsigned long rio; + unsigned long rmerge; + unsigned long rsect; + unsigned long ruse; + unsigned long wio; + unsigned long wmerge; + unsigned long wsect; + unsigned long wuse; + unsigned long running; + unsigned long use; + unsigned long aveq; +} linux_diskio; + +typedef struct linux_diskio_header +{ + linux_diskio* indices; + int length; + int alloc; +} linux_diskio_header; + +static linux_diskio_header head; + + +int getstats(void) +{ + FILE* parts; + time_t now; + + now = time(NULL); + if (cache_time + CACHE_TIMEOUT > now) { + return 0; + } + + if (!head.indices) { + head.alloc = DISK_INCR; + head.indices = (linux_diskio *)malloc(head.alloc*sizeof(linux_diskio)); + } + head.length = 0; + + memset(head.indices, 0, head.alloc*sizeof(linux_diskio)); + + + parts = fopen("/proc/diskstats", "r"); + if (parts) { + char buffer[1024]; + while (fgets(buffer, sizeof(buffer), parts)) { + linux_diskio* pTemp; + if (head.length == head.alloc) { + head.alloc += DISK_INCR; + head.indices = (linux_diskio *)realloc(head.indices, head.alloc*sizeof(linux_diskio)); + } + pTemp = &head.indices[head.length]; + sscanf (buffer, "%d %d", &pTemp->major, &pTemp->minor); + if (pTemp->minor == 0) + sscanf (buffer, "%d %d %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n", + &pTemp->major, &pTemp->minor, pTemp->name, + &pTemp->rio, &pTemp->rmerge, &pTemp->rsect, &pTemp->ruse, + &pTemp->wio, &pTemp->wmerge, &pTemp->wsect, &pTemp->wuse, + &pTemp->running, &pTemp->use, &pTemp->aveq); + else + sscanf (buffer, "%d %d %s %lu %lu %lu %lu\n", + &pTemp->major, &pTemp->minor, pTemp->name, + &pTemp->rio, &pTemp->rsect, + &pTemp->wio, &pTemp->wsect); + head.length++; + } + + fclose(parts); + } + else { + + head.length = 0; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + cache_time = now; + return 0; +} + +u_char * +var_diskio(struct variable * vp, + oid * name, + size_t * length, + int exact, + size_t * var_len, + WriteMethod ** write_method) +{ + unsigned int indx; + static unsigned long long_ret; + + if (getstats() == 1) { + return NULL; + } + + if (header_simple_table(vp, name, length, exact, var_len, write_method, head.length)) + { + return NULL; + } + + indx = (unsigned int) (name[*length - 1] - 1); + + if (indx >= head.length) + return NULL; + + switch (vp->magic) { + case DISKIO_INDEX: + long_ret = indx+1; + return (u_char *) &long_ret; + case DISKIO_DEVICE: + *var_len = strlen(head.indices[indx].name); + return (u_char *) head.indices[indx].name; + case DISKIO_NREAD: + long_ret = head.indices[indx].rsect*512; + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: + long_ret = head.indices[indx].wsect*512; + return (u_char *) & long_ret; + case DISKIO_READS: + long_ret = head.indices[indx].rio; + return (u_char *) & long_ret; + case DISKIO_WRITES: + long_ret = head.indices[indx].wio; + return (u_char *) & long_ret; + + default: + snmp_log(LOG_ERR, "diskio.c: don't know how to handle %d request\n", vp->magic); + } + return NULL; +} +#endif + +#if defined(darwin) + +#define MAXDRIVES 16 +#define MAXDRIVENAME 31 + +#define kIDXBytesRead 0 +#define kIDXBytesWritten 1 +#define kIDXNumReads 2 +#define kIDXNumWrites 3 +#define kIDXLast 3 + +struct drivestats { + char name[MAXDRIVENAME + 1]; + long bsd_unit_number; + long stats[kIDXLast+1]; +}; + +static struct drivestats drivestat[MAXDRIVES]; + +static mach_port_t masterPort; + +static int num_drives; + +static int +collect_drive_stats(io_registry_entry_t driver, long *stats) +{ + CFNumberRef number; + CFDictionaryRef properties; + CFDictionaryRef statistics; + long value; + kern_return_t status; + int i; + + + + + + + for (i = 0; i < kIDXLast; i++) { + stats[i] = 0; + } + + + status = IORegistryEntryCreateCFProperties(driver, (CFMutableDictionaryRef *)&properties, + kCFAllocatorDefault, kNilOptions); + if (status != KERN_SUCCESS) { + snmp_log(LOG_ERR, "diskio: device has no properties\n"); + + return (1); + } + + + statistics = (CFDictionaryRef)CFDictionaryGetValue(properties, + CFSTR(kIOBlockStorageDriverStatisticsKey)); + if (statistics) { + + + if ((number = (CFNumberRef)CFDictionaryGetValue(statistics, + CFSTR(kIOBlockStorageDriverStatisticsBytesReadKey)))) { + CFNumberGetValue(number, kCFNumberSInt32Type, &value); + stats[kIDXBytesRead] = value; + } + + if ((number = (CFNumberRef)CFDictionaryGetValue(statistics, + CFSTR(kIOBlockStorageDriverStatisticsBytesWrittenKey)))) { + CFNumberGetValue(number, kCFNumberSInt32Type, &value); + stats[kIDXBytesWritten] = value; + } + + if ((number = (CFNumberRef)CFDictionaryGetValue(statistics, + CFSTR(kIOBlockStorageDriverStatisticsReadsKey)))) { + CFNumberGetValue(number, kCFNumberSInt32Type, &value); + stats[kIDXNumReads] = value; + } + if ((number = (CFNumberRef)CFDictionaryGetValue(statistics, + CFSTR(kIOBlockStorageDriverStatisticsWritesKey)))) { + CFNumberGetValue(number, kCFNumberSInt32Type, &value); + stats[kIDXNumWrites] = value; + } + } + + CFRelease(properties); + return (0); +} + + + + + +static int +handle_drive(io_registry_entry_t drive, struct drivestats * dstat) +{ + io_registry_entry_t parent; + CFDictionaryRef properties; + CFStringRef name; + CFNumberRef number; + kern_return_t status; + + + status = IORegistryEntryGetParentEntry(drive, kIOServicePlane, &parent); + if (status != KERN_SUCCESS) { + snmp_log(LOG_ERR, "diskio: device has no parent\n"); + + return(1); + } + + if (IOObjectConformsTo(parent, "IOBlockStorageDriver")) { + + + status = IORegistryEntryCreateCFProperties(drive, (CFMutableDictionaryRef *)&properties, + kCFAllocatorDefault, kNilOptions); + if (status != KERN_SUCCESS) { + snmp_log(LOG_ERR, "diskio: device has no properties\n"); + + return(1); + } + + + name = (CFStringRef)CFDictionaryGetValue(properties, + CFSTR(kIOBSDNameKey)); + number = (CFNumberRef)CFDictionaryGetValue(properties, + CFSTR(kIOBSDUnitKey)); + + + if (!collect_drive_stats(parent, dstat->stats)) { + + CFStringGetCString(name, dstat->name, MAXDRIVENAME, CFStringGetSystemEncoding()); + CFNumberGetValue(number, kCFNumberSInt32Type, &dstat->bsd_unit_number); + num_drives++; + } + + + CFRelease(properties); + return(0); + } + + + IOObjectRelease(parent); + return(1); +} + +static int +getstats(void) +{ + time_t now; + io_iterator_t drivelist; + io_registry_entry_t drive; + CFMutableDictionaryRef match; + kern_return_t status; + + now = time(NULL); + if (cache_time + CACHE_TIMEOUT > now) { + return 0; + } + + + match = IOServiceMatching("IOMedia"); + CFDictionaryAddValue(match, CFSTR(kIOMediaWholeKey), kCFBooleanTrue); + status = IOServiceGetMatchingServices(masterPort, match, &drivelist); + if (status != KERN_SUCCESS) { + snmp_log(LOG_ERR, "diskio: couldn't match whole IOMedia devices\n"); + + return(1); + } + + num_drives = 0; + while ((drive = IOIteratorNext(drivelist)) && (num_drives < MAXDRIVES)) { + handle_drive(drive, &drivestat[num_drives]); + IOObjectRelease(drive); + } + IOObjectRelease(drivelist); + + cache_time = now; + return (0); +} + +u_char * +var_diskio(struct variable * vp, + oid * name, + size_t * length, + int exact, size_t * var_len, WriteMethod ** write_method) +{ + static long long_ret; + unsigned int indx; + + if (getstats() == 1) { + return NULL; + } + + + if (header_simple_table + (vp, name, length, exact, var_len, write_method, num_drives)) { + return NULL; + } + + indx = (unsigned int) (name[*length - 1] - 1); + + if (indx >= num_drives) + return NULL; + + switch (vp->magic) { + case DISKIO_INDEX: + long_ret = (long) drivestat[indx].bsd_unit_number; + return (u_char *) & long_ret; + case DISKIO_DEVICE: + *var_len = strlen(drivestat[indx].name); + return (u_char *) drivestat[indx].name; + case DISKIO_NREAD: + long_ret = (signed long) drivestat[indx].stats[kIDXBytesRead]; + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: + long_ret = (signed long) drivestat[indx].stats[kIDXBytesWritten]; + return (u_char *) & long_ret; + case DISKIO_READS: + long_ret = (signed long) drivestat[indx].stats[kIDXNumReads]; + return (u_char *) & long_ret; + case DISKIO_WRITES: + long_ret = (signed long) drivestat[indx].stats[kIDXNumWrites]; + return (u_char *) & long_ret; + + default: + ERROR_MSG("diskio.c: don't know how to handle this request."); + } + return NULL; +} +#endif + + +#if defined(aix4) || defined(aix5) + + + +int +collect_disks(void) +{ + time_t now; + int i; + perfstat_id_t first; + + + now = time(NULL); + if (ps_disk != NULL && cache_time + CACHE_TIMEOUT > now) { + return 0; + } + + + i = perfstat_disk(NULL, NULL, sizeof(perfstat_disk_t), 0); + if(i <= 0) return 1; + + + if(i != ps_numdisks || ps_disk == NULL) { + if(ps_disk != NULL) free(ps_disk); + ps_numdisks = i; + ps_disk = malloc(sizeof(perfstat_disk_t) * ps_numdisks); + if(ps_disk == NULL) return 1; + } + + + strcpy(first.name, ""); + i = perfstat_disk(&first, ps_disk, sizeof(perfstat_disk_t), ps_numdisks); + if(i != ps_numdisks) return 1; + + cache_time = now; + return 0; +} + + +u_char * +var_diskio(struct variable * vp, + oid * name, + size_t * length, + int exact, size_t * var_len, WriteMethod ** write_method) +{ + static long long_ret; + unsigned int indx; + + + if (collect_disks()) + return NULL; + + if (header_simple_table + (vp, name, length, exact, var_len, write_method, ps_numdisks)) + return NULL; + + indx = (unsigned int) (name[*length - 1] - 1); + if (indx >= ps_numdisks) + return NULL; + + + switch (vp->magic) { + case DISKIO_INDEX: + long_ret = (long) indx; + return (u_char *) & long_ret; + case DISKIO_DEVICE: + *var_len = strlen(ps_disk[indx].name); + return (u_char *) ps_disk[indx].name; + case DISKIO_NREAD: + long_ret = (signed long) ps_disk[indx].rblks * ps_disk[indx].bsize; + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: + long_ret = (signed long) ps_disk[indx].wblks * ps_disk[indx].bsize; + return (u_char *) & long_ret; + case DISKIO_READS: + long_ret = (signed long) ps_disk[indx].xfers; + return (u_char *) & long_ret; + case DISKIO_WRITES: + long_ret = (signed long) 0; + return (u_char *) & long_ret; + + default: + ERROR_MSG("diskio.c: don't know how to handle this request."); + } + + + return NULL; +} +#endif diff --git a/plugins/scancode-compiledcode/tests/data/cppincludes/test6.c b/plugins/scancode-compiledcode/tests/data/cppincludes/test6.c new file mode 100644 index 00000000000..e3b09145af6 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/cppincludes/test6.c @@ -0,0 +1,4 @@ + +#include //clude +#include /*clude */ + diff --git a/plugins/scancode-dwarf/tests/data/dwarf/32.fsize.chgg_DOES_NOT_EXIST.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/32.fsize.chgg_DOES_NOT_EXIST.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/32.fsize.chgg_DOES_NOT_EXIST.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/32.fsize.chgg_DOES_NOT_EXIST.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/amd64_exec b/plugins/scancode-compiledcode/tests/data/dwarf/amd64_exec similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/amd64_exec rename to plugins/scancode-compiledcode/tests/data/dwarf/amd64_exec diff --git a/plugins/scancode-dwarf/tests/data/dwarf/amd64_exec.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/amd64_exec.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/amd64_exec.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/amd64_exec.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/amd64_exec.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/amd64_exec.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/amd64_exec.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/amd64_exec.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_exec_nosect.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_exec_nosect.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf b/plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_gentoo_elf.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_gentoo_elf.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_object b/plugins/scancode-compiledcode/tests/data/dwarf/arm_object similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_object rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_object diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_object.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_object.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_object.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_object.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_object.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_object.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_object.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_object.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_object.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_object.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_object.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_object.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_object.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/arm_object.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_object.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_object.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load b/plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/arm_scatter_load.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/arm_scatter_load.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386 b/plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386 rename to plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386 diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.darwin.i386.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.darwin.i386.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686 b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686 rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686 diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.i686.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.i686.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64 b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64 rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64 diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file.linux.x86_64.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file.linux.x86_64.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file_stripped b/plugins/scancode-compiledcode/tests/data/dwarf/file_stripped similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file_stripped rename to plugins/scancode-compiledcode/tests/data/dwarf/file_stripped diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file_stripped.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file_stripped.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file_stripped.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file_stripped.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file_stripped.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file_stripped.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file_stripped.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file_stripped.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/file_stripped.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/file_stripped.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/file_stripped.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/file_stripped.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ia32_exec b/plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ia32_exec rename to plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ia32_exec.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ia32_exec.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ia32_exec.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ia32_exec.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ia32_exec.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ia32_exec.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ia32_exec.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ia64_exec b/plugins/scancode-compiledcode/tests/data/dwarf/ia64_exec similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ia64_exec rename to plugins/scancode-compiledcode/tests/data/dwarf/ia64_exec diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ia64_exec.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ia64_exec.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ia64_exec.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ia64_exec.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o b/plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o rename to plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o diff --git a/plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/libelf-begin.o.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/libelf-begin.o.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/shash.i686 b/plugins/scancode-compiledcode/tests/data/dwarf/shash.i686 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/shash.i686 rename to plugins/scancode-compiledcode/tests/data/dwarf/shash.i686 diff --git a/plugins/scancode-dwarf/tests/data/dwarf/shash.i686.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/shash.i686.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/shash.i686.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/shash.i686.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/shash.i686.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/shash.i686.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/shash.i686.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/shash.i686.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/shash.i686.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/shash.x86_64 b/plugins/scancode-compiledcode/tests/data/dwarf/shash.x86_64 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/shash.x86_64 rename to plugins/scancode-compiledcode/tests/data/dwarf/shash.x86_64 diff --git a/plugins/scancode-dwarf/tests/data/dwarf/shash.x86_64.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/shash.x86_64.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/shash.x86_64.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/shash.x86_64.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686 b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686 rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686 diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.i686.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.i686.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64 b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64 rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64 diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64.dwarf.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64.dwarf.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64.dwarf.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64.dwarf.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64.expected_elf_symbols b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64.expected_elf_symbols similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64.expected_elf_symbols rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64.expected_elf_symbols diff --git a/plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64_scan.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64_scan.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf/ssdeep.x86_64_scan.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf/ssdeep.x86_64_scan.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/analyze.so.debug b/plugins/scancode-compiledcode/tests/data/dwarf2/analyze.so.debug similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/analyze.so.debug rename to plugins/scancode-compiledcode/tests/data/dwarf2/analyze.so.debug diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/analyze.so.debug.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/analyze.so.debug.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/analyze.so.debug.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/analyze.so.debug.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/analyze.so.debug.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/analyze.so.debug.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/analyze.so.debug.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/analyze.so.debug.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/autotalent.so.debug b/plugins/scancode-compiledcode/tests/data/dwarf2/autotalent.so.debug similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/autotalent.so.debug rename to plugins/scancode-compiledcode/tests/data/dwarf2/autotalent.so.debug diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/autotalent.so.debug.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/autotalent.so.debug.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/autotalent.so.debug.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/autotalent.so.debug.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/autotalent.so.debug.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/autotalent.so.debug.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/autotalent.so.debug.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/autotalent.so.debug.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/labrea.debug b/plugins/scancode-compiledcode/tests/data/dwarf2/labrea.debug similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/labrea.debug rename to plugins/scancode-compiledcode/tests/data/dwarf2/labrea.debug diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/labrea.debug.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/labrea.debug.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/labrea.debug.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/labrea.debug.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/labrea.debug.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/labrea.debug.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/labrea.debug.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/labrea.debug.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/latex2emf.debug b/plugins/scancode-compiledcode/tests/data/dwarf2/latex2emf.debug similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/latex2emf.debug rename to plugins/scancode-compiledcode/tests/data/dwarf2/latex2emf.debug diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/latex2emf.debug.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/latex2emf.debug.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/latex2emf.debug.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/latex2emf.debug.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/latex2emf.debug.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/latex2emf.debug.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/latex2emf.debug.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/latex2emf.debug.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-extra.so.26.22.4 b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-extra.so.26.22.4 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-extra.so.26.22.4 rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-extra.so.26.22.4 diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-extra.so.26.22.4.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-openssl.so.27.0.0 b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-openssl.so.27.0.0 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-openssl.so.27.0.0 rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-openssl.so.27.0.0 diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls-openssl.so.27.0.0.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls.so.26.22.4 b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls.so.26.22.4 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls.so.26.22.4 rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls.so.26.22.4 diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutls.so.26.22.4.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutlsxx.so.27.0.0 b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutlsxx.so.27.0.0 similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutlsxx.so.27.0.0 rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutlsxx.so.27.0.0 diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/libgnutlsxx.so.27.0.0.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/pam_vbox.so.debug b/plugins/scancode-compiledcode/tests/data/dwarf2/pam_vbox.so.debug similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/pam_vbox.so.debug rename to plugins/scancode-compiledcode/tests/data/dwarf2/pam_vbox.so.debug diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/pam_vbox.so.debug.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/pam_vbox.so.debug.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/pam_vbox.so.debug.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/pam_vbox.so.debug.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/dwarf2/pam_vbox.so.debug.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/dwarf2/pam_vbox.so.debug.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/dwarf2/pam_vbox.so.debug.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/dwarf2/pam_vbox.so.debug.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/elf-corrupted/corrupt.o b/plugins/scancode-compiledcode/tests/data/elf-corrupted/corrupt.o similarity index 100% rename from plugins/scancode-dwarf/tests/data/elf-corrupted/corrupt.o rename to plugins/scancode-compiledcode/tests/data/elf-corrupted/corrupt.o diff --git a/plugins/scancode-dwarf/tests/data/elf-corrupted/corrupt.o.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/elf-corrupted/corrupt.o.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/elf-corrupted/corrupt.o.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/elf-corrupted/corrupt.o.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/elf-corrupted/corrupt.o.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/elf-corrupted/corrupt.o.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/elf-corrupted/corrupt.o.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/elf-corrupted/corrupt.o.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable b/plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable similarity index 100% rename from plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable rename to plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable diff --git a/plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable.win.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable.win.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/elf-corrupted/malformed_stringtable.win.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/elf-corrupted/malformed_stringtable.win.dwarf2.expected.json diff --git a/plugins/scancode-lkmclue/tests/data/elf/corrupt.o b/plugins/scancode-compiledcode/tests/data/elf/corrupt.o similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/corrupt.o rename to plugins/scancode-compiledcode/tests/data/elf/corrupt.o diff --git a/plugins/scancode-lkmclue/tests/data/elf/expected.json b/plugins/scancode-compiledcode/tests/data/elf/expected.json similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/expected.json rename to plugins/scancode-compiledcode/tests/data/elf/expected.json diff --git a/plugins/scancode-lkmclue/tests/data/elf/malformed_stringtable b/plugins/scancode-compiledcode/tests/data/elf/malformed_stringtable similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/malformed_stringtable rename to plugins/scancode-compiledcode/tests/data/elf/malformed_stringtable diff --git a/plugins/scancode-lkmclue/tests/data/elf/non_elf b/plugins/scancode-compiledcode/tests/data/elf/non_elf similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/non_elf rename to plugins/scancode-compiledcode/tests/data/elf/non_elf diff --git a/plugins/scancode-lkmclue/tests/data/elf/shash.i686 b/plugins/scancode-compiledcode/tests/data/elf/shash.i686 similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/shash.i686 rename to plugins/scancode-compiledcode/tests/data/elf/shash.i686 diff --git a/plugins/scancode-lkmclue/tests/data/elf/ssdeep.i686 b/plugins/scancode-compiledcode/tests/data/elf/ssdeep.i686 similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/ssdeep.i686 rename to plugins/scancode-compiledcode/tests/data/elf/ssdeep.i686 diff --git a/plugins/scancode-lkmclue/tests/data/elf/ssdeep.x86_64 b/plugins/scancode-compiledcode/tests/data/elf/ssdeep.x86_64 similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/ssdeep.x86_64 rename to plugins/scancode-compiledcode/tests/data/elf/ssdeep.x86_64 diff --git a/plugins/scancode-lkmclue/tests/data/elf/strip_stripped b/plugins/scancode-compiledcode/tests/data/elf/strip_stripped similarity index 100% rename from plugins/scancode-lkmclue/tests/data/elf/strip_stripped rename to plugins/scancode-compiledcode/tests/data/elf/strip_stripped diff --git a/plugins/scancode-compiledcode/tests/data/generatedcode/expected.json b/plugins/scancode-compiledcode/tests/data/generatedcode/expected.json new file mode 100644 index 00000000000..848bb361e76 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/generatedcode/expected.json @@ -0,0 +1,42 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--generatedcode": true, + "--json": "" + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 2 + } + } + ], + "files": [ + { + "path": "input", + "type": "directory", + "generatedcode": [], + "scan_errors": [] + }, + { + "path": "input/configure", + "type": "file", + "generatedcode": [ + "# Generated by GNU Autoconf 2.64 for Apache CouchDB 1.0.1." + ], + "scan_errors": [] + }, + { + "path": "input/generated_1.java", + "type": "file", + "generatedcode": [ + "// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation" + ], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/plugins/scancode-compiledcode/tests/data/generatedcode/input/configure b/plugins/scancode-compiledcode/tests/data/generatedcode/input/configure new file mode 100644 index 00000000000..8d47467fe21 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/generatedcode/input/configure @@ -0,0 +1,14679 @@ +#! /bin/sh +# From configure.ac 1.0.1. +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.64 for Apache CouchDB 1.0.1. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software +# Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='Apache CouchDB' +PACKAGE_TARNAME='apache-couchdb' +PACKAGE_VERSION='1.0.1' +PACKAGE_STRING='Apache CouchDB 1.0.1' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="CHANGES" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +abs_top_builddir +abs_top_srcdir +localerlanglibdir +locallibbindir +localstaterundir +localstatelogdir +localstatelibdir +locallibdir +localdocdir +localdatadir +localconfdir +bug_uri +version_release +version_stage +version_revision +version_minor +version_major +version +package_name +package_tarname +package_identifier +package_author_address +package_author_name +HELP2MAN_FALSE +HELP2MAN_TRUE +LAUNCHD_FALSE +LAUNCHD_TRUE +INIT_FALSE +INIT_TRUE +launchddir +initdir +HELP2MAN_EXECUTABLE +ERLC +ERL +CURL_LDFLAGS +CURL_LIBS +CURL_CFLAGS +CURL_CONFIG +ICU_LOCAL_BIN +ICU_LOCAL_LDFLAGS +ICU_LOCAL_CFLAGS +ICU_LIBS +ICU_CXXFLAGS +ICU_CFLAGS +ICU_CONFIG +JSLIB +msvc_redist_name +msvc_redist_dir +INNO_COMPILER_EXECUTABLE +openssl_bin_dir +JS_LIB_BINARY +JS_LIB_BASE +WINDOWS_FALSE +WINDOWS_TRUE +FLAGS +ERLC_FLAGS +JS_LIB_DIR +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +lt_ECHO +RANLIB +AR +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +with_erlang +with_js_include +with_js_lib +with_openssl_bin_dir +with_msvc_redist_dir +with_win32_icu_binaries +with_win32_curl +enable_init +enable_launchd +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +ERLC_FLAGS +FLAGS +ERL +ERLC +HELP2MAN_EXECUTABLE' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures Apache CouchDB 1.0.1 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/apache-couchdb] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of Apache CouchDB 1.0.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=no] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-init don't install init script where applicable + --disable-launchd don't install launchd configuration where applicable + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-erlang=PATH set PATH to the Erlang include directory + --with-js-include=PATH set PATH to the SpiderMonkey include directory + --with-js-lib=PATH set PATH to the SpiderMonkey library directory + --with-openssl-bin-dir=PATH + path to the open ssl binaries for distribution on + Windows + --with-msvc-redist-dir=PATH + path to the msvc redistributables for the Windows + platform + --with-win32-icu-binaries=PATH + set PATH to the Win32 native ICU binaries directory + --with-win32-curl=PATH set PATH to the Win32 native curl directory + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + ERLC_FLAGS general flags to prepend to ERLC_FLAGS + FLAGS general flags to prepend to LDFLAGS and CPPFLAGS + ERL path to the `erl' executable + ERLC path to the `erlc' executable + HELP2MAN_EXECUTABLE + path to the `help2man' program + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +Apache CouchDB configure 1.0.1 +generated by GNU Autoconf 2.64 + +Copyright (C) 2009 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + return $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by Apache CouchDB $as_me 1.0.1, which was +generated by GNU Autoconf 2.64. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + +ac_aux_dir= +for ac_dir in build-aux "$srcdir"/build-aux; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +ac_config_headers="$ac_config_headers config.h" + + +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='apache-couchdb' + VERSION='1.0.1' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + rm -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then : + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +fi +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = x""yes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; 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 +else + enable_shared=yes +fi + + + + + + + + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; 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 +else + enable_static=no +fi + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + rm -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.6' +macro_revision='1.3012' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:5591: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:5594: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:5597: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 6802 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; 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 +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8004: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8008: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8343: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8347: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8448: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8452: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8503: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8507: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10870 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10966 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } + +original_LIBS="$LIBS" +LIBS="-lpthread $original_LIBS" + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +pthread_create((void *)0, (void *)0, (void *)0, (void *)0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + pthread=yes +else + pthread=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +if test x${pthread} = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + LIBS="$original_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Check whether --with-erlang was given. +if test "${with_erlang+set}" = set; then : + withval=$with_erlang; + ERLANG_FLAGS="-I$withval" + +else + + ERLANG_FLAGS="-I${libdir}/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/lib/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/usr/local/lib/erlang/usr/include" + ERLANG_FLAGS="$ERLANG_FLAGS -I/opt/local/lib/erlang/usr/include" + +fi + + + +# Check whether --with-js-include was given. +if test "${with_js_include+set}" = set; then : + withval=$with_js_include; + JS_INCLUDE="$withval" + JS_FLAGS="-I$JS_INCLUDE" + +else + + JS_FLAGS="-I/usr/include" + JS_FLAGS="$JS_FLAGS -I/usr/include/js" + JS_FLAGS="$JS_FLAGS -I/usr/include/mozjs" + JS_FLAGS="$JS_FLAGS -I/usr/local/include" + JS_FLAGS="$JS_FLAGS -I/opt/local/include" + JS_FLAGS="$JS_FLAGS -I/usr/local/include/js" + JS_FLAGS="$JS_FLAGS -I/opt/local/include/js" + +fi + + + +# Check whether --with-js-lib was given. +if test "${with_js_lib+set}" = set; then : + withval=$with_js_lib; + JS_LIB_DIR=$withval + JS_LIB_FLAGS="-L$withval" + +else + + JS_LIB_DIR= + +fi + + + + + + +LIB_FLAGS="$JS_LIB_FLAGS -L/usr/local/lib -L/opt/local/lib" +LIBS="$LIB_FLAGS $LIBS" + +case "$(uname -s)" in + CYGWIN*) + FLAGS="$LIB_FLAGS $ERLANG_FLAGS $JS_FLAGS -DXP_WIN $FLAGS" + CPPFLAGS="$FLAGS $CPPFLAGS" + LDFLAGS="$FLAGS $LDFLAGS" + IS_WINDOWS="TRUE" + # The erlang cc.sh/ld.sh scripts will convert a -O option + # into the same optimization flags erlang itself uses. + CFLAGS="-O2" + LTCFLAGS="$CFLAGS" + ;; + *) + # XP_UNIX required for jsapi.h and has been tested to work on Linux and Darwin. + FLAGS="$LIB_FLAGS $ERLANG_FLAGS $JS_FLAGS -DXP_UNIX $FLAGS" + CPPFLAGS="$FLAGS $CPPFLAGS" + # manually linking libm is requred for FreeBSD 7.0 + LDFLAGS="$FLAGS -lm $LDFLAGS" + ;; +esac + + if test x$IS_WINDOWS = xTRUE; then + WINDOWS_TRUE= + WINDOWS_FALSE='#' +else + WINDOWS_TRUE='#' + WINDOWS_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JS_NewContext in -lmozjs" >&5 +$as_echo_n "checking for JS_NewContext in -lmozjs... " >&6; } +if test "${ac_cv_lib_mozjs_JS_NewContext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmozjs $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char JS_NewContext (); +int +main () +{ +return JS_NewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mozjs_JS_NewContext=yes +else + ac_cv_lib_mozjs_JS_NewContext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mozjs_JS_NewContext" >&5 +$as_echo "$ac_cv_lib_mozjs_JS_NewContext" >&6; } +if test "x$ac_cv_lib_mozjs_JS_NewContext" = x""yes; then : + JS_LIB_BASE=mozjs +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JS_NewContext in -ljs" >&5 +$as_echo_n "checking for JS_NewContext in -ljs... " >&6; } +if test "${ac_cv_lib_js_JS_NewContext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljs $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char JS_NewContext (); +int +main () +{ +return JS_NewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_js_JS_NewContext=yes +else + ac_cv_lib_js_JS_NewContext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_js_JS_NewContext" >&5 +$as_echo "$ac_cv_lib_js_JS_NewContext" >&6; } +if test "x$ac_cv_lib_js_JS_NewContext" = x""yes; then : + JS_LIB_BASE=js +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JS_NewContext in -ljs3250" >&5 +$as_echo_n "checking for JS_NewContext in -ljs3250... " >&6; } +if test "${ac_cv_lib_js3250_JS_NewContext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljs3250 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char JS_NewContext (); +int +main () +{ +return JS_NewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_js3250_JS_NewContext=yes +else + ac_cv_lib_js3250_JS_NewContext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_js3250_JS_NewContext" >&5 +$as_echo "$ac_cv_lib_js3250_JS_NewContext" >&6; } +if test "x$ac_cv_lib_js3250_JS_NewContext" = x""yes; then : + JS_LIB_BASE=js3250 +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JS_NewContext in -ljs32" >&5 +$as_echo_n "checking for JS_NewContext in -ljs32... " >&6; } +if test "${ac_cv_lib_js32_JS_NewContext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljs32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char JS_NewContext (); +int +main () +{ +return JS_NewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_js32_JS_NewContext=yes +else + ac_cv_lib_js32_JS_NewContext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_js32_JS_NewContext" >&5 +$as_echo "$ac_cv_lib_js32_JS_NewContext" >&6; } +if test "x$ac_cv_lib_js32_JS_NewContext" = x""yes; then : + JS_LIB_BASE=js32 +else + + as_fn_error "Could not find the js library. + +Is the Mozilla SpiderMonkey library installed?" "$LINENO" 5 +fi + +fi + +fi + +fi + + + + +if test x${IS_WINDOWS} = xTRUE; then + if test -f "$JS_LIB_DIR/$JS_LIB_BASE.dll"; then + # seamonkey 1.7- build layout on Windows + JS_LIB_BINARY="$JS_LIB_DIR/$JS_LIB_BASE.dll" + else + # seamonkey 1.8+ build layout on Windows + if test -f "$JS_LIB_DIR/../bin/$JS_LIB_BASE.dll"; then + JS_LIB_BINARY="$JS_LIB_DIR/../bin/$JS_LIB_BASE.dll" + else + as_fn_error "Could not find $JS_LIB_BASE.dll." "$LINENO" 5 + fi + fi + + + # On windows we need to know the path to the openssl binaries. + +# Check whether --with-openssl-bin-dir was given. +if test "${with_openssl_bin_dir+set}" = set; then : + withval=$with_openssl_bin_dir; + openssl_bin_dir=`cygpath -m "$withval"` + + +fi + + + # Windows uses Inno setup - look for its compiler. + # Extract the first word of "iscc", so it can be a program name with args. +set dummy iscc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INNO_COMPILER_EXECUTABLE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INNO_COMPILER_EXECUTABLE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INNO_COMPILER_EXECUTABLE="$INNO_COMPILER_EXECUTABLE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INNO_COMPILER_EXECUTABLE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INNO_COMPILER_EXECUTABLE=$ac_cv_path_INNO_COMPILER_EXECUTABLE +if test -n "$INNO_COMPILER_EXECUTABLE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INNO_COMPILER_EXECUTABLE" >&5 +$as_echo "$INNO_COMPILER_EXECUTABLE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x${INNO_COMPILER_EXECUTABLE} = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You will be unable to build the Windows installer." >&5 +$as_echo "$as_me: WARNING: You will be unable to build the Windows installer." >&2;} + fi + + # We need the msvc redistributables for this platform too + # (in theory we could just install the assembly locally - but + # there are at least 4 directories with binaries, meaning 4 copies; + # so using the redist .exe means it ends up installed globally...) + +# Check whether --with-msvc-redist-dir was given. +if test "${with_msvc_redist_dir+set}" = set; then : + withval=$with_msvc_redist_dir; + msvc_redist_dir=`cygpath -m "$withval"` + msvc_redist_name="vcredist_x86.exe" + + + +fi + + if test ! -f ${msvc_redist_dir}/${msvc_redist_name}; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The MSVC redistributable seems to be missing; expect the installer to fail." >&5 +$as_echo "$as_me: WARNING: The MSVC redistributable seems to be missing; expect the installer to fail." >&2;} + fi +fi + +JSLIB=-l$JS_LIB_BASE + +ac_fn_c_check_header_mongrel "$LINENO" "jsapi.h" "ac_cv_header_jsapi_h" "$ac_includes_default" +if test "x$ac_cv_header_jsapi_h" = x""yes; then : + +else + + ac_fn_c_check_header_mongrel "$LINENO" "js/jsapi.h" "ac_cv_header_js_jsapi_h" "$ac_includes_default" +if test "x$ac_cv_header_js_jsapi_h" = x""yes; then : + + CPPFLAGS="$CPPFLAGS -I$JS_INCLUDE/js" + +else + + as_fn_error "Could not find the jsapi header. + +Are the Mozilla SpiderMonkey headers installed?" "$LINENO" 5 + +fi + + +fi + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +OLD_CFLAGS="$CFLAGS" +CFLAGS="-Werror-implicit-function-declaration" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +JS_SetOperationCallback(0, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define USE_JS_SETOPCB /**/" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$OLD_CFLAGS" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Check whether --with-win32-icu-binaries was given. +if test "${with_win32_icu_binaries+set}" = set; then : + withval=$with_win32_icu_binaries; + ICU_CONFIG="" # supposed to be a command to query options... + ICU_LOCAL_CFLAGS="-I$withval/include" + ICU_LOCAL_LDFLAGS="-L$withval/lib" + ICU_LOCAL_BIN=$withval/bin + +else + + + succeeded=no + + if test -z "$ICU_CONFIG"; then + # Extract the first word of "icu-config", so it can be a program name with args. +set dummy icu-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ICU_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ICU_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ICU_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_ICU_CONFIG" && ac_cv_path_ICU_CONFIG="no" + ;; +esac +fi +ICU_CONFIG=$ac_cv_path_ICU_CONFIG +if test -n "$ICU_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_CONFIG" >&5 +$as_echo "$ICU_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + + if test "$ICU_CONFIG" = "no" ; then + echo "*** The icu-config script could not be found. Make sure it is" + echo "*** in your path, and that taglib is properly installed." + echo "*** Or see http://ibm.com/software/globalization/icu/" + else + ICU_VERSION=`$ICU_CONFIG --version` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICU >= 3.4.1" >&5 +$as_echo_n "checking for ICU >= 3.4.1... " >&6; } + VERSION_CHECK=`expr $ICU_VERSION \>\= 3.4.1` + if test "$VERSION_CHECK" = "1" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + succeeded=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU_CFLAGS" >&5 +$as_echo_n "checking ICU_CFLAGS... " >&6; } + ICU_CFLAGS=`$ICU_CONFIG --cflags` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_CFLAGS" >&5 +$as_echo "$ICU_CFLAGS" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU_CXXFLAGS" >&5 +$as_echo_n "checking ICU_CXXFLAGS... " >&6; } + ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_CXXFLAGS" >&5 +$as_echo "$ICU_CXXFLAGS" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU_LIBS" >&5 +$as_echo_n "checking ICU_LIBS... " >&6; } + ICU_LIBS=`$ICU_CONFIG --ldflags` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_LIBS" >&5 +$as_echo "$ICU_LIBS" >&6; } + else + ICU_CFLAGS="" + ICU_CXXFLAGS="" + ICU_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + echo "can't find ICU >= 3.4.1" + fi + + + + + fi + + if test $succeeded = yes; then + : + else + as_fn_error "Library requirements (ICU) not met." "$LINENO" 5 + fi + + ICU_LOCAL_CFLAGS=`$ICU_CONFIG --cppflags-searchpath` + ICU_LOCAL_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath` + ICU_LOCAL_BIN= + +fi + + + + + + + + +# Check whether --with-win32-curl was given. +if test "${with_win32_curl+set}" = set; then : + withval=$with_win32_curl; + # default build on windows is a static lib, and that's what we want too + CURL_CFLAGS="-I$withval/include -DCURL_STATICLIB" + CURL_LIBS="$withval/lib/libcurl" + CURL_LDFLAGS="-l$CURL_LIBS -lWs2_32 -lkernel32 -luser32 -ladvapi32 -lWldap32" + +else + + + succeeded=no + + if test -z "$CURL_CONFIG"; then + # Extract the first word of "curl-config", so it can be a program name with args. +set dummy curl-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CURL_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $CURL_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_CURL_CONFIG="$CURL_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CURL_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CURL_CONFIG" && ac_cv_path_CURL_CONFIG="no" + ;; +esac +fi +CURL_CONFIG=$ac_cv_path_CURL_CONFIG +if test -n "$CURL_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL_CONFIG" >&5 +$as_echo "$CURL_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + + if test "$CURL_CONFIG" = "no" ; then + echo "*** The curl-config script could not be found. Make sure it is" + echo "*** in your path, and that curl is properly installed." + echo "*** Or see http://curl.haxx.se/" + else + CURL_VERSION=`$CURL_CONFIG --version | cut -d" " -f2` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl >= 7.18.0" >&5 +$as_echo_n "checking for curl >= 7.18.0... " >&6; } + VERSION_CHECK=`expr $CURL_VERSION \>\= 7.18.0` + if test "$VERSION_CHECK" = "1" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + succeeded=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking CURL_CFLAGS" >&5 +$as_echo_n "checking CURL_CFLAGS... " >&6; } + CURL_CFLAGS=`$CURL_CONFIG --cflags` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL_CFLAGS" >&5 +$as_echo "$CURL_CFLAGS" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking CURL_LIBS" >&5 +$as_echo_n "checking CURL_LIBS... " >&6; } + CURL_LIBS=`$CURL_CONFIG --libs` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL_LIBS" >&5 +$as_echo "$CURL_LIBS" >&6; } + else + CURL_CFLAGS="" + CURL_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + echo "can't find curl >= 7.18.0" + fi + + + + fi + + if test $succeeded = yes; then + : + else + as_fn_error "Library requirements (curl) not met." "$LINENO" 5 + fi + + CURL_LDFLAGS=-lcurl + +fi + + + + + + +case "$(uname -s)" in + Linux) + LIBS="$LIBS -lcrypt" + CPPFLAGS="-D_XOPEN_SOURCE $CPPFLAGS" + ;; + FreeBSD) + LIBS="$LIBS -lcrypt" + ;; + OpenBSD) + LIBS="$LIBS -lcrypto" + ;; +esac + +# Extract the first word of "erl", so it can be a program name with args. +set dummy erl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ERL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_ERL="$ERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ERL=$ac_cv_path_ERL +if test -n "$ERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ERL" >&5 +$as_echo "$ERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +if test x${ERL} = x; then + as_fn_error "Could not find the \`erl' executable. Is Erlang installed?" "$LINENO" 5 +fi + +erlang_version_error="The installed Erlang version is less than 5.6.5 (R12B05)." + +version="`${ERL} -version 2>&1 | ${SED} "s/[^0-9]/ /g"`" + +if test `echo $version | ${AWK} "{print \\$1}"` -lt 5; then + as_fn_error "$erlang_version_error" "$LINENO" 5 +fi + +if test `echo $version | ${AWK} "{print \\$2}"` -lt 6; then + as_fn_error "$erlang_version_error" "$LINENO" 5 +fi + +if test `echo $version | ${AWK} "{print \\$2}"` -eq 6; then + if test `echo $version | ${AWK} "{print \\$3}"` -lt 5; then + as_fn_error "$erlang_version_error" "$LINENO" 5 + fi +fi + +# Extract the first word of "erlc", so it can be a program name with args. +set dummy erlc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ERLC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ERLC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ERLC="$ERLC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ERLC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ERLC=$ac_cv_path_ERLC +if test -n "$ERLC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ERLC" >&5 +$as_echo "$ERLC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +if test x${ERLC} = x; then + as_fn_error "Could not find the \`erlc' executable. Is Erlang installed?" "$LINENO" 5 +fi + +ac_fn_c_check_header_mongrel "$LINENO" "erl_driver.h" "ac_cv_header_erl_driver_h" "$ac_includes_default" +if test "x$ac_cv_header_erl_driver_h" = x""yes; then : + +else + + as_fn_error "Could not find the \`erl_driver.h' header. + +Are the Erlang headers installed? Use the \`--with-erlang' option to specify the +path to the Erlang include directory." "$LINENO" 5 +fi + + + +# Extract the first word of "help2man", so it can be a program name with args. +set dummy help2man; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_HELP2MAN_EXECUTABLE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $HELP2MAN_EXECUTABLE in + [\\/]* | ?:[\\/]*) + ac_cv_path_HELP2MAN_EXECUTABLE="$HELP2MAN_EXECUTABLE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_HELP2MAN_EXECUTABLE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +HELP2MAN_EXECUTABLE=$ac_cv_path_HELP2MAN_EXECUTABLE +if test -n "$HELP2MAN_EXECUTABLE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HELP2MAN_EXECUTABLE" >&5 +$as_echo "$HELP2MAN_EXECUTABLE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test x${HELP2MAN_EXECUTABLE} = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You will be unable to regenerate any man pages." >&5 +$as_echo "$as_me: WARNING: You will be unable to regenerate any man pages." >&2;} +fi + +use_init=yes +use_launchd=yes + +# Check whether --enable-init was given. +if test "${enable_init+set}" = set; then : + enableval=$enable_init; + use_init=$enableval + +fi + + +# Check whether --enable-launchd was given. +if test "${enable_launchd+set}" = set; then : + enableval=$enable_launchd; + use_launchd=$enableval + +fi + + +init_enabled=false +launchd_enabled=false + +if test "$use_init" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of init directory" >&5 +$as_echo_n "checking location of init directory... " >&6; } + if test -d /etc/rc.d; then + init_enabled=true + initdir='${sysconfdir}/rc.d' + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${initdir}" >&5 +$as_echo "${initdir}" >&6; } + else + if test -d /etc/init.d; then + init_enabled=true + initdir='${sysconfdir}/init.d' + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${initdir}" >&5 +$as_echo "${initdir}" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + fi + fi +fi + +if test "$use_launchd" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of launchd directory" >&5 +$as_echo_n "checking location of launchd directory... " >&6; } + if test -d /Library/LaunchDaemons; then + init_enabled=false + launchd_enabled=true + launchddir='${prefix}/Library/LaunchDaemons' + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${launchddir}" >&5 +$as_echo "${launchddir}" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + fi +fi + + + + + +if test -n "$HELP2MAN_EXECUTABLE"; then + help2man_enabled=true +else + if test -f "$srcdir/bin/couchdb.1" -a -f "$srcdir/bin/couchjs.1"; then + help2man_enabled=true + else + help2man_enabled=false + fi +fi + + if test x${init_enabled} = xtrue; then + INIT_TRUE= + INIT_FALSE='#' +else + INIT_TRUE='#' + INIT_FALSE= +fi + + if test x${launchd_enabled} = xtrue; then + LAUNCHD_TRUE= + LAUNCHD_FALSE='#' +else + LAUNCHD_TRUE='#' + LAUNCHD_FALSE= +fi + + if test x${help2man_enabled} = xtrue; then + HELP2MAN_TRUE= + HELP2MAN_FALSE='#' +else + HELP2MAN_TRUE='#' + HELP2MAN_FALSE= +fi + + +package_author_name="The Apache Software Foundation" + +package_author_address="dev@couchdb.apache.org" + +package_identifier="couchdb" + +package_tarname="apache-couchdb" + +package_name="Apache CouchDB" + + +version="1.0.1" + +version_major="1" + +version_minor="0" + +version_revision="1" + +version_stage="" + +version_release="" + + +bug_uri="https://issues.apache.org/jira/browse/COUCHDB" + + +localconfdir=${sysconfdir}/${package_identifier} + +localdatadir=${datadir}/${package_identifier} + +localdocdir=${datadir}/doc/${package_identifier} + +locallibdir=${libdir}/${package_identifier} + +localstatelibdir=${localstatedir}/lib/${package_identifier} + +localstatelogdir=${localstatedir}/log/${package_identifier} + +localstaterundir=${localstatedir}/run/${package_identifier} + + +# On Windows we install directly into our erlang distribution. +if test x${IS_WINDOWS} = xTRUE; then + locallibbindir=${prefix}/bin + + localerlanglibdir=${libdir} + +else + locallibbindir=${locallibdir}/bin + + localerlanglibdir=${locallibdir}/erlang/lib + +fi + +# fix for older autotools that don't define "abs_top_YYY" by default + + + + + +ac_config_files="$ac_config_files Makefile" + +ac_config_files="$ac_config_files bin/couchjs.tpl" + +ac_config_files="$ac_config_files bin/couchdb.tpl" + +ac_config_files="$ac_config_files bin/couchdb.bat.tpl" + +ac_config_files="$ac_config_files bin/Makefile" + +ac_config_files="$ac_config_files etc/couchdb/Makefile" + +ac_config_files="$ac_config_files etc/couchdb/default.ini.tpl" + +ac_config_files="$ac_config_files etc/default/Makefile" + +ac_config_files="$ac_config_files etc/init/couchdb.tpl" + +ac_config_files="$ac_config_files etc/init/Makefile" + +ac_config_files="$ac_config_files etc/launchd/org.apache.couchdb.plist.tpl" + +ac_config_files="$ac_config_files etc/launchd/Makefile" + +ac_config_files="$ac_config_files etc/logrotate.d/couchdb.tpl" + +ac_config_files="$ac_config_files etc/logrotate.d/Makefile" + +ac_config_files="$ac_config_files etc/windows/Makefile" + +ac_config_files="$ac_config_files etc/Makefile" + +ac_config_files="$ac_config_files share/Makefile" + +ac_config_files="$ac_config_files src/Makefile" + +ac_config_files="$ac_config_files src/couchdb/couch.app.tpl" + +ac_config_files="$ac_config_files src/couchdb/Makefile" + +ac_config_files="$ac_config_files src/couchdb/priv/Makefile" + +ac_config_files="$ac_config_files src/erlang-oauth/Makefile" + +ac_config_files="$ac_config_files src/etap/Makefile" + +ac_config_files="$ac_config_files src/ibrowse/Makefile" + +ac_config_files="$ac_config_files src/mochiweb/Makefile" + +ac_config_files="$ac_config_files test/Makefile" + +ac_config_files="$ac_config_files test/bench/Makefile" + +ac_config_files="$ac_config_files test/etap/Makefile" + +ac_config_files="$ac_config_files test/etap/test_util.erl" + +ac_config_files="$ac_config_files test/javascript/Makefile" + +ac_config_files="$ac_config_files test/view_server/Makefile" + +ac_config_files="$ac_config_files utils/Makefile" + +ac_config_files="$ac_config_files var/Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WINDOWS_TRUE}" && test -z "${WINDOWS_FALSE}"; then + as_fn_error "conditional \"WINDOWS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${INIT_TRUE}" && test -z "${INIT_FALSE}"; then + as_fn_error "conditional \"INIT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LAUNCHD_TRUE}" && test -z "${LAUNCHD_FALSE}"; then + as_fn_error "conditional \"LAUNCHD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HELP2MAN_TRUE}" && test -z "${HELP2MAN_FALSE}"; then + as_fn_error "conditional \"HELP2MAN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by Apache CouchDB $as_me 1.0.1, which was +generated by GNU Autoconf 2.64. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +Apache CouchDB config.status 1.0.1 +configured by $0, generated by GNU Autoconf 2.64, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "bin/couchjs.tpl") CONFIG_FILES="$CONFIG_FILES bin/couchjs.tpl" ;; + "bin/couchdb.tpl") CONFIG_FILES="$CONFIG_FILES bin/couchdb.tpl" ;; + "bin/couchdb.bat.tpl") CONFIG_FILES="$CONFIG_FILES bin/couchdb.bat.tpl" ;; + "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; + "etc/couchdb/Makefile") CONFIG_FILES="$CONFIG_FILES etc/couchdb/Makefile" ;; + "etc/couchdb/default.ini.tpl") CONFIG_FILES="$CONFIG_FILES etc/couchdb/default.ini.tpl" ;; + "etc/default/Makefile") CONFIG_FILES="$CONFIG_FILES etc/default/Makefile" ;; + "etc/init/couchdb.tpl") CONFIG_FILES="$CONFIG_FILES etc/init/couchdb.tpl" ;; + "etc/init/Makefile") CONFIG_FILES="$CONFIG_FILES etc/init/Makefile" ;; + "etc/launchd/org.apache.couchdb.plist.tpl") CONFIG_FILES="$CONFIG_FILES etc/launchd/org.apache.couchdb.plist.tpl" ;; + "etc/launchd/Makefile") CONFIG_FILES="$CONFIG_FILES etc/launchd/Makefile" ;; + "etc/logrotate.d/couchdb.tpl") CONFIG_FILES="$CONFIG_FILES etc/logrotate.d/couchdb.tpl" ;; + "etc/logrotate.d/Makefile") CONFIG_FILES="$CONFIG_FILES etc/logrotate.d/Makefile" ;; + "etc/windows/Makefile") CONFIG_FILES="$CONFIG_FILES etc/windows/Makefile" ;; + "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; + "share/Makefile") CONFIG_FILES="$CONFIG_FILES share/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/couchdb/couch.app.tpl") CONFIG_FILES="$CONFIG_FILES src/couchdb/couch.app.tpl" ;; + "src/couchdb/Makefile") CONFIG_FILES="$CONFIG_FILES src/couchdb/Makefile" ;; + "src/couchdb/priv/Makefile") CONFIG_FILES="$CONFIG_FILES src/couchdb/priv/Makefile" ;; + "src/erlang-oauth/Makefile") CONFIG_FILES="$CONFIG_FILES src/erlang-oauth/Makefile" ;; + "src/etap/Makefile") CONFIG_FILES="$CONFIG_FILES src/etap/Makefile" ;; + "src/ibrowse/Makefile") CONFIG_FILES="$CONFIG_FILES src/ibrowse/Makefile" ;; + "src/mochiweb/Makefile") CONFIG_FILES="$CONFIG_FILES src/mochiweb/Makefile" ;; + "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "test/bench/Makefile") CONFIG_FILES="$CONFIG_FILES test/bench/Makefile" ;; + "test/etap/Makefile") CONFIG_FILES="$CONFIG_FILES test/etap/Makefile" ;; + "test/etap/test_util.erl") CONFIG_FILES="$CONFIG_FILES test/etap/test_util.erl" ;; + "test/javascript/Makefile") CONFIG_FILES="$CONFIG_FILES test/javascript/Makefile" ;; + "test/view_server/Makefile") CONFIG_FILES="$CONFIG_FILES test/view_server/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "var/Makefile") CONFIG_FILES="$CONFIG_FILES var/Makefile" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +# *sob* - on Windows libtool fails as 'libname_spec' isn't correct (it +# expects GNU style lib names). I can't work out how to configure this +# option sanely, so we pass the script through sed to modify it. +# Also, the erlang cc.sh script doesn't cope well with the '-link' command +# line option libtool provides. +# PLEASE, someone help put this out of its misery!! +# This hackery is being tracked via COUCHDB-440. +if test x${IS_WINDOWS} = xTRUE; then + sed -e 's,libname_spec="lib\\$name",libname_spec="\\\$name",' \ + -e 's,-link,,' \ + < libtool > libtool.tmp + mv libtool.tmp libtool + # probably would chmod +x if we weren't on windows... +fi + +echo +echo "You have configured Apache CouchDB, time to relax." +echo +echo "Run \`make && sudo make install' to install." diff --git a/plugins/scancode-compiledcode/tests/data/generatedcode/input/generated_1.java b/plugins/scancode-compiledcode/tests/data/generatedcode/input/generated_1.java new file mode 100644 index 00000000000..8e1409816ce --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/generatedcode/input/generated_1.java @@ -0,0 +1,6 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.4-05/26/2009 06:25 PM()-fcs +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2011.08.01 at 11:35:59 AM CEST +// \ No newline at end of file diff --git a/plugins/scancode-compiledcode/tests/data/gwt/expected.json b/plugins/scancode-compiledcode/tests/data/gwt/expected.json new file mode 100644 index 00000000000..b7849ba36d4 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/gwt/expected.json @@ -0,0 +1,95 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--gwt": true, + "--json": "" + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 2 + } + } + ], + "files": [ + { + "path": "gwt", + "type": "directory", + "gwt": [], + "scan_errors": [] + }, + { + "path": "gwt/expected.json", + "type": "file", + "gwt": [], + "scan_errors": [] + }, + { + "path": "gwt/gwt.symbolMap", + "type": "file", + "gwt": [ + { + "clean_path": "/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java", + "sourceLine": "33", + "memberName": "", + "jsName": "GXT", + "className": "com.extjs.gxt.ui.client.GXT", + "jsniIdent": "" + }, + { + "clean_path": "/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java", + "sourceLine": "33", + "memberName": "$clinit", + "jsName": "qc", + "className": "com.extjs.gxt.ui.client.GXT", + "jsniIdent": "com.extjs.gxt.ui.client.GXT::$clinit()V" + }, + { + "clean_path": "/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java", + "sourceLine": "39", + "memberName": "BLANK_IMAGE_URL", + "jsName": "Nb", + "className": "com.extjs.gxt.ui.client.GXT", + "jsniIdent": "com.extjs.gxt.ui.client.GXT::BLANK_IMAGE_URL" + }, + { + "clean_path": "/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java", + "sourceLine": "44", + "memberName": "IMAGES", + "jsName": "Ob", + "className": "com.extjs.gxt.ui.client.GXT", + "jsniIdent": "com.extjs.gxt.ui.client.GXT::IMAGES" + }, + { + "clean_path": "/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java", + "sourceLine": "180", + "memberName": "SSL_SECURE_URL", + "jsName": "Pb", + "className": "com.extjs.gxt.ui.client.GXT", + "jsniIdent": "com.extjs.gxt.ui.client.GXT::SSL_SECURE_URL" + }, + { + "clean_path": "/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java", + "sourceLine": "186", + "memberName": "ariaEnabled", + "jsName": "Qb", + "className": "com.extjs.gxt.ui.client.GXT", + "jsniIdent": "com.extjs.gxt.ui.client.GXT::ariaEnabled" + }, + { + "clean_path": "/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java", + "sourceLine": "187", + "memberName": "defaultTheme", + "jsName": "Rb", + "className": "com.extjs.gxt.ui.client.GXT", + "jsniIdent": "com.extjs.gxt.ui.client.GXT::defaultTheme" + } + ], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/plugins/scancode-compiledcode/tests/data/gwt/gwt.symbolMap b/plugins/scancode-compiledcode/tests/data/gwt/gwt.symbolMap new file mode 100644 index 00000000000..7f53eec3582 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/gwt/gwt.symbolMap @@ -0,0 +1,12 @@ +# { 1 } +# { 'gxt.user.agent' : 'ie8' , 'user.agent' : 'ie8' , 'user.agent.os' : 'linux' } +# { 'gxt.user.agent' : 'ie8' , 'user.agent' : 'ie8' , 'user.agent.os' : 'mac' } +# { 'gxt.user.agent' : 'ie8' , 'user.agent' : 'ie8' , 'user.agent.os' : 'windows' } +# jsName, jsniIdent, className, memberName, sourceUri, sourceLine +GXT,,com.extjs.gxt.ui.client.GXT,,jar:file:/C:/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java,33 +qc,com.extjs.gxt.ui.client.GXT::$clinit()V,com.extjs.gxt.ui.client.GXT,$clinit,jar:file:/C:/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java,33 +Nb,com.extjs.gxt.ui.client.GXT::BLANK_IMAGE_URL,com.extjs.gxt.ui.client.GXT,BLANK_IMAGE_URL,jar:file:/C:/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java,39 +Ob,com.extjs.gxt.ui.client.GXT::IMAGES,com.extjs.gxt.ui.client.GXT,IMAGES,jar:file:/C:/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java,44 +Pb,com.extjs.gxt.ui.client.GXT::SSL_SECURE_URL,com.extjs.gxt.ui.client.GXT,SSL_SECURE_URL,jar:file:/C:/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java,180 +Qb,com.extjs.gxt.ui.client.GXT::ariaEnabled,com.extjs.gxt.ui.client.GXT,ariaEnabled,jar:file:/C:/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java,186 +Rb,com.extjs.gxt.ui.client.GXT::defaultTheme,com.extjs.gxt.ui.client.GXT,defaultTheme,jar:file:/C:/Views/zoro/lib/lib/gxt/gxt-2.2.6-gwt22.jar!/com/extjs/gxt/ui/client/GXT.java,187 diff --git a/plugins/scancode-compiledcode/tests/data/javaclass/ControlPanel.class b/plugins/scancode-compiledcode/tests/data/javaclass/ControlPanel.class new file mode 100644 index 00000000000..950458552fa Binary files /dev/null and b/plugins/scancode-compiledcode/tests/data/javaclass/ControlPanel.class differ diff --git a/plugins/scancode-compiledcode/tests/data/javaclass/expected.json b/plugins/scancode-compiledcode/tests/data/javaclass/expected.json new file mode 100644 index 00000000000..b391df866d2 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/javaclass/expected.json @@ -0,0 +1,846 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--javaclass": true, + "--json": "" + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 2 + } + } + ], + "files": [ + { + "path": "javaclass", + "type": "directory", + "javaclass": {}, + "scan_errors": [] + }, + { + "path": "javaclass/ControlPanel.class", + "type": "file", + "javaclass": { + "Version": "Version: 45.3 (1.1)", + "Constants Pool": "266", + "Constants": { + "1": { + "Method": "203" + }, + "2": { + "Class": "java/lang/ClassNotFoundException" + }, + "3": { + "Class": "java/lang/NoClassDefFoundError" + }, + "4": { + "Method": "205" + }, + "5": { + "Method": "126" + }, + "6": { + "Method": "202" + }, + "7": { + "String": "131" + }, + "8": { + "Method": "209" + }, + "9": { + "Method": "212" + }, + "10": { + "Class": "java/awt/GridBagLayout" + }, + "11": { + "Method": "136" + }, + "12": { + "Class": "java/awt/GridBagConstraints" + }, + "13": { + "Method": "137" + }, + "14": { + "Method": "215" + }, + "15": { + "Field": "137" + }, + "16": { + "Field": "137" + }, + "17": { + "Field": "137" + }, + "18": { + "Field": "137" + }, + "19": { + "Field": "137" + }, + "20": { + "Class": "javax/swing/JLabel" + }, + "21": { + "String": "146" + }, + "22": { + "Method": "145" + }, + "23": { + "Method": "136" + }, + "24": { + "Method": "215" + }, + "25": { + "String": "149" + }, + "26": { + "String": "150" + }, + "27": { + "String": "151" + }, + "28": { + "String": "152" + }, + "29": { + "Field": "137" + }, + "30": { + "Class": "org/apache/log4j/Level" + }, + "31": { + "Field": "154" + }, + "32": { + "Field": "154" + }, + "33": { + "Field": "154" + }, + "34": { + "Field": "154" + }, + "35": { + "Field": "154" + }, + "36": { + "Field": "154" + }, + "37": { + "Class": "javax/swing/JComboBox" + }, + "38": { + "Method": "161" + }, + "39": { + "Method": "161" + }, + "40": { + "Method": "239" + }, + "41": { + "Method": "161" + }, + "42": { + "Class": "org/apache/log4j/chainsaw/ControlPanel$1" + }, + "43": { + "Method": "167" + }, + "44": { + "Method": "161" + }, + "45": { + "Field": "137" + }, + "46": { + "Class": "javax/swing/JTextField" + }, + "47": { + "String": "168" + }, + "48": { + "Method": "173" + }, + "49": { + "Method": "248" + }, + "50": { + "Class": "org/apache/log4j/chainsaw/ControlPanel$2" + }, + "51": { + "Method": "176" + }, + "52": { + "InterfaceMethod": "252" + }, + "53": { + "Class": "org/apache/log4j/chainsaw/ControlPanel$3" + }, + "54": { + "Method": "180" + }, + "55": { + "Class": "org/apache/log4j/chainsaw/ControlPanel$4" + }, + "56": { + "Method": "181" + }, + "57": { + "Class": "org/apache/log4j/chainsaw/ControlPanel$5" + }, + "58": { + "Method": "182" + }, + "59": { + "Class": "javax/swing/JButton" + }, + "60": { + "String": "184" + }, + "61": { + "Method": "183" + }, + "62": { + "Method": "255" + }, + "63": { + "Field": "258" + }, + "64": { + "Method": "255" + }, + "65": { + "String": "189" + }, + "66": { + "Class": "org/apache/log4j/chainsaw/ControlPanel$6" + }, + "67": { + "Method": "190" + }, + "68": { + "String": "192" + }, + "69": { + "Class": "org/apache/log4j/chainsaw/ControlPanel$7" + }, + "70": { + "Method": "193" + }, + "71": { + "Field": "201" + }, + "72": { + "String": "196" + }, + "73": { + "Method": "201" + }, + "74": { + "Method": "263" + }, + "75": { + "Field": "201" + }, + "76": { + "Class": "org/apache/log4j/chainsaw/ControlPanel" + }, + "77": { + "Class": "javax/swing/JPanel" + }, + "78": { + "Utf8": "LOG" + }, + "79": { + "Utf8": "Lorg/apache/log4j/Logger;" + }, + "80": { + "Utf8": "class$org$apache$log4j$chainsaw$ControlPanel" + }, + "81": { + "Utf8": "Ljava/lang/Class;" + }, + "82": { + "Utf8": "Synthetic" + }, + "83": { + "Utf8": "" + }, + "84": { + "Utf8": "(Lorg/apache/log4j/chainsaw/MyTableModel;)V" + }, + "85": { + "Utf8": "Code" + }, + "86": { + "Utf8": "LineNumberTable" + }, + "87": { + "Utf8": "LocalVariableTable" + }, + "88": { + "Utf8": "this" + }, + "89": { + "Utf8": "Lorg/apache/log4j/chainsaw/ControlPanel;" + }, + "90": { + "Utf8": "aModel" + }, + "91": { + "Utf8": "Lorg/apache/log4j/chainsaw/MyTableModel;" + }, + "92": { + "Utf8": "gridbag" + }, + "93": { + "Utf8": "Ljava/awt/GridBagLayout;" + }, + "94": { + "Utf8": "c" + }, + "95": { + "Utf8": "Ljava/awt/GridBagConstraints;" + }, + "96": { + "Utf8": "label" + }, + "97": { + "Utf8": "Ljavax/swing/JLabel;" + }, + "98": { + "Utf8": "allPriorities" + }, + "99": { + "Utf8": "[Lorg/apache/log4j/Level;" + }, + "100": { + "Utf8": "priorities" + }, + "101": { + "Utf8": "Ljavax/swing/JComboBox;" + }, + "102": { + "Utf8": "lowest" + }, + "103": { + "Utf8": "Lorg/apache/log4j/Level;" + }, + "104": { + "Utf8": "threadField" + }, + "105": { + "Utf8": "Ljavax/swing/JTextField;" + }, + "106": { + "Utf8": "catField" + }, + "107": { + "Utf8": "ndcField" + }, + "108": { + "Utf8": "msgField" + }, + "109": { + "Utf8": "exitButton" + }, + "110": { + "Utf8": "Ljavax/swing/JButton;" + }, + "111": { + "Utf8": "clearButton" + }, + "112": { + "Utf8": "toggleButton" + }, + "113": { + "Utf8": "class$" + }, + "114": { + "Utf8": "(Ljava/lang/String;)Ljava/lang/Class;" + }, + "115": { + "Utf8": "x1" + }, + "116": { + "Utf8": "Ljava/lang/ClassNotFoundException;" + }, + "117": { + "Utf8": "x0" + }, + "118": { + "Utf8": "Ljava/lang/String;" + }, + "119": { + "Utf8": "" + }, + "120": { + "Utf8": "()V" + }, + "121": { + "Utf8": "SourceFile" + }, + "122": { + "Utf8": "ControlPanel.java" + }, + "123": { + "Class": "java/lang/Class" + }, + "124": { + "NameAndType": "204, 114" + }, + "125": { + "Utf8": "java/lang/ClassNotFoundException" + }, + "126": { + "Utf8": "java/lang/NoClassDefFoundError" + }, + "127": { + "Class": "java/lang/Throwable" + }, + "128": { + "NameAndType": "206, 207" + }, + "129": { + "NameAndType": "83, 208" + }, + "130": { + "NameAndType": "83, 120" + }, + "131": { + "Utf8": "Controls: " + }, + "132": { + "Class": "javax/swing/BorderFactory" + }, + "133": { + "NameAndType": "210, 211" + }, + "134": { + "Class": "javax/swing/JComponent" + }, + "135": { + "NameAndType": "213, 214" + }, + "136": { + "Utf8": "java/awt/GridBagLayout" + }, + "137": { + "Utf8": "java/awt/GridBagConstraints" + }, + "138": { + "Class": "java/awt/Container" + }, + "139": { + "NameAndType": "216, 217" + }, + "140": { + "NameAndType": "218, 219" + }, + "141": { + "NameAndType": "220, 219" + }, + "142": { + "NameAndType": "221, 219" + }, + "143": { + "NameAndType": "222, 219" + }, + "144": { + "NameAndType": "223, 219" + }, + "145": { + "Utf8": "javax/swing/JLabel" + }, + "146": { + "Utf8": "Filter Level:" + }, + "147": { + "NameAndType": "224, 225" + }, + "148": { + "NameAndType": "226, 227" + }, + "149": { + "Utf8": "Filter Thread:" + }, + "150": { + "Utf8": "Filter Logger:" + }, + "151": { + "Utf8": "Filter NDC:" + }, + "152": { + "Utf8": "Filter Message:" + }, + "153": { + "NameAndType": "228, 229" + }, + "154": { + "Utf8": "org/apache/log4j/Level" + }, + "155": { + "NameAndType": "230, 103" + }, + "156": { + "NameAndType": "231, 103" + }, + "157": { + "NameAndType": "232, 103" + }, + "158": { + "NameAndType": "233, 103" + }, + "159": { + "NameAndType": "234, 103" + }, + "160": { + "NameAndType": "235, 103" + }, + "161": { + "Utf8": "javax/swing/JComboBox" + }, + "162": { + "NameAndType": "83, 236" + }, + "163": { + "NameAndType": "237, 238" + }, + "164": { + "Class": "org/apache/log4j/chainsaw/MyTableModel" + }, + "165": { + "NameAndType": "240, 241" + }, + "166": { + "NameAndType": "242, 243" + }, + "167": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel$1" + }, + "168": { + "Utf8": "" + }, + "169": { + "Utf8": "InnerClasses" + }, + "170": { + "NameAndType": "83, 244" + }, + "171": { + "NameAndType": "245, 246" + }, + "172": { + "NameAndType": "247, 219" + }, + "173": { + "Utf8": "javax/swing/JTextField" + }, + "174": { + "Class": "javax/swing/text/JTextComponent" + }, + "175": { + "NameAndType": "249, 250" + }, + "176": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel$2" + }, + "177": { + "NameAndType": "83, 251" + }, + "178": { + "Class": "javax/swing/text/Document" + }, + "179": { + "NameAndType": "253, 254" + }, + "180": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel$3" + }, + "181": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel$4" + }, + "182": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel$5" + }, + "183": { + "Utf8": "javax/swing/JButton" + }, + "184": { + "Utf8": "Exit" + }, + "185": { + "Class": "javax/swing/AbstractButton" + }, + "186": { + "NameAndType": "256, 257" + }, + "187": { + "Class": "org/apache/log4j/chainsaw/ExitAction" + }, + "188": { + "NameAndType": "259, 260" + }, + "189": { + "Utf8": "Clear" + }, + "190": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel$6" + }, + "191": { + "NameAndType": "83, 261" + }, + "192": { + "Utf8": "Pause" + }, + "193": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel$7" + }, + "194": { + "NameAndType": "83, 262" + }, + "195": { + "NameAndType": "80, 81" + }, + "196": { + "Utf8": "org.apache.log4j.chainsaw.ControlPanel" + }, + "197": { + "NameAndType": "113, 114" + }, + "198": { + "Class": "org/apache/log4j/Logger" + }, + "199": { + "NameAndType": "264, 265" + }, + "200": { + "NameAndType": "78, 79" + }, + "201": { + "Utf8": "org/apache/log4j/chainsaw/ControlPanel" + }, + "202": { + "Utf8": "javax/swing/JPanel" + }, + "203": { + "Utf8": "java/lang/Class" + }, + "204": { + "Utf8": "forName" + }, + "205": { + "Utf8": "java/lang/Throwable" + }, + "206": { + "Utf8": "getMessage" + }, + "207": { + "Utf8": "()Ljava/lang/String;" + }, + "208": { + "Utf8": "(Ljava/lang/String;)V" + }, + "209": { + "Utf8": "javax/swing/BorderFactory" + }, + "210": { + "Utf8": "createTitledBorder" + }, + "211": { + "Utf8": "(Ljava/lang/String;)Ljavax/swing/border/TitledBorder;" + }, + "212": { + "Utf8": "javax/swing/JComponent" + }, + "213": { + "Utf8": "setBorder" + }, + "214": { + "Utf8": "(Ljavax/swing/border/Border;)V" + }, + "215": { + "Utf8": "java/awt/Container" + }, + "216": { + "Utf8": "setLayout" + }, + "217": { + "Utf8": "(Ljava/awt/LayoutManager;)V" + }, + "218": { + "Utf8": "ipadx" + }, + "219": { + "Utf8": "I" + }, + "220": { + "Utf8": "ipady" + }, + "221": { + "Utf8": "gridx" + }, + "222": { + "Utf8": "anchor" + }, + "223": { + "Utf8": "gridy" + }, + "224": { + "Utf8": "setConstraints" + }, + "225": { + "Utf8": "(Ljava/awt/Component;Ljava/awt/GridBagConstraints;)V" + }, + "226": { + "Utf8": "add" + }, + "227": { + "Utf8": "(Ljava/awt/Component;)Ljava/awt/Component;" + }, + "228": { + "Utf8": "weightx" + }, + "229": { + "Utf8": "D" + }, + "230": { + "Utf8": "FATAL" + }, + "231": { + "Utf8": "ERROR" + }, + "232": { + "Utf8": "WARN" + }, + "233": { + "Utf8": "INFO" + }, + "234": { + "Utf8": "DEBUG" + }, + "235": { + "Utf8": "TRACE" + }, + "236": { + "Utf8": "([Ljava/lang/Object;)V" + }, + "237": { + "Utf8": "setSelectedItem" + }, + "238": { + "Utf8": "(Ljava/lang/Object;)V" + }, + "239": { + "Utf8": "org/apache/log4j/chainsaw/MyTableModel" + }, + "240": { + "Utf8": "setPriorityFilter" + }, + "241": { + "Utf8": "(Lorg/apache/log4j/Priority;)V" + }, + "242": { + "Utf8": "setEditable" + }, + "243": { + "Utf8": "(Z)V" + }, + "244": { + "Utf8": "(Lorg/apache/log4j/chainsaw/ControlPanel;Lorg/apache/log4j/chainsaw/MyTableModel;Ljavax/swing/JComboBox;)V" + }, + "245": { + "Utf8": "addActionListener" + }, + "246": { + "Utf8": "(Ljava/awt/event/ActionListener;)V" + }, + "247": { + "Utf8": "fill" + }, + "248": { + "Utf8": "javax/swing/text/JTextComponent" + }, + "249": { + "Utf8": "getDocument" + }, + "250": { + "Utf8": "()Ljavax/swing/text/Document;" + }, + "251": { + "Utf8": "(Lorg/apache/log4j/chainsaw/ControlPanel;Lorg/apache/log4j/chainsaw/MyTableModel;Ljavax/swing/JTextField;)V" + }, + "252": { + "Utf8": "javax/swing/text/Document" + }, + "253": { + "Utf8": "addDocumentListener" + }, + "254": { + "Utf8": "(Ljavax/swing/event/DocumentListener;)V" + }, + "255": { + "Utf8": "javax/swing/AbstractButton" + }, + "256": { + "Utf8": "setMnemonic" + }, + "257": { + "Utf8": "(C)V" + }, + "258": { + "Utf8": "org/apache/log4j/chainsaw/ExitAction" + }, + "259": { + "Utf8": "INSTANCE" + }, + "260": { + "Utf8": "Lorg/apache/log4j/chainsaw/ExitAction;" + }, + "261": { + "Utf8": "(Lorg/apache/log4j/chainsaw/ControlPanel;Lorg/apache/log4j/chainsaw/MyTableModel;)V" + }, + "262": { + "Utf8": "(Lorg/apache/log4j/chainsaw/ControlPanel;Lorg/apache/log4j/chainsaw/MyTableModel;Ljavax/swing/JButton;)V" + }, + "263": { + "Utf8": "org/apache/log4j/Logger" + }, + "264": { + "Utf8": "getLogger" + }, + "265": { + "Utf8": "(Ljava/lang/Class;)Lorg/apache/log4j/Logger;" + } + }, + "Access": "Superclass ", + "Methods": [ + "void ControlPanel(MyTableModel)", + "static Class class$(String)", + "static void ()" + ], + "Class": "org/apache/log4j/chainsaw/ControlPanel", + "Super Class": "javax/swing/JPanel" + }, + "scan_errors": [] + }, + { + "path": "javaclass/expected.json", + "type": "file", + "javaclass": {}, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/plugins/scancode-lkmclue/tests/data/lkmclue/expected.json b/plugins/scancode-compiledcode/tests/data/lkmclue/expected.json similarity index 100% rename from plugins/scancode-lkmclue/tests/data/lkmclue/expected.json rename to plugins/scancode-compiledcode/tests/data/lkmclue/expected.json diff --git a/plugins/scancode-lkmclue/tests/data/lkmclue/input/audio_manager.c b/plugins/scancode-compiledcode/tests/data/lkmclue/input/audio_manager.c similarity index 100% rename from plugins/scancode-lkmclue/tests/data/lkmclue/input/audio_manager.c rename to plugins/scancode-compiledcode/tests/data/lkmclue/input/audio_manager.c diff --git a/plugins/scancode-compiledcode/tests/data/makedepend/addrutil.d b/plugins/scancode-compiledcode/tests/data/makedepend/addrutil.d new file mode 100644 index 00000000000..29f37306b89 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/makedepend/addrutil.d @@ -0,0 +1,11 @@ +addrutil.o: \ + /test/ram/../../Common/Src/addrutil.c \ + /test/ram/../../Common/Inc/buildmode.h \ + /test/ram/../../Common/Inc/dct_types.h \ + /test/ram/../../Common/Inc/mostypes.h \ + /test/ram/../../Common/Inc/memutil.h \ + /test/ram/../../Common/Inc/addrutil.h \ + /test/ram/../../Common/Inc/hwdevices.h \ + /test/ram/../../Common/Inc/tsic.h \ + /test/ram/../../Common/Inc/pltcfg.h \ + /test/ram/../../Common/Inc/dct_debug.h diff --git a/plugins/scancode-compiledcode/tests/data/makedepend/expected.json b/plugins/scancode-compiledcode/tests/data/makedepend/expected.json new file mode 100644 index 00000000000..60ecb25d2c6 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/makedepend/expected.json @@ -0,0 +1,51 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--json": "", + "--makedepend": true + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 2 + } + } + ], + "files": [ + { + "path": "makedepend", + "type": "directory", + "makedepend": {}, + "scan_errors": [] + }, + { + "path": "makedepend/addrutil.d", + "type": "file", + "makedepend": { + "addrutil.o": [ + "/test/ram/../../Common/Src/addrutil.c", + "/test/ram/../../Common/Inc/buildmode.h", + "/test/ram/../../Common/Inc/dct_types.h", + "/test/ram/../../Common/Inc/mostypes.h", + "/test/ram/../../Common/Inc/memutil.h", + "/test/ram/../../Common/Inc/addrutil.h", + "/test/ram/../../Common/Inc/hwdevices.h", + "/test/ram/../../Common/Inc/tsic.h", + "/test/ram/../../Common/Inc/pltcfg.h", + "/test/ram/../../Common/Inc/dct_debug.h" + ] + }, + "scan_errors": [] + }, + { + "path": "makedepend/expected.json", + "type": "file", + "makedepend": {}, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/cpp-test.o b/plugins/scancode-compiledcode/tests/data/misc_elfs/cpp-test.o similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/cpp-test.o rename to plugins/scancode-compiledcode/tests/data/misc_elfs/cpp-test.o diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/cpp-test.o.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/misc_elfs/cpp-test.o.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/cpp-test.o.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/misc_elfs/cpp-test.o.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/mips32_exec b/plugins/scancode-compiledcode/tests/data/misc_elfs/mips32_exec similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/mips32_exec rename to plugins/scancode-compiledcode/tests/data/misc_elfs/mips32_exec diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/mips32_exec.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/misc_elfs/mips32_exec.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/mips32_exec.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/misc_elfs/mips32_exec.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/mips32_exec.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/misc_elfs/mips32_exec.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/mips32_exec.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/misc_elfs/mips32_exec.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/mips64_exec b/plugins/scancode-compiledcode/tests/data/misc_elfs/mips64_exec similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/mips64_exec rename to plugins/scancode-compiledcode/tests/data/misc_elfs/mips64_exec diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/mips64_exec.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/misc_elfs/mips64_exec.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/mips64_exec.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/misc_elfs/mips64_exec.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/mips64_exec.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/misc_elfs/mips64_exec.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/mips64_exec.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/misc_elfs/mips64_exec.dwarf3.expected.json diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/null_elf b/plugins/scancode-compiledcode/tests/data/misc_elfs/null_elf similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/null_elf rename to plugins/scancode-compiledcode/tests/data/misc_elfs/null_elf diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/null_elf.dwarf2.expected.json b/plugins/scancode-compiledcode/tests/data/misc_elfs/null_elf.dwarf2.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/null_elf.dwarf2.expected.json rename to plugins/scancode-compiledcode/tests/data/misc_elfs/null_elf.dwarf2.expected.json diff --git a/plugins/scancode-dwarf/tests/data/misc_elfs/null_elf.dwarf3.expected.json b/plugins/scancode-compiledcode/tests/data/misc_elfs/null_elf.dwarf3.expected.json similarity index 100% rename from plugins/scancode-dwarf/tests/data/misc_elfs/null_elf.dwarf3.expected.json rename to plugins/scancode-compiledcode/tests/data/misc_elfs/null_elf.dwarf3.expected.json diff --git a/plugins/scancode-compiledcode/tests/data/sourcecode/expected.json b/plugins/scancode-compiledcode/tests/data/sourcecode/expected.json new file mode 100644 index 00000000000..de01073e3c0 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/sourcecode/expected.json @@ -0,0 +1,34 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--codecommentlines": true, + "--json": "" + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 1 + } + } + ], + "files": [ + { + "path": "input", + "type": "directory", + "commentlines": 0, + "codelines": 0, + "scan_errors": [] + }, + { + "path": "input/if_ath.c", + "type": "file", + "commentlines": 2532, + "codelines": 6586, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/plugins/scancode-compiledcode/tests/data/sourcecode/input/if_ath.c b/plugins/scancode-compiledcode/tests/data/sourcecode/input/if_ath.c new file mode 100644 index 00000000000..4815dcd8943 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/data/sourcecode/input/if_ath.c @@ -0,0 +1,9940 @@ +/*- + * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $Id: if_ath.c 3354 2008-02-13 05:13:10Z mrenzmann $ + */ + +/* + * Driver for the Atheros Wireless LAN controller. + * + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ +#include "opt_ah.h" + +#ifndef AUTOCONF_INCLUDED +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "if_ethersubr.h" /* for ETHER_IS_MULTICAST */ +#include "if_media.h" +#include "if_llc.h" + +#include +#include +#include +#include + +#ifdef USE_HEADERLEN_RESV +#include +#endif + +#define AR_DEBUG + +#include "net80211/if_athproto.h" +#include "if_athvar.h" +#include "ah_desc.h" +#include "ah_devid.h" /* XXX to identify chipset */ + +#ifdef ATH_PCI /* PCI BUS */ +#include "if_ath_pci.h" +#endif /* PCI BUS */ +#ifdef ATH_AHB /* AHB BUS */ +#include "if_ath_ahb.h" +#endif /* AHB BUS */ + +#ifdef ATH_TX99_DIAG +#include "ath_tx99.h" +#endif + +/* unaligned little endian access */ +#define LE_READ_2(p) \ + ((u_int16_t) \ + ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8))) +#define LE_READ_4(p) \ + ((u_int32_t) \ + ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8) | \ + (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) + +/* Default rate control algorithm */ +#ifdef CONFIG_ATHEROS_RATE_DEFAULT +#define DEF_RATE_CTL CONFIG_ATHEROS_RATE_DEFAULT +#else +#define DEF_RATE_CTL "sample" +#endif + +enum { + ATH_LED_TX, + ATH_LED_RX, + ATH_LED_POLL, +}; + +static struct ieee80211vap *ath_vap_create(struct ieee80211com *, + const char *, int, int, int, struct net_device *); +static void ath_vap_delete(struct ieee80211vap *); +static int ath_init(struct net_device *); +static int ath_set_ack_bitrate(struct ath_softc *, int); +static int ath_reset(struct net_device *); +static void ath_fatal_tasklet(TQUEUE_ARG); +static void ath_rxorn_tasklet(TQUEUE_ARG); +static void ath_bmiss_tasklet(TQUEUE_ARG); +static void ath_bstuck_tasklet(TQUEUE_ARG); +static void ath_radar_task(struct work_struct *); +static void ath_dfs_test_return(unsigned long); + +static int ath_stop_locked(struct net_device *); +static int ath_stop(struct net_device *); +#if 0 +static void ath_initkeytable(struct ath_softc *); +#endif +static int ath_key_alloc(struct ieee80211vap *, const struct ieee80211_key *); +static int ath_key_delete(struct ieee80211vap *, const struct ieee80211_key *, + struct ieee80211_node *); +static int ath_key_set(struct ieee80211vap *, const struct ieee80211_key *, + const u_int8_t mac[IEEE80211_ADDR_LEN]); +static void ath_key_update_begin(struct ieee80211vap *); +static void ath_key_update_end(struct ieee80211vap *); +static void ath_mode_init(struct net_device *); +static void ath_setslottime(struct ath_softc *); +static void ath_updateslot(struct net_device *); +static int ath_beaconq_setup(struct ath_hal *); +static int ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *); +#ifdef ATH_SUPERG_DYNTURBO +static void ath_beacon_dturbo_update(struct ieee80211vap *, int *, u_int8_t); +static void ath_beacon_dturbo_config(struct ieee80211vap *, u_int32_t); +static void ath_turbo_switch_mode(unsigned long); +static int ath_check_beacon_done(struct ath_softc *); +#endif +static void ath_beacon_send(struct ath_softc *, int *); +static void ath_beacon_start_adhoc(struct ath_softc *, struct ieee80211vap *); +static void ath_beacon_return(struct ath_softc *, struct ath_buf *); +static void ath_beacon_free(struct ath_softc *); +static void ath_beacon_config(struct ath_softc *, struct ieee80211vap *); +static int ath_desc_alloc(struct ath_softc *); +static void ath_desc_free(struct ath_softc *); +static void ath_desc_swap(struct ath_desc *); +static struct ieee80211_node *ath_node_alloc(struct ieee80211_node_table *, + struct ieee80211vap *); +static void ath_node_cleanup(struct ieee80211_node *); +static void ath_node_free(struct ieee80211_node *); +static u_int8_t ath_node_getrssi(const struct ieee80211_node *); +static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *); +static void ath_recv_mgmt(struct ieee80211_node *, struct sk_buff *, int, + int, u_int32_t); +static void ath_setdefantenna(struct ath_softc *, u_int); +static struct ath_txq *ath_txq_setup(struct ath_softc *, int, int); +static void ath_rx_tasklet(TQUEUE_ARG); +static int ath_hardstart(struct sk_buff *, struct net_device *); +static int ath_mgtstart(struct ieee80211com *, struct sk_buff *); +#ifdef ATH_SUPERG_COMP +static u_int32_t ath_get_icvlen(struct ieee80211_key *); +static u_int32_t ath_get_ivlen(struct ieee80211_key *); +static void ath_setup_comp(struct ieee80211_node *, int); +static void ath_comp_set(struct ieee80211vap *, struct ieee80211_node *, int); +#endif +static int ath_tx_setup(struct ath_softc *, int, int); +static int ath_wme_update(struct ieee80211com *); +static void ath_uapsd_flush(struct ieee80211_node *); +static void ath_tx_cleanupq(struct ath_softc *, struct ath_txq *); +static void ath_tx_cleanup(struct ath_softc *); +static void ath_tx_uapsdqueue(struct ath_softc *, struct ath_node *, + struct ath_buf *); + +static int ath_tx_start(struct net_device *, struct ieee80211_node *, + struct ath_buf *, struct sk_buff *, int); +static void ath_tx_tasklet_q0(TQUEUE_ARG); +static void ath_tx_tasklet_q0123(TQUEUE_ARG); +static void ath_tx_tasklet(TQUEUE_ARG); +static void ath_tx_timeout(struct net_device *); +static void ath_tx_draintxq(struct ath_softc *, struct ath_txq *); +static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); +static void ath_draintxq(struct ath_softc *); +static __inline void ath_tx_txqaddbuf(struct ath_softc *, struct ieee80211_node *, + struct ath_txq *, struct ath_buf *, struct ath_desc *, int); +static void ath_stoprecv(struct ath_softc *); +static int ath_startrecv(struct ath_softc *); +static void ath_flushrecv(struct ath_softc *); +static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); +static void ath_calibrate(unsigned long); +static int ath_newstate(struct ieee80211vap *, enum ieee80211_state, int); + +static void ath_scan_start(struct ieee80211com *); +static void ath_scan_end(struct ieee80211com *); +static void ath_set_channel(struct ieee80211com *); +static void ath_set_coverageclass(struct ieee80211com *); +static u_int ath_mhz2ieee(struct ieee80211com *, u_int, u_int); +#ifdef ATH_SUPERG_FF +static int athff_can_aggregate(struct ath_softc *, struct ether_header *, + struct ath_node *, struct sk_buff *, u_int16_t, int *); +#endif +static struct net_device_stats *ath_getstats(struct net_device *); +static void ath_setup_stationkey(struct ieee80211_node *); +static void ath_setup_stationwepkey(struct ieee80211_node *); +static void ath_setup_keycacheslot(struct ath_softc *, struct ieee80211_node *); +static void ath_newassoc(struct ieee80211_node *, int); +static int ath_getchannels(struct net_device *, u_int, HAL_BOOL, HAL_BOOL); +static void ath_led_event(struct ath_softc *, int); +static void ath_update_txpow(struct ath_softc *); + +static int ath_set_mac_address(struct net_device *, void *); +static int ath_change_mtu(struct net_device *, int); +static int ath_ioctl(struct net_device *, struct ifreq *, int); + +static int ath_rate_setup(struct net_device *, u_int); +static void ath_setup_subrates(struct net_device *); +#ifdef ATH_SUPERG_XR +static int ath_xr_rate_setup(struct net_device *); +static void ath_grppoll_txq_setup(struct ath_softc *, int, int); +static void ath_grppoll_start(struct ieee80211vap *, int); +static void ath_grppoll_stop(struct ieee80211vap *); +static u_int8_t ath_node_move_data(const struct ieee80211_node *); +static void ath_grppoll_txq_update(struct ath_softc *, int); +static void ath_grppoll_period_update(struct ath_softc *); +#endif +static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode); + +static void ath_dynamic_sysctl_register(struct ath_softc *); +static void ath_dynamic_sysctl_unregister(struct ath_softc *); +static void ath_announce(struct net_device *); +static int ath_descdma_setup(struct ath_softc *, struct ath_descdma *, + ath_bufhead *, const char *, int, int); +static void ath_descdma_cleanup(struct ath_softc *, struct ath_descdma *, + ath_bufhead *, int); +static void ath_check_dfs_clear(unsigned long); +static const char *ath_get_hal_status_desc(HAL_STATUS status); +static int ath_rcv_dev_event(struct notifier_block *, unsigned long, void *); + +static int ath_calinterval = ATH_SHORT_CALINTERVAL; /* + * calibrate every 30 secs in steady state + * but check every second at first. + */ +static int ath_countrycode = CTRY_DEFAULT; /* country code */ +static int ath_outdoor = AH_FALSE; /* enable outdoor use */ +static int ath_xchanmode = AH_TRUE; /* enable extended channels */ +static int ath_maxvaps = ATH_MAXVAPS_DEFAULT; /* set default maximum vaps */ +static char *autocreate = NULL; +static char *ratectl = DEF_RATE_CTL; +static int rfkill = -1; +static int countrycode = -1; +static int maxvaps = -1; +static int outdoor = -1; +static int xchanmode = -1; + +static const char *hal_status_desc[] = { + "No error", + "No hardware present or device not yet supported", + "Memory allocation failed", + "Hardware didn't respond as expected", + "EEPROM magic number invalid", + "EEPROM version invalid", + "EEPROM unreadable", + "EEPROM checksum invalid", + "EEPROM read problem", + "EEPROM mac address invalid", + "EEPROM size not supported", + "Attempt to change write-locked EEPROM", + "Invalid parameter to function", + "Hardware revision not supported", + "Hardware self-test failed", + "Operation incomplete" +}; + +static struct notifier_block ath_event_block = { + .notifier_call = ath_rcv_dev_event +}; + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52)) +MODULE_PARM(countrycode, "i"); +MODULE_PARM(maxvaps, "i"); +MODULE_PARM(outdoor, "i"); +MODULE_PARM(xchanmode, "i"); +MODULE_PARM(rfkill, "i"); +MODULE_PARM(autocreate, "s"); +MODULE_PARM(ratectl, "s"); +#else +#include +module_param(countrycode, int, 0600); +module_param(maxvaps, int, 0600); +module_param(outdoor, int, 0600); +module_param(xchanmode, int, 0600); +module_param(rfkill, int, 0600); +module_param(autocreate, charp, 0600); +module_param(ratectl, charp, 0600); +#endif +MODULE_PARM_DESC(countrycode, "Override default country code"); +MODULE_PARM_DESC(maxvaps, "Maximum VAPs"); +MODULE_PARM_DESC(outdoor, "Enable/disable outdoor use"); +MODULE_PARM_DESC(xchanmode, "Enable/disable extended channel mode"); +MODULE_PARM_DESC(rfkill, "Enable/disable RFKILL capability"); +MODULE_PARM_DESC(autocreate, "Create ath device in [sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use 'none' to disable"); +MODULE_PARM_DESC(ratectl, "Rate control algorithm [amrr|minstrel|onoe|sample], defaults to '" DEF_RATE_CTL "'"); + +static int ath_debug = 0; +#ifdef AR_DEBUG +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52)) +MODULE_PARM(ath_debug, "i"); +#else +module_param(ath_debug, int, 0600); +#endif +MODULE_PARM_DESC(ath_debug, "Load-time debug output enable"); + +#define IFF_DUMPPKTS(sc, _m) \ + ((sc->sc_debug & _m)) +static void ath_printrxbuf(struct ath_buf *, int); +static void ath_printtxbuf(struct ath_buf *, int); +enum { + ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ + ATH_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ + ATH_DEBUG_RECV = 0x00000004, /* basic recv operation */ + ATH_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ + ATH_DEBUG_RATE = 0x00000010, /* rate control */ + ATH_DEBUG_RESET = 0x00000020, /* reset processing */ + /* 0x00000040 was ATH_DEBUG_MODE */ + ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */ + ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */ + ATH_DEBUG_INTR = 0x00001000, /* ISR */ + ATH_DEBUG_TX_PROC = 0x00002000, /* tx ISR proc */ + ATH_DEBUG_RX_PROC = 0x00004000, /* rx ISR proc */ + ATH_DEBUG_BEACON_PROC = 0x00008000, /* beacon ISR proc */ + ATH_DEBUG_CALIBRATE = 0x00010000, /* periodic calibration */ + ATH_DEBUG_KEYCACHE = 0x00020000, /* key cache management */ + ATH_DEBUG_STATE = 0x00040000, /* 802.11 state transitions */ + ATH_DEBUG_NODE = 0x00080000, /* node management */ + ATH_DEBUG_LED = 0x00100000, /* led management */ + ATH_DEBUG_FF = 0x00200000, /* fast frames */ + ATH_DEBUG_TURBO = 0x00400000, /* turbo/dynamic turbo */ + ATH_DEBUG_UAPSD = 0x00800000, /* uapsd */ + ATH_DEBUG_DOTH = 0x01000000, /* 11.h */ + ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */ + ATH_DEBUG_ANY = 0xffffffff +}; +#define DPRINTF(sc, _m, _fmt, ...) do { \ + if (sc->sc_debug & (_m)) \ + printk(_fmt, __VA_ARGS__); \ +} while (0) +#define KEYPRINTF(sc, ix, hk, mac) do { \ + if (sc->sc_debug & ATH_DEBUG_KEYCACHE) \ + ath_keyprint(sc, __func__, ix, hk, mac); \ +} while (0) +#else /* defined(AR_DEBUG) */ +#define IFF_DUMPPKTS(sc, _m) netif_msg_dumppkts(&sc->sc_ic) +#define DPRINTF(sc, _m, _fmt, ...) +#define KEYPRINTF(sc, k, ix, mac) +#endif /* defined(AR_DEBUG) */ + +#define ATH_SETUP_XR_VAP(sc,vap,rfilt) \ + do { \ + if (sc->sc_curchan.privFlags & CHANNEL_4MS_LIMIT) \ + vap->iv_fragthreshold = XR_4MS_FRAG_THRESHOLD; \ + else \ + vap->iv_fragthreshold = vap->iv_xrvap->iv_fragthreshold; \ + if (!sc->sc_xrgrppoll) { \ + ath_grppoll_txq_setup(sc, HAL_TX_QUEUE_DATA, GRP_POLL_PERIOD_NO_XR_STA(sc)); \ + ath_grppoll_start(vap, sc->sc_xrpollcount); \ + ath_hal_setrxfilter(sc->sc_ah, rfilt|HAL_RX_FILTER_XRPOLL); \ + } \ + } while(0) + +/* + * Define the scheme that we select MAC address for multiple BSS on the same radio. + * The very first VAP will just use the MAC address from the EEPROM. + * For the next 3 VAPs, we set the U/L bit (bit 1) in MAC address, + * and use the next two bits as the index of the VAP. + */ +#define ATH_SET_VAP_BSSID_MASK(bssid_mask) \ + ((bssid_mask)[0] &= ~(((ath_maxvaps-1) << 2) | 0x02)) +#define ATH_GET_VAP_ID(bssid) ((bssid)[0] >> 2) +#define ATH_SET_VAP_BSSID(bssid, id) \ + do { \ + if (id) \ + (bssid)[0] |= (((id) << 2) | 0x02); \ + } while(0) + +int +ath_attach(u_int16_t devid, struct net_device *dev, HAL_BUS_TAG tag) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah; + HAL_STATUS status; + int error = 0, i; + int autocreatemode = IEEE80211_M_STA; + u_int8_t csz; + + sc->devid = devid; + sc->sc_debug = ath_debug; + DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); + + /* Allocate space for dynamically determined maximum VAP count */ + sc->sc_bslot = kmalloc(ath_maxvaps * sizeof(struct ieee80211vap), GFP_KERNEL); + memset(sc->sc_bslot, 0, ath_maxvaps * sizeof(struct ieee80211vap)); + + /* + * Cache line size is used to size and align various + * structures used to communicate with the hardware. + */ + bus_read_cachesize(sc, &csz); + /* XXX assert csz is non-zero */ + sc->sc_cachelsz = csz << 2; /* convert to bytes */ + + ATH_LOCK_INIT(sc); + ATH_TXBUF_LOCK_INIT(sc); + ATH_RXBUF_LOCK_INIT(sc); + + ATH_INIT_TQUEUE(&sc->sc_rxtq, ath_rx_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_bmisstq, ath_bmiss_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_bstucktq,ath_bstuck_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_rxorntq, ath_rxorn_tasklet, dev); + ATH_INIT_TQUEUE(&sc->sc_fataltq, ath_fatal_tasklet, dev); + ATH_INIT_WORK(&sc->sc_radartask, ath_radar_task); + + /* + * Attach the HAL and verify ABI compatibility by checking + * the HAL's ABI signature against the one the driver was + * compiled with. A mismatch indicates the driver was + * built with an ah.h that does not correspond to the HAL + * module loaded in the kernel. + */ + ah = _ath_hal_attach(devid, sc, tag, sc->sc_iobase, &status); + if (ah == NULL) { + printk(KERN_ERR "%s: unable to attach hardware: '%s' (HAL status %u)\n", + dev->name, ath_get_hal_status_desc(status), status); + error = ENXIO; + goto bad; + } + if (ah->ah_abi != HAL_ABI_VERSION) { + printk(KERN_ERR "%s: HAL ABI mismatch; " + "driver expects 0x%x, HAL reports 0x%x\n", + dev->name, HAL_ABI_VERSION, ah->ah_abi); + error = ENXIO; /* XXX */ + goto bad; + } + sc->sc_ah = ah; + + /* + * Check if the MAC has multi-rate retry support. + * We do this by trying to setup a fake extended + * descriptor. MAC's that don't have support will + * return false w/o doing anything. MAC's that do + * support it will return true w/o doing anything. + */ + sc->sc_mrretry = ath_hal_setupxtxdesc(ah, NULL, 0,0, 0,0, 0,0); + + /* + * Check if the device has hardware counters for PHY + * errors. If so we need to enable the MIB interrupt + * so we can act on stat triggers. + */ + if (ath_hal_hwphycounters(ah)) + sc->sc_needmib = 1; + + /* + * Get the hardware key cache size. + */ + sc->sc_keymax = ath_hal_keycachesize(ah); + if (sc->sc_keymax > ATH_KEYMAX) { + printk("%s: Warning, using only %u entries in %u key cache\n", + dev->name, ATH_KEYMAX, sc->sc_keymax); + sc->sc_keymax = ATH_KEYMAX; + } + /* + * Reset the key cache since some parts do not + * reset the contents on initial power up. + */ + for (i = 0; i < sc->sc_keymax; i++) + ath_hal_keyreset(ah, i); + + /* + * Collect the channel list using the default country + * code and including outdoor channels. The 802.11 layer + * is responsible for filtering this list based on settings + * like the phy mode. + */ + if (countrycode != -1) + ath_countrycode = countrycode; + if (maxvaps != -1) { + ath_maxvaps = maxvaps; + if (ath_maxvaps < ATH_MAXVAPS_MIN) + ath_maxvaps = ATH_MAXVAPS_MIN; + if (ath_maxvaps > ATH_MAXVAPS_MAX) + ath_maxvaps = ATH_MAXVAPS_MAX; + } + if (outdoor != -1) + ath_outdoor = outdoor; + if (xchanmode != -1) + ath_xchanmode = xchanmode; + error = ath_getchannels(dev, ath_countrycode, + ath_outdoor, ath_xchanmode); + if (error != 0) + goto bad; + + ic->ic_country_code = ath_countrycode; + ic->ic_country_outdoor = ath_outdoor; + + if (rfkill != -1) { + printk(KERN_INFO "ath_pci: switching rfkill capability %s\n", + rfkill ? "on" : "off"); + ath_hal_setrfsilent(ah, rfkill); + } + + /* + * Setup rate tables for all potential media types. + */ + ath_rate_setup(dev, IEEE80211_MODE_11A); + ath_rate_setup(dev, IEEE80211_MODE_11B); + ath_rate_setup(dev, IEEE80211_MODE_11G); + ath_rate_setup(dev, IEEE80211_MODE_TURBO_A); + ath_rate_setup(dev, IEEE80211_MODE_TURBO_G); + + /* Setup for half/quarter rates */ + ath_setup_subrates(dev); + + /* NB: setup here so ath_rate_update is happy */ + ath_setcurmode(sc, IEEE80211_MODE_11A); + + /* + * Allocate tx+rx descriptors and populate the lists. + */ + error = ath_desc_alloc(sc); + if (error != 0) { + printk(KERN_ERR "%s: failed to allocate descriptors: %d\n", + dev->name, error); + goto bad; + } + + /* + * Init ic_caps prior to queue init, since WME cap setting + * depends on queue setup. + */ + ic->ic_caps = 0; + + /* + * Allocate hardware transmit queues: one queue for + * beacon frames and one data queue for each QoS + * priority. Note that the HAL handles resetting + * these queues at the needed time. + * + * XXX PS-Poll + */ + sc->sc_bhalq = ath_beaconq_setup(ah); + if (sc->sc_bhalq == (u_int) -1) { + printk(KERN_ERR "%s: unable to setup a beacon xmit queue!\n", + dev->name); + error = EIO; + goto bad2; + } + sc->sc_cabq = ath_txq_setup(sc, HAL_TX_QUEUE_CAB, 0); + if (sc->sc_cabq == NULL) { + printk(KERN_ERR "%s: unable to setup CAB xmit queue!\n", + dev->name); + error = EIO; + goto bad2; + } + /* NB: ensure BK queue is the lowest priority h/w queue */ + if (!ath_tx_setup(sc, WME_AC_BK, HAL_WME_AC_BK)) { + printk(KERN_ERR "%s: unable to setup xmit queue for %s traffic!\n", + dev->name, ieee80211_wme_acnames[WME_AC_BK]); + error = EIO; + goto bad2; + } + if (!ath_tx_setup(sc, WME_AC_BE, HAL_WME_AC_BE) || + !ath_tx_setup(sc, WME_AC_VI, HAL_WME_AC_VI) || + !ath_tx_setup(sc, WME_AC_VO, HAL_WME_AC_VO)) { + /* + * Not enough hardware tx queues to properly do WME; + * just punt and assign them all to the same h/w queue. + * We could do a better job of this if, for example, + * we allocate queues when we switch from station to + * AP mode. + */ + if (sc->sc_ac2q[WME_AC_VI] != NULL) + ath_tx_cleanupq(sc, sc->sc_ac2q[WME_AC_VI]); + if (sc->sc_ac2q[WME_AC_BE] != NULL) + ath_tx_cleanupq(sc, sc->sc_ac2q[WME_AC_BE]); + sc->sc_ac2q[WME_AC_BE] = sc->sc_ac2q[WME_AC_BK]; + sc->sc_ac2q[WME_AC_VI] = sc->sc_ac2q[WME_AC_BK]; + sc->sc_ac2q[WME_AC_VO] = sc->sc_ac2q[WME_AC_BK]; + } else { + /* + * Mark WME capability since we have sufficient + * hardware queues to do proper priority scheduling. + */ + ic->ic_caps |= IEEE80211_C_WME; + sc->sc_uapsdq = ath_txq_setup(sc, HAL_TX_QUEUE_UAPSD, 0); + if (sc->sc_uapsdq == NULL) + DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: unable to setup UAPSD xmit queue!\n", + __func__); + else { + ic->ic_caps |= IEEE80211_C_UAPSD; + /* + * default UAPSD on if HW capable + */ + IEEE80211_COM_UAPSD_ENABLE(ic); + } + } +#ifdef ATH_SUPERG_XR + ath_xr_rate_setup(dev); + sc->sc_xrpollint = XR_DEFAULT_POLL_INTERVAL; + sc->sc_xrpollcount = XR_DEFAULT_POLL_COUNT; + strcpy(sc->sc_grppoll_str, XR_DEFAULT_GRPPOLL_RATE_STR); + sc->sc_grpplq.axq_qnum = -1; + sc->sc_xrtxq = ath_txq_setup(sc, HAL_TX_QUEUE_DATA, HAL_XR_DATA); +#endif + + /* + * Special case certain configurations. Note the + * CAB queue is handled by these specially so don't + * include them when checking the txq setup mask. + */ + switch (sc->sc_txqsetup &~ ((1<sc_cabq->axq_qnum) | + (sc->sc_uapsdq ? (1<sc_uapsdq->axq_qnum) : 0))) { + case 0x01: + ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet_q0, dev); + break; + case 0x0f: + ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet_q0123, dev); + break; + } + + sc->sc_setdefantenna = ath_setdefantenna; + sc->sc_rc = ieee80211_rate_attach(sc, ratectl); + if (sc->sc_rc == NULL) { + error = EIO; + goto bad2; + } + + init_timer(&sc->sc_cal_ch); + sc->sc_cal_ch.function = ath_calibrate; + sc->sc_cal_ch.data = (unsigned long) dev; + +#ifdef ATH_SUPERG_DYNTURBO + init_timer(&sc->sc_dturbo_switch_mode); + sc->sc_dturbo_switch_mode.function = ath_turbo_switch_mode; + sc->sc_dturbo_switch_mode.data = (unsigned long) dev; +#endif + + sc->sc_blinking = 0; + sc->sc_ledstate = 1; + sc->sc_ledon = 0; /* low true */ + sc->sc_ledidle = msecs_to_jiffies(2700); /* 2.7 sec */ + sc->sc_dfstesttime = ATH_DFS_TEST_RETURN_PERIOD; + init_timer(&sc->sc_ledtimer); + init_timer(&sc->sc_dfswaittimer); + init_timer(&sc->sc_dfstesttimer); + sc->sc_ledtimer.data = (unsigned long) sc; + if (sc->sc_softled) { + ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); + } + + /* NB: ether_setup is done by bus-specific code */ + dev->open = ath_init; + dev->stop = ath_stop; + dev->hard_start_xmit = ath_hardstart; + dev->tx_timeout = ath_tx_timeout; + dev->watchdog_timeo = 5 * HZ; /* XXX */ + dev->set_multicast_list = ath_mode_init; + dev->do_ioctl = ath_ioctl; + dev->get_stats = ath_getstats; + dev->set_mac_address = ath_set_mac_address; + dev->change_mtu = ath_change_mtu; + dev->tx_queue_len = ATH_TXBUF - 1; /* 1 for mgmt frame */ +#ifdef USE_HEADERLEN_RESV + dev->hard_header_len += sizeof(struct ieee80211_qosframe) + + sizeof(struct llc) + + IEEE80211_ADDR_LEN + + IEEE80211_WEP_IVLEN + + IEEE80211_WEP_KIDLEN; +#ifdef ATH_SUPERG_FF + dev->hard_header_len += ATH_FF_MAX_HDR; +#endif +#endif + ic->ic_dev = dev; + ic->ic_mgtstart = ath_mgtstart; + ic->ic_init = ath_init; + ic->ic_reset = ath_reset; + ic->ic_newassoc = ath_newassoc; + ic->ic_updateslot = ath_updateslot; + + ic->ic_wme.wme_update = ath_wme_update; + ic->ic_uapsd_flush = ath_uapsd_flush; + + /* XXX not right but it's not used anywhere important */ + ic->ic_phytype = IEEE80211_T_OFDM; + ic->ic_opmode = IEEE80211_M_STA; + sc->sc_opmode = HAL_M_STA; + /* + * Set the Atheros Advanced Capabilities from station config before + * starting 802.11 state machine. Currently, set only fast-frames + * capability. + */ + ic->ic_ath_cap = 0; + sc->sc_fftxqmin = ATH_FF_TXQMIN; +#ifdef ATH_SUPERG_FF + ic->ic_ath_cap |= (ath_hal_fastframesupported(ah) ? IEEE80211_ATHC_FF : 0); +#endif + ic->ic_ath_cap |= (ath_hal_burstsupported(ah) ? IEEE80211_ATHC_BURST : 0); + +#ifdef ATH_SUPERG_COMP + ic->ic_ath_cap |= (ath_hal_compressionsupported(ah) ? IEEE80211_ATHC_COMP : 0); +#endif + +#ifdef ATH_SUPERG_DYNTURBO + ic->ic_ath_cap |= (ath_hal_turboagsupported(ah) ? (IEEE80211_ATHC_TURBOP | + IEEE80211_ATHC_AR) : 0); +#endif +#ifdef ATH_SUPERG_XR + ic->ic_ath_cap |= (ath_hal_xrsupported(ah) ? IEEE80211_ATHC_XR : 0); +#endif + + ic->ic_caps |= + IEEE80211_C_IBSS /* ibss, nee adhoc, mode */ + | IEEE80211_C_HOSTAP /* hostap mode */ + | IEEE80211_C_MONITOR /* monitor mode */ + | IEEE80211_C_AHDEMO /* adhoc demo mode */ + | IEEE80211_C_SHPREAMBLE /* short preamble supported */ + | IEEE80211_C_SHSLOT /* short slot time supported */ + | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ + | IEEE80211_C_BGSCAN /* capable of bg scanning */ + ; + /* + * Query the HAL to figure out h/w crypto support. + */ + if (ath_hal_ciphersupported(ah, HAL_CIPHER_WEP)) + ic->ic_caps |= IEEE80211_C_WEP; + if (ath_hal_ciphersupported(ah, HAL_CIPHER_AES_OCB)) + ic->ic_caps |= IEEE80211_C_AES; + if (ath_hal_ciphersupported(ah, HAL_CIPHER_AES_CCM)) + ic->ic_caps |= IEEE80211_C_AES_CCM; + if (ath_hal_ciphersupported(ah, HAL_CIPHER_CKIP)) + ic->ic_caps |= IEEE80211_C_CKIP; + if (ath_hal_ciphersupported(ah, HAL_CIPHER_TKIP)) { + ic->ic_caps |= IEEE80211_C_TKIP; + /* + * Check if h/w does the MIC and/or whether the + * separate key cache entries are required to + * handle both tx+rx MIC keys. + */ + if (ath_hal_ciphersupported(ah, HAL_CIPHER_MIC)) { + ic->ic_caps |= IEEE80211_C_TKIPMIC; + /* + * Check if h/w does MIC correctly when + * WMM is turned on. + */ + if (ath_hal_wmetkipmic(ah)) + ic->ic_caps |= IEEE80211_C_WME_TKIPMIC; + } + + /* + * If the h/w supports storing tx+rx MIC keys + * in one cache slot automatically enable use. + */ + if (ath_hal_hastkipsplit(ah) || + !ath_hal_settkipsplit(ah, AH_FALSE)) + sc->sc_splitmic = 1; + } + sc->sc_hasclrkey = ath_hal_ciphersupported(ah, HAL_CIPHER_CLR); +#if 0 + sc->sc_mcastkey = ath_hal_getmcastkeysearch(ah); +#endif + /* + * Mark key cache slots associated with global keys + * as in use. If we knew TKIP was not to be used we + * could leave the +32, +64, and +32+64 slots free. + */ + for (i = 0; i < IEEE80211_WEP_NKID; i++) { + setbit(sc->sc_keymap, i); + setbit(sc->sc_keymap, i+64); + if (sc->sc_splitmic) { + setbit(sc->sc_keymap, i+32); + setbit(sc->sc_keymap, i+32+64); + } + } + /* + * TPC support can be done either with a global cap or + * per-packet support. The latter is not available on + * all parts. We're a bit pedantic here as all parts + * support a global cap. + */ + sc->sc_hastpc = ath_hal_hastpc(ah); + if (sc->sc_hastpc || ath_hal_hastxpowlimit(ah)) + ic->ic_caps |= IEEE80211_C_TXPMGT; + + /* + * Default 11.h to start enabled. + */ + ic->ic_flags |= IEEE80211_F_DOTH; + + /* + * Check for misc other capabilities. + */ + if (ath_hal_hasbursting(ah)) + ic->ic_caps |= IEEE80211_C_BURST; + sc->sc_hasbmask = ath_hal_hasbssidmask(ah); + sc->sc_hastsfadd = ath_hal_hastsfadjust(ah); + /* + * Indicate we need the 802.11 header padded to a + * 32-bit boundary for 4-address and QoS frames. + */ + ic->ic_flags |= IEEE80211_F_DATAPAD; + + /* + * Query the HAL about antenna support + * Enable rx fast diversity if HAL has support + */ + if (ath_hal_hasdiversity(ah)) { + sc->sc_hasdiversity = 1; + ath_hal_setdiversity(ah, AH_TRUE); + sc->sc_diversity = 1; + } else { + sc->sc_hasdiversity = 0; + sc->sc_diversity = 0; + ath_hal_setdiversity(ah, AH_FALSE); + } + sc->sc_defant = ath_hal_getdefantenna(ah); + + /* + * Not all chips have the VEOL support we want to + * use with IBSS beacons; check here for it. + */ + sc->sc_hasveol = ath_hal_hasveol(ah); + + /* Interference Mitigation causes problems with recevive sensitivity + * for OFDM rates when we are in non-STA modes. We will turn this + * capability off in non-STA VAPs + */ + sc->sc_hasintmit = ath_hal_hasintmit(ah); + sc->sc_useintmit = 1; + + /* get mac address from hardware */ + ath_hal_getmac(ah, ic->ic_myaddr); + if (sc->sc_hasbmask) { + ath_hal_getbssidmask(ah, sc->sc_bssidmask); + ATH_SET_VAP_BSSID_MASK(sc->sc_bssidmask); + ath_hal_setbssidmask(ah, sc->sc_bssidmask); + } + IEEE80211_ADDR_COPY(dev->dev_addr, ic->ic_myaddr); + + /* call MI attach routine. */ + ieee80211_ifattach(ic); + /* override default methods */ + ic->ic_node_alloc = ath_node_alloc; + sc->sc_node_free = ic->ic_node_free; + ic->ic_node_free = ath_node_free; + ic->ic_node_getrssi = ath_node_getrssi; +#ifdef ATH_SUPERG_XR + ic->ic_node_move_data = ath_node_move_data; +#endif + sc->sc_node_cleanup = ic->ic_node_cleanup; + ic->ic_node_cleanup = ath_node_cleanup; + sc->sc_recv_mgmt = ic->ic_recv_mgmt; + ic->ic_recv_mgmt = ath_recv_mgmt; + + ic->ic_vap_create = ath_vap_create; + ic->ic_vap_delete = ath_vap_delete; + + ic->ic_scan_start = ath_scan_start; + ic->ic_scan_end = ath_scan_end; + ic->ic_set_channel = ath_set_channel; + + ic->ic_set_coverageclass = ath_set_coverageclass; + ic->ic_mhz2ieee = ath_mhz2ieee; + + if (register_netdev(dev)) { + printk(KERN_ERR "%s: unable to register device\n", dev->name); + goto bad3; + } + /* + * Attach dynamic MIB vars and announce support + * now that we have a device name with unit number. + */ + ath_dynamic_sysctl_register(sc); + ieee80211_announce(ic); + ath_announce(dev); +#ifdef ATH_TX99_DIAG + printk("%s: TX99 support enabled\n", dev->name); +#endif + sc->sc_invalid = 0; + + if (autocreate) { + if (!strcmp(autocreate, "none")) + autocreatemode = -1; + else if (!strcmp(autocreate, "sta")) + autocreatemode = IEEE80211_M_STA; + else if (!strcmp(autocreate, "ap")) + autocreatemode = IEEE80211_M_HOSTAP; + else if (!strcmp(autocreate, "adhoc")) + autocreatemode = IEEE80211_M_IBSS; + else if (!strcmp(autocreate, "ahdemo")) + autocreatemode = IEEE80211_M_AHDEMO; + else if (!strcmp(autocreate, "wds")) + autocreatemode = IEEE80211_M_WDS; + else if (!strcmp(autocreate, "monitor")) + autocreatemode = IEEE80211_M_MONITOR; + else { + printk(KERN_INFO "Unknown autocreate mode: %s\n", + autocreate); + autocreatemode = -1; + } + } + + if (autocreatemode != -1) { + rtnl_lock(); + error = ieee80211_create_vap(ic, "ath%d", dev, + autocreatemode, IEEE80211_CLONE_BSSID); + rtnl_unlock(); + if (error) + printk(KERN_ERR "%s: autocreation of VAP failed: %d\n", + dev->name, error); + } + + return 0; +bad3: + ieee80211_ifdetach(ic); + ieee80211_rate_detach(sc->sc_rc); +bad2: + ath_tx_cleanup(sc); + ath_desc_free(sc); +bad: + if (ah) + ath_hal_detach(ah); + ATH_TXBUF_LOCK_DESTROY(sc); + ATH_LOCK_DESTROY(sc); + sc->sc_invalid = 1; + + return error; +} + +int +ath_detach(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + + HAL_INT tmp; + DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); + ath_stop(dev); + + ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); + /* Flush the radar task if it's scheduled */ + if (sc->sc_rtasksched == 1) + flush_scheduled_work(); + + sc->sc_invalid = 1; + + /* + * NB: the order of these is important: + * o call the 802.11 layer before detaching the HAL to + * ensure callbacks into the driver to delete global + * key cache entries can be handled + * o reclaim the tx queue data structures after calling + * the 802.11 layer as we'll get called back to reclaim + * node state and potentially want to use them + * o to cleanup the tx queues the HAL is called, so detach + * it last + * Other than that, it's straightforward... + */ + ieee80211_ifdetach(&sc->sc_ic); + + ath_hal_intrset(ah, 0); /* disable further intr's */ + ath_hal_getisr(ah, &tmp); /* clear ISR */ + if(dev->irq) { + free_irq(dev->irq, dev); + dev->irq = 0; + } +#ifdef ATH_TX99_DIAG + if (sc->sc_tx99 != NULL) + sc->sc_tx99->detach(sc->sc_tx99); +#endif + ieee80211_rate_detach(sc->sc_rc); + ath_desc_free(sc); + ath_tx_cleanup(sc); + ath_hal_detach(ah); + kfree(sc->sc_bslot); + sc->sc_bslot = NULL; + + ath_dynamic_sysctl_unregister(sc); + ATH_LOCK_DESTROY(sc); + dev->stop = NULL; /* prevent calling ath_stop again */ + unregister_netdev(dev); + return 0; +} + +static struct ieee80211vap * +ath_vap_create(struct ieee80211com *ic, const char *name, int unit, + int opmode, int flags, struct net_device *mdev) +{ + struct ath_softc *sc = ic->ic_dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct net_device *dev; + struct ath_vap *avp; + struct ieee80211vap *vap; + int ic_opmode; + + if (ic->ic_dev->flags & IFF_RUNNING) { + /* needs to disable hardware too */ + ath_hal_intrset(ah, 0); /* disable interrupts */ + ath_draintxq(sc); /* stop xmit side */ + ath_stoprecv(sc); /* stop recv side */ + } + /* XXX ic unlocked and race against add */ + switch (opmode) { + case IEEE80211_M_STA: /* ap+sta for repeater application */ + if (sc->sc_nstavaps != 0) /* only one sta regardless */ + return NULL; + if ((sc->sc_nvaps != 0) && (!(flags & IEEE80211_NO_STABEACONS))) + return NULL; /* If using station beacons, must first up */ + if (flags & IEEE80211_NO_STABEACONS) { + sc->sc_nostabeacons = 1; + ic_opmode = IEEE80211_M_HOSTAP; /* Run with chip in AP mode */ + } else + ic_opmode = opmode; + break; + case IEEE80211_M_IBSS: + if (sc->sc_nvaps != 0) /* only one */ + return NULL; + ic_opmode = opmode; + break; + case IEEE80211_M_AHDEMO: + case IEEE80211_M_MONITOR: + if (sc->sc_nvaps != 0 && ic->ic_opmode != opmode) { + /* preserve existing mode */ + ic_opmode = ic->ic_opmode; + } else + ic_opmode = opmode; + break; + case IEEE80211_M_HOSTAP: + case IEEE80211_M_WDS: + /* permit multiple ap's and/or wds links */ + /* XXX sta+ap for repeater/bridge application */ + if ((sc->sc_nvaps != 0) && (ic->ic_opmode == IEEE80211_M_STA)) + return NULL; + /* XXX not right, beacon buffer is allocated on RUN trans */ + if (opmode == IEEE80211_M_HOSTAP && STAILQ_EMPTY(&sc->sc_bbuf)) + return NULL; + /* + * XXX Not sure if this is correct when operating only + * with WDS links. + */ + ic_opmode = IEEE80211_M_HOSTAP; + + break; + default: + return NULL; + } + + if (sc->sc_nvaps >= ath_maxvaps) { + printk(KERN_WARNING "too many virtual ap's (already got %d)\n", sc->sc_nvaps); + return NULL; + } + + dev = alloc_etherdev(sizeof(struct ath_vap) + sc->sc_rc->arc_vap_space); + if (dev == NULL) { + /* XXX msg */ + return NULL; + } + + avp = dev->priv; + ieee80211_vap_setup(ic, dev, name, unit, opmode, flags); + /* override with driver methods */ + vap = &avp->av_vap; + avp->av_newstate = vap->iv_newstate; + vap->iv_newstate = ath_newstate; + vap->iv_key_alloc = ath_key_alloc; + vap->iv_key_delete = ath_key_delete; + vap->iv_key_set = ath_key_set; + vap->iv_key_update_begin = ath_key_update_begin; + vap->iv_key_update_end = ath_key_update_end; +#ifdef ATH_SUPERG_COMP + vap->iv_comp_set = ath_comp_set; +#endif + + /* Let rate control register proc entries for the VAP */ + if (sc->sc_rc->ops->dynamic_proc_register) + sc->sc_rc->ops->dynamic_proc_register(vap); + + /* + * Change the interface type for monitor mode. + */ + if (opmode == IEEE80211_M_MONITOR) + dev->type = ARPHRD_IEEE80211_RADIOTAP; + if ((flags & IEEE80211_CLONE_BSSID) && + sc->sc_nvaps != 0 && opmode != IEEE80211_M_WDS && sc->sc_hasbmask) { + struct ieee80211vap *v; + uint64_t id_mask; + unsigned int id; + + /* + * Hardware supports the bssid mask and a unique + * bssid was requested. Assign a new mac address + * and expand our bssid mask to cover the active + * virtual ap's with distinct addresses. + */ + + /* do a full search to mark all the allocated VAPs */ + id_mask = 0; + TAILQ_FOREACH(v, &ic->ic_vaps, iv_next) + id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr)); + + for (id = 0; id < ath_maxvaps; id++) { + /* get the first available slot */ + if ((id_mask & (1 << id)) == 0) { + ATH_SET_VAP_BSSID(vap->iv_myaddr, id); + break; + } + } + } + avp->av_bslot = -1; + STAILQ_INIT(&avp->av_mcastq.axq_q); + ATH_TXQ_LOCK_INIT(&avp->av_mcastq); + if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_IBSS) { + /* + * Allocate beacon state for hostap/ibss. We know + * a buffer is available because of the check above. + */ + avp->av_bcbuf = STAILQ_FIRST(&sc->sc_bbuf); + STAILQ_REMOVE_HEAD(&sc->sc_bbuf, bf_list); + if (opmode == IEEE80211_M_HOSTAP || !sc->sc_hasveol) { + int slot; + /* + * Assign the VAP to a beacon xmit slot. As + * above, this cannot fail to find one. + */ + avp->av_bslot = 0; + for (slot = 0; slot < ath_maxvaps; slot++) + if (sc->sc_bslot[slot] == NULL) { + /* + * XXX hack, space out slots to better + * deal with misses + */ + if (slot + 1 < ath_maxvaps && + sc->sc_bslot[slot+1] == NULL) { + avp->av_bslot = slot + 1; + break; + } + avp->av_bslot = slot; + /* NB: keep looking for a double slot */ + } + KASSERT(sc->sc_bslot[avp->av_bslot] == NULL, + ("beacon slot %u not empty?", avp->av_bslot)); + sc->sc_bslot[avp->av_bslot] = vap; + sc->sc_nbcnvaps++; + } + if ((opmode == IEEE80211_M_HOSTAP) && (sc->sc_hastsfadd)) { + /* + * Multiple VAPs are to transmit beacons and we + * have h/w support for TSF adjusting; enable use + * of staggered beacons. + */ + /* XXX check for beacon interval too small */ + if (ath_maxvaps > 4) { + DPRINTF(sc, ATH_DEBUG_BEACON, + "Staggered beacons are not possible " + "with maxvaps set to %d.\n", + ath_maxvaps); + sc->sc_stagbeacons = 0; + } else { + sc->sc_stagbeacons = 1; + } + } + DPRINTF(sc, ATH_DEBUG_BEACON, "sc->stagbeacons %sabled\n", + (sc->sc_stagbeacons ? "en" : "dis")); + } + if (sc->sc_hastsfadd) + ath_hal_settsfadjust(sc->sc_ah, sc->sc_stagbeacons); + SET_NETDEV_DEV(dev, ATH_GET_NETDEV_DEV(mdev)); + /* complete setup */ + (void) ieee80211_vap_attach(vap, + ieee80211_media_change, ieee80211_media_status); + + ic->ic_opmode = ic_opmode; + + if (opmode != IEEE80211_M_WDS) + sc->sc_nvaps++; + + if (opmode == IEEE80211_M_STA) + sc->sc_nstavaps++; + else if (opmode == IEEE80211_M_MONITOR) + sc->sc_nmonvaps++; + /* + * Adhoc demo mode is a pseudo mode; to the HAL it's + * just ibss mode and the driver doesn't use management + * frames. Other modes carry over directly to the HAL. + */ + if (ic->ic_opmode == IEEE80211_M_AHDEMO) + sc->sc_opmode = HAL_M_IBSS; + else + sc->sc_opmode = (HAL_OPMODE) ic->ic_opmode; /* NB: compatible */ + +#ifdef ATH_SUPERG_XR + if ( vap->iv_flags & IEEE80211_F_XR ) { + if (ath_descdma_setup(sc, &sc->sc_grppolldma, &sc->sc_grppollbuf, + "grppoll", (sc->sc_xrpollcount+1) * HAL_ANTENNA_MAX_MODE, 1) != 0) + printk("%s:grppoll Buf allocation failed \n",__func__); + if (!sc->sc_xrtxq) + sc->sc_xrtxq = ath_txq_setup(sc, HAL_TX_QUEUE_DATA, HAL_XR_DATA); + if (sc->sc_hasdiversity) { + /* Save current diversity state if user destroys XR VAP */ + sc->sc_olddiversity = sc->sc_diversity; + ath_hal_setdiversity(sc->sc_ah, 0); + sc->sc_diversity = 0; + } + } +#endif + if (ic->ic_dev->flags & IFF_RUNNING) { + /* restart hardware */ + if (ath_startrecv(sc) != 0) /* restart recv */ + printk("%s: %s: unable to start recv logic\n", + dev->name, __func__); + if (sc->sc_beacons) + ath_beacon_config(sc, NULL); /* restart beacons */ + ath_hal_intrset(ah, sc->sc_imask); + } + + return vap; +} + +static void +ath_vap_delete(struct ieee80211vap *vap) +{ + struct net_device *dev = vap->iv_ic->ic_dev; + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ath_vap *avp = ATH_VAP(vap); + int decrease = 1; + int i; + KASSERT(vap->iv_state == IEEE80211_S_INIT, ("VAP not stopped")); + + if (dev->flags & IFF_RUNNING) { + /* + * Quiesce the hardware while we remove the VAP. In + * particular we need to reclaim all references to the + * VAP state by any frames pending on the tx queues. + * + * XXX can we do this w/o affecting other VAPs? + */ + ath_hal_intrset(ah, 0); /* disable interrupts */ + ath_draintxq(sc); /* stop xmit side */ + ath_stoprecv(sc); /* stop recv side */ + } + + /* + * Reclaim any pending mcast bufs on the VAP. + */ + ath_tx_draintxq(sc, &avp->av_mcastq); + ATH_TXQ_LOCK_DESTROY(&avp->av_mcastq); + + /* + * Reclaim beacon state. Note this must be done before + * VAP instance is reclaimed as we may have a reference + * to it in the buffer for the beacon frame. + */ + if (avp->av_bcbuf != NULL) { + if (avp->av_bslot != -1) { + sc->sc_bslot[avp->av_bslot] = NULL; + sc->sc_nbcnvaps--; + } + ath_beacon_return(sc, avp->av_bcbuf); + avp->av_bcbuf = NULL; + if (sc->sc_nbcnvaps == 0) + sc->sc_stagbeacons = 0; + } + if (vap->iv_opmode == IEEE80211_M_STA) { + sc->sc_nstavaps--; + if (sc->sc_nostabeacons) + sc->sc_nostabeacons = 0; + } else if (vap->iv_opmode == IEEE80211_M_MONITOR) { + sc->sc_nmonvaps--; + } else if (vap->iv_opmode == IEEE80211_M_WDS) { + decrease = 0; + } + ieee80211_vap_detach(vap); + /* NB: memory is reclaimed through dev->destructor callback */ + if (decrease) + sc->sc_nvaps--; + +#ifdef ATH_SUPERG_XR + /* + * If it's an XR VAP, free the memory allocated explicitly. + * Since the XR VAP is not registered, OS cannot free the memory. + */ + if (vap->iv_flags & IEEE80211_F_XR) { + ath_grppoll_stop(vap); + ath_descdma_cleanup(sc, &sc->sc_grppolldma, &sc->sc_grppollbuf, BUS_DMA_FROMDEVICE); + memset(&sc->sc_grppollbuf, 0, sizeof(sc->sc_grppollbuf)); + memset(&sc->sc_grppolldma, 0, sizeof(sc->sc_grppolldma)); + if (vap->iv_xrvap) + vap->iv_xrvap->iv_xrvap = NULL; + kfree(vap->iv_dev); + ath_tx_cleanupq(sc,sc->sc_xrtxq); + sc->sc_xrtxq = NULL; + if (sc->sc_hasdiversity) { + /* Restore diversity setting to old diversity setting */ + ath_hal_setdiversity(ah, sc->sc_olddiversity); + sc->sc_diversity = sc->sc_olddiversity; + } + } +#endif + + for (i = 0; i < IEEE80211_APPIE_NUM_OF_FRAME; i++) { + if (vap->app_ie[i].ie != NULL) { + FREE(vap->app_ie[i].ie, M_DEVBUF); + vap->app_ie[i].ie = NULL; + vap->app_ie[i].length = 0; + } + } + + if (dev->flags & IFF_RUNNING) { + /* + * Restart rx+tx machines if device is still running. + */ + if (ath_startrecv(sc) != 0) /* restart recv */ + printk("%s: %s: unable to start recv logic\n", + dev->name, __func__); + if (sc->sc_beacons) + ath_beacon_config(sc, NULL); /* restart beacons */ + ath_hal_intrset(ah, sc->sc_imask); + } +} + +void +ath_suspend(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + + DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); + ath_stop(dev); +} + +void +ath_resume(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + + DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); + ath_init(dev); +} + +static void +ath_uapsd_processtriggers(struct ath_softc *sc) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + struct ath_desc *ds; + struct sk_buff *skb; + struct ieee80211_node *ni; + struct ath_node *an; + struct ieee80211_qosframe *qwh; + struct ath_txq *uapsd_xmit_q = sc->sc_uapsdq; + struct ieee80211com *ic = &sc->sc_ic; + int ac, retval; + u_int8_t tid; + u_int16_t frame_seq; + u_int64_t tsf; +#define PA2DESC(_sc, _pa) \ + ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ + ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) + + /* XXXAPSD: build in check against max triggers we could see + * based on ic->ic_uapsdmaxtriggers. + */ + + tsf = ath_hal_gettsf64(ah); + ATH_RXBUF_LOCK(sc); + if (sc->sc_rxbufcur == NULL) + sc->sc_rxbufcur = STAILQ_FIRST(&sc->sc_rxbuf); + for (bf = sc->sc_rxbufcur; bf; bf = STAILQ_NEXT(bf, bf_list)) { + ds = bf->bf_desc; + if (ds->ds_link == bf->bf_daddr) { + /* NB: never process the self-linked entry at the end */ + break; + } + if (bf->bf_status & ATH_BUFSTATUS_DONE) { + /* + * already processed this buffer (shouldn't occur if + * we change code to always process descriptors in + * rx intr handler - as opposed to sometimes processing + * in the rx tasklet). + */ + continue; + } + skb = bf->bf_skb; + if (skb == NULL) { /* XXX ??? can this happen */ + printk("%s: no skbuff\n", __func__); + continue; + } + + /* + * XXXAPSD: consider new HAL call that does only the subset + * of ath_hal_rxprocdesc we require for trigger search. + */ + + /* + * NB: descriptor memory doesn't need to be sync'd + * due to the way it was allocated. + */ + + /* + * Must provide the virtual address of the current + * descriptor, the physical address, and the virtual + * address of the next descriptor in the h/w chain. + * This allows the HAL to look ahead to see if the + * hardware is done with a descriptor by checking the + * done bit in the following descriptor and the address + * of the current descriptor the DMA engine is working + * on. All this is necessary because of our use of + * a self-linked list to avoid rx overruns. + */ + retval = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, PA2DESC(sc, ds->ds_link), tsf); + if (HAL_EINPROGRESS == retval) + break; + + /* XXX: we do not support frames spanning multiple descriptors */ + bf->bf_status |= ATH_BUFSTATUS_DONE; + + /* errors? */ + if (ds->ds_rxstat.rs_status) + continue; + + /* prepare wireless header for examination */ + bus_dma_sync_single(sc->sc_bdev, bf->bf_skbaddr, + sizeof(struct ieee80211_qosframe), + BUS_DMA_FROMDEVICE); + qwh = (struct ieee80211_qosframe *) skb->data; + + /* find the node. it MUST be in the keycache. */ + if (ds->ds_rxstat.rs_keyix == HAL_RXKEYIX_INVALID || + (ni = sc->sc_keyixmap[ds->ds_rxstat.rs_keyix]) == NULL) { + /* + * XXX: this can occur if WEP mode is used for non-Atheros clients + * (since we do not know which of the 4 WEP keys will be used + * at association time, so cannot setup a key-cache entry. + * The Atheros client can convey this in the Atheros IE.) + * + * TODO: The fix is to use the hash lookup on the node here. + */ +#if 0 + /* + * This print is very chatty, so removing for now. + */ + DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: U-APSD node (%s) has invalid keycache entry\n", + __func__, ether_sprintf(qwh->i_addr2)); +#endif + continue; + } + + if (!(ni->ni_flags & IEEE80211_NODE_UAPSD)) + continue; + + /* + * Must deal with change of state here, since otherwise there would + * be a race (on two quick frames from STA) between this code and the + * tasklet where we would: + * - miss a trigger on entry to PS if we're already trigger hunting + * - generate spurious SP on exit (due to frame following exit frame) + */ + if (((qwh->i_fc[1] & IEEE80211_FC1_PWR_MGT) ^ + (ni->ni_flags & IEEE80211_NODE_PWR_MGT))) { + /* + * NB: do not require lock here since this runs at intr + * "proper" time and cannot be interrupted by rx tasklet + * (code there has lock). May want to place a macro here + * (that does nothing) to make this more clear. + */ + ni->ni_flags |= IEEE80211_NODE_PS_CHANGED; + ni->ni_pschangeseq = *(__le16 *)(&qwh->i_seq[0]); + ni->ni_flags &= ~IEEE80211_NODE_UAPSD_SP; + ni->ni_flags ^= IEEE80211_NODE_PWR_MGT; + if (qwh->i_fc[1] & IEEE80211_FC1_PWR_MGT) { + ni->ni_flags |= IEEE80211_NODE_UAPSD_TRIG; + ic->ic_uapsdmaxtriggers++; + WME_UAPSD_NODE_TRIGSEQINIT(ni); + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: Node (%s) became U-APSD triggerable (%d)\n", + __func__, ether_sprintf(qwh->i_addr2), + ic->ic_uapsdmaxtriggers); + } else { + ni->ni_flags &= ~IEEE80211_NODE_UAPSD_TRIG; + ic->ic_uapsdmaxtriggers--; + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: Node (%s) no longer U-APSD triggerable (%d)\n", + __func__, ether_sprintf(qwh->i_addr2), + ic->ic_uapsdmaxtriggers); + /* + * XXX: rapidly thrashing sta could get + * out-of-order frames due this flush placing + * frames on backlogged regular AC queue and + * re-entry to PS having fresh arrivals onto + * faster UPSD delivery queue. if this is a + * big problem we may need to drop these. + */ + ath_uapsd_flush(ni); + } + + continue; + } + + if (ic->ic_uapsdmaxtriggers == 0) + continue; + + /* make sure the frame is QoS data/null */ + /* NB: with current sub-type definitions, the + * IEEE80211_FC0_SUBTYPE_QOS check, below, covers the + * QoS null case too. + */ + if (((qwh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_DATA) || + !(qwh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS)) + continue; + + /* + * To be a trigger: + * - node is in triggerable state + * - QoS data/null frame with triggerable AC + */ + tid = qwh->i_qos[0] & IEEE80211_QOS_TID; + ac = TID_TO_WME_AC(tid); + if (!WME_UAPSD_AC_CAN_TRIGGER(ac, ni)) + continue; + + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: U-APSD trigger detected for node (%s) on AC %d\n", + __func__, ether_sprintf(ni->ni_macaddr), ac); + if (ni->ni_flags & IEEE80211_NODE_UAPSD_SP) { + /* have trigger, but SP in progress, so ignore */ + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: SP already in progress - ignoring\n", + __func__); + continue; + } + + /* + * Detect duplicate triggers and drop if so. + */ + frame_seq = le16toh(*(__le16 *)qwh->i_seq); + if ((qwh->i_fc[1] & IEEE80211_FC1_RETRY) && + frame_seq == ni->ni_uapsd_trigseq[ac]) { + DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: dropped dup trigger, ac %d, seq %d\n", + __func__, ac, frame_seq); + continue; + } + + an = ATH_NODE(ni); + + /* start the SP */ + ATH_NODE_UAPSD_LOCK(an); + ni->ni_stats.ns_uapsd_triggers++; + ni->ni_flags |= IEEE80211_NODE_UAPSD_SP; + ni->ni_uapsd_trigseq[ac] = frame_seq; + ATH_NODE_UAPSD_UNLOCK(an); + + ATH_TXQ_LOCK(uapsd_xmit_q); + if (STAILQ_EMPTY(&an->an_uapsd_q)) { + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: Queue empty, generating QoS NULL to send\n", + __func__); + /* + * Empty queue, so need to send QoS null on this ac. Make a + * call that will dump a QoS null onto the node's queue, then + * we can proceed as normal. + */ + ieee80211_send_qosnulldata(ni, ac); + } + + if (STAILQ_FIRST(&an->an_uapsd_q)) { + struct ath_buf *last_buf = STAILQ_LAST(&an->an_uapsd_q, ath_buf, bf_list); + struct ath_desc *last_desc = last_buf->bf_desc; + struct ieee80211_qosframe *qwhl = (struct ieee80211_qosframe *)last_buf->bf_skb->data; + /* + * NB: flip the bit to cause intr on the EOSP desc, + * which is the last one + */ + ath_hal_txreqintrdesc(sc->sc_ah, last_desc); + qwhl->i_qos[0] |= IEEE80211_QOS_EOSP; + + if (IEEE80211_VAP_EOSPDROP_ENABLED(ni->ni_vap)) { + /* simulate lost EOSP */ + qwhl->i_addr1[0] |= 0x40; + } + + /* more data bit only for EOSP frame */ + if (an->an_uapsd_overflowqdepth) + qwhl->i_fc[1] |= IEEE80211_FC1_MORE_DATA; + else if (IEEE80211_NODE_UAPSD_USETIM(ni)) + ni->ni_vap->iv_set_tim(ni, 0); + + ni->ni_stats.ns_tx_uapsd += an->an_uapsd_qdepth; + + bus_dma_sync_single(sc->sc_bdev, last_buf->bf_skbaddr, + sizeof(*qwhl), BUS_DMA_TODEVICE); + + if (uapsd_xmit_q->axq_link) { +#ifdef AH_NEED_DESC_SWAP + *uapsd_xmit_q->axq_link = cpu_to_le32(STAILQ_FIRST(&an->an_uapsd_q)->bf_daddr); +#else + *uapsd_xmit_q->axq_link = STAILQ_FIRST(&an->an_uapsd_q)->bf_daddr; +#endif + } + /* below leaves an_uapsd_q NULL */ + STAILQ_CONCAT(&uapsd_xmit_q->axq_q, &an->an_uapsd_q); + uapsd_xmit_q->axq_link = &last_desc->ds_link; + ath_hal_puttxbuf(sc->sc_ah, + uapsd_xmit_q->axq_qnum, + (STAILQ_FIRST(&uapsd_xmit_q->axq_q))->bf_daddr); + ath_hal_txstart(sc->sc_ah, uapsd_xmit_q->axq_qnum); + } + an->an_uapsd_qdepth = 0; + + ATH_TXQ_UNLOCK(uapsd_xmit_q); + } + sc->sc_rxbufcur = bf; + ATH_RXBUF_UNLOCK(sc); +#undef PA2DESC +} + +/* + * Interrupt handler. Most of the actual processing is deferred. + */ +irqreturn_t +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) +ath_intr(int irq, void *dev_id) +#else +ath_intr(int irq, void *dev_id, struct pt_regs *regs) +#endif +{ + struct net_device *dev = dev_id; + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + HAL_INT status; + int needmark; + + if (sc->sc_invalid) { + /* + * The hardware is not ready/present, don't touch anything. + * Note this can happen early on if the IRQ is shared. + */ + return IRQ_NONE; + } + if (!ath_hal_intrpend(ah)) /* shared irq, not for us */ + return IRQ_NONE; + if ((dev->flags & (IFF_RUNNING | IFF_UP)) != (IFF_RUNNING | IFF_UP)) { + DPRINTF(sc, ATH_DEBUG_INTR, "%s: flags 0x%x\n", + __func__, dev->flags); + ath_hal_getisr(ah, &status); /* clear ISR */ + ath_hal_intrset(ah, 0); /* disable further intr's */ + return IRQ_HANDLED; + } + needmark = 0; + /* + * Figure out the reason(s) for the interrupt. Note + * that the HAL returns a pseudo-ISR that may include + * bits we haven't explicitly enabled so we mask the + * value to ensure we only process bits we requested. + */ + ath_hal_getisr(ah, &status); /* NB: clears ISR too */ + DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status); + status &= sc->sc_imask; /* discard unasked for bits */ + if (status & HAL_INT_FATAL) { + sc->sc_stats.ast_hardware++; + ath_hal_intrset(ah, 0); /* disable intr's until reset */ + ATH_SCHEDULE_TQUEUE(&sc->sc_fataltq, &needmark); + } else if (status & HAL_INT_RXORN) { + sc->sc_stats.ast_rxorn++; + ath_hal_intrset(ah, 0); /* disable intr's until reset */ + ATH_SCHEDULE_TQUEUE(&sc->sc_rxorntq, &needmark); + } else { + if (status & HAL_INT_SWBA) { + /* + * Software beacon alert--time to send a beacon. + * Handle beacon transmission directly; deferring + * this is too slow to meet timing constraints + * under load. + */ + ath_beacon_send(sc, &needmark); + } + if (status & HAL_INT_RXEOL) { + /* + * NB: the hardware should re-read the link when + * RXE bit is written, but it doesn't work at + * least on older hardware revs. + */ + sc->sc_stats.ast_rxeol++; + } + if (status & HAL_INT_TXURN) { + sc->sc_stats.ast_txurn++; + /* bump tx trigger level */ + ath_hal_updatetxtriglevel(ah, AH_TRUE); + } + if (status & HAL_INT_RX) { + ath_uapsd_processtriggers(sc); + /* Get the noise floor data in interrupt context as we can't get it + * per frame, so we need to get it as soon as possible (i.e. the tasklet + * might take too long to fire */ + ath_hal_process_noisefloor(ah); + sc->sc_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan)); + ATH_SCHEDULE_TQUEUE(&sc->sc_rxtq, &needmark); + } + if (status & HAL_INT_TX) { +#ifdef ATH_SUPERG_DYNTURBO + /* + * Check if the beacon queue caused the interrupt + * when a dynamic turbo switch + * is pending so we can initiate the change. + * XXX must wait for all VAPs' beacons + */ + + if (sc->sc_dturbo_switch) { + u_int32_t txqs = (1 << sc->sc_bhalq); + ath_hal_gettxintrtxqs(ah, &txqs); + if(txqs & (1 << sc->sc_bhalq)) { + sc->sc_dturbo_switch = 0; + /* + * Hack: defer switch for 10ms to permit slow + * clients time to track us. This especially + * noticeable with Windows clients. + */ + mod_timer(&sc->sc_dturbo_switch_mode, + jiffies + msecs_to_jiffies(10)); + } + } +#endif + ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark); + } + if (status & HAL_INT_BMISS) { + sc->sc_stats.ast_bmiss++; + ATH_SCHEDULE_TQUEUE(&sc->sc_bmisstq, &needmark); + } + if (status & HAL_INT_MIB) { + sc->sc_stats.ast_mib++; + /* + * Disable interrupts until we service the MIB + * interrupt; otherwise it will continue to fire. + */ + ath_hal_intrset(ah, 0); + /* + * Let the HAL handle the event. We assume it will + * clear whatever condition caused the interrupt. + */ + ath_hal_mibevent(ah, &sc->sc_halstats); + ath_hal_intrset(ah, sc->sc_imask); + } + } + if (needmark) + mark_bh(IMMEDIATE_BH); + return IRQ_HANDLED; +} + +static void +ath_radar_task(struct work_struct *thr) +{ + struct ath_softc *sc = container_of(thr, struct ath_softc, sc_radartask); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_channel ichan; + HAL_CHANNEL hchan; + + sc->sc_rtasksched = 0; + if (ath_hal_procdfs(ah, &hchan)) { + /* + * DFS was found, initiate channel change + */ + ichan.ic_ieee = ath_hal_mhz2ieee(ah, hchan.channel, hchan.channelFlags); + ichan.ic_freq = hchan.channel; + ichan.ic_flags = hchan.channelFlags; + + if ((sc->sc_curchan.channel == hchan.channel) && + (sc->sc_curchan.channelFlags == hchan.channel)) { + if (hchan.privFlags & CHANNEL_INTERFERENCE) + sc->sc_curchan.privFlags |= CHANNEL_INTERFERENCE; + } + ieee80211_mark_dfs(ic, &ichan); + if (((ic->ic_flags_ext & IEEE80211_FEXT_MARKDFS) == 0) && + (ic->ic_opmode == IEEE80211_M_HOSTAP)) { + sc->sc_dfstest_ieeechan = ic->ic_curchan->ic_ieee; + sc->sc_dfstesttimer.function = ath_dfs_test_return; + sc->sc_dfstesttimer.expires = jiffies + (sc->sc_dfstesttime * HZ); + sc->sc_dfstesttimer.data = (unsigned long)sc; + if (sc->sc_dfstest == 0) { + sc->sc_dfstest = 1; + add_timer(&sc->sc_dfstesttimer); + } + } + } +} + +static void +ath_dfs_test_return(unsigned long data) +{ + struct ath_softc *sc = (struct ath_softc *)data; + struct ieee80211com *ic = &sc->sc_ic; + + sc->sc_dfstest = 0; + ieee80211_dfs_test_return(ic, sc->sc_dfstest_ieeechan); +} + +static void +ath_fatal_tasklet(TQUEUE_ARG data) +{ + struct net_device *dev = (struct net_device *)data; + + printk("%s: hardware error; resetting\n", dev->name); + ath_reset(dev); +} + +static void +ath_rxorn_tasklet(TQUEUE_ARG data) +{ + struct net_device *dev = (struct net_device *)data; + + printk("%s: rx FIFO overrun; resetting\n", dev->name); + ath_reset(dev); +} + +static void +ath_bmiss_tasklet(TQUEUE_ARG data) +{ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + + if (time_before(jiffies, sc->sc_ic.ic_bmiss_guard)) { + /* Beacon miss interrupt occured too short after last beacon + * timer configuration. Ignore it as it could be spurious. */ + DPRINTF(sc, ATH_DEBUG_ANY, "%s: ignored\n", __func__); + } else { + DPRINTF(sc, ATH_DEBUG_ANY, "%s\n", __func__); + ieee80211_beacon_miss(&sc->sc_ic); + } +} + +static u_int +ath_chan2flags(struct ieee80211_channel *chan) +{ + u_int flags; + static const u_int modeflags[] = { + 0, /* IEEE80211_MODE_AUTO */ + CHANNEL_A, /* IEEE80211_MODE_11A */ + CHANNEL_B, /* IEEE80211_MODE_11B */ + CHANNEL_PUREG, /* IEEE80211_MODE_11G */ + 0, /* IEEE80211_MODE_FH */ + CHANNEL_108A, /* IEEE80211_MODE_TURBO_A */ + CHANNEL_108G, /* IEEE80211_MODE_TURBO_G */ + }; + + flags = modeflags[ieee80211_chan2mode(chan)]; + + if (IEEE80211_IS_CHAN_HALF(chan)) + flags |= CHANNEL_HALF; + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + flags |= CHANNEL_QUARTER; + + return flags; +} + +/* + * Context: process context + */ + +static int +ath_init(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + HAL_STATUS status; + int error = 0; + + ATH_LOCK(sc); + + DPRINTF(sc, ATH_DEBUG_RESET, "%s: mode %d\n", __func__, ic->ic_opmode); + + /* + * Stop anything previously setup. This is safe + * whether this is the first time through or not. + */ + ath_stop_locked(dev); + +#ifdef ATH_CAP_TPC + ath_hal_setcapability(sc->sc_ah, HAL_CAP_TPC, 0, 1, NULL); +#endif + + /* Whether we should enable h/w TKIP MIC */ + if ((ic->ic_caps & IEEE80211_C_WME) == 0) + ath_hal_setcapability(sc->sc_ah, HAL_CAP_TKIP_MIC, 0, 0, NULL); + else { + if (((ic->ic_caps & IEEE80211_C_WME_TKIPMIC) == 0) && + (ic->ic_flags & IEEE80211_F_WME)) + ath_hal_setcapability(sc->sc_ah, HAL_CAP_TKIP_MIC, 0, 0, NULL); + else + ath_hal_setcapability(sc->sc_ah, HAL_CAP_TKIP_MIC, 0, 1, NULL); + } + + /* + * Flush the skb's allocated for receive in case the rx + * buffer size changes. This could be optimized but for + * now we do it each time under the assumption it does + * not happen often. + */ + ath_flushrecv(sc); + + /* + * The basic interface to setting the hardware in a good + * state is ``reset''. On return the hardware is known to + * be powered up and with interrupts disabled. This must + * be followed by initialization of the appropriate bits + * and then setup of the interrupt mask. + */ + sc->sc_curchan.channel = ic->ic_curchan->ic_freq; + sc->sc_curchan.channelFlags = ath_chan2flags(ic->ic_curchan); + if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_FALSE, &status)) { + printk("%s: unable to reset hardware: '%s' (HAL status %u) " + "(freq %u flags 0x%x)\n", dev->name, + ath_get_hal_status_desc(status), status, + sc->sc_curchan.channel, sc->sc_curchan.channelFlags); + error = -EIO; + goto done; + } + + if (sc->sc_softled) + ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + + /* Turn off Interference Mitigation in non-STA modes */ + if ((sc->sc_opmode != HAL_M_STA) && sc->sc_hasintmit && !sc->sc_useintmit) { + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: disabling interference mitigation (ANI)\n", __func__); + ath_hal_setintmit(ah, 0); + } + + /* + * This is needed only to setup initial state + * but it's best done after a reset. + */ + ath_update_txpow(sc); + + /* Set the default RX antenna; it may get lost on reset. */ + ath_setdefantenna(sc, sc->sc_defant); + + /* + * Setup the hardware after reset: the key cache + * is filled as needed and the receive engine is + * set going. Frame transmit is handled entirely + * in the frame output path; there's nothing to do + * here except setup the interrupt mask. + */ +#if 0 + ath_initkeytable(sc); /* XXX still needed? */ +#endif + if (ath_startrecv(sc) != 0) { + printk("%s: unable to start recv logic\n", dev->name); + error = -EIO; + goto done; + } + /* Enable interrupts. */ + sc->sc_imask = HAL_INT_RX | HAL_INT_TX + | HAL_INT_RXEOL | HAL_INT_RXORN + | HAL_INT_FATAL | HAL_INT_GLOBAL; + /* + * Enable MIB interrupts when there are hardware phy counters. + * Note we only do this (at the moment) for station mode. + */ + if (sc->sc_needmib && ic->ic_opmode == IEEE80211_M_STA) + sc->sc_imask |= HAL_INT_MIB; + ath_hal_intrset(ah, sc->sc_imask); + + /* + * The hardware should be ready to go now so it's safe + * to kick the 802.11 state machine as it's likely to + * immediately call back to us to send mgmt frames. + */ + ath_chan_change(sc, ic->ic_curchan); + ath_set_ack_bitrate(sc, sc->sc_ackrate); + dev->flags |= IFF_RUNNING; /* we are ready to go */ + ieee80211_start_running(ic); /* start all VAPs */ +#ifdef ATH_TX99_DIAG + if (sc->sc_tx99 != NULL) + sc->sc_tx99->start(sc->sc_tx99); +#endif +done: + ATH_UNLOCK(sc); + return error; +} + +/* Caller must lock ATH_LOCK + * + * Context: softIRQ + */ +static int +ath_stop_locked(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + + DPRINTF(sc, ATH_DEBUG_RESET, "%s: invalid %u flags 0x%x\n", + __func__, sc->sc_invalid, dev->flags); + + if (dev->flags & IFF_RUNNING) { + /* + * Shutdown the hardware and driver: + * stop output from above + * reset 802.11 state machine + * (sends station deassoc/deauth frames) + * turn off timers + * disable interrupts + * clear transmit machinery + * clear receive machinery + * turn off the radio + * reclaim beacon resources + * + * Note that some of this work is not possible if the + * hardware is gone (invalid). + */ +#ifdef ATH_TX99_DIAG + if (sc->sc_tx99 != NULL) + sc->sc_tx99->stop(sc->sc_tx99); +#endif + netif_stop_queue(dev); /* XXX re-enabled by ath_newstate */ + dev->flags &= ~IFF_RUNNING; /* NB: avoid recursion */ + ieee80211_stop_running(ic); /* stop all VAPs */ + if (!sc->sc_invalid) { + ath_hal_intrset(ah, 0); + if (sc->sc_softled) { + del_timer(&sc->sc_ledtimer); + ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); + sc->sc_blinking = 0; + sc->sc_ledstate = 1; + } + } + ath_draintxq(sc); + if (!sc->sc_invalid) { + ath_stoprecv(sc); + ath_hal_phydisable(ah); + } else + sc->sc_rxlink = NULL; + ath_beacon_free(sc); /* XXX needed? */ + } else + ieee80211_stop_running(ic); /* stop other VAPs */ + + if (sc->sc_softled) + ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); + + return 0; +} + +/* + * Stop the device, grabbing the top-level lock to protect + * against concurrent entry through ath_init (which can happen + * if another thread does a system call and the thread doing the + * stop is preempted). + */ +static int +ath_stop(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + int error; + + ATH_LOCK(sc); + + if (!sc->sc_invalid) + ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); + + error = ath_stop_locked(dev); +#if 0 + if (error == 0 && !sc->sc_invalid) { + /* + * Set the chip in full sleep mode. Note that we are + * careful to do this only when bringing the interface + * completely to a stop. When the chip is in this state + * it must be carefully woken up or references to + * registers in the PCI clock domain may freeze the bus + * (and system). This varies by chip and is mostly an + * issue with newer parts that go to sleep more quickly. + */ + ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); + } +#endif + ATH_UNLOCK(sc); + + return error; +} + +static int +ar_device(int devid) +{ + switch (devid) { + case AR5210_DEFAULT: + case AR5210_PROD: + case AR5210_AP: + return 5210; + case AR5211_DEFAULT: + case AR5311_DEVID: + case AR5211_LEGACY: + case AR5211_FPGA11B: + return 5211; + case AR5212_DEFAULT: + case AR5212_DEVID: + case AR5212_FPGA: + case AR5212_DEVID_IBM: + case AR5212_AR5312_REV2: + case AR5212_AR5312_REV7: + case AR5212_AR2313_REV8: + case AR5212_AR2315_REV6: + case AR5212_AR2315_REV7: + case AR5212_AR2317_REV1: + case AR5212_DEVID_0014: + case AR5212_DEVID_0015: + case AR5212_DEVID_0016: + case AR5212_DEVID_0017: + case AR5212_DEVID_0018: + case AR5212_DEVID_0019: + case AR5212_AR2413: + case AR5212_AR5413: + case AR5212_AR5424: + case AR5212_DEVID_FF19: + return 5212; + case AR5213_SREV_1_0: + case AR5213_SREV_REG: + case AR_SUBVENDOR_ID_NOG: + case AR_SUBVENDOR_ID_NEW_A: + return 5213; + default: + return 0; /* unknown */ + } +} + + +static int +ath_set_ack_bitrate(struct ath_softc *sc, int high) +{ + struct ath_hal *ah = sc->sc_ah; + if (ar_device(sc->devid) == 5212 || ar_device(sc->devid) == 5213) { + /* set ack to be sent at low bit-rate */ + /* registers taken from the OpenBSD 5212 HAL */ +#define AR5K_AR5212_STA_ID1 0x8004 +#define AR5K_AR5212_STA_ID1_ACKCTS_6MB 0x01000000 +#define AR5K_AR5212_STA_ID1_BASE_RATE_11B 0x02000000 + u_int32_t v = AR5K_AR5212_STA_ID1_BASE_RATE_11B | AR5K_AR5212_STA_ID1_ACKCTS_6MB; + if (high) { + OS_REG_WRITE(ah, AR5K_AR5212_STA_ID1, OS_REG_READ(ah, AR5K_AR5212_STA_ID1) & ~v); + } else { + OS_REG_WRITE(ah, AR5K_AR5212_STA_ID1, OS_REG_READ(ah, AR5K_AR5212_STA_ID1) | v); + } + return 0; + } + return 1; +} + +/* + * Reset the hardware w/o losing operational state. This is + * basically a more efficient way of doing ath_stop, ath_init, + * followed by state transitions to the current 802.11 + * operational state. Used to recover from errors rx overrun + * and to reset the hardware when rf gain settings must be reset. + */ +static int +ath_reset(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_channel *c; + HAL_STATUS status; + + /* + * Convert to a HAL channel description with the flags + * constrained to reflect the current operating mode. + */ + c = ic->ic_curchan; + sc->sc_curchan.channel = c->ic_freq; + sc->sc_curchan.channelFlags = ath_chan2flags(c); + + ath_hal_intrset(ah, 0); /* disable interrupts */ + ath_draintxq(sc); /* stop xmit side */ + ath_stoprecv(sc); /* stop recv side */ + /* NB: indicate channel change so we do a full reset */ + if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status)) + printk("%s: %s: unable to reset hardware: '%s' (HAL status %u)\n", + dev->name, __func__, ath_get_hal_status_desc(status), status); + + /* Turn off Interference Mitigation in non-STA modes */ + if ((sc->sc_opmode != HAL_M_STA) && sc->sc_hasintmit && !sc->sc_useintmit) { + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: disabling interference mitigation (ANI)\n", __func__); + ath_hal_setintmit(ah, 0); + } + + ath_update_txpow(sc); /* update tx power state */ + if (ath_startrecv(sc) != 0) /* restart recv */ + printk("%s: %s: unable to start recv logic\n", + dev->name, __func__); + if (sc->sc_softled) + ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + + /* + * We may be doing a reset in response to an ioctl + * that changes the channel so update any state that + * might change as a result. + */ + ath_chan_change(sc, c); + if (sc->sc_beacons) + ath_beacon_config(sc, NULL); /* restart beacons */ + ath_hal_intrset(ah, sc->sc_imask); + ath_set_ack_bitrate(sc, sc->sc_ackrate); + netif_wake_queue(dev); /* restart xmit */ +#ifdef ATH_SUPERG_XR + /* + * restart the group polls. + */ + if (sc->sc_xrgrppoll) { + struct ieee80211vap *vap; + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap && (vap->iv_flags & IEEE80211_F_XR)) + break; + ath_grppoll_stop(vap); + ath_grppoll_start(vap, sc->sc_xrpollcount); + } +#endif + return 0; +} + + +/* Swap transmit descriptor. + * if AH_NEED_DESC_SWAP flag is not defined this becomes a "null" + * function. + */ +static __inline void +ath_desc_swap(struct ath_desc *ds) +{ +#ifdef AH_NEED_DESC_SWAP + ds->ds_link = cpu_to_le32(ds->ds_link); + ds->ds_data = cpu_to_le32(ds->ds_data); + ds->ds_ctl0 = cpu_to_le32(ds->ds_ctl0); + ds->ds_ctl1 = cpu_to_le32(ds->ds_ctl1); + ds->ds_hw[0] = cpu_to_le32(ds->ds_hw[0]); + ds->ds_hw[1] = cpu_to_le32(ds->ds_hw[1]); +#endif +} + +/* + * Insert a buffer on a txq + * + */ +static __inline void +ath_tx_txqaddbuf(struct ath_softc *sc, struct ieee80211_node *ni, + struct ath_txq *txq, struct ath_buf *bf, + struct ath_desc *lastds, int framelen) +{ + struct ath_hal *ah = sc->sc_ah; + + /* + * Insert the frame on the outbound list and + * pass it on to the hardware. + */ + ATH_TXQ_LOCK(txq); + if (ni && ni->ni_vap && txq == &ATH_VAP(ni->ni_vap)->av_mcastq) { + /* + * The CAB queue is started from the SWBA handler since + * frames only go out on DTIM and to avoid possible races. + */ + ath_hal_intrset(ah, sc->sc_imask & ~HAL_INT_SWBA); + ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: txq depth = %d\n", __func__, txq->axq_depth); + if (txq->axq_link != NULL) { +#ifdef AH_NEED_DESC_SWAP + *txq->axq_link = cpu_to_le32(bf->bf_daddr); +#else + *txq->axq_link = bf->bf_daddr; +#endif + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: link[%u](%p)=%llx (%p)\n", + __func__, + txq->axq_qnum, txq->axq_link, + ito64(bf->bf_daddr), bf->bf_desc); + } + txq->axq_link = &lastds->ds_link; + ath_hal_intrset(ah, sc->sc_imask); + } else { + ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: txq depth = %d\n", __func__, txq->axq_depth); + if (txq->axq_link == NULL) { + ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: TXDP[%u] = %llx (%p)\n", + __func__, + txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc); + } else { +#ifdef AH_NEED_DESC_SWAP + *txq->axq_link = cpu_to_le32(bf->bf_daddr); +#else + *txq->axq_link = bf->bf_daddr; +#endif + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: link[%u] (%p)=%llx (%p)\n", + __func__, + txq->axq_qnum, txq->axq_link, + ito64(bf->bf_daddr), bf->bf_desc); + } + txq->axq_link = &lastds->ds_link; + ath_hal_txstart(ah, txq->axq_qnum); + sc->sc_dev->trans_start = jiffies; + } + ATH_TXQ_UNLOCK(txq); + + sc->sc_devstats.tx_packets++; + sc->sc_devstats.tx_bytes += framelen; +} + +static int +dot11_to_ratecode(struct ath_softc *sc, const HAL_RATE_TABLE *rt, int dot11) +{ + int index = sc->sc_rixmap[dot11 & IEEE80211_RATE_VAL]; + if (index >= 0 && index < rt->rateCount) + return rt->info[index].rateCode; + + return rt->info[sc->sc_minrateix].rateCode; +} + + +static int +ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb) +{ + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *) (skb->cb + sizeof(struct ieee80211_cb)); + const HAL_RATE_TABLE *rt; + int pktlen; + int hdrlen; + HAL_PKT_TYPE atype; + u_int flags; + int keyix; + int try0; + int power; + u_int8_t antenna, txrate; + struct ath_txq *txq=NULL; + struct ath_desc *ds=NULL; + struct ieee80211_frame *wh; + + wh = (struct ieee80211_frame *) skb->data; + try0 = ph->try0; + rt = sc->sc_currates; + txrate = dot11_to_ratecode(sc, rt, ph->rate0); + power = ph->power > 60 ? 60 : ph->power; + hdrlen = ieee80211_anyhdrsize(wh); + pktlen = skb->len + IEEE80211_CRC_LEN; + + keyix = HAL_TXKEYIX_INVALID; + flags = HAL_TXDESC_INTREQ | HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, pktlen, BUS_DMA_TODEVICE); + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: skb %p [data %p len %u] skbaddr %llx\n", + __func__, skb, skb->data, skb->len, ito64(bf->bf_skbaddr)); + + + bf->bf_skb = skb; + bf->bf_node = NULL; + +#ifdef ATH_SUPERG_FF + bf->bf_numdesc = 1; +#endif + + /* setup descriptors */ + ds = bf->bf_desc; + rt = sc->sc_currates; + KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + + + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + flags |= HAL_TXDESC_NOACK; /* no ack on broad/multicast */ + sc->sc_stats.ast_tx_noack++; + try0 = 1; + } + atype = HAL_PKT_TYPE_NORMAL; /* default */ + txq = sc->sc_ac2q[skb->priority & 0x3]; + + + flags |= HAL_TXDESC_INTREQ; + antenna = sc->sc_txantenna; + + /* XXX check return value? */ + ath_hal_setuptxdesc(ah, ds + , pktlen /* packet length */ + , hdrlen /* header length */ + , atype /* Atheros packet type */ + , power /* txpower */ + , txrate, try0 /* series 0 rate/tries */ + , keyix /* key cache index */ + , antenna /* antenna mode */ + , flags /* flags */ + , 0 /* rts/cts rate */ + , 0 /* rts/cts duration */ + , 0 /* comp icv len */ + , 0 /* comp iv len */ + , ATH_COMP_PROC_NO_COMP_NO_CCS /* comp scheme */ + ); + + if (ph->try1) { + ath_hal_setupxtxdesc(sc->sc_ah, ds + , dot11_to_ratecode(sc, rt, ph->rate1), ph->try1 /* series 1 */ + , dot11_to_ratecode(sc, rt, ph->rate2), ph->try2 /* series 2 */ + , dot11_to_ratecode(sc, rt, ph->rate3), ph->try3 /* series 3 */ + ); + } + bf->bf_flags = flags; /* record for post-processing */ + + ds->ds_link = 0; + ds->ds_data = bf->bf_skbaddr; + + ath_hal_filltxdesc(ah, ds + , skb->len /* segment length */ + , AH_TRUE /* first segment */ + , AH_TRUE /* last segment */ + , ds /* first descriptor */ + ); + + /* NB: The desc swap function becomes void, + * if descriptor swapping is not enabled + */ + ath_desc_swap(ds); + + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: Q%d: %08x %08x %08x %08x %08x %08x\n", + __func__, M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, ds->ds_link, ds->ds_data, + ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); + + ath_tx_txqaddbuf(sc, NULL, txq, bf, ds, pktlen); + return 0; +} + +#ifdef ATH_SUPERG_FF +/* + * Flush FF staging queue. + */ +static int +ath_ff_neverflushtestdone(struct ath_txq *txq, struct ath_buf *bf) +{ + return 0; +} + +static int +ath_ff_ageflushtestdone(struct ath_txq *txq, struct ath_buf *bf) +{ + if ( (txq->axq_totalqueued - bf->bf_queueage) < ATH_FF_STAGEQAGEMAX ) + return 1; + + return 0; +} + +/* Caller must not hold ATH_TXQ_LOCK and ATH_TXBUF_LOCK + * + * Context: softIRQ + */ +static void +ath_ffstageq_flush(struct ath_softc *sc, struct ath_txq *txq, + int (*ath_ff_flushdonetest)(struct ath_txq *txq, struct ath_buf *bf)) +{ + struct ath_buf *bf_ff = NULL; + struct ieee80211_node *ni = NULL; + int pktlen; + int framecnt; + + for (;;) { + ATH_TXQ_LOCK(txq); + + bf_ff = TAILQ_LAST(&txq->axq_stageq, axq_headtype); + if ((!bf_ff) || ath_ff_flushdonetest(txq, bf_ff)) + { + ATH_TXQ_UNLOCK(txq); + break; + } + + ni = bf_ff->bf_node; + KASSERT(ATH_NODE(ni)->an_tx_ffbuf[bf_ff->bf_skb->priority], + ("no bf_ff on staging queue %p", bf_ff)); + ATH_NODE(ni)->an_tx_ffbuf[bf_ff->bf_skb->priority] = NULL; + TAILQ_REMOVE(&txq->axq_stageq, bf_ff, bf_stagelist); + + ATH_TXQ_UNLOCK(txq); + + /* encap and xmit */ + bf_ff->bf_skb = ieee80211_encap(ni, bf_ff->bf_skb, &framecnt); + if (bf_ff->bf_skb == NULL) { + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, + "%s: discard, encapsulation failure\n", __func__); + sc->sc_stats.ast_tx_encap++; + goto bad; + } + pktlen = bf_ff->bf_skb->len; /* NB: don't reference skb below */ + if (ath_tx_start(sc->sc_dev, ni, bf_ff, bf_ff->bf_skb, 0) == 0) + continue; + bad: + ieee80211_free_node(ni); + if (bf_ff->bf_skb != NULL) { + dev_kfree_skb(bf_ff->bf_skb); + bf_ff->bf_skb = NULL; + } + bf_ff->bf_node = NULL; + + ATH_TXBUF_LOCK_IRQ(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf_ff, bf_list); + ATH_TXBUF_UNLOCK_IRQ(sc); + } +} +#endif + +#define ATH_HARDSTART_GET_TX_BUF_WITH_LOCK \ + ATH_TXBUF_LOCK_IRQ(sc); \ + bf = STAILQ_FIRST(&sc->sc_txbuf); \ + if (bf != NULL) { \ + STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); \ + STAILQ_INSERT_TAIL(&bf_head, bf, bf_list); \ + } \ + /* XXX use a counter and leave at least one for mgmt frames */ \ + if (STAILQ_EMPTY(&sc->sc_txbuf)) { \ + DPRINTF(sc, ATH_DEBUG_XMIT, \ + "%s: stop queue\n", __func__); \ + sc->sc_stats.ast_tx_qstop++; \ + netif_stop_queue(dev); \ + sc->sc_devstopped = 1; \ + ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, NULL); \ + } \ + ATH_TXBUF_UNLOCK_IRQ(sc); \ + if (bf == NULL) { /* NB: should not happen */ \ + DPRINTF(sc,ATH_DEBUG_XMIT, \ + "%s: discard, no xmit buf\n", __func__); \ + sc->sc_stats.ast_tx_nobuf++; \ + } + +/* + * Transmit a data packet. On failure caller is + * assumed to reclaim the resources. + * + * Context: process context with BH's disabled + */ +static int +ath_hardstart(struct sk_buff *skb, struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211_node *ni = NULL; + struct ath_buf *bf = NULL; + struct ieee80211_cb *cb = (struct ieee80211_cb *) skb->cb; + struct ether_header *eh; + STAILQ_HEAD(tmp_bf_head, ath_buf) bf_head; + struct ath_buf *tbf, *tempbf; + struct sk_buff *tskb; + struct ieee80211vap *vap; + int framecnt; + int requeue = 0; +#ifdef ATH_SUPERG_FF + int pktlen; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_node *an; + struct ath_txq *txq = NULL; + int ff_flush; +#endif + + if ((dev->flags & IFF_RUNNING) == 0 || sc->sc_invalid) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: discard, invalid %d flags %x\n", + __func__, sc->sc_invalid, dev->flags); + sc->sc_stats.ast_tx_invalid++; + return -ENETDOWN; + } + + STAILQ_INIT(&bf_head); + + if (cb->flags & M_RAW) { + ATH_HARDSTART_GET_TX_BUF_WITH_LOCK; + if (bf == NULL) + goto hardstart_fail; + ath_tx_startraw(dev, bf,skb); + return NETDEV_TX_OK; + } + + eh = (struct ether_header *)skb->data; + ni = cb->ni; /* NB: always passed down by 802.11 layer */ + if (ni == NULL) { + /* NB: this happens if someone marks the underlying device up */ + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: discard, no node in cb\n", __func__); + goto hardstart_fail; + } + + vap = ni->ni_vap; + +#ifdef ATH_SUPERG_FF + if (M_FLAG_GET(skb, M_UAPSD)) { + /* bypass FF handling */ + ATH_HARDSTART_GET_TX_BUF_WITH_LOCK; + if (bf == NULL) + goto hardstart_fail; + goto ff_bypass; + } + + /* + * Fast frames check. + */ + ATH_FF_MAGIC_CLR(skb); + an = ATH_NODE(ni); + + txq = sc->sc_ac2q[skb->priority]; + + if (txq->axq_depth > TAIL_DROP_COUNT) { + sc->sc_stats.ast_tx_discard++; + /* queue is full, let the kernel backlog the skb */ + requeue = 1; + goto hardstart_fail; + } + + /* NB: use this lock to protect an->an_ff_txbuf in athff_can_aggregate() + * call too. + */ + ATH_TXQ_LOCK(txq); + if (athff_can_aggregate(sc, eh, an, skb, vap->iv_fragthreshold, &ff_flush)) { + + if (an->an_tx_ffbuf[skb->priority]) { /* i.e., frame on the staging queue */ + bf = an->an_tx_ffbuf[skb->priority]; + + /* get (and remove) the frame from staging queue */ + TAILQ_REMOVE(&txq->axq_stageq, bf, bf_stagelist); + an->an_tx_ffbuf[skb->priority] = NULL; + + ATH_TXQ_UNLOCK(txq); + + /* + * chain skbs and add FF magic + * + * NB: the arriving skb should not be on a list (skb->list), + * so "re-using" the skb next field should be OK. + */ + bf->bf_skb->next = skb; + skb->next = NULL; + skb = bf->bf_skb; + ATH_FF_MAGIC_PUT(skb); + + /* decrement extra node reference made when an_tx_ffbuf[] was set */ + //ieee80211_free_node(ni); /* XXX where was it set ? */ + + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, + "%s: aggregating fast-frame\n", __func__); + } else { + /* NB: careful grabbing the TX_BUF lock since still holding the txq lock. + * this could be avoided by always obtaining the txbuf earlier, + * but the "if" portion of this "if/else" clause would then need + * to give the buffer back. + */ + ATH_HARDSTART_GET_TX_BUF_WITH_LOCK; + if (bf == NULL) { + ATH_TXQ_UNLOCK(txq); + goto hardstart_fail; + } + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, + "%s: adding to fast-frame stage Q\n", __func__); + + bf->bf_skb = skb; + bf->bf_node = ni; + bf->bf_queueage = txq->axq_totalqueued; + an->an_tx_ffbuf[skb->priority] = bf; + + TAILQ_INSERT_HEAD(&txq->axq_stageq, bf, bf_stagelist); + + ATH_TXQ_UNLOCK(txq); + + return NETDEV_TX_OK; + } + } else { + if (ff_flush) { + struct ath_buf *bf_ff = an->an_tx_ffbuf[skb->priority]; + + TAILQ_REMOVE(&txq->axq_stageq, bf_ff, bf_stagelist); + an->an_tx_ffbuf[skb->priority] = NULL; + + ATH_TXQ_UNLOCK(txq); + + /* encap and xmit */ + bf_ff->bf_skb = ieee80211_encap(ni, bf_ff->bf_skb, &framecnt); + + if (bf_ff->bf_skb == NULL) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: discard, ff flush encap failure\n", + __func__); + sc->sc_stats.ast_tx_encap++; + goto ff_flushbad; + } + pktlen = bf_ff->bf_skb->len; /* NB: don't reference skb below */ + /* NB: ath_tx_start() will use ATH_TXBUF_LOCK_BH(). The _BH + * portion is not needed here since we're running at + * interrupt time, but should be harmless. + */ + if (ath_tx_start(dev, ni, bf_ff, bf_ff->bf_skb, 0)) + goto ff_flushbad; + goto ff_flushdone; + ff_flushbad: + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, + "%s: ff stageq flush failure\n", __func__); + ieee80211_free_node(ni); + if (bf_ff->bf_skb) { + dev_kfree_skb(bf_ff->bf_skb); + bf_ff->bf_skb = NULL; + } + bf_ff->bf_node = NULL; + + ATH_TXBUF_LOCK(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf_ff, bf_list); + ATH_TXBUF_UNLOCK(sc); + goto ff_flushdone; + } + /* + * XXX: out-of-order condition only occurs for AP mode and multicast. + * But, there may be no valid way to get this condition. + */ + else if (an->an_tx_ffbuf[skb->priority]) { + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, + "%s: Out-Of-Order fast-frame\n", __func__); + ATH_TXQ_UNLOCK(txq); + } else + ATH_TXQ_UNLOCK(txq); + + ff_flushdone: + ATH_HARDSTART_GET_TX_BUF_WITH_LOCK; + if (bf == NULL) + goto hardstart_fail; + } + +ff_bypass: + +#else /* ATH_SUPERG_FF */ + + ATH_HARDSTART_GET_TX_BUF_WITH_LOCK; + +#endif /* ATH_SUPERG_FF */ + + /* + * Encapsulate the packet for transmission. + */ + skb = ieee80211_encap(ni, skb, &framecnt); + if (skb == NULL) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: discard, encapsulation failure\n", __func__); + sc->sc_stats.ast_tx_encap++; + goto hardstart_fail; + } + + if (framecnt > 1) { + int bfcnt; + + /* + ** Allocate 1 ath_buf for each frame given 1 was + ** already alloc'd + */ + ATH_TXBUF_LOCK(sc); + for (bfcnt = 1; bfcnt < framecnt; ++bfcnt) { + if ((tbf = STAILQ_FIRST(&sc->sc_txbuf)) != NULL) { + STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); + STAILQ_INSERT_TAIL(&bf_head, tbf, bf_list); + } + else + break; + + ieee80211_ref_node(ni); + } + + if (bfcnt != framecnt) { + if (!STAILQ_EMPTY(&bf_head)) { + /* + ** Failed to alloc enough ath_bufs; + ** return to sc_txbuf list + */ + STAILQ_FOREACH_SAFE(tbf, &bf_head, bf_list, tempbf) { + STAILQ_INSERT_TAIL(&sc->sc_txbuf, tbf, bf_list); + } + } + ATH_TXBUF_UNLOCK(sc); + STAILQ_INIT(&bf_head); + goto hardstart_fail; + } + ATH_TXBUF_UNLOCK(sc); + + while ((bf = STAILQ_FIRST(&bf_head)) != NULL && skb != NULL) { + int nextfraglen = 0; + + STAILQ_REMOVE_HEAD(&bf_head, bf_list); + tskb = skb->next; + skb->next = NULL; + if (tskb) + nextfraglen = tskb->len; + + if (ath_tx_start(dev, ni, bf, skb, nextfraglen) != 0) { + STAILQ_INSERT_TAIL(&bf_head, bf, bf_list); + skb->next = tskb; + goto hardstart_fail; + } + skb = tskb; + } + } else { + if (ath_tx_start(dev, ni, bf, skb, 0) != 0) { + STAILQ_INSERT_TAIL(&bf_head, bf, bf_list); + goto hardstart_fail; + } + } + +#ifdef ATH_SUPERG_FF + /* + * flush out stale FF from staging Q for applicable operational modes. + */ + /* XXX: ADHOC mode too? */ + if (txq && ic->ic_opmode == IEEE80211_M_HOSTAP) + ath_ffstageq_flush(sc, txq, ath_ff_ageflushtestdone); +#endif + + return NETDEV_TX_OK; + +hardstart_fail: + if (!STAILQ_EMPTY(&bf_head)) { + ATH_TXBUF_LOCK(sc); + STAILQ_FOREACH_SAFE(tbf, &bf_head, bf_list, tempbf) { + tbf->bf_skb = NULL; + tbf->bf_node = NULL; + + if (ni != NULL) + ieee80211_free_node(ni); + + STAILQ_INSERT_TAIL(&sc->sc_txbuf, tbf, bf_list); + } + ATH_TXBUF_UNLOCK(sc); + } + + /* let the kernel requeue the skb (don't free it!) */ + if (requeue) + return NETDEV_TX_BUSY; + + /* free sk_buffs */ + while (skb) { + tskb = skb->next; + skb->next = NULL; + dev_kfree_skb(skb); + skb = tskb; + } + return NETDEV_TX_OK; +} +#undef ATH_HARDSTART_GET_TX_BUF_WITH_LOCK + +/* + * Transmit a management frame. On failure we reclaim the skbuff. + * Note that management frames come directly from the 802.11 layer + * and do not honor the send queue flow control. Need to investigate + * using priority queuing so management frames can bypass data. + * + * Context: hwIRQ and softIRQ + */ +static int +ath_mgtstart(struct ieee80211com *ic, struct sk_buff *skb) +{ + struct net_device *dev = ic->ic_dev; + struct ath_softc *sc = dev->priv; + struct ieee80211_node *ni = NULL; + struct ath_buf *bf = NULL; + struct ieee80211_cb *cb; + int error; + + if ((dev->flags & IFF_RUNNING) == 0 || sc->sc_invalid) { + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: discard, invalid %d flags %x\n", + __func__, sc->sc_invalid, dev->flags); + sc->sc_stats.ast_tx_invalid++; + error = -ENETDOWN; + goto bad; + } + /* + * Grab a TX buffer and associated resources. + */ + ATH_TXBUF_LOCK_IRQ(sc); + bf = STAILQ_FIRST(&sc->sc_txbuf); + if (bf != NULL) + STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); + if (STAILQ_EMPTY(&sc->sc_txbuf)) { + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: stop queue\n", __func__); + sc->sc_stats.ast_tx_qstop++; + netif_stop_queue(dev); + sc->sc_devstopped=1; + ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, NULL); + } + ATH_TXBUF_UNLOCK_IRQ(sc); + if (bf == NULL) { + printk("ath_mgtstart: discard, no xmit buf\n"); + sc->sc_stats.ast_tx_nobufmgt++; + error = -ENOBUFS; + goto bad; + } + + /* + * NB: the referenced node pointer is in the + * control block of the sk_buff. This is + * placed there by ieee80211_mgmt_output because + * we need to hold the reference with the frame. + */ + cb = (struct ieee80211_cb *)skb->cb; + ni = cb->ni; + error = ath_tx_start(dev, ni, bf, skb, 0); + if (error == 0) { + sc->sc_stats.ast_tx_mgmt++; + return 0; + } + /* fall thru... */ +bad: + if (ni != NULL) + ieee80211_free_node(ni); + if (bf != NULL) { + bf->bf_skb = NULL; + bf->bf_node = NULL; + + ATH_TXBUF_LOCK_IRQ(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + ATH_TXBUF_UNLOCK_IRQ(sc); + } + dev_kfree_skb_any(skb); + skb = NULL; + return error; +} + +#ifdef AR_DEBUG +static void +ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix, + const HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN]) +{ + static const char *ciphers[] = { + "WEP", + "AES-OCB", + "AES-CCM", + "CKIP", + "TKIP", + "CLR", + }; + int i, n; + + printk("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]); + for (i = 0, n = hk->kv_len; i < n; i++) + printk("%02x", hk->kv_val[i]); + printk(" mac %s", ether_sprintf(mac)); + if (hk->kv_type == HAL_CIPHER_TKIP) { + printk(" %s ", sc->sc_splitmic ? "mic" : "rxmic"); + for (i = 0; i < sizeof(hk->kv_mic); i++) + printk("%02x", hk->kv_mic[i]); +#if HAL_ABI_VERSION > 0x06052200 + if (!sc->sc_splitmic) { + printk(" txmic "); + for (i = 0; i < sizeof(hk->kv_txmic); i++) + printk("%02x", hk->kv_txmic[i]); + } +#endif + } + printk("\n"); +} +#endif + +/* + * Set a TKIP key into the hardware. This handles the + * potential distribution of key state to multiple key + * cache slots for TKIP. + */ +static int +ath_keyset_tkip(struct ath_softc *sc, const struct ieee80211_key *k, + HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN]) +{ +#define IEEE80211_KEY_XR (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV) + static const u_int8_t zerobssid[IEEE80211_ADDR_LEN]; + struct ath_hal *ah = sc->sc_ah; + + KASSERT(k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP, + ("got a non-TKIP key, cipher %u", k->wk_cipher->ic_cipher)); + if ((k->wk_flags & IEEE80211_KEY_XR) == IEEE80211_KEY_XR) { + if (sc->sc_splitmic) { + /* + * TX key goes at first index, RX key at the rx index. + * The HAL handles the MIC keys at index+64. + */ + memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic)); + KEYPRINTF(sc, k->wk_keyix, hk, zerobssid); + if (!ath_hal_keyset(ah, k->wk_keyix, hk, zerobssid)) + return 0; + + memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); + KEYPRINTF(sc, k->wk_keyix+32, hk, mac); + /* XXX delete tx key on failure? */ + return ath_hal_keyset(ah, k->wk_keyix+32, hk, mac); + } else { + /* + * Room for both TX+RX MIC keys in one key cache + * slot, just set key at the first index; the HAL + * will handle the reset. + */ + memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); +#if HAL_ABI_VERSION > 0x06052200 + memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic)); +#endif + KEYPRINTF(sc, k->wk_keyix, hk, mac); + return ath_hal_keyset(ah, k->wk_keyix, hk, mac); + } + } else if (k->wk_flags & IEEE80211_KEY_XR) { + /* + * TX/RX key goes at first index. + * The HAL handles the MIC keys are index+64. + */ + memcpy(hk->kv_mic, k->wk_flags & IEEE80211_KEY_XMIT ? + k->wk_txmic : k->wk_rxmic, sizeof(hk->kv_mic)); + KEYPRINTF(sc, k->wk_keyix, hk, mac); + return ath_hal_keyset(ah, k->wk_keyix, hk, mac); + } + return 0; +#undef IEEE80211_KEY_XR +} + +/* + * Set a net80211 key into the hardware. This handles the + * potential distribution of key state to multiple key + * cache slots for TKIP with hardware MIC support. + */ +static int +ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k, + const u_int8_t mac0[IEEE80211_ADDR_LEN], + struct ieee80211_node *bss) +{ +#define N(a) ((int)(sizeof(a)/sizeof(a[0]))) + static const u_int8_t ciphermap[] = { + HAL_CIPHER_WEP, /* IEEE80211_CIPHER_WEP */ + HAL_CIPHER_TKIP, /* IEEE80211_CIPHER_TKIP */ + HAL_CIPHER_AES_OCB, /* IEEE80211_CIPHER_AES_OCB */ + HAL_CIPHER_AES_CCM, /* IEEE80211_CIPHER_AES_CCM */ + (u_int8_t) -1, /* 4 is not allocated */ + HAL_CIPHER_CKIP, /* IEEE80211_CIPHER_CKIP */ + HAL_CIPHER_CLR, /* IEEE80211_CIPHER_NONE */ + }; + struct ath_hal *ah = sc->sc_ah; + const struct ieee80211_cipher *cip = k->wk_cipher; + u_int8_t gmac[IEEE80211_ADDR_LEN]; + const u_int8_t *mac; + HAL_KEYVAL hk; + + memset(&hk, 0, sizeof(hk)); + /* + * Software crypto uses a "clear key" so non-crypto + * state kept in the key cache are maintained and + * so that rx frames have an entry to match. + */ + if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) == 0) { + KASSERT(cip->ic_cipher < N(ciphermap), + ("invalid cipher type %u", cip->ic_cipher)); + hk.kv_type = ciphermap[cip->ic_cipher]; + hk.kv_len = k->wk_keylen; + memcpy(hk.kv_val, k->wk_key, k->wk_keylen); + } else + hk.kv_type = HAL_CIPHER_CLR; + + if ((k->wk_flags & IEEE80211_KEY_GROUP) && sc->sc_mcastkey) { + /* + * Group keys on hardware that supports multicast frame + * key search use a mac that is the sender's address with + * the high bit set instead of the app-specified address. + */ + IEEE80211_ADDR_COPY(gmac, bss->ni_macaddr); + gmac[0] |= 0x80; + mac = gmac; + } else + mac = mac0; + + if (hk.kv_type == HAL_CIPHER_TKIP && + (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { + return ath_keyset_tkip(sc, k, &hk, mac); + } else { + KEYPRINTF(sc, k->wk_keyix, &hk, mac); + return ath_hal_keyset(ah, k->wk_keyix, &hk, mac); + } +#undef N +} + +/* + * Allocate tx/rx key slots for TKIP. We allocate two slots for + * each key, one for decrypt/encrypt and the other for the MIC. + */ +static u_int16_t +key_alloc_2pair(struct ath_softc *sc) +{ +#define N(a) ((int)(sizeof(a)/sizeof(a[0]))) + u_int i, keyix; + + KASSERT(sc->sc_splitmic, ("key cache !split")); + /* XXX could optimize */ + for (i = 0; i < N(sc->sc_keymap) / 4; i++) { + u_int8_t b = sc->sc_keymap[i]; + if (b != 0xff) { + /* + * One or more slots in this byte are free. + */ + keyix = i * NBBY; + while (b & 1) { + again: + keyix++; + b >>= 1; + } + /* XXX IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV */ + if (isset(sc->sc_keymap, keyix + 32) || + isset(sc->sc_keymap, keyix + 64) || + isset(sc->sc_keymap, keyix + 32 + 64)) { + /* full pair unavailable */ + /* XXX statistic */ + if (keyix == (i + 1) * NBBY) { + /* no slots were appropriate, advance */ + continue; + } + goto again; + } + setbit(sc->sc_keymap, keyix); + setbit(sc->sc_keymap, keyix + 64); + setbit(sc->sc_keymap, keyix + 32); + setbit(sc->sc_keymap, keyix + 32 + 64); + DPRINTF(sc, ATH_DEBUG_KEYCACHE, + "%s: key pair %u,%u %u,%u\n", + __func__, keyix, keyix + 64, + keyix + 32, keyix + 32 + 64); + return keyix; + } + } + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__); + return IEEE80211_KEYIX_NONE; +#undef N +} + +/* + * Allocate tx/rx key slots for TKIP. We allocate two slots for + * each key, one for decrypt/encrypt and the other for the MIC. + */ +static u_int16_t +key_alloc_pair(struct ath_softc *sc) +{ +#define N(a) (sizeof(a)/sizeof(a[0])) + u_int i, keyix; + + KASSERT(!sc->sc_splitmic, ("key cache split")); + /* XXX could optimize */ + for (i = 0; i < N(sc->sc_keymap)/4; i++) { + u_int8_t b = sc->sc_keymap[i]; + if (b != 0xff) { + /* + * One or more slots in this byte are free. + */ + keyix = i*NBBY; + while (b & 1) { + again: + keyix++; + b >>= 1; + } + if (isset(sc->sc_keymap, keyix+64)) { + /* full pair unavailable */ + /* XXX statistic */ + if (keyix == (i+1)*NBBY) { + /* no slots were appropriate, advance */ + continue; + } + goto again; + } + setbit(sc->sc_keymap, keyix); + setbit(sc->sc_keymap, keyix+64); + DPRINTF(sc, ATH_DEBUG_KEYCACHE, + "%s: key pair %u,%u\n", + __func__, keyix, keyix+64); + return keyix; + } + } + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__); + return IEEE80211_KEYIX_NONE; +#undef N +} + +/* + * Allocate a single key cache slot. + */ +static u_int16_t +key_alloc_single(struct ath_softc *sc) +{ +#define N(a) ((int)(sizeof(a)/sizeof(a[0]))) + u_int i, keyix; + + /* XXX try i,i+32,i+64,i+32+64 to minimize key pair conflicts */ + for (i = 0; i < N(sc->sc_keymap); i++) { + u_int8_t b = sc->sc_keymap[i]; + if (b != 0xff) { + /* + * One or more slots are free. + */ + keyix = i * NBBY; + while (b & 1) + keyix++, b >>= 1; + setbit(sc->sc_keymap, keyix); + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: key %u\n", + __func__, keyix); + return keyix; + } + } + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of space\n", __func__); + return IEEE80211_KEYIX_NONE; +#undef N +} + +/* + * Allocate one or more key cache slots for a unicast key. The + * key itself is needed only to identify the cipher. For hardware + * TKIP with split cipher+MIC keys we allocate two key cache slot + * pairs so that we can setup separate TX and RX MIC keys. Note + * that the MIC key for a TKIP key at slot i is assumed by the + * hardware to be at slot i+64. This limits TKIP keys to the first + * 64 entries. + */ +static int +ath_key_alloc(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + struct net_device *dev = vap->iv_ic->ic_dev; + struct ath_softc *sc = dev->priv; + + /* + * Group key allocation must be handled specially for + * parts that do not support multicast key cache search + * functionality. For those parts the key id must match + * the h/w key index so lookups find the right key. On + * parts w/ the key search facility we install the sender's + * mac address (with the high bit set) and let the hardware + * find the key w/o using the key id. This is preferred as + * it permits us to support multiple users for adhoc and/or + * multi-station operation. + */ + if ((k->wk_flags & IEEE80211_KEY_GROUP) && !sc->sc_mcastkey) { + int i; + u_int keyix = IEEE80211_KEYIX_NONE; + + for (i = 0; i < IEEE80211_WEP_NKID; i++) { + if (k == &vap->iv_nw_keys[i]) { + keyix = i; + break; + } + } + if (keyix == IEEE80211_KEYIX_NONE) { + /* should not happen */ + DPRINTF(sc, ATH_DEBUG_KEYCACHE, + "%s: bogus group key\n", __func__); + return IEEE80211_KEYIX_NONE; + } + + /* + * XXX we pre-allocate the global keys so + * have no way to check if they've already been allocated. + */ + return keyix; + } + /* + * We allocate two pair for TKIP when using the h/w to do + * the MIC. For everything else, including software crypto, + * we allocate a single entry. Note that s/w crypto requires + * a pass-through slot on the 5211 and 5212. The 5210 does + * not support pass-through cache entries and we map all + * those requests to slot 0. + * + * Allocate 1 pair of keys for WEP case. Make sure the key + * is not a shared-key. + */ + if (k->wk_flags & IEEE80211_KEY_SWCRYPT) + return key_alloc_single(sc); + else if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP && + (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { + if (sc->sc_splitmic) + return key_alloc_2pair(sc); + else + return key_alloc_pair(sc); + } else + return key_alloc_single(sc); +} + +/* + * Delete an entry in the key cache allocated by ath_key_alloc. + */ +static int +ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, + struct ieee80211_node *ninfo) +{ + struct net_device *dev = vap->iv_ic->ic_dev; + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + const struct ieee80211_cipher *cip = k->wk_cipher; + struct ieee80211_node *ni; + u_int keyix = k->wk_keyix; + int rxkeyoff = 0; + + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: delete key %u\n", __func__, keyix); + + ath_hal_keyreset(ah, keyix); + /* + * Check the key->node map and flush any ref. + */ + ni = sc->sc_keyixmap[keyix]; + if (ni != NULL) { + ieee80211_free_node(ni); + sc->sc_keyixmap[keyix] = NULL; + } + /* + * Handle split tx/rx keying required for TKIP with h/w MIC. + */ + if (cip->ic_cipher == IEEE80211_CIPHER_TKIP && + (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic) { + ath_hal_keyreset(ah, keyix + 32); /* RX key */ + ni = sc->sc_keyixmap[keyix + 32]; + if (ni != NULL) { /* as above... */ + ieee80211_free_node(ni); + sc->sc_keyixmap[keyix + 32] = NULL; + } + } + + /* Remove receive key entry if one exists for static WEP case */ + if (ninfo != NULL) { + rxkeyoff = ninfo->ni_rxkeyoff; + if (rxkeyoff != 0) { + ninfo->ni_rxkeyoff = 0; + ath_hal_keyreset(ah, keyix + rxkeyoff); + ni = sc->sc_keyixmap[keyix + rxkeyoff]; + if (ni != NULL) { /* as above... */ + ieee80211_free_node(ni); + sc->sc_keyixmap[keyix + rxkeyoff] = NULL; + } + } + } + + if (keyix >= IEEE80211_WEP_NKID) { + /* + * Don't touch keymap entries for global keys so + * they are never considered for dynamic allocation. + */ + clrbit(sc->sc_keymap, keyix); + if (cip->ic_cipher == IEEE80211_CIPHER_TKIP && + (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { + clrbit(sc->sc_keymap, keyix + 64); /* TX key MIC */ + if (sc->sc_splitmic) { + /* +32 for RX key, +32+64 for RX key MIC */ + clrbit(sc->sc_keymap, keyix+32); + clrbit(sc->sc_keymap, keyix+32+64); + } + } + + if (rxkeyoff != 0) + clrbit(sc->sc_keymap, keyix + rxkeyoff);/*RX Key */ + } + return 1; +} + +/* + * Set the key cache contents for the specified key. Key cache + * slot(s) must already have been allocated by ath_key_alloc. + */ +static int +ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, + const u_int8_t mac[IEEE80211_ADDR_LEN]) +{ + struct net_device *dev = vap->iv_ic->ic_dev; + struct ath_softc *sc = dev->priv; + + return ath_keyset(sc, k, mac, vap->iv_bss); +} + +/* + * Block/unblock tx+rx processing while a key change is done. + * We assume the caller serializes key management operations + * so we only need to worry about synchronization with other + * uses that originate in the driver. + */ +static void +ath_key_update_begin(struct ieee80211vap *vap) +{ + struct net_device *dev = vap->iv_ic->ic_dev; + struct ath_softc *sc = dev->priv; + + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); + /* + * When called from the rx tasklet we cannot use + * tasklet_disable because it will block waiting + * for us to complete execution. + * + * XXX Using in_softirq is not right since we might + * be called from other soft irq contexts than + * ath_rx_tasklet. + */ + if (!in_softirq()) + tasklet_disable(&sc->sc_rxtq); + netif_stop_queue(dev); +} + +static void +ath_key_update_end(struct ieee80211vap *vap) +{ + struct net_device *dev = vap->iv_ic->ic_dev; + struct ath_softc *sc = dev->priv; + + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); + netif_start_queue(dev); + if (!in_softirq()) /* NB: see above */ + tasklet_enable(&sc->sc_rxtq); +} + +/* + * Calculate the receive filter according to the + * operating mode and state: + * + * o always accept unicast, broadcast, and multicast traffic + * o maintain current state of phy error reception (the HAL + * may enable phy error frames for noise immunity work) + * o probe request frames are accepted only when operating in + * hostap, adhoc, or monitor modes + * o enable promiscuous mode according to the interface state + * o accept beacons: + * - when operating in adhoc mode so the 802.11 layer creates + * node table entries for peers, + * - when operating in station mode for collecting rssi data when + * the station is otherwise quiet, or + * - when operating as a repeater so we see repeater-sta beacons + * - when scanning + */ +static u_int32_t +ath_calcrxfilter(struct ath_softc *sc) +{ +#define RX_FILTER_PRESERVE (HAL_RX_FILTER_PHYERR | HAL_RX_FILTER_PHYRADAR) + struct ieee80211com *ic = &sc->sc_ic; + struct net_device *dev = ic->ic_dev; + struct ath_hal *ah = sc->sc_ah; + u_int32_t rfilt; + + rfilt = (ath_hal_getrxfilter(ah) & RX_FILTER_PRESERVE) | + HAL_RX_FILTER_UCAST | HAL_RX_FILTER_BCAST | + HAL_RX_FILTER_MCAST; + if (ic->ic_opmode != IEEE80211_M_STA) + rfilt |= HAL_RX_FILTER_PROBEREQ; + if (ic->ic_opmode != IEEE80211_M_HOSTAP && (dev->flags & IFF_PROMISC)) + rfilt |= HAL_RX_FILTER_PROM; + if (ic->ic_opmode == IEEE80211_M_STA || + sc->sc_opmode == HAL_M_IBSS || /* NB: AHDEMO too */ + (sc->sc_nostabeacons) || sc->sc_scanning) + rfilt |= HAL_RX_FILTER_BEACON; + if (sc->sc_nmonvaps > 0) + rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON | + HAL_RX_FILTER_PROBEREQ | HAL_RX_FILTER_PROM); + return rfilt; +#undef RX_FILTER_PRESERVE +} + +/* + * Merge multicast addresses from all VAPs to form the + * hardware filter. Ideally we should only inspect our + * own list and the 802.11 layer would merge for us but + * that's a bit difficult so for now we put the onus on + * the driver. + */ +static void +ath_merge_mcast(struct ath_softc *sc, u_int32_t mfilt[2]) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap; + struct dev_mc_list *mc; + u_int32_t val; + u_int8_t pos; + + mfilt[0] = mfilt[1] = 0; + /* XXX locking */ + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + struct net_device *dev = vap->iv_dev; + for (mc = dev->mc_list; mc; mc = mc->next) { + /* calculate XOR of eight 6-bit values */ + val = LE_READ_4(mc->dmi_addr + 0); + pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; + val = LE_READ_4(mc->dmi_addr + 3); + pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; + pos &= 0x3f; + mfilt[pos / 32] |= (1 << (pos % 32)); + } + } +} + +static void +ath_mode_init(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + u_int32_t rfilt, mfilt[2]; + + /* configure rx filter */ + rfilt = ath_calcrxfilter(sc); + ath_hal_setrxfilter(ah, rfilt); + + /* configure bssid mask */ + if (sc->sc_hasbmask) + ath_hal_setbssidmask(ah, sc->sc_bssidmask); + + /* configure operational mode */ + ath_hal_setopmode(ah); + + /* calculate and install multicast filter */ + if ((dev->flags & IFF_ALLMULTI) == 0) + ath_merge_mcast(sc, mfilt); + else + mfilt[0] = mfilt[1] = ~0; + ath_hal_setmcastfilter(ah, mfilt[0], mfilt[1]); + DPRINTF(sc, ATH_DEBUG_STATE, + "%s: RX filter 0x%x, MC filter %08x:%08x\n", + __func__, rfilt, mfilt[0], mfilt[1]); +} + +/* + * Set the slot time based on the current setting. + */ +static void +ath_setslottime(struct ath_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + + if (sc->sc_slottimeconf > 0) /* manual override */ + ath_hal_setslottime(ah, sc->sc_slottimeconf); + else if (ic->ic_flags & IEEE80211_F_SHSLOT) + ath_hal_setslottime(ah, HAL_SLOT_TIME_9); + else + ath_hal_setslottime(ah, HAL_SLOT_TIME_20); + sc->sc_updateslot = OK; +} + +/* + * Callback from the 802.11 layer to update the + * slot time based on the current setting. + */ +static void +ath_updateslot(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + + /* + * When not coordinating the BSS, change the hardware + * immediately. For other operation we defer the change + * until beacon updates have propagated to the stations. + */ + if (ic->ic_opmode == IEEE80211_M_HOSTAP) + sc->sc_updateslot = UPDATE; + else if (dev->flags & IFF_RUNNING) + ath_setslottime(sc); +} + +#ifdef ATH_SUPERG_DYNTURBO +/* + * Dynamic turbo support. + * XXX much of this could be moved up to the net80211 layer. + */ + +/* + * Configure dynamic turbo state on beacon setup. + */ +static void +ath_beacon_dturbo_config(struct ieee80211vap *vap, u_int32_t intval) +{ +#define IS_CAPABLE(vap) \ + (vap->iv_bss && (vap->iv_bss->ni_ath_flags & (IEEE80211_ATHC_TURBOP )) == \ + (IEEE80211_ATHC_TURBOP)) + struct ieee80211com *ic = vap->iv_ic; + struct ath_softc *sc = ic->ic_dev->priv; + + if (ic->ic_opmode == IEEE80211_M_HOSTAP && IS_CAPABLE(vap)) { + + /* Dynamic Turbo is supported on this channel. */ + sc->sc_dturbo = 1; + sc->sc_dturbo_tcount = 0; + sc->sc_dturbo_switch = 0; + sc->sc_ignore_ar = 0; + + /* Set the initial ATHC_BOOST capability. */ + if (ic->ic_bsschan->ic_flags & CHANNEL_TURBO) + ic->ic_ath_cap |= IEEE80211_ATHC_BOOST; + else + ic->ic_ath_cap &= ~IEEE80211_ATHC_BOOST; + + /* + * Calculate time & bandwidth thresholds + * + * sc_dturbo_base_tmin : ~70 seconds + * sc_dturbo_turbo_tmax : ~120 seconds + * + * NB: scale calculated values to account for staggered + * beacon handling + */ + sc->sc_dturbo_base_tmin = 70 * 1024 / ic->ic_lintval; + sc->sc_dturbo_turbo_tmax = 120 * 1024 / ic->ic_lintval; + sc->sc_dturbo_turbo_tmin = 5 * 1024 / ic->ic_lintval; + /* convert the thresholds from BW/sec to BW/beacon period */ + sc->sc_dturbo_bw_base = ATH_TURBO_DN_THRESH/(1024/ic->ic_lintval); + sc->sc_dturbo_bw_turbo = ATH_TURBO_UP_THRESH/(1024/ic->ic_lintval); + /* time in hold state in number of beacon */ + sc->sc_dturbo_hold_max = (ATH_TURBO_PERIOD_HOLD * 1024)/ic->ic_lintval; + } else { + sc->sc_dturbo = 0; + ic->ic_ath_cap &= ~IEEE80211_ATHC_BOOST; + } +#undef IS_CAPABLE +} + +/* + * Update dynamic turbo state at SWBA. We assume we care + * called only if dynamic turbo has been enabled (sc_turbo). + */ +static void +ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark,u_int8_t dtim) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ath_softc *sc = ic->ic_dev->priv; + u_int32_t bss_traffic; + + /* TBD: Age out CHANNEL_INTERFERENCE */ + if (sc->sc_ignore_ar) { + /* + * Ignore AR for this beacon; a dynamic turbo + * switch just happened and the information + * is invalid. Notify AR support of the channel + * change. + */ + sc->sc_ignore_ar = 0; + ath_hal_ar_enable(sc->sc_ah); + } + sc->sc_dturbo_tcount++; + /* + * Calculate BSS traffic over the previous interval. + */ + bss_traffic = (sc->sc_devstats.tx_bytes + sc->sc_devstats.rx_bytes) + - sc->sc_dturbo_bytes; + sc->sc_dturbo_bytes = sc->sc_devstats.tx_bytes + + sc->sc_devstats.rx_bytes; + if (ic->ic_ath_cap & IEEE80211_ATHC_BOOST) { + /* + * before switching to base mode, + * make sure that the conditions( low rssi, low bw) to switch mode + * hold for some time and time in turbo exceeds minimum turbo time. + */ + + if (sc->sc_dturbo_tcount >= sc->sc_dturbo_turbo_tmin && + sc->sc_dturbo_hold ==0 && + (bss_traffic < sc->sc_dturbo_bw_base || !sc->sc_rate_recn_state)) { + sc->sc_dturbo_hold = 1; + } else { + if (sc->sc_dturbo_hold && + bss_traffic >= sc->sc_dturbo_bw_turbo && sc->sc_rate_recn_state) { + /* out of hold state */ + sc->sc_dturbo_hold = 0; + sc->sc_dturbo_hold_count = sc->sc_dturbo_hold_max; + } + } + if (sc->sc_dturbo_hold && sc->sc_dturbo_hold_count) + sc->sc_dturbo_hold_count--; + /* + * Current Mode: Turbo (i.e. BOOST) + * + * Transition to base occurs when one of the following + * is true: + * 1. its a DTIM beacon. + * 2. Maximum time in BOOST has elapsed (120 secs). + * 3. Channel is marked with interference + * 4. Average BSS traffic falls below 4Mbps + * 5. RSSI cannot support at least 18 Mbps rate + * XXX do bw checks at true beacon interval? + */ + if (dtim && + (sc->sc_dturbo_tcount >= sc->sc_dturbo_turbo_tmax || + ((vap->iv_bss->ni_ath_flags & IEEE80211_ATHC_AR) && + (sc->sc_curchan.privFlags & CHANNEL_INTERFERENCE) && + IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) || + !sc->sc_dturbo_hold_count)) { + DPRINTF(sc, ATH_DEBUG_TURBO, "%s: Leaving turbo\n", + sc->sc_dev->name); + ic->ic_ath_cap &= ~IEEE80211_ATHC_BOOST; + vap->iv_bss->ni_ath_flags &= ~IEEE80211_ATHC_BOOST; + sc->sc_dturbo_tcount = 0; + sc->sc_dturbo_switch = 1; + } + } else { + /* + * Current Mode: BASE + * + * Transition to Turbo (i.e. BOOST) when all of the + * following are true: + * + * 1. its a DTIM beacon. + * 2. Dwell time at base has exceeded minimum (70 secs) + * 3. Only DT-capable stations are associated + * 4. Channel is marked interference-free. + * 5. BSS data traffic averages at least 6Mbps + * 6. RSSI is good enough to support 36Mbps + * XXX do bw+rssi checks at true beacon interval? + */ + if (dtim && + (sc->sc_dturbo_tcount >= sc->sc_dturbo_base_tmin && + (ic->ic_dt_sta_assoc != 0 && + ic->ic_sta_assoc == ic->ic_dt_sta_assoc) && + ((vap->iv_bss->ni_ath_flags & IEEE80211_ATHC_AR) == 0 || + (sc->sc_curchan.privFlags & CHANNEL_INTERFERENCE) == 0) && + bss_traffic >= sc->sc_dturbo_bw_turbo && + sc->sc_rate_recn_state)) { + DPRINTF(sc, ATH_DEBUG_TURBO, "%s: Entering turbo\n", + sc->sc_dev->name); + ic->ic_ath_cap |= IEEE80211_ATHC_BOOST; + vap->iv_bss->ni_ath_flags |= IEEE80211_ATHC_BOOST; + sc->sc_dturbo_tcount = 0; + sc->sc_dturbo_switch = 1; + sc->sc_dturbo_hold = 0; + sc->sc_dturbo_hold_count = sc->sc_dturbo_hold_max; + } + } +} + + +static int +ath_check_beacon_done(struct ath_softc *sc) +{ + struct ieee80211vap *vap=NULL; + struct ath_vap *avp; + struct ath_buf *bf; + struct sk_buff *skb; + struct ath_desc *ds; + struct ath_hal *ah = sc->sc_ah; + int slot; + + /* + * check if the last beacon went out with the mode change flag set. + */ + for (slot = 0; slot < ath_maxvaps; slot++) { + if(sc->sc_bslot[slot]) { + vap = sc->sc_bslot[slot]; + break; + } + } + if (!vap) + return 0; + avp = ATH_VAP(vap); + bf = avp->av_bcbuf; + skb = bf->bf_skb; + ds = bf->bf_desc; + + return (ath_hal_txprocdesc(ah, ds) != HAL_EINPROGRESS); + +} + +/* + * Effect a turbo mode switch when operating in dynamic + * turbo mode. wait for beacon to go out before switching. + */ +static void +ath_turbo_switch_mode(unsigned long data) +{ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + int newflags; + + KASSERT(ic->ic_opmode == IEEE80211_M_HOSTAP, + ("unexpected operating mode %d", ic->ic_opmode)); + + DPRINTF(sc, ATH_DEBUG_STATE, "%s: dynamic turbo switch to %s mode\n", + dev->name, + ic->ic_ath_cap & IEEE80211_ATHC_BOOST ? "turbo" : "base"); + + if (!ath_check_beacon_done(sc)) { + /* + * beacon did not go out. reschedule tasklet. + */ + mod_timer(&sc->sc_dturbo_switch_mode, jiffies + msecs_to_jiffies(2)); + return; + } + + /* TBD: DTIM adjustments, delay CAB queue tx until after transmit */ + newflags = ic->ic_bsschan->ic_flags; + if (ic->ic_ath_cap & IEEE80211_ATHC_BOOST) { + if (IEEE80211_IS_CHAN_2GHZ(ic->ic_bsschan)) { + /* + * Ignore AR next beacon. the AR detection + * code detects the traffic in normal channel + * from stations during transition delays + * between AP and station. + */ + sc->sc_ignore_ar = 1; + ath_hal_ar_disable(sc->sc_ah); + } + newflags |= IEEE80211_CHAN_TURBO; + } else + newflags &= ~IEEE80211_CHAN_TURBO; + ieee80211_dturbo_switch(ic, newflags); + /* XXX ieee80211_reset_erp? */ +} +#endif /* ATH_SUPERG_DYNTURBO */ + +/* + * Setup a h/w transmit queue for beacons. + */ +static int +ath_beaconq_setup(struct ath_hal *ah) +{ + HAL_TXQ_INFO qi; + + memset(&qi, 0, sizeof(qi)); + qi.tqi_aifs = 1; + qi.tqi_cwmin = 0; + qi.tqi_cwmax = 0; +#ifdef ATH_SUPERG_DYNTURBO + qi.tqi_qflags = HAL_TXQ_TXDESCINT_ENABLE; +#endif + /* NB: don't enable any interrupts */ + return ath_hal_setuptxqueue(ah, HAL_TX_QUEUE_BEACON, &qi); +} + +/* + * Configure IFS parameter for the beacon queue. + */ +static int +ath_beaconq_config(struct ath_softc *sc) +{ +#define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ic; + struct ath_hal *ah = sc->sc_ah; + HAL_TXQ_INFO qi; + + ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); + if (ic->ic_opmode == IEEE80211_M_HOSTAP) { + /* + * Always burst out beacon and CAB traffic. + */ + qi.tqi_aifs = 1; + qi.tqi_cwmin = 0; + qi.tqi_cwmax = 0; + } else { + struct wmeParams *wmep = + &ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE]; + /* + * Adhoc mode; important thing is to use 2x cwmin. + */ + qi.tqi_aifs = wmep->wmep_aifsn; + qi.tqi_cwmin = 2 * ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); + qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); + } + + if (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) { + printk("%s: unable to update h/w beacon queue parameters\n", + sc->sc_dev->name); + return 0; + } else { + ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ + return 1; + } +#undef ATH_EXPONENT_TO_VALUE +} + +/* + * Allocate and setup an initial beacon frame. + * + * Context: softIRQ + */ +static int +ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) +{ + struct ath_vap *avp = ATH_VAP(ni->ni_vap); + struct ieee80211_frame *wh; + struct ath_buf *bf; + struct sk_buff *skb; + + /* + * release the previous beacon's skb if it already exists. + */ + bf = avp->av_bcbuf; + if (bf->bf_skb != NULL) { + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + dev_kfree_skb(bf->bf_skb); + bf->bf_skb = NULL; + } + if (bf->bf_node != NULL) { + ieee80211_free_node(bf->bf_node); + bf->bf_node = NULL; + } + + /* + * NB: the beacon data buffer must be 32-bit aligned; + * we assume the mbuf routines will return us something + * with this alignment (perhaps should assert). + */ + skb = ieee80211_beacon_alloc(ni, &avp->av_boff); + if (skb == NULL) { + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: cannot get sk_buff\n", + __func__); + sc->sc_stats.ast_be_nobuf++; + return -ENOMEM; + } + + /* + * Calculate a TSF adjustment factor required for + * staggered beacons. Note that we assume the format + * of the beacon frame leaves the tstamp field immediately + * following the header. + */ + if (sc->sc_stagbeacons && avp->av_bslot > 0) { + uint64_t tuadjust; + __le64 tsfadjust; + /* + * The beacon interval is in TU's; the TSF in usecs. + * We figure out how many TU's to add to align the + * timestamp then convert to TSF units and handle + * byte swapping before writing it in the frame. + * The hardware will then add this each time a beacon + * frame is sent. Note that we align VAPs 1..N + * and leave VAP 0 untouched. This means VAP 0 + * has a timestamp in one beacon interval while the + * others get a timestamp aligned to the next interval. + */ + tuadjust = (ni->ni_intval * (ath_maxvaps - avp->av_bslot)) / ath_maxvaps; + tsfadjust = cpu_to_le64(tuadjust << 10); /* TU->TSF */ + + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: %s beacons, bslot %d intval %u tsfadjust(Kus) %llu\n", + __func__, sc->sc_stagbeacons ? "stagger" : "burst", + avp->av_bslot, ni->ni_intval, (long long) tuadjust); + + wh = (struct ieee80211_frame *) skb->data; + memcpy(&wh[1], &tsfadjust, sizeof(tsfadjust)); + } + + bf->bf_node = ieee80211_ref_node(ni); + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, skb->len, BUS_DMA_TODEVICE); + bf->bf_skb = skb; + + return 0; +} + +/* + * Setup the beacon frame for transmit. + */ +static void +ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf) +{ +#define USE_SHPREAMBLE(_ic) \ + (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\ + == IEEE80211_F_SHPREAMBLE) + struct ieee80211_node *ni = bf->bf_node; + struct ieee80211com *ic = ni->ni_ic; + struct sk_buff *skb = bf->bf_skb; + struct ath_hal *ah = sc->sc_ah; + struct ath_desc *ds; + int flags; + int antenna = sc->sc_txantenna; + const HAL_RATE_TABLE *rt; + u_int8_t rix, rate; + int ctsrate = 0; + int ctsduration = 0; + + DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: m %p len %u\n", + __func__, skb, skb->len); + + /* setup descriptors */ + ds = bf->bf_desc; + + flags = HAL_TXDESC_NOACK; +#ifdef ATH_SUPERG_DYNTURBO + if (sc->sc_dturbo_switch) + flags |= HAL_TXDESC_INTREQ; +#endif + + if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) { + ds->ds_link = bf->bf_daddr; /* self-linked */ + flags |= HAL_TXDESC_VEOL; + /* + * Let hardware handle antenna switching if txantenna is not set + */ + } else { + ds->ds_link = 0; + /* + * Switch antenna every beacon if txantenna is not set + * Should only switch every beacon period, not for every + * SWBA's + * XXX assumes two antenna + */ + if (antenna == 0) { + if (sc->sc_stagbeacons) + antenna = ((sc->sc_stats.ast_be_xmit / sc->sc_nbcnvaps) & 1 ? 2 : 1); + else + antenna = (sc->sc_stats.ast_be_xmit & 1 ? 2 : 1); + } + } + + ds->ds_data = bf->bf_skbaddr; + /* + * Calculate rate code. + * XXX everything at min xmit rate + */ + rix = sc->sc_minrateix; + rt = sc->sc_currates; + rate = rt->info[rix].rateCode; + if (USE_SHPREAMBLE(ic)) + rate |= rt->info[rix].shortPreamble; +#ifdef ATH_SUPERG_XR + if (bf->bf_node->ni_vap->iv_flags & IEEE80211_F_XR) { + u_int8_t cix; + int pktlen; + pktlen = skb->len + IEEE80211_CRC_LEN; + cix = rt->info[sc->sc_protrix].controlRate; + /* for XR VAP use different RTSCTS rates and calculate duration */ + ctsrate = rt->info[cix].rateCode; + if (USE_SHPREAMBLE(ic)) + ctsrate |= rt->info[cix].shortPreamble; + flags |= HAL_TXDESC_CTSENA; + rt = sc->sc_xr_rates; + ctsduration = ath_hal_computetxtime(ah,rt, pktlen, + IEEE80211_XR_DEFAULT_RATE_INDEX, AH_FALSE); + rate = rt->info[IEEE80211_XR_DEFAULT_RATE_INDEX].rateCode; + } +#endif + ath_hal_setuptxdesc(ah, ds + , skb->len + IEEE80211_CRC_LEN /* frame length */ + , sizeof(struct ieee80211_frame) /* header length */ + , HAL_PKT_TYPE_BEACON /* Atheros packet type */ + , ni->ni_txpower /* txpower XXX */ + , rate, 1 /* series 0 rate/tries */ + , HAL_TXKEYIX_INVALID /* no encryption */ + , antenna /* antenna mode */ + , flags /* no ack, veol for beacons */ + , ctsrate /* rts/cts rate */ + , ctsduration /* rts/cts duration */ + , 0 /* comp icv len */ + , 0 /* comp iv len */ + , ATH_COMP_PROC_NO_COMP_NO_CCS /* comp scheme */ + ); + + /* NB: beacon's BufLen must be a multiple of 4 bytes */ + ath_hal_filltxdesc(ah, ds + , roundup(skb->len, 4) /* buffer length */ + , AH_TRUE /* first segment */ + , AH_TRUE /* last segment */ + , ds /* first descriptor */ + ); + + /* NB: The desc swap function becomes void, + * if descriptor swapping is not enabled + */ + ath_desc_swap(ds); +#undef USE_SHPREAMBLE +} + +/* + * Generate beacon frame and queue cab data for a VAP. + */ +static struct ath_buf * +ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap, int *needmark) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + struct ieee80211_node *ni; + struct ath_vap *avp; + struct sk_buff *skb; + int ncabq; + unsigned int curlen; + + if (vap->iv_state != IEEE80211_S_RUN) { + DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: skip VAP in %s state\n", + __func__, ieee80211_state_name[vap->iv_state]); + return NULL; + } +#ifdef ATH_SUPERG_XR + if (vap->iv_flags & IEEE80211_F_XR) { + vap->iv_xrbcnwait++; + /* wait for XR_BEACON_FACTOR times before sending the beacon */ + if (vap->iv_xrbcnwait < IEEE80211_XR_BEACON_FACTOR) + return NULL; + vap->iv_xrbcnwait = 0; + } +#endif + avp = ATH_VAP(vap); + if (avp->av_bcbuf == NULL) { + DPRINTF(sc, ATH_DEBUG_ANY, "%s: avp=%p av_bcbuf=%p\n", + __func__, avp, avp->av_bcbuf); + return NULL; + } + bf = avp->av_bcbuf; + ni = bf->bf_node; + +#ifdef ATH_SUPERG_DYNTURBO + /* + * If we are using dynamic turbo, update the + * capability info and arrange for a mode change + * if needed. + */ + if (sc->sc_dturbo) { + u_int8_t dtim; + dtim = ((avp->av_boff.bo_tim[2] == 1) || + (avp->av_boff.bo_tim[3] == 1)); + ath_beacon_dturbo_update(vap, needmark, dtim); + } +#endif + /* + * Update dynamic beacon contents. If this returns + * non-zero then we need to remap the memory because + * the beacon frame changed size (probably because + * of the TIM bitmap). + */ + skb = bf->bf_skb; + curlen = skb->len; + ncabq = avp->av_mcastq.axq_depth; + if (ieee80211_beacon_update(ni, &avp->av_boff, skb, ncabq)) { + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, curlen, BUS_DMA_TODEVICE); + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, skb->len, BUS_DMA_TODEVICE); + } + + /* + * if the CABQ traffic from previous DTIM is pending and the current + * beacon is also a DTIM. + * 1) if there is only one VAP let the cab traffic continue. + * 2) if there are more than one VAP and we are using staggered + * beacons, then drain the cabq by dropping all the frames in + * the cabq so that the current VAP's cab traffic can be scheduled. + * XXX: Need to handle the last MORE_DATA bit here. + */ + if (ncabq && (avp->av_boff.bo_tim[4] & 1) && sc->sc_cabq->axq_depth) { + if (sc->sc_nvaps > 1 && sc->sc_stagbeacons) { + ath_tx_draintxq(sc, sc->sc_cabq); + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: flush previous cabq traffic\n", __func__); + } + } + + /* + * Construct tx descriptor. + */ + ath_beacon_setup(sc, bf); + + bus_dma_sync_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + + /* + * Enable the CAB queue before the beacon queue to + * ensure cab frames are triggered by this beacon. + */ + if (avp->av_boff.bo_tim[4] & 1) { /* NB: only at DTIM */ + struct ath_txq *cabq = sc->sc_cabq; + struct ath_buf *bfmcast; + /* + * Move everything from the VAP's mcast queue + * to the hardware cab queue. + */ + ATH_TXQ_LOCK(&avp->av_mcastq); + ATH_TXQ_LOCK(cabq); + bfmcast = STAILQ_FIRST(&avp->av_mcastq.axq_q); + /* link the descriptors */ + if (cabq->axq_link == NULL) + ath_hal_puttxbuf(ah, cabq->axq_qnum, bfmcast->bf_daddr); + else { +#ifdef AH_NEED_DESC_SWAP + *cabq->axq_link = cpu_to_le32(bfmcast->bf_daddr); +#else + *cabq->axq_link = bfmcast->bf_daddr; +#endif + } + + /* Set the MORE_DATA bit for each packet except the last one */ + STAILQ_FOREACH(bfmcast, &avp->av_mcastq.axq_q, bf_list) { + if (bfmcast != STAILQ_LAST(&avp->av_mcastq.axq_q, ath_buf, bf_list)) + ((struct ieee80211_frame *)bfmcast->bf_skb->data)->i_fc[1] |= IEEE80211_FC1_MORE_DATA; + } + + /* append the private VAP mcast list to the cabq */ + ATH_TXQ_MOVE_MCASTQ(&avp->av_mcastq, cabq); + /* NB: gated by beacon so safe to start here */ + ath_hal_txstart(ah, cabq->axq_qnum); + ATH_TXQ_UNLOCK(cabq); + ATH_TXQ_UNLOCK(&avp->av_mcastq); + } + + return bf; +} + +/* + * Transmit one or more beacon frames at SWBA. Dynamic + * updates to the frame contents are done as needed and + * the slot time is also adjusted based on current state. + */ +static void +ath_beacon_send(struct ath_softc *sc, int *needmark) +{ +#define TSF_TO_TU(_h,_l) \ + ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) + struct ath_hal *ah = sc->sc_ah; + struct ieee80211vap *vap; + struct ath_buf *bf; + int slot; + u_int32_t bfaddr; + + /* + * Check if the previous beacon has gone out. If + * not don't try to post another, skip this period + * and wait for the next. Missed beacons indicate + * a problem and should not occur. If we miss too + * many consecutive beacons reset the device. + */ + if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { + sc->sc_bmisscount++; + /* XXX: 802.11h needs the chanchange IE countdown decremented. + * We should consider adding a net80211 call to indicate + * a beacon miss so appropriate action could be taken + * (in that layer). + */ + DPRINTF(sc, ATH_DEBUG_BEACON_PROC, + "%s: missed %u consecutive beacons\n", + __func__, sc->sc_bmisscount); + if (sc->sc_bmisscount > BSTUCK_THRESH) + ATH_SCHEDULE_TQUEUE(&sc->sc_bstucktq, needmark); + return; + } + if (sc->sc_bmisscount != 0) { + DPRINTF(sc, ATH_DEBUG_BEACON_PROC, + "%s: resume beacon xmit after %u misses\n", + __func__, sc->sc_bmisscount); + sc->sc_bmisscount = 0; + } + + /* + * Generate beacon frames. If we are sending frames + * staggered then calculate the slot for this frame based + * on the tsf to safeguard against missing an swba. + * Otherwise we are bursting all frames together and need + * to generate a frame for each VAP that is up and running. + */ + if (sc->sc_stagbeacons) { /* staggered beacons */ + struct ieee80211com *ic = &sc->sc_ic; + u_int64_t tsf; + u_int32_t tsftu; + + tsf = ath_hal_gettsf64(ah); + tsftu = TSF_TO_TU(tsf >> 32, tsf); + slot = ((tsftu % ic->ic_lintval) * ath_maxvaps) / ic->ic_lintval; + vap = sc->sc_bslot[(slot + 1) % ath_maxvaps]; + DPRINTF(sc, ATH_DEBUG_BEACON_PROC, + "%s: slot %d [tsf %llu tsftu %u intval %u] vap %p\n", + __func__, slot, (long long) tsf, tsftu, ic->ic_lintval, vap); + bfaddr = 0; + if (vap != NULL) { + bf = ath_beacon_generate(sc, vap, needmark); + if (bf != NULL) + bfaddr = bf->bf_daddr; + } + } else { /* burst'd beacons */ + u_int32_t *bflink; + + bflink = &bfaddr; + /* XXX rotate/randomize order? */ + for (slot = 0; slot < ath_maxvaps; slot++) { + vap = sc->sc_bslot[slot]; + if (vap != NULL) { + bf = ath_beacon_generate(sc, vap, needmark); + if (bf != NULL) { +#ifdef AH_NEED_DESC_SWAP + if (bflink != &bfaddr) + *bflink = cpu_to_le32(bf->bf_daddr); + else + *bflink = bf->bf_daddr; +#else + *bflink = bf->bf_daddr; +#endif + bflink = &bf->bf_desc->ds_link; + } + } + } + *bflink = 0; /* link of last frame */ + } + + /* + * Handle slot time change when a non-ERP station joins/leaves + * an 11g network. The 802.11 layer notifies us via callback, + * we mark updateslot, then wait one beacon before effecting + * the change. This gives associated stations at least one + * beacon interval to note the state change. + * + * NB: The slot time change state machine is clocked according + * to whether we are bursting or staggering beacons. We + * recognize the request to update and record the current + * slot then don't transition until that slot is reached + * again. If we miss a beacon for that slot then we'll be + * slow to transition but we'll be sure at least one beacon + * interval has passed. When bursting slot is always left + * set to ath_maxvaps so this check is a no-op. + */ + /* XXX locking */ + if (sc->sc_updateslot == UPDATE) { + sc->sc_updateslot = COMMIT; /* commit next beacon */ + sc->sc_slotupdate = slot; + } else if (sc->sc_updateslot == COMMIT && sc->sc_slotupdate == slot) + ath_setslottime(sc); /* commit change to hardware */ + + if ((!sc->sc_stagbeacons || slot == 0) && (!sc->sc_diversity)) { + int otherant; + /* + * Check recent per-antenna transmit statistics and flip + * the default rx antenna if noticeably more frames went out + * on the non-default antenna. Only do this if rx diversity + * is off. + * XXX assumes 2 antennae + */ + otherant = sc->sc_defant & 1 ? 2 : 1; + if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + ATH_ANTENNA_DIFF) { + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: flip defant to %u, %u > %u\n", + __func__, otherant, sc->sc_ant_tx[otherant], + sc->sc_ant_tx[sc->sc_defant]); + ath_setdefantenna(sc, otherant); + } + sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; + } + + if (bfaddr != 0) { + /* + * Stop any current DMA and put the new frame(s) on the queue. + * This should never fail since we check above that no frames + * are still pending on the queue. + */ + if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: beacon queue %u did not stop?\n", + __func__, sc->sc_bhalq); + /* NB: the HAL still stops DMA, so proceed */ + } + /* NB: cabq traffic should already be queued and primed */ + ath_hal_puttxbuf(ah, sc->sc_bhalq, bfaddr); + ath_hal_txstart(ah, sc->sc_bhalq); + + sc->sc_stats.ast_be_xmit++; /* XXX per-VAP? */ + } +#undef TSF_TO_TU +} + +/* + * Reset the hardware after detecting beacons have stopped. + */ +static void +ath_bstuck_tasklet(TQUEUE_ARG data) +{ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + /* + * XXX:if the bmisscount is cleared while the + * tasklet execution is pending, the following + * check will be true, in which case return + * without resetting the driver. + */ + if (sc->sc_bmisscount <= BSTUCK_THRESH) + return; + printk("%s: stuck beacon; resetting (bmiss count %u)\n", + dev->name, sc->sc_bmisscount); + ath_reset(dev); +} + +/* + * Startup beacon transmission for adhoc mode when + * they are sent entirely by the hardware using the + * self-linked descriptor + veol trick. + */ +static void +ath_beacon_start_adhoc(struct ath_softc *sc, struct ieee80211vap *vap) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + struct ieee80211_node *ni; + struct ath_vap *avp; + struct sk_buff *skb; + + avp = ATH_VAP(vap); + if (avp->av_bcbuf == NULL) { + DPRINTF(sc, ATH_DEBUG_ANY, "%s: avp=%p av_bcbuf=%p\n", + __func__, avp, avp != NULL ? avp->av_bcbuf : NULL); + return; + } + bf = avp->av_bcbuf; + ni = bf->bf_node; + + /* + * Update dynamic beacon contents. If this returns + * non-zero then we need to remap the memory because + * the beacon frame changed size (probably because + * of the TIM bitmap). + */ + skb = bf->bf_skb; + if (ieee80211_beacon_update(ni, &avp->av_boff, skb, 0)) { + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, skb->len, BUS_DMA_TODEVICE); + } + + /* + * Construct tx descriptor. + */ + ath_beacon_setup(sc, bf); + + bus_dma_sync_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + + /* NB: caller is known to have already stopped tx DMA */ + ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); + ath_hal_txstart(ah, sc->sc_bhalq); + DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: TXDP%u = %llx (%p)\n", __func__, + sc->sc_bhalq, ito64(bf->bf_daddr), bf->bf_desc); +} + +/* + * Reclaim beacon resources and return buffer to the pool. + */ +static void +ath_beacon_return(struct ath_softc *sc, struct ath_buf *bf) +{ + if (bf->bf_skb != NULL) { + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + dev_kfree_skb(bf->bf_skb); + bf->bf_skb = NULL; + } + if (bf->bf_node != NULL) { + ieee80211_free_node(bf->bf_node); + bf->bf_node = NULL; + } + STAILQ_INSERT_TAIL(&sc->sc_bbuf, bf, bf_list); +} + +/* + * Reclaim all beacon resources. + */ +static void +ath_beacon_free(struct ath_softc *sc) +{ + struct ath_buf *bf; + + STAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { + if (bf->bf_skb != NULL) { + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + dev_kfree_skb(bf->bf_skb); + bf->bf_skb = NULL; + } + if (bf->bf_node != NULL) { + ieee80211_free_node(bf->bf_node); + bf->bf_node = NULL; + } + } +} + +/* + * Configure the beacon and sleep timers. + * + * When operating as an AP this resets the TSF and sets + * up the hardware to notify us when we need to issue beacons. + * + * When operating in station mode this sets up the beacon + * timers according to the timestamp of the last received + * beacon and the current TSF, configures PCF and DTIM + * handling, programs the sleep registers so the hardware + * will wake up in time to receive beacons, and configures + * the beacon miss handling so we'll receive a BMISS + * interrupt when we stop seeing beacons from the AP + * we've associated with. + */ +static void +ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap) +{ +#define TSF_TO_TU(_h,_l) \ + ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_node *ni; + u_int32_t nexttbtt, intval; + + if (vap == NULL) + vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ + + ni = vap->iv_bss; + + /* extract tstamp from last beacon and convert to TU */ + nexttbtt = TSF_TO_TU(LE_READ_4(ni->ni_tstamp.data + 4), + LE_READ_4(ni->ni_tstamp.data)); + /* XXX conditionalize multi-bss support? */ + if (ic->ic_opmode == IEEE80211_M_HOSTAP) { + /* + * For multi-bss ap support beacons are either staggered + * evenly over N slots or burst together. For the former + * arrange for the SWBA to be delivered for each slot. + * Slots that are not occupied will generate nothing. + */ + /* NB: the beacon interval is kept internally in TU's */ + intval = ic->ic_lintval & HAL_BEACON_PERIOD; + if (sc->sc_stagbeacons) + intval /= ath_maxvaps; /* for staggered beacons */ + if ((sc->sc_nostabeacons) && + (vap->iv_opmode == IEEE80211_M_HOSTAP)) + nexttbtt = 0; + } else + intval = ni->ni_intval & HAL_BEACON_PERIOD; + if (nexttbtt == 0) /* e.g. for ap mode */ + nexttbtt = intval; + else if (intval) /* NB: can be 0 for monitor mode */ + nexttbtt = roundup(nexttbtt, intval); + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", + __func__, nexttbtt, intval, ni->ni_intval); + if (ic->ic_opmode == IEEE80211_M_STA && !(sc->sc_nostabeacons)) { + HAL_BEACON_STATE bs; + u_int64_t tsf; + u_int32_t tsftu; + int dtimperiod, dtimcount; + int cfpperiod, cfpcount; + + /* + * Setup dtim and cfp parameters according to + * last beacon we received (which may be none). + */ + dtimperiod = vap->iv_dtim_period; + if (dtimperiod <= 0) /* NB: 0 if not known */ + dtimperiod = 1; + dtimcount = vap->iv_dtim_count; + if (dtimcount >= dtimperiod) /* NB: sanity check */ + dtimcount = 0; /* XXX? */ + cfpperiod = 1; /* NB: no PCF support yet */ + cfpcount = 0; +#define FUDGE 2 + /* + * Pull nexttbtt forward to reflect the current + * TSF and calculate dtim+cfp state for the result. + */ + tsf = ath_hal_gettsf64(ah); + tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; + do { + nexttbtt += intval; + if (--dtimcount < 0) { + dtimcount = dtimperiod - 1; + if (--cfpcount < 0) + cfpcount = cfpperiod - 1; + } + } while (nexttbtt < tsftu); +#undef FUDGE + memset(&bs, 0, sizeof(bs)); + bs.bs_intval = intval; + bs.bs_nexttbtt = nexttbtt; + bs.bs_dtimperiod = dtimperiod * intval; + bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount * intval; + bs.bs_cfpperiod = cfpperiod * bs.bs_dtimperiod; + bs.bs_cfpnext = bs.bs_nextdtim + cfpcount * bs.bs_dtimperiod; + bs.bs_cfpmaxduration = 0; +#if 0 + /* + * The 802.11 layer records the offset to the DTIM + * bitmap while receiving beacons; use it here to + * enable h/w detection of our AID being marked in + * the bitmap vector (to indicate frames for us are + * pending at the AP). + * XXX do DTIM handling in s/w to WAR old h/w bugs + * XXX enable based on h/w rev for newer chips + */ + bs.bs_timoffset = ni->ni_timoff; +#endif + /* + * Calculate the number of consecutive beacons to miss + * before taking a BMISS interrupt. The configuration + * is specified in TU so we only need calculate based + * on the beacon interval. Note that we clamp the + * result to at most 10 beacons. + */ + bs.bs_bmissthreshold = howmany(ic->ic_bmisstimeout, intval); + if (bs.bs_bmissthreshold > 10) + bs.bs_bmissthreshold = 10; + else if (bs.bs_bmissthreshold < 2) + bs.bs_bmissthreshold = 2; + + /* + * Calculate sleep duration. The configuration is + * given in ms. We ensure a multiple of the beacon + * period is used. Also, if the sleep duration is + * greater than the DTIM period then it makes senses + * to make it a multiple of that. + * + * XXX fixed at 100ms + */ + bs.bs_sleepduration = + roundup(IEEE80211_MS_TO_TU(100), bs.bs_intval); + if (bs.bs_sleepduration > bs.bs_dtimperiod) + bs.bs_sleepduration = roundup(bs.bs_sleepduration, bs.bs_dtimperiod); + + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: tsf %llu tsf:tu %u intval %u nexttbtt %u dtim %u nextdtim %u bmiss %u sleep %u cfp:period %u maxdur %u next %u timoffset %u\n" + , __func__ + , (long long) tsf, tsftu + , bs.bs_intval + , bs.bs_nexttbtt + , bs.bs_dtimperiod + , bs.bs_nextdtim + , bs.bs_bmissthreshold + , bs.bs_sleepduration + , bs.bs_cfpperiod + , bs.bs_cfpmaxduration + , bs.bs_cfpnext + , bs.bs_timoffset + ); + + ic->ic_bmiss_guard = jiffies + + IEEE80211_TU_TO_JIFFIES(bs.bs_intval * bs.bs_bmissthreshold); + + ath_hal_intrset(ah, 0); + ath_hal_beacontimers(ah, &bs); + sc->sc_imask |= HAL_INT_BMISS; + ath_hal_intrset(ah, sc->sc_imask); + } else { + ath_hal_intrset(ah, 0); + if (nexttbtt == intval) + intval |= HAL_BEACON_RESET_TSF; + if (ic->ic_opmode == IEEE80211_M_IBSS) { + /* + * In IBSS mode enable the beacon timers but only + * enable SWBA interrupts if we need to manually + * prepare beacon frames. Otherwise we use a + * self-linked tx descriptor and let the hardware + * deal with things. + */ + intval |= HAL_BEACON_ENA; + if (!sc->sc_hasveol) + sc->sc_imask |= HAL_INT_SWBA; + ath_beaconq_config(sc); + } else if (ic->ic_opmode == IEEE80211_M_HOSTAP) { + /* + * In AP mode we enable the beacon timers and + * SWBA interrupts to prepare beacon frames. + */ + intval |= HAL_BEACON_ENA; + sc->sc_imask |= HAL_INT_SWBA; /* beacon prepare */ + ath_beaconq_config(sc); + } +#ifdef ATH_SUPERG_DYNTURBO + ath_beacon_dturbo_config(vap, intval & + ~(HAL_BEACON_RESET_TSF | HAL_BEACON_ENA)); +#endif + ath_hal_beaconinit(ah, nexttbtt, intval); + sc->sc_bmisscount = 0; + ath_hal_intrset(ah, sc->sc_imask); + /* + * When using a self-linked beacon descriptor in + * ibss mode load it once here. + */ + if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) + ath_beacon_start_adhoc(sc, vap); + } + sc->sc_syncbeacon = 0; +#undef TSF_TO_TU +} + +static int +ath_descdma_setup(struct ath_softc *sc, + struct ath_descdma *dd, ath_bufhead *head, + const char *name, int nbuf, int ndesc) +{ +#define DS2PHYS(_dd, _ds) \ + ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) + struct ath_desc *ds; + struct ath_buf *bf; + int i, bsize, error; + + DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA: %u buffers %u desc/buf\n", + __func__, name, nbuf, ndesc); + + dd->dd_name = name; + dd->dd_desc_len = sizeof(struct ath_desc) * nbuf * ndesc; + + /* allocate descriptors */ + dd->dd_desc = bus_alloc_consistent(sc->sc_bdev, + dd->dd_desc_len, &dd->dd_desc_paddr); + if (dd->dd_desc == NULL) { + error = -ENOMEM; + goto fail; + } + ds = dd->dd_desc; + DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA map: %p (%lu) -> %llx (%lu)\n", + __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len, + ito64(dd->dd_desc_paddr), /*XXX*/ (u_long) dd->dd_desc_len); + + /* allocate buffers */ + bsize = sizeof(struct ath_buf) * nbuf; + bf = kmalloc(bsize, GFP_KERNEL); + if (bf == NULL) { + error = -ENOMEM; /* XXX different code */ + goto fail2; + } + memset(bf, 0, bsize); + dd->dd_bufptr = bf; + + STAILQ_INIT(head); + for (i = 0; i < nbuf; i++, bf++, ds += ndesc) { + bf->bf_desc = ds; + bf->bf_daddr = DS2PHYS(dd, ds); + STAILQ_INSERT_TAIL(head, bf, bf_list); + } + return 0; +fail2: + bus_free_consistent(sc->sc_bdev, dd->dd_desc_len, + dd->dd_desc, dd->dd_desc_paddr); +fail: + memset(dd, 0, sizeof(*dd)); + return error; +#undef DS2PHYS +} + +static void +ath_descdma_cleanup(struct ath_softc *sc, + struct ath_descdma *dd, ath_bufhead *head, int dir) +{ + struct ath_buf *bf; + struct ieee80211_node *ni; + + STAILQ_FOREACH(bf, head, bf_list) { + if (bf->bf_skb != NULL) { + /* XXX skb->len is not good enough for rxbuf */ + if (dd == &sc->sc_rxdma) + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, sc->sc_rxbufsize, dir); + else + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, dir); + dev_kfree_skb(bf->bf_skb); + bf->bf_skb = NULL; + } + ni = bf->bf_node; + bf->bf_node = NULL; + if (ni != NULL) { + /* + * Reclaim node reference. + */ + ieee80211_free_node(ni); + } + } + + /* Free memory associated with descriptors */ + bus_free_consistent(sc->sc_bdev, dd->dd_desc_len, + dd->dd_desc, dd->dd_desc_paddr); + + STAILQ_INIT(head); + kfree(dd->dd_bufptr); + memset(dd, 0, sizeof(*dd)); +} + +static int +ath_desc_alloc(struct ath_softc *sc) +{ + int error; + + error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, + "rx", ATH_RXBUF, 1); + if (error != 0) + return error; + + error = ath_descdma_setup(sc, &sc->sc_txdma, &sc->sc_txbuf, + "tx", ATH_TXBUF, ATH_TXDESC); + if (error != 0) { + ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, + BUS_DMA_FROMDEVICE); + return error; + } + + /* XXX allocate beacon state together with VAP */ + error = ath_descdma_setup(sc, &sc->sc_bdma, &sc->sc_bbuf, + "beacon", ath_maxvaps, 1); + if (error != 0) { + ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf, + BUS_DMA_TODEVICE); + ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, + BUS_DMA_FROMDEVICE); + return error; + } + return 0; +} + +static void +ath_desc_free(struct ath_softc *sc) +{ + if (sc->sc_bdma.dd_desc_len != 0) + ath_descdma_cleanup(sc, &sc->sc_bdma, &sc->sc_bbuf, + BUS_DMA_TODEVICE); + if (sc->sc_txdma.dd_desc_len != 0) + ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf, + BUS_DMA_TODEVICE); + if (sc->sc_rxdma.dd_desc_len != 0) + ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, + BUS_DMA_FROMDEVICE); +} + +static struct ieee80211_node * +ath_node_alloc(struct ieee80211_node_table *nt,struct ieee80211vap *vap) +{ + struct ath_softc *sc = nt->nt_ic->ic_dev->priv; + const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space; + struct ath_node *an; + + an = kmalloc(space, GFP_ATOMIC); + if (an == NULL) + return NULL; + memset(an, 0, space); + an->an_decomp_index = INVALID_DECOMP_INDEX; + an->an_avgrssi = ATH_RSSI_DUMMY_MARKER; + an->an_halstats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; + an->an_halstats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER; + an->an_halstats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER; + /* + * ath_rate_node_init needs a VAP pointer in node + * to decide which mgt rate to use + */ + an->an_node.ni_vap = vap; + sc->sc_rc->ops->node_init(sc, an); + + /* U-APSD init */ + STAILQ_INIT(&an->an_uapsd_q); + an->an_uapsd_qdepth = 0; + STAILQ_INIT(&an->an_uapsd_overflowq); + an->an_uapsd_overflowqdepth = 0; + ATH_NODE_UAPSD_LOCK_INIT(an); + + DPRINTF(sc, ATH_DEBUG_NODE, "%s: an %p\n", __func__, an); + return &an->an_node; +} + +static void +ath_node_cleanup(struct ieee80211_node *ni) +{ + struct ieee80211com *ic = ni->ni_ic; + struct ath_softc *sc = ni->ni_ic->ic_dev->priv; + struct ath_node *an = ATH_NODE(ni); + struct ath_buf *bf; + + /* + * U-APSD cleanup + */ + ATH_NODE_UAPSD_LOCK_IRQ(an); + if (ni->ni_flags & IEEE80211_NODE_UAPSD_TRIG) { + ni->ni_flags &= ~IEEE80211_NODE_UAPSD_TRIG; + ic->ic_uapsdmaxtriggers--; + ni->ni_flags &= ~IEEE80211_NODE_UAPSD_SP; + } + ATH_NODE_UAPSD_UNLOCK_IRQ(an); + while (an->an_uapsd_qdepth) { + bf = STAILQ_FIRST(&an->an_uapsd_q); + STAILQ_REMOVE_HEAD(&an->an_uapsd_q, bf_list); + bf->bf_desc->ds_link = 0; + + dev_kfree_skb_any(bf->bf_skb); + bf->bf_skb = NULL; + bf->bf_node = NULL; + ATH_TXBUF_LOCK_IRQ(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + ATH_TXBUF_UNLOCK_IRQ(sc); + ieee80211_free_node(ni); + + an->an_uapsd_qdepth--; + } + + while (an->an_uapsd_overflowqdepth) { + bf = STAILQ_FIRST(&an->an_uapsd_overflowq); + STAILQ_REMOVE_HEAD(&an->an_uapsd_overflowq, bf_list); + bf->bf_desc->ds_link = 0; + + dev_kfree_skb_any(bf->bf_skb); + bf->bf_skb = NULL; + bf->bf_node = NULL; + ATH_TXBUF_LOCK_IRQ(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + ATH_TXBUF_UNLOCK_IRQ(sc); + ieee80211_free_node(ni); + + an->an_uapsd_overflowqdepth--; + } + + ATH_NODE_UAPSD_LOCK_IRQ(an); + sc->sc_node_cleanup(ni); + ATH_NODE_UAPSD_UNLOCK_IRQ(an); +} + +static void +ath_node_free(struct ieee80211_node *ni) +{ + struct ath_softc *sc = ni->ni_ic->ic_dev->priv; + + sc->sc_rc->ops->node_cleanup(sc, ATH_NODE(ni)); + sc->sc_node_free(ni); +#ifdef ATH_SUPERG_XR + ath_grppoll_period_update(sc); +#endif +} + +static u_int8_t +ath_node_getrssi(const struct ieee80211_node *ni) +{ +#define HAL_EP_RND(x, mul) \ + ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul)) + u_int32_t avgrssi = ATH_NODE_CONST(ni)->an_avgrssi; + int32_t rssi; + + /* + * When only one frame is received there will be no state in + * avgrssi so fallback on the value recorded by the 802.11 layer. + */ + if (avgrssi != ATH_RSSI_DUMMY_MARKER) + rssi = HAL_EP_RND(avgrssi, HAL_RSSI_EP_MULTIPLIER); + else + rssi = ni->ni_rssi; + /* NB: theoretically we shouldn't need this, but be paranoid */ + return rssi < 0 ? 0 : rssi > 127 ? 127 : rssi; +#undef HAL_EP_RND +} + + +#ifdef ATH_SUPERG_XR +/* + * Stops the txqs and moves data between XR and Normal queues. + * Also adjusts the rate info in the descriptors. + */ + +static u_int8_t +ath_node_move_data(const struct ieee80211_node *ni) +{ +#ifdef NOT_YET + struct ath_txq *txq = NULL; + struct ieee80211com *ic = ni->ni_ic; + struct ath_softc *sc = ic->ic_dev->priv; + struct ath_buf *bf, *prev, *bf_tmp, *bf_tmp1; + struct ath_hal *ah = sc->sc_ah; + struct sk_buff *skb = NULL; + struct ath_desc *ds; + HAL_STATUS status; + int index; + + if (ni->ni_vap->iv_flags & IEEE80211_F_XR) { + struct ath_txq tmp_q; + memset(&tmp_q, 0, sizeof(tmp_q)); + STAILQ_INIT(&tmp_q.axq_q); + /* + * move data from Normal txqs to XR queue. + */ + printk("move data from NORMAL to XR\n"); + /* + * collect all the data towards the node + * in to the tmp_q. + */ + index = WME_AC_VO; + while (index >= WME_AC_BE && txq != sc->sc_ac2q[index]) { + txq = sc->sc_ac2q[index]; + ATH_TXQ_LOCK(txq); + ath_hal_stoptxdma(ah, txq->axq_qnum); + bf = prev = STAILQ_FIRST(&txq->axq_q); + /* + * skip all the buffers that are done + * until the first one that is in progress + */ + while (bf) { +#ifdef ATH_SUPERG_FF + ds = &bf->bf_desc[bf->bf_numdesc - 1]; +#else + ds = bf->bf_desc; /* NB: last descriptor */ +#endif + status = ath_hal_txprocdesc(ah, ds); + if (status == HAL_EINPROGRESS) + break; + prev = bf; + bf = STAILQ_NEXT(bf,bf_list); + } + /* + * save the pointer to the last buf that's + * done + */ + if (prev == bf) + bf_tmp = NULL; + else + bf_tmp=prev; + while (bf) { + if (ni == bf->bf_node) { + if (prev == bf) { + ATH_TXQ_REMOVE_HEAD(txq, bf_list); + STAILQ_INSERT_TAIL(&tmp_q.axq_q, bf, bf_list); + bf = STAILQ_FIRST(&txq->axq_q); + prev = bf; + } else { + STAILQ_REMOVE_AFTER(&(txq->axq_q), prev, bf_list); + txq->axq_depth--; + STAILQ_INSERT_TAIL(&tmp_q.axq_q, bf, bf_list); + bf = STAILQ_NEXT(prev, bf_list); + /* + * after deleting the node + * link the descriptors + */ +#ifdef ATH_SUPERG_FF + ds = &prev->bf_desc[prev->bf_numdesc - 1]; +#else + ds = prev->bf_desc; /* NB: last descriptor */ +#endif +#ifdef AH_NEED_DESC_SWAP + ds->ds_link = cpu_to_le32(bf->bf_daddr); +#else + ds->ds_link = bf->bf_daddr; +#endif + } + } else { + prev = bf; + bf = STAILQ_NEXT(bf, bf_list); + } + } + /* + * if the last buf was deleted. + * set the pointer to the last descriptor. + */ + bf = STAILQ_FIRST(&txq->axq_q); + if (bf) { + if (prev) { + bf = STAILQ_NEXT(prev, bf_list); + if (!bf) { /* prev is the last one on the list */ +#ifdef ATH_SUPERG_FF + ds = &prev->bf_desc[prev->bf_numdesc - 1]; +#else + ds = prev->bf_desc; /* NB: last descriptor */ +#endif + status = ath_hal_txprocdesc(ah, ds); + if (status == HAL_EINPROGRESS) + txq->axq_link = &ds->ds_link; + else + txq->axq_link = NULL; + } + } + } else + txq->axq_link = NULL; + + ATH_TXQ_UNLOCK(txq); + /* + * restart the DMA from the first + * buffer that was not DMA'd. + */ + if (bf_tmp) + bf = STAILQ_NEXT(bf_tmp, bf_list); + else + bf = STAILQ_FIRST(&txq->axq_q); + if (bf) { + ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + ath_hal_txstart(ah, txq->axq_qnum); + } + } + /* + * queue them on to the XR txqueue. + * can not directly put them on to the XR txq. since the + * skb data size may be greater than the XR fragmentation + * threshold size. + */ + bf = STAILQ_FIRST(&tmp_q.axq_q); + index = 0; + while (bf) { + skb = bf->bf_skb; + bf->bf_skb = NULL; + bf->bf_node = NULL; + ATH_TXBUF_LOCK(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + ATH_TXBUF_UNLOCK(sc); + ath_hardstart(skb,sc->sc_dev); + ATH_TXQ_REMOVE_HEAD(&tmp_q, bf_list); + bf = STAILQ_FIRST(&tmp_q.axq_q); + index++; + } + printk("moved %d buffers from NORMAL to XR\n", index); + } else { + struct ath_txq wme_tmp_qs[WME_AC_VO+1]; + struct ath_txq *wmeq = NULL, *prevq; + struct ieee80211_frame *wh; + struct ath_desc *ds = NULL; + int count = 0; + + /* + * move data from XR txq to Normal txqs. + */ + printk("move buffers from XR to NORMAL\n"); + memset(&wme_tmp_qs, 0, sizeof(wme_tmp_qs)); + for (index = 0; index <= WME_AC_VO; index++) + STAILQ_INIT(&wme_tmp_qs[index].axq_q); + txq = sc->sc_xrtxq; + ATH_TXQ_LOCK(txq); + ath_hal_stoptxdma(ah, txq->axq_qnum); + bf = prev = STAILQ_FIRST(&txq->axq_q); + /* + * skip all the buffers that are done + * until the first one that is in progress + */ + while (bf) { +#ifdef ATH_SUPERG_FF + ds = &bf->bf_desc[bf->bf_numdesc - 1]; +#else + ds = bf->bf_desc; /* NB: last descriptor */ +#endif + status = ath_hal_txprocdesc(ah, ds); + if (status == HAL_EINPROGRESS) + break; + prev= bf; + bf = STAILQ_NEXT(bf,bf_list); + } + /* + * save the pointer to the last buf that's + * done + */ + if (prev == bf) + bf_tmp1 = NULL; + else + bf_tmp1 = prev; + /* + * collect all the data in to four temp SW queues. + */ + while (bf) { + if (ni == bf->bf_node) { + if (prev == bf) { + STAILQ_REMOVE_HEAD(&txq->axq_q,bf_list); + bf_tmp=bf; + bf = STAILQ_FIRST(&txq->axq_q); + prev = bf; + } else { + STAILQ_REMOVE_AFTER(&(txq->axq_q),prev,bf_list); + bf_tmp=bf; + bf = STAILQ_NEXT(prev,bf_list); + } + count++; + skb = bf_tmp->bf_skb; + wh = (struct ieee80211_frame *) skb->data; + if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) { + /* XXX validate skb->priority, remove mask */ + wmeq = &wme_tmp_qs[skb->priority & 0x3]; + } else + wmeq = &wme_tmp_qs[WME_AC_BE]; + STAILQ_INSERT_TAIL(&wmeq->axq_q, bf_tmp, bf_list); + ds = bf_tmp->bf_desc; + /* + * link the descriptors + */ + if (wmeq->axq_link != NULL) { +#ifdef AH_NEED_DESC_SWAP + *wmeq->axq_link = cpu_to_le32(bf_tmp->bf_daddr); +#else + *wmeq->axq_link = bf_tmp->bf_daddr; +#endif + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: link[%u](%p)=%p (%p)\n", + __func__, + wmeq->axq_qnum, wmeq->axq_link, + (caddr_t)bf_tmp->bf_daddr, bf_tmp->bf_desc); + } + wmeq->axq_link = &ds->ds_link; + /* + * update the rate information + */ + } else { + prev = bf; + bf = STAILQ_NEXT(bf, bf_list); + } + } + /* + * reset the axq_link pointer to the last descriptor. + */ + bf = STAILQ_FIRST(&txq->axq_q); + if (bf) { + if (prev) { + bf = STAILQ_NEXT(prev, bf_list); + if (!bf) { /* prev is the last one on the list */ +#ifdef ATH_SUPERG_FF + ds = &prev->bf_desc[prev->bf_numdesc - 1]; +#else + ds = prev->bf_desc; /* NB: last descriptor */ +#endif + status = ath_hal_txprocdesc(ah, ds); + if (status == HAL_EINPROGRESS) + txq->axq_link = &ds->ds_link; + else + txq->axq_link = NULL; + } + } + } else { + /* + * if the list is empty reset the pointer. + */ + txq->axq_link = NULL; + } + ATH_TXQ_UNLOCK(txq); + /* + * restart the DMA from the first + * buffer that was not DMA'd. + */ + if (bf_tmp1) + bf = STAILQ_NEXT(bf_tmp1,bf_list); + else + bf = STAILQ_FIRST(&txq->axq_q); + if (bf) { + ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + ath_hal_txstart(ah, txq->axq_qnum); + } + + /* + * move (concant) the lists from the temp sw queues in to + * WME queues. + */ + index = WME_AC_VO; + txq = NULL; + while (index >= WME_AC_BE ) { + prevq = txq; + txq = sc->sc_ac2q[index]; + if (txq != prevq) { + ATH_TXQ_LOCK(txq); + ath_hal_stoptxdma(ah, txq->axq_qnum); + } + + wmeq = &wme_tmp_qs[index]; + bf = STAILQ_FIRST(&wmeq->axq_q); + if (bf) { + ATH_TXQ_MOVE_Q(wmeq,txq); + if (txq->axq_link != NULL) { +#ifdef AH_NEED_DESC_SWAP + *(txq->axq_link) = cpu_to_le32(bf->bf_daddr); +#else + *(txq->axq_link) = bf->bf_daddr; +#endif + } + } + if (index == WME_AC_BE || txq != prevq) { + /* + * find the first buffer to be DMA'd. + */ + bf = STAILQ_FIRST(&txq->axq_q); + while (bf) { +#ifdef ATH_SUPERG_FF + ds = &bf->bf_desc[bf->bf_numdesc - 1]; +#else + ds = bf->bf_desc; /* NB: last descriptor */ +#endif + status = ath_hal_txprocdesc(ah, ds); + if (status == HAL_EINPROGRESS) + break; + bf = STAILQ_NEXT(bf,bf_list); + } + if (bf) { + ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + ath_hal_txstart(ah, txq->axq_qnum); + } + ATH_TXQ_UNLOCK(txq); + } + index--; + } + printk("moved %d buffers from XR to NORMAL\n", count); + } +#endif + return 0; +} +#endif + +static struct sk_buff * +ath_alloc_skb(u_int size, u_int align) +{ + struct sk_buff *skb; + u_int off; + + skb = dev_alloc_skb(size + align - 1); + if (skb != NULL) { + off = ((unsigned long) skb->data) % align; + if (off != 0) + skb_reserve(skb, align - off); + } + return skb; +} + +static int +ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) +{ + struct ath_hal *ah = sc->sc_ah; + struct sk_buff *skb; + struct ath_desc *ds; + + skb = bf->bf_skb; + if (skb == NULL) { + if (sc->sc_nmonvaps > 0) { + u_int off; + int extra = A_MAX(sizeof(struct ath_rx_radiotap_header), + A_MAX(sizeof(wlan_ng_prism2_header), ATHDESC_HEADER_SIZE)); + + /* + * Allocate buffer for monitor mode with space for the + * wlan-ng style physical layer header at the start. + */ + skb = dev_alloc_skb(sc->sc_rxbufsize + extra + sc->sc_cachelsz - 1); + if (skb == NULL) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: skbuff alloc of size %u failed\n", + __func__, + sc->sc_rxbufsize + extra + sc->sc_cachelsz - 1); + sc->sc_stats.ast_rx_nobuf++; + return -ENOMEM; + } + /* + * Reserve space for the Prism header. + */ + skb_reserve(skb, sizeof(wlan_ng_prism2_header)); + /* + * Align to cache line. + */ + off = ((unsigned long) skb->data) % sc->sc_cachelsz; + if (off != 0) + skb_reserve(skb, sc->sc_cachelsz - off); + } else { + /* + * Cache-line-align. This is important (for the + * 5210 at least) as not doing so causes bogus data + * in rx'd frames. + */ + skb = ath_alloc_skb(sc->sc_rxbufsize, sc->sc_cachelsz); + if (skb == NULL) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: skbuff alloc of size %u failed\n", + __func__, sc->sc_rxbufsize); + sc->sc_stats.ast_rx_nobuf++; + return -ENOMEM; + } + } + skb->dev = sc->sc_dev; + bf->bf_skb = skb; + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, sc->sc_rxbufsize, BUS_DMA_FROMDEVICE); + } + + /* + * Setup descriptors. For receive we always terminate + * the descriptor list with a self-linked entry so we'll + * not get overrun under high load (as can happen with a + * 5212 when ANI processing enables PHY error frames). + * + * To ensure the last descriptor is self-linked we create + * each descriptor as self-linked and add it to the end. As + * each additional descriptor is added the previous self-linked + * entry is ``fixed'' naturally. This should be safe even + * if DMA is happening. When processing RX interrupts we + * never remove/process the last, self-linked, entry on the + * descriptor list. This ensures the hardware always has + * someplace to write a new frame. + */ + ds = bf->bf_desc; + ds->ds_link = bf->bf_daddr; /* link to self */ + ds->ds_data = bf->bf_skbaddr; + ds->ds_vdata = (void *) skb->data; /* virt addr of buffer */ + ath_hal_setuprxdesc(ah, ds + , skb_tailroom(skb) /* buffer size */ + , 0 + ); + if (sc->sc_rxlink != NULL) + *sc->sc_rxlink = bf->bf_daddr; + sc->sc_rxlink = &ds->ds_link; + return 0; +} + +/* + * Extend 15-bit time stamp from rx descriptor to + * a full 64-bit TSF using the current h/w TSF. + */ +static __inline u_int64_t +ath_extend_tsf(struct ath_hal *ah, u_int32_t rstamp) +{ + u_int64_t tsf; + + tsf = ath_hal_gettsf64(ah); + if ((tsf & 0x7fff) < rstamp) + tsf -= 0x8000; + return ((tsf &~ 0x7fff) | rstamp); +} + +/* + * Add a prism2 header to a received frame and + * dispatch it to capture tools like kismet. + */ +static void +ath_rx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_frame *wh = (struct ieee80211_frame *) skb->data; + unsigned int headersize = ieee80211_anyhdrsize(wh); + int padbytes = roundup(headersize, 4) - headersize; + u_int64_t tsf; + + /* Pass up tsf clock in mactime + * Rx descriptor has the low 15 bits of the tsf at + * the time the frame was received. Use the current + * tsf to extend this to 64 bits. + */ + tsf = ath_extend_tsf(sc->sc_ah, ds->ds_rxstat.rs_tstamp); + + KASSERT(ic->ic_flags & IEEE80211_F_DATAPAD, + ("data padding not enabled?")); + + if (padbytes > 0) { + /* Remove hw pad bytes */ + struct sk_buff *skb1 = skb_copy(skb, GFP_ATOMIC); + memmove(skb1->data + padbytes, skb1->data, headersize); + skb_pull(skb1, padbytes); + ieee80211_input_monitor(ic, skb1, ds, 0, tsf, sc); + dev_kfree_skb(skb1); + } else { + ieee80211_input_monitor(ic, skb, ds, 0, tsf, sc); + } +} + + +static void +ath_tx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_frame *wh; + int extra = A_MAX(sizeof(struct ath_tx_radiotap_header), + A_MAX(sizeof(wlan_ng_prism2_header), ATHDESC_HEADER_SIZE)); + u_int64_t tsf; + u_int32_t tstamp; + unsigned int headersize; + int padbytes; + + /* Pass up tsf clock in mactime + * TX descriptor contains the transmit time in TU's, + * (bits 25-10 of the TSF). + */ + tsf = ath_hal_gettsf64(sc->sc_ah); + tstamp = ds->ds_txstat.ts_tstamp << 10; + + if ((tsf & 0x3ffffff) < tstamp) + tsf -= 0x4000000; + tsf = ((tsf &~ 0x3ffffff) | tstamp); + + /* + * release the owner of this skb since we're basically + * recycling it + */ + if (atomic_read(&skb->users) != 1) { + struct sk_buff *skb2 = skb; + skb = skb_copy(skb, GFP_ATOMIC); + if (skb == NULL) { + printk("%s:%d %s\n", __FILE__, __LINE__, __func__); + dev_kfree_skb(skb2); + return; + } + dev_kfree_skb(skb2); + } else + skb_orphan(skb); + + wh = (struct ieee80211_frame *) skb->data; + headersize = ieee80211_anyhdrsize(wh); + padbytes = roundup(headersize, 4) - headersize; + if (padbytes > 0) { + /* Unlike in rx_capture, we're freeing the skb at the end + * anyway, so we don't need to worry about using a copy */ + memmove(skb->data + padbytes, skb->data, headersize); + skb_pull(skb, padbytes); + } + + if (skb_headroom(skb) < extra && + pskb_expand_head(skb, extra, 0, GFP_ATOMIC)) { + printk("%s:%d %s\n", __FILE__, __LINE__, __func__); + goto done; + } + ieee80211_input_monitor(ic, skb, ds, 1, tsf, sc); + done: + dev_kfree_skb(skb); +} + +/* + * Intercept management frames to collect beacon rssi data + * and to do ibss merges. + */ +static void +ath_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb, + int subtype, int rssi, u_int32_t rstamp) +{ + struct ath_softc *sc = ni->ni_ic->ic_dev->priv; + struct ieee80211vap *vap = ni->ni_vap; + + /* + * Call up first so subsequent work can use information + * potentially stored in the node (e.g. for ibss merge). + */ + sc->sc_recv_mgmt(ni, skb, subtype, rssi, rstamp); + switch (subtype) { + case IEEE80211_FC0_SUBTYPE_BEACON: + /* update rssi statistics for use by the HAL */ + ATH_RSSI_LPF(ATH_NODE(ni)->an_halstats.ns_avgbrssi, rssi); + if ((sc->sc_syncbeacon || (vap->iv_flags_ext & IEEE80211_FEXT_APPIE_UPDATE)) && + ni == vap->iv_bss && vap->iv_state == IEEE80211_S_RUN) { + /* + * Resync beacon timers using the tsf of the + * beacon frame we just received. + */ + vap->iv_flags_ext &= ~IEEE80211_FEXT_APPIE_UPDATE; + ath_beacon_config(sc, vap); + } + /* fall thru... */ + case IEEE80211_FC0_SUBTYPE_PROBE_RESP: + if (vap->iv_opmode == IEEE80211_M_IBSS && + vap->iv_state == IEEE80211_S_RUN) { + u_int64_t tsf = ath_extend_tsf(sc->sc_ah, rstamp); + /* + * Handle ibss merge as needed; check the tsf on the + * frame before attempting the merge. The 802.11 spec + * says the station should change it's bssid to match + * the oldest station with the same ssid, where oldest + * is determined by the tsf. Note that hardware + * reconfiguration happens through callback to + * ath_newstate as the state machine will go from + * RUN -> RUN when this happens. + */ + /* jal: added: don't merge if we have a desired + BSSID */ + if (!(vap->iv_flags & IEEE80211_F_DESBSSID) && + le64_to_cpu(ni->ni_tstamp.tsf) >= tsf) { + DPRINTF(sc, ATH_DEBUG_STATE, + "ibss merge, rstamp %u tsf %llu " + "tstamp %llu\n", rstamp, (long long) tsf, + (long long) le64_to_cpu(ni->ni_tstamp.tsf)); + (void) ieee80211_ibss_merge(ni); + } + } + break; + } +} + +static void +ath_setdefantenna(struct ath_softc *sc, u_int antenna) +{ + struct ath_hal *ah = sc->sc_ah; + + /* XXX block beacon interrupts */ + ath_hal_setdefantenna(ah, antenna); + if (sc->sc_defant != antenna) + sc->sc_stats.ast_ant_defswitch++; + sc->sc_defant = antenna; + sc->sc_rxotherant = 0; +} + +static void +ath_rx_tasklet(TQUEUE_ARG data) +{ +#define PA2DESC(_sc, _pa) \ + ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ + ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) + struct net_device *dev = (struct net_device *)data; + struct ath_buf *bf; + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct ath_desc *ds; + struct sk_buff *skb; + struct ieee80211_node *ni; + int len, type; + u_int phyerr; + + /* Let the 802.11 layer know about the new noise floor */ + ic->ic_channoise = sc->sc_channoise; + + DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s\n", __func__); + do { + bf = STAILQ_FIRST(&sc->sc_rxbuf); + if (bf == NULL) { /* XXX ??? can this happen */ + printk("%s: no buffer (%s)\n", dev->name, __func__); + break; + } + + /* + * Descriptors are now processed at in the first-level + * interrupt handler to support U-APSD trigger search. + * This must also be done even when U-APSD is not active to support + * other error handling that requires immediate attention. + * We check bf_status to find out if the bf's descriptors have + * been processed by the HAL. + */ + if (!(bf->bf_status & ATH_BUFSTATUS_DONE)) + break; + + ds = bf->bf_desc; + if (ds->ds_link == bf->bf_daddr) { + /* NB: never process the self-linked entry at the end */ + break; + } + skb = bf->bf_skb; + if (skb == NULL) { /* XXX ??? can this happen */ + printk("%s: no skbuff (%s)\n", dev->name, __func__); + continue; + } + +#ifdef AR_DEBUG + if (sc->sc_debug & ATH_DEBUG_RECV_DESC) + ath_printrxbuf(bf, 1); +#endif + + if (ds->ds_rxstat.rs_more) { + /* + * Frame spans multiple descriptors; this + * cannot happen yet as we don't support + * jumbograms. If not in monitor mode, + * discard the frame. + */ +#ifndef ERROR_FRAMES + /* + * Enable this if you want to see + * error frames in Monitor mode. + */ + if (ic->ic_opmode != IEEE80211_M_MONITOR) { + sc->sc_stats.ast_rx_toobig++; + goto rx_next; + } +#endif + /* fall thru for monitor mode handling... */ + } else if (ds->ds_rxstat.rs_status != 0) { + if (ds->ds_rxstat.rs_status & HAL_RXERR_CRC) + sc->sc_stats.ast_rx_crcerr++; + if (ds->ds_rxstat.rs_status & HAL_RXERR_FIFO) + sc->sc_stats.ast_rx_fifoerr++; + if (ds->ds_rxstat.rs_status & HAL_RXERR_PHY) { + sc->sc_stats.ast_rx_phyerr++; + phyerr = ds->ds_rxstat.rs_phyerr & 0x1f; + sc->sc_stats.ast_rx_phy[phyerr]++; + } + if (ds->ds_rxstat.rs_status & HAL_RXERR_DECRYPT) { + /* + * Decrypt error. If the error occurred + * because there was no hardware key, then + * let the frame through so the upper layers + * can process it. This is necessary for 5210 + * parts which have no way to setup a ``clear'' + * key cache entry. + * + * XXX do key cache faulting + */ + if (ds->ds_rxstat.rs_keyix == HAL_RXKEYIX_INVALID) + goto rx_accept; + sc->sc_stats.ast_rx_badcrypt++; + } + if (ds->ds_rxstat.rs_status & HAL_RXERR_MIC) { + sc->sc_stats.ast_rx_badmic++; + /* + * Do minimal work required to hand off + * the 802.11 header for notification. + */ + /* XXX frag's and QoS frames */ + len = ds->ds_rxstat.rs_datalen; + if (len >= sizeof (struct ieee80211_frame)) { + bus_dma_sync_single(sc->sc_bdev, + bf->bf_skbaddr, len, + BUS_DMA_FROMDEVICE); +#if 0 +/* XXX revalidate MIC, lookup ni to find VAP */ + ieee80211_notify_michael_failure(ic, + (struct ieee80211_frame *) skb->data, + sc->sc_splitmic ? + ds->ds_rxstat.rs_keyix - 32 : + ds->ds_rxstat.rs_keyix + ); +#endif + } + } + /* + * Reject error frames if we have no vaps that + * are operating in monitor mode. + */ + if(sc->sc_nmonvaps == 0) goto rx_next; + } +rx_accept: + /* + * Sync and unmap the frame. At this point we're + * committed to passing the sk_buff somewhere so + * clear buf_skb; this means a new sk_buff must be + * allocated when the rx descriptor is setup again + * to receive another frame. + */ + len = ds->ds_rxstat.rs_datalen; + bus_dma_sync_single(sc->sc_bdev, + bf->bf_skbaddr, len, BUS_DMA_FROMDEVICE); + bus_unmap_single(sc->sc_bdev, bf->bf_skbaddr, + sc->sc_rxbufsize, BUS_DMA_FROMDEVICE); + bf->bf_skb = NULL; + + sc->sc_stats.ast_ant_rx[ds->ds_rxstat.rs_antenna]++; + sc->sc_devstats.rx_packets++; + sc->sc_devstats.rx_bytes += len; + + skb_put(skb, len); + skb->protocol = __constant_htons(ETH_P_CONTROL); + + if (sc->sc_nmonvaps > 0) { + /* + * Some vap is in monitor mode, so send to + * ath_rx_capture for monitor encapsulation + */ +#if 0 + if (len < IEEE80211_ACK_LEN) { + DPRINTF(sc, ATH_DEBUG_RECV, + "%s: runt packet %d\n", __func__, len); + sc->sc_stats.ast_rx_tooshort++; + dev_kfree_skb(skb); + skb = NULL; + goto rx_next; + } +#endif + ath_rx_capture(dev, ds, skb); + if (sc->sc_ic.ic_opmode == IEEE80211_M_MONITOR) { + /* no other VAPs need the packet */ + dev_kfree_skb(skb); + skb = NULL; + goto rx_next; + } + } + + /* + * Finished monitor mode handling, now reject + * error frames before passing to other vaps + */ + if (ds->ds_rxstat.rs_status != 0) { + dev_kfree_skb(skb); + skb = NULL; + goto rx_next; + } + + /* remove the CRC */ + skb_trim(skb, skb->len - IEEE80211_CRC_LEN); + + /* + * From this point on we assume the frame is at least + * as large as ieee80211_frame_min; verify that. + */ + if (len < IEEE80211_MIN_LEN) { + DPRINTF(sc, ATH_DEBUG_RECV, "%s: short packet %d\n", + __func__, len); + sc->sc_stats.ast_rx_tooshort++; + dev_kfree_skb(skb); + skb = NULL; + goto rx_next; + } + + /* + * Normal receive. + */ + + if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) { + ieee80211_dump_pkt(ic, skb->data, skb->len, + sc->sc_hwmap[ds->ds_rxstat.rs_rate].ieeerate, + ds->ds_rxstat.rs_rssi); + } + + /* + * Locate the node for sender, track state, and then + * pass the (referenced) node up to the 802.11 layer + * for its use. If the sender is unknown spam the + * frame; it'll be dropped where it's not wanted. + */ + if (ds->ds_rxstat.rs_keyix != HAL_RXKEYIX_INVALID && + (ni = sc->sc_keyixmap[ds->ds_rxstat.rs_keyix]) != NULL) { + struct ath_node *an; + /* + * Fast path: node is present in the key map; + * grab a reference for processing the frame. + */ + an = ATH_NODE(ieee80211_ref_node(ni)); + ATH_RSSI_LPF(an->an_avgrssi, ds->ds_rxstat.rs_rssi); + type = ieee80211_input(ni, skb, + ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); + ieee80211_free_node(ni); + } else { + /* + * No key index or no entry, do a lookup and + * add the node to the mapping table if possible. + */ + ni = ieee80211_find_rxnode(ic, + (const struct ieee80211_frame_min *) skb->data); + if (ni != NULL) { + struct ath_node *an = ATH_NODE(ni); + u_int16_t keyix; + + ATH_RSSI_LPF(an->an_avgrssi, + ds->ds_rxstat.rs_rssi); + type = ieee80211_input(ni, skb, + ds->ds_rxstat.rs_rssi, + ds->ds_rxstat.rs_tstamp); + /* + * If the station has a key cache slot assigned + * update the key->node mapping table. + */ + keyix = ni->ni_ucastkey.wk_keyix; + if (keyix != IEEE80211_KEYIX_NONE && + sc->sc_keyixmap[keyix] == NULL) + sc->sc_keyixmap[keyix] = ieee80211_ref_node(ni); + ieee80211_free_node(ni); + } else + type = ieee80211_input_all(ic, skb, + ds->ds_rxstat.rs_rssi, + ds->ds_rxstat.rs_tstamp); + } + + if (sc->sc_diversity) { + /* + * When using hardware fast diversity, change the default rx + * antenna if rx diversity chooses the other antenna 3 + * times in a row. + */ + if (sc->sc_defant != ds->ds_rxstat.rs_antenna) { + if (++sc->sc_rxotherant >= 3) + ath_setdefantenna(sc, ds->ds_rxstat.rs_antenna); + } else + sc->sc_rxotherant = 0; + } + if (sc->sc_softled) { + /* + * Blink for any data frame. Otherwise do a + * heartbeat-style blink when idle. The latter + * is mainly for station mode where we depend on + * periodic beacon frames to trigger the poll event. + */ + if (type == IEEE80211_FC0_TYPE_DATA) { + sc->sc_rxrate = ds->ds_rxstat.rs_rate; + ath_led_event(sc, ATH_LED_RX); + } else if (jiffies - sc->sc_ledevent >= sc->sc_ledidle) + ath_led_event(sc, ATH_LED_POLL); + } +rx_next: + ATH_RXBUF_LOCK_IRQ(sc); + STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); + bf->bf_status &= ~ATH_BUFSTATUS_DONE; + STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + ATH_RXBUF_UNLOCK_IRQ(sc); + } while (ath_rxbuf_init(sc, bf) == 0); + + /* rx signal state monitoring */ + ath_hal_rxmonitor(ah, &sc->sc_halstats, &sc->sc_curchan); + if (ath_hal_radar_event(ah)) { + sc->sc_rtasksched = 1; + schedule_work(&sc->sc_radartask); + } +#undef PA2DESC +} + +#ifdef ATH_SUPERG_XR + +static void +ath_grppoll_period_update(struct ath_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + u_int16_t interval; + u_int16_t xrsta; + u_int16_t normalsta; + u_int16_t allsta; + + xrsta = ic->ic_xr_sta_assoc; + + /* + * if no stations are in XR mode. + * use default poll interval. + */ + if (xrsta == 0) { + if (sc->sc_xrpollint != XR_DEFAULT_POLL_INTERVAL) { + sc->sc_xrpollint = XR_DEFAULT_POLL_INTERVAL; + ath_grppoll_txq_update(sc,XR_DEFAULT_POLL_INTERVAL); + } + return; + } + + allsta = ic->ic_sta_assoc; + /* + * if all the stations are in XR mode. + * use minimum poll interval. + */ + if (allsta == xrsta) { + if (sc->sc_xrpollint != XR_MIN_POLL_INTERVAL) { + sc->sc_xrpollint = XR_MIN_POLL_INTERVAL; + ath_grppoll_txq_update(sc,XR_MIN_POLL_INTERVAL); + } + return; + } + + normalsta = allsta-xrsta; + /* + * if stations are in both XR and normal mode. + * use some fudge factor. + */ + interval = XR_DEFAULT_POLL_INTERVAL - + ((XR_DEFAULT_POLL_INTERVAL - XR_MIN_POLL_INTERVAL) * xrsta)/(normalsta * XR_GRPPOLL_PERIOD_FACTOR); + if (interval < XR_MIN_POLL_INTERVAL) + interval = XR_MIN_POLL_INTERVAL; + + if (sc->sc_xrpollint != interval) { + sc->sc_xrpollint = interval; + ath_grppoll_txq_update(sc,interval); + } + + /* + * XXX: what if stations go to sleep? + * ideally the interval should be adjusted dynamically based on + * xr and normal upstream traffic. + */ +} + +/* + * update grppoll period. + */ +static void +ath_grppoll_txq_update(struct ath_softc *sc, int period) +{ + struct ath_hal *ah = sc->sc_ah; + HAL_TXQ_INFO qi; + struct ath_txq *txq = &sc->sc_grpplq; + + if (sc->sc_grpplq.axq_qnum == -1) + return; + + memset(&qi, 0, sizeof(qi)); + qi.tqi_subtype = 0; + qi.tqi_aifs = XR_AIFS; + qi.tqi_cwmin = XR_CWMIN_CWMAX; + qi.tqi_cwmax = XR_CWMIN_CWMAX; + qi.tqi_compBuf = 0; + qi.tqi_cbrPeriod = IEEE80211_TU_TO_MS(period) * 1000; /* usec */ + qi.tqi_cbrOverflowLimit = 2; + ath_hal_settxqueueprops(ah, txq->axq_qnum,&qi); + ath_hal_resettxqueue(ah, txq->axq_qnum); /* push to h/w */ +} + +/* + * Setup grppoll h/w transmit queue. + */ +static void +ath_grppoll_txq_setup(struct ath_softc *sc, int qtype, int period) +{ +#define N(a) ((int)(sizeof(a)/sizeof(a[0]))) + struct ath_hal *ah = sc->sc_ah; + HAL_TXQ_INFO qi; + int qnum; + u_int compbufsz = 0; + char *compbuf = NULL; + dma_addr_t compbufp = 0; + struct ath_txq *txq = &sc->sc_grpplq; + + memset(&qi, 0, sizeof(qi)); + qi.tqi_subtype = 0; + qi.tqi_aifs = XR_AIFS; + qi.tqi_cwmin = XR_CWMIN_CWMAX; + qi.tqi_cwmax = XR_CWMIN_CWMAX; + qi.tqi_compBuf = 0; + qi.tqi_cbrPeriod = IEEE80211_TU_TO_MS(period) * 1000; /* usec */ + qi.tqi_cbrOverflowLimit = 2; + + if (sc->sc_grpplq.axq_qnum == -1) { + qnum = ath_hal_setuptxqueue(ah, qtype, &qi); + if (qnum == -1) + return ; + if (qnum >= N(sc->sc_txq)) { + printk("%s: HAL qnum %u out of range, max %u!\n", + sc->sc_dev->name, qnum, N(sc->sc_txq)); + ath_hal_releasetxqueue(ah, qnum); + return; + } + + txq->axq_qnum = qnum; + } + txq->axq_link = NULL; + STAILQ_INIT(&txq->axq_q); + ATH_TXQ_LOCK_INIT(txq); + txq->axq_depth = 0; + txq->axq_totalqueued = 0; + txq->axq_intrcnt = 0; + TAILQ_INIT(&txq->axq_stageq); + txq->axq_compbuf = compbuf; + txq->axq_compbufsz = compbufsz; + txq->axq_compbufp = compbufp; + ath_hal_resettxqueue(ah, txq->axq_qnum); /* push to h/w */ +#undef N + +} + +/* + * Setup group poll frames on the group poll queue. + */ +static void ath_grppoll_start(struct ieee80211vap *vap,int pollcount) +{ + int i, amode; + int flags; + struct sk_buff *skb = NULL; + struct ath_buf *bf, *head = NULL; + struct ieee80211com *ic = vap->iv_ic; + struct ath_softc *sc = ic->ic_dev->priv; + struct ath_hal *ah = sc->sc_ah; + u_int8_t rate; + int ctsrate = 0; + int ctsduration = 0; + const HAL_RATE_TABLE *rt; + u_int8_t cix, rtindex = 0; + u_int type; + struct ath_txq *txq = &sc->sc_grpplq; + struct ath_desc *ds = NULL; + int pktlen = 0, keyix = 0; + int pollsperrate, pos; + int rates[XR_NUM_RATES]; + u_int8_t ratestr[16], numpollstr[16]; + typedef struct rate_to_str_map { + u_int8_t str[4]; + int ratekbps; + } RATE_TO_STR_MAP; + + static const RATE_TO_STR_MAP ratestrmap[] = { + {"0.25", 250}, + { ".25", 250}, + {"0.5", 500}, + { ".5", 500}, + { "1", 1000}, + { "3", 3000}, + { "6", 6000}, + { "?", 0}, + }; + +#define MAX_GRPPOLL_RATE 5 +#define USE_SHPREAMBLE(_ic) \ + (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER)) \ + == IEEE80211_F_SHPREAMBLE) + + if (sc->sc_xrgrppoll) + return; + + memset(&rates, 0, sizeof(rates)); + pos = 0; + while (sscanf(&(sc->sc_grppoll_str[pos]), "%s %s", ratestr, numpollstr) == 2) { + int rtx = 0; + while (ratestrmap[rtx].ratekbps != 0) { + if (strcmp(ratestrmap[rtx].str, ratestr) == 0) + break; + rtx++; + } + sscanf(numpollstr, "%d", &(rates[rtx])); + pos += strlen(ratestr) + strlen(numpollstr) + 2; + } + if (!sc->sc_grppolldma.dd_bufptr) { + printk("grppoll_start: grppoll Buf allocation failed\n"); + return; + } + rt = sc->sc_currates; + cix = rt->info[sc->sc_protrix].controlRate; + ctsrate = rt->info[cix].rateCode; + if (USE_SHPREAMBLE(ic)) + ctsrate |= rt->info[cix].shortPreamble; + rt = sc->sc_xr_rates; + /* + * queue the group polls for each antenna mode. set the right keycache index for the + * broadcast packets. this will ensure that if the first poll + * does not elicit a single chirp from any XR station, hardware will + * not send the subsequent polls + */ + pollsperrate = 0; + for (amode = HAL_ANTENNA_FIXED_A; amode < HAL_ANTENNA_MAX_MODE ; amode++) { + for (i = 0; i < (pollcount + 1); i++) { + + flags = HAL_TXDESC_NOACK; + rate = rt->info[rtindex].rateCode; + /* + * except for the last one every thing else is a CF poll. + * last one is the CF End frame. + */ + + if (i == pollcount) { + skb = ieee80211_getcfframe(vap,IEEE80211_FC0_SUBTYPE_CF_END); + rate = ctsrate; + ctsduration = ath_hal_computetxtime(ah, + sc->sc_currates, pktlen, sc->sc_protrix, AH_FALSE); + } else { + skb = ieee80211_getcfframe(vap, IEEE80211_FC0_SUBTYPE_CFPOLL); + pktlen = skb->len + IEEE80211_CRC_LEN; + /* + * the very first group poll ctsduration should be enough to allow + * an auth frame from station. This is to pass the wifi testing (as + * some stations in testing do not honor CF_END and rely on CTS duration) + */ + if (i == 0 && amode == HAL_ANTENNA_FIXED_A) { + ctsduration = ath_hal_computetxtime(ah, rt, + pktlen, rtindex, + AH_FALSE) /*cf-poll time */ + + (XR_AIFS + (XR_CWMIN_CWMAX * XR_SLOT_DELAY)) + + ath_hal_computetxtime(ah, rt, + 2 * (sizeof(struct ieee80211_frame_min) + 6), + IEEE80211_XR_DEFAULT_RATE_INDEX, + AH_FALSE) /*auth packet time */ + + ath_hal_computetxtime(ah, rt, + IEEE80211_ACK_LEN, + IEEE80211_XR_DEFAULT_RATE_INDEX, + AH_FALSE); /*ack frame time */ + } else { + ctsduration = ath_hal_computetxtime(ah, rt, + pktlen, rtindex, + AH_FALSE) /*cf-poll time */ + + (XR_AIFS + (XR_CWMIN_CWMAX * XR_SLOT_DELAY)) + + ath_hal_computetxtime(ah,rt, + XR_FRAGMENTATION_THRESHOLD, + IEEE80211_XR_DEFAULT_RATE_INDEX, + AH_FALSE) /*data packet time */ + + ath_hal_computetxtime(ah,rt, + IEEE80211_ACK_LEN, + IEEE80211_XR_DEFAULT_RATE_INDEX, + AH_FALSE); /*ack frame time */ + } + if ((vap->iv_flags & IEEE80211_F_PRIVACY) && keyix == 0) { + struct ieee80211_key *k; + k = ieee80211_crypto_encap(vap->iv_bss, skb); + if (k) + keyix = k->wk_keyix; + } + } + ATH_TXBUF_LOCK_IRQ(sc); + bf = STAILQ_FIRST(&sc->sc_grppollbuf); + if (bf != NULL) + STAILQ_REMOVE_HEAD(&sc->sc_grppollbuf, bf_list); + else { + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: No more TxBufs\n", __func__); + ATH_TXBUF_UNLOCK_IRQ_EARLY(sc); + return; + } + /* XXX use a counter and leave at least one for mgmt frames */ + if (STAILQ_EMPTY(&sc->sc_grppollbuf)) { + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: No more TxBufs left\n", __func__); + ATH_TXBUF_UNLOCK_IRQ_EARLY(sc); + return; + } + ATH_TXBUF_UNLOCK_IRQ(sc); + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, skb->len, BUS_DMA_TODEVICE); + bf->bf_skb = skb; + ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); + ds = bf->bf_desc; + ds->ds_data = bf->bf_skbaddr; + if (i == pollcount && amode == (HAL_ANTENNA_MAX_MODE -1)) { + type = HAL_PKT_TYPE_NORMAL; + flags |= (HAL_TXDESC_CLRDMASK | HAL_TXDESC_VEOL); + } else { + flags |= HAL_TXDESC_CTSENA; + type = HAL_PKT_TYPE_GRP_POLL; + } + if (i == 0 && amode == HAL_ANTENNA_FIXED_A ) { + flags |= HAL_TXDESC_CLRDMASK; + head = bf; + } + ath_hal_setuptxdesc(ah, ds + , skb->len + IEEE80211_CRC_LEN /* frame length */ + , sizeof(struct ieee80211_frame) /* header length */ + , type /* Atheros packet type */ + , ic->ic_txpowlimit /* max txpower */ + , rate, 0 /* series 0 rate/tries */ + , keyix /* HAL_TXKEYIX_INVALID */ /* use key index */ + , amode /* antenna mode */ + , flags + , ctsrate /* rts/cts rate */ + , ctsduration /* rts/cts duration */ + , 0 /* comp icv len */ + , 0 /* comp iv len */ + , ATH_COMP_PROC_NO_COMP_NO_CCS /* comp scheme */ + ); + ath_hal_filltxdesc(ah, ds + , roundup(skb->len, 4) /* buffer length */ + , AH_TRUE /* first segment */ + , AH_TRUE /* last segment */ + , ds /* first descriptor */ + ); + /* NB: The desc swap function becomes void, + * if descriptor swapping is not enabled + */ + ath_desc_swap(ds); + if (txq->axq_link) { +#ifdef AH_NEED_DESC_SWAP + *txq->axq_link = cpu_to_le32(bf->bf_daddr); +#else + *txq->axq_link = bf->bf_daddr; +#endif + } + txq->axq_link = &ds->ds_link; + pollsperrate++; + if (pollsperrate > rates[rtindex]) { + rtindex = (rtindex + 1) % MAX_GRPPOLL_RATE; + pollsperrate = 0; + } + } + } + /* make it circular */ +#ifdef AH_NEED_DESC_SWAP + ds->ds_link = cpu_to_le32(head->bf_daddr); +#else + ds->ds_link = head->bf_daddr; +#endif + /* start the queue */ + ath_hal_puttxbuf(ah, txq->axq_qnum, head->bf_daddr); + ath_hal_txstart(ah, txq->axq_qnum); + sc->sc_xrgrppoll = 1; +#undef USE_SHPREAMBLE +} + +static void ath_grppoll_stop(struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ath_softc *sc = ic->ic_dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ath_txq *txq = &sc->sc_grpplq; + struct ath_buf *bf; + + + if (!sc->sc_xrgrppoll) + return; + ath_hal_stoptxdma(ah, txq->axq_qnum); + + /* move the grppool bufs back to the grppollbuf */ + for (;;) { + ATH_TXQ_LOCK(txq); + bf = STAILQ_FIRST(&txq->axq_q); + if (bf == NULL) { + txq->axq_link = NULL; + ATH_TXQ_UNLOCK(txq); + break; + } + ATH_TXQ_REMOVE_HEAD(txq, bf_list); + ATH_TXQ_UNLOCK(txq); + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + dev_kfree_skb(bf->bf_skb); + bf->bf_skb = NULL; + bf->bf_node = NULL; + + ATH_TXBUF_LOCK(sc); + STAILQ_INSERT_TAIL(&sc->sc_grppollbuf, bf, bf_list); + ATH_TXBUF_UNLOCK(sc); + } + STAILQ_INIT(&txq->axq_q); + ATH_TXQ_LOCK_INIT(txq); + txq->axq_depth = 0; + txq->axq_totalqueued = 0; + txq->axq_intrcnt = 0; + TAILQ_INIT(&txq->axq_stageq); + sc->sc_xrgrppoll = 0; +} +#endif + +/* + * Setup a h/w transmit queue. + */ +static struct ath_txq * +ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) +{ +#define N(a) ((int)(sizeof(a)/sizeof(a[0]))) + struct ath_hal *ah = sc->sc_ah; + HAL_TXQ_INFO qi; + int qnum; + u_int compbufsz = 0; + char *compbuf = NULL; + dma_addr_t compbufp = 0; + + memset(&qi, 0, sizeof(qi)); + qi.tqi_subtype = subtype; + qi.tqi_aifs = HAL_TXQ_USEDEFAULT; + qi.tqi_cwmin = HAL_TXQ_USEDEFAULT; + qi.tqi_cwmax = HAL_TXQ_USEDEFAULT; + qi.tqi_compBuf = 0; +#ifdef ATH_SUPERG_XR + if (subtype == HAL_XR_DATA) { + qi.tqi_aifs = XR_DATA_AIFS; + qi.tqi_cwmin = XR_DATA_CWMIN; + qi.tqi_cwmax = XR_DATA_CWMAX; + } +#endif + +#ifdef ATH_SUPERG_COMP + /* allocate compression scratch buffer for data queues */ + if (((qtype == HAL_TX_QUEUE_DATA)|| (qtype == HAL_TX_QUEUE_UAPSD)) + && ath_hal_compressionsupported(ah)) { + compbufsz = roundup(HAL_COMP_BUF_MAX_SIZE, + HAL_COMP_BUF_ALIGN_SIZE) + HAL_COMP_BUF_ALIGN_SIZE; + compbuf = (char *)bus_alloc_consistent(sc->sc_bdev, + compbufsz, &compbufp); + if (compbuf == NULL) + sc->sc_ic.ic_ath_cap &= ~IEEE80211_ATHC_COMP; + else + qi.tqi_compBuf = (u_int32_t)compbufp; + } +#endif + /* + * Enable interrupts only for EOL and DESC conditions. + * We mark tx descriptors to receive a DESC interrupt + * when a tx queue gets deep; otherwise waiting for the + * EOL to reap descriptors. Note that this is done to + * reduce interrupt load and this only defers reaping + * descriptors, never transmitting frames. Aside from + * reducing interrupts this also permits more concurrency. + * The only potential downside is if the tx queue backs + * up in which case the top half of the kernel may backup + * due to a lack of tx descriptors. + * + * The UAPSD queue is an exception, since we take a desc- + * based intr on the EOSP frames. + */ + if (qtype == HAL_TX_QUEUE_UAPSD) + qi.tqi_qflags = HAL_TXQ_TXDESCINT_ENABLE; + else + qi.tqi_qflags = HAL_TXQ_TXEOLINT_ENABLE | HAL_TXQ_TXDESCINT_ENABLE; + qnum = ath_hal_setuptxqueue(ah, qtype, &qi); + if (qnum == -1) { + /* + * NB: don't print a message, this happens + * normally on parts with too few tx queues + */ +#ifdef ATH_SUPERG_COMP + if (compbuf) { + bus_free_consistent(sc->sc_bdev, compbufsz, + compbuf, compbufp); + } +#endif + return NULL; + } + if (qnum >= N(sc->sc_txq)) { + printk("%s: HAL qnum %u out of range, max %u!\n", + sc->sc_dev->name, qnum, N(sc->sc_txq)); +#ifdef ATH_SUPERG_COMP + if (compbuf) { + bus_free_consistent(sc->sc_bdev, compbufsz, + compbuf, compbufp); + } +#endif + ath_hal_releasetxqueue(ah, qnum); + return NULL; + } + if (!ATH_TXQ_SETUP(sc, qnum)) { + struct ath_txq *txq = &sc->sc_txq[qnum]; + + txq->axq_qnum = qnum; + txq->axq_link = NULL; + STAILQ_INIT(&txq->axq_q); + ATH_TXQ_LOCK_INIT(txq); + txq->axq_depth = 0; + txq->axq_totalqueued = 0; + txq->axq_intrcnt = 0; + TAILQ_INIT(&txq->axq_stageq); + txq->axq_compbuf = compbuf; + txq->axq_compbufsz = compbufsz; + txq->axq_compbufp = compbufp; + sc->sc_txqsetup |= 1 << qnum; + } + return &sc->sc_txq[qnum]; +#undef N +} + +/* + * Setup a hardware data transmit queue for the specified + * access control. The HAL may not support all requested + * queues in which case it will return a reference to a + * previously setup queue. We record the mapping from ac's + * to h/w queues for use by ath_tx_start and also track + * the set of h/w queues being used to optimize work in the + * transmit interrupt handler and related routines. + */ +static int +ath_tx_setup(struct ath_softc *sc, int ac, int haltype) +{ +#define N(a) ((int)(sizeof(a)/sizeof(a[0]))) + struct ath_txq *txq; + + if (ac >= N(sc->sc_ac2q)) { + printk("%s: AC %u out of range, max %u!\n", + sc->sc_dev->name, ac, (unsigned)N(sc->sc_ac2q)); + return 0; + } + txq = ath_txq_setup(sc, HAL_TX_QUEUE_DATA, haltype); + if (txq != NULL) { + sc->sc_ac2q[ac] = txq; + return 1; + } else + return 0; +#undef N +} + +/* + * Update WME parameters for a transmit queue. + */ +static int +ath_txq_update(struct ath_softc *sc, struct ath_txq *txq, int ac) +{ +#define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ic; + struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; + struct ath_hal *ah = sc->sc_ah; + HAL_TXQ_INFO qi; + + ath_hal_gettxqueueprops(ah, txq->axq_qnum, &qi); + qi.tqi_aifs = wmep->wmep_aifsn; + qi.tqi_cwmin = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); + qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); + qi.tqi_burstTime = ATH_TXOP_TO_US(wmep->wmep_txopLimit); + + if (!ath_hal_settxqueueprops(ah, txq->axq_qnum, &qi)) { + printk("%s: unable to update hardware queue " + "parameters for %s traffic!\n", + sc->sc_dev->name, ieee80211_wme_acnames[ac]); + return 0; + } else { + ath_hal_resettxqueue(ah, txq->axq_qnum); /* push to h/w */ + return 1; + } +#undef ATH_TXOP_TO_US +#undef ATH_EXPONENT_TO_VALUE +} + +/* + * Callback from the 802.11 layer to update WME parameters. + */ +static int +ath_wme_update(struct ieee80211com *ic) +{ + struct ath_softc *sc = ic->ic_dev->priv; + + if (sc->sc_uapsdq) + ath_txq_update(sc, sc->sc_uapsdq, WME_AC_VO); + + return !ath_txq_update(sc, sc->sc_ac2q[WME_AC_BE], WME_AC_BE) || + !ath_txq_update(sc, sc->sc_ac2q[WME_AC_BK], WME_AC_BK) || + !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VI], WME_AC_VI) || + !ath_txq_update(sc, sc->sc_ac2q[WME_AC_VO], WME_AC_VO) ? EIO : 0; +} + +/* + * Callback from 802.11 layer to flush a node's U-APSD queues + */ +static void +ath_uapsd_flush(struct ieee80211_node *ni) +{ + struct ath_node *an = ATH_NODE(ni); + struct ath_buf *bf; + struct ath_softc *sc = ni->ni_ic->ic_dev->priv; + struct ath_txq *txq; + + ATH_NODE_UAPSD_LOCK_IRQ(an); + /* + * NB: could optimize for successive runs from the same AC + * if we can assume that is the most frequent case. + */ + while (an->an_uapsd_qdepth) { + bf = STAILQ_FIRST(&an->an_uapsd_q); + STAILQ_REMOVE_HEAD(&an->an_uapsd_q, bf_list); + bf->bf_desc->ds_link = 0; + txq = sc->sc_ac2q[bf->bf_skb->priority & 0x3]; + ath_tx_txqaddbuf(sc, ni, txq, bf, bf->bf_desc, bf->bf_skb->len); + an->an_uapsd_qdepth--; + } + + while (an->an_uapsd_overflowqdepth) { + bf = STAILQ_FIRST(&an->an_uapsd_overflowq); + STAILQ_REMOVE_HEAD(&an->an_uapsd_overflowq, bf_list); + bf->bf_desc->ds_link = 0; + txq = sc->sc_ac2q[bf->bf_skb->priority & 0x3]; + ath_tx_txqaddbuf(sc, ni, txq, bf, bf->bf_desc, bf->bf_skb->len); + an->an_uapsd_overflowqdepth--; + } + if (IEEE80211_NODE_UAPSD_USETIM(ni)) + ni->ni_vap->iv_set_tim(ni, 0); + ATH_NODE_UAPSD_UNLOCK_IRQ(an); +} + +/* + * Reclaim resources for a setup queue. + */ +static void +ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) +{ + +#ifdef ATH_SUPERG_COMP + /* Release compression buffer */ + if (txq->axq_compbuf) { + bus_free_consistent(sc->sc_bdev, txq->axq_compbufsz, + txq->axq_compbuf, txq->axq_compbufp); + txq->axq_compbuf = NULL; + } +#endif + ath_hal_releasetxqueue(sc->sc_ah, txq->axq_qnum); + ATH_TXQ_LOCK_DESTROY(txq); + sc->sc_txqsetup &= ~(1 << txq->axq_qnum); +} + +/* + * Reclaim all tx queue resources. + */ +static void +ath_tx_cleanup(struct ath_softc *sc) +{ + int i; + + ATH_TXBUF_LOCK_DESTROY(sc); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_cleanupq(sc, &sc->sc_txq[i]); +} + +#ifdef ATH_SUPERG_COMP +static u_int32_t +ath_get_icvlen(struct ieee80211_key *k) +{ + const struct ieee80211_cipher *cip = k->wk_cipher; + + if (cip->ic_cipher == IEEE80211_CIPHER_AES_CCM || + cip->ic_cipher == IEEE80211_CIPHER_AES_OCB) + return AES_ICV_FIELD_SIZE; + + return WEP_ICV_FIELD_SIZE; +} + +static u_int32_t +ath_get_ivlen(struct ieee80211_key *k) +{ + const struct ieee80211_cipher *cip = k->wk_cipher; + u_int32_t ivlen; + + ivlen = WEP_IV_FIELD_SIZE; + + if (cip->ic_cipher == IEEE80211_CIPHER_AES_CCM || + cip->ic_cipher == IEEE80211_CIPHER_AES_OCB) + ivlen += EXT_IV_FIELD_SIZE; + + return ivlen; +} +#endif + +/* + * Get transmit rate index using rate in Kbps + */ +static __inline int +ath_tx_findindex(const HAL_RATE_TABLE *rt, int rate) +{ + int i; + int ndx = 0; + + for (i = 0; i < rt->rateCount; i++) { + if (rt->info[i].rateKbps == rate) { + ndx = i; + break; + } + } + + return ndx; +} + +/* + * Needs external locking! + */ +static void +ath_tx_uapsdqueue(struct ath_softc *sc, struct ath_node *an, struct ath_buf *bf) +{ + struct ath_buf *lastbuf; + + /* case the delivery queue just sent and can move overflow q over */ + if (an->an_uapsd_qdepth == 0 && an->an_uapsd_overflowqdepth != 0) { + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: delivery Q empty, replacing with overflow Q\n", + __func__); + STAILQ_CONCAT(&an->an_uapsd_q, &an->an_uapsd_overflowq); + an->an_uapsd_qdepth = an->an_uapsd_overflowqdepth; + an->an_uapsd_overflowqdepth = 0; + } + + /* most common case - room on delivery q */ + if (an->an_uapsd_qdepth < an->an_node.ni_uapsd_maxsp) { + /* add to delivery q */ + if ((lastbuf = STAILQ_LAST(&an->an_uapsd_q, ath_buf, bf_list))) { +#ifdef AH_NEED_DESC_SWAP + lastbuf->bf_desc->ds_link = cpu_to_le32(bf->bf_daddr); +#else + lastbuf->bf_desc->ds_link = bf->bf_daddr; +#endif + } + STAILQ_INSERT_TAIL(&an->an_uapsd_q, bf, bf_list); + an->an_uapsd_qdepth++; + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: added AC %d frame to delivery Q, new depth = %d\n", + __func__, bf->bf_skb->priority, an->an_uapsd_qdepth); + return; + } + + /* check if need to make room on overflow queue */ + if (an->an_uapsd_overflowqdepth == an->an_node.ni_uapsd_maxsp) { + /* + * pop oldest from delivery queue and cleanup + */ + lastbuf = STAILQ_FIRST(&an->an_uapsd_q); + STAILQ_REMOVE_HEAD(&an->an_uapsd_q, bf_list); + dev_kfree_skb(lastbuf->bf_skb); + lastbuf->bf_skb = NULL; + ieee80211_free_node(lastbuf->bf_node); + lastbuf->bf_node = NULL; + ATH_TXBUF_LOCK_IRQ(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, lastbuf, bf_list); + ATH_TXBUF_UNLOCK_IRQ(sc); + + /* + * move oldest from overflow to delivery + */ + lastbuf = STAILQ_FIRST(&an->an_uapsd_overflowq); + STAILQ_REMOVE_HEAD(&an->an_uapsd_overflowq, bf_list); + an->an_uapsd_overflowqdepth--; + STAILQ_INSERT_TAIL(&an->an_uapsd_q, lastbuf, bf_list); + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: delivery and overflow Qs full, dropped oldest\n", + __func__); + } + + /* add to overflow q */ + if ((lastbuf = STAILQ_LAST(&an->an_uapsd_overflowq, ath_buf, bf_list))) { +#ifdef AH_NEED_DESC_SWAP + lastbuf->bf_desc->ds_link = cpu_to_le32(bf->bf_daddr); +#else + lastbuf->bf_desc->ds_link = bf->bf_daddr; +#endif + } + STAILQ_INSERT_TAIL(&an->an_uapsd_overflowq, bf, bf_list); + an->an_uapsd_overflowqdepth++; + DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: added AC %d to overflow Q, new depth = %d\n", + __func__, bf->bf_skb->priority, an->an_uapsd_overflowqdepth); + + return; +} + +static int +ath_tx_start(struct net_device *dev, struct ieee80211_node *ni, struct ath_buf *bf, struct sk_buff *skb, int nextfraglen) +{ +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = ni->ni_ic; + struct ieee80211vap *vap = ni->ni_vap; + struct ath_hal *ah = sc->sc_ah; + int isprot, ismcast, keyix, hdrlen, pktlen, try0; + u_int8_t rix, txrate, ctsrate; + u_int32_t ivlen = 0, icvlen = 0; + int comp = ATH_COMP_PROC_NO_COMP_NO_CCS; + u_int8_t cix = 0xff; /* NB: silence compiler */ + struct ath_desc *ds = NULL; + struct ath_txq *txq = NULL; + struct ieee80211_frame *wh; + u_int subtype, flags, ctsduration; + HAL_PKT_TYPE atype; + const HAL_RATE_TABLE *rt; + HAL_BOOL shortPreamble; + struct ath_node *an; + struct ath_vap *avp = ATH_VAP(vap); + int istxfrag; + u_int8_t antenna; + + wh = (struct ieee80211_frame *) skb->data; + isprot = wh->i_fc[1] & IEEE80211_FC1_PROT; + ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); + hdrlen = ieee80211_anyhdrsize(wh); + istxfrag = (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) || + (((le16toh(*(__le16 *) &wh->i_seq[0]) >> + IEEE80211_SEQ_FRAG_SHIFT) & IEEE80211_SEQ_FRAG_MASK) > 0); + + pktlen = skb->len; +#ifdef ATH_SUPERG_FF + { + struct sk_buff *skbtmp = skb; + while ((skbtmp = skbtmp->next)) + pktlen += skbtmp->len; + } +#endif + /* + * Packet length must not include any + * pad bytes; deduct them here. + */ + pktlen -= (hdrlen & 3); + + if (isprot) { + const struct ieee80211_cipher *cip; + struct ieee80211_key *k; + + /* + * Construct the 802.11 header+trailer for an encrypted + * frame. The only reason this can fail is because of an + * unknown or unsupported cipher/key type. + */ + + /* FFXXX: change to handle linked skbs */ + k = ieee80211_crypto_encap(ni, skb); + if (k == NULL) { + /* + * This can happen when the key is yanked after the + * frame was queued. Just discard the frame; the + * 802.11 layer counts failures and provides + * debugging/diagnostics. + */ + return -EIO; + } + /* + * Adjust the packet + header lengths for the crypto + * additions and calculate the h/w key index. When + * a s/w mic is done the frame will have had any mic + * added to it prior to entry so skb->len above will + * account for it. Otherwise we need to add it to the + * packet length. + */ + cip = k->wk_cipher; + hdrlen += cip->ic_header; + pktlen += cip->ic_header + cip->ic_trailer; + if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { + if (!istxfrag) + pktlen += cip->ic_miclen; + else + if (cip->ic_cipher != IEEE80211_CIPHER_TKIP) + pktlen += cip->ic_miclen; + } + keyix = k->wk_keyix; + +#ifdef ATH_SUPERG_COMP + icvlen = ath_get_icvlen(k) / 4; + ivlen = ath_get_ivlen(k) / 4; +#endif + /* packet header may have moved, reset our local pointer */ + wh = (struct ieee80211_frame *) skb->data; + } else if (ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) { + /* + * Use station key cache slot, if assigned. + */ + keyix = ni->ni_ucastkey.wk_keyix; + if (keyix == IEEE80211_KEYIX_NONE) + keyix = HAL_TXKEYIX_INVALID; + } else + keyix = HAL_TXKEYIX_INVALID; + + pktlen += IEEE80211_CRC_LEN; + + /* + * Load the DMA map so any coalescing is done. This + * also calculates the number of descriptors we need. + */ +#ifndef ATH_SUPERG_FF + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, pktlen, BUS_DMA_TODEVICE); + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: skb %p [data %p len %u] skbaddr %llx\n", + __func__, skb, skb->data, skb->len, ito64(bf->bf_skbaddr)); +#else /* ATH_SUPERG_FF case */ + /* NB: ensure skb->len had been updated for each skb so we don't need pktlen */ + { + struct sk_buff *skbtmp = skb; + int i = 0; + + bf->bf_skbaddr = bus_map_single(sc->sc_bdev, + skb->data, skb->len, BUS_DMA_TODEVICE); + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: skb%d %p [data %p len %u] skbaddr %llx\n", + __func__, i, skb, skb->data, skb->len, ito64(bf->bf_skbaddr)); + while ((skbtmp = skbtmp->next)) { + bf->bf_skbaddrff[i++] = bus_map_single(sc->sc_bdev, + skbtmp->data, skbtmp->len, BUS_DMA_TODEVICE); + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: skb%d %p [data %p len %u] skbaddr %llx\n", + __func__, i, skbtmp, skbtmp->data, skbtmp->len, + ito64(bf->bf_skbaddrff[i-1])); + } + bf->bf_numdesc = i + 1; + } +#endif /* ATH_SUPERG_FF */ + bf->bf_skb = skb; + bf->bf_node = ni; + + /* setup descriptors */ + ds = bf->bf_desc; +#ifdef ATH_SUPERG_XR + if(vap->iv_flags & IEEE80211_F_XR ) + rt = sc->sc_xr_rates; + else + rt = sc->sc_currates; +#else + rt = sc->sc_currates; +#endif + KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + + /* + * NB: the 802.11 layer marks whether or not we should + * use short preamble based on the current mode and + * negotiated parameters. + */ + if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && + (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE)) { + shortPreamble = AH_TRUE; + sc->sc_stats.ast_tx_shortpre++; + } else + shortPreamble = AH_FALSE; + + an = ATH_NODE(ni); + flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + /* + * Calculate Atheros packet type from IEEE80211 packet header, + * setup for rate calculations, and select h/w transmit queue. + */ + switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { + case IEEE80211_FC0_TYPE_MGT: + subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + if (subtype == IEEE80211_FC0_SUBTYPE_BEACON) + atype = HAL_PKT_TYPE_BEACON; + else if (subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP) + atype = HAL_PKT_TYPE_PROBE_RESP; + else if (subtype == IEEE80211_FC0_SUBTYPE_ATIM) + atype = HAL_PKT_TYPE_ATIM; + else + atype = HAL_PKT_TYPE_NORMAL; /* XXX */ + rix = sc->sc_minrateix; + txrate = rt->info[rix].rateCode; + if (shortPreamble) + txrate |= rt->info[rix].shortPreamble; + try0 = ATH_TXMAXTRY; + + if (ni->ni_flags & IEEE80211_NODE_QOS) { + /* NB: force all management frames to highest queue */ + txq = sc->sc_ac2q[WME_AC_VO]; + } else + txq = sc->sc_ac2q[WME_AC_BE]; + break; + case IEEE80211_FC0_TYPE_CTL: + atype = HAL_PKT_TYPE_PSPOLL; /* stop setting of duration */ + rix = sc->sc_minrateix; + txrate = rt->info[rix].rateCode; + if (shortPreamble) + txrate |= rt->info[rix].shortPreamble; + try0 = ATH_TXMAXTRY; + + if (ni->ni_flags & IEEE80211_NODE_QOS) { + /* NB: force all ctl frames to highest queue */ + txq = sc->sc_ac2q[WME_AC_VO]; + } else + txq = sc->sc_ac2q[WME_AC_BE]; + break; + case IEEE80211_FC0_TYPE_DATA: + atype = HAL_PKT_TYPE_NORMAL; /* default */ + + if (ismcast) { + rix = ath_tx_findindex(rt, vap->iv_mcast_rate); + txrate = rt->info[rix].rateCode; + if (shortPreamble) + txrate |= rt->info[rix].shortPreamble; + /* + * ATH_TXMAXTRY disables Multi-rate retries, which + * isn't applicable to mcast packets and overrides + * the desired transmission rate for mcast traffic. + */ + try0 = ATH_TXMAXTRY; + } else { + /* + * Data frames; consult the rate control module. + */ + sc->sc_rc->ops->findrate(sc, an, shortPreamble, skb->len, + &rix, &try0, &txrate); + + /* Ratecontrol sometimes returns invalid rate index */ + if (rix != 0xff) + an->an_prevdatarix = rix; + else + rix = an->an_prevdatarix; + } + + if (M_FLAG_GET(skb, M_UAPSD)) { + /* U-APSD frame, handle txq later */ + break; + } + + /* + * Default all non-QoS traffic to the best-effort queue. + */ + if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) { + /* XXX validate skb->priority, remove mask */ + txq = sc->sc_ac2q[skb->priority & 0x3]; + if (ic->ic_wme.wme_wmeChanParams.cap_wmeParams[skb->priority].wmep_noackPolicy) { + flags |= HAL_TXDESC_NOACK; + sc->sc_stats.ast_tx_noack++; + } + } else + txq = sc->sc_ac2q[WME_AC_BE]; + break; + default: + printk("%s: bogus frame type 0x%x (%s)\n", dev->name, + wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, __func__); + /* XXX statistic */ + return -EIO; + } + +#ifdef ATH_SUPERG_XR + if (vap->iv_flags & IEEE80211_F_XR ) { + txq = sc->sc_xrtxq; + if (!txq) + txq = sc->sc_ac2q[WME_AC_BK]; + flags |= HAL_TXDESC_CTSENA; + cix = rt->info[sc->sc_protrix].controlRate; + } +#endif + /* + * When servicing one or more stations in power-save mode (or) + * if there is some mcast data waiting on mcast queue + * (to prevent out of order delivery of mcast,bcast packets) + * multicast frames must be buffered until after the beacon. + * We use the private mcast queue for that. + */ + if (ismcast && (vap->iv_ps_sta || avp->av_mcastq.axq_depth)) { + txq = &avp->av_mcastq; + /* XXX? more bit in 802.11 frame header */ + } + + /* + * Calculate miscellaneous flags. + */ + if (ismcast) { + flags |= HAL_TXDESC_NOACK; /* no ack on broad/multicast */ + sc->sc_stats.ast_tx_noack++; + try0 = ATH_TXMAXTRY; /* turn off multi-rate retry for multicast traffic */ + } else if (pktlen > vap->iv_rtsthreshold) { +#ifdef ATH_SUPERG_FF + /* we could refine to only check that the frame of interest + * is a FF, but this seems inconsistent. + */ + if (!(vap->iv_ath_cap & ni->ni_ath_flags & IEEE80211_ATHC_FF)) { +#endif + flags |= HAL_TXDESC_RTSENA; /* RTS based on frame length */ + cix = rt->info[rix].controlRate; + sc->sc_stats.ast_tx_rts++; +#ifdef ATH_SUPERG_FF + } +#endif + } + + /* + * If 802.11g protection is enabled, determine whether + * to use RTS/CTS or just CTS. Note that this is only + * done for OFDM unicast frames. + */ + if ((ic->ic_flags & IEEE80211_F_USEPROT) && + rt->info[rix].phy == IEEE80211_T_OFDM && + (flags & HAL_TXDESC_NOACK) == 0) { + /* XXX fragments must use CCK rates w/ protection */ + if (ic->ic_protmode == IEEE80211_PROT_RTSCTS) + flags |= HAL_TXDESC_RTSENA; + else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) + flags |= HAL_TXDESC_CTSENA; + + if (istxfrag) + /* + ** if Tx fragment, it would be desirable to + ** use highest CCK rate for RTS/CTS. + ** However, stations farther away may detect it + ** at a lower CCK rate. Therefore, use the + ** configured protect rate, which is 2 Mbps + ** for 11G. + */ + cix = rt->info[sc->sc_protrix].controlRate; + else + cix = rt->info[sc->sc_protrix].controlRate; + sc->sc_stats.ast_tx_protect++; + } + + /* + * Calculate duration. This logically belongs in the 802.11 + * layer but it lacks sufficient information to calculate it. + */ + if ((flags & HAL_TXDESC_NOACK) == 0 && + (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_CTL) { + u_int16_t dur; + /* + * XXX not right with fragmentation. + */ + if (shortPreamble) + dur = rt->info[rix].spAckDuration; + else + dur = rt->info[rix].lpAckDuration; + + if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) { + dur += dur; /* Add additional 'SIFS + ACK' */ + + /* + ** Compute size of next fragment in order to compute + ** durations needed to update NAV. + ** The last fragment uses the ACK duration only. + ** Add time for next fragment. + */ + dur += ath_hal_computetxtime(ah, rt, nextfraglen, + rix, shortPreamble); + } + + if (istxfrag) { + /* + ** Force hardware to use computed duration for next + ** fragment by disabling multi-rate retry, which + ** updates duration based on the multi-rate + ** duration table. + */ + try0 = ATH_TXMAXTRY; + } + + wh->i_dur = cpu_to_le16(dur); + } + + /* + * Calculate RTS/CTS rate and duration if needed. + */ + ctsduration = 0; + if (flags & (HAL_TXDESC_RTSENA|HAL_TXDESC_CTSENA)) { + /* + * CTS transmit rate is derived from the transmit rate + * by looking in the h/w rate table. We must also factor + * in whether or not a short preamble is to be used. + */ + /* NB: cix is set above where RTS/CTS is enabled */ + KASSERT(cix != 0xff, ("cix not setup")); + ctsrate = rt->info[cix].rateCode; + /* + * Compute the transmit duration based on the frame + * size and the size of an ACK frame. We call into the + * HAL to do the computation since it depends on the + * characteristics of the actual PHY being used. + * + * NB: CTS is assumed the same size as an ACK so we can + * use the precalculated ACK durations. + */ + if (shortPreamble) { + ctsrate |= rt->info[cix].shortPreamble; + if (flags & HAL_TXDESC_RTSENA) /* SIFS + CTS */ + ctsduration += rt->info[cix].spAckDuration; + ctsduration += ath_hal_computetxtime(ah, + rt, pktlen, rix, AH_TRUE); + if ((flags & HAL_TXDESC_NOACK) == 0) /* SIFS + ACK */ + ctsduration += rt->info[rix].spAckDuration; + } else { + if (flags & HAL_TXDESC_RTSENA) /* SIFS + CTS */ + ctsduration += rt->info[cix].lpAckDuration; + ctsduration += ath_hal_computetxtime(ah, + rt, pktlen, rix, AH_FALSE); + if ((flags & HAL_TXDESC_NOACK) == 0) /* SIFS + ACK */ + ctsduration += rt->info[rix].lpAckDuration; + } + /* + * Must disable multi-rate retry when using RTS/CTS. + */ + try0 = ATH_TXMAXTRY; + } else + ctsrate = 0; + + if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) + /* FFXXX: need multi-skb version to dump entire FF */ + ieee80211_dump_pkt(ic, skb->data, skb->len, + sc->sc_hwmap[txrate].ieeerate, -1); + + /* + * Determine if a tx interrupt should be generated for + * this descriptor. We take a tx interrupt to reap + * descriptors when the h/w hits an EOL condition or + * when the descriptor is specifically marked to generate + * an interrupt. We periodically mark descriptors in this + * way to ensure timely replenishing of the supply needed + * for sending frames. Deferring interrupts reduces system + * load and potentially allows more concurrent work to be + * done, but if done too aggressively, it can cause senders + * to backup. + * + * NB: use >= to deal with sc_txintrperiod changing + * dynamically through sysctl. + */ + if (!M_FLAG_GET(skb, M_UAPSD) && + ++txq->axq_intrcnt >= sc->sc_txintrperiod) { + flags |= HAL_TXDESC_INTREQ; + txq->axq_intrcnt = 0; + } + +#ifdef ATH_SUPERG_COMP + if (ATH_NODE(ni)->an_decomp_index != INVALID_DECOMP_INDEX && + !ismcast && + ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) && + ((wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) != IEEE80211_FC0_SUBTYPE_NODATA)) { + if (pktlen > ATH_COMP_THRESHOLD) + comp = ATH_COMP_PROC_COMP_OPTIMAL; + else + comp = ATH_COMP_PROC_NO_COMP_ADD_CCS; + } +#endif + + /* + * sc_txantenna == 0 means transmit diversity mode. + * sc_txantenna == 1 or sc_txantenna == 2 means the user has selected + * the first or second antenna port. + * If the user has set the txantenna, use it for multicast frames too. + */ + if (ismcast && !sc->sc_txantenna) { + antenna = sc->sc_mcastantenna + 1; + sc->sc_mcastantenna = (sc->sc_mcastantenna + 1) & 0x1; + } else + antenna = sc->sc_txantenna; + + if (txrate == 0) { + /* Drop frame, if the rate is 0. + * Otherwise this may lead to the continuous transmission of + * noise. */ + printk("%s: invalid TX rate %u (%s: %u)\n", dev->name, + txrate, __func__, __LINE__); + return -EIO; + } + + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: set up txdesc: pktlen %d hdrlen %d " + "atype %d txpower %d txrate %d try0 %d keyix %d ant %d flags %x " + "ctsrate %d ctsdur %d icvlen %d ivlen %d comp %d\n", + __func__, pktlen, hdrlen, atype, MIN(ni->ni_txpower, 60), txrate, + try0, keyix, antenna, flags, ctsrate, ctsduration, icvlen, ivlen, + comp); + + /* + * Formulate first tx descriptor with tx controls. + */ + /* XXX check return value? */ + ath_hal_setuptxdesc(ah, ds + , pktlen /* packet length */ + , hdrlen /* header length */ + , atype /* Atheros packet type */ + , MIN(ni->ni_txpower, 60)/* txpower */ + , txrate, try0 /* series 0 rate/tries */ + , keyix /* key cache index */ + , antenna /* antenna mode */ + , flags /* flags */ + , ctsrate /* rts/cts rate */ + , ctsduration /* rts/cts duration */ + , icvlen /* comp icv len */ + , ivlen /* comp iv len */ + , comp /* comp scheme */ + ); + bf->bf_flags = flags; /* record for post-processing */ + + /* + * Setup the multi-rate retry state only when we're + * going to use it. This assumes ath_hal_setuptxdesc + * initializes the descriptors (so we don't have to) + * when the hardware supports multi-rate retry and + * we don't use it. + */ + if (try0 != ATH_TXMAXTRY) + sc->sc_rc->ops->setupxtxdesc(sc, an, ds, shortPreamble, + skb->len, rix); + +#ifndef ATH_SUPERG_FF + ds->ds_link = 0; + ds->ds_data = bf->bf_skbaddr; + + ath_hal_filltxdesc(ah, ds + , skb->len /* segment length */ + , AH_TRUE /* first segment */ + , AH_TRUE /* last segment */ + , ds /* first descriptor */ + ); + + /* NB: The desc swap function becomes void, + * if descriptor swapping is not enabled + */ + ath_desc_swap(ds); + + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: Q%d: %08x %08x %08x %08x %08x %08x\n", + __func__, M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, ds->ds_link, ds->ds_data, + ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); +#else /* ATH_SUPERG_FF */ + { + struct sk_buff *skbtmp = skb; + struct ath_desc *ds0 = ds; + int i; + + ds->ds_data = bf->bf_skbaddr; + ds->ds_link = (skb->next == NULL) ? 0 : bf->bf_daddr + sizeof(*ds); + + ath_hal_filltxdesc(ah, ds + , skbtmp->len /* segment length */ + , AH_TRUE /* first segment */ + , skbtmp->next == NULL /* last segment */ + , ds /* first descriptor */ + ); + + /* NB: The desc swap function becomes void, + * if descriptor swapping is not enabled + */ + ath_desc_swap(ds); + + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: Q%d: (ds)%p (lk)%08x (d)%08x (c0)%08x (c1)%08x %08x %08x\n", + __func__, M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, + ds, ds->ds_link, ds->ds_data, ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1]); + for (i= 0, skbtmp = skbtmp->next; i < bf->bf_numdesc - 1; i++, skbtmp = skbtmp->next) { + ds++; + ds->ds_link = skbtmp->next == NULL ? 0 : bf->bf_daddr + sizeof(*ds) * (i + 2); + ds->ds_data = bf->bf_skbaddrff[i]; + ath_hal_filltxdesc(ah, ds + , skbtmp->len /* segment length */ + , AH_FALSE /* first segment */ + , skbtmp->next == NULL /* last segment */ + , ds0 /* first descriptor */ + ); + + /* NB: The desc swap function becomes void, + * if descriptor swapping is not enabled + */ + ath_desc_swap(ds); + + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: Q%d: %08x %08x %08x %08x %08x %08x\n", + __func__, M_FLAG_GET(skb, M_UAPSD) ? 0 : txq->axq_qnum, + ds->ds_link, ds->ds_data, ds->ds_ctl0, + ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); + } + } +#endif + + if (M_FLAG_GET(skb, M_UAPSD)) { + /* must lock against interrupt-time processing (i.e., not just tasklet) */ + ATH_NODE_UAPSD_LOCK_IRQ(an); + DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: Qing U-APSD data frame for node %s \n", + __func__, ether_sprintf(an->an_node.ni_macaddr)); + ath_tx_uapsdqueue(sc, an, bf); + if (IEEE80211_NODE_UAPSD_USETIM(ni) && (an->an_uapsd_qdepth == 1)) + vap->iv_set_tim(ni, 1); + ATH_NODE_UAPSD_UNLOCK_IRQ(an); + + return 0; + } + + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, "%s: %p<%s> refcnt %d\n", + __func__, vap->iv_bss, ether_sprintf(vap->iv_bss->ni_macaddr), + ieee80211_node_refcnt(vap->iv_bss)); + + + ath_tx_txqaddbuf(sc, ni, txq, bf, ds, pktlen); + return 0; +#undef MIN +} + +/* + * Process completed xmit descriptors from the specified queue. + * Should only be called from tasklet context + */ +static void +ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf = NULL; + struct ath_desc *ds = NULL; + struct ieee80211_node *ni = NULL; + struct ath_node *an = NULL; + int sr, lr; + HAL_STATUS status; + int uapsdq = 0; + unsigned long uapsdq_lockflags = 0; + + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: tx queue %d (0x%x), link %p\n", __func__, + txq->axq_qnum, ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum), + txq->axq_link); + + if (txq == sc->sc_uapsdq) { + DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: reaping U-APSD txq\n", __func__); + uapsdq = 1; + } + + for (;;) { + if (uapsdq) + ATH_TXQ_UAPSDQ_LOCK_IRQ(txq); + else + ATH_TXQ_LOCK(txq); + txq->axq_intrcnt = 0; /* reset periodic desc intr count */ + bf = STAILQ_FIRST(&txq->axq_q); + if (bf == NULL) { + txq->axq_link = NULL; + if (uapsdq) + ATH_TXQ_UAPSDQ_UNLOCK_IRQ(txq); + else + ATH_TXQ_UNLOCK(txq); + break; + } + +#ifdef ATH_SUPERG_FF + ds = &bf->bf_desc[bf->bf_numdesc - 1]; + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: frame's last desc: %p\n", + __func__, ds); +#else + ds = bf->bf_desc; /* NB: last descriptor */ +#endif + status = ath_hal_txprocdesc(ah, ds); +#ifdef AR_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(bf, status == HAL_OK); +#endif + if (status == HAL_EINPROGRESS) { + if (uapsdq) + ATH_TXQ_UAPSDQ_UNLOCK_IRQ(txq); + else + ATH_TXQ_UNLOCK(txq); + break; + } + + ATH_TXQ_REMOVE_HEAD(txq, bf_list); + if (uapsdq) + ATH_TXQ_UAPSDQ_UNLOCK_IRQ(txq); + else + ATH_TXQ_UNLOCK(txq); + + ni = bf->bf_node; + if (ni != NULL) { + an = ATH_NODE(ni); + if (ds->ds_txstat.ts_status == 0) { + u_int8_t txant = ds->ds_txstat.ts_antenna; + sc->sc_stats.ast_ant_tx[txant]++; + sc->sc_ant_tx[txant]++; +#ifdef ATH_SUPERG_FF + if (bf->bf_numdesc > 1) + ni->ni_vap->iv_stats.is_tx_ffokcnt++; +#endif + if (ds->ds_txstat.ts_rate & HAL_TXSTAT_ALTRATE) + sc->sc_stats.ast_tx_altrate++; + sc->sc_stats.ast_tx_rssi = + ds->ds_txstat.ts_rssi; + ATH_RSSI_LPF(an->an_halstats.ns_avgtxrssi, + ds->ds_txstat.ts_rssi); + if (bf->bf_skb->priority == WME_AC_VO || + bf->bf_skb->priority == WME_AC_VI) + ni->ni_ic->ic_wme.wme_hipri_traffic++; + ni->ni_inact = ni->ni_inact_reload; + } else { +#ifdef ATH_SUPERG_FF + if (bf->bf_numdesc > 1) + ni->ni_vap->iv_stats.is_tx_fferrcnt++; +#endif + if (ds->ds_txstat.ts_status & HAL_TXERR_XRETRY) { + sc->sc_stats.ast_tx_xretries++; + if (ni->ni_flags & IEEE80211_NODE_UAPSD_TRIG) { + ni->ni_stats.ns_tx_eosplost++; + DPRINTF(sc, ATH_DEBUG_UAPSD, + "%s: frame in SP retried out, possible EOSP stranded!!!\n", + __func__); + } + } + if (ds->ds_txstat.ts_status & HAL_TXERR_FIFO) + sc->sc_stats.ast_tx_fifoerr++; + if (ds->ds_txstat.ts_status & HAL_TXERR_FILT) + sc->sc_stats.ast_tx_filtered++; + } + sr = ds->ds_txstat.ts_shortretry; + lr = ds->ds_txstat.ts_longretry; + sc->sc_stats.ast_tx_shortretry += sr; + sc->sc_stats.ast_tx_longretry += lr; + /* + * Hand the descriptor to the rate control algorithm + * if the frame wasn't dropped for filtering or sent + * w/o waiting for an ack. In those cases the rssi + * and retry counts will be meaningless. + */ + if ((ds->ds_txstat.ts_status & HAL_TXERR_FILT) == 0 && + (bf->bf_flags & HAL_TXDESC_NOACK) == 0) + sc->sc_rc->ops->tx_complete(sc, an, ds); + /* + * Reclaim reference to node. + * + * NB: the node may be reclaimed here if, for example + * this is a DEAUTH message that was sent and the + * node was timed out due to inactivity. + */ + ieee80211_free_node(ni); + } + + bus_unmap_single(sc->sc_bdev, bf->bf_skbaddr, + bf->bf_skb->len, BUS_DMA_TODEVICE); + if (ni && uapsdq) { + /* detect EOSP for this node */ + struct ieee80211_qosframe *qwh = (struct ieee80211_qosframe *)bf->bf_skb->data; + an = ATH_NODE(ni); + KASSERT(ni != NULL, ("Processing U-APSD txq for ath_buf with no node!\n")); + if (qwh->i_qos[0] & IEEE80211_QOS_EOSP) { + DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: EOSP detected for node (%s) on desc %p\n", + __func__, ether_sprintf(ni->ni_macaddr), ds); + ATH_NODE_UAPSD_LOCK_IRQ(an); + ni->ni_flags &= ~IEEE80211_NODE_UAPSD_SP; + if (an->an_uapsd_qdepth == 0 && an->an_uapsd_overflowqdepth != 0) { + STAILQ_CONCAT(&an->an_uapsd_q, &an->an_uapsd_overflowq); + an->an_uapsd_qdepth = an->an_uapsd_overflowqdepth; + an->an_uapsd_overflowqdepth = 0; + } + ATH_NODE_UAPSD_UNLOCK_IRQ(an); + } + } + + { + struct ieee80211_frame *wh = (struct ieee80211_frame *)bf->bf_skb->data; + if ((ds->ds_txstat.ts_seqnum << IEEE80211_SEQ_SEQ_SHIFT) & ~IEEE80211_SEQ_SEQ_MASK) { + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: h/w assigned sequence number is not sane (%d), ignoring it\n", __func__, + ds->ds_txstat.ts_seqnum); + } else { + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: updating frame's sequence number from %d to %d\n", __func__, + (le16toh(*(__le16 *)&wh->i_seq[0]) & IEEE80211_SEQ_SEQ_MASK) >> IEEE80211_SEQ_SEQ_SHIFT, + ds->ds_txstat.ts_seqnum); + + *(__le16 *)&wh->i_seq[0] = htole16( + ds->ds_txstat.ts_seqnum << IEEE80211_SEQ_SEQ_SHIFT | + (le16toh(*(__le16 *)&wh->i_seq[0]) & ~IEEE80211_SEQ_SEQ_MASK)); + } + } + +#ifdef ATH_SUPERG_FF + { + struct sk_buff *skbfree, *skb = bf->bf_skb; + int i; + + skbfree = skb; + skb = skb->next; + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: free skb %p\n", + __func__, skbfree); + ath_tx_capture(sc->sc_dev, ds, skbfree); + for (i = 1; i < bf->bf_numdesc; i++) { + bus_unmap_single(sc->sc_bdev, bf->bf_skbaddrff[i-1], + bf->bf_skb->len, BUS_DMA_TODEVICE); + skbfree = skb; + skb = skb->next; + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: free skb %p\n", + __func__, skbfree); + ath_tx_capture(sc->sc_dev, ds, skbfree); + } + } + bf->bf_numdesc = 0; +#else + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: free skb %p\n", __func__, bf->bf_skb); + ath_tx_capture(sc->sc_dev, ds, bf->bf_skb); +#endif + bf->bf_skb = NULL; + bf->bf_node = NULL; + + ATH_TXBUF_LOCK_IRQ(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + if (sc->sc_devstopped) { + ++sc->sc_reapcount; + if (sc->sc_reapcount > ATH_TXBUF_FREE_THRESHOLD) { + if (!sc->sc_dfswait) + netif_start_queue(sc->sc_dev); + DPRINTF(sc, ATH_DEBUG_TX_PROC, + "%s: tx tasklet restart the queue\n", + __func__); + sc->sc_reapcount = 0; + sc->sc_devstopped = 0; + } else + ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, NULL); + } + ATH_TXBUF_UNLOCK_IRQ(sc); + } +#ifdef ATH_SUPERG_FF + /* flush ff staging queue if buffer low */ + if (txq->axq_depth <= sc->sc_fftxqmin - 1) { + /* NB: consider only flushing a preset number based on age. */ + ath_ffstageq_flush(sc, txq, ath_ff_neverflushtestdone); + } +#endif /* ATH_SUPERG_FF */ +} + +static __inline int +txqactive(struct ath_hal *ah, int qnum) +{ + u_int32_t txqs = 1 << qnum; + ath_hal_gettxintrtxqs(ah, &txqs); + return (txqs & (1 << qnum)); +} + +/* + * Deferred processing of transmit interrupt; special-cased + * for a single hardware transmit queue (e.g. 5210 and 5211). + */ +static void +ath_tx_tasklet_q0(TQUEUE_ARG data) +{ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + + if (txqactive(sc->sc_ah, 0)) + ath_tx_processq(sc, &sc->sc_txq[0]); + if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum)) + ath_tx_processq(sc, sc->sc_cabq); + + netif_wake_queue(dev); + + if (sc->sc_softled) + ath_led_event(sc, ATH_LED_TX); +} + +/* + * Deferred processing of transmit interrupt; special-cased + * for four hardware queues, 0-3 (e.g. 5212 w/ WME support). + */ +static void +ath_tx_tasklet_q0123(TQUEUE_ARG data) +{ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + + /* + * Process each active queue. + */ + if (txqactive(sc->sc_ah, 0)) + ath_tx_processq(sc, &sc->sc_txq[0]); + if (txqactive(sc->sc_ah, 1)) + ath_tx_processq(sc, &sc->sc_txq[1]); + if (txqactive(sc->sc_ah, 2)) + ath_tx_processq(sc, &sc->sc_txq[2]); + if (txqactive(sc->sc_ah, 3)) + ath_tx_processq(sc, &sc->sc_txq[3]); + if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum)) + ath_tx_processq(sc, sc->sc_cabq); +#ifdef ATH_SUPERG_XR + if (sc->sc_xrtxq && txqactive(sc->sc_ah, sc->sc_xrtxq->axq_qnum)) + ath_tx_processq(sc, sc->sc_xrtxq); +#endif + if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum)) + ath_tx_processq(sc, sc->sc_uapsdq); + + netif_wake_queue(dev); + + if (sc->sc_softled) + ath_led_event(sc, ATH_LED_TX); +} + +/* + * Deferred processing of transmit interrupt. + */ +static void +ath_tx_tasklet(TQUEUE_ARG data) +{ + struct net_device *dev = (struct net_device *)data; + struct ath_softc *sc = dev->priv; + int i; + + /* + * Process each active queue. + */ + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) + if (ATH_TXQ_SETUP(sc, i) && txqactive(sc->sc_ah, i)) + ath_tx_processq(sc, &sc->sc_txq[i]); +#ifdef ATH_SUPERG_XR + if (sc->sc_xrtxq && txqactive(sc->sc_ah, sc->sc_xrtxq->axq_qnum)) + ath_tx_processq(sc, sc->sc_xrtxq); +#endif + + netif_wake_queue(dev); + + if (sc->sc_softled) + ath_led_event(sc, ATH_LED_TX); +} + +static void +ath_tx_timeout(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + + DPRINTF(sc, ATH_DEBUG_WATCHDOG, "%s: %sRUNNING %svalid\n", + __func__, (dev->flags & IFF_RUNNING) ? "" : "!", + sc->sc_invalid ? "in" : ""); + + if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { + sc->sc_stats.ast_watchdog++; + ath_reset(dev); /* Avoid taking a semaphore in ath_init */ + } +} + +/* + * Context: softIRQ and hwIRQ + */ +static void +ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + struct sk_buff *skb; +#ifdef ATH_SUPERG_FF + struct sk_buff *tskb; +#endif + int i; + + /* + * NB: this assumes output has been stopped and + * we do not need to block ath_tx_tasklet + */ + for (;;) { + ATH_TXQ_LOCK(txq); + bf = STAILQ_FIRST(&txq->axq_q); + if (bf == NULL) { + txq->axq_link = NULL; + ATH_TXQ_UNLOCK(txq); + break; + } + ATH_TXQ_REMOVE_HEAD(txq, bf_list); + ATH_TXQ_UNLOCK(txq); +#ifdef AR_DEBUG + if (sc->sc_debug & ATH_DEBUG_RESET) + ath_printtxbuf(bf, ath_hal_txprocdesc(ah, bf->bf_desc) == HAL_OK); +#endif /* AR_DEBUG */ + skb = bf->bf_skb->next; + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); + dev_kfree_skb_any(bf->bf_skb); + i = 0; +#ifdef ATH_SUPERG_FF + while (skb) { + tskb = skb->next; + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddrff[i++], skb->len, BUS_DMA_TODEVICE); + dev_kfree_skb_any(skb); + skb = tskb; + } +#endif /* ATH_SUPERG_FF */ + if (bf->bf_node) + ieee80211_free_node(bf->bf_node); + + bf->bf_skb = NULL; + bf->bf_node = NULL; + + ATH_TXBUF_LOCK(sc); + STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + ATH_TXBUF_UNLOCK(sc); + } +} + +static void +ath_tx_stopdma(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_hal *ah = sc->sc_ah; + + (void) ath_hal_stoptxdma(ah, txq->axq_qnum); + DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] 0x%x, link %p\n", + __func__, txq->axq_qnum, + ath_hal_gettxbuf(ah, txq->axq_qnum), txq->axq_link); +} + +/* + * Drain the transmit queues and reclaim resources. + */ +static void +ath_draintxq(struct ath_softc *sc) +{ + struct ath_hal *ah = sc->sc_ah; + int i; + + /* XXX return value */ + if (!sc->sc_invalid) { + (void) ath_hal_stoptxdma(ah, sc->sc_bhalq); + DPRINTF(sc, ATH_DEBUG_RESET, "%s: beacon queue 0x%x\n", + __func__, ath_hal_gettxbuf(ah, sc->sc_bhalq)); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_stopdma(sc, &sc->sc_txq[i]); + } + sc->sc_dev->trans_start = jiffies; + netif_start_queue(sc->sc_dev); /* XXX move to callers */ + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_draintxq(sc, &sc->sc_txq[i]); +} + +/* + * Disable the receive h/w in preparation for a reset. + */ +static void +ath_stoprecv(struct ath_softc *sc) +{ +#define PA2DESC(_sc, _pa) \ + ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ + ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) + struct ath_hal *ah = sc->sc_ah; + u_int64_t tsf; + + ath_hal_stoppcurecv(ah); /* disable PCU */ + ath_hal_setrxfilter(ah, 0); /* clear recv filter */ + ath_hal_stopdmarecv(ah); /* disable DMA engine */ + mdelay(3); /* 3 ms is long enough for 1 frame */ + tsf = ath_hal_gettsf64(ah); +#ifdef AR_DEBUG + if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) { + struct ath_buf *bf; + + printk("ath_stoprecv: rx queue 0x%x, link %p\n", + ath_hal_getrxbuf(ah), sc->sc_rxlink); + STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { + struct ath_desc *ds = bf->bf_desc; + HAL_STATUS status = ath_hal_rxprocdesc(ah, ds, + bf->bf_daddr, PA2DESC(sc, ds->ds_link), tsf); + if (status == HAL_OK || (sc->sc_debug & ATH_DEBUG_FATAL)) + ath_printrxbuf(bf, status == HAL_OK); + } + } +#endif + sc->sc_rxlink = NULL; /* just in case */ +#undef PA2DESC +} + +/* + * Enable the receive h/w following a reset. + */ +static int +ath_startrecv(struct ath_softc *sc) +{ + struct ath_hal *ah = sc->sc_ah; + struct net_device *dev = sc->sc_dev; + struct ath_buf *bf; + + /* + * Cisco's VPN software requires that drivers be able to + * receive encapsulated frames that are larger than the MTU. + * Since we can't be sure how large a frame we'll get, setup + * to handle the larges on possible. + */ +#ifdef ATH_SUPERG_FF + sc->sc_rxbufsize = roundup(ATH_FF_MAX_LEN, sc->sc_cachelsz); +#else + sc->sc_rxbufsize = roundup(IEEE80211_MAX_LEN, sc->sc_cachelsz); +#endif + DPRINTF(sc,ATH_DEBUG_RESET, "%s: mtu %u cachelsz %u rxbufsize %u\n", + __func__, dev->mtu, sc->sc_cachelsz, sc->sc_rxbufsize); + + sc->sc_rxlink = NULL; + STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { + int error = ath_rxbuf_init(sc, bf); + ATH_RXBUF_RESET(bf); + if (error < 0) + return error; + } + + sc->sc_rxbufcur = NULL; + + bf = STAILQ_FIRST(&sc->sc_rxbuf); + ath_hal_putrxbuf(ah, bf->bf_daddr); + ath_hal_rxena(ah); /* enable recv descriptors */ + ath_mode_init(dev); /* set filters, etc. */ + ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ + return 0; +} + +/* + * Flush skb's allocate for receive. + */ +static void +ath_flushrecv(struct ath_softc *sc) +{ + struct ath_buf *bf; + + STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) + if (bf->bf_skb != NULL) { + bus_unmap_single(sc->sc_bdev, + bf->bf_skbaddr, sc->sc_rxbufsize, + BUS_DMA_FROMDEVICE); + dev_kfree_skb(bf->bf_skb); + bf->bf_skb = NULL; + } +} + +/* + * Update internal state after a channel change. + */ +static void +ath_chan_change(struct ath_softc *sc, struct ieee80211_channel *chan) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct net_device *dev = sc->sc_dev; + enum ieee80211_phymode mode; + + mode = ieee80211_chan2mode(chan); + + ath_rate_setup(dev, mode); + ath_setcurmode(sc, mode); + +#ifdef notyet + /* + * Update BPF state. + */ + sc->sc_tx_th.wt_chan_freq = sc->sc_rx_th.wr_chan_freq = + htole16(chan->ic_freq); + sc->sc_tx_th.wt_chan_flags = sc->sc_rx_th.wr_chan_flags = + htole16(chan->ic_flags); +#endif + if (ic->ic_curchanmaxpwr == 0) + ic->ic_curchanmaxpwr = chan->ic_maxregpower; +} + +/* + * Set/change channels. If the channel is really being changed, + * it's done by resetting the chip. To accomplish this we must + * first cleanup any pending DMA, then restart stuff after a la + * ath_init. + */ +static int +ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) +{ + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + struct net_device *dev = sc->sc_dev; + HAL_CHANNEL hchan; + u_int8_t tswitch = 0; + + /* + * Convert to a HAL channel description with + * the flags constrained to reflect the current + * operating mode. + */ + hchan.channel = chan->ic_freq; + hchan.channelFlags = ath_chan2flags(chan); + KASSERT(hchan.channel != 0, + ("bogus channel %u/0x%x", hchan.channel, hchan.channelFlags)); + + DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz) -> %u (%u MHz)\n", + __func__, ath_hal_mhz2ieee(ah, sc->sc_curchan.channel, + sc->sc_curchan.channelFlags), sc->sc_curchan.channel, + ath_hal_mhz2ieee(ah, hchan.channel, hchan.channelFlags), + hchan.channel); + /* check if it is turbo mode switch */ + if (hchan.channel == sc->sc_curchan.channel && + (hchan.channelFlags & IEEE80211_CHAN_TURBO) != (sc->sc_curchan.channelFlags & IEEE80211_CHAN_TURBO)) + tswitch = 1; + if (hchan.channel != sc->sc_curchan.channel || + hchan.channelFlags != sc->sc_curchan.channelFlags) { + HAL_STATUS status; + + /* + * To switch channels clear any pending DMA operations; + * wait long enough for the RX fifo to drain, reset the + * hardware at the new frequency, and then re-enable + * the relevant bits of the h/w. + */ + ath_hal_intrset(ah, 0); /* disable interrupts */ + ath_draintxq(sc); /* clear pending tx frames */ + ath_stoprecv(sc); /* turn off frame recv */ + + /* Set coverage class */ + if (sc->sc_scanning || !IEEE80211_IS_CHAN_A(chan)) + ath_hal_setcoverageclass(sc->sc_ah, 0, 0); + else + ath_hal_setcoverageclass(sc->sc_ah, ic->ic_coverageclass, 0); + + if (!ath_hal_reset(ah, sc->sc_opmode, &hchan, AH_TRUE, &status)) { + printk("%s: %s: unable to reset channel %u (%u MHz) " + "flags 0x%x '%s' (HAL status %u)\n", + dev->name, __func__, + ieee80211_chan2ieee(ic, chan), chan->ic_freq, + hchan.channelFlags, + ath_get_hal_status_desc(status), status); + return -EIO; + } + + if (sc->sc_softled) + ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + + /* Turn off Interference Mitigation in non-STA modes */ + if ((sc->sc_opmode != HAL_M_STA) && sc->sc_hasintmit && !sc->sc_useintmit) { + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: disabling interference mitigation (ANI)\n", __func__); + ath_hal_setintmit(ah, 0); + } + sc->sc_curchan = hchan; + ath_update_txpow(sc); /* update tx power state */ + + /* + * Re-enable rx framework. + */ + if (ath_startrecv(sc) != 0) { + printk("%s: %s: unable to restart recv logic\n", + dev->name, __func__); + return -EIO; + } + + /* + * Change channels and update the h/w rate map + * if we're switching; e.g. 11a to 11b/g. + */ + ath_chan_change(sc, chan); + if (ic->ic_opmode == IEEE80211_M_HOSTAP) { + if (sc->sc_curchan.privFlags & CHANNEL_DFS) { + if (!(sc->sc_curchan.privFlags & CHANNEL_DFS_CLEAR)) { + dev->watchdog_timeo = 120 * HZ; /* set the timeout to normal */ + netif_stop_queue(dev); + if (sc->sc_dfswait) + del_timer_sync(&sc->sc_dfswaittimer); + DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s: start dfs wait period\n", + __func__, dev->name); + sc->sc_dfswait = 1; + sc->sc_dfswaittimer.function = ath_check_dfs_clear; + sc->sc_dfswaittimer.expires = + jiffies + (ATH_DFS_WAIT_POLL_PERIOD * HZ); + sc->sc_dfswaittimer.data = (unsigned long)sc; + add_timer(&sc->sc_dfswaittimer); + } + } else + if (sc->sc_dfswait == 1) + mod_timer(&sc->sc_dfswaittimer, jiffies + 2); + } + /* + * re configure beacons when it is a turbo mode switch. + * HW seems to turn off beacons during turbo mode switch. + */ + if (sc->sc_beacons && tswitch) + ath_beacon_config(sc, NULL); + + /* + * Re-enable interrupts. + */ + ath_hal_intrset(ah, sc->sc_imask); + } + return 0; +} + +/* + * Periodically recalibrate the PHY to account + * for temperature/environment changes. + */ +static void +ath_calibrate(unsigned long arg) +{ + struct net_device *dev = (struct net_device *) arg; + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + HAL_CHANNEL *chans; + u_int32_t nchans; + HAL_BOOL isIQdone = AH_FALSE; + + sc->sc_stats.ast_per_cal++; + + DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: channel %u/%x\n", + __func__, sc->sc_curchan.channel, sc->sc_curchan.channelFlags); + + if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) { + /* + * Rfgain is out of bounds, reset the chip + * to load new gain values. + */ + sc->sc_stats.ast_per_rfgain++; + ath_reset(dev); + } + if (!ath_hal_calibrate(ah, &sc->sc_curchan, &isIQdone)) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: calibration of channel %u failed\n", + __func__, sc->sc_curchan.channel); + sc->sc_stats.ast_per_calfail++; + } + if (ic->ic_opmode == IEEE80211_M_HOSTAP) { + chans = kmalloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL), GFP_ATOMIC); + if (chans == NULL) { + printk("%s: unable to allocate channel table\n", dev->name); + return; + } + nchans = ath_hal_checknol(ah, chans, IEEE80211_CHAN_MAX); + if (nchans > 0) { + u_int32_t i, j; + struct ieee80211_channel *ichan; + + for (i = 0; i < nchans; i++) { + for (j = 0; j < ic->ic_nchans; j++) { + ichan = &ic->ic_channels[j]; + if (chans[i].channel == ichan->ic_freq) + ichan->ic_flags &= ~IEEE80211_CHAN_RADAR; + } + + ichan = ieee80211_find_channel(ic, chans[i].channel, + chans[i].channelFlags); + if (ichan != NULL) + ichan->ic_flags &= ~IEEE80211_CHAN_RADAR; + } + } + kfree(chans); + } + + if (isIQdone == AH_TRUE) + ath_calinterval = ATH_LONG_CALINTERVAL; + else + ath_calinterval = ATH_SHORT_CALINTERVAL; + + sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ); + add_timer(&sc->sc_cal_ch); +} + +static void +ath_scan_start(struct ieee80211com *ic) +{ + struct net_device *dev = ic->ic_dev; + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + u_int32_t rfilt; + + /* XXX calibration timer? */ + + sc->sc_scanning = 1; + sc->sc_syncbeacon = 0; + rfilt = ath_calcrxfilter(sc); + ath_hal_setrxfilter(ah, rfilt); + ath_hal_setassocid(ah, dev->broadcast, 0); + + DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid %s aid 0\n", + __func__, rfilt, ether_sprintf(dev->broadcast)); +} + +static void +ath_scan_end(struct ieee80211com *ic) +{ + struct net_device *dev = ic->ic_dev; + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + u_int32_t rfilt; + + sc->sc_scanning = 0; + rfilt = ath_calcrxfilter(sc); + ath_hal_setrxfilter(ah, rfilt); + ath_hal_setassocid(ah, sc->sc_curbssid, sc->sc_curaid); + + DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid %s aid 0x%x\n", + __func__, rfilt, ether_sprintf(sc->sc_curbssid), + sc->sc_curaid); +} + +static void +ath_set_channel(struct ieee80211com *ic) +{ + struct net_device *dev = ic->ic_dev; + struct ath_softc *sc = dev->priv; + + (void) ath_chan_set(sc, ic->ic_curchan); + /* + * If we are returning to our bss channel then mark state + * so the next recv'd beacon's tsf will be used to sync the + * beacon timers. Note that since we only hear beacons in + * sta/ibss mode this has no effect in other operating modes. + */ + if (!sc->sc_scanning && ic->ic_curchan == ic->ic_bsschan) + sc->sc_syncbeacon = 1; +} + +static void +ath_set_coverageclass(struct ieee80211com *ic) +{ + struct ath_softc *sc = ic->ic_dev->priv; + + ath_hal_setcoverageclass(sc->sc_ah, ic->ic_coverageclass, 0); + + return; +} + +static u_int +ath_mhz2ieee(struct ieee80211com *ic, u_int freq, u_int flags) +{ + struct ath_softc *sc = ic->ic_dev->priv; + + return (ath_hal_mhz2ieee(sc->sc_ah, freq, flags)); +} + + +/* + * Context: softIRQ and process context + */ +static int +ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) +{ + struct ath_vap *avp = ATH_VAP(vap); + struct ieee80211com *ic = vap->iv_ic; + struct net_device *dev = ic->ic_dev; + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_node *ni, *wds_ni; + int i, error, stamode; + u_int32_t rfilt = 0; + struct ieee80211vap *tmpvap; + static const HAL_LED_STATE leds[] = { + HAL_LED_INIT, /* IEEE80211_S_INIT */ + HAL_LED_SCAN, /* IEEE80211_S_SCAN */ + HAL_LED_AUTH, /* IEEE80211_S_AUTH */ + HAL_LED_ASSOC, /* IEEE80211_S_ASSOC */ + HAL_LED_RUN, /* IEEE80211_S_RUN */ + }; + + DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s: %s -> %s\n", __func__, dev->name, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[nstate]); + + del_timer(&sc->sc_cal_ch); /* periodic calibration timer */ + ath_hal_setledstate(ah, leds[nstate]); /* set LED */ + netif_stop_queue(dev); /* before we do anything else */ + + if (nstate == IEEE80211_S_INIT) { + /* + * if there is no VAP left in RUN state + * disable beacon interrupts. + */ + TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { + if (tmpvap != vap && tmpvap->iv_state == IEEE80211_S_RUN ) + break; + } + if (!tmpvap) { + sc->sc_imask &= ~(HAL_INT_SWBA | HAL_INT_BMISS); + /* + * Disable interrupts. + */ + ath_hal_intrset(ah, sc->sc_imask &~ HAL_INT_GLOBAL); + sc->sc_beacons = 0; + } + /* + * Notify the rate control algorithm. + */ + sc->sc_rc->ops->newstate(vap, nstate); + goto done; + } + ni = vap->iv_bss; + + rfilt = ath_calcrxfilter(sc); + stamode = (vap->iv_opmode == IEEE80211_M_STA || + vap->iv_opmode == IEEE80211_M_IBSS || + vap->iv_opmode == IEEE80211_M_AHDEMO); + if (stamode && nstate == IEEE80211_S_RUN) { + sc->sc_curaid = ni->ni_associd; + IEEE80211_ADDR_COPY(sc->sc_curbssid, ni->ni_bssid); + } else + sc->sc_curaid = 0; + + DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid %s aid 0x%x\n", + __func__, rfilt, ether_sprintf(sc->sc_curbssid), + sc->sc_curaid); + + ath_hal_setrxfilter(ah, rfilt); + if (stamode) + ath_hal_setassocid(ah, sc->sc_curbssid, sc->sc_curaid); + + if ((vap->iv_opmode != IEEE80211_M_STA) && + (vap->iv_flags & IEEE80211_F_PRIVACY)) { + for (i = 0; i < IEEE80211_WEP_NKID; i++) + if (ath_hal_keyisvalid(ah, i)) + ath_hal_keysetmac(ah, i, ni->ni_bssid); + } + + /* + * Notify the rate control algorithm so rates + * are setup should ath_beacon_alloc be called. + */ + sc->sc_rc->ops->newstate(vap, nstate); + + if (vap->iv_opmode == IEEE80211_M_MONITOR) { + /* nothing to do */; + } else if (nstate == IEEE80211_S_RUN) { + DPRINTF(sc, ATH_DEBUG_STATE, + "%s(RUN): ic_flags=0x%08x iv=%d bssid=%s " + "capinfo=0x%04x chan=%d\n" + , __func__ + , vap->iv_flags + , ni->ni_intval + , ether_sprintf(ni->ni_bssid) + , ni->ni_capinfo + , ieee80211_chan2ieee(ic, ni->ni_chan)); + + switch (vap->iv_opmode) { + case IEEE80211_M_HOSTAP: + case IEEE80211_M_IBSS: + /* + * Allocate and setup the beacon frame. + * + * Stop any previous beacon DMA. This may be + * necessary, for example, when an ibss merge + * causes reconfiguration; there will be a state + * transition from RUN->RUN that means we may + * be called with beacon transmission active. + */ + ath_hal_stoptxdma(ah, sc->sc_bhalq); + + /* Set default key index for static wep case */ + ni->ni_ath_defkeyindex = IEEE80211_INVAL_DEFKEY; + if (((vap->iv_flags & IEEE80211_F_WPA) == 0) && + (ni->ni_authmode != IEEE80211_AUTH_8021X) && + (vap->iv_def_txkey != IEEE80211_KEYIX_NONE)) { + ni->ni_ath_defkeyindex = vap->iv_def_txkey; + } + + error = ath_beacon_alloc(sc, ni); + if (error < 0) + goto bad; + /* + * if the turbo flags have changed, then beacon and turbo + * need to be reconfigured. + */ + if ((sc->sc_dturbo && !(vap->iv_ath_cap & IEEE80211_ATHC_TURBOP)) || + (!sc->sc_dturbo && (vap->iv_ath_cap & IEEE80211_ATHC_TURBOP))) + sc->sc_beacons = 0; + /* + * if it is the first AP VAP moving to RUN state then beacon + * needs to be reconfigured. + */ + TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { + if (tmpvap != vap && tmpvap->iv_state == IEEE80211_S_RUN && + tmpvap->iv_opmode == IEEE80211_M_HOSTAP) + break; + } + if (!tmpvap) + sc->sc_beacons = 0; + break; + case IEEE80211_M_STA: +#ifdef ATH_SUPERG_COMP + /* have we negotiated compression? */ + if (!(vap->iv_ath_cap & ni->ni_ath_flags & IEEE80211_NODE_COMP)) + ni->ni_ath_flags &= ~IEEE80211_NODE_COMP; +#endif + /* + * Allocate a key cache slot to the station. + */ + ath_setup_keycacheslot(sc, ni); + /* + * Record negotiated dynamic turbo state for + * use by rate control modules. + */ + sc->sc_dturbo = + (ni->ni_ath_flags & IEEE80211_ATHC_TURBOP) != 0; + break; + case IEEE80211_M_WDS: + wds_ni = ieee80211_find_txnode(vap, vap->wds_mac); + if (wds_ni) { + /* XXX no rate negotiation; just dup */ + wds_ni->ni_rates = vap->iv_bss->ni_rates; + /* Depending on the sequence of bringing up devices + * it's possible the rates of the root bss isn't + * filled yet. + */ + if (vap->iv_ic->ic_newassoc != NULL && + wds_ni->ni_rates.rs_nrates != 0) { + /* Fill in the rates based on our own rates + * we rely on the rate selection mechanism + * to find out which rates actually work! + */ + vap->iv_ic->ic_newassoc(wds_ni, 1); + } + } + break; + default: + break; + } + + + /* + * Configure the beacon and sleep timers. + */ + if (!sc->sc_beacons && vap->iv_opmode!=IEEE80211_M_WDS) { + ath_beacon_config(sc, vap); + sc->sc_beacons = 1; + } + + /* + * Reset rssi stats; maybe not the best place... + */ + sc->sc_halstats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; + sc->sc_halstats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER; + sc->sc_halstats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER; + /* + * if it is a DFS channel and has not been checked for radar + * do not let the 80211 state machine to go to RUN state. + * + */ + if (sc->sc_dfswait && vap->iv_opmode == IEEE80211_M_HOSTAP ) { + /* push the VAP to RUN state once DFS is cleared */ + DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s: VAP -> DFS_WAIT\n", + __func__, dev->name); + avp->av_dfswait_run = 1; + return 0; + } + } else { + if (sc->sc_dfswait && + vap->iv_opmode == IEEE80211_M_HOSTAP && + sc->sc_dfswaittimer.data == (unsigned long)vap) { + del_timer_sync(&sc->sc_dfswaittimer); + sc->sc_dfswait = 0; + DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s: VAP out of DFS_WAIT\n", + __func__, dev->name); + } + /* + * XXXX + * if it is SCAN state, disable beacons. + */ + if (nstate == IEEE80211_S_SCAN) { + ath_hal_intrset(ah,sc->sc_imask &~ (HAL_INT_SWBA | HAL_INT_BMISS)); + sc->sc_imask &= ~(HAL_INT_SWBA | HAL_INT_BMISS); + /* need to reconfigure the beacons when it moves to RUN */ + sc->sc_beacons = 0; + } + avp->av_dfswait_run = 0; /* reset the dfs wait flag */ + } +done: + /* + * Invoke the parent method to complete the work. + */ + error = avp->av_newstate(vap, nstate, arg); + + /* + * Finally, start any timers. + */ + if (nstate == IEEE80211_S_RUN) { + /* start periodic recalibration timer */ + mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ)); + } + +#ifdef ATH_SUPERG_XR + if (vap->iv_flags & IEEE80211_F_XR && + nstate == IEEE80211_S_RUN) + ATH_SETUP_XR_VAP(sc,vap,rfilt); + if (vap->iv_flags & IEEE80211_F_XR && + nstate == IEEE80211_S_INIT && sc->sc_xrgrppoll) + ath_grppoll_stop(vap); +#endif +bad: + netif_start_queue(dev); + dev->watchdog_timeo = 5 * HZ; /* set the timeout to normal */ + return error; +} + +/* + * periodically checks for the HAL to set + * CHANNEL_DFS_CLEAR flag on current channel. + * if the flag is set and a VAP is waiting for it, push + * transition the VAP to RUN state. + * + * Context: Timer (softIRQ) + */ +static void +ath_check_dfs_clear(unsigned long data ) +{ + struct ath_softc *sc = (struct ath_softc *)data; + struct ieee80211com *ic = &sc->sc_ic; + struct net_device *dev = sc->sc_dev; + struct ieee80211vap *vap ; + HAL_CHANNEL hchan; + + if(!sc->sc_dfswait) return; + + /* if still need to wait */ + ath_hal_radar_wait(sc->sc_ah, &hchan); + + if (hchan.privFlags & CHANNEL_INTERFERENCE) + return; + + if ((hchan.privFlags & CHANNEL_DFS_CLEAR) || + (!(hchan.privFlags & CHANNEL_DFS))) { + sc->sc_curchan.privFlags |= CHANNEL_DFS_CLEAR; + sc->sc_dfswait = 0; + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + struct ath_vap *avp = ATH_VAP(vap); + if (avp->av_dfswait_run) { + /* re alloc beacons to update new channel info */ + int error; + error = ath_beacon_alloc(sc, vap->iv_bss); + if(error < 0) { + /* XXX */ + return; + } + DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s: VAP DFS_WAIT -> RUN\n", + __func__, dev->name); + avp->av_newstate(vap, IEEE80211_S_RUN, 0); + /* start calibration timer */ + mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ)); +#ifdef ATH_SUPERG_XR + if (vap->iv_flags & IEEE80211_F_XR ) { + u_int32_t rfilt = 0; + rfilt = ath_calcrxfilter(sc); + ATH_SETUP_XR_VAP(sc, vap, rfilt); + } +#endif + avp->av_dfswait_run = 0; + } + } + /* start the device */ + netif_start_queue(dev); + dev->watchdog_timeo = 5 * HZ; /* set the timeout to normal */ + } else { + /* fire the timer again */ + sc->sc_dfswaittimer.expires = jiffies + (ATH_DFS_WAIT_POLL_PERIOD * HZ); + sc->sc_dfswaittimer.data = (unsigned long)sc; + add_timer(&sc->sc_dfswaittimer); + } + +} + +#ifdef ATH_SUPERG_COMP +/* Enable/Disable de-compression mask for given node. + * The routine is invoked after addition or deletion of the + * key. + */ +static void +ath_comp_set(struct ieee80211vap *vap, struct ieee80211_node *ni, int en) +{ + ath_setup_comp(ni, en); + return; +} + +/* Set up decompression engine for this node. */ +static void +ath_setup_comp(struct ieee80211_node *ni, int enable) +{ +#define IEEE80211_KEY_XR (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV) + struct ieee80211vap *vap = ni->ni_vap; + struct ath_softc *sc = vap->iv_ic->ic_dev->priv; + struct ath_node *an = ATH_NODE(ni); + u_int16_t keyindex; + + if (enable) { + /* Have we negotiated compression? */ + if (!(ni->ni_ath_flags & IEEE80211_NODE_COMP)) + return; + + /* No valid key? */ + if (ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE) + return; + + /* Setup decompression mask. + * For TKIP and split MIC case, recv. keyindex is at 32 offset + * from tx key. + */ + if ((ni->ni_wpa_ie != NULL) && + (ni->ni_rsn.rsn_ucastcipher == IEEE80211_CIPHER_TKIP) && + sc->sc_splitmic) { + if ((ni->ni_ucastkey.wk_flags & IEEE80211_KEY_XR) + == IEEE80211_KEY_XR) + keyindex = ni->ni_ucastkey.wk_keyix + 32; + else + keyindex = ni->ni_ucastkey.wk_keyix; + } else + keyindex = ni->ni_ucastkey.wk_keyix + ni->ni_rxkeyoff; + + ath_hal_setdecompmask(sc->sc_ah, keyindex, 1); + an->an_decomp_index = keyindex; + } else { + if (an->an_decomp_index != INVALID_DECOMP_INDEX) { + ath_hal_setdecompmask(sc->sc_ah, an->an_decomp_index, 0); + an->an_decomp_index = INVALID_DECOMP_INDEX; + } + } + + return; +#undef IEEE80211_KEY_XR +} +#endif + +/* + * Allocate a key cache slot to the station so we can + * setup a mapping from key index to node. The key cache + * slot is needed for managing antenna state and for + * compression when stations do not use crypto. We do + * it unilaterally here; if crypto is employed this slot + * will be reassigned. + */ +static void +ath_setup_stationkey(struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ath_softc *sc = vap->iv_ic->ic_dev->priv; + u_int16_t keyix; + + keyix = ath_key_alloc(vap, &ni->ni_ucastkey); + if (keyix == IEEE80211_KEYIX_NONE) { + /* + * Key cache is full; we'll fall back to doing + * the more expensive lookup in software. Note + * this also means no h/w compression. + */ + /* XXX msg+statistic */ + return; + } else { + ni->ni_ucastkey.wk_keyix = keyix; + /* NB: this will create a pass-thru key entry */ + ath_keyset(sc, &ni->ni_ucastkey, ni->ni_macaddr, vap->iv_bss); + +#ifdef ATH_SUPERG_COMP + /* Enable de-compression logic */ + ath_setup_comp(ni, 1); +#endif + } + + return; +} + +/* Setup WEP key for the station if compression is negotiated. + * When station and AP are using same default key index, use single key + * cache entry for receive and transmit, else two key cache entries are + * created. One for receive with MAC address of station and one for transmit + * with NULL mac address. On receive key cache entry de-compression mask + * is enabled. + */ +static void +ath_setup_stationwepkey(struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_key *ni_key; + struct ieee80211_key tmpkey; + struct ieee80211_key *rcv_key, *xmit_key; + int txkeyidx, rxkeyidx = IEEE80211_KEYIX_NONE, i; + u_int8_t null_macaddr[IEEE80211_ADDR_LEN] = {0, 0, 0, 0, 0, 0}; + + KASSERT(ni->ni_ath_defkeyindex < IEEE80211_WEP_NKID, + ("got invalid node key index 0x%x", ni->ni_ath_defkeyindex)); + KASSERT(vap->iv_def_txkey < IEEE80211_WEP_NKID, + ("got invalid vap def key index 0x%x", vap->iv_def_txkey)); + + /* Allocate a key slot first */ + if (!ieee80211_crypto_newkey(vap, + IEEE80211_CIPHER_WEP, + IEEE80211_KEY_XMIT|IEEE80211_KEY_RECV, + &ni->ni_ucastkey)) + goto error; + + txkeyidx = ni->ni_ucastkey.wk_keyix; + xmit_key = &vap->iv_nw_keys[vap->iv_def_txkey]; + + /* Do we need separate rx key? */ + if (ni->ni_ath_defkeyindex != vap->iv_def_txkey) { + ni->ni_ucastkey.wk_keyix = IEEE80211_KEYIX_NONE; + if (!ieee80211_crypto_newkey(vap, + IEEE80211_CIPHER_WEP, + IEEE80211_KEY_XMIT|IEEE80211_KEY_RECV, + &ni->ni_ucastkey)) { + ni->ni_ucastkey.wk_keyix = txkeyidx; + ieee80211_crypto_delkey(vap, &ni->ni_ucastkey, ni); + goto error; + } + rxkeyidx = ni->ni_ucastkey.wk_keyix; + ni->ni_ucastkey.wk_keyix = txkeyidx; + + rcv_key = &vap->iv_nw_keys[ni->ni_ath_defkeyindex]; + } else { + rcv_key = xmit_key; + rxkeyidx = txkeyidx; + } + + /* Remember receive key offset */ + ni->ni_rxkeyoff = rxkeyidx - txkeyidx; + + /* Setup xmit key */ + ni_key = &ni->ni_ucastkey; + if (rxkeyidx != txkeyidx) + ni_key->wk_flags = IEEE80211_KEY_XMIT; + else + ni_key->wk_flags = IEEE80211_KEY_XMIT|IEEE80211_KEY_RECV; + + ni_key->wk_keylen = xmit_key->wk_keylen; + for (i = 0; i < IEEE80211_TID_SIZE; i++) + ni_key->wk_keyrsc[i] = xmit_key->wk_keyrsc[i]; + ni_key->wk_keytsc = 0; + memset(ni_key->wk_key, 0, sizeof(ni_key->wk_key)); + memcpy(ni_key->wk_key, xmit_key->wk_key, xmit_key->wk_keylen); + ieee80211_crypto_setkey(vap, &ni->ni_ucastkey, + (rxkeyidx == txkeyidx) ? ni->ni_macaddr:null_macaddr, ni); + + if (rxkeyidx != txkeyidx) { + /* Setup recv key */ + ni_key = &tmpkey; + ni_key->wk_keyix = rxkeyidx; + ni_key->wk_flags = IEEE80211_KEY_RECV; + ni_key->wk_keylen = rcv_key->wk_keylen; + for(i = 0; i < IEEE80211_TID_SIZE; i++) + ni_key->wk_keyrsc[i] = rcv_key->wk_keyrsc[i]; + ni_key->wk_keytsc = 0; + ni_key->wk_cipher = rcv_key->wk_cipher; + ni_key->wk_private = rcv_key->wk_private; + memset(ni_key->wk_key, 0, sizeof(ni_key->wk_key)); + memcpy(ni_key->wk_key, rcv_key->wk_key, rcv_key->wk_keylen); + ieee80211_crypto_setkey(vap, &tmpkey, ni->ni_macaddr, ni); + } + + return; + +error: + ni->ni_ath_flags &= ~IEEE80211_NODE_COMP; + return; +} + +/* Create a keycache entry for given node in clearcase as well as static wep. + * Handle compression state if required. + * For non clearcase/static wep case, the key is plumbed by hostapd. + */ +static void +ath_setup_keycacheslot(struct ath_softc *sc, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + + if (ni->ni_ucastkey.wk_keyix != IEEE80211_KEYIX_NONE) + ieee80211_crypto_delkey(vap, &ni->ni_ucastkey, ni); + + /* Only for clearcase and WEP case */ + if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0 || + (ni->ni_ath_defkeyindex != IEEE80211_INVAL_DEFKEY)) { + + if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { + KASSERT(ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE, + ("new node with a ucast key already setup (keyix %u)", + ni->ni_ucastkey.wk_keyix)); + /* NB: 5210 has no passthru/clr key support */ + if (sc->sc_hasclrkey) + ath_setup_stationkey(ni); + } else + ath_setup_stationwepkey(ni); + } + + return; +} + +/* + * Setup driver-specific state for a newly associated node. + * Note that we're called also on a re-associate, the isnew + * param tells us if this is the first time or not. + */ +static void +ath_newassoc(struct ieee80211_node *ni, int isnew) +{ + struct ieee80211com *ic = ni->ni_ic; + struct ieee80211vap *vap = ni->ni_vap; + struct ath_softc *sc = ic->ic_dev->priv; + + sc->sc_rc->ops->newassoc(sc, ATH_NODE(ni), isnew); + + /* are we supporting compression? */ + if (!(vap->iv_ath_cap & ni->ni_ath_flags & IEEE80211_NODE_COMP)) + ni->ni_ath_flags &= ~IEEE80211_NODE_COMP; + + /* disable compression for TKIP */ + if ((ni->ni_ath_flags & IEEE80211_NODE_COMP) && + (ni->ni_wpa_ie != NULL) && + (ni->ni_rsn.rsn_ucastcipher == IEEE80211_CIPHER_TKIP)) + ni->ni_ath_flags &= ~IEEE80211_NODE_COMP; + + ath_setup_keycacheslot(sc, ni); +#ifdef ATH_SUPERG_XR + if (1) { + struct ath_node *an = ATH_NODE(ni); + if (ic->ic_ath_cap & an->an_node.ni_ath_flags & IEEE80211_ATHC_XR) + an->an_minffrate = ATH_MIN_FF_RATE; + else + an->an_minffrate = 0; + ath_grppoll_period_update(sc); + } +#endif +} + +static int +ath_getchannels(struct net_device *dev, u_int cc, + HAL_BOOL outdoor, HAL_BOOL xchanmode) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + HAL_CHANNEL *chans; + int i; + u_int nchan; + + chans = kmalloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL), GFP_KERNEL); + if (chans == NULL) { + printk("%s: unable to allocate channel table\n", dev->name); + return -ENOMEM; + } + if (!ath_hal_init_channels(ah, chans, IEEE80211_CHAN_MAX, &nchan, + ic->ic_regclassids, IEEE80211_REGCLASSIDS_MAX, &ic->ic_nregclass, + cc, HAL_MODE_ALL, outdoor, xchanmode)) { + u_int32_t rd; + + ath_hal_getregdomain(ah, &rd); + printk("%s: unable to collect channel list from HAL; " + "regdomain likely %u country code %u\n", + dev->name, rd, cc); + kfree(chans); + return -EINVAL; + } + /* + * Convert HAL channels to ieee80211 ones. + */ + for (i = 0; i < nchan; i++) { + HAL_CHANNEL *c = &chans[i]; + struct ieee80211_channel *ichan = &ic->ic_channels[i]; + + ichan->ic_ieee = ath_hal_mhz2ieee(ah, c->channel, c->channelFlags); + ichan->ic_freq = c->channel; + ichan->ic_flags = c->channelFlags; + ichan->ic_maxregpower = c->maxRegTxPower; /* dBm */ + ichan->ic_maxpower = c->maxTxPower; /* 1/4 dBm */ + ichan->ic_minpower = c->minTxPower; /* 1/4 dBm */ + } + ic->ic_nchans = nchan; + kfree(chans); + return 0; +} + +static void +ath_led_done(unsigned long arg) +{ + struct ath_softc *sc = (struct ath_softc *) arg; + + sc->sc_blinking = 0; +} + +/* + * Turn the LED off: flip the pin and then set a timer so no + * update will happen for the specified duration. + */ +static void +ath_led_off(unsigned long arg) +{ + struct ath_softc *sc = (struct ath_softc *) arg; + + ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon); + sc->sc_ledtimer.function = ath_led_done; + sc->sc_ledtimer.expires = jiffies + sc->sc_ledoff; + add_timer(&sc->sc_ledtimer); +} + +/* + * Blink the LED according to the specified on/off times. + */ +static void +ath_led_blink(struct ath_softc *sc, int on, int off) +{ + DPRINTF(sc, ATH_DEBUG_LED, "%s: on %u off %u\n", __func__, on, off); + ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, sc->sc_ledon); + sc->sc_blinking = 1; + sc->sc_ledoff = off; + sc->sc_ledtimer.function = ath_led_off; + sc->sc_ledtimer.expires = jiffies + on; + add_timer(&sc->sc_ledtimer); +} + +static void +ath_led_event(struct ath_softc *sc, int event) +{ + + sc->sc_ledevent = jiffies; /* time of last event */ + if (sc->sc_blinking) /* don't interrupt active blink */ + return; + switch (event) { + case ATH_LED_POLL: + ath_led_blink(sc, sc->sc_hwmap[0].ledon, + sc->sc_hwmap[0].ledoff); + break; + case ATH_LED_TX: + ath_led_blink(sc, sc->sc_hwmap[sc->sc_txrate].ledon, + sc->sc_hwmap[sc->sc_txrate].ledoff); + break; + case ATH_LED_RX: + ath_led_blink(sc, sc->sc_hwmap[sc->sc_rxrate].ledon, + sc->sc_hwmap[sc->sc_rxrate].ledoff); + break; + } +} + +static void +set_node_txpower(void *arg, struct ieee80211_node *ni) +{ + int *value = (int *)arg; + ni->ni_txpower = *value; +} + +/* XXX: this function needs some locking to avoid being called twice/interrupted */ +static void +ath_update_txpow(struct ath_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = NULL; + struct ath_hal *ah = sc->sc_ah; + u_int32_t txpowlimit = 0; + u_int32_t maxtxpowlimit = 9999; + u_int32_t clamped_txpow = 0; + + /* + * Find the maxtxpow of the card and regulatory constraints + */ + (void)ath_hal_getmaxtxpow(ah, &txpowlimit); + ath_hal_settxpowlimit(ah, maxtxpowlimit); + (void)ath_hal_getmaxtxpow(ah, &maxtxpowlimit); + ic->ic_txpowlimit = maxtxpowlimit; + ath_hal_settxpowlimit(ah, txpowlimit); + + /* + * Make sure the VAP's change is within limits, clamp it otherwise + */ + if (ic->ic_newtxpowlimit > ic->ic_txpowlimit) + clamped_txpow = ic->ic_txpowlimit; + else + clamped_txpow = ic->ic_newtxpowlimit; + + /* + * Search for the VAP that needs a txpow change, if any + */ + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { +#ifdef ATH_CAP_TPC + if (ic->ic_newtxpowlimit == vap->iv_bss->ni_txpower) { + vap->iv_bss->ni_txpower = clamped_txpow; + ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, set_node_txpower, &clamped_txpow); + } +#else + vap->iv_bss->ni_txpower = clamped_txpow; + ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, set_node_txpower, &clamped_txpow); +#endif + } + + ic->ic_newtxpowlimit = sc->sc_curtxpow = clamped_txpow; + +#ifdef ATH_CAP_TPC + if (ic->ic_newtxpowlimit >= txpowlimit) + ath_hal_settxpowlimit(ah, ic->ic_newtxpowlimit); +#else + if (ic->ic_newtxpowlimit != txpowlimit) + ath_hal_settxpowlimit(ah, ic->ic_newtxpowlimit); +#endif +} + + +#ifdef ATH_SUPERG_XR +static int +ath_xr_rate_setup(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + const HAL_RATE_TABLE *rt; + struct ieee80211_rateset *rs; + int i, maxrates; + sc->sc_xr_rates = ath_hal_getratetable(ah, HAL_MODE_XR); + rt = sc->sc_xr_rates; + if (rt == NULL) + return 0; + if (rt->rateCount > XR_NUM_SUP_RATES) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: rate table too small (%u > %u)\n", + __func__, rt->rateCount, IEEE80211_RATE_MAXSIZE); + maxrates = IEEE80211_RATE_MAXSIZE; + } else + maxrates = rt->rateCount; + rs = &ic->ic_sup_xr_rates; + for (i = 0; i < maxrates; i++) + rs->rs_rates[i] = rt->info[i].dot11Rate; + rs->rs_nrates = maxrates; + return 1; +} +#endif + +/* Setup half/quarter rate table support */ +static void +ath_setup_subrates(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + const HAL_RATE_TABLE *rt; + struct ieee80211_rateset *rs; + int i, maxrates; + + sc->sc_half_rates = ath_hal_getratetable(ah, HAL_MODE_11A_HALF_RATE); + rt = sc->sc_half_rates; + if (rt != NULL) { + if (rt->rateCount > IEEE80211_RATE_MAXSIZE) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: rate table too small (%u > %u)\n", + __func__, rt->rateCount, IEEE80211_RATE_MAXSIZE); + maxrates = IEEE80211_RATE_MAXSIZE; + } else + maxrates = rt->rateCount; + rs = &ic->ic_sup_half_rates; + for (i = 0; i < maxrates; i++) + rs->rs_rates[i] = rt->info[i].dot11Rate; + rs->rs_nrates = maxrates; + } + + sc->sc_quarter_rates = ath_hal_getratetable(ah, HAL_MODE_11A_QUARTER_RATE); + rt = sc->sc_quarter_rates; + if (rt != NULL) { + if (rt->rateCount > IEEE80211_RATE_MAXSIZE) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: rate table too small (%u > %u)\n", + __func__, rt->rateCount, IEEE80211_RATE_MAXSIZE); + maxrates = IEEE80211_RATE_MAXSIZE; + } else + maxrates = rt->rateCount; + rs = &ic->ic_sup_quarter_rates; + for (i = 0; i < maxrates; i++) + rs->rs_rates[i] = rt->info[i].dot11Rate; + rs->rs_nrates = maxrates; + } +} + +static int +ath_rate_setup(struct net_device *dev, u_int mode) +{ + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + const HAL_RATE_TABLE *rt; + struct ieee80211_rateset *rs; + int i, maxrates; + + switch (mode) { + case IEEE80211_MODE_11A: + sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_11A); + break; + case IEEE80211_MODE_11B: + sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_11B); + break; + case IEEE80211_MODE_11G: + sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_11G); + break; + case IEEE80211_MODE_TURBO_A: + sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_TURBO); + break; + case IEEE80211_MODE_TURBO_G: + sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_108G); + break; + default: + DPRINTF(sc, ATH_DEBUG_ANY, "%s: invalid mode %u\n", + __func__, mode); + return 0; + } + rt = sc->sc_rates[mode]; + if (rt == NULL) + return 0; + if (rt->rateCount > IEEE80211_RATE_MAXSIZE) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: rate table too small (%u > %u)\n", + __func__, rt->rateCount, IEEE80211_RATE_MAXSIZE); + maxrates = IEEE80211_RATE_MAXSIZE; + } else + maxrates = rt->rateCount; + rs = &ic->ic_sup_rates[mode]; + for (i = 0; i < maxrates; i++) + rs->rs_rates[i] = rt->info[i].dot11Rate; + rs->rs_nrates = maxrates; + return 1; +} + +static void +ath_setcurmode(struct ath_softc *sc, enum ieee80211_phymode mode) +{ +#define N(a) ((int)(sizeof(a)/sizeof(a[0]))) + /* NB: on/off times from the Atheros NDIS driver, w/ permission */ + static const struct { + u_int rate; /* tx/rx 802.11 rate */ + u_int16_t timeOn; /* LED on time (ms) */ + u_int16_t timeOff; /* LED off time (ms) */ + } blinkrates[] = { + { 108, 40, 10 }, + { 96, 44, 11 }, + { 72, 50, 13 }, + { 48, 57, 14 }, + { 36, 67, 16 }, + { 24, 80, 20 }, + { 22, 100, 25 }, + { 18, 133, 34 }, + { 12, 160, 40 }, + { 10, 200, 50 }, + { 6, 240, 58 }, + { 4, 267, 66 }, + { 2, 400, 100 }, + { 0, 500, 130 }, + }; + const HAL_RATE_TABLE *rt; + int i, j; + + memset(sc->sc_rixmap, 0xff, sizeof(sc->sc_rixmap)); + rt = sc->sc_rates[mode]; + KASSERT(rt != NULL, ("no h/w rate set for phy mode %u", mode)); + for (i = 0; i < rt->rateCount; i++) + sc->sc_rixmap[rt->info[i].dot11Rate & IEEE80211_RATE_VAL] = i; + memset(sc->sc_hwmap, 0, sizeof(sc->sc_hwmap)); + for (i = 0; i < 32; i++) { + u_int8_t ix = rt->rateCodeToIndex[i]; + if (ix == 0xff) { + sc->sc_hwmap[i].ledon = msecs_to_jiffies(500); + sc->sc_hwmap[i].ledoff = msecs_to_jiffies(130); + continue; + } + sc->sc_hwmap[i].ieeerate = + rt->info[ix].dot11Rate & IEEE80211_RATE_VAL; + if (rt->info[ix].shortPreamble || + rt->info[ix].phy == IEEE80211_T_OFDM) + sc->sc_hwmap[i].flags |= IEEE80211_RADIOTAP_F_SHORTPRE; + /* setup blink rate table to avoid per-packet lookup */ + for (j = 0; j < N(blinkrates) - 1; j++) + if (blinkrates[j].rate == sc->sc_hwmap[i].ieeerate) + break; + /* NB: this uses the last entry if the rate isn't found */ + /* XXX beware of overflow */ + sc->sc_hwmap[i].ledon = msecs_to_jiffies(blinkrates[j].timeOn); + sc->sc_hwmap[i].ledoff = msecs_to_jiffies(blinkrates[j].timeOff); + } + sc->sc_currates = rt; + sc->sc_curmode = mode; + /* + * All protection frames are transmitted at 2Mb/s for + * 11g, otherwise at 1Mb/s. + * XXX select protection rate index from rate table. + */ + sc->sc_protrix = (mode == IEEE80211_MODE_11G ? 1 : 0); + /* rate index used to send mgt frames */ + sc->sc_minrateix = 0; +#undef N +} + +#ifdef ATH_SUPERG_FF +static u_int32_t +athff_approx_txtime(struct ath_softc *sc, struct ath_node *an, struct sk_buff *skb) +{ + u_int32_t txtime; + u_int32_t framelen; + + /* + * Approximate the frame length to be transmitted. A swag to add + * the following maximal values to the skb payload: + * - 32: 802.11 encap + CRC + * - 24: encryption overhead (if wep bit) + * - 4 + 6: fast-frame header and padding + * - 16: 2 LLC FF tunnel headers + * - 14: 1 802.3 FF tunnel header (skb already accounts for 2nd) + */ + framelen = skb->len + 32 + 4 + 6 + 16 + 14; + if (sc->sc_ic.ic_flags & IEEE80211_F_PRIVACY) + framelen += 24; + if (an->an_tx_ffbuf[skb->priority]) + framelen += an->an_tx_ffbuf[skb->priority]->bf_skb->len; + + txtime = ath_hal_computetxtime(sc->sc_ah, sc->sc_currates, framelen, + an->an_prevdatarix, AH_FALSE); + + return txtime; +} +/* + * Determine if a data frame may be aggregated via ff tunneling. + * + * NB: allowing EAPOL frames to be aggregated with other unicast traffic. + * Do 802.1x EAPOL frames proceed in the clear? Then they couldn't + * be aggregated with other types of frames when encryption is on? + * + * NB: assumes lock on an_tx_ffbuf effectively held by txq lock mechanism. + */ +static int +athff_can_aggregate(struct ath_softc *sc, struct ether_header *eh, + struct ath_node *an, struct sk_buff *skb, u_int16_t fragthreshold, int *flushq) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ath_txq *txq = sc->sc_ac2q[skb->priority]; + struct ath_buf *ffbuf = an->an_tx_ffbuf[skb->priority]; + u_int32_t txoplimit; + +#define US_PER_4MS 4000 +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + + *flushq = AH_FALSE; + + if (fragthreshold < 2346) + return AH_FALSE; + + if ((!ffbuf) && (txq->axq_depth < sc->sc_fftxqmin)) + return AH_FALSE; + if (!(ic->ic_ath_cap & an->an_node.ni_ath_flags & IEEE80211_ATHC_FF)) + return AH_FALSE; + if (!(ic->ic_opmode == IEEE80211_M_STA || + ic->ic_opmode == IEEE80211_M_HOSTAP)) + return AH_FALSE; + if ((ic->ic_opmode == IEEE80211_M_HOSTAP) && + ETHER_IS_MULTICAST(eh->ether_dhost)) + return AH_FALSE; + +#ifdef ATH_SUPERG_XR + if (sc->sc_currates->info[an->an_prevdatarix].rateKbps < an->an_minffrate) + return AH_FALSE; +#endif + txoplimit = IEEE80211_TXOP_TO_US( + ic->ic_wme.wme_chanParams.cap_wmeParams[skb->priority].wmep_txopLimit); + + /* if the 4 msec limit is set on the channel, take it into account */ + if (sc->sc_curchan.privFlags & CHANNEL_4MS_LIMIT) + txoplimit = MIN(txoplimit, US_PER_4MS); + + if (txoplimit != 0 && athff_approx_txtime(sc, an, skb) > txoplimit) { + DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, + "%s: FF TxOp violation\n", __func__); + if (ffbuf) + *flushq = AH_TRUE; + return AH_FALSE; + } + + return AH_TRUE; + +#undef US_PER_4MS +#undef MIN +} +#endif + +#ifdef AR_DEBUG +static void +ath_printrxbuf(struct ath_buf *bf, int done) +{ + struct ath_desc *ds = bf->bf_desc; + + printk("R (%p %llx) %08x %08x %08x %08x %08x %08x %c\n", + ds, ito64(bf->bf_daddr), + ds->ds_link, ds->ds_data, + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1], + !done ? ' ' : (ds->ds_rxstat.rs_status == 0) ? '*' : '!'); +} + +static void +ath_printtxbuf(struct ath_buf *bf, int done) +{ + struct ath_desc *ds = bf->bf_desc; + + printk("T (%p %llx) %08x %08x %08x %08x %08x %08x %08x %08x %c\n", + ds, ito64(bf->bf_daddr), + ds->ds_link, ds->ds_data, + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3], + !done ? ' ' : (ds->ds_txstat.ts_status == 0) ? '*' : '!'); +} +#endif /* AR_DEBUG */ + +/* + * Return netdevice statistics. + */ +static struct net_device_stats * +ath_getstats(struct net_device *dev) +{ + struct ath_softc *sc = dev->priv; + struct net_device_stats *stats = &sc->sc_devstats; + + /* update according to private statistics */ + stats->tx_errors = sc->sc_stats.ast_tx_xretries + + sc->sc_stats.ast_tx_fifoerr + + sc->sc_stats.ast_tx_filtered; + stats->tx_dropped = sc->sc_stats.ast_tx_nobuf + + sc->sc_stats.ast_tx_encap + + sc->sc_stats.ast_tx_nonode + + sc->sc_stats.ast_tx_nobufmgt; + stats->rx_errors = sc->sc_stats.ast_rx_fifoerr + + sc->sc_stats.ast_rx_badcrypt + + sc->sc_stats.ast_rx_badmic; + stats->rx_dropped = sc->sc_stats.ast_rx_tooshort; + stats->rx_crc_errors = sc->sc_stats.ast_rx_crcerr; + + return stats; +} + +static int +ath_set_mac_address(struct net_device *dev, void *addr) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct sockaddr *mac = addr; + int error = 0; + + if (netif_running(dev)) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: cannot set address; device running\n", __func__); + return -EBUSY; + } + DPRINTF(sc, ATH_DEBUG_ANY, "%s: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + __func__, + mac->sa_data[0], mac->sa_data[1], mac->sa_data[2], + mac->sa_data[3], mac->sa_data[4], mac->sa_data[5]); + + ATH_LOCK(sc); + /* XXX not right for multiple VAPs */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, mac->sa_data); + IEEE80211_ADDR_COPY(dev->dev_addr, mac->sa_data); + ath_hal_setmac(ah, dev->dev_addr); + if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { + error = ath_reset(dev); + } + ATH_UNLOCK(sc); + + return error; +} + +static int +ath_change_mtu(struct net_device *dev, int mtu) +{ + struct ath_softc *sc = dev->priv; + int error = 0; + + if (!(ATH_MIN_MTU < mtu && mtu <= ATH_MAX_MTU)) { + DPRINTF(sc, ATH_DEBUG_ANY, "%s: invalid %d, min %u, max %u\n", + __func__, mtu, ATH_MIN_MTU, ATH_MAX_MTU); + return -EINVAL; + } + DPRINTF(sc, ATH_DEBUG_ANY, "%s: %d\n", __func__, mtu); + + ATH_LOCK(sc); + dev->mtu = mtu; + if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { + /* NB: the rx buffers may need to be reallocated */ + tasklet_disable(&sc->sc_rxtq); + error = ath_reset(dev); + tasklet_enable(&sc->sc_rxtq); + } + ATH_UNLOCK(sc); + + return error; +} + +/* + * Diagnostic interface to the HAL. This is used by various + * tools to do things like retrieve register contents for + * debugging. The mechanism is intentionally opaque so that + * it can change frequently w/o concern for compatibility. + */ +static int +ath_ioctl_diag(struct ath_softc *sc, struct ath_diag *ad) +{ + struct ath_hal *ah = sc->sc_ah; + u_int id = ad->ad_id & ATH_DIAG_ID; + void *indata = NULL; + void *outdata = NULL; + u_int32_t insize = ad->ad_in_size; + u_int32_t outsize = ad->ad_out_size; + int error = 0; + + if (ad->ad_id & ATH_DIAG_IN) { + /* + * Copy in data. + */ + indata = kmalloc(insize, GFP_KERNEL); + if (indata == NULL) { + error = -ENOMEM; + goto bad; + } + if (copy_from_user(indata, ad->ad_in_data, insize)) { + error = -EFAULT; + goto bad; + } + } + if (ad->ad_id & ATH_DIAG_DYN) { + /* + * Allocate a buffer for the results (otherwise the HAL + * returns a pointer to a buffer where we can read the + * results). Note that we depend on the HAL leaving this + * pointer for us to use below in reclaiming the buffer; + * may want to be more defensive. + */ + outdata = kmalloc(outsize, GFP_KERNEL); + if (outdata == NULL) { + error = -ENOMEM; + goto bad; + } + } + if (ath_hal_getdiagstate(ah, id, indata, insize, &outdata, &outsize)) { + if (outsize < ad->ad_out_size) + ad->ad_out_size = outsize; + if (outdata && + copy_to_user(ad->ad_out_data, outdata, ad->ad_out_size)) + error = -EFAULT; + } else + error = -EINVAL; +bad: + if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL) + kfree(indata); + if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL) + kfree(outdata); + return error; +} + +static int +ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +{ + struct ath_softc *sc = dev->priv; + struct ieee80211com *ic = &sc->sc_ic; + int error; + + ATH_LOCK(sc); + switch (cmd) { + case SIOCGATHSTATS: + sc->sc_stats.ast_tx_packets = sc->sc_devstats.tx_packets; + sc->sc_stats.ast_rx_packets = sc->sc_devstats.rx_packets; + sc->sc_stats.ast_rx_rssi = ieee80211_getrssi(ic); + if (copy_to_user(ifr->ifr_data, &sc->sc_stats, sizeof (sc->sc_stats))) + error = -EFAULT; + else + error = 0; + break; + case SIOCGATHDIAG: + if (!capable(CAP_NET_ADMIN)) + error = -EPERM; + else + error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); + break; + case SIOCETHTOOL: + if (copy_from_user(&cmd, ifr->ifr_data, sizeof(cmd))) + error = -EFAULT; + else + error = ath_ioctl_ethtool(sc, cmd, ifr->ifr_data); + break; + case SIOC80211IFCREATE: + error = ieee80211_ioctl_create_vap(ic, ifr, dev); + break; + default: + error = -EINVAL; + break; + } + ATH_UNLOCK(sc); + return error; +} + +/* + * Sysctls are split into ``static'' and ``dynamic'' tables. + * The former are defined at module load time and are used + * control parameters common to all devices. The latter are + * tied to particular device instances and come and go with + * each device. The split is currently a bit tenuous; many of + * the static ones probably should be dynamic but having them + * static (e.g. debug) means they can be set after a module is + * loaded and before bringing up a device. The alternative + * is to add module parameters. + */ + +/* + * Dynamic (i.e. per-device) sysctls. These are automatically + * mirrored in /proc/sys. + */ +enum { + ATH_SLOTTIME = 1, + ATH_ACKTIMEOUT = 2, + ATH_CTSTIMEOUT = 3, + ATH_SOFTLED = 4, + ATH_LEDPIN = 5, + ATH_COUNTRYCODE = 6, + ATH_REGDOMAIN = 7, + ATH_DEBUG = 8, + ATH_TXANTENNA = 9, + ATH_RXANTENNA = 10, + ATH_DIVERSITY = 11, + ATH_TXINTRPERIOD = 12, + ATH_FFTXQMIN = 18, + ATH_TKIPMIC = 19, + ATH_XR_POLL_PERIOD = 20, + ATH_XR_POLL_COUNT = 21, + ATH_ACKRATE = 22, + ATH_INTMIT = 23, + ATH_MAXVAPS = 26, +}; + +static int +ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos) +{ + struct ath_softc *sc = ctl->extra1; + struct ath_hal *ah = sc->sc_ah; + u_int val; + int ret; + + ctl->data = &val; + ctl->maxlen = sizeof(val); + if (write) { + ret = ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos); + if (ret == 0) { + switch ((long)ctl->extra2) { + case ATH_SLOTTIME: + if (val > 0) { + if (!ath_hal_setslottime(ah, val)) + ret = -EINVAL; + else + sc->sc_slottimeconf = val; + } else { + /* disable manual override */ + sc->sc_slottimeconf = 0; + ath_setslottime(sc); + } + break; + case ATH_ACKTIMEOUT: + if (!ath_hal_setacktimeout(ah, val)) + ret = -EINVAL; + break; + case ATH_CTSTIMEOUT: + if (!ath_hal_setctstimeout(ah, val)) + ret = -EINVAL; + break; + case ATH_SOFTLED: + if (val != sc->sc_softled) { + if (val) + ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + ath_hal_gpioset(ah, sc->sc_ledpin,!sc->sc_ledon); + sc->sc_softled = val; + } + break; + case ATH_LEDPIN: + /* XXX validate? */ + sc->sc_ledpin = val; + break; + case ATH_DEBUG: + sc->sc_debug = val; + break; + case ATH_TXANTENNA: + /* + * antenna can be: + * 0 = transmit diversity + * 1 = antenna port 1 + * 2 = antenna port 2 + */ + if (val < 0 || val > 2) + return -EINVAL; + else + sc->sc_txantenna = val; + break; + case ATH_RXANTENNA: + /* + * antenna can be: + * 0 = receive diversity + * 1 = antenna port 1 + * 2 = antenna port 2 + */ + if (val < 0 || val > 2) + return -EINVAL; + else + ath_setdefantenna(sc, val); + break; + case ATH_DIVERSITY: + /* + * 0 = disallow use of diversity + * 1 = allow use of diversity + */ + if (val < 0 || val > 1) + return -EINVAL; + /* Don't enable diversity if XR is enabled */ + if (((!sc->sc_hasdiversity) || (sc->sc_xrtxq != NULL)) && val) + return -EINVAL; + sc->sc_diversity = val; + ath_hal_setdiversity(ah, val); + break; + case ATH_TXINTRPERIOD: + /* XXX: validate? */ + sc->sc_txintrperiod = val; + break; + case ATH_FFTXQMIN: + /* XXX validate? */ + sc->sc_fftxqmin = val; + break; + case ATH_TKIPMIC: { + struct ieee80211com *ic = &sc->sc_ic; + + if (!ath_hal_hastkipmic(ah)) + return -EINVAL; + ath_hal_settkipmic(ah, val); + if (val) + ic->ic_caps |= IEEE80211_C_TKIPMIC; + else + ic->ic_caps &= ~IEEE80211_C_TKIPMIC; + break; + } +#ifdef ATH_SUPERG_XR + case ATH_XR_POLL_PERIOD: + if (val > XR_MAX_POLL_INTERVAL) + val = XR_MAX_POLL_INTERVAL; + else if (val < XR_MIN_POLL_INTERVAL) + val = XR_MIN_POLL_INTERVAL; + sc->sc_xrpollint = val; + break; + + case ATH_XR_POLL_COUNT: + if (val > XR_MAX_POLL_COUNT) + val = XR_MAX_POLL_COUNT; + else if (val < XR_MIN_POLL_COUNT) + val = XR_MIN_POLL_COUNT; + sc->sc_xrpollcount = val; + break; +#endif + case ATH_ACKRATE: + sc->sc_ackrate = val; + ath_set_ack_bitrate(sc, sc->sc_ackrate); + break; + case ATH_INTMIT: + sc->sc_useintmit = val; + ath_hal_setintmit(ah, val ? 1 : 0); + if (sc->sc_dev != NULL && + sc->sc_dev->flags & IFF_RUNNING && + !sc->sc_invalid) + ath_reset(sc->sc_dev); + break; + default: + return -EINVAL; + } + } + } else { + switch ((long)ctl->extra2) { + case ATH_SLOTTIME: + val = ath_hal_getslottime(ah); + break; + case ATH_ACKTIMEOUT: + val = ath_hal_getacktimeout(ah); + break; + case ATH_CTSTIMEOUT: + val = ath_hal_getctstimeout(ah); + break; + case ATH_SOFTLED: + val = sc->sc_softled; + break; + case ATH_LEDPIN: + val = sc->sc_ledpin; + break; + case ATH_COUNTRYCODE: + ath_hal_getcountrycode(ah, &val); + break; + case ATH_MAXVAPS: + val = ath_maxvaps; + break; + case ATH_REGDOMAIN: + ath_hal_getregdomain(ah, &val); + break; + case ATH_DEBUG: + val = sc->sc_debug; + break; + case ATH_TXANTENNA: + val = sc->sc_txantenna; + break; + case ATH_RXANTENNA: + val = ath_hal_getdefantenna(ah); + break; + case ATH_DIVERSITY: + val = sc->sc_diversity; + break; + case ATH_TXINTRPERIOD: + val = sc->sc_txintrperiod; + break; + case ATH_FFTXQMIN: + val = sc->sc_fftxqmin; + break; + case ATH_TKIPMIC: + val = ath_hal_gettkipmic(ah); + break; +#ifdef ATH_SUPERG_XR + case ATH_XR_POLL_PERIOD: + val=sc->sc_xrpollint; + break; + case ATH_XR_POLL_COUNT: + val=sc->sc_xrpollcount; + break; +#endif + case ATH_ACKRATE: + val = sc->sc_ackrate; + break; + case ATH_INTMIT: + val = sc->sc_useintmit; + break; + default: + return -EINVAL; + } + ret = ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos); + } + return ret; +} + +static int mincalibrate = 1; /* once a second */ +static int maxint = 0x7fffffff; /* 32-bit big */ + +static const ctl_table ath_sysctl_template[] = { + { .ctl_name = CTL_AUTO, + .procname = "slottime", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_SLOTTIME, + }, + { .ctl_name = CTL_AUTO, + .procname = "acktimeout", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_ACKTIMEOUT, + }, + { .ctl_name = CTL_AUTO, + .procname = "ctstimeout", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_CTSTIMEOUT, + }, + { .ctl_name = CTL_AUTO, + .procname = "softled", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_SOFTLED, + }, + { .ctl_name = CTL_AUTO, + .procname = "ledpin", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_LEDPIN, + }, + { .ctl_name = CTL_AUTO, + .procname = "countrycode", + .mode = 0444, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_COUNTRYCODE, + }, + { .ctl_name = CTL_AUTO, + .procname = "maxvaps", + .mode = 0444, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_MAXVAPS, + }, + { .ctl_name = CTL_AUTO, + .procname = "regdomain", + .mode = 0444, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_REGDOMAIN, + }, +#ifdef AR_DEBUG + { .ctl_name = CTL_AUTO, + .procname = "debug", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_DEBUG, + }, +#endif + { .ctl_name = CTL_AUTO, + .procname = "txantenna", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_TXANTENNA, + }, + { .ctl_name = CTL_AUTO, + .procname = "rxantenna", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_RXANTENNA, + }, + { .ctl_name = CTL_AUTO, + .procname = "diversity", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_DIVERSITY, + }, + { .ctl_name = CTL_AUTO, + .procname = "txintrperiod", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_TXINTRPERIOD, + }, + { .ctl_name = CTL_AUTO, + .procname = "fftxqmin", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_FFTXQMIN, + }, + { .ctl_name = CTL_AUTO, + .procname = "tkipmic", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_TKIPMIC, + }, +#ifdef ATH_SUPERG_XR + { .ctl_name = CTL_AUTO, + .procname = "xrpollperiod", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_XR_POLL_PERIOD, + }, + { .ctl_name = CTL_AUTO, + .procname = "xrpollcount", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_XR_POLL_COUNT, + }, +#endif + { .ctl_name = CTL_AUTO, + .procname = "ackrate", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_ACKRATE, + }, + { .ctl_name = CTL_AUTO, + .procname = "intmit", + .mode = 0644, + .proc_handler = ath_sysctl_halparam, + .extra2 = (void *)ATH_INTMIT, + }, + { 0 } +}; + +static void +ath_dynamic_sysctl_register(struct ath_softc *sc) +{ + int i, space; + char *dev_name = NULL; + + space = 5 * sizeof(struct ctl_table) + sizeof(ath_sysctl_template); + sc->sc_sysctls = kmalloc(space, GFP_KERNEL); + if (sc->sc_sysctls == NULL) { + printk("%s: no memory for sysctl table!\n", __func__); + return; + } + + /* + * We want to reserve space for the name of the device separate + * from the net_device structure, because when the name is changed + * it is changed in the net_device structure and the message given + * out. Thus we won't know what the name it used to be if we rely + * on it. + */ + dev_name = kmalloc((strlen(sc->sc_dev->name) + 1) * sizeof(char), GFP_KERNEL); + if (dev_name == NULL) { + printk("%s: no memory for device name storage!\n", __func__); + return; + } + strncpy(dev_name, sc->sc_dev->name, strlen(sc->sc_dev->name) + 1); + + /* setup the table */ + memset(sc->sc_sysctls, 0, space); + sc->sc_sysctls[0].ctl_name = CTL_DEV; + sc->sc_sysctls[0].procname = "dev"; + sc->sc_sysctls[0].mode = 0555; + sc->sc_sysctls[0].child = &sc->sc_sysctls[2]; + /* [1] is NULL terminator */ + sc->sc_sysctls[2].ctl_name = CTL_AUTO; + sc->sc_sysctls[2].procname = dev_name; + sc->sc_sysctls[2].mode = 0555; + sc->sc_sysctls[2].child = &sc->sc_sysctls[4]; + /* [3] is NULL terminator */ + /* copy in pre-defined data */ + memcpy(&sc->sc_sysctls[4], ath_sysctl_template, + sizeof(ath_sysctl_template)); + + /* add in dynamic data references */ + for (i = 4; sc->sc_sysctls[i].procname; i++) + if (sc->sc_sysctls[i].extra1 == NULL) + sc->sc_sysctls[i].extra1 = sc; + + /* and register everything */ + sc->sc_sysctl_header = ATH_REGISTER_SYSCTL_TABLE(sc->sc_sysctls); + if (!sc->sc_sysctl_header) { + printk("%s: failed to register sysctls!\n", sc->sc_dev->name); + kfree(dev_name); + kfree(sc->sc_sysctls); + sc->sc_sysctls = NULL; + } + + /* initialize values */ + sc->sc_debug = ath_debug; + sc->sc_txantenna = 0; /* default to auto-selection */ + sc->sc_txintrperiod = ATH_TXQ_INTR_PERIOD; +} + +static void +ath_dynamic_sysctl_unregister(struct ath_softc *sc) +{ + if (sc->sc_sysctl_header) { + unregister_sysctl_table(sc->sc_sysctl_header); + sc->sc_sysctl_header = NULL; + } + if (sc->sc_sysctls && sc->sc_sysctls[2].procname) { + kfree(sc->sc_sysctls[2].procname); + sc->sc_sysctls[2].procname = NULL; + } + if (sc->sc_sysctls) { + kfree(sc->sc_sysctls); + sc->sc_sysctls = NULL; + } +} + +/* + * Announce various information on device/driver attach. + */ +static void +ath_announce(struct net_device *dev) +{ +#define HAL_MODE_DUALBAND (HAL_MODE_11A|HAL_MODE_11B) + struct ath_softc *sc = dev->priv; + struct ath_hal *ah = sc->sc_ah; + u_int modes, cc; + + printk("%s: mac %d.%d phy %d.%d", dev->name, + ah->ah_macVersion, ah->ah_macRev, + ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf); + /* + * Print radio revision(s). We check the wireless modes + * to avoid falsely printing revs for inoperable parts. + * Dual-band radio revs are returned in the 5 GHz rev number. + */ + ath_hal_getcountrycode(ah, &cc); + modes = ath_hal_getwirelessmodes(ah, cc); + if ((modes & HAL_MODE_DUALBAND) == HAL_MODE_DUALBAND) { + if (ah->ah_analog5GhzRev && ah->ah_analog2GhzRev) + printk(" 5 GHz radio %d.%d 2 GHz radio %d.%d", + ah->ah_analog5GhzRev >> 4, + ah->ah_analog5GhzRev & 0xf, + ah->ah_analog2GhzRev >> 4, + ah->ah_analog2GhzRev & 0xf); + else + printk(" radio %d.%d", ah->ah_analog5GhzRev >> 4, + ah->ah_analog5GhzRev & 0xf); + } else + printk(" radio %d.%d", ah->ah_analog5GhzRev >> 4, + ah->ah_analog5GhzRev & 0xf); + printk("\n"); + if (1/*bootverbose*/) { + int i; + for (i = 0; i <= WME_AC_VO; i++) { + struct ath_txq *txq = sc->sc_ac2q[i]; + printk("%s: Use hw queue %u for %s traffic\n", + dev->name, txq->axq_qnum, + ieee80211_wme_acnames[i]); + } + printk("%s: Use hw queue %u for CAB traffic\n", dev->name, + sc->sc_cabq->axq_qnum); + printk("%s: Use hw queue %u for beacons\n", dev->name, + sc->sc_bhalq); + } +#undef HAL_MODE_DUALBAND +} + +/* + * Static (i.e. global) sysctls. Note that the HAL sysctls + * are located under ours by sharing the setting for DEV_ATH. + */ +static ctl_table ath_static_sysctls[] = { +#ifdef AR_DEBUG + { .ctl_name = CTL_AUTO, + .procname = "debug", + .mode = 0644, + .data = &ath_debug, + .maxlen = sizeof(ath_debug), + .proc_handler = proc_dointvec + }, +#endif + { .ctl_name = CTL_AUTO, + .procname = "countrycode", + .mode = 0444, + .data = &ath_countrycode, + .maxlen = sizeof(ath_countrycode), + .proc_handler = proc_dointvec + }, + { .ctl_name = CTL_AUTO, + .procname = "maxvaps", + .mode = 0444, + .data = &ath_maxvaps, + .maxlen = sizeof(ath_maxvaps), + .proc_handler = proc_dointvec + }, + { .ctl_name = CTL_AUTO, + .procname = "outdoor", + .mode = 0444, + .data = &ath_outdoor, + .maxlen = sizeof(ath_outdoor), + .proc_handler = proc_dointvec + }, + { .ctl_name = CTL_AUTO, + .procname = "xchanmode", + .mode = 0444, + .data = &ath_xchanmode, + .maxlen = sizeof(ath_xchanmode), + .proc_handler = proc_dointvec + }, + { .ctl_name = CTL_AUTO, + .procname = "calibrate", + .mode = 0644, + .data = &ath_calinterval, + .maxlen = sizeof(ath_calinterval), + .extra1 = &mincalibrate, + .extra2 = &maxint, + .proc_handler = proc_dointvec_minmax + }, + { 0 } +}; +static ctl_table ath_ath_table[] = { + { .ctl_name = DEV_ATH, + .procname = "ath", + .mode = 0555, + .child = ath_static_sysctls + }, { 0 } +}; +static ctl_table ath_root_table[] = { + { .ctl_name = CTL_DEV, + .procname = "dev", + .mode = 0555, + .child = ath_ath_table + }, { 0 } +}; +static struct ctl_table_header *ath_sysctl_header; + +void +ath_sysctl_register(void) +{ + static int initialized = 0; + + if (!initialized) { + register_netdevice_notifier(&ath_event_block); + ath_sysctl_header = ATH_REGISTER_SYSCTL_TABLE(ath_root_table); + initialized = 1; + } +} + +void +ath_sysctl_unregister(void) +{ + unregister_netdevice_notifier(&ath_event_block); + if (ath_sysctl_header) + unregister_sysctl_table(ath_sysctl_header); +} + +static const char* +ath_get_hal_status_desc(HAL_STATUS status) +{ + if (status > 0 && status < sizeof(hal_status_desc)/sizeof(char *)) + return hal_status_desc[status]; + else + return ""; +} + +static int +ath_rcv_dev_event(struct notifier_block *this, unsigned long event, + void *ptr) +{ + struct net_device *dev = (struct net_device *) ptr; + struct ath_softc *sc = (struct ath_softc *) dev->priv; + + if (!dev || !sc || dev->open != &ath_init) + return 0; + + switch (event) { + case NETDEV_CHANGENAME: + ath_dynamic_sysctl_unregister(sc); + ath_dynamic_sysctl_register(sc); + return NOTIFY_DONE; + default: + break; + } + return 0; +} diff --git a/plugins/scancode-compiledcode/tests/test_cpp_includes.py b/plugins/scancode-compiledcode/tests/test_cpp_includes.py new file mode 100644 index 00000000000..4cf1aa446f9 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/test_cpp_includes.py @@ -0,0 +1,49 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import print_function + +from collections import OrderedDict +import json +import os + +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click + +from commoncode.testcase import FileBasedTesting + + +class TestScanPluginCPPIncludesScan(FileBasedTesting): + + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_cpp_includes(self): + test_dir = self.get_test_loc('cppincludes') + result_file = self.get_temp_file('json') + args = ['--cpp-includes', test_dir, '--json', result_file] + run_scan_click(args) + test_loc = self.get_test_loc('cppincludes/expected.json') + check_json_scan(test_loc, result_file, regen=False) + diff --git a/plugins/scancode-dwarf/tests/test_dwarf.py b/plugins/scancode-compiledcode/tests/test_dwarf.py similarity index 99% rename from plugins/scancode-dwarf/tests/test_dwarf.py rename to plugins/scancode-compiledcode/tests/test_dwarf.py index 0befa2011cb..d1098c6ff29 100644 --- a/plugins/scancode-dwarf/tests/test_dwarf.py +++ b/plugins/scancode-compiledcode/tests/test_dwarf.py @@ -29,11 +29,11 @@ import json import os +from commoncode.testcase import FileBasedTesting from scancode.cli_test_utils import check_json_scan from scancode.cli_test_utils import run_scan_click -from scandwarf.dwarf import Dwarf -from commoncode.testcase import FileBasedTesting +from dwarf.dwarf import Dwarf class TestDwarf(FileBasedTesting): diff --git a/plugins/scancode-dwarf/tests/test_dwarf2.py b/plugins/scancode-compiledcode/tests/test_dwarf2.py similarity index 99% rename from plugins/scancode-dwarf/tests/test_dwarf2.py rename to plugins/scancode-compiledcode/tests/test_dwarf2.py index 5c30496aea6..8ad07bac0ab 100644 --- a/plugins/scancode-dwarf/tests/test_dwarf2.py +++ b/plugins/scancode-compiledcode/tests/test_dwarf2.py @@ -34,7 +34,7 @@ from commoncode.system import on_mac from commoncode.system import on_windows -from scandwarf import dwarf2 +from dwarf import dwarf2 @skipIf(on_mac, 'Mac is not yet supported: nm needs to be built first') diff --git a/plugins/scancode-dwarf/tests/test_dwarf3.py b/plugins/scancode-compiledcode/tests/test_dwarf3.py similarity index 98% rename from plugins/scancode-dwarf/tests/test_dwarf3.py rename to plugins/scancode-compiledcode/tests/test_dwarf3.py index 7da85b2373d..a2aac6a5f8b 100644 --- a/plugins/scancode-dwarf/tests/test_dwarf3.py +++ b/plugins/scancode-compiledcode/tests/test_dwarf3.py @@ -34,7 +34,7 @@ from commoncode.system import on_mac from commoncode.system import on_windows -import scandwarf +import dwarf @skipIf(on_mac, 'Mac is not yet supported: nm needs to be built first') @@ -43,7 +43,7 @@ class TestDwarf3(FileBasedTesting): def check_dwarf3(self, test_file, expected_file, regen=False): test_loc = self.get_test_loc(test_file, self.test_data_dir, exists=False) - result = list(scandwarf.dwarf_source_path(test_loc)) + result = list(dwarf.dwarf_source_path(test_loc)) expected_loc = self.get_test_loc(expected_file, self.test_data_dir, exists=False) if regen: diff --git a/plugins/scancode-lkmclue/tests/test_elf.py b/plugins/scancode-compiledcode/tests/test_elf.py similarity index 97% rename from plugins/scancode-lkmclue/tests/test_elf.py rename to plugins/scancode-compiledcode/tests/test_elf.py index 61c02e4845d..ce402e3d568 100644 --- a/plugins/scancode-lkmclue/tests/test_elf.py +++ b/plugins/scancode-compiledcode/tests/test_elf.py @@ -45,5 +45,5 @@ def test_elf_needed_library(self): args = ['--elf', test_dir, '--json', result_file] run_scan_click(args) test_loc = self.get_test_loc('elf/expected.json') - check_json_scan(test_loc, result_file, regen=True) + check_json_scan(test_loc, result_file, regen=False) diff --git a/plugins/scancode-compiledcode/tests/test_generatedcode.py b/plugins/scancode-compiledcode/tests/test_generatedcode.py new file mode 100644 index 00000000000..f1979f86168 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/test_generatedcode.py @@ -0,0 +1,49 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import print_function + +from collections import OrderedDict +import json +import os + +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click + +from commoncode.testcase import FileBasedTesting + + +class TestScanPluginMakedependScan(FileBasedTesting): + + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_genrated_code_scan(self): + test_dir = self.get_test_loc('generatedcode/input') + result_file = self.get_temp_file('json') + args = ['--generatedcode', test_dir, '--json', result_file] + run_scan_click(args) + test_loc = self.get_test_loc('generatedcode/expected.json') + check_json_scan(test_loc, result_file, regen=False) + diff --git a/plugins/scancode-lkmclue/src/sourcecode/__init__.py b/plugins/scancode-compiledcode/tests/test_gwt.py similarity index 64% rename from plugins/scancode-lkmclue/src/sourcecode/__init__.py rename to plugins/scancode-compiledcode/tests/test_gwt.py index b447b1cf876..cb973394089 100644 --- a/plugins/scancode-lkmclue/src/sourcecode/__init__.py +++ b/plugins/scancode-compiledcode/tests/test_gwt.py @@ -22,3 +22,28 @@ # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. +from __future__ import absolute_import +from __future__ import print_function + +from collections import OrderedDict +import json +import os + +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click + +from commoncode.testcase import FileBasedTesting + + +class TestScanPluginGWTScan(FileBasedTesting): + + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_gwt_scan(self): + test_dir = self.get_test_loc('gwt') + result_file = self.get_temp_file('json') + args = ['--gwt', test_dir, '--json', result_file] + run_scan_click(args) + test_loc = self.get_test_loc('gwt/expected.json') + check_json_scan(test_loc, result_file, regen=False) + diff --git a/plugins/scancode-compiledcode/tests/test_javaclass.py b/plugins/scancode-compiledcode/tests/test_javaclass.py new file mode 100644 index 00000000000..76b6938d06c --- /dev/null +++ b/plugins/scancode-compiledcode/tests/test_javaclass.py @@ -0,0 +1,49 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import print_function + +from collections import OrderedDict +import json +import os + +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click + +from commoncode.testcase import FileBasedTesting + + +class TestScanPluginJavaClassScan(FileBasedTesting): + + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_javaclass_scan(self): + test_dir = self.get_test_loc('javaclass') + result_file = self.get_temp_file('json') + args = ['--javaclass', test_dir, '--json', result_file] + run_scan_click(args) + test_loc = self.get_test_loc('javaclass/expected.json') + check_json_scan(test_loc, result_file, regen=False) + diff --git a/plugins/scancode-lkmclue/tests/test_lkmclue.py b/plugins/scancode-compiledcode/tests/test_lkmclue.py similarity index 100% rename from plugins/scancode-lkmclue/tests/test_lkmclue.py rename to plugins/scancode-compiledcode/tests/test_lkmclue.py diff --git a/plugins/scancode-compiledcode/tests/test_makedepend.py b/plugins/scancode-compiledcode/tests/test_makedepend.py new file mode 100644 index 00000000000..4bcae6c57f5 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/test_makedepend.py @@ -0,0 +1,49 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import print_function + +from collections import OrderedDict +import json +import os + +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click + +from commoncode.testcase import FileBasedTesting + + +class TestScanPluginMakedependScan(FileBasedTesting): + + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_makedepend(self): + test_dir = self.get_test_loc('makedepend') + result_file = self.get_temp_file('json') + args = ['--makedepend', test_dir, '--json', result_file] + run_scan_click(args) + test_loc = self.get_test_loc('makedepend/expected.json') + check_json_scan(test_loc, result_file, regen=False) + diff --git a/plugins/scancode-compiledcode/tests/test_sourcecode.py b/plugins/scancode-compiledcode/tests/test_sourcecode.py new file mode 100644 index 00000000000..0f65015d079 --- /dev/null +++ b/plugins/scancode-compiledcode/tests/test_sourcecode.py @@ -0,0 +1,49 @@ +# +# Copyright (c) 2019 nexB Inc. and others. All rights reserved. +# http://nexb.com and https://github.com/nexB/scancode-toolkit/ +# The ScanCode software is licensed under the Apache License version 2.0. +# Data generated with ScanCode require an acknowledgment. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://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. +# +# When you publish or redistribute any data created with ScanCode or any ScanCode +# derivative work, you must accompany this data with the following acknowledgment: +# +# Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# ScanCode is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode-toolkit/ for support and download. + +from __future__ import absolute_import +from __future__ import print_function + +from collections import OrderedDict +import json +import os + +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click + +from commoncode.testcase import FileBasedTesting + + +class TestCodeCommentLinesScan(FileBasedTesting): + + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_codecommentlines(self): + test_dir = self.get_test_loc('sourcecode/input') + result_file = self.get_temp_file('json') + args = ['--codecommentlines', test_dir, '--json', result_file] + run_scan_click(args) + test_loc = self.get_test_loc('sourcecode/expected.json') + check_json_scan(test_loc, result_file, regen=False) + diff --git a/plugins/scancode-dwarf/README.md b/plugins/scancode-dwarf/README.md deleted file mode 100644 index cd941f9ee06..00000000000 --- a/plugins/scancode-dwarf/README.md +++ /dev/null @@ -1,9 +0,0 @@ -A ScanCode scan plugin to find dwarf source info. - -To start the test case, please run: -1. ./configure -2. source bin/activate -3. pip install -e plugins/scancode-dwarfdump-manylinux1_x86_64 -e plugins/scancode-dwarf -4. pytest -vvs plugins/scancode-dwarf/tests/test_dwarf.py - -Note that in step3, the path depends on your OS versions, please update according to your real os enviroment. \ No newline at end of file diff --git a/plugins/scancode-dwarf/setup.py b/plugins/scancode-dwarf/setup.py deleted file mode 100644 index ab99c3382bb..00000000000 --- a/plugins/scancode-dwarf/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -*- encoding: utf-8 -*- - -from __future__ import absolute_import -from __future__ import print_function - -from glob import glob -from os.path import basename -from os.path import join -from os.path import splitext - -from setuptools import find_packages -from setuptools import setup - - -desc = '''A ScanCode scan plugin to get dwarf info.''' - -setup( - name='scancode-dwarf', - version='1.0.0', - license='Apache-2.0 with ScanCode acknowledgment', - description=desc, - long_description=desc, - author='nexB', - author_email='info@aboutcode.org', - url='https://github.com/nexB/scancode-toolkit/plugins/scancode-dwarf', - packages=find_packages('src'), - package_dir={'': 'src'}, - py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')], - include_package_data=True, - zip_safe=False, - classifiers=[ - # complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Topic :: Utilities', - ], - keywords=[ - 'open source', 'scancode', 'dwarf' - ], - install_requires=[ - 'scancode-toolkit', - 'attr', - 'scancode-dwarfdump', - ], - entry_points={ - 'scancode_scan': [ - 'scancode-dwarf = scandwarf:DwarfScanner', - ], - } - - -) diff --git a/plugins/scancode-dwarfdump-win32/README.md b/plugins/scancode-dwarfdump-win32/README.md index 614fe74b2d9..3c3ab0d6e31 100644 --- a/plugins/scancode-dwarfdump-win32/README.md +++ b/plugins/scancode-dwarfdump-win32/README.md @@ -1 +1 @@ -A scanCode plugin to provide binaries of dwarf command \ No newline at end of file +A ScanCode plugin to provide binaries of dwarf command diff --git a/plugins/scancode-lkmclue/.gitignore b/plugins/scancode-lkmclue/.gitignore deleted file mode 100644 index e2cae228c89..00000000000 --- a/plugins/scancode-lkmclue/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build/ -/dist/ diff --git a/plugins/scancode-lkmclue/NOTICE b/plugins/scancode-lkmclue/NOTICE deleted file mode 100644 index edd8b6b075b..00000000000 --- a/plugins/scancode-lkmclue/NOTICE +++ /dev/null @@ -1,25 +0,0 @@ -Software license -================ - -Copyright (c) 2019 nexB Inc. and others. All rights reserved. -http://nexb.com and https://github.com/nexB/scancode-toolkit/ -The ScanCode software is licensed under the Apache License version 2.0. -Data generated with ScanCode require an acknowledgment. -ScanCode is a trademark of nexB Inc. - -You may not use this software except in compliance with the License. -You may obtain a copy of the License at: http://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. - -When you publish or redistribute any data created with ScanCode or any ScanCode -derivative work, you must accompany this data with the following acknowledgment: - - Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES - OR CONDITIONS OF ANY KIND, either express or implied. No content created from - ScanCode should be considered or used as legal advice. Consult an Attorney - for any legal advice. - ScanCode is a free software code scanning tool from nexB Inc. and others. - Visit https://github.com/nexB/scancode-toolkit/ for support and download. diff --git a/plugins/scancode-lkmclue/README.md b/plugins/scancode-lkmclue/README.md deleted file mode 100644 index d1db4ba25e6..00000000000 --- a/plugins/scancode-lkmclue/README.md +++ /dev/null @@ -1,10 +0,0 @@ -A ScanCode scan plugin to find lkmclue source info. - -To start the test case, please run: -1. ./configure -2. source bin/activate -3. pip install -e plugins/scancode-ctags-manylinux1_x86_64 -e plugins/scancode-readelf-manylinux1_x86_64 -e plugins/scancode-lkmclue -4. pytest -vvs plugins/scancode-lkmclue/tests/test_lkmclue.py - pytest -vvs plugins/scancode-lkmclue/tests/test_elf.py - -Note that in step3, the path depends on your OS versions, please update according to your real os enviroment. \ No newline at end of file diff --git a/plugins/scancode-lkmclue/apache-2.0.LICENSE b/plugins/scancode-lkmclue/apache-2.0.LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/plugins/scancode-lkmclue/apache-2.0.LICENSE +++ /dev/null @@ -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. diff --git a/plugins/scancode-lkmclue/setup.cfg b/plugins/scancode-lkmclue/setup.cfg deleted file mode 100644 index 917cf1e0f0d..00000000000 --- a/plugins/scancode-lkmclue/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[metadata] -license_file = NOTICE - -[bdist_wheel] -universal = 1 - -[aliases] -release = clean --all bdist_wheel diff --git a/src/cluecode/finder.py b/src/cluecode/finder.py index 792a361751c..f1ba559e56a 100644 --- a/src/cluecode/finder.py +++ b/src/cluecode/finder.py @@ -385,7 +385,7 @@ def canonical_url(uri): parsed = urlpy.parse(uri) if not parsed: return - + if py2: if not hasattr(parsed, '_scheme') or not hasattr(parsed, '_host'): raise Exception('a') @@ -393,19 +393,19 @@ def canonical_url(uri): else: if not hasattr(parsed, 'scheme') or not hasattr(parsed, 'host'): raise Exception('b') - if TRACE: + if TRACE: logger_debug('canonical_url: parsed:', parsed) - + sanitized = parsed.sanitize() - + if TRACE: logger_debug('canonical_url: sanitized:', sanitized) - + punycoded = sanitized.punycode() - + if TRACE: logger_debug('canonical_url: punycoded:', punycoded) - + if py2: if punycoded._port == DEFAULT_PORTS.get(punycoded._scheme): punycoded._port = None diff --git a/src/extractcode/uncompress.py b/src/extractcode/uncompress.py index 612a06c372a..4b23f7a588a 100644 --- a/src/extractcode/uncompress.py +++ b/src/extractcode/uncompress.py @@ -113,7 +113,7 @@ def uncompress_gzip(location, target_dir): Uncompress a gzip compressed file at location in the target_dir. Return a list warnings messages. """ - + return uncompress(location, target_dir, GzipFileWithTrailing) diff --git a/src/formattedcode/output_csv.py b/src/formattedcode/output_csv.py index acb1249826b..bde506a8ead 100644 --- a/src/formattedcode/output_csv.py +++ b/src/formattedcode/output_csv.py @@ -128,9 +128,8 @@ def collect_keys(mapping, key_group): for scanned_file in scan: path = scanned_file.pop('path') - # alway use a root slash - if not path.startswith('/'): - path = '/' + path + # removing any slash at the begening of the path + path = path.lstrip('/') # use a trailing slash for directories if scanned_file.get('type') == 'directory' and not path.endswith('/'): @@ -236,7 +235,7 @@ def pretty(data): maptypes = OrderedDict, dict coltypes = seqtypes + maptypes if isinstance(data, seqtypes): - if len(data) ==1 and isinstance(data[0], string_types): + if len(data) == 1 and isinstance(data[0], string_types): return data[0].strip() if isinstance(data, coltypes): return saneyaml.dump( diff --git a/src/licensedcode/data/licenses/fsf-mit.LICENSE b/src/licensedcode/data/licenses/fsf-unlimited-no-warranty.LICENSE similarity index 100% rename from src/licensedcode/data/licenses/fsf-mit.LICENSE rename to src/licensedcode/data/licenses/fsf-unlimited-no-warranty.LICENSE diff --git a/src/licensedcode/data/licenses/fsf-mit.yml b/src/licensedcode/data/licenses/fsf-unlimited-no-warranty.yml similarity index 58% rename from src/licensedcode/data/licenses/fsf-mit.yml rename to src/licensedcode/data/licenses/fsf-unlimited-no-warranty.yml index 88d14780046..aaad67c646e 100644 --- a/src/licensedcode/data/licenses/fsf-mit.yml +++ b/src/licensedcode/data/licenses/fsf-unlimited-no-warranty.yml @@ -1,6 +1,6 @@ -key: fsf-mit -short_name: FSF-MIT -name: Free Software Foundation - MIT Style License +key: fsf-unlimited-no-warranty +short_name: FSF-Unlimited-No-Warranty +name: FSF Unlimited License (With License Retention) No Warranty category: Permissive owner: Free Software Foundation (FSF) homepage_url: http://www.fsf.org/licensing/licenses/ diff --git a/src/licensedcode/data/licenses/json-pd.LICENSE b/src/licensedcode/data/licenses/json-pd.LICENSE index 38dd05a96db..b3c378c2c61 100644 --- a/src/licensedcode/data/licenses/json-pd.LICENSE +++ b/src/licensedcode/data/licenses/json-pd.LICENSE @@ -1,6 +1,3 @@ -json2.js - 2011-10-19 - Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. diff --git a/src/licensedcode/data/licenses/postgresql.LICENSE b/src/licensedcode/data/licenses/postgresql.LICENSE index 698b2698998..0ed1c43bc21 100644 --- a/src/licensedcode/data/licenses/postgresql.LICENSE +++ b/src/licensedcode/data/licenses/postgresql.LICENSE @@ -7,8 +7,18 @@ Portions Copyright (c) The PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California -Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose, without fee, and without a written agreement is +hereby granted, provided that the above copyright notice and this paragraph and +the following two paragraphs appear in all copies. -IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST +PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF +THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. \ No newline at end of file +THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND +THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, +UPDATES, ENHANCEMENTS, OR MODIFICATIONS. \ No newline at end of file diff --git a/src/licensedcode/data/rules/agpl-3.0_100.RULE b/src/licensedcode/data/rules/agpl-3.0_100.RULE new file mode 100644 index 00000000000..b7d8ddd731e --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_100.RULE @@ -0,0 +1 @@ +plupload \ No newline at end of file diff --git a/src/licensedcode/data/rules/agpl-3.0_100.yml b/src/licensedcode/data/rules/agpl-3.0_100.yml new file mode 100644 index 00000000000..6dd3d3a550e --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_100.yml @@ -0,0 +1,3 @@ +license_expression: agpl-3.0 +is_license_reference: yes +relevance: 80 diff --git a/src/licensedcode/data/rules/agpl-3.0_99.RULE b/src/licensedcode/data/rules/agpl-3.0_99.RULE new file mode 100644 index 00000000000..1c13b69f713 --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_99.RULE @@ -0,0 +1 @@ +Released under AGPL-3.0 License. \ No newline at end of file diff --git a/src/licensedcode/data/rules/agpl-3.0_99.yml b/src/licensedcode/data/rules/agpl-3.0_99.yml new file mode 100644 index 00000000000..b6548eaf117 --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_99.yml @@ -0,0 +1,3 @@ +license_expression: agpl-3.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_2.RULE b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_2.RULE new file mode 100644 index 00000000000..369e204360d --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_2.RULE @@ -0,0 +1,5 @@ +Released under AGPL-3.0 License. + +We also provide commercial license. + + * License: http://www.plupload.com/license \ No newline at end of file diff --git a/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_2.yml b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_2.yml new file mode 100644 index 00000000000..5a684cd1b13 --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_2.yml @@ -0,0 +1,5 @@ +license_expression: agpl-3.0 OR commercial-license +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.plupload.com/license diff --git a/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_3.RULE b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_3.RULE new file mode 100644 index 00000000000..589cab9e392 --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_3.RULE @@ -0,0 +1 @@ +* License: http://www.plupload.com/license \ No newline at end of file diff --git a/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_3.yml b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_3.yml new file mode 100644 index 00000000000..5a684cd1b13 --- /dev/null +++ b/src/licensedcode/data/rules/agpl-3.0_or_commercial-license_3.yml @@ -0,0 +1,5 @@ +license_expression: agpl-3.0 OR commercial-license +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.plupload.com/license diff --git a/src/licensedcode/data/rules/apache-2.0_308.RULE b/src/licensedcode/data/rules/apache-2.0_308.RULE new file mode 100644 index 00000000000..c2a82409625 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_308.RULE @@ -0,0 +1 @@ +distributed under the Apache 2 license; the text of this license can be found in the LICENSE file. \ No newline at end of file diff --git a/src/licensedcode/data/rules/apache-2.0_308.yml b/src/licensedcode/data/rules/apache-2.0_308.yml new file mode 100644 index 00000000000..d892e977716 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_308.yml @@ -0,0 +1,5 @@ +license_expression: apache-2.0 +is_license_notice: yes +relevance: 100 +referenced_filenames: + - LICENSE diff --git a/src/licensedcode/data/rules/apache-2.0_309.RULE b/src/licensedcode/data/rules/apache-2.0_309.RULE new file mode 100644 index 00000000000..0b784ec52bb --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_309.RULE @@ -0,0 +1,3 @@ +License +licensed under the +[Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0.html). \ No newline at end of file diff --git a/src/licensedcode/data/rules/apache-2.0_309.yml b/src/licensedcode/data/rules/apache-2.0_309.yml new file mode 100644 index 00000000000..f4be30dcf09 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_309.yml @@ -0,0 +1,5 @@ +license_expression: apache-2.0 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/src/licensedcode/data/rules/apache-2.0_310.RULE b/src/licensedcode/data/rules/apache-2.0_310.RULE new file mode 100644 index 00000000000..cd0349abb9a --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_310.RULE @@ -0,0 +1,2 @@ +licensed under the +[Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0.html). \ No newline at end of file diff --git a/src/licensedcode/data/rules/apache-2.0_310.yml b/src/licensedcode/data/rules/apache-2.0_310.yml new file mode 100644 index 00000000000..f4be30dcf09 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_310.yml @@ -0,0 +1,5 @@ +license_expression: apache-2.0 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/src/licensedcode/data/rules/apache-2.0_311.RULE b/src/licensedcode/data/rules/apache-2.0_311.RULE new file mode 100644 index 00000000000..5218f5b71b2 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_311.RULE @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/licensedcode/data/rules/apache-2.0_311.yml b/src/licensedcode/data/rules/apache-2.0_311.yml new file mode 100644 index 00000000000..cb93143f8db --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_311.yml @@ -0,0 +1,5 @@ +license_expression: apache-2.0 +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/src/licensedcode/data/rules/apache-2.0_312.RULE b/src/licensedcode/data/rules/apache-2.0_312.RULE new file mode 100644 index 00000000000..bd3dae50b62 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_312.RULE @@ -0,0 +1 @@ +subcomponent licensed under the Apache License 2.0. \ No newline at end of file diff --git a/src/licensedcode/data/rules/apache-2.0_312.yml b/src/licensedcode/data/rules/apache-2.0_312.yml new file mode 100644 index 00000000000..fec9233bc17 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_312.yml @@ -0,0 +1,3 @@ +license_expression: apache-2.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/apache-2.0_313.RULE b/src/licensedcode/data/rules/apache-2.0_313.RULE new file mode 100644 index 00000000000..8fc64149e6f --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_313.RULE @@ -0,0 +1 @@ +licensed under the Apache License 2.0. \ No newline at end of file diff --git a/src/licensedcode/data/rules/apache-2.0_313.yml b/src/licensedcode/data/rules/apache-2.0_313.yml new file mode 100644 index 00000000000..fec9233bc17 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_313.yml @@ -0,0 +1,3 @@ +license_expression: apache-2.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/apache-2.0_and_other-permissive_1.RULE b/src/licensedcode/data/rules/apache-2.0_and_other-permissive_1.RULE new file mode 100644 index 00000000000..a463afea605 --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_and_other-permissive_1.RULE @@ -0,0 +1,3 @@ +Mostly licensed under the Apache License 2.0, but subprojects may use different licensing. + See https://github.com/CindyJS/CindyJS/tree/$gitid$ + for corresponding sources and their respective licensing conditions. \ No newline at end of file diff --git a/src/licensedcode/data/rules/apache-2.0_and_other-permissive_1.yml b/src/licensedcode/data/rules/apache-2.0_and_other-permissive_1.yml new file mode 100644 index 00000000000..49c8c3bbf0f --- /dev/null +++ b/src/licensedcode/data/rules/apache-2.0_and_other-permissive_1.yml @@ -0,0 +1,5 @@ +license_expression: apache-2.0 AND other-permissive +is_license_notice: yes +relevance: 95 +ignorable_urls: + - https://github.com/CindyJS/CindyJS/tree/$gitid diff --git a/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_7.yml b/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_7.yml index 829a7c164c7..156339a4264 100644 --- a/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_7.yml +++ b/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_7.yml @@ -1,2 +1,4 @@ license_expression: artistic-perl-1.0 OR gpl-1.0-plus is_license_notice: yes +referenced_filenames: + - README diff --git a/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_and_bsd-new_1.RULE b/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_and_bsd-new_1.RULE new file mode 100644 index 00000000000..0bf7069c7b4 --- /dev/null +++ b/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_and_bsd-new_1.RULE @@ -0,0 +1,3 @@ +License: Perl / BSD + This module is free software; you may redistribute it and/or + modify it under the same terms as Perl itself. \ No newline at end of file diff --git a/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_and_bsd-new_1.yml b/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_and_bsd-new_1.yml new file mode 100644 index 00000000000..d79b7b9ab45 --- /dev/null +++ b/src/licensedcode/data/rules/artistic-perl-1.0_or_gpl-1.0-plus_and_bsd-new_1.yml @@ -0,0 +1,3 @@ +license_expression: (artistic-perl-1.0 OR gpl-1.0-plus) AND bsd-new +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/artistic_and_bsd-new.yml b/src/licensedcode/data/rules/artistic_and_bsd-new.yml index c829975a1b7..e817c03dfe3 100644 --- a/src/licensedcode/data/rules/artistic_and_bsd-new.yml +++ b/src/licensedcode/data/rules/artistic_and_bsd-new.yml @@ -1,2 +1,4 @@ -license_expression: artistic-2.0 AND bsd-new +license_expression: (artistic-perl-1.0 OR gpl-1.0-plus) AND bsd-new +relevance: 90 is_license_tag: yes + diff --git a/src/licensedcode/data/rules/boost-1.0_18.RULE b/src/licensedcode/data/rules/boost-1.0_18.RULE new file mode 100644 index 00000000000..dcc23608741 --- /dev/null +++ b/src/licensedcode/data/rules/boost-1.0_18.RULE @@ -0,0 +1,3 @@ +License: + Use, modification & distribution is subject to Boost Software License Ver 1. + http://www.boost.org/LICENSE_1_0.txt \ No newline at end of file diff --git a/src/licensedcode/data/rules/boost-1.0_18.yml b/src/licensedcode/data/rules/boost-1.0_18.yml new file mode 100644 index 00000000000..93113bae8ef --- /dev/null +++ b/src/licensedcode/data/rules/boost-1.0_18.yml @@ -0,0 +1,5 @@ +license_expression: boost-1.0 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.boost.org/LICENSE_1_0.txt diff --git a/src/licensedcode/data/rules/boost-1.0_19.RULE b/src/licensedcode/data/rules/boost-1.0_19.RULE new file mode 100644 index 00000000000..5a0ce8a35f1 --- /dev/null +++ b/src/licensedcode/data/rules/boost-1.0_19.RULE @@ -0,0 +1,2 @@ +Use, modification & distribution is subject to Boost Software License Ver 1. + http://www.boost.org/LICENSE_1_0.txt \ No newline at end of file diff --git a/src/licensedcode/data/rules/boost-1.0_19.yml b/src/licensedcode/data/rules/boost-1.0_19.yml new file mode 100644 index 00000000000..93113bae8ef --- /dev/null +++ b/src/licensedcode/data/rules/boost-1.0_19.yml @@ -0,0 +1,5 @@ +license_expression: boost-1.0 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.boost.org/LICENSE_1_0.txt diff --git a/src/licensedcode/data/rules/boost-1.0_20.RULE b/src/licensedcode/data/rules/boost-1.0_20.RULE new file mode 100644 index 00000000000..ce4eb86e594 --- /dev/null +++ b/src/licensedcode/data/rules/boost-1.0_20.RULE @@ -0,0 +1 @@ +Use, modification & distribution is subject to Boost Software License Ver 1. \ No newline at end of file diff --git a/src/licensedcode/data/rules/boost-1.0_20.yml b/src/licensedcode/data/rules/boost-1.0_20.yml new file mode 100644 index 00000000000..4cfb24fc84f --- /dev/null +++ b/src/licensedcode/data/rules/boost-1.0_20.yml @@ -0,0 +1,3 @@ +license_expression: boost-1.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_484.RULE b/src/licensedcode/data/rules/bsd-new_484.RULE new file mode 100644 index 00000000000..8e82cee2ff8 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_484.RULE @@ -0,0 +1,25 @@ +Redistribution and use in source and binary forms, with or without modification, are +permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + * Neither the name of the SimplePie Team nor the names of its contributors may be used + to endorse or promote products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS +AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +@license http://www.opensource.org/licenses/bsd-license.php BSD License \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_484.yml b/src/licensedcode/data/rules/bsd-new_484.yml new file mode 100644 index 00000000000..81fa965c748 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_484.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-new_485.RULE b/src/licensedcode/data/rules/bsd-new_485.RULE new file mode 100644 index 00000000000..1a3f1e6810d --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_485.RULE @@ -0,0 +1,9 @@ +* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://www.opensource.org/licenses/bsd-license.php \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_485.yml b/src/licensedcode/data/rules/bsd-new_485.yml new file mode 100644 index 00000000000..81fa965c748 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_485.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-new_486.RULE b/src/licensedcode/data/rules/bsd-new_486.RULE new file mode 100644 index 00000000000..741666a66de --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_486.RULE @@ -0,0 +1,11 @@ +* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://www.opensource.org/licenses/bsd-license.php + * + * See scriptaculous.js for full scriptaculous licence \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_486.yml b/src/licensedcode/data/rules/bsd-new_486.yml new file mode 100644 index 00000000000..81fa965c748 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_486.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-new_487.RULE b/src/licensedcode/data/rules/bsd-new_487.RULE new file mode 100644 index 00000000000..332b686add5 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_487.RULE @@ -0,0 +1,3 @@ +* http://www.opensource.org/licenses/bsd-license.php + * + * See scriptaculous.js for full scriptaculous licence \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_487.yml b/src/licensedcode/data/rules/bsd-new_487.yml new file mode 100644 index 00000000000..61e08468ac4 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_487.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-new_488.RULE b/src/licensedcode/data/rules/bsd-new_488.RULE new file mode 100644 index 00000000000..9cb08f55012 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_488.RULE @@ -0,0 +1 @@ +* See scriptaculous.js for full scriptaculous licence \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_488.yml b/src/licensedcode/data/rules/bsd-new_488.yml new file mode 100644 index 00000000000..21c2892de50 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_488.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/bsd-new_489.RULE b/src/licensedcode/data/rules/bsd-new_489.RULE new file mode 100644 index 00000000000..c7395a1b94a --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_489.RULE @@ -0,0 +1 @@ +Original License : BSD \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_489.yml b/src/licensedcode/data/rules/bsd-new_489.yml new file mode 100644 index 00000000000..21c2892de50 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_489.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/bsd-new_490.RULE b/src/licensedcode/data/rules/bsd-new_490.RULE new file mode 100644 index 00000000000..e8927db1417 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_490.RULE @@ -0,0 +1,25 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the Team nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/fsf-mit_4.yml b/src/licensedcode/data/rules/bsd-new_490.yml similarity index 56% rename from src/licensedcode/data/rules/fsf-mit_4.yml rename to src/licensedcode/data/rules/bsd-new_490.yml index ce7c8c3cd26..646f0f05a97 100644 --- a/src/licensedcode/data/rules/fsf-mit_4.yml +++ b/src/licensedcode/data/rules/bsd-new_490.yml @@ -1,3 +1,3 @@ -license_expression: fsf-mit +license_expression: bsd-new is_license_text: yes relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_491.RULE b/src/licensedcode/data/rules/bsd-new_491.RULE new file mode 100644 index 00000000000..3102594afb9 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_491.RULE @@ -0,0 +1,23 @@ +Redistribution and use in source and binary forms, with or without modification, are + permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + * Neither the name of the SimplePie Team nor the names of its contributors may be used + to endorse or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS + AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_491.yml b/src/licensedcode/data/rules/bsd-new_491.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_491.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_492.RULE b/src/licensedcode/data/rules/bsd-new_492.RULE new file mode 100644 index 00000000000..a43e25c5706 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_492.RULE @@ -0,0 +1,8 @@ +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. + + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_492.yml b/src/licensedcode/data/rules/bsd-new_492.yml new file mode 100644 index 00000000000..67d99f838ff --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_492.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_493.RULE b/src/licensedcode/data/rules/bsd-new_493.RULE new file mode 100644 index 00000000000..55164430ca4 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_493.RULE @@ -0,0 +1,24 @@ +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_493.yml b/src/licensedcode/data/rules/bsd-new_493.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_493.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_494.RULE b/src/licensedcode/data/rules/bsd-new_494.RULE new file mode 100644 index 00000000000..e3a22cbd4aa --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_494.RULE @@ -0,0 +1,3 @@ +Update modules from + the NetBSD source tree (the old 4-clause BSD license changed to + the new 3-clause one). \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_494.yml b/src/licensedcode/data/rules/bsd-new_494.yml new file mode 100644 index 00000000000..e55e499970e --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_494.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_notice: yes +relevance: 99 diff --git a/src/licensedcode/data/rules/bsd-new_495.RULE b/src/licensedcode/data/rules/bsd-new_495.RULE new file mode 100644 index 00000000000..5862dfcb380 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_495.RULE @@ -0,0 +1,2 @@ +is now covered by a modified BSD license. See LICENSE +for the new terms. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_495.yml b/src/licensedcode/data/rules/bsd-new_495.yml new file mode 100644 index 00000000000..fb32e3c94a3 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_495.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_notice: yes +relevance: 90 +referenced_filenames: + - LICENSE diff --git a/src/licensedcode/data/rules/bsd-new_496.RULE b/src/licensedcode/data/rules/bsd-new_496.RULE new file mode 100644 index 00000000000..f034e4122c7 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_496.RULE @@ -0,0 +1,29 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with + the distribution. + + * Neither the name of nor the names of + any other contributors to this software may be used to endorse or + promote products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_496.yml b/src/licensedcode/data/rules/bsd-new_496.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_496.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_497.RULE b/src/licensedcode/data/rules/bsd-new_497.RULE new file mode 100644 index 00000000000..8b542b9789b --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_497.RULE @@ -0,0 +1,24 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * The name of Contributor may not used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_497.yml b/src/licensedcode/data/rules/bsd-new_497.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_497.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_498.RULE b/src/licensedcode/data/rules/bsd-new_498.RULE new file mode 100644 index 00000000000..2d914d76924 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_498.RULE @@ -0,0 +1 @@ +Distributed under the BSD 3-clause License, \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_498.yml b/src/licensedcode/data/rules/bsd-new_498.yml new file mode 100644 index 00000000000..67d99f838ff --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_498.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_499.RULE b/src/licensedcode/data/rules/bsd-new_499.RULE new file mode 100644 index 00000000000..19ab1641d99 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_499.RULE @@ -0,0 +1,25 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + Neither the name of NVIDIA Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_499.yml b/src/licensedcode/data/rules/bsd-new_499.yml new file mode 100644 index 00000000000..1940635e96d --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_499.yml @@ -0,0 +1,2 @@ +license_expression: bsd-new +is_license_text: yes diff --git a/src/licensedcode/data/rules/bsd-new_500.RULE b/src/licensedcode/data/rules/bsd-new_500.RULE new file mode 100644 index 00000000000..bb68d510d41 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_500.RULE @@ -0,0 +1,23 @@ +Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistribution's of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistribution's in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of the copyright holders may not be used to endorse or promote products + derived from this software without specific prior written permission. + + This software is provided by the copyright holders and contributors "as is" and + any express or implied warranties, including, but not limited to, the implied + warranties of merchantability and fitness for a particular purpose are disclaimed. + In no event shall the OpenCV Foundation or contributors be liable for any direct, + indirect, incidental, special, exemplary, or consequential damages + (including, but not limited to, procurement of substitute goods or services; + loss of use, data, or profits; or business interruption) however caused + and on any theory of liability, whether in contract, strict liability, + or tort (including negligence or otherwise) arising in any way out of + the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_500.yml b/src/licensedcode/data/rules/bsd-new_500.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_500.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_501.RULE b/src/licensedcode/data/rules/bsd-new_501.RULE new file mode 100644 index 00000000000..d59727eee31 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_501.RULE @@ -0,0 +1,3 @@ +This file is part of OpenCV project. + It is subject to the license terms in the LICENSE file found in the top-level directory + of this distribution and at http://opencv.org/license.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_501.yml b/src/licensedcode/data/rules/bsd-new_501.yml new file mode 100644 index 00000000000..81e1345ee83 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_501.yml @@ -0,0 +1,7 @@ +license_expression: bsd-new +is_license_notice: yes +relevance: 100 +referenced_filenames: + - LICENSE +ignorable_urls: + - http://opencv.org/license.html diff --git a/src/licensedcode/data/rules/bsd-new_502.RULE b/src/licensedcode/data/rules/bsd-new_502.RULE new file mode 100644 index 00000000000..3c659db1594 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_502.RULE @@ -0,0 +1,2 @@ +This file is based on files from packages softfloat and fdlibm +issued with the following licenses: \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_502.yml b/src/licensedcode/data/rules/bsd-new_502.yml new file mode 100644 index 00000000000..3c43e265100 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_502.yml @@ -0,0 +1,4 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 99 +minimum_coverage: 100 diff --git a/src/licensedcode/data/rules/bsd-new_503.RULE b/src/licensedcode/data/rules/bsd-new_503.RULE new file mode 100644 index 00000000000..dd199e8cb27 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_503.RULE @@ -0,0 +1,23 @@ +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistribution's of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistribution's in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of the copyright holders may not be used to endorse or promote products + derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors as is and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall the Intel Corporation or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_503.yml b/src/licensedcode/data/rules/bsd-new_503.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_503.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_504.RULE b/src/licensedcode/data/rules/bsd-new_504.RULE new file mode 100644 index 00000000000..fc475fde4e9 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_504.RULE @@ -0,0 +1,25 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistribution's of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistribution's in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of Intel Corporation or contributors may not be used to endorse + or promote products derived from this software without specific + prior written permission. + +This software is provided by the copyright holders and contributors "as is" +and any express or implied warranties, including, but not limited to, the +implied warranties of merchantability and fitness for a particular purpose +are disclaimed. In no event shall the Intel Corporation or contributors be +liable for any direct, indirect, incidental, special, exemplary, or +consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_504.yml b/src/licensedcode/data/rules/bsd-new_504.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_504.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_505.RULE b/src/licensedcode/data/rules/bsd-new_505.RULE new file mode 100644 index 00000000000..4db4564e59a --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_505.RULE @@ -0,0 +1,35 @@ +IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. + + By downloading, copying, installing or using the software you agree to this license. + If you do not agree to this license, do not download, install, + copy or use the software. + + + Intel License Agreement + +Copyright (C) Intel Corporation, all rights reserved. +Third party copyrights are property of their respective owners. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistribution's of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistribution's in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of Intel Corporation may not be used to endorse or promote products + derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall the Intel Corporation or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_505.yml b/src/licensedcode/data/rules/bsd-new_505.yml new file mode 100644 index 00000000000..b35b5c4f92b --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_505.yml @@ -0,0 +1,7 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 +ignorable_copyrights: + - Copyright (c) Intel Corporation +ignorable_holders: + - Intel Corporation diff --git a/src/licensedcode/data/rules/bsd-new_506.RULE b/src/licensedcode/data/rules/bsd-new_506.RULE new file mode 100644 index 00000000000..a5823fc1567 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_506.RULE @@ -0,0 +1,23 @@ +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistribution's of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistribution's in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of the copyright holders may not be used to endorse or promote products + derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors as is and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall the copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_506.yml b/src/licensedcode/data/rules/bsd-new_506.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_506.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_507.RULE b/src/licensedcode/data/rules/bsd-new_507.RULE new file mode 100644 index 00000000000..0819b5bde2d --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_507.RULE @@ -0,0 +1,8 @@ +IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. + + By downloading, copying, installing or using the software you agree to this license. + If you do not agree to this license, do not download, install, + copy or use the software. + + License Agreement + For Open Source Computer Vision Library \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_507.yml b/src/licensedcode/data/rules/bsd-new_507.yml new file mode 100644 index 00000000000..21c2892de50 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_507.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/bsd-new_508.RULE b/src/licensedcode/data/rules/bsd-new_508.RULE new file mode 100644 index 00000000000..bb83244bf8d --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_508.RULE @@ -0,0 +1,23 @@ +Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistribution's of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistribution's in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of the copyright holders may not be used to endorse or promote products + derived from this software without specific prior written permission. + + This software is provided by the copyright holders and contributors "as is" and + any express or implied warranties, including, but not limited to, the implied + warranties of merchantability and fitness for a particular purpose are disclaimed. + In no event shall the contributor be liable for any direct, + indirect, incidental, special, exemplary, or consequential damages + (including, but not limited to, procurement of substitute goods or services; + loss of use, data, or profits; or business interruption) however caused + and on any theory of liability, whether in contract, strict liability, + or tort (including negligence or otherwise) arising in any way out of + the use of this software, even if advised of the possibility of such damage. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_508.yml b/src/licensedcode/data/rules/bsd-new_508.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_508.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_509.RULE b/src/licensedcode/data/rules/bsd-new_509.RULE new file mode 100644 index 00000000000..1b5d8886f55 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_509.RULE @@ -0,0 +1 @@ +Software License Agreement (BSD License) \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_509.yml b/src/licensedcode/data/rules/bsd-new_509.yml new file mode 100644 index 00000000000..1ea4dba5170 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_509.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_510.RULE b/src/licensedcode/data/rules/bsd-new_510.RULE new file mode 100644 index 00000000000..8c20f6f37b4 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_510.RULE @@ -0,0 +1,22 @@ +THE BSD LICENSE + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_510.yml b/src/licensedcode/data/rules/bsd-new_510.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_510.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_511.RULE b/src/licensedcode/data/rules/bsd-new_511.RULE new file mode 100644 index 00000000000..4bb4355e664 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_511.RULE @@ -0,0 +1,9 @@ +IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. + +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. + + + Intel License Agreement + For Open Source Computer Vision Library \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_511.yml b/src/licensedcode/data/rules/bsd-new_511.yml new file mode 100644 index 00000000000..21c2892de50 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_511.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/bsd-new_512.RULE b/src/licensedcode/data/rules/bsd-new_512.RULE new file mode 100644 index 00000000000..0d61d4f57d4 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_512.RULE @@ -0,0 +1,6 @@ + + + License Agreement For Open Source Computer Vision Library (3-clause BSD License) + http://opencv.org/license.html + + \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_512.yml b/src/licensedcode/data/rules/bsd-new_512.yml new file mode 100644 index 00000000000..c802ea69f9f --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_512.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://opencv.org/license.html diff --git a/src/licensedcode/data/rules/bsd-new_513.RULE b/src/licensedcode/data/rules/bsd-new_513.RULE new file mode 100644 index 00000000000..7324daa4a6d --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_513.RULE @@ -0,0 +1,4 @@ + + License Agreement For Open Source Computer Vision Library (3-clause BSD License) + http://opencv.org/license.html + \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_513.yml b/src/licensedcode/data/rules/bsd-new_513.yml new file mode 100644 index 00000000000..c802ea69f9f --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_513.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://opencv.org/license.html diff --git a/src/licensedcode/data/rules/bsd-new_514.RULE b/src/licensedcode/data/rules/bsd-new_514.RULE new file mode 100644 index 00000000000..5d7f18b00b0 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_514.RULE @@ -0,0 +1,2 @@ +License Agreement For Open Source Computer Vision Library (3-clause BSD License) +http://opencv.org/license.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_514.yml b/src/licensedcode/data/rules/bsd-new_514.yml new file mode 100644 index 00000000000..bfc96385ea5 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_514.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 100 +ignorable_urls: + - http://opencv.org/license.html diff --git a/src/licensedcode/data/rules/bsd-new_515.RULE b/src/licensedcode/data/rules/bsd-new_515.RULE new file mode 100644 index 00000000000..550846a6683 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_515.RULE @@ -0,0 +1 @@ +License Agreement For Open Source Computer Vision Library (3-clause BSD License) \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_515.yml b/src/licensedcode/data/rules/bsd-new_515.yml new file mode 100644 index 00000000000..1ea4dba5170 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_515.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_516.RULE b/src/licensedcode/data/rules/bsd-new_516.RULE new file mode 100644 index 00000000000..4ef9860f15b --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_516.RULE @@ -0,0 +1 @@ +http://opencv.org/license.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_516.yml b/src/licensedcode/data/rules/bsd-new_516.yml new file mode 100644 index 00000000000..bfc96385ea5 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_516.yml @@ -0,0 +1,5 @@ +license_expression: bsd-new +is_license_reference: yes +relevance: 100 +ignorable_urls: + - http://opencv.org/license.html diff --git a/src/licensedcode/data/rules/bsd-new_517.RULE b/src/licensedcode/data/rules/bsd-new_517.RULE new file mode 100644 index 00000000000..6cac1372f05 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_517.RULE @@ -0,0 +1,28 @@ +Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + Neither the name of Texas Instruments Incorporated nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_517.yml b/src/licensedcode/data/rules/bsd-new_517.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_517.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-new_518.RULE b/src/licensedcode/data/rules/bsd-new_518.RULE new file mode 100644 index 00000000000..011eaa869f4 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_518.RULE @@ -0,0 +1,24 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +list* Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +class= Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. +list Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_518.yml b/src/licensedcode/data/rules/bsd-new_518.yml new file mode 100644 index 00000000000..163390d8890 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_518.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 99 diff --git a/src/licensedcode/data/rules/bsd-new_519.RULE b/src/licensedcode/data/rules/bsd-new_519.RULE new file mode 100644 index 00000000000..29bd07377a7 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_519.RULE @@ -0,0 +1,2 @@ +License: BSD + Same license text as \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_519.yml b/src/licensedcode/data/rules/bsd-new_519.yml new file mode 100644 index 00000000000..888c5d071c1 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_519.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_tag: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/bsd-new_520.RULE b/src/licensedcode/data/rules/bsd-new_520.RULE new file mode 100644 index 00000000000..659f4047d1a --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_520.RULE @@ -0,0 +1,2 @@ +License: BSD-like + Same license text as \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_520.yml b/src/licensedcode/data/rules/bsd-new_520.yml new file mode 100644 index 00000000000..888c5d071c1 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_520.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_tag: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/bsd-new_521.RULE b/src/licensedcode/data/rules/bsd-new_521.RULE new file mode 100644 index 00000000000..73a0d53ec61 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_521.RULE @@ -0,0 +1,21 @@ +Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-new_521.yml b/src/licensedcode/data/rules/bsd-new_521.yml new file mode 100644 index 00000000000..646f0f05a97 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-new_521.yml @@ -0,0 +1,3 @@ +license_expression: bsd-new +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-simplified_121.RULE b/src/licensedcode/data/rules/bsd-simplified_121.RULE new file mode 100644 index 00000000000..47c4d75ef64 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_121.RULE @@ -0,0 +1 @@ +license http://www.opensource.org/licenses/bsd-license.php BSD \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_121.yml b/src/licensedcode/data/rules/bsd-simplified_121.yml new file mode 100644 index 00000000000..fdaa7d91735 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_121.yml @@ -0,0 +1,5 @@ +license_expression: bsd-simplified +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-simplified_122.RULE b/src/licensedcode/data/rules/bsd-simplified_122.RULE new file mode 100644 index 00000000000..2a135403001 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_122.RULE @@ -0,0 +1,25 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of Incutio Ltd. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@license http://www.opensource.org/licenses/bsd-license.php BSD \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_122.yml b/src/licensedcode/data/rules/bsd-simplified_122.yml new file mode 100644 index 00000000000..a39a0eb8f85 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_122.yml @@ -0,0 +1,6 @@ +license_expression: bsd-simplified +is_license_text: yes +relevance: 100 +minimum_coverage: 97 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-simplified_123.RULE b/src/licensedcode/data/rules/bsd-simplified_123.RULE new file mode 100644 index 00000000000..be683ba6bb9 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_123.RULE @@ -0,0 +1,22 @@ +LICENSE: Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: Redistributions of source code must retain the +above copyright notice, this list of conditions and the following +disclaimer. Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN +NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +@license http://www.opensource.org/licenses/bsd-license.php \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_123.yml b/src/licensedcode/data/rules/bsd-simplified_123.yml new file mode 100644 index 00000000000..78677a6a3eb --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_123.yml @@ -0,0 +1,5 @@ +license_expression: bsd-simplified +is_license_text: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-simplified_124.RULE b/src/licensedcode/data/rules/bsd-simplified_124.RULE new file mode 100644 index 00000000000..c91dd32e1da --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_124.RULE @@ -0,0 +1 @@ +@license http://www.opensource.org/licenses/bsd-license.php \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_124.yml b/src/licensedcode/data/rules/bsd-simplified_124.yml new file mode 100644 index 00000000000..fdaa7d91735 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_124.yml @@ -0,0 +1,5 @@ +license_expression: bsd-simplified +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-simplified_125.RULE b/src/licensedcode/data/rules/bsd-simplified_125.RULE new file mode 100644 index 00000000000..30aa96a5772 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_125.RULE @@ -0,0 +1 @@ +@license http://www.opensource.org/licenses/bsd-license.php BSD License \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_125.yml b/src/licensedcode/data/rules/bsd-simplified_125.yml new file mode 100644 index 00000000000..fdaa7d91735 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_125.yml @@ -0,0 +1,5 @@ +license_expression: bsd-simplified +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license.php diff --git a/src/licensedcode/data/rules/bsd-simplified_126.RULE b/src/licensedcode/data/rules/bsd-simplified_126.RULE new file mode 100644 index 00000000000..3dadf429695 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_126.RULE @@ -0,0 +1,22 @@ +#LICENSE +# +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are met: +# +#1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +#2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +#ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_126.yml b/src/licensedcode/data/rules/bsd-simplified_126.yml new file mode 100644 index 00000000000..d7f3625b73c --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_126.yml @@ -0,0 +1,3 @@ +license_expression: bsd-simplified +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-simplified_127.RULE b/src/licensedcode/data/rules/bsd-simplified_127.RULE new file mode 100644 index 00000000000..c4b70567d06 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_127.RULE @@ -0,0 +1,14 @@ +Released to public domain under terms of the BSD Simplified license. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the organization nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + See \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_127.yml b/src/licensedcode/data/rules/bsd-simplified_127.yml new file mode 100644 index 00000000000..c2f50173e80 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_127.yml @@ -0,0 +1,6 @@ +license_expression: bsd-simplified +is_license_notice: yes +relevance: 100 +minimum_coverage: 99 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license diff --git a/src/licensedcode/data/rules/bsd-simplified_128.RULE b/src/licensedcode/data/rules/bsd-simplified_128.RULE new file mode 100644 index 00000000000..05c52544fad --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_128.RULE @@ -0,0 +1,12 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the organization nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + See \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_128.yml b/src/licensedcode/data/rules/bsd-simplified_128.yml new file mode 100644 index 00000000000..c2f50173e80 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_128.yml @@ -0,0 +1,6 @@ +license_expression: bsd-simplified +is_license_notice: yes +relevance: 100 +minimum_coverage: 99 +ignorable_urls: + - http://www.opensource.org/licenses/bsd-license diff --git a/src/licensedcode/data/rules/bsd-simplified_129.RULE b/src/licensedcode/data/rules/bsd-simplified_129.RULE new file mode 100644 index 00000000000..0499507188b --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_129.RULE @@ -0,0 +1 @@ +Released to public domain under terms of the BSD Simplified license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_129.yml b/src/licensedcode/data/rules/bsd-simplified_129.yml new file mode 100644 index 00000000000..3b5338540a9 --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_129.yml @@ -0,0 +1,3 @@ +license_expression: bsd-simplified +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-simplified_130.RULE b/src/licensedcode/data/rules/bsd-simplified_130.RULE new file mode 100644 index 00000000000..698baff9fae --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_130.RULE @@ -0,0 +1,2 @@ +* @license + * license: Simplified BSD License \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_130.yml b/src/licensedcode/data/rules/bsd-simplified_130.yml new file mode 100644 index 00000000000..24d34a714ca --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_130.yml @@ -0,0 +1,3 @@ +license_expression: bsd-simplified +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-simplified_131.RULE b/src/licensedcode/data/rules/bsd-simplified_131.RULE new file mode 100644 index 00000000000..dd0f156fd1a --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_131.RULE @@ -0,0 +1 @@ +* license: Simplified BSD License \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_131.yml b/src/licensedcode/data/rules/bsd-simplified_131.yml new file mode 100644 index 00000000000..24d34a714ca --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_131.yml @@ -0,0 +1,3 @@ +license_expression: bsd-simplified +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-simplified_132.RULE b/src/licensedcode/data/rules/bsd-simplified_132.RULE new file mode 100644 index 00000000000..86f5071970b --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_132.RULE @@ -0,0 +1 @@ +Simplified BSD License \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_132.yml b/src/licensedcode/data/rules/bsd-simplified_132.yml new file mode 100644 index 00000000000..e4601ea944d --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_132.yml @@ -0,0 +1,3 @@ +license_expression: bsd-simplified +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/bsd-simplified_146.RULE b/src/licensedcode/data/rules/bsd-simplified_146.RULE new file mode 100644 index 00000000000..7e60957310a --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_146.RULE @@ -0,0 +1,23 @@ +/** + * @license + * license: Simplified BSD License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL DANIEL GUERRERO BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ \ No newline at end of file diff --git a/src/licensedcode/data/rules/bsd-simplified_146.yml b/src/licensedcode/data/rules/bsd-simplified_146.yml new file mode 100644 index 00000000000..d7f3625b73c --- /dev/null +++ b/src/licensedcode/data/rules/bsd-simplified_146.yml @@ -0,0 +1,3 @@ +license_expression: bsd-simplified +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/cc-by-3.0_22.RULE b/src/licensedcode/data/rules/cc-by-3.0_22.RULE new file mode 100644 index 00000000000..e84fdc5725f --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-3.0_22.RULE @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc-by-3.0_22.yml b/src/licensedcode/data/rules/cc-by-3.0_22.yml new file mode 100644 index 00000000000..52a9cb56c00 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-3.0_22.yml @@ -0,0 +1,5 @@ +license_expression: cc-by-3.0 +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://creativecommons.org/licenses/by/3.0/ diff --git a/src/licensedcode/data/rules/cc-by-3.0_23.RULE b/src/licensedcode/data/rules/cc-by-3.0_23.RULE new file mode 100644 index 00000000000..700f83946a4 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-3.0_23.RULE @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc-by-3.0_23.yml b/src/licensedcode/data/rules/cc-by-3.0_23.yml new file mode 100644 index 00000000000..52a9cb56c00 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-3.0_23.yml @@ -0,0 +1,5 @@ +license_expression: cc-by-3.0 +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://creativecommons.org/licenses/by/3.0/ diff --git a/src/licensedcode/data/rules/cc-by-3.0_24.RULE b/src/licensedcode/data/rules/cc-by-3.0_24.RULE new file mode 100644 index 00000000000..d41c13af295 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-3.0_24.RULE @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc-by-3.0_24.yml b/src/licensedcode/data/rules/cc-by-3.0_24.yml new file mode 100644 index 00000000000..7e3499dfcdd --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-3.0_24.yml @@ -0,0 +1,10 @@ +license_expression: cc-by-3.0 +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://creativecommons.org/licenses/by/3.0/ + - http://creativecommons.org/ns#Attribution + - http://creativecommons.org/ns#DerivativeWorks + - http://creativecommons.org/ns#Distribution + - http://creativecommons.org/ns#Notice + - http://creativecommons.org/ns#Reproduction diff --git a/src/licensedcode/data/rules/cc-by-nc-nd-4.0_1.RULE b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_1.RULE new file mode 100644 index 00000000000..8c44e3f255a --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_1.RULE @@ -0,0 +1 @@ +The article text, contained in the index.html file, is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International license. For the full text of the license, please see the Creative Commons site. \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc-by-nc-nd-4.0_1.yml b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_1.yml new file mode 100644 index 00000000000..f9af455c0ff --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_1.yml @@ -0,0 +1,3 @@ +license_expression: cc-by-nc-nd-4.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/cc-by-nc-nd-4.0_2.RULE b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_2.RULE new file mode 100644 index 00000000000..1adc4ed3917 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_2.RULE @@ -0,0 +1 @@ +licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc-by-nc-nd-4.0_2.yml b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_2.yml new file mode 100644 index 00000000000..f9af455c0ff --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_2.yml @@ -0,0 +1,3 @@ +license_expression: cc-by-nc-nd-4.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/cc-by-nc-nd-4.0_3.RULE b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_3.RULE new file mode 100644 index 00000000000..e03d63414d3 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_3.RULE @@ -0,0 +1 @@ +Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc-by-nc-nd-4.0_3.yml b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_3.yml new file mode 100644 index 00000000000..f9af455c0ff --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-nd-4.0_3.yml @@ -0,0 +1,3 @@ +license_expression: cc-by-nc-nd-4.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/cc-by-nc-sa-3.0_14.RULE b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_14.RULE new file mode 100644 index 00000000000..7ee7d599b16 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_14.RULE @@ -0,0 +1 @@ +This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc-by-nc-sa-3.0_14.yml b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_14.yml new file mode 100644 index 00000000000..0ffe21e0933 --- /dev/null +++ b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_14.yml @@ -0,0 +1,3 @@ +license_expression: cc-by-nc-sa-3.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/cc-by-nc-sa-3.0_9.yml b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_9.yml index f993fc48cb8..5b33a886c6a 100644 --- a/src/licensedcode/data/rules/cc-by-nc-sa-3.0_9.yml +++ b/src/licensedcode/data/rules/cc-by-nc-sa-3.0_9.yml @@ -1,6 +1,6 @@ license_expression: cc-by-nc-sa-3.0 is_license_notice: yes referenced_filenames: - - LICENSE + - ../../LICENSE ignorable_urls: - http://creativecommons.org/licenses/by-nc-sa/3.0/ diff --git a/src/licensedcode/data/rules/cc0-1.0_67.RULE b/src/licensedcode/data/rules/cc0-1.0_67.RULE new file mode 100644 index 00000000000..78484413146 --- /dev/null +++ b/src/licensedcode/data/rules/cc0-1.0_67.RULE @@ -0,0 +1 @@ +License: CC0 1.0 Universal (CC0 1.0) \ No newline at end of file diff --git a/src/licensedcode/data/rules/cc0-1.0_67.yml b/src/licensedcode/data/rules/cc0-1.0_67.yml new file mode 100644 index 00000000000..5613dd42089 --- /dev/null +++ b/src/licensedcode/data/rules/cc0-1.0_67.yml @@ -0,0 +1,3 @@ +license_expression: cc0-1.0 +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/commercial-license_41.RULE b/src/licensedcode/data/rules/commercial-license_41.RULE new file mode 100644 index 00000000000..e2daff06694 --- /dev/null +++ b/src/licensedcode/data/rules/commercial-license_41.RULE @@ -0,0 +1,114 @@ +Software License Agreement + +Software License Agreement +IMPORTANT NOTICE -- READ CAREFULLY: This Software License +Agreement ("License") for Customer use of Software is the agreement +which governs use of the software of ("Seller"), including +source code and associated printed materials ("Software"). By downloading, +installing, copying, or otherwise using the Software, you agree to be bound by +the terms of this License. If you do not agree to the terms of this License, delete +all copies of the Software and contact the place of purchase for a full refund. + +1. Definitions +Whenever used in this Contract, unless inconsistent with the subject matter or +context of their use, the following words and terms shall have the respective +meanings ascribed to them as follows: +(a) "Seller" means includes its successors and permitted +assigns. +(b) "License" or "Agreement" means this nontransferable Software License +Agreement including the Terms and Conditions provided herein. +(c) "Buyer" or "Customer", means the entity or individual that downloads the +Software, and includes its successors and permitted assigns. +(d) "Parties", means Seller and Buyer, collectively, and "Party" means any one of +them. +(e) "Software", means the software in both object and source code. + +2. License Grant +Upon Seller''s receipt of the full purchase price, Seller grants to Buyer a +non-exclusive license to: +(a) use or modify the Software in source or object code to create derived works +including the Software or any portion or element thereof, +(b) process or permit to be processed any data associated with the Software, +(c) release, distribute or make available, either generally or to any specific +third-party, the Software in source or object code format. + +3. License Conditions +The grant of the License under section 2 hereof will remain subject to the +following terms and conditions, as well as to the other provisions hereof: +(a) Buyer acknowledges that the copyright and title to the Software and any +trademarks or service marks relating thereto remain with Seller. Neither Buyer +nor any third party shall have right, title or interest in the Software except as +expressly set forth in this Agreement. +(b) Buyer may not remove or obscure any copyright or other notices included in +the Software source code. +(c) The names "" or "" may not be used to endorse or +promote products derived from this software without specific prior written +permission. +(d) The Software is only distributed bundled with or integrated into Buyer +programs that add significant functionality to the Software. + +4. Delivery & Risk of Loss +Copies of the Software will be provided to the Buyer through electronic transfer +(by means of HTTP or otherwise). Risk of loss for Software delivered under this +License shall pass to Buyer at time of delivery. + +5. Early Termination +In the event that either party believes that the other materially has breached any +obligations under this Agreement, or if Seller believes that Buyer has exceeded +the scope of the License, such party shall so notify the breaching party in writing. +The breaching party shall have 30 days from the receipt of notice to cure the +alleged breach and to notify the non-breaching party in writing that cure has been +effected. +If the breach is not cured within 30 days, the non-breaching party shall have the +right to terminate the Agreement without further notice. Upon Termination of +this Agreement the Buyer must stop any further distribution of the Software or +any modified or derived works within 5 days. Any copies of the Software +distributed prior to such termination of this Agreement may remain in use +according to the terms specifically provided elsewhere in this Agreement. + +6. Perpetual License +Except for termination for cause, Seller hereby grants to Buyer a nonexclusive, +royalty-free, perpetual license to use the Software. Such use shall be in +accordance with the provisions of this Agreement, which provisions shall survive +any termination of this Agreement. + +7. "As Is" Warranty +SELLER PROVIDES THE SOFTWARE "AS IS" AND IS IN LIEU OF ANY +OR ALL OTHER WARRANTIES OR CONDITIONS, EXPRESS OR IMPLIED +INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTY OF +MERCHANTABILITY, ANY IMPLIED WARRANTY OF FITNESS FOR A +PARTICULAR PURPOSE OR ANY WARRANTY ARISING OUT OF +PERFORMANCE OR CUSTOM OR USAGE OF TRADE INCLUDING BUT +NOT LIMITED TO A WARRANTY AGAINST PATENT, COPYRIGHT OR +TRADE SECRET INFRINGEMENT. + +8. Limitation Of Liability +IN NO EVENT, WHETHER AS A RESULT OF BREACH OF CONTRACT, +WARRANTY, TORT, STRICT LIABILITY OR OTHERWISE, SHALL +BUYER OR SELLER BE LIABLE FOR ANY SPECIAL, CONSEQUENTIAL, +INCIDENTAL, INDIRECT OR EXEMPLARY DAMASELLER, INCLUDING, +BUT NOT LIMITED TO, LOSS OF PROFITS OR REVENUES, LOSS OF USE +OF THE HARDWARE OR ANY OTHER EQUIPMENT, COST OF CAPITAL, +COST OF SUBSTITUTE GOODS, FACILITIES, SERVICES OR DOWNTIME +COSTS. +The provisions of this Article, Limitations Of Liability, shall apply +notwithstanding any other provisions of these terms or of any other agreement. + +9. Assignment +Neither this License nor any interest in it shall be assigned directly or indirectly +by Buyer without the prior written consent of Seller. + +10. Enforceability +If any provision of this License is held invalid, illegal or unenforceable, the +validity, legality or enforceability of the remaining provisions will, to the extent +of such invalidity, illegality, or unenforceability, be severed, but without in any +way affecting the remainder of such provision or any other provision contained +herein, all of which shall continue in full force and effect. + +11. Entire Agreement +This License supercedes all previous proposals, negotiations, conversations, and +understandings, whether oral or written, and constitutes the sole and entire +agreement between the parties with respect to the purchase by Buyer of the +Software. No modification or deletion of, or addition to these terms will be +binding unless made in writing and signed by duly authorized representatives of +both parties. \ No newline at end of file diff --git a/src/licensedcode/data/rules/commercial-license_41.yml b/src/licensedcode/data/rules/commercial-license_41.yml new file mode 100644 index 00000000000..efd1c753de8 --- /dev/null +++ b/src/licensedcode/data/rules/commercial-license_41.yml @@ -0,0 +1,4 @@ +license_expression: commercial-license +is_license_text: yes +relevance: 100 +minimum_coverage: 80 diff --git a/src/licensedcode/data/rules/commercial-license_42.RULE b/src/licensedcode/data/rules/commercial-license_42.RULE new file mode 100644 index 00000000000..2678ed21bc4 --- /dev/null +++ b/src/licensedcode/data/rules/commercial-license_42.RULE @@ -0,0 +1,224 @@ +END-USER LICENSE AGREEMENT +(LIMITED COMMERCIAL USE) + +PLEASE REVIEW THE FOLLOWING TERMS AND CONDITIONS PRIOR TO ACCESSING, DOWNLOADING AND/OR OTHERWISE USING ANY OF THE LICENSED PRODUCTS, AS HEREIN AFTER DEFINED. + +THE USE OF THE LICENSED PRODUCTS AS WELL AS ANY UPDATES THERETO IS SUBJECT TO THE TERMS AND CONDITIONS OF THE THIS LICENSE AGREEMENT (THE AGREEMENT). BY OPENING THE RELEVANT SOFTWARE PACKAGE, BY SELECTING THE [AGREED AND/OR ACCEPT] BUTTON, DOWNLOADING AND/OR OTHERWISE USING THE SOFTWARE OR ANY PORTION THEREOF, LICENSEE (THE FIRM, COMPANY OR OTHER PERSON HAVING RECEIVED THE LICENSED SOFTWARE PURSUANT TO AN ORDER ON THE WEB SITE OR OTHERWISE) ARE AGREEING TO THE BOUND BY THE TERMS AND CONDITIONS OF THE AGREEMENT AND ARE ENTERING INTO THE AGREEMENT WITH (LICENSOR or ). + +1. DEFINITIONS + +As used in this Agreement, the following terms shall have the +following meanings: + +1.1 "Designated Use" means the uses described in Section 2.3. + +1.2 "Documentation" means the materials and documents relevant to the +Licensed Products and provided by + +1.3 "Event of Default" means any event specified in Section 7.1. + +1.4 "License" means the license to use the Licensed Products as defined +in Section 2.1. + +1.5 "Licensed Products" means the software product in object +code form only. (Use of source code is subject to the conditions set +forth in the Public Source license agreement.) + +1.7 "Usage, Use or Used" includes the act of transferring, transmitting, +compiling, executing, interpreting, processing or storing the +Licensed Products through the use of computer equipment, or +transferring, transmitting, compiling, executing, interpreting, +processing or storing any data or information using the Licensed +Products; and/or displaying any portion of the Licensed Products or +data or information in connection with any of these activities. + +2. GRANT OF LICENSE + +2.1 Nonexclusive License + +Subject to Licensee''s compliance with the terms and conditions of +this Agreement Licensee is hereby granted a nonexclusive, +non-transferable, non assignable and royalty-free license to Use the +Licensed Products for purposes of the Designated Use; provided, +however, that this Agreement does not grant to Licensee any title or +right of ownership in or to the Licensed Products. + +2.2 Right to Utilize the Documentation + +Subject to the term and conditions of this Agreement, hereby +grants to Licensee, and Licensee hereby accepts from , a +nonexclusive, non-transferable, non assignable and royalty-free +right to utilize the Documentation in connection with the Designated +Use of the Licensed Products; provided, however, that this Agreement +does not grant to Licensee any title or right of ownership in or to +the Documentation. Licensee shall not copy any Documentation, but +may obtain additional copies from for the applicable charges +specified by from time to time. + +2.3 Use + +The Licensed Products may be Used only for Licensee''s own internal +computing requirements in accordance with the terms and conditions +set forth herein and strictly limited to the number of users as +defined here. The Licensed Products are free to use by Licensor in +any organization, commercial or non-commercial, according to this +License Agreement for up to, but not exceeding, 25 (twenty five) +distinct users. Any other use requires a Commercial License +Agreement which may grant in its sole discretion. + +Licensors with a Commercial License agreement can subscribe to +Maintenance and Support services to periodically receive updated +versions of the Licensed Products, get access to support services +(web, e-mail and telephone) and receive updated signed versions of +the applet. These services are not available under this +limited Agreement. + +Licensee is allowed to use the source code according to the + Public Source license agreement. Licensee is allowed to use +any derivative works of the Licensed Products for its own internal +computing requirements according to the terms and conditions of this +Agreement. + +3. TERM OF LICENSE + +The License granted hereunder shall commence upon Licensee''s +acceptance of the terms and conditions herein contained and shall +continue in effect unless terminated earlier pursuant hereto. + +4. NO COPYING AND RESTRICTED USE + +4.1 Restricted Use + +Licensee shall not Use the Licensed Products or the Documentation +for any purposes other than the Designated Use specified in Section +2 hereof. + +4.2 No Copying + +Licensee may make, free of charge, copies of the Licensed Products +for the Designated Use, archival or back-up purposes. Licensee shall +not make any copy of the Licensed Products for a use that +has not expressly approved under this Agreement. Licensee shall not +Use or allow the Licensed Products to be Used, directly or +indirectly, in any manner that would enable its customers or any +other person or entity to copy or Use any of the Licensed Products. +Copying or reproduction of the Licensed Products to any other server +or location or media for further reproduction or redistribution is +expressly prohibited. + +4.3 No Transfer of License; No Sublicense + +Licensee shall not assign or transfer this License, or license or +sublicense the Use of all or any portion of the Licensed Products, +to any other party. + +4.4 No Modification or Decompilation + +Licensee shall not modify, disassemble, decompile, recreate or +generate any Licensed Products or any portion or version thereof +unless and to the extent permitted under applicable mandatory law. + +4.5 Export + +Licensee shall not export or re-export the Licensed Products or +permit transshipment thereof, directly on indirectly, to any country +to the extent such country requires an export license or other +governmental approval, without first obtaining such license or +approval. + +4.6 Proprietary Markings + +Licensee shall not remove, erase or hide from view any copyright, +trademark, confidentiality notice, mark or legend appearing on any +of the Licensed Products or any form of output produced by the +Licensed Products. + +5. NO WARRANTY + +Because the Licensed Products are licensed free of charge, there is +no warranty for the Licensed Program, to the extent permitted by +applicable law. provides the Licensed Products “as is” +without warranty of any kind, either expressed or implied, +including, but not limited to, the implied warranties of +merchantability and fitness for a particular purpose. Licensee alone +accepts the entire risk as to the quality and performance of the +Licensed Products. Should the Licensed Products prove defective, +Licensee assumes the cost of all necessary servicing, repair or +correction. + +6. LIMITATION OF LIABILITY AND REMEDIES + +In no event shall be liable for any loss of or damage to +revenues, profits or goodwill or other special, incidental, indirect +or consequential damages of any kind, resulting from its performance +or failure to perform pursuant to the terms of this Agreement or any +exhibits hereto, or resulting from the furnishing, performance, or +use or loss of use, loss of data or loss of any licensed products or +other materials delivered, including, without limitation, any +interruption of business, whether resulting from breach of contract +or breach of warranty, even if licensee has been advised of the +possibility of such damages. + +7. DEFAULT AND TERMINATION + +7.1 Termination in Advance Upon Default + +This Agreement may be terminated with immediate effect upon the +occurrence of any of the following Events of Default: + +(a) Covenants + +The failure or neglect of Licensee to observe, keep or perform any +of the covenants, terms and conditions of this Agreement, where such +non-performance is not fully cured by Licensee within thirty (30) +days after written notice from ; or + +(b) Bankruptcy + +The filing of a petition for Licensee''s bankruptcy, whether +voluntary or involuntary, or if an assignment of Licensee''s assets +is made for the benefit of creditors, or a trustee or receiver is +appointed to take charge of the business of Licensee for any reason, +or if Licensee becomes insolvent or voluntarily or involuntarily +dissolved. + +7.2 Obligations on Termination + +Effective with the date of expiration or other termination of this +Agreement, all Usage of the Licensed Products shall terminate, and +all rights of Licensee under this Agreement shall cease, +specifically including, but without limitation, the License and all +other rights granted to Licensee under this Agreement. + +7.3 No Waiver + +Termination of the Agreement under this Section shall be in addition +to, and not a waiver of, any remedy at law or in equity available to + arising from Licensee''s breach of this Agreement. + +8. MISCELLANEOUS + +8.1 Notices + +All notices, requests and demands given to or made upon the parties +shall be in writing and shall be mailed properly addressed, postage +prepaid, registered or a certified, or personally delivered to +either party at the addresses specified by either party, upon not +less than ten (10) days notice. Such notice shall be deemed received +by the close of business on the date shown on the certified or +registered mail receipt, or when it is actually received, whichever +is sooner. + +8.2 Governing Law and Jurisdiction + +This Agreement shall be governed by and construed in accordance with +the laws of , without reference to its conflicts of law +provisions. The exclusive jurisdiction and venue for all legal +actions relating to this Agreement shall be in courts of competent +subject matter jurisdiction located in Sweden. + +8.3 Severability + +If any provision of this Agreement is held invalid or unenforceable +by any agency of competent jurisdiction, the remaining provisions +shall nevertheless remain valid. \ No newline at end of file diff --git a/src/licensedcode/data/rules/commercial-license_42.yml b/src/licensedcode/data/rules/commercial-license_42.yml new file mode 100644 index 00000000000..efd1c753de8 --- /dev/null +++ b/src/licensedcode/data/rules/commercial-license_42.yml @@ -0,0 +1,4 @@ +license_expression: commercial-license +is_license_text: yes +relevance: 100 +minimum_coverage: 80 diff --git a/src/licensedcode/data/rules/commercial-license_or_gpl-1.0-plus_1.RULE b/src/licensedcode/data/rules/commercial-license_or_gpl-1.0-plus_1.RULE new file mode 100644 index 00000000000..1da85e37dcc --- /dev/null +++ b/src/licensedcode/data/rules/commercial-license_or_gpl-1.0-plus_1.RULE @@ -0,0 +1,23 @@ +getID3() Commercial License +getID3() is licensed under the "GNU Public License" (GPL) and/or the +"getID3() Commercial License" (gCL). This document describes the gCL. + +The license is non-exclusively granted to a single person or company, +per payment of the license fee, for the lifetime of that person or +company. The license is non-transferrable. + +The gCL grants the licensee the right to use getID3() in commercial +closed-source projects. Modifications may be made to getID3() with no +obligation to release the modified source code. getID3() (or pieces +thereof) may be included in any number of projects authored (in whole +or in part) by the licensee. + +The licensee may use any version of getID3(), past, present or future, +as is most convenient. This license does not entitle the licensee to +receive any technical support, updates or bugfixes, except as such are +made publicly available to all getID3() users. + +The licensee may not sub-license getID3() itself, meaning that any +commercially released product containing all or parts of getID3() must +have added functionality beyond what is available in getID3(); +getID3() itself may not be re-licensed by the licensee. \ No newline at end of file diff --git a/src/licensedcode/data/rules/commercial-license_or_gpl-1.0-plus_1.yml b/src/licensedcode/data/rules/commercial-license_or_gpl-1.0-plus_1.yml new file mode 100644 index 00000000000..e65a0957368 --- /dev/null +++ b/src/licensedcode/data/rules/commercial-license_or_gpl-1.0-plus_1.yml @@ -0,0 +1,3 @@ +license_expression: commercial-license OR gpl-1.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/cpol-1.02_2.RULE b/src/licensedcode/data/rules/cpol-1.02_2.RULE new file mode 100644 index 00000000000..c6d9024da15 --- /dev/null +++ b/src/licensedcode/data/rules/cpol-1.02_2.RULE @@ -0,0 +1,2 @@ +Originaly licensed under The Code Project Open License (CPOL) 1.02: + http://www.codeproject.com/info/cpol10.aspx \ No newline at end of file diff --git a/src/licensedcode/data/rules/cpol-1.02_2.yml b/src/licensedcode/data/rules/cpol-1.02_2.yml new file mode 100644 index 00000000000..d6d42ce5b2f --- /dev/null +++ b/src/licensedcode/data/rules/cpol-1.02_2.yml @@ -0,0 +1,4 @@ +license_expression: cpol-1.02 +is_license_notice: yes +ignorable_urls: + - http://www.codeproject.com/info/cpol10.aspx diff --git a/src/licensedcode/data/rules/epl-1.0_29.RULE b/src/licensedcode/data/rules/epl-1.0_29.RULE new file mode 100644 index 00000000000..3bf446eb788 --- /dev/null +++ b/src/licensedcode/data/rules/epl-1.0_29.RULE @@ -0,0 +1 @@ +support (EPL) \ No newline at end of file diff --git a/src/licensedcode/data/rules/epl-1.0_29.yml b/src/licensedcode/data/rules/epl-1.0_29.yml new file mode 100644 index 00000000000..734c09c2fde --- /dev/null +++ b/src/licensedcode/data/rules/epl-1.0_29.yml @@ -0,0 +1,3 @@ +license_expression: epl-1.0 +is_license_reference: yes +relevance: 90 diff --git a/src/licensedcode/data/rules/epl-1.0_30.RULE b/src/licensedcode/data/rules/epl-1.0_30.RULE new file mode 100644 index 00000000000..abf6c5365d9 --- /dev/null +++ b/src/licensedcode/data/rules/epl-1.0_30.RULE @@ -0,0 +1,2 @@ +license {:name "Eclipse Public License" +url "http://www.eclipse.org/legal/epl-v10.html"} \ No newline at end of file diff --git a/src/licensedcode/data/rules/epl-1.0_30.yml b/src/licensedcode/data/rules/epl-1.0_30.yml new file mode 100644 index 00000000000..8506f6de371 --- /dev/null +++ b/src/licensedcode/data/rules/epl-1.0_30.yml @@ -0,0 +1,5 @@ +license_expression: epl-1.0 +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.eclipse.org/legal/epl-v10.html diff --git a/src/licensedcode/data/rules/fsf-mit.yml b/src/licensedcode/data/rules/fsf-mit.yml deleted file mode 100644 index 6ef058eb7c8..00000000000 --- a/src/licensedcode/data/rules/fsf-mit.yml +++ /dev/null @@ -1,3 +0,0 @@ -license_expression: fsf-mit -is_license_text: yes -notes: small variant diff --git a/src/licensedcode/data/rules/fsf-mit_1.yml b/src/licensedcode/data/rules/fsf-mit_1.yml deleted file mode 100644 index 6ef058eb7c8..00000000000 --- a/src/licensedcode/data/rules/fsf-mit_1.yml +++ /dev/null @@ -1,3 +0,0 @@ -license_expression: fsf-mit -is_license_text: yes -notes: small variant diff --git a/src/licensedcode/data/rules/fsf-mit_2.yml b/src/licensedcode/data/rules/fsf-mit_2.yml deleted file mode 100644 index 6ef058eb7c8..00000000000 --- a/src/licensedcode/data/rules/fsf-mit_2.yml +++ /dev/null @@ -1,3 +0,0 @@ -license_expression: fsf-mit -is_license_text: yes -notes: small variant diff --git a/src/licensedcode/data/rules/fsf-mit_3.yml b/src/licensedcode/data/rules/fsf-mit_3.yml deleted file mode 100644 index 10487f34d4a..00000000000 --- a/src/licensedcode/data/rules/fsf-mit_3.yml +++ /dev/null @@ -1,2 +0,0 @@ -license_expression: fsf-mit -is_license_text: yes diff --git a/src/licensedcode/data/rules/fsf-mit_5.yml b/src/licensedcode/data/rules/fsf-mit_5.yml deleted file mode 100644 index 10487f34d4a..00000000000 --- a/src/licensedcode/data/rules/fsf-mit_5.yml +++ /dev/null @@ -1,2 +0,0 @@ -license_expression: fsf-mit -is_license_text: yes diff --git a/src/licensedcode/data/rules/fsf-mit.RULE b/src/licensedcode/data/rules/fsf-unlimited-no-warranty.RULE similarity index 100% rename from src/licensedcode/data/rules/fsf-mit.RULE rename to src/licensedcode/data/rules/fsf-unlimited-no-warranty.RULE diff --git a/src/licensedcode/data/rules/fsf-unlimited-no-warranty.yml b/src/licensedcode/data/rules/fsf-unlimited-no-warranty.yml new file mode 100644 index 00000000000..e7acb068db5 --- /dev/null +++ b/src/licensedcode/data/rules/fsf-unlimited-no-warranty.yml @@ -0,0 +1,3 @@ +license_expression: fsf-unlimited-no-warranty +is_license_text: yes +notes: small variant diff --git a/src/licensedcode/data/rules/fsf-mit_1.RULE b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_1.RULE similarity index 100% rename from src/licensedcode/data/rules/fsf-mit_1.RULE rename to src/licensedcode/data/rules/fsf-unlimited-no-warranty_1.RULE diff --git a/src/licensedcode/data/rules/fsf-unlimited-no-warranty_1.yml b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_1.yml new file mode 100644 index 00000000000..e7acb068db5 --- /dev/null +++ b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_1.yml @@ -0,0 +1,3 @@ +license_expression: fsf-unlimited-no-warranty +is_license_text: yes +notes: small variant diff --git a/src/licensedcode/data/rules/fsf-mit_2.RULE b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_2.RULE similarity index 100% rename from src/licensedcode/data/rules/fsf-mit_2.RULE rename to src/licensedcode/data/rules/fsf-unlimited-no-warranty_2.RULE diff --git a/src/licensedcode/data/rules/fsf-unlimited-no-warranty_2.yml b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_2.yml new file mode 100644 index 00000000000..e7acb068db5 --- /dev/null +++ b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_2.yml @@ -0,0 +1,3 @@ +license_expression: fsf-unlimited-no-warranty +is_license_text: yes +notes: small variant diff --git a/src/licensedcode/data/rules/fsf-mit_3.RULE b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_3.RULE similarity index 100% rename from src/licensedcode/data/rules/fsf-mit_3.RULE rename to src/licensedcode/data/rules/fsf-unlimited-no-warranty_3.RULE diff --git a/src/licensedcode/data/rules/fsf-unlimited-no-warranty_3.yml b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_3.yml new file mode 100644 index 00000000000..a8793ba08c7 --- /dev/null +++ b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_3.yml @@ -0,0 +1,2 @@ +license_expression: fsf-unlimited-no-warranty +is_license_text: yes diff --git a/src/licensedcode/data/rules/fsf-mit_4.RULE b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_4.RULE similarity index 100% rename from src/licensedcode/data/rules/fsf-mit_4.RULE rename to src/licensedcode/data/rules/fsf-unlimited-no-warranty_4.RULE diff --git a/src/licensedcode/data/rules/fsf-unlimited-no-warranty_4.yml b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_4.yml new file mode 100644 index 00000000000..897a15b4b30 --- /dev/null +++ b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_4.yml @@ -0,0 +1,3 @@ +license_expression: fsf-unlimited-no-warranty +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/fsf-mit_5.RULE b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_5.RULE similarity index 100% rename from src/licensedcode/data/rules/fsf-mit_5.RULE rename to src/licensedcode/data/rules/fsf-unlimited-no-warranty_5.RULE diff --git a/src/licensedcode/data/rules/fsf-unlimited-no-warranty_5.yml b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_5.yml new file mode 100644 index 00000000000..a8793ba08c7 --- /dev/null +++ b/src/licensedcode/data/rules/fsf-unlimited-no-warranty_5.yml @@ -0,0 +1,2 @@ +license_expression: fsf-unlimited-no-warranty +is_license_text: yes diff --git a/src/licensedcode/data/rules/generic-cla_1.RULE b/src/licensedcode/data/rules/generic-cla_1.RULE new file mode 100644 index 00000000000..7116bab14dc --- /dev/null +++ b/src/licensedcode/data/rules/generic-cla_1.RULE @@ -0,0 +1,6 @@ +# uses a shared copyright model: each contributor holds copyright over +#their contributions to Caffe. The project versioning records all such +#contribution and copyright details. If a contributor wants to further mark +#their specific copyright on a particular contribution, they should indicate +#their copyright solely in the commit message of the change when it is +#committed. \ No newline at end of file diff --git a/src/licensedcode/data/rules/generic-cla_1.yml b/src/licensedcode/data/rules/generic-cla_1.yml new file mode 100644 index 00000000000..747ea46ff05 --- /dev/null +++ b/src/licensedcode/data/rules/generic-cla_1.yml @@ -0,0 +1,3 @@ +license_expression: generic-cla +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_148.RULE b/src/licensedcode/data/rules/gpl-1.0-plus_148.RULE new file mode 100644 index 00000000000..f1da6f298be --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_148.RULE @@ -0,0 +1 @@ +distributed under the terms of the GNU GPL \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_148.yml b/src/licensedcode/data/rules/gpl-1.0-plus_148.yml new file mode 100644 index 00000000000..116c9848025 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_148.yml @@ -0,0 +1,3 @@ +license_expression: gpl-1.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_149.RULE b/src/licensedcode/data/rules/gpl-1.0-plus_149.RULE new file mode 100644 index 00000000000..4a858b2b0de --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_149.RULE @@ -0,0 +1 @@ +This theme is licensed under the GPL. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_149.yml b/src/licensedcode/data/rules/gpl-1.0-plus_149.yml new file mode 100644 index 00000000000..116c9848025 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_149.yml @@ -0,0 +1,3 @@ +license_expression: gpl-1.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_150.RULE b/src/licensedcode/data/rules/gpl-1.0-plus_150.RULE new file mode 100644 index 00000000000..5ea00240be6 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_150.RULE @@ -0,0 +1,2 @@ +Licensed under the GNU GPL. For full terms see the file COPYING. + @license http://opensource.org/licenses/gpl-license.php GNU Public License \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_150.yml b/src/licensedcode/data/rules/gpl-1.0-plus_150.yml new file mode 100644 index 00000000000..0f92ae8de72 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_150.yml @@ -0,0 +1,7 @@ +license_expression: gpl-1.0-plus +is_license_notice: yes +relevance: 100 +referenced_filenames: + - COPYING +ignorable_urls: + - http://opensource.org/licenses/gpl-license.php diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_151.RULE b/src/licensedcode/data/rules/gpl-1.0-plus_151.RULE new file mode 100644 index 00000000000..509a115093b --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_151.RULE @@ -0,0 +1 @@ +@license http://opensource.org/licenses/gpl-license.php GNU Public License \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_151.yml b/src/licensedcode/data/rules/gpl-1.0-plus_151.yml new file mode 100644 index 00000000000..1297d1045f5 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_151.yml @@ -0,0 +1,5 @@ +license_expression: gpl-1.0-plus +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://opensource.org/licenses/gpl-license.php diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_152.RULE b/src/licensedcode/data/rules/gpl-1.0-plus_152.RULE new file mode 100644 index 00000000000..ac130a5be5a --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_152.RULE @@ -0,0 +1,2 @@ +Released under GPL License. + License: http://www.plupload.com/license \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_152.yml b/src/licensedcode/data/rules/gpl-1.0-plus_152.yml new file mode 100644 index 00000000000..eedb4432099 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_152.yml @@ -0,0 +1,5 @@ +license_expression: gpl-1.0-plus +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.plupload.com/license diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_153.RULE b/src/licensedcode/data/rules/gpl-1.0-plus_153.RULE new file mode 100644 index 00000000000..74a7a289646 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_153.RULE @@ -0,0 +1 @@ +support (GPL) \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_153.yml b/src/licensedcode/data/rules/gpl-1.0-plus_153.yml new file mode 100644 index 00000000000..fb1f61395f4 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-1.0-plus_153.yml @@ -0,0 +1,3 @@ +license_expression: gpl-1.0-plus +is_license_reference: yes +relevance: 90 diff --git a/src/licensedcode/data/rules/gpl-1.0-plus_or_bsd-simplified_1.yml b/src/licensedcode/data/rules/gpl-1.0-plus_or_bsd-simplified_1.yml index 16598840682..ae9028d208b 100644 --- a/src/licensedcode/data/rules/gpl-1.0-plus_or_bsd-simplified_1.yml +++ b/src/licensedcode/data/rules/gpl-1.0-plus_or_bsd-simplified_1.yml @@ -1,3 +1,4 @@ license_expression: gpl-1.0-plus OR bsd-simplified is_license_notice: yes notes: openib openfabrics See https://web.archive.org/web/20081201111036/http://www.openfabrics.org/software_license.htm +minimum_coverage: 95 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_520.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_520.RULE new file mode 100644 index 00000000000..bd3dbdda12e --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_520.RULE @@ -0,0 +1,4 @@ +License + +WordPress is free software, and is released under the terms of the GPL version 2 or (at your option) any later + version. See ="license.txt">license.txt \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_520.yml b/src/licensedcode/data/rules/gpl-2.0-plus_520.yml new file mode 100644 index 00000000000..b63f9c8a42e --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_520.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 +referenced_filenames: + - license.txt diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_521.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_521.RULE new file mode 100644 index 00000000000..442b782f944 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_521.RULE @@ -0,0 +1,2 @@ +WordPress is free software, and is released under the terms of the GPL version 2 or (at your option) any later + version. See ="license.txt">license.txt \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_521.yml b/src/licensedcode/data/rules/gpl-2.0-plus_521.yml new file mode 100644 index 00000000000..b63f9c8a42e --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_521.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 +referenced_filenames: + - license.txt diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_522.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_522.RULE new file mode 100644 index 00000000000..ad4fe5ae9de --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_522.RULE @@ -0,0 +1,8 @@ +WordPress is Free and open source software, built by a distributed community of mostly volunteer developers from around the world. +WordPress comes with some awesome, worldview-changing rights courtesy of its license the GPL. https://wordpress.org/about/license/ +You have the freedom to run the program, for any purpose. + +You have access to the source code, the freedom to study how the program works, and the freedom to change it to make it do what you wish. +You have the freedom to redistribute copies of the original program so you can help your neighbor.' +You have the freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a + chance to benefit from your changes.' ); \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_522.yml b/src/licensedcode/data/rules/gpl-2.0-plus_522.yml new file mode 100644 index 00000000000..c522c8ed2f1 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_522.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://wordpress.org/about/license/ diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_523.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_523.RULE new file mode 100644 index 00000000000..8c3d8667eb0 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_523.RULE @@ -0,0 +1 @@ +Specify the license is GPL v2 or later \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_523.yml b/src/licensedcode/data/rules/gpl-2.0-plus_523.yml new file mode 100644 index 00000000000..be81fec7fd0 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_523.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0-plus +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_524.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_524.RULE new file mode 100644 index 00000000000..f9001805ec8 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_524.RULE @@ -0,0 +1,2 @@ +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_524.yml b/src/licensedcode/data/rules/gpl-2.0-plus_524.yml new file mode 100644 index 00000000000..8652860de3f --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_524.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0-plus +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/licenses/gpl-2.0.html diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_525.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_525.RULE new file mode 100644 index 00000000000..01f71e35797 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_525.RULE @@ -0,0 +1 @@ +The GPL v2.0 or later license. :) \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_525.yml b/src/licensedcode/data/rules/gpl-2.0-plus_525.yml new file mode 100644 index 00000000000..be81fec7fd0 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_525.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0-plus +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_526.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_526.RULE new file mode 100644 index 00000000000..9136667c822 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_526.RULE @@ -0,0 +1,11 @@ +is distributed under the terms of the GNU GPL + +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. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_526.yml b/src/licensedcode/data/rules/gpl-2.0-plus_526.yml new file mode 100644 index 00000000000..44214778e8c --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_526.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_527.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_527.RULE new file mode 100644 index 00000000000..ffeb54e033f --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_527.RULE @@ -0,0 +1,11 @@ +distributed under the terms of the GNU GPL + +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. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_527.yml b/src/licensedcode/data/rules/gpl-2.0-plus_527.yml new file mode 100644 index 00000000000..44214778e8c --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_527.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_528.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_528.RULE new file mode 100644 index 00000000000..dac139204bc --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_528.RULE @@ -0,0 +1 @@ +License: GNU GPL, Version 2 (or later) \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_528.yml b/src/licensedcode/data/rules/gpl-2.0-plus_528.yml new file mode 100644 index 00000000000..d42f7d6e274 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_528.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0-plus +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_529.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_529.RULE new file mode 100644 index 00000000000..34e5cee4fa0 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_529.RULE @@ -0,0 +1,2 @@ +License: GNU General Public License v2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_529.yml b/src/licensedcode/data/rules/gpl-2.0-plus_529.yml new file mode 100644 index 00000000000..8652860de3f --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_529.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0-plus +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/licenses/gpl-2.0.html diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_530.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_530.RULE new file mode 100644 index 00000000000..47e3cca3483 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_530.RULE @@ -0,0 +1 @@ +This theme, like WordPress, is licensed under the GPL. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_530.yml b/src/licensedcode/data/rules/gpl-2.0-plus_530.yml new file mode 100644 index 00000000000..44214778e8c --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_530.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_531.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_531.RULE new file mode 100644 index 00000000000..0da8fb138e2 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_531.RULE @@ -0,0 +1,14 @@ +This program is free software and open source software; you can redistribute +it and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of the License, +or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +http://www.gnu.org/licenses/gpl.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_531.yml b/src/licensedcode/data/rules/gpl-2.0-plus_531.yml new file mode 100644 index 00000000000..dcc6a91d75b --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_531.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/licenses/gpl.html diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_532.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_532.RULE new file mode 100644 index 00000000000..dc927d4908b --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_532.RULE @@ -0,0 +1,13 @@ +This program is free software and open source software; you can redistribute +it and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of the License, +or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_532.yml b/src/licensedcode/data/rules/gpl-2.0-plus_532.yml new file mode 100644 index 00000000000..44214778e8c --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_532.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_with_font-exception-gpl_2.RULE b/src/licensedcode/data/rules/gpl-2.0-plus_with_font-exception-gpl_2.RULE new file mode 100644 index 00000000000..52b2a05aa22 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_with_font-exception-gpl_2.RULE @@ -0,0 +1 @@ +GPL version 2 or any later version with font exception (http://www.gnu.org/licenses/gpl-faq.html#FontException) \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0-plus_with_font-exception-gpl_2.yml b/src/licensedcode/data/rules/gpl-2.0-plus_with_font-exception-gpl_2.yml new file mode 100644 index 00000000000..b4f479a449b --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0-plus_with_font-exception-gpl_2.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0-plus WITH font-exception-gpl +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/licenses/gpl-faq.html#FontException diff --git a/src/licensedcode/data/rules/gpl-2.0_778.RULE b/src/licensedcode/data/rules/gpl-2.0_778.RULE new file mode 100644 index 00000000000..a0aa9a34d7c --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_778.RULE @@ -0,0 +1,2 @@ +Licensed under the GPL license: + http://www.gnu.org/licenses/gpl.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_778.yml b/src/licensedcode/data/rules/gpl-2.0_778.yml new file mode 100644 index 00000000000..1de092a0b20 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_778.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/licenses/gpl.html diff --git a/src/licensedcode/data/rules/gpl-2.0_779.RULE b/src/licensedcode/data/rules/gpl-2.0_779.RULE new file mode 100644 index 00000000000..69fec972f11 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_779.RULE @@ -0,0 +1 @@ +Licensed GPLv2 */ \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_779.yml b/src/licensedcode/data/rules/gpl-2.0_779.yml new file mode 100644 index 00000000000..40bcbb97725 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_779.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-2.0_780.RULE b/src/licensedcode/data/rules/gpl-2.0_780.RULE new file mode 100644 index 00000000000..98fbb278525 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_780.RULE @@ -0,0 +1 @@ +License URI: http://www.gnu.org/licenses/gpl-2.0.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_780.yml b/src/licensedcode/data/rules/gpl-2.0_780.yml new file mode 100644 index 00000000000..e5c9296b534 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_780.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0 +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/licenses/gpl-2.0.html diff --git a/src/licensedcode/data/rules/gpl-2.0_781.RULE b/src/licensedcode/data/rules/gpl-2.0_781.RULE new file mode 100644 index 00000000000..1ca4fba22ff --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_781.RULE @@ -0,0 +1 @@ +License URI: https://www.gnu.org/licenses/gpl-2.0.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_781.yml b/src/licensedcode/data/rules/gpl-2.0_781.yml new file mode 100644 index 00000000000..2a1d4dccbf1 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_781.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0 +is_license_tag: yes +relevance: 100 +ignorable_urls: + - https://www.gnu.org/licenses/gpl-2.0.html diff --git a/src/licensedcode/data/rules/gpl-2.0_782.RULE b/src/licensedcode/data/rules/gpl-2.0_782.RULE new file mode 100644 index 00000000000..9b7f00b2a6a --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_782.RULE @@ -0,0 +1,14 @@ +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +The full GNU General Public License is included in this distribution +in the file called LICENSE.GPL. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_782.yml b/src/licensedcode/data/rules/gpl-2.0_782.yml new file mode 100644 index 00000000000..b445f8b97bc --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_782.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0 +is_license_notice: yes +relevance: 100 +referenced_filenames: + - LICENSE.GPL diff --git a/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_4.RULE b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_4.RULE new file mode 100644 index 00000000000..d37bdd8baf0 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_4.RULE @@ -0,0 +1,49 @@ +This file is provided under a dual BSD/GPLv2 license. When using or +redistributing this file, you may do so under either license. + +GPL LICENSE SUMMARY + +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +The full GNU General Public License is included in this distribution +in the file called LICENSE.GPL. + + +BSD LICENSE + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_4.yml b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_4.yml new file mode 100644 index 00000000000..0bd0235baa3 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_4.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0 OR bsd-new +is_license_notice: yes +relevance: 100 +referenced_filenames: + - LICENSE.GPL diff --git a/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_5.RULE b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_5.RULE new file mode 100644 index 00000000000..a9e8657620d --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_5.RULE @@ -0,0 +1,50 @@ +/* + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + + BSD LICENSE + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_5.yml b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_5.yml new file mode 100644 index 00000000000..a4a27139bfa --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_or_bsd-new_5.yml @@ -0,0 +1,5 @@ +license_expression: gpl-2.0 OR bsd-new +is_license_notice: yes +relevance: 100 +referenced_filenames: + - LICENSE.GPL. diff --git a/src/licensedcode/data/rules/gpl-2.0_or_other-copyleft_or_other-permissive_1.RULE b/src/licensedcode/data/rules/gpl-2.0_or_other-copyleft_or_other-permissive_1.RULE new file mode 100644 index 00000000000..f0938867fd0 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_or_other-copyleft_or_other-permissive_1.RULE @@ -0,0 +1 @@ +Every plugin and theme in WordPress.org's directory is 100%% GPL or a similarly free and compatible license \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-2.0_or_other-copyleft_or_other-permissive_1.yml b/src/licensedcode/data/rules/gpl-2.0_or_other-copyleft_or_other-permissive_1.yml new file mode 100644 index 00000000000..d9610083d50 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-2.0_or_other-copyleft_or_other-permissive_1.yml @@ -0,0 +1,3 @@ +license_expression: gpl-2.0 OR other-copyleft OR other-permissive +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_1.RULE b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_1.RULE new file mode 100644 index 00000000000..23dfe95b524 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_1.RULE @@ -0,0 +1,16 @@ +getID3() is released under multiple licenses. You may choose + from the following licenses, and use getID3 according to the + terms of the license most suitable to your project. + +GNU GPL: https://gnu.org/licenses/gpl.html (v3) + https://gnu.org/licenses/old-licenses/gpl-2.0.html (v2) + https://gnu.org/licenses/old-licenses/gpl-1.0.html (v1) + +GNU LGPL: https://gnu.org/licenses/lgpl.html (v3) + +Mozilla MPL: https://www.mozilla.org/MPL/2.0/ (v2) + +getID3 Commercial License: https://www.getid3.org/#gCL (payment required) + +Copies of each of the above licenses are included in the 'licenses' +directory of the getID3 distribution. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_1.yml b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_1.yml new file mode 100644 index 00000000000..4867b6dea91 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_1.yml @@ -0,0 +1,10 @@ +license_expression: gpl-3.0 OR gpl-2.0 OR gpl-1.0 OR lgpl-3.0 OR mpl-2.0 OR commercial-license +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://gnu.org/licenses/gpl.html + - https://gnu.org/licenses/lgpl.html + - https://gnu.org/licenses/old-licenses/gpl-1.0.html + - https://gnu.org/licenses/old-licenses/gpl-2.0.html + - https://www.getid3.org/#gCL + - https://www.mozilla.org/MPL/2.0/ diff --git a/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_2.RULE b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_2.RULE new file mode 100644 index 00000000000..4ab8e87c4c0 --- /dev/null +++ b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_2.RULE @@ -0,0 +1,17 @@ +getID3() is released under multiple licenses. You may choose + from the following licenses, and use getID3 according to the + terms of the license most suitable to your project. + +GNU GPL: https://gnu.org/licenses/gpl.html (v3) + https://gnu.org/licenses/old-licenses/gpl-2.0.html (v2) + https://gnu.org/licenses/old-licenses/gpl-1.0.html (v1) + +GNU LGPL: https://gnu.org/licenses/lgpl.html (v3) + +Mozilla MPL: http://www.mozilla.org/MPL/2.0/ (v2) + +getID3 Commercial License: http://getid3.org/#gCL (payment required) +***************************************************************** + +Copies of each of the above licenses are included in the 'licenses' +directory of the getID3 distribution. \ No newline at end of file diff --git a/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_2.yml b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_2.yml new file mode 100644 index 00000000000..e0e6fea355e --- /dev/null +++ b/src/licensedcode/data/rules/gpl-3.0_or_gpl-2.0_or_gpl-1.0_or_lgpl-3.0_or_mpl-2.0_or_commercial-license_2.yml @@ -0,0 +1,10 @@ +license_expression: gpl-3.0 OR gpl-2.0 OR gpl-1.0 OR lgpl-3.0 OR mpl-2.0 OR commercial-license +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://getid3.org/#gCL + - http://www.mozilla.org/MPL/2.0/ + - https://gnu.org/licenses/gpl.html + - https://gnu.org/licenses/lgpl.html + - https://gnu.org/licenses/old-licenses/gpl-1.0.html + - https://gnu.org/licenses/old-licenses/gpl-2.0.html diff --git a/src/licensedcode/data/rules/gpl_80.yml b/src/licensedcode/data/rules/gpl_80.yml index 5c8568e5f3f..894a08975bb 100644 --- a/src/licensedcode/data/rules/gpl_80.yml +++ b/src/licensedcode/data/rules/gpl_80.yml @@ -1,2 +1,4 @@ license_expression: gpl-1.0-plus -is_license_reference: yes +is_license_notice: yes +relevance: 100 + diff --git a/src/licensedcode/data/rules/ijg_18.RULE b/src/licensedcode/data/rules/ijg_18.RULE new file mode 100644 index 00000000000..45d5b7dcad5 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_18.RULE @@ -0,0 +1,3 @@ +This distribution contains the ninth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_18.yml b/src/licensedcode/data/rules/ijg_18.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_18.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_19.RULE b/src/licensedcode/data/rules/ijg_19.RULE new file mode 100644 index 00000000000..8d7efdcc784 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_19.RULE @@ -0,0 +1,3 @@ +This distribution contains the eigth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_19.yml b/src/licensedcode/data/rules/ijg_19.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_19.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_20.RULE b/src/licensedcode/data/rules/ijg_20.RULE new file mode 100644 index 00000000000..5cdbe6f28a0 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_20.RULE @@ -0,0 +1,3 @@ +This distribution contains the seventh public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_20.yml b/src/licensedcode/data/rules/ijg_20.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_20.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_21.RULE b/src/licensedcode/data/rules/ijg_21.RULE new file mode 100644 index 00000000000..908d951821f --- /dev/null +++ b/src/licensedcode/data/rules/ijg_21.RULE @@ -0,0 +1,3 @@ +This distribution contains the sixth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_21.yml b/src/licensedcode/data/rules/ijg_21.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_21.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_22.RULE b/src/licensedcode/data/rules/ijg_22.RULE new file mode 100644 index 00000000000..45ccd151533 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_22.RULE @@ -0,0 +1,3 @@ +This distribution contains the fifth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_22.yml b/src/licensedcode/data/rules/ijg_22.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_22.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_23.RULE b/src/licensedcode/data/rules/ijg_23.RULE new file mode 100644 index 00000000000..a0d34cd9194 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_23.RULE @@ -0,0 +1,3 @@ +This distribution contains the fourth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_23.yml b/src/licensedcode/data/rules/ijg_23.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_23.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_24.RULE b/src/licensedcode/data/rules/ijg_24.RULE new file mode 100644 index 00000000000..996ddffec41 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_24.RULE @@ -0,0 +1,3 @@ +This distribution contains the third public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_24.yml b/src/licensedcode/data/rules/ijg_24.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_24.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_25.RULE b/src/licensedcode/data/rules/ijg_25.RULE new file mode 100644 index 00000000000..7577899f19c --- /dev/null +++ b/src/licensedcode/data/rules/ijg_25.RULE @@ -0,0 +1,3 @@ +This distribution contains the second public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_25.yml b/src/licensedcode/data/rules/ijg_25.yml new file mode 100644 index 00000000000..76d8bd03b22 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_25.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ijg_26.RULE b/src/licensedcode/data/rules/ijg_26.RULE new file mode 100644 index 00000000000..14137bbf49c --- /dev/null +++ b/src/licensedcode/data/rules/ijg_26.RULE @@ -0,0 +1,11 @@ +LEGAL ISSUES + + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_26.yml b/src/licensedcode/data/rules/ijg_26.yml new file mode 100644 index 00000000000..d108c7d334e --- /dev/null +++ b/src/licensedcode/data/rules/ijg_26.yml @@ -0,0 +1,4 @@ +license_expression: ijg +is_license_reference: yes +relevance: 100 +minimum_coverage: 95 diff --git a/src/licensedcode/data/rules/ijg_27.RULE b/src/licensedcode/data/rules/ijg_27.RULE new file mode 100644 index 00000000000..f9d15bbcce6 --- /dev/null +++ b/src/licensedcode/data/rules/ijg_27.RULE @@ -0,0 +1,36 @@ +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ijg_27.yml b/src/licensedcode/data/rules/ijg_27.yml new file mode 100644 index 00000000000..77c63565d2e --- /dev/null +++ b/src/licensedcode/data/rules/ijg_27.yml @@ -0,0 +1,3 @@ +license_expression: ijg +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/jasper-2.0_2.RULE b/src/licensedcode/data/rules/jasper-2.0_2.RULE new file mode 100644 index 00000000000..ef03dccf665 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_2.RULE @@ -0,0 +1 @@ +The JasPer license can be found in libjasper. \ No newline at end of file diff --git a/src/licensedcode/data/rules/jasper-2.0_2.yml b/src/licensedcode/data/rules/jasper-2.0_2.yml new file mode 100644 index 00000000000..6165ae75149 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_2.yml @@ -0,0 +1,3 @@ +license_expression: jasper-2.0 +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/jasper-2.0_3.RULE b/src/licensedcode/data/rules/jasper-2.0_3.RULE new file mode 100644 index 00000000000..2a6a9737300 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_3.RULE @@ -0,0 +1 @@ +JasPer License Version 2.0 \ No newline at end of file diff --git a/src/licensedcode/data/rules/jasper-2.0_3.yml b/src/licensedcode/data/rules/jasper-2.0_3.yml new file mode 100644 index 00000000000..6165ae75149 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_3.yml @@ -0,0 +1,3 @@ +license_expression: jasper-2.0 +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/jasper-2.0_4.RULE b/src/licensedcode/data/rules/jasper-2.0_4.RULE new file mode 100644 index 00000000000..8776764c3e4 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_4.RULE @@ -0,0 +1 @@ +JasPer License \ No newline at end of file diff --git a/src/licensedcode/data/rules/jasper-2.0_4.yml b/src/licensedcode/data/rules/jasper-2.0_4.yml new file mode 100644 index 00000000000..929a479b8e9 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_4.yml @@ -0,0 +1,3 @@ +license_expression: jasper-2.0 +is_license_reference: yes +relevance: 99 diff --git a/src/licensedcode/data/rules/jasper-2.0_5.RULE b/src/licensedcode/data/rules/jasper-2.0_5.RULE new file mode 100644 index 00000000000..70e0fd43dc5 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_5.RULE @@ -0,0 +1,2 @@ +License: +JasPer License Version 2.0 \ No newline at end of file diff --git a/src/licensedcode/data/rules/jasper-2.0_5.yml b/src/licensedcode/data/rules/jasper-2.0_5.yml new file mode 100644 index 00000000000..573a1ec7cf5 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_5.yml @@ -0,0 +1,3 @@ +license_expression: jasper-2.0 +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/jasper-2.0_6.RULE b/src/licensedcode/data/rules/jasper-2.0_6.RULE new file mode 100644 index 00000000000..90149cdbc7e --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_6.RULE @@ -0,0 +1,2 @@ +License: +JasPer License \ No newline at end of file diff --git a/src/licensedcode/data/rules/jasper-2.0_6.yml b/src/licensedcode/data/rules/jasper-2.0_6.yml new file mode 100644 index 00000000000..be096b2af0c --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_6.yml @@ -0,0 +1,3 @@ +license_expression: jasper-2.0 +is_license_tag: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/jasper-2.0_7.RULE b/src/licensedcode/data/rules/jasper-2.0_7.RULE new file mode 100644 index 00000000000..3dce2133615 --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_7.RULE @@ -0,0 +1,34 @@ +Permission is hereby granted, free of charge, to any person (the +"User") 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, 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: + +1. The above copyright notices and this permission notice (which +includes the disclaimer below) shall be included in all copies or +substantial portions of the Software. + +2. The name of a copyright holder shall not be used to endorse or +promote products derived from the Software without specific prior +written permission. + +THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS +LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER +THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS +"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 OF THIRD PARTY RIGHTS. IN NO +EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL +INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING +FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE +PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE +THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. +EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS +BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL +PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS +GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE +ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE \ No newline at end of file diff --git a/src/licensedcode/data/rules/jasper-2.0_7.yml b/src/licensedcode/data/rules/jasper-2.0_7.yml new file mode 100644 index 00000000000..ab799944dac --- /dev/null +++ b/src/licensedcode/data/rules/jasper-2.0_7.yml @@ -0,0 +1,3 @@ +license_expression: jasper-2.0 +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/json-pd_1.RULE b/src/licensedcode/data/rules/json-pd_1.RULE new file mode 100644 index 00000000000..60dd99e4ca4 --- /dev/null +++ b/src/licensedcode/data/rules/json-pd_1.RULE @@ -0,0 +1,5 @@ +Public Domain. + +NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + +See http://www.JSON.org/js.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/json-pd_1.yml b/src/licensedcode/data/rules/json-pd_1.yml new file mode 100644 index 00000000000..d9b4e15d8fd --- /dev/null +++ b/src/licensedcode/data/rules/json-pd_1.yml @@ -0,0 +1,5 @@ +license_expression: json-pd +is_license_text: yes +relevance: 100 +ignorable_urls: + - http://www.json.org/js.html diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_188.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_188.RULE new file mode 100644 index 00000000000..f9ae242751f --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_188.RULE @@ -0,0 +1 @@ +* @license LGPL http://www.opensource.org/licenses/lgpl-license.html \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_188.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_188.yml new file mode 100644 index 00000000000..a16ec35962a --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_188.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.0-plus +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/lgpl-license.html diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_189.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_189.RULE new file mode 100644 index 00000000000..7ea6d444f65 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_189.RULE @@ -0,0 +1 @@ +Released under LGPL \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_189.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_189.yml new file mode 100644 index 00000000000..8775364f78c --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_189.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_190.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_190.RULE new file mode 100644 index 00000000000..953c58211d4 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_190.RULE @@ -0,0 +1 @@ +used under LGPL. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_190.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_190.yml new file mode 100644 index 00000000000..8775364f78c --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_190.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.0-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_191.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_191.RULE new file mode 100644 index 00000000000..29db3741b03 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_191.RULE @@ -0,0 +1,2 @@ +See the enclosed file COPYING for license information (LGPL). If you did +not receive this file, see http://opensource.org/licenses/lgpl-license.php. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_191.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_191.yml new file mode 100644 index 00000000000..6790eeee113 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_191.yml @@ -0,0 +1,7 @@ +license_expression: lgpl-2.0-plus +is_license_notice: yes +relevance: 100 +referenced_filenames: + - COPYING +ignorable_urls: + - http://opensource.org/licenses/lgpl-license.php diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_192.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_192.RULE new file mode 100644 index 00000000000..ca1aa1f0e78 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_192.RULE @@ -0,0 +1 @@ +See the enclosed file COPYING for license information (LGPL). \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_192.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_192.yml new file mode 100644 index 00000000000..4681cdf83a7 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_192.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.0-plus +is_license_notice: yes +relevance: 100 +referenced_filenames: + - COPYING diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_193.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_193.RULE new file mode 100644 index 00000000000..4db6a939675 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_193.RULE @@ -0,0 +1 @@ +see http://opensource.org/licenses/lgpl-license.php. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_193.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_193.yml new file mode 100644 index 00000000000..7c881c6e203 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_193.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.0-plus +is_license_reference: yes +relevance: 100 +ignorable_urls: + - http://opensource.org/licenses/lgpl-license.php diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_194.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_194.RULE new file mode 100644 index 00000000000..c95f70bdc48 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_194.RULE @@ -0,0 +1 @@ +http://opensource.org/licenses/lgpl-license.php. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_194.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_194.yml new file mode 100644 index 00000000000..7c881c6e203 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_194.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.0-plus +is_license_reference: yes +relevance: 100 +ignorable_urls: + - http://opensource.org/licenses/lgpl-license.php diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_195.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_195.RULE new file mode 100644 index 00000000000..efd2780b9f0 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_195.RULE @@ -0,0 +1 @@ +https://opensource.org/licenses/lgpl-license.php. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_195.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_195.yml new file mode 100644 index 00000000000..45d6aa00662 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_195.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.0-plus +is_license_reference: yes +relevance: 100 +ignorable_urls: + - https://opensource.org/licenses/lgpl-license.php diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_196.RULE b/src/licensedcode/data/rules/lgpl-2.0-plus_196.RULE new file mode 100644 index 00000000000..3c748e4060d --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_196.RULE @@ -0,0 +1 @@ +opensource.org/licenses/lgpl-license.php. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.0-plus_196.yml b/src/licensedcode/data/rules/lgpl-2.0-plus_196.yml new file mode 100644 index 00000000000..c04460543a4 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.0-plus_196.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.0-plus +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_163.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_163.RULE new file mode 100644 index 00000000000..12d8b412356 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_163.RULE @@ -0,0 +1,4 @@ +@license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + @note This program is distributed in the hope that it will be useful - WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_163.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_163.yml new file mode 100644 index 00000000000..0481afeaa4e --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_163.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/copyleft/lesser.html diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_164.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_164.RULE new file mode 100644 index 00000000000..b1049cf8d61 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_164.RULE @@ -0,0 +1 @@ +@license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_164.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_164.yml new file mode 100644 index 00000000000..0481afeaa4e --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_164.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.gnu.org/copyleft/lesser.html diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_165.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_165.RULE new file mode 100644 index 00000000000..a2b25b4c64d --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_165.RULE @@ -0,0 +1 @@ +License: http://www.tinymce.com/license \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_165.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_165.yml new file mode 100644 index 00000000000..7bf463e199b --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_165.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.1-plus +is_license_tag: yes +relevance: 100 +ignorable_urls: + - http://www.tinymce.com/license diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_166.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_166.RULE new file mode 100644 index 00000000000..a8523bfb7c9 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_166.RULE @@ -0,0 +1,2 @@ +Released under LGPL License. +License: http://www.tinymce.com/license \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_166.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_166.yml new file mode 100644 index 00000000000..51f7b927b62 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_166.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.tinymce.com/license diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_167.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_167.RULE new file mode 100644 index 00000000000..fd720fe416a --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_167.RULE @@ -0,0 +1,13 @@ +FFmpeg is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + FFmpeg is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with FFmpeg; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_167.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_167.yml new file mode 100644 index 00000000000..f57751a8d70 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_167.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_168.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_168.RULE new file mode 100644 index 00000000000..f7b88becd55 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_168.RULE @@ -0,0 +1,2 @@ +The pre-built opencv_ffmpeg*.dll is: +* LGPL library, not BSD libraries. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_168.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_168.yml new file mode 100644 index 00000000000..9061bc799ec --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_168.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.1-plus +is_license_reference: yes +relevance: 95 diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_169.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_169.RULE new file mode 100644 index 00000000000..8a57be0eadb --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_169.RULE @@ -0,0 +1 @@ +See license.txt for the FFMPEG copyright notice and the licensing terms. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_169.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_169.yml new file mode 100644 index 00000000000..28106cc0ab4 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_169.yml @@ -0,0 +1,5 @@ +license_expression: lgpl-2.1-plus +is_license_reference: yes +relevance: 95 +referenced_filenames: + - license.txt diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_170.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_170.RULE new file mode 100644 index 00000000000..592a48affb6 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_170.RULE @@ -0,0 +1,3 @@ +FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. +See `OPENCV_SOURCE_CODE/3rdparty/ffmpeg/readme.txt` and http://ffmpeg.org/legal.html for details and +licensing information \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_170.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_170.yml new file mode 100644 index 00000000000..9a9cd83b820 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_170.yml @@ -0,0 +1,7 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 +referenced_filenames: + - OPENCV_SOURCE_CODE/3rdparty/ffmpeg/readme.txt +ignorable_urls: + - http://ffmpeg.org/legal.html diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_171.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_171.RULE new file mode 100644 index 00000000000..c9edadbbe3c --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_171.RULE @@ -0,0 +1 @@ +FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_171.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_171.yml new file mode 100644 index 00000000000..f57751a8d70 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_171.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_172.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_172.RULE new file mode 100644 index 00000000000..544015a2dad --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_172.RULE @@ -0,0 +1 @@ +licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_172.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_172.yml new file mode 100644 index 00000000000..f57751a8d70 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_172.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_173.RULE b/src/licensedcode/data/rules/lgpl-2.1-plus_173.RULE new file mode 100644 index 00000000000..3e831c600ee --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_173.RULE @@ -0,0 +1 @@ +under the GNU Lesser General Public License (LGPL) version 2.1 or later. \ No newline at end of file diff --git a/src/licensedcode/data/rules/lgpl-2.1-plus_173.yml b/src/licensedcode/data/rules/lgpl-2.1-plus_173.yml new file mode 100644 index 00000000000..f57751a8d70 --- /dev/null +++ b/src/licensedcode/data/rules/lgpl-2.1-plus_173.yml @@ -0,0 +1,3 @@ +license_expression: lgpl-2.1-plus +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/libpng_18.RULE b/src/licensedcode/data/rules/libpng_18.RULE new file mode 100644 index 00000000000..504ac732c46 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_18.RULE @@ -0,0 +1 @@ +The license and copyright notes can be found in libpng/LICENSE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/libpng_18.yml b/src/licensedcode/data/rules/libpng_18.yml new file mode 100644 index 00000000000..387e0dc86c7 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_18.yml @@ -0,0 +1,5 @@ +license_expression: libpng +is_license_reference: yes +relevance: 100 +referenced_filenames: + - libpng/LICENSE diff --git a/src/licensedcode/data/rules/libpng_19.RULE b/src/licensedcode/data/rules/libpng_19.RULE new file mode 100644 index 00000000000..358a1ac72d4 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_19.RULE @@ -0,0 +1,4 @@ +This code is released under the libpng license. + For conditions of distribution and use, see the disclaimer + and license in png.h +/ \ No newline at end of file diff --git a/src/licensedcode/data/rules/libpng_19.yml b/src/licensedcode/data/rules/libpng_19.yml new file mode 100644 index 00000000000..b0a62d2940a --- /dev/null +++ b/src/licensedcode/data/rules/libpng_19.yml @@ -0,0 +1,5 @@ +license_expression: libpng +is_license_notice: yes +relevance: 100 +referenced_filenames: + - png.h diff --git a/src/licensedcode/data/rules/libpng_20.RULE b/src/licensedcode/data/rules/libpng_20.RULE new file mode 100644 index 00000000000..bfe1c947286 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_20.RULE @@ -0,0 +1,6 @@ +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +This code is released under the libpng license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/libpng_20.yml b/src/licensedcode/data/rules/libpng_20.yml new file mode 100644 index 00000000000..2af598d9484 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_20.yml @@ -0,0 +1,3 @@ +license_expression: libpng +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/libpng_21.RULE b/src/licensedcode/data/rules/libpng_21.RULE new file mode 100644 index 00000000000..3e401207e26 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_21.RULE @@ -0,0 +1,2 @@ +and are distributed according to the same +disclaimer and license as libpng \ No newline at end of file diff --git a/src/licensedcode/data/rules/libpng_21.yml b/src/licensedcode/data/rules/libpng_21.yml new file mode 100644 index 00000000000..ca6d4a05805 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_21.yml @@ -0,0 +1,3 @@ +license_expression: libpng +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/libpng_22.RULE b/src/licensedcode/data/rules/libpng_22.RULE new file mode 100644 index 00000000000..c58fa43e595 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_22.RULE @@ -0,0 +1 @@ +derived from libpng \ No newline at end of file diff --git a/src/licensedcode/data/rules/libpng_22.yml b/src/licensedcode/data/rules/libpng_22.yml new file mode 100644 index 00000000000..ca6d4a05805 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_22.yml @@ -0,0 +1,3 @@ +license_expression: libpng +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/libpng_23.RULE b/src/licensedcode/data/rules/libpng_23.RULE new file mode 100644 index 00000000000..c9c3cadb191 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_23.RULE @@ -0,0 +1,3 @@ +derived from libpng +and are distributed according to the same disclaimer and license as +libpng \ No newline at end of file diff --git a/src/licensedcode/data/rules/libpng_23.yml b/src/licensedcode/data/rules/libpng_23.yml new file mode 100644 index 00000000000..ca6d4a05805 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_23.yml @@ -0,0 +1,3 @@ +license_expression: libpng +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/libpng_24.RULE b/src/licensedcode/data/rules/libpng_24.RULE new file mode 100644 index 00000000000..51427ec29fa --- /dev/null +++ b/src/licensedcode/data/rules/libpng_24.RULE @@ -0,0 +1,2 @@ +Some files in the "scripts" directory have other copyright owners +but are released under this license. libpng \ No newline at end of file diff --git a/src/licensedcode/data/rules/libpng_24.yml b/src/licensedcode/data/rules/libpng_24.yml new file mode 100644 index 00000000000..2f5a421afa6 --- /dev/null +++ b/src/licensedcode/data/rules/libpng_24.yml @@ -0,0 +1,4 @@ +license_expression: libpng +is_license_reference: yes +relevance: 95 +minimum_coverage: 100 diff --git a/src/licensedcode/data/rules/mattkruse_1.RULE b/src/licensedcode/data/rules/mattkruse_1.RULE new file mode 100644 index 00000000000..8681200bcbc --- /dev/null +++ b/src/licensedcode/data/rules/mattkruse_1.RULE @@ -0,0 +1,16 @@ +WWW: http://www.mattkruse.com/ + +NOTICE: You may use this code for any purpose, commercial or +private, without any further permission from the author. You may +remove this notice from your final code if you wish, however it is +appreciated by the author if at least my web site address is kept. + +You may *NOT* re-distribute this code in any way except through its +use. That means, you can include it in your product, or your web +site, or any other form where the code is actually being used. You +may not put the plain javascript up on your site for download or +include it in your javascript libraries for download. +If you wish to share this code with others, please just point them +to the URL instead. +Please DO NOT link directly to my .js files from your site. Copy +the files to your server and use them there. Thank you. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mattkruse_1.yml b/src/licensedcode/data/rules/mattkruse_1.yml new file mode 100644 index 00000000000..d1a267d09c1 --- /dev/null +++ b/src/licensedcode/data/rules/mattkruse_1.yml @@ -0,0 +1,5 @@ +license_expression: mattkruse +is_license_text: yes +relevance: 100 +ignorable_urls: + - http://www.mattkruse.com/ diff --git a/src/licensedcode/data/rules/mentalis_1.yml b/src/licensedcode/data/rules/mentalis_1.yml index cbced6ebdfc..0fc568fe23e 100644 --- a/src/licensedcode/data/rules/mentalis_1.yml +++ b/src/licensedcode/data/rules/mentalis_1.yml @@ -1,2 +1,4 @@ license_expression: bsd-source-code is_license_text: yes +minimum_coverage: 96 + diff --git a/src/licensedcode/data/rules/mit-old-style_10.RULE b/src/licensedcode/data/rules/mit-old-style_10.RULE new file mode 100644 index 00000000000..608f0d177b5 --- /dev/null +++ b/src/licensedcode/data/rules/mit-old-style_10.RULE @@ -0,0 +1,7 @@ +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this +// permission notice appear in supporting documentation. +// The author make no representations about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit-old-style_10.yml b/src/licensedcode/data/rules/mit-old-style_10.yml new file mode 100644 index 00000000000..72f604e9c2a --- /dev/null +++ b/src/licensedcode/data/rules/mit-old-style_10.yml @@ -0,0 +1,3 @@ +license_expression: mit-old-style +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit-old-style_8.RULE b/src/licensedcode/data/rules/mit-old-style_8.RULE new file mode 100644 index 00000000000..0505fc1969c --- /dev/null +++ b/src/licensedcode/data/rules/mit-old-style_8.RULE @@ -0,0 +1,8 @@ +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this +// permission notice appear in supporting documentation. +// The author or Addison-Welsey Longman make no representations about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// http://loki-lib.sourceforge.net/index.php?n=Main.License \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit-old-style_8.yml b/src/licensedcode/data/rules/mit-old-style_8.yml new file mode 100644 index 00000000000..6a43a7df4e3 --- /dev/null +++ b/src/licensedcode/data/rules/mit-old-style_8.yml @@ -0,0 +1,7 @@ +license_expression: mit-old-style +is_license_text: yes +relevance: 100 +ignorable_authors: + - Addison-Welsey Longman +ignorable_urls: + - http://loki-lib.sourceforge.net/index.php?n=Main.License diff --git a/src/licensedcode/data/rules/mit-old-style_9.RULE b/src/licensedcode/data/rules/mit-old-style_9.RULE new file mode 100644 index 00000000000..e33497f5696 --- /dev/null +++ b/src/licensedcode/data/rules/mit-old-style_9.RULE @@ -0,0 +1,7 @@ +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this +// permission notice appear in supporting documentation. +// The author or Addison-Welsey Longman make no representations about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit-old-style_9.yml b/src/licensedcode/data/rules/mit-old-style_9.yml new file mode 100644 index 00000000000..cf1c81505a1 --- /dev/null +++ b/src/licensedcode/data/rules/mit-old-style_9.yml @@ -0,0 +1,5 @@ +license_expression: mit-old-style +is_license_text: yes +relevance: 100 +ignorable_authors: + - Addison-Welsey Longman diff --git a/src/licensedcode/data/rules/mit_368.RULE b/src/licensedcode/data/rules/mit_368.RULE new file mode 100644 index 00000000000..8b14e2961c9 --- /dev/null +++ b/src/licensedcode/data/rules/mit_368.RULE @@ -0,0 +1 @@ +which is MIT licensed \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_368.yml b/src/licensedcode/data/rules/mit_368.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_368.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_369.RULE b/src/licensedcode/data/rules/mit_369.RULE new file mode 100644 index 00000000000..aea003f0d44 --- /dev/null +++ b/src/licensedcode/data/rules/mit_369.RULE @@ -0,0 +1 @@ +Modified from https://github.com/geertw/php-ip-anonymizer, MIT license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_369.yml b/src/licensedcode/data/rules/mit_369.yml new file mode 100644 index 00000000000..0f5934639e4 --- /dev/null +++ b/src/licensedcode/data/rules/mit_369.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_reference: yes +relevance: 100 +ignorable_urls: + - https://github.com/geertw/php-ip-anonymizer diff --git a/src/licensedcode/data/rules/mit_370.RULE b/src/licensedcode/data/rules/mit_370.RULE new file mode 100644 index 00000000000..d7e98fc7ce4 --- /dev/null +++ b/src/licensedcode/data/rules/mit_370.RULE @@ -0,0 +1,2 @@ +Licensed under the MIT license + http://www.opensource.org/licenses/mit-license.php \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_370.yml b/src/licensedcode/data/rules/mit_370.yml new file mode 100644 index 00000000000..bd20f5cfe8c --- /dev/null +++ b/src/licensedcode/data/rules/mit_370.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/mit-license.php diff --git a/src/licensedcode/data/rules/mit_371.RULE b/src/licensedcode/data/rules/mit_371.RULE new file mode 100644 index 00000000000..327116dd6fa --- /dev/null +++ b/src/licensedcode/data/rules/mit_371.RULE @@ -0,0 +1,2 @@ +Licensed under the MIT license + https://www.opensource.org/licenses/mit-license.php \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_371.yml b/src/licensedcode/data/rules/mit_371.yml new file mode 100644 index 00000000000..00631a6fdc1 --- /dev/null +++ b/src/licensedcode/data/rules/mit_371.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://www.opensource.org/licenses/mit-license.php diff --git a/src/licensedcode/data/rules/mit_372.RULE b/src/licensedcode/data/rules/mit_372.RULE new file mode 100644 index 00000000000..896b579c468 --- /dev/null +++ b/src/licensedcode/data/rules/mit_372.RULE @@ -0,0 +1,2 @@ +You may use under the terms of the MIT license. Basically that +means you are free to use as long as this header is left intact. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_372.yml b/src/licensedcode/data/rules/mit_372.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_372.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_373.RULE b/src/licensedcode/data/rules/mit_373.RULE new file mode 100644 index 00000000000..d44b46914ec --- /dev/null +++ b/src/licensedcode/data/rules/mit_373.RULE @@ -0,0 +1 @@ +released under the MIT License \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_373.yml b/src/licensedcode/data/rules/mit_373.yml new file mode 100644 index 00000000000..bd20f5cfe8c --- /dev/null +++ b/src/licensedcode/data/rules/mit_373.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.opensource.org/licenses/mit-license.php diff --git a/src/licensedcode/data/rules/mit_374.RULE b/src/licensedcode/data/rules/mit_374.RULE new file mode 100644 index 00000000000..4b04e9ad8ce --- /dev/null +++ b/src/licensedcode/data/rules/mit_374.RULE @@ -0,0 +1 @@ +is released under the MIT License \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_374.yml b/src/licensedcode/data/rules/mit_374.yml new file mode 100644 index 00000000000..00631a6fdc1 --- /dev/null +++ b/src/licensedcode/data/rules/mit_374.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://www.opensource.org/licenses/mit-license.php diff --git a/src/licensedcode/data/rules/mit_375.RULE b/src/licensedcode/data/rules/mit_375.RULE new file mode 100644 index 00000000000..6f8b97ec78f --- /dev/null +++ b/src/licensedcode/data/rules/mit_375.RULE @@ -0,0 +1 @@ +released under the MIT License \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_375.yml b/src/licensedcode/data/rules/mit_375.yml new file mode 100644 index 00000000000..af986eb00c1 --- /dev/null +++ b/src/licensedcode/data/rules/mit_375.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://opensource.org/licenses/mit-license.php diff --git a/src/licensedcode/data/rules/mit_376.RULE b/src/licensedcode/data/rules/mit_376.RULE new file mode 100644 index 00000000000..d2c9835eddd --- /dev/null +++ b/src/licensedcode/data/rules/mit_376.RULE @@ -0,0 +1 @@ +X11 Licence \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_376.yml b/src/licensedcode/data/rules/mit_376.yml new file mode 100644 index 00000000000..802275a47d8 --- /dev/null +++ b/src/licensedcode/data/rules/mit_376.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_reference: yes +relevance: 90 diff --git a/src/licensedcode/data/rules/mit_377.RULE b/src/licensedcode/data/rules/mit_377.RULE new file mode 100644 index 00000000000..44e706da3e1 --- /dev/null +++ b/src/licensedcode/data/rules/mit_377.RULE @@ -0,0 +1,3 @@ +Licence + +This is released under the MIT license. It's fully open source. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_377.yml b/src/licensedcode/data/rules/mit_377.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_377.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_378.RULE b/src/licensedcode/data/rules/mit_378.RULE new file mode 100644 index 00000000000..7a3173a4ccd --- /dev/null +++ b/src/licensedcode/data/rules/mit_378.RULE @@ -0,0 +1,3 @@ +Licence + +This is released under the MIT license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_378.yml b/src/licensedcode/data/rules/mit_378.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_378.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_379.RULE b/src/licensedcode/data/rules/mit_379.RULE new file mode 100644 index 00000000000..ba01ce5573e --- /dev/null +++ b/src/licensedcode/data/rules/mit_379.RULE @@ -0,0 +1 @@ +This is released under the MIT license. It's fully open source. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_379.yml b/src/licensedcode/data/rules/mit_379.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_379.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_380.RULE b/src/licensedcode/data/rules/mit_380.RULE new file mode 100644 index 00000000000..4bc2e451ba8 --- /dev/null +++ b/src/licensedcode/data/rules/mit_380.RULE @@ -0,0 +1 @@ +This is released under the MIT license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_380.yml b/src/licensedcode/data/rules/mit_380.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_380.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_381.RULE b/src/licensedcode/data/rules/mit_381.RULE new file mode 100644 index 00000000000..272471e046a --- /dev/null +++ b/src/licensedcode/data/rules/mit_381.RULE @@ -0,0 +1 @@ +http://codemirror.net/LICENSE \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_381.yml b/src/licensedcode/data/rules/mit_381.yml new file mode 100644 index 00000000000..ead157f1c91 --- /dev/null +++ b/src/licensedcode/data/rules/mit_381.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_reference: yes +relevance: 95 +ignorable_urls: + - http://codemirror.net/LICENSE diff --git a/src/licensedcode/data/rules/mit_382.RULE b/src/licensedcode/data/rules/mit_382.RULE new file mode 100644 index 00000000000..3dc5dc065b8 --- /dev/null +++ b/src/licensedcode/data/rules/mit_382.RULE @@ -0,0 +1 @@ +License: jQuery-License. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_382.yml b/src/licensedcode/data/rules/mit_382.yml new file mode 100644 index 00000000000..685a0bfa1f8 --- /dev/null +++ b/src/licensedcode/data/rules/mit_382.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_383.RULE b/src/licensedcode/data/rules/mit_383.RULE new file mode 100644 index 00000000000..cd56dd77753 --- /dev/null +++ b/src/licensedcode/data/rules/mit_383.RULE @@ -0,0 +1 @@ +and is released under the MIT License: \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_383.yml b/src/licensedcode/data/rules/mit_383.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_383.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_384.RULE b/src/licensedcode/data/rules/mit_384.RULE new file mode 100644 index 00000000000..135cd712a60 --- /dev/null +++ b/src/licensedcode/data/rules/mit_384.RULE @@ -0,0 +1 @@ +is released under the MIT License: \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_384.yml b/src/licensedcode/data/rules/mit_384.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_384.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_385.RULE b/src/licensedcode/data/rules/mit_385.RULE new file mode 100644 index 00000000000..8788d8e3a01 --- /dev/null +++ b/src/licensedcode/data/rules/mit_385.RULE @@ -0,0 +1,20 @@ +The MIT License + +License for the specific language governing rights and limitations under +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_385.yml b/src/licensedcode/data/rules/mit_385.yml new file mode 100644 index 00000000000..95efa1912a2 --- /dev/null +++ b/src/licensedcode/data/rules/mit_385.yml @@ -0,0 +1,4 @@ +license_expression: mit +is_license_text: yes +relevance: 95 +notes: the text is damaged diff --git a/src/licensedcode/data/rules/mit_386.RULE b/src/licensedcode/data/rules/mit_386.RULE new file mode 100644 index 00000000000..cedce499a5c --- /dev/null +++ b/src/licensedcode/data/rules/mit_386.RULE @@ -0,0 +1,2 @@ +This code is licensed under the MIT License. See the FindCUDA.cmake script + for the text of the license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_386.yml b/src/licensedcode/data/rules/mit_386.yml new file mode 100644 index 00000000000..225f8ab8828 --- /dev/null +++ b/src/licensedcode/data/rules/mit_386.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +referenced_filenames: + - FindCUDA.cmake diff --git a/src/licensedcode/data/rules/mit_387.RULE b/src/licensedcode/data/rules/mit_387.RULE new file mode 100644 index 00000000000..5eab7253963 --- /dev/null +++ b/src/licensedcode/data/rules/mit_387.RULE @@ -0,0 +1 @@ +This code is licensed under the MIT License. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_387.yml b/src/licensedcode/data/rules/mit_387.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_387.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_388.RULE b/src/licensedcode/data/rules/mit_388.RULE new file mode 100644 index 00000000000..b60c43c590f --- /dev/null +++ b/src/licensedcode/data/rules/mit_388.RULE @@ -0,0 +1,2 @@ +This code is licensed under the MIT License. See the script + for the text of the license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_388.yml b/src/licensedcode/data/rules/mit_388.yml new file mode 100644 index 00000000000..2aaf29d7607 --- /dev/null +++ b/src/licensedcode/data/rules/mit_388.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_389.RULE b/src/licensedcode/data/rules/mit_389.RULE new file mode 100644 index 00000000000..7bfc89b0e07 --- /dev/null +++ b/src/licensedcode/data/rules/mit_389.RULE @@ -0,0 +1,2 @@ +License +MIT licensed. https://opensource.org/licenses/MIT \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_389.yml b/src/licensedcode/data/rules/mit_389.yml new file mode 100644 index 00000000000..37f25973781 --- /dev/null +++ b/src/licensedcode/data/rules/mit_389.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://opensource.org/licenses/MIT diff --git a/src/licensedcode/data/rules/mit_390.RULE b/src/licensedcode/data/rules/mit_390.RULE new file mode 100644 index 00000000000..7f2343ec21d --- /dev/null +++ b/src/licensedcode/data/rules/mit_390.RULE @@ -0,0 +1,3 @@ +License + +MIT licensed. See the bundled LICENSE file for more details. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_390.yml b/src/licensedcode/data/rules/mit_390.yml new file mode 100644 index 00000000000..85e26e99ea7 --- /dev/null +++ b/src/licensedcode/data/rules/mit_390.yml @@ -0,0 +1,5 @@ +license_expression: mit +is_license_notice: yes +relevance: 100 +referenced_filenames: + - LICENSE diff --git a/src/licensedcode/data/rules/mit_391.RULE b/src/licensedcode/data/rules/mit_391.RULE new file mode 100644 index 00000000000..cf2186b3d1f --- /dev/null +++ b/src/licensedcode/data/rules/mit_391.RULE @@ -0,0 +1,17 @@ +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: +list"> +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_391.yml b/src/licensedcode/data/rules/mit_391.yml new file mode 100644 index 00000000000..6608f7322e1 --- /dev/null +++ b/src/licensedcode/data/rules/mit_391.yml @@ -0,0 +1,3 @@ +license_expression: mit +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_and_cc-by-sa-4.0_1.RULE b/src/licensedcode/data/rules/mit_and_cc-by-sa-4.0_1.RULE new file mode 100644 index 00000000000..10a7e1b2f89 --- /dev/null +++ b/src/licensedcode/data/rules/mit_and_cc-by-sa-4.0_1.RULE @@ -0,0 +1 @@ +Modified from https://stackoverflow.com/a/2031935/450127, MIT license. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_and_cc-by-sa-4.0_1.yml b/src/licensedcode/data/rules/mit_and_cc-by-sa-4.0_1.yml new file mode 100644 index 00000000000..c92a1a12665 --- /dev/null +++ b/src/licensedcode/data/rules/mit_and_cc-by-sa-4.0_1.yml @@ -0,0 +1,6 @@ +license_expression: mit AND cc-by-sa-4.0 +is_license_reference: yes +relevance: 100 +notes: stackoverflow.com is not MIT-licensed +ignorable_urls: + - https://stackoverflow.com/a/2031935/450127 diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_15.RULE b/src/licensedcode/data/rules/mit_or_gpl-2.0_15.RULE new file mode 100644 index 00000000000..a090c007fbe --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_15.RULE @@ -0,0 +1 @@ +Licenses: MIT/GPL2 \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_15.yml b/src/licensedcode/data/rules/mit_or_gpl-2.0_15.yml new file mode 100644 index 00000000000..d53119bfaf7 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_15.yml @@ -0,0 +1,3 @@ +license_expression: mit OR gpl-2.0 +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_16.RULE b/src/licensedcode/data/rules/mit_or_gpl-2.0_16.RULE new file mode 100644 index 00000000000..3f94436c10e --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_16.RULE @@ -0,0 +1 @@ +This software is licensed under a dual license system (MIT or GPL version 2). This means you are free to choose with which of both licenses (MIT or GPL version 2) you want to use this library. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_16.yml b/src/licensedcode/data/rules/mit_or_gpl-2.0_16.yml new file mode 100644 index 00000000000..cffa8d80b91 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_16.yml @@ -0,0 +1,3 @@ +license_expression: mit OR gpl-2.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_17.RULE b/src/licensedcode/data/rules/mit_or_gpl-2.0_17.RULE new file mode 100644 index 00000000000..d5968b6dfb3 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_17.RULE @@ -0,0 +1 @@ +This software is licensed under a dual license system (MIT or GPL version 2). \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_17.yml b/src/licensedcode/data/rules/mit_or_gpl-2.0_17.yml new file mode 100644 index 00000000000..cffa8d80b91 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_17.yml @@ -0,0 +1,3 @@ +license_expression: mit OR gpl-2.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_18.RULE b/src/licensedcode/data/rules/mit_or_gpl-2.0_18.RULE new file mode 100644 index 00000000000..46516338494 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_18.RULE @@ -0,0 +1 @@ +MIT or GPL version 2 \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_or_gpl-2.0_18.yml b/src/licensedcode/data/rules/mit_or_gpl-2.0_18.yml new file mode 100644 index 00000000000..a88c196b959 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_gpl-2.0_18.yml @@ -0,0 +1,3 @@ +license_expression: mit OR gpl-2.0 +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/mit_or_lgpl-3.0_1.RULE b/src/licensedcode/data/rules/mit_or_lgpl-3.0_1.RULE new file mode 100644 index 00000000000..67a24526a17 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_lgpl-3.0_1.RULE @@ -0,0 +1,2 @@ +Dual licensed under the MIT and LGPLv3 licenses. +https://github.com/jquery-form/form#license \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_or_lgpl-3.0_1.yml b/src/licensedcode/data/rules/mit_or_lgpl-3.0_1.yml new file mode 100644 index 00000000000..e6936a7f1df --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_lgpl-3.0_1.yml @@ -0,0 +1,5 @@ +license_expression: mit OR lgpl-3.0 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://github.com/jquery-form/form#license diff --git a/src/licensedcode/data/rules/mit_or_lgpl-3.0_2.RULE b/src/licensedcode/data/rules/mit_or_lgpl-3.0_2.RULE new file mode 100644 index 00000000000..b1f7cc9be14 --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_lgpl-3.0_2.RULE @@ -0,0 +1 @@ +Dual licensed under the MIT and LGPLv3 licenses. \ No newline at end of file diff --git a/src/licensedcode/data/rules/mit_or_lgpl-3.0_2.yml b/src/licensedcode/data/rules/mit_or_lgpl-3.0_2.yml new file mode 100644 index 00000000000..75c0838cfaf --- /dev/null +++ b/src/licensedcode/data/rules/mit_or_lgpl-3.0_2.yml @@ -0,0 +1,3 @@ +license_expression: mit OR lgpl-3.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/not-a-license_259.RULE b/src/licensedcode/data/rules/not-a-license_259.RULE new file mode 100644 index 00000000000..fa48819549d --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_259.RULE @@ -0,0 +1,2 @@ +If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude + opencv_ffmpeg*.dll from your distribution; \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_259.yml b/src/licensedcode/data/rules/not-a-license_259.yml new file mode 100644 index 00000000000..adba252eb05 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_259.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: a commentary on FFmpeg licensing diff --git a/src/licensedcode/data/rules/not-a-license_268.RULE b/src/licensedcode/data/rules/not-a-license_268.RULE new file mode 100644 index 00000000000..a94476141c7 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_268.RULE @@ -0,0 +1 @@ +ENABLE_NONFREE "Enable non-free \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_268.yml b/src/licensedcode/data/rules/not-a-license_268.yml new file mode 100644 index 00000000000..9fb93733a19 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_268.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: code and not a license diff --git a/src/licensedcode/data/rules/not-a-license_269.RULE b/src/licensedcode/data/rules/not-a-license_269.RULE new file mode 100644 index 00000000000..89afcc9c039 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_269.RULE @@ -0,0 +1 @@ +# Apache 2.1 \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_269.yml b/src/licensedcode/data/rules/not-a-license_269.yml new file mode 100644 index 00000000000..983bbc776cb --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_269.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: about the HTTP server, not the license diff --git a/src/licensedcode/data/rules/not-a-license_335.RULE b/src/licensedcode/data/rules/not-a-license_335.RULE new file mode 100644 index 00000000000..acf62716a11 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_335.RULE @@ -0,0 +1 @@ +# Apache 2.2 \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_335.yml b/src/licensedcode/data/rules/not-a-license_335.yml new file mode 100644 index 00000000000..983bbc776cb --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_335.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: about the HTTP server, not the license diff --git a/src/licensedcode/data/rules/not-a-license_336.RULE b/src/licensedcode/data/rules/not-a-license_336.RULE new file mode 100644 index 00000000000..85141d22137 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_336.RULE @@ -0,0 +1 @@ +# Apache 2.3 \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_336.yml b/src/licensedcode/data/rules/not-a-license_336.yml new file mode 100644 index 00000000000..983bbc776cb --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_336.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: about the HTTP server, not the license diff --git a/src/licensedcode/data/rules/not-a-license_338.RULE b/src/licensedcode/data/rules/not-a-license_338.RULE new file mode 100644 index 00000000000..45138d5e610 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_338.RULE @@ -0,0 +1 @@ +# Apache 2.4 \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_338.yml b/src/licensedcode/data/rules/not-a-license_338.yml new file mode 100644 index 00000000000..983bbc776cb --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_338.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: about the HTTP server, not the license diff --git a/src/licensedcode/data/rules/not-a-license_339.RULE b/src/licensedcode/data/rules/not-a-license_339.RULE new file mode 100644 index 00000000000..48b3086a390 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_339.RULE @@ -0,0 +1 @@ +# Apache 2.5 \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_339.yml b/src/licensedcode/data/rules/not-a-license_339.yml new file mode 100644 index 00000000000..983bbc776cb --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_339.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: about the HTTP server, not the license diff --git a/src/licensedcode/data/rules/not-a-license_341.RULE b/src/licensedcode/data/rules/not-a-license_341.RULE new file mode 100644 index 00000000000..1f92704f7fa --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_341.RULE @@ -0,0 +1 @@ +# Apache 2.6 \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_341.yml b/src/licensedcode/data/rules/not-a-license_341.yml new file mode 100644 index 00000000000..983bbc776cb --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_341.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: about the HTTP server, not the license diff --git a/src/licensedcode/data/rules/not-a-license_342.RULE b/src/licensedcode/data/rules/not-a-license_342.RULE new file mode 100644 index 00000000000..2b84087a38b --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_342.RULE @@ -0,0 +1 @@ +JSHINT has some GPL Compatability issues, so we are faking it \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_342.yml b/src/licensedcode/data/rules/not-a-license_342.yml new file mode 100644 index 00000000000..b3a46db532b --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_342.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: comments on license diff --git a/src/licensedcode/data/rules/not-a-license_343.RULE b/src/licensedcode/data/rules/not-a-license_343.RULE new file mode 100644 index 00000000000..0416e6be1d4 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_343.RULE @@ -0,0 +1,2 @@ +* @var string + public $domain = ''; \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_343.yml b/src/licensedcode/data/rules/not-a-license_343.yml new file mode 100644 index 00000000000..68d3f578019 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_343.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: PHP code diff --git a/src/licensedcode/data/rules/not-a-license_344.RULE b/src/licensedcode/data/rules/not-a-license_344.RULE new file mode 100644 index 00000000000..ccf6852b248 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_344.RULE @@ -0,0 +1 @@ +that is intended to be stored in an image \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_344.yml b/src/licensedcode/data/rules/not-a-license_344.yml new file mode 100644 index 00000000000..62d15743c73 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_344.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: nothing about licenses diff --git a/src/licensedcode/data/rules/not-a-license_345.RULE b/src/licensedcode/data/rules/not-a-license_345.RULE new file mode 100644 index 00000000000..5b62f0f935f --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_345.RULE @@ -0,0 +1,3 @@ +If user builds ffmpeg/libav from source and wants OpenCV to stay BSD library, not GPL/LGPL, +he/she should use --enabled-shared configure flag and make sure that no GPL components are +enabled \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_345.yml b/src/licensedcode/data/rules/not-a-license_345.yml new file mode 100644 index 00000000000..adba252eb05 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_345.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: a commentary on FFmpeg licensing diff --git a/src/licensedcode/data/rules/not-a-license_346.RULE b/src/licensedcode/data/rules/not-a-license_346.RULE new file mode 100644 index 00000000000..4b54390a09e --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_346.RULE @@ -0,0 +1 @@ +OpenCV uses pre-built ffmpeg binaries, built with proper flags (without GPL components) \ No newline at end of file diff --git a/src/licensedcode/data/rules/not-a-license_346.yml b/src/licensedcode/data/rules/not-a-license_346.yml new file mode 100644 index 00000000000..adba252eb05 --- /dev/null +++ b/src/licensedcode/data/rules/not-a-license_346.yml @@ -0,0 +1,2 @@ +is_negative: yes +notes: a commentary on FFmpeg licensing diff --git a/src/licensedcode/data/rules/ofl-1.1_23.RULE b/src/licensedcode/data/rules/ofl-1.1_23.RULE new file mode 100644 index 00000000000..172c8523065 --- /dev/null +++ b/src/licensedcode/data/rules/ofl-1.1_23.RULE @@ -0,0 +1 @@ +License: SIL Open Font License, version 1.1. \ No newline at end of file diff --git a/src/licensedcode/data/rules/ofl-1.1_23.yml b/src/licensedcode/data/rules/ofl-1.1_23.yml new file mode 100644 index 00000000000..c39b1887eff --- /dev/null +++ b/src/licensedcode/data/rules/ofl-1.1_23.yml @@ -0,0 +1,3 @@ +license_expression: ofl-1.1 +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/ofl-1.1_24.RULE b/src/licensedcode/data/rules/ofl-1.1_24.RULE new file mode 100644 index 00000000000..759641e9f2c --- /dev/null +++ b/src/licensedcode/data/rules/ofl-1.1_24.RULE @@ -0,0 +1,3 @@ +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license available with a FAQ at: +http://scripts.sil.org/OFL \ No newline at end of file diff --git a/src/licensedcode/data/rules/ofl-1.1_24.yml b/src/licensedcode/data/rules/ofl-1.1_24.yml new file mode 100644 index 00000000000..cf1af019689 --- /dev/null +++ b/src/licensedcode/data/rules/ofl-1.1_24.yml @@ -0,0 +1,5 @@ +license_expression: ofl-1.1 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://scripts.sil.org/OFL diff --git a/src/licensedcode/data/rules/ofl-1.1_25.RULE b/src/licensedcode/data/rules/ofl-1.1_25.RULE new file mode 100644 index 00000000000..a2aeae0a9c3 --- /dev/null +++ b/src/licensedcode/data/rules/ofl-1.1_25.RULE @@ -0,0 +1,3 @@ +licensed under the SIL Open Font License, Version 1.1. +This license available with a FAQ at: +http://scripts.sil.org/OFL \ No newline at end of file diff --git a/src/licensedcode/data/rules/ofl-1.1_25.yml b/src/licensedcode/data/rules/ofl-1.1_25.yml new file mode 100644 index 00000000000..cf1af019689 --- /dev/null +++ b/src/licensedcode/data/rules/ofl-1.1_25.yml @@ -0,0 +1,5 @@ +license_expression: ofl-1.1 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://scripts.sil.org/OFL diff --git a/src/licensedcode/data/rules/other-permissive_131.RULE b/src/licensedcode/data/rules/other-permissive_131.RULE new file mode 100644 index 00000000000..c3a67aaec1f --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_131.RULE @@ -0,0 +1,10 @@ +* Warranty Information + * Even though I have reviewed this software, I makes no warranty + * or representation, either express or implied, with respect to this + * software, its quality, accuracy, merchantability, or fitness for a + * particular purpose. As a result, this software is provided "as is," + * and you, its user, are assuming the entire risk as to its quality + * and accuracy. + * + * This code may be used and freely distributed as long as it includes + * this copyright notice and the above warranty information. \ No newline at end of file diff --git a/src/licensedcode/data/rules/other-permissive_131.yml b/src/licensedcode/data/rules/other-permissive_131.yml new file mode 100644 index 00000000000..9efa3fc20a7 --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_131.yml @@ -0,0 +1,4 @@ +license_expression: other-permissive +is_license_text: yes +relevance: 100 +notes: This is really a wariant on the apple-attribution whee Apple is replaced by "i". diff --git a/src/licensedcode/data/rules/other-permissive_132.RULE b/src/licensedcode/data/rules/other-permissive_132.RULE new file mode 100644 index 00000000000..15c3653d127 --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_132.RULE @@ -0,0 +1,14 @@ +Below is the original copyright +//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +//THE SOFTWARE. + +//Do whatever you want with this code but if you find // +//a bug or make an improvement I would love to know! // +// // +//Warning This code is experimental // +//use at your own risk :) // \ No newline at end of file diff --git a/src/licensedcode/data/rules/other-permissive_132.yml b/src/licensedcode/data/rules/other-permissive_132.yml new file mode 100644 index 00000000000..283ec04b470 --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_132.yml @@ -0,0 +1,3 @@ +license_expression: other-permissive +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/other-permissive_133.RULE b/src/licensedcode/data/rules/other-permissive_133.RULE new file mode 100644 index 00000000000..eea00fe5644 --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_133.RULE @@ -0,0 +1,12 @@ +//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +//THE SOFTWARE. +//Do whatever you want with this code but if you find +//a bug or make an improvement I would love to know! +// +//Warning This code is experimental +//use at your own risk :) \ No newline at end of file diff --git a/src/licensedcode/data/rules/other-permissive_133.yml b/src/licensedcode/data/rules/other-permissive_133.yml new file mode 100644 index 00000000000..283ec04b470 --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_133.yml @@ -0,0 +1,3 @@ +license_expression: other-permissive +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/other-permissive_134.RULE b/src/licensedcode/data/rules/other-permissive_134.RULE new file mode 100644 index 00000000000..52d1f60c919 --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_134.RULE @@ -0,0 +1,5 @@ +//Do whatever you want with this code but if you find +//a bug or make an improvement I would love to know! +// +//Warning This code is experimental +//use at your own risk :) \ No newline at end of file diff --git a/src/licensedcode/data/rules/other-permissive_134.yml b/src/licensedcode/data/rules/other-permissive_134.yml new file mode 100644 index 00000000000..283ec04b470 --- /dev/null +++ b/src/licensedcode/data/rules/other-permissive_134.yml @@ -0,0 +1,3 @@ +license_expression: other-permissive +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/postgresql_10.RULE b/src/licensedcode/data/rules/postgresql_10.RULE new file mode 100644 index 00000000000..f3235628bcd --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_10.RULE @@ -0,0 +1,18 @@ +License: BSD + Permission to use, copy, modify, and distribute this software and + its documentation for any purpose, without fee, and without a + written agreement is hereby granted, provided that the above + copyright notice and this paragraph and the following two + paragraphs appear in all copies. + . + IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, + INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING + LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS + DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + . + THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS + IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, + SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. \ No newline at end of file diff --git a/src/licensedcode/data/rules/postgresql_10.yml b/src/licensedcode/data/rules/postgresql_10.yml new file mode 100644 index 00000000000..53b0aa8ba7c --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_10.yml @@ -0,0 +1,3 @@ +license_expression: postgresql +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/postgresql_18.RULE b/src/licensedcode/data/rules/postgresql_18.RULE new file mode 100644 index 00000000000..bfae7766783 --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_18.RULE @@ -0,0 +1,17 @@ +Permission to use, copy, modify, and distribute this software and + its documentation for any purpose, without fee, and without a + written agreement is hereby granted, provided that the above + copyright notice and this paragraph and the following two + paragraphs appear in all copies. + . + IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, + INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING + LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS + DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + . + THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS + IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, + SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. \ No newline at end of file diff --git a/src/licensedcode/data/rules/postgresql_18.yml b/src/licensedcode/data/rules/postgresql_18.yml new file mode 100644 index 00000000000..53b0aa8ba7c --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_18.yml @@ -0,0 +1,3 @@ +license_expression: postgresql +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/postgresql_19.RULE b/src/licensedcode/data/rules/postgresql_19.RULE new file mode 100644 index 00000000000..e73eb815c79 --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_19.RULE @@ -0,0 +1,17 @@ +Permission to use, copy, modify, and distribute this software and + its documentation for any purpose, without fee, and without a + written agreement is hereby granted, provided that the above + copyright notice and this paragraph and the following two + paragraphs appear in all copies. + . + IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, + INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING + LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS + DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + . + THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS + IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, + SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. \ No newline at end of file diff --git a/src/licensedcode/data/rules/postgresql_19.yml b/src/licensedcode/data/rules/postgresql_19.yml new file mode 100644 index 00000000000..53b0aa8ba7c --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_19.yml @@ -0,0 +1,3 @@ +license_expression: postgresql +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/postgresql_9.RULE b/src/licensedcode/data/rules/postgresql_9.RULE new file mode 100644 index 00000000000..d13664aaa26 --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_9.RULE @@ -0,0 +1,15 @@ +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose, without fee, and without a written agreement is +hereby granted, provided that the above copyright notice and this paragraph and +the following two paragraphs appear in all copies. + +IN NO EVENT SHALL THE BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST +PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF +THE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +THE SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND +THE HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, +UPDATES, ENHANCEMENTS, OR MODIFICATIONS. \ No newline at end of file diff --git a/src/licensedcode/data/rules/postgresql_9.yml b/src/licensedcode/data/rules/postgresql_9.yml new file mode 100644 index 00000000000..53b0aa8ba7c --- /dev/null +++ b/src/licensedcode/data/rules/postgresql_9.yml @@ -0,0 +1,3 @@ +license_expression: postgresql +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/proprietary-license_100.RULE b/src/licensedcode/data/rules/proprietary-license_100.RULE new file mode 100644 index 00000000000..105ec43aaf3 --- /dev/null +++ b/src/licensedcode/data/rules/proprietary-license_100.RULE @@ -0,0 +1,2 @@ +The C++ bindings need to be generated using an XSD Commercial Proprietary License. +See http://www.codesynthesis.com/products/xsd/license.xhtml for more information. \ No newline at end of file diff --git a/src/licensedcode/data/rules/proprietary-license_100.yml b/src/licensedcode/data/rules/proprietary-license_100.yml new file mode 100644 index 00000000000..0e722d26eb4 --- /dev/null +++ b/src/licensedcode/data/rules/proprietary-license_100.yml @@ -0,0 +1,5 @@ +license_expression: proprietary-license +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://www.codesynthesis.com/products/xsd/license.xhtml diff --git a/src/licensedcode/data/rules/proprietary-license_101.RULE b/src/licensedcode/data/rules/proprietary-license_101.RULE new file mode 100644 index 00000000000..330f9cc0f59 --- /dev/null +++ b/src/licensedcode/data/rules/proprietary-license_101.RULE @@ -0,0 +1,3 @@ +/ # You are free to use, change, or redistribute the code in any way you wish for +/ # non-commercial purposes, but please maintain the name of the original author. +/ # This code comes with no warranty of any kind. \ No newline at end of file diff --git a/src/licensedcode/data/rules/proprietary-license_101.yml b/src/licensedcode/data/rules/proprietary-license_101.yml new file mode 100644 index 00000000000..e55fcc24a28 --- /dev/null +++ b/src/licensedcode/data/rules/proprietary-license_101.yml @@ -0,0 +1,3 @@ +license_expression: proprietary-license +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/public-domain-disclaimer_38.RULE b/src/licensedcode/data/rules/public-domain-disclaimer_38.RULE new file mode 100644 index 00000000000..1c07018eec4 --- /dev/null +++ b/src/licensedcode/data/rules/public-domain-disclaimer_38.RULE @@ -0,0 +1,7 @@ +placed in +the public domain. Revised in subsequent years, still public domain. + +There's absolutely no warranty. + +Obviously, since this code is in the public domain, the above are not +requirements (there can be none), but merely suggestions. \ No newline at end of file diff --git a/src/licensedcode/data/rules/public-domain-disclaimer_38.yml b/src/licensedcode/data/rules/public-domain-disclaimer_38.yml new file mode 100644 index 00000000000..12015d6e64c --- /dev/null +++ b/src/licensedcode/data/rules/public-domain-disclaimer_38.yml @@ -0,0 +1,3 @@ +license_expression: public-domain-disclaimer +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/public-domain-disclaimer_39.RULE b/src/licensedcode/data/rules/public-domain-disclaimer_39.RULE new file mode 100644 index 00000000000..75012f1b557 --- /dev/null +++ b/src/licensedcode/data/rules/public-domain-disclaimer_39.RULE @@ -0,0 +1,2 @@ +Obviously, since this code is in the public domain, the above are not +requirements (there can be none), but merely suggestions. \ No newline at end of file diff --git a/src/licensedcode/data/rules/public-domain-disclaimer_39.yml b/src/licensedcode/data/rules/public-domain-disclaimer_39.yml new file mode 100644 index 00000000000..d5698394b79 --- /dev/null +++ b/src/licensedcode/data/rules/public-domain-disclaimer_39.yml @@ -0,0 +1,3 @@ +license_expression: public-domain-disclaimer +is_license_reference: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/public-domain_196.RULE b/src/licensedcode/data/rules/public-domain_196.RULE new file mode 100644 index 00000000000..2911d8307b6 --- /dev/null +++ b/src/licensedcode/data/rules/public-domain_196.RULE @@ -0,0 +1 @@ +released to public domain \ No newline at end of file diff --git a/src/licensedcode/data/rules/public-domain_196.yml b/src/licensedcode/data/rules/public-domain_196.yml new file mode 100644 index 00000000000..bba87100644 --- /dev/null +++ b/src/licensedcode/data/rules/public-domain_196.yml @@ -0,0 +1,3 @@ +license_expression: public-domain +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/public-domain_197.RULE b/src/licensedcode/data/rules/public-domain_197.RULE new file mode 100644 index 00000000000..b3201a81d1f --- /dev/null +++ b/src/licensedcode/data/rules/public-domain_197.RULE @@ -0,0 +1,2 @@ +// which has been released to public domain by The MathWorks and the +// National Institute of Standards and Technology (NIST). \ No newline at end of file diff --git a/src/licensedcode/data/rules/public-domain_197.yml b/src/licensedcode/data/rules/public-domain_197.yml new file mode 100644 index 00000000000..bba87100644 --- /dev/null +++ b/src/licensedcode/data/rules/public-domain_197.yml @@ -0,0 +1,3 @@ +license_expression: public-domain +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/tcl_10.RULE b/src/licensedcode/data/rules/tcl_10.RULE new file mode 100644 index 00000000000..f9a7b457d33 --- /dev/null +++ b/src/licensedcode/data/rules/tcl_10.RULE @@ -0,0 +1 @@ +Licence: Tcl \ No newline at end of file diff --git a/src/licensedcode/data/rules/tcl_10.yml b/src/licensedcode/data/rules/tcl_10.yml new file mode 100644 index 00000000000..7d76c1bfbd8 --- /dev/null +++ b/src/licensedcode/data/rules/tcl_10.yml @@ -0,0 +1,3 @@ +license_expression: tcl +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/tcl_9.RULE b/src/licensedcode/data/rules/tcl_9.RULE new file mode 100644 index 00000000000..14346877c72 --- /dev/null +++ b/src/licensedcode/data/rules/tcl_9.RULE @@ -0,0 +1 @@ +License: Tcl \ No newline at end of file diff --git a/src/licensedcode/data/rules/tcl_9.yml b/src/licensedcode/data/rules/tcl_9.yml new file mode 100644 index 00000000000..7d76c1bfbd8 --- /dev/null +++ b/src/licensedcode/data/rules/tcl_9.yml @@ -0,0 +1,3 @@ +license_expression: tcl +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/unknown-license-reference_118.RULE b/src/licensedcode/data/rules/unknown-license-reference_118.RULE new file mode 100644 index 00000000000..d1723713786 --- /dev/null +++ b/src/licensedcode/data/rules/unknown-license-reference_118.RULE @@ -0,0 +1,3 @@ +By downloading, copying, installing or using the software you agree to this license. + If you do not agree to this license, do not download, install, + copy or use the software. \ No newline at end of file diff --git a/src/licensedcode/data/rules/unknown-license-reference_118.yml b/src/licensedcode/data/rules/unknown-license-reference_118.yml new file mode 100644 index 00000000000..7020e93de3c --- /dev/null +++ b/src/licensedcode/data/rules/unknown-license-reference_118.yml @@ -0,0 +1,4 @@ +license_expression: unknown-license-reference +is_license_reference: yes +relevance: 100 +notes: often used as a lead-in to a bsd-new diff --git a/src/licensedcode/data/rules/w3c-software-doc-20150513_4.RULE b/src/licensedcode/data/rules/w3c-software-doc-20150513_4.RULE new file mode 100644 index 00000000000..db7df7d87fa --- /dev/null +++ b/src/licensedcode/data/rules/w3c-software-doc-20150513_4.RULE @@ -0,0 +1,3 @@ +* @license W3C-20150513 +* This content is licensed according to the W3C Software License at +* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document \ No newline at end of file diff --git a/src/licensedcode/data/rules/w3c-software-doc-20150513_4.yml b/src/licensedcode/data/rules/w3c-software-doc-20150513_4.yml new file mode 100644 index 00000000000..4b5b73a184d --- /dev/null +++ b/src/licensedcode/data/rules/w3c-software-doc-20150513_4.yml @@ -0,0 +1,5 @@ +license_expression: w3c-software-doc-20150513 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document diff --git a/src/licensedcode/data/rules/w3c-software-doc-20150513_5.RULE b/src/licensedcode/data/rules/w3c-software-doc-20150513_5.RULE new file mode 100644 index 00000000000..55ef5b37b62 --- /dev/null +++ b/src/licensedcode/data/rules/w3c-software-doc-20150513_5.RULE @@ -0,0 +1 @@ +* @license W3C-20150513 \ No newline at end of file diff --git a/src/licensedcode/data/rules/w3c-software-doc-20150513_5.yml b/src/licensedcode/data/rules/w3c-software-doc-20150513_5.yml new file mode 100644 index 00000000000..7849547899e --- /dev/null +++ b/src/licensedcode/data/rules/w3c-software-doc-20150513_5.yml @@ -0,0 +1,3 @@ +license_expression: w3c-software-doc-20150513 +is_license_tag: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/w3c-software-doc-20150513_6.RULE b/src/licensedcode/data/rules/w3c-software-doc-20150513_6.RULE new file mode 100644 index 00000000000..3006a2797ae --- /dev/null +++ b/src/licensedcode/data/rules/w3c-software-doc-20150513_6.RULE @@ -0,0 +1,2 @@ +* This content is licensed according to the W3C Software License at +* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document \ No newline at end of file diff --git a/src/licensedcode/data/rules/w3c-software-doc-20150513_6.yml b/src/licensedcode/data/rules/w3c-software-doc-20150513_6.yml new file mode 100644 index 00000000000..4b5b73a184d --- /dev/null +++ b/src/licensedcode/data/rules/w3c-software-doc-20150513_6.yml @@ -0,0 +1,5 @@ +license_expression: w3c-software-doc-20150513 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document diff --git a/src/licensedcode/data/rules/warranty-disclaimer_27.RULE b/src/licensedcode/data/rules/warranty-disclaimer_27.RULE new file mode 100644 index 00000000000..2bd58e2c0d1 --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_27.RULE @@ -0,0 +1,6 @@ +Warning : + This library and the associated files are non commercial, non professional + work. + It should not have unexpected results. However if any damage is caused by + this software the author can not be responsible. + The use of this software is at the risk of the user. \ No newline at end of file diff --git a/src/licensedcode/data/rules/warranty-disclaimer_27.yml b/src/licensedcode/data/rules/warranty-disclaimer_27.yml new file mode 100644 index 00000000000..3bf0969221d --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_27.yml @@ -0,0 +1,3 @@ +license_expression: warranty-disclaimer +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/warranty-disclaimer_28.RULE b/src/licensedcode/data/rules/warranty-disclaimer_28.RULE new file mode 100644 index 00000000000..bfdd2cea140 --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_28.RULE @@ -0,0 +1,4 @@ +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. \ No newline at end of file diff --git a/src/licensedcode/data/rules/warranty-disclaimer_28.yml b/src/licensedcode/data/rules/warranty-disclaimer_28.yml new file mode 100644 index 00000000000..3bf0969221d --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_28.yml @@ -0,0 +1,3 @@ +license_expression: warranty-disclaimer +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/warranty-disclaimer_29.RULE b/src/licensedcode/data/rules/warranty-disclaimer_29.RULE new file mode 100644 index 00000000000..a34e5a29feb --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_29.RULE @@ -0,0 +1,7 @@ +//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +//THE SOFTWARE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/warranty-disclaimer_29.yml b/src/licensedcode/data/rules/warranty-disclaimer_29.yml new file mode 100644 index 00000000000..3bf0969221d --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_29.yml @@ -0,0 +1,3 @@ +license_expression: warranty-disclaimer +is_license_text: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/warranty-disclaimer_30.RULE b/src/licensedcode/data/rules/warranty-disclaimer_30.RULE new file mode 100644 index 00000000000..857c93c5a95 --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_30.RULE @@ -0,0 +1,4 @@ +THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF +ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY +IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR +PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. \ No newline at end of file diff --git a/src/licensedcode/data/rules/warranty-disclaimer_30.yml b/src/licensedcode/data/rules/warranty-disclaimer_30.yml new file mode 100644 index 00000000000..68379ef1174 --- /dev/null +++ b/src/licensedcode/data/rules/warranty-disclaimer_30.yml @@ -0,0 +1,4 @@ +license_expression: warranty-disclaimer +is_license_text: yes +relevance: 100 +notes: a bare Microsoft disclaimer with no explicit grant of license diff --git a/src/licensedcode/data/rules/wtfpl-2.0_12.RULE b/src/licensedcode/data/rules/wtfpl-2.0_12.RULE new file mode 100644 index 00000000000..6f8379e9021 --- /dev/null +++ b/src/licensedcode/data/rules/wtfpl-2.0_12.RULE @@ -0,0 +1 @@ +Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). \ No newline at end of file diff --git a/src/licensedcode/data/rules/wtfpl-2.0_12.yml b/src/licensedcode/data/rules/wtfpl-2.0_12.yml new file mode 100644 index 00000000000..d1d3519c28c --- /dev/null +++ b/src/licensedcode/data/rules/wtfpl-2.0_12.yml @@ -0,0 +1,5 @@ +license_expression: wtfpl-2.0 +is_license_notice: yes +relevance: 100 +ignorable_urls: + - http://sam.zoy.org/wtfpl diff --git a/src/licensedcode/data/rules/wtfpl-2.0_13.RULE b/src/licensedcode/data/rules/wtfpl-2.0_13.RULE new file mode 100644 index 00000000000..8575fc12d0e --- /dev/null +++ b/src/licensedcode/data/rules/wtfpl-2.0_13.RULE @@ -0,0 +1 @@ +Licensed under the WTFPL \ No newline at end of file diff --git a/src/licensedcode/data/rules/wtfpl-2.0_13.yml b/src/licensedcode/data/rules/wtfpl-2.0_13.yml new file mode 100644 index 00000000000..670ce4722ac --- /dev/null +++ b/src/licensedcode/data/rules/wtfpl-2.0_13.yml @@ -0,0 +1,3 @@ +license_expression: wtfpl-2.0 +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/wtfpl-2.0_14.RULE b/src/licensedcode/data/rules/wtfpl-2.0_14.RULE new file mode 100644 index 00000000000..f18c593eb79 --- /dev/null +++ b/src/licensedcode/data/rules/wtfpl-2.0_14.RULE @@ -0,0 +1 @@ +WTFPL (http://sam.zoy.org/wtfpl/). \ No newline at end of file diff --git a/src/licensedcode/data/rules/wtfpl-2.0_14.yml b/src/licensedcode/data/rules/wtfpl-2.0_14.yml new file mode 100644 index 00000000000..685c1c712bd --- /dev/null +++ b/src/licensedcode/data/rules/wtfpl-2.0_14.yml @@ -0,0 +1,5 @@ +license_expression: wtfpl-2.0 +is_license_reference: yes +relevance: 100 +ignorable_urls: + - http://sam.zoy.org/wtfpl diff --git a/src/licensedcode/data/rules/x11-tiff_4.RULE b/src/licensedcode/data/rules/x11-tiff_4.RULE new file mode 100644 index 00000000000..f90c0bedfcf --- /dev/null +++ b/src/licensedcode/data/rules/x11-tiff_4.RULE @@ -0,0 +1,9 @@ +The licence agreement for this file is the same as the rest of the LibTiff +library. + +IN NO EVENT SHALL BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. \ No newline at end of file diff --git a/src/licensedcode/data/rules/x11-tiff_4.yml b/src/licensedcode/data/rules/x11-tiff_4.yml new file mode 100644 index 00000000000..c255fb05774 --- /dev/null +++ b/src/licensedcode/data/rules/x11-tiff_4.yml @@ -0,0 +1,3 @@ +license_expression: x11-tiff +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/x11-tiff_5.RULE b/src/licensedcode/data/rules/x11-tiff_5.RULE new file mode 100644 index 00000000000..5fcbbee08d3 --- /dev/null +++ b/src/licensedcode/data/rules/x11-tiff_5.RULE @@ -0,0 +1,2 @@ +The licence agreement for this file is the same as the rest of the LibTiff +library. \ No newline at end of file diff --git a/src/licensedcode/data/rules/x11-tiff_5.yml b/src/licensedcode/data/rules/x11-tiff_5.yml new file mode 100644 index 00000000000..c255fb05774 --- /dev/null +++ b/src/licensedcode/data/rules/x11-tiff_5.yml @@ -0,0 +1,3 @@ +license_expression: x11-tiff +is_license_notice: yes +relevance: 100 diff --git a/src/licensedcode/data/rules/x11_and_other-permissive_2.RULE b/src/licensedcode/data/rules/x11_and_other-permissive_2.RULE new file mode 100644 index 00000000000..38ffb375bb4 --- /dev/null +++ b/src/licensedcode/data/rules/x11_and_other-permissive_2.RULE @@ -0,0 +1,3 @@ +www.twilightuniverse.com */ + Software licenced under a modified X11 licence, + see documentation or authors website for more details */ \ No newline at end of file diff --git a/src/licensedcode/data/rules/x11_and_other-permissive_2.yml b/src/licensedcode/data/rules/x11_and_other-permissive_2.yml new file mode 100644 index 00000000000..74714ff99bf --- /dev/null +++ b/src/licensedcode/data/rules/x11_and_other-permissive_2.yml @@ -0,0 +1,9 @@ +license_expression: x11 AND other-permissive +is_license_text: yes +relevance: 95 +notes: Per author "This is a modified version of the X11 Licence (commonly known as the MIT + licence). The modifications relate to including not only the copyright notice, as per the + original X11, but also the authors URL. This is a trivial modification, and does not affect + any other part of the licence." +ignorable_urls: + - http://www.twilightuniverse.com/ diff --git a/src/licensedcode/data/rules/x11_and_other-permissive_3.RULE b/src/licensedcode/data/rules/x11_and_other-permissive_3.RULE new file mode 100644 index 00000000000..c2edca165ba --- /dev/null +++ b/src/licensedcode/data/rules/x11_and_other-permissive_3.RULE @@ -0,0 +1,9 @@ +Authors Website: http://www.twilightuniverse.com/ + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s), authors website url, and this permission notice appear in all copies of the Software and that the above copyright notice(s), authors url, and this permission notice appear in supporting documentation. + +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 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. \ No newline at end of file diff --git a/src/licensedcode/data/rules/x11_and_other-permissive_3.yml b/src/licensedcode/data/rules/x11_and_other-permissive_3.yml new file mode 100644 index 00000000000..be0364dac13 --- /dev/null +++ b/src/licensedcode/data/rules/x11_and_other-permissive_3.yml @@ -0,0 +1,11 @@ +license_expression: x11 AND other-permissive +is_license_text: yes +relevance: 95 +notes: Per author "This is a modified version of the X11 Licence (commonly known as the MIT + licence). The modifications relate to including not only the copyright notice, as per the + original X11, but also the authors URL. This is a trivial modification, and does not affect + any other part of the licence." +ignorable_authors: + - Website http://www.twilightuniverse.com +ignorable_urls: + - http://www.twilightuniverse.com/ diff --git a/src/licensedcode/data/rules/zlib_41.RULE b/src/licensedcode/data/rules/zlib_41.RULE new file mode 100644 index 00000000000..94cbb607402 --- /dev/null +++ b/src/licensedcode/data/rules/zlib_41.RULE @@ -0,0 +1,16 @@ +License: other + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. \ No newline at end of file diff --git a/src/licensedcode/data/rules/zlib_41.yml b/src/licensedcode/data/rules/zlib_41.yml new file mode 100644 index 00000000000..c84bccd7192 --- /dev/null +++ b/src/licensedcode/data/rules/zlib_41.yml @@ -0,0 +1,3 @@ +license_expression: zlib +is_license_text: yes +relevance: 100 diff --git a/src/packagedcode/cargo.py b/src/packagedcode/cargo.py index d8b6eb86b46..6dc81d7eb2e 100644 --- a/src/packagedcode/cargo.py +++ b/src/packagedcode/cargo.py @@ -27,12 +27,11 @@ from __future__ import unicode_literals from collections import OrderedDict -import io -import toml import logging import re import attr +import toml from commoncode import filetype from commoncode import fileutils @@ -109,7 +108,7 @@ def build_package(package_data): authors = core_package_data.get('authors') parties = list(party_mapper(authors, party_role='author')) - + declared_license = core_package_data.get('license') package = RustCargoCrate( @@ -117,7 +116,7 @@ def build_package(package_data): version=version, description=description, parties=parties, - declared_license = declared_license + declared_license=declared_license ) return package diff --git a/src/packagedcode/conda.py b/src/packagedcode/conda.py index 5dd3f1f53c8..539cd4e9e05 100644 --- a/src/packagedcode/conda.py +++ b/src/packagedcode/conda.py @@ -66,7 +66,7 @@ def logger_debug(*args): @attr.s() class CondaPackage(models.Package): - metafiles = ('meta.yaml', 'META.yml',) + metafiles = ('meta.yaml', 'META.yml',) default_type = 'conda' default_web_baseurl = None default_download_baseurl = 'https://repo.continuum.io/pkgs/free' @@ -158,7 +158,7 @@ def build_package(package_data): package.description = value elif key == 'dev_url' and value: package.vcs_url = value - + # Handle the about element requirements_element = package_data.get('requirements') if requirements_element: @@ -169,7 +169,7 @@ def build_package(package_data): package_dependencies = [] for dependency in value: requirement = None - for splitter in ('==', '>=', '<=', '>', '<'): + for splitter in ('==', '>=', '<=', '>', '<'): if splitter in dependency: splits = dependency.split(splitter) # Replace the package name and keep the relationship and version @@ -190,7 +190,7 @@ def build_package(package_data): package.dependencies = package_dependencies return package - + def get_yaml_data(location): """ Get variables and parse the yaml file, replace the variable with the value and return dictionary. @@ -207,11 +207,11 @@ def get_yaml_data(location): # Replace the variable with the value if '{{' in line and '}}' in line: for variable, value in variables.items(): - line = line.replace('{{ ' + variable + ' }}', value) + line = line.replace('{{ ' + variable + ' }}', value) yaml_lines.append(line) return saneyaml.load('\n'.join(yaml_lines)) - - + + def get_variables(location): """ Conda yaml will have variables defined at the beginning of the file, the idea is to parse it and return a dictionary of the variable and value diff --git a/src/packagedcode/cran.py b/src/packagedcode/cran.py index 908836caf8a..2657c9b964f 100644 --- a/src/packagedcode/cran.py +++ b/src/packagedcode/cran.py @@ -30,12 +30,12 @@ import logging import attr - -from commoncode import saneyaml +import saneyaml from packagedcode import models from packageurl import PackageURL + """ Handle CRAN package. R is a programming languages and CRAN its package repository. @@ -110,7 +110,7 @@ def build_package(package_data): if dependencies: for dependency in dependencies.split(',\n'): requirement = None - for splitter in ('==', '>=', '<=', '>', '<'): + for splitter in ('==', '>=', '<=', '>', '<'): if splitter in dependency: splits = dependency.split(splitter) # Replace the package name and keep the relationship and version @@ -130,16 +130,17 @@ def build_package(package_data): ) package = CranPackage( name=name, - version = package_data.get('Version'), - description = package_data.get('Description', '') or package_data.get('Title', ''), - declared_license = package_data.get('License'), - parties = parties, - dependencies = package_dependencies, - #TODO: Let's handle the release date as a Date type - #release_date = package_data.get('Date/Publication'), + version=package_data.get('Version'), + description=package_data.get('Description', '') or package_data.get('Title', ''), + declared_license=package_data.get('License'), + parties=parties, + dependencies=package_dependencies, + # TODO: Let's handle the release date as a Date type + # release_date = package_data.get('Date/Publication'), ) return package + def get_yaml_data(location): """ Parse the yaml file and return the metadata in dictionary format. @@ -151,7 +152,8 @@ def get_yaml_data(location): continue yaml_lines.append(line) return saneyaml.load('\n'.join(yaml_lines)) - + + def get_party_info(info): """ Parse the info and return name, email. diff --git a/src/packagedcode/freebsd.py b/src/packagedcode/freebsd.py index aea2a1f5ebd..a025fa6831f 100644 --- a/src/packagedcode/freebsd.py +++ b/src/packagedcode/freebsd.py @@ -84,17 +84,17 @@ def compute_normalized_license(declared_license): return license_logic = declared_license.get('licenselogic') - relation= 'AND' + relation = 'AND' if license_logic: if license_logic == 'or' or license_logic == 'dual': relation = 'OR' - + detected_licenses = [] for declared in licenses: detected_license = models.compute_normalized_license(declared) if detected_license: detected_licenses.append(detected_license) - + if detected_licenses: return combine_expressions(detected_licenses, relation) @@ -185,7 +185,7 @@ def license_mapper(package_data, package): declared_license['licenses'] = lics if license_logic: declared_license['licenselogic'] = license_logic - + package.declared_license = declared_license return package diff --git a/src/packagedcode/plugin_package.py b/src/packagedcode/plugin_package.py index 5600815b328..a593d39f191 100644 --- a/src/packagedcode/plugin_package.py +++ b/src/packagedcode/plugin_package.py @@ -28,11 +28,13 @@ from __future__ import unicode_literals from collections import OrderedDict +import posixpath import attr import click click.disable_unicode_literals_warning = True +from commoncode.fileutils import parent_directory from plugincode.scan import ScanPlugin from plugincode.scan import scan_impl from scancode import CommandLineOption @@ -43,7 +45,6 @@ from packagedcode import PACKAGE_TYPES - def print_packages(ctx, param, value): if not value or ctx.resilient_parsing: return @@ -146,7 +147,38 @@ def set_packages_at_root(resource, codebase): if not package_root: # this can happen if we scan a single resource that is a package manifest - return + continue + + if package_root == resource: + continue + + # here new_package_root != resource: + + # What if the target resource (e.g. a parent) is the root and we are in stripped root mode? + if package_root.is_root and codebase.strip_root: + continue + + # Determine if this package applies to more than just the manifest + # file (typically it means the whole parent directory is the + # package) and if yes: + # 1. fetch this resource + # 2. move the package data to this new resource + # 3. set the manifest_path if needed. + # 4. save. + + # TODO: this is a hack for the ABOUT file Package parser, ABOUT files are kept alongside + # the resource its for + if package_root.is_file and resource.path.endswith('.ABOUT'): + new_manifest_path = posixpath.join(parent_directory(package_root.path), resource.name) + else: + # here we have a relocated Resource and we compute the manifest path + # relative to the new package root + # TODO: We should have codebase relative paths for manifests + new_package_root_path = package_root.path and package_root.path.strip('/') + if new_package_root_path: + _, _, new_manifest_path = resource.path.partition(new_package_root_path) + # note we could have also deserialized and serialized again instead + package_info['manifest_path'] = new_manifest_path.lstrip('/') package_root.packages.append(package_info) codebase.save_resource(package_root) diff --git a/src/packagedcode/rpm.py b/src/packagedcode/rpm.py index 03d91f9391e..603e057222b 100644 --- a/src/packagedcode/rpm.py +++ b/src/packagedcode/rpm.py @@ -92,7 +92,7 @@ def get_rpm_tags(location, include_desc=False): Include the long RPM description value if `include_desc` is True. """ T = typecode.contenttype.get_type(location) - + if 'rpm' not in T.filetype_file.lower(): return @@ -167,7 +167,7 @@ def parse(location): epoch = tags.epoch and int(tags.epoch) or None except ValueError: epoch = None - + evr = EVR( version=tags.version or None, release=tags.release or None, @@ -207,8 +207,8 @@ def parse(location): parties.append(models.Party(name=tags.vendor, role='vendor')) description = build_description(tags.summary, tags.description) - - if TRACE: + + if TRACE: data = dict( name=name, version=evr, @@ -227,7 +227,7 @@ def parse(location): parties=parties, declared_license=tags.license or None, source_packages=source_packages) - if TRACE: + if TRACE: logger_debug('parse: created package:\n', package) return package diff --git a/src/scancode/plugin_consolidate.py b/src/scancode/plugin_consolidate.py index 827f111884b..15af0a160ec 100644 --- a/src/scancode/plugin_consolidate.py +++ b/src/scancode/plugin_consolidate.py @@ -192,8 +192,8 @@ def process_codebase(self, codebase, **kwargs): codebase.attributes.consolidated_components = consolidated_components = [] identifier_counts = Counter() for index, c in enumerate(consolidations, start=1): - # Skip consolidation if it does not have any Resources - if not c.consolidation.resources: + # Skip consolidation if it does not have any Files + if c.consolidation.files_count == 0: continue if isinstance(c, ConsolidatedPackage): # We use the purl as the identifier for ConsolidatedPackages @@ -338,6 +338,9 @@ def get_license_holders_consolidated_components(codebase): if child.is_file: license_expression = combine_expressions(child.license_expressions) holders = tuple(h['value'] for h in child.holders) + child.extra_data['license_expression'] = license_expression + child.extra_data['holders'] = holders + child.save(codebase) if not license_expression or not holders: continue origin = holders, license_expression @@ -360,25 +363,31 @@ def get_license_holders_consolidated_components(codebase): origin_key, top_count = origin_count.most_common(1)[0] if is_majority(top_count, resource.files_count): majority_holders, majority_license_expression = origin_translation_table[origin_key] - resource.extra_data['origin_summary_license_expression'] = majority_license_expression - resource.extra_data['origin_summary_holders'] = majority_holders - resource.extra_data['origin_summary_count'] = top_count + resource.extra_data['license_expression'] = majority_license_expression + resource.extra_data['holders'] = majority_holders resource.save(codebase) # Create consolidated components for a child that has a majority # that is different than the one we have now for child in children: - origin_summary_license_expression = child.extra_data.get('origin_summary_license_expression') - origin_summary_holders = child.extra_data.get('origin_summary_holders') - if (origin_summary_license_expression and origin_summary_holders - and origin_summary_license_expression != majority_license_expression - and origin_summary_holders != majority_holders): + # We are only looking at directories so we can summarize to them + if not child.is_dir: + continue + license_expression = child.extra_data.get('license_expression') + holders = child.extra_data.get('holders') + # If there is a child directory that has a different majority than its parent, + # we report it + if ((license_expression and license_expression != majority_license_expression) + or (holders and holders != majority_holders)): c = create_license_holders_consolidated_component(child, codebase) if c: yield c else: # If there is no majority, we see if any of our child directories had majorities for child in children: + # Again, we are only looking at directories so we can summarize to them + if not child.is_dir: + continue c = create_license_holders_consolidated_component(child, codebase) if c: yield c @@ -404,8 +413,11 @@ def create_license_holders_consolidated_component(resource, codebase): Return a ConsolidatedComponent for `resource` if it can be summarized on license expression and holders """ - license_expression = resource.extra_data.get('origin_summary_license_expression') - holders = resource.extra_data.get('origin_summary_holders') + # We only want to create ConsolidatedComponents from directory Resources + if not resource.is_dir: + return + license_expression = resource.extra_data.get('license_expression') + holders = resource.extra_data.get('holders') if license_expression and holders: component_resources = get_consolidated_component_resources(resource, codebase) if component_resources: @@ -425,21 +437,16 @@ def get_consolidated_component_resources(resource, codebase): """ Return a list of resources to be used to create a ConsolidatedComponent from `resource` """ - license_expression = resource.extra_data.get('origin_summary_license_expression') - holders = resource.extra_data.get('origin_summary_holders') + license_expression = resource.extra_data.get('license_expression') + holders = resource.extra_data.get('holders') if not license_expression and holders: return resources = [] if resource.extra_data.get('in_package_component') else [resource] for r in resource.walk(codebase, topdown=False): if r.extra_data.get('in_package_component'): continue - resource_holders = tuple(h.get('value') for h in r.holders) - if ((r.is_file - and combine_expressions(r.license_expressions) == license_expression - and resource_holders == holders) - or (r.is_dir - and r.extra_data.get('origin_summary_license_expression', '') == license_expression - and r.extra_data.get('origin_summary_holders', tuple()) == holders)): + if (r.extra_data.get('license_expression', '') == license_expression + and r.extra_data.get('holders', tuple()) == holders): resources.append(r) return resources @@ -452,8 +459,8 @@ def combine_license_holders_consolidated_components(components): origin_translation_table = {} components_by_holders_license_expression = defaultdict(list) for component in components: - if (not isinstance(component, ConsolidatedComponent) - or (isinstance(component, ConsolidatedComponent) and component.type != 'license-holders')): + is_consolidated_component = isinstance(component, ConsolidatedComponent) + if not is_consolidated_component or (is_consolidated_component and component.type != 'license-holders'): # Yield the components we don't handle yield component continue diff --git a/src/summarycode/generated.py b/src/summarycode/generated.py index 2de1c62f361..28d9a69feb7 100644 --- a/src/summarycode/generated.py +++ b/src/summarycode/generated.py @@ -168,15 +168,15 @@ def generated_scanner(location, **kwargs): 'This file has been generated by the GUI designer. Do not modify', 'file is generated by gopy gen. do not edit.', - - #https://github.com/Microsoft/azure-devops-python-api/blob/0d9537016bd45cf7f2140433c0ec54b44768f726/vsts/vsts/licensing/v4_1/licensing_client.py + + # https://github.com/Microsoft/azure-devops-python-api/blob/0d9537016bd45cf7f2140433c0ec54b44768f726/vsts/vsts/licensing/v4_1/licensing_client.py 'generated file, do not edit', 'changes may cause incorrect behavior and will be lost if the code is regenerated.', 'this file is generated. best not to modify it, as it will likely be overwritten.', # in Ogg/Vorbis 'function: static codebooks autogenerated by', - + # yarn lock 'THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.', 'This file has been automatically created by', diff --git a/tests/formattedcode/data/csv/expressions/expected.csv b/tests/formattedcode/data/csv/expressions/expected.csv index 0172f01b251..28f52c2b52d 100644 --- a/tests/formattedcode/data/csv/expressions/expected.csv +++ b/tests/formattedcode/data/csv/expressions/expected.csv @@ -1,4 +1,4 @@ Resource,type,scan_errors,license_expression -/apache-2.0.LICENSE,file,, -/apache-2.0.LICENSE,,,apache-2.0 -/apache-2.0.LICENSE,,,mit +apache-2.0.LICENSE,file,, +apache-2.0.LICENSE,,,apache-2.0 +apache-2.0.LICENSE,,,mit diff --git a/tests/formattedcode/data/csv/flatten_scan/full.json-expected b/tests/formattedcode/data/csv/flatten_scan/full.json-expected index 584a51915a8..079634bb08d 100644 --- a/tests/formattedcode/data/csv/flatten_scan/full.json-expected +++ b/tests/formattedcode/data/csv/flatten_scan/full.json-expected @@ -1,6 +1,6 @@ [ { - "Resource": "/samples/", + "Resource": "samples/", "type": "directory", "name": "samples", "base_name": "samples", @@ -24,7 +24,7 @@ "scan_errors": "" }, { - "Resource": "/samples/README", + "Resource": "samples/README", "type": "file", "name": "README", "base_name": "README", @@ -48,19 +48,19 @@ "scan_errors": "" }, { - "Resource": "/samples/README", + "Resource": "samples/README", "url": "http://zlib.net/zlib-1.2.8.tar.gz", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/README", + "Resource": "samples/README", "url": "http://master.dl.sourceforge.net/project/javagroups/JGroups/2.10.0.GA/JGroups-2.10.0.GA.src.zip", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/screenshot.png", + "Resource": "samples/screenshot.png", "type": "file", "name": "screenshot.png", "base_name": "screenshot", @@ -84,7 +84,7 @@ "scan_errors": "" }, { - "Resource": "/samples/arch/", + "Resource": "samples/arch/", "type": "directory", "name": "arch", "base_name": "arch", @@ -108,7 +108,7 @@ "scan_errors": "" }, { - "Resource": "/samples/arch/zlib.tar.gz", + "Resource": "samples/arch/zlib.tar.gz", "type": "file", "name": "zlib.tar.gz", "base_name": "zlib", @@ -132,7 +132,7 @@ "scan_errors": "" }, { - "Resource": "/samples/arch/zlib.tar.gz", + "Resource": "samples/arch/zlib.tar.gz", "package__type": "tarball", "package__namespace": "", "package__name": "", @@ -153,7 +153,7 @@ "package__contains_source_code": "" }, { - "Resource": "/samples/JGroups/", + "Resource": "samples/JGroups/", "type": "directory", "name": "JGroups", "base_name": "JGroups", @@ -177,7 +177,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "type": "file", "name": "EULA", "base_name": "EULA", @@ -201,7 +201,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "license__key": "jboss-eula", "license__score": "100.00", "license__short_name": "JBoss EULA", @@ -224,49 +224,49 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "copyright": "Copyright 2006 Red Hat, Inc.", "start_line": 104, "end_line": 104 }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "copyright_holder": "Red Hat, Inc.", "start_line": 104, "end_line": 104 }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "url": "http://www.opensource.org/licenses/index.php", "start_line": 24, "end_line": 24 }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "url": "http://www.jboss.org/", "start_line": 27, "end_line": 27 }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "url": "http://www.redhat.com/about/corporate/trademark", "start_line": 40, "end_line": 40 }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "url": "http://www.jboss.com/company/logos", "start_line": 43, "end_line": 43 }, { - "Resource": "/samples/JGroups/EULA", + "Resource": "samples/JGroups/EULA", "url": "http://www.redhat.com/licenses", "start_line": 94, "end_line": 94 }, { - "Resource": "/samples/JGroups/LICENSE", + "Resource": "samples/JGroups/LICENSE", "type": "file", "name": "LICENSE", "base_name": "LICENSE", @@ -290,7 +290,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/LICENSE", + "Resource": "samples/JGroups/LICENSE", "license__key": "lgpl-2.1-plus", "license__score": "100.00", "license__short_name": "LGPL 2.1 or later", @@ -313,31 +313,31 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/LICENSE", + "Resource": "samples/JGroups/LICENSE", "copyright": "Copyright (c) 1991, 1999 Free Software Foundation, Inc.", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/JGroups/LICENSE", + "Resource": "samples/JGroups/LICENSE", "copyright": "copyrighted by the Free Software Foundation", "start_line": 428, "end_line": 428 }, { - "Resource": "/samples/JGroups/LICENSE", + "Resource": "samples/JGroups/LICENSE", "copyright_holder": "Free Software Foundation, Inc.", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/JGroups/LICENSE", + "Resource": "samples/JGroups/LICENSE", "copyright_holder": "the Free Software Foundation", "start_line": 428, "end_line": 428 }, { - "Resource": "/samples/JGroups/licenses/", + "Resource": "samples/JGroups/licenses/", "type": "directory", "name": "licenses", "base_name": "licenses", @@ -361,7 +361,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/licenses/apache-1.1.txt", + "Resource": "samples/JGroups/licenses/apache-1.1.txt", "type": "file", "name": "apache-1.1.txt", "base_name": "apache-1.1", @@ -385,7 +385,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/licenses/apache-1.1.txt", + "Resource": "samples/JGroups/licenses/apache-1.1.txt", "license__key": "apache-1.1", "license__score": "100.00", "license__short_name": "Apache 1.1", @@ -408,37 +408,37 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/licenses/apache-1.1.txt", + "Resource": "samples/JGroups/licenses/apache-1.1.txt", "copyright": "Copyright (c) 2000 The Apache Software Foundation.", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/JGroups/licenses/apache-1.1.txt", + "Resource": "samples/JGroups/licenses/apache-1.1.txt", "copyright_holder": "The Apache Software Foundation.", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/JGroups/licenses/apache-1.1.txt", + "Resource": "samples/JGroups/licenses/apache-1.1.txt", "author": "the Apache Software Foundation (http://www.apache.org/).", "start_line": 21, "end_line": 21 }, { - "Resource": "/samples/JGroups/licenses/apache-1.1.txt", + "Resource": "samples/JGroups/licenses/apache-1.1.txt", "email": "apache@apache.org", "start_line": 29, "end_line": 29 }, { - "Resource": "/samples/JGroups/licenses/apache-1.1.txt", + "Resource": "samples/JGroups/licenses/apache-1.1.txt", "url": "http://www.apache.org/", "start_line": 22, "end_line": 22 }, { - "Resource": "/samples/JGroups/licenses/apache-2.0.txt", + "Resource": "samples/JGroups/licenses/apache-2.0.txt", "type": "file", "name": "apache-2.0.txt", "base_name": "apache-2.0", @@ -462,7 +462,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/licenses/apache-2.0.txt", + "Resource": "samples/JGroups/licenses/apache-2.0.txt", "license__key": "apache-2.0", "license__score": "100.00", "license__short_name": "Apache 2.0", @@ -485,19 +485,19 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/licenses/apache-2.0.txt", + "Resource": "samples/JGroups/licenses/apache-2.0.txt", "url": "http://www.apache.org/licenses/", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/JGroups/licenses/apache-2.0.txt", + "Resource": "samples/JGroups/licenses/apache-2.0.txt", "url": "http://www.apache.org/licenses/LICENSE-2.0", "start_line": 196, "end_line": 196 }, { - "Resource": "/samples/JGroups/licenses/bouncycastle.txt", + "Resource": "samples/JGroups/licenses/bouncycastle.txt", "type": "file", "name": "bouncycastle.txt", "base_name": "bouncycastle", @@ -521,7 +521,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/licenses/bouncycastle.txt", + "Resource": "samples/JGroups/licenses/bouncycastle.txt", "license__key": "mit", "license__score": "100.00", "license__short_name": "MIT License", @@ -544,25 +544,25 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/licenses/bouncycastle.txt", + "Resource": "samples/JGroups/licenses/bouncycastle.txt", "copyright": "Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)", "start_line": 5, "end_line": 5 }, { - "Resource": "/samples/JGroups/licenses/bouncycastle.txt", + "Resource": "samples/JGroups/licenses/bouncycastle.txt", "copyright_holder": "The Legion Of The Bouncy Castle", "start_line": 5, "end_line": 5 }, { - "Resource": "/samples/JGroups/licenses/bouncycastle.txt", + "Resource": "samples/JGroups/licenses/bouncycastle.txt", "url": "http://www.bouncycastle.org/", "start_line": 5, "end_line": 5 }, { - "Resource": "/samples/JGroups/licenses/cpl-1.0.txt", + "Resource": "samples/JGroups/licenses/cpl-1.0.txt", "type": "file", "name": "cpl-1.0.txt", "base_name": "cpl-1.0", @@ -586,7 +586,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/licenses/cpl-1.0.txt", + "Resource": "samples/JGroups/licenses/cpl-1.0.txt", "license__key": "cpl-1.0", "license__score": "99.94", "license__short_name": "CPL 1.0", @@ -609,7 +609,7 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/licenses/lgpl.txt", + "Resource": "samples/JGroups/licenses/lgpl.txt", "type": "file", "name": "lgpl.txt", "base_name": "lgpl", @@ -633,7 +633,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/licenses/lgpl.txt", + "Resource": "samples/JGroups/licenses/lgpl.txt", "license__key": "lgpl-2.1-plus", "license__score": "100.00", "license__short_name": "LGPL 2.1 or later", @@ -656,31 +656,31 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/licenses/lgpl.txt", + "Resource": "samples/JGroups/licenses/lgpl.txt", "copyright": "Copyright (c) 1991, 1999 Free Software Foundation, Inc.", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/JGroups/licenses/lgpl.txt", + "Resource": "samples/JGroups/licenses/lgpl.txt", "copyright": "copyrighted by the Free Software Foundation", "start_line": 428, "end_line": 428 }, { - "Resource": "/samples/JGroups/licenses/lgpl.txt", + "Resource": "samples/JGroups/licenses/lgpl.txt", "copyright_holder": "Free Software Foundation, Inc.", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/JGroups/licenses/lgpl.txt", + "Resource": "samples/JGroups/licenses/lgpl.txt", "copyright_holder": "the Free Software Foundation", "start_line": 428, "end_line": 428 }, { - "Resource": "/samples/JGroups/src/", + "Resource": "samples/JGroups/src/", "type": "directory", "name": "src", "base_name": "src", @@ -704,7 +704,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/FixedMembershipToken.java", + "Resource": "samples/JGroups/src/FixedMembershipToken.java", "type": "file", "name": "FixedMembershipToken.java", "base_name": "FixedMembershipToken", @@ -728,7 +728,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/FixedMembershipToken.java", + "Resource": "samples/JGroups/src/FixedMembershipToken.java", "license__key": "lgpl-2.1-plus", "license__score": "100.00", "license__short_name": "LGPL 2.1 or later", @@ -751,37 +751,37 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/src/FixedMembershipToken.java", + "Resource": "samples/JGroups/src/FixedMembershipToken.java", "copyright": "Copyright 2005, JBoss Inc., and individual contributors", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/JGroups/src/FixedMembershipToken.java", + "Resource": "samples/JGroups/src/FixedMembershipToken.java", "copyright_holder": "JBoss Inc., and individual contributors", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/JGroups/src/FixedMembershipToken.java", + "Resource": "samples/JGroups/src/FixedMembershipToken.java", "author": "Chris Mills (millsy@jboss.com)", "start_line": 51, "end_line": 51 }, { - "Resource": "/samples/JGroups/src/FixedMembershipToken.java", + "Resource": "samples/JGroups/src/FixedMembershipToken.java", "email": "millsy@jboss.com", "start_line": 51, "end_line": 51 }, { - "Resource": "/samples/JGroups/src/FixedMembershipToken.java", + "Resource": "samples/JGroups/src/FixedMembershipToken.java", "url": "http://www.fsf.org/", "start_line": 20, "end_line": 20 }, { - "Resource": "/samples/JGroups/src/GuardedBy.java", + "Resource": "samples/JGroups/src/GuardedBy.java", "type": "file", "name": "GuardedBy.java", "base_name": "GuardedBy", @@ -805,7 +805,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/GuardedBy.java", + "Resource": "samples/JGroups/src/GuardedBy.java", "license__key": "cc-by-2.5", "license__score": "70.00", "license__short_name": "CC-BY-2.5", @@ -828,37 +828,37 @@ "matched_rule__rule_relevance": "70.00" }, { - "Resource": "/samples/JGroups/src/GuardedBy.java", + "Resource": "samples/JGroups/src/GuardedBy.java", "copyright": "Copyright (c) 2005 Brian Goetz and Tim Peierls", "start_line": 9, "end_line": 9 }, { - "Resource": "/samples/JGroups/src/GuardedBy.java", + "Resource": "samples/JGroups/src/GuardedBy.java", "copyright_holder": "Brian Goetz and Tim Peierls", "start_line": 9, "end_line": 9 }, { - "Resource": "/samples/JGroups/src/GuardedBy.java", + "Resource": "samples/JGroups/src/GuardedBy.java", "author": "Bela Ban", "start_line": 15, "end_line": 15 }, { - "Resource": "/samples/JGroups/src/GuardedBy.java", + "Resource": "samples/JGroups/src/GuardedBy.java", "url": "http://creativecommons.org/licenses/by/2.5", "start_line": 11, "end_line": 11 }, { - "Resource": "/samples/JGroups/src/GuardedBy.java", + "Resource": "samples/JGroups/src/GuardedBy.java", "url": "http://www.jcip.net/", "start_line": 12, "end_line": 12 }, { - "Resource": "/samples/JGroups/src/ImmutableReference.java", + "Resource": "samples/JGroups/src/ImmutableReference.java", "type": "file", "name": "ImmutableReference.java", "base_name": "ImmutableReference", @@ -882,7 +882,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/ImmutableReference.java", + "Resource": "samples/JGroups/src/ImmutableReference.java", "license__key": "lgpl-2.1-plus", "license__score": "100.00", "license__short_name": "LGPL 2.1 or later", @@ -905,31 +905,31 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/src/ImmutableReference.java", + "Resource": "samples/JGroups/src/ImmutableReference.java", "copyright": "Copyright 2010, Red Hat, Inc. and individual contributors", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/JGroups/src/ImmutableReference.java", + "Resource": "samples/JGroups/src/ImmutableReference.java", "copyright_holder": "Red Hat, Inc. and individual contributors", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/JGroups/src/ImmutableReference.java", + "Resource": "samples/JGroups/src/ImmutableReference.java", "author": "Brian Stansberry", "start_line": 29, "end_line": 29 }, { - "Resource": "/samples/JGroups/src/ImmutableReference.java", + "Resource": "samples/JGroups/src/ImmutableReference.java", "url": "http://www.fsf.org/", "start_line": 20, "end_line": 20 }, { - "Resource": "/samples/JGroups/src/RATE_LIMITER.java", + "Resource": "samples/JGroups/src/RATE_LIMITER.java", "type": "file", "name": "RATE_LIMITER.java", "base_name": "RATE_LIMITER", @@ -953,13 +953,13 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/RATE_LIMITER.java", + "Resource": "samples/JGroups/src/RATE_LIMITER.java", "author": "Bela Ban", "start_line": 14, "end_line": 14 }, { - "Resource": "/samples/JGroups/src/RouterStub.java", + "Resource": "samples/JGroups/src/RouterStub.java", "type": "file", "name": "RouterStub.java", "base_name": "RouterStub", @@ -983,19 +983,19 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/RouterStub.java", + "Resource": "samples/JGroups/src/RouterStub.java", "author": "Bela Ban", "start_line": 23, "end_line": 23 }, { - "Resource": "/samples/JGroups/src/RouterStub.java", + "Resource": "samples/JGroups/src/RouterStub.java", "url": "https://jira.jboss.org/jira/browse/JGRP-1151", "start_line": 232, "end_line": 232 }, { - "Resource": "/samples/JGroups/src/RouterStubManager.java", + "Resource": "samples/JGroups/src/RouterStubManager.java", "type": "file", "name": "RouterStubManager.java", "base_name": "RouterStubManager", @@ -1019,7 +1019,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/RouterStubManager.java", + "Resource": "samples/JGroups/src/RouterStubManager.java", "license__key": "lgpl-2.1-plus", "license__score": "100.00", "license__short_name": "LGPL 2.1 or later", @@ -1042,25 +1042,25 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/JGroups/src/RouterStubManager.java", + "Resource": "samples/JGroups/src/RouterStubManager.java", "copyright": "Copyright 2009, Red Hat Middleware LLC, and individual contributors", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/JGroups/src/RouterStubManager.java", + "Resource": "samples/JGroups/src/RouterStubManager.java", "copyright_holder": "Red Hat Middleware LLC, and individual contributors", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/JGroups/src/RouterStubManager.java", + "Resource": "samples/JGroups/src/RouterStubManager.java", "url": "http://www.fsf.org/", "start_line": 20, "end_line": 20 }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "type": "file", "name": "S3_PING.java", "base_name": "S3_PING", @@ -1084,7 +1084,7 @@ "scan_errors": "" }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "license__key": "public-domain", "license__score": "10.00", "license__short_name": "Public Domain", @@ -1107,7 +1107,7 @@ "matched_rule__rule_relevance": "10.00" }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "license__key": "public-domain", "license__score": "10.00", "license__short_name": "Public Domain", @@ -1130,43 +1130,43 @@ "matched_rule__rule_relevance": "10.00" }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "author": "Bela Ban", "start_line": 35, "end_line": 35 }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "author": "Robert Harder", "start_line": 1698, "end_line": 1698 }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "author": "rob@iharder.net", "start_line": 1698, "end_line": 1698 }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "email": "rob@iharder.net", "start_line": 1699, "end_line": 1699 }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "url": "http://iharder.sourceforge.net/current/java/base64/", "start_line": 1652, "end_line": 1652 }, { - "Resource": "/samples/JGroups/src/S3_PING.java", + "Resource": "samples/JGroups/src/S3_PING.java", "url": "http://iharder.net/base64", "start_line": 1695, "end_line": 1695 }, { - "Resource": "/samples/srp/", + "Resource": "samples/srp/", "type": "directory", "name": "srp", "base_name": "srp", @@ -1190,7 +1190,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/build.info", + "Resource": "samples/srp/build.info", "type": "file", "name": "build.info", "base_name": "build", @@ -1214,7 +1214,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/srp_lib.c", + "Resource": "samples/srp/srp_lib.c", "type": "file", "name": "srp_lib.c", "base_name": "srp_lib", @@ -1238,7 +1238,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/srp_lib.c", + "Resource": "samples/srp/srp_lib.c", "license__key": "openssl", "license__score": "100.00", "license__short_name": "OpenSSL License", @@ -1261,25 +1261,25 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/srp/srp_lib.c", + "Resource": "samples/srp/srp_lib.c", "copyright": "Copyright 2011-2016 The OpenSSL Project", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/srp/srp_lib.c", + "Resource": "samples/srp/srp_lib.c", "copyright_holder": "The OpenSSL Project", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/srp/srp_lib.c", + "Resource": "samples/srp/srp_lib.c", "url": "https://www.openssl.org/source/license.html", "start_line": 7, "end_line": 7 }, { - "Resource": "/samples/srp/srp_vfy.c", + "Resource": "samples/srp/srp_vfy.c", "type": "file", "name": "srp_vfy.c", "base_name": "srp_vfy", @@ -1303,7 +1303,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/srp_vfy.c", + "Resource": "samples/srp/srp_vfy.c", "license__key": "openssl", "license__score": "100.00", "license__short_name": "OpenSSL License", @@ -1326,25 +1326,25 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/srp/srp_vfy.c", + "Resource": "samples/srp/srp_vfy.c", "copyright": "Copyright 2011-2016 The OpenSSL Project", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/srp/srp_vfy.c", + "Resource": "samples/srp/srp_vfy.c", "copyright_holder": "The OpenSSL Project", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/srp/srp_vfy.c", + "Resource": "samples/srp/srp_vfy.c", "url": "https://www.openssl.org/source/license.html", "start_line": 7, "end_line": 7 }, { - "Resource": "/samples/srp/scan/", + "Resource": "samples/srp/scan/", "type": "directory", "name": "scan", "base_name": "scan", @@ -1368,7 +1368,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/scan/", + "Resource": "samples/srp/scan/", "package__type": "npm", "package__namespace": "", "package__name": "cookie-signature", @@ -1389,7 +1389,7 @@ "package__contains_source_code": "" }, { - "Resource": "/samples/srp/scan/json2csv.rb", + "Resource": "samples/srp/scan/json2csv.rb", "type": "file", "name": "json2csv.rb", "base_name": "json2csv", @@ -1413,7 +1413,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/scan/json2csv.rb", + "Resource": "samples/srp/scan/json2csv.rb", "license__key": "apache-2.0", "license__score": "89.53", "license__short_name": "Apache 2.0", @@ -1436,37 +1436,37 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/srp/scan/json2csv.rb", + "Resource": "samples/srp/scan/json2csv.rb", "copyright": "Copyright (c) 2017 nexB Inc. and others.", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/srp/scan/json2csv.rb", + "Resource": "samples/srp/scan/json2csv.rb", "copyright_holder": "nexB Inc. and others.", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/srp/scan/json2csv.rb", + "Resource": "samples/srp/scan/json2csv.rb", "url": "http://nexb.com/", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/srp/scan/json2csv.rb", + "Resource": "samples/srp/scan/json2csv.rb", "url": "https://github.com/nexB/scancode-toolkit/", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/srp/scan/json2csv.rb", + "Resource": "samples/srp/scan/json2csv.rb", "url": "http://apache.org/licenses/LICENSE-2.0", "start_line": 10, "end_line": 10 }, { - "Resource": "/samples/srp/scan/license", + "Resource": "samples/srp/scan/license", "type": "file", "name": "license", "base_name": "license", @@ -1490,7 +1490,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/scan/license", + "Resource": "samples/srp/scan/license", "license__key": "gpl-2.0-plus", "license__score": "100.00", "license__short_name": "GPL 2.0 or later", @@ -1513,7 +1513,7 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "type": "file", "name": "package.json", "base_name": "package", @@ -1537,7 +1537,7 @@ "scan_errors": "" }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "license__key": "mit", "license__score": "15.00", "license__short_name": "MIT License", @@ -1560,7 +1560,7 @@ "matched_rule__rule_relevance": "15.00" }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "license__key": "mit", "license__score": "100.00", "license__short_name": "MIT License", @@ -1583,37 +1583,37 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "copyright": "Copyright (c) 2012 LearnBoost ", "start_line": 24, "end_line": 24 }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "copyright_holder": "LearnBoost", "start_line": 24, "end_line": 24 }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "email": "tj@learnboost.com", "start_line": 12, "end_line": 12 }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "url": "https://github.com/visionmedia/node-cookie-signature.git", "start_line": 16, "end_line": 16 }, { - "Resource": "/samples/srp/scan/package.json", + "Resource": "samples/srp/scan/package.json", "url": "https://github.com/visionmedia/node-cookie-signature/issues", "start_line": 27, "end_line": 27 }, { - "Resource": "/samples/zlib/", + "Resource": "samples/zlib/", "type": "directory", "name": "zlib", "base_name": "zlib", @@ -1637,7 +1637,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/adler32.c", + "Resource": "samples/zlib/adler32.c", "type": "file", "name": "adler32.c", "base_name": "adler32", @@ -1661,7 +1661,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/adler32.c", + "Resource": "samples/zlib/adler32.c", "license__key": "zlib", "license__score": "60.00", "license__short_name": "ZLIB License", @@ -1684,19 +1684,19 @@ "matched_rule__rule_relevance": "60.00" }, { - "Resource": "/samples/zlib/adler32.c", + "Resource": "samples/zlib/adler32.c", "copyright": "Copyright (c) 1995-2011 Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/adler32.c", + "Resource": "samples/zlib/adler32.c", "copyright_holder": "Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "type": "file", "name": "deflate.c", "base_name": "deflate", @@ -1720,7 +1720,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "license__key": "zlib", "license__score": "60.00", "license__short_name": "ZLIB License", @@ -1743,43 +1743,43 @@ "matched_rule__rule_relevance": "60.00" }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "copyright": "Copyright (c) 1995-2013 Jean-loup Gailly and Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "copyright": "Copyright 1995-2013 Jean-loup Gailly and Mark Adler", "start_line": 54, "end_line": 54 }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "copyright_holder": "Jean-loup Gailly and Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "copyright_holder": "Jean-loup Gailly and Mark Adler", "start_line": 54, "end_line": 54 }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "author": "Leonid Broukhis.", "start_line": 34, "end_line": 34 }, { - "Resource": "/samples/zlib/deflate.c", + "Resource": "samples/zlib/deflate.c", "url": "http://tools.ietf.org/html/rfc1951", "start_line": 40, "end_line": 40 }, { - "Resource": "/samples/zlib/deflate.h", + "Resource": "samples/zlib/deflate.h", "type": "file", "name": "deflate.h", "base_name": "deflate", @@ -1803,7 +1803,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/deflate.h", + "Resource": "samples/zlib/deflate.h", "license__key": "zlib", "license__score": "60.00", "license__short_name": "ZLIB License", @@ -1826,7 +1826,7 @@ "matched_rule__rule_relevance": "60.00" }, { - "Resource": "/samples/zlib/deflate.h", + "Resource": "samples/zlib/deflate.h", "license__key": "zlib", "license__score": "100.00", "license__short_name": "ZLIB License", @@ -1849,19 +1849,19 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/deflate.h", + "Resource": "samples/zlib/deflate.h", "copyright": "Copyright (c) 1995-2012 Jean-loup Gailly", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/deflate.h", + "Resource": "samples/zlib/deflate.h", "copyright_holder": "Jean-loup Gailly", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/zlib.h", + "Resource": "samples/zlib/zlib.h", "type": "file", "name": "zlib.h", "base_name": "zlib", @@ -1885,7 +1885,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/zlib.h", + "Resource": "samples/zlib/zlib.h", "license__key": "zlib", "license__score": "100.00", "license__short_name": "ZLIB License", @@ -1908,37 +1908,37 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/zlib.h", + "Resource": "samples/zlib/zlib.h", "copyright": "Copyright (c) 1995-2013 Jean-loup Gailly and Mark Adler", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/zlib/zlib.h", + "Resource": "samples/zlib/zlib.h", "copyright_holder": "Jean-loup Gailly and Mark Adler", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/zlib/zlib.h", + "Resource": "samples/zlib/zlib.h", "email": "jloup@gzip.org", "start_line": 23, "end_line": 23 }, { - "Resource": "/samples/zlib/zlib.h", + "Resource": "samples/zlib/zlib.h", "email": "madler@alumni.caltech.edu", "start_line": 23, "end_line": 23 }, { - "Resource": "/samples/zlib/zlib.h", + "Resource": "samples/zlib/zlib.h", "url": "http://tools.ietf.org/html/rfc1950", "start_line": 27, "end_line": 27 }, { - "Resource": "/samples/zlib/zutil.c", + "Resource": "samples/zlib/zutil.c", "type": "file", "name": "zutil.c", "base_name": "zutil", @@ -1962,7 +1962,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/zutil.c", + "Resource": "samples/zlib/zutil.c", "license__key": "zlib", "license__score": "60.00", "license__short_name": "ZLIB License", @@ -1985,19 +1985,19 @@ "matched_rule__rule_relevance": "60.00" }, { - "Resource": "/samples/zlib/zutil.c", + "Resource": "samples/zlib/zutil.c", "copyright": "Copyright (c) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/zutil.c", + "Resource": "samples/zlib/zutil.c", "copyright_holder": "Jean-loup Gailly.", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/zutil.h", + "Resource": "samples/zlib/zutil.h", "type": "file", "name": "zutil.h", "base_name": "zutil", @@ -2021,7 +2021,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/zutil.h", + "Resource": "samples/zlib/zutil.h", "license__key": "zlib", "license__score": "60.00", "license__short_name": "ZLIB License", @@ -2044,19 +2044,19 @@ "matched_rule__rule_relevance": "60.00" }, { - "Resource": "/samples/zlib/zutil.h", + "Resource": "samples/zlib/zutil.h", "copyright": "Copyright (c) 1995-2013 Jean-loup Gailly.", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/zutil.h", + "Resource": "samples/zlib/zutil.h", "copyright_holder": "Jean-loup Gailly.", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/ada/", + "Resource": "samples/zlib/ada/", "type": "directory", "name": "ada", "base_name": "ada", @@ -2080,7 +2080,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/ada/zlib.ads", + "Resource": "samples/zlib/ada/zlib.ads", "type": "file", "name": "zlib.ads", "base_name": "zlib", @@ -2104,7 +2104,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/ada/zlib.ads", + "Resource": "samples/zlib/ada/zlib.ads", "license__key": "lgpl-2.0-plus", "license__score": "97.39", "license__short_name": "LGPL 2.0 or later", @@ -2127,7 +2127,7 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/ada/zlib.ads", + "Resource": "samples/zlib/ada/zlib.ads", "license__key": "ada-linking-exception", "license__score": "100.00", "license__short_name": "Ada linking exception to GPL 2.0 or later", @@ -2150,19 +2150,19 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/ada/zlib.ads", + "Resource": "samples/zlib/ada/zlib.ads", "copyright": "Copyright (c) 2002-2004 Dmitriy Anisimkov", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/zlib/ada/zlib.ads", + "Resource": "samples/zlib/ada/zlib.ads", "copyright_holder": "Dmitriy Anisimkov", "start_line": 4, "end_line": 4 }, { - "Resource": "/samples/zlib/dotzlib/", + "Resource": "samples/zlib/dotzlib/", "type": "directory", "name": "dotzlib", "base_name": "dotzlib", @@ -2186,7 +2186,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/dotzlib/AssemblyInfo.cs", + "Resource": "samples/zlib/dotzlib/AssemblyInfo.cs", "type": "file", "name": "AssemblyInfo.cs", "base_name": "AssemblyInfo", @@ -2210,19 +2210,19 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/dotzlib/AssemblyInfo.cs", + "Resource": "samples/zlib/dotzlib/AssemblyInfo.cs", "copyright": "Copyright (c) 2004 by Henrik Ravn", "start_line": 14, "end_line": 14 }, { - "Resource": "/samples/zlib/dotzlib/AssemblyInfo.cs", + "Resource": "samples/zlib/dotzlib/AssemblyInfo.cs", "copyright_holder": "Henrik Ravn", "start_line": 14, "end_line": 14 }, { - "Resource": "/samples/zlib/dotzlib/ChecksumImpl.cs", + "Resource": "samples/zlib/dotzlib/ChecksumImpl.cs", "type": "file", "name": "ChecksumImpl.cs", "base_name": "ChecksumImpl", @@ -2246,7 +2246,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/dotzlib/ChecksumImpl.cs", + "Resource": "samples/zlib/dotzlib/ChecksumImpl.cs", "license__key": "boost-1.0", "license__score": "92.59", "license__short_name": "Boost 1.0", @@ -2269,25 +2269,25 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/dotzlib/ChecksumImpl.cs", + "Resource": "samples/zlib/dotzlib/ChecksumImpl.cs", "copyright": "(c) Copyright Henrik Ravn 2004", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/dotzlib/ChecksumImpl.cs", + "Resource": "samples/zlib/dotzlib/ChecksumImpl.cs", "copyright_holder": "Henrik Ravn", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/dotzlib/ChecksumImpl.cs", + "Resource": "samples/zlib/dotzlib/ChecksumImpl.cs", "url": "http://www.boost.org/LICENSE_1_0.txt", "start_line": 5, "end_line": 5 }, { - "Resource": "/samples/zlib/dotzlib/LICENSE_1_0.txt", + "Resource": "samples/zlib/dotzlib/LICENSE_1_0.txt", "type": "file", "name": "LICENSE_1_0.txt", "base_name": "LICENSE_1_0", @@ -2311,7 +2311,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/dotzlib/LICENSE_1_0.txt", + "Resource": "samples/zlib/dotzlib/LICENSE_1_0.txt", "license__key": "boost-1.0", "license__score": "100.00", "license__short_name": "Boost 1.0", @@ -2334,7 +2334,7 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/dotzlib/readme.txt", + "Resource": "samples/zlib/dotzlib/readme.txt", "type": "file", "name": "readme.txt", "base_name": "readme", @@ -2358,7 +2358,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/dotzlib/readme.txt", + "Resource": "samples/zlib/dotzlib/readme.txt", "license__key": "boost-1.0", "license__score": "92.59", "license__short_name": "Boost 1.0", @@ -2381,25 +2381,25 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/dotzlib/readme.txt", + "Resource": "samples/zlib/dotzlib/readme.txt", "copyright": "Copyright (c) Henrik Ravn 2004", "start_line": 55, "end_line": 55 }, { - "Resource": "/samples/zlib/dotzlib/readme.txt", + "Resource": "samples/zlib/dotzlib/readme.txt", "copyright_holder": "Henrik Ravn", "start_line": 55, "end_line": 55 }, { - "Resource": "/samples/zlib/dotzlib/readme.txt", + "Resource": "samples/zlib/dotzlib/readme.txt", "url": "http://www.boost.org/LICENSE_1_0.txt", "start_line": 58, "end_line": 58 }, { - "Resource": "/samples/zlib/gcc_gvmat64/", + "Resource": "samples/zlib/gcc_gvmat64/", "type": "directory", "name": "gcc_gvmat64", "base_name": "gcc_gvmat64", @@ -2423,7 +2423,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "type": "file", "name": "gvmat64.S", "base_name": "gvmat64", @@ -2447,7 +2447,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "license__key": "zlib", "license__score": "100.00", "license__short_name": "ZLIB License", @@ -2470,61 +2470,61 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "copyright": "Copyright (c) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.", "start_line": 10, "end_line": 10 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "copyright_holder": "Jean-loup Gailly, Brian Raiter and Gilles Vollant.", "start_line": 10, "end_line": 10 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "author": "Gilles Vollant", "start_line": 12, "end_line": 12 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "url": "http://www.zlib.net/", "start_line": 33, "end_line": 33 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "url": "http://www.winimage.com/zLibDll", "start_line": 34, "end_line": 34 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "url": "http://www.muppetlabs.com/~breadbox/software/assembly.html", "start_line": 35, "end_line": 35 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "url": "http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx", "start_line": 172, "end_line": 172 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "url": "http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp", "start_line": 173, "end_line": 173 }, { - "Resource": "/samples/zlib/gcc_gvmat64/gvmat64.S", + "Resource": "samples/zlib/gcc_gvmat64/gvmat64.S", "url": "http://www.x86-64.org/documentation/abi-0.99.pdf", "start_line": 180, "end_line": 180 }, { - "Resource": "/samples/zlib/infback9/", + "Resource": "samples/zlib/infback9/", "type": "directory", "name": "infback9", "base_name": "infback9", @@ -2548,7 +2548,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/infback9/infback9.c", + "Resource": "samples/zlib/infback9/infback9.c", "type": "file", "name": "infback9.c", "base_name": "infback9", @@ -2572,7 +2572,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/infback9/infback9.c", + "Resource": "samples/zlib/infback9/infback9.c", "license__key": "zlib", "license__score": "60.00", "license__short_name": "ZLIB License", @@ -2595,19 +2595,19 @@ "matched_rule__rule_relevance": "60.00" }, { - "Resource": "/samples/zlib/infback9/infback9.c", + "Resource": "samples/zlib/infback9/infback9.c", "copyright": "Copyright (c) 1995-2008 Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/infback9/infback9.c", + "Resource": "samples/zlib/infback9/infback9.c", "copyright_holder": "Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/infback9/infback9.h", + "Resource": "samples/zlib/infback9/infback9.h", "type": "file", "name": "infback9.h", "base_name": "infback9", @@ -2631,7 +2631,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/infback9/infback9.h", + "Resource": "samples/zlib/infback9/infback9.h", "license__key": "zlib", "license__score": "60.00", "license__short_name": "ZLIB License", @@ -2654,19 +2654,19 @@ "matched_rule__rule_relevance": "60.00" }, { - "Resource": "/samples/zlib/infback9/infback9.h", + "Resource": "samples/zlib/infback9/infback9.h", "copyright": "Copyright (c) 2003 Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/infback9/infback9.h", + "Resource": "samples/zlib/infback9/infback9.h", "copyright_holder": "Mark Adler", "start_line": 2, "end_line": 2 }, { - "Resource": "/samples/zlib/iostream2/", + "Resource": "samples/zlib/iostream2/", "type": "directory", "name": "iostream2", "base_name": "iostream2", @@ -2690,7 +2690,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/iostream2/zstream.h", + "Resource": "samples/zlib/iostream2/zstream.h", "type": "file", "name": "zstream.h", "base_name": "zstream", @@ -2714,7 +2714,7 @@ "scan_errors": "" }, { - "Resource": "/samples/zlib/iostream2/zstream.h", + "Resource": "samples/zlib/iostream2/zstream.h", "license__key": "cmr-no", "license__score": "100.00", "license__short_name": "CMR License", @@ -2737,25 +2737,25 @@ "matched_rule__rule_relevance": "100.00" }, { - "Resource": "/samples/zlib/iostream2/zstream.h", + "Resource": "samples/zlib/iostream2/zstream.h", "copyright": "Copyright (c) 1997 Christian Michelsen Research AS Advanced Computing", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/zlib/iostream2/zstream.h", + "Resource": "samples/zlib/iostream2/zstream.h", "copyright_holder": "Christian Michelsen Research AS Advanced Computing", "start_line": 3, "end_line": 3 }, { - "Resource": "/samples/zlib/iostream2/zstream.h", + "Resource": "samples/zlib/iostream2/zstream.h", "url": "http://www.cmr.no/", "start_line": 7, "end_line": 7 }, { - "Resource": "/samples/zlib/iostream2/zstream_test.cpp", + "Resource": "samples/zlib/iostream2/zstream_test.cpp", "type": "file", "name": "zstream_test.cpp", "base_name": "zstream_test", diff --git a/tests/formattedcode/data/csv/flatten_scan/key_order.expected.json b/tests/formattedcode/data/csv/flatten_scan/key_order.expected.json index cebb8b67e6a..4f0017ac1e1 100644 --- a/tests/formattedcode/data/csv/flatten_scan/key_order.expected.json +++ b/tests/formattedcode/data/csv/flatten_scan/key_order.expected.json @@ -1,6 +1,6 @@ [ { - "Resource": "/srp/", + "Resource": "srp/", "type": "directory", "name": "srp", "base_name": "srp", @@ -24,7 +24,7 @@ "scan_errors": "" }, { - "Resource": "/srp/build.info", + "Resource": "srp/build.info", "type": "file", "name": "build.info", "base_name": "build", @@ -48,7 +48,7 @@ "scan_errors": "" }, { - "Resource": "/srp/srp_lib.c", + "Resource": "srp/srp_lib.c", "type": "file", "name": "srp_lib.c", "base_name": "srp_lib", @@ -72,7 +72,7 @@ "scan_errors": "" }, { - "Resource": "/srp/srp_vfy.c", + "Resource": "srp/srp_vfy.c", "type": "file", "name": "srp_vfy.c", "base_name": "srp_vfy", diff --git a/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected b/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected index 14e7cd47250..90f2eaaf80d 100644 --- a/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected +++ b/tests/formattedcode/data/csv/flatten_scan/minimal.json-expected @@ -1,21 +1,21 @@ [ { - "Resource": "/srp/", + "Resource": "srp/", "type": "directory", "scan_errors": "" }, { - "Resource": "/srp/build.info", + "Resource": "srp/build.info", "type": "file", "scan_errors": "" }, { - "Resource": "/srp/srp_lib.c", + "Resource": "srp/srp_lib.c", "type": "file", "scan_errors": "" }, { - "Resource": "/srp/srp_lib.c", + "Resource": "srp/srp_lib.c", "license__key": "openssl", "license__score": "100.00", "license__short_name": "OpenSSL License", @@ -33,24 +33,24 @@ "matched_rule__licenses": "openssl" }, { - "Resource": "/srp/srp_lib.c", + "Resource": "srp/srp_lib.c", "copyright": "Copyright 2011-2016 The OpenSSL Project", "start_line": 2, "end_line": 2 }, { - "Resource": "/srp/srp_lib.c", + "Resource": "srp/srp_lib.c", "copyright_holder": "The OpenSSL Project", "start_line": 2, "end_line": 2 }, { - "Resource": "/srp/srp_vfy.c", + "Resource": "srp/srp_vfy.c", "type": "file", "scan_errors": "" }, { - "Resource": "/srp/srp_vfy.c", + "Resource": "srp/srp_vfy.c", "license__key": "openssl", "license__score": "100.00", "license__short_name": "OpenSSL License", @@ -68,13 +68,13 @@ "matched_rule__licenses": "openssl" }, { - "Resource": "/srp/srp_vfy.c", + "Resource": "srp/srp_vfy.c", "copyright": "Copyright 2011-2016 The OpenSSL Project", "start_line": 2, "end_line": 2 }, { - "Resource": "/srp/srp_vfy.c", + "Resource": "srp/srp_vfy.c", "copyright_holder": "The OpenSSL Project", "start_line": 2, "end_line": 2 diff --git a/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected b/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected index ba3cf60c288..a2eba977b5a 100644 --- a/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected +++ b/tests/formattedcode/data/csv/flatten_scan/package_license_value_null.json-expected @@ -1,6 +1,6 @@ [ { - "Resource": "/package.json", + "Resource": "package.json", "type": "file", "name": "package.json", "base_name": "package", @@ -24,7 +24,7 @@ "scan_errors": "" }, { - "Resource": "/package.json", + "Resource": "package.json", "package__type": "npm", "package__namespace": "", "package__name": "cookie-signature", diff --git a/tests/formattedcode/data/csv/flatten_scan/path_with_and_without_leading_slash.json b/tests/formattedcode/data/csv/flatten_scan/path_with_and_without_leading_slash.json new file mode 100644 index 00000000000..db992b3803d --- /dev/null +++ b/tests/formattedcode/data/csv/flatten_scan/path_with_and_without_leading_slash.json @@ -0,0 +1,68 @@ +{ + "files": [ + { + "path": "samples/", + "type": "directory", + "name": "samples", + "base_name": "samples", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [], + "license_expressions": [], + "holders": [], + "copyrights": [], + "authors": [], + "emails": [], + "urls": [], + "packages": [], + "files_count": 39, + "dirs_count": 12, + "size_count": 1189824, + "scan_errors": [] + }, + { + "path": "samples/arch", + "type": "directory", + "name": "arch", + "base_name": "arch", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [], + "license_expressions": [], + "holders": [], + "copyrights": [], + "authors": [], + "emails": [], + "urls": [], + "packages": [], + "files_count": 1, + "dirs_count": 0, + "size_count": 28103, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/formattedcode/data/csv/flatten_scan/path_with_and_without_leading_slash.json-expected b/tests/formattedcode/data/csv/flatten_scan/path_with_and_without_leading_slash.json-expected new file mode 100644 index 00000000000..90496cb8bad --- /dev/null +++ b/tests/formattedcode/data/csv/flatten_scan/path_with_and_without_leading_slash.json-expected @@ -0,0 +1,50 @@ +[ + { + "Resource": "samples/", + "type": "directory", + "name": "samples", + "base_name": "samples", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "files_count": 39, + "dirs_count": 12, + "size_count": 1189824, + "scan_errors": "" + }, + { + "Resource": "samples/arch/", + "type": "directory", + "name": "arch", + "base_name": "arch", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "files_count": 1, + "dirs_count": 0, + "size_count": 28103, + "scan_errors": "" + } +] \ No newline at end of file diff --git a/tests/formattedcode/data/csv/livescan/expected.csv b/tests/formattedcode/data/csv/livescan/expected.csv index 695f6f17ac7..a909b31bb5f 100644 --- a/tests/formattedcode/data/csv/livescan/expected.csv +++ b/tests/formattedcode/data/csv/livescan/expected.csv @@ -1,23 +1,23 @@ Resource,type,name,base_name,extension,size,date,sha1,md5,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,files_count,dirs_count,size_count,scan_errors,license_expression,license__key,license__score,license__name,license__short_name,license__category,license__is_exception,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_expression,matched_rule__licenses,matched_rule__is_license_text,matched_rule__is_license_notice,matched_rule__is_license_reference,matched_rule__is_license_tag,matched_rule__matcher,matched_rule__rule_length,matched_rule__matched_length,matched_rule__match_coverage,matched_rule__rule_relevance,copyright,copyright_holder,email,url,package__type,package__namespace,package__name,package__version,package__qualifiers,package__subpath,package__primary_language,package__description,package__release_date,package__homepage_url,package__download_url,package__size,package__sha1,package__md5,package__sha256,package__sha512,package__bug_tracking_url,package__code_view_url,package__vcs_url,package__copyright,package__license_expression,package__declared_license,package__notice_text,package__manifest_path,package__contains_source_code -/json2csv.rb,file,json2csv.rb,json2csv,.rb,912,2018-11-15,1236469a06a2bacbdd8e172ad718482af5b0a936,1307c281e0b153202e291b217eab85d5,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,apache-2.0,100.00,Apache License 2.0,Apache 2.0,Permissive,False,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,13,apache-2.0_7.RULE,apache-2.0,apache-2.0,,True,,,2-aho,85,85,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,,,,,,Copyright (c) 2017 nexB Inc. and others,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,,,,,,,nexB Inc. and others,,,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,,,,,,http://nexb.com/,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,,,,,,,,,,,, -/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,8,,,,,,,,,,,,,,,,http://www.apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,,,,,,,,,,,, -/license,file,license,license,,679,2018-04-11,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/license,,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GNU General Public License 2.0 or later,GPL 2.0 or later,Copyleft,False,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0-or-later,https://spdx.org/licenses/GPL-2.0-or-later,1,12,gpl-2.0-plus.LICENSE,gpl-2.0-plus,gpl-2.0-plus,True,,,,1-hash,113,113,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,file,package.json,package,.json,2200,2018-04-11,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,mit,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,mit,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,MIT License,Permissive,False,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,mit,mit,,,True,,2-aho,3,3,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,MIT License,Permissive,False,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,mit,mit,True,,,,2-aho,161,161,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,24,,,,,,,,,,,,,Copyright (c) 2012 LearnBoost ,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,24,,,,,,,,,,,,,,LearnBoost,,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,,,,,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,,,,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,,,,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,npm,,cookie-signature,v 1.0.3,,,JavaScript,Sign and unsign cookies,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,git+https://github.com/visionmedia/node-cookie-signature.git,,,,,, +json2csv.rb,file,json2csv.rb,json2csv,.rb,912,2018-11-15,1236469a06a2bacbdd8e172ad718482af5b0a936,1307c281e0b153202e291b217eab85d5,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,apache-2.0,100.00,Apache License 2.0,Apache 2.0,Permissive,False,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,13,apache-2.0_7.RULE,apache-2.0,apache-2.0,,True,,,2-aho,85,85,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,,,,,,Copyright (c) 2017 nexB Inc. and others,,,,,,,,,,,,,,,,,,,,,,,,,,,, +json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,,,,,,,nexB Inc. and others,,,,,,,,,,,,,,,,,,,,,,,,,,, +json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,,,,,,http://nexb.com/,,,,,,,,,,,,,,,,,,,,,,,,, +json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,,,,,,,,,,,, +json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,8,,,,,,,,,,,,,,,,http://www.apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,,,,,,,,,,,, +license,file,license,license,,679,2018-04-11,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +license,,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GNU General Public License 2.0 or later,GPL 2.0 or later,Copyleft,False,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0-or-later,https://spdx.org/licenses/GPL-2.0-or-later,1,12,gpl-2.0-plus.LICENSE,gpl-2.0-plus,gpl-2.0-plus,True,,,,1-hash,113,113,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,file,package.json,package,.json,2200,2018-04-11,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,mit,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,mit,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,MIT License,Permissive,False,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_27.RULE,mit,mit,,,True,,2-aho,3,3,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,mit,100.00,MIT License,MIT License,Permissive,False,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit.LICENSE,mit,mit,True,,,,2-aho,161,161,100.00,100.00,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,24,,,,,,,,,,,,,Copyright (c) 2012 LearnBoost ,,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,24,,,,,,,,,,,,,,LearnBoost,,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,12,,,,,,,,,,,,,,,tj@learnboost.com,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,16,,,,,,,,,,,,,,,,https://github.com/visionmedia/node-cookie-signature.git,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,27,,,,,,,,,,,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,npm,,cookie-signature,v 1.0.3,,,JavaScript,Sign and unsign cookies,,,https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz,,,,,,https://github.com/visionmedia/node-cookie-signature/issues,,git+https://github.com/visionmedia/node-cookie-signature.git,,,,,, diff --git a/tests/formattedcode/data/csv/non-standard/identified.csv b/tests/formattedcode/data/csv/non-standard/identified.csv index 539fa38174f..184212825d2 100644 --- a/tests/formattedcode/data/csv/non-standard/identified.csv +++ b/tests/formattedcode/data/csv/non-standard/identified.csv @@ -1,6 +1,6 @@ Resource,type,name,base_name,extension,size,date,sha1,md5,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,files_count,dirs_count,size_count,scan_errors,package__download_url,package__sha1,package__md5,package__size,package__release_date,package__primary_language,package__description,package__copyright,package__license_expression,package__reference_notes,package__homepage_url,package__notice_text,package__components__name,package__components__version,package__components__owner_name,package__components__copyright,package__components__license_expression,package__components__reference_notes,package__components__release_date,package__components__description,package__components__homepage_url,package__components__vcs_url,package__components__code_view_url,package__components__bug_tracking_url,package__components__primary_language,package__components__notice_text,package__components__notice_filename,package__components__notice_url,package__type,package__namespace,package__name,package__version,package__qualifiers,package__subpath -/apache-log4j-extras-1.1.jar,file,apache-log4j-extras-1.1.jar,apache-log4j-extras-1.1,.jar,346729,2010-12-02,1e4b290f5c9ce5ea3a1a7352496c9c9d2a894800,acd91d528e26aa771198d930cf08e953,application/java-archive,Java archive data (JAR),,True,False,True,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -/apache-log4j-extras-1.1.jar,,,,,,,,,,,,,,,,,,,,,,http://central.maven.org/maven2/log4j/apache-log4j-extras/1.1/apache-log4j-extras-1.1.jar,1e4b290f5c9ce5ea3a1a7352496c9c9d2a894800,acd91d528e26aa771198d930cf08e953,346729,,,,,,,,,Apache Log4j Extras,1.1,Apache Software Foundation,Copyright 2007 The Apache Software Foundation,apache-2.0,,,Apache Extras for Apache log4j is a jar file full of additional functionality for log4j 1.2.x.,http://logging.apache.org/log4j/extras/,,,,Java,"Apache Extras Companion for log4j 1.2. +apache-log4j-extras-1.1.jar,file,apache-log4j-extras-1.1.jar,apache-log4j-extras-1.1,.jar,346729,2010-12-02,1e4b290f5c9ce5ea3a1a7352496c9c9d2a894800,acd91d528e26aa771198d930cf08e953,application/java-archive,Java archive data (JAR),,True,False,True,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +apache-log4j-extras-1.1.jar,,,,,,,,,,,,,,,,,,,,,,http://central.maven.org/maven2/log4j/apache-log4j-extras/1.1/apache-log4j-extras-1.1.jar,1e4b290f5c9ce5ea3a1a7352496c9c9d2a894800,acd91d528e26aa771198d930cf08e953,346729,,,,,,,,,Apache Log4j Extras,1.1,Apache Software Foundation,Copyright 2007 The Apache Software Foundation,apache-2.0,,,Apache Extras for Apache log4j is a jar file full of additional functionality for log4j 1.2.x.,http://logging.apache.org/log4j/extras/,,,,Java,"Apache Extras Companion for log4j 1.2. Copyright 2007 The Apache Software Foundation This product includes software developed at diff --git a/tests/formattedcode/data/csv/packages/expected-no-root.csv b/tests/formattedcode/data/csv/packages/expected-no-root.csv index 0e6433ae848..dbbb69958f1 100644 --- a/tests/formattedcode/data/csv/packages/expected-no-root.csv +++ b/tests/formattedcode/data/csv/packages/expected-no-root.csv @@ -1,3 +1,3 @@ Resource,type,scan_errors,package__type,package__namespace,package__name,package__version,package__qualifiers,package__subpath,package__primary_language,package__description,package__release_date,package__homepage_url,package__download_url,package__size,package__sha1,package__md5,package__sha256,package__sha512,package__bug_tracking_url,package__code_view_url,package__vcs_url,package__copyright,package__license_expression,package__declared_license,package__notice_text,package__manifest_path,package__contains_source_code -/package.json,file,,,,,,,,,,,,,,,,,,,,,,,,,, -/package.json,,,npm,,npm,v 2.13.5,,,JavaScript,a package manager for JavaScript,,https://docs.npmjs.com/,https://registry.npmjs.org/npm/-/npm-2.13.5.tgz,,a124386bce4a90506f28ad4b1d1a804a17baaf32,,,,http://github.com/npm/npm/issues,,git+https://github.com/npm/npm.git@fc7bbf03e39cc48a8924b90696d28345a6a90f3c,,artistic-2.0,Artistic-2.0,,, +package.json,file,,,,,,,,,,,,,,,,,,,,,,,,,, +package.json,,,npm,,npm,v 2.13.5,,,JavaScript,a package manager for JavaScript,,https://docs.npmjs.com/,https://registry.npmjs.org/npm/-/npm-2.13.5.tgz,,a124386bce4a90506f28ad4b1d1a804a17baaf32,,,,http://github.com/npm/npm/issues,,git+https://github.com/npm/npm.git@fc7bbf03e39cc48a8924b90696d28345a6a90f3c,,artistic-2.0,Artistic-2.0,,, diff --git a/tests/formattedcode/data/csv/srp.csv b/tests/formattedcode/data/csv/srp.csv index a2ce47508a3..5e3b109cf3e 100644 --- a/tests/formattedcode/data/csv/srp.csv +++ b/tests/formattedcode/data/csv/srp.csv @@ -1,9 +1,9 @@ Resource,type,scan_errors,copyright,start_line,end_line,copyright_holder -/srp/,directory,,,,, -/srp/build.info,file,,,,, -/srp/srp_lib.c,file,,,,, -/srp/srp_lib.c,,,Copyright 2011-2016 The OpenSSL Project Authors,2,2, -/srp/srp_lib.c,,,,2,2,The OpenSSL Project Authors -/srp/srp_vfy.c,file,,,,, -/srp/srp_vfy.c,,,Copyright 2011-2016 The OpenSSL Project Authors,2,2, -/srp/srp_vfy.c,,,,2,2,The OpenSSL Project Authors +srp/,directory,,,,, +srp/build.info,file,,,,, +srp/srp_lib.c,file,,,,, +srp/srp_lib.c,,,Copyright 2011-2016 The OpenSSL Project Authors,2,2, +srp/srp_lib.c,,,,2,2,The OpenSSL Project Authors +srp/srp_vfy.c,file,,,,, +srp/srp_vfy.c,,,Copyright 2011-2016 The OpenSSL Project Authors,2,2, +srp/srp_vfy.c,,,,2,2,The OpenSSL Project Authors diff --git a/tests/formattedcode/data/csv/tree/expected.csv b/tests/formattedcode/data/csv/tree/expected.csv index 940f37c2b33..4c0cf2a6162 100644 --- a/tests/formattedcode/data/csv/tree/expected.csv +++ b/tests/formattedcode/data/csv/tree/expected.csv @@ -1,24 +1,24 @@ Resource,type,scan_errors,copyright,start_line,end_line,copyright_holder -/scan/,directory,,,,, -/scan/copy1.c,file,,,,, -/scan/copy1.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy1.c,,,,1,1,"ACME, Inc." -/scan/copy2.c,file,,,,, -/scan/copy2.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy2.c,,,,1,1,"ACME, Inc." -/scan/copy3.c,file,,,,, -/scan/copy3.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/copy3.c,,,,1,1,"ACME, Inc." -/scan/subdir/,directory,,,,, -/scan/subdir/copy1.c,file,,,,, -/scan/subdir/copy1.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/subdir/copy1.c,,,,1,1,"ACME, Inc." -/scan/subdir/copy2.c,file,,,,, -/scan/subdir/copy2.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/subdir/copy2.c,,,,1,1,"ACME, Inc." -/scan/subdir/copy3.c,file,,,,, -/scan/subdir/copy3.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/subdir/copy3.c,,,,1,1,"ACME, Inc." -/scan/subdir/copy4.c,file,,,,, -/scan/subdir/copy4.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, -/scan/subdir/copy4.c,,,,1,1,"ACME, Inc." +scan/,directory,,,,, +scan/copy1.c,file,,,,, +scan/copy1.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, +scan/copy1.c,,,,1,1,"ACME, Inc." +scan/copy2.c,file,,,,, +scan/copy2.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, +scan/copy2.c,,,,1,1,"ACME, Inc." +scan/copy3.c,file,,,,, +scan/copy3.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, +scan/copy3.c,,,,1,1,"ACME, Inc." +scan/subdir/,directory,,,,, +scan/subdir/copy1.c,file,,,,, +scan/subdir/copy1.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, +scan/subdir/copy1.c,,,,1,1,"ACME, Inc." +scan/subdir/copy2.c,file,,,,, +scan/subdir/copy2.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, +scan/subdir/copy2.c,,,,1,1,"ACME, Inc." +scan/subdir/copy3.c,file,,,,, +scan/subdir/copy3.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, +scan/subdir/copy3.c,,,,1,1,"ACME, Inc." +scan/subdir/copy4.c,file,,,,, +scan/subdir/copy4.c,,,"Copyright (c) 2000 ACME, Inc.",1,1, +scan/subdir/copy4.c,,,,1,1,"ACME, Inc." diff --git a/tests/formattedcode/test_output_csv.py b/tests/formattedcode/test_output_csv.py index e3abd2aed88..e3070e1b0af 100644 --- a/tests/formattedcode/test_output_csv.py +++ b/tests/formattedcode/test_output_csv.py @@ -117,6 +117,22 @@ def test_flatten_scan_minimal(): check_json(result, expected_file) +def test_flatten_scan_can_process_path_with_and_without_leading_slash(): + test_json = test_env.get_test_loc('csv/flatten_scan/path_with_and_without_leading_slash.json') + scan = load_scan(test_json) + headers = OrderedDict([ + ('info', []), + ('license', []), + ('copyright', []), + ('email', []), + ('url', []), + ('package', []), + ]) + result = list(flatten_scan(scan, headers)) + expected_file = test_env.get_test_loc('csv/flatten_scan/path_with_and_without_leading_slash.json-expected') + check_json(result, expected_file) + + @pytest.mark.scanslow def test_can_process_live_scan_for_packages_with_root(): test_dir = test_env.get_test_loc('csv/packages/scan') diff --git a/tests/licensedcode/data/licenses/artistic-2.0_and_bsd-new_and_bsd-new_and_bzip2-libbzip-1.0.5_and_other.txt.yml b/tests/licensedcode/data/licenses/artistic-2.0_and_bsd-new_and_bsd-new_and_bzip2-libbzip-1.0.5_and_other.txt.yml index 0225d56cfb4..f3606146909 100644 --- a/tests/licensedcode/data/licenses/artistic-2.0_and_bsd-new_and_bsd-new_and_bzip2-libbzip-1.0.5_and_other.txt.yml +++ b/tests/licensedcode/data/licenses/artistic-2.0_and_bsd-new_and_bsd-new_and_bzip2-libbzip-1.0.5_and_other.txt.yml @@ -1,9 +1,9 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus - zlib - unicode - unicode - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus - bsd-new - bsd-new - bzip2-libbzip-2010 diff --git a/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0-plus_and_zlib.txt.yml b/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0-plus_and_zlib.txt.yml index 5932c2e8b8d..b7ec715d2a8 100644 --- a/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0-plus_and_zlib.txt.yml +++ b/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0-plus_and_zlib.txt.yml @@ -1,6 +1,6 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus - unknown - zlib - - artistic-2.0 OR gpl-1.0-plus - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0.txt.yml b/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0.txt.yml index 8d6f48dd756..09ef46709ed 100644 --- a/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0.txt.yml +++ b/tests/licensedcode/data/licenses/artistic-2.0_and_gpl-1.0.txt.yml @@ -1,2 +1,2 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/licenses/artistic-2.0_and_gpl.txt.yml b/tests/licensedcode/data/licenses/artistic-2.0_and_gpl.txt.yml index 8d6f48dd756..09ef46709ed 100644 --- a/tests/licensedcode/data/licenses/artistic-2.0_and_gpl.txt.yml +++ b/tests/licensedcode/data/licenses/artistic-2.0_and_gpl.txt.yml @@ -1,2 +1,2 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/licenses/boost-1.0_and_bsd-simplified_and_cddl-1.0_and_gpl-2.0-classpath_and_other.txt.yml b/tests/licensedcode/data/licenses/boost-1.0_and_bsd-simplified_and_cddl-1.0_and_gpl-2.0-classpath_and_other.txt.yml index 64d907803ad..42d81681578 100644 --- a/tests/licensedcode/data/licenses/boost-1.0_and_bsd-simplified_and_cddl-1.0_and_gpl-2.0-classpath_and_other.txt.yml +++ b/tests/licensedcode/data/licenses/boost-1.0_and_bsd-simplified_and_cddl-1.0_and_gpl-2.0-classpath_and_other.txt.yml @@ -63,7 +63,7 @@ license_expressions: - lgpl-2.1 - lgpl-2.0-plus - gpl-1.0-plus - - fsf-mit + - fsf-unlimited-no-warranty - mpl-1.1 - unknown - openssl-ssleay @@ -90,7 +90,7 @@ license_expressions: - lgpl-2.1 - lgpl-2.0-plus - gpl-1.0-plus - - fsf-mit + - fsf-unlimited-no-warranty - mpl-1.1 - unknown - openssl-ssleay diff --git a/tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-mit_and_gfdl-1.2_and_other.txt b/tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-unlimited-no-warranty_and_gfdl-1.2_and_other.txt similarity index 100% rename from tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-mit_and_gfdl-1.2_and_other.txt rename to tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-unlimited-no-warranty_and_gfdl-1.2_and_other.txt diff --git a/tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-mit_and_gfdl-1.2_and_other.txt.yml b/tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-unlimited-no-warranty_and_gfdl-1.2_and_other.txt.yml similarity index 100% rename from tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-mit_and_gfdl-1.2_and_other.txt.yml rename to tests/licensedcode/data/licenses/bsd-new_and_bsd-new_and_fsf-unlimited-no-warranty_and_gfdl-1.2_and_other.txt.yml diff --git a/tests/licensedcode/data/licenses/eclipse-openj9_html.html.yml b/tests/licensedcode/data/licenses/eclipse-openj9_html.html.yml index 765cda16ae3..f5c1046be3a 100644 --- a/tests/licensedcode/data/licenses/eclipse-openj9_html.html.yml +++ b/tests/licensedcode/data/licenses/eclipse-openj9_html.html.yml @@ -5,8 +5,7 @@ license_expressions: AND bsd-new AND mit AND gpl-3.0-plus WITH autoconf-simple-exception - epl-2.0 OR apache-2.0 - bsd-new - - unknown - - bsd-new + - mit - bsd-new - gpl-3.0-plus WITH autoconf-simple-exception - unicode diff --git a/tests/licensedcode/data/licenses/fsf-mit_and_fsf-mit_and_fsf-mit_and_fsf-mit_and_other.txt b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_other.txt similarity index 100% rename from tests/licensedcode/data/licenses/fsf-mit_and_fsf-mit_and_fsf-mit_and_fsf-mit_and_other.txt rename to tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_other.txt diff --git a/tests/licensedcode/data/licenses/fsf-mit_and_fsf-mit_and_fsf-mit_and_fsf-mit_and_other.txt.yml b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_other.txt.yml similarity index 91% rename from tests/licensedcode/data/licenses/fsf-mit_and_fsf-mit_and_fsf-mit_and_fsf-mit_and_other.txt.yml rename to tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_other.txt.yml index 9b5ecd9e9ef..1ce21708c7d 100644 --- a/tests/licensedcode/data/licenses/fsf-mit_and_fsf-mit_and_fsf-mit_and_fsf-mit_and_other.txt.yml +++ b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_fsf-unlimited-no-warranty_and_other.txt.yml @@ -1,5 +1,5 @@ license_expressions: - - fsf-mit + - fsf-unlimited-no-warranty - fsf-unlimited - fsf-unlimited - fsf-unlimited diff --git a/tests/licensedcode/data/licenses/fsf-mit_and_lgpl-2.1-plus.txt b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_lgpl-2.1-plus.txt similarity index 100% rename from tests/licensedcode/data/licenses/fsf-mit_and_lgpl-2.1-plus.txt rename to tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_lgpl-2.1-plus.txt diff --git a/tests/licensedcode/data/licenses/fsf-mit_and_lgpl-2.1-plus.txt.yml b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_lgpl-2.1-plus.txt.yml similarity index 56% rename from tests/licensedcode/data/licenses/fsf-mit_and_lgpl-2.1-plus.txt.yml rename to tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_lgpl-2.1-plus.txt.yml index 3533918f33b..dd669e57f13 100644 --- a/tests/licensedcode/data/licenses/fsf-mit_and_lgpl-2.1-plus.txt.yml +++ b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_and_lgpl-2.1-plus.txt.yml @@ -1,3 +1,3 @@ license_expressions: - - fsf-mit + - fsf-unlimited-no-warranty - lgpl-2.1-plus diff --git a/tests/licensedcode/data/licenses/fsf-mit_with_line_numbers.pl b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_with_line_numbers.pl similarity index 100% rename from tests/licensedcode/data/licenses/fsf-mit_with_line_numbers.pl rename to tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_with_line_numbers.pl diff --git a/tests/licensedcode/data/licenses/fsf-mit_with_line_numbers.pl.yml b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_with_line_numbers.pl.yml similarity index 64% rename from tests/licensedcode/data/licenses/fsf-mit_with_line_numbers.pl.yml rename to tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_with_line_numbers.pl.yml index 3420c2acd75..60677f6c267 100644 --- a/tests/licensedcode/data/licenses/fsf-mit_with_line_numbers.pl.yml +++ b/tests/licensedcode/data/licenses/fsf-unlimited-no-warranty_with_line_numbers.pl.yml @@ -1,4 +1,4 @@ license_expressions: - gpl-2.0-plus - - fsf-mit + - fsf-unlimited-no-warranty - free-unknown diff --git a/tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-mit.txt b/tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-unlimited-no-warranty.txt similarity index 100% rename from tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-mit.txt rename to tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-unlimited-no-warranty.txt diff --git a/tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-mit.txt.yml b/tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-unlimited-no-warranty.txt.yml similarity index 100% rename from tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-mit.txt.yml rename to tests/licensedcode/data/licenses/fsf-unlimited_not_fsf-unlimited-no-warranty.txt.yml diff --git a/tests/licensedcode/data/licenses/multiple_permissive_licenses_and_lgpl_and_mpl.txt.yml b/tests/licensedcode/data/licenses/multiple_permissive_licenses_and_lgpl_and_mpl.txt.yml index e6b25656a35..43119eabe96 100644 --- a/tests/licensedcode/data/licenses/multiple_permissive_licenses_and_lgpl_and_mpl.txt.yml +++ b/tests/licensedcode/data/licenses/multiple_permissive_licenses_and_lgpl_and_mpl.txt.yml @@ -20,6 +20,7 @@ license_expressions: - libpng - libpng - libpng + - libpng - bsd-new - mit - mpl-2.0 diff --git a/tests/licensedcode/data/more_licenses/licenses/mibble.txt.yml b/tests/licensedcode/data/more_licenses/licenses/mibble.txt.yml index c832eae14f9..b6664baa83e 100644 --- a/tests/licensedcode/data/more_licenses/licenses/mibble.txt.yml +++ b/tests/licensedcode/data/more_licenses/licenses/mibble.txt.yml @@ -1,9 +1,4 @@ license_expressions: - - unknown - - unknown - - unknown - - unknown - - w3c - - other-permissive + - commercial-license notes: this is a license from fossology license reference Mibble (Mibble Software License Agreement) http://www.mibble.org/download/commercial-license.pdf diff --git a/tests/licensedcode/data/more_licenses/licenses/mindterm.txt.yml b/tests/licensedcode/data/more_licenses/licenses/mindterm.txt.yml index 59ef514aaac..50ff02dc94a 100644 --- a/tests/licensedcode/data/more_licenses/licenses/mindterm.txt.yml +++ b/tests/licensedcode/data/more_licenses/licenses/mindterm.txt.yml @@ -1,14 +1,3 @@ license_expressions: - - proprietary-license - - unknown - - unknown - - unknown - - unknown - - unknown - commercial-license - - commercial-license - - unknown - - warranty-disclaimer - - warranty-disclaimer - - warranty-disclaimer notes: this is a license from fossology license reference Mindterm (Mindterm EULA) http://www.appgate.com/index/products/mindterm/mindterm_end_user_lic.html diff --git a/tests/licensedcode/data/more_licenses/tests/Artistic/a2p.c.yml b/tests/licensedcode/data/more_licenses/tests/Artistic/a2p.c.yml index 8d6f48dd756..09ef46709ed 100644 --- a/tests/licensedcode/data/more_licenses/tests/Artistic/a2p.c.yml +++ b/tests/licensedcode/data/more_licenses/tests/Artistic/a2p.c.yml @@ -1,2 +1,2 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/more_licenses/tests/BSD/bsd.txt.yml b/tests/licensedcode/data/more_licenses/tests/BSD/bsd.txt.yml index 51b40f5cab2..79dd6413bde 100644 --- a/tests/licensedcode/data/more_licenses/tests/BSD/bsd.txt.yml +++ b/tests/licensedcode/data/more_licenses/tests/BSD/bsd.txt.yml @@ -3,7 +3,7 @@ license_expressions: - bsd-new - bsd-new - bsd-simplified - - bsd-new + - bsd-simplified - bsd-simplified - mit - unknown diff --git a/tests/licensedcode/data/more_licenses/tests/Dual-license/Artistic-1.0+GPL_META.yaml.yml b/tests/licensedcode/data/more_licenses/tests/Dual-license/Artistic-1.0+GPL_META.yaml.yml index 18d1cade02f..ddc2c329926 100644 --- a/tests/licensedcode/data/more_licenses/tests/Dual-license/Artistic-1.0+GPL_META.yaml.yml +++ b/tests/licensedcode/data/more_licenses/tests/Dual-license/Artistic-1.0+GPL_META.yaml.yml @@ -1,2 +1,2 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref1.yml b/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref1.yml index 8d6f48dd756..09ef46709ed 100644 --- a/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref1.yml +++ b/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref1.yml @@ -1,2 +1,2 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref2.yml b/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref2.yml index 8d6f48dd756..09ef46709ed 100644 --- a/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref2.yml +++ b/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref2.yml @@ -1,2 +1,2 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref3.yml b/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref3.yml index 8d6f48dd756..09ef46709ed 100644 --- a/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref3.yml +++ b/tests/licensedcode/data/more_licenses/tests/Dual-license/Perl_ref3.yml @@ -1,2 +1,2 @@ license_expressions: - - artistic-2.0 OR gpl-1.0-plus + - artistic-perl-1.0 OR gpl-1.0-plus diff --git a/tests/licensedcode/data/more_licenses/tests/Dual-license/postgres_lic.txt.yml b/tests/licensedcode/data/more_licenses/tests/Dual-license/postgres_lic.txt.yml index d738668744f..52259e10490 100644 --- a/tests/licensedcode/data/more_licenses/tests/Dual-license/postgres_lic.txt.yml +++ b/tests/licensedcode/data/more_licenses/tests/Dual-license/postgres_lic.txt.yml @@ -2,22 +2,19 @@ license_expressions: - other-permissive - postgresql - henry-spencer-1999 - - artistic-2.0 AND bsd-new - - artistic-2.0 OR gpl-1.0-plus + - tcl + - tcl + - (artistic-perl-1.0 OR gpl-1.0-plus) AND bsd-new - postgresql - postgresql - bsd-new - - unknown-license-reference - bsd-new - - unknown-license-reference - bsd-new - bsd-new - bsd-new - - unknown-license-reference - bsd-new - - unknown-license-reference - bsd-new - - unknown-license-reference - other-permissive - other-permissive - tcl + - tcl diff --git a/tests/licensedcode/data/more_licenses/tests/FSF/FSF-and-GPL.txt.yml b/tests/licensedcode/data/more_licenses/tests/FSF/FSF-and-GPL.txt.yml index 38ac2bcaa55..ace7bd30bf7 100644 --- a/tests/licensedcode/data/more_licenses/tests/FSF/FSF-and-GPL.txt.yml +++ b/tests/licensedcode/data/more_licenses/tests/FSF/FSF-and-GPL.txt.yml @@ -1,3 +1,3 @@ license_expressions: - - fsf-mit + - fsf-unlimited-no-warranty - gpl-2.0-plus diff --git a/tests/licensedcode/data/more_licenses/tests/FSF/aclocal.m4.yml b/tests/licensedcode/data/more_licenses/tests/FSF/aclocal.m4.yml index 8b22643abb1..5c02feb6e08 100644 --- a/tests/licensedcode/data/more_licenses/tests/FSF/aclocal.m4.yml +++ b/tests/licensedcode/data/more_licenses/tests/FSF/aclocal.m4.yml @@ -1,5 +1,5 @@ license_expressions: - - fsf-mit + - fsf-unlimited-no-warranty - fsf-unlimited - fsf-unlimited - fsf-unlimited diff --git a/tests/licensedcode/data/more_licenses/tests/IJG/jpeg.LICENSE.yml b/tests/licensedcode/data/more_licenses/tests/IJG/jpeg.LICENSE.yml index 0c24449293e..5c7fe908040 100644 --- a/tests/licensedcode/data/more_licenses/tests/IJG/jpeg.LICENSE.yml +++ b/tests/licensedcode/data/more_licenses/tests/IJG/jpeg.LICENSE.yml @@ -1,2 +1,4 @@ license_expressions: - ijg + - ijg + diff --git a/tests/licensedcode/data/more_licenses/tests/LGPL/openjdk-7-jre-headless_license.txt.yml b/tests/licensedcode/data/more_licenses/tests/LGPL/openjdk-7-jre-headless_license.txt.yml index b39575248d9..6537db2406e 100644 --- a/tests/licensedcode/data/more_licenses/tests/LGPL/openjdk-7-jre-headless_license.txt.yml +++ b/tests/licensedcode/data/more_licenses/tests/LGPL/openjdk-7-jre-headless_license.txt.yml @@ -66,7 +66,7 @@ license_expressions: - x11-keith-packard - unicode - historical - - x11 + - x11 AND other-permissive - mit - historical - warranty-disclaimer diff --git a/tests/licensedcode/data/more_licenses/tests/UnclassifiedLicense/eula.txt.yml b/tests/licensedcode/data/more_licenses/tests/UnclassifiedLicense/eula.txt.yml index 6c6ff17e8ff..6a0cd936404 100644 --- a/tests/licensedcode/data/more_licenses/tests/UnclassifiedLicense/eula.txt.yml +++ b/tests/licensedcode/data/more_licenses/tests/UnclassifiedLicense/eula.txt.yml @@ -1,5 +1,5 @@ license_expressions: - unknown - - fsf-mit - - fsf-mit + - fsf-unlimited-no-warranty + - fsf-unlimited-no-warranty - amd-historical diff --git a/tests/licensedcode/data/slic-tests/identification/aclocal.m4.yml b/tests/licensedcode/data/slic-tests/identification/aclocal.m4.yml index 7c0b7343368..e2b90791b48 100644 --- a/tests/licensedcode/data/slic-tests/identification/aclocal.m4.yml +++ b/tests/licensedcode/data/slic-tests/identification/aclocal.m4.yml @@ -1,5 +1,5 @@ license_expressions: - - fsf-mit + - fsf-unlimited-no-warranty - fsf-unlimited - gpl-2.0-plus WITH libtool-exception-2.0 - fsf-free diff --git a/tests/licensedcode/data/slic-tests/identification/versioninfo.rc.in.yml b/tests/licensedcode/data/slic-tests/identification/versioninfo.rc.in.yml index 3533918f33b..dd669e57f13 100644 --- a/tests/licensedcode/data/slic-tests/identification/versioninfo.rc.in.yml +++ b/tests/licensedcode/data/slic-tests/identification/versioninfo.rc.in.yml @@ -1,3 +1,3 @@ license_expressions: - - fsf-mit + - fsf-unlimited-no-warranty - lgpl-2.1-plus diff --git a/tests/licensedcode/data/spdx/licenses/complex-short.html.yml b/tests/licensedcode/data/spdx/licenses/complex-short.html.yml index 2bd69754737..a7b736a51a1 100644 --- a/tests/licensedcode/data/spdx/licenses/complex-short.html.yml +++ b/tests/licensedcode/data/spdx/licenses/complex-short.html.yml @@ -5,8 +5,8 @@ license_expressions: - epl-2.0 OR apache-2.0 OR gpl-2.0 WITH classpath-exception-2.0 OR unknown-spdx WITH unknown-spdx - (epl-2.0 OR apache-2.0 OR (gpl-2.0 WITH classpath-exception-2.0 AND gpl-2.0 WITH openjdk-exception)) AND bsd-new AND mit AND gpl-3.0-plus WITH autoconf-simple-exception - - bsd-source-code - - unknown + - bsd-new + - mit - gpl-3.0-plus WITH autoconf-simple-exception - unicode - unicode diff --git a/tests/licensedcode/test_detect.py b/tests/licensedcode/test_detect.py index 7a234dfa1a9..b20daac2034 100644 --- a/tests/licensedcode/test_detect.py +++ b/tests/licensedcode/test_detect.py @@ -1082,7 +1082,7 @@ def test_match_has_correct_line_positions_in_automake_perl_file(self): expected = [ # detected, match.lines(), match.qspan, (u'gpl-2.0-plus', (12, 25), Span(46, 155)), - (u'fsf-mit', (231, 238), Span(937, 1000)), + (u'fsf-unlimited-no-warranty', (231, 238), Span(937, 1000)), (u'free-unknown', (306, 307), Span(1300, 1322)) ] self.check_position('positions/automake.pl', expected) diff --git a/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin-expected.json b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin-expected.json new file mode 100644 index 00000000000..1c77bb57f06 --- /dev/null +++ b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin-expected.json @@ -0,0 +1,439 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "options": { + "input": "", + "--consolidate": true, + "--copyright": true, + "--info": true, + "--json": "", + "--license": true, + "--package": true + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "message": null, + "errors": [], + "extra_data": { + "files_count": 4 + } + } + ], + "consolidated_components": [ + { + "type": "license-holders", + "identifier": "omega_corp__1", + "consolidated_license_expression": "mit", + "consolidated_holders": [ + "Omega Corp." + ], + "consolidated_copyright": "Copyright (c) Omega Corp.", + "core_license_expression": "mit", + "core_holders": [ + "Omega Corp." + ], + "other_license_expression": null, + "other_holders": [], + "files_count": 1 + }, + { + "type": "license-holders", + "identifier": "ibm_corp__1", + "consolidated_license_expression": "mit", + "consolidated_holders": [ + "IBM Corp." + ], + "consolidated_copyright": "Copyright (c) IBM Corp.", + "core_license_expression": "mit", + "core_holders": [ + "IBM Corp." + ], + "other_license_expression": null, + "other_holders": [], + "files_count": 3 + } + ], + "consolidated_packages": [], + "files": [ + { + "path": "report-subdirectory-with-minority-origin", + "type": "directory", + "name": "report-subdirectory-with-minority-origin", + "base_name": "report-subdirectory-with-minority-origin", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [], + "license_expressions": [], + "copyrights": [], + "holders": [], + "authors": [], + "packages": [], + "consolidated_to": [ + "ibm_corp__1" + ], + "files_count": 4, + "dirs_count": 1, + "size_count": 4190, + "scan_errors": [] + }, + { + "path": "report-subdirectory-with-minority-origin/b", + "type": "file", + "name": "b", + "base_name": "b", + "extension": "", + "size": 1047, + "sha1": "c1c59de6f5973dc018be393cad42eae9eab2bd76", + "md5": "d4918bcfd0ba980596702cbaae7ceb13", + "mime_type": "text/plain", + "file_type": "ASCII text, with very long lines", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [ + { + "key": "mit", + "score": 100.0, + "name": "MIT License", + "short_name": "MIT License", + "category": "Permissive", + "is_exception": false, + "owner": "MIT", + "homepage_url": "http://opensource.org/licenses/mit-license.php", + "text_url": "http://opensource.org/licenses/mit-license.php", + "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:mit", + "spdx_license_key": "MIT", + "spdx_url": "https://spdx.org/licenses/MIT", + "start_line": 3, + "end_line": 7, + "matched_rule": { + "identifier": "mit.LICENSE", + "license_expression": "mit", + "licenses": [ + "mit" + ], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "matcher": "2-aho", + "rule_length": 161, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } + ], + "license_expressions": [ + "mit" + ], + "copyrights": [ + { + "value": "Copyright (c) IBM Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "holders": [ + { + "value": "IBM Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "authors": [], + "packages": [], + "consolidated_to": [ + "ibm_corp__1" + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "report-subdirectory-with-minority-origin/c", + "type": "file", + "name": "c", + "base_name": "c", + "extension": "", + "size": 1047, + "sha1": "c1c59de6f5973dc018be393cad42eae9eab2bd76", + "md5": "d4918bcfd0ba980596702cbaae7ceb13", + "mime_type": "text/plain", + "file_type": "ASCII text, with very long lines", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [ + { + "key": "mit", + "score": 100.0, + "name": "MIT License", + "short_name": "MIT License", + "category": "Permissive", + "is_exception": false, + "owner": "MIT", + "homepage_url": "http://opensource.org/licenses/mit-license.php", + "text_url": "http://opensource.org/licenses/mit-license.php", + "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:mit", + "spdx_license_key": "MIT", + "spdx_url": "https://spdx.org/licenses/MIT", + "start_line": 3, + "end_line": 7, + "matched_rule": { + "identifier": "mit.LICENSE", + "license_expression": "mit", + "licenses": [ + "mit" + ], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "matcher": "2-aho", + "rule_length": 161, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } + ], + "license_expressions": [ + "mit" + ], + "copyrights": [ + { + "value": "Copyright (c) IBM Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "holders": [ + { + "value": "IBM Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "authors": [], + "packages": [], + "consolidated_to": [ + "ibm_corp__1" + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "report-subdirectory-with-minority-origin/d", + "type": "file", + "name": "d", + "base_name": "d", + "extension": "", + "size": 1047, + "sha1": "c1c59de6f5973dc018be393cad42eae9eab2bd76", + "md5": "d4918bcfd0ba980596702cbaae7ceb13", + "mime_type": "text/plain", + "file_type": "ASCII text, with very long lines", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [ + { + "key": "mit", + "score": 100.0, + "name": "MIT License", + "short_name": "MIT License", + "category": "Permissive", + "is_exception": false, + "owner": "MIT", + "homepage_url": "http://opensource.org/licenses/mit-license.php", + "text_url": "http://opensource.org/licenses/mit-license.php", + "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:mit", + "spdx_license_key": "MIT", + "spdx_url": "https://spdx.org/licenses/MIT", + "start_line": 3, + "end_line": 7, + "matched_rule": { + "identifier": "mit.LICENSE", + "license_expression": "mit", + "licenses": [ + "mit" + ], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "matcher": "2-aho", + "rule_length": 161, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } + ], + "license_expressions": [ + "mit" + ], + "copyrights": [ + { + "value": "Copyright (c) IBM Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "holders": [ + { + "value": "IBM Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "authors": [], + "packages": [], + "consolidated_to": [ + "ibm_corp__1" + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "report-subdirectory-with-minority-origin/minority_holder", + "type": "directory", + "name": "minority_holder", + "base_name": "minority_holder", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [], + "license_expressions": [], + "copyrights": [], + "holders": [], + "authors": [], + "packages": [], + "consolidated_to": [ + "omega_corp__1" + ], + "files_count": 1, + "dirs_count": 0, + "size_count": 1049, + "scan_errors": [] + }, + { + "path": "report-subdirectory-with-minority-origin/minority_holder/a", + "type": "file", + "name": "a", + "base_name": "a", + "extension": "", + "size": 1049, + "sha1": "e37712571a025608fd352ef365f6cf2ca0a0dac9", + "md5": "d19b821a9d3564a3592df92e3956687a", + "mime_type": "text/plain", + "file_type": "ASCII text, with very long lines", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "licenses": [ + { + "key": "mit", + "score": 100.0, + "name": "MIT License", + "short_name": "MIT License", + "category": "Permissive", + "is_exception": false, + "owner": "MIT", + "homepage_url": "http://opensource.org/licenses/mit-license.php", + "text_url": "http://opensource.org/licenses/mit-license.php", + "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:mit", + "spdx_license_key": "MIT", + "spdx_url": "https://spdx.org/licenses/MIT", + "start_line": 3, + "end_line": 7, + "matched_rule": { + "identifier": "mit.LICENSE", + "license_expression": "mit", + "licenses": [ + "mit" + ], + "is_license_text": true, + "is_license_notice": false, + "is_license_reference": false, + "is_license_tag": false, + "matcher": "2-aho", + "rule_length": 161, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100 + } + } + ], + "license_expressions": [ + "mit" + ], + "copyrights": [ + { + "value": "Copyright (c) Omega Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "holders": [ + { + "value": "Omega Corp.", + "start_line": 1, + "end_line": 1 + } + ], + "authors": [], + "packages": [], + "consolidated_to": [ + "omega_corp__1" + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/b b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/b new file mode 100644 index 00000000000..2b71b2289c8 --- /dev/null +++ b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/b @@ -0,0 +1,7 @@ +Copyright (c) IBM Corp. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/c b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/c new file mode 100644 index 00000000000..2b71b2289c8 --- /dev/null +++ b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/c @@ -0,0 +1,7 @@ +Copyright (c) IBM Corp. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/d b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/d new file mode 100644 index 00000000000..2b71b2289c8 --- /dev/null +++ b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/d @@ -0,0 +1,7 @@ +Copyright (c) IBM Corp. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/minority_holder/a b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/minority_holder/a new file mode 100644 index 00000000000..467e72c4670 --- /dev/null +++ b/tests/scancode/data/plugin_consolidate/report-subdirectory-with-minority-origin/minority_holder/a @@ -0,0 +1,7 @@ +Copyright (c) Omega Corp. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/scancode/test_plugin_consolidate.py b/tests/scancode/test_plugin_consolidate.py index c9fbdf0d70f..3eff46014da 100644 --- a/tests/scancode/test_plugin_consolidate.py +++ b/tests/scancode/test_plugin_consolidate.py @@ -95,7 +95,6 @@ def test_consolidate_clear_summary_from_json(self): def test_consolidate_component_package_from_json_can_run_twice(self): scan_file = self.get_scan('plugin_consolidate/component-package', cli_options='-clip') - expected_file = self.get_test_loc('plugin_consolidate/component-package-expected.json') result_file = self.get_temp_file('json') @@ -163,3 +162,10 @@ def test_consolidate_component_package_build_from_live_scan(self): expected_file = self.get_test_loc('plugin_consolidate/component-package-build-expected.json') run_scan_click(['-clip', scan_loc, '--consolidate', '--json', result_file]) check_json_scan(expected_file, result_file, regen=False, remove_file_date=True, ignore_headers=True) + + def test_consolidate_report_minority_origin_directory(self): + scan_loc = self.get_test_loc('plugin_consolidate/report-subdirectory-with-minority-origin') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('plugin_consolidate/report-subdirectory-with-minority-origin-expected.json') + run_scan_click(['-clip', scan_loc, '--consolidate', '--json', result_file]) + check_json_scan(expected_file, result_file, regen=False, remove_file_date=True, ignore_headers=True)