diff --git a/.github/workflows/entrypoint.sh b/.github/workflows/entrypoint.sh index 8d48d8a22..363e15822 100755 --- a/.github/workflows/entrypoint.sh +++ b/.github/workflows/entrypoint.sh @@ -13,7 +13,7 @@ mkdir -p /var/lock/ opkg update -[ -n "${CI_HELPER:=''}" ] || CI_HELPER="/ci/.github/workflows/ci_helpers.sh" +export CI_HELPER="/ci/.github/workflows/ci_helpers.sh" for PKG in /ci/*.ipk; do tar -xzOf "$PKG" ./control.tar.gz | tar xzf - ./control @@ -42,7 +42,7 @@ for PKG in /ci/*.ipk; do continue fi - export PKG_NAME PKG_VERSION CI_HELPER + export PKG_NAME PKG_VERSION if [ -f "$PRE_TEST_SCRIPT" ]; then echo "Use package specific pre-test.sh" diff --git a/.github/workflows/formal.yml b/.github/workflows/formal.yml index b3f824c52..1447a3959 100644 --- a/.github/workflows/formal.yml +++ b/.github/workflows/formal.yml @@ -43,7 +43,7 @@ jobs: fi subject="$(git show -s --format=%s $commit)" - if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then + if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert ' -e '^CONTRIBUTING.md' -e '^README.md'; then success "Commit subject line seems ok ($subject)" else err "Commit subject line MUST start with ': ' ($subject)" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 993915b93..25c332146 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -200,9 +200,9 @@ checking if `foobar --version` prints the correct version. `PKG_VERSION` is the OpenWrt version and therefore includes the `PKG_RELEASE`, which isn't usually part of the running programs version. -The following snippet show a script that tests different binaries, depending +The following snippet shows a script that tests different binaries depending on what IPK package was installed. The `gpsd` Makefile produces both a `gpsd` and -a `gpsd-clients` IPK package. +a `gpsd-clients` IPK packages. ```shell #!/bin/sh diff --git a/lang/node/Makefile b/lang/node/Makefile index 692bedf38..b37c433b3 100644 --- a/lang/node/Makefile +++ b/lang/node/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=node -PKG_VERSION:=v20.9.0 +PKG_VERSION:=v20.10.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION) -PKG_HASH:=a23d96810abf0455426b349d47ce5310f33095b7bc0571b9cc510f481c3a4519 +PKG_HASH:=32eb256eebd8cacd5574e6631e54b42be7ec8ebe25ad47a8ca685403bad15535 PKG_MAINTAINER:=Hirokazu MORIKAWA , Adrian Panella PKG_LICENSE:=MIT diff --git a/lang/node/patches/003-path.patch b/lang/node/patches/003-path.patch index 011b02489..06201179b 100644 --- a/lang/node/patches/003-path.patch +++ b/lang/node/patches/003-path.patch @@ -1,6 +1,6 @@ --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -1378,7 +1378,8 @@ Module._initPaths = function() { +@@ -1537,7 +1537,8 @@ Module._initPaths = function() { path.resolve(process.execPath, '..') : path.resolve(process.execPath, '..', '..'); diff --git a/lang/perl/Makefile b/lang/perl/Makefile index 5249a0505..afd82997f 100644 --- a/lang/perl/Makefile +++ b/lang/perl/Makefile @@ -15,7 +15,7 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://www.cpan.org/src/5.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=eca551caec3bc549a4e590c0015003790bdd1a604ffe19cc78ee631d51f7072e +PKG_HASH:=d91115e90b896520e83d4de6b52f8254ef2b70a8d545ffab33200ea9f1cf29e8 PKG_LICENSE:=GPL-1.0-or-later Artistic-1.0-Perl PKG_LICENSE_FILES:=Copying Artistic README diff --git a/lang/perl/files/version.config b/lang/perl/files/version.config index fbd036130..1c0e7718c 100644 --- a/lang/perl/files/version.config +++ b/lang/perl/files/version.config @@ -1,7 +1,7 @@ # Set the version here PERL_REVISION=5 PERL_VERSION=38 -PERL_SUBVERSION=0 +PERL_SUBVERSION=2 # (api_revison, api_version, api_subversion) = (revision, version, 0) usually PERL_API_REVISION=5 diff --git a/lang/perl/patches/900-use-rm-force.patch b/lang/perl/patches/900-use-rm-force.patch index 857cd1e9e..09967bebd 100644 --- a/lang/perl/patches/900-use-rm-force.patch +++ b/lang/perl/patches/900-use-rm-force.patch @@ -120,8 +120,8 @@ !NO!SUBS! case "$osname" in -@@ -1133,8 +1134,8 @@ pod/perl5380delta.pod: pod/perldelta.pod - $(LNS) perldelta.pod pod/perl5380delta.pod +@@ -1133,8 +1134,8 @@ pod/perl5382delta.pod: pod/perldelta.pod + $(LNS) perldelta.pod pod/perl5382delta.pod extra.pods: $(MINIPERL_EXE) - -@test ! -f extra.pods || rm -f `cat extra.pods` @@ -153,14 +153,14 @@ # Like distclean but also removes emacs backups and *.orig. veryclean: _verycleaner _mopup _clobber - -@rm -f Obsolete Wanted -+ $(RMS) Obsolete Wanted ++ @$(RMS) Obsolete Wanted # Do not 'make _mopup' directly. _mopup: - rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c $(mini_only_src) generate_uudmap$(EXE_EXT) $(generated_headers) + $(RMS) *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c $(mini_only_src) generate_uudmap$(EXE_EXT) $(generated_headers) -rmdir .depending -- -rm *.depends makedepend_file + -rm *.depends makedepend_file - -@test -f extra.pods && rm -f `cat extra.pods` - -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod - -rm -f perl.exp ext.libs $(generated_pods) uni.data $(mini_only_objs) pod/roffitall @@ -169,7 +169,6 @@ - -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump - -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl - -rm -f config.arch config.over $(DTRACE_H) -+ $(RMS) *.depends makedepend_file + -@test -f extra.pods && $(RMS) `cat extra.pods` + -@test -f vms/README_vms.pod && $(RMS) vms/README_vms.pod + $(RMS) perl.exp ext.libs $(generated_pods) uni.data $(mini_only_objs) pod/roffitall diff --git a/lang/perl/perlbase.mk b/lang/perl/perlbase.mk index f3d65a517..c50fda1b1 100644 --- a/lang/perl/perlbase.mk +++ b/lang/perl/perlbase.mk @@ -140,7 +140,7 @@ endef define Package/perlbase-b/install $(call perlmod/Install,$(1),B B.pm auto/B,) -$(call perlmod/InstallBaseTests,$(1),cpan/B-Debug/t ext/B/t lib/B/Deparse-core.t lib/B/Deparse-subclass.t lib/B/Deparse.t) +$(call perlmod/InstallBaseTests,$(1),ext/B/t lib/B/Deparse-core.t lib/B/Deparse-subclass.t lib/B/Deparse.t) endef $(eval $(call BuildPackage,perlbase-b)) @@ -405,7 +405,6 @@ endef define Package/perlbase-digest/install $(call perlmod/Install,$(1),Digest Digest.pm auto/Digest,) $(call perlmod/InstallBaseTests,$(1),cpan/Digest-MD5/MD5.xs cpan/Digest-MD5/t cpan/Digest-SHA/t cpan/Digest/t) - $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Digest-SHA/src endef $(eval $(call BuildPackage,perlbase-digest)) @@ -543,9 +542,9 @@ DEPENDS+=+perlbase-config endef define Package/perlbase-essential/install -$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm deprecate.pm lib.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm warnings warnings.pm,) +$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm deprecate.pm lib.pm builtin.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm vmsish.pm warnings warnings.pm,) $(call perlmod/Install/NoStrip,$(1),overload/numbers.pm,) -$(call perlmod/InstallBaseTests,$(1),cpan/parent/t dist/Carp/t dist/Exporter/t dist/constant/t dist/lib/t lib/locale.t lib/overload.t lib/overload64.t lib/overloading.t lib/strict.t lib/subs.t lib/vars.t lib/vars_carp.t lib/warnings.t) +$(call perlmod/InstallBaseTests,$(1),cpan/parent/t dist/Carp/t dist/Exporter/t dist/constant/t dist/lib/t lib/builtin.t lib/locale.t lib/overload.t lib/overload64.t lib/overloading.t lib/strict.t lib/subs.t lib/vars.t lib/vars_carp.t lib/vmsish.t lib/warnings.t) endef $(eval $(call BuildPackage,perlbase-essential)) @@ -558,7 +557,7 @@ DEPENDS+=+perlbase-essential +perlbase-feature +perlbase-version endef define Package/perlbase-experimental/install -$(call perlmod/Install,$(1),experimental.pm,) +$(call perlmod/Install,$(1),experimental.pm stable.pm,) $(call perlmod/InstallBaseTests,$(1),cpan/experimental/t) endef @@ -891,7 +890,7 @@ endef define Package/perlbase-locale/install $(call perlmod/Install,$(1),Locale,Locale/Constants.pod Locale/Country.pod Locale/Currency.pod Locale/Language.pod Locale/Maketext.pod Locale/Maketext/TPJ13.pod Locale/Script.pod) -$(call perlmod/InstallBaseTests,$(1),cpan/Locale-Codes/t cpan/Locale-Maketext-Simple/t dist/Locale-Maketext/t) +$(call perlmod/InstallBaseTests,$(1),cpan/Locale-Maketext-Simple/t dist/Locale-Maketext/t) endef $(eval $(call BuildPackage,perlbase-locale)) @@ -905,7 +904,7 @@ endef define Package/perlbase-math/install $(call perlmod/Install,$(1),Math auto/Math,) -$(call perlmod/InstallBaseTests,$(1),cpan/Math-Complex/t cpan/Math-BigInt-FastCalc/t cpan/Math-BigInt/t cpan/Math-BigRat/t) +$(call perlmod/InstallBaseTests,$(1),cpan/Math-BigInt-FastCalc/t cpan/Math-BigInt/t cpan/Math-BigRat/t) endef $(eval $(call BuildPackage,perlbase-math)) @@ -1128,7 +1127,7 @@ endef define Package/perlbase-pod/install $(call perlmod/Install,$(1),Pod,Pod/Usage.pm) $(call perlmod/Install/NoStrip,$(1),Pod/Usage.pm,) -$(call perlmod/InstallBaseTests,$(1),cpan/Pod-Checker/t cpan/Pod-Escapes/t cpan/Pod-Parser/lib cpan/Pod-Parser/scripts cpan/Pod-Parser/t cpan/Pod-Perldoc/t cpan/Pod-Simple/t cpan/Pod-Usage/scripts cpan/Pod-Usage/t cpan/podlators/t ext/Pod-Functions/Functions.pm ext/Pod-Functions/t ext/Pod-Html/t lib/Pod/t) +$(call perlmod/InstallBaseTests,$(1),cpan/Pod-Checker/t cpan/Pod-Escapes/t cpan/Pod-Perldoc/t cpan/Pod-Simple/t cpan/Pod-Usage/scripts cpan/Pod-Usage/t cpan/podlators/t ext/Pod-Functions/Functions.pm ext/Pod-Functions/t ext/Pod-Html/t lib/Pod/t) $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2man $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2text $(1)/usr/bin/ @@ -1188,7 +1187,6 @@ endef define Package/perlbase-scalar/install $(call perlmod/Install,$(1),Scalar Sub,) $(call perlmod/InstallBaseTests,$(1),cpan/Scalar-List-Utils/t) - $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Scalar-List-Utils/blib endef $(eval $(call BuildPackage,perlbase-scalar)) @@ -1368,7 +1366,7 @@ DEPENDS+=+perlbase-base +perlbase-config +perlbase-essential +perlbase-io +perlb endef define Package/perlbase-test/install -$(call perlmod/Install,$(1),Test Test.pm ok.pm,Test/Builder.pm Test/Harness/TAP.pod Test/More.pm Test/Tutorial.pod) +$(call perlmod/Install,$(1),Test Test2 Test.pm Test2.pm ok.pm,Test/Builder.pm Test/More.pm Test/Tutorial.pod Test2/Transition.pod) $(call perlmod/Install/NoStrip,$(1),Test/Builder.pm Test/More.pm,) $(call perlmod/InstallBaseTests,$(1),cpan/Test-Harness/t cpan/Test-Simple/t dist/Test/t) $(INSTALL_DIR) $(1)/usr/bin diff --git a/lang/perl/perlver.mk b/lang/perl/perlver.mk index 465140bf1..b0acc5d9e 100644 --- a/lang/perl/perlver.mk +++ b/lang/perl/perlver.mk @@ -1,4 +1,4 @@ -PERL_VERSION:=5.38.0 +PERL_VERSION:=5.38.2 PERL_EXPLODE:=$(subst ., ,$(PERL_VERSION)) diff --git a/lang/python/python-idna/Makefile b/lang/python/python-idna/Makefile index ee8738a61..33129b03a 100644 --- a/lang/python/python-idna/Makefile +++ b/lang/python/python-idna/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-idna -PKG_VERSION:=3.4 +PKG_VERSION:=3.6 PKG_RELEASE:=1 PYPI_NAME:=idna -PKG_HASH:=814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 +PKG_HASH:=9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca PKG_LICENSE:=BSD-3-Clause -PKG_LICENSE_FILES:=LICENSE.rst +PKG_LICENSE_FILES:=LICENSE.md PKG_MAINTAINER:=Jeffery To PKG_BUILD_DEPENDS:=python-flit-core/host @@ -30,9 +30,7 @@ define Package/python3-idna SUBMENU:=Python TITLE:=IDNA library URL:=https://github.com/kjd/idna - DEPENDS:= \ - +python3-light \ - +python3-codecs + DEPENDS:=+python3-light +python3-codecs endef define Package/python3-idna/description diff --git a/lang/python/python-idna/test.sh b/lang/python/python-idna/test.sh new file mode 100644 index 000000000..85f779c23 --- /dev/null +++ b/lang/python/python-idna/test.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +[ "$1" = python3-idna ] || exit 0 + +python3 - << 'EOF' + +import idna +import idna.codec + +assert idna.encode('ドメイン.テスト') == b'xn--eckwd4c7c.xn--zckzah' +assert idna.decode('xn--eckwd4c7c.xn--zckzah') == 'ドメイン.テスト' + +assert 'домен.испытание'.encode('idna2008') == b'xn--d1acufc.xn--80akhbyknj4f' +assert b'xn--d1acufc.xn--80akhbyknj4f'.decode('idna2008') == 'домен.испытание' + +assert idna.alabel('测试') == b'xn--0zwm56d' + +assert idna.encode('Königsgäßchen', uts46=True) == b'xn--knigsgchen-b4a3dun' +assert idna.decode('xn--knigsgchen-b4a3dun') == 'königsgäßchen' + +assert idna.encode('Königsgäßchen', uts46=True, transitional=True) == b'xn--knigsgsschen-lcb0w' + +EOF diff --git a/lang/python/python-jsonschema-specifications/Makefile b/lang/python/python-jsonschema-specifications/Makefile new file mode 100644 index 000000000..88cc0ba32 --- /dev/null +++ b/lang/python/python-jsonschema-specifications/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jsonschema-specifications +PKG_VERSION:=2023.7.1 +PKG_RELEASE:=1 + +PYPI_NAME:=jsonschema-specifications +PYPI_SOURCE_NAME:=jsonschema_specifications +PKG_HASH:=c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jsonschema-specifications + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=JSON Schema meta-schemas and vocabularies + URL:=https://github.com/python-jsonschema/jsonschema-specifications + DEPENDS:=+python3-light +python3-referencing +endef + +define Package/python3-jsonschema-specifications/description +JSON support files from the JSON Schema Specifications (metaschemas, +vocabularies, etc.), packaged for runtime access from Python as a +referencing-based Schema Registry. +endef + +$(eval $(call Py3Package,python3-jsonschema-specifications)) +$(eval $(call BuildPackage,python3-jsonschema-specifications)) +$(eval $(call BuildPackage,python3-jsonschema-specifications-src)) diff --git a/lang/python/python-jsonschema-specifications/test.sh b/lang/python/python-jsonschema-specifications/test.sh new file mode 100644 index 000000000..cdf2f5710 --- /dev/null +++ b/lang/python/python-jsonschema-specifications/test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +[ "$1" = python3-jsonschema-specifications ] || exit 0 + +python3 - << 'EOF' + +from jsonschema_specifications import REGISTRY as SPECIFICATIONS + +DRAFT202012_DIALECT_URI = "https://json-schema.org/draft/2020-12/schema" +assert SPECIFICATIONS.contents(DRAFT202012_DIALECT_URI) != "" + +EOF diff --git a/lang/python/python-jsonschema/Makefile b/lang/python/python-jsonschema/Makefile index 4c6e44d46..4e3b9c7e4 100644 --- a/lang/python/python-jsonschema/Makefile +++ b/lang/python/python-jsonschema/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-jsonschema -PKG_VERSION:=4.17.3 -PKG_RELEASE:=3 +PKG_VERSION:=4.19.1 +PKG_RELEASE:=1 PYPI_NAME:=jsonschema -PKG_HASH:=0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d +PKG_HASH:=ec84cc37cfa703ef7cd4928db24f9cb31428a5d0fa77747b8b51a847458e0bbf PKG_MAINTAINER:=Javier Marcet PKG_LICENSE:=MIT @@ -22,9 +22,16 @@ define Package/python3-jsonschema CATEGORY:=Languages SUBMENU:=Python TITLE:=An implementation of JSON Schema validation - URL:=https://github.com/Julian/jsonschema - DEPENDS:=+python3-light +python3-attrs +python3-urllib \ - +python3-six +python3-pyrsistent +python3-setuptools + URL:=https://github.com/python-jsonschema/jsonschema + DEPENDS:= \ + +python3-light \ + +python3-decimal \ + +python3-urllib \ + +python3-uuid \ + +python3-attrs \ + +python3-jsonschema-specifications \ + +python3-referencing \ + +python3-rpds-py endef define Package/python3-jsonschema/description diff --git a/lang/python/python-jsonschema/test.sh b/lang/python/python-jsonschema/test.sh new file mode 100644 index 000000000..37fe4925a --- /dev/null +++ b/lang/python/python-jsonschema/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +[ "$1" = python3-jsonschema ] || exit 0 + +python3 - << 'EOF' + +from jsonschema import validate + +# A sample schema, like what we'd get from json.load() +schema = { + "type" : "object", + "properties" : { + "price" : {"type" : "number"}, + "name" : {"type" : "string"}, + }, +} + +# If no exception is raised by validate(), the instance is valid. +validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema) + +EOF diff --git a/lang/python/python-pyasn1/Makefile b/lang/python/python-pyasn1/Makefile index 998a06a57..b44ea2a42 100644 --- a/lang/python/python-pyasn1/Makefile +++ b/lang/python/python-pyasn1/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-pyasn1 -PKG_VERSION:=0.5.0 +PKG_VERSION:=0.5.1 PKG_RELEASE:=1 PYPI_NAME:=pyasn1 -PKG_HASH:=97b7290ca68e62a832558ec3976f15cbf911bf5d7c7039d8b861c2a0ece69fde +PKG_HASH:=6d391a96e59b23130a5cfa74d6fd7f388dbbe26cc8f1edf39fdddf08d9d6676c PKG_LICENSE:=BSD-2-Clause PKG_LICENSE_FILES:=LICENSE.rst diff --git a/lang/python/python-pyasn1/test.sh b/lang/python/python-pyasn1/test.sh new file mode 100644 index 000000000..2f13e5fc8 --- /dev/null +++ b/lang/python/python-pyasn1/test.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +[ "$1" = python3-pyasn1 ] || exit 0 + +python3 - << 'EOF' + +from collections import OrderedDict + +from pyasn1.type import namedtype +from pyasn1.type import tag +from pyasn1.type import univ +from pyasn1.codec.der.encoder import encode as derEncode +from pyasn1.codec.der.decoder import decode as derDecode +from pyasn1.codec.native.encoder import encode as nativeEncode +from pyasn1.codec.native.decoder import decode as nativeDecode + +class Record(univ.Sequence): + componentType = namedtype.NamedTypes( + namedtype.NamedType('id', univ.Integer()), + namedtype.OptionalNamedType( + 'room', univ.Integer().subtype( + implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0) + ) + ), + namedtype.DefaultedNamedType( + 'house', univ.Integer(0).subtype( + implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1) + ) + ) + ) + +# encoding modifies the object (https://github.com/pyasn1/pyasn1/issues/53) +# so test decoding before encoding + +record = Record() +record['id'] = 123 +record['room'] = 321 +assert str(record) == 'Record:\n id=123\n room=321\n' + +substrate = b'0\x07\x02\x01{\x80\x02\x01A' + +received_record, _ = derDecode(substrate, asn1Spec=Record()) +assert received_record == record + +dict_record = nativeDecode({'id': 123, 'room': 321}, asn1Spec=Record()) +assert dict_record == record + +assert derEncode(record) == substrate +assert nativeEncode(record) == OrderedDict([('id', 123), ('room', 321), ('house', 0)]) + +EOF diff --git a/lang/python/python-referencing/Makefile b/lang/python/python-referencing/Makefile new file mode 100644 index 000000000..05f184a55 --- /dev/null +++ b/lang/python/python-referencing/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-referencing +PKG_VERSION:=0.30.2 +PKG_RELEASE:=1 + +PYPI_NAME:=referencing +PKG_HASH:=794ad8003c65938edcdbc027f1933215e0d0ccc0291e3ce20a4d87432b59efc0 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-referencing + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=JSON Referencing + Python + URL:=https://github.com/python-jsonschema/referencing + DEPENDS:= \ + +python3-light \ + +python3-email \ + +python3-urllib \ + +python3-attrs \ + +python3-rpds-py +endef + +define Package/python3-referencing/description +An implementation-agnostic implementation of JSON reference resolution. +endef + +$(eval $(call Py3Package,python3-referencing)) +$(eval $(call BuildPackage,python3-referencing)) +$(eval $(call BuildPackage,python3-referencing-src)) diff --git a/lang/python/python-referencing/test.sh b/lang/python/python-referencing/test.sh new file mode 100644 index 000000000..0517ba168 --- /dev/null +++ b/lang/python/python-referencing/test.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +[ "$1" = python3-referencing ] || exit 0 + +python3 - << 'EOF' + +from referencing import Registry, Resource +import referencing.jsonschema + +schema = Resource.from_contents( # Parse some contents into a 2020-12 JSON Schema + { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:example:a-202012-schema", + "$defs": { + "nonNegativeInteger": { + "$anchor": "nonNegativeInteger", + "type": "integer", + "minimum": 0, + }, + }, + } +) +registry = schema @ Registry() # Add the resource to a new registry + +# From here forward, this would usually be done within a library wrapping this one, +# like a JSON Schema implementation +resolver = registry.resolver() +resolved = resolver.lookup("urn:example:a-202012-schema#nonNegativeInteger") +assert resolved.contents == { + "$anchor": "nonNegativeInteger", + "type": "integer", + "minimum": 0, +} + +EOF diff --git a/lang/python/python-rpds-py/Makefile b/lang/python/python-rpds-py/Makefile new file mode 100644 index 000000000..c2aef8452 --- /dev/null +++ b/lang/python/python-rpds-py/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-rpds-py +PKG_VERSION:=0.10.6 +PKG_RELEASE:=1 + +PYPI_NAME:=rpds-py +PYPI_SOURCE_NAME:=rpds_py +PKG_HASH:=4ce5a708d65a8dbf3748d2474b580d606b1b9f91b5c6ab2a316e0b0cf7a4ba50 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-maturin/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-rpds-py + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Bindings to Rust's persistent data structures + URL:=https://github.com/crate-py/rpds + DEPENDS:=+python3-light $(RUST_ARCH_DEPENDS) +endef + +define Package/python3-rpds-py/description +Python bindings to the Rust rpds crate for persistent data structures. +endef + +$(eval $(call Py3Package,python3-rpds-py)) +$(eval $(call BuildPackage,python3-rpds-py)) +$(eval $(call BuildPackage,python3-rpds-py-src)) diff --git a/lang/python/python-rpds-py/test.sh b/lang/python/python-rpds-py/test.sh new file mode 100644 index 000000000..d5dec8f5f --- /dev/null +++ b/lang/python/python-rpds-py/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +[ "$1" = python3-rpds-py ] || exit 0 + +python3 - << 'EOF' + +from rpds import HashTrieMap, HashTrieSet, List + +m = HashTrieMap({"foo": "bar", "baz": "quux"}) +assert m.insert("spam", 37) == HashTrieMap({"foo": "bar", "baz": "quux", "spam": 37}) +assert m.remove("foo") == HashTrieMap({"baz": "quux"}) + +s = HashTrieSet({"foo", "bar", "baz", "quux"}) +assert s.insert("spam") == HashTrieSet({"foo", "bar", "baz", "quux", "spam"}) +assert s.remove("foo") == HashTrieSet({"bar", "baz", "quux"}) + +L = List([1, 3, 5]) +assert L.push_front(-1) == List([-1, 1, 3, 5]) +assert L.rest == List([3, 5]) + +EOF diff --git a/lang/python/python-setuptools/Makefile b/lang/python/python-setuptools/Makefile index 8138a9955..b2ebfa1c6 100644 --- a/lang/python/python-setuptools/Makefile +++ b/lang/python/python-setuptools/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-setuptools -PKG_VERSION:=68.2.2 +PKG_VERSION:=69.0.2 PKG_RELEASE:=1 PYPI_NAME:=setuptools -PKG_HASH:=4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87 +PKG_HASH:=735896e78a4742605974de002ac60562d286fa8051a7e2299445e8e8fbb01aa6 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/lang/python/python-wheel/Makefile b/lang/python/python-wheel/Makefile index 76a1b44bb..28f549b55 100644 --- a/lang/python/python-wheel/Makefile +++ b/lang/python/python-wheel/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-wheel -PKG_VERSION:=0.41.3 +PKG_VERSION:=0.42.0 PKG_RELEASE:=1 PYPI_NAME:=wheel -PKG_HASH:=4d4987ce51a49370ea65c0bfd2234e8ce80a12780820d9dc462597a6e60d0841 +PKG_HASH:=c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE.txt diff --git a/libs/libsocketcan/Makefile b/libs/libsocketcan/Makefile new file mode 100644 index 000000000..67ba3a9cf --- /dev/null +++ b/libs/libsocketcan/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libsocketcan +PKG_VERSION:=0.0.12 +PKG_RELEASE=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://www.pengutronix.de/software/libsocketcan/download/ +PKG_HASH:=be8280124707701935e6294d366e2474158b758fa4b2e3cae571d5b256d2fe34 + +PKG_MAINTAINER:=Yegor Yefremov +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=LICENSE + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libsocketcan + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Library to control SocketCAN interfaces + URL:=https://git.pengutronix.de/cgit/tools/libsocketcan +endef + +define Package/libsocketcan/description + This userspace library allows one to do common configure/control tasks +on a SocketCAN interface. +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/can_netlink.h $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libsocketcan.h $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsocketcan.{a,so*} $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsocketcan.pc $(1)/usr/lib/pkgconfig +endef + +define Package/libsocketcan/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsocketcan.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libsocketcan)) diff --git a/libs/nghttp3/Makefile b/libs/nghttp3/Makefile index 9505f2e0d..6573977fb 100644 --- a/libs/nghttp3/Makefile +++ b/libs/nghttp3/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nghttp3 -PKG_VERSION:=1.0.0 +PKG_VERSION:=1.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/ngtcp2/nghttp3/releases/download/v$(PKG_VERSION)/ -PKG_HASH:=2e5b5a39415b9a0d160bbcb90b37bef7d8aee44ae504e8c0ddcb31aa92435988 +PKG_SOURCE_URL:=https://codeload.github.com/ngtcp2/nghttp3/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=b3ffb23a90442a0eafe8bfbefbc8b4ffb5179d68a7c0b8a416a34cf04b28d7c5 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING @@ -25,7 +25,7 @@ define Package/libnghttp3 endef define Package/libnghttp3/description - nghttp3 is a thin HTTP/3 layer over an underlying QUIC stack. +nghttp3 is a thin HTTP/3 layer over an underlying QUIC stack. endef CMAKE_OPTIONS += -DENABLE_LIB_ONLY=ON diff --git a/libs/ngtcp2/Makefile b/libs/ngtcp2/Makefile index 3db59361d..dc5d04db5 100644 --- a/libs/ngtcp2/Makefile +++ b/libs/ngtcp2/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ngtcp2 -PKG_VERSION:=1.0.1 +PKG_VERSION:=1.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/ngtcp2/ngtcp2/releases/download/v$(PKG_VERSION)/ -PKG_HASH:=df03e7e91110fcbb165ae048fa671f1dd39f77b841df3a14aef076a1c192cc27 +PKG_SOURCE_URL:=https://codeload.github.com/ngtcp2/ngtcp2/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=987d784643edea4f2859c405f7dfbc53871a9f7ae5fcddf5fb12ec5dfce1ef22 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING @@ -26,7 +26,8 @@ define Package/libngtcp2 endef define Package/libngtcp2/description - ngtcp2 project is an effort to implement QUIC protocol which is now being discussed in IETF QUICWG for its standardization. +ngtcp2 project is an effort to implement QUIC protocol which is now being +discussed in IETF QUICWG for its standardization. endef CMAKE_OPTIONS += -DENABLE_LIB_ONLY=ON diff --git a/libs/xmlrpc-c/Makefile b/libs/xmlrpc-c/Makefile index 49e43a3e3..0ea2071d5 100644 --- a/libs/xmlrpc-c/Makefile +++ b/libs/xmlrpc-c/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xmlrpc-c -PKG_VERSION:=1.51.07 +PKG_VERSION:=1.54.06 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/xmlrpc-c/Xmlrpc-c%20Super%20Stable/$(PKG_VERSION) -PKG_HASH:=84d20ae33f927582f821d61c0b9194aefbf1d7924590a13fa9da5ae1698aded9 +PKG_HASH:=ae6d0fb58f38f1536511360dc0081d3876c1f209d9eaa54357e2bacd690a5640 PKG_MAINTAINER:=Ted Hess PKG_LICENSE:=VARIOUS @@ -42,22 +42,15 @@ define Package/xmlrpc-c-internal $(call Package/xmlrpc-c/Default) TITLE+= (uses internal expat variant) DEPENDS:=+xmlrpc-c-common -# PROVIDES:=xmlrpc-c + PROVIDES:=xmlrpc-c VARIANT:=internal - HIDDEN:=1 -endef - -define Package/xmlrpc-c - $(call Package/xmlrpc-c/Default) - TITLE+= (uses internal expat variant) - DEPENDS:=+xmlrpc-c-internal endef define Package/xmlrpc-c-libxml2 $(call Package/xmlrpc-c/Default) TITLE+= (uses libxml2) - DEPENDS:=+xmlrpc-c-common +libxml2 @BROKEN -# PROVIDES:=xmlrpc-c + DEPENDS:=+xmlrpc-c-common +libxml2 + PROVIDES:=xmlrpc-c VARIANT:=libxml2 endef @@ -76,7 +69,7 @@ endef define Package/xmlrpc-c-abyss $(call Package/xmlrpc-c/Default) TITLE+= - abyss - DEPENDS:=+xmlrpc-c-common @BROKEN + DEPENDS:=+xmlrpc-c-common endef define Package/xmlrpc-c-server-abyss @@ -101,11 +94,10 @@ Package/xmlrpc-c-internal/description += Uses internal expat variant (stripped d CONFIGURE_ARGS+= \ --disable-wininet-client \ --disable-libwww-client \ - --disable-abyss-server \ --disable-cgi-server \ --disable-cplusplus \ - --disable-abyss-threads \ - --without-libwww-ssl + --without-libwww-ssl \ + --disable-abyss-openssl ifeq ($(BUILD_VARIANT),libxml2) CONFIGURE_ARGS += \ @@ -118,7 +110,7 @@ ifeq ($(BUILD_VARIANT),internal) endif define Build/Compile - ( cd $(PKG_BUILD_DIR)/lib/expat/gennmtab && cc -I$(PKG_BUILD_DIR) -c gennmtab.c -o gennmtab.o && cc -o gennmtab gennmtab.o ) + ( cd $(PKG_BUILD_DIR)/lib/expat/gennmtab && cc -I$(PKG_BUILD_DIR) -c gennmtab.c -o gennmtab.o && cc -o gennmtab gennmtab.o ) $(call Build/Compile/Default) endef @@ -208,15 +200,10 @@ define Package/xmlrpc-c-common/install $(1)/usr/lib/ endef -define Package/xmlrpc-c/install - true -endef - -$(eval $(call BuildPackage,xmlrpc-c)) $(eval $(call BuildPackage,xmlrpc-c-common)) -#$(eval $(call BuildPackage,xmlrpc-c-libxml2)) +$(eval $(call BuildPackage,xmlrpc-c-libxml2)) $(eval $(call BuildPackage,xmlrpc-c-internal)) $(eval $(call BuildPackage,xmlrpc-c-server)) -#$(eval $(call BuildPackage,xmlrpc-c-abyss)) -#$(eval $(call BuildPackage,xmlrpc-c-server-abyss)) +$(eval $(call BuildPackage,xmlrpc-c-abyss)) +$(eval $(call BuildPackage,xmlrpc-c-server-abyss)) $(eval $(call BuildPackage,xmlrpc-c-client)) diff --git a/libs/xmlrpc-c/patches/001-fix-format-parameter.patch b/libs/xmlrpc-c/patches/001-fix-format-parameter.patch new file mode 100644 index 000000000..2986a965a --- /dev/null +++ b/libs/xmlrpc-c/patches/001-fix-format-parameter.patch @@ -0,0 +1,11 @@ +--- a/src/xmlrpc_server_abyss.c ++++ b/src/xmlrpc_server_abyss.c +@@ -780,7 +780,7 @@ createServer(xmlrpc_env * + ServerInit2(abyssServerP, &error); + + if (error) { +- xmlrpc_faultf(envP, error); ++ xmlrpc_faultf(envP, "%s", error); + xmlrpc_strfree(error); + } + } diff --git a/libs/xmlrpc-c/patches/002-remove-unnecessary-linking.patch b/libs/xmlrpc-c/patches/002-remove-unnecessary-linking.patch new file mode 100644 index 000000000..0e21dcf71 --- /dev/null +++ b/libs/xmlrpc-c/patches/002-remove-unnecessary-linking.patch @@ -0,0 +1,37 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -183,7 +183,7 @@ $(LIBXMLRPC_SERVER): \ + $(call shliblefn, libxmlrpc) + $(LIBXMLRPC_SERVER): LIBOBJECTS = $(LIBXMLRPC_SERVER_MODS:%=%.osh) + $(LIBXMLRPC_SERVER): LIBDEP = \ +- -L. -lxmlrpc $(XML_PARSER_LIBDEP) $(LIBXMLRPC_UTIL_LIBDEP) ++ -L. -lxmlrpc $(LIBXMLRPC_UTIL_LIBDEP) + + LIBXMLRPC_SERVER_ABYSS = $(call shlibfn, libxmlrpc_server_abyss) + +@@ -197,7 +197,7 @@ $(LIBXMLRPC_SERVER_ABYSS): LIBOBJECTS = + $(LIBXMLRPC_SERVER_ABYSS): LIBDEP = \ + -L. -lxmlrpc_server \ + -L$(LIBXMLRPC_ABYSS_DIR) -lxmlrpc_abyss \ +- -L. -lxmlrpc $(XML_PARSER_LIBDEP) $(LIBXMLRPC_UTIL_LIBDEP) ++ -L. -lxmlrpc $(LIBXMLRPC_UTIL_LIBDEP) + ifeq ($(MSVCRT),yes) + $(LIBXMLRPC_SERVER_ABYSS): LIBDEP += -lws2_32 -lwsock32 + endif +@@ -212,7 +212,7 @@ $(LIBXMLRPC_SERVER_CGI): \ + $(LIBXMLRPC_SERVER_CGI): LIBOBJECTS = $(LIBXMLRPC_SERVER_CGI_MODS:%=%.osh) + $(LIBXMLRPC_SERVER_CGI): LIBDEP = \ + -L. -lxmlrpc_server \ +- -L. -lxmlrpc $(XML_PARSER_LIBDEP) $(LIBXMLRPC_UTIL_LIBDEP) ++ -L. -lxmlrpc $(LIBXMLRPC_UTIL_LIBDEP) + + LIBXMLRPC_CLIENT = $(call shlibfn, libxmlrpc_client) + +@@ -237,7 +237,6 @@ $(LIBXMLRPC_CLIENT): LIBOBJECTS = \ + LIBXMLRPC_CLIENT_LIBDEP = \ + -Lblddir/src -Lblddir/lib/libutil \ + -lxmlrpc -lxmlrpc_util \ +- $(XML_PARSER_LIBDEP) \ + $(TRANSPORT_LIBDEP) \ + + $(LIBXMLRPC_CLIENT): LIBDEP = \ diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 313713692..5fbecf125 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=postfix PKG_VERSION:=3.8.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:= \ @@ -172,7 +172,7 @@ ifdef CONFIG_POSTFIX_PGSQL endif ifdef CONFIG_POSTFIX_PCRE - CCARGS+=-DHAS_PCRE2 -I$(STAGING_DIR)/usr/include/ + CCARGS+=-DHAS_PCRE=2 -I$(STAGING_DIR)/usr/include/ AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpcre2-8 else CCARGS+=-DNO_PCRE diff --git a/net/aardvark-dns/Makefile b/net/aardvark-dns/Makefile index b7ea0e5d9..d556c4bac 100644 --- a/net/aardvark-dns/Makefile +++ b/net/aardvark-dns/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=aardvark-dns -PKG_VERSION:=1.8.0 +PKG_VERSION:=1.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/containers/aardvark-dns/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=c9b818110e3d5d45f8bdb3c9ccc48c994aedb0b19fefcc7577fc1ef7ed294343 +PKG_HASH:=d6b51743d334c42ec98ff229be044b5b2a5fedf8da45a005447809c4c1e9beea PKG_MAINTAINER:=Oskari Rauta PKG_LICENSE:=Apache-2.0 diff --git a/net/fail2ban/Makefile b/net/fail2ban/Makefile index 77568e908..fba0a11df 100644 --- a/net/fail2ban/Makefile +++ b/net/fail2ban/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fail2ban PKG_VERSION:=0.11.2 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/fail2ban/fail2ban/tar.gz/$(PKG_VERSION)? diff --git a/net/fail2ban/patches/101-move-global-groups-to-start-of-expression-python-3.11-compat.patch b/net/fail2ban/patches/101-move-global-groups-to-start-of-expression-python-3.11-compat.patch new file mode 100644 index 000000000..bd50c17bb --- /dev/null +++ b/net/fail2ban/patches/101-move-global-groups-to-start-of-expression-python-3.11-compat.patch @@ -0,0 +1,44 @@ +From 7e2ab36d86998575853150c0a57de5e22518cf66 Mon Sep 17 00:00:00 2001 +From: sebres +Date: Tue, 21 Jun 2022 16:55:57 +0200 +Subject: [PATCH] move global groups to start of expression (python 3.11 + compat) + +[remove change to regex not in 0.11.2] +Signed-off-by: Jeffery To +--- + fail2ban/client/fail2banregex.py | 2 +- + fail2ban/server/datetemplate.py | 8 ++++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/fail2ban/server/datetemplate.py ++++ b/fail2ban/server/datetemplate.py +@@ -35,6 +35,7 @@ logSys = getLogger(__name__) + # check already grouped contains "(", but ignores char "\(" and conditional "(?(id)...)": + RE_GROUPED = re.compile(r'(? +Date: Tue, 21 Jun 2022 16:56:57 +0200 +Subject: [PATCH] wrap global flags like ((?i)xxx) or (?:(?i)xxx) to local + flags (?i:xxx) if supported by RE-engine in the python version + +--- + fail2ban/server/failregex.py | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/fail2ban/server/failregex.py ++++ b/fail2ban/server/failregex.py +@@ -91,6 +91,13 @@ R_MAP = { + "port": "fport", + } + ++# map global flags like ((?i)xxx) or (?:(?i)xxx) to local flags (?i:xxx) if supported by RE-engine in this python version: ++try: ++ re.search("^re(?i:val)$", "reVAL") ++ R_GLOB2LOCFLAGS = ( re.compile(r"(?/dev/null 2>&1; then : ++as_nop=: ++if test ${ZSH_VERSION+y} && (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 ++else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( +@@ -32,46 +35,46 @@ esac + fi + + ++ ++# Reset variables that may have inherited troublesome values from ++# the environment. ++ ++# IFS needs to be set, to space, tab, and newline, in precisely that order. ++# (If _AS_PATH_WALK were called with IFS unset, it would have the ++# side effect of setting IFS to empty, thus disabling word splitting.) ++# Quoting is to prevent editors from complaining about space-tab. + 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 ++IFS=" "" $as_nl" ++ ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# Ensure predictable behavior from utilities with locale-dependent output. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# We cannot yet rely on "unset" to work, but we need these variables ++# to be unset--not just set to an empty or harmless value--now, to ++# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct ++# also avoids known problems related to "unset" and subshell syntax ++# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). ++for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH ++do eval test \${$as_var+y} \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : ++done ++ ++# Ensure that fds 0, 1, and 2 are open. ++if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi ++if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + + # The user is always right. +-if test "${PATH_SEPARATOR+set}" != set; then ++if ${PATH_SEPARATOR+false} :; 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 || +@@ -80,13 +83,6 @@ if test "${PATH_SEPARATOR+set}" != set; + 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. + as_myself= + case $0 in #(( +@@ -95,8 +91,12 @@ case $0 in #(( + 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 ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done + IFS=$as_save_IFS + +@@ -108,30 +108,10 @@ 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 ++ printf "%s\n" "$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 + + # Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. +@@ -153,20 +133,22 @@ esac + exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} + # Admittedly, this is quite paranoid, since all the known shells bail + # out after a failed `exec'. +-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +-as_fn_exit 255 ++printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 ++exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} + if test "x$CONFIG_SHELL" = x; then +- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : ++ as_bourne_compatible="as_nop=: ++if test \${ZSH_VERSION+y} && (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 ++else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( +@@ -186,41 +168,52 @@ as_fn_success || { exitcode=1; echo as_f + 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 : ++if ( set x; as_fn_ret_success y && test x = \"\$1\" ) ++then : + +-else ++else \$as_nop + exitcode=1; echo positional parameters were not saved. + fi + test x\$exitcode = x0 || exit 1 ++blah=\$(echo \$(echo blah)) ++test x\"\$blah\" = xblah || exit 1 + test -x / || 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" +- if (eval "$as_required") 2>/dev/null; then : ++ if (eval "$as_required") 2>/dev/null ++then : + as_have_required=yes +-else ++else $as_nop + as_have_required=no + fi +- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : ++ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null ++then : + +-else ++else $as_nop + 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=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + 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 ++ 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 : ++ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 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 : ++ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null ++then : + break 2 + fi + fi +@@ -228,14 +221,21 @@ fi + 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 $as_found ++then : ++ ++else $as_nop ++ if { test -f "$SHELL" || test -f "$SHELL.exe"; } && ++ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null ++then : ++ CONFIG_SHELL=$SHELL as_have_required=yes ++fi ++fi + + +- if test "x$CONFIG_SHELL" != x; then : ++ if test "x$CONFIG_SHELL" != x ++then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also +@@ -253,18 +253,19 @@ esac + exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} + # Admittedly, this is quite paranoid, since all the known shells bail + # out after a failed `exec'. +-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 ++printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 + exit 255 + 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." ++ if test x$as_have_required = xno ++then : ++ printf "%s\n" "$0: This script requires a shell more modern than all" ++ printf "%s\n" "$0: the shells that I found on your system." ++ if test ${ZSH_VERSION+y} ; then ++ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" ++ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else +- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, ++ printf "%s\n" "$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." +@@ -291,6 +292,7 @@ as_fn_unset () + } + as_unset=as_fn_unset + ++ + # as_fn_set_status STATUS + # ----------------------- + # Set $? to STATUS, without forking. +@@ -308,6 +310,14 @@ as_fn_exit () + as_fn_set_status $1 + exit $1 + } # as_fn_exit ++# as_fn_nop ++# --------- ++# Do nothing but, unlike ":", preserve the value of $?. ++as_fn_nop () ++{ ++ return $? ++} ++as_nop=as_fn_nop + + # as_fn_mkdir_p + # ------------- +@@ -322,7 +332,7 @@ as_fn_mkdir_p () + as_dirs= + while :; do + case $as_dir in #( +- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" +@@ -331,7 +341,7 @@ $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" | ++printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -370,12 +380,13 @@ as_fn_executable_p () + # 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 : ++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 ++else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 +@@ -387,18 +398,27 @@ fi # as_fn_append + # 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 : ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null ++then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +-else ++else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } + fi # as_fn_arith + ++# as_fn_nop ++# --------- ++# Do nothing but, unlike ":", preserve the value of $?. ++as_fn_nop () ++{ ++ return $? ++} ++as_nop=as_fn_nop + + # as_fn_error STATUS ERROR [LINENO LOG_FD] + # ---------------------------------------- +@@ -410,9 +430,9 @@ as_fn_error () + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi +- $as_echo "$as_me: error: $2" >&2 ++ printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status + } # as_fn_error + +@@ -439,7 +459,7 @@ as_me=`$as_basename -- "$0" || + $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X/"$0" | ++printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q +@@ -483,7 +503,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits + 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; } ++ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall +@@ -497,6 +517,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits + exit + } + ++ ++# Determine whether it's possible to make 'echo' print without a newline. ++# These variables are no longer used directly by Autoconf, but are AC_SUBSTed ++# for compatibility with existing Makefiles. + ECHO_C= ECHO_N= ECHO_T= + case `echo -n x` in #((((( + -n*) +@@ -510,6 +534,13 @@ case `echo -n x` in #((((( + ECHO_N='-n';; + esac + ++# For backward compatibility with old third-party macros, we provide ++# the shell variables $as_echo and $as_echo_n. New code should use ++# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. ++as_echo='printf %s\n' ++as_echo_n='printf %s' ++ ++ + rm -f conf$$ conf$$.exe conf$$.file + if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +@@ -575,19 +606,19 @@ MFLAGS= + MAKEFLAGS= + + # Identity of this package. +-PACKAGE_NAME= +-PACKAGE_TARNAME= +-PACKAGE_VERSION= +-PACKAGE_STRING= +-PACKAGE_BUGREPORT= +-PACKAGE_URL= ++PACKAGE_NAME='' ++PACKAGE_TARNAME='' ++PACKAGE_VERSION='' ++PACKAGE_STRING='' ++PACKAGE_BUGREPORT='' ++PACKAGE_URL='' + + ac_unique_file="rlm_krb5.c" + ac_subst_vars='LTLIBOBJS + LIBOBJS +-targetname + mod_cflags + mod_ldflags ++targetname + krb5_config + CPP + OBJEXT +@@ -616,6 +647,7 @@ infodir + docdir + oldincludedir + includedir ++runstatedir + localstatedir + sharedstatedir + sysconfdir +@@ -688,6 +720,7 @@ datadir='${datarootdir}' + sysconfdir='${prefix}/etc' + sharedstatedir='${prefix}/com' + localstatedir='${prefix}/var' ++runstatedir='${localstatedir}/run' + includedir='${prefix}/include' + oldincludedir='/usr/include' + docdir='${datarootdir}/doc/${PACKAGE}' +@@ -717,8 +750,6 @@ do + *) ac_optarg=yes ;; + esac + +- # Accept the important Cygnus configure options, so we can diagnose typos. +- + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; +@@ -759,9 +790,9 @@ do + 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" ++ as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "enable_$ac_useropt" +@@ -785,9 +816,9 @@ do + 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" ++ as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "enable_$ac_useropt" +@@ -940,6 +971,15 @@ do + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + ++ -runstatedir | --runstatedir | --runstatedi | --runstated \ ++ | --runstate | --runstat | --runsta | --runst | --runs \ ++ | --run | --ru | --r) ++ ac_prev=runstatedir ;; ++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ ++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ ++ | --run=* | --ru=* | --r=*) ++ runstatedir=$ac_optarg ;; ++ + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ +@@ -989,9 +1029,9 @@ do + 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" ++ as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "with_$ac_useropt" +@@ -1005,9 +1045,9 @@ do + 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" ++ as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "with_$ac_useropt" +@@ -1051,9 +1091,9 @@ Try \`$0 --help' for more information" + + *) + # FIXME: should be removed in autoconf 3.0. +- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 ++ printf "%s\n" "$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 ++ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + +@@ -1069,7 +1109,7 @@ 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 ;; ++ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac + fi + +@@ -1077,7 +1117,7 @@ fi + 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 ++ libdir localedir mandir runstatedir + do + eval ac_val=\$$ac_var + # Remove trailing slashes. +@@ -1133,7 +1173,7 @@ $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" | ++printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -1230,6 +1270,7 @@ Fine tuning of the installation director + --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] ++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] +@@ -1256,8 +1297,8 @@ if test -n "$ac_init_help"; then + Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +- --with-rlm_krb5 build rlm_krb5. (default=yes) +- --with-rlm-krb5-dir=DIR Directory for krb5 files ++ --without-rlm_krb5 build without Kerberos support ++ --with-rlm-krb5-dir=DIR directory where krb5 files are installed + + Some influential environment variables: + CC C compiler command +@@ -1288,9 +1329,9 @@ if test "$ac_init_help" = "recursive"; t + case "$ac_dir" in + .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) +- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` ++ ac_dir_suffix=/`printf "%s\n" "$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|/||'` ++ ac_top_builddir_sub=`printf "%s\n" "$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/ ;; +@@ -1318,7 +1359,8 @@ esac + ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } +- # Check for guested configure. ++ # Check for configure.gnu first; this name is used for a wrapper for ++ # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive +@@ -1326,7 +1368,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_ + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else +- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 ++ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +@@ -1336,9 +1378,9 @@ test -n "$ac_init_help" && exit $ac_stat + if $ac_init_version; then + cat <<\_ACEOF + configure +-generated by GNU Autoconf 2.69 ++generated by GNU Autoconf 2.71 + +-Copyright (C) 2012 Free Software Foundation, Inc. ++Copyright (C) 2021 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -1349,20 +1391,25 @@ fi + ## Autoconf initialization. ## + ## ------------------------ ## + ++echo ++echo Running tests for rlm_krb5 ++echo ++ ++ + # 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 ++ rm -f conftest.$ac_objext conftest.beam + 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 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +@@ -1370,14 +1417,15 @@ $as_echo "$ac_try_echo"; } >&5 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$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 : ++ } && test -s conftest.$ac_objext ++then : + ac_retval=0 +-else +- $as_echo "$as_me: failed program was:" >&5 ++else $as_nop ++ printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +@@ -1399,7 +1447,7 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +@@ -1407,14 +1455,15 @@ $as_echo "$ac_try_echo"; } >&5 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err +- }; then : ++ } ++then : + ac_retval=0 +-else +- $as_echo "$as_me: failed program was:" >&5 ++else $as_nop ++ printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +@@ -1430,14 +1479,14 @@ fi + 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 ++ rm -f conftest.$ac_objext conftest.beam 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 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +@@ -1445,17 +1494,18 @@ $as_echo "$ac_try_echo"; } >&5 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$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 || + test -x conftest$ac_exeext +- }; then : ++ } ++then : + ac_retval=0 +-else +- $as_echo "$as_me: failed program was:" >&5 ++else $as_nop ++ printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +@@ -1476,11 +1526,12 @@ fi + 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 eval \${$3+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++printf %s "checking for $2... " >&6; } ++if eval test \${$3+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + /* Define $2 to an innocuous variant, in case declares $2. +@@ -1488,16 +1539,9 @@ else + #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 ++ which can conflict with char $2 (); below. */ + ++#include + #undef $2 + + /* Override any GCC internal prototype to avoid an error. +@@ -1515,32 +1559,33 @@ choke me + #endif + + int +-main () ++main (void) + { + return $2 (); + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + eval "$3=yes" +-else ++else $as_nop + eval "$3=no" + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + 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; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + + } # ac_fn_c_check_func + + # ac_fn_c_try_run LINENO + # ---------------------- +-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +-# that executables *can* be run. ++# Try to run 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 +@@ -1550,25 +1595,26 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$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 ++printf "%s\n" "$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 : ++ printf "%s\n" "$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 ++else $as_nop ++ printf "%s\n" "$as_me: program exited with status $ac_status" >&5 ++ printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +@@ -1578,14 +1624,34 @@ fi + as_fn_set_status $ac_retval + + } # ac_fn_c_try_run ++ac_configure_args_raw= ++for ac_arg ++do ++ case $ac_arg in ++ *\'*) ++ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ esac ++ as_fn_append ac_configure_args_raw " '$ac_arg'" ++done ++ ++case $ac_configure_args_raw in ++ *$as_nl*) ++ ac_safe_unquote= ;; ++ *) ++ ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ++ ac_unsafe_a="$ac_unsafe_z#~" ++ ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ++ ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; ++esac ++ + 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 $as_me, which was +-generated by GNU Autoconf 2.69. Invocation command line was ++generated by GNU Autoconf 2.71. Invocation command line was + +- $ $0 $@ ++ $ $0$ac_configure_args_raw + + _ACEOF + exec 5>>config.log +@@ -1618,8 +1684,12 @@ 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" ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ printf "%s\n" "PATH: $as_dir" + done + IFS=$as_save_IFS + +@@ -1654,7 +1724,7 @@ do + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) +- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; +@@ -1689,11 +1759,13 @@ done + # 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=$? ++ # Sanitize IFS. ++ IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + +- $as_echo "## ---------------- ## ++ printf "%s\n" "## ---------------- ## + ## Cache variables. ## + ## ---------------- ##" + echo +@@ -1704,8 +1776,8 @@ trap 'exit_status=$? + 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;} ;; ++ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 ++printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( +@@ -1729,7 +1801,7 @@ $as_echo "$as_me: WARNING: cache variabl + ) + echo + +- $as_echo "## ----------------- ## ++ printf "%s\n" "## ----------------- ## + ## Output variables. ## + ## ----------------- ##" + echo +@@ -1737,14 +1809,14 @@ $as_echo "$as_me: WARNING: cache variabl + do + eval ac_val=\$$ac_var + case $ac_val in +- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac +- $as_echo "$ac_var='\''$ac_val'\''" ++ printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then +- $as_echo "## ------------------- ## ++ printf "%s\n" "## ------------------- ## + ## File substitutions. ## + ## ------------------- ##" + echo +@@ -1752,15 +1824,15 @@ $as_echo "$as_me: WARNING: cache variabl + do + eval ac_val=\$$ac_var + case $ac_val in +- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac +- $as_echo "$ac_var='\''$ac_val'\''" ++ printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then +- $as_echo "## ----------- ## ++ printf "%s\n" "## ----------- ## + ## confdefs.h. ## + ## ----------- ##" + echo +@@ -1768,8 +1840,8 @@ $as_echo "$as_me: WARNING: cache variabl + echo + fi + test "$ac_signal" != 0 && +- $as_echo "$as_me: caught signal $ac_signal" +- $as_echo "$as_me: exit $exit_status" ++ printf "%s\n" "$as_me: caught signal $ac_signal" ++ printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && +@@ -1783,63 +1855,48 @@ 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 ++printf "%s\n" "/* confdefs.h */" > confdefs.h + + # Predefined preprocessor variables. + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_NAME "$PACKAGE_NAME" +-_ACEOF ++printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +-_ACEOF ++printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_VERSION "$PACKAGE_VERSION" +-_ACEOF ++printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_STRING "$PACKAGE_STRING" +-_ACEOF ++printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +-_ACEOF ++printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_URL "$PACKAGE_URL" +-_ACEOF ++printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + + # 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 +- # We do not want a PATH search for config.site. +- case $CONFIG_SITE in #(( +- -*) ac_site_file1=./$CONFIG_SITE;; +- */*) ac_site_file1=$CONFIG_SITE;; +- *) ac_site_file1=./$CONFIG_SITE;; +- esac ++ ac_site_files="$CONFIG_SITE" + elif test "x$prefix" != xNONE; then +- ac_site_file1=$prefix/share/config.site +- ac_site_file2=$prefix/etc/config.site ++ ac_site_files="$prefix/share/config.site $prefix/etc/config.site" + else +- ac_site_file1=$ac_default_prefix/share/config.site +- ac_site_file2=$ac_default_prefix/etc/config.site ++ ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +-for ac_site_file in "$ac_site_file1" "$ac_site_file2" ++ ++for ac_site_file in $ac_site_files + do +- test "x$ac_site_file" = xNONE && continue +- if test /dev/null != "$ac_site_file" && 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;} ++ case $ac_site_file in #( ++ */*) : ++ ;; #( ++ *) : ++ ac_site_file=./$ac_site_file ;; ++esac ++ if test -f "$ac_site_file" && test -r "$ac_site_file"; then ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 ++printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ +- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "failed to load site script $ac_site_file + See \`config.log' for more details" "$LINENO" 5; } + fi +@@ -1849,19 +1906,327 @@ if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && 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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 ++printf "%s\n" "$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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 ++printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file + fi + ++# Test code for whether the C compiler supports C89 (global declarations) ++ac_c_conftest_c89_globals=' ++/* Does the compiler advertise C89 conformance? ++ Do not test the value of __STDC__, because some compilers set it to 0 ++ while being otherwise adequately conformant. */ ++#if !defined __STDC__ ++# error "Compiler does not advertise C89 conformance" ++#endif ++ ++#include ++#include ++struct stat; ++/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ ++struct buf { int x; }; ++struct buf * (*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 do not provoke an error unfortunately, instead are silently treated ++ as an "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 is necessary to write \x00 == 0 to get something ++ that is 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 **, int *(*)(struct buf *, struct stat *, int), ++ int, int);' ++ ++# Test code for whether the C compiler supports C89 (body of main). ++ac_c_conftest_c89_main=' ++ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ++' ++ ++# Test code for whether the C compiler supports C99 (global declarations) ++ac_c_conftest_c99_globals=' ++// Does the compiler advertise C99 conformance? ++#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L ++# error "Compiler does not advertise C99 conformance" ++#endif ++ ++#include ++extern int puts (const char *); ++extern int printf (const char *, ...); ++extern int dprintf (int, const char *, ...); ++extern void *malloc (size_t); ++ ++// Check varargs macros. These examples are taken from C99 6.10.3.5. ++// dprintf is used instead of fprintf to avoid needing to declare ++// FILE and stderr. ++#define debug(...) dprintf (2, __VA_ARGS__) ++#define showlist(...) puts (#__VA_ARGS__) ++#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) ++static void ++test_varargs_macros (void) ++{ ++ int x = 1234; ++ int y = 5678; ++ debug ("Flag"); ++ debug ("X = %d\n", x); ++ showlist (The first, second, and third items.); ++ report (x>y, "x is %d but y is %d", x, y); ++} ++ ++// Check long long types. ++#define BIG64 18446744073709551615ull ++#define BIG32 4294967295ul ++#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) ++#if !BIG_OK ++ #error "your preprocessor is broken" ++#endif ++#if BIG_OK ++#else ++ #error "your preprocessor is broken" ++#endif ++static long long int bignum = -9223372036854775807LL; ++static unsigned long long int ubignum = BIG64; ++ ++struct incomplete_array ++{ ++ int datasize; ++ double data[]; ++}; ++ ++struct named_init { ++ int number; ++ const wchar_t *name; ++ double average; ++}; ++ ++typedef const char *ccp; ++ ++static inline int ++test_restrict (ccp restrict text) ++{ ++ // See if C++-style comments work. ++ // Iterate through items via the restricted pointer. ++ // Also check for declarations in for loops. ++ for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) ++ continue; ++ return 0; ++} ++ ++// Check varargs and va_copy. ++static bool ++test_varargs (const char *format, ...) ++{ ++ va_list args; ++ va_start (args, format); ++ va_list args_copy; ++ va_copy (args_copy, args); ++ ++ const char *str = ""; ++ int number = 0; ++ float fnumber = 0; ++ ++ while (*format) ++ { ++ switch (*format++) ++ { ++ case '\''s'\'': // string ++ str = va_arg (args_copy, const char *); ++ break; ++ case '\''d'\'': // int ++ number = va_arg (args_copy, int); ++ break; ++ case '\''f'\'': // float ++ fnumber = va_arg (args_copy, double); ++ break; ++ default: ++ break; ++ } ++ } ++ va_end (args_copy); ++ va_end (args); ++ ++ return *str && number && fnumber; ++} ++' ++ ++# Test code for whether the C compiler supports C99 (body of main). ++ac_c_conftest_c99_main=' ++ // Check bool. ++ _Bool success = false; ++ success |= (argc != 0); ++ ++ // Check restrict. ++ if (test_restrict ("String literal") == 0) ++ success = true; ++ char *restrict newvar = "Another string"; ++ ++ // Check varargs. ++ success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); ++ test_varargs_macros (); ++ ++ // Check flexible array members. ++ struct incomplete_array *ia = ++ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ++ ia->datasize = 10; ++ for (int i = 0; i < ia->datasize; ++i) ++ ia->data[i] = i * 1.234; ++ ++ // Check named initializers. ++ struct named_init ni = { ++ .number = 34, ++ .name = L"Test wide string", ++ .average = 543.34343, ++ }; ++ ++ ni.number = 58; ++ ++ int dynamic_array[ni.number]; ++ dynamic_array[0] = argv[0][0]; ++ dynamic_array[ni.number - 1] = 543; ++ ++ // work around unused variable warnings ++ ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' ++ || dynamic_array[ni.number - 1] != 543); ++' ++ ++# Test code for whether the C compiler supports C11 (global declarations) ++ac_c_conftest_c11_globals=' ++// Does the compiler advertise C11 conformance? ++#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L ++# error "Compiler does not advertise C11 conformance" ++#endif ++ ++// Check _Alignas. ++char _Alignas (double) aligned_as_double; ++char _Alignas (0) no_special_alignment; ++extern char aligned_as_int; ++char _Alignas (0) _Alignas (int) aligned_as_int; ++ ++// Check _Alignof. ++enum ++{ ++ int_alignment = _Alignof (int), ++ int_array_alignment = _Alignof (int[100]), ++ char_alignment = _Alignof (char) ++}; ++_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); ++ ++// Check _Noreturn. ++int _Noreturn does_not_return (void) { for (;;) continue; } ++ ++// Check _Static_assert. ++struct test_static_assert ++{ ++ int x; ++ _Static_assert (sizeof (int) <= sizeof (long int), ++ "_Static_assert does not work in struct"); ++ long int y; ++}; ++ ++// Check UTF-8 literals. ++#define u8 syntax error! ++char const utf8_literal[] = u8"happens to be ASCII" "another string"; ++ ++// Check duplicate typedefs. ++typedef long *long_ptr; ++typedef long int *long_ptr; ++typedef long_ptr long_ptr; ++ ++// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. ++struct anonymous ++{ ++ union { ++ struct { int i; int j; }; ++ struct { int k; long int l; } w; ++ }; ++ int m; ++} v1; ++' ++ ++# Test code for whether the C compiler supports C11 (body of main). ++ac_c_conftest_c11_main=' ++ _Static_assert ((offsetof (struct anonymous, i) ++ == offsetof (struct anonymous, w.k)), ++ "Anonymous union alignment botch"); ++ v1.i = 2; ++ v1.w.k = 5; ++ ok |= v1.i != 5; ++' ++ ++# Test code for whether the C compiler supports C11 (complete). ++ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ++${ac_c_conftest_c99_globals} ++${ac_c_conftest_c11_globals} ++ ++int ++main (int argc, char **argv) ++{ ++ int ok = 0; ++ ${ac_c_conftest_c89_main} ++ ${ac_c_conftest_c99_main} ++ ${ac_c_conftest_c11_main} ++ return ok; ++} ++" ++ ++# Test code for whether the C compiler supports C99 (complete). ++ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ++${ac_c_conftest_c99_globals} ++ ++int ++main (int argc, char **argv) ++{ ++ int ok = 0; ++ ${ac_c_conftest_c89_main} ++ ${ac_c_conftest_c99_main} ++ return ok; ++} ++" ++ ++# Test code for whether the C compiler supports C89 (complete). ++ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} ++ ++int ++main (int argc, char **argv) ++{ ++ int ok = 0; ++ ${ac_c_conftest_c89_main} ++ return ok; ++} ++" ++ + # Check that the precious variables saved in the cache have kept the same + # value. + ac_cache_corrupted=false +@@ -1872,12 +2237,12 @@ for ac_var in $ac_precious_vars; do + 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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 ++printf "%s\n" "$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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 ++printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) +@@ -1886,24 +2251,24 @@ $as_echo "$as_me: error: \`$ac_var' was + 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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 ++printf "%s\n" "$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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 ++printf "%s\n" "$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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 ++printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 ++printf "%s\n" "$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=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in +@@ -1913,11 +2278,12 @@ $as_echo "$as_me: current value: \`$ac + 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 ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 ++printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} ++ as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' ++ and start over" "$LINENO" 5 + fi + ## -------------------- ## + ## Main body of script. ## +@@ -1934,15 +2300,39 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ++ ++ ++ + # Check whether --with-rlm_krb5 was given. +-if test "${with_rlm_krb5+set}" = set; then : ++if test ${with_rlm_krb5+y} ++then : + withval=$with_rlm_krb5; + fi + + +-if test x$with_rlm_krb5 != xno; then + +- ac_ext=c ++ ++fail= ++fr_status= ++fr_features= ++: > "config.report" ++: > "config.report.tmp" ++ ++ ++ ++if test x"$with_rlm_krb5" != xno; then ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++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' +@@ -1950,11 +2340,12 @@ 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 ${ac_cv_prog_CC+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +@@ -1962,11 +2353,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$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 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -1977,11 +2372,11 @@ 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; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++printf "%s\n" "$CC" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -1990,11 +2385,12 @@ 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 ${ac_cv_prog_ac_ct_CC+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_ac_ct_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + else +@@ -2002,11 +2398,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$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 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2017,11 +2417,11 @@ 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; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 ++printf "%s\n" "$ac_ct_CC" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + if test "x$ac_ct_CC" = x; then +@@ -2029,8 +2429,8 @@ fi + 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;} ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} + ac_tool_warned=yes ;; + esac + CC=$ac_ct_CC +@@ -2043,11 +2443,12 @@ 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 ${ac_cv_prog_CC+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +@@ -2055,11 +2456,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$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 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2070,11 +2475,11 @@ 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; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++printf "%s\n" "$CC" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2083,11 +2488,12 @@ 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 ${ac_cv_prog_CC+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +@@ -2096,15 +2502,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ++ if as_fn_executable_p "$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 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2120,18 +2530,18 @@ if test $ac_prog_rejected = yes; then + # 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+' '}$@" ++ 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; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++printf "%s\n" "$CC" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2142,11 +2552,12 @@ if test -z "$CC"; then + 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 ${ac_cv_prog_CC+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +@@ -2154,11 +2565,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$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 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2169,11 +2584,11 @@ 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; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++printf "%s\n" "$CC" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2186,11 +2601,12 @@ if test -z "$CC"; then + 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 ${ac_cv_prog_ac_ct_CC+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_ac_ct_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + else +@@ -2198,11 +2614,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$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 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2213,11 +2633,11 @@ 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; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 ++printf "%s\n" "$ac_ct_CC" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2229,34 +2649,138 @@ done + 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;} ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ CC=$ac_ct_CC ++ fi ++fi ++ ++fi ++if test -z "$CC"; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. ++set dummy ${ac_tool_prefix}clang; ac_word=$2 ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ 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 ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ++ ac_cv_prog_CC="${ac_tool_prefix}clang" ++ printf "%s\n" "$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 ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++printf "%s\n" "$CC" >&6; } ++else ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_CC"; then ++ ac_ct_CC=$CC ++ # Extract the first word of "clang", so it can be a program name with args. ++set dummy clang; ac_word=$2 ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_ac_ct_CC+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ 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 ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_CC="clang" ++ printf "%s\n" "$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 ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 ++printf "%s\n" "$ac_ct_CC" >&6; } ++else ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } ++fi ++ ++ if test "x$ac_ct_CC" = x; then ++ CC="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++printf "%s\n" "$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 + + 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;} ++test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$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 ++printf "%s\n" "$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 ++for ac_option in --version -v -V -qversion -version; 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 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +@@ -2266,7 +2790,7 @@ $as_echo "$ac_try_echo"; } >&5 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + done + +@@ -2274,7 +2798,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; +@@ -2286,9 +2810,9 @@ ac_clean_files="$ac_clean_files a.out a. + # 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 whether the C compiler works" >&5 +-$as_echo_n "checking whether the C compiler works... " >&6; } +-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 ++printf %s "checking whether the C compiler works... " >&6; } ++ac_link_default=`printf "%s\n" "$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.*" +@@ -2309,11 +2833,12 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$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 : ++ printf "%s\n" "$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, +@@ -2330,7 +2855,7 @@ do + # certainly right. + break;; + *.* ) +- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; ++ if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi +@@ -2346,44 +2871,46 @@ do + done + test "$ac_cv_exeext" = no && ac_cv_exeext= + +-else ++else $as_nop + ac_file='' + fi +-if test -z "$ac_file"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-$as_echo "$as_me: failed program was:" >&5 ++if test -z "$ac_file" ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } ++printf "%s\n" "$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;} ++{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error 77 "C compiler cannot create executables + See \`config.log' for more details" "$LINENO" 5; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +-fi +-{ $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; } +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +-$as_echo "$ac_file" >&6; } ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 ++printf %s "checking for C compiler default output file name... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 ++printf "%s\n" "$ac_file" >&6; } + ac_exeext=$ac_cv_exeext + + rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out + ac_clean_files=$ac_clean_files_save +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +-$as_echo_n "checking for suffix of executables... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 ++printf %s "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 ++printf "%s\n" "$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 : ++ printf "%s\n" "$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 +@@ -2397,15 +2924,15 @@ for ac_file in conftest.exe conftest con + * ) 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;} ++else $as_nop ++ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$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 conftest$ac_cv_exeext +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +-$as_echo "$ac_cv_exeext" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 ++printf "%s\n" "$ac_cv_exeext" >&6; } + + rm -f conftest.$ac_ext + EXEEXT=$ac_cv_exeext +@@ -2414,7 +2941,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ + /* end confdefs.h. */ + #include + int +-main () ++main (void) + { + FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; +@@ -2426,8 +2953,8 @@ _ACEOF + ac_clean_files="$ac_clean_files conftest.out" + # 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; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 ++printf %s "checking whether we are cross compiling... " >&6; } + if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" + case "(($ac_try" in +@@ -2435,10 +2962,10 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in +@@ -2446,39 +2973,40 @@ $as_echo "$ac_try_echo"; } >&5 + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$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. ++ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error 77 "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: $cross_compiling" >&5 +-$as_echo "$cross_compiling" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 ++printf "%s\n" "$cross_compiling" >&6; } + + rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out + ac_clean_files=$ac_clean_files_save +-{ $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 ${ac_cv_objext+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 ++printf %s "checking for suffix of object files... " >&6; } ++if test ${ac_cv_objext+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; +@@ -2492,11 +3020,12 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$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 : ++ printf "%s\n" "$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 +@@ -2505,31 +3034,32 @@ $as_echo "$ac_try_echo"; } >&5 + break;; + esac + done +-else +- $as_echo "$as_me: failed program was:" >&5 ++else $as_nop ++ printf "%s\n" "$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;} ++{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$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; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 ++printf "%s\n" "$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 ${ac_cv_c_compiler_gnu+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 ++printf %s "checking whether the compiler supports GNU C... " >&6; } ++if test ${ac_cv_c_compiler_gnu+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + #ifndef __GNUC__ + choke me +@@ -2539,29 +3069,33 @@ main () + return 0; + } + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + ac_compiler_gnu=yes +-else ++else $as_nop + ac_compiler_gnu=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam 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; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 ++printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ + if test $ac_compiler_gnu = yes; then + GCC=yes + else + GCC= + fi +-ac_test_CFLAGS=${CFLAGS+set} ++ac_test_CFLAGS=${CFLAGS+y} + 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 ${ac_cv_prog_cc_g+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 ++printf %s "checking whether $CC accepts -g... " >&6; } ++if test ${ac_cv_prog_cc_g+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no +@@ -2570,57 +3104,60 @@ else + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + ac_cv_prog_cc_g=yes +-else ++else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +-else ++else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++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 ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam 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 ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 ++printf "%s\n" "$ac_cv_prog_cc_g" >&6; } ++if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS + elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then +@@ -2635,94 +3172,144 @@ 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 ${ac_cv_prog_cc_c89+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- ac_cv_prog_cc_c89=no ++ac_prog_cc_stdc=no ++if test x$ac_prog_cc_stdc = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 ++printf %s "checking for $CC option to enable C11 features... " >&6; } ++if test ${ac_cv_prog_cc_c11+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ ac_cv_prog_cc_c11=no + ac_save_CC=$CC + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-#include +-#include +-struct stat; +-/* 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]; ++$ac_c_conftest_c11_program ++_ACEOF ++for ac_arg in '' -std=gnu11 ++do ++ CC="$ac_save_CC $ac_arg" ++ if ac_fn_c_try_compile "$LINENO" ++then : ++ ac_cv_prog_cc_c11=$ac_arg ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.beam ++ test "x$ac_cv_prog_cc_c11" != "xno" && break ++done ++rm -f conftest.$ac_ext ++CC=$ac_save_CC ++fi + +-/* 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]; ++if test "x$ac_cv_prog_cc_c11" = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 ++printf "%s\n" "unsupported" >&6; } ++else $as_nop ++ if test "x$ac_cv_prog_cc_c11" = x ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 ++printf "%s\n" "none needed" >&6; } ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 ++printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } ++ CC="$CC $ac_cv_prog_cc_c11" ++fi ++ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ++ ac_prog_cc_stdc=c11 ++fi ++fi ++if test x$ac_prog_cc_stdc = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 ++printf %s "checking for $CC option to enable C99 features... " >&6; } ++if test ${ac_cv_prog_cc_c99+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ ac_cv_prog_cc_c99=no ++ac_save_CC=$CC ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_c_conftest_c99_program ++_ACEOF ++for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= ++do ++ CC="$ac_save_CC $ac_arg" ++ if ac_fn_c_try_compile "$LINENO" ++then : ++ ac_cv_prog_cc_c99=$ac_arg ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.beam ++ test "x$ac_cv_prog_cc_c99" != "xno" && break ++done ++rm -f conftest.$ac_ext ++CC=$ac_save_CC ++fi + +-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; +-} ++if test "x$ac_cv_prog_cc_c99" = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 ++printf "%s\n" "unsupported" >&6; } ++else $as_nop ++ if test "x$ac_cv_prog_cc_c99" = x ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 ++printf "%s\n" "none needed" >&6; } ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 ++printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } ++ CC="$CC $ac_cv_prog_cc_c99" ++fi ++ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ++ ac_prog_cc_stdc=c99 ++fi ++fi ++if test x$ac_prog_cc_stdc = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 ++printf %s "checking for $CC option to enable C89 features... " >&6; } ++if test ${ac_cv_prog_cc_c89+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ ac_cv_prog_cc_c89=no ++ac_save_CC=$CC ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_c_conftest_c89_program + _ACEOF +-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ +- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" ++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 : ++ if ac_fn_c_try_compile "$LINENO" ++then : + ac_cv_prog_cc_c89=$ac_arg + fi +-rm -f core conftest.err conftest.$ac_objext ++rm -f core conftest.err conftest.$ac_objext conftest.beam + 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 : + ++if test "x$ac_cv_prog_cc_c89" = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 ++printf "%s\n" "unsupported" >&6; } ++else $as_nop ++ if test "x$ac_cv_prog_cc_c89" = x ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 ++printf "%s\n" "none needed" >&6; } ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 ++printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } ++ CC="$CC $ac_cv_prog_cc_c89" ++fi ++ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ++ ac_prog_cc_stdc=c89 ++fi + fi + + ac_ext=c +@@ -2731,45 +3318,41 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS con + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + +- ac_ext=c ++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; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 ++printf %s "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 ${ac_cv_prog_CPP+:} false; 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" ++ if test ${ac_cv_prog_CPP+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ # Double quotes because $CC needs to be expanded ++ for CPP in "$CC -E" "$CC -E -traditional-cpp" 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 ++#include + Syntax error + _ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : ++if ac_fn_c_try_cpp "$LINENO" ++then : + +-else ++else $as_nop + # Broken: fails on valid input. + continue + fi +@@ -2781,10 +3364,11 @@ rm -f conftest.err conftest.i conftest.$ + /* end confdefs.h. */ + #include + _ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : ++if ac_fn_c_try_cpp "$LINENO" ++then : + # Broken: success on invalid input. + continue +-else ++else $as_nop + # Passes both tests. + ac_preproc_ok=: + break +@@ -2794,7 +3378,8 @@ rm -f conftest.err conftest.i conftest.$ + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.i conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then : ++if $ac_preproc_ok ++then : + break + fi + +@@ -2806,29 +3391,24 @@ fi + else + ac_cv_prog_CPP=$CPP + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +-$as_echo "$CPP" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 ++printf "%s\n" "$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 ++#include + Syntax error + _ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : ++if ac_fn_c_try_cpp "$LINENO" ++then : + +-else ++else $as_nop + # Broken: fails on valid input. + continue + fi +@@ -2840,10 +3420,11 @@ rm -f conftest.err conftest.i conftest.$ + /* end confdefs.h. */ + #include + _ACEOF +-if ac_fn_c_try_cpp "$LINENO"; then : ++if ac_fn_c_try_cpp "$LINENO" ++then : + # Broken: success on invalid input. + continue +-else ++else $as_nop + # Passes both tests. + ac_preproc_ok=: + break +@@ -2853,11 +3434,12 @@ rm -f conftest.err conftest.i conftest.$ + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.i conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then : ++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;} ++else $as_nop ++ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$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 +@@ -2869,31 +3451,32 @@ ac_link='$CC -o conftest$ac_exeext $CFLA + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +- rlm_krb5_dir= ++rlm_krb5_dir= + + # Check whether --with-rlm-krb5-dir was given. +-if test "${with_rlm_krb5_dir+set}" = set; then : +- withval=$with_rlm_krb5_dir; case "$withval" in +- no) ++if test ${with_rlm_krb5_dir+y} ++then : ++ withval=$with_rlm_krb5_dir; case "$withval" in ++ no) + as_fn_error $? "Need rlm-krb5-dir" "$LINENO" 5 + ;; +- yes) ++ yes) + ;; +- *) ++ *) + rlm_krb5_dir="$withval" + ;; +- esac +- ++ esac + fi + + +- # Extract the first word of "krb5-config", so it can be a program name with args. ++# Extract the first word of "krb5-config", so it can be a program name with args. + set dummy krb5-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 ${ac_cv_path_krb5_config+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_path_krb5_config+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + case $krb5_config in + [\\/]* | ?:[\\/]*) + ac_cv_path_krb5_config="$krb5_config" # Let the user override the test with a path. +@@ -2904,11 +3487,15 @@ as_dummy="${rlm_krb5_dir}/bin:${PATH}:/u + for as_dir in $as_dummy + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_path_krb5_config="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ++ ac_cv_path_krb5_config="$as_dir$ac_word$ac_exec_ext" ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2921,1920 +3508,1639 @@ esac + fi + krb5_config=$ac_cv_path_krb5_config + if test -n "$krb5_config"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $krb5_config" >&5 +-$as_echo "$krb5_config" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $krb5_config" >&5 ++printf "%s\n" "$krb5_config" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +- if test "$krb5_config" != 'not-found'; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking krb5-config CFLAGS" >&5 +-$as_echo_n "checking krb5-config CFLAGS... " >&6; } +- SMART_CPPFLAGS=$($krb5_config --cflags) +- SMART_CPPFLAGS=$(echo "$SMART_CPPFLAGS" | sed 's/-I[ ]*/-isystem /g') +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$SMART_CPPFLAGS\"" >&5 +-$as_echo "\"$SMART_CPPFLAGS\"" >&6; } +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking krb5-config LDFLAGS" >&5 +-$as_echo_n "checking krb5-config LDFLAGS... " >&6; } +- SMART_LIBS=$($krb5_config --libs) +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SMART_LIBS}" >&5 +-$as_echo "${SMART_LIBS}" >&6; } +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking krb5-config reported version" >&5 +-$as_echo_n "checking krb5-config reported version... " >&6; } +- krb5_version_raw=$($krb5_config --version) +- +- krb5_version=$(echo "$krb5_version_raw" | head -n 1 | \ +- awk '{split($(4),v,"."); if (v["3"] = "") v["3"] = "0"; print v["1"]v["2"]v["3"] }') +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${krb5_version_raw} ($krb5_version)" >&5 +-$as_echo "${krb5_version_raw} ($krb5_version)" >&6; } +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking krb5-config reported vendor" >&5 +-$as_echo_n "checking krb5-config reported vendor... " >&6; } +- krb5_vendor=$($krb5_config --vendor) +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${krb5_vendor}" >&5 +-$as_echo "${krb5_vendor}" >&6; } +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking canonical API type" >&5 +-$as_echo_n "checking canonical API type... " >&6; } +- if test "$krb5_vendor" = "Massachusetts Institute of Technology" || \ +- echo "$krb5_vendor" | grep -i 'MIT' > /dev/null 2>&1 || \ +- echo "$krb5_version_raw" | grep -i 'MIT' > /dev/null 2>&1 ; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: MIT" >&5 +-$as_echo "MIT" >&6; } +- krb5_api_type='mit' +- else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: HEIMDAL" >&5 +-$as_echo "HEIMDAL" >&6; } +- krb5_api_type='heimdal' +- fi ++if test "$krb5_config" != 'not-found'; then ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking krb5-config CFLAGS" >&5 ++printf %s "checking krb5-config CFLAGS... " >&6; } ++ SMART_CPPFLAGS=$($krb5_config --cflags) ++ SMART_CPPFLAGS=$(echo "$SMART_CPPFLAGS" | sed 's/-I[ ]*/-isystem /g') ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$SMART_CPPFLAGS\"" >&5 ++printf "%s\n" "\"$SMART_CPPFLAGS\"" >&6; } ++ ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking krb5-config LDFLAGS" >&5 ++printf %s "checking krb5-config LDFLAGS... " >&6; } ++ SMART_LIBS=$($krb5_config --libs) ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${SMART_LIBS}" >&5 ++printf "%s\n" "${SMART_LIBS}" >&6; } ++ ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking krb5-config reported version" >&5 ++printf %s "checking krb5-config reported version... " >&6; } ++ krb5_version_raw=$($krb5_config --version) ++ ++ krb5_version=$(echo "$krb5_version_raw" | head -n 1 | \ ++ awk '{split($(4),v,"."); if (v["3"] == "") v["3"] = "0"; print v["1"]v["2"]v["3"] }') ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${krb5_version_raw} ($krb5_version)" >&5 ++printf "%s\n" "${krb5_version_raw} ($krb5_version)" >&6; } ++ ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking krb5-config reported vendor" >&5 ++printf %s "checking krb5-config reported vendor... " >&6; } ++ krb5_vendor=$($krb5_config --vendor) ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${krb5_vendor}" >&5 ++printf "%s\n" "${krb5_vendor}" >&6; } ++ ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking canonical API type" >&5 ++printf %s "checking canonical API type... " >&6; } ++ if test "$krb5_vendor" = "Massachusetts Institute of Technology" || \ ++ echo "$krb5_vendor" | grep -i 'MIT' > /dev/null 2>&1 || \ ++ echo "$krb5_version_raw" | grep -i 'MIT' > /dev/null 2>&1 ; then ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: MIT" >&5 ++printf "%s\n" "MIT" >&6; } ++ krb5_api_type='mit' + else +- smart_try_dir="$rlm_krb5_dir/include" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: HEIMDAL" >&5 ++printf "%s\n" "HEIMDAL" >&6; } ++ krb5_api_type='heimdal' ++ fi ++else ++ smart_try_dir="$rlm_krb5_dir/include" + + + + ac_safe=`echo "krb5.h" | sed 'y%./+-%__pm%'` ++ ++if test "x" = "x"; then ++ sm_pkg=`echo "${ac_safe}" | sed 's/.h//;s/^lib//'` ++else ++ sm_pkg="" ++fi ++ + old_CPPFLAGS="$CPPFLAGS" +-smart_include= +-smart_include_dir="/usr/local/include /opt/include" ++smart_include_dir="/usr/local/include /opt/include /usr/local/${sm_pkg}/include /opt/homebrew/include /opt/homebrew/opt/${sm_pkg}/include" + + _smart_try_dir= + _smart_include_dir= + + for _prefix in $smart_prefix ""; do +- for _dir in $smart_try_dir; do +- _smart_try_dir="${_smart_try_dir} ${_dir}/${_prefix}" +- done ++for _dir in $smart_try_dir; do ++ _smart_try_dir="${_smart_try_dir} ${_dir}/${_prefix}" ++done + +- for _dir in $smart_include_dir; do +- _smart_include_dir="${_smart_include_dir} ${_dir}/${_prefix}" +- done ++for _dir in $smart_include_dir; do ++ _smart_include_dir="${_smart_include_dir} ${_dir}/${_prefix}" ++done + done + + if test "x$_smart_try_dir" != "x"; then +- for try in $_smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5.h in $try" >&5 +-$as_echo_n "checking for krb5.h in $try... " >&6; } +- CPPFLAGS="-isystem $try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $_smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5.h in $try" >&5 ++printf %s "checking for krb5.h in $try... " >&6; } ++ CPPFLAGS="-isystem $try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem $try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem $try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done +- CPPFLAGS="$old_CPPFLAGS" ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_include" = "x"; then +- for _prefix in $smart_prefix; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/krb5.h" >&5 +-$as_echo_n "checking for ${_prefix}/krb5.h... " >&6; } ++for _prefix in $smart_prefix; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/krb5.h" >&5 ++printf %s "checking for ${_prefix}/krb5.h... " >&6; } + +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem ${_prefix}/" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem ${_prefix}/" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done + fi + + if test "x$smart_include" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5.h" >&5 +-$as_echo_n "checking for krb5.h... " >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5.h" >&5 ++printf %s "checking for krb5.h... " >&6; } + +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include=" " +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include=" " ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + if test "x$smart_include" = "x"; then +- +- for prefix in $smart_prefix; do +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file="${_prefix}/${1}" +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$_smart_include_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "_smart_include_dir=\"\$_smart_include_dir $DIRS\"" +- +- done ++for try in $_smart_include_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5.h in $try" >&5 ++printf %s "checking for krb5.h in $try... " >&6; } ++ CPPFLAGS="-isystem $try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ + + +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=krb5.h +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi ++ #include + +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$_smart_include_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "_smart_include_dir=\"\$_smart_include_dir $DIRS\"" ++int ++main (void) ++{ + ++ int a = 1; + +- for try in $_smart_include_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5.h in $try" >&5 +-$as_echo_n "checking for krb5.h in $try... " >&6; } +- CPPFLAGS="-isystem $try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ + +- #include +-int +-main () +-{ +-int a = 1; + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem $try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem $try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done +- CPPFLAGS="$old_CPPFLAGS" ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_include" != "x"; then +- eval "ac_cv_header_$ac_safe=yes" +- CPPFLAGS="$smart_include $old_CPPFLAGS" +- SMART_CPPFLAGS="$smart_include $SMART_CPPFLAGS" ++eval "ac_cv_header_$ac_safe=yes" ++CPPFLAGS="$smart_include $old_CPPFLAGS" ++SMART_CPPFLAGS="$smart_include $SMART_CPPFLAGS" + fi + + smart_prefix= + +- if test "$ac_cv_header_krb5_h" != "yes"; then +- fail="$fail krb5.h" +- fi ++ if test "$ac_cv_header_krb5_h" != "yes"; then ++ ++fail="$fail krb5.h" + +- krb5libcrypto= +- smart_try_dir="$rlm_krb5_dir/lib" ++ fi ++ ++ krb5libcrypto= ++ smart_try_dir="$rlm_krb5_dir/lib" + + + sm_lib_safe=`echo "k5crypto" | sed 'y%./+-%__p_%'` + sm_func_safe=`echo "krb5_encrypt_data" | sed 'y%./+-%__p_%'` + ++if test "x" = "x"; then ++ sm_pkg="${sm_lib_safe}" ++else ++ sm_pkg="" ++fi ++ + old_LIBS="$LIBS" + old_CPPFLAGS="$CPPFLAGS" + smart_lib= + smart_ldflags= +-smart_lib_dir= ++smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib" + + if test "x$smart_try_dir" != "x"; then +- for try in $smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_encrypt_data in -lk5crypto in $try" >&5 +-$as_echo_n "checking for krb5_encrypt_data in -lk5crypto in $try... " >&6; } +- LIBS="-lk5crypto $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_encrypt_data in -lk5crypto in $try" >&5 ++printf %s "checking for krb5_encrypt_data in -lk5crypto in $try... " >&6; } ++ LIBS="-lk5crypto $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_encrypt_data(); + int +-main () ++main (void) + { + krb5_encrypt_data() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lk5crypto" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lk5crypto" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_encrypt_data in -lk5crypto" >&5 +-$as_echo_n "checking for krb5_encrypt_data in -lk5crypto... " >&6; } +- LIBS="-lk5crypto $old_LIBS" ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_encrypt_data in -lk5crypto" >&5 ++printf %s "checking for krb5_encrypt_data in -lk5crypto... " >&6; } ++LIBS="-lk5crypto $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_encrypt_data(); + int +-main () ++main (void) + { + krb5_encrypt_data() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + +- smart_lib="-lk5crypto" +- { $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; } ++ smart_lib="-lk5crypto" ++ smart_ld_found="" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- LIBS="$old_LIBS" ++LIBS="$old_LIBS" + fi + + if test "x$smart_lib" = "x"; then +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libk5crypto${libltdl_cv_shlibext} +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libk5crypto.a +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- for try in $smart_lib_dir /usr/local/lib /opt/lib; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_encrypt_data in -lk5crypto in $try" >&5 +-$as_echo_n "checking for krb5_encrypt_data in -lk5crypto in $try... " >&6; } +- LIBS="-lk5crypto $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_lib_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_encrypt_data in -lk5crypto in $try" >&5 ++printf %s "checking for krb5_encrypt_data in -lk5crypto in $try... " >&6; } ++ LIBS="-lk5crypto $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_encrypt_data(); + int +-main () ++main (void) + { + krb5_encrypt_data() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lk5crypto" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lk5crypto" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" != "x"; then +- eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" +- LIBS="$smart_ldflags $smart_lib $old_LIBS" +- SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" ++LIBS="$smart_ldflags $smart_lib $old_LIBS" ++SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++SMART_LD_FOUND="$smart_ld_found" + fi + +- if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = xyes; then +- krb5libcrypto="-lk5crypto" +- fi ++ if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = xyes; then ++ krb5libcrypto="-lk5crypto" ++ fi + +- if test "x$krb5libcrypto" = x; then ++ if test "x$krb5libcrypto" = x; then + + + sm_lib_safe=`echo "crypto" | sed 'y%./+-%__p_%'` + sm_func_safe=`echo "DH_new" | sed 'y%./+-%__p_%'` + ++if test "x" = "x"; then ++ sm_pkg="${sm_lib_safe}" ++else ++ sm_pkg="" ++fi ++ + old_LIBS="$LIBS" + old_CPPFLAGS="$CPPFLAGS" + smart_lib= + smart_ldflags= +-smart_lib_dir= ++smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib" + + if test "x$smart_try_dir" != "x"; then +- for try in $smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto in $try" >&5 +-$as_echo_n "checking for DH_new in -lcrypto in $try... " >&6; } +- LIBS="-lcrypto $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto in $try" >&5 ++printf %s "checking for DH_new in -lcrypto in $try... " >&6; } ++ LIBS="-lcrypto $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char DH_new(); + int +-main () ++main (void) + { + DH_new() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lcrypto" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lcrypto" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto" >&5 +-$as_echo_n "checking for DH_new in -lcrypto... " >&6; } +- LIBS="-lcrypto $old_LIBS" ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto" >&5 ++printf %s "checking for DH_new in -lcrypto... " >&6; } ++LIBS="-lcrypto $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char DH_new(); + int +-main () ++main (void) + { + DH_new() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lcrypto" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lcrypto" ++ smart_ld_found="" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- LIBS="$old_LIBS" ++LIBS="$old_LIBS" + fi + + if test "x$smart_lib" = "x"; then +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libcrypto${libltdl_cv_shlibext} +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libcrypto.a +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- for try in $smart_lib_dir /usr/local/lib /opt/lib; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto in $try" >&5 +-$as_echo_n "checking for DH_new in -lcrypto in $try... " >&6; } +- LIBS="-lcrypto $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_lib_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto in $try" >&5 ++printf %s "checking for DH_new in -lcrypto in $try... " >&6; } ++ LIBS="-lcrypto $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char DH_new(); + int +-main () ++main (void) + { + DH_new() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lcrypto" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lcrypto" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" != "x"; then +- eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" +- LIBS="$smart_ldflags $smart_lib $old_LIBS" +- SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" ++LIBS="$smart_ldflags $smart_lib $old_LIBS" ++SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++SMART_LD_FOUND="$smart_ld_found" + fi + +- if test "x$ac_cv_lib_crypto_DH_new" = xyes; then +- krb5libcrypto="-lcrypto" +- fi ++ if test "x$ac_cv_lib_crypto_DH_new" = xyes; then ++ krb5libcrypto="-lcrypto" + fi ++ fi + +- if test "x$krb5libcrypto" = x; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: neither krb5 'k5crypto' nor 'crypto' libraries are found!" >&5 +-$as_echo "$as_me: WARNING: neither krb5 'k5crypto' nor 'crypto' libraries are found!" >&2;} +- fi ++ if test "x$krb5libcrypto" = x; then ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: neither krb5 'k5crypto' nor 'crypto' libraries are found!" >&5 ++printf "%s\n" "$as_me: WARNING: neither krb5 'k5crypto' nor 'crypto' libraries are found!" >&2;} ++ fi + + + + sm_lib_safe=`echo "com_err" | sed 'y%./+-%__p_%'` + sm_func_safe=`echo "set_com_err_hook" | sed 'y%./+-%__p_%'` + ++if test "x" = "x"; then ++ sm_pkg="${sm_lib_safe}" ++else ++ sm_pkg="" ++fi ++ + old_LIBS="$LIBS" + old_CPPFLAGS="$CPPFLAGS" + smart_lib= + smart_ldflags= +-smart_lib_dir= ++smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib" + + if test "x$smart_try_dir" != "x"; then +- for try in $smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for set_com_err_hook in -lcom_err in $try" >&5 +-$as_echo_n "checking for set_com_err_hook in -lcom_err in $try... " >&6; } +- LIBS="-lcom_err $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for set_com_err_hook in -lcom_err in $try" >&5 ++printf %s "checking for set_com_err_hook in -lcom_err in $try... " >&6; } ++ LIBS="-lcom_err $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char set_com_err_hook(); + int +-main () ++main (void) + { + set_com_err_hook() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + +- smart_lib="-lcom_err" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lcom_err" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for set_com_err_hook in -lcom_err" >&5 +-$as_echo_n "checking for set_com_err_hook in -lcom_err... " >&6; } +- LIBS="-lcom_err $old_LIBS" ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for set_com_err_hook in -lcom_err" >&5 ++printf %s "checking for set_com_err_hook in -lcom_err... " >&6; } ++LIBS="-lcom_err $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char set_com_err_hook(); + int +-main () ++main (void) + { + set_com_err_hook() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + +- smart_lib="-lcom_err" +- { $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; } ++ smart_lib="-lcom_err" ++ smart_ld_found="" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- LIBS="$old_LIBS" ++LIBS="$old_LIBS" + fi + + if test "x$smart_lib" = "x"; then +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libcom_err${libltdl_cv_shlibext} +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libcom_err.a +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- for try in $smart_lib_dir /usr/local/lib /opt/lib; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for set_com_err_hook in -lcom_err in $try" >&5 +-$as_echo_n "checking for set_com_err_hook in -lcom_err in $try... " >&6; } +- LIBS="-lcom_err $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_lib_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for set_com_err_hook in -lcom_err in $try" >&5 ++printf %s "checking for set_com_err_hook in -lcom_err in $try... " >&6; } ++ LIBS="-lcom_err $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char set_com_err_hook(); + int +-main () ++main (void) + { + set_com_err_hook() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lcom_err" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lcom_err" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" != "x"; then +- eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" +- LIBS="$smart_ldflags $smart_lib $old_LIBS" +- SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" ++LIBS="$smart_ldflags $smart_lib $old_LIBS" ++SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++SMART_LD_FOUND="$smart_ld_found" + fi + +- if test "x$ac_cv_lib_com_err_set_com_err_hook" != xyes; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the comm_err library isn't found!" >&5 +-$as_echo "$as_me: WARNING: the comm_err library isn't found!" >&2;} +- fi ++ if test "x$ac_cv_lib_com_err_set_com_err_hook" != xyes; then ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: the comm_err library isn't found!" >&5 ++printf "%s\n" "$as_me: WARNING: the comm_err library isn't found!" >&2;} ++ fi + + + + sm_lib_safe=`echo "krb5" | sed 'y%./+-%__p_%'` + sm_func_safe=`echo "krb5_verify_user_opt" | sed 'y%./+-%__p_%'` + ++if test "x" = "x"; then ++ sm_pkg="${sm_lib_safe}" ++else ++ sm_pkg="" ++fi ++ + old_LIBS="$LIBS" + old_CPPFLAGS="$CPPFLAGS" + smart_lib= + smart_ldflags= +-smart_lib_dir= ++smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib" + + if test "x$smart_try_dir" != "x"; then +- for try in $smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_verify_user_opt in -lkrb5 in $try" >&5 +-$as_echo_n "checking for krb5_verify_user_opt in -lkrb5 in $try... " >&6; } +- LIBS="-lkrb5 $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_verify_user_opt in -lkrb5 in $try" >&5 ++printf %s "checking for krb5_verify_user_opt in -lkrb5 in $try... " >&6; } ++ LIBS="-lkrb5 $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_verify_user_opt(); + int +-main () ++main (void) + { + krb5_verify_user_opt() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lkrb5" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lkrb5" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_verify_user_opt in -lkrb5" >&5 +-$as_echo_n "checking for krb5_verify_user_opt in -lkrb5... " >&6; } +- LIBS="-lkrb5 $old_LIBS" ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_verify_user_opt in -lkrb5" >&5 ++printf %s "checking for krb5_verify_user_opt in -lkrb5... " >&6; } ++LIBS="-lkrb5 $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_verify_user_opt(); + int +-main () ++main (void) + { + krb5_verify_user_opt() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + +- smart_lib="-lkrb5" +- { $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; } ++ smart_lib="-lkrb5" ++ smart_ld_found="" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- LIBS="$old_LIBS" ++LIBS="$old_LIBS" + fi + + if test "x$smart_lib" = "x"; then +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libkrb5${libltdl_cv_shlibext} +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libkrb5.a +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- for try in $smart_lib_dir /usr/local/lib /opt/lib; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_verify_user_opt in -lkrb5 in $try" >&5 +-$as_echo_n "checking for krb5_verify_user_opt in -lkrb5 in $try... " >&6; } +- LIBS="-lkrb5 $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_lib_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_verify_user_opt in -lkrb5 in $try" >&5 ++printf %s "checking for krb5_verify_user_opt in -lkrb5 in $try... " >&6; } ++ LIBS="-lkrb5 $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_verify_user_opt(); + int +-main () ++main (void) + { + krb5_verify_user_opt() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lkrb5" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lkrb5" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" != "x"; then +- eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" +- LIBS="$smart_ldflags $smart_lib $old_LIBS" +- SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" ++LIBS="$smart_ldflags $smart_lib $old_LIBS" ++SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++SMART_LD_FOUND="$smart_ld_found" + fi + +- if test "x$ac_cv_lib_krb5_krb5_verify_user_opt" = xyes; then +- krb5_api_type='heimdal' +- else +- krb5_api_type='mit' ++ if test "x$ac_cv_lib_krb5_krb5_verify_user_opt" = xyes; then ++ krb5_api_type='heimdal' ++ else ++ krb5_api_type='mit' + + + + sm_lib_safe=`echo "krb5" | sed 'y%./+-%__p_%'` + sm_func_safe=`echo "krb5_get_init_creds_password" | sed 'y%./+-%__p_%'` + ++if test "x" = "x"; then ++ sm_pkg="${sm_lib_safe}" ++else ++ sm_pkg="" ++fi ++ + old_LIBS="$LIBS" + old_CPPFLAGS="$CPPFLAGS" + smart_lib= + smart_ldflags= +-smart_lib_dir= ++smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib" + + if test "x$smart_try_dir" != "x"; then +- for try in $smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_password in -lkrb5 in $try" >&5 +-$as_echo_n "checking for krb5_get_init_creds_password in -lkrb5 in $try... " >&6; } +- LIBS="-lkrb5 $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_password in -lkrb5 in $try" >&5 ++printf %s "checking for krb5_get_init_creds_password in -lkrb5 in $try... " >&6; } ++ LIBS="-lkrb5 $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_get_init_creds_password(); + int +-main () ++main (void) + { + krb5_get_init_creds_password() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lkrb5" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lkrb5" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_password in -lkrb5" >&5 +-$as_echo_n "checking for krb5_get_init_creds_password in -lkrb5... " >&6; } +- LIBS="-lkrb5 $old_LIBS" ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_password in -lkrb5" >&5 ++printf %s "checking for krb5_get_init_creds_password in -lkrb5... " >&6; } ++LIBS="-lkrb5 $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_get_init_creds_password(); + int +-main () ++main (void) + { + krb5_get_init_creds_password() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + +- smart_lib="-lkrb5" +- { $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; } ++ smart_lib="-lkrb5" ++ smart_ld_found="" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- LIBS="$old_LIBS" ++LIBS="$old_LIBS" + fi + + if test "x$smart_lib" = "x"; then +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libkrb5${libltdl_cv_shlibext} +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libkrb5.a +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- for try in $smart_lib_dir /usr/local/lib /opt/lib; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_password in -lkrb5 in $try" >&5 +-$as_echo_n "checking for krb5_get_init_creds_password in -lkrb5 in $try... " >&6; } +- LIBS="-lkrb5 $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_lib_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_password in -lkrb5 in $try" >&5 ++printf %s "checking for krb5_get_init_creds_password in -lkrb5 in $try... " >&6; } ++ LIBS="-lkrb5 $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_get_init_creds_password(); + int +-main () ++main (void) + { + krb5_get_init_creds_password() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lkrb5" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lkrb5" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" != "x"; then +- eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" +- LIBS="$smart_ldflags $smart_lib $old_LIBS" +- SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" ++LIBS="$smart_ldflags $smart_lib $old_LIBS" ++SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++SMART_LD_FOUND="$smart_ld_found" + fi + +- if test "x$ac_cv_lib_krb5_krb5_get_init_creds_password" != xyes; then +- fail="$fail krb5" +- fi +- fi ++ if test "x$ac_cv_lib_krb5_krb5_get_init_creds_password" != xyes; then + ++fail="$fail krb5" ++ ++ fi + fi + +- LDFLAGS="${LDFLAGS} ${SMART_LIBS}" +- CFLAGS="${CFLAGS} ${SMART_CPPFLAGS}" ++fi + +- for ac_func in krb5_get_error_message krb5_free_error_string krb5_free_error_message +-do : +- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +- cat >>confdefs.h <<_ACEOF +-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +-_ACEOF ++LDFLAGS="${LDFLAGS} ${SMART_LIBS}" ++CFLAGS="${CFLAGS} ${SMART_CPPFLAGS}" ++ ++ac_fn_c_check_func "$LINENO" "krb5_get_error_message" "ac_cv_func_krb5_get_error_message" ++if test "x$ac_cv_func_krb5_get_error_message" = xyes ++then : ++ printf "%s\n" "#define HAVE_KRB5_GET_ERROR_MESSAGE 1" >>confdefs.h + + fi +-done ++ac_fn_c_check_func "$LINENO" "krb5_free_error_string" "ac_cv_func_krb5_free_error_string" ++if test "x$ac_cv_func_krb5_free_error_string" = xyes ++then : ++ printf "%s\n" "#define HAVE_KRB5_FREE_ERROR_STRING 1" >>confdefs.h + +- if test "x$ac_cv_func_krb5_get_error_message" = xyes; then +- krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_GET_ERROR_MESSAGE" +- fi +- if test "x$ac_cv_func_krb5_free_error_message" = xyes; then +- krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_MESSAGE" +- fi +- if test "x$ac_cv_func_krb5_free_error_string" = xyes; then +- krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_STRING" +- fi ++fi ++ac_fn_c_check_func "$LINENO" "krb5_free_error_message" "ac_cv_func_krb5_free_error_message" ++if test "x$ac_cv_func_krb5_free_error_message" = xyes ++then : ++ printf "%s\n" "#define HAVE_KRB5_FREE_ERROR_MESSAGE 1" >>confdefs.h + +- if test "$krb5threadsafe" != "no"; then +- krb5threadsafe= ++fi ++ ++if test "x$ac_cv_func_krb5_get_error_message" = xyes; then ++ krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_GET_ERROR_MESSAGE" ++fi ++if test "x$ac_cv_func_krb5_free_error_message" = xyes; then ++ krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_MESSAGE" ++fi ++if test "x$ac_cv_func_krb5_free_error_string" = xyes; then ++ krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_STRING" ++fi ++ ++if test "$krb5threadsafe" != "no"; then ++ krb5threadsafe= + + + + sm_lib_safe=`echo "krb5" | sed 'y%./+-%__p_%'` + sm_func_safe=`echo "krb5_is_thread_safe" | sed 'y%./+-%__p_%'` + ++if test "x" = "x"; then ++ sm_pkg="${sm_lib_safe}" ++else ++ sm_pkg="" ++fi ++ + old_LIBS="$LIBS" + old_CPPFLAGS="$CPPFLAGS" + smart_lib= + smart_ldflags= +-smart_lib_dir= ++smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib" + + if test "x$smart_try_dir" != "x"; then +- for try in $smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_is_thread_safe in -lkrb5 in $try" >&5 +-$as_echo_n "checking for krb5_is_thread_safe in -lkrb5 in $try... " >&6; } +- LIBS="-lkrb5 $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_is_thread_safe in -lkrb5 in $try" >&5 ++printf %s "checking for krb5_is_thread_safe in -lkrb5 in $try... " >&6; } ++ LIBS="-lkrb5 $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_is_thread_safe(); + int +-main () ++main (void) + { + krb5_is_thread_safe() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + +- smart_lib="-lkrb5" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lkrb5" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_is_thread_safe in -lkrb5" >&5 +-$as_echo_n "checking for krb5_is_thread_safe in -lkrb5... " >&6; } +- LIBS="-lkrb5 $old_LIBS" ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_is_thread_safe in -lkrb5" >&5 ++printf %s "checking for krb5_is_thread_safe in -lkrb5... " >&6; } ++LIBS="-lkrb5 $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_is_thread_safe(); + int +-main () ++main (void) + { + krb5_is_thread_safe() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- +- smart_lib="-lkrb5" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } ++if ac_fn_c_try_link "$LINENO" ++then : + +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lkrb5" ++ smart_ld_found="" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- LIBS="$old_LIBS" ++LIBS="$old_LIBS" + fi + + if test "x$smart_lib" = "x"; then +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libkrb5${libltdl_cv_shlibext} +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=libkrb5.a +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" +- +- +- for try in $smart_lib_dir /usr/local/lib /opt/lib; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_is_thread_safe in -lkrb5 in $try" >&5 +-$as_echo_n "checking for krb5_is_thread_safe in -lkrb5 in $try... " >&6; } +- LIBS="-lkrb5 $old_LIBS" +- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $smart_lib_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for krb5_is_thread_safe in -lkrb5 in $try" >&5 ++printf %s "checking for krb5_is_thread_safe in -lkrb5 in $try... " >&6; } ++ LIBS="-lkrb5 $old_LIBS" ++ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + extern char krb5_is_thread_safe(); + int +-main () ++main (void) + { + krb5_is_thread_safe() + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_link "$LINENO"; then : ++if ac_fn_c_try_link "$LINENO" ++then : + +- smart_lib="-lkrb5" +- smart_ldflags="-L$try -Wl,-rpath,$try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_lib="-lkrb5" ++ smart_ldflags="-L$try -Wl,-rpath,$try" ++ smart_ld_found="$try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break ++ ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +- done +- LIBS="$old_LIBS" +- CPPFLAGS="$old_CPPFLAGS" ++done ++LIBS="$old_LIBS" ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_lib" != "x"; then +- eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" +- LIBS="$smart_ldflags $smart_lib $old_LIBS" +- SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" ++LIBS="$smart_ldflags $smart_lib $old_LIBS" ++SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS" ++SMART_LD_FOUND="$smart_ld_found" + fi + +- if test "x$ac_cv_lib_krb5_krb5_is_thread_safe" = xyes; then +- if test "$cross_compiling" = yes; then : +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "cannot run test program while cross compiling +-See \`config.log' for more details" "$LINENO" 5; } +-else ++ if test "x$ac_cv_lib_krb5_krb5_is_thread_safe" = xyes; then ++ if test "$cross_compiling" = yes ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5 ++printf "%s\n" "$as_me: WARNING: cross compiling: not checking" >&2;} ++else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + int +-main () ++main (void) + { + return krb5_is_thread_safe() ? 0 : 1 + ; + return 0; + } + _ACEOF +-if ac_fn_c_try_run "$LINENO"; then : ++if ac_fn_c_try_run "$LINENO" ++then : + krb5threadsafe="-DKRB5_IS_THREAD_SAFE" +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libkrb5 is not threadsafe" >&5 +-$as_echo "$as_me: WARNING: libkrb5 is not threadsafe" >&2;} ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libkrb5 is not threadsafe" >&5 ++printf "%s\n" "$as_me: WARNING: libkrb5 is not threadsafe" >&2;} + fi + rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +- fi +- else +- krb5threadsafe="" + fi ++else ++ krb5threadsafe="" ++fi + +- if test "$krb5_api_type" = "mit"; then ++if test "$krb5_api_type" = "mit"; then + + + ac_safe=`echo "com_err.h" | sed 'y%./+-%__pm%'` ++ ++if test "x" = "x"; then ++ sm_pkg=`echo "${ac_safe}" | sed 's/.h//;s/^lib//'` ++else ++ sm_pkg="" ++fi ++ + old_CPPFLAGS="$CPPFLAGS" +-smart_include= +-smart_include_dir="/usr/local/include /opt/include" ++smart_include_dir="/usr/local/include /opt/include /usr/local/${sm_pkg}/include /opt/homebrew/include /opt/homebrew/opt/${sm_pkg}/include" + + _smart_try_dir= + _smart_include_dir= + + for _prefix in $smart_prefix ""; do +- for _dir in $smart_try_dir; do +- _smart_try_dir="${_smart_try_dir} ${_dir}/${_prefix}" +- done ++for _dir in $smart_try_dir; do ++ _smart_try_dir="${_smart_try_dir} ${_dir}/${_prefix}" ++done + +- for _dir in $smart_include_dir; do +- _smart_include_dir="${_smart_include_dir} ${_dir}/${_prefix}" +- done ++for _dir in $smart_include_dir; do ++ _smart_include_dir="${_smart_include_dir} ${_dir}/${_prefix}" ++done + done + + if test "x$_smart_try_dir" != "x"; then +- for try in $_smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err.h in $try" >&5 +-$as_echo_n "checking for com_err.h in $try... " >&6; } +- CPPFLAGS="-isystem $try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $_smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for com_err.h in $try" >&5 ++printf %s "checking for com_err.h in $try... " >&6; } ++ CPPFLAGS="-isystem $try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem $try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem $try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done +- CPPFLAGS="$old_CPPFLAGS" ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_include" = "x"; then +- for _prefix in $smart_prefix; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/com_err.h" >&5 +-$as_echo_n "checking for ${_prefix}/com_err.h... " >&6; } ++for _prefix in $smart_prefix; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/com_err.h" >&5 ++printf %s "checking for ${_prefix}/com_err.h... " >&6; } + +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem ${_prefix}/" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem ${_prefix}/" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done + fi + + if test "x$smart_include" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err.h" >&5 +-$as_echo_n "checking for com_err.h... " >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for com_err.h" >&5 ++printf %s "checking for com_err.h... " >&6; } + +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include=" " +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include=" " ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + if test "x$smart_include" = "x"; then ++for try in $_smart_include_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for com_err.h in $try" >&5 ++printf %s "checking for com_err.h in $try... " >&6; } ++ CPPFLAGS="-isystem $try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ + +- for prefix in $smart_prefix; do +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file="${_prefix}/${1}" +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$_smart_include_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "_smart_include_dir=\"\$_smart_include_dir $DIRS\"" +- +- done +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=com_err.h +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi + +- already=`echo \$_smart_include_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi ++ #include + +-eval "_smart_include_dir=\"\$_smart_include_dir $DIRS\"" ++int ++main (void) ++{ + ++ int a = 1; + +- for try in $_smart_include_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err.h in $try" >&5 +-$as_echo_n "checking for com_err.h in $try... " >&6; } +- CPPFLAGS="-isystem $try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ + +- #include +-int +-main () +-{ +-int a = 1; + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem $try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem $try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done +- CPPFLAGS="$old_CPPFLAGS" ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_include" != "x"; then +- eval "ac_cv_header_$ac_safe=yes" +- CPPFLAGS="$smart_include $old_CPPFLAGS" +- SMART_CPPFLAGS="$smart_include $SMART_CPPFLAGS" ++eval "ac_cv_header_$ac_safe=yes" ++CPPFLAGS="$smart_include $old_CPPFLAGS" ++SMART_CPPFLAGS="$smart_include $SMART_CPPFLAGS" + fi + + smart_prefix= + +- if test "$ac_cv_header_com_err_h" != "yes"; then ++ if test "$ac_cv_header_com_err_h" != "yes"; then + + + ac_safe=`echo "et/com_err.h" | sed 'y%./+-%__pm%'` ++ ++if test "x" = "x"; then ++ sm_pkg=`echo "${ac_safe}" | sed 's/.h//;s/^lib//'` ++else ++ sm_pkg="" ++fi ++ + old_CPPFLAGS="$CPPFLAGS" +-smart_include= +-smart_include_dir="/usr/local/include /opt/include" ++smart_include_dir="/usr/local/include /opt/include /usr/local/${sm_pkg}/include /opt/homebrew/include /opt/homebrew/opt/${sm_pkg}/include" + + _smart_try_dir= + _smart_include_dir= + + for _prefix in $smart_prefix ""; do +- for _dir in $smart_try_dir; do +- _smart_try_dir="${_smart_try_dir} ${_dir}/${_prefix}" +- done ++for _dir in $smart_try_dir; do ++ _smart_try_dir="${_smart_try_dir} ${_dir}/${_prefix}" ++done + +- for _dir in $smart_include_dir; do +- _smart_include_dir="${_smart_include_dir} ${_dir}/${_prefix}" +- done ++for _dir in $smart_include_dir; do ++ _smart_include_dir="${_smart_include_dir} ${_dir}/${_prefix}" ++done + done + + if test "x$_smart_try_dir" != "x"; then +- for try in $_smart_try_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for et/com_err.h in $try" >&5 +-$as_echo_n "checking for et/com_err.h in $try... " >&6; } +- CPPFLAGS="-isystem $try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++for try in $_smart_try_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for et/com_err.h in $try" >&5 ++printf %s "checking for et/com_err.h in $try... " >&6; } ++ CPPFLAGS="-isystem $try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem $try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem $try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done +- CPPFLAGS="$old_CPPFLAGS" ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_include" = "x"; then +- for _prefix in $smart_prefix; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/et/com_err.h" >&5 +-$as_echo_n "checking for ${_prefix}/et/com_err.h... " >&6; } ++for _prefix in $smart_prefix; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/et/com_err.h" >&5 ++printf %s "checking for ${_prefix}/et/com_err.h... " >&6; } + +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem ${_prefix}/" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem ${_prefix}/" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done + fi + + if test "x$smart_include" = "x"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for et/com_err.h" >&5 +-$as_echo_n "checking for et/com_err.h... " >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for et/com_err.h" >&5 ++printf %s "checking for et/com_err.h... " >&6; } + +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +- #include ++ ++ #include ++ + int +-main () ++main (void) + { +-int a = 1; ++ ++ int a = 1; ++ ++ + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include=" " +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include=" " ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + if test "x$smart_include" = "x"; then ++for try in $_smart_include_dir; do ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for et/com_err.h in $try" >&5 ++printf %s "checking for et/com_err.h in $try... " >&6; } ++ CPPFLAGS="-isystem $try $old_CPPFLAGS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ + +- for prefix in $smart_prefix; do +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file="${_prefix}/${1}" +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi +- +- already=`echo \$_smart_include_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi +- +-eval "_smart_include_dir=\"\$_smart_include_dir $DIRS\"" +- +- done +- +- +-if test "x$LOCATE" != "x"; then +- DIRS= +- file=et/com_err.h +- +- for x in `${LOCATE} $file 2>/dev/null`; do +- base=`echo $x | sed "s%/${file}%%"` +- if test "x$x" = "x$base"; then +- continue; +- fi +- +- dir=`${DIRNAME} $x 2>/dev/null` +- exclude=`echo ${dir} | ${GREP} /home` +- if test "x$exclude" != "x"; then +- continue +- fi + +- already=`echo \$_smart_include_dir ${DIRS} | ${GREP} ${dir}` +- if test "x$already" = "x"; then +- DIRS="$DIRS $dir" +- fi +- done +-fi ++ #include + +-eval "_smart_include_dir=\"\$_smart_include_dir $DIRS\"" ++int ++main (void) ++{ + ++ int a = 1; + +- for try in $_smart_include_dir; do +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for et/com_err.h in $try" >&5 +-$as_echo_n "checking for et/com_err.h in $try... " >&6; } +- CPPFLAGS="-isystem $try $old_CPPFLAGS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ + +- #include +-int +-main () +-{ +-int a = 1; + ; + return 0; + } ++ + _ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : ++if ac_fn_c_try_compile "$LINENO" ++then : + +- smart_include="-isystem $try" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- break ++ smart_include="-isystem $try" ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++ break + +-else ++else $as_nop + +- smart_include= +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ smart_include= ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- done +- CPPFLAGS="$old_CPPFLAGS" ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++done ++CPPFLAGS="$old_CPPFLAGS" + fi + + if test "x$smart_include" != "x"; then +- eval "ac_cv_header_$ac_safe=yes" +- CPPFLAGS="$smart_include $old_CPPFLAGS" +- SMART_CPPFLAGS="$smart_include $SMART_CPPFLAGS" ++eval "ac_cv_header_$ac_safe=yes" ++CPPFLAGS="$smart_include $old_CPPFLAGS" ++SMART_CPPFLAGS="$smart_include $SMART_CPPFLAGS" + fi + + smart_prefix= + +- if test "$ac_cv_header_et_com_err_h" != "yes"; then +- fail="$fail com_err.h" +- else +- krb5mod_cflags="$krb5mod_cflags -DET_COMM_ERR " +- fi ++ if test "$ac_cv_header_et_com_err_h" != "yes"; then ++ ++fail="$fail com_err.h" ++ ++ else ++ krb5mod_cflags="$krb5mod_cflags -DET_COMM_ERR " + fi +- else +- krb5mod_cflags="$krb5mod_cflags -DHEIMDAL_KRB5" + fi ++else ++ krb5mod_cflags="$krb5mod_cflags -DHEIMDAL_KRB5" ++fi ++ ++ + targetname=rlm_krb5 + else + targetname= + echo \*\*\* module rlm_krb5 is disabled. ++ ++ ++fr_status="disabled" ++ + fi + + if test x"$fail" != x""; then ++ targetname="" ++ ++ + if test x"${enable_strict_dependencies}" = x"yes"; then + as_fn_error $? "set --without-rlm_krb5 to disable it explicitly." "$LINENO" 5 + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: silently not building rlm_krb5." >&5 +-$as_echo "$as_me: WARNING: silently not building rlm_krb5." >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: FAILURE: rlm_krb5 requires: $fail." >&5 +-$as_echo "$as_me: WARNING: FAILURE: rlm_krb5 requires: $fail." >&2;}; +- targetname="" ++ ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: silently not building rlm_krb5." >&5 ++printf "%s\n" "$as_me: WARNING: silently not building rlm_krb5." >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: FAILURE: rlm_krb5 requires: $fail." >&5 ++printf "%s\n" "$as_me: WARNING: FAILURE: rlm_krb5 requires: $fail." >&2;}; ++ fail="$(echo $fail)" ++ ++ ++fr_status="skipping (requires $fail)" ++ ++ fr_features= ++ + fi ++ ++else ++ ++ ++fr_status="OK" ++ + fi + +-mod_ldflags="$krb5mod_ldflags $krb5libcrypto $SMART_LIBS" +-mod_cflags="$krb5mod_cflags $krb5threadsafe $SMART_CPPFLAGS" ++if test x"$fr_features" = x""; then ++ $as_echo "$fr_status" > "config.report" ++else ++ $as_echo_n "$fr_status ... " > "config.report" ++ cat "config.report.tmp" >> "config.report" ++fi + ++rm "config.report.tmp" + + + + +- unset ac_cv_env_LIBS_set +- unset ac_cv_env_LIBS_value ++mod_ldflags="$krb5mod_ldflags $krb5libcrypto $SMART_LIBS" ++mod_cflags="$krb5mod_cflags $krb5threadsafe $SMART_CPPFLAGS" + +- ac_config_files="$ac_config_files all.mk" ++ ++ ++ ++ac_config_files="$ac_config_files all.mk" + + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure +@@ -4863,8 +5169,8 @@ _ACEOF + 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;} ;; ++ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 ++printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( +@@ -4894,15 +5200,15 @@ $as_echo "$as_me: WARNING: cache variabl + /^ac_cv_env_/b end + t clear + :clear +- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ ++ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + 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 + if test "x$cache_file" != "x/dev/null"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +-$as_echo "$as_me: updating cache $cache_file" >&6;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 ++printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else +@@ -4916,8 +5222,8 @@ $as_echo "$as_me: updating cache $cache_ + fi + fi + 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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 ++printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi + fi + rm -f confcache +@@ -4970,7 +5276,7 @@ U= + 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"` ++ ac_i=`printf "%s\n" "$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" +@@ -4986,8 +5292,8 @@ LTLIBOBJS=$ac_ltlibobjs + 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;} ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 ++printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} + as_write_fail=0 + cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 + #! $SHELL +@@ -5010,14 +5316,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_wri + + # Be more Bourne compatible + DUALCASE=1; export DUALCASE # for MKS sh +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : ++as_nop=: ++if test ${ZSH_VERSION+y} && (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 ++else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( +@@ -5027,46 +5335,46 @@ esac + fi + + ++ ++# Reset variables that may have inherited troublesome values from ++# the environment. ++ ++# IFS needs to be set, to space, tab, and newline, in precisely that order. ++# (If _AS_PATH_WALK were called with IFS unset, it would have the ++# side effect of setting IFS to empty, thus disabling word splitting.) ++# Quoting is to prevent editors from complaining about space-tab. + 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 ++IFS=" "" $as_nl" ++ ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# Ensure predictable behavior from utilities with locale-dependent output. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# We cannot yet rely on "unset" to work, but we need these variables ++# to be unset--not just set to an empty or harmless value--now, to ++# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct ++# also avoids known problems related to "unset" and subshell syntax ++# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). ++for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH ++do eval test \${$as_var+y} \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : ++done ++ ++# Ensure that fds 0, 1, and 2 are open. ++if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi ++if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + + # The user is always right. +-if test "${PATH_SEPARATOR+set}" != set; then ++if ${PATH_SEPARATOR+false} :; 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 || +@@ -5075,13 +5383,6 @@ if test "${PATH_SEPARATOR+set}" != set; + 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. + as_myself= + case $0 in #(( +@@ -5090,8 +5391,12 @@ case $0 in #(( + 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 ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done + IFS=$as_save_IFS + +@@ -5103,30 +5408,10 @@ 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 ++ printf "%s\n" "$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 STATUS ERROR [LINENO LOG_FD] +@@ -5139,13 +5424,14 @@ as_fn_error () + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi +- $as_echo "$as_me: error: $2" >&2 ++ printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status + } # as_fn_error + + ++ + # as_fn_set_status STATUS + # ----------------------- + # Set $? to STATUS, without forking. +@@ -5172,18 +5458,20 @@ 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 : ++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 ++else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 +@@ -5195,12 +5483,13 @@ fi # as_fn_append + # 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 : ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null ++then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +-else ++else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` +@@ -5231,7 +5520,7 @@ as_me=`$as_basename -- "$0" || + $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X/"$0" | ++printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q +@@ -5253,6 +5542,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE + as_cr_digits='0123456789' + as_cr_alnum=$as_cr_Letters$as_cr_digits + ++ ++# Determine whether it's possible to make 'echo' print without a newline. ++# These variables are no longer used directly by Autoconf, but are AC_SUBSTed ++# for compatibility with existing Makefiles. + ECHO_C= ECHO_N= ECHO_T= + case `echo -n x` in #((((( + -n*) +@@ -5266,6 +5559,12 @@ case `echo -n x` in #((((( + ECHO_N='-n';; + esac + ++# For backward compatibility with old third-party macros, we provide ++# the shell variables $as_echo and $as_echo_n. New code should use ++# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. ++as_echo='printf %s\n' ++as_echo_n='printf %s' ++ + rm -f conf$$ conf$$.exe conf$$.file + if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +@@ -5307,7 +5606,7 @@ as_fn_mkdir_p () + as_dirs= + while :; do + case $as_dir in #( +- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" +@@ -5316,7 +5615,7 @@ $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" | ++printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -5379,7 +5678,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri + # values after options handling. + ac_log=" + This file was extended by $as_me, which was +-generated by GNU Autoconf 2.69. Invocation command line was ++generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -5428,14 +5727,16 @@ $config_files + Report bugs to the package provider." + + _ACEOF ++ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ++ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ++ac_cs_config='$ac_cs_config_escaped' + ac_cs_version="\\ + config.status +-configured by $0, generated by GNU Autoconf 2.69, ++configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +-Copyright (C) 2012 Free Software Foundation, Inc. ++Copyright (C) 2021 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + +@@ -5472,21 +5773,21 @@ do + -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 ;; ++ printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) +- $as_echo "$ac_cs_config"; exit ;; ++ printf "%s\n" "$ac_cs_config"; 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"` ;; ++ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) +- $as_echo "$ac_cs_usage"; exit ;; ++ printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; +@@ -5514,7 +5815,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ + 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 ++ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +@@ -5528,7 +5829,7 @@ exec 5>>config.log + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX + ## Running $as_me. ## + _ASBOX +- $as_echo "$ac_log" ++ printf "%s\n" "$ac_log" + } >&5 + + _ACEOF +@@ -5553,7 +5854,7 @@ done + # 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_FILES+y} || CONFIG_FILES=$config_files + fi + + # Have a temporary directory for convenience. Make it in the build tree +@@ -5781,7 +6082,7 @@ do + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac +- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ++ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + +@@ -5789,17 +6090,17 @@ do + # 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' ++ printf "%s\n" "$*" | 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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 ++printf "%s\n" "$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" | ++ ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac +@@ -5816,7 +6117,7 @@ $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" | ++printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -5840,9 +6141,9 @@ $as_echo X"$ac_file" | + case "$ac_dir" in + .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) +- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` ++ ac_dir_suffix=/`printf "%s\n" "$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|/||'` ++ ac_top_builddir_sub=`printf "%s\n" "$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/ ;; +@@ -5895,8 +6196,8 @@ ac_sed_dataroot=' + 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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 ++printf "%s\n" "$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=' +@@ -5938,9 +6239,9 @@ test -z "$ac_datarootdir_hack$ac_dataroo + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' ++ { printf "%s\n" "$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' ++printf "%s\n" "$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 "$ac_tmp/stdin" +@@ -5987,8 +6288,8 @@ if test "$no_create" != yes; then + $ac_cs_success || as_fn_exit 1 + 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;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 ++printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + fi + + +--- a/src/modules/rlm_krb5/configure.ac ++++ b/src/modules/rlm_krb5/configure.ac +@@ -1,187 +1,178 @@ +-AC_PREREQ([2.53]) +-AC_INIT(rlm_krb5.c) ++AC_PREREQ([2.71]) ++AC_INIT ++AC_CONFIG_SRCDIR([rlm_krb5.c]) + AC_REVISION($Revision$) +-AC_DEFUN(modname,[rlm_krb5]) ++FR_INIT_MODULE([rlm_krb5], [Kerberos support]) + +-AC_ARG_WITH([]modname, +-[ --with-[]modname build []modname. (default=yes)]) ++FR_MODULE_START_TESTS + +-if test x$with_[]modname != xno; then ++AC_PROG_CC ++AC_PROG_CPP + +- AC_PROG_CC +- AC_PROG_CPP +- +- dnl extra argument: --with-rlm-krb5-dir +- rlm_krb5_dir= +- AC_ARG_WITH(rlm-krb5-dir, +- [ --with-rlm-krb5-dir=DIR Directory for krb5 files []], +- [ case "$withval" in +- no) ++dnl extra argument: --with-rlm-krb5-dir ++rlm_krb5_dir= ++AC_ARG_WITH(rlm-krb5-dir, ++ [AS_HELP_STRING([--with-rlm-krb5-dir=DIR], ++ [directory where krb5 files are installed])], ++ [case "$withval" in ++ no) + AC_MSG_ERROR(Need rlm-krb5-dir) + ;; +- yes) ++ yes) + ;; +- *) ++ *) + rlm_krb5_dir="$withval" + ;; +- esac ] +- ) ++ esac]) + +- AC_PATH_PROG(krb5_config, krb5-config, not-found, [${rlm_krb5_dir}/bin:${PATH}:/usr/bin:/usr/local/bin]) +- dnl # +- dnl # If we can find krb5-config we can get the version of the library and determine +- dnl # whether it's safe to enable threading. +- dnl # +- if test "$krb5_config" != 'not-found'; then +- AC_MSG_CHECKING([krb5-config CFLAGS]) +- SMART_CPPFLAGS=$($krb5_config --cflags) +- SMART_CPPFLAGS=[$(echo "$SMART_CPPFLAGS" | sed 's/-I[ ]*/-isystem /g')] +- AC_MSG_RESULT("$SMART_CPPFLAGS") +- +- AC_MSG_CHECKING([krb5-config LDFLAGS]) +- SMART_LIBS=$($krb5_config --libs) +- AC_MSG_RESULT(${SMART_LIBS}) +- +- AC_MSG_CHECKING([krb5-config reported version]) +- krb5_version_raw=$($krb5_config --version) +- +- dnl # AWK originally from from https://github.com/hpc/lustre +- krb5_version=$(echo "$krb5_version_raw" | head -n 1 | \ +- awk '{split($(4),v,"."); if (v@<:@"3"@:>@ = "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }') +- AC_MSG_RESULT([${krb5_version_raw} ($krb5_version)]) +- +- AC_MSG_CHECKING([krb5-config reported vendor]) +- krb5_vendor=$($krb5_config --vendor) +- AC_MSG_RESULT([${krb5_vendor}]) +- +- AC_MSG_CHECKING([canonical API type]) +- if test "$krb5_vendor" = "Massachusetts Institute of Technology" || \ +- echo "$krb5_vendor" | grep -i 'MIT' > /dev/null 2>&1 || \ +- echo "$krb5_version_raw" | grep -i 'MIT' > /dev/null 2>&1 ; then +- AC_MSG_RESULT([MIT]) +- krb5_api_type='mit' +- else +- AC_MSG_RESULT([HEIMDAL]) +- krb5_api_type='heimdal' +- fi ++AC_PATH_PROG(krb5_config, krb5-config, not-found, [${rlm_krb5_dir}/bin:${PATH}:/usr/bin:/usr/local/bin]) ++dnl # ++dnl # If we can find krb5-config we can get the version of the library and determine ++dnl # whether it's safe to enable threading. ++dnl # ++if test "$krb5_config" != 'not-found'; then ++ AC_MSG_CHECKING([krb5-config CFLAGS]) ++ SMART_CPPFLAGS=$($krb5_config --cflags) ++ SMART_CPPFLAGS=[$(echo "$SMART_CPPFLAGS" | sed 's/-I[ ]*/-isystem /g')] ++ AC_MSG_RESULT("$SMART_CPPFLAGS") ++ ++ AC_MSG_CHECKING([krb5-config LDFLAGS]) ++ SMART_LIBS=$($krb5_config --libs) ++ AC_MSG_RESULT(${SMART_LIBS}) ++ ++ AC_MSG_CHECKING([krb5-config reported version]) ++ krb5_version_raw=$($krb5_config --version) ++ ++ dnl # AWK originally from from https://github.com/hpc/lustre ++ krb5_version=$(echo "$krb5_version_raw" | head -n 1 | \ ++ awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }') ++ AC_MSG_RESULT([${krb5_version_raw} ($krb5_version)]) ++ ++ AC_MSG_CHECKING([krb5-config reported vendor]) ++ krb5_vendor=$($krb5_config --vendor) ++ AC_MSG_RESULT([${krb5_vendor}]) ++ ++ AC_MSG_CHECKING([canonical API type]) ++ if test "$krb5_vendor" = "Massachusetts Institute of Technology" || \ ++ echo "$krb5_vendor" | grep -i 'MIT' > /dev/null 2>&1 || \ ++ echo "$krb5_version_raw" | grep -i 'MIT' > /dev/null 2>&1 ; then ++ AC_MSG_RESULT([MIT]) ++ krb5_api_type='mit' + else +- smart_try_dir="$rlm_krb5_dir/include" +- FR_SMART_CHECK_INCLUDE(krb5.h) +- if test "$ac_cv_header_krb5_h" != "yes"; then +- fail="$fail krb5.h" +- fi +- +- krb5libcrypto= +- smart_try_dir="$rlm_krb5_dir/lib" +- FR_SMART_CHECK_LIB(k5crypto, krb5_encrypt_data) +- if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = xyes; then +- krb5libcrypto="-lk5crypto" +- fi +- +- if test "x$krb5libcrypto" = x; then +- FR_SMART_CHECK_LIB(crypto, DH_new) +- if test "x$ac_cv_lib_crypto_DH_new" = xyes; then +- krb5libcrypto="-lcrypto" +- fi +- fi +- +- if test "x$krb5libcrypto" = x; then +- AC_MSG_WARN([neither krb5 'k5crypto' nor 'crypto' libraries are found!]) +- fi +- +- FR_SMART_CHECK_LIB(com_err, set_com_err_hook) +- if test "x$ac_cv_lib_com_err_set_com_err_hook" != xyes; then +- AC_MSG_WARN([the comm_err library isn't found!]) +- fi ++ AC_MSG_RESULT([HEIMDAL]) ++ krb5_api_type='heimdal' ++ fi ++else ++ smart_try_dir="$rlm_krb5_dir/include" ++ FR_SMART_CHECK_INCLUDE(krb5.h) ++ if test "$ac_cv_header_krb5_h" != "yes"; then ++ FR_MODULE_FAIL([krb5.h]) ++ fi + +- dnl # +- dnl # Only the heimdal version of the library has this function +- dnl # +- FR_SMART_CHECK_LIB(krb5, krb5_verify_user_opt) +- if test "x$ac_cv_lib_krb5_krb5_verify_user_opt" = xyes; then +- krb5_api_type='heimdal' +- else +- krb5_api_type='mit' ++ krb5libcrypto= ++ smart_try_dir="$rlm_krb5_dir/lib" ++ FR_SMART_CHECK_LIB(k5crypto, krb5_encrypt_data) ++ if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = xyes; then ++ krb5libcrypto="-lk5crypto" ++ fi + +- FR_SMART_CHECK_LIB(krb5, krb5_get_init_creds_password) +- if test "x$ac_cv_lib_krb5_krb5_get_init_creds_password" != xyes; then +- fail="$fail krb5" +- fi ++ if test "x$krb5libcrypto" = x; then ++ FR_SMART_CHECK_LIB(crypto, DH_new) ++ if test "x$ac_cv_lib_crypto_DH_new" = xyes; then ++ krb5libcrypto="-lcrypto" + fi +- + fi + +- dnl # +- dnl # Need to ensure the test program(s) link against the right library +- dnl # +- LDFLAGS="${LDFLAGS} ${SMART_LIBS}" +- CFLAGS="${CFLAGS} ${SMART_CPPFLAGS}" +- +- dnl # +- dnl # Check how to free things returned by krb5_get_error_message +- dnl # +- AC_CHECK_FUNCS([krb5_get_error_message krb5_free_error_string krb5_free_error_message]) +- if test "x$ac_cv_func_krb5_get_error_message" = xyes; then +- krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_GET_ERROR_MESSAGE" +- fi +- if test "x$ac_cv_func_krb5_free_error_message" = xyes; then +- krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_MESSAGE" ++ if test "x$krb5libcrypto" = x; then ++ AC_MSG_WARN([neither krb5 'k5crypto' nor 'crypto' libraries are found!]) + fi +- if test "x$ac_cv_func_krb5_free_error_string" = xyes; then +- krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_STRING" ++ ++ FR_SMART_CHECK_LIB(com_err, set_com_err_hook) ++ if test "x$ac_cv_lib_com_err_set_com_err_hook" != xyes; then ++ AC_MSG_WARN([the comm_err library isn't found!]) + fi + + dnl # +- dnl # Only check if version checks have not found kerberos to be thread unsafe ++ dnl # Only the heimdal version of the library has this function + dnl # +- if test "$krb5threadsafe" != "no"; then +- krb5threadsafe= ++ FR_SMART_CHECK_LIB(krb5, krb5_verify_user_opt) ++ if test "x$ac_cv_lib_krb5_krb5_verify_user_opt" = xyes; then ++ krb5_api_type='heimdal' ++ else ++ krb5_api_type='mit' + +- FR_SMART_CHECK_LIB(krb5, krb5_is_thread_safe) +- if test "x$ac_cv_lib_krb5_krb5_is_thread_safe" = xyes; then +- AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]], [[return krb5_is_thread_safe() ? 0 : 1]])], +- [krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])]) ++ FR_SMART_CHECK_LIB(krb5, krb5_get_init_creds_password) ++ if test "x$ac_cv_lib_krb5_krb5_get_init_creds_password" != xyes; then ++ FR_MODULE_FAIL([krb5]) + fi +- else +- krb5threadsafe="" + fi + +- if test "$krb5_api_type" = "mit"; then +- dnl # +- dnl # This lives in different places depending on the distro +- dnl # +- FR_SMART_CHECK_INCLUDE([com_err.h]) +- if test "$ac_cv_header_com_err_h" != "yes"; then +- FR_SMART_CHECK_INCLUDE([et/com_err.h]) +- if test "$ac_cv_header_et_com_err_h" != "yes"; then +- fail="$fail com_err.h" +- else +- krb5mod_cflags="$krb5mod_cflags -DET_COMM_ERR " +- fi +- fi +- else +- krb5mod_cflags="$krb5mod_cflags -DHEIMDAL_KRB5" ++fi ++ ++dnl # ++dnl # Need to ensure the test program(s) link against the right library ++dnl # ++LDFLAGS="${LDFLAGS} ${SMART_LIBS}" ++CFLAGS="${CFLAGS} ${SMART_CPPFLAGS}" ++ ++dnl # ++dnl # Check how to free things returned by krb5_get_error_message ++dnl # ++AC_CHECK_FUNCS(\ ++ krb5_get_error_message \ ++ krb5_free_error_string \ ++ krb5_free_error_message \ ++) ++if test "x$ac_cv_func_krb5_get_error_message" = xyes; then ++ krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_GET_ERROR_MESSAGE" ++fi ++if test "x$ac_cv_func_krb5_free_error_message" = xyes; then ++ krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_MESSAGE" ++fi ++if test "x$ac_cv_func_krb5_free_error_string" = xyes; then ++ krb5mod_cflags="${krb5mod_cflags} -DHAVE_KRB5_FREE_ERROR_STRING" ++fi ++ ++dnl # ++dnl # Only check if version checks have not found kerberos to be thread unsafe ++dnl # ++if test "$krb5threadsafe" != "no"; then ++ krb5threadsafe= ++ ++ FR_SMART_CHECK_LIB(krb5, krb5_is_thread_safe) ++ if test "x$ac_cv_lib_krb5_krb5_is_thread_safe" = xyes; then ++ AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]], [[return krb5_is_thread_safe() ? 0 : 1]])], ++ [krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])], ++ [AC_MSG_WARN(cross compiling: not checking)]) + fi +- targetname=modname + else +- targetname= +- echo \*\*\* module modname is disabled. ++ krb5threadsafe="" + fi + +-if test x"$fail" != x""; then +- if test x"${enable_strict_dependencies}" = x"yes"; then +- AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) +- else +- AC_MSG_WARN([silently not building ]modname[.]) +- AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); +- targetname="" ++if test "$krb5_api_type" = "mit"; then ++ dnl # ++ dnl # This lives in different places depending on the distro ++ dnl # ++ FR_SMART_CHECK_INCLUDE([com_err.h]) ++ if test "$ac_cv_header_com_err_h" != "yes"; then ++ FR_SMART_CHECK_INCLUDE([et/com_err.h]) ++ if test "$ac_cv_header_et_com_err_h" != "yes"; then ++ FR_MODULE_FAIL([com_err.h]) ++ else ++ krb5mod_cflags="$krb5mod_cflags -DET_COMM_ERR " ++ fi + fi ++else ++ krb5mod_cflags="$krb5mod_cflags -DHEIMDAL_KRB5" + fi + ++FR_MODULE_END_TESTS(strict) ++ + mod_ldflags="$krb5mod_ldflags $krb5libcrypto $SMART_LIBS" + mod_cflags="$krb5mod_cflags $krb5threadsafe $SMART_CPPFLAGS" + + AC_SUBST(mod_ldflags) + AC_SUBST(mod_cflags) +-AC_SUBST(targetname) +-AC_OUTPUT(all.mk) ++ ++AC_CONFIG_FILES([all.mk]) ++AC_OUTPUT diff --git a/net/iperf3-mt/Makefile b/net/iperf3-mt/Makefile deleted file mode 100644 index 42ff05635..000000000 --- a/net/iperf3-mt/Makefile +++ /dev/null @@ -1,104 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (C) 2023 Jonas Jelonek - -include $(TOPDIR)/rules.mk - -PKG_NAME:=iperf -PKG_VERSION:=3.15-mt-beta1 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/esnet/iperf/tar.gz/$(PKG_NAME)-$(PKG_VERSION)? -PKG_HASH:=4d5ad5bef9321adb832581a495c3cb1b5dec9d9678296f90bfc87166bbb7a43b - -PKG_MAINTAINER:=Jonas Jelonek -PKG_LICENSE:=BSD-3-Clause -PKG_CPE_ID:=cpe:/a:es:iperf3 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION) -PKG_BUILD_PARALLEL:=1 -PKG_INSTALL:=1 - -PKG_FIXUP:=autoreconf - -include $(INCLUDE_DIR)/package.mk - -DISABLE_NLS:= - -define Package/iperf3-mt/default - SECTION:=net - CATEGORY:=Network - TITLE:=iperf3 with multithreading - URL:=https://github.com/esnet/iperf - CONFLICTS:=iperf3 iperf3-ssl -endef - -define Package/iperf3-mt -$(call Package/iperf3-mt/default) - VARIANT:=nossl - DEPENDS:=+libiperf3-mt - CONFLICTS+=iperf3-mt-ssl -endef - -define Package/iperf3-mt-ssl -$(call Package/iperf3-mt/default) - TITLE+= and iperf_auth support - VARIANT:=ssl - DEPENDS:=+libopenssl +libatomic -endef - -define Package/libiperf3-mt - SECTION:=libs - CATEGORY:=Libraries - TITLE:=libiperf3 with multithreading - URL:=https://github.com/esnet/iperf - CONFLICTS:=libiperf3 - DEPENDS+=+libatomic -endef - -TARGET_CFLAGS += -D_GNU_SOURCE -TARGET_LDFLAGS += -latomic - -ifeq ($(BUILD_VARIANT),ssl) - CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --disable-shared -else - CONFIGURE_ARGS += --without-openssl -endif - -MAKE_FLAGS += noinst_PROGRAMS= - -define Package/iperf3-mt/description - iPerf3 is a modern alternative for measuring TCP and UDP bandwidth - performance, allowing the tuning of various parameters and - characteristics. - iperf3-mt has experimental multithreading support. -endef - -define Package/libiperf3-mt/description - Libiperf is a library providing an API for iperf3 functionality. -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.* $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ -endef - -define Package/iperf3-mt/install/Default - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ -endef - -Package/iperf3-mt/install = $(Package/iperf3-mt/install/Default) -Package/iperf3-mt-ssl/install = $(Package/iperf3-mt/install/Default) - -define Package/libiperf3-mt/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.so.* $(1)/usr/lib -endef - -$(eval $(call BuildPackage,iperf3-mt)) -$(eval $(call BuildPackage,iperf3-mt-ssl)) -$(eval $(call BuildPackage,libiperf3-mt)) diff --git a/net/iperf3/Makefile b/net/iperf3/Makefile index 2bd9275cb..41d8cb7e2 100644 --- a/net/iperf3/Makefile +++ b/net/iperf3/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=3.15 -PKG_RELEASE:=2 +PKG_VERSION:=3.16 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf -PKG_HASH:=bdb77c11f72bce90214883159577fa24412013e62b2083cf5f54391d79b1d8ff +PKG_HASH:=cc740c6bbea104398cc3e466befc515a25896ec85e44a662d5f4a767b9cf713e PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -45,7 +45,7 @@ define Package/iperf3-ssl $(call Package/iperf3/default) TITLE+= with iperf_auth support VARIANT:=ssl - DEPENDS:=+libopenssl + DEPENDS:=+libopenssl +libatomic CONFLICTS:=iperf3 endef @@ -54,9 +54,11 @@ define Package/libiperf3 CATEGORY:=Libraries TITLE:=Internet Protocol bandwidth measuring library URL:=https://github.com/esnet/iperf + DEPENDS+=+libatomic endef TARGET_CFLAGS += -D_GNU_SOURCE +TARGET_LDFLAGS += -latomic ifeq ($(BUILD_VARIANT),ssl) CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --disable-shared diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile index 56568f42b..d3b106e8e 100644 --- a/net/mosquitto/Makefile +++ b/net/mosquitto/Makefile @@ -9,17 +9,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mosquitto -PKG_VERSION:=2.0.17 +PKG_VERSION:=2.0.18 PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://mosquitto.org/files/source/ +PKG_HASH:=d665fe7d0032881b1371a47f34169ee4edab67903b2cd2b4c083822823f4448a + PKG_LICENSE:=EPL-2.0 PKG_LICENSE_FILES:=LICENSE.txt PKG_CPE_ID:=cpe:/a:eclipse:mosquitto -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://mosquitto.org/files/source/ -PKG_HASH:=3be7a911236567c1a9fbe25baf3e3167004ba4a0c151a448ef1f7fc077dba52f - include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk define Package/mosquitto/default SECTION:=net @@ -163,9 +165,9 @@ Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles) define Package/mosquitto/install/default $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mosquitto $(1)/usr/sbin $(INSTALL_DIR) $(1)/etc/mosquitto - $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/etc/mosquitto/mosquitto.conf $(1)/etc/mosquitto $(CP) ./files/* $(1)/ endef @@ -177,69 +179,69 @@ define Package/mosquitto-ssl/install $(call Package/mosquitto/install/default,$(1)) ifeq ($(CONFIG_MOSQUITTO_PASSWD),y) $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/apps/mosquitto_passwd/mosquitto_passwd $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_passwd $(1)/usr/bin endif ifeq ($(CONFIG_MOSQUITTO_DYNAMIC_SECURITY),y) $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/dynamic-security/mosquitto_dynamic_security.so $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mosquitto_dynamic_security.so $(1)/usr/lib endif endef define Package/mosquitto-client-nossl/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_rr $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_pub $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_sub $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_rr $(1)/usr/bin endef define Package/mosquitto-client-ssl/install $(call Package/mosquitto-client-nossl/install,$(1)) ifeq ($(CONFIG_MOSQUITTO_CTRL),y) - $(INSTALL_BIN) $(PKG_BUILD_DIR)/apps/mosquitto_ctrl/mosquitto_ctrl $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_ctrl $(1)/usr/bin endif endef # This installs files into ./staging_dir/. so that you can cross compile from the host define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include - $(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/ - $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/ - $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so - $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmosquitto.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmosquittopp.so* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_BUILD_DIR)/libmosquitto.pc.in $(1)/usr/lib/pkgconfig/libmosquitto.pc - sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \ - -e "s#@VERSION@#$(PKG_VERSION)#" \ - $(1)/usr/lib/pkgconfig/libmosquitto.pc - $(CP) $(PKG_BUILD_DIR)/libmosquittopp.pc.in $(1)/usr/lib/pkgconfig/libmosquittopp.pc - sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \ - -e "s#@VERSION@#$(PKG_VERSION)#" \ - $(1)/usr/lib/pkgconfig/libmosquittopp.pc + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig endef # This installs files on the target. Compare with Build/InstallDev define Package/libmosquitto-ssl/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/ - $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmosquitto.so.* $(1)/usr/lib/ endef Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install) define Package/libmosquittopp/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/ - $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmosquittopp.so.* $(1)/usr/lib/ endef # Applies to all... -MAKE_FLAGS += WITH_DOCS=no UNAME=Linux +CMAKE_OPTIONS += \ + -DDOCUMENTATION=OFF \ + -DWITH_ADNS=OFF \ + -DWITH_BUNDLED_DEPS=ON \ + -DWITH_DLT=OFF \ + -DWITH_PERSISTENCE=OFF \ + -DWITH_PIC=ON \ + -DWITH_SOCKS=ON \ + -DWITH_SRV=ON \ + -DWITH_SYSTEMD=OFF \ + -DWITH_SYS_TREE=OFF \ + -DWITH_THREADING=ON + ifeq ($(BUILD_VARIANT),nossl) - MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no + CMAKE_OPTIONS += -DWITH_TLS=OFF -DWITH_WEBSOCKETS=OFF else - MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no") - MAKE_FLAGS += WITH_TLS_PSK=$(if $(CONFIG_OPENSSL_WITH_PSK),"yes","no") + CMAKE_OPTIONS += -DWITH_TLS_PSK=O$(if $(CONFIG_OPENSSL_WITH_PSK),N,FF) + CMAKE_OPTIONS += -DWITH_WEBSOCKETS=O$(if $(CONFIG_MOSQUITTO_LWS),N,FF) endif $(eval $(call BuildPackage,mosquitto-ssl)) diff --git a/net/netavark/Makefile b/net/netavark/Makefile index da04a5e9d..84d7092ae 100644 --- a/net/netavark/Makefile +++ b/net/netavark/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netavark -PKG_VERSION:=1.8.0 +PKG_VERSION:=1.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/containers/netavark/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=b1422ef6927458e9f80f7d322b751e29ab5d04d8ed6cb065baa82fa4291af10f +PKG_HASH:=9ec50b715ded0a0699134c001656fdd1411e3fb5325d347695c6cb8cc5fcf572 PKG_MAINTAINER:=Oskari Rauta PKG_LICENSE:=Apache-2.0 diff --git a/net/netbird/Makefile b/net/netbird/Makefile index 606f16c51..d6ee0ce30 100644 --- a/net/netbird/Makefile +++ b/net/netbird/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netbird -PKG_VERSION:=0.24.2 +PKG_VERSION:=0.24.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/netbirdio/netbird/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=7fd90c6004c7fde6393bd618e106410e708f2d84f7884055acda6b016be42858 +PKG_HASH:=6590034fe8a8dc215242bbd7706197beef67a63a099a45a30c436373c892aab0 PKG_MAINTAINER:=Oskari Rauta PKG_LICENSE:=BSD-3-Clause diff --git a/net/snort/Makefile b/net/snort/Makefile index 6afffec5c..66a8806cf 100644 --- a/net/snort/Makefile +++ b/net/snort/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=snort -PKG_VERSION:=2.9.19 -PKG_RELEASE:=2 +PKG_VERSION:=2.9.20 +PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=W. Michael Petullo @@ -18,7 +18,7 @@ PKG_CPE_ID:=cpe:/a:snort:snort PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.snort.org/downloads/archive/snort/ \ @SF/$(PKG_NAME) -PKG_HASH:=b12fc6db72afb58987a2bf1954b8f45bde02047c235513c7663857b9506369c7 +PKG_HASH:=29400e13f53b1831e0b8b10ec1224a1cbaa6dc1533a5322a20dd80bb84b4981c PKG_BUILD_DEPENDS:=libtirpc PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION) @@ -31,7 +31,7 @@ define Package/snort SUBMENU:=Firewall SECTION:=net CATEGORY:=Network - DEPENDS:=+libdaq +libdnet +libnghttp2 +libopenssl +libpcap +libpcre +libpthread +libtirpc +libuuid +zlib @HAS_LUAJIT_ARCH +luajit +SNORT_LZMA:liblzma + DEPENDS:=+libdaq +libdnet +libnghttp2 +libopenssl +libpcap +libpcre2 +libpthread +libtirpc +libuuid +zlib @HAS_LUAJIT_ARCH +luajit +SNORT_LZMA:liblzma TITLE:=Lightweight Network Intrusion Detection System URL:=http://www.snort.org/ CONFLICTS:=snort3 @@ -57,8 +57,8 @@ CONFIGURE_ARGS += \ --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \ --with-libpcap-includes="$(STAGING_DIR)/usr/include" \ --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \ - --with-libpcre-includes="$(STAGING_DIR)/usr/include" \ - --with-libpcre-libraries="$(STAGING_DIR)/usr/lib" \ + --with-libpcre2-includes="$(STAGING_DIR)/usr/include" \ + --with-libpcre2-libraries="$(STAGING_DIR)/usr/lib" \ --with-daq-includes="$(STAGING_DIR)/usr/include/daq2" \ --with-daq-libraries="$(STAGING_DIR)/usr/lib/daq2" \ --disable-static-daq diff --git a/net/snort/patches/900-Convert-project-to-PCRE2.patch b/net/snort/patches/900-Convert-project-to-PCRE2.patch new file mode 100644 index 000000000..4e01347af --- /dev/null +++ b/net/snort/patches/900-Convert-project-to-PCRE2.patch @@ -0,0 +1,2114 @@ +From 514af7b25f1f49d87963baf4fd057d9c85f518a7 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sat, 4 Nov 2023 01:30:37 +0100 +Subject: [PATCH] Convert project to PCRE2 + +Convert project to PCRE2. Convert every example to PCRE2. + +Due to API changes examples needs to be updated accordingly with the new +struct and API. + +The API name were voluntary changes to make sure the user of plugins is +aware of the change and manually refresh the plugin with new code. + +Most of the time it's just PcreMatch to Pcre2Match and PCREInfo to +PCRE2Info and the relative options (that are 1:1 compared to PCRE +library). + +For complex case where ovector extraction is needed, refer to example +36733 where new way with match data is used. Follow comments there for +additional info. + +Signed-off-by: Christian Marangi +--- + config.h.in | 8 +- + configure.in | 67 ++++---- + src/detection-plugins/sp_pcre.c | 149 +++++++++--------- + src/detection-plugins/sp_pcre.h | 9 +- + src/dynamic-plugins/sf_convert_dynamic.c | 59 ++++--- + src/dynamic-plugins/sf_dynamic_engine.h | 32 ++-- + src/dynamic-plugins/sf_dynamic_plugins.c | 109 +++++++------ + src/dynamic-plugins/sf_engine/examples/3036.c | 8 +- + src/dynamic-plugins/sf_engine/examples/3052.c | 8 +- + src/dynamic-plugins/sf_engine/examples/3099.c | 8 +- + .../sf_engine/examples/36733.c | 40 +++-- + src/dynamic-plugins/sf_engine/examples/3682.c | 11 +- + .../sf_engine/examples/bug31842.c | 9 +- + .../sf_engine/examples/bug35218.c | 15 +- + .../sf_engine/examples/sid1902.c | 9 +- + .../sf_engine/examples/sid2389.c | 9 +- + .../sf_engine/examples/sid9999.c | 2 +- + .../sf_engine/examples/web-client_test.c | 18 +-- + .../sf_engine/sf_snort_detection_engine.c | 20 +-- + .../sf_engine/sf_snort_detection_engine.h | 2 +- + .../sf_engine/sf_snort_plugin_api.c | 10 +- + .../sf_engine/sf_snort_plugin_api.h | 39 +++-- + .../sf_engine/sf_snort_plugin_pcre.c | 132 ++++++++++------ + .../appid/luaDetectorApi.c | 63 +++++--- + src/dynamic-preprocessors/imap/snort_imap.h | 6 +- + src/dynamic-preprocessors/pop/snort_pop.h | 3 +- + src/dynamic-preprocessors/smtp/snort_smtp.h | 3 +- + src/snort.c | 3 - + src/snort.h | 1 - + src/util.c | 9 +- + 30 files changed, 497 insertions(+), 364 deletions(-) + mode change 100755 => 100644 src/dynamic-plugins/sf_engine/sf_snort_plugin_api.h + mode change 100755 => 100644 src/dynamic-plugins/sf_engine/sf_snort_plugin_pcre.c + +--- a/config.h.in ++++ b/config.h.in +@@ -133,8 +133,8 @@ + /* Define to 1 if you have the `pcap' library (-lpcap). */ + #undef HAVE_LIBPCAP + +-/* Define to 1 if you have the `pcre' library (-lpcre). */ +-#undef HAVE_LIBPCRE ++/* Define to 1 if you have the `pcre2' library (-lpcre2-8). */ ++#undef HAVE_LIBPCRE2 + + /* Define to 1 if you have the `pfring' library (-lpfring). */ + #undef HAVE_LIBPFRING +@@ -190,8 +190,8 @@ + /* Can output the library version. */ + #undef HAVE_PCAP_LIB_VERSION + +-/* Define to 1 if you have the header file. */ +-#undef HAVE_PCRE_H ++/* Define to 1 if you have the header file. */ ++#undef HAVE_PCRE2_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_PFRING_H +--- a/configure.in ++++ b/configure.in +@@ -455,65 +455,70 @@ AC_DEFUN([FAIL_MESSAGE],[ + exit 1 + ]) + +-AC_ARG_WITH(libpcre_includes, +- [ --with-libpcre-includes=DIR libpcre include directory], +- [with_libpcre_includes="$withval"],[with_libpcre_includes="no"]) +- +-AC_ARG_WITH(libpcre_libraries, +- [ --with-libpcre-libraries=DIR libpcre library directory], +- [with_libpcre_libraries="$withval"],[with_libpcre_libraries="no"]) +- +-if test "x$with_libpcre_includes" != "xno"; then +- CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}" +- ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_libpcre_includes}" ++AC_ARG_WITH(libpcre2_includes, ++ [ --with-libpcre2-includes=DIR libpcre2 include directory], ++ [with_libpcre2_includes="$withval"],[with_libpcre2_includes="no"]) ++ ++AC_ARG_WITH(libpcre2_libraries, ++ [ --with-libpcre2-libraries=DIR libpcre2 library directory], ++ [with_libpcre2_libraries="$withval"],[with_libpcre2_libraries="no"]) ++ ++if test "x$with_libpcre2_includes" != "xno"; then ++ CPPFLAGS="${CPPFLAGS} -I${with_libpcre2_includes}" ++ ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_libpcre2_includes}" + else +- CPPFLAGS="${CPPFLAGS} `pcre-config --cflags`" ++ CPPFLAGS="${CPPFLAGS} `pcre2-config --cflags`" + fi + +-if test "x$with_libpcre_libraries" != "xno"; then +- LDFLAGS="${LDFLAGS} -L${with_libpcre_libraries}" ++if test "x$with_libpcre2_libraries" != "xno"; then ++ LDFLAGS="${LDFLAGS} -L${with_libpcre2_libraries}" + else +- LDFLAGS="${LDFLAGS} `pcre-config --libs`" ++ LDFLAGS="${LDFLAGS} `pcre2-config --libs8`" + fi + +-# PCRE configuration (required) ++# PCRE2 configuration (required) + # Verify that we have the headers +-PCRE_H="" +-AC_CHECK_HEADERS(pcre.h,, PCRE_H="no") +-if test "x$PCRE_H" = "xno"; then ++PCRE2_H="" ++AC_CHECK_HEADERS(pcre2.h,, PCRE2_H="no",[#define PCRE2_CODE_UNIT_WIDTH 8]) ++if test "x$PCRE2_H" = "xno"; then + echo +- echo " ERROR! Libpcre header not found." ++ echo " ERROR! Libpcre2 header not found." + echo " Get it from http://www.pcre.org" + exit 1 + fi + + # Verify that we have the library +-PCRE_L="" +-pcre_version_six="" +-AC_CHECK_LIB(pcre, pcre_compile, ,PCRE_L="no") ++PCRE2_L="" ++pcre2_version_six="" ++AC_CHECK_LIB(pcre2-8, pcre2_compile_8, ,PCRE2_L="no") + if test "x$PCRE_L" = "xno"; then + echo +- echo " ERROR! Libpcre library not found." ++ echo " ERROR! Libpcre2 library not found." + echo " Get it from http://www.pcre.org" + echo + exit 1 + else +- AC_MSG_CHECKING(for libpcre version 6.0 or greater) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ +- #if (PCRE_MAJOR < 6) ++ AC_MSG_CHECKING(for libpcre2 version 10.0 or greater) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ++ #define PCRE2_CODE_UNIT_WIDTH 8 ++ #include ++ ]], [[ ++ #if (PCRE2_MAJOR < 10) + #error "Version failure" + #else +- int a, b = 0, c = 0, d = 0; +- pcre *tmp = NULL; +- a = pcre_copy_named_substring(tmp, "", &b, c, "", "", d); ++ int a; ++ PCRE2_UCHAR b = { 0 }; ++ PCRE2_SIZE c; ++ pcre2_match_data *match_data = NULL; ++ a = pcre2_substring_copy_byname(match_data, (PCRE2_SPTR )"", &b, &c); + #endif +- ]])],[pcre_version_six="yes"],[pcre_version_six="no"]) ++ ]])],[pcre2_version_ten="yes"],[pcre2_version_ten="no"]) + fi + +-if test "x$pcre_version_six" != "xyes"; then ++if test "x$pcre2_version_ten" != "xyes"; then + AC_MSG_RESULT(no) + echo +- echo " ERROR! Libpcre library version >= 6.0 not found." ++ echo " ERROR! Libpcre2 library version >= 10.0 not found." + echo " Get it from http://www.pcre.org" + echo + exit 1 +--- a/src/detection-plugins/sp_pcre.c ++++ b/src/detection-plugins/sp_pcre.c +@@ -46,7 +46,8 @@ + + #include "sp_pcre.h" + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + + #include "snort.h" + #include "profiler.h" +@@ -60,7 +61,7 @@ extern PreprocStats ruleOTNEvalPerfStats + #include "detection_util.h" + + /* +- * we need to specify the vector length for our pcre_exec call. we only care ++ * we need to specify the vector length for our pcre2_match call. we only care + * about the first vector, which if the match is successful will include the + * offset to the end of the full pattern match. If we decide to store other + * matches, make *SURE* that this is a multiple of 3 as pcre requires it. +@@ -77,8 +78,8 @@ void PcreFree(void *d) + PcreData *data = (PcreData *)d; + + free(data->expression); +- free(data->re); +- free(data->pe); ++ pcre2_match_context_free(data->match_context); ++ pcre2_code_free(data->re); + free(data); + } + +@@ -161,7 +162,6 @@ void PcreDuplicatePcreData(void *src, Pc + pcre_dup->expression = pcre_src->expression; + pcre_dup->options = pcre_src->options; + pcre_dup->search_offset = 0; +- pcre_dup->pe = pcre_src->pe; + pcre_dup->re = pcre_src->re; + } + +@@ -197,7 +197,7 @@ static void Ovector_Init(struct _SnortCo + * configuraton, we won't pcre capture count again, so save the max. */ + static int s_ovector_max = 0; + +- /* The pcre_fullinfo() function can be used to find out how many ++ /* The pcre2_pattern_info() function can be used to find out how many + * capturing subpatterns there are in a compiled pattern. The + * smallest size for ovector that will allow for n captured + * substrings, in addition to the offsets of the substring matched +@@ -207,8 +207,6 @@ static void Ovector_Init(struct _SnortCo + + if (sc->pcre_ovector_size > s_ovector_max) + s_ovector_max = sc->pcre_ovector_size; +- +- sc->pcre_ovector = (int *) SnortAlloc(s_ovector_max*sizeof(int)); + } + + #if SNORT_RELOAD +@@ -218,12 +216,12 @@ static void Ovector_Reload(struct _Snort + } + #endif + +-void PcreCapture(struct _SnortConfig *sc, const void *code, const void *extra) ++void Pcre2Capture(struct _SnortConfig *sc, const void *code) + { + int tmp_ovector_size = 0; + +- pcre_fullinfo((const pcre *)code, (const pcre_extra *)extra, +- PCRE_INFO_CAPTURECOUNT, &tmp_ovector_size); ++ pcre2_pattern_info((const pcre2_code *)code, ++ PCRE2_INFO_CAPTURECOUNT, &tmp_ovector_size); + + if (tmp_ovector_size > sc->pcre_ovector_size) + sc->pcre_ovector_size = tmp_ovector_size; +@@ -268,10 +266,10 @@ void SnortPcreInit(struct _SnortConfig * + + if (pcre_data->expression) + free(pcre_data->expression); +- if (pcre_data->pe) +- free(pcre_data->pe); ++ if (pcre_data->match_context) ++ pcre2_match_context_free(pcre_data->match_context); + if (pcre_data->re) +- free(pcre_data->re); ++ pcre2_code_free(pcre_data->re); + + free(pcre_data); + pcre_data = pcre_dup; +@@ -305,11 +303,12 @@ static inline void ValidatePcreHttpConte + + void SnortPcreParse(struct _SnortConfig *sc, char *data, PcreData *pcre_data, OptTreeNode *otn) + { +- const char *error; ++ PCRE2_UCHAR error[128]; + char *re, *free_me; + char *opts; + char delimit = '/'; +- int erroffset; ++ int errorcode; ++ PCRE2_SIZE erroffset; + int compile_flags = 0; + unsigned http = 0; + +@@ -381,17 +380,17 @@ void SnortPcreParse(struct _SnortConfig + /* process any /regex/ismxR options */ + while(*opts != '\0') { + switch(*opts) { +- case 'i': compile_flags |= PCRE_CASELESS; break; +- case 's': compile_flags |= PCRE_DOTALL; break; +- case 'm': compile_flags |= PCRE_MULTILINE; break; +- case 'x': compile_flags |= PCRE_EXTENDED; break; ++ case 'i': compile_flags |= PCRE2_CASELESS; break; ++ case 's': compile_flags |= PCRE2_DOTALL; break; ++ case 'm': compile_flags |= PCRE2_MULTILINE; break; ++ case 'x': compile_flags |= PCRE2_EXTENDED; break; + + /* + * these are pcre specific... don't work with perl + */ +- case 'A': compile_flags |= PCRE_ANCHORED; break; +- case 'E': compile_flags |= PCRE_DOLLAR_ENDONLY; break; +- case 'G': compile_flags |= PCRE_UNGREEDY; break; ++ case 'A': compile_flags |= PCRE2_ANCHORED; break; ++ case 'E': compile_flags |= PCRE2_DOLLAR_ENDONLY; break; ++ case 'G': compile_flags |= PCRE2_UNGREEDY; break; + + /* + * these are snort specific don't work with pcre or perl +@@ -424,45 +423,37 @@ void SnortPcreParse(struct _SnortConfig + + /* now compile the re */ + DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre: compiling %s\n", re);); +- pcre_data->re = pcre_compile(re, compile_flags, &error, &erroffset, NULL); ++ pcre_data->re = pcre2_compile((PCRE2_SPTR)re, PCRE2_ZERO_TERMINATED, compile_flags, &errorcode, &erroffset, NULL); + + if(pcre_data->re == NULL) + { ++ pcre2_get_error_message(errorcode, error, 128); + FatalError("%s(%d) : pcre compile of \"%s\" failed at offset " +- "%d : %s\n", file_name, file_line, re, erroffset, error); ++ "%zu : %s\n", file_name, file_line, re, erroffset, error); + } + ++ /* now create match context */ ++ pcre_data->match_context = pcre2_match_context_create(NULL); ++ if(pcre_data->match_context == NULL) ++ { ++ FatalError("%s(%d) : failed to allocate memory for match context\n", ++ file_name, file_line); ++ } + + /* now study it... */ +- pcre_data->pe = pcre_study(pcre_data->re, 0, &error); ++ errorcode = pcre2_jit_compile(pcre_data->re, PCRE2_JIT_COMPLETE); + +- if (pcre_data->pe) ++ if (!errorcode) + { + if ((ScPcreMatchLimitNewConf(sc) != -1) && !(pcre_data->options & SNORT_OVERRIDE_MATCH_LIMIT)) + { +- if (pcre_data->pe->flags & PCRE_EXTRA_MATCH_LIMIT) +- { +- pcre_data->pe->match_limit = ScPcreMatchLimitNewConf(sc); +- } +- else +- { +- pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT; +- pcre_data->pe->match_limit = ScPcreMatchLimitNewConf(sc); +- } ++ pcre2_set_match_limit(pcre_data->match_context, ScPcreMatchLimitNewConf(sc)); + } + + #ifdef PCRE_EXTRA_MATCH_LIMIT_RECURSION + if ((ScPcreMatchLimitRecursionNewConf(sc) != -1) && !(pcre_data->options & SNORT_OVERRIDE_MATCH_LIMIT)) + { +- if (pcre_data->pe->flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) +- { +- pcre_data->pe->match_limit_recursion = ScPcreMatchLimitRecursionNewConf(sc); +- } +- else +- { +- pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; +- pcre_data->pe->match_limit_recursion = ScPcreMatchLimitRecursionNewConf(sc); +- } ++ pcre2_set_depth_limit(pcre_data->match_context, ScPcreMatchLimitRecursionNewConf(sc)); + } + #endif + } +@@ -471,30 +462,28 @@ void SnortPcreParse(struct _SnortConfig + if (!(pcre_data->options & SNORT_OVERRIDE_MATCH_LIMIT) && + ((ScPcreMatchLimitNewConf(sc) != -1) || (ScPcreMatchLimitRecursionNewConf(sc) != -1))) + { +- pcre_data->pe = (pcre_extra *)SnortAlloc(sizeof(pcre_extra)); + if (ScPcreMatchLimitNewConf(sc) != -1) + { +- pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT; +- pcre_data->pe->match_limit = ScPcreMatchLimitNewConf(sc); ++ pcre2_set_match_limit(pcre_data->match_context, ScPcreMatchLimitNewConf(sc)); + } + + #ifdef PCRE_EXTRA_MATCH_LIMIT_RECURSION + if (ScPcreMatchLimitRecursionNewConf(sc) != -1) + { +- pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; +- pcre_data->pe->match_limit_recursion = ScPcreMatchLimitRecursionNewConf(sc); ++ pcre2_set_depth_limit(pcre_data->match_context, ScPcreMatchLimitRecursionNewConf(sc)); + } + #endif + } + } + +- if(error != NULL) ++ if(errorcode) + { ++ pcre2_get_error_message(errorcode, error, 128); + FatalError("%s(%d) : pcre study failed : %s\n", file_name, + file_line, error); + } + +- PcreCapture(sc, pcre_data->re, pcre_data->pe); ++ Pcre2Capture(sc, pcre_data->re); + + PcreCheckAnchored(pcre_data); + +@@ -515,13 +504,13 @@ void PcreCheckAnchored(PcreData *pcre_da + int rc; + unsigned long int options = 0; + +- if ((pcre_data == NULL) || (pcre_data->re == NULL) || (pcre_data->pe == NULL)) ++ if ((pcre_data == NULL) || (pcre_data->re == NULL) || (pcre_data->match_context == NULL)) + return; + +- rc = pcre_fullinfo(pcre_data->re, pcre_data->pe, PCRE_INFO_OPTIONS, (void *)&options); ++ rc = pcre2_pattern_info(pcre_data->re, PCRE2_INFO_ARGOPTIONS, (void *)&options); + switch (rc) + { +- /* pcre_fullinfo fails for the following: ++ /* pcre2_pattern_info fails for the following: + * PCRE_ERROR_NULL - the argument code was NULL + * the argument where was NULL + * PCRE_ERROR_BADMAGIC - the "magic number" was not found +@@ -533,24 +522,24 @@ void PcreCheckAnchored(PcreData *pcre_da + /* This is the success code */ + break; + +- case PCRE_ERROR_NULL: +- FatalError("%s(%d) pcre_fullinfo: code and/or where were NULL.\n", ++ case PCRE2_ERROR_NULL: ++ FatalError("%s(%d) pcre2_pattern_info: code and/or where were NULL.\n", + __FILE__, __LINE__); + +- case PCRE_ERROR_BADMAGIC: +- FatalError("%s(%d) pcre_fullinfo: compiled code didn't have " ++ case PCRE2_ERROR_BADMAGIC: ++ FatalError("%s(%d) pcre2_pattern_info: compiled code didn't have " + "correct magic.\n", __FILE__, __LINE__); + +- case PCRE_ERROR_BADOPTION: +- FatalError("%s(%d) pcre_fullinfo: option type is invalid.\n", ++ case PCRE2_ERROR_BADOPTION: ++ FatalError("%s(%d) pcre2_pattern_info: option type is invalid.\n", + __FILE__, __LINE__); + + default: +- FatalError("%s(%d) pcre_fullinfo: Unknown error code.\n", ++ FatalError("%s(%d) pcre2_pattern_info: Unknown error code.\n", + __FILE__, __LINE__); + } + +- if ((options & PCRE_ANCHORED) && !(options & PCRE_MULTILINE)) ++ if ((options & PCRE2_ANCHORED) && !(options & PCRE2_MULTILINE)) + { + /* This means that this pcre rule option shouldn't be reevaluted + * even if any of it's relative children should fail to match. +@@ -579,6 +568,8 @@ static int pcre_search(const PcreData *p + int start_offset, + int *found_offset) + { ++ pcre2_match_data *match_data; ++ PCRE2_SIZE *ovector; + int matched; + int result; + +@@ -596,14 +587,19 @@ static int pcre_search(const PcreData *p + + *found_offset = -1; + +- result = pcre_exec(pcre_data->re, /* result of pcre_compile() */ +- pcre_data->pe, /* result of pcre_study() */ +- buf, /* the subject string */ +- len, /* the length of the subject string */ +- start_offset, /* start at offset 0 in the subject */ +- 0, /* options(handled at compile time */ +- snort_conf->pcre_ovector, /* vector for substring information */ +- snort_conf->pcre_ovector_size);/* number of elements in the vector */ ++ match_data = pcre2_match_data_create(snort_conf->pcre_ovector_size, NULL); ++ if (!match_data) { ++ DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre2_match_data_create failed to alloc mem!\n");); ++ return 0; ++ } ++ ++ result = pcre2_match(pcre_data->re, /* result of pcre2_compile() */ ++ (PCRE2_SPTR)buf, /* the subject string */ ++ (PCRE2_SIZE)len, /* the length of the subject string */ ++ (PCRE2_SIZE)start_offset, /* start at offset 0 in the subject */ ++ 0, /* options(handled at compile time */ ++ match_data, /* match data for results */ ++ pcre_data->match_context); /* match context for JIT limits */ + + if(result >= 0) + { +@@ -615,23 +611,25 @@ static int pcre_search(const PcreData *p + * second is set to the offset of the first character after the end of a substring. The first pair, + * ovector[0] and ovector[1], identify the portion of the subject string matched by the entire pattern. + * The next pair is used for the first capturing subpattern, and so on. The value returned by +- * pcre_exec() is the number of pairs that have been set. If there are no capturing subpatterns, the ++ * pcre_match() is the number of pairs that have been set. If there are no capturing subpatterns, the + * return value from a successful match is 1, indicating that just the first pair of offsets has been set. + * + * In Snort's case, the ovector size only allows for the first pair and a single int for scratch space. + */ +- *found_offset = snort_conf->pcre_ovector[1]; ++ ovector = pcre2_get_ovector_pointer(match_data); ++ *found_offset = ovector[1]; + DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, + "Setting Doe_ptr and found_offset: %p %d\n", + doe_ptr, found_offset);); + } +- else if(result == PCRE_ERROR_NOMATCH) ++ else if(result == PCRE2_ERROR_NOMATCH) + { + matched = 0; + } + else + { +- DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre_exec error : %d \n", result);); ++ pcre2_match_data_free(match_data); ++ DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre2_match error : %d \n", result);); + return 0; + } + +@@ -641,6 +639,7 @@ static int pcre_search(const PcreData *p + matched = !matched; + } + ++ pcre2_match_data_free(match_data); + return matched; + } + +--- a/src/detection-plugins/sp_pcre.h ++++ b/src/detection-plugins/sp_pcre.h +@@ -49,17 +49,18 @@ + + void SetupPcre(void); + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + typedef struct _PcreData + { +- pcre *re; /* compiled regex */ +- pcre_extra *pe; /* studied regex foo */ ++ pcre2_code *re; /* compiled regex */ ++ pcre2_match_context *match_context; /* regex match context */ + int options; /* sp_pcre specfic options (relative & inverse) */ + char *expression; + uint32_t search_offset; + } PcreData; + +-void PcreCapture(struct _SnortConfig *sc, const void *code, const void *extra); ++void Pcre2Capture(struct _SnortConfig *sc, const void *code); + void PcreFree(void *d); + uint32_t PcreHash(void *d); + int PcreCompare(void *l, void *r); +--- a/src/dynamic-plugins/sf_convert_dynamic.c ++++ b/src/dynamic-plugins/sf_convert_dynamic.c +@@ -52,9 +52,11 @@ + + extern void ParsePattern(char *, OptTreeNode *, int); + extern void ParseProtectedPattern(char *, OptTreeNode *, int); +-extern void *pcreCompile(const char *pattern, int options, const char **errptr, +- int *erroffset, const unsigned char *tableptr); +-extern void *pcreStudy(struct _SnortConfig *sc, const void *code, int options, const char **errptr); ++extern void *pcre2MatchContextCreate(const void *gcontext); ++extern void *pcre2Compile(const char *pattern, int options, int *errorcode, size_t *erroffset, void *matchcontext); ++extern int pcre2JITCompile(struct _SnortConfig *sc, const void *code, const void *matchcontext, int options); ++extern void pcre2MatchContextFree(const void *match_context); ++extern void pcre2CodeFree(const void *code); + + extern int SnortPcre(void *option_data, Packet *p); + extern int FlowBitsCheck(void *option_data, Packet *p); +@@ -517,20 +519,20 @@ static int ConvertProtectedContentOption + static int ConvertPcreOption(SnortConfig *sc, Rule *rule, int index, OptTreeNode *otn) + { + PcreData *pcre_data = (PcreData *) SnortAlloc(sizeof(PcreData)); +- PCREInfo *pcre_info = rule->options[index]->option_u.pcre; ++ PCRE2Info *pcre2_info = rule->options[index]->option_u.pcre2; + OptFpList *fpl; + void *pcre_dup; +- const char *error; +- int erroroffset; ++ int errorcode; ++ size_t erroroffset; + + /* Need to recompile the expression so double free doesn't occur + * during reload */ + + /* Compile & Study PCRE */ +- pcre_data->re = pcreCompile( +- pcre_info->expr, +- pcre_info->compile_flags, +- &error, ++ pcre_data->re = pcre2Compile( ++ pcre2_info->expr, ++ pcre2_info->compile_flags, ++ &errorcode, + &erroroffset, + NULL + ); +@@ -541,37 +543,46 @@ static int ConvertPcreOption(SnortConfig + return -1; + } + +- pcre_data->pe = pcreStudy(sc, ++ pcre_data->match_context = pcre2MatchContextCreate(NULL); ++ if (pcre_data->match_context == NULL) { ++ pcre2CodeFree(pcre_data->re); ++ free(pcre_data); ++ return -1; ++ } ++ ++ errorcode = pcre2JITCompile( ++ sc, + pcre_data->re, +- pcre_info->compile_flags, +- &error ++ pcre_data->match_context, ++ pcre2_info->compile_flags + ); + +- if (error) ++ if (errorcode) + { +- free(pcre_data->re); ++ pcre2MatchContextFree(pcre_data->match_context); ++ pcre2CodeFree(pcre_data->re); + free(pcre_data); + return -1; + } + + /* Copy to struct used for normal PCRE rules */ +- pcre_data->expression = SnortStrdup(pcre_info->expr); ++ pcre_data->expression = SnortStrdup(pcre2_info->expr); + + /* Option values differ between PCREInfo and PcreData, + * so a straight copy of the options variable won't work. */ +- if (pcre_info->flags & CONTENT_RELATIVE) ++ if (pcre2_info->flags & CONTENT_RELATIVE) + pcre_data->options |= SNORT_PCRE_RELATIVE; + +- if (pcre_info->flags & NOT_FLAG) ++ if (pcre2_info->flags & NOT_FLAG) + pcre_data->options |= SNORT_PCRE_INVERT; + +- if (pcre_info->flags & CONTENT_BUF_RAW) ++ if (pcre2_info->flags & CONTENT_BUF_RAW) + pcre_data->options |= SNORT_PCRE_RAWBYTES; + +- if (pcre_info->flags & CONTENT_BUF_NORMALIZED) ++ if (pcre2_info->flags & CONTENT_BUF_NORMALIZED) + pcre_data->options &= ~SNORT_PCRE_RAWBYTES; + +- pcre_data->options |= HTTP_CONTENT(pcre_info->flags); ++ pcre_data->options |= HTTP_CONTENT(pcre2_info->flags); + + PcreCheckAnchored(pcre_data); + +@@ -584,10 +595,10 @@ static int ConvertPcreOption(SnortConfig + { + if (pcre_data->expression) + free(pcre_data->expression); +- if (pcre_data->pe) +- free(pcre_data->pe); ++ if (pcre_data->match_context) ++ pcre2MatchContextFree(pcre_data->match_context); + if (pcre_data->re) +- free(pcre_data->re); ++ pcre2CodeFree(pcre_data->re); + + free(pcre_data); + pcre_data = pcre_dup; +--- a/src/dynamic-plugins/sf_dynamic_engine.h ++++ b/src/dynamic-plugins/sf_dynamic_engine.h +@@ -139,11 +139,18 @@ typedef int (*DynamicDecompressFunc)(voi + + #define ENGINE_DATA_VERSION 10 + +-typedef void *(*PCRECompileFunc)(const char *, int, const char **, int *, const unsigned char *); +-typedef void *(*PCREStudyFunc)(struct _SnortConfig *, const void *, int, const char **); +-typedef int (*PCREExecFunc)(const void *, const void *, const char *, int, int, int, int *, int); +-typedef void (*PCRECapture)(struct _SnortConfig *, const void *, const void *); +-typedef void(*PCREOvectorInfo)(int **, int *); ++typedef void *(*PCRE2CompileFunc)(const char *, int, int *, size_t *, void *); ++typedef void *(*PCRE2MatchContextCreate)(const void *); ++typedef int (*PCRE2JITCompileFunc)(struct _SnortConfig *, const void *, const void *, int); ++typedef int (*PCRE2OvectorSizeFunc)(void); ++typedef void *(*PCRE2MatchDataCreateFunc)(int, const void *); ++typedef unsigned int (*PCRE2GetOvectorCountFunc)(const void *); ++typedef void *(*PCRE2GetOvectorPointerFunc)(const void *); ++typedef int (*PCRE2MatchRealFunc)(const void *, const char *, int, int, int, const void *, const void *); ++typedef void (*PCRE2MatchDataFreeFunc)(const void *); ++typedef void (*PCRE2MatchContextFreeFunc)(const void *); ++typedef void (*PCRE2CodeFreeFunc)(const void *); ++typedef void (*PCRE2Capture)(struct _SnortConfig *, const void *); + + typedef struct _DynamicEngineData + { +@@ -175,9 +182,15 @@ typedef struct _DynamicEngineData + char **debugMsgFile; + int *debugMsgLine; + +- PCRECompileFunc pcreCompile; +- PCREStudyFunc pcreStudy; +- PCREExecFunc pcreExec; ++ PCRE2CompileFunc pcre2Compile; ++ PCRE2MatchContextCreate pcre2MatchContextCreate; ++ PCRE2JITCompileFunc pcre2JITCompile; ++ PCRE2OvectorSizeFunc pcre2OvectorSize; ++ PCRE2MatchDataCreateFunc pcre2MatchDataCreate; ++ PCRE2GetOvectorCountFunc pcre2GetOvectorCount; ++ PCRE2GetOvectorPointerFunc pcre2GetOvectorPointer; ++ PCRE2MatchRealFunc pcre2MatchReal; ++ PCRE2MatchDataFreeFunc pcre2MatchDataFree; + SfUnfold sfUnfold; + SfBase64Decode sfbase64decode; + GetAltDetectFunc GetAltDetect; +@@ -190,8 +203,7 @@ typedef struct _DynamicEngineData + + UnregisterBit flowbitUnregister; + +- PCRECapture pcreCapture; +- PCREOvectorInfo pcreOvectorInfo; ++ PCRE2Capture pcre2Capture; + + GetHttpBufferFunc getHttpBuffer; + DynamicDecompressInitFunc decompressInit; +--- a/src/dynamic-plugins/sf_dynamic_plugins.c ++++ b/src/dynamic-plugins/sf_dynamic_plugins.c +@@ -92,7 +92,8 @@ typedef HANDLE PluginHandle; + #include "sf_iph.h" + #include "fpdetect.h" + #include "sfportobject.h" +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "parser.h" + #include "event_wrapper.h" + #include "util.h" +@@ -1250,46 +1251,35 @@ void DynamicGetRuleData(void *p, const R + } + } + +-void *pcreCompile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) ++void *pcre2Compile(const char *pattern, int options, int *errorcode, size_t *erroffset, void *compilecontect) + { + options &= ~SNORT_PCRE_OVERRIDE_MATCH_LIMIT; +- return (void *)pcre_compile(pattern, options, errptr, erroffset, tableptr); ++ return (void *)pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED, options, errorcode, (PCRE2_SIZE *)erroffset, (pcre2_compile_context *)compilecontect); + } + +-void *pcreStudy(struct _SnortConfig *sc, const void *code, int options, const char **errptr) ++void *pcre2MatchContextCreate(const void *generalcontext) ++{ ++ return (void *)pcre2_match_context_create((pcre2_general_context *)generalcontext); ++} ++ ++int pcre2JITCompile(struct _SnortConfig *sc, const void *code, const void *matchcontext, int options) + { +- pcre_extra *extra_extra; + int snort_options = options & SNORT_PCRE_OVERRIDE_MATCH_LIMIT; ++ int errorcode; + +- extra_extra = pcre_study((const pcre*)code, 0, errptr); ++ errorcode = pcre2_jit_compile((pcre2_code*)code, PCRE2_JIT_COMPLETE); + +- if (extra_extra) ++ if (errorcode) + { + if ((ScPcreMatchLimitNewConf(sc) != -1) && !(snort_options & SNORT_PCRE_OVERRIDE_MATCH_LIMIT)) + { +- if (extra_extra->flags & PCRE_EXTRA_MATCH_LIMIT) +- { +- extra_extra->match_limit = ScPcreMatchLimitNewConf(sc); +- } +- else +- { +- extra_extra->flags |= PCRE_EXTRA_MATCH_LIMIT; +- extra_extra->match_limit = ScPcreMatchLimitNewConf(sc); +- } ++ pcre2_set_match_limit((pcre2_match_context*)matchcontext, ScPcreMatchLimitNewConf(sc)); + } + + #ifdef PCRE_EXTRA_MATCH_LIMIT_RECURSION + if ((ScPcreMatchLimitRecursionNewConf(sc) != -1) && !(snort_options & SNORT_PCRE_OVERRIDE_MATCH_LIMIT)) + { +- if (extra_extra->flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) +- { +- extra_extra->match_limit_recursion = ScPcreMatchLimitRecursionNewConf(sc); +- } +- else +- { +- extra_extra->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; +- extra_extra->match_limit_recursion = ScPcreMatchLimitRecursionNewConf(sc); +- } ++ pcre2_set_depth_limit((pcre2_match_context*)matchcontext, ScPcreMatchLimitRecursionNewConf(sc)); + } + #endif + } +@@ -1298,40 +1288,62 @@ void *pcreStudy(struct _SnortConfig *sc, + if (!(snort_options & SNORT_PCRE_OVERRIDE_MATCH_LIMIT) && + ((ScPcreMatchLimitNewConf(sc) != -1) || (ScPcreMatchLimitRecursionNewConf(sc) != -1))) + { +- extra_extra = (pcre_extra *)SnortAlloc(sizeof(pcre_extra)); + if (ScPcreMatchLimitNewConf(sc) != -1) + { +- extra_extra->flags |= PCRE_EXTRA_MATCH_LIMIT; +- extra_extra->match_limit = ScPcreMatchLimitNewConf(sc); ++ pcre2_set_match_limit((pcre2_match_context*)matchcontext, ScPcreMatchLimitNewConf(sc)); + } + + #ifdef PCRE_EXTRA_MATCH_LIMIT_RECURSION + if (ScPcreMatchLimitRecursionNewConf(sc) != -1) + { +- extra_extra->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; +- extra_extra->match_limit_recursion = ScPcreMatchLimitRecursionNewConf(sc); ++ pcre2_set_depth_limit((pcre2_match_context*)matchcontext, ScPcreMatchLimitRecursionNewConf(sc)); + } + #endif + } + } + +- return extra_extra; ++ return errorcode; ++} ++ ++int pcre2OvectorSize(void) ++{ ++ return snort_conf->pcre_ovector_size; ++} ++ ++void *pcre2MatchDataCreate(int size, const void *generalcontext) ++{ ++ return pcre2_match_data_create(size, (pcre2_general_context *)generalcontext); ++} ++ ++unsigned int pcre2GetOvectorCount(const void *match_data) ++{ ++ return pcre2_get_ovector_count((pcre2_match_data *)match_data); ++} ++ ++void *pcre2GetOvectorPointer(const void *match_data) ++{ ++ return pcre2_get_ovector_pointer((pcre2_match_data *)match_data); ++} ++ ++int pcre2MatchReal(const void *code, const char *subj, ++ int len, int start, int options, const void *matchdata, const void *matchcontext) ++{ ++ return pcre2_match((const pcre2_code *)code, (PCRE2_SPTR)subj, len, start, options, (pcre2_match_data *)matchdata, (pcre2_match_context *)matchcontext); ++} ++ ++void pcre2MatchDataFree(const void *match_data) ++{ ++ pcre2_match_data_free((pcre2_match_data *)match_data); + } + +-/* pcreOvectorInfo +- * +- * Get the Ovector configuration for PCRE from the snort.conf +- */ +-void pcreOvectorInfo(int **ovector, int *ovector_size) ++void pcre2MatchContextFree(const void *code) + { +- *ovector = snort_conf->pcre_ovector; +- *ovector_size = snort_conf->pcre_ovector_size; ++ pcre2_match_context_free((pcre2_match_context *)code); + } + +-int pcreExec(const void *code, const void *extra, const char *subj, +- int len, int start, int options, int *ovec, int ovecsize) ++void pcre2CodeFree(const void *code) + { +- return pcre_exec((const pcre *)code, (const pcre_extra *)extra, subj, len, start, options, ovec, ovecsize); ++ pcre2_code_free((pcre2_code *)code); + } + + static int setFlowId(const void* p, uint32_t id) +@@ -1415,17 +1427,22 @@ int InitDynamicEngines(char *dynamic_rul + engineData.debugMsgLine = &no_line; + #endif + +- engineData.pcreStudy = &pcreStudy; +- engineData.pcreCompile = &pcreCompile; +- engineData.pcreExec = &pcreExec; ++ engineData.pcre2JITCompile = &pcre2JITCompile; ++ engineData.pcre2MatchContextCreate = &pcre2MatchContextCreate; ++ engineData.pcre2Compile = &pcre2Compile; ++ engineData.pcre2OvectorSize = &pcre2OvectorSize; ++ engineData.pcre2MatchDataCreate = &pcre2MatchDataCreate; ++ engineData.pcre2GetOvectorCount = &pcre2GetOvectorCount; ++ engineData.pcre2GetOvectorPointer = &pcre2GetOvectorPointer; ++ engineData.pcre2MatchReal = &pcre2MatchReal; ++ engineData.pcre2MatchDataFree = &pcre2MatchDataFree; + + engineData.allocRuleData = &DynamicRuleDataAlloc; + engineData.freeRuleData = &DynamicRuleDataFree; + + engineData.flowbitUnregister = &DynamicFlowbitUnregister; + +- engineData.pcreCapture = &PcreCapture; +- engineData.pcreOvectorInfo = &pcreOvectorInfo; ++ engineData.pcre2Capture = &Pcre2Capture; + engineData.getHttpBuffer = getHttpBuffer; + + engineData.decompressInit = &DynamicDecompressInit; +--- a/src/dynamic-plugins/sf_engine/examples/3036.c ++++ b/src/dynamic-plugins/sf_engine/examples/3036.c +@@ -104,7 +104,7 @@ static RuleOption rule3036option3 = + { &rule3036byte_test3 } + }; + // pcre:"^.{27}", relative; +-static PCREInfo rule3036pcre4 = ++static PCRE2Info rule3036pcre4 = + { + "^.{27}", /* pattern */ + NULL, /* holder for compiled pattern */ +@@ -166,7 +166,7 @@ static RuleOption rule3036option6 = + { &rule3036byte_jump6 } + }; + // pcre:"^.{4}", relative; +-static PCREInfo rule3036pcre7 = ++static PCRE2Info rule3036pcre7 = + { + "^.{4}", /* pattern */ + NULL, /* holder for compiled pattern */ +@@ -325,13 +325,13 @@ int rule3036eval(void *p) { + // byte_test:size 1, value 128, operator &, offset 6, relative; + if (byteTest(p, rule3036options[3]->option_u.byte, cursor_normal) > 0) { + // pcre:"^.{27}", relative; +- if (pcreMatch(p, rule3036options[4]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule3036options[4]->option_u.pcre2, &cursor_normal)) { + // content:"|01 00|", offset 37, depth 2, relative; + if (contentMatch(p, rule3036options[5]->option_u.content, &cursor_normal) > 0) { + // byte_jump:size 4, offset -7, relative, endian little; + if (byteJump(p, rule3036options[6]->option_u.byte, &cursor_normal) > 0) { + // pcre:"^.{4}", relative; +- if (pcreMatch(p, rule3036options[7]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule3036options[7]->option_u.pcre2, &cursor_normal)) { + // content:"|00 00 00 00|", offset 16, depth 4, relative; + if (!(contentMatch(p, rule3036options[8]->option_u.content, &cursor_normal) > 0)) { + // byte_jump:size 4, offset 16, relative, endian little; +--- a/src/dynamic-plugins/sf_engine/examples/3052.c ++++ b/src/dynamic-plugins/sf_engine/examples/3052.c +@@ -93,7 +93,7 @@ static RuleOption rule3052option2 = + { &rule3052byte_test2 } + }; + // pcre:"^.{27}", relative; +-static PCREInfo rule3052pcre3 = ++static PCRE2Info rule3052pcre3 = + { + "^.{27}", /* pattern */ + NULL, /* holder for compiled pattern */ +@@ -155,7 +155,7 @@ static RuleOption rule3052option5 = + { &rule3052byte_jump5 } + }; + // pcre:"^.{4}", relative; +-static PCREInfo rule3052pcre6 = ++static PCRE2Info rule3052pcre6 = + { + "^.{4}", /* pattern */ + NULL, /* holder for compiled pattern */ +@@ -307,13 +307,13 @@ int rule3052eval(void *p) { + // byte_test:size 1, value 128, operator &, offset 6, relative; + if (byteTest(p, rule3052options[2]->option_u.byte, cursor_normal) > 0) { + // pcre:"^.{27}", relative; +- if (pcreMatch(p, rule3052options[3]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule3052options[3]->option_u.pcre2, &cursor_normal)) { + // content:"|01 00|", offset 37, depth 2, relative; + if (contentMatch(p, rule3052options[4]->option_u.content, &cursor_normal) > 0) { + // byte_jump:size 4, offset -7, relative, endian little; + if (byteJump(p, rule3052options[5]->option_u.byte, &cursor_normal) > 0) { + // pcre:"^.{4}", relative; +- if (pcreMatch(p, rule3052options[6]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule3052options[6]->option_u.pcre2, &cursor_normal)) { + // content:"|00 00 00 00|", offset 16, depth 4, relative; + if (!(contentMatch(p, rule3052options[7]->option_u.content, &cursor_normal) > 0)) { + // byte_jump:size 4, offset 16, relative, endian little; +--- a/src/dynamic-plugins/sf_engine/examples/3099.c ++++ b/src/dynamic-plugins/sf_engine/examples/3099.c +@@ -104,7 +104,7 @@ static RuleOption rule3099option3 = + { &rule3099byte_test3 } + }; + // pcre:"^.{27}", relative; +-static PCREInfo rule3099pcre4 = ++static PCRE2Info rule3099pcre4 = + { + "^.{27}", /* pattern */ + NULL, /* holder for compiled pattern */ +@@ -191,7 +191,7 @@ static RuleOption rule3099option7 = + { &rule3099byte_jump7 } + }; + // pcre:"^.{4}", relative; +-static PCREInfo rule3099pcre8 = ++static PCRE2Info rule3099pcre8 = + { + "^.{4}", /* pattern */ + NULL, /* holder for compiled pattern */ +@@ -392,7 +392,7 @@ int rule3099eval(void *p) { + // byte_test:size 1, value 128, operator &, offset 6, relative; + if (!(byteTest(p, rule3099options[3]->option_u.byte, cursor_normal) > 0)) { + // pcre:"^.{27}", relative; +- if (pcreMatch(p, rule3099options[4]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule3099options[4]->option_u.pcre2, &cursor_normal)) { + // content:"&|00|", offset 29, depth 2, relative; + if (contentMatch(p, rule3099options[5]->option_u.content, &cursor_normal) > 0) { + // content:"|5C|PIPE|5C 00|", offset 4, nocase, relative; +@@ -400,7 +400,7 @@ int rule3099eval(void *p) { + // byte_jump:size 2, offset -17, relative, endian little; + if (byteJump(p, rule3099options[7]->option_u.byte, &cursor_normal) > 0) { + // pcre:"^.{4}", relative; +- if (pcreMatch(p, rule3099options[8]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule3099options[8]->option_u.pcre2, &cursor_normal)) { + // content:"|05|", depth 1, relative; + if (contentMatch(p, rule3099options[9]->option_u.content, &cursor_normal) > 0) { + // byte_test:size 1, value 16, operator &, offset 3, relative; +--- a/src/dynamic-plugins/sf_engine/examples/36733.c ++++ b/src/dynamic-plugins/sf_engine/examples/36733.c +@@ -25,7 +25,8 @@ + #include "config.h" + #endif + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sf_snort_plugin_api.h" + #include "sf_snort_packet.h" + #include "web-misc_base64_decode.h" +@@ -80,12 +81,12 @@ static RuleOption ruleAPACHEAUTHLDAPopti + }; + + // pcre:"/^Authorization:\s*Basic/mi"; +-static PCREInfo ruleAPACHEAUTHLDAPpcre0 = ++static PCRE2Info ruleAPACHEAUTHLDAPpcre0 = + { + "^Authorization:\\s*Basic\\s+", /* pattern (now in snort content format) */ + 0, /* compiled expression */ + 0, /* compiled extra */ +- PCRE_CASELESS | PCRE_MULTILINE, /* compile flags */ ++ PCRE2_CASELESS | PCRE2_MULTILINE, /* compile flags */ + CONTENT_BUF_NORMALIZED, /* flags */ // XXX - need to add CONTENT_FAST_PATTERN support + 0 /* offset */ + }; +@@ -99,7 +100,7 @@ static RuleOption ruleAPACHEAUTHLDAPopti + }; + + // pcre:"/%[0-9]*\.?[0-9]*[:formatspecifiers:]/"; +-static PCREInfo ruleAPACHEAUTHLDAPpcre1 = ++static PCRE2Info ruleAPACHEAUTHLDAPpcre1 = + { + // "%[-# +'I]*[0-9]*\\.?[0-9]*[qjzthdiouxefgcrslnp]", /* pattern (now in snort content format) */ // ZDNOTE + "%.+%.", /* regex. The above is technically more correct, but this is faster and good enough */ +@@ -191,7 +192,7 @@ static int ruleAPACHEAUTHLDAPeval(void * + + // manual pcre stuff + int result; +- int ovector[3]; // Needs to be a multiple of 3 ++ void *match_data; + + if(sp == NULL) + return RULE_NOMATCH; +@@ -221,7 +222,7 @@ static int ruleAPACHEAUTHLDAPeval(void * + //DEBUG_WRAP(printf("found content:\"Authorization:\" %p\n", cursor)); + + // pcre:"/^Authorization:\s*Basic\s+/mi" +- if(pcreMatch(p, ruleAPACHEAUTHLDAPoptions[2]->option_u.pcre, &cursor) <= 0) ++ if(pcre2Match(p, ruleAPACHEAUTHLDAPoptions[2]->option_u.pcre2, &cursor) <= 0) + return RULE_NOMATCH; + + //DEBUG_WRAP(printf("found pcre:\"/^Authorization:\\s*Basic\\s+/mi\" %p\n", cursor)); +@@ -238,14 +239,35 @@ static int ruleAPACHEAUTHLDAPeval(void * + + //DEBUG_WRAP(printf("Successfully base64 decoded (%s)(%d)\n", decodedbuf, decodedbytes)); + ++ match_data = pcre2MatchDataCreateWrapper(); ++ if (!match_data) ++ return RULE_NOMATCH; ++ + // Now run our regex on the base64 decoding to find an attack +- result = pcreExecWrapper(ruleAPACHEAUTHLDAPoptions[3]->option_u.pcre, ++ result = pcre2MatchWrapper(ruleAPACHEAUTHLDAPoptions[3]->option_u.pcre2, + (char *)decodedbuf, // subject string + decodedbytes, // subject length + 0, // start offset + 0, // options (handled at compile time) +- ovector, // ovector for storing result substrings +- sizeof(ovector)/sizeof(int)); // size of ovector ++ match_data); // size of ovector ++ ++ /* If ovector is required: ++ * 1. declare a size_t *ovector ++ * 2. after pcre2ExecWrapper... ++ * 3. ovector = pcre2GetOvectorPointer(match_data); ++ * 4. Use ovector as old implementation ++ * ++ * If required ovector_size: ++ * 1. declare a unsigned int ovector_size ++ * 2. after pcre2ExecWrapper... ++ * 3. ovector_size = pcre2GetOvectorCount(match_data); ++ * 4. User ovector_size as old implementation ++ * ++ * ALWAYS REMEMBER TO USE THE MATCH DATA CREATE AND FREE BEFORE ++ * EXEC WRAPPER ++ */ ++ ++ pcre2MatchDataFreeWrapper(match_data); + + //DEBUG_WRAP(printf("result = %d\n", result)); + +--- a/src/dynamic-plugins/sf_engine/examples/3682.c ++++ b/src/dynamic-plugins/sf_engine/examples/3682.c +@@ -9,7 +9,8 @@ + #include "config.h" + #endif + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sf_snort_plugin_api.h" + #include "sf_snort_packet.h" + #include "detection_lib_meta.h" +@@ -103,12 +104,12 @@ static RuleOption rule3682option3 = + + /* pcre for sid 3682 */ + //pcre:"/Content-Type\x3A\s+audio\/(x-wav|mpeg|x-midi)/i"; +-static PCREInfo rule3682pcre4 = ++static PCRE2Info rule3682pcre4 = + { + "Content-Type\\x3A\\s+audio\\/(x-wav|mpeg|x-midi)", /* expression */ + NULL, /* Holder for compiled expr */ + NULL, /* Holder for compiled expr extra flags */ +- PCRE_CASELESS, /* Compile Flags */ ++ PCRE2_CASELESS, /* Compile Flags */ + CONTENT_BUF_NORMALIZED, /* Flags */ + 0 /* offset */ + }; +@@ -148,12 +149,12 @@ static RuleOption rule3682option5 = + + /* pcre for sid 3682 */ + //pcre:"/filename=[\x22\x27]?.{1,221}\.(vbs|exe|scr|pif|bat)/i"; +-static PCREInfo rule3682pcre6 = ++static PCRE2Info rule3682pcre6 = + { + "filename=[\\x22\\x27]?.{1,221}\\.(vbs|exe|scr|pif|bat)", /* expression */ + NULL, /* Holder for compiled expr */ + NULL, /* Holder for compiled expr extra flags */ +- PCRE_CASELESS, /* Compile Flags */ ++ PCRE2_CASELESS, /* Compile Flags */ + CONTENT_BUF_NORMALIZED, /* Flags */ + 0 /* offset */ + }; +--- a/src/dynamic-plugins/sf_engine/examples/bug31842.c ++++ b/src/dynamic-plugins/sf_engine/examples/bug31842.c +@@ -25,7 +25,8 @@ + #include "config.h" + #endif + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sf_snort_plugin_api.h" + #include "sf_snort_packet.h" + +@@ -89,12 +90,12 @@ static RuleOption ruleSQUID_NTLM_AUTHopt + } + }; + +-static PCREInfo ruleSQUID_NTLM_AUTHpcre = ++static PCRE2Info ruleSQUID_NTLM_AUTHpcre = + { + "^Proxy-Authorization:\\s*NTLM\\s+", /* pattern to search for */ + NULL, /* holder for compiled pattern */ + NULL, /* holder for compiled pattern flags */ +- PCRE_CASELESS | PCRE_DOTALL | PCRE_MULTILINE, /* compile flags */ ++ PCRE2_CASELESS | PCRE2_DOTALL | PCRE2_MULTILINE, /* compile flags */ + CONTENT_BUF_NORMALIZED, /* content flags */ + 0 /* offset */ + }; +@@ -336,7 +337,7 @@ int ruleSQUID_NTLM_AUTHeval(void *p) { + } + + /* call pcre match */ +- if (pcreMatch(p, ruleSQUID_NTLM_AUTHoptions[2]->option_u.pcre, &cursor) <= 0) { ++ if (pcre2Match(p, ruleSQUID_NTLM_AUTHoptions[2]->option_u.pcre2, &cursor) <= 0) { + return RULE_NOMATCH; + } + +--- a/src/dynamic-plugins/sf_engine/examples/bug35218.c ++++ b/src/dynamic-plugins/sf_engine/examples/bug35218.c +@@ -26,7 +26,8 @@ + #include "config.h" + #endif + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sf_snort_plugin_api.h" + #include "sf_snort_packet.h" + +@@ -97,12 +98,12 @@ static RuleOption ruleEXCHANGE_BASE64_DE + } + }; + +-static PCREInfo ruleEXCHANGE_BASE64_DECODEpcre0 = ++static PCRE2Info ruleEXCHANGE_BASE64_DECODEpcre0 = + { + "^Content-Transfer-Encoding:\\s*base64\\s*$", /* pattern to search for */ + NULL, /* compiled_expr */ + 0, /* compiled_extra */ +- PCRE_CASELESS | PCRE_MULTILINE, /* compile_flags */ ++ PCRE2_CASELESS | PCRE2_MULTILINE, /* compile_flags */ + CONTENT_BUF_RAW, /* flags: must include a CONTENT_BUF_X */ + 0 /* offset */ + }; +@@ -119,12 +120,12 @@ static RuleOption ruleEXCHANGE_BASE64_DE + /* Second PCRE just like above but with CONTENT_RELATIVE so we can find + additional base64 sections if they exist. + */ +-static PCREInfo ruleEXCHANGE_BASE64_DECODEpcre1 = ++static PCRE2Info ruleEXCHANGE_BASE64_DECODEpcre1 = + { + "^Content-Transfer-Encoding:\\s*base64\\s*$", /* pattern to search for */ + NULL, /* compiled_expr */ + 0, /* compiled_extra */ +- PCRE_CASELESS | PCRE_MULTILINE, /* compile_flags */ ++ PCRE2_CASELESS | PCRE2_MULTILINE, /* compile_flags */ + CONTENT_BUF_RAW | CONTENT_RELATIVE, /* flags: must include a CONTENT_BUF_X */ + 0 /* offset */ + }; +@@ -214,7 +215,7 @@ int ruleEXCHANGE_BASE64_DECODEeval(void + } + + /* call pcre match */ +- if (pcreMatch(sp, ruleEXCHANGE_BASE64_DECODEoptions[2]->option_u.pcre, &cursor_normal) <= 0) { ++ if (pcre2Match(sp, ruleEXCHANGE_BASE64_DECODEoptions[2]->option_u.pcre2, &cursor_normal) <= 0) { + return RULE_NOMATCH; + } + +@@ -286,7 +287,7 @@ int ruleEXCHANGE_BASE64_DECODEeval(void + + } else { /* !in_base64_content */ + // Find the next base64 content the easy way +- if(pcreMatch(sp, ruleEXCHANGE_BASE64_DECODEoptions[3]->option_u.pcre, &cursor_normal) <= 0) ++ if(pcre2Match(sp, ruleEXCHANGE_BASE64_DECODEoptions[3]->option_u.pcre2, &cursor_normal) <= 0) + return RULE_NOMATCH; + + // Another base64 section was found, set up for another loop +--- a/src/dynamic-plugins/sf_engine/examples/sid1902.c ++++ b/src/dynamic-plugins/sf_engine/examples/sid1902.c +@@ -12,7 +12,8 @@ + #include "config.h" + #endif + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sf_snort_plugin_api.h" + #include "sf_snort_packet.h" + +@@ -59,12 +60,12 @@ static RuleOption rule1902option1 = + { &rule1902content1 } + }; + // pcre:"\sLSUB\s[^\n]*?\s\{", dotall, multiline, nocase; +-static PCREInfo rule1902pcre2 = ++static PCRE2Info rule1902pcre2 = + { + "\\sLSUB\\s[^\\n]*?\\s\\{", /* pattern */ + NULL, /* holder for compiled pattern */ + NULL, /* holder for compiled pattern flags */ +- PCRE_CASELESS|PCRE_DOTALL|PCRE_MULTILINE, /* compile flags */ ++ PCRE2_CASELESS|PCRE2_DOTALL|PCRE2_MULTILINE, /* compile flags */ + CONTENT_BUF_NORMALIZED, /* content flags */ + 0 /* offset */ + }; +@@ -177,7 +178,7 @@ int rule1902eval(void *p) { + // content:"LSUB", nocase; + if (contentMatch(p, rule1902options[1]->option_u.content, &cursor_normal) > 0) { + // pcre:"\sLSUB\s[^\n]*?\s\{", dotall, multiline, nocase; +- if (pcreMatch(p, rule1902options[2]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule1902options[2]->option_u.pcre2, &cursor_normal)) { + // byte_test:size 5, value 256, operator >, relative, representation dec; + if (byteTest(p, rule1902options[3]->option_u.byte, cursor_normal) > 0) { + return RULE_MATCH; +--- a/src/dynamic-plugins/sf_engine/examples/sid2389.c ++++ b/src/dynamic-plugins/sf_engine/examples/sid2389.c +@@ -6,7 +6,8 @@ + #include "config.h" + #endif + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sf_snort_plugin_api.h" + #include "detection_lib_meta.h" + +@@ -113,12 +114,12 @@ static RuleOption option2 = + { &content1 } + }; + +-static PCREInfo pcre1 = ++static PCRE2Info pcre1 = + { /* PCRE */ + "^RNTO\\s[^\\n]{100}", /* expression */ + NULL, /* Holder for compiled expr */ + NULL, /* Holder for compiled expr extra flags */ +- PCRE_DOTALL | PCRE_MULTILINE | PCRE_CASELESS, /* Compile Flags */ ++ PCRE2_DOTALL | PCRE2_MULTILINE | PCRE2_CASELESS, /* Compile Flags */ + CONTENT_BUF_NORMALIZED, /* Flags */ + 0 /* offset */ + }; +@@ -178,7 +179,7 @@ int sid2389Eval(void *p) + if (contentMatch(p, sid2389.options[1]->option_u.content, &norm_cur)>0) + { + /* Not relative to norm cursor */ +- if (pcreMatch(p, sid2389.options[2]->option_u.pcre, NULL)) ++ if (pcre2Match(p, sid2389.options[2]->option_u.pcre2, NULL)) + { + return RULE_MATCH; + } +--- a/src/dynamic-plugins/sf_engine/examples/sid9999.c ++++ b/src/dynamic-plugins/sf_engine/examples/sid9999.c +@@ -159,7 +159,7 @@ static CursorInfo loopCursor = + /* these don't get structures... lets hope this works :) */ + /* pcre for sid 9999 */ + // pcre:"^[rbg]XYZ", relative; +-static PCREInfo rule9999pcre7 = ++static PCRE2Info rule9999pcre7 = + { + "^[rbg]XYZ", /* pattern */ + NULL, /* holder for compiled pattern */ +--- a/src/dynamic-plugins/sf_engine/examples/web-client_test.c ++++ b/src/dynamic-plugins/sf_engine/examples/web-client_test.c +@@ -85,12 +85,12 @@ static RuleOption rule64111option1 = + }; + + // pcre:"IIS 7\x2e5 Detailed Error - 404\x2e0 - Not Found", nocase; +-static PCREInfo rule64111pcre2 = ++static PCRE2Info rule64111pcre2 = + { + "IIS 7\\x2e5 Detailed Error - 404\\x2e0 - Not Found", /* pattern */ + NULL, /* holder for compiled pattern */ + NULL, /* holder for compiled pattern flags */ +- PCRE_CASELESS, /* compile flags */ ++ PCRE2_CASELESS, /* compile flags */ + CONTENT_BUF_NORMALIZED, /* content flags */ + 0 /* offset */ + }; +@@ -256,12 +256,12 @@ static RuleOption rule64222option2 = + }; + + // pcre:"SignUrl=[^\x26\s]*[\x22\x27\x28\x29\x3C\x3E]", payload uri, nocase; +-static PCREInfo rule64222pcre3 = ++static PCRE2Info rule64222pcre3 = + { + "SignUrl=[^\\x26\\s]*[\\x22\\x27\\x28\\x29\\x3C\\x3E]", /* pattern */ + NULL, /* holder for compiled pattern */ + NULL, /* holder for compiled pattern flags */ +- PCRE_CASELESS, /* compile flags */ ++ PCRE2_CASELESS, /* compile flags */ + CONTENT_BUF_URI, /* content flags */ + 0 /* offset */ + }; +@@ -428,12 +428,12 @@ static RuleOption rule64333option2 = + }; + + // pcre:"SignUrl=[^\\x26\\s]*[\\x22\\x27\\x28\\x29\\x3C\\x3E]", payload uri, nocase; +-static PCREInfo rule64333pcre3 = ++static PCRE2Info rule64333pcre3 = + { + "SignUrl=[^\\\\x26\\\\s]*[\\\\x22\\\\x27\\\\x28\\\\x29\\\\x3C\\\\x3E]", /* pattern */ + NULL, /* holder for compiled pattern */ + NULL, /* holder for compiled pattern flags */ +- PCRE_CASELESS, /* compile flags */ ++ PCRE2_CASELESS, /* compile flags */ + CONTENT_BUF_URI, /* content flags */ + 0 /* offset */ + }; +@@ -550,7 +550,7 @@ int rule64111eval(void *p) { + // content:"IIS 7.5 Detailed Error - 404.0 - Not Found", depth 0, nocase, fast_pattern; + if (contentMatch(p, rule64111options[1]->option_u.content, &cursor_normal) > 0) { + // pcre:"IIS 7\x2e5 Detailed Error - 404\x2e0 - Not Found", nocase; +- if (pcreMatch(p, rule64111options[2]->option_u.pcre, &cursor_normal)) { ++ if (pcre2Match(p, rule64111options[2]->option_u.pcre2, &cursor_normal)) { + return RULE_MATCH; + } + } +@@ -576,7 +576,7 @@ int rule64222eval(void *p) { + // content:"SignUrl=", payload http_uri, depth 0, nocase; + if (contentMatch(p, rule64222options[2]->option_u.content, &cursor_http_uri) > 0) { + // pcre:"SignUrl=[^\x26\s]*[\x22\x27\x28\x29\x3C\x3E]", payload uri, nocase; +- if (pcreMatch(p, rule64222options[3]->option_u.pcre, &cursor_uri)) { ++ if (pcre2Match(p, rule64222options[3]->option_u.pcre2, &cursor_uri)) { + return RULE_MATCH; + } + } +@@ -603,7 +603,7 @@ int rule64333eval(void *p) { + // content:"SignUrl=", payload http_uri, depth 0, nocase; + if (contentMatch(p, rule64333options[2]->option_u.content, &cursor_http_uri) > 0) { + // pcre:"SignUrl=[^\\x26\\s]*[\\x22\\x27\\x28\\x29\\x3C\\x3E]", payload uri, nocase; +- if (pcreMatch(p, rule64333options[3]->option_u.pcre, &cursor_uri)) { ++ if (pcre2Match(p, rule64333options[3]->option_u.pcre2, &cursor_uri)) { + return RULE_MATCH; + } + } +--- a/src/dynamic-plugins/sf_engine/sf_snort_detection_engine.c ++++ b/src/dynamic-plugins/sf_engine/sf_snort_detection_engine.c +@@ -899,11 +899,11 @@ int RegisterOneRule(struct _SnortConfig + break; + case OPTION_TYPE_PCRE: + { +- PCREInfo *pcre = option->option_u.pcre; ++ PCRE2Info *pcre2 = option->option_u.pcre2; + +- if (pcre->compiled_expr == NULL) ++ if (pcre2->compiled_expr == NULL) + { +- if (PCRESetup(sc, rule, pcre)) ++ if (PCRE2Setup(sc, rule, pcre2)) + { + rule->initialized = 0; + FreeOneRule(rule); +@@ -1120,18 +1120,18 @@ static void FreeOneRule(void *data) + + case OPTION_TYPE_PCRE: + { +- PCREInfo *pcre = option->option_u.pcre; ++ PCRE2Info *pcre2 = option->option_u.pcre2; + +- if (pcre->compiled_expr != NULL) ++ if (pcre2->match_context != NULL) + { +- free(pcre->compiled_expr); +- pcre->compiled_expr = NULL; ++ pcre2_match_context_free(pcre2->match_context); ++ pcre2->match_context = NULL; + } + +- if (pcre->compiled_extra != NULL) ++ if (pcre2->compiled_expr != NULL) + { +- free(pcre->compiled_extra); +- pcre->compiled_extra = NULL; ++ pcre2_code_free(pcre2->compiled_expr); ++ pcre2->compiled_expr = NULL; + } + } + +--- a/src/dynamic-plugins/sf_engine/sf_snort_detection_engine.h ++++ b/src/dynamic-plugins/sf_engine/sf_snort_detection_engine.h +@@ -30,7 +30,7 @@ + #define SF_SNORT_DETECTION_ENGINE__H + + int BoyerContentSetup(Rule *rule, ContentInfo *content); +-int PCRESetup(struct _SnortConfig *sc, Rule *rule, PCREInfo *pcreInfo); ++int PCRE2Setup(struct _SnortConfig *sc, Rule *rule, PCRE2Info *pcre2Info); + int ValidateHeaderCheck(Rule *rule, HdrOptCheck *optData); + void ContentSetup(void); + int ByteExtractInitialize(Rule *rule, ByteExtract *extractData); +--- a/src/dynamic-plugins/sf_engine/sf_snort_plugin_api.c ++++ b/src/dynamic-plugins/sf_engine/sf_snort_plugin_api.c +@@ -640,7 +640,7 @@ int isRelativeOption(RuleOption *option) + relative = option->option_u.content->flags & CONTENT_RELATIVE; + break; + case OPTION_TYPE_PCRE: +- relative = option->option_u.pcre->flags & CONTENT_RELATIVE; ++ relative = option->option_u.pcre2->flags & CONTENT_RELATIVE; + break; + case OPTION_TYPE_FLOWBIT: + /* Never relative */ +@@ -716,7 +716,7 @@ int ruleMatchInternal(SFSnortPacket *p, + int32_t origOffset = 0; + uint32_t origDepth = 0; + int continueLoop = 1; +- PCREInfo *thisPCREInfo = NULL; ++ PCRE2Info *thisPCREInfo = NULL; + + if (cursor) + startCursor = thisCursor = *cursor; +@@ -736,7 +736,7 @@ int ruleMatchInternal(SFSnortPacket *p, + origOffset = thisContentInfo->offset; + break; + case OPTION_TYPE_PCRE: +- thisPCREInfo = rule->options[optIndex]->option_u.pcre; ++ thisPCREInfo = rule->options[optIndex]->option_u.pcre2; + origFlags = thisPCREInfo->flags; + origOffset = thisPCREInfo->offset; + break; +@@ -760,8 +760,8 @@ int ruleMatchInternal(SFSnortPacket *p, + notFlag = rule->options[optIndex]->option_u.protectedContent->flags & NOT_FLAG; + break; + case OPTION_TYPE_PCRE: +- retVal = pcreMatch(p, rule->options[optIndex]->option_u.pcre, &thisCursor); +- notFlag = rule->options[optIndex]->option_u.pcre->flags & NOT_FLAG; ++ retVal = pcre2Match(p, rule->options[optIndex]->option_u.pcre2, &thisCursor); ++ notFlag = rule->options[optIndex]->option_u.pcre2->flags & NOT_FLAG; + break; + case OPTION_TYPE_FLOWBIT: + retVal = processFlowbits(p, rule->options[optIndex]->option_u.flowBit); +--- a/src/dynamic-plugins/sf_engine/sf_snort_plugin_api.h ++++ b/src/dynamic-plugins/sf_engine/sf_snort_plugin_api.h +@@ -30,7 +30,8 @@ + #ifndef SF_SNORT_PLUGIN_API_H_ + #define SF_SNORT_PLUGIN_API_H_ + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "stdio.h" + + #ifndef WIN32 +@@ -211,26 +212,26 @@ typedef struct _CursorInfo + } CursorInfo; + + /* +-pcre.h provides flags: ++pcre2.h provides flags: + +-PCRE_CASELESS +-PCRE_MULTILINE +-PCRE_DOTALL +-PCRE_EXTENDED +-PCRE_ANCHORED +-PCRE_DOLLAR_ENDONLY +-PCRE_UNGREEDY ++PCRE2_CASELESS ++PCRE2_MULTILINE ++PCRE2_DOTALL ++PCRE2_EXTENDED ++PCRE2_ANCHORED ++PCRE2_DOLLAR_ENDONLY ++PCRE2_UNGREEDY + */ + +-typedef struct _PCREInfo ++typedef struct _PCRE2Info + { + char *expr; + void *compiled_expr; +- void *compiled_extra; ++ void *match_context; + uint32_t compile_flags; + uint32_t flags; /* must include a CONTENT_BUF_X */ + int32_t offset; +-} PCREInfo; ++} PCRE2Info; + + #define FLOWBIT_SET 0x01 + #define FLOWBIT_UNSET 0x02 +@@ -393,7 +394,7 @@ typedef struct _RuleOption + ContentInfo *content; + ProtectedContentInfo *protectedContent; + CursorInfo *cursor; +- PCREInfo *pcre; ++ PCRE2Info *pcre2; + FlowBitsInfo *flowBit; + ByteData *byte; + ByteExtract *byteExtract; +@@ -482,7 +483,7 @@ ENGINE_LINKAGE int byteTest(void *p, Byt + ENGINE_LINKAGE int byteMath(void *p, ByteData *byteData, const uint8_t *cursor); + /* Same as extractValue plus setCursor */ + ENGINE_LINKAGE int byteJump(void *p, ByteData *byteData, const uint8_t **cursor); +-ENGINE_LINKAGE int pcreMatch(void *p, PCREInfo* pcre, const uint8_t **cursor); ++ENGINE_LINKAGE int pcre2Match(void *p, PCRE2Info* pcre2, const uint8_t **cursor); + ENGINE_LINKAGE int detectAsn1(void *p, Asn1Context* asn1, const uint8_t *cursor); + ENGINE_LINKAGE int checkHdrOpt(void *p, HdrOptCheck *optData); + ENGINE_LINKAGE int loopEval(void *p, LoopInfo *loop, const uint8_t **cursor); +@@ -506,8 +507,12 @@ ENGINE_LINKAGE void detectFlagDisable(SF + ENGINE_LINKAGE int getAltDetect(uint8_t **bufPtr, uint16_t *altLenPtr); + ENGINE_LINKAGE void setAltDetect(uint8_t *buf, uint16_t altLen); + +-ENGINE_LINKAGE int pcreExecWrapper(const PCREInfo *pcre_info, const char *buf, int len, int start_offset, +- int options, int *ovector, int ovecsize); ++ENGINE_LINKAGE void *pcre2MatchDataCreateWrapper(void); ++ENGINE_LINKAGE void pcre2MatchDataFreeWrapper(void *match_data); ++ENGINE_LINKAGE int pcre2GetOvectorCountWrapper(void *match_data); ++ENGINE_LINKAGE void *pcre2GetOvectorPointerWrapper(void *match_data); ++ENGINE_LINKAGE int pcre2MatchWrapper(const PCRE2Info *pcre2_info, const char *buf, int len, int start_offset, ++ int options, const void *match_data); + + static inline int invertMatchResult(int retVal) + { +--- a/src/dynamic-plugins/sf_engine/sf_snort_plugin_pcre.c ++++ b/src/dynamic-plugins/sf_engine/sf_snort_plugin_pcre.c +@@ -25,13 +25,14 @@ + * Date: 5/2005 + * + * +- * PCRE operations for dynamic rule engine ++ * PCRE2 operations for dynamic rule engine + */ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "sf_types.h" + #include "snort_debug.h" + #include "sf_dynamic_define.h" +@@ -43,32 +44,38 @@ + /* Need access to the snort-isms that were passed to the engine */ + extern int checkCursorSimple(const uint8_t *cursor, int flags, const uint8_t *start, const uint8_t *end, int offset); + extern int checkCursorInternal(void *p, int flags, int offset, const uint8_t *cursor); +-static int pcreMatchInternal(void *, PCREInfo*, const uint8_t **); ++static int pcreMatchInternal(void *, PCRE2Info*, const uint8_t **); + +-int PCRESetup(struct _SnortConfig *sc, Rule *rule, PCREInfo *pcreInfo) ++int PCRE2Setup(struct _SnortConfig *sc, Rule *rule, PCRE2Info *pcre2Info) + { +- const char *error; +- int erroffset; ++ size_t erroffset; ++ int errorcode; + +- pcreInfo->compiled_expr = (void *)_ded.pcreCompile(pcreInfo->expr, +- pcreInfo->compile_flags, +- &error, ++ pcre2Info->compiled_expr = (void *)_ded.pcre2Compile(pcre2Info->expr, ++ pcre2Info->compile_flags, ++ &errorcode, + &erroffset, + NULL); + +- if (!pcreInfo->compiled_expr) ++ if (!pcre2Info->compiled_expr) + { + /* error doing compilation. */ +- _ded.errMsg("Failed to compile PCRE in dynamic rule [%d:%d]\n", ++ _ded.errMsg("Failed to compile PCRE2 in dynamic rule [%d:%d]\n", + rule->info.genID, rule->info.sigID); + return -1; + } +- else ++ ++ pcre2Info->match_context = _ded.pcre2MatchContextCreate(NULL); ++ if (!pcre2Info->match_context) + { +- pcreInfo->compiled_extra = (void *)_ded.pcreStudy(sc, pcreInfo->compiled_expr, pcreInfo->compile_flags, &error); ++ /* error doing match context */ ++ _ded.errMsg("Failed to allocate mem for PCRE2 match context [%d:%d]\n", ++ rule->info.genID, rule->info.sigID); ++ return -1; + } + +- if (error) ++ errorcode = _ded.pcre2JITCompile(sc, pcre2Info->compiled_expr, pcre2Info->match_context, pcre2Info->compile_flags); ++ if (errorcode) + { + /* error doing study. */ + _ded.errMsg("Failed to study PCRE in dynamic rule [%d:%d]\n", +@@ -76,51 +83,82 @@ int PCRESetup(struct _SnortConfig *sc, R + return -1; + } + +- _ded.pcreCapture(sc, pcreInfo->compiled_expr, pcreInfo->compiled_extra); ++ _ded.pcre2Capture(sc, pcre2Info->compiled_expr); + + + return 0; + } + + /** +- * * Wrapper for pcre_exec to expose ovector. ++ * * Wrapper for pcre2_match_data_create to run match_data. ++ * */ ++ENGINE_LINKAGE void *pcre2MatchDataCreateWrapper(void) ++{ ++ return _ded.pcre2MatchDataCreate(_ded.pcre2OvectorSize(), NULL); ++} ++ ++/** ++ * * Wrapper for pcre2_match_data_free to run match_data. ++ * */ ++ENGINE_LINKAGE void pcre2MatchDataFreeWrapper(void *match_data) ++{ ++ _ded.pcre2MatchDataFree(match_data); ++} ++ ++/** ++ * * Wrapper for pcre2_get_ovector_count to run match_data. ++ * */ ++ENGINE_LINKAGE int pcre2GetOvectorCountWrapper(void *match_data) ++{ ++ return _ded.pcre2GetOvectorCount(match_data); ++} ++ ++/** ++ * * Wrapper for pcre2_get_ovector_pointer to run match_data. + * */ +-ENGINE_LINKAGE int pcreExecWrapper(const PCREInfo *pcre_info, const char *buf, int len, int start_offset, +- int options, int *ovector, int ovecsize) ++ENGINE_LINKAGE void *pcre2GetOvectorPointerWrapper(void *match_data) ++{ ++ return _ded.pcre2GetOvectorPointer(match_data); ++} ++ ++/** ++ * * Wrapper for pcre2_match to run match_data. ++ * */ ++ENGINE_LINKAGE int pcre2ExecWrapper(const PCRE2Info *pcre2_info, const char *buf, int len, int start_offset, ++ int options, const void *match_data) + { + int result; + int matched; + +- if(pcre_info == NULL ++ if(pcre2_info == NULL + || buf == NULL + || len <= 0 + || start_offset < 0 + || start_offset >= len +- || ovector == NULL) ++ || match_data == NULL) + { + return 0; + } + +- result = _ded.pcreExec(pcre_info->compiled_expr, /* result of pcre_compile() */ +- pcre_info->compiled_extra, /* result of pcre_study() */ ++ result = _ded.pcre2MatchReal(pcre2_info->compiled_expr, /* result of pcre_compile() */ + buf, /* the subject string */ + len, /* the length of the subject string */ + start_offset, /* start at offset 0 in the subject */ + options, /* options(handled at compile time */ +- ovector, /* vector for substring information */ +- ovecsize); /* number of elements in the vector */ ++ match_data, /* match_data for results */ ++ pcre2_info->match_context); /* match_context for JIT limits */ + + if(result >= 0) + { + matched = 1; + } +- else if(result == PCRE_ERROR_NOMATCH) ++ else if(result == PCRE2_ERROR_NOMATCH) + { + matched = 0; + } + else + { +- DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre_exec error : %d \n", result);); ++ DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre_match error : %d \n", result);); + return 0; + } + +@@ -128,7 +166,7 @@ ENGINE_LINKAGE int pcreExecWrapper(const + } + + /* +- * we need to specify the vector length for our pcre_exec call. we only care ++ * we need to specify the vector length for our pcre2_match call. we only care + * about the first vector, which if the match is successful will include the + * offset to the end of the full pattern match. If we decide to store other + * matches, make *SURE* that this is a multiple of 3 as pcre requires it. +@@ -136,7 +174,7 @@ ENGINE_LINKAGE int pcreExecWrapper(const + #define SNORT_PCRE_OVECTOR_SIZE 3 + + /** +- * Perform a search of the PCRE data. ++ * Perform a search of the PCRE2 data. + * + * @param pcre_data structure that options and patterns are passed in + * @param buf buffer to search +@@ -148,21 +186,18 @@ ENGINE_LINKAGE int pcreExecWrapper(const + * + * @return 1 when we find the string, 0 when we don't (unless we've been passed a flag to invert) + */ +-static int pcre_test(const PCREInfo *pcre_info, ++static int pcre2_test(const PCRE2Info *pcre2_info, + const char *buf, + int len, + int start_offset, + int *found_offset) + { ++ void *match_data; ++ size_t *ovector; + int matched; + int result; + +- int *ovector; +- int ovector_size; +- +- _ded.pcreOvectorInfo(&ovector, &ovector_size); +- +- if(pcre_info == NULL ++ if(pcre2_info == NULL + || buf == NULL + || len <= 0 + || start_offset < 0 +@@ -174,50 +209,59 @@ static int pcre_test(const PCREInfo *pcr + return 0; + } + ++ match_data = _ded.pcre2MatchDataCreate(_ded.pcre2OvectorSize(), NULL); ++ if (!match_data) { ++ DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, ++ "Returning 0 because match data failed!\n");); ++ return 0; ++ } ++ + *found_offset = -1; + +- result = _ded.pcreExec(pcre_info->compiled_expr,/* result of pcre_compile() */ +- pcre_info->compiled_extra, /* result of pcre_study() */ ++ result = _ded.pcre2MatchReal(pcre2_info->compiled_expr,/* result of pcre_compile() */ + buf, /* the subject string */ + len, /* the length of the subject string */ + start_offset, /* start at offset 0 in the subject */ + 0, /* options(handled at compile time */ +- ovector, /* vector for substring information */ +- ovector_size); /* number of elements in the vector */ ++ match_data, /* match_data vector */ ++ pcre2_info->match_context); /* match context for limits */ + + if(result >= 0) + { + matched = 1; + } +- else if(result == PCRE_ERROR_NOMATCH) ++ else if(result == PCRE2_ERROR_NOMATCH) + { + matched = 0; + } + else + { +- DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre_exec error : %d \n", result);); ++ _ded.pcre2MatchDataFree(match_data); ++ DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "pcre_match error : %d \n", result);); + return 0; + } + + if (found_offset) + { ++ ovector = _ded.pcre2GetOvectorPointer(match_data); + *found_offset = ovector[1]; + DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, + "Setting buffer and found_offset: %p %d\n", + buf, found_offset);); + } + ++ _ded.pcre2MatchDataFree(match_data); + return matched; + } + +-ENGINE_LINKAGE int pcreMatch(void *p, PCREInfo* pcre_info, const uint8_t **cursor) ++ENGINE_LINKAGE int pcre2Match(void *p, PCRE2Info* pcre_info, const uint8_t **cursor) + { + if (pcre_info->flags & NOT_FLAG) + return invertMatchResult(pcreMatchInternal(p, pcre_info, cursor)); + return pcreMatchInternal(p, pcre_info, cursor); + } + +-static int pcreMatchInternal(void *p, PCREInfo* pcre_info, const uint8_t **cursor) ++static int pcreMatchInternal(void *p, PCRE2Info* pcre_info, const uint8_t **cursor) + { + const uint8_t *buffer_start; + int buffer_len; +@@ -295,7 +339,7 @@ static int pcreMatchInternal(void *p, PC + } + + +- pcre_found = pcre_test(pcre_info, (const char *)buffer_start, buffer_len, pcre_info->offset, &pcre_offset); ++ pcre_found = pcre2_test(pcre_info, (const char *)buffer_start, buffer_len, pcre_info->offset, &pcre_offset); + + if (pcre_found) + { +--- a/src/dynamic-preprocessors/appid/luaDetectorApi.c ++++ b/src/dynamic-preprocessors/appid/luaDetectorApi.c +@@ -38,7 +38,8 @@ + #include "luaDetectorModule.h" + #include "luaDetectorApi.h" + #include "luaDetectorFlowApi.h" +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + #include "httpCommon.h" + #include "sf_multi_mpse.h" + #include "fw_appid.h" +@@ -54,7 +55,6 @@ + #include "detector_cip.h" + + #define DETECTOR "Detector" +-#define OVECCOUNT 30 /* should be a multiple of 3 */ + #define URL_LIST_STEP_SIZE 5000 + + typedef enum { +@@ -1355,7 +1355,7 @@ static int Detector_getPacketDir( + return 1; + } + +-/**Perform a pcre match with grouping. A simple regular expression match with no grouping ++/**Perform a pcre2 match with grouping. A simple regular expression match with no grouping + * can also be performed. + * + * @param Lua_State* - Lua state variable. +@@ -1371,12 +1371,15 @@ static int Detector_getPcreGroups( + Detector *detector; + char *pattern; + unsigned int offset; +- pcre *re; +- int ovector[OVECCOUNT]; +- const char *error; +- int erroffset; ++ pcre2_code *re; ++ pcre2_match_data *match_data; ++ PCRE2_UCHAR error[128]; ++ int errorcode; ++ PCRE2_SIZE erroffset; + int rc, i; + DetectorUserData *detectorUserData = checkDetectorUserData(L, 1); ++ unsigned int oveccount; ++ size_t *ovector; + + pattern = (char *)lua_tostring(L, 2); + offset = lua_tonumber(L, 3); /*offset can be zero, no check necessary. */ +@@ -1390,49 +1393,56 @@ static int Detector_getPcreGroups( + + { + /*compile the regular expression pattern, and handle errors */ +- re = pcre_compile( +- pattern, /*the pattern */ +- PCRE_DOTALL, /*default options - dot matches everything including newline */ +- &error, /*for error message */ +- &erroffset, /*for error offset */ +- NULL); /*use default character tables */ ++ re = pcre2_compile( ++ (PCRE2_SPTR)pattern, /*the pattern */ ++ PCRE2_ZERO_TERMINATED, /*zero terminated string*/ ++ PCRE2_DOTALL, /*default options - dot matches everything including newline */ ++ &errorcode, /*for error message */ ++ &erroffset, /*for error offset */ ++ NULL); /*use default character tables */ + + if (re == NULL) + { +- _dpd.errMsg("PCRE compilation failed at offset %d: %s\n",erroffset, error); ++ pcre2_get_error_message(errorcode, error, 128); ++ _dpd.errMsg("PCRE2 compilation failed at offset %zu: %s\n",erroffset, error); + return 0; + } + ++ match_data = pcre2_match_data_create_from_pattern(re, NULL); ++ if (!match_data) { ++ _dpd.errMsg("PCRE2 failed to alloc data for match data\n"); ++ return 0; ++ } + + /*pattern match against the subject string. */ +- rc = pcre_exec( ++ rc = pcre2_match( + re, /*compiled pattern */ +- NULL, /*no extra data */ +- (char *)detector->validateParams.data, /*subject string */ +- detector->validateParams.size, /*length of the subject */ +- offset, /*offset 0 */ ++ (PCRE2_SPTR)detector->validateParams.data, /*subject string */ ++ (PCRE2_SIZE)detector->validateParams.size, /*length of the subject */ ++ (PCRE2_SIZE)offset, /*offset 0 */ + 0, /*default options */ +- ovector, /*output vector for substring information */ +- OVECCOUNT); /*number of elements in the output vector */ +- ++ match_data, /*output vector for substring information */ ++ NULL); /*number of elements in the output vector */ + + if (rc < 0) + { + /*Matching failed: clubbing PCRE_ERROR_NOMATCH with other errors. */ +- pcre_free(re); ++ pcre2_match_data_free(match_data); ++ pcre2_code_free(re); + return 0; + } + + /*Match succeded */ + + /*printf("\nMatch succeeded at offset %d", ovector[0]); */ +- pcre_free(re); + ++ oveccount = pcre2_get_ovector_count(match_data); ++ ovector = pcre2_get_ovector_pointer(match_data); + + if (rc == 0) + { + /*overflow of matches */ +- rc = OVECCOUNT/3; ++ rc = oveccount/3; + /*printf("ovector only has room for %d captured substrings", rc - 1); */ + _dpd.errMsg("ovector only has room for %d captured substrings\n",rc - 1); + } +@@ -1447,6 +1457,9 @@ static int Detector_getPcreGroups( + lua_pushlstring(L, (char *)detector->validateParams.data + ovector[2*i], ovector[2*i+1] - ovector[2*i]); + } + ++ pcre2_match_data_free(match_data); ++ pcre2_code_free(re); ++ + return rc; + } + +--- a/src/dynamic-preprocessors/imap/snort_imap.h ++++ b/src/dynamic-preprocessors/imap/snort_imap.h +@@ -38,7 +38,8 @@ + + /* Includes ***************************************************************/ + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + + #include "sf_snort_packet.h" + #include "imap_config.h" +@@ -216,8 +217,7 @@ typedef struct _IMAPMimeBoundary + + typedef struct _IMAPPcre + { +- pcre *re; +- pcre_extra *pe; ++ pcre2_code *re; + + } IMAPPcre; + +--- a/src/dynamic-preprocessors/pop/snort_pop.h ++++ b/src/dynamic-preprocessors/pop/snort_pop.h +@@ -38,7 +38,8 @@ + + /* Includes ***************************************************************/ + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + + #include "sf_snort_packet.h" + #include "pop_config.h" +--- a/src/dynamic-preprocessors/smtp/snort_smtp.h ++++ b/src/dynamic-preprocessors/smtp/snort_smtp.h +@@ -39,7 +39,8 @@ + + /* Includes ***************************************************************/ + +-#include ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + + #include "sf_snort_packet.h" + #include "ssl.h" +--- a/src/snort.c ++++ b/src/snort.c +@@ -4449,9 +4449,6 @@ void SnortConfFree(SnortConfig *sc) + + OtnxMatchDataFree(sc->omd); + +- if (sc->pcre_ovector != NULL) +- free(sc->pcre_ovector); +- + if ( sc->event_queue_config ) + EventQueueConfigFree(sc->event_queue_config); + +--- a/src/snort.h ++++ b/src/snort.h +@@ -826,7 +826,6 @@ typedef struct _SnortConfig + long int tagged_packet_limit; /* config tagged_packet_limit */ + long int pcre_match_limit; /* config pcre_match_limit */ + long int pcre_match_limit_recursion; /* config pcre_match_limit_recursion */ +- int *pcre_ovector; + int pcre_ovector_size; + + #ifdef PERF_PROFILING +--- a/src/util.c ++++ b/src/util.c +@@ -78,7 +78,8 @@ static struct mallinfo mi; + #include "plugbase.h" + #include "sf_types.h" + #include "sflsq.h" +-#include "pcre.h" ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include "pcre2.h" + #include "mpse.h" + #include "ppm.h" + #include "active.h" +@@ -175,7 +176,7 @@ double CalcPct(uint64_t cnt, uint64_t to + int DisplayBanner(void) + { + const char * info; +- const char * pcre_ver; ++ PCRE2_UCHAR buffer[32]; + const char * zlib_ver; + + info = getenv("HOSTTYPE"); +@@ -184,7 +185,7 @@ int DisplayBanner(void) + info=""; + } + +- pcre_ver = pcre_version(); ++ pcre2_config(PCRE2_CONFIG_VERSION, buffer); + zlib_ver = zlib_version; + + LogMessage("\n"); +@@ -204,7 +205,7 @@ int DisplayBanner(void) + #ifdef HAVE_PCAP_LIB_VERSION + LogMessage(" Using %s\n", pcap_lib_version()); + #endif +- LogMessage(" Using PCRE version: %s\n", pcre_ver); ++ LogMessage(" Using PCRE2 version: %s\n", buffer); + LogMessage(" Using ZLIB version: %s\n", zlib_ver); + LogMessage("\n"); + diff --git a/net/snort3/Makefile b/net/snort3/Makefile index 5e452d180..5f6b50cc8 100644 --- a/net/snort3/Makefile +++ b/net/snort3/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=snort3 -PKG_VERSION:=3.1.74.0 -PKG_RELEASE:=2 +PKG_VERSION:=3.1.75.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/snort3/snort3/archive/refs/tags/ -PKG_HASH:=4a4529e74bc202303c0330ae8b2317f0bef3ac92ae7216df8cfedfce24ddd129 +PKG_HASH:=c1a1b7d00df5ab45df968f0fb0125eba95bad27c181018b8d68a41e1bb6fc111 PKG_MAINTAINER:=W. Michael Petullo PKG_LICENSE:=GPL-2.0-only diff --git a/net/wifischedule/Makefile b/net/wifischedule/Makefile index 8c26f7051..98e748c4d 100644 --- a/net/wifischedule/Makefile +++ b/net/wifischedule/Makefile @@ -15,8 +15,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wifischedule -PKG_VERSION:=1 -PKG_RELEASE:=3 +PKG_VERSION:=1.0.5 +PKG_RELEASE:=1 PKG_LICENSE:=PRPL PKG_MAINTAINER:=Nils Koenig @@ -53,6 +53,18 @@ define Package/wifischedule/install $(INSTALL_BIN) ./net/usr/bin/wifi_schedule.sh $(1)/usr/bin/wifi_schedule.sh $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DATA) ./net/etc/config/wifi_schedule $(1)/etc/config/wifi_schedule + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DATA) ./net/etc/init.d/wifi_schedule $(1)/etc/init.d/wifi_schedule +endef + +define Package/wifischedule/postinst +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Enabling rc.d symlink for wifischedule" + /etc/init.d/wifi_schedule enable +fi +exit 0 endef $(eval $(call BuildPackage,wifischedule)) diff --git a/net/wifischedule/README.md b/net/wifischedule/README.md index 6d53da5f5..7b40eb87d 100644 --- a/net/wifischedule/README.md +++ b/net/wifischedule/README.md @@ -74,10 +74,11 @@ Then call the script as follows in order to get the necessary cron jobs created: All commands: ``` -wifi_schedule.sh cron|start|stop|forcestop|recheck|getmodules|savemodules|help +wifi_schedule.sh cron|start|startup|stop|forcestop|recheck|getmodules|savemodules|help cron: Create cronjob entries. start: Start wifi. + startup: Checks current timewindow and enables/disables WIFI accordingly. stop: Stop wifi gracefully, i.e. check if there are stations associated and if so keep retrying. forcestop: Stop wifi immediately. recheck: Recheck if wifi can be disabled now. @@ -85,3 +86,6 @@ wifi_schedule.sh cron|start|stop|forcestop|recheck|getmodules|savemodules|help savemodules: Saves a list of automatic determined modules to UCI help: This description. ``` + +## Startup Script: `/etc/init.d/wifi_schedule` +Makes sure time window is checked and WIFI is enabled or disabled accordingly when powering on the router. diff --git a/net/wifischedule/net/etc/init.d/wifi_schedule b/net/wifischedule/net/etc/init.d/wifi_schedule new file mode 100644 index 000000000..9156fdc12 --- /dev/null +++ b/net/wifischedule/net/etc/init.d/wifi_schedule @@ -0,0 +1,8 @@ +#!/bin/sh /etc/rc.common +# Startup Script for wifi_schedule + +START=100 + +start() { + /usr/bin/wifi_schedule.sh startup +} diff --git a/net/wifischedule/net/usr/bin/wifi_schedule.sh b/net/wifischedule/net/usr/bin/wifi_schedule.sh index be483d0bc..9787bc37d 100755 --- a/net/wifischedule/net/usr/bin/wifi_schedule.sh +++ b/net/wifischedule/net/usr/bin/wifi_schedule.sh @@ -14,6 +14,8 @@ # # Author: Nils Koenig +set -o pipefail + SCRIPT=$0 LOCKFILE=/tmp/wifi_schedule.lock LOGFILE=/tmp/log/wifi_schedule.log @@ -122,10 +124,46 @@ _enable_wifi_schedule() return 0 } +_is_earlier() +{ + local hhmm=$1 + local ret=1 + if [[ $(date +%H) -lt ${hhmm:0:2} ]] + then + ret=0 + fi + if [[ $(date +%H) -eq ${hhmm:0:2} && $(date +%M) -lt ${hhmm:3:4} ]] + then + ret=0 + fi + echo $ret +} + +# returns 0 if now() is in $entry +_check_startup_timewindow() +{ + local entry=$1 + local starttime + local stoptime + local dow + starttime=$(_get_uci_value ${PACKAGE}.${entry}.starttime) || _exit 1 + stoptime=$(_get_uci_value ${PACKAGE}.${entry}.stoptime) || _exit 1 + dow=$(_get_uci_value_raw ${PACKAGE}.${entry}.daysofweek) || _exit 1 + + echo $dow | grep $(date +%A) > /dev/null 2>&1 + rc=$? + + if [[ $rc -eq 0 && $(date +%H) -ge ${starttime:0:2} && $(date +%M) -ge ${starttime:3:4} && $(_is_earlier $stoptime) -eq 0 ]] + then + echo 0 + else + echo 1 + fi +} + _get_wireless_interfaces() { - local n=$(cat /proc/net/wireless | wc -l) - cat /proc/net/wireless | tail -n $(($n - 2))|awk -F':' '{print $1}'| sed 's/ //' + iwinfo | grep ESSID | cut -f 1 -s -d" " } @@ -218,6 +256,38 @@ _create_cron_entries() done } +_should_wifi_enabled() +{ + + local enable_wifi=0 + local entries=$(uci show ${PACKAGE} 2> /dev/null | awk -F'.' '{print $2}' | grep -v '=' | grep -v '@global\[0\]' | uniq | sort) + local _entry + for _entry in ${entries} + do + local status + status=$(_get_uci_value ${PACKAGE}.${_entry}.enabled) || _exit 1 + if [ ${status} -eq 1 ] + then + enable_wifi=$(_check_startup_timewindow $_entry) + fi + done + echo ${enable_wifi} +} + +startup() +{ + _log "startup" + local _enable_wifi=$(_should_wifi_enabled) + if [[ ${_enable_wifi} -eq 0 ]] + then + _log "enable wifi" + enable_wifi + else + _log "disable wifi" + disable_wifi + fi +} + check_cron_status() { local global_enabled @@ -231,7 +301,7 @@ check_cron_status() disable_wifi() { _rm_cron_script "${SCRIPT} recheck" - /sbin/wifi down + _set_status_wifi_uci 1 local unload_modules unload_modules=$(_get_uci_value_raw ${GLOBAL}.unload_modules) || _exit 1 if [[ "${unload_modules}" == "1" ]]; then @@ -241,7 +311,7 @@ disable_wifi() soft_disable_wifi() { - local _disable_wifi=1 + local _disable_wifi=0 #0: disable wifi, 1: do not disable wifi local iwinfo=/usr/bin/iwinfo if [ ! -e ${iwinfo} ]; then _log "${iwinfo} not available, skipping" @@ -261,14 +331,18 @@ soft_disable_wifi() fi if [ -n "${stations}" ]; then - _disable_wifi=0 + _disable_wifi=1 _log "Station(s) $(echo ${stations}) associated on ${_if}" fi done - if [ ${_disable_wifi} -eq 1 ]; then + local _wifi_enabled=$(_should_wifi_enabled) + if [[ ${_disable_wifi} -eq 0 && ${_wifi_enabled} -eq 1 ]]; then _log "No stations associated, disable wifi." disable_wifi + elif [[ ${_disable_wifi} -eq 0 && ${_wifi_enabled} -eq 0 ]]; then + _log "Do not disable wifi since there is an allow timeframe, skip rechecking." + _rm_cron_script "${SCRIPT} recheck" else _log "Could not disable wifi due to associated stations, retrying..." local recheck_interval=$(_get_uci_value ${GLOBAL}.recheck_interval) @@ -276,6 +350,17 @@ soft_disable_wifi() fi } +_set_status_wifi_uci() +{ + local status=$1 + local radios=$(uci show wireless | grep radio | awk -F'.' '{print $2}' | grep -v '[=|@]' | sort | uniq) + for radio in ${radios} + do + uci set wireless.${radio}.disabled=${status} + done + uci commit +} + enable_wifi() { _rm_cron_script "${SCRIPT} recheck" @@ -284,18 +369,20 @@ enable_wifi() if [[ "${unload_modules}" == "1" ]]; then _load_modules fi + _set_status_wifi_uci 0 /sbin/wifi } usage() { echo "" - echo "$0 cron|start|stop|forcestop|recheck|getmodules|savemodules|help" + echo "$0 cron|start|startup|stop|forcestop|recheck|getmodules|savemodules|help" echo "" echo " UCI Config File: /etc/config/${PACKAGE}" echo "" echo " cron: Create cronjob entries." echo " start: Start wifi." + echo " startup: Checks current timewindow and enables/disables WIFI accordingly." echo " stop: Stop wifi gracefully, i.e. check if there are stations associated and if so keep retrying." echo " forcestop: Stop wifi immediately." echo " recheck: Recheck if wifi can be disabled now." @@ -305,16 +392,28 @@ usage() echo "" } +_cleanup() +{ + lock -u ${LOCKFILE} + rm ${LOCKFILE} +} + ############################################################################### # MAIN ############################################################################### +trap _cleanup EXIT + LOGGING=$(_get_uci_value ${GLOBAL}.logging) || _exit 1 _log ${SCRIPT} $1 $2 lock ${LOCKFILE} case "$1" in - cron) check_cron_status ;; + cron) + check_cron_status + startup + ;; start) enable_wifi ;; + startup) startup ;; forcestop) disable_wifi ;; stop) soft_disable_wifi ;; recheck) soft_disable_wifi ;; diff --git a/net/yggdrasil/Makefile b/net/yggdrasil/Makefile index a40a9f5be..71d6b5f48 100644 --- a/net/yggdrasil/Makefile +++ b/net/yggdrasil/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=yggdrasil -PKG_VERSION:=0.4.7 +PKG_VERSION:=0.5.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/yggdrasil-network/yggdrasil-go/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=47429f75b87d9b2450108471991e84c90d748606642e8778e9f578485b05a56f +PKG_HASH:=c1cceb9a7a4a8959536b1d930ca081bcfbc76ab655e4bcb55d5d0ab6520d9241 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-go-$(PKG_VERSION) PKG_MAINTAINER:=William Fleurant @@ -33,7 +33,7 @@ define Package/yggdrasil SUBMENU:=Routing and Redirection TITLE:=Yggdrasil supports end-to-end encrypted IPv6 networks URL:=https://yggdrasil-network.github.io/ - DEPENDS:=$(GO_ARCH_DEPENDS) @IPV6 +kmod-tun +dkjson +libuci-lua + DEPENDS:=$(GO_ARCH_DEPENDS) @IPV6 +kmod-tun endef define Package/yggdrasil/description @@ -46,14 +46,9 @@ define Package/yggdrasil/description interfaces simultaneously with much greater throughput. endef -define Package/yggdrasil/conffiles -/etc/config/yggdrasil -endef - define Package/yggdrasil/install $(INSTALL_DIR) \ - $(1)/etc/init.d \ - $(1)/etc/uci-defaults \ + $(1)/lib/netifd/proto \ $(1)/usr/sbin $(INSTALL_BIN) \ @@ -65,16 +60,8 @@ define Package/yggdrasil/install $(1)/usr/sbin $(INSTALL_BIN) \ - ./files/ygguci \ - $(1)/usr/sbin - - $(INSTALL_BIN) \ - ./files/yggdrasil.defaults \ - $(1)/etc/uci-defaults/yggdrasil - - $(INSTALL_BIN) \ - ./files/yggdrasil.init \ - $(1)/etc/init.d/yggdrasil + ./files/yggdrasil.sh \ + $(1)/lib/netifd/proto endef $(eval $(call GoBinPackage,yggdrasil)) diff --git a/net/yggdrasil/files/yggdrasil.defaults b/net/yggdrasil/files/yggdrasil.defaults deleted file mode 100644 index 269726233..000000000 --- a/net/yggdrasil/files/yggdrasil.defaults +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh - -yggConfig="/etc/config/yggdrasil" - -first_boot_genConfig() -{ - . /usr/share/libubox/jshn.sh - boardcfg=$(ubus call system board) - touch ${yggConfig} - yggdrasil -genconf -json | ygguci set - - json_load "$boardcfg" - json_get_var kernel kernel - json_get_var system system - json_get_var model model - json_get_var board_name board_name - nodeinfo='{"kernel": "'$kernel'", "hostname":"'OpenWrt'", "system": "'$system'", "model": "'$model'", "board_name": "'$board_name'"}' - - uci set yggdrasil.yggdrasil.IfName="ygg0" - uci set yggdrasil.yggdrasil.NodeInfo="$nodeinfo" - uci commit yggdrasil -} - -if [ -e /etc/yggdrasil.conf ]; then - echo "config: import config from /etc/yggdrasil.conf to /etc/config/yggdrasil" | logger -t yggdrasil - touch ${yggConfig} - cat /etc/yggdrasil.conf | ygguci set - mv /etc/yggdrasil.conf /etc/yggdrasil.conf.bak -elif [ ! -e ${yggConfig} ]; then - echo "first_boot: adding system board details to NodeInfo[] in NEW config: ${yggConfig}" | logger -t yggdrasil - - first_boot_genConfig - - # create the network interface - uci -q batch <<-EOF >/dev/null - set network.yggdrasil=interface - set network.yggdrasil.device=ygg0 - set network.yggdrasil.proto=none -EOF - - # create the firewall zone - uci -q batch <<-EOF >/dev/null - set firewall.yggdrasil=zone - set firewall.yggdrasil.name=yggdrasil - add_list firewall.yggdrasil.network=yggdrasil - set firewall.yggdrasil.input=REJECT - set firewall.yggdrasil.output=ACCEPT - set firewall.yggdrasil.forward=REJECT - set firewall.yggdrasil.conntrack=1 -EOF - - # allow ICMP from yggdrasil zone, e.g. ping6 - uci -q batch <<-EOF >/dev/null - add firewall rule - set firewall.@rule[-1].name='Allow-ICMPv6-yggdrasil' - set firewall.@rule[-1].src=yggdrasil - set firewall.@rule[-1].proto=icmp - add_list firewall.@rule[-1].icmp_type=echo-request - add_list firewall.@rule[-1].icmp_type=echo-reply - add_list firewall.@rule[-1].icmp_type=destination-unreachable - add_list firewall.@rule[-1].icmp_type=packet-too-big - add_list firewall.@rule[-1].icmp_type=time-exceeded - add_list firewall.@rule[-1].icmp_type=bad-header - add_list firewall.@rule[-1].icmp_type=unknown-header-type - set firewall.@rule[-1].limit='1000/sec' - set firewall.@rule[-1].family=ipv6 - set firewall.@rule[-1].target=ACCEPT -EOF - - # allow SSH from yggdrasil zone, needs to be explicitly enabled - uci -q batch <<-EOF >/dev/null - add firewall rule - set firewall.@rule[-1].enabled=0 - set firewall.@rule[-1].name='Allow-SSH-yggdrasil' - set firewall.@rule[-1].src=yggdrasil - set firewall.@rule[-1].proto=tcp - set firewall.@rule[-1].dest_port=22 - set firewall.@rule[-1].target=ACCEPT -EOF - - # allow LuCI access from yggdrasil zone, needs to be explicitly enabled - uci -q batch <<-EOF >/dev/null - add firewall rule - set firewall.@rule[-1].enabled=0 - set firewall.@rule[-1].name='Allow-HTTP-yggdrasil' - set firewall.@rule[-1].src=yggdrasil - set firewall.@rule[-1].proto=tcp - set firewall.@rule[-1].dest_port=80 - set firewall.@rule[-1].target=ACCEPT -EOF - - # allow LuCI access with SSL from yggdrasil zone, needs to be explicitly enabled - uci -q batch <<-EOF >/dev/null - add firewall rule - set firewall.@rule[-1].enabled=0 - set firewall.@rule[-1].name='Allow-HTTPS-yggdrasil' - set firewall.@rule[-1].src=yggdrasil - set firewall.@rule[-1].proto=tcp - set firewall.@rule[-1].dest_port=443 - set firewall.@rule[-1].target=ACCEPT -EOF - - uci commit firewall - uci commit network - -else - : -fi - -exit 0 diff --git a/net/yggdrasil/files/yggdrasil.init b/net/yggdrasil/files/yggdrasil.init deleted file mode 100755 index 3510e3a3c..000000000 --- a/net/yggdrasil/files/yggdrasil.init +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=90 -STOP=85 - -USE_PROCD=1 -BIN_FILE="/usr/sbin/yggdrasil" -CONFIG_FILE="/tmp/yggdrasil.conf" -DAEMON_OPTS="-useconffile $CONFIG_FILE" - -start_service() -{ - [ -f /etc/uci-defaults/yggdrasil ] && ( . /etc/uci-defaults/yggdrasil ) - - /usr/sbin/ygguci get | $BIN_FILE -useconf -normaliseconf -json > $CONFIG_FILE - - procd_open_instance - procd_set_param respawn - procd_set_param command $BIN_FILE $DAEMON_OPTS - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_close_instance -} - -reload_service() -{ - restart -} - -service_triggers() -{ - procd_add_reload_trigger yggdrasil -} diff --git a/net/yggdrasil/files/yggdrasil.sh b/net/yggdrasil/files/yggdrasil.sh new file mode 100755 index 000000000..9d3c6c3b7 --- /dev/null +++ b/net/yggdrasil/files/yggdrasil.sh @@ -0,0 +1,205 @@ +#!/bin/sh + + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . ../netifd-proto.sh + init_proto "$@" +} + +proto_yggdrasil_init_config() { + proto_config_add_string "private_key" + available=1 +} + +proto_yggdrasil_setup_peer_if_non_interface() { + local peer_config="$1" + local peer_address + local peer_interface + config_get peer_address "${peer_config}" "address" + config_get peer_interface "${peer_config}" "interface" + if [ -z ${peer_interface} ]; then + json_add_string "" ${peer_address} + fi; +} + +proto_yggdrasil_dump_peer_interface() { + local peer_config="$1" + local peer_interface + + config_get peer_interface "${peer_config}" "interface" + + if [ ! -z ${peer_interface} ]; then + peer_interfaces="${peer_interfaces}\n${peer_interface}" + fi; +} + +proto_yggdrasil_setup_peer_if_interface() { + local peer_config="$1" + local peer_address + local peer_interface + config_get peer_interface "${peer_config}" "interface" + if [ "${peer_interface}" = "${peer_interface_filter}" ]; then + config_get peer_address "${peer_config}" "address" + json_add_string "" ${peer_address} + fi; +} + +proto_yggdrasil_append_to_interface_regex() { + if [ -z "${regex}" ]; then + regex="$1" + else + regex="${regex}|$1"; + fi; +} + +proto_yggdrasil_setup_multicast_interface() { + local interface_config="$1" + local beacon + local listen + local port=0 + local password + local regex="" + + config_get beacon "${interface_config}" "beacon" + config_get listen "${interface_config}" "listen" + config_get port "${interface_config}" "port" + config_get password "${interface_config}" "password" + + json_add_object "" + json_add_boolean "Beacon" $beacon + json_add_boolean "Listen" $listen + if [ ! -z ${port} ]; then + json_add_int "Port" $port + else + json_add_int "Port" 0 + fi; + if [ ! -z ${password} ]; then + json_add_string "Password" $password + fi; + + config_list_foreach "${interface_config}" interface proto_yggdrasil_append_to_interface_regex + + json_add_string "Regex" "^(${regex})\$" + + json_close_object +} + +proto_yggdrasil_add_string() { + json_add_string "" $1 +} + +proto_yggdrasil_generate_keypair() { + json_load "$(yggdrasil -genconf -json)" + json_get_vars PrivateKey + json_cleanup + private_key=$PrivateKey + public_key=${PrivateKey:64} +} + +proto_yggdrasil_setup() { + local config="$1" + local device="$2" + local ygg_dir="/tmp/yggdrasil" + local ygg_cfg="${ygg_dir}/${config}.conf" + local ygg_sock="unix://${ygg_dir}/${config}.sock" + + + local private_key + local public_key + local mtu + local listen_addresses + local whitelisted_keys + local node_info + local node_info_privacy + + config_load network + config_get private_key "${config}" "private_key" + config_get public_key "${config}" "public_key" + config_get mtu "${config}" "mtu" + config_get node_info "${config}" "node_info" + config_get node_info_privacy "${config}" "node_info_privacy" + + if [ -z $private_key ]; then + proto_yggdrasil_generate_keypair + fi; + + umask 077 + mkdir -p "${ygg_dir}" + + if [ $private_key = "auto" ]; then + proto_yggdrasil_generate_keypair + uci -t ${ygg_dir}/.uci.${config} batch < "${ygg_cfg}.1" + awk -v s='"%%_YGGDRASIL_NODEINFO_TEMPLATE_%%"' -v r="${node_info}" '{gsub(s, r)} 1' "${ygg_cfg}.1" > ${ygg_cfg} + rm "${ygg_cfg}.1" + + proto_run_command "$config" /usr/sbin/yggdrasil -useconffile "${ygg_cfg}" + proto_init_update "$config" 1 + proto_add_ipv6_address "$(yggdrasil -useconffile "${ygg_cfg}" -address)" "7" + proto_add_ipv6_prefix "$(yggdrasil -useconffile "${ygg_cfg}" -subnet)" + proto_send_update "$config" +} + +proto_yggdrasil_teardown() { + local interface="$1" + proto_kill_command "$interface" +} + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol yggdrasil +} diff --git a/net/yggdrasil/files/ygguci b/net/yggdrasil/files/ygguci deleted file mode 100755 index cdeb3c1a9..000000000 --- a/net/yggdrasil/files/ygguci +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/env lua - -dkjson = require("dkjson") -uci = require("uci") - -UCI = {} - ---- Return the configuration defaults as a table suitable for JSON output --- --- Mostly taken from yggdrasil -genconf -json --- @return table with configuration defaults -function UCI.defaults() - return { - AdminListen = "unix:///var/run/yggdrasil.sock", IfName = "ygg0", - NodeInfoPrivacy = false, - IfMTU = 65535, - - Peers = { }, Listen = { }, MulticastInterfaces = { }, AllowedPublicKeys = { }, - InterfacePeers = setmetatable({ }, {__jsontype = "object"}), - NodeInfo = setmetatable({ }, {__jsontype = "object"}) - } -end - ---- Return the yggdrasil configuration as a table suitable for JSON output --- --- @return table with yggdrasil configuration -function UCI.get() - local obj = UCI.defaults() - - local cursor = uci.cursor() - local config = cursor:get_all("yggdrasil", "yggdrasil") - if not config then return obj end - - obj.PublicKey = config.PublicKey - obj.PrivateKey = config.PrivateKey - obj.AdminListen = config.AdminListen or obj.AdminListen - obj.IfName = config.IfName or obj.IfName - obj.NodeInfo = dkjson.decode(config.NodeInfo) or obj.NodeInfo - for _, v in pairs({ "NodeInfoPrivacy" }) do - if config[v] ~= nil then obj[v] = to_bool(config[v]) end - end - if config["IfMTU"] ~= nil then obj["IfMTU"] = tonumber(config["IfMTU"]) end - - cursor:foreach("yggdrasil", "peer", function (s) - table.insert(obj.Peers, s.uri) - end) - cursor:foreach("yggdrasil", "listen_address", function (s) - table.insert(obj.Listen, s.uri) - end) - cursor:foreach("yggdrasil", "multicast_interface", function (s) - table.insert(obj.MulticastInterfaces, { - Beacon = to_bool(s.beacon), Listen = to_bool(s.listen), - Port = tonumber(s.port), Regex = s.regex - }) - end) - cursor:foreach("yggdrasil", "allowed_public_key", function (s) - table.insert(obj.AllowedPublicKeys, s.key) - end) - - cursor:foreach("yggdrasil", "interface_peer", function (s) - if obj.InterfacePeers[s.interface] == nil then - obj.InterfacePeers[s.interface] = {} - end - table.insert(obj.InterfacePeers[s["interface"]], s.uri) - end) - - return obj -end - ---- Parse and save updated configuration from JSON input --- --- Transforms general settings into UCI sections, and replaces the UCI config's --- contents with them. --- @param table JSON input --- @return Boolean whether saving succeeded -function UCI.set(obj) - local cursor = uci.cursor() - - for i, section in pairs(cursor:get_all("yggdrasil")) do - cursor:delete("yggdrasil", section[".name"]) - end - - - cursor:set("yggdrasil", "yggdrasil", "yggdrasil") - cursor:set("yggdrasil", "yggdrasil", "PublicKey", obj.PublicKey) - cursor:set("yggdrasil", "yggdrasil", "PrivateKey", obj.PrivateKey) - cursor:set("yggdrasil", "yggdrasil", "AdminListen", obj.AdminListen) - cursor:set("yggdrasil", "yggdrasil", "IfName", obj.IfName) - cursor:set("yggdrasil", "yggdrasil", "NodeInfoPrivacy", to_int(obj.NodeInfoPrivacy)) - cursor:set("yggdrasil", "yggdrasil", "NodeInfo", dkjson.encode(obj.NodeInfo)) - cursor:set("yggdrasil", "yggdrasil", "IfMTU", obj.IfMTU) - - set_values(cursor, "peer", "uri", obj.Peers) - set_values(cursor, "listen_address", "uri", obj.Listen) - - for _, interface in pairs(obj.MulticastInterfaces) do - local name = cursor:add("yggdrasil", "multicast_interface") - cursor:set("yggdrasil", name, "beacon", to_int(interface.Beacon)) - cursor:set("yggdrasil", name, "listen", to_int(interface.Listen)) - cursor:set("yggdrasil", name, "port", interface.Port) - cursor:set("yggdrasil", name, "regex", interface.Regex) - end - - set_values(cursor, "allowed_public_key", "key", obj.AllowedPublicKeys) - - for interface, peers in pairs(obj.InterfacePeers) do - for _, v in pairs(peers) do - local name = cursor:add("yggdrasil", "interface_peer") - cursor:set("yggdrasil", name, "interface", interface) - cursor:set("yggdrasil", name, "uri", v) - end - end - - return cursor:commit("yggdrasil") -end - -function set_values(cursor, section_name, parameter, values) - if values == nil then return false end - - for k, v in pairs(values) do - local name = cursor:add("yggdrasil", section_name) - cursor:set("yggdrasil", name, parameter, v) - end -end - -function to_int(bool) return bool and '1' or '0' end - -function to_bool(int) return int ~= '0' end - -function help() - print("JSON interface to /etc/config/yggdrasil\n\nExamples: \ - ygguci get > /tmp/etc/yggdrasil.conf \ - cat /tmp/etc/yggdrasil.conf | ygguci set \ - uci changes \ - ygguci get | yggdrasil -useconf") -end - --- main - -if arg[1] == "get" then - local json = dkjson.encode(UCI.get(), { indent = true }) - print(json) -elseif arg[1] == "set" then - local json = io.stdin:read("*a") - local obj, pos, err = dkjson.decode(json, 1, nil) - - if obj then - UCI.set(obj) - else - print("dkjson: " .. err) - os.exit(1) - end -else - help() -end diff --git a/utils/crun/Makefile b/utils/crun/Makefile index 332c7844a..9971adee5 100644 --- a/utils/crun/Makefile +++ b/utils/crun/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=crun -PKG_VERSION:=1.9.2 +PKG_VERSION:=1.12 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/containers/crun/tar.gz/$(PKG_VERSION)? -PKG_HASH:=a5ed2984a9ebb3e0e5cba0781832f03931423097a56f48a948ab034b46726aef +PKG_HASH:=e4afa9dc5b3b851435b990331a013c6cb6064f3206609782f01486dff2446522 PKG_BUILD_DEPENDS:=argp-standalone PKG_BUILD_PARALLEL:=1 diff --git a/utils/podman/Makefile b/utils/podman/Makefile index 7a785f537..cdcc2be54 100644 --- a/utils/podman/Makefile +++ b/utils/podman/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=podman -PKG_VERSION:=4.7.1 +PKG_VERSION:=4.8.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/containers/podman/archive/v$(PKG_VERSION) -PKG_HASH:=b785fe69041a0f222a8e1f8165816d767cb9bff5418f3f559547da82c0c279cc +PKG_HASH:=cd0afd1fb493b0c099fd8634525f318f35e4e84c1d7735d8426a722a4d5c8409 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE @@ -39,7 +39,7 @@ define Package/podman CATEGORY:=Utilities TITLE:=Podman URL:=https://podman.io - DEPENDS:=$(GO_ARCH_DEPENDS) +conmon +libgpgme +libseccomp +nsenter +zoneinfo-simple +kmod-veth +slirp4netns +netavark +aardvark-dns +catatonit +PODMAN_SELINUX_SUPPORT:libselinux + DEPENDS:=$(GO_ARCH_DEPENDS) +conmon +libgpgme +libseccomp +nsenter +zoneinfo-simple +kmod-veth +slirp4netns +netavark +aardvark-dns +catatonit +crun +PODMAN_SELINUX_SUPPORT:libselinux endef define Package/podman/description diff --git a/utils/podman/files/containers.conf b/utils/podman/files/containers.conf index 13d3fb295..b956f0db0 100644 --- a/utils/podman/files/containers.conf +++ b/utils/podman/files/containers.conf @@ -3,11 +3,14 @@ [containers] #annotations = [] #apparmor_profile = "container-default" +#base_hosts_file = "" +#cgroup_conf = [] cgroupns = "private" cgroups = "enabled" netns = "private" #pidns = "private" -#rootless_networking = "slirp4netns" +#userns = "host" +#utsns = "private" #seccomp_profile = "/usr/share/containers/seccomp.json" #shm_size = "65536k" @@ -29,30 +32,116 @@ default_sysctls = [ "net.ipv4.ping_group_range=0 0", ] +#devices = [] +#dns_options = [] +#dns_searches = [] +#dns_servers = [] +#env = [ +# "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", +#] + +#env_host = false +#host_containers_internal_ip = "" +#http_proxy = true +#init = false +#ipcns = "shareable" +#keyring = true +#label = true +#label_users = false +#log_driver = "k8s-file" +#log_size_max = -1 +#log_tag = "" +#mounts = [] +#prepare_volume_on_create = false +#privileged = false +#read_only = false +#seccomp_profile = "/usr/share/containers/seccomp.json" +#tz = "" +#umask = "0022" +#volumes = [] + +[secrets] +#driver = "file" + +[secrets.opts] +#root = "/example/directory" + [network] network_backend = "netavark" +#netavark_plugin_dirs = [ +# "/usr/local/libexec/netavark", +# "/usr/libexec/netavark", +# "/usr/local/lib/netavark", +# "/usr/lib/netavark", +#] +#firewall_driver = "none" network_config_dir = "/etc/containers/networks/" default_network = "podman" +#default_subnet = "10.88.0.0/16" +#default_subnet_pools = [ +# {"base" = "10.89.0.0/16", "size" = 24}, +# {"base" = "10.90.0.0/15", "size" = 24}, +# {"base" = "10.92.0.0/14", "size" = 24}, +# {"base" = "10.96.0.0/11", "size" = 24}, +# {"base" = "10.128.0.0/9", "size" = 24}, +#] + +default_rootless_network_cmd = "slirp4netns" +#dns_bind_port = 53 + [engine] +#add_compression = ["gzip", "zstd", "zstd:chunked"] +#compat_api_enforce_docker_hub = true +#compose_providers=[] +#compose_warning_logs = true +#compression_format = "gzip" +#compression_level = 5 cgroup_manager = "cgroupfs" + +conmon_path = [ "/usr/bin/conmon" ] +#conmon_env_vars = [ +# "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +#] + +#database_backend = "" +#detach_keys = "ctrl-p,ctrl-q" +#enable_port_reservation = true +#env = [] +#events_logfile_path="" +#events_logfile_max_size = "1m" events_logger = "none" +#events_container_create_inspect_data = false +#image_default_format = "" #image_default_transport = "docker://" #image_parallel_copies = 0 +#image_volume_mode = "" #infra_command = "/pause" -#infra_image = "k8s.gcr.io/pause:3.4.1" -#lock_type** = "shm" +#infra_image = "" +#lock_type = "shm" +#multi_image_archive = false #namespace = "" -#network_cmd_path = "" +network_cmd_path = "/usr/bin/slirp4netns" +#network_cmd_options = [] +#no_pivot_root = false +#num_locks = 2048 +#pod_exit_policy = "continue" +#pull_policy = "missing" +#remote = false runtime = "crun" -# runtime = "runc" -# runtime = "uxc" -runtime_supports_json = ["crun", "runc", "kata", "uxc"] +runtime_supports_json = ["crun", "runc", "kata", "runsc", "youki", "krun", "uxc"] #runtime_supports_kvm = ["kata", "krun"] #runtime_supports_nocgroups = ["crun", "krun", "uxc"] +#service_timeout = 5 +#stop_timeout = 10 +#exit_command_delay = 300 #static_dir = "/var/lib/containers/storage/libpod" +tmp_dir = "/var/run/libpod" +#volume_path = "/var/lib/containers/storage/volumes" +#volume_plugin_timeout = 5 +#podmansh_timeout = 30 [engine.runtimes] crun = [ @@ -67,8 +156,19 @@ uxc = [ "/sbin/uxc", ] +[engine.volume_plugins] +#testplugin = "/run/podman/plugins/test.sock" + [machine] #cpus = 1 #disk_size = 10 #image = "testing" #memory = 2048 +#user = "core" +#volumes = [ +# "$HOME:$HOME", +#] +#provider = "" + +[farms] +#[farms.list] diff --git a/utils/podman/patches/010-do-not-build-docs.patch b/utils/podman/patches/010-do-not-build-docs.patch index c64c4bd07..b2f1efd49 100644 --- a/utils/podman/patches/010-do-not-build-docs.patch +++ b/utils/podman/patches/010-do-not-build-docs.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -219,7 +219,7 @@ GV_SHA=db608827124caa71ba411cec8ea959bb9 +@@ -224,7 +224,7 @@ GV_VERSION=v0.7.1 default: all .PHONY: all @@ -9,7 +9,7 @@ .PHONY: binaries ifeq ($(shell uname -s),FreeBSD) -@@ -804,7 +804,7 @@ rpm-install: package ## Install rpm pac +@@ -803,7 +803,7 @@ rpm-install: package ## Install rpm pac /usr/bin/podman info # will catch a broken conmon .PHONY: install diff --git a/utils/tesseract/Makefile b/utils/tesseract/Makefile index db43e08e6..faed81050 100644 --- a/utils/tesseract/Makefile +++ b/utils/tesseract/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tesseract -PKG_VERSION:=4.1.1 -PKG_RELEASE:=3 +PKG_VERSION:=5.3.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/tesseract-ocr/tesseract/tar.gz/$(PKG_VERSION)? -PKG_HASH:=2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb +PKG_HASH:=dc4329f85f41191b2d813b71b528ba6047745813474e583ccce8795ff2ff5681 PKG_MAINTAINER:=Valentin Kivachuk PKG_LICENSE:=Apache-2.0 @@ -36,15 +36,17 @@ TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS)) -O3 CMAKE_OPTIONS += \ -DAUTO_OPTIMIZE=OFF \ - -DBUILD_TRAINING_TOOLS=OFF + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TRAINING_TOOLS=OFF \ + -DDISABLE_CURL=ON define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/tesseract $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtesseract.so* $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/lib/cmake - $(CP) $(PKG_INSTALL_DIR)/usr/cmake/*.cmake $(1)/usr/lib/cmake/ + $(INSTALL_DIR) $(1)/usr/lib/cmake/tesseract + $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/tesseract/*.cmake $(1)/usr/lib/cmake/tesseract $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/tesseract.pc $(1)/usr/lib/pkgconfig/ endef diff --git a/utils/tesseract/patches/010-cmake.patch b/utils/tesseract/patches/010-cmake.patch index 2a9f88c79..d6064660d 100644 --- a/utils/tesseract/patches/010-cmake.patch +++ b/utils/tesseract/patches/010-cmake.patch @@ -1,18 +1,27 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -252,15 +252,6 @@ set(AVX2_OPT OFF) - set(FMA_OPT OFF) - set(SSE41_OPT OFF) - set(MARCH_NATIVE_OPT OFF) --foreach(flag ${_enable_vector_unit_list}) # from OptimizeForArchitecture() -- string(TOUPPER "${flag}" flag) -- string(REPLACE "\." "_" flag "${flag}") -- set(simd_flags "${simd_flags} -D${flag}") -- string(REPLACE "_" "" flag "${flag}") -- if("${flag}" MATCHES "AVX|AVX2|FMA|SSE41") -- set("${flag}_OPT" ON) +--- a/cmake/CheckFunctions.cmake ++++ b/cmake/CheckFunctions.cmake +@@ -29,24 +29,6 @@ function(check_leptonica_tiff_support) + " return ret_val;}\n") + if(${CMAKE_VERSION} VERSION_LESS "3.25") + message(STATUS "Testing TIFF support in Leptonica is available with CMake >= 3.25 (you have ${CMAKE_VERSION}))") +- else() +- set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) +- try_run( +- LEPT_TIFF_RESULT +- LEPT_TIFF_COMPILE_SUCCESS +- SOURCE_FROM_CONTENT tiff_test.cpp "${TIFF_TEST}" +- CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${Leptonica_INCLUDE_DIRS}" +- LINK_LIBRARIES ${Leptonica_LIBRARIES} +- COMPILE_OUTPUT_VARIABLE +- COMPILE_OUTPUT) +- if(NOT LEPT_TIFF_COMPILE_SUCCESS) +- message(STATUS "COMPILE_OUTPUT: ${COMPILE_OUTPUT}") +- message(STATUS "Leptonica_INCLUDE_DIRS: ${Leptonica_INCLUDE_DIRS}") +- message(STATUS "Leptonica_LIBRARIES: ${Leptonica_LIBRARIES}") +- message(STATUS "LEPT_TIFF_RESULT: ${LEPT_TIFF_RESULT}") +- message(STATUS "LEPT_TIFF_COMPILE: ${LEPT_TIFF_COMPILE}") +- message(WARNING "Failed to compile test") - endif() --endforeach(flag) - if (NOT MSVC) - set(MARCH_NATIVE_FLAGS "${MARCH_NATIVE_FLAGS} -O3 -ffast-math") - endif() + endif() + endfunction(check_leptonica_tiff_support) + diff --git a/utils/tesseract/patches/020-musl.patch b/utils/tesseract/patches/020-musl.patch deleted file mode 100644 index 821a51d06..000000000 --- a/utils/tesseract/patches/020-musl.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/ccutil/ocrclass.h -+++ b/src/ccutil/ocrclass.h -@@ -28,6 +28,7 @@ - - #include - #include -+#include - #ifdef _WIN32 - #include // for timeval - #endif