From af754e596a8dbb05ed8580c342e7fe02e08b28e0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:11:00 +0200 Subject: Adding upstream version 3.2.3+dfsg. Signed-off-by: Daniel Baumann --- .gitattributes | 5 + .github/workflows/ci-deb.yml | 230 + .github/workflows/ci-rpm.yml | 332 + .github/workflows/ci.yml | 483 + .gitignore | 74 + .travis.yml | 95 + .vscode/c_cpp_properties.json | 28 + .vscode/launch.json | 52 + CONTRIBUTING | 109 + COPYRIGHT | 95 + CREDITS | 2 + INSTALL.rst | 169 + LICENSE | 340 + Make.inc.in | 186 + Makefile | 401 + README.rst | 179 + VERSION | 1 + config.guess | 1701 ++ config.sub | 1855 +++ configure | 16139 +++++++++++++++++++ configure.ac | 2645 +++ doc/.gitignore | 1 + doc/ChangeLog | 189 + doc/Makefile.sphinx | 95 + doc/README | 181 + doc/all.mk | 55 + doc/antora/antora.yml | 18 + doc/antora/modules/ROOT/assets/images/favicon.png | Bin 0 -> 4105 bytes doc/antora/modules/ROOT/assets/images/favicon.svg | 104 + .../modules/ROOT/assets/images/networkradius.png | Bin 0 -> 7126 bytes doc/antora/modules/ROOT/nav.adoc | 1 + doc/antora/modules/ROOT/pages/directories.adoc | 69 + doc/antora/modules/ROOT/pages/index.adoc | 137 + doc/antora/modules/howto/nav.adoc | 19 + doc/antora/modules/howto/pages/index.adoc | 17 + .../modules/howto/pages/protocols/dhcp/enable.adoc | 213 + .../modules/howto/pages/protocols/dhcp/index.adoc | 35 + .../modules/howto/pages/protocols/dhcp/policy.adoc | 14 + .../protocols/dhcp/policy_common_options.adoc | 80 + .../protocols/dhcp/policy_device_options.adoc | 310 + .../pages/protocols/dhcp/policy_ippool_access.adoc | 54 + .../protocols/dhcp/policy_ippool_creation.adoc | 112 + .../protocols/dhcp/policy_network_options.adoc | 237 + .../protocols/dhcp/policy_subnet_options.adoc | 184 + .../howto/pages/protocols/dhcp/prepare.adoc | 59 + .../modules/howto/pages/protocols/dhcp/test.adoc | 143 + .../protocols/proxy/enable_proxy_protocol.adoc | 114 + .../howto/pages/protocols/proxy/enable_radsec.adoc | 188 + .../modules/howto/pages/protocols/proxy/index.adoc | 126 + .../howto/pages/protocols/proxy/radsec_client.adoc | 181 + .../pages/protocols/proxy/radsec_with_haproxy.adoc | 134 + .../pages/protocols/proxy/radsec_with_traefik.adoc | 128 + doc/antora/modules/installation/nav.adoc | 5 + .../modules/installation/pages/dependencies.adoc | 58 + doc/antora/modules/installation/pages/index.adoc | 15 + .../modules/installation/pages/packages.adoc | 22 + doc/antora/modules/installation/pages/source.adoc | 199 + doc/antora/modules/installation/pages/upgrade.adoc | 737 + doc/antora/modules/unlang/.gitignore | 1 + doc/antora/modules/unlang/nav.adoc | 51 + doc/antora/modules/unlang/pages/attr.adoc | 77 + doc/antora/modules/unlang/pages/break.adoc | 28 + doc/antora/modules/unlang/pages/case.adoc | 44 + doc/antora/modules/unlang/pages/condition/and.adoc | 21 + doc/antora/modules/unlang/pages/condition/cmp.adoc | 104 + doc/antora/modules/unlang/pages/condition/eq.adoc | 30 + .../modules/unlang/pages/condition/index.adoc | 85 + doc/antora/modules/unlang/pages/condition/not.adoc | 19 + .../modules/unlang/pages/condition/operands.adoc | 37 + doc/antora/modules/unlang/pages/condition/or.adoc | 21 + .../modules/unlang/pages/condition/para.adoc | 19 + .../modules/unlang/pages/condition/regex.adoc | 180 + .../unlang/pages/condition/return_codes.adoc | 35 + doc/antora/modules/unlang/pages/default.adoc | 47 + doc/antora/modules/unlang/pages/else.adoc | 30 + doc/antora/modules/unlang/pages/elsif.adoc | 43 + doc/antora/modules/unlang/pages/foreach.adoc | 40 + doc/antora/modules/unlang/pages/group.adoc | 39 + doc/antora/modules/unlang/pages/if.adoc | 29 + doc/antora/modules/unlang/pages/index.adoc | 162 + doc/antora/modules/unlang/pages/keywords.adoc | 78 + doc/antora/modules/unlang/pages/list.adoc | 72 + doc/antora/modules/unlang/pages/load-balance.adoc | 32 + doc/antora/modules/unlang/pages/module.adoc | 86 + .../modules/unlang/pages/module_builtin.adoc | 42 + doc/antora/modules/unlang/pages/module_method.adoc | 27 + .../unlang/pages/redundant-load-balance.adoc | 39 + doc/antora/modules/unlang/pages/redundant.adoc | 42 + doc/antora/modules/unlang/pages/return.adoc | 36 + doc/antora/modules/unlang/pages/return_codes.adoc | 17 + doc/antora/modules/unlang/pages/switch.adoc | 83 + .../modules/unlang/pages/type/all_types.adoc | 80 + doc/antora/modules/unlang/pages/type/double.adoc | 39 + doc/antora/modules/unlang/pages/type/index.adoc | 117 + doc/antora/modules/unlang/pages/type/ip.adoc | 15 + doc/antora/modules/unlang/pages/type/numb.adoc | 11 + .../unlang/pages/type/string/backticks.adoc | 38 + .../modules/unlang/pages/type/string/double.adoc | 68 + .../modules/unlang/pages/type/string/escaping.adoc | 14 + .../modules/unlang/pages/type/string/single.adoc | 19 + .../modules/unlang/pages/type/string/unquoted.adoc | 21 + doc/antora/modules/unlang/pages/update.adoc | 160 + .../modules/unlang/pages/xlat/alternation.adoc | 24 + .../modules/unlang/pages/xlat/attribute.adoc | 54 + doc/antora/modules/unlang/pages/xlat/builtin.adoc | 891 + .../modules/unlang/pages/xlat/character.adoc | 80 + doc/antora/modules/unlang/pages/xlat/index.adoc | 56 + doc/antora/modules/unlang/pages/xlat/module.adoc | 18 + .../modules/unlang/partials/rcode_table.adoc | 39 + doc/bugs | 175 + doc/concepts/aaa.rst | 99 + doc/concepts/proxy.rst | 118 + doc/configuration/acct_type.rst | 71 + doc/configuration/autz_type.rst | 88 + doc/configuration/configurable_failover.rst | 476 + doc/configuration/dynamic_home_servers.md | 238 + doc/configuration/load_balance.rst | 172 + doc/configuration/post_auth_type | 44 + doc/configuration/session_type | 10 + doc/configuration/simultaneous_use | 173 + doc/configuration/snmp | 58 + doc/configuration/variables.rst | 151 + doc/deployment/CYGWIN.rst | 283 + doc/deployment/MACOSX | 12 + doc/deployment/OS2 | 22 + doc/deployment/performance-testing | 168 + doc/deployment/supervise-radiusd.rst | 163 + doc/deployment/tuning_guide | 58 + doc/developer/autotools.md | 179 + doc/developer/coding-methods.rst | 242 + doc/developer/contributing.rst | 127 + doc/developer/module_interface.rst | 186 + doc/developer/release-method.rst | 42 + doc/index.rst | 29 + doc/modules/RADIUS-LDAP-eDirectory | 18 + doc/modules/ldap_howto.rst | 1648 ++ doc/modules/mschap.rst | 196 + doc/modules/rlm_dbm | 195 + doc/modules/rlm_eap | 395 + doc/modules/rlm_expiration | 23 + doc/modules/rlm_krb5 | 47 + doc/modules/rlm_pam | 108 + doc/modules/rlm_passwd | 50 + doc/modules/rlm_python | 76 + doc/modules/rlm_soh | 183 + doc/modules/rlm_sql | 283 + doc/modules/rlm_sqlcounter | 182 + doc/modules/rlm_sqlippool | 40 + doc/schemas/ldap/edir/freeradius-clients.ldif | 69 + doc/schemas/ldap/iplanet/freeradius.ldif | 73 + doc/schemas/ldap/iplanet/freeradius.schema | 78 + doc/schemas/ldap/openldap/freeradius-clients.ldif | 17 + .../ldap/openldap/freeradius-clients.schema | 70 + doc/schemas/ldap/openldap/freeradius.ldif | 76 + doc/schemas/ldap/openldap/freeradius.schema | 477 + doc/schemas/ldap/samba/README.txt | 11 + doc/schemas/ldap/samba/freeradius-attrs.ldif | 806 + doc/schemas/ldap/samba/freeradius-classes.ldif | 91 + .../ldap/samba/freeradius-clients-attrs.ldif | 91 + .../ldap/samba/freeradius-clients-classes.ldif | 19 + doc/schemas/ldap/samba/freeradius-user.ldif | 10 + doc/schemas/logstash/README | 95 + doc/schemas/logstash/kibana4-dashboard.json | 123 + doc/schemas/logstash/log-courier.conf | 56 + doc/schemas/logstash/logstash-radius.conf | 256 + doc/schemas/logstash/radius-mapping.sh | 100 + doc/schemas/sql | 8 + doc/source/.gitignore | 4 + doc/source/Doxyfile | 2313 +++ doc/source/extra/client.c | 12 + doc/source/extra/core.c | 31 + doc/source/extra/freeradius.png | Bin 0 -> 14616 bytes doc/source/extra/module.c | 17 + doc/source/extra/toc.c | 102 + doc/vendor/ascend | 57 + doc/vendor/bay | 11 + doc/vendor/cisco.rst | 168 + doc/vendor/proxim | 12 + install-sh | 251 + m4/ac_prog_cc_sunpro.m4 | 17 + m4/ax_cc.m4 | 493 + m4/ax_compare_version.m4 | 177 + m4/ax_prog_perl_modules.m4 | 77 + m4/ax_prog_ruby_version.m4 | 66 + m4/ax_ruby_devel.m4 | 214 + m4/ax_with_prog.m4 | 70 + m4/fr_check_struct_has_member.m4 | 36 + m4/fr_check_type_include.m4 | 21 + m4/fr_have_bounded_attribute.m4 | 26 + m4/fr_have_builtin_bswap64.m4 | 23 + m4/fr_have_builtin_choose_expr.m4 | 24 + m4/fr_have_builtin_types_compatible_p.m4 | 24 + m4/fr_init_module.m4 | 16 + m4/fr_module_start_tests.m4 | 250 + m4/fr_smart_check_include.m4 | 133 + m4/fr_smart_check_lib.m4 | 97 + m4/fr_tls.m4 | 67 + m4/libcurl_check_config.m4 | 251 + m4/python.m4 | 363 + m4/vl_lib_readline.m4 | 45 + main.mk | 1 + man/man1/dhcpclient.1 | 71 + man/man1/rad_counter.1 | 42 + man/man1/radclient.1 | 195 + man/man1/radeapclient.1 | 100 + man/man1/radlast.1 | 21 + man/man1/radtest.1 | 81 + man/man1/radwho.1 | 99 + man/man1/radzap.1 | 68 + man/man1/smbencrypt.1 | 22 + man/man5/checkrad.5 | 95 + man/man5/clients.conf.5 | 46 + man/man5/dictionary.5 | 185 + man/man5/radiusd.conf.5 | 202 + man/man5/radrelay.conf.5 | 146 + man/man5/rlm_always.5 | 119 + man/man5/rlm_attr_filter.5 | 145 + man/man5/rlm_chap.5 | 30 + man/man5/rlm_counter.5 | 89 + man/man5/rlm_detail.5 | 89 + man/man5/rlm_digest.5 | 79 + man/man5/rlm_expr.5 | 113 + man/man5/rlm_files.5 | 95 + man/man5/rlm_idn.5 | 45 + man/man5/rlm_mschap.5 | 110 + man/man5/rlm_pap.5 | 137 + man/man5/rlm_passwd.5 | 136 + man/man5/rlm_realm.5 | 94 + man/man5/rlm_sql.5 | 152 + man/man5/rlm_unbound.5 | 82 + man/man5/rlm_unix.5 | 66 + man/man5/unlang.5 | 900 ++ man/man5/users.5 | 228 + man/man8/radcrypt.8 | 45 + man/man8/raddebug.8 | 104 + man/man8/radiusd.8 | 235 + man/man8/radmin.8 | 188 + man/man8/radrelay.8 | 49 + man/man8/radsniff.8 | 75 + man/man8/radsqlrelay.8 | 90 + man/man8/rlm_sqlippool_tool.8 | 157 + mibs/FREERADIUS-MGMT-MIB.mib | 38 + mibs/FREERADIUS-NOTIFICATION-MIB.mib | 180 + mibs/FREERADIUS-PRODUCT-RADIUSD-MIB.mib | 75 + mibs/FREERADIUS-SMI.mib | 52 + mibs/RADIUS-ACC-CLIENT-MIB.mib | 647 + mibs/RADIUS-ACC-SERVER-MIB.mib | 732 + mibs/RADIUS-AUTH-CLIENT-MIB.mib | 708 + mibs/RADIUS-AUTH-SERVER-MIB.mib | 775 + mibs/RADIUS-STAT-MIB.mib | 349 + mibs/README | 7 + missing | 215 + raddb/.gitignore | 6 + raddb/README.rst | 665 + raddb/all.mk | 152 + raddb/certs/.gitignore | 13 + raddb/certs/Makefile | 186 + raddb/certs/README.md | 248 + raddb/certs/bootstrap | 86 + raddb/certs/ca.cnf | 62 + raddb/certs/client.cnf | 53 + raddb/certs/demoCA/cacert.pem | 22 + raddb/certs/inner-server.cnf | 55 + raddb/certs/ocsp.cnf | 61 + raddb/certs/realms/README.md | 235 + raddb/certs/server.cnf | 72 + raddb/certs/xpextensions | 75 + raddb/clients.conf | 288 + raddb/debug.conf | 9 + raddb/dictionary | 49 + raddb/experimental.conf | 116 + raddb/home_servers/README.md | 21 + raddb/home_servers/tls.conf | 58 + raddb/mods-available/README.rst | 116 + raddb/mods-available/abfab_psk_sql | 15 + raddb/mods-available/always | 81 + raddb/mods-available/attr_filter | 61 + raddb/mods-available/cache | 150 + raddb/mods-available/cache_auth | 116 + raddb/mods-available/chap | 11 + raddb/mods-available/couchbase | 204 + raddb/mods-available/counter | 82 + raddb/mods-available/cui | 53 + raddb/mods-available/date | 35 + raddb/mods-available/detail | 109 + raddb/mods-available/detail.example.com | 27 + raddb/mods-available/detail.log | 75 + raddb/mods-available/dhcp | 19 + raddb/mods-available/dhcp_files | 56 + raddb/mods-available/dhcp_passwd | 20 + raddb/mods-available/dhcp_sql | 92 + raddb/mods-available/dhcp_sqlippool | 101 + raddb/mods-available/digest | 13 + raddb/mods-available/dynamic_clients | 32 + raddb/mods-available/eap | 1115 ++ raddb/mods-available/echo | 123 + raddb/mods-available/etc_group | 32 + raddb/mods-available/exec | 29 + raddb/mods-available/expiration | 13 + raddb/mods-available/expr | 148 + raddb/mods-available/files | 30 + raddb/mods-available/idn | 28 + raddb/mods-available/inner-eap | 107 + raddb/mods-available/ippool | 66 + raddb/mods-available/json | 271 + raddb/mods-available/krb5 | 82 + raddb/mods-available/ldap | 712 + raddb/mods-available/ldap_google | 262 + raddb/mods-available/linelog | 170 + raddb/mods-available/logintime | 23 + raddb/mods-available/mac2ip | 25 + raddb/mods-available/mac2vlan | 18 + raddb/mods-available/moonshot-targeted-ids | 57 + raddb/mods-available/mschap | 253 + raddb/mods-available/ntlm_auth | 18 + raddb/mods-available/opendirectory | 26 + raddb/mods-available/pam | 26 + raddb/mods-available/pap | 18 + raddb/mods-available/passwd | 55 + raddb/mods-available/perl | 94 + raddb/mods-available/preprocess | 62 + raddb/mods-available/python | 65 + raddb/mods-available/python3 | 65 + raddb/mods-available/radutmp | 53 + raddb/mods-available/realm | 80 + raddb/mods-available/redis | 99 + raddb/mods-available/rediswho | 52 + raddb/mods-available/replicate | 42 + raddb/mods-available/rest | 301 + raddb/mods-available/smbpasswd | 16 + raddb/mods-available/smsotp | 94 + raddb/mods-available/soh | 4 + raddb/mods-available/sometimes | 12 + raddb/mods-available/sql | 376 + raddb/mods-available/sql_map | 49 + raddb/mods-available/sqlcounter | 122 + raddb/mods-available/sqlippool | 109 + raddb/mods-available/sradutmp | 16 + raddb/mods-available/totp | 40 + raddb/mods-available/unbound | 13 + raddb/mods-available/unix | 25 + raddb/mods-available/unpack | 105 + raddb/mods-available/utf8 | 14 + raddb/mods-available/wimax | 165 + raddb/mods-available/yubikey | 158 + raddb/mods-config/README.rst | 22 + raddb/mods-config/attr_filter/access_challenge | 19 + raddb/mods-config/attr_filter/access_reject | 18 + raddb/mods-config/attr_filter/accounting_response | 16 + raddb/mods-config/attr_filter/coa | 22 + raddb/mods-config/attr_filter/post-proxy | 121 + raddb/mods-config/attr_filter/pre-proxy | 67 + raddb/mods-config/files/accounting | 27 + raddb/mods-config/files/authorize | 206 + raddb/mods-config/files/dhcp | 153 + raddb/mods-config/files/pre-proxy | 31 + raddb/mods-config/perl/example.pl | 230 + raddb/mods-config/preprocess/hints | 86 + raddb/mods-config/preprocess/huntgroups | 43 + .../realm/freeradius-naptr-to-home-server.sh | 161 + .../sql/counter/mysql/dailycounter.conf | 46 + .../sql/counter/mysql/expire_on_login.conf | 6 + .../sql/counter/mysql/monthlycounter.conf | 34 + .../sql/counter/mysql/noresetcounter.conf | 4 + .../sql/counter/mysql/weeklycounter.conf | 11 + .../sql/counter/postgresql/dailycounter.conf | 34 + .../sql/counter/postgresql/expire_on_login.conf | 6 + .../sql/counter/postgresql/monthlycounter.conf | 31 + .../sql/counter/postgresql/noresetcounter.conf | 4 + .../sql/counter/postgresql/weeklycounter.conf | 12 + .../sql/counter/sqlite/dailycounter.conf | 33 + .../sql/counter/sqlite/expire_on_login.conf | 6 + .../sql/counter/sqlite/monthlycounter.conf | 34 + .../sql/counter/sqlite/noresetcounter.conf | 4 + .../sql/counter/sqlite/weeklycounter.conf | 12 + raddb/mods-config/sql/cui/mysql/queries.conf | 50 + raddb/mods-config/sql/cui/mysql/schema.sql | 9 + raddb/mods-config/sql/cui/postgresql/queries.conf | 47 + raddb/mods-config/sql/cui/postgresql/schema.sql | 14 + raddb/mods-config/sql/cui/sqlite/queries.conf | 47 + raddb/mods-config/sql/cui/sqlite/schema.sql | 9 + raddb/mods-config/sql/dhcp/mssql/queries.conf | 52 + raddb/mods-config/sql/dhcp/mssql/schema.sql | 91 + raddb/mods-config/sql/dhcp/mysql/queries.conf | 75 + raddb/mods-config/sql/dhcp/mysql/schema.sql | 47 + raddb/mods-config/sql/dhcp/mysql/setup.sql | 21 + raddb/mods-config/sql/dhcp/oracle/queries.conf | 47 + raddb/mods-config/sql/dhcp/oracle/schema.sql | 81 + raddb/mods-config/sql/dhcp/postgresql/queries.conf | 76 + raddb/mods-config/sql/dhcp/postgresql/schema.sql | 44 + raddb/mods-config/sql/dhcp/postgresql/setup.sql | 28 + raddb/mods-config/sql/dhcp/sqlite/queries.conf | 52 + raddb/mods-config/sql/dhcp/sqlite/schema.sql | 46 + .../sql/ippool-dhcp/mssql/procedure.sql | 159 + .../mods-config/sql/ippool-dhcp/mssql/queries.conf | 257 + raddb/mods-config/sql/ippool-dhcp/mssql/schema.sql | 40 + .../ippool-dhcp/mysql/procedure-no-skip-locked.sql | 160 + .../sql/ippool-dhcp/mysql/procedure.sql | 144 + .../mods-config/sql/ippool-dhcp/mysql/queries.conf | 221 + raddb/mods-config/sql/ippool-dhcp/mysql/schema.sql | 21 + .../sql/ippool-dhcp/oracle/procedure.sql | 217 + .../sql/ippool-dhcp/oracle/queries.conf | 200 + .../mods-config/sql/ippool-dhcp/oracle/schema.sql | 28 + .../sql/ippool-dhcp/postgresql/procedure.sql | 119 + .../sql/ippool-dhcp/postgresql/queries.conf | 291 + .../sql/ippool-dhcp/postgresql/schema.sql | 23 + .../sql/ippool-dhcp/sqlite/queries.conf | 236 + .../mods-config/sql/ippool-dhcp/sqlite/schema.sql | 25 + raddb/mods-config/sql/ippool/mongo/queries.conf | 109 + raddb/mods-config/sql/ippool/mssql/procedure.sql | 137 + raddb/mods-config/sql/ippool/mssql/queries.conf | 175 + raddb/mods-config/sql/ippool/mssql/schema.sql | 25 + .../sql/ippool/mysql/procedure-no-skip-locked.sql | 149 + raddb/mods-config/sql/ippool/mysql/procedure.sql | 139 + raddb/mods-config/sql/ippool/mysql/queries.conf | 156 + raddb/mods-config/sql/ippool/mysql/schema.sql | 18 + raddb/mods-config/sql/ippool/oracle/procedure.sql | 129 + raddb/mods-config/sql/ippool/oracle/queries.conf | 172 + raddb/mods-config/sql/ippool/oracle/schema.sql | 27 + .../sql/ippool/postgresql/procedure.sql | 111 + .../mods-config/sql/ippool/postgresql/queries.conf | 207 + raddb/mods-config/sql/ippool/postgresql/schema.sql | 22 + raddb/mods-config/sql/ippool/sqlite/queries.conf | 148 + raddb/mods-config/sql/ippool/sqlite/schema.sql | 18 + raddb/mods-config/sql/main/mongo/queries.conf | 289 + .../mods-config/sql/main/mssql/process-radacct.sql | 161 + raddb/mods-config/sql/main/mssql/queries.conf | 617 + raddb/mods-config/sql/main/mssql/schema.sql | 302 + .../sql/main/mysql/extras/wimax/queries.conf | 40 + .../sql/main/mysql/extras/wimax/schema.sql | 16 + .../mods-config/sql/main/mysql/process-radacct.sql | 289 + raddb/mods-config/sql/main/mysql/queries.conf | 694 + raddb/mods-config/sql/main/mysql/schema.sql | 179 + raddb/mods-config/sql/main/mysql/setup.sql | 40 + raddb/mods-config/sql/main/ndb/README | 5 + raddb/mods-config/sql/main/ndb/schema.sql | 144 + raddb/mods-config/sql/main/ndb/setup.sql | 25 + .../sql/main/oracle/process-radacct.sql | 147 + raddb/mods-config/sql/main/oracle/queries.conf | 694 + raddb/mods-config/sql/main/oracle/schema.sql | 205 + .../postgresql/extras/cisco_h323_db_schema.sql | 295 + .../sql/main/postgresql/extras/voip-postpaid.conf | 70 + .../sql/main/postgresql/process-radacct.sql | 288 + raddb/mods-config/sql/main/postgresql/queries.conf | 742 + raddb/mods-config/sql/main/postgresql/schema.sql | 178 + raddb/mods-config/sql/main/postgresql/setup.sql | 58 + .../sqlite/process-radacct-close-after-reload.pl | 119 + .../process-radacct-new-data-usage-period.sh | 124 + .../sql/main/sqlite/process-radacct-schema.sql | 95 + raddb/mods-config/sql/main/sqlite/queries.conf | 635 + raddb/mods-config/sql/main/sqlite/schema.sql | 164 + .../sql/moonshot-targeted-ids/mysql/queries.conf | 15 + .../sql/moonshot-targeted-ids/mysql/schema.sql | 8 + .../moonshot-targeted-ids/postgresql/queries.conf | 15 + .../moonshot-targeted-ids/postgresql/schema.sql | 8 + .../sql/moonshot-targeted-ids/sqlite/queries.conf | 15 + .../sql/moonshot-targeted-ids/sqlite/schema.sql | 8 + raddb/mods-config/unbound/default.conf | 2 + raddb/panic.gdb | 4 + raddb/policy.d/abfab-tr | 106 + raddb/policy.d/accounting | 127 + raddb/policy.d/canonicalization | 113 + raddb/policy.d/control | 40 + raddb/policy.d/cui | 131 + raddb/policy.d/debug | 64 + raddb/policy.d/dhcp | 327 + raddb/policy.d/eap | 54 + raddb/policy.d/filter | 211 + raddb/policy.d/moonshot-targeted-ids | 249 + raddb/policy.d/operator-name | 46 + raddb/policy.d/rfc7542 | 46 + raddb/proxy.conf | 872 + raddb/radiusd.conf.in | 902 ++ raddb/radrelay.conf.in | 170 + raddb/sites-available/README | 333 + raddb/sites-available/abfab-tls | 118 + raddb/sites-available/abfab-tr-idp | 198 + raddb/sites-available/aws-nlb | 46 + raddb/sites-available/buffered-sql | 161 + raddb/sites-available/challenge | 123 + raddb/sites-available/channel_bindings | 17 + raddb/sites-available/check-eap-tls | 135 + raddb/sites-available/coa | 49 + raddb/sites-available/coa-relay | 366 + raddb/sites-available/control-socket | 92 + raddb/sites-available/copy-acct-to-home-server | 202 + raddb/sites-available/decoupled-accounting | 139 + raddb/sites-available/default | 1159 ++ raddb/sites-available/dhcp | 595 + raddb/sites-available/dhcp.relay | 44 + raddb/sites-available/dynamic-clients | 222 + raddb/sites-available/example | 122 + raddb/sites-available/google-ldap-auth | 225 + raddb/sites-available/inner-tunnel | 468 + raddb/sites-available/originate-coa | 185 + raddb/sites-available/proxy-inner-tunnel | 47 + raddb/sites-available/resource-check | 140 + raddb/sites-available/robust-proxy-accounting | 177 + raddb/sites-available/soh | 34 + raddb/sites-available/status | 127 + raddb/sites-available/tls | 696 + raddb/sites-available/tls-cache | 144 + raddb/sites-available/totp | 85 + raddb/sites-available/virtual.example.com | 32 + raddb/sites-available/vmps | 98 + raddb/templates.conf | 108 + raddb/trigger.conf | 281 + raddb/vmpsd.conf.in | 405 + redhat/.gitignore | 1 + redhat/README | 10 + redhat/freeradius-logrotate | 61 + redhat/freeradius-pam-conf | 6 + redhat/freeradius-radiusd-init | 191 + redhat/freeradius-tmpfiles-conf | 1 + redhat/freeradius.spec | 956 ++ redhat/radiusd-pam | 7 + redhat/radiusd.service | 67 + scripts/.gitignore | 8 + scripts/Ssha2Passwd | 144 + scripts/all.mk | 22 + scripts/bbedit/unlanglaguage.plist | 116 + scripts/bin/README.md | 9 + scripts/bin/gdb | 5 + scripts/bin/lldb | 5 + scripts/bin/radclient | 1 + scripts/bin/radict | 5 + scripts/bin/radiusd | 5 + scripts/bin/radmin | 1 + scripts/bin/radsniff | 1 + scripts/bin/unit_test_module | 1 + scripts/boiler.mk | 674 + scripts/ci/Dockerfile | 10 + scripts/ci/Jenkinsfile | 66 + scripts/ci/eapol_test-build.sh | 121 + scripts/ci/eapol_test/.gitignore | 1 + scripts/ci/eapol_test/config_freebsd | 520 + scripts/ci/eapol_test/config_linux | 520 + scripts/ci/eapol_test/config_osx | 515 + scripts/ci/haproxy.conf | 16 + scripts/ci/ldap-setup.sh | 51 + scripts/ci/ldap/slapd.conf | 51 + scripts/ci/ldap/slapd2.conf | 61 + scripts/ci/ldap2-setup.sh | 63 + scripts/ci/mysql-setup.sh | 19 + scripts/ci/openresty-setup.sh | 144 + scripts/ci/openresty/.htpasswd | 1 + scripts/ci/openresty/auth-api.lua | 19 + scripts/ci/openresty/delay-api.lua | 6 + scripts/ci/openresty/json-api.lua | 145 + scripts/ci/openresty/post-api.lua | 19 + scripts/ci/openresty/test.txt | 1 + scripts/ci/package-test.mk | 41 + scripts/ci/postgresql-setup.sh | 26 + scripts/ci/radsecproxy.conf | 33 + scripts/ci/start.sh | 37 + scripts/ci/stunnel.conf | 16 + scripts/clients.pl | 68 + scripts/collectd/radsniff_types.db | 10 + scripts/create-users.pl | 64 + scripts/cron/radiusd.cron.daily.in | 34 + scripts/cron/radiusd.cron.monthly.in | 19 + scripts/crossbuild/README.md | 122 + scripts/crossbuild/build/.gitignore | 4 + scripts/crossbuild/crossbuild.mk | 236 + scripts/crossbuild/docker/centos7/Dockerfile | 92 + scripts/crossbuild/docker/centos8/Dockerfile | 81 + scripts/crossbuild/docker/debian10/Dockerfile | 89 + scripts/crossbuild/docker/debian8/Dockerfile | 84 + scripts/crossbuild/docker/debian9/Dockerfile | 84 + scripts/crossbuild/docker/debian9/README | 15 + scripts/crossbuild/docker/ubuntu16/Dockerfile | 86 + scripts/crossbuild/docker/ubuntu18/Dockerfile | 65 + scripts/crossbuild/docker/ubuntu20/Dockerfile | 65 + scripts/cryptpasswd.in | 83 + scripts/dhcp/isc2ippool.pl | 189 + scripts/dhcp/rlm_iscfixed2ippool | 422 + scripts/dict_alias.sh | 22 + scripts/docker/README.md | 200 + scripts/docker/alpine/Dockerfile | 83 + scripts/docker/alpine/docker-entrypoint.sh | 27 + scripts/docker/centos7/Dockerfile | 96 + scripts/docker/centos7/docker-entrypoint.sh | 24 + scripts/docker/debian10/Dockerfile | 59 + scripts/docker/debian10/docker-entrypoint.sh | 24 + scripts/docker/debian11/Dockerfile | 64 + scripts/docker/debian11/docker-entrypoint.sh | 24 + scripts/docker/debian9/Dockerfile | 59 + scripts/docker/debian9/docker-entrypoint.sh | 24 + scripts/docker/debiansid/Dockerfile | 64 + scripts/docker/debiansid/docker-entrypoint.sh | 24 + scripts/docker/docker.mk | 86 + scripts/docker/rocky8/Dockerfile | 108 + scripts/docker/rocky8/docker-entrypoint.sh | 24 + scripts/docker/ubuntu18/Dockerfile | 59 + scripts/docker/ubuntu18/docker-entrypoint.sh | 24 + scripts/docker/ubuntu20/Dockerfile | 61 + scripts/docker/ubuntu20/docker-entrypoint.sh | 24 + scripts/docker/ubuntu22/Dockerfile | 66 + scripts/docker/ubuntu22/docker-entrypoint.sh | 24 + scripts/exec-program-wait | 62 + scripts/git/post-receive | 151 + scripts/install.mk | 250 + scripts/jlibtool.c | 2608 +++ scripts/ldap/radiusd2ldif.pl | 307 + scripts/ldap/schema_to_samba.py | 132 + scripts/libtool.mk | 243 + scripts/logrotate/freeradius | 59 + scripts/min-includes.pl | 238 + scripts/monit/freeradius.monitrc | 18 + scripts/munin/freeradius_acct | 88 + scripts/munin/freeradius_auth | 103 + scripts/munin/freeradius_proxy_acct | 88 + scripts/munin/freeradius_proxy_auth | 103 + scripts/munin/radsniff | 246 + scripts/osx/README | 2 + scripts/osx/org.freeradius.radiusd.plist | 21 + scripts/raddebug | 140 + scripts/radiusd.sh | 17 + scripts/radtee | 563 + scripts/raduat | 366 + scripts/rc.radiusd.in | 100 + scripts/snmp-proxy/README | 32 + scripts/snmp-proxy/dictionary.hacked | 132 + scripts/snmp-proxy/freeradius-snmp.pl | 585 + .../net-radius-freeradius-dictionary.diff | 81 + scripts/solaris/.gitignore | 1 + scripts/solaris/README.md | 58 + scripts/solaris/radius.xml | 68 + scripts/solaris/svc-radius.in | 99 + scripts/sql/align_sql_pools.pl | 311 + scripts/sql/generate_pool_addresses.pl | 456 + scripts/sql/radsqlrelay | 342 + scripts/sql/rlm_sqlippool_tool | 961 ++ scripts/sql/users2mysql.pl | 157 + share/LICENSE | 339 + share/Makefile | 13 + share/attrnew.pl | 93 + share/attrsort.pl | 87 + share/backref.pl | 192 + share/dct2fr | 31 + share/dictionary | 340 + share/dictionary.3com | 54 + share/dictionary.3gpp | 76 + share/dictionary.3gpp2 | 192 + share/dictionary.acc | 260 + share/dictionary.acme | 241 + share/dictionary.actelis | 19 + share/dictionary.adtran | 18 + share/dictionary.adva | 41 + share/dictionary.aerohive | 75 + share/dictionary.airespace | 33 + share/dictionary.alcatel | 101 + share/dictionary.alcatel-lucent.aaa | 88 + share/dictionary.alcatel.esam | 253 + share/dictionary.alcatel.sr | 420 + share/dictionary.alteon | 32 + share/dictionary.altiga | 163 + share/dictionary.alvarion | 313 + share/dictionary.alvarion.wimax.v2_2 | 36 + share/dictionary.apc | 39 + share/dictionary.aptilo | 154 + share/dictionary.aptis | 184 + share/dictionary.arbor | 21 + share/dictionary.arista | 29 + share/dictionary.aruba | 101 + share/dictionary.ascend | 899 ++ share/dictionary.ascend.illegal | 432 + share/dictionary.asn | 96 + share/dictionary.audiocodes | 23 + share/dictionary.avaya | 32 + share/dictionary.azaire | 53 + share/dictionary.bay | 295 + share/dictionary.bigswitch | 17 + share/dictionary.bintec | 49 + share/dictionary.bluecoat | 27 + share/dictionary.boingo | 48 + share/dictionary.bristol | 23 + share/dictionary.broadsoft | 371 + share/dictionary.brocade | 24 + share/dictionary.bskyb | 26 + share/dictionary.bt | 19 + share/dictionary.cablelabs | 202 + share/dictionary.cabletron | 28 + share/dictionary.calix | 29 + share/dictionary.cambium | 78 + share/dictionary.camiant | 24 + share/dictionary.centec | 18 + share/dictionary.checkpoint | 13 + share/dictionary.chillispot | 40 + share/dictionary.ciena | 41 + share/dictionary.cisco | 226 + share/dictionary.cisco.asa | 369 + share/dictionary.cisco.bbsm | 15 + share/dictionary.cisco.vpn3000 | 243 + share/dictionary.cisco.vpn5000 | 21 + share/dictionary.citrix | 25 + share/dictionary.clavister | 22 + share/dictionary.cnergee | 52 + share/dictionary.colubris | 13 + share/dictionary.columbia_university | 29 + share/dictionary.compat | 44 + share/dictionary.compatible | 22 + share/dictionary.cosine | 26 + share/dictionary.covaro | 43 + share/dictionary.dante | 20 + share/dictionary.dellemc | 19 + share/dictionary.dhcp | 608 + share/dictionary.digium | 39 + share/dictionary.dlink | 37 + share/dictionary.dragonwave | 31 + share/dictionary.efficientip | 31 + share/dictionary.eleven | 52 + share/dictionary.eltex | 26 + share/dictionary.epygi | 118 + share/dictionary.equallogic | 43 + share/dictionary.ericsson | 134 + share/dictionary.ericsson.ab | 451 + share/dictionary.ericsson.packet.core.networks | 15 + share/dictionary.erx | 433 + share/dictionary.extreme | 36 + share/dictionary.f5 | 51 + share/dictionary.fdxtended | 19 + share/dictionary.force10 | 10 + share/dictionary.fortinet | 55 + share/dictionary.foundry | 58 + share/dictionary.freedhcp | 369 + share/dictionary.freeradius | 202 + share/dictionary.freeradius.evs5 | 22 + share/dictionary.freeradius.internal | 890 + share/dictionary.freeswitch | 112 + share/dictionary.gandalf | 103 + share/dictionary.garderos | 25 + share/dictionary.gemtek | 20 + share/dictionary.h3c | 95 + share/dictionary.hillstone | 51 + share/dictionary.hp | 103 + share/dictionary.huawei | 243 + share/dictionary.iana | 48 + share/dictionary.iea | 19 + share/dictionary.infinera | 12 + share/dictionary.infoblox | 21 + share/dictionary.infonet | 50 + share/dictionary.ipunplugged | 29 + share/dictionary.issanni | 44 + share/dictionary.itk | 45 + share/dictionary.juniper | 79 + share/dictionary.karlnet | 2076 +++ share/dictionary.kineto | 119 + share/dictionary.lancom | 42 + share/dictionary.lantronix | 13 + share/dictionary.livingston | 63 + share/dictionary.localweb | 35 + share/dictionary.lucent | 454 + share/dictionary.manzara | 33 + share/dictionary.meinberg | 19 + share/dictionary.mellanox | 18 + share/dictionary.meraki | 15 + share/dictionary.merit | 17 + share/dictionary.meru | 18 + share/dictionary.microsemi | 22 + share/dictionary.microsoft | 170 + share/dictionary.mikrotik | 68 + share/dictionary.mimosa | 39 + share/dictionary.motorola | 74 + share/dictionary.motorola.illegal | 29 + share/dictionary.motorola.wimax | 37 + share/dictionary.navini | 22 + share/dictionary.net | 132 + share/dictionary.netelastic | 55 + share/dictionary.netscreen | 34 + share/dictionary.networkphysics | 19 + share/dictionary.nexans | 21 + share/dictionary.nile | 20 + share/dictionary.nokia | 41 + share/dictionary.nokia.conflict | 32 + share/dictionary.nomadix | 34 + share/dictionary.nortel | 77 + share/dictionary.ntua | 46 + share/dictionary.openser | 43 + share/dictionary.packeteer | 26 + share/dictionary.paloalto | 29 + share/dictionary.patton | 156 + share/dictionary.perle | 525 + share/dictionary.pfsense | 18 + share/dictionary.pica8 | 20 + share/dictionary.propel | 17 + share/dictionary.prosoft | 44 + share/dictionary.proxim | 94 + share/dictionary.purewave | 53 + share/dictionary.quiconnect | 21 + share/dictionary.quintum | 52 + share/dictionary.rcntec | 19 + share/dictionary.redcreek | 23 + share/dictionary.rfc2865 | 139 + share/dictionary.rfc2866 | 59 + share/dictionary.rfc2867 | 18 + share/dictionary.rfc2868 | 56 + share/dictionary.rfc2869 | 41 + share/dictionary.rfc3162 | 15 + share/dictionary.rfc3576 | 32 + share/dictionary.rfc3580 | 18 + share/dictionary.rfc4072 | 11 + share/dictionary.rfc4372 | 10 + share/dictionary.rfc4603 | 19 + share/dictionary.rfc4675 | 30 + share/dictionary.rfc4679 | 74 + share/dictionary.rfc4818 | 14 + share/dictionary.rfc4849 | 10 + share/dictionary.rfc5090 | 29 + share/dictionary.rfc5176 | 11 + share/dictionary.rfc5447 | 17 + share/dictionary.rfc5580 | 43 + share/dictionary.rfc5607 | 32 + share/dictionary.rfc5904 | 24 + share/dictionary.rfc6519 | 11 + share/dictionary.rfc6572 | 28 + share/dictionary.rfc6677 | 20 + share/dictionary.rfc6911 | 13 + share/dictionary.rfc6929 | 26 + share/dictionary.rfc6930 | 12 + share/dictionary.rfc7055 | 12 + share/dictionary.rfc7155 | 12 + share/dictionary.rfc7268 | 70 + share/dictionary.rfc7499 | 18 + share/dictionary.rfc7930 | 10 + share/dictionary.rfc8045 | 65 + share/dictionary.rfc8559 | 9 + share/dictionary.riverbed | 21 + share/dictionary.riverstone | 45 + share/dictionary.roaringpenguin | 32 + share/dictionary.ruckus | 155 + share/dictionary.ruggedcom | 12 + share/dictionary.sangoma | 114 + share/dictionary.sg | 149 + share/dictionary.shasta | 26 + share/dictionary.shiva | 131 + share/dictionary.siemens | 28 + share/dictionary.slipstream | 21 + share/dictionary.sofaware | 39 + share/dictionary.softbank | 32 + share/dictionary.sonicwall | 64 + share/dictionary.springtide | 34 + share/dictionary.starent | 1383 ++ share/dictionary.starent.vsa1 | 1202 ++ share/dictionary.surfnet | 21 + share/dictionary.symbol | 55 + share/dictionary.t_systems_nova | 35 + share/dictionary.telebit | 21 + share/dictionary.telkom | 31 + share/dictionary.telrad | 23 + share/dictionary.terena | 19 + share/dictionary.trapeze | 40 + share/dictionary.travelping | 76 + share/dictionary.tripplite | 63 + share/dictionary.tropos | 55 + share/dictionary.ukerna | 39 + share/dictionary.unix | 21 + share/dictionary.usr | 1618 ++ share/dictionary.usr.illegal | 49 + share/dictionary.utstarcom | 45 + share/dictionary.valemount | 29 + share/dictionary.vasexperts | 93 + share/dictionary.verizon | 26 + share/dictionary.versanet | 56 + share/dictionary.vqp | 112 + share/dictionary.walabi | 31 + share/dictionary.waverider | 58 + share/dictionary.wichorus | 26 + share/dictionary.wifialliance | 94 + share/dictionary.wimax | 619 + share/dictionary.wimax.alvarion | 516 + share/dictionary.wimax.wichorus | 409 + share/dictionary.wispr | 41 + share/dictionary.xedia | 26 + share/dictionary.xylan | 56 + share/dictionary.yubico | 25 + share/dictionary.zeus | 18 + share/dictionary.zte | 73 + share/dictionary.zyxel | 27 + share/format.pl | 235 + site.yml | 17 + src/.gitignore | 2 + src/LICENSE.openssl | 13 + src/all.mk | 4 + src/include/.gitignore | 21 + src/include/all.mk | 168 + src/include/atomic_queue.h | 79 + src/include/autoconf.h.in | 748 + src/include/automask.h | 21 + src/include/base64.h | 38 + src/include/build-radpaths-h.in | 37 + src/include/build.h | 168 + src/include/channel.h | 55 + src/include/clients.h | 174 + src/include/conf.h | 23 + src/include/conffile.h | 306 + src/include/connection.h | 131 + src/include/detail.h | 97 + src/include/dhcp.h | 85 + src/include/event.h | 67 + src/include/exfile.h | 45 + src/include/features-h | 97 + src/include/hash.h | 75 + src/include/heap.h | 46 + src/include/libradius.h | 967 ++ src/include/listen.h | 206 + src/include/log.h | 390 + src/include/map.h | 111 + src/include/math.h | 161 + src/include/md4.h | 137 + src/include/md5.h | 123 + src/include/missing-h | 530 + src/include/modcall.h | 55 + src/include/modpriv.h | 69 + src/include/modules.h | 175 + src/include/net.h | 140 + src/include/openssl3.h | 109 + src/include/packet.h | 87 + src/include/parser.h | 111 + src/include/pcap.h | 101 + src/include/process.h | 87 + src/include/protocol.h | 63 + src/include/rad_assert.h | 50 + src/include/radclient.h | 93 + src/include/radius.h | 186 + src/include/radiusd.h | 631 + src/include/radsniff.h | 323 + src/include/radutmp.h | 65 + src/include/realms.h | 235 + src/include/regex.h | 77 + src/include/sha1.h | 57 + src/include/socket.h | 53 + src/include/soh.h | 42 + src/include/state.h | 47 + src/include/stats.h | 101 + src/include/stdatomic.h | 364 + src/include/sysutmp.h | 108 + src/include/talloc.h | 51 + src/include/tcp.h | 31 + src/include/threads.h | 119 + src/include/tls-h | 453 + src/include/tmpl.h | 345 + src/include/token.h | 95 + src/include/udpfromto.h | 31 + src/include/xlat.h | 71 + src/lib/LICENSE | 504 + src/lib/README | 2 + src/lib/all.mk | 53 + src/lib/atomic_queue.c | 337 + src/lib/base64.c | 315 + src/lib/cbuff.c | 145 + src/lib/cursor.c | 461 + src/lib/debug.c | 1217 ++ src/lib/dict.c | 3506 ++++ src/lib/event.c | 843 + src/lib/fifo.c | 197 + src/lib/filters.c | 1253 ++ src/lib/getaddrinfo.c | 438 + src/lib/hash.c | 935 ++ src/lib/heap.c | 356 + src/lib/hmacmd5.c | 197 + src/lib/hmacsha1.c | 228 + src/lib/isaac.c | 133 + src/lib/log.c | 343 + src/lib/md4.c | 310 + src/lib/md5.c | 276 + src/lib/misc.c | 2192 +++ src/lib/missing.c | 443 + src/lib/net.c | 94 + src/lib/packet.c | 1116 ++ src/lib/pair.c | 2520 +++ src/lib/pcap.c | 474 + src/lib/print.c | 790 + src/lib/radius.c | 5354 ++++++ src/lib/rbtree.c | 744 + src/lib/regex.c | 390 + src/lib/sha1.c | 185 + src/lib/snprintf.c | 880 + src/lib/snprintf.h | 220 + src/lib/socket.c | 390 + src/lib/strlcat.c | 67 + src/lib/strlcpy.c | 63 + src/lib/talloc.c | 74 + src/lib/tcp.c | 172 + src/lib/token.c | 481 + src/lib/udpfromto.c | 579 + src/lib/value.c | 2013 +++ src/lib/version.c | 58 + src/main/.gitignore | 13 + src/main/acct.c | 186 + src/main/all.mk | 3 + src/main/auth.c | 894 + src/main/cb.c | 247 + src/main/channel.c | 231 + src/main/checkrad.in | 1515 ++ src/main/checkrad.mk | 5 + src/main/client.c | 1581 ++ src/main/collectd.c | 382 + src/main/command.c | 3632 +++++ src/main/conffile.c | 3821 +++++ src/main/connection.c | 1520 ++ src/main/crypt.c | 97 + src/main/detail.c | 1266 ++ src/main/evaluate.c | 1144 ++ src/main/exec.c | 633 + src/main/exfile.c | 547 + src/main/files.c | 361 + src/main/libfreeradius-server.mk | 22 + src/main/listen.c | 4486 ++++++ src/main/log.c | 923 ++ src/main/mainconfig.c | 1420 ++ src/main/map.c | 1717 ++ src/main/modcall.c | 4041 +++++ src/main/modules.c | 2302 +++ src/main/pair.c | 911 ++ src/main/parser.c | 1809 +++ src/main/process.c | 6457 ++++++++ src/main/radattr.c | 1123 ++ src/main/radattr.mk | 10 + src/main/radclient.c | 1712 ++ src/main/radclient.mk | 8 + src/main/radiusd.c | 794 + src/main/radiusd.mk | 21 + src/main/radlast.in | 7 + src/main/radlast.mk | 5 + src/main/radmin.c | 773 + src/main/radmin.mk | 7 + src/main/radsniff.c | 2683 +++ src/main/radsniff.mk.in | 13 + src/main/radtest.in | 135 + src/main/radtest.mk | 5 + src/main/radwho.c | 565 + src/main/radwho.mk | 5 + src/main/radzap | 54 + src/main/radzap.mk | 5 + src/main/realms.c | 3247 ++++ src/main/regex.c | 279 + src/main/session.c | 262 + src/main/soh.c | 675 + src/main/state.c | 713 + src/main/stats.c | 1028 ++ src/main/threads.c | 1697 ++ src/main/tls.c | 5420 +++++++ src/main/tls_listen.c | 1568 ++ src/main/tmpl.c | 2399 +++ src/main/unittest.c | 982 ++ src/main/unittest.mk | 25 + src/main/util.c | 1732 ++ src/main/version.c | 625 + src/main/xlat.c | 2696 ++++ src/mkinstalldirs | 40 + src/modules/.gitignore | 3 + src/modules/all.mk | 28 + src/modules/proto_dhcp/README.md | 9 + src/modules/proto_dhcp/all.mk | 3 + src/modules/proto_dhcp/dhcp.c | 2268 +++ src/modules/proto_dhcp/dhcpclient.c | 652 + src/modules/proto_dhcp/dhcpclient.mk | 5 + src/modules/proto_dhcp/dhcpd.c | 866 + src/modules/proto_dhcp/libfreeradius-dhcp.mk | 3 + src/modules/proto_dhcp/proto_dhcp.mk | 9 + src/modules/proto_dhcp/rlm_dhcp.c | 203 + src/modules/proto_dhcp/rlm_dhcp.mk | 4 + src/modules/proto_vmps/README.md | 10 + src/modules/proto_vmps/all.mk | 8 + src/modules/proto_vmps/vmps.c | 124 + src/modules/proto_vmps/vqp.c | 721 + src/modules/proto_vmps/vqp.h | 44 + src/modules/proto_vmps/vqpcli.pl | 207 + src/modules/rlm_always/README.md | 10 + src/modules/rlm_always/all.mk | 2 + src/modules/rlm_always/rlm_always.c | 234 + src/modules/rlm_attr_filter/README.md | 9 + src/modules/rlm_attr_filter/all.mk | 2 + src/modules/rlm_attr_filter/rlm_attr_filter.c | 374 + src/modules/rlm_cache/.gitignore | 1 + src/modules/rlm_cache/README.md | 11 + src/modules/rlm_cache/all.mk.in | 7 + src/modules/rlm_cache/configure | 3966 +++++ src/modules/rlm_cache/configure.ac | 35 + .../drivers/rlm_cache_memcached/.gitignore | 1 + .../drivers/rlm_cache_memcached/all.mk.in | 10 + .../drivers/rlm_cache_memcached/configure | 4593 ++++++ .../drivers/rlm_cache_memcached/configure.ac | 115 + .../rlm_cache_memcached/rlm_cache_memcached.c | 347 + .../rlm_cache/drivers/rlm_cache_rbtree/all.mk | 3 + .../drivers/rlm_cache_rbtree/rlm_cache_rbtree.c | 351 + .../rlm_cache/drivers/rlm_cache_redis/.gitignore | 1 + .../rlm_cache/drivers/rlm_cache_redis/all.mk.in | 10 + .../rlm_cache/drivers/rlm_cache_redis/configure | 4202 +++++ .../rlm_cache/drivers/rlm_cache_redis/configure.ac | 102 + .../drivers/rlm_cache_redis/rlm_cache_redis.c | 413 + src/modules/rlm_cache/rlm_cache.c | 839 + src/modules/rlm_cache/rlm_cache.h | 112 + src/modules/rlm_cache/rlm_cache.mk | 3 + src/modules/rlm_cache/serialize.c | 243 + src/modules/rlm_cache/serialize.h | 29 + src/modules/rlm_cache/stable | 2 + src/modules/rlm_chap/README.md | 9 + src/modules/rlm_chap/all.mk | 4 + src/modules/rlm_chap/rlm_chap.c | 162 + src/modules/rlm_couchbase/.gitignore | 1 + src/modules/rlm_couchbase/README.md | 196 + src/modules/rlm_couchbase/all.mk.in | 13 + src/modules/rlm_couchbase/config.h.in | 25 + src/modules/rlm_couchbase/configure | 5276 ++++++ src/modules/rlm_couchbase/configure.ac | 220 + src/modules/rlm_couchbase/couchbase.c | 412 + src/modules/rlm_couchbase/couchbase.h | 94 + src/modules/rlm_couchbase/jsonc_missing.c | 82 + src/modules/rlm_couchbase/jsonc_missing.h | 89 + src/modules/rlm_couchbase/mod.c | 767 + src/modules/rlm_couchbase/mod.h | 101 + src/modules/rlm_couchbase/rlm_couchbase.c | 874 + src/modules/rlm_counter/.gitignore | 2 + src/modules/rlm_counter/README.md | 12 + src/modules/rlm_counter/all.mk.in | 17 + src/modules/rlm_counter/config.h.in | 9 + src/modules/rlm_counter/configure | 4672 ++++++ src/modules/rlm_counter/configure.ac | 55 + src/modules/rlm_counter/rad_counter | 113 + src/modules/rlm_counter/rlm_counter.c | 891 + src/modules/rlm_date/README.md | 9 + src/modules/rlm_date/all.mk | 2 + src/modules/rlm_date/rlm_date.c | 141 + src/modules/rlm_detail/README.md | 9 + src/modules/rlm_detail/all.mk | 2 + src/modules/rlm_detail/rlm_detail.c | 564 + src/modules/rlm_digest/README.md | 11 + src/modules/rlm_digest/all.mk | 2 + src/modules/rlm_digest/rlm_digest.c | 601 + src/modules/rlm_dynamic_clients/README.md | 10 + src/modules/rlm_dynamic_clients/all.mk | 2 + .../rlm_dynamic_clients/rlm_dynamic_clients.c | 119 + src/modules/rlm_eap/.gitignore | 1 + src/modules/rlm_eap/README.md | 11 + src/modules/rlm_eap/all.mk | 1 + src/modules/rlm_eap/configure | 3557 ++++ src/modules/rlm_eap/configure.ac | 42 + src/modules/rlm_eap/eap.c | 1270 ++ src/modules/rlm_eap/eap.h | 154 + src/modules/rlm_eap/libeap/all.mk | 10 + src/modules/rlm_eap/libeap/comp128.c | 460 + src/modules/rlm_eap/libeap/comp128.h | 11 + src/modules/rlm_eap/libeap/eap_chbind.c | 290 + src/modules/rlm_eap/libeap/eap_chbind.h | 64 + src/modules/rlm_eap/libeap/eap_sim.h | 122 + src/modules/rlm_eap/libeap/eap_tls.c | 1206 ++ src/modules/rlm_eap/libeap/eap_tls.h | 109 + src/modules/rlm_eap/libeap/eap_types.h | 162 + src/modules/rlm_eap/libeap/eapclient.h | 8 + src/modules/rlm_eap/libeap/eapcommon.c | 401 + src/modules/rlm_eap/libeap/eapcrypto.c | 301 + src/modules/rlm_eap/libeap/eapsimlib.c | 508 + src/modules/rlm_eap/libeap/fips186prf.c | 270 + src/modules/rlm_eap/libeap/mppe_keys.c | 384 + src/modules/rlm_eap/mem.c | 503 + src/modules/rlm_eap/radeapclient.c | 2315 +++ src/modules/rlm_eap/radeapclient.mk | 29 + src/modules/rlm_eap/rlm_eap.c | 859 + src/modules/rlm_eap/rlm_eap.h | 116 + src/modules/rlm_eap/rlm_eap.mk | 6 + src/modules/rlm_eap/types/all.mk | 1 + src/modules/rlm_eap/types/rlm_eap_fast/.gitignore | 1 + src/modules/rlm_eap/types/rlm_eap_fast/README.md | 10 + src/modules/rlm_eap/types/rlm_eap_fast/all.mk.in | 12 + src/modules/rlm_eap/types/rlm_eap_fast/configure | 4512 ++++++ .../rlm_eap/types/rlm_eap_fast/configure.ac | 86 + src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c | 1315 ++ src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.h | 260 + .../rlm_eap/types/rlm_eap_fast/eap_fast_crypto.c | 198 + .../rlm_eap/types/rlm_eap_fast/eap_fast_crypto.h | 39 + .../rlm_eap/types/rlm_eap_fast/rlm_eap_fast.c | 659 + src/modules/rlm_eap/types/rlm_eap_gtc/README.md | 12 + src/modules/rlm_eap/types/rlm_eap_gtc/all.mk | 12 + .../rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c | 250 + src/modules/rlm_eap/types/rlm_eap_ikev2/.gitignore | 1 + src/modules/rlm_eap/types/rlm_eap_ikev2/README.md | 11 + src/modules/rlm_eap/types/rlm_eap_ikev2/all.mk.in | 13 + src/modules/rlm_eap/types/rlm_eap_ikev2/configure | 4206 +++++ .../rlm_eap/types/rlm_eap_ikev2/configure.ac | 99 + src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.c | 420 + src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.h | 48 + .../rlm_eap/types/rlm_eap_ikev2/logging_impl.c | 52 + .../rlm_eap/types/rlm_eap_ikev2/logging_impl.h | 35 + .../rlm_eap/types/rlm_eap_ikev2/rlm_eap_ikev2.c | 526 + src/modules/rlm_eap/types/rlm_eap_md5/README.md | 12 + src/modules/rlm_eap/types/rlm_eap_md5/all.mk | 12 + src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.c | 229 + src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.h | 52 + .../rlm_eap/types/rlm_eap_md5/rlm_eap_md5.c | 168 + .../rlm_eap/types/rlm_eap_mschapv2/README.md | 13 + src/modules/rlm_eap/types/rlm_eap_mschapv2/all.mk | 12 + .../rlm_eap/types/rlm_eap_mschapv2/eap_mschapv2.h | 51 + .../types/rlm_eap_mschapv2/rlm_eap_mschapv2.c | 757 + src/modules/rlm_eap/types/rlm_eap_peap/README.md | 13 + src/modules/rlm_eap/types/rlm_eap_peap/all.mk | 10 + src/modules/rlm_eap/types/rlm_eap_peap/eap_peap.h | 76 + src/modules/rlm_eap/types/rlm_eap_peap/peap.c | 1316 ++ .../rlm_eap/types/rlm_eap_peap/rlm_eap_peap.c | 429 + src/modules/rlm_eap/types/rlm_eap_pwd/.gitignore | 1 + src/modules/rlm_eap/types/rlm_eap_pwd/README.md | 11 + src/modules/rlm_eap/types/rlm_eap_pwd/all.mk.in | 16 + src/modules/rlm_eap/types/rlm_eap_pwd/configure | 4271 +++++ src/modules/rlm_eap/types/rlm_eap_pwd/configure.ac | 80 + src/modules/rlm_eap/types/rlm_eap_pwd/const_time.h | 190 + src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c | 933 ++ src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.h | 126 + .../rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c | 972 ++ .../rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.h | 51 + src/modules/rlm_eap/types/rlm_eap_sim/.gitignore | 1 + src/modules/rlm_eap/types/rlm_eap_sim/README.md | 9 + src/modules/rlm_eap/types/rlm_eap_sim/all.mk.in | 12 + src/modules/rlm_eap/types/rlm_eap_sim/configure | 2929 ++++ src/modules/rlm_eap/types/rlm_eap_sim/configure.ac | 18 + .../rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c | 697 + src/modules/rlm_eap/types/rlm_eap_tls/README.md | 9 + src/modules/rlm_eap/types/rlm_eap_tls/all.mk | 10 + .../rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c | 303 + .../rlm_eap/types/rlm_eap_tls/rlm_eap_tls.h | 52 + src/modules/rlm_eap/types/rlm_eap_tnc/.gitignore | 1 + src/modules/rlm_eap/types/rlm_eap_tnc/README.md | 9 + src/modules/rlm_eap/types/rlm_eap_tnc/all.mk.in | 14 + src/modules/rlm_eap/types/rlm_eap_tnc/configure | 4199 +++++ src/modules/rlm_eap/types/rlm_eap_tnc/configure.ac | 90 + .../rlm_eap/types/rlm_eap_tnc/rlm_eap_tnc.c | 357 + src/modules/rlm_eap/types/rlm_eap_ttls/README.md | 10 + src/modules/rlm_eap/types/rlm_eap_ttls/all.mk | 10 + src/modules/rlm_eap/types/rlm_eap_ttls/eap_ttls.h | 46 + .../rlm_eap/types/rlm_eap_ttls/rlm_eap_ttls.c | 392 + src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c | 1321 ++ src/modules/rlm_example/.gitignore | 1 + src/modules/rlm_example/Makefile.clean | 11 + src/modules/rlm_example/README.md | 10 + src/modules/rlm_example/all.mk.in | 44 + src/modules/rlm_example/config.h.in | 1 + src/modules/rlm_example/configure | 4424 +++++ src/modules/rlm_example/configure.ac | 32 + src/modules/rlm_example/rlm_example.c | 216 + src/modules/rlm_exec/README.md | 11 + src/modules/rlm_exec/all.mk | 2 + src/modules/rlm_exec/rlm_exec.c | 487 + src/modules/rlm_expiration/README.md | 11 + src/modules/rlm_expiration/all.mk | 2 + src/modules/rlm_expiration/rlm_expiration.c | 131 + src/modules/rlm_expr/README.md | 12 + src/modules/rlm_expr/all.mk | 2 + src/modules/rlm_expr/paircmp.c | 231 + src/modules/rlm_expr/rlm_expr.c | 1924 +++ src/modules/rlm_expr/rlm_expr.h | 25 + src/modules/rlm_files/README.md | 13 + src/modules/rlm_files/all.mk | 2 + src/modules/rlm_files/rlm_files.c | 550 + src/modules/rlm_idn/.gitignore | 1 + src/modules/rlm_idn/README.md | 13 + src/modules/rlm_idn/all.mk.in | 10 + src/modules/rlm_idn/configure | 4306 +++++ src/modules/rlm_idn/configure.ac | 32 + src/modules/rlm_idn/rlm_idn.c | 158 + src/modules/rlm_ippool/.gitignore | 3 + src/modules/rlm_ippool/README.md | 11 + src/modules/rlm_ippool/all.mk.in | 12 + src/modules/rlm_ippool/config.h.in | 7 + src/modules/rlm_ippool/configure | 4679 ++++++ src/modules/rlm_ippool/configure.ac | 60 + src/modules/rlm_ippool/rlm_ippool.c | 834 + src/modules/rlm_ippool/rlm_ippool.mk | 9 + src/modules/rlm_ippool/rlm_ippool_tool.8 | 122 + src/modules/rlm_ippool/rlm_ippool_tool.c | 645 + src/modules/rlm_ippool/rlm_ippool_tool.mk | 12 + src/modules/rlm_json/.gitignore | 1 + src/modules/rlm_json/README.md | 13 + src/modules/rlm_json/all.mk.in | 10 + src/modules/rlm_json/config.h.in | 34 + src/modules/rlm_json/configure | 4904 ++++++ src/modules/rlm_json/configure.ac | 139 + src/modules/rlm_json/json.c | 829 + src/modules/rlm_json/json.h | 99 + src/modules/rlm_json/rlm_json.c | 237 + src/modules/rlm_krb5/.gitignore | 1 + src/modules/rlm_krb5/README.md | 12 + src/modules/rlm_krb5/all.mk.in | 11 + src/modules/rlm_krb5/configure | 5603 +++++++ src/modules/rlm_krb5/configure.ac | 178 + src/modules/rlm_krb5/krb5.c | 166 + src/modules/rlm_krb5/krb5.h | 93 + src/modules/rlm_krb5/rlm_krb5.c | 470 + src/modules/rlm_ldap/.gitignore | 1 + src/modules/rlm_ldap/README.md | 14 + src/modules/rlm_ldap/all.mk.in | 10 + src/modules/rlm_ldap/attrmap.c | 389 + src/modules/rlm_ldap/clients.c | 263 + src/modules/rlm_ldap/config.h.in | 43 + src/modules/rlm_ldap/configure | 4636 ++++++ src/modules/rlm_ldap/configure.ac | 140 + src/modules/rlm_ldap/edir.c | 275 + src/modules/rlm_ldap/groups.c | 863 + src/modules/rlm_ldap/ldap.c | 1661 ++ src/modules/rlm_ldap/ldap.h | 489 + src/modules/rlm_ldap/rlm_ldap.c | 1985 +++ src/modules/rlm_ldap/sasl.c | 194 + src/modules/rlm_linelog/README.md | 11 + src/modules/rlm_linelog/all.mk | 2 + src/modules/rlm_linelog/rlm_linelog.c | 328 + src/modules/rlm_logintime/README.md | 14 + src/modules/rlm_logintime/all.mk | 2 + src/modules/rlm_logintime/rlm_logintime.c | 260 + src/modules/rlm_logintime/timestr.c | 269 + src/modules/rlm_mschap/.gitignore | 3 + src/modules/rlm_mschap/README.md | 10 + src/modules/rlm_mschap/all.mk | 5 + src/modules/rlm_mschap/auth_wbclient.c | 270 + src/modules/rlm_mschap/auth_wbclient.h | 19 + src/modules/rlm_mschap/config.h.in | 7 + src/modules/rlm_mschap/configure | 4931 ++++++ src/modules/rlm_mschap/configure.ac | 128 + src/modules/rlm_mschap/mschap.c | 147 + src/modules/rlm_mschap/mschap.h | 25 + src/modules/rlm_mschap/opendir.c | 418 + src/modules/rlm_mschap/rlm_mschap.c | 2150 +++ src/modules/rlm_mschap/rlm_mschap.h | 55 + src/modules/rlm_mschap/rlm_mschap.mk.in | 10 + src/modules/rlm_mschap/smbdes.c | 349 + src/modules/rlm_mschap/smbdes.h | 13 + src/modules/rlm_mschap/smbencrypt.c | 147 + src/modules/rlm_mschap/smbencrypt.mk | 8 + src/modules/rlm_opendirectory/.gitignore | 1 + src/modules/rlm_opendirectory/README.md | 13 + src/modules/rlm_opendirectory/all.mk.in | 10 + src/modules/rlm_opendirectory/configure | 4211 +++++ src/modules/rlm_opendirectory/configure.ac | 32 + src/modules/rlm_opendirectory/rlm_opendirectory.c | 483 + src/modules/rlm_pam/.gitignore | 2 + src/modules/rlm_pam/README.md | 9 + src/modules/rlm_pam/all.mk.in | 10 + src/modules/rlm_pam/config.h.in | 43 + src/modules/rlm_pam/configure | 4709 ++++++ src/modules/rlm_pam/configure.ac | 50 + src/modules/rlm_pam/rlm_pam.c | 244 + src/modules/rlm_pap/README.md | 13 + src/modules/rlm_pap/all.mk | 2 + src/modules/rlm_pap/rlm_pap.c | 1422 ++ src/modules/rlm_passwd/README.md | 15 + src/modules/rlm_passwd/all.mk | 2 + src/modules/rlm_passwd/rlm_passwd.c | 624 + src/modules/rlm_perl/.gitignore | 2 + src/modules/rlm_perl/README.md | 12 + src/modules/rlm_perl/all.mk.in | 10 + src/modules/rlm_perl/config.h.in | 1 + src/modules/rlm_perl/configure | 4721 ++++++ src/modules/rlm_perl/configure.ac | 102 + src/modules/rlm_perl/rlm_perl.c | 1195 ++ src/modules/rlm_preprocess/README.md | 11 + src/modules/rlm_preprocess/all.mk | 2 + src/modules/rlm_preprocess/rlm_preprocess.c | 736 + src/modules/rlm_python/.gitignore | 1 + src/modules/rlm_python/README.md | 12 + src/modules/rlm_python/all.mk.in | 26 + src/modules/rlm_python/config.h.in | 4 + src/modules/rlm_python/configure | 4806 ++++++ src/modules/rlm_python/configure.ac | 145 + src/modules/rlm_python/example.py | 99 + src/modules/rlm_python/prepaid.py | 251 + src/modules/rlm_python/prepaid.sql | 41 + src/modules/rlm_python/radiusd.py | 47 + src/modules/rlm_python/radiusd_test.py | 63 + src/modules/rlm_python/rlm_python.c | 1284 ++ src/modules/rlm_python3/.gitignore | 1 + src/modules/rlm_python3/README.md | 12 + src/modules/rlm_python3/all.mk.in | 26 + src/modules/rlm_python3/config.h.in | 4 + src/modules/rlm_python3/configure | 4802 ++++++ src/modules/rlm_python3/configure.ac | 101 + src/modules/rlm_python3/example.py | 99 + src/modules/rlm_python3/prepaid.py | 247 + src/modules/rlm_python3/prepaid.sql | 41 + src/modules/rlm_python3/radiusd.py | 43 + src/modules/rlm_python3/rlm_python3.c | 1372 ++ src/modules/rlm_python3/rlm_python3.h | 63 + src/modules/rlm_radutmp/.gitignore | 2 + src/modules/rlm_radutmp/README.md | 11 + src/modules/rlm_radutmp/all.mk.in | 10 + src/modules/rlm_radutmp/config.h.in | 34 + src/modules/rlm_radutmp/configure | 4540 ++++++ src/modules/rlm_radutmp/configure.ac | 18 + src/modules/rlm_radutmp/rlm_radutmp.c | 763 + src/modules/rlm_realm/.gitignore | 1 + src/modules/rlm_realm/README.md | 10 + src/modules/rlm_realm/all.mk.in | 17 + src/modules/rlm_realm/configure | 4438 +++++ src/modules/rlm_realm/configure.ac | 39 + src/modules/rlm_realm/rlm_realm.c | 542 + src/modules/rlm_realm/trustrouter.c | 715 + src/modules/rlm_realm/trustrouter.h | 38 + src/modules/rlm_redis/.gitignore | 2 + src/modules/rlm_redis/README.md | 14 + src/modules/rlm_redis/all.mk.in | 10 + src/modules/rlm_redis/configure | 4201 +++++ src/modules/rlm_redis/configure.ac | 102 + src/modules/rlm_redis/rlm_redis.c | 336 + src/modules/rlm_redis/rlm_redis.h | 65 + src/modules/rlm_rediswho/.gitignore | 1 + src/modules/rlm_rediswho/README.md | 11 + src/modules/rlm_rediswho/all.mk.in | 11 + src/modules/rlm_rediswho/configure | 4201 +++++ src/modules/rlm_rediswho/configure.ac | 102 + src/modules/rlm_rediswho/rlm_rediswho.c | 247 + src/modules/rlm_replicate/README.md | 10 + src/modules/rlm_replicate/all.mk | 2 + src/modules/rlm_replicate/rlm_replicate.c | 290 + src/modules/rlm_rest/.gitignore | 1 + src/modules/rlm_rest/README.md | 11 + src/modules/rlm_rest/all.mk.in | 14 + src/modules/rlm_rest/config.h.in | 85 + src/modules/rlm_rest/configure | 5313 ++++++ src/modules/rlm_rest/configure.ac | 155 + src/modules/rlm_rest/demo.pl | 59 + src/modules/rlm_rest/rest.c | 2689 +++ src/modules/rlm_rest/rest.h | 328 + src/modules/rlm_rest/rlm_rest.c | 1011 ++ src/modules/rlm_ruby/.gitignore | 1 + src/modules/rlm_ruby/README.md | 10 + src/modules/rlm_ruby/all.mk.in | 22 + src/modules/rlm_ruby/configure | 4638 ++++++ src/modules/rlm_ruby/configure.ac | 40 + src/modules/rlm_ruby/example.rb | 25 + src/modules/rlm_ruby/rlm_ruby.c | 481 + src/modules/rlm_securid/.gitignore | 1 + src/modules/rlm_securid/README | 34 + src/modules/rlm_securid/README.md | 49 + src/modules/rlm_securid/all.mk.in | 18 + src/modules/rlm_securid/configure | 4200 +++++ src/modules/rlm_securid/configure.ac | 97 + src/modules/rlm_securid/mem.c | 313 + src/modules/rlm_securid/rlm_securid.c | 563 + src/modules/rlm_securid/rlm_securid.h | 93 + src/modules/rlm_securid/securid | 19 + src/modules/rlm_smsotp/.gitignore | 1 + src/modules/rlm_smsotp/README.md | 11 + src/modules/rlm_smsotp/all.mk.in | 10 + src/modules/rlm_smsotp/config.h.in | 34 + src/modules/rlm_smsotp/configure | 4552 ++++++ src/modules/rlm_smsotp/configure.ac | 24 + src/modules/rlm_smsotp/rlm_smsotp.c | 344 + src/modules/rlm_smsotp/smsotpd.pl | 238 + src/modules/rlm_soh/README.md | 10 + src/modules/rlm_soh/all.mk | 2 + src/modules/rlm_soh/rlm_soh.c | 226 + src/modules/rlm_sometimes/README.md | 13 + src/modules/rlm_sometimes/all.mk | 2 + src/modules/rlm_sometimes/rlm_sometimes.c | 191 + src/modules/rlm_sql/.gitignore | 1 + src/modules/rlm_sql/README.md | 19 + src/modules/rlm_sql/all.mk.in | 12 + src/modules/rlm_sql/configure | 3980 +++++ src/modules/rlm_sql/configure.ac | 41 + src/modules/rlm_sql/drivers/rlm_sql_db2/README.md | 8 + src/modules/rlm_sql/drivers/rlm_sql_db2/all.mk.in | 11 + src/modules/rlm_sql/drivers/rlm_sql_db2/configure | 4191 +++++ .../rlm_sql/drivers/rlm_sql_db2/configure.ac | 83 + .../rlm_sql/drivers/rlm_sql_db2/rlm_sql_db2.c | 271 + .../rlm_sql/drivers/rlm_sql_firebird/README.md | 8 + .../rlm_sql/drivers/rlm_sql_firebird/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_firebird/configure | 4192 +++++ .../rlm_sql/drivers/rlm_sql_firebird/configure.ac | 83 + .../drivers/rlm_sql_firebird/rlm_sql_firebird.c | 298 + .../rlm_sql/drivers/rlm_sql_firebird/sql_fbapi.c | 578 + .../rlm_sql/drivers/rlm_sql_firebird/sql_fbapi.h | 91 + .../rlm_sql/drivers/rlm_sql_freetds/.gitignore | 1 + .../rlm_sql/drivers/rlm_sql_freetds/README.md | 8 + .../rlm_sql/drivers/rlm_sql_freetds/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_freetds/configure | 4200 +++++ .../rlm_sql/drivers/rlm_sql_freetds/configure.ac | 97 + .../drivers/rlm_sql_freetds/rlm_sql_freetds.c | 773 + .../rlm_sql/drivers/rlm_sql_iodbc/.gitignore | 1 + .../rlm_sql/drivers/rlm_sql_iodbc/README.md | 8 + .../rlm_sql/drivers/rlm_sql_iodbc/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_iodbc/configure | 4191 +++++ .../rlm_sql/drivers/rlm_sql_iodbc/configure.ac | 83 + .../rlm_sql/drivers/rlm_sql_iodbc/rlm_sql_iodbc.c | 295 + .../rlm_sql/drivers/rlm_sql_mongo/README.md | 8 + .../rlm_sql/drivers/rlm_sql_mongo/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_mongo/configure | 4075 +++++ .../rlm_sql/drivers/rlm_sql_mongo/configure.ac | 118 + .../rlm_sql/drivers/rlm_sql_mongo/rlm_sql_mongo.c | 884 + .../rlm_sql/drivers/rlm_sql_mysql/.gitignore | 2 + .../rlm_sql/drivers/rlm_sql_mysql/README.md | 8 + .../rlm_sql/drivers/rlm_sql_mysql/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_mysql/config.h.in | 7 + .../rlm_sql/drivers/rlm_sql_mysql/configure | 4789 ++++++ .../rlm_sql/drivers/rlm_sql_mysql/configure.ac | 265 + .../rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c | 858 + src/modules/rlm_sql/drivers/rlm_sql_null/README.md | 8 + src/modules/rlm_sql/drivers/rlm_sql_null/all.mk | 4 + .../rlm_sql/drivers/rlm_sql_null/rlm_sql_null.c | 120 + .../rlm_sql/drivers/rlm_sql_oracle/README.md | 8 + .../rlm_sql/drivers/rlm_sql_oracle/all.mk.in | 14 + .../rlm_sql/drivers/rlm_sql_oracle/configure | 4160 +++++ .../rlm_sql/drivers/rlm_sql_oracle/configure.ac | 153 + .../drivers/rlm_sql_oracle/rlm_sql_oracle.c | 482 + .../rlm_sql/drivers/rlm_sql_postgresql/.gitignore | 1 + .../rlm_sql/drivers/rlm_sql_postgresql/README.md | 8 + .../rlm_sql/drivers/rlm_sql_postgresql/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_postgresql/config.h.in | 16 + .../rlm_sql/drivers/rlm_sql_postgresql/configure | 4473 +++++ .../drivers/rlm_sql_postgresql/configure.ac | 119 + .../rlm_sql_postgresql/rlm_sql_postgresql.c | 610 + .../drivers/rlm_sql_postgresql/sql_postgresql.h | 250 + .../rlm_sql/drivers/rlm_sql_sqlite/README.md | 8 + .../rlm_sql/drivers/rlm_sql_sqlite/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_sqlite/config.h.in | 19 + .../rlm_sql/drivers/rlm_sql_sqlite/configure | 4474 +++++ .../rlm_sql/drivers/rlm_sql_sqlite/configure.ac | 117 + .../drivers/rlm_sql_sqlite/rlm_sql_sqlite.c | 800 + .../rlm_sql/drivers/rlm_sql_unixodbc/.gitignore | 1 + .../rlm_sql/drivers/rlm_sql_unixodbc/README.md | 8 + .../rlm_sql/drivers/rlm_sql_unixodbc/all.mk.in | 11 + .../rlm_sql/drivers/rlm_sql_unixodbc/configure | 4192 +++++ .../rlm_sql/drivers/rlm_sql_unixodbc/configure.ac | 83 + .../drivers/rlm_sql_unixodbc/rlm_sql_unixodbc.c | 364 + src/modules/rlm_sql/rlm_sql.c | 1847 +++ src/modules/rlm_sql/rlm_sql.h | 258 + src/modules/rlm_sql/rlm_sql.mk | 5 + src/modules/rlm_sql/sql.c | 516 + src/modules/rlm_sql/stable | 7 + src/modules/rlm_sql_map/.gitignore | 1 + src/modules/rlm_sql_map/README.md | 9 + src/modules/rlm_sql_map/all.mk.in | 11 + src/modules/rlm_sql_map/configure | 2924 ++++ src/modules/rlm_sql_map/configure.ac | 21 + src/modules/rlm_sql_map/rlm_sql_map.c | 426 + src/modules/rlm_sqlcounter/.gitignore | 1 + src/modules/rlm_sqlcounter/README.md | 10 + src/modules/rlm_sqlcounter/all.mk.in | 10 + src/modules/rlm_sqlcounter/configure | 3959 +++++ src/modules/rlm_sqlcounter/configure.ac | 21 + src/modules/rlm_sqlcounter/rlm_sqlcounter.c | 707 + src/modules/rlm_sqlippool/.gitignore | 1 + src/modules/rlm_sqlippool/README.md | 10 + src/modules/rlm_sqlippool/all.mk.in | 11 + src/modules/rlm_sqlippool/configure | 2924 ++++ src/modules/rlm_sqlippool/configure.ac | 21 + src/modules/rlm_sqlippool/rlm_sqlippool.c | 900 ++ src/modules/rlm_test/README.md | 10 + src/modules/rlm_test/all.mk | 2 + src/modules/rlm_test/rlm_test.c | 227 + src/modules/rlm_totp/.gitignore | 3 + src/modules/rlm_totp/Makefile | 33 + src/modules/rlm_totp/README.md | 9 + src/modules/rlm_totp/all.mk | 2 + src/modules/rlm_totp/rlm_totp.c | 320 + src/modules/rlm_totp/sha1.txt | 6 + src/modules/rlm_unbound/.gitignore | 1 + src/modules/rlm_unbound/README.md | 10 + src/modules/rlm_unbound/all.mk.in | 12 + src/modules/rlm_unbound/config.h.in | 1 + src/modules/rlm_unbound/configure | 4288 +++++ src/modules/rlm_unbound/configure.ac | 66 + src/modules/rlm_unbound/rlm_unbound.c | 758 + src/modules/rlm_unix/.gitignore | 2 + src/modules/rlm_unix/README.md | 15 + src/modules/rlm_unix/all.mk.in | 10 + src/modules/rlm_unix/config.h.in | 49 + src/modules/rlm_unix/configure | 4757 ++++++ src/modules/rlm_unix/configure.ac | 53 + src/modules/rlm_unix/rlm_unix.c | 546 + src/modules/rlm_unpack/README.md | 9 + src/modules/rlm_unpack/all.mk | 2 + src/modules/rlm_unpack/rlm_unpack.c | 422 + src/modules/rlm_utf8/README.md | 10 + src/modules/rlm_utf8/all.mk | 2 + src/modules/rlm_utf8/rlm_utf8.c | 73 + src/modules/rlm_wimax/README.md | 9 + src/modules/rlm_wimax/all.mk | 9 + src/modules/rlm_wimax/milenage.c | 642 + src/modules/rlm_wimax/milenage.h | 128 + src/modules/rlm_wimax/rlm_wimax.c | 842 + src/modules/rlm_yubikey/.gitignore | 1 + src/modules/rlm_yubikey/README.md | 11 + src/modules/rlm_yubikey/all.mk.in | 23 + src/modules/rlm_yubikey/config.h.in | 7 + src/modules/rlm_yubikey/configure | 4864 ++++++ src/modules/rlm_yubikey/configure.ac | 196 + src/modules/rlm_yubikey/decrypt.c | 137 + src/modules/rlm_yubikey/rlm_yubikey.c | 455 + src/modules/rlm_yubikey/rlm_yubikey.h | 54 + src/modules/rlm_yubikey/validate.c | 201 + src/modules/stable | 46 + src/tests/.gitignore | 12 + src/tests/Makefile | 328 + src/tests/README | 29 + src/tests/all.mk | 78 + src/tests/auth/all.mk | 119 + src/tests/auth/chap | 3 + src/tests/auth/chap.attrs | 4 + src/tests/auth/chap_header | 7 + src/tests/auth/chap_header.attrs | 4 + src/tests/auth/digest | 3 + src/tests/auth/digest.attrs | 25 + src/tests/auth/md5_password | 7 + src/tests/auth/md5_password.attrs | 4 + src/tests/auth/password_with_header | 7 + src/tests/auth/password_with_header.attrs | 4 + src/tests/auth/password_without_header | 7 + src/tests/auth/password_without_header.attrs | 4 + src/tests/auth/radiusd.conf | 50 + src/tests/auth/user_password | 3 + src/tests/auth/user_password.attrs | 4 + src/tests/auth/wimax | 3 + src/tests/auth/wimax.attrs | 30 + src/tests/bob | 2 + src/tests/comp128-1vectors | 1024 ++ src/tests/comp128-2vectors | 1024 ++ src/tests/comp128-3vectors | 1024 ++ src/tests/config/test.conf | 114 + src/tests/dictionary.test | 11 + src/tests/digest-01/digest-auth-MD5 | 28 + src/tests/digest-01/digest-auth-MD5_Sess | 23 + src/tests/digest-01/digest-auth-int | 23 + src/tests/digest-01/digest-auth-noalgo | 21 + src/tests/digest-01/digest-auth_int-MD5 | 23 + src/tests/digest-01/digest-auth_int-MD5_Sess | 24 + src/tests/digest-01/digest-auth_int-noalgo | 22 + src/tests/digest-01/digest-md5-sess | 21 + src/tests/eap-fast.conf | 15 + src/tests/eap-md5.conf | 10 + src/tests/eap-mschapv2.conf | 10 + src/tests/eap-pwd.conf | 11 + src/tests/eap-tls.conf | 19 + src/tests/eap-ttls-eap-mschapv2.conf | 17 + src/tests/eap-ttls-eap-tls.conf | 15 + src/tests/eap-ttls-mschapv2.conf | 12 + src/tests/eap-ttls-pap.conf | 12 + src/tests/eapcrypto-01/eapcrypto-out.txt | 63 + src/tests/eapmd5-01/client.gdb | 5 + src/tests/eapmd5-01/client.sh | 14 + src/tests/eapmd5-01/req.txt | 8 + src/tests/eapsim-02/check.gdb | 3 + src/tests/eapsim-02/client.sh | 14 + src/tests/eapsim-02/eapsim-in.txt | 59 + src/tests/eapsim-02/eapsim-out.txt | 161 + src/tests/eapsim-02/req.txt | 8 + src/tests/eapsim-03/check.gdb | 2 + src/tests/eapsim-03/client.sh | 6 + src/tests/eapsim-03/eapsim-cooked.txt | 169 + src/tests/eapsim-03/eapsim-in.txt | 17 + src/tests/eapsim-03/eapsim-out.txt | 169 + src/tests/eapsim-03/eapsim-sanitize.sed | 21 + src/tests/eapsim-03/radiusd-example.txt | 1506 ++ src/tests/eapsim-03/users-example.txt | 34 + src/tests/eapsim-04/client.sh | 6 + src/tests/eapsim-04/eapsim-cooked.txt | 169 + src/tests/eapsim-04/eapsim-in.txt | 17 + src/tests/eapsim-04/myvectors.txt | 136 + src/tests/eapsim-04/users.txt | 17 + src/tests/eapsim-05/check.gdb | 2 + src/tests/eapsim-05/client.sh | 6 + src/tests/eapsim-05/description.txt | 2 + src/tests/eapsim-05/eapsim-cooked.txt | 148 + src/tests/eapsim-05/eapsim-in.txt | 15 + src/tests/eapsim-05/eapsim-out.txt | 148 + src/tests/eapsim-05/eapsim-raw.txt | 148 + src/tests/eapsim-05/eapsim-sanitize.sed | 10 + src/tests/eapsim-06/check.gdb | 2 + src/tests/eapsim-06/client.sh | 6 + src/tests/eapsim-06/description.txt | 24 + src/tests/eapsim-06/eapsim-cooked.txt | 184 + src/tests/eapsim-06/eapsim-in.txt | 15 + src/tests/eapsim-06/eapsim-out.txt | 184 + src/tests/eapsim-06/eapsim-raw.txt | 184 + src/tests/eapsim-06/simtriplets.dat | 5 + src/tests/example.com | 5 + src/tests/fips186-02/description.txt | 5 + src/tests/fips186-02/fips186-2.txt | 9 + src/tests/hmac-md5-01/digest1.txt | 1 + src/tests/hmac-sha1-01/digest1.txt | 1 + src/tests/keywords/3gpp | 19 + src/tests/keywords/README.md | 43 + src/tests/keywords/all.mk | 123 + src/tests/keywords/array | 53 + src/tests/keywords/base64 | 141 + src/tests/keywords/break-error | 11 + src/tests/keywords/cache | 229 + src/tests/keywords/case-attr-error | 20 + src/tests/keywords/case-empty | 23 + src/tests/keywords/case-empty-string | 25 + src/tests/keywords/case-list | 19 + src/tests/keywords/cast-byte | 25 + src/tests/keywords/cast-integer | 25 + src/tests/keywords/cast-ipaddr | 442 + src/tests/keywords/cast-short | 25 + src/tests/keywords/cmp | 20 + src/tests/keywords/cmp-ipaddr | 20 + src/tests/keywords/comments | 48 + src/tests/keywords/count-error | 11 + src/tests/keywords/crypt | 151 + src/tests/keywords/default-input.attrs | 11 + src/tests/keywords/else-error | 14 + src/tests/keywords/escape | 67 + src/tests/keywords/escape-sequences | 95 + src/tests/keywords/expand | 39 + src/tests/keywords/expr | 108 + src/tests/keywords/foreach | 5 + src/tests/keywords/foreach-break | 73 + src/tests/keywords/foreach-break-2 | 46 + src/tests/keywords/foreach-break-3 | 44 + src/tests/keywords/foreach-break-4 | 44 + src/tests/keywords/foreach-break.attrs | 18 + src/tests/keywords/foreach-error | 5 + src/tests/keywords/foreach-isolation | 38 + src/tests/keywords/foreach-list | 5 + src/tests/keywords/foreach-list.attrs | 21 + src/tests/keywords/foreach-nested | 9 + src/tests/keywords/foreach-nested.attrs | 25 + src/tests/keywords/foreach-regex | 26 + src/tests/keywords/foreach-regex.attrs | 16 + src/tests/keywords/foreach-return | 52 + src/tests/keywords/foreach-varied-depth | 43 + src/tests/keywords/foreach.attrs | 18 + src/tests/keywords/hex | 141 + src/tests/keywords/if | 10 + src/tests/keywords/if-bob | 15 + src/tests/keywords/if-else | 15 + src/tests/keywords/if-elsif | 19 + src/tests/keywords/if-multivalue | 173 + src/tests/keywords/if-paircmp | 27 + src/tests/keywords/if-rcode-error | 11 + src/tests/keywords/if-regex-bad-attribute | 21 + src/tests/keywords/if-regex-error | 12 + src/tests/keywords/if-regex-match | 183 + src/tests/keywords/if-regex-match-comp | 149 + src/tests/keywords/if-regex-match-comp.attrs | 7 + src/tests/keywords/if-regex-match-named | 117 + src/tests/keywords/if-regex-match-named.attrs | 6 + src/tests/keywords/if-regex-match.attrs | 7 + src/tests/keywords/if-regex-multivalue | 26 + src/tests/keywords/if-skip | 42 + src/tests/keywords/integer | 209 + src/tests/keywords/ipaddr | 51 + src/tests/keywords/ipaddr-error | 10 + src/tests/keywords/ipaddr.attrs | 12 + src/tests/keywords/ipprefix | 52 + src/tests/keywords/length | 155 + src/tests/keywords/load-balance | 97 + src/tests/keywords/log | 7 + src/tests/keywords/map-xlat | 25 + src/tests/keywords/md4 | 58 + src/tests/keywords/md5 | 60 + src/tests/keywords/module-failure-message | 40 + src/tests/keywords/ok-return | 13 + src/tests/keywords/ok-return.attrs | 4 + src/tests/keywords/pad | 62 + src/tests/keywords/pairs | 42 + src/tests/keywords/pap | 146 + src/tests/keywords/pap-ssha2 | 114 + src/tests/keywords/radiusd.conf | 127 + src/tests/keywords/redundant | 17 + src/tests/keywords/redundant-error | 6 + src/tests/keywords/redundant-load-balance | 65 + src/tests/keywords/redundant-redundant | 73 + src/tests/keywords/regex-escape | 29 + src/tests/keywords/regex-lhs | 27 + src/tests/keywords/return | 33 + src/tests/keywords/return-group | 22 + src/tests/keywords/return-group.attrs | 4 + src/tests/keywords/return-section | 35 + src/tests/keywords/sha1 | 60 + src/tests/keywords/sha2 | 81 + src/tests/keywords/smash | 6 + src/tests/keywords/string | 19 + src/tests/keywords/substring | 418 + src/tests/keywords/switch | 19 + src/tests/keywords/switch-attr-cast | 34 + src/tests/keywords/switch-attr-cmp | 36 + src/tests/keywords/switch-default | 22 + src/tests/keywords/switch-escape | 43 + src/tests/keywords/switch-nodefault | 22 + src/tests/keywords/switch-value-error | 29 + src/tests/keywords/switch-value-error2 | 27 + src/tests/keywords/switch-virtual | 23 + src/tests/keywords/switch-xlat-error | 17 + src/tests/keywords/truncation | 109 + src/tests/keywords/unknown | 84 + src/tests/keywords/unknown-if | 8 + src/tests/keywords/unknown-name | 15 + src/tests/keywords/unknown-update | 6 + src/tests/keywords/update | 7 + src/tests/keywords/update-add-ref-index | 118 + src/tests/keywords/update-add-ref-tag | 118 + src/tests/keywords/update-all | 9 + src/tests/keywords/update-array | 63 + src/tests/keywords/update-delete | 40 + src/tests/keywords/update-error | 9 + src/tests/keywords/update-error-2 | 9 + src/tests/keywords/update-error-3 | 10 + src/tests/keywords/update-exec | 94 + src/tests/keywords/update-filter | 75 + src/tests/keywords/update-index | 52 + src/tests/keywords/update-list-error | 19 + src/tests/keywords/update-operator | 85 + src/tests/keywords/update-prepend | 65 + src/tests/keywords/update-remove-any | 50 + src/tests/keywords/update-remove-index | 100 + src/tests/keywords/update-remove-list | 40 + src/tests/keywords/update-remove-tag | 275 + src/tests/keywords/update-remove-value | 116 + src/tests/keywords/update-tag | 176 + src/tests/keywords/update-xlat | 61 + src/tests/keywords/urlquote | 50 + src/tests/keywords/virtual | 12 + src/tests/keywords/virtual-exists | 12 + src/tests/keywords/virtual-load-balance | 14 + src/tests/keywords/virtual-rhs | 16 + src/tests/keywords/virtual_policy | 15 + src/tests/keywords/wimax | 31 + src/tests/keywords/wimax-comboip | 19 + src/tests/keywords/with_dots | 19 + src/tests/keywords/xlat-attr | 62 + src/tests/keywords/xlat-attr-index | 53 + src/tests/keywords/xlat-attr-tag | 225 + src/tests/keywords/xlat-concat | 40 + src/tests/keywords/xlat-error | 12 + src/tests/keywords/xlat-explode | 91 + src/tests/keywords/xlat-list | 64 + src/tests/keywords/xlat-octets | 36 + src/tests/keywords/xlat-virtual-attr | 131 + src/tests/map/all.mk | 1 + src/tests/map/base | 6 + src/tests/map/base.out | 5 + src/tests/map/count-error | 6 + src/tests/map/count-list-error | 6 + src/tests/map/map_tests.mk | 50 + src/tests/map/map_unit.c | 219 + src/tests/map/map_unit.mk | 5 + src/tests/modules/README.rst | 18 + src/tests/modules/all.mk | 40 + src/tests/modules/always/all.mk | 3 + src/tests/modules/always/module.conf | 7 + src/tests/modules/always/replace.unlang | 11 + src/tests/modules/always/set_rcode.unlang | 44 + src/tests/modules/always/set_status_dead.unlang | 18 + src/tests/modules/always/set_status_revive.unlang | 28 + src/tests/modules/cache/rbtree/all.mk | 2 + src/tests/modules/default-input.attrs | 11 + src/tests/modules/files/addcontrol.attrs | 13 + src/tests/modules/files/addcontrol.unlang | 8 + src/tests/modules/files/addreply.attrs | 12 + src/tests/modules/files/addreply.unlang | 4 + src/tests/modules/files/all.mk | 3 + src/tests/modules/files/authorize | 92 + src/tests/modules/files/bob.attrs | 11 + src/tests/modules/files/bob.unlang | 4 + src/tests/modules/files/doug.attrs | 11 + src/tests/modules/files/doug.unlang | 4 + src/tests/modules/files/fall-through.attrs | 11 + src/tests/modules/files/fall-through.unlang | 4 + src/tests/modules/files/filterreply.attrs | 10 + src/tests/modules/files/filterreply.unlang | 4 + src/tests/modules/files/module.conf | 9 + src/tests/modules/files/subreply.attrs | 12 + src/tests/modules/files/subreply.unlang | 4 + src/tests/modules/json/all.mk | 3 + src/tests/modules/json/encode.attrs | 13 + src/tests/modules/json/encode.unlang | 233 + src/tests/modules/json/module.conf | 150 + src/tests/modules/ldap/acct.attrs | 35 + src/tests/modules/ldap/acct.unlang | 23 + src/tests/modules/ldap/all.mk | 8 + src/tests/modules/ldap/auth.attrs | 15 + src/tests/modules/ldap/auth.unlang | 72 + src/tests/modules/ldap/example.com.ldif | 1 + src/tests/modules/ldap/groups_rfc2307bis.attrs | 15 + src/tests/modules/ldap/groups_rfc2307bis.unlang | 41 + src/tests/modules/ldap/module.conf | 537 + src/tests/modules/pap/all.mk | 3 + src/tests/modules/pap/module.conf | 1 + src/tests/modules/pap/pbkfd2_dig_big.attrs | 11 + src/tests/modules/pap/pbkfd2_dig_big.unlang | 17 + src/tests/modules/pap/pbkfd2_dig_small.attrs | 11 + src/tests/modules/pap/pbkfd2_dig_small.unlang | 17 + src/tests/modules/pap/pbkfd2_iter0.attrs | 11 + src/tests/modules/pap/pbkfd2_iter0.unlang | 17 + src/tests/modules/pap/pbkfd2_iter1.attrs | 11 + src/tests/modules/pap/pbkfd2_iter1.unlang | 17 + src/tests/modules/pap/pbkfd2_iter1000.attrs | 11 + src/tests/modules/pap/pbkfd2_iter1000.unlang | 17 + src/tests/modules/pap/pbkfd2_iter100000.attrs | 10 + src/tests/modules/pap/pbkfd2_iter100000.unlang | 17 + src/tests/modules/pap/pbkfd2_iter_big.attrs | 11 + src/tests/modules/pap/pbkfd2_iter_big.unlang | 17 + src/tests/modules/pap/pbkfd2_iter_miss.attrs | 11 + src/tests/modules/pap/pbkfd2_iter_miss.unlang | 19 + src/tests/modules/pap/pbkfd2_iter_small.attrs | 11 + src/tests/modules/pap/pbkfd2_iter_small.unlang | 19 + src/tests/modules/pap/pbkfd2_passlib.attrs | 10 + src/tests/modules/pap/pbkfd2_passlib.unlang | 20 + src/tests/modules/pap/pbkfd2_salt0.attrs | 10 + src/tests/modules/pap/pbkfd2_salt0.unlang | 19 + src/tests/modules/pap/pbkfd2_salt1.attrs | 10 + src/tests/modules/pap/pbkfd2_salt1.unlang | 17 + src/tests/modules/pap/pbkfd2_salt1024.attrs | 10 + src/tests/modules/pap/pbkfd2_salt1024.unlang | 17 + src/tests/modules/pap/pbkfd2_salt64.attrs | 10 + src/tests/modules/pap/pbkfd2_salt64.unlang | 17 + src/tests/modules/pap/pbkfd2_salt_big.attrs | 10 + src/tests/modules/pap/pbkfd2_salt_big.unlang | 17 + src/tests/modules/pap/pbkfd2_salt_small.attrs | 10 + src/tests/modules/pap/pbkfd2_salt_small.unlang | 17 + src/tests/modules/pap/pbkfd2_sha1.attrs | 10 + src/tests/modules/pap/pbkfd2_sha1.unlang | 17 + src/tests/modules/pap/pbkfd2_sha2_224.attrs | 10 + src/tests/modules/pap/pbkfd2_sha2_224.unlang | 17 + src/tests/modules/pap/pbkfd2_sha2_256.attrs | 10 + src/tests/modules/pap/pbkfd2_sha2_256.unlang | 17 + src/tests/modules/pap/pbkfd2_sha2_384.attrs | 10 + src/tests/modules/pap/pbkfd2_sha2_384.unlang | 17 + src/tests/modules/pap/pbkfd2_sha2_512.attrs | 10 + src/tests/modules/pap/pbkfd2_sha2_512.unlang | 17 + src/tests/modules/preprocess/all.mk | 3 + src/tests/modules/preprocess/hints | 2 + src/tests/modules/preprocess/huntgroups | 0 src/tests/modules/preprocess/module.conf | 4 + src/tests/modules/preprocess/xlat.attrs | 12 + src/tests/modules/preprocess/xlat.unlang | 14 + src/tests/modules/radiusd.conf | 103 + src/tests/modules/rest/all.mk | 6 + src/tests/modules/rest/module.conf | 46 + src/tests/modules/rest/rest_module.attrs | 14 + src/tests/modules/rest/rest_module.unlang | 111 + src/tests/modules/rest/rest_xlat.attrs | 18 + src/tests/modules/rest/rest_xlat.unlang | 208 + src/tests/modules/sql/.gitignore | 1 + src/tests/modules/sql/acct_0_start.attrs | 37 + src/tests/modules/sql/acct_0_start.unlang | 40 + src/tests/modules/sql/acct_1_update.attrs | 37 + src/tests/modules/sql/acct_1_update.unlang | 30 + src/tests/modules/sql/acct_2_stop.attrs | 38 + src/tests/modules/sql/acct_2_stop.unlang | 40 + src/tests/modules/sql/acct_start_conflict.attrs | 37 + src/tests/modules/sql/acct_start_conflict.unlang | 76 + src/tests/modules/sql/acct_update_no_start.attrs | 37 + src/tests/modules/sql/acct_update_no_start.unlang | 40 + src/tests/modules/sql/auth.attrs | 12 + src/tests/modules/sql/auth.unlang | 39 + src/tests/modules/sql/reject.attrs | 12 + src/tests/modules/sql/reject.unlang | 39 + src/tests/modules/sql_mysql/.gitignore | 1 + src/tests/modules/sql_mysql/acct_0_start.attrs | 1 + src/tests/modules/sql_mysql/acct_0_start.unlang | 1 + src/tests/modules/sql_mysql/acct_1_update.attrs | 1 + src/tests/modules/sql_mysql/acct_1_update.unlang | 1 + src/tests/modules/sql_mysql/acct_2_stop.attrs | 1 + src/tests/modules/sql_mysql/acct_2_stop.unlang | 1 + .../modules/sql_mysql/acct_start_conflict.attrs | 1 + .../modules/sql_mysql/acct_start_conflict.unlang | 1 + .../modules/sql_mysql/acct_update_no_start.attrs | 1 + .../modules/sql_mysql/acct_update_no_start.unlang | 1 + src/tests/modules/sql_mysql/all.mk | 6 + src/tests/modules/sql_mysql/auth.attrs | 1 + src/tests/modules/sql_mysql/auth.unlang | 1 + src/tests/modules/sql_mysql/module.conf | 53 + src/tests/modules/sql_mysql/reject.attrs | 1 + src/tests/modules/sql_mysql/reject.unlang | 1 + src/tests/modules/sql_postgresql/.gitignore | 1 + .../modules/sql_postgresql/acct_0_start.attrs | 1 + .../modules/sql_postgresql/acct_0_start.unlang | 1 + .../modules/sql_postgresql/acct_1_update.attrs | 1 + .../modules/sql_postgresql/acct_1_update.unlang | 1 + src/tests/modules/sql_postgresql/acct_2_stop.attrs | 1 + .../modules/sql_postgresql/acct_2_stop.unlang | 1 + .../sql_postgresql/acct_start_conflict.attrs | 1 + .../sql_postgresql/acct_start_conflict.unlang | 1 + .../sql_postgresql/acct_update_no_start.attrs | 1 + .../sql_postgresql/acct_update_no_start.unlang | 1 + src/tests/modules/sql_postgresql/all.mk | 6 + src/tests/modules/sql_postgresql/auth.attrs | 1 + src/tests/modules/sql_postgresql/auth.unlang | 1 + src/tests/modules/sql_postgresql/module.conf | 52 + src/tests/modules/sql_postgresql/reject.attrs | 1 + src/tests/modules/sql_postgresql/reject.unlang | 1 + src/tests/modules/sql_sqlite/.gitignore | 1 + src/tests/modules/sql_sqlite/acct_0_start.attrs | 1 + src/tests/modules/sql_sqlite/acct_0_start.unlang | 1 + src/tests/modules/sql_sqlite/acct_1_update.attrs | 1 + src/tests/modules/sql_sqlite/acct_1_update.unlang | 1 + src/tests/modules/sql_sqlite/acct_2_stop.attrs | 1 + src/tests/modules/sql_sqlite/acct_2_stop.unlang | 1 + .../modules/sql_sqlite/acct_start_conflict.attrs | 1 + .../modules/sql_sqlite/acct_start_conflict.unlang | 1 + .../modules/sql_sqlite/acct_update_no_start.attrs | 1 + .../modules/sql_sqlite/acct_update_no_start.unlang | 1 + src/tests/modules/sql_sqlite/all.mk | 3 + src/tests/modules/sql_sqlite/auth.attrs | 1 + src/tests/modules/sql_sqlite/auth.unlang | 1 + src/tests/modules/sql_sqlite/module.conf | 52 + src/tests/modules/sql_sqlite/reject.attrs | 1 + src/tests/modules/sql_sqlite/reject.unlang | 1 + src/tests/modules/test.mk | 165 + src/tests/modules/unbound/all.mk | 3 + src/tests/modules/unbound/dns.attrs | 11 + src/tests/modules/unbound/dns.unlang | 53 + src/tests/modules/unbound/module.conf | 4 + src/tests/modules/unbound/unbound.conf | 6 + src/tests/mschapv1 | 16 + src/tests/panic.gdb | 4 + src/tests/peap-client-mschapv2.conf | 18 + src/tests/peap-eap-tls.conf | 14 + src/tests/peap-mschapv2.conf | 13 + src/tests/proxy.conf | 61 + src/tests/radiusd.mk | 115 + src/tests/radsec/.gitignore | 6 + src/tests/radsec/1.basic-auth.reply | 2 + src/tests/radsec/1.basic-auth.request | 3 + src/tests/radsec/2.ipaddrudp-coa.reply | 4 + src/tests/radsec/2.ipaddrudp-coa.request | 3 + src/tests/radsec/3.homepooludp-coa.reply | 4 + src/tests/radsec/3.homepooludp-coa.request | 2 + src/tests/radsec/4.homepooltls-coa.reply | 4 + src/tests/radsec/4.homepooltls-coa.request | 2 + src/tests/radsec/5.singletunnel_proxy-coa.reply | 6 + src/tests/radsec/5.singletunnel_proxy-coa.request | 2 + .../radsec/6.singletunnel_originate-coa.reply | 4 + .../radsec/6.singletunnel_originate-coa.request | 2 + src/tests/radsec/7.coareply-auth.reply | 4 + src/tests/radsec/7.coareply-auth.request | 2 + src/tests/radsec/Makefile | 10 + src/tests/radsec/README.rst | 103 + src/tests/radsec/all.mk | 150 + src/tests/radsec/config-coa/main.conf.template | 37 + src/tests/radsec/config-home/main.conf | 322 + src/tests/radsec/config-proxy/main.conf.template | 207 + src/tests/radsec/runtest.sh | 83 + src/tests/rbmonkey.c | 250 + src/tests/rbmonkey.mk | 7 + src/tests/runtests.sh | 51 + src/tests/salt-test-server/.gitignore | 8 + src/tests/salt-test-server/README | 3 + src/tests/salt-test-server/build.sh | 1 + src/tests/salt-test-server/salt/iptable.sls | 13 + src/tests/salt-test-server/salt/iptables | 15 + src/tests/salt-test-server/salt/ldap.sls | 41 + src/tests/salt-test-server/salt/ldap/base.ldif | 80 + src/tests/salt-test-server/salt/ldap/base2.ldif | 81 + .../salt/ldap/schema_freeradius.ldif | 76 + src/tests/salt-test-server/salt/mysql.sls | 74 + src/tests/salt-test-server/salt/mysql/schema.sql | 150 + src/tests/salt-test-server/salt/mysql/setup.sql | 18 + src/tests/salt-test-server/salt/ntp.sls | 22 + src/tests/salt-test-server/salt/postgres.sls | 71 + .../salt-test-server/salt/postgres/schema.sql | 183 + src/tests/salt-test-server/salt/postgres/setup.sql | 21 + src/tests/salt-test-server/salt/top.sls | 7 + src/tests/salt-test-server/salt_config/master | 12 + src/tests/salt-test-server/salt_config/roster | 4 + src/tests/sql_nas_table/all.mk | 78 + src/tests/sql_nas_table/auth.txt | 2 + src/tests/sql_nas_table/clients.sql | 1 + src/tests/sql_nas_table/config/radiusd.conf | 143 + src/tests/stripped.example.com | 5 + src/tests/test.example.com | 7 + src/tests/tests.gdb | 9 + src/tests/tls/README.md | 40 + src/tests/tls/acct | 7 + src/tests/tls/block.sh | 34 + src/tests/tls/common.sh | 12 + src/tests/tls/home/radiusd.conf | 105 + src/tests/tls/proxy/proxy.conf | 59 + src/tests/tls/proxy/radiusd.conf | 63 + src/tests/tls/radacct.sh | 7 + src/tests/tls/radclient.sh | 7 + src/tests/tls/radiusd-home.sh | 7 + src/tests/tls/radiusd-proxy.sh | 7 + src/tests/tls/user_password | 3 + src/tests/unit/all.mk | 53 + src/tests/unit/ascend.txt | 5 + src/tests/unit/condition.txt | 679 + src/tests/unit/dhcp.txt | 44 + src/tests/unit/eapol_key_msg.txt | 14 + src/tests/unit/errors.txt | 17 + src/tests/unit/escape.txt | 74 + src/tests/unit/extended.txt | 103 + src/tests/unit/lucent.txt | 11 + src/tests/unit/rfc.txt | 204 + src/tests/unit/rfc4849.txt | 49 + src/tests/unit/tunnel.txt | 87 + src/tests/unit/vendor.txt | 48 + src/tests/unit/wimax.txt | 171 + src/tests/unit/xlat.txt | 142 + src/tests/xlat/all.mk | 57 + src/tests/xlat/expr.txt | 20 + src/tests/xlat/radiusd.conf | 37 + suse/README.SuSE | 14 + suse/freeradius-server-rpmlintrc | 7 + suse/freeradius-server-tmpfiles.conf | 1 + suse/freeradius.spec | 260 + suse/radiusd-logrotate | 68 + suse/radiusd-pam | 6 + suse/rcradiusd | 138 + 2098 files changed, 578195 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/workflows/ci-deb.yml create mode 100644 .github/workflows/ci-rpm.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 CONTRIBUTING create mode 100644 COPYRIGHT create mode 100644 CREDITS create mode 100644 INSTALL.rst create mode 100644 LICENSE create mode 100644 Make.inc.in create mode 100644 Makefile create mode 100644 README.rst create mode 100644 VERSION create mode 100644 config.guess create mode 100644 config.sub create mode 100755 configure create mode 100644 configure.ac create mode 100644 doc/.gitignore create mode 100644 doc/ChangeLog create mode 100644 doc/Makefile.sphinx create mode 100644 doc/README create mode 100644 doc/all.mk create mode 100644 doc/antora/antora.yml create mode 100644 doc/antora/modules/ROOT/assets/images/favicon.png create mode 100644 doc/antora/modules/ROOT/assets/images/favicon.svg create mode 100644 doc/antora/modules/ROOT/assets/images/networkradius.png create mode 100644 doc/antora/modules/ROOT/nav.adoc create mode 100644 doc/antora/modules/ROOT/pages/directories.adoc create mode 100644 doc/antora/modules/ROOT/pages/index.adoc create mode 100644 doc/antora/modules/howto/nav.adoc create mode 100644 doc/antora/modules/howto/pages/index.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/enable.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/index.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/policy.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/policy_common_options.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/policy_device_options.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_access.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_creation.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/policy_network_options.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/policy_subnet_options.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/prepare.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/dhcp/test.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/proxy/enable_proxy_protocol.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/proxy/enable_radsec.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/proxy/index.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/proxy/radsec_client.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/proxy/radsec_with_haproxy.adoc create mode 100644 doc/antora/modules/howto/pages/protocols/proxy/radsec_with_traefik.adoc create mode 100644 doc/antora/modules/installation/nav.adoc create mode 100644 doc/antora/modules/installation/pages/dependencies.adoc create mode 100644 doc/antora/modules/installation/pages/index.adoc create mode 100644 doc/antora/modules/installation/pages/packages.adoc create mode 100644 doc/antora/modules/installation/pages/source.adoc create mode 100644 doc/antora/modules/installation/pages/upgrade.adoc create mode 100644 doc/antora/modules/unlang/.gitignore create mode 100644 doc/antora/modules/unlang/nav.adoc create mode 100644 doc/antora/modules/unlang/pages/attr.adoc create mode 100644 doc/antora/modules/unlang/pages/break.adoc create mode 100644 doc/antora/modules/unlang/pages/case.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/and.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/cmp.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/eq.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/index.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/not.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/operands.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/or.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/para.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/regex.adoc create mode 100644 doc/antora/modules/unlang/pages/condition/return_codes.adoc create mode 100644 doc/antora/modules/unlang/pages/default.adoc create mode 100644 doc/antora/modules/unlang/pages/else.adoc create mode 100644 doc/antora/modules/unlang/pages/elsif.adoc create mode 100644 doc/antora/modules/unlang/pages/foreach.adoc create mode 100644 doc/antora/modules/unlang/pages/group.adoc create mode 100644 doc/antora/modules/unlang/pages/if.adoc create mode 100644 doc/antora/modules/unlang/pages/index.adoc create mode 100644 doc/antora/modules/unlang/pages/keywords.adoc create mode 100644 doc/antora/modules/unlang/pages/list.adoc create mode 100644 doc/antora/modules/unlang/pages/load-balance.adoc create mode 100644 doc/antora/modules/unlang/pages/module.adoc create mode 100644 doc/antora/modules/unlang/pages/module_builtin.adoc create mode 100644 doc/antora/modules/unlang/pages/module_method.adoc create mode 100644 doc/antora/modules/unlang/pages/redundant-load-balance.adoc create mode 100644 doc/antora/modules/unlang/pages/redundant.adoc create mode 100644 doc/antora/modules/unlang/pages/return.adoc create mode 100644 doc/antora/modules/unlang/pages/return_codes.adoc create mode 100644 doc/antora/modules/unlang/pages/switch.adoc create mode 100644 doc/antora/modules/unlang/pages/type/all_types.adoc create mode 100644 doc/antora/modules/unlang/pages/type/double.adoc create mode 100644 doc/antora/modules/unlang/pages/type/index.adoc create mode 100644 doc/antora/modules/unlang/pages/type/ip.adoc create mode 100644 doc/antora/modules/unlang/pages/type/numb.adoc create mode 100644 doc/antora/modules/unlang/pages/type/string/backticks.adoc create mode 100644 doc/antora/modules/unlang/pages/type/string/double.adoc create mode 100644 doc/antora/modules/unlang/pages/type/string/escaping.adoc create mode 100644 doc/antora/modules/unlang/pages/type/string/single.adoc create mode 100644 doc/antora/modules/unlang/pages/type/string/unquoted.adoc create mode 100644 doc/antora/modules/unlang/pages/update.adoc create mode 100644 doc/antora/modules/unlang/pages/xlat/alternation.adoc create mode 100644 doc/antora/modules/unlang/pages/xlat/attribute.adoc create mode 100644 doc/antora/modules/unlang/pages/xlat/builtin.adoc create mode 100644 doc/antora/modules/unlang/pages/xlat/character.adoc create mode 100644 doc/antora/modules/unlang/pages/xlat/index.adoc create mode 100644 doc/antora/modules/unlang/pages/xlat/module.adoc create mode 100644 doc/antora/modules/unlang/partials/rcode_table.adoc create mode 100644 doc/bugs create mode 100644 doc/concepts/aaa.rst create mode 100644 doc/concepts/proxy.rst create mode 100644 doc/configuration/acct_type.rst create mode 100644 doc/configuration/autz_type.rst create mode 100644 doc/configuration/configurable_failover.rst create mode 100644 doc/configuration/dynamic_home_servers.md create mode 100644 doc/configuration/load_balance.rst create mode 100644 doc/configuration/post_auth_type create mode 100644 doc/configuration/session_type create mode 100644 doc/configuration/simultaneous_use create mode 100644 doc/configuration/snmp create mode 100644 doc/configuration/variables.rst create mode 100644 doc/deployment/CYGWIN.rst create mode 100644 doc/deployment/MACOSX create mode 100644 doc/deployment/OS2 create mode 100644 doc/deployment/performance-testing create mode 100644 doc/deployment/supervise-radiusd.rst create mode 100644 doc/deployment/tuning_guide create mode 100644 doc/developer/autotools.md create mode 100644 doc/developer/coding-methods.rst create mode 100644 doc/developer/contributing.rst create mode 100644 doc/developer/module_interface.rst create mode 100644 doc/developer/release-method.rst create mode 100644 doc/index.rst create mode 100644 doc/modules/RADIUS-LDAP-eDirectory create mode 100644 doc/modules/ldap_howto.rst create mode 100644 doc/modules/mschap.rst create mode 100644 doc/modules/rlm_dbm create mode 100644 doc/modules/rlm_eap create mode 100644 doc/modules/rlm_expiration create mode 100644 doc/modules/rlm_krb5 create mode 100644 doc/modules/rlm_pam create mode 100644 doc/modules/rlm_passwd create mode 100644 doc/modules/rlm_python create mode 100644 doc/modules/rlm_soh create mode 100644 doc/modules/rlm_sql create mode 100644 doc/modules/rlm_sqlcounter create mode 100644 doc/modules/rlm_sqlippool create mode 100644 doc/schemas/ldap/edir/freeradius-clients.ldif create mode 100644 doc/schemas/ldap/iplanet/freeradius.ldif create mode 100644 doc/schemas/ldap/iplanet/freeradius.schema create mode 100644 doc/schemas/ldap/openldap/freeradius-clients.ldif create mode 100644 doc/schemas/ldap/openldap/freeradius-clients.schema create mode 100644 doc/schemas/ldap/openldap/freeradius.ldif create mode 100644 doc/schemas/ldap/openldap/freeradius.schema create mode 100644 doc/schemas/ldap/samba/README.txt create mode 100644 doc/schemas/ldap/samba/freeradius-attrs.ldif create mode 100644 doc/schemas/ldap/samba/freeradius-classes.ldif create mode 100644 doc/schemas/ldap/samba/freeradius-clients-attrs.ldif create mode 100644 doc/schemas/ldap/samba/freeradius-clients-classes.ldif create mode 100644 doc/schemas/ldap/samba/freeradius-user.ldif create mode 100644 doc/schemas/logstash/README create mode 100644 doc/schemas/logstash/kibana4-dashboard.json create mode 100644 doc/schemas/logstash/log-courier.conf create mode 100644 doc/schemas/logstash/logstash-radius.conf create mode 100755 doc/schemas/logstash/radius-mapping.sh create mode 100644 doc/schemas/sql create mode 100644 doc/source/.gitignore create mode 100644 doc/source/Doxyfile create mode 100644 doc/source/extra/client.c create mode 100644 doc/source/extra/core.c create mode 100644 doc/source/extra/freeradius.png create mode 100644 doc/source/extra/module.c create mode 100644 doc/source/extra/toc.c create mode 100644 doc/vendor/ascend create mode 100644 doc/vendor/bay create mode 100644 doc/vendor/cisco.rst create mode 100644 doc/vendor/proxim create mode 100755 install-sh create mode 100644 m4/ac_prog_cc_sunpro.m4 create mode 100644 m4/ax_cc.m4 create mode 100644 m4/ax_compare_version.m4 create mode 100644 m4/ax_prog_perl_modules.m4 create mode 100644 m4/ax_prog_ruby_version.m4 create mode 100644 m4/ax_ruby_devel.m4 create mode 100644 m4/ax_with_prog.m4 create mode 100644 m4/fr_check_struct_has_member.m4 create mode 100644 m4/fr_check_type_include.m4 create mode 100644 m4/fr_have_bounded_attribute.m4 create mode 100644 m4/fr_have_builtin_bswap64.m4 create mode 100644 m4/fr_have_builtin_choose_expr.m4 create mode 100644 m4/fr_have_builtin_types_compatible_p.m4 create mode 100644 m4/fr_init_module.m4 create mode 100644 m4/fr_module_start_tests.m4 create mode 100644 m4/fr_smart_check_include.m4 create mode 100644 m4/fr_smart_check_lib.m4 create mode 100644 m4/fr_tls.m4 create mode 100644 m4/libcurl_check_config.m4 create mode 100644 m4/python.m4 create mode 100644 m4/vl_lib_readline.m4 create mode 100644 main.mk create mode 100644 man/man1/dhcpclient.1 create mode 100644 man/man1/rad_counter.1 create mode 100644 man/man1/radclient.1 create mode 100644 man/man1/radeapclient.1 create mode 100644 man/man1/radlast.1 create mode 100644 man/man1/radtest.1 create mode 100644 man/man1/radwho.1 create mode 100644 man/man1/radzap.1 create mode 100644 man/man1/smbencrypt.1 create mode 100644 man/man5/checkrad.5 create mode 100644 man/man5/clients.conf.5 create mode 100644 man/man5/dictionary.5 create mode 100644 man/man5/radiusd.conf.5 create mode 100644 man/man5/radrelay.conf.5 create mode 100644 man/man5/rlm_always.5 create mode 100644 man/man5/rlm_attr_filter.5 create mode 100644 man/man5/rlm_chap.5 create mode 100644 man/man5/rlm_counter.5 create mode 100644 man/man5/rlm_detail.5 create mode 100644 man/man5/rlm_digest.5 create mode 100644 man/man5/rlm_expr.5 create mode 100644 man/man5/rlm_files.5 create mode 100644 man/man5/rlm_idn.5 create mode 100644 man/man5/rlm_mschap.5 create mode 100644 man/man5/rlm_pap.5 create mode 100644 man/man5/rlm_passwd.5 create mode 100644 man/man5/rlm_realm.5 create mode 100644 man/man5/rlm_sql.5 create mode 100644 man/man5/rlm_unbound.5 create mode 100644 man/man5/rlm_unix.5 create mode 100644 man/man5/unlang.5 create mode 100644 man/man5/users.5 create mode 100644 man/man8/radcrypt.8 create mode 100644 man/man8/raddebug.8 create mode 100644 man/man8/radiusd.8 create mode 100644 man/man8/radmin.8 create mode 100644 man/man8/radrelay.8 create mode 100644 man/man8/radsniff.8 create mode 100644 man/man8/radsqlrelay.8 create mode 100644 man/man8/rlm_sqlippool_tool.8 create mode 100644 mibs/FREERADIUS-MGMT-MIB.mib create mode 100644 mibs/FREERADIUS-NOTIFICATION-MIB.mib create mode 100644 mibs/FREERADIUS-PRODUCT-RADIUSD-MIB.mib create mode 100644 mibs/FREERADIUS-SMI.mib create mode 100644 mibs/RADIUS-ACC-CLIENT-MIB.mib create mode 100644 mibs/RADIUS-ACC-SERVER-MIB.mib create mode 100644 mibs/RADIUS-AUTH-CLIENT-MIB.mib create mode 100644 mibs/RADIUS-AUTH-SERVER-MIB.mib create mode 100644 mibs/RADIUS-STAT-MIB.mib create mode 100644 mibs/README create mode 100755 missing create mode 100644 raddb/.gitignore create mode 100644 raddb/README.rst create mode 100644 raddb/all.mk create mode 100644 raddb/certs/.gitignore create mode 100644 raddb/certs/Makefile create mode 100644 raddb/certs/README.md create mode 100755 raddb/certs/bootstrap create mode 100644 raddb/certs/ca.cnf create mode 100644 raddb/certs/client.cnf create mode 100644 raddb/certs/demoCA/cacert.pem create mode 100644 raddb/certs/inner-server.cnf create mode 100644 raddb/certs/ocsp.cnf create mode 100644 raddb/certs/realms/README.md create mode 100644 raddb/certs/server.cnf create mode 100644 raddb/certs/xpextensions create mode 100644 raddb/clients.conf create mode 100644 raddb/debug.conf create mode 100644 raddb/dictionary create mode 100644 raddb/experimental.conf create mode 100644 raddb/home_servers/README.md create mode 100644 raddb/home_servers/tls.conf create mode 100644 raddb/mods-available/README.rst create mode 100644 raddb/mods-available/abfab_psk_sql create mode 100644 raddb/mods-available/always create mode 100644 raddb/mods-available/attr_filter create mode 100644 raddb/mods-available/cache create mode 100644 raddb/mods-available/cache_auth create mode 100644 raddb/mods-available/chap create mode 100644 raddb/mods-available/couchbase create mode 100644 raddb/mods-available/counter create mode 100644 raddb/mods-available/cui create mode 100644 raddb/mods-available/date create mode 100644 raddb/mods-available/detail create mode 100644 raddb/mods-available/detail.example.com create mode 100644 raddb/mods-available/detail.log create mode 100644 raddb/mods-available/dhcp create mode 100644 raddb/mods-available/dhcp_files create mode 100644 raddb/mods-available/dhcp_passwd create mode 100644 raddb/mods-available/dhcp_sql create mode 100644 raddb/mods-available/dhcp_sqlippool create mode 100644 raddb/mods-available/digest create mode 100644 raddb/mods-available/dynamic_clients create mode 100644 raddb/mods-available/eap create mode 100644 raddb/mods-available/echo create mode 100644 raddb/mods-available/etc_group create mode 100644 raddb/mods-available/exec create mode 100644 raddb/mods-available/expiration create mode 100644 raddb/mods-available/expr create mode 100644 raddb/mods-available/files create mode 100644 raddb/mods-available/idn create mode 100644 raddb/mods-available/inner-eap create mode 100644 raddb/mods-available/ippool create mode 100644 raddb/mods-available/json create mode 100644 raddb/mods-available/krb5 create mode 100644 raddb/mods-available/ldap create mode 100644 raddb/mods-available/ldap_google create mode 100644 raddb/mods-available/linelog create mode 100644 raddb/mods-available/logintime create mode 100644 raddb/mods-available/mac2ip create mode 100644 raddb/mods-available/mac2vlan create mode 100644 raddb/mods-available/moonshot-targeted-ids create mode 100644 raddb/mods-available/mschap create mode 100644 raddb/mods-available/ntlm_auth create mode 100644 raddb/mods-available/opendirectory create mode 100644 raddb/mods-available/pam create mode 100644 raddb/mods-available/pap create mode 100644 raddb/mods-available/passwd create mode 100644 raddb/mods-available/perl create mode 100644 raddb/mods-available/preprocess create mode 100644 raddb/mods-available/python create mode 100644 raddb/mods-available/python3 create mode 100644 raddb/mods-available/radutmp create mode 100644 raddb/mods-available/realm create mode 100644 raddb/mods-available/redis create mode 100644 raddb/mods-available/rediswho create mode 100644 raddb/mods-available/replicate create mode 100644 raddb/mods-available/rest create mode 100644 raddb/mods-available/smbpasswd create mode 100644 raddb/mods-available/smsotp create mode 100644 raddb/mods-available/soh create mode 100644 raddb/mods-available/sometimes create mode 100644 raddb/mods-available/sql create mode 100644 raddb/mods-available/sql_map create mode 100644 raddb/mods-available/sqlcounter create mode 100644 raddb/mods-available/sqlippool create mode 100644 raddb/mods-available/sradutmp create mode 100644 raddb/mods-available/totp create mode 100644 raddb/mods-available/unbound create mode 100644 raddb/mods-available/unix create mode 100644 raddb/mods-available/unpack create mode 100644 raddb/mods-available/utf8 create mode 100644 raddb/mods-available/wimax create mode 100644 raddb/mods-available/yubikey create mode 100644 raddb/mods-config/README.rst create mode 100644 raddb/mods-config/attr_filter/access_challenge create mode 100644 raddb/mods-config/attr_filter/access_reject create mode 100644 raddb/mods-config/attr_filter/accounting_response create mode 100644 raddb/mods-config/attr_filter/coa create mode 100644 raddb/mods-config/attr_filter/post-proxy create mode 100644 raddb/mods-config/attr_filter/pre-proxy create mode 100644 raddb/mods-config/files/accounting create mode 100644 raddb/mods-config/files/authorize create mode 100644 raddb/mods-config/files/dhcp create mode 100644 raddb/mods-config/files/pre-proxy create mode 100644 raddb/mods-config/perl/example.pl create mode 100644 raddb/mods-config/preprocess/hints create mode 100644 raddb/mods-config/preprocess/huntgroups create mode 100755 raddb/mods-config/realm/freeradius-naptr-to-home-server.sh create mode 100644 raddb/mods-config/sql/counter/mysql/dailycounter.conf create mode 100644 raddb/mods-config/sql/counter/mysql/expire_on_login.conf create mode 100644 raddb/mods-config/sql/counter/mysql/monthlycounter.conf create mode 100644 raddb/mods-config/sql/counter/mysql/noresetcounter.conf create mode 100644 raddb/mods-config/sql/counter/mysql/weeklycounter.conf create mode 100644 raddb/mods-config/sql/counter/postgresql/dailycounter.conf create mode 100644 raddb/mods-config/sql/counter/postgresql/expire_on_login.conf create mode 100644 raddb/mods-config/sql/counter/postgresql/monthlycounter.conf create mode 100644 raddb/mods-config/sql/counter/postgresql/noresetcounter.conf create mode 100644 raddb/mods-config/sql/counter/postgresql/weeklycounter.conf create mode 100644 raddb/mods-config/sql/counter/sqlite/dailycounter.conf create mode 100644 raddb/mods-config/sql/counter/sqlite/expire_on_login.conf create mode 100644 raddb/mods-config/sql/counter/sqlite/monthlycounter.conf create mode 100644 raddb/mods-config/sql/counter/sqlite/noresetcounter.conf create mode 100644 raddb/mods-config/sql/counter/sqlite/weeklycounter.conf create mode 100644 raddb/mods-config/sql/cui/mysql/queries.conf create mode 100644 raddb/mods-config/sql/cui/mysql/schema.sql create mode 100644 raddb/mods-config/sql/cui/postgresql/queries.conf create mode 100644 raddb/mods-config/sql/cui/postgresql/schema.sql create mode 100644 raddb/mods-config/sql/cui/sqlite/queries.conf create mode 100644 raddb/mods-config/sql/cui/sqlite/schema.sql create mode 100644 raddb/mods-config/sql/dhcp/mssql/queries.conf create mode 100644 raddb/mods-config/sql/dhcp/mssql/schema.sql create mode 100644 raddb/mods-config/sql/dhcp/mysql/queries.conf create mode 100644 raddb/mods-config/sql/dhcp/mysql/schema.sql create mode 100644 raddb/mods-config/sql/dhcp/mysql/setup.sql create mode 100644 raddb/mods-config/sql/dhcp/oracle/queries.conf create mode 100644 raddb/mods-config/sql/dhcp/oracle/schema.sql create mode 100644 raddb/mods-config/sql/dhcp/postgresql/queries.conf create mode 100644 raddb/mods-config/sql/dhcp/postgresql/schema.sql create mode 100644 raddb/mods-config/sql/dhcp/postgresql/setup.sql create mode 100644 raddb/mods-config/sql/dhcp/sqlite/queries.conf create mode 100644 raddb/mods-config/sql/dhcp/sqlite/schema.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/mssql/procedure.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/mssql/queries.conf create mode 100644 raddb/mods-config/sql/ippool-dhcp/mssql/schema.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/mysql/procedure-no-skip-locked.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/mysql/procedure.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/mysql/queries.conf create mode 100644 raddb/mods-config/sql/ippool-dhcp/mysql/schema.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/oracle/procedure.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/oracle/queries.conf create mode 100644 raddb/mods-config/sql/ippool-dhcp/oracle/schema.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/postgresql/procedure.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/postgresql/queries.conf create mode 100644 raddb/mods-config/sql/ippool-dhcp/postgresql/schema.sql create mode 100644 raddb/mods-config/sql/ippool-dhcp/sqlite/queries.conf create mode 100644 raddb/mods-config/sql/ippool-dhcp/sqlite/schema.sql create mode 100644 raddb/mods-config/sql/ippool/mongo/queries.conf create mode 100644 raddb/mods-config/sql/ippool/mssql/procedure.sql create mode 100644 raddb/mods-config/sql/ippool/mssql/queries.conf create mode 100644 raddb/mods-config/sql/ippool/mssql/schema.sql create mode 100644 raddb/mods-config/sql/ippool/mysql/procedure-no-skip-locked.sql create mode 100644 raddb/mods-config/sql/ippool/mysql/procedure.sql create mode 100644 raddb/mods-config/sql/ippool/mysql/queries.conf create mode 100644 raddb/mods-config/sql/ippool/mysql/schema.sql create mode 100644 raddb/mods-config/sql/ippool/oracle/procedure.sql create mode 100644 raddb/mods-config/sql/ippool/oracle/queries.conf create mode 100644 raddb/mods-config/sql/ippool/oracle/schema.sql create mode 100644 raddb/mods-config/sql/ippool/postgresql/procedure.sql create mode 100644 raddb/mods-config/sql/ippool/postgresql/queries.conf create mode 100644 raddb/mods-config/sql/ippool/postgresql/schema.sql create mode 100644 raddb/mods-config/sql/ippool/sqlite/queries.conf create mode 100644 raddb/mods-config/sql/ippool/sqlite/schema.sql create mode 100644 raddb/mods-config/sql/main/mongo/queries.conf create mode 100644 raddb/mods-config/sql/main/mssql/process-radacct.sql create mode 100644 raddb/mods-config/sql/main/mssql/queries.conf create mode 100644 raddb/mods-config/sql/main/mssql/schema.sql create mode 100644 raddb/mods-config/sql/main/mysql/extras/wimax/queries.conf create mode 100644 raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql create mode 100644 raddb/mods-config/sql/main/mysql/process-radacct.sql create mode 100644 raddb/mods-config/sql/main/mysql/queries.conf create mode 100644 raddb/mods-config/sql/main/mysql/schema.sql create mode 100755 raddb/mods-config/sql/main/mysql/setup.sql create mode 100644 raddb/mods-config/sql/main/ndb/README create mode 100644 raddb/mods-config/sql/main/ndb/schema.sql create mode 100644 raddb/mods-config/sql/main/ndb/setup.sql create mode 100644 raddb/mods-config/sql/main/oracle/process-radacct.sql create mode 100644 raddb/mods-config/sql/main/oracle/queries.conf create mode 100644 raddb/mods-config/sql/main/oracle/schema.sql create mode 100644 raddb/mods-config/sql/main/postgresql/extras/cisco_h323_db_schema.sql create mode 100644 raddb/mods-config/sql/main/postgresql/extras/voip-postpaid.conf create mode 100644 raddb/mods-config/sql/main/postgresql/process-radacct.sql create mode 100644 raddb/mods-config/sql/main/postgresql/queries.conf create mode 100644 raddb/mods-config/sql/main/postgresql/schema.sql create mode 100644 raddb/mods-config/sql/main/postgresql/setup.sql create mode 100755 raddb/mods-config/sql/main/sqlite/process-radacct-close-after-reload.pl create mode 100755 raddb/mods-config/sql/main/sqlite/process-radacct-new-data-usage-period.sh create mode 100644 raddb/mods-config/sql/main/sqlite/process-radacct-schema.sql create mode 100644 raddb/mods-config/sql/main/sqlite/queries.conf create mode 100644 raddb/mods-config/sql/main/sqlite/schema.sql create mode 100644 raddb/mods-config/sql/moonshot-targeted-ids/mysql/queries.conf create mode 100644 raddb/mods-config/sql/moonshot-targeted-ids/mysql/schema.sql create mode 100644 raddb/mods-config/sql/moonshot-targeted-ids/postgresql/queries.conf create mode 100644 raddb/mods-config/sql/moonshot-targeted-ids/postgresql/schema.sql create mode 100644 raddb/mods-config/sql/moonshot-targeted-ids/sqlite/queries.conf create mode 100644 raddb/mods-config/sql/moonshot-targeted-ids/sqlite/schema.sql create mode 100644 raddb/mods-config/unbound/default.conf create mode 100644 raddb/panic.gdb create mode 100644 raddb/policy.d/abfab-tr create mode 100644 raddb/policy.d/accounting create mode 100644 raddb/policy.d/canonicalization create mode 100644 raddb/policy.d/control create mode 100644 raddb/policy.d/cui create mode 100644 raddb/policy.d/debug create mode 100644 raddb/policy.d/dhcp create mode 100644 raddb/policy.d/eap create mode 100644 raddb/policy.d/filter create mode 100644 raddb/policy.d/moonshot-targeted-ids create mode 100644 raddb/policy.d/operator-name create mode 100644 raddb/policy.d/rfc7542 create mode 100644 raddb/proxy.conf create mode 100644 raddb/radiusd.conf.in create mode 100644 raddb/radrelay.conf.in create mode 100644 raddb/sites-available/README create mode 100644 raddb/sites-available/abfab-tls create mode 100644 raddb/sites-available/abfab-tr-idp create mode 100644 raddb/sites-available/aws-nlb create mode 100644 raddb/sites-available/buffered-sql create mode 100644 raddb/sites-available/challenge create mode 100644 raddb/sites-available/channel_bindings create mode 100644 raddb/sites-available/check-eap-tls create mode 100644 raddb/sites-available/coa create mode 100644 raddb/sites-available/coa-relay create mode 100644 raddb/sites-available/control-socket create mode 100644 raddb/sites-available/copy-acct-to-home-server create mode 100644 raddb/sites-available/decoupled-accounting create mode 100644 raddb/sites-available/default create mode 100644 raddb/sites-available/dhcp create mode 100644 raddb/sites-available/dhcp.relay create mode 100644 raddb/sites-available/dynamic-clients create mode 100644 raddb/sites-available/example create mode 100644 raddb/sites-available/google-ldap-auth create mode 100644 raddb/sites-available/inner-tunnel create mode 100644 raddb/sites-available/originate-coa create mode 100644 raddb/sites-available/proxy-inner-tunnel create mode 100644 raddb/sites-available/resource-check create mode 100644 raddb/sites-available/robust-proxy-accounting create mode 100644 raddb/sites-available/soh create mode 100644 raddb/sites-available/status create mode 100644 raddb/sites-available/tls create mode 100644 raddb/sites-available/tls-cache create mode 100644 raddb/sites-available/totp create mode 100644 raddb/sites-available/virtual.example.com create mode 100644 raddb/sites-available/vmps create mode 100644 raddb/templates.conf create mode 100644 raddb/trigger.conf create mode 100644 raddb/vmpsd.conf.in create mode 100644 redhat/.gitignore create mode 100644 redhat/README create mode 100644 redhat/freeradius-logrotate create mode 100644 redhat/freeradius-pam-conf create mode 100755 redhat/freeradius-radiusd-init create mode 100644 redhat/freeradius-tmpfiles-conf create mode 100644 redhat/freeradius.spec create mode 100644 redhat/radiusd-pam create mode 100644 redhat/radiusd.service create mode 100644 scripts/.gitignore create mode 100755 scripts/Ssha2Passwd create mode 100644 scripts/all.mk create mode 100644 scripts/bbedit/unlanglaguage.plist create mode 100644 scripts/bin/README.md create mode 100755 scripts/bin/gdb create mode 100755 scripts/bin/lldb create mode 120000 scripts/bin/radclient create mode 100755 scripts/bin/radict create mode 100755 scripts/bin/radiusd create mode 120000 scripts/bin/radmin create mode 120000 scripts/bin/radsniff create mode 120000 scripts/bin/unit_test_module create mode 100644 scripts/boiler.mk create mode 100644 scripts/ci/Dockerfile create mode 100644 scripts/ci/Jenkinsfile create mode 100755 scripts/ci/eapol_test-build.sh create mode 100644 scripts/ci/eapol_test/.gitignore create mode 100644 scripts/ci/eapol_test/config_freebsd create mode 100644 scripts/ci/eapol_test/config_linux create mode 100644 scripts/ci/eapol_test/config_osx create mode 100644 scripts/ci/haproxy.conf create mode 100755 scripts/ci/ldap-setup.sh create mode 100644 scripts/ci/ldap/slapd.conf create mode 100644 scripts/ci/ldap/slapd2.conf create mode 100755 scripts/ci/ldap2-setup.sh create mode 100755 scripts/ci/mysql-setup.sh create mode 100755 scripts/ci/openresty-setup.sh create mode 100644 scripts/ci/openresty/.htpasswd create mode 100644 scripts/ci/openresty/auth-api.lua create mode 100644 scripts/ci/openresty/delay-api.lua create mode 100644 scripts/ci/openresty/json-api.lua create mode 100644 scripts/ci/openresty/post-api.lua create mode 100644 scripts/ci/openresty/test.txt create mode 100644 scripts/ci/package-test.mk create mode 100755 scripts/ci/postgresql-setup.sh create mode 100644 scripts/ci/radsecproxy.conf create mode 100644 scripts/ci/start.sh create mode 100644 scripts/ci/stunnel.conf create mode 100755 scripts/clients.pl create mode 100644 scripts/collectd/radsniff_types.db create mode 100755 scripts/create-users.pl create mode 100644 scripts/cron/radiusd.cron.daily.in create mode 100644 scripts/cron/radiusd.cron.monthly.in create mode 100644 scripts/crossbuild/README.md create mode 100644 scripts/crossbuild/build/.gitignore create mode 100644 scripts/crossbuild/crossbuild.mk create mode 100644 scripts/crossbuild/docker/centos7/Dockerfile create mode 100644 scripts/crossbuild/docker/centos8/Dockerfile create mode 100644 scripts/crossbuild/docker/debian10/Dockerfile create mode 100644 scripts/crossbuild/docker/debian8/Dockerfile create mode 100644 scripts/crossbuild/docker/debian9/Dockerfile create mode 100644 scripts/crossbuild/docker/debian9/README create mode 100644 scripts/crossbuild/docker/ubuntu16/Dockerfile create mode 100644 scripts/crossbuild/docker/ubuntu18/Dockerfile create mode 100644 scripts/crossbuild/docker/ubuntu20/Dockerfile create mode 100755 scripts/cryptpasswd.in create mode 100755 scripts/dhcp/isc2ippool.pl create mode 100755 scripts/dhcp/rlm_iscfixed2ippool create mode 100755 scripts/dict_alias.sh create mode 100644 scripts/docker/README.md create mode 100644 scripts/docker/alpine/Dockerfile create mode 100755 scripts/docker/alpine/docker-entrypoint.sh create mode 100644 scripts/docker/centos7/Dockerfile create mode 100755 scripts/docker/centos7/docker-entrypoint.sh create mode 100644 scripts/docker/debian10/Dockerfile create mode 100755 scripts/docker/debian10/docker-entrypoint.sh create mode 100644 scripts/docker/debian11/Dockerfile create mode 100755 scripts/docker/debian11/docker-entrypoint.sh create mode 100644 scripts/docker/debian9/Dockerfile create mode 100755 scripts/docker/debian9/docker-entrypoint.sh create mode 100644 scripts/docker/debiansid/Dockerfile create mode 100755 scripts/docker/debiansid/docker-entrypoint.sh create mode 100644 scripts/docker/docker.mk create mode 100644 scripts/docker/rocky8/Dockerfile create mode 100755 scripts/docker/rocky8/docker-entrypoint.sh create mode 100644 scripts/docker/ubuntu18/Dockerfile create mode 100755 scripts/docker/ubuntu18/docker-entrypoint.sh create mode 100644 scripts/docker/ubuntu20/Dockerfile create mode 100755 scripts/docker/ubuntu20/docker-entrypoint.sh create mode 100644 scripts/docker/ubuntu22/Dockerfile create mode 100755 scripts/docker/ubuntu22/docker-entrypoint.sh create mode 100755 scripts/exec-program-wait create mode 100755 scripts/git/post-receive create mode 100644 scripts/install.mk create mode 100644 scripts/jlibtool.c create mode 100755 scripts/ldap/radiusd2ldif.pl create mode 100644 scripts/ldap/schema_to_samba.py create mode 100644 scripts/libtool.mk create mode 100644 scripts/logrotate/freeradius create mode 100755 scripts/min-includes.pl create mode 100644 scripts/monit/freeradius.monitrc create mode 100755 scripts/munin/freeradius_acct create mode 100755 scripts/munin/freeradius_auth create mode 100755 scripts/munin/freeradius_proxy_acct create mode 100755 scripts/munin/freeradius_proxy_auth create mode 100755 scripts/munin/radsniff create mode 100644 scripts/osx/README create mode 100644 scripts/osx/org.freeradius.radiusd.plist create mode 100755 scripts/raddebug create mode 100644 scripts/radiusd.sh create mode 100755 scripts/radtee create mode 100755 scripts/raduat create mode 100755 scripts/rc.radiusd.in create mode 100644 scripts/snmp-proxy/README create mode 100644 scripts/snmp-proxy/dictionary.hacked create mode 100644 scripts/snmp-proxy/freeradius-snmp.pl create mode 100644 scripts/snmp-proxy/net-radius-freeradius-dictionary.diff create mode 100644 scripts/solaris/.gitignore create mode 100644 scripts/solaris/README.md create mode 100644 scripts/solaris/radius.xml create mode 100755 scripts/solaris/svc-radius.in create mode 100755 scripts/sql/align_sql_pools.pl create mode 100755 scripts/sql/generate_pool_addresses.pl create mode 100755 scripts/sql/radsqlrelay create mode 100755 scripts/sql/rlm_sqlippool_tool create mode 100644 scripts/sql/users2mysql.pl create mode 100644 share/LICENSE create mode 100644 share/Makefile create mode 100755 share/attrnew.pl create mode 100755 share/attrsort.pl create mode 100755 share/backref.pl create mode 100755 share/dct2fr create mode 100644 share/dictionary create mode 100644 share/dictionary.3com create mode 100644 share/dictionary.3gpp create mode 100644 share/dictionary.3gpp2 create mode 100644 share/dictionary.acc create mode 100644 share/dictionary.acme create mode 100644 share/dictionary.actelis create mode 100644 share/dictionary.adtran create mode 100644 share/dictionary.adva create mode 100644 share/dictionary.aerohive create mode 100644 share/dictionary.airespace create mode 100644 share/dictionary.alcatel create mode 100644 share/dictionary.alcatel-lucent.aaa create mode 100644 share/dictionary.alcatel.esam create mode 100644 share/dictionary.alcatel.sr create mode 100644 share/dictionary.alteon create mode 100644 share/dictionary.altiga create mode 100644 share/dictionary.alvarion create mode 100644 share/dictionary.alvarion.wimax.v2_2 create mode 100644 share/dictionary.apc create mode 100644 share/dictionary.aptilo create mode 100644 share/dictionary.aptis create mode 100644 share/dictionary.arbor create mode 100644 share/dictionary.arista create mode 100644 share/dictionary.aruba create mode 100644 share/dictionary.ascend create mode 100644 share/dictionary.ascend.illegal create mode 100644 share/dictionary.asn create mode 100644 share/dictionary.audiocodes create mode 100644 share/dictionary.avaya create mode 100644 share/dictionary.azaire create mode 100644 share/dictionary.bay create mode 100644 share/dictionary.bigswitch create mode 100644 share/dictionary.bintec create mode 100644 share/dictionary.bluecoat create mode 100644 share/dictionary.boingo create mode 100644 share/dictionary.bristol create mode 100644 share/dictionary.broadsoft create mode 100644 share/dictionary.brocade create mode 100644 share/dictionary.bskyb create mode 100644 share/dictionary.bt create mode 100644 share/dictionary.cablelabs create mode 100644 share/dictionary.cabletron create mode 100644 share/dictionary.calix create mode 100644 share/dictionary.cambium create mode 100644 share/dictionary.camiant create mode 100644 share/dictionary.centec create mode 100644 share/dictionary.checkpoint create mode 100644 share/dictionary.chillispot create mode 100644 share/dictionary.ciena create mode 100644 share/dictionary.cisco create mode 100644 share/dictionary.cisco.asa create mode 100644 share/dictionary.cisco.bbsm create mode 100644 share/dictionary.cisco.vpn3000 create mode 100644 share/dictionary.cisco.vpn5000 create mode 100644 share/dictionary.citrix create mode 100644 share/dictionary.clavister create mode 100644 share/dictionary.cnergee create mode 100644 share/dictionary.colubris create mode 100644 share/dictionary.columbia_university create mode 100644 share/dictionary.compat create mode 100644 share/dictionary.compatible create mode 100644 share/dictionary.cosine create mode 100644 share/dictionary.covaro create mode 100644 share/dictionary.dante create mode 100644 share/dictionary.dellemc create mode 100644 share/dictionary.dhcp create mode 100644 share/dictionary.digium create mode 100644 share/dictionary.dlink create mode 100644 share/dictionary.dragonwave create mode 100644 share/dictionary.efficientip create mode 100644 share/dictionary.eleven create mode 100644 share/dictionary.eltex create mode 100644 share/dictionary.epygi create mode 100644 share/dictionary.equallogic create mode 100644 share/dictionary.ericsson create mode 100644 share/dictionary.ericsson.ab create mode 100644 share/dictionary.ericsson.packet.core.networks create mode 100644 share/dictionary.erx create mode 100644 share/dictionary.extreme create mode 100644 share/dictionary.f5 create mode 100644 share/dictionary.fdxtended create mode 100644 share/dictionary.force10 create mode 100644 share/dictionary.fortinet create mode 100644 share/dictionary.foundry create mode 100644 share/dictionary.freedhcp create mode 100644 share/dictionary.freeradius create mode 100644 share/dictionary.freeradius.evs5 create mode 100644 share/dictionary.freeradius.internal create mode 100644 share/dictionary.freeswitch create mode 100644 share/dictionary.gandalf create mode 100644 share/dictionary.garderos create mode 100644 share/dictionary.gemtek create mode 100644 share/dictionary.h3c create mode 100644 share/dictionary.hillstone create mode 100644 share/dictionary.hp create mode 100644 share/dictionary.huawei create mode 100644 share/dictionary.iana create mode 100644 share/dictionary.iea create mode 100644 share/dictionary.infinera create mode 100644 share/dictionary.infoblox create mode 100644 share/dictionary.infonet create mode 100644 share/dictionary.ipunplugged create mode 100644 share/dictionary.issanni create mode 100644 share/dictionary.itk create mode 100644 share/dictionary.juniper create mode 100644 share/dictionary.karlnet create mode 100644 share/dictionary.kineto create mode 100644 share/dictionary.lancom create mode 100644 share/dictionary.lantronix create mode 100644 share/dictionary.livingston create mode 100644 share/dictionary.localweb create mode 100644 share/dictionary.lucent create mode 100644 share/dictionary.manzara create mode 100644 share/dictionary.meinberg create mode 100644 share/dictionary.mellanox create mode 100644 share/dictionary.meraki create mode 100644 share/dictionary.merit create mode 100644 share/dictionary.meru create mode 100644 share/dictionary.microsemi create mode 100644 share/dictionary.microsoft create mode 100644 share/dictionary.mikrotik create mode 100644 share/dictionary.mimosa create mode 100644 share/dictionary.motorola create mode 100644 share/dictionary.motorola.illegal create mode 100644 share/dictionary.motorola.wimax create mode 100644 share/dictionary.navini create mode 100644 share/dictionary.net create mode 100644 share/dictionary.netelastic create mode 100644 share/dictionary.netscreen create mode 100644 share/dictionary.networkphysics create mode 100644 share/dictionary.nexans create mode 100644 share/dictionary.nile create mode 100644 share/dictionary.nokia create mode 100644 share/dictionary.nokia.conflict create mode 100644 share/dictionary.nomadix create mode 100644 share/dictionary.nortel create mode 100644 share/dictionary.ntua create mode 100644 share/dictionary.openser create mode 100644 share/dictionary.packeteer create mode 100644 share/dictionary.paloalto create mode 100644 share/dictionary.patton create mode 100644 share/dictionary.perle create mode 100644 share/dictionary.pfsense create mode 100644 share/dictionary.pica8 create mode 100644 share/dictionary.propel create mode 100644 share/dictionary.prosoft create mode 100644 share/dictionary.proxim create mode 100644 share/dictionary.purewave create mode 100644 share/dictionary.quiconnect create mode 100644 share/dictionary.quintum create mode 100644 share/dictionary.rcntec create mode 100644 share/dictionary.redcreek create mode 100644 share/dictionary.rfc2865 create mode 100644 share/dictionary.rfc2866 create mode 100644 share/dictionary.rfc2867 create mode 100644 share/dictionary.rfc2868 create mode 100644 share/dictionary.rfc2869 create mode 100644 share/dictionary.rfc3162 create mode 100644 share/dictionary.rfc3576 create mode 100644 share/dictionary.rfc3580 create mode 100644 share/dictionary.rfc4072 create mode 100644 share/dictionary.rfc4372 create mode 100644 share/dictionary.rfc4603 create mode 100644 share/dictionary.rfc4675 create mode 100644 share/dictionary.rfc4679 create mode 100644 share/dictionary.rfc4818 create mode 100644 share/dictionary.rfc4849 create mode 100644 share/dictionary.rfc5090 create mode 100644 share/dictionary.rfc5176 create mode 100644 share/dictionary.rfc5447 create mode 100644 share/dictionary.rfc5580 create mode 100644 share/dictionary.rfc5607 create mode 100644 share/dictionary.rfc5904 create mode 100644 share/dictionary.rfc6519 create mode 100644 share/dictionary.rfc6572 create mode 100644 share/dictionary.rfc6677 create mode 100644 share/dictionary.rfc6911 create mode 100644 share/dictionary.rfc6929 create mode 100644 share/dictionary.rfc6930 create mode 100644 share/dictionary.rfc7055 create mode 100644 share/dictionary.rfc7155 create mode 100644 share/dictionary.rfc7268 create mode 100644 share/dictionary.rfc7499 create mode 100644 share/dictionary.rfc7930 create mode 100644 share/dictionary.rfc8045 create mode 100644 share/dictionary.rfc8559 create mode 100644 share/dictionary.riverbed create mode 100644 share/dictionary.riverstone create mode 100644 share/dictionary.roaringpenguin create mode 100644 share/dictionary.ruckus create mode 100644 share/dictionary.ruggedcom create mode 100644 share/dictionary.sangoma create mode 100644 share/dictionary.sg create mode 100644 share/dictionary.shasta create mode 100644 share/dictionary.shiva create mode 100644 share/dictionary.siemens create mode 100644 share/dictionary.slipstream create mode 100644 share/dictionary.sofaware create mode 100644 share/dictionary.softbank create mode 100644 share/dictionary.sonicwall create mode 100644 share/dictionary.springtide create mode 100644 share/dictionary.starent create mode 100644 share/dictionary.starent.vsa1 create mode 100644 share/dictionary.surfnet create mode 100644 share/dictionary.symbol create mode 100644 share/dictionary.t_systems_nova create mode 100644 share/dictionary.telebit create mode 100644 share/dictionary.telkom create mode 100644 share/dictionary.telrad create mode 100644 share/dictionary.terena create mode 100644 share/dictionary.trapeze create mode 100644 share/dictionary.travelping create mode 100644 share/dictionary.tripplite create mode 100644 share/dictionary.tropos create mode 100644 share/dictionary.ukerna create mode 100644 share/dictionary.unix create mode 100644 share/dictionary.usr create mode 100644 share/dictionary.usr.illegal create mode 100644 share/dictionary.utstarcom create mode 100644 share/dictionary.valemount create mode 100644 share/dictionary.vasexperts create mode 100644 share/dictionary.verizon create mode 100644 share/dictionary.versanet create mode 100644 share/dictionary.vqp create mode 100644 share/dictionary.walabi create mode 100644 share/dictionary.waverider create mode 100644 share/dictionary.wichorus create mode 100644 share/dictionary.wifialliance create mode 100644 share/dictionary.wimax create mode 100644 share/dictionary.wimax.alvarion create mode 100644 share/dictionary.wimax.wichorus create mode 100644 share/dictionary.wispr create mode 100644 share/dictionary.xedia create mode 100644 share/dictionary.xylan create mode 100644 share/dictionary.yubico create mode 100644 share/dictionary.zeus create mode 100644 share/dictionary.zte create mode 100644 share/dictionary.zyxel create mode 100755 share/format.pl create mode 100644 site.yml create mode 100644 src/.gitignore create mode 100644 src/LICENSE.openssl create mode 100644 src/all.mk create mode 100644 src/include/.gitignore create mode 100644 src/include/all.mk create mode 100644 src/include/atomic_queue.h create mode 100644 src/include/autoconf.h.in create mode 100644 src/include/automask.h create mode 100644 src/include/base64.h create mode 100644 src/include/build-radpaths-h.in create mode 100644 src/include/build.h create mode 100644 src/include/channel.h create mode 100644 src/include/clients.h create mode 100644 src/include/conf.h create mode 100644 src/include/conffile.h create mode 100644 src/include/connection.h create mode 100644 src/include/detail.h create mode 100644 src/include/dhcp.h create mode 100644 src/include/event.h create mode 100644 src/include/exfile.h create mode 100644 src/include/features-h create mode 100644 src/include/hash.h create mode 100644 src/include/heap.h create mode 100644 src/include/libradius.h create mode 100644 src/include/listen.h create mode 100644 src/include/log.h create mode 100644 src/include/map.h create mode 100644 src/include/math.h create mode 100644 src/include/md4.h create mode 100644 src/include/md5.h create mode 100644 src/include/missing-h create mode 100644 src/include/modcall.h create mode 100644 src/include/modpriv.h create mode 100644 src/include/modules.h create mode 100644 src/include/net.h create mode 100644 src/include/openssl3.h create mode 100644 src/include/packet.h create mode 100644 src/include/parser.h create mode 100644 src/include/pcap.h create mode 100644 src/include/process.h create mode 100644 src/include/protocol.h create mode 100644 src/include/rad_assert.h create mode 100644 src/include/radclient.h create mode 100644 src/include/radius.h create mode 100644 src/include/radiusd.h create mode 100644 src/include/radsniff.h create mode 100644 src/include/radutmp.h create mode 100644 src/include/realms.h create mode 100644 src/include/regex.h create mode 100644 src/include/sha1.h create mode 100644 src/include/socket.h create mode 100644 src/include/soh.h create mode 100644 src/include/state.h create mode 100644 src/include/stats.h create mode 100644 src/include/stdatomic.h create mode 100644 src/include/sysutmp.h create mode 100644 src/include/talloc.h create mode 100644 src/include/tcp.h create mode 100644 src/include/threads.h create mode 100644 src/include/tls-h create mode 100644 src/include/tmpl.h create mode 100644 src/include/token.h create mode 100644 src/include/udpfromto.h create mode 100644 src/include/xlat.h create mode 100644 src/lib/LICENSE create mode 100644 src/lib/README create mode 100644 src/lib/all.mk create mode 100644 src/lib/atomic_queue.c create mode 100644 src/lib/base64.c create mode 100644 src/lib/cbuff.c create mode 100644 src/lib/cursor.c create mode 100644 src/lib/debug.c create mode 100644 src/lib/dict.c create mode 100644 src/lib/event.c create mode 100644 src/lib/fifo.c create mode 100644 src/lib/filters.c create mode 100644 src/lib/getaddrinfo.c create mode 100644 src/lib/hash.c create mode 100644 src/lib/heap.c create mode 100644 src/lib/hmacmd5.c create mode 100644 src/lib/hmacsha1.c create mode 100644 src/lib/isaac.c create mode 100644 src/lib/log.c create mode 100644 src/lib/md4.c create mode 100644 src/lib/md5.c create mode 100644 src/lib/misc.c create mode 100644 src/lib/missing.c create mode 100644 src/lib/net.c create mode 100644 src/lib/packet.c create mode 100644 src/lib/pair.c create mode 100644 src/lib/pcap.c create mode 100644 src/lib/print.c create mode 100644 src/lib/radius.c create mode 100644 src/lib/rbtree.c create mode 100644 src/lib/regex.c create mode 100644 src/lib/sha1.c create mode 100644 src/lib/snprintf.c create mode 100644 src/lib/snprintf.h create mode 100644 src/lib/socket.c create mode 100644 src/lib/strlcat.c create mode 100644 src/lib/strlcpy.c create mode 100644 src/lib/talloc.c create mode 100644 src/lib/tcp.c create mode 100644 src/lib/token.c create mode 100644 src/lib/udpfromto.c create mode 100644 src/lib/value.c create mode 100644 src/lib/version.c create mode 100644 src/main/.gitignore create mode 100644 src/main/acct.c create mode 100644 src/main/all.mk create mode 100644 src/main/auth.c create mode 100644 src/main/cb.c create mode 100644 src/main/channel.c create mode 100644 src/main/checkrad.in create mode 100644 src/main/checkrad.mk create mode 100644 src/main/client.c create mode 100644 src/main/collectd.c create mode 100644 src/main/command.c create mode 100644 src/main/conffile.c create mode 100644 src/main/connection.c create mode 100644 src/main/crypt.c create mode 100644 src/main/detail.c create mode 100644 src/main/evaluate.c create mode 100644 src/main/exec.c create mode 100644 src/main/exfile.c create mode 100644 src/main/files.c create mode 100644 src/main/libfreeradius-server.mk create mode 100644 src/main/listen.c create mode 100644 src/main/log.c create mode 100644 src/main/mainconfig.c create mode 100644 src/main/map.c create mode 100644 src/main/modcall.c create mode 100644 src/main/modules.c create mode 100644 src/main/pair.c create mode 100644 src/main/parser.c create mode 100644 src/main/process.c create mode 100644 src/main/radattr.c create mode 100644 src/main/radattr.mk create mode 100644 src/main/radclient.c create mode 100644 src/main/radclient.mk create mode 100644 src/main/radiusd.c create mode 100644 src/main/radiusd.mk create mode 100755 src/main/radlast.in create mode 100644 src/main/radlast.mk create mode 100644 src/main/radmin.c create mode 100644 src/main/radmin.mk create mode 100644 src/main/radsniff.c create mode 100644 src/main/radsniff.mk.in create mode 100644 src/main/radtest.in create mode 100644 src/main/radtest.mk create mode 100644 src/main/radwho.c create mode 100644 src/main/radwho.mk create mode 100755 src/main/radzap create mode 100644 src/main/radzap.mk create mode 100644 src/main/realms.c create mode 100644 src/main/regex.c create mode 100644 src/main/session.c create mode 100644 src/main/soh.c create mode 100644 src/main/state.c create mode 100644 src/main/stats.c create mode 100644 src/main/threads.c create mode 100644 src/main/tls.c create mode 100644 src/main/tls_listen.c create mode 100644 src/main/tmpl.c create mode 100644 src/main/unittest.c create mode 100644 src/main/unittest.mk create mode 100644 src/main/util.c create mode 100644 src/main/version.c create mode 100644 src/main/xlat.c create mode 100755 src/mkinstalldirs create mode 100644 src/modules/.gitignore create mode 100644 src/modules/all.mk create mode 100644 src/modules/proto_dhcp/README.md create mode 100644 src/modules/proto_dhcp/all.mk create mode 100644 src/modules/proto_dhcp/dhcp.c create mode 100644 src/modules/proto_dhcp/dhcpclient.c create mode 100644 src/modules/proto_dhcp/dhcpclient.mk create mode 100644 src/modules/proto_dhcp/dhcpd.c create mode 100644 src/modules/proto_dhcp/libfreeradius-dhcp.mk create mode 100644 src/modules/proto_dhcp/proto_dhcp.mk create mode 100644 src/modules/proto_dhcp/rlm_dhcp.c create mode 100644 src/modules/proto_dhcp/rlm_dhcp.mk create mode 100644 src/modules/proto_vmps/README.md create mode 100644 src/modules/proto_vmps/all.mk create mode 100644 src/modules/proto_vmps/vmps.c create mode 100644 src/modules/proto_vmps/vqp.c create mode 100644 src/modules/proto_vmps/vqp.h create mode 100755 src/modules/proto_vmps/vqpcli.pl create mode 100644 src/modules/rlm_always/README.md create mode 100644 src/modules/rlm_always/all.mk create mode 100644 src/modules/rlm_always/rlm_always.c create mode 100644 src/modules/rlm_attr_filter/README.md create mode 100644 src/modules/rlm_attr_filter/all.mk create mode 100644 src/modules/rlm_attr_filter/rlm_attr_filter.c create mode 100644 src/modules/rlm_cache/.gitignore create mode 100644 src/modules/rlm_cache/README.md create mode 100644 src/modules/rlm_cache/all.mk.in create mode 100755 src/modules/rlm_cache/configure create mode 100644 src/modules/rlm_cache/configure.ac create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_memcached/.gitignore create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_memcached/all.mk.in create mode 100755 src/modules/rlm_cache/drivers/rlm_cache_memcached/configure create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_memcached/configure.ac create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_memcached/rlm_cache_memcached.c create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_rbtree/all.mk create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_rbtree/rlm_cache_rbtree.c create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_redis/.gitignore create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_redis/all.mk.in create mode 100755 src/modules/rlm_cache/drivers/rlm_cache_redis/configure create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_redis/configure.ac create mode 100644 src/modules/rlm_cache/drivers/rlm_cache_redis/rlm_cache_redis.c create mode 100644 src/modules/rlm_cache/rlm_cache.c create mode 100644 src/modules/rlm_cache/rlm_cache.h create mode 100644 src/modules/rlm_cache/rlm_cache.mk create mode 100644 src/modules/rlm_cache/serialize.c create mode 100644 src/modules/rlm_cache/serialize.h create mode 100644 src/modules/rlm_cache/stable create mode 100644 src/modules/rlm_chap/README.md create mode 100644 src/modules/rlm_chap/all.mk create mode 100644 src/modules/rlm_chap/rlm_chap.c create mode 100644 src/modules/rlm_couchbase/.gitignore create mode 100644 src/modules/rlm_couchbase/README.md create mode 100644 src/modules/rlm_couchbase/all.mk.in create mode 100644 src/modules/rlm_couchbase/config.h.in create mode 100755 src/modules/rlm_couchbase/configure create mode 100644 src/modules/rlm_couchbase/configure.ac create mode 100644 src/modules/rlm_couchbase/couchbase.c create mode 100644 src/modules/rlm_couchbase/couchbase.h create mode 100644 src/modules/rlm_couchbase/jsonc_missing.c create mode 100644 src/modules/rlm_couchbase/jsonc_missing.h create mode 100644 src/modules/rlm_couchbase/mod.c create mode 100644 src/modules/rlm_couchbase/mod.h create mode 100644 src/modules/rlm_couchbase/rlm_couchbase.c create mode 100644 src/modules/rlm_counter/.gitignore create mode 100644 src/modules/rlm_counter/README.md create mode 100644 src/modules/rlm_counter/all.mk.in create mode 100644 src/modules/rlm_counter/config.h.in create mode 100755 src/modules/rlm_counter/configure create mode 100644 src/modules/rlm_counter/configure.ac create mode 100755 src/modules/rlm_counter/rad_counter create mode 100644 src/modules/rlm_counter/rlm_counter.c create mode 100644 src/modules/rlm_date/README.md create mode 100644 src/modules/rlm_date/all.mk create mode 100644 src/modules/rlm_date/rlm_date.c create mode 100644 src/modules/rlm_detail/README.md create mode 100644 src/modules/rlm_detail/all.mk create mode 100644 src/modules/rlm_detail/rlm_detail.c create mode 100644 src/modules/rlm_digest/README.md create mode 100644 src/modules/rlm_digest/all.mk create mode 100644 src/modules/rlm_digest/rlm_digest.c create mode 100644 src/modules/rlm_dynamic_clients/README.md create mode 100644 src/modules/rlm_dynamic_clients/all.mk create mode 100644 src/modules/rlm_dynamic_clients/rlm_dynamic_clients.c create mode 100644 src/modules/rlm_eap/.gitignore create mode 100644 src/modules/rlm_eap/README.md create mode 100644 src/modules/rlm_eap/all.mk create mode 100755 src/modules/rlm_eap/configure create mode 100644 src/modules/rlm_eap/configure.ac create mode 100644 src/modules/rlm_eap/eap.c create mode 100644 src/modules/rlm_eap/eap.h create mode 100644 src/modules/rlm_eap/libeap/all.mk create mode 100644 src/modules/rlm_eap/libeap/comp128.c create mode 100644 src/modules/rlm_eap/libeap/comp128.h create mode 100644 src/modules/rlm_eap/libeap/eap_chbind.c create mode 100644 src/modules/rlm_eap/libeap/eap_chbind.h create mode 100644 src/modules/rlm_eap/libeap/eap_sim.h create mode 100644 src/modules/rlm_eap/libeap/eap_tls.c create mode 100644 src/modules/rlm_eap/libeap/eap_tls.h create mode 100644 src/modules/rlm_eap/libeap/eap_types.h create mode 100644 src/modules/rlm_eap/libeap/eapclient.h create mode 100644 src/modules/rlm_eap/libeap/eapcommon.c create mode 100644 src/modules/rlm_eap/libeap/eapcrypto.c create mode 100644 src/modules/rlm_eap/libeap/eapsimlib.c create mode 100644 src/modules/rlm_eap/libeap/fips186prf.c create mode 100644 src/modules/rlm_eap/libeap/mppe_keys.c create mode 100644 src/modules/rlm_eap/mem.c create mode 100644 src/modules/rlm_eap/radeapclient.c create mode 100644 src/modules/rlm_eap/radeapclient.mk create mode 100644 src/modules/rlm_eap/rlm_eap.c create mode 100644 src/modules/rlm_eap/rlm_eap.h create mode 100644 src/modules/rlm_eap/rlm_eap.mk create mode 100644 src/modules/rlm_eap/types/all.mk create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/.gitignore create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/all.mk.in create mode 100755 src/modules/rlm_eap/types/rlm_eap_fast/configure create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/configure.ac create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/eap_fast_crypto.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/eap_fast_crypto.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_fast/rlm_eap_fast.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_gtc/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_gtc/all.mk create mode 100644 src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/.gitignore create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/all.mk.in create mode 100755 src/modules/rlm_eap/types/rlm_eap_ikev2/configure create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/configure.ac create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/logging_impl.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/logging_impl.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_ikev2/rlm_eap_ikev2.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_md5/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_md5/all.mk create mode 100644 src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_md5/rlm_eap_md5.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_mschapv2/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_mschapv2/all.mk create mode 100644 src/modules/rlm_eap/types/rlm_eap_mschapv2/eap_mschapv2.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_peap/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_peap/all.mk create mode 100644 src/modules/rlm_eap/types/rlm_eap_peap/eap_peap.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_peap/peap.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_peap/rlm_eap_peap.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/.gitignore create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/all.mk.in create mode 100755 src/modules/rlm_eap/types/rlm_eap_pwd/configure create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/configure.ac create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/const_time.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_sim/.gitignore create mode 100644 src/modules/rlm_eap/types/rlm_eap_sim/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_sim/all.mk.in create mode 100755 src/modules/rlm_eap/types/rlm_eap_sim/configure create mode 100644 src/modules/rlm_eap/types/rlm_eap_sim/configure.ac create mode 100644 src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_tls/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_tls/all.mk create mode 100644 src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_tnc/.gitignore create mode 100644 src/modules/rlm_eap/types/rlm_eap_tnc/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_tnc/all.mk.in create mode 100755 src/modules/rlm_eap/types/rlm_eap_tnc/configure create mode 100644 src/modules/rlm_eap/types/rlm_eap_tnc/configure.ac create mode 100644 src/modules/rlm_eap/types/rlm_eap_tnc/rlm_eap_tnc.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_ttls/README.md create mode 100644 src/modules/rlm_eap/types/rlm_eap_ttls/all.mk create mode 100644 src/modules/rlm_eap/types/rlm_eap_ttls/eap_ttls.h create mode 100644 src/modules/rlm_eap/types/rlm_eap_ttls/rlm_eap_ttls.c create mode 100644 src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c create mode 100644 src/modules/rlm_example/.gitignore create mode 100644 src/modules/rlm_example/Makefile.clean create mode 100644 src/modules/rlm_example/README.md create mode 100644 src/modules/rlm_example/all.mk.in create mode 100644 src/modules/rlm_example/config.h.in create mode 100755 src/modules/rlm_example/configure create mode 100644 src/modules/rlm_example/configure.ac create mode 100644 src/modules/rlm_example/rlm_example.c create mode 100644 src/modules/rlm_exec/README.md create mode 100644 src/modules/rlm_exec/all.mk create mode 100644 src/modules/rlm_exec/rlm_exec.c create mode 100644 src/modules/rlm_expiration/README.md create mode 100644 src/modules/rlm_expiration/all.mk create mode 100644 src/modules/rlm_expiration/rlm_expiration.c create mode 100644 src/modules/rlm_expr/README.md create mode 100644 src/modules/rlm_expr/all.mk create mode 100644 src/modules/rlm_expr/paircmp.c create mode 100644 src/modules/rlm_expr/rlm_expr.c create mode 100644 src/modules/rlm_expr/rlm_expr.h create mode 100644 src/modules/rlm_files/README.md create mode 100644 src/modules/rlm_files/all.mk create mode 100644 src/modules/rlm_files/rlm_files.c create mode 100644 src/modules/rlm_idn/.gitignore create mode 100644 src/modules/rlm_idn/README.md create mode 100644 src/modules/rlm_idn/all.mk.in create mode 100755 src/modules/rlm_idn/configure create mode 100644 src/modules/rlm_idn/configure.ac create mode 100644 src/modules/rlm_idn/rlm_idn.c create mode 100644 src/modules/rlm_ippool/.gitignore create mode 100644 src/modules/rlm_ippool/README.md create mode 100644 src/modules/rlm_ippool/all.mk.in create mode 100644 src/modules/rlm_ippool/config.h.in create mode 100755 src/modules/rlm_ippool/configure create mode 100644 src/modules/rlm_ippool/configure.ac create mode 100644 src/modules/rlm_ippool/rlm_ippool.c create mode 100644 src/modules/rlm_ippool/rlm_ippool.mk create mode 100644 src/modules/rlm_ippool/rlm_ippool_tool.8 create mode 100644 src/modules/rlm_ippool/rlm_ippool_tool.c create mode 100644 src/modules/rlm_ippool/rlm_ippool_tool.mk create mode 100644 src/modules/rlm_json/.gitignore create mode 100644 src/modules/rlm_json/README.md create mode 100644 src/modules/rlm_json/all.mk.in create mode 100644 src/modules/rlm_json/config.h.in create mode 100755 src/modules/rlm_json/configure create mode 100644 src/modules/rlm_json/configure.ac create mode 100644 src/modules/rlm_json/json.c create mode 100644 src/modules/rlm_json/json.h create mode 100644 src/modules/rlm_json/rlm_json.c create mode 100644 src/modules/rlm_krb5/.gitignore create mode 100644 src/modules/rlm_krb5/README.md create mode 100644 src/modules/rlm_krb5/all.mk.in create mode 100755 src/modules/rlm_krb5/configure create mode 100644 src/modules/rlm_krb5/configure.ac create mode 100644 src/modules/rlm_krb5/krb5.c create mode 100644 src/modules/rlm_krb5/krb5.h create mode 100644 src/modules/rlm_krb5/rlm_krb5.c create mode 100644 src/modules/rlm_ldap/.gitignore create mode 100644 src/modules/rlm_ldap/README.md create mode 100644 src/modules/rlm_ldap/all.mk.in create mode 100644 src/modules/rlm_ldap/attrmap.c create mode 100644 src/modules/rlm_ldap/clients.c create mode 100644 src/modules/rlm_ldap/config.h.in create mode 100755 src/modules/rlm_ldap/configure create mode 100644 src/modules/rlm_ldap/configure.ac create mode 100644 src/modules/rlm_ldap/edir.c create mode 100644 src/modules/rlm_ldap/groups.c create mode 100644 src/modules/rlm_ldap/ldap.c create mode 100644 src/modules/rlm_ldap/ldap.h create mode 100644 src/modules/rlm_ldap/rlm_ldap.c create mode 100644 src/modules/rlm_ldap/sasl.c create mode 100644 src/modules/rlm_linelog/README.md create mode 100644 src/modules/rlm_linelog/all.mk create mode 100644 src/modules/rlm_linelog/rlm_linelog.c create mode 100644 src/modules/rlm_logintime/README.md create mode 100644 src/modules/rlm_logintime/all.mk create mode 100644 src/modules/rlm_logintime/rlm_logintime.c create mode 100644 src/modules/rlm_logintime/timestr.c create mode 100644 src/modules/rlm_mschap/.gitignore create mode 100644 src/modules/rlm_mschap/README.md create mode 100644 src/modules/rlm_mschap/all.mk create mode 100644 src/modules/rlm_mschap/auth_wbclient.c create mode 100644 src/modules/rlm_mschap/auth_wbclient.h create mode 100644 src/modules/rlm_mschap/config.h.in create mode 100755 src/modules/rlm_mschap/configure create mode 100644 src/modules/rlm_mschap/configure.ac create mode 100644 src/modules/rlm_mschap/mschap.c create mode 100644 src/modules/rlm_mschap/mschap.h create mode 100644 src/modules/rlm_mschap/opendir.c create mode 100644 src/modules/rlm_mschap/rlm_mschap.c create mode 100644 src/modules/rlm_mschap/rlm_mschap.h create mode 100644 src/modules/rlm_mschap/rlm_mschap.mk.in create mode 100644 src/modules/rlm_mschap/smbdes.c create mode 100644 src/modules/rlm_mschap/smbdes.h create mode 100644 src/modules/rlm_mschap/smbencrypt.c create mode 100644 src/modules/rlm_mschap/smbencrypt.mk create mode 100644 src/modules/rlm_opendirectory/.gitignore create mode 100644 src/modules/rlm_opendirectory/README.md create mode 100644 src/modules/rlm_opendirectory/all.mk.in create mode 100755 src/modules/rlm_opendirectory/configure create mode 100644 src/modules/rlm_opendirectory/configure.ac create mode 100644 src/modules/rlm_opendirectory/rlm_opendirectory.c create mode 100644 src/modules/rlm_pam/.gitignore create mode 100644 src/modules/rlm_pam/README.md create mode 100644 src/modules/rlm_pam/all.mk.in create mode 100644 src/modules/rlm_pam/config.h.in create mode 100755 src/modules/rlm_pam/configure create mode 100644 src/modules/rlm_pam/configure.ac create mode 100644 src/modules/rlm_pam/rlm_pam.c create mode 100644 src/modules/rlm_pap/README.md create mode 100644 src/modules/rlm_pap/all.mk create mode 100644 src/modules/rlm_pap/rlm_pap.c create mode 100644 src/modules/rlm_passwd/README.md create mode 100644 src/modules/rlm_passwd/all.mk create mode 100644 src/modules/rlm_passwd/rlm_passwd.c create mode 100644 src/modules/rlm_perl/.gitignore create mode 100644 src/modules/rlm_perl/README.md create mode 100644 src/modules/rlm_perl/all.mk.in create mode 100644 src/modules/rlm_perl/config.h.in create mode 100755 src/modules/rlm_perl/configure create mode 100644 src/modules/rlm_perl/configure.ac create mode 100644 src/modules/rlm_perl/rlm_perl.c create mode 100644 src/modules/rlm_preprocess/README.md create mode 100644 src/modules/rlm_preprocess/all.mk create mode 100644 src/modules/rlm_preprocess/rlm_preprocess.c create mode 100644 src/modules/rlm_python/.gitignore create mode 100644 src/modules/rlm_python/README.md create mode 100644 src/modules/rlm_python/all.mk.in create mode 100644 src/modules/rlm_python/config.h.in create mode 100755 src/modules/rlm_python/configure create mode 100644 src/modules/rlm_python/configure.ac create mode 100644 src/modules/rlm_python/example.py create mode 100644 src/modules/rlm_python/prepaid.py create mode 100644 src/modules/rlm_python/prepaid.sql create mode 100644 src/modules/rlm_python/radiusd.py create mode 100644 src/modules/rlm_python/radiusd_test.py create mode 100644 src/modules/rlm_python/rlm_python.c create mode 100644 src/modules/rlm_python3/.gitignore create mode 100644 src/modules/rlm_python3/README.md create mode 100644 src/modules/rlm_python3/all.mk.in create mode 100644 src/modules/rlm_python3/config.h.in create mode 100755 src/modules/rlm_python3/configure create mode 100644 src/modules/rlm_python3/configure.ac create mode 100644 src/modules/rlm_python3/example.py create mode 100644 src/modules/rlm_python3/prepaid.py create mode 100644 src/modules/rlm_python3/prepaid.sql create mode 100644 src/modules/rlm_python3/radiusd.py create mode 100644 src/modules/rlm_python3/rlm_python3.c create mode 100644 src/modules/rlm_python3/rlm_python3.h create mode 100644 src/modules/rlm_radutmp/.gitignore create mode 100644 src/modules/rlm_radutmp/README.md create mode 100644 src/modules/rlm_radutmp/all.mk.in create mode 100644 src/modules/rlm_radutmp/config.h.in create mode 100755 src/modules/rlm_radutmp/configure create mode 100644 src/modules/rlm_radutmp/configure.ac create mode 100644 src/modules/rlm_radutmp/rlm_radutmp.c create mode 100644 src/modules/rlm_realm/.gitignore create mode 100644 src/modules/rlm_realm/README.md create mode 100644 src/modules/rlm_realm/all.mk.in create mode 100755 src/modules/rlm_realm/configure create mode 100644 src/modules/rlm_realm/configure.ac create mode 100644 src/modules/rlm_realm/rlm_realm.c create mode 100644 src/modules/rlm_realm/trustrouter.c create mode 100644 src/modules/rlm_realm/trustrouter.h create mode 100644 src/modules/rlm_redis/.gitignore create mode 100644 src/modules/rlm_redis/README.md create mode 100644 src/modules/rlm_redis/all.mk.in create mode 100755 src/modules/rlm_redis/configure create mode 100644 src/modules/rlm_redis/configure.ac create mode 100644 src/modules/rlm_redis/rlm_redis.c create mode 100644 src/modules/rlm_redis/rlm_redis.h create mode 100644 src/modules/rlm_rediswho/.gitignore create mode 100644 src/modules/rlm_rediswho/README.md create mode 100644 src/modules/rlm_rediswho/all.mk.in create mode 100755 src/modules/rlm_rediswho/configure create mode 100644 src/modules/rlm_rediswho/configure.ac create mode 100644 src/modules/rlm_rediswho/rlm_rediswho.c create mode 100644 src/modules/rlm_replicate/README.md create mode 100644 src/modules/rlm_replicate/all.mk create mode 100644 src/modules/rlm_replicate/rlm_replicate.c create mode 100644 src/modules/rlm_rest/.gitignore create mode 100644 src/modules/rlm_rest/README.md create mode 100644 src/modules/rlm_rest/all.mk.in create mode 100644 src/modules/rlm_rest/config.h.in create mode 100755 src/modules/rlm_rest/configure create mode 100644 src/modules/rlm_rest/configure.ac create mode 100755 src/modules/rlm_rest/demo.pl create mode 100644 src/modules/rlm_rest/rest.c create mode 100644 src/modules/rlm_rest/rest.h create mode 100644 src/modules/rlm_rest/rlm_rest.c create mode 100644 src/modules/rlm_ruby/.gitignore create mode 100644 src/modules/rlm_ruby/README.md create mode 100644 src/modules/rlm_ruby/all.mk.in create mode 100755 src/modules/rlm_ruby/configure create mode 100644 src/modules/rlm_ruby/configure.ac create mode 100644 src/modules/rlm_ruby/example.rb create mode 100644 src/modules/rlm_ruby/rlm_ruby.c create mode 100644 src/modules/rlm_securid/.gitignore create mode 100644 src/modules/rlm_securid/README create mode 100644 src/modules/rlm_securid/README.md create mode 100644 src/modules/rlm_securid/all.mk.in create mode 100755 src/modules/rlm_securid/configure create mode 100644 src/modules/rlm_securid/configure.ac create mode 100644 src/modules/rlm_securid/mem.c create mode 100644 src/modules/rlm_securid/rlm_securid.c create mode 100644 src/modules/rlm_securid/rlm_securid.h create mode 100644 src/modules/rlm_securid/securid create mode 100644 src/modules/rlm_smsotp/.gitignore create mode 100644 src/modules/rlm_smsotp/README.md create mode 100644 src/modules/rlm_smsotp/all.mk.in create mode 100644 src/modules/rlm_smsotp/config.h.in create mode 100755 src/modules/rlm_smsotp/configure create mode 100644 src/modules/rlm_smsotp/configure.ac create mode 100644 src/modules/rlm_smsotp/rlm_smsotp.c create mode 100644 src/modules/rlm_smsotp/smsotpd.pl create mode 100644 src/modules/rlm_soh/README.md create mode 100644 src/modules/rlm_soh/all.mk create mode 100644 src/modules/rlm_soh/rlm_soh.c create mode 100644 src/modules/rlm_sometimes/README.md create mode 100644 src/modules/rlm_sometimes/all.mk create mode 100644 src/modules/rlm_sometimes/rlm_sometimes.c create mode 100644 src/modules/rlm_sql/.gitignore create mode 100644 src/modules/rlm_sql/README.md create mode 100644 src/modules/rlm_sql/all.mk.in create mode 100755 src/modules/rlm_sql/configure create mode 100644 src/modules/rlm_sql/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_db2/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_db2/all.mk.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_db2/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_db2/rlm_sql_db2.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_firebird/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_firebird/all.mk.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_firebird/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_firebird/rlm_sql_firebird.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_firebird/sql_fbapi.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_firebird/sql_fbapi.h create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_freetds/.gitignore create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_freetds/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_freetds/all.mk.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_freetds/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_freetds/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_freetds/rlm_sql_freetds.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_iodbc/.gitignore create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_iodbc/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_iodbc/all.mk.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_iodbc/rlm_sql_iodbc.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mongo/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mongo/all.mk.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_mongo/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mongo/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mongo/rlm_sql_mongo.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mysql/.gitignore create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mysql/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mysql/all.mk.in create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mysql/config.h.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_mysql/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_null/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_null/all.mk create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_null/rlm_sql_null.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_oracle/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_oracle/all.mk.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_oracle/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_oracle/rlm_sql_oracle.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_postgresql/.gitignore create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_postgresql/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_postgresql/all.mk.in create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_postgresql/config.h.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_postgresql/rlm_sql_postgresql.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_postgresql/sql_postgresql.h create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_sqlite/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_sqlite/all.mk.in create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_sqlite/config.h.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_sqlite/rlm_sql_sqlite.c create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_unixodbc/.gitignore create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_unixodbc/README.md create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_unixodbc/all.mk.in create mode 100755 src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac create mode 100644 src/modules/rlm_sql/drivers/rlm_sql_unixodbc/rlm_sql_unixodbc.c create mode 100644 src/modules/rlm_sql/rlm_sql.c create mode 100644 src/modules/rlm_sql/rlm_sql.h create mode 100644 src/modules/rlm_sql/rlm_sql.mk create mode 100644 src/modules/rlm_sql/sql.c create mode 100644 src/modules/rlm_sql/stable create mode 100644 src/modules/rlm_sql_map/.gitignore create mode 100644 src/modules/rlm_sql_map/README.md create mode 100644 src/modules/rlm_sql_map/all.mk.in create mode 100755 src/modules/rlm_sql_map/configure create mode 100644 src/modules/rlm_sql_map/configure.ac create mode 100644 src/modules/rlm_sql_map/rlm_sql_map.c create mode 100644 src/modules/rlm_sqlcounter/.gitignore create mode 100644 src/modules/rlm_sqlcounter/README.md create mode 100644 src/modules/rlm_sqlcounter/all.mk.in create mode 100755 src/modules/rlm_sqlcounter/configure create mode 100644 src/modules/rlm_sqlcounter/configure.ac create mode 100644 src/modules/rlm_sqlcounter/rlm_sqlcounter.c create mode 100644 src/modules/rlm_sqlippool/.gitignore create mode 100644 src/modules/rlm_sqlippool/README.md create mode 100644 src/modules/rlm_sqlippool/all.mk.in create mode 100755 src/modules/rlm_sqlippool/configure create mode 100644 src/modules/rlm_sqlippool/configure.ac create mode 100644 src/modules/rlm_sqlippool/rlm_sqlippool.c create mode 100644 src/modules/rlm_test/README.md create mode 100644 src/modules/rlm_test/all.mk create mode 100644 src/modules/rlm_test/rlm_test.c create mode 100644 src/modules/rlm_totp/.gitignore create mode 100644 src/modules/rlm_totp/Makefile create mode 100644 src/modules/rlm_totp/README.md create mode 100644 src/modules/rlm_totp/all.mk create mode 100644 src/modules/rlm_totp/rlm_totp.c create mode 100644 src/modules/rlm_totp/sha1.txt create mode 100644 src/modules/rlm_unbound/.gitignore create mode 100644 src/modules/rlm_unbound/README.md create mode 100644 src/modules/rlm_unbound/all.mk.in create mode 100644 src/modules/rlm_unbound/config.h.in create mode 100755 src/modules/rlm_unbound/configure create mode 100644 src/modules/rlm_unbound/configure.ac create mode 100644 src/modules/rlm_unbound/rlm_unbound.c create mode 100644 src/modules/rlm_unix/.gitignore create mode 100644 src/modules/rlm_unix/README.md create mode 100644 src/modules/rlm_unix/all.mk.in create mode 100644 src/modules/rlm_unix/config.h.in create mode 100755 src/modules/rlm_unix/configure create mode 100644 src/modules/rlm_unix/configure.ac create mode 100644 src/modules/rlm_unix/rlm_unix.c create mode 100644 src/modules/rlm_unpack/README.md create mode 100644 src/modules/rlm_unpack/all.mk create mode 100644 src/modules/rlm_unpack/rlm_unpack.c create mode 100644 src/modules/rlm_utf8/README.md create mode 100644 src/modules/rlm_utf8/all.mk create mode 100644 src/modules/rlm_utf8/rlm_utf8.c create mode 100644 src/modules/rlm_wimax/README.md create mode 100644 src/modules/rlm_wimax/all.mk create mode 100644 src/modules/rlm_wimax/milenage.c create mode 100644 src/modules/rlm_wimax/milenage.h create mode 100644 src/modules/rlm_wimax/rlm_wimax.c create mode 100644 src/modules/rlm_yubikey/.gitignore create mode 100644 src/modules/rlm_yubikey/README.md create mode 100644 src/modules/rlm_yubikey/all.mk.in create mode 100644 src/modules/rlm_yubikey/config.h.in create mode 100755 src/modules/rlm_yubikey/configure create mode 100644 src/modules/rlm_yubikey/configure.ac create mode 100644 src/modules/rlm_yubikey/decrypt.c create mode 100644 src/modules/rlm_yubikey/rlm_yubikey.c create mode 100644 src/modules/rlm_yubikey/rlm_yubikey.h create mode 100644 src/modules/rlm_yubikey/validate.c create mode 100644 src/modules/stable create mode 100644 src/tests/.gitignore create mode 100644 src/tests/Makefile create mode 100644 src/tests/README create mode 100644 src/tests/all.mk create mode 100644 src/tests/auth/all.mk create mode 100644 src/tests/auth/chap create mode 100644 src/tests/auth/chap.attrs create mode 100644 src/tests/auth/chap_header create mode 100644 src/tests/auth/chap_header.attrs create mode 100644 src/tests/auth/digest create mode 100644 src/tests/auth/digest.attrs create mode 100644 src/tests/auth/md5_password create mode 100644 src/tests/auth/md5_password.attrs create mode 100644 src/tests/auth/password_with_header create mode 100644 src/tests/auth/password_with_header.attrs create mode 100644 src/tests/auth/password_without_header create mode 100644 src/tests/auth/password_without_header.attrs create mode 100644 src/tests/auth/radiusd.conf create mode 100644 src/tests/auth/user_password create mode 100644 src/tests/auth/user_password.attrs create mode 100644 src/tests/auth/wimax create mode 100644 src/tests/auth/wimax.attrs create mode 100644 src/tests/bob create mode 100644 src/tests/comp128-1vectors create mode 100644 src/tests/comp128-2vectors create mode 100644 src/tests/comp128-3vectors create mode 100644 src/tests/config/test.conf create mode 100644 src/tests/dictionary.test create mode 100644 src/tests/digest-01/digest-auth-MD5 create mode 100644 src/tests/digest-01/digest-auth-MD5_Sess create mode 100644 src/tests/digest-01/digest-auth-int create mode 100644 src/tests/digest-01/digest-auth-noalgo create mode 100644 src/tests/digest-01/digest-auth_int-MD5 create mode 100644 src/tests/digest-01/digest-auth_int-MD5_Sess create mode 100644 src/tests/digest-01/digest-auth_int-noalgo create mode 100644 src/tests/digest-01/digest-md5-sess create mode 100644 src/tests/eap-fast.conf create mode 100644 src/tests/eap-md5.conf create mode 100644 src/tests/eap-mschapv2.conf create mode 100644 src/tests/eap-pwd.conf create mode 100644 src/tests/eap-tls.conf create mode 100644 src/tests/eap-ttls-eap-mschapv2.conf create mode 100644 src/tests/eap-ttls-eap-tls.conf create mode 100644 src/tests/eap-ttls-mschapv2.conf create mode 100644 src/tests/eap-ttls-pap.conf create mode 100644 src/tests/eapcrypto-01/eapcrypto-out.txt create mode 100644 src/tests/eapmd5-01/client.gdb create mode 100644 src/tests/eapmd5-01/client.sh create mode 100644 src/tests/eapmd5-01/req.txt create mode 100644 src/tests/eapsim-02/check.gdb create mode 100644 src/tests/eapsim-02/client.sh create mode 100644 src/tests/eapsim-02/eapsim-in.txt create mode 100644 src/tests/eapsim-02/eapsim-out.txt create mode 100644 src/tests/eapsim-02/req.txt create mode 100644 src/tests/eapsim-03/check.gdb create mode 100644 src/tests/eapsim-03/client.sh create mode 100644 src/tests/eapsim-03/eapsim-cooked.txt create mode 100644 src/tests/eapsim-03/eapsim-in.txt create mode 100644 src/tests/eapsim-03/eapsim-out.txt create mode 100644 src/tests/eapsim-03/eapsim-sanitize.sed create mode 100644 src/tests/eapsim-03/radiusd-example.txt create mode 100644 src/tests/eapsim-03/users-example.txt create mode 100644 src/tests/eapsim-04/client.sh create mode 100644 src/tests/eapsim-04/eapsim-cooked.txt create mode 100644 src/tests/eapsim-04/eapsim-in.txt create mode 100644 src/tests/eapsim-04/myvectors.txt create mode 100644 src/tests/eapsim-04/users.txt create mode 100644 src/tests/eapsim-05/check.gdb create mode 100644 src/tests/eapsim-05/client.sh create mode 100644 src/tests/eapsim-05/description.txt create mode 100644 src/tests/eapsim-05/eapsim-cooked.txt create mode 100644 src/tests/eapsim-05/eapsim-in.txt create mode 100644 src/tests/eapsim-05/eapsim-out.txt create mode 100644 src/tests/eapsim-05/eapsim-raw.txt create mode 100644 src/tests/eapsim-05/eapsim-sanitize.sed create mode 100644 src/tests/eapsim-06/check.gdb create mode 100644 src/tests/eapsim-06/client.sh create mode 100644 src/tests/eapsim-06/description.txt create mode 100644 src/tests/eapsim-06/eapsim-cooked.txt create mode 100644 src/tests/eapsim-06/eapsim-in.txt create mode 100644 src/tests/eapsim-06/eapsim-out.txt create mode 100644 src/tests/eapsim-06/eapsim-raw.txt create mode 100644 src/tests/eapsim-06/simtriplets.dat create mode 100644 src/tests/example.com create mode 100644 src/tests/fips186-02/description.txt create mode 100644 src/tests/fips186-02/fips186-2.txt create mode 100644 src/tests/hmac-md5-01/digest1.txt create mode 100644 src/tests/hmac-sha1-01/digest1.txt create mode 100644 src/tests/keywords/3gpp create mode 100644 src/tests/keywords/README.md create mode 100644 src/tests/keywords/all.mk create mode 100644 src/tests/keywords/array create mode 100644 src/tests/keywords/base64 create mode 100644 src/tests/keywords/break-error create mode 100644 src/tests/keywords/cache create mode 100644 src/tests/keywords/case-attr-error create mode 100644 src/tests/keywords/case-empty create mode 100644 src/tests/keywords/case-empty-string create mode 100644 src/tests/keywords/case-list create mode 100644 src/tests/keywords/cast-byte create mode 100644 src/tests/keywords/cast-integer create mode 100644 src/tests/keywords/cast-ipaddr create mode 100644 src/tests/keywords/cast-short create mode 100644 src/tests/keywords/cmp create mode 100644 src/tests/keywords/cmp-ipaddr create mode 100644 src/tests/keywords/comments create mode 100644 src/tests/keywords/count-error create mode 100644 src/tests/keywords/crypt create mode 100644 src/tests/keywords/default-input.attrs create mode 100644 src/tests/keywords/else-error create mode 100644 src/tests/keywords/escape create mode 100644 src/tests/keywords/escape-sequences create mode 100644 src/tests/keywords/expand create mode 100644 src/tests/keywords/expr create mode 100644 src/tests/keywords/foreach create mode 100644 src/tests/keywords/foreach-break create mode 100644 src/tests/keywords/foreach-break-2 create mode 100644 src/tests/keywords/foreach-break-3 create mode 100644 src/tests/keywords/foreach-break-4 create mode 100644 src/tests/keywords/foreach-break.attrs create mode 100644 src/tests/keywords/foreach-error create mode 100644 src/tests/keywords/foreach-isolation create mode 100644 src/tests/keywords/foreach-list create mode 100644 src/tests/keywords/foreach-list.attrs create mode 100644 src/tests/keywords/foreach-nested create mode 100644 src/tests/keywords/foreach-nested.attrs create mode 100644 src/tests/keywords/foreach-regex create mode 100644 src/tests/keywords/foreach-regex.attrs create mode 100644 src/tests/keywords/foreach-return create mode 100644 src/tests/keywords/foreach-varied-depth create mode 100644 src/tests/keywords/foreach.attrs create mode 100644 src/tests/keywords/hex create mode 100644 src/tests/keywords/if create mode 100644 src/tests/keywords/if-bob create mode 100644 src/tests/keywords/if-else create mode 100644 src/tests/keywords/if-elsif create mode 100644 src/tests/keywords/if-multivalue create mode 100644 src/tests/keywords/if-paircmp create mode 100644 src/tests/keywords/if-rcode-error create mode 100644 src/tests/keywords/if-regex-bad-attribute create mode 100644 src/tests/keywords/if-regex-error create mode 100644 src/tests/keywords/if-regex-match create mode 100644 src/tests/keywords/if-regex-match-comp create mode 100644 src/tests/keywords/if-regex-match-comp.attrs create mode 100644 src/tests/keywords/if-regex-match-named create mode 100644 src/tests/keywords/if-regex-match-named.attrs create mode 100644 src/tests/keywords/if-regex-match.attrs create mode 100644 src/tests/keywords/if-regex-multivalue create mode 100644 src/tests/keywords/if-skip create mode 100644 src/tests/keywords/integer create mode 100644 src/tests/keywords/ipaddr create mode 100644 src/tests/keywords/ipaddr-error create mode 100644 src/tests/keywords/ipaddr.attrs create mode 100644 src/tests/keywords/ipprefix create mode 100644 src/tests/keywords/length create mode 100644 src/tests/keywords/load-balance create mode 100644 src/tests/keywords/log create mode 100644 src/tests/keywords/map-xlat create mode 100644 src/tests/keywords/md4 create mode 100644 src/tests/keywords/md5 create mode 100644 src/tests/keywords/module-failure-message create mode 100644 src/tests/keywords/ok-return create mode 100644 src/tests/keywords/ok-return.attrs create mode 100644 src/tests/keywords/pad create mode 100644 src/tests/keywords/pairs create mode 100644 src/tests/keywords/pap create mode 100644 src/tests/keywords/pap-ssha2 create mode 100644 src/tests/keywords/radiusd.conf create mode 100644 src/tests/keywords/redundant create mode 100644 src/tests/keywords/redundant-error create mode 100644 src/tests/keywords/redundant-load-balance create mode 100644 src/tests/keywords/redundant-redundant create mode 100644 src/tests/keywords/regex-escape create mode 100644 src/tests/keywords/regex-lhs create mode 100644 src/tests/keywords/return create mode 100644 src/tests/keywords/return-group create mode 100644 src/tests/keywords/return-group.attrs create mode 100644 src/tests/keywords/return-section create mode 100644 src/tests/keywords/sha1 create mode 100644 src/tests/keywords/sha2 create mode 100644 src/tests/keywords/smash create mode 100644 src/tests/keywords/string create mode 100644 src/tests/keywords/substring create mode 100644 src/tests/keywords/switch create mode 100644 src/tests/keywords/switch-attr-cast create mode 100644 src/tests/keywords/switch-attr-cmp create mode 100644 src/tests/keywords/switch-default create mode 100644 src/tests/keywords/switch-escape create mode 100644 src/tests/keywords/switch-nodefault create mode 100644 src/tests/keywords/switch-value-error create mode 100644 src/tests/keywords/switch-value-error2 create mode 100644 src/tests/keywords/switch-virtual create mode 100644 src/tests/keywords/switch-xlat-error create mode 100644 src/tests/keywords/truncation create mode 100644 src/tests/keywords/unknown create mode 100644 src/tests/keywords/unknown-if create mode 100644 src/tests/keywords/unknown-name create mode 100644 src/tests/keywords/unknown-update create mode 100644 src/tests/keywords/update create mode 100644 src/tests/keywords/update-add-ref-index create mode 100644 src/tests/keywords/update-add-ref-tag create mode 100644 src/tests/keywords/update-all create mode 100644 src/tests/keywords/update-array create mode 100644 src/tests/keywords/update-delete create mode 100644 src/tests/keywords/update-error create mode 100644 src/tests/keywords/update-error-2 create mode 100644 src/tests/keywords/update-error-3 create mode 100644 src/tests/keywords/update-exec create mode 100644 src/tests/keywords/update-filter create mode 100644 src/tests/keywords/update-index create mode 100644 src/tests/keywords/update-list-error create mode 100644 src/tests/keywords/update-operator create mode 100644 src/tests/keywords/update-prepend create mode 100644 src/tests/keywords/update-remove-any create mode 100644 src/tests/keywords/update-remove-index create mode 100644 src/tests/keywords/update-remove-list create mode 100644 src/tests/keywords/update-remove-tag create mode 100644 src/tests/keywords/update-remove-value create mode 100644 src/tests/keywords/update-tag create mode 100644 src/tests/keywords/update-xlat create mode 100644 src/tests/keywords/urlquote create mode 100644 src/tests/keywords/virtual create mode 100644 src/tests/keywords/virtual-exists create mode 100644 src/tests/keywords/virtual-load-balance create mode 100644 src/tests/keywords/virtual-rhs create mode 100644 src/tests/keywords/virtual_policy create mode 100644 src/tests/keywords/wimax create mode 100644 src/tests/keywords/wimax-comboip create mode 100644 src/tests/keywords/with_dots create mode 100644 src/tests/keywords/xlat-attr create mode 100644 src/tests/keywords/xlat-attr-index create mode 100644 src/tests/keywords/xlat-attr-tag create mode 100644 src/tests/keywords/xlat-concat create mode 100644 src/tests/keywords/xlat-error create mode 100644 src/tests/keywords/xlat-explode create mode 100644 src/tests/keywords/xlat-list create mode 100644 src/tests/keywords/xlat-octets create mode 100644 src/tests/keywords/xlat-virtual-attr create mode 100644 src/tests/map/all.mk create mode 100644 src/tests/map/base create mode 100644 src/tests/map/base.out create mode 100644 src/tests/map/count-error create mode 100644 src/tests/map/count-list-error create mode 100644 src/tests/map/map_tests.mk create mode 100644 src/tests/map/map_unit.c create mode 100644 src/tests/map/map_unit.mk create mode 100644 src/tests/modules/README.rst create mode 100644 src/tests/modules/all.mk create mode 100644 src/tests/modules/always/all.mk create mode 100644 src/tests/modules/always/module.conf create mode 100644 src/tests/modules/always/replace.unlang create mode 100644 src/tests/modules/always/set_rcode.unlang create mode 100644 src/tests/modules/always/set_status_dead.unlang create mode 100644 src/tests/modules/always/set_status_revive.unlang create mode 100644 src/tests/modules/cache/rbtree/all.mk create mode 100644 src/tests/modules/default-input.attrs create mode 100644 src/tests/modules/files/addcontrol.attrs create mode 100644 src/tests/modules/files/addcontrol.unlang create mode 100644 src/tests/modules/files/addreply.attrs create mode 100644 src/tests/modules/files/addreply.unlang create mode 100644 src/tests/modules/files/all.mk create mode 100644 src/tests/modules/files/authorize create mode 100644 src/tests/modules/files/bob.attrs create mode 100644 src/tests/modules/files/bob.unlang create mode 100644 src/tests/modules/files/doug.attrs create mode 100644 src/tests/modules/files/doug.unlang create mode 100644 src/tests/modules/files/fall-through.attrs create mode 100644 src/tests/modules/files/fall-through.unlang create mode 100644 src/tests/modules/files/filterreply.attrs create mode 100644 src/tests/modules/files/filterreply.unlang create mode 100644 src/tests/modules/files/module.conf create mode 100644 src/tests/modules/files/subreply.attrs create mode 100644 src/tests/modules/files/subreply.unlang create mode 100644 src/tests/modules/json/all.mk create mode 100644 src/tests/modules/json/encode.attrs create mode 100644 src/tests/modules/json/encode.unlang create mode 100644 src/tests/modules/json/module.conf create mode 100644 src/tests/modules/ldap/acct.attrs create mode 100644 src/tests/modules/ldap/acct.unlang create mode 100644 src/tests/modules/ldap/all.mk create mode 100644 src/tests/modules/ldap/auth.attrs create mode 100644 src/tests/modules/ldap/auth.unlang create mode 120000 src/tests/modules/ldap/example.com.ldif create mode 100644 src/tests/modules/ldap/groups_rfc2307bis.attrs create mode 100644 src/tests/modules/ldap/groups_rfc2307bis.unlang create mode 100644 src/tests/modules/ldap/module.conf create mode 100644 src/tests/modules/pap/all.mk create mode 100644 src/tests/modules/pap/module.conf create mode 100644 src/tests/modules/pap/pbkfd2_dig_big.attrs create mode 100644 src/tests/modules/pap/pbkfd2_dig_big.unlang create mode 100644 src/tests/modules/pap/pbkfd2_dig_small.attrs create mode 100644 src/tests/modules/pap/pbkfd2_dig_small.unlang create mode 100644 src/tests/modules/pap/pbkfd2_iter0.attrs create mode 100644 src/tests/modules/pap/pbkfd2_iter0.unlang create mode 100644 src/tests/modules/pap/pbkfd2_iter1.attrs create mode 100644 src/tests/modules/pap/pbkfd2_iter1.unlang create mode 100644 src/tests/modules/pap/pbkfd2_iter1000.attrs create mode 100644 src/tests/modules/pap/pbkfd2_iter1000.unlang create mode 100644 src/tests/modules/pap/pbkfd2_iter100000.attrs create mode 100644 src/tests/modules/pap/pbkfd2_iter100000.unlang create mode 100644 src/tests/modules/pap/pbkfd2_iter_big.attrs create mode 100644 src/tests/modules/pap/pbkfd2_iter_big.unlang create mode 100644 src/tests/modules/pap/pbkfd2_iter_miss.attrs create mode 100644 src/tests/modules/pap/pbkfd2_iter_miss.unlang create mode 100644 src/tests/modules/pap/pbkfd2_iter_small.attrs create mode 100644 src/tests/modules/pap/pbkfd2_iter_small.unlang create mode 100644 src/tests/modules/pap/pbkfd2_passlib.attrs create mode 100644 src/tests/modules/pap/pbkfd2_passlib.unlang create mode 100644 src/tests/modules/pap/pbkfd2_salt0.attrs create mode 100644 src/tests/modules/pap/pbkfd2_salt0.unlang create mode 100644 src/tests/modules/pap/pbkfd2_salt1.attrs create mode 100644 src/tests/modules/pap/pbkfd2_salt1.unlang create mode 100644 src/tests/modules/pap/pbkfd2_salt1024.attrs create mode 100644 src/tests/modules/pap/pbkfd2_salt1024.unlang create mode 100644 src/tests/modules/pap/pbkfd2_salt64.attrs create mode 100644 src/tests/modules/pap/pbkfd2_salt64.unlang create mode 100644 src/tests/modules/pap/pbkfd2_salt_big.attrs create mode 100644 src/tests/modules/pap/pbkfd2_salt_big.unlang create mode 100644 src/tests/modules/pap/pbkfd2_salt_small.attrs create mode 100644 src/tests/modules/pap/pbkfd2_salt_small.unlang create mode 100644 src/tests/modules/pap/pbkfd2_sha1.attrs create mode 100644 src/tests/modules/pap/pbkfd2_sha1.unlang create mode 100644 src/tests/modules/pap/pbkfd2_sha2_224.attrs create mode 100644 src/tests/modules/pap/pbkfd2_sha2_224.unlang create mode 100644 src/tests/modules/pap/pbkfd2_sha2_256.attrs create mode 100644 src/tests/modules/pap/pbkfd2_sha2_256.unlang create mode 100644 src/tests/modules/pap/pbkfd2_sha2_384.attrs create mode 100644 src/tests/modules/pap/pbkfd2_sha2_384.unlang create mode 100644 src/tests/modules/pap/pbkfd2_sha2_512.attrs create mode 100644 src/tests/modules/pap/pbkfd2_sha2_512.unlang create mode 100644 src/tests/modules/preprocess/all.mk create mode 100644 src/tests/modules/preprocess/hints create mode 100644 src/tests/modules/preprocess/huntgroups create mode 100644 src/tests/modules/preprocess/module.conf create mode 100644 src/tests/modules/preprocess/xlat.attrs create mode 100644 src/tests/modules/preprocess/xlat.unlang create mode 100644 src/tests/modules/radiusd.conf create mode 100644 src/tests/modules/rest/all.mk create mode 100644 src/tests/modules/rest/module.conf create mode 100644 src/tests/modules/rest/rest_module.attrs create mode 100644 src/tests/modules/rest/rest_module.unlang create mode 100644 src/tests/modules/rest/rest_xlat.attrs create mode 100644 src/tests/modules/rest/rest_xlat.unlang create mode 100644 src/tests/modules/sql/.gitignore create mode 100644 src/tests/modules/sql/acct_0_start.attrs create mode 100644 src/tests/modules/sql/acct_0_start.unlang create mode 100644 src/tests/modules/sql/acct_1_update.attrs create mode 100644 src/tests/modules/sql/acct_1_update.unlang create mode 100644 src/tests/modules/sql/acct_2_stop.attrs create mode 100644 src/tests/modules/sql/acct_2_stop.unlang create mode 100644 src/tests/modules/sql/acct_start_conflict.attrs create mode 100644 src/tests/modules/sql/acct_start_conflict.unlang create mode 100644 src/tests/modules/sql/acct_update_no_start.attrs create mode 100644 src/tests/modules/sql/acct_update_no_start.unlang create mode 100644 src/tests/modules/sql/auth.attrs create mode 100644 src/tests/modules/sql/auth.unlang create mode 100644 src/tests/modules/sql/reject.attrs create mode 100644 src/tests/modules/sql/reject.unlang create mode 100644 src/tests/modules/sql_mysql/.gitignore create mode 120000 src/tests/modules/sql_mysql/acct_0_start.attrs create mode 120000 src/tests/modules/sql_mysql/acct_0_start.unlang create mode 120000 src/tests/modules/sql_mysql/acct_1_update.attrs create mode 120000 src/tests/modules/sql_mysql/acct_1_update.unlang create mode 120000 src/tests/modules/sql_mysql/acct_2_stop.attrs create mode 120000 src/tests/modules/sql_mysql/acct_2_stop.unlang create mode 120000 src/tests/modules/sql_mysql/acct_start_conflict.attrs create mode 120000 src/tests/modules/sql_mysql/acct_start_conflict.unlang create mode 120000 src/tests/modules/sql_mysql/acct_update_no_start.attrs create mode 120000 src/tests/modules/sql_mysql/acct_update_no_start.unlang create mode 100644 src/tests/modules/sql_mysql/all.mk create mode 120000 src/tests/modules/sql_mysql/auth.attrs create mode 120000 src/tests/modules/sql_mysql/auth.unlang create mode 100644 src/tests/modules/sql_mysql/module.conf create mode 120000 src/tests/modules/sql_mysql/reject.attrs create mode 120000 src/tests/modules/sql_mysql/reject.unlang create mode 100644 src/tests/modules/sql_postgresql/.gitignore create mode 120000 src/tests/modules/sql_postgresql/acct_0_start.attrs create mode 120000 src/tests/modules/sql_postgresql/acct_0_start.unlang create mode 120000 src/tests/modules/sql_postgresql/acct_1_update.attrs create mode 120000 src/tests/modules/sql_postgresql/acct_1_update.unlang create mode 120000 src/tests/modules/sql_postgresql/acct_2_stop.attrs create mode 120000 src/tests/modules/sql_postgresql/acct_2_stop.unlang create mode 120000 src/tests/modules/sql_postgresql/acct_start_conflict.attrs create mode 120000 src/tests/modules/sql_postgresql/acct_start_conflict.unlang create mode 120000 src/tests/modules/sql_postgresql/acct_update_no_start.attrs create mode 120000 src/tests/modules/sql_postgresql/acct_update_no_start.unlang create mode 100644 src/tests/modules/sql_postgresql/all.mk create mode 120000 src/tests/modules/sql_postgresql/auth.attrs create mode 120000 src/tests/modules/sql_postgresql/auth.unlang create mode 100644 src/tests/modules/sql_postgresql/module.conf create mode 120000 src/tests/modules/sql_postgresql/reject.attrs create mode 120000 src/tests/modules/sql_postgresql/reject.unlang create mode 100644 src/tests/modules/sql_sqlite/.gitignore create mode 120000 src/tests/modules/sql_sqlite/acct_0_start.attrs create mode 120000 src/tests/modules/sql_sqlite/acct_0_start.unlang create mode 120000 src/tests/modules/sql_sqlite/acct_1_update.attrs create mode 120000 src/tests/modules/sql_sqlite/acct_1_update.unlang create mode 120000 src/tests/modules/sql_sqlite/acct_2_stop.attrs create mode 120000 src/tests/modules/sql_sqlite/acct_2_stop.unlang create mode 120000 src/tests/modules/sql_sqlite/acct_start_conflict.attrs create mode 120000 src/tests/modules/sql_sqlite/acct_start_conflict.unlang create mode 120000 src/tests/modules/sql_sqlite/acct_update_no_start.attrs create mode 120000 src/tests/modules/sql_sqlite/acct_update_no_start.unlang create mode 100644 src/tests/modules/sql_sqlite/all.mk create mode 120000 src/tests/modules/sql_sqlite/auth.attrs create mode 120000 src/tests/modules/sql_sqlite/auth.unlang create mode 100644 src/tests/modules/sql_sqlite/module.conf create mode 120000 src/tests/modules/sql_sqlite/reject.attrs create mode 120000 src/tests/modules/sql_sqlite/reject.unlang create mode 100644 src/tests/modules/test.mk create mode 100644 src/tests/modules/unbound/all.mk create mode 100644 src/tests/modules/unbound/dns.attrs create mode 100644 src/tests/modules/unbound/dns.unlang create mode 100644 src/tests/modules/unbound/module.conf create mode 100644 src/tests/modules/unbound/unbound.conf create mode 100644 src/tests/mschapv1 create mode 100644 src/tests/panic.gdb create mode 100644 src/tests/peap-client-mschapv2.conf create mode 100644 src/tests/peap-eap-tls.conf create mode 100644 src/tests/peap-mschapv2.conf create mode 100644 src/tests/proxy.conf create mode 100644 src/tests/radiusd.mk create mode 100644 src/tests/radsec/.gitignore create mode 100644 src/tests/radsec/1.basic-auth.reply create mode 100644 src/tests/radsec/1.basic-auth.request create mode 100644 src/tests/radsec/2.ipaddrudp-coa.reply create mode 100644 src/tests/radsec/2.ipaddrudp-coa.request create mode 100644 src/tests/radsec/3.homepooludp-coa.reply create mode 100644 src/tests/radsec/3.homepooludp-coa.request create mode 100644 src/tests/radsec/4.homepooltls-coa.reply create mode 100644 src/tests/radsec/4.homepooltls-coa.request create mode 100644 src/tests/radsec/5.singletunnel_proxy-coa.reply create mode 100644 src/tests/radsec/5.singletunnel_proxy-coa.request create mode 100644 src/tests/radsec/6.singletunnel_originate-coa.reply create mode 100644 src/tests/radsec/6.singletunnel_originate-coa.request create mode 100644 src/tests/radsec/7.coareply-auth.reply create mode 100644 src/tests/radsec/7.coareply-auth.request create mode 100644 src/tests/radsec/Makefile create mode 100644 src/tests/radsec/README.rst create mode 100644 src/tests/radsec/all.mk create mode 100644 src/tests/radsec/config-coa/main.conf.template create mode 100644 src/tests/radsec/config-home/main.conf create mode 100644 src/tests/radsec/config-proxy/main.conf.template create mode 100755 src/tests/radsec/runtest.sh create mode 100644 src/tests/rbmonkey.c create mode 100644 src/tests/rbmonkey.mk create mode 100755 src/tests/runtests.sh create mode 100644 src/tests/salt-test-server/.gitignore create mode 100644 src/tests/salt-test-server/README create mode 100755 src/tests/salt-test-server/build.sh create mode 100644 src/tests/salt-test-server/salt/iptable.sls create mode 100644 src/tests/salt-test-server/salt/iptables create mode 100644 src/tests/salt-test-server/salt/ldap.sls create mode 100644 src/tests/salt-test-server/salt/ldap/base.ldif create mode 100644 src/tests/salt-test-server/salt/ldap/base2.ldif create mode 100644 src/tests/salt-test-server/salt/ldap/schema_freeradius.ldif create mode 100644 src/tests/salt-test-server/salt/mysql.sls create mode 100644 src/tests/salt-test-server/salt/mysql/schema.sql create mode 100644 src/tests/salt-test-server/salt/mysql/setup.sql create mode 100644 src/tests/salt-test-server/salt/ntp.sls create mode 100644 src/tests/salt-test-server/salt/postgres.sls create mode 100644 src/tests/salt-test-server/salt/postgres/schema.sql create mode 100644 src/tests/salt-test-server/salt/postgres/setup.sql create mode 100644 src/tests/salt-test-server/salt/top.sls create mode 100644 src/tests/salt-test-server/salt_config/master create mode 100644 src/tests/salt-test-server/salt_config/roster create mode 100644 src/tests/sql_nas_table/all.mk create mode 100644 src/tests/sql_nas_table/auth.txt create mode 100644 src/tests/sql_nas_table/clients.sql create mode 100644 src/tests/sql_nas_table/config/radiusd.conf create mode 100644 src/tests/stripped.example.com create mode 100644 src/tests/test.example.com create mode 100644 src/tests/tests.gdb create mode 100644 src/tests/tls/README.md create mode 100644 src/tests/tls/acct create mode 100755 src/tests/tls/block.sh create mode 100644 src/tests/tls/common.sh create mode 100644 src/tests/tls/home/radiusd.conf create mode 100644 src/tests/tls/proxy/proxy.conf create mode 100644 src/tests/tls/proxy/radiusd.conf create mode 100755 src/tests/tls/radacct.sh create mode 100755 src/tests/tls/radclient.sh create mode 100755 src/tests/tls/radiusd-home.sh create mode 100755 src/tests/tls/radiusd-proxy.sh create mode 100644 src/tests/tls/user_password create mode 100644 src/tests/unit/all.mk create mode 100644 src/tests/unit/ascend.txt create mode 100644 src/tests/unit/condition.txt create mode 100644 src/tests/unit/dhcp.txt create mode 100644 src/tests/unit/eapol_key_msg.txt create mode 100644 src/tests/unit/errors.txt create mode 100644 src/tests/unit/escape.txt create mode 100644 src/tests/unit/extended.txt create mode 100644 src/tests/unit/lucent.txt create mode 100644 src/tests/unit/rfc.txt create mode 100644 src/tests/unit/rfc4849.txt create mode 100644 src/tests/unit/tunnel.txt create mode 100644 src/tests/unit/vendor.txt create mode 100644 src/tests/unit/wimax.txt create mode 100644 src/tests/unit/xlat.txt create mode 100644 src/tests/xlat/all.mk create mode 100644 src/tests/xlat/expr.txt create mode 100644 src/tests/xlat/radiusd.conf create mode 100644 suse/README.SuSE create mode 100644 suse/freeradius-server-rpmlintrc create mode 100644 suse/freeradius-server-tmpfiles.conf create mode 100644 suse/freeradius.spec create mode 100644 suse/radiusd-logrotate create mode 100644 suse/radiusd-pam create mode 100644 suse/rcradiusd diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a76baa9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +* text=auto +* ident +*.h linguist-language=c +*.c linguist-language=c +doc/* linguist-documentation diff --git a/.github/workflows/ci-deb.yml b/.github/workflows/ci-deb.yml new file mode 100644 index 0000000..965c926 --- /dev/null +++ b/.github/workflows/ci-deb.yml @@ -0,0 +1,230 @@ +name: CI DEB + +on: + push: + branches-ignore: + - coverity_scan + pull_request: + +env: + DEBIAN_FRONTEND: noninteractive + CC: gcc + +jobs: + deb-build: + + strategy: + matrix: + env: + - { NAME: "ubuntu-18.04", OS: "ubuntu:bionic-20220801" } + - { NAME: "ubuntu-20.04", OS: "ubuntu:20.04" } + - { NAME: "ubuntu-22.04", OS: "ubuntu:22.04" } + - { NAME: "debian-10", OS: "debian:buster" } + - { NAME: "debian-11", OS: "debian:bullseye" } + - { NAME: "debian-sid", OS: "debian:sid" } + fail-fast: false + + runs-on: ubuntu-latest + + container: + image: ${{ matrix.env.OS }} + + env: + HOSTAPD_BUILD_DIR: /tmp/eapol_test.ci + HOSTAPD_GIT_TAG: hostap_2_8 + + name: "DEB build" + + steps: + + - name: Package manager performance and stability improvements + run: | + if [ -f "/etc/apt/sources.list" ]; then + sed -i 's/deb.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list + sed -i 's/archive.ubuntu.com/azure.archive.ubuntu.com/' /etc/apt/sources.list + fi + echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries + echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/02speedup + echo 'man-db man-db/auto-update boolean false' | debconf-set-selections + apt-get update + + - name: Install recent git + run: | + apt-get install -y --no-install-recommends git-core ca-certificates + + - uses: actions/checkout@v3 + with: + path: freeradius + + - name: Prepare filesystem + run: | + pwd + ls -la + mkdir debs + ls -la + + - name: Install build dependencies + run: | + apt-get install -y --no-install-recommends build-essential devscripts quilt equivs procps + debian/rules debian/control + mk-build-deps -irt"apt-get -y" debian/control + working-directory: freeradius + + - name: Show versions + run: | + $CC --version + make --version + krb5-config --all || : + openssl version + + - name: Build DEBs + run: | + make deb + working-directory: freeradius + + - name: Collect DEBs + run: | + mv *.deb debs/ + + - name: Restore eapol_test build directory from cache + uses: actions/cache@v3 + id: hostapd-cache + with: + path: ${{ env.HOSTAPD_BUILD_DIR }} + key: hostapd-${{ matrix.env.NAME }}-${{ env.HOSTAPD_GIT_TAG }}-v1 + + # Debian sid defaults to gcc12 which fails to build eapol_test + - name: Install GCC 10 for eapol_test build + run: | + apt-get install -y --no-install-recommends gcc-10 + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 && update-alternatives --set gcc /usr/bin/gcc-10 + if: ${{ matrix.env.OS == 'debian:sid' }} + + - name: Build eapol_test + run: | + apt-get install -y libnl-3-dev libnl-genl-3-dev + scripts/ci/eapol_test-build.sh + mv scripts/ci/eapol_test/eapol_test ../debs + working-directory: freeradius + + - name: Store DEBs + uses: actions/upload-artifact@v3 + with: + name: debs-${{ matrix.env.NAME }} + path: debs + + # + # If the CI has failed and the branch is ci-debug then start a tmate + # session. SSH rendezvous point is emited continuously in the job output. + # + - name: "Debug: Package dependancies for tmate" + run: | + apt-get install -y --no-install-recommends xz-utils + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + + - name: "Debug: Start tmate" + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + sudo: false + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + + + deb-test: + + needs: + - deb-build + + strategy: + matrix: + env: + - { NAME: "ubuntu-18.04", OS: "ubuntu:bionic-20220801" } + - { NAME: "ubuntu-20.04", OS: "ubuntu:20.04" } + - { NAME: "ubuntu-22.04", OS: "ubuntu:22.04" } + - { NAME: "debian-10", OS: "debian:buster" } + - { NAME: "debian-11", OS: "debian:bullseye" } + - { NAME: "debian-sid", OS: "debian:sid" } + fail-fast: false + + runs-on: ubuntu-latest + + container: + image: ${{ matrix.env.OS }} + + name: "DEB install test" + + steps: + + - name: Load DEBs + uses: actions/download-artifact@v3 + with: + name: debs-${{ matrix.env.NAME }} + + - name: Package manager performance improvements + run: | + if [ -f "/etc/apt/sources.list" ]; then + sed -i 's/deb.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list + sed -i 's/archive.ubuntu.com/azure.archive.ubuntu.com/' /etc/apt/sources.list + fi + echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/02speedup + echo 'man-db man-db/auto-update boolean false' | debconf-set-selections + apt-get update + + # For pkill and strings + - name: Install procps and binutils + run: | + apt-get update + apt-get install -y --no-install-recommends procps binutils + + - name: Install DEBs + run: | + find . -maxdepth 1 -name '*.deb' | xargs apt-get install -y --no-install-recommends + + - name: Config test + run: | + freeradius -XC + + # + # We now perform some post-install tests that depend on the availability + # of the source tree + # + - name: Install pre-built eapol_test + run: | + apt-get install -y libssl1.? libdbus-1-? libnl-3-200 libnl-genl-3-200 + mv eapol_test /usr/local/bin + chmod +x /usr/local/bin/eapol_test + + - uses: actions/checkout@v3 + with: + path: freeradius + + - name: Run the post-install test target + run: | + echo "top_builddir := $(pwd)" > Make.inc + make -C src/tests/ OPENSSL_LIBS=1 EAPOL_TEST_BIN="$(which eapol_test)" $(pwd)/build/tests/eapol_test/eapol_test.mk + make -f scripts/ci/package-test.mk package-test + working-directory: freeradius + + - name: Upload radius logs on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: radius-logs-${{ matrix.env.NAME }}.tgz + path: | + /var/log/freeradius + freeradius/build/tests/eapol_test + + # + # See above comments for tmate + # + - name: "Debug: Package dependancies for tmate" + run: | + apt-get install -y --no-install-recommends xz-utils + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + + - name: "Debug: Start tmate" + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + sudo: false + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} diff --git a/.github/workflows/ci-rpm.yml b/.github/workflows/ci-rpm.yml new file mode 100644 index 0000000..94517f3 --- /dev/null +++ b/.github/workflows/ci-rpm.yml @@ -0,0 +1,332 @@ +name: CI RPM + +on: + push: + branches-ignore: + - coverity_scan + pull_request: + +env: + CC: gcc + +jobs: + rpm-build: + + strategy: + matrix: + env: + - { NAME: "centos-7", OS: "centos:7" } + - { NAME: "centos-8", OS: "centos:8" } + - { NAME: "rocky-8", OS: "rockylinux/rockylinux:8" } + - { NAME: "rocky-9", OS: "rockylinux/rockylinux:9" } + fail-fast: false + + runs-on: ubuntu-latest + + container: + image: ${{ matrix.env.OS }} + + env: + HOSTAPD_BUILD_DIR: /tmp/eapol_test.ci + HOSTAPD_GIT_TAG: hostapd_2_8 + + name: "RPM build" + + steps: + + # + # Centos9 is EOL, so we need the below tricks to get it to work. + # + # Converting from CentOS Linux 8 to CentOS Stream 8 is the "official" process + # (see centos.org/centos-stream/#centos-stream-8): + # + - name: Some hacks for CentOS 8 (EOL) to work again. + if: ${{ matrix.env.NAME == 'centos-8' }} + run: | + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* + yum upgrade -y + yum -y --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos + yum clean all && yum makecache + yum distro-sync -y --allowerasing + + # Required so that the checkout action uses git protocol rather than the GitHub REST API. + # make rpm requires the FR directory to be a git repository. + - name: Install recent git for CentOS 7 + if: ${{ matrix.env.NAME == 'centos-7' }} + run: | + yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/git-core-2.30.1-1.ep7.x86_64.rpm + + - name: Install distro git for Rocky and CentOS 8. + if: ${{ startsWith(matrix.env.NAME, 'rocky-') || matrix.env.NAME == 'centos-8' }} + run: | + yum install -y git-core + + - uses: actions/checkout@v3 + with: + path: freeradius + + - name: Prepare filesystem + run: | + pwd + ls -la + mkdir rpms + ls -la + + - name: LTB repo for CentOS and Rocky Linux 8 + if: ${{ startsWith(matrix.env.NAME, 'centos-') || matrix.env.NAME == 'rocky-8' }} + run: | + echo '[ltb-project]' > /etc/yum.repos.d/ltb-project.repo + echo 'name=LTB project packages' >> /etc/yum.repos.d/ltb-project.repo + echo 'baseurl=https://ltb-project.org/rpm/$releasever/$basearch' >> /etc/yum.repos.d/ltb-project.repo + echo 'enabled=1' >> /etc/yum.repos.d/ltb-project.repo + echo 'gpgcheck=1' >> /etc/yum.repos.d/ltb-project.repo + echo 'gpgkey=https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project' >> /etc/yum.repos.d/ltb-project.repo + rpm --import https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project + + - name: Enable EPEL for CentOS and Rocky Linux + if: ${{ startsWith(matrix.env.NAME, 'centos-') || startsWith(matrix.env.NAME, 'rocky-') }} + run: | + yum install -y epel-release + + - name: Enable PowerTools on Rocky 8 and CentOS 8. + if: ${{ matrix.env.NAME == 'rocky-8' || matrix.env.NAME == 'centos-8' }} + run: | + yum install -y yum-utils + yum config-manager --enable PowerTools || : + yum config-manager --enable powertools || : + + - name: Enable Code Ready Builer on Rocky 9. + if: ${{ matrix.env.NAME == 'rocky-9' }} + run: | + yum install -y yum-utils + yum config-manager --enable crb + + - name: Install common tools + run: | + yum install -y \ + bzip2 \ + gcc \ + make \ + perl \ + rpm-build \ + yum-utils + + # + # We just patch the SPEC file for Fedora since we want to use the standard + # make rpm target which wants to build with LDAP. + # + - name: Disable rlm_ldap on Fedora (no LTB packages) + if: ${{ startsWith(matrix.env.NAME, 'fedora-') }} + run: | + sed -ie 's/%bcond_without ldap/%global _without_ldap: 1/' freeradius/redhat/freeradius.spec + + - name: Install build dependencies + run: | + yum-builddep -y freeradius/redhat/freeradius.spec + + # + # It has been observed that sometimes not all the dependencies are + # installed on the first go. Give it a second chance. + # + - name: Second run of install build dependencies + run: | + yum-builddep -y redhat/freeradius.spec + working-directory: freeradius + + - name: Show versions + run: | + $CC --version + make --version + krb5-config --all || : + openssl version + + # For pkill and ps + - name: Enable procps-ng on Centos and Rocky + if: ${{ startsWith(matrix.env.NAME, 'centos-8') || startsWith(matrix.env.NAME, 'rocky-') }} + run: | + yum install -y procps-ng + + - name: Build RPMs + run: | + [ -r /opt/rh/devtoolset-8/enable ] && source /opt/rh/devtoolset-8/enable || : + ./configure + make rpm + working-directory: freeradius + + - name: Collect RPMs + run: | + mv freeradius/rpmbuild/RPMS/x86_64/*.rpm rpms/ + + - name: Restore eapol_test build directory from cache + uses: actions/cache@v3 + id: hostapd-cache + with: + path: ${{ env.HOSTAPD_BUILD_DIR }} + key: hostapd-${{ matrix.env.NAME }}-${{ env.HOSTAPD_GIT_TAG }}-v1 + + - name: Build eapol_test + run: | + yum install -y libnl3-devel which + [ -r /opt/rh/devtoolset-8/enable ] && source /opt/rh/devtoolset-8/enable || : + scripts/ci/eapol_test-build.sh + mv scripts/ci/eapol_test/eapol_test ../rpms/ + working-directory: freeradius + + - name: Store RPMs + uses: actions/upload-artifact@v3 + with: + name: rpms-${{ matrix.env.NAME }} + path: rpms + + # + # If the CI has failed and the branch is ci-debug then start a tmate + # session. SSH rendezvous point is emited continuously in the job output. + # + - name: "Debug: Package dependancies for tmate" + run: | + yum install -y xz + ln -s /bin/true /bin/apt-get + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + + - name: "Debug: Start tmate" + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + sudo: false + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + + + rpm-test: + + needs: + - rpm-build + + strategy: + matrix: + env: + - { NAME: "centos-7", OS: "centos:7" } + - { NAME: "centos-8", OS: "centos:8" } + - { NAME: "rocky-8", OS: "rockylinux/rockylinux:8" } + - { NAME: "rocky-9", OS: "rockylinux/rockylinux:9" } + fail-fast: false + + runs-on: ubuntu-latest + + container: + image: ${{ matrix.env.OS }} + + name: "RPM install test" + + steps: + + # + # Centos9 is EOL, so we need the below tricks to get it to work. + # + # Converting from CentOS Linux 8 to CentOS Stream 8 is the "official" process + # (see centos.org/centos-stream/#centos-stream-8): + # + - name: Some hacks for CentOS 8 (EOL) to work again. + if: ${{ matrix.env.NAME == 'centos-8' }} + run: | + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* + yum upgrade -y + yum -y --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos + yum clean all && yum makecache + yum distro-sync -y --allowerasing + + - name: LTB repo for CentOS and Rocky 8 + if: ${{ startsWith(matrix.env.NAME, 'centos-') || matrix.env.NAME == 'rocky-8' }} + run: | + echo '[ltb-project]' > /etc/yum.repos.d/ltb-project.repo + echo 'name=LTB project packages' >> /etc/yum.repos.d/ltb-project.repo + echo 'baseurl=https://ltb-project.org/rpm/$releasever/$basearch' >> /etc/yum.repos.d/ltb-project.repo + echo 'enabled=1' >> /etc/yum.repos.d/ltb-project.repo + echo 'gpgcheck=1' >> /etc/yum.repos.d/ltb-project.repo + echo 'gpgkey=https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project' >> /etc/yum.repos.d/ltb-project.repo + rpm --import https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project + + - name: Enable EPEL for CentOS and Rocky Linux + if: ${{ startsWith(matrix.env.NAME, 'centos-') || startsWith(matrix.env.NAME, 'rocky-') }} + run: | + yum install -y epel-release + + - name: Enable PowerTools on Centos 8 and Rocky 8 + if: ${{ matrix.env.NAME == 'centos-8' || matrix.env.NAME == 'rocky-8' }} + run: | + yum install -y yum-utils + yum config-manager --enable PowerTools || : + yum config-manager --enable powertools || : + + - name: Enable Code Ready Builer on Rocky 9. + if: ${{ matrix.env.NAME == 'rocky-9' }} + run: | + yum install -y yum-utils + yum config-manager --enable crb + + # For pkill + - name: Enable procps-ng on Centos and Rocky + if: ${{ startsWith(matrix.env.NAME, 'centos-') || startsWith(matrix.env.NAME, 'rocky-') }} + run: | + yum install -y procps-ng + + - name: Load RPMs + uses: actions/download-artifact@v3 + with: + name: rpms-${{ matrix.env.NAME }} + + - name: Install RPMs + run: | + yum install -y *.rpm + + - name: Config check + run: | + radiusd -XC + + # + # We now perform some post-install tests that depend on the availability + # of the source tree + # + - name: Install pre-built eapol_test + run: | + yum install -y libnl3 make gdb which + mv eapol_test /usr/local/bin + chmod +x /usr/local/bin/eapol_test + + - uses: actions/checkout@v3 + with: + path: freeradius + + - name: Run the post-install test target + run: | + echo "top_builddir := $(pwd)" > Make.inc + make -C src/tests/ OPENSSL_LIBS=1 EAPOL_TEST_BIN="$(which eapol_test)" $(pwd)/build/tests/eapol_test/eapol_test.mk + make -f scripts/ci/package-test.mk package-test + working-directory: freeradius + + - name: Upload radius logs on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: radius-logs-${{ matrix.env.NAME }}.tgz + path: | + /var/log/radius + freeradius/build/tests/eapol_test + + # + # See above comments for tmate + # + - name: "Debug: Package dependancies for tmate" + run: | + yum install -y xz + ln -s /bin/true /bin/apt-get + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + + - name: "Debug: Start tmate" + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + sudo: false + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..de5e7ed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,483 @@ +name: CI + +on: + push: + branches-ignore: + - coverity_scan + pull_request: + +env: + PANIC_ACTION: "gdb -batch -x raddb/panic.gdb %e %p 1>&0 2>&0" + ALT_OPENSSL: "3.0.8" + CI: 1 + GH_ACTIONS: 1 + DEBIAN_FRONTEND: noninteractive + APT_OPTS: "-y --no-install-recommends" + LDAP_TEST_SERVER: 127.0.0.1 + LDAP_TEST_SERVER_PORT: 3890 + REST_TEST_SERVER: 127.0.0.1 + REST_TEST_SERVER_PORT: 8080 + REST_TEST_SERVER_SSL_PORT: 8443 + SQL_MYSQL_TEST_SERVER: mariadb + SQL_POSTGRESQL_TEST_SERVER: postgres + ASAN_OPTIONS: symbolize=1 detect_leaks=1 detect_stack_use_after_return=1 + LSAN_OPTIONS: fast_unwind_on_malloc=0:malloc_context_size=50 + UBSAN_OPTIONS: print_stacktrace=1 + +jobs: + pre-ci: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + selfhosted: ${{ github.repository_owner == 'FreeRADIUS' && '1' || '0' }} + docker_prefix: ${{ github.repository_owner == 'FreeRADIUS' && 'docker.internal.networkradius.com/' || '' }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + + ci: + needs: pre-ci + if: ${{ needs.pre-ci.outputs.should_skip != 'true' }} + + runs-on: ${{ matrix.os.runs_on }} + + container: + image: ${{ matrix.os.docker }} + + strategy: + fail-fast: false + matrix: + os: +# +# runs_on - where GitHub will spin up the runner, either +# "self-hosted", or the name of a GitHub VM image. +# code - the name/version of the OS (for step evaluations below) +# docker - the docker image name, if containers are being used +# name - used in the job name only +# + - runs_on: "${{ needs.pre-ci.outputs.selfhosted == '1' && 'self-hosted' || 'ubuntu-20.04' }}" + docker: "${{ needs.pre-ci.outputs.selfhosted == '1' && 'docker.internal.networkradius.com/self-hosted' || 'ubuntu:20.04' }}" + name: "${{ needs.pre-ci.outputs.selfhosted == '1' && 'self' || 'gh' }}-ubuntu20" + code: "ubuntu2004" + + env: + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: no, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-gcc-lean } + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-gcc } + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: no, REPRODUCIBLE: yes, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-gcc-reproducible } + - { CC: gcc, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG -O2 -g3", NAME: linux-gcc-O2-g3 } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: no, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-clang-lean } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-clang } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: yes, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-clang-altlibs } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: no, REPRODUCIBLE: yes, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-clang-reproducible } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: yes, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG", NAME: linux-clang-sanitizer } + - { CC: clang, DO_BUILD: yes, LIBS_OPTIONAL: yes, LIBS_ALT: no, REPRODUCIBLE: no, SANITIZER: no, BUILD_CFLAGS: "-DWITH_EVAL_DEBUG -O2 -g3", NAME: linux-clang-O2-g3 } + + env: ${{ matrix.env }} + + # Test names are used in the branch protection rules in GitHub + # If you change the names here, or add additional matrix entries, you + # must also amend the branch protection fules. + name: "v3.2.x-${{ matrix.os.name }}-${{ matrix.env.NAME }}" + + # The standard GitHub environment contains PostgreSQL and + # MySQL already. However when running on hosted GitHub runners + # we need to run separate database containers to provide these. + services: + mariadb: + image: ${{ needs.pre-ci.outputs.docker_prefix }}mariadb + env: + MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10 + + postgres: + image: ${{ needs.pre-ci.outputs.docker_prefix }}postgres + env: + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + + - name: Self-hosted runner container fixes + run: | + ln -fs /usr/bin/env /usr/local/bin/sudo + rm -rf "$HOME"/* + + - name: Package manager performance improvements + run: | + sudo sh -c 'echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/02speedup' + if command -v mandb >/dev/null; then + echo 'man-db man-db/auto-update boolean false' | sudo debconf-set-selections + sudo dpkg-reconfigure man-db + fi + + - name: Freshen APT repo metadata + run: | + sudo apt-get update + + - name: Install common build dependencies + run: | + sudo apt-get install ${APT_OPTS} \ + autoconf \ + build-essential \ + debhelper \ + devscripts \ + dh-make \ + fakeroot \ + firebird-dev \ + freetds-dev \ + gawk \ + git \ + git-lfs \ + gnupg \ + libcap-dev \ + libcollectdclient-dev \ + libcurl4-openssl-dev \ + libgdbm-dev \ + libhiredis-dev \ + libidn11-dev \ + libiodbc2 \ + libiodbc2-dev \ + libjson-c-dev \ + libkqueue-dev \ + libkrb5-dev \ + libldap2-dev \ + libmemcached-dev \ + libmysqlclient-dev \ + libnl-3-dev \ + libnl-genl-3-dev \ + libpam0g-dev \ + libpcap-dev \ + libpcre3-dev \ + libperl-dev \ + libpq-dev \ + libreadline-dev \ + libruby \ + libsnmp-dev \ + libsqlite3-dev \ + libssl-dev \ + libtalloc-dev \ + libunbound-dev \ + libwbclient-dev \ + libykclient-dev \ + libyubikey-dev \ + lintian \ + pbuilder \ + python-dev \ + python3-dev \ + ruby-dev \ + snmp \ + software-properties-common \ + quilt + + - name: Install LLVM 15 for 20.04 + if: ${{ matrix.os.code == 'ubuntu2004' && matrix.env.CC == 'clang' }} + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add + sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" + sudo apt-get install ${APT_OPTS} clang-15 llvm-15 gdb libclang-rt-15-dev + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 60 && sudo update-alternatives --set clang /usr/bin/clang-15 + sudo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-15 60 && sudo update-alternatives --set llvm-symbolizer /usr/bin/llvm-symbolizer-15 + + - name: Install GCC + if: ${{ matrix.env.CC == 'gcc' }} + run: | + sudo apt-get install ${APT_OPTS} gcc gdb + + # + # Build using some alternative libraries + # + # MIT Kerberos -> HEIMDAL Kerberos + # OpenSSL 1.0 -> OpenSSL 3.0 + # + - name: 'Fetch OpenSSL 3.0 SHA' + id: opensslshasum + if: ${{ matrix.env.LIBS_ALT == 'yes' }} + run: | + wget -qO- http://www.openssl.org/source/openssl-$ALT_OPENSSL.tar.gz.sha256 | sed -ne 's/^\s\+/shasum=/p' >> $GITHUB_OUTPUT + + - name: 'Restore OpenSSL 3.0 from the cache' + if: ${{ matrix.env.LIBS_ALT == 'yes' }} + uses: actions/cache@v3 + id: openssl-cache + with: + path: /opt/openssl/ + key: openssl3-${{ steps.opensslshasum.outputs.shasum }} + + - name: 'Build OpenSSL 3.0 (if cache stale)' + if: ${{ matrix.env.LIBS_ALT == 'yes' && steps.openssl-cache.outputs.cache-hit != 'true' }} + run: | + cd ~ + wget https://www.openssl.org/source/openssl-$ALT_OPENSSL.tar.gz + tar xzf openssl-$ALT_OPENSSL.tar.gz + cd openssl-$ALT_OPENSSL + ./Configure --prefix=/opt/openssl --openssldir=. + make -j `nproc` + make install + + - name: Use alternative libraries + if: ${{ matrix.env.LIBS_ALT == 'yes' }} + run: | + echo /opt/openssl/lib64 | sudo tee /etc/ld.so.conf.d/openssl3.conf >/dev/null + sudo ldconfig + sudo apt-get install ${APT_OPTS} heimdal-dev + + - name: Show versions + run: | + printf "$CC: " ; $CC --version + printf "\nmake: " ; make --version + printf "\nkrb5: " ; krb5-config --all || : + [ -d /opt/openssl ] && export PATH=/opt/openssl/bin:$PATH + printf "\nopenssl: " ; openssl version + + - uses: actions/checkout@v3 + + - name: Build eapol_test + run: | + if [ -d /opt/openssl ]; then + # Used by scripts/ci/eapol_test-build.sh + export PATH=/opt/openssl/bin:$PATH + export EAPOL_TEST_CFLAGS="-I/opt/openssl/include" + export EAPOL_TEST_LDFLAGS="-L/opt/openssl/lib64" + fi + ./scripts/ci/eapol_test-build.sh + + - name: Build FreeRADIUS + run: | + export PATH=$(echo "$PATH" | sed -e 's#:/home/linuxbrew/[^:]\+##g') + if [ -d /opt/openssl ]; then + export PATH=/opt/openssl/bin:$PATH + CONFIG_OPENSSL="--with-openssl-lib-dir=/opt/openssl/lib64 --with-openssl-include-dir=/opt/openssl/include" + fi + + if [ $SANITIZER = "yes" ]; then + echo "Enabling sanitizers" + enable_sanitizers="--enable-address-sanitizer --enable-undefined-behaviour-sanitizer" + if [ "`uname`" != "Darwin" ]; then + enable_sanitizers="$enable_sanitizers --enable-leak-sanitizer" + fi + # TODO: libunbound is broken when built with LSAN/ASAN, let's disable it for now. + extra_cflags="--without-rlm_unbound" + + # Temporary hack just to skip and see the result. + # memory leak in rlm_{ldap,rest} and problems in perl+llvm + rm -rf src/tests/modules/ldap/ + rm -rf src/tests/modules/rest/ + else + enable_sanitizers="" + extra_cflags="" + fi + CFLAGS="${BUILD_CFLAGS}" ./configure -C \ + --enable-developer \ + ${enable_sanitizers} \ + $CONFIG_OPENSSL \ + $extra_cflags \ + --enable-werror \ + --prefix=$HOME/freeradius \ + --with-threads=$LIBS_OPTIONAL \ + --with-udpfromto=$LIBS_OPTIONAL \ + --with-openssl=$LIBS_OPTIONAL \ + --with-pcre=$LIBS_OPTIONAL \ + --enable-reproducible-builds=${REPRODUCIBLE} + make -j $(($(nproc) + 1)) + + - name: clang scan + run: | + make -j $(($(nproc) + 1)) scan && [ "$(find build/plist/ -name *.html)" = '' ] + if: ${{ matrix.env.CC == 'clang' }} + + - name: "Clang Static Analyzer: Store assets on failure" + uses: actions/upload-artifact@v3 + with: + name: clang-scan.tgz + path: build/plist/**/*.html + if: ${{ matrix.env.CC == 'clang' && failure() }} + + - name: Add OpenResty repository + shell: bash + run: | + wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add - + echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list + + sudo apt-get update + + - name: Setup git + shell: bash + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Install test requisites + run: | + # Temporarily replace ucf (for config merge) with cp since it's + # terribly slow! + sudo mv /usr/bin/ucf /usr/bin/ucf.disabled + sudo sh -c 'echo "#!/bin/sh" > /usr/bin/ucf' + sudo sh -c 'echo "shift && cp -v \$@" >> /usr/bin/ucf' + sudo chmod +x /usr/bin/ucf + + sudo apt-get install ${APT_OPTS} \ + apparmor-utils \ + ldap-utils \ + openresty \ + slapd + + sudo mv -f /usr/bin/ucf.disabled /usr/bin/ucf + + - name: Database dependencies + run: | + sudo apt-get install ${APT_OPTS} \ + mariadb-client \ + postgresql-client + + slapd + + - name: Build certificates for REST tests + run: | + cp -r raddb/certs raddb/restcerts + cd ./raddb/restcerts && make ca && make server + + - name: Setup test databases + run: | + for i in \ + postgresql-setup.sh \ + mysql-setup.sh \ + openresty-setup.sh \ + ldap-setup.sh \ + ldap2-setup.sh; do + + script="./scripts/ci/$i" + echo "Calling $i" + $script + done + + - name: Configure test database access + run: | + mysql -h mariadb -uroot -e "CREATE USER 'radius'@'%' IDENTIFIED BY 'radpass';" + mysql -u root -h mariadb -e "GRANT ALL ON radius.* TO 'radius'; FLUSH PRIVILEGES;" + + - name: Run tests + run: | + [ -d /opt/openssl ] && export PATH=/opt/openssl/bin:$PATH + + openssl dhparam -out ./raddb/certs/dh -2 128 || \ + openssl dhparam -out ./raddb/certs/dh -2 512 || \ + true + + make ci-test + + - name: Show debug logs on failure + if: ${{ failure() }} + run: | + cat src/tests/radius.log || : + + # + # If the CI has failed and the branch is ci-debug then start a tmate + # session. SSH rendezvous point is emited continuously in the job output. + # + - name: "Debug: Start tmate" + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }} + +########################################################################################## +# FREERADIUS CORE DEVELOPERS ONLY +########################################################################################## +# +# Direct push access to the main freeradius-server repo has been disabled in an attempt +# to keep CI passing reliably. +# +# The code below will automatically push to the main repository if a commit passes CI in +# your fork on a branch that exists in the main repository. +# +# The code below will only run if PERSONAL_ACCESS_TOKEN is defined in the repository +# secrets for your fork of the freeradius-server repo. +# +# If the above CI checks pass then we auto-merge into the same branch in the +# main FR repo (only on push) if the PERSONAL_ACCESS_TOKEN secret is defined, i.e. when +# the actor claims to be a FreeRADIUS developer with push access. +# +# Personal access tokens can be generated via the GitHub website: +# +# - Click on the Profile menu (top right) +# > Settings +# > Developer settings +# > Personal access tokens +# > Generate New Token +# - Next, add the following settings and scopes: +# Note: FreeRADIUS CI Push +# public_repo (checked) +# +# This will allow any git operations using this PERSONAL_ACCESS_TOKEN to commit code to any +# public repository you have access to. +# +# As this PERSONAL_ACCESS_TOKEN will only ever be accessible from GitHub actions when they are +# running from your fork of the FreeRADIUS repo, this shouldn't be a security issue. +# +# After generating your PERSONAL_ACCESS_TOKEN you will need to add it as a secret to your +# repository. +# +# - Copy your new token +# - Click on the Profile menu (top right) +# > Your repositories +# - Search for freeradius-server +# > Click freeradius-server +# - Click settings in the tabs on the left +# - Click secrets in the menu items on the left +# - Click New repository secret +# - Name: PERSONAL_ACCESS_TOKEN +# Value: +# - Click Add secret + # + # Needed because secrets are not available for evaluation in if conditions + # at the job level, so we evaluate the existence of the PERSONAL_ACCESS_TOKEN secret + # within a step and export the result instead. We also extract the short + # branch name here because it's convenient to do so. + # + merge-preflight: + needs: + - ci + if: ( github.event_name == 'push' ) && ( github.repository_owner != 'FreeRADIUS' ) && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v3.2.x' ) + name: "Merge preflight" + runs-on: ubuntu-latest + steps: + - name: "Report whether PERSONAL_ACCESS_TOKEN secret exists" + id: merge-preflight + run: | + [ -z "$PERSONAL_ACCESS_TOKEN" ] || echo "::set-output name=PERSONAL_ACCESS_TOKEN_EXISTS::1" + env: + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + outputs: + PERSONAL_ACCESS_TOKEN_EXISTS: ${{ steps.merge-preflight.outputs.PERSONAL_ACCESS_TOKEN_EXISTS }} + + merge-upstream: + needs: + - ci + - merge-preflight + if: needs.merge-preflight.outputs.PERSONAL_ACCESS_TOKEN_EXISTS == '1' + runs-on: ubuntu-latest + name: "Merge into upstream" + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + lfs: false + persist-credentials: false + # Note: This also opportunistically updates the developer's branch with commits from + # the main repository. + # This update may fail if the developer has pushed additional commits since the + # workflow started. This is normal, and we ignore the failure. + - name: "Merge into upstream dev branch and update local branch" + run: | + BRANCH=${GITHUB_REF#refs/heads/} + git remote add upstream https://$USERNAME:$REPO_KEY@github.com/FreeRADIUS/freeradius-server.git + git fetch --no-recurse-submodules upstream +refs/heads/*:refs/remotes/upstream/* +refs/tags/*:refs/tags/upstream/* + git checkout --progress --force -B upstream-branch "refs/remotes/upstream/$BRANCH" + git merge "$BRANCH" --ff-only + git push upstream "upstream-branch:$BRANCH" + git push origin "$BRANCH" || true + env: + USERNAME: ${{ github.actor }} + REPO_KEY: ${{ secrets.PERSONAL_ACCESS_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d0b46d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +*~ +*.o +*.a +*.buildinfo +*.changes +*.lo +*.loT +*.la +*.so +*.lai +*.bz2 +*.gz +*.sig +*.orig +*.rej +.libs +.depends +*.log +*.substvars +*-stamp +*.swp +*.cache +*.dist +*.dylib +*.rej +*.orig +*.dSYM +*.patch +.pc + +# Editor projects +*.kdev4 +*.cproject +*.project +*.bbprojectd + +# Exuberant ctags +tags + +# Local icon files +icon.png + +# OS specific cruft +.DS_Store + +# Certificates and signing requests +*.pem +*.der +*.csr +*.key + +# Autoconf and libtool output +build +config.status +*confdefs.h +*conftest* +*confcache +Make.inc +libtool +autom4te.cache +aclocal.m4 +config.guess +config.report +config.sub +config.h +src/main/radattr +src/modules/lib/ +warnings.txt + +# Analyzer output +/*.plist + +# rpm packages +rpmbuild/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e35729f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,95 @@ +language: c +compiler: + - clang + - gcc +sudo: false +cache: + apt: true +env: + global: + - PANIC_ACTION="gdb -batch -x raddb/panic.gdb %e %p 1>&0 2>&0" + - secure: "H+uQeyOgsIyXtIPPG2VzAG8S/8KYGHlHaWhdiNuz1LM3SMcEKoPqG6o/P+HO8HVvYnA6nelyGuEryV90UfuwGY9YC6A/pqPQvx/gXSso63Zt66XSaiZjulCSm9OV8EB3wyWF7VSQ/ZHcn+L01hIlsQXTqLprMaC33cM0FYPr9fY=" + matrix: + - DO_BUILD=yes LIBS_OPTIONAL=no LIBS_SHARED=yes REPRODUCIBLE=no BUILD_CFLAGS="-DWITH_EVAL_DEBUG" + - DO_BUILD=yes LIBS_OPTIONAL=yes LIBS_SHARED=yes REPRODUCIBLE=no BUILD_CFLAGS="-DWITH_EVAL_DEBUG" + - DO_BUILD=yes LIBS_OPTIONAL=yes LIBS_SHARED=yes REPRODUCIBLE=yes BUILD_CFLAGS="-DWITH_EVAL_DEBUG" + - DO_BUILD=yes LIBS_OPTIONAL=yes LIBS_SHARED=yes REPRODUCIBLE=no BUILD_CFLAGS="-DWITH_EVAL_DEBUG -O2 -g3" + - DO_BUILD=no +addons: + coverity_scan: + project: + name: FreeRADIUS/freeradius-server + version: v3.2.x + description: The FreeRADIUS server project + notification_email: freeradius-devel@lists.freeradius.org + build_command_prepend: ./configure + build_command: make + branch_pattern: coverity_scan + apt: + config: + retries: true + sources: + - couchbase-precise + packages: + - autoconf + - build-essential + - debhelper + - devscripts + - dh-make + - doxygen + - fakeroot + - gdb + - graphviz + - lintian + - pbuilder + - python-dev + - python3-dev + - quilt + - libruby + - ruby-dev + - libcollectdclient-dev + - firebird-dev + - freetds-dev + - libcap-dev + - libcouchbase2-libevent + - libcouchbase-dev + - libcurl4-openssl-dev + - libgdbm-dev + - libhiredis-dev + - libidn11-dev + - libiodbc2-dev libiodbc2 + - libjson0 + - libjson0-dev + - libkrb5-dev + - libldap2-dev + - libmemcached-dev + - libmysqlclient-dev + - libpam0g-dev + - libpcap-dev + - libpcre3-dev + - libperl-dev + - libpq-dev + - libreadline-dev + - libsnmp-dev + - libssl-dev + - libtalloc-dev + - libtalloc2-dbg + - libunbound-dev + - libwbclient-dev + - libykclient-dev + - libyubikey-dev +before_install: + - $CC --version +before_script: +# Configure the server + - if [ "${DO_BUILD}" = 'yes' ]; then CFLAGS="${BUILD_CFLAGS}" ./configure -C --enable-werror --prefix=$HOME/freeradius --with-shared-libs=$LIBS_SHARED --with-threads=$LIBS_OPTIONAL --with-udpfromto=$LIBS_OPTIONAL --with-openssl=$LIBS_OPTIONAL --with-pcre=$LIBS_OPTIONAL --enable-reproducible-builds=${REPRODUCIBLE}; fi + - if [ "${DO_BUILD}" = 'no' ]; then ./configure -C --without-modules; fi +# Build the server + - if [ "${DO_BUILD}" = 'yes' ]; then make -j8; fi +# Run CLANG analyzer if we're building with CLANG + - if [ "${DO_BUILD}" = 'yes' -a "${COVERITY_SCAN_BRANCH}" != 1 -a ${CC} = 'clang' ]; then make -j8 scan && [ "$(find build/plist/ -name *.html)" = '' ]; fi +script: + - if [ "${DO_BUILD}" = 'yes' -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then make ci-test; fi +# - if [ "${DO_BUILD}" = 'no' ]; then make deb; fi +# Build the doxygen documentation + - if [ "${DO_BUILD}" = 'no' ]; then cd doc/source; doxygen 3>&1 1>&2 2>&3 | grep -iv '^warning:' | tee doxygen_stderr.log && [ ! -n "$(cat doxygen_stderr.log)" ]; fi diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..4ae342a --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,28 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "/usr/include/**", + "${workspaceFolder}/src/**" + ], + "defines": [], + "compilerPath": "/usr/bin/clang", + "cStandard": "c11", + "cppStandard": "c++14", + "intelliSenseMode": "linux-clang-x64" + }, + { + "name": "Mac", + "includePath": [ + "${workspaceFolder}/src/**" + ], + "defines": [], + "compilerPath": "/usr/bin/clang", + "cStandard": "c11", + "cppStandard": "c++14", + "intelliSenseMode": "linux-clang-x64" + } + ], + "version": 4 +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..a8c6e49 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,52 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug (lldb)", + "program": "${workspaceFolder}/build/bin/local/radiusd", + "args": [ + "-X", + "-D", + "${workspaceFolder}/share", + "-d", + "${workspaceFolder}/raddb" + ], + "cwd": "${workspaceFolder}", + "env": { + "FR_LIBRARY_PATH": "${workspaceFolder}/build/lib/local/.libs", + "DEBUGGER_ATTACHED": "yes" + } + }, + { + "type": "cppdbg", + "request": "launch", + "name": "Debug (gdb)", + "program": "${workspaceFolder}/build/bin/local/radiusd", + "args": [ + "-X", + "-D", + "${workspaceFolder}/share", + "-d", + "${workspaceFolder}/raddb" + ], + "cwd": "${workspaceFolder}", + "environment": [ + { "name": "FR_LIBRARY_PATH", "value": "${workspaceFolder}/build/lib/local/.libs" }, + { "name": "LD_LIBRARY_PATH", "value": "${workspaceFolder}/build/lib/local/.libs" }, + { "name": "DEBUGGER_ATTACHED", "value": "yes" } + ], + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Set solib", + "text": "set solib-search-path ${workspaceFolder}" + } + ] + } + ] +} diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..28a0d87 --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,109 @@ +0.INTRODUCTION + + The FreeRADIUS project wouldn't exist without contributions from a significant number of developers. + + We greatly value all comments, defect reports, patches/pull-requests, but must balance individual + contributor's desires and practices against what's required for the project to operate efficiently. + + This document describes best practices when interacting with members of the FreeRADIUS project team + via GitHub. If you follow these guidelines, it is very likely that your question, bug report or pull + request will be acted on, and in a timely manor. + + If you choose to ignore these guidelines our response will be a link to this document. + + +1.GITHUB ISSUE TRACKER + + The GitHub issue tracker is for non-security related defect reports, feature requests, and + pull-requests ONLY. + + It is not for support requests or questions regarding configuration/operation of the server, they + belong on the users mailing list: + + https://freeradius.org/support/ + + Raising support requests or questions as issues will result in them being closed and locked. If you + continue to raise these questions as issues you will be banned from the FreeRADIUS project's GitHub + repositories. + + Security issues should be reported to security@freeradius.org, especially if they can be remotely + exploited. This ensures that patches can be developed before the exploit is made public. + + +2.BEFORE REPORTING A DEFECT + + Verify it's still present in the Git HEAD. Checkout the appropriate branch for the version of the + server you're working with as listed here (http://doc.freeradius.org), build the server, and attempt + to reproduce your issue. + + The ChangeLog (https://github.com/FreeRADIUS/freeradius-server/blob/v3.2.x/doc/ChangeLog) for the + current stable branch may also be used to determine if your issue has already been addressed. + The ChangeLog is updated as fixes are made to the server code, and usually reflects the state of the + Git HEAD. + + Do not report non-security defects for EOL branches (as listed on doc.freeradius.org), they will be + closed and locked. + + +3.CONTENTS OF A DEFECT REPORT + + See doc/bugs (https://github.com/FreeRADIUS/freeradius-server/blob/v3.2.x/doc/bugs) for information + on what to include, and how to obtain it. + + When logging bug reports using the GitHub issue tracker, pay attention to formatting. You should + ensure any log output is surrounded by two sets of tripple backticks (```). If you don't do this + Github will automatically link your issue to other pre-existing issues when it encounters a # + string. + + +4.PULL REQUESTS AND CODING STANDARDS + + If you're developing a new feature, module, or writing large amounts of code to fix a defect, contact + a member of the FreeRADIUS development team first. For simpler one or two line fixes, go ahead and + open a pull-request immediately. + + The dev team can be contacted via the devel mailing list (https://freeradius.org/support/), + or via GitHub by using the GitHub issue tracker. + + Contacting the dev team gives us the opportunity to offer feedback. We may have a solution to your + problem that doesn't require additional code, or may have ideas as to how your problem can be solved + in a way that will better fit with the long-term vision for the server. + + Once you've got the go ahead, read through the coding standards document: + + https://wiki.freeradius.org/contributing/coding-standards + + If you're creating a new module you may wish to read the module creation guide: + + https://wiki.freeradius.org/contributing/Modules3 + + You may also wish to utilise the doxygen site to review code documentation: + + http://doc.freeradius.org + + The doxygen site contains the complete reference of all API functions with doxygen headers, as well + as structs, and callback declarations. doc.freeradius.org is updated within one minute of each commit + to the master branch of the main freeradius-server repo. + + Finally, this file was written to be displayed automatically on the GitHub issue tracker, so + Git/GitHub knowledge is assumed. If you're wondering what the heck a pull-request is, this + document may be of some use: + + https://wiki.freeradius.org/contributing/GitHub + + +5.CONTINUOUS INTEGRATION TESTS + + If possible include test cases in your pull-requests. + + There are currently three test frameworks for different elements of the server: + + Unit tests - src/tests/unit/*.txt - Tests for conditions and protocol encoders/decoders. + Module tests - src/tests/modules/ - Tests for module functionality. + Unlang tests - src/tests/unlang/ - Tests for unlang keywords and functions. + + See README.* docs in the directories above for basic information on writing test cases. The easiest + way to write new tests is to use the existing tests as examples. + + Tests are run via a GitHub Actions workflow for each pull-request, and on every commit by a develope + with repository access. diff --git a/COPYRIGHT b/COPYRIGHT new file mode 100644 index 0000000..73f2555 --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1,95 @@ +1. COPYRIGHT + +Unless otherwise mentioned, the copyrights described in section 4, +below, apply to all files in this distribution. + +2. INDIVIDUAL DIRECTORIES + +2.1 doc/rfc/ + +Most of the files in this directory are copyrighted by the Internet +Society, Inc. See the contents of the files for details. + +2.2 src/lib/ + +Copyright for files in this directory is held by the contributors. +See the contents of the files for details + +2.2.1 LICENSE + +The license for all files in the src/lib directory is the GNU LGPL +version 2, which is included with this program in the file +src/lib/LICENSE. + +3. ALL OTHER FILES + +Copyright for files in this directory is held by the contributors. +See the contents of the files for details. Files without explicit +copyright notices are copyright The FreeRADIUS Server Project. See +section 4.2 for more information. + +3.1 LICENSE + +The license for all other source code and documentation except the +files in src/lib directory is the GNU GPL version 2, which is included +with this program in the LICENSE file in this directory. + +3.2 LIST OF COPYRIGHT HOLDERS + +Portions of the source code and documentation included here are +copyright by one or more of the following organizations and +individuals. This list is not exhaustive. Consult the individual +files for more detailed copyright statements. + + +Copyright (C) 1999-2021 The FreeRADIUS Server Project + +Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Alan DeKok + + +Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 Free +Software Foundation, Inc. + +Copyright (C) 2011-2015 Arran Cudbard-Bell + +Copyright (C) 2012-2018 Matthew Newton + +Copyright (C) 2003, 2004, 2005 Kostas Kalevras + +Copyright (C) 2004 Cladju Consulting, Inc. + +Copyright (C) 2001, 2002, 2003, 2004, 2005 Google, Inc. + +Copyright (C) 2003, 2004 Michael Richardson + +Copyright (C) 2002, 2003, 2004 Novell, Inc. + +Copyright (C) 2002 Miguel A.L. Paraz + +Copyright (C) 2002 Simon Ekstrand + +Copyright (C) 2001 Chad Miller + +Copyright (C) 2001 hereUare Communications, Inc. + +Copyright (C) 2000 Jochen Friedrich + +Copyright (C) 2000, 2002 Miquel van Smoorenburg + +Copyright (C) 2000 Jeff Carneal + +Copyright (C) 2000 Alan Curry + +Copyright (C) 2000 David Kerry + +Copyright (C) 2000 Dmitri Ageev + +Copyright (C) 2000 Nathan Neulinger + +Copyright (C) 2000 Mike Machado + +Copyright (C) 2000, 2001 Chad Miller + +Copyright (C) 1997, 1998, 1999 Cistron Internet Services B.V. + +Copyright (C) 1999 Kunihiro Ishiguro diff --git a/CREDITS b/CREDITS new file mode 100644 index 0000000..2dcb96b --- /dev/null +++ b/CREDITS @@ -0,0 +1,2 @@ +Please see: + https://wiki.freeradius.org/project/Acknowledgements diff --git a/INSTALL.rst b/INSTALL.rst new file mode 100644 index 0000000..6edb34d --- /dev/null +++ b/INSTALL.rst @@ -0,0 +1,169 @@ +Installation +============ + +1. INTRODUCTION +--------------- + +Ignore the installation instructions in this file if you have a +pre-installed binary package. When upgrading from older versions of +FreeRADIUS, you should read ALL of this file, especially the section +on "UPGRADING" below which gives information on how to update your +configuration. + +Whether you are installing from source or a pre-built binary +package, you should read the section below "RUNNING THE SERVER". + + +2. SIMPLE INSTALLATION +---------------------- + +If you do not need to modify the default configuration, then take +the following steps to build and install the server:: + + $ ./configure + $ make + $ make install + + +3. CUSTOM INSTALLATION +---------------------- + +FreeRADIUS has autoconf support. This means you have to run +``./configure``, and then run make. To see which configuration options +are supported, run ``./configure --help``, and read it's output. The +following list is a selection from the available flags:: + + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log] + --with-radacctdir=PATH Directory for detail files [LOGDIR/radacct] + --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] + --with-threads Use threads, if available. (default=yes) + --with-snmp Compile in SNMP support. (default=yes) + --with-dhcp Compile in DHCP support. (default=yes) + --with-experimental-modules Use experimental and unstable modules. + (default=no) + --enable-developer Turns on super-duper-extra-compile-warnings + when using gcc, as well as experimental modules. + +The ``make install`` stage will install the binaries, the 'man' pages, +and MAY install the configuration files. If you have not installed a +RADIUS server before, then the configuration files for FreeRADIUS will +be installed. If you already have a RADIUS server installed, then + +**FreeRADIUS WILL NOT over-write your current configuration.** + +The ``make install`` process will warn you about the files it could +not install. + +If you see a warning message about files that could not be +installed, then you MUST ensure that the new server is using the new +configuration files, and not the old configuration files. The initial +output from running in debugging mode (``radiusd -X``) will tell you which +configuration files are being used. See UPGRADING above for +information about upgrading from older versions. There MAY be changes +in the dictionary files which are REQUIRED for a new version of the +software. These files will NOT be installed over your current +configuration, so you MUST verify and install any problem files by +hand, for example using ``diff(1)`` to check for changes. + +It is EXTREMELY helpful to read the output of both ``./configure``, +``make``, and ``make install``. If a particular module you expected to be +installed was not installed, then the output of the +``./configure; make; make install`` sequence will tell you why that module +was not installed. Please do NOT post questions to the FreeRADIUS +users list without first carefully reading the output of this process. + + +4. UPGRADING +------------ + +The installation process will not over-write your existing +configuration files. It will, however, warn you about the files it +did not install. + +For users upgrading from any older version to 3.0, it is *NOT* +possible to use the older configuration as-is. However, the version +2.x configuration is largely compatible, so upgrading the +configuration should not be too difficult. For details on what has +changed, see ``raddb/README.rst``. + +We STRONGLY recommend that 3.0 be installed in a different location +than any existing 1.x or 2.x installation. Any local policies can +then be migrated gradually to the new 3.0 configuration. The number +of differences in the new configuration mean that is is both simpler +and safer to migrate your configurations rather than to try and just +get the old configuration to work. + + +5. RUNNING THE SERVER +--------------------- + +If the server builds and installs, but doesn't run correctly, then +you should use debugging mode (radiusd -X) to figure out the problem. + +This is your BEST HOPE for understanding the problem. Read ALL of +the messages which are printed to the screen, the answer to your +problem will often be in a warning or error message. + +We really can't emphasize that last sentence enough. Configuring a +RADIUS server for complex local authentication isn't a trivial task. +Your ONLY method for debugging it is to read the debug messages, where +the server will tell you exactly what it's doing, and why. You should +then compare its behaviour to what you intended, and edit the +configuration files as appropriate. + +If you don't use debugging mode, and ask questions on the mailing +list, then the responses will all tell you to use debugging mode. The +server prints out a lot of information in this mode, including +suggestions for fixes to common problems. Look especially for +"WARNING" in the output, and read the related messages. + +Since the main developers of FreeRADIUS use debugging mode to track +down their configuration problems with the server, it's a good idea +for you to use it, too. If you don't, there is little hope for you to +solve ANY configuration problem related to the server. + +To start the server in debugging mode, do:: + + $ radiusd -X + +You should see a lot of text printed on the screen as it starts up. +If you don't, or if you see error messages, please read the FAQ: + + http://www.freeradius.org/faq/ + +If the server says "Ready to process requests.", then it is running +properly. From another shell (or another window), type:: + + $ radtest test test localhost 0 testing123 + +You should see the server print out more messages as it receives the +request, and responds to it. The 'radtest' program should receive the +response within a few seconds. It doesn't matter if the +authentication request is accepted or rejected, what matters is that +the server received the request, and responded to it. + +You can now edit the configuration files for your local system. You +will usually want to start with ``sites-enabled/default``. To set +which NASes (clients) can communicate with this server, +edit ``clients.conf``. +Please read the configuration files carefully, as many configuration +options are only documented in comments in the file. + +Note that is is HIGHLY recommended that you use some sort of version +control system to manage your configuration, such as git or +Subversion. You should then make small changes to the configuration, +checking in and testing as you go. When a config change causes the +server to stop working, you will be able to easily step back and find +out what update broke the configuraiton. + +Configuring and running the server MAY be complicated. Many modules +have ``man`` pages. See ``man rlm_pap``, or ``man rlm_*`` for +information. +Please read the documentation in the doc/ directory. The comments in +the configuration files also contain a lot of documentation. + +If you have any additional issues, the FAQ is also a good place to +start. + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Make.inc.in b/Make.inc.in new file mode 100644 index 0000000..05f8277 --- /dev/null +++ b/Make.inc.in @@ -0,0 +1,186 @@ +# -*- makefile -*- +# Make.inc.in +# +# Version: $Id$ +# + +# Location of files. +prefix = @prefix@ +exec_prefix = @exec_prefix@ +sysconfdir = @sysconfdir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +bindir = @bindir@ +sbindir = @sbindir@ +docdir = @docdir@ +mandir = @mandir@ +datadir = @datadir@ +dictdir = @dictdir@ +logdir = @logdir@ +includedir = @includedir@ + +# +# In some systems, we don't want to over-write ANY configuration. +# So we do: +# +# $./configure +# $ make +# $ make -Draddbdir=/tmp/garbage install +# +# and all of the configuration files go into /tmp/garbage +# +ifeq "${raddbdir}" "" +raddbdir = @raddbdir@ +endif +modconfdir = @modconfdir@ +radacctdir = @radacctdir@ +top_builddir = @abs_top_builddir@ +top_build_prefix=@abs_top_builddir@/ +top_srcdir = @abs_top_srcdir@ +datarootdir = @datarootdir@ + +MAKE = @MAKE@ + +# Makeflags set within the makefile appear to be additive and override +# flags set on the command line and the environmental variables +MAKEFLAGS = @FR_MAKEFLAGS@ + +CC = @CC@ +RANLIB = @RANLIB@ +INCLUDE = -I. -Isrc \ + -include src/freeradius-devel/autoconf.h \ + -include src/freeradius-devel/build.h \ + -include src/freeradius-devel/features.h \ + -include src/freeradius-devel/radpaths.h +CFLAGS = $(INCLUDE) -fno-strict-aliasing @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LIBPREFIX = @LIBPREFIX@ +EXEEXT = @EXEEXT@ + +LIBTOOL = JLIBTOOL +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +INSTALL = ${top_builddir}/install-sh -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL_PROGRAM} +INSTALLSTRIP = @INSTALLSTRIP@ + +# +# Linker arguments for libraries searched for by the main +# configure script. +# +TALLOC_LIBS = @TALLOC_LIBS@ +TALLOC_LDFLAGS = @TALLOC_LDFLAGS@ + +OPENSSL_LIBS = @OPENSSL_LIBS@ +OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ +OPENSSL_CPPFLAGS = @OPENSSL_CPPFLAGS@ + +PCAP_LIBS = @PCAP_LIBS@ +PCAP_LDFLAGS = @PCAP_LDFLAGS@ + +COLLECTDC_LIBS = @COLLECTDC_LIBS@ +COLLECTDC_LDFLAGS = @COLLECTDC_LDFLAGS@ + +SYSTEMD_LIBS = @SYSTEMD_LIBS@ +SYSTEMD_LDFLAGS = @SYSTEMD_LDFLAGS@ + +LCRYPT = @CRYPTLIB@ + +# +# OpenSSL libs (if used) must be linked everywhere in order for +# the server to work properly on on all platforms. +# +LIBS = $(OPENSSL_LIBS) $(TALLOC_LIBS) @LIBS@ +LDFLAGS = $(OPENSSL_LDFLAGS) $(TALLOC_LDFLAGS) @LDFLAGS@ + +LOGDIR = ${logdir} +RADDBDIR = ${raddbdir} +RUNDIR = ${localstatedir}/run/radiusd +SBINDIR = ${sbindir} +RADIR = ${radacctdir} +LIBRADIUS = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la $(TALLOC_LIBS) + +USE_SHARED_LIBS = @USE_SHARED_LIBS@ +bm_shared_libs = @USE_SHARED_LIBS@ +USE_STATIC_LIBS = @USE_STATIC_LIBS@ +bm_static_libs = @USE_STATIC_LIBS@ + +STATIC_MODULES = @STATIC_MODULES@ +LIBREADLINE = @LIBREADLINE@ + +WITH_DHCP = @WITH_DHCP@ + +# +# Version to use for packaging and other Make related things +# +RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@ + +# +# This allows dlopen to do runtime checks for version mismatches +# between what it was originally linked with, and the library it's +# actually loading. +# +MODULES = @MODULES@ +HOSTINFO = @HOSTINFO@ + +# +# If the system has OpenSSL, use it's version of MD4/MD5/SHA1, instead of +# using ours. +# +# We don't use OpenSSL SHA1 by default because src/modules/rlm_eap/libeap/fips186prf.c +# needs access to the SHA internals. +# +ifeq "$(WITH_OPENSSL)" "yes" +CFLAGS += -DWITH_OPENSSL_MD4 -DWITH_OPENSSL_MD5 +CPPFLAGS := "$(OPENSSL_CPPFLAGS) $(CPPFLAGS)" +endif + +OPENSSL_LIBS = @OPENSSL_LIBS@ + +ifneq ($(WITH_OPENSSL_MD5),) +LIBRADIUS_WITH_OPENSSL = 1 +CFLAGS += -DWITH_OPENSSL_MD5 +endif + +ifneq ($(WITH_OPENSSL_SHA1),) +LIBRADIUS_WITH_OPENSSL = 1 +CFLAGS += -DWITH_OPENSSL_SHA1 +endif + +ifneq ($(LIBRADIUS_WITH_OPENSSL),) +ifeq ($(OPENSSL_LIBS),) +$(error OPENSSL_LIBS must be define in order to use WITH_OPENSSL_*) +else +LIBRADIUS += $(OPENSSL_LIBS) +endif +endif + +# Path to clang, setting this enables the 'scan.*' build targets +# which perform static analysis on various server components. +ANALYZE.c := @clang_path@ + +# +# With shared libs, the test binaries are in a different place +# AND the method we use to run those binaries changes. +# +ifeq "$(USE_SHARED_LIBS)" "yes" + TESTBINDIR = ./$(BUILD_DIR)/bin/local + TESTBIN = FR_LIBRARY_PATH=./build/lib/.libs $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR) +else + TESTBINDIR = ./$(BUILD_DIR)/bin + TESTBIN = ./$(BUILD_DIR)/bin +endif + + +# +# For creating documentation via doc/all.mk +# +ASCIIDOCTOR := @ASCIIDOCTOR@ +PANDOC := @PANDOC@ +PANDOC_ENGINE := @PANDOC_ENGINE@ +DOXYGEN := @DOXYGEN@ +GRAPHVIZ_DOT := @GRAPHVIZ_DOT@ +ANTORA := @ANTORA@ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..60e183c --- /dev/null +++ b/Makefile @@ -0,0 +1,401 @@ +# +# Makefile +# +# NOTE: This top-level Makefile must not +# use GNU-make extensions. The lower ones can. +# +# Version: $Id$ +# + +# +# If we didn't call ./configure just define the version. +# +RADIUSD_VERSION_STRING := $(shell cat VERSION) + +# +# The default rule is "all". +# +all: + +# +# Catch people who try to use BSD make +# +ifeq "0" "1" +.error GNU Make is required to build FreeRADIUS +endif + +# +# We require Make.inc, UNLESS the target is "make deb" +# +# Since "make deb" re-runs configure... there's no point in +# requiring the developer to run configure *before* making +# the debian packages. +# +ifneq "$(MAKECMDGOALS)" "deb" +ifneq "$(MAKECMDGOALS)" "rpm" +ifeq "$(findstring docker,$(MAKECMDGOALS))" "" +ifeq "$(findstring crossbuild,$(MAKECMDGOALS))" "" +$(if $(wildcard Make.inc),,$(error Missing 'Make.inc' Run './configure [options]' and retry)) + +include Make.inc +endif +endif +endif +endif + +MFLAGS += --no-print-directory + +# +# The version of GNU Make is too old, don't use it (.FEATURES +# variable was added in 3.81) +# +ifndef .FEATURES +$(error The build system requires GNU Make 3.81 or later.) +endif + +export DESTDIR := $(R) + +# +# And over-ride all of the other magic. +# +ifneq "$(MAKECMDGOALS)" "deb" +ifneq "$(MAKECMDGOALS)" "rpm" +ifeq "$(findstring docker,$(MAKECMDGOALS))" "" +ifeq "$(findstring crossbuild,$(MAKECMDGOALS))" "" +include scripts/boiler.mk +endif +endif +endif +endif + +# +# To work around OpenSSL issues within CI. +# +.PHONY: +raddb/test.conf: + @echo 'security {' >> $@ + @echo ' allow_vulnerable_openssl = yes' >> $@ + @echo '}' >> $@ + @echo '$$INCLUDE radiusd.conf' >> $@ + +# +# Run "radiusd -C", looking for errors. +# +# Only redirect STDOUT, which should contain details of why the test failed. +# Don't molest STDERR as this may be used to receive output from a debugger. +# +$(BUILD_DIR)/tests/radiusd-c: raddb/test.conf ${BUILD_DIR}/bin/radiusd | build.raddb + ${Q}$(MAKE) -C raddb/certs + ${Q}printf "radiusd -C... " + ${Q}if ! $(TESTBIN)/radiusd -XCMd ./raddb -D ./share -n test > $(BUILD_DIR)/tests/radiusd.config.log; then \ + rm -f raddb/test.conf; \ + cat $(BUILD_DIR)/tests/radiusd.config.log; \ + echo "fail"; \ + exit 1; \ + fi + ${Q}rm -f raddb/test.conf + ${Q}echo "ok" + ${Q}touch $@ + +test: ${BUILD_DIR}/bin/radiusd ${BUILD_DIR}/bin/radclient tests.unit tests.xlat tests.keywords tests.modules tests.auth test.sql_nas_table $(BUILD_DIR)/tests/radiusd-c | build.raddb + ${Q}$(MAKE) -C src/tests tests + +# +# Tests specifically for CI. We do a LOT more than just +# the above tests +# +ci-test: raddb/test.conf test + ${Q}$(TESTBIN)/radiusd -xxxv -n test + ${Q}rm -f raddb/test.conf + ${Q}$(MAKE) install + ${Q}perl -p -i -e 's/allow_vulnerable_openssl = no/allow_vulnerable_openssl = yes/' ${raddbdir}/radiusd.conf + ${Q}sh ${HOME}/freeradius/etc/raddb/certs + ${Q}${sbindir}/radiusd -XC + +# +# The $(R) is a magic variable not defined anywhere in this source. +# It's purpose is to allow an admin to create an installation 'tar' +# file *without* actually installing it. e.g.: +# +# $ R=/home/root/tmp make install +# $ cd /home/root/tmp +# $ tar -cf ~/freeradius-package.tar * +# +# The 'tar' file can then be un-tar'd on any similar machine. It's a +# cheap way of creating packages, without using a package manager. +# Many of the platform-specific packaging tools use the $(R) variable +# when creating their packages. +# +# For compatibility with typical GNU packages (e.g. as seen in libltdl), +# we make sure DESTDIR is defined. +# +export DESTDIR := $(R) + +DICTIONARIES := $(wildcard share/dictionary*) +install.share: $(addprefix $(R)$(dictdir)/,$(notdir $(DICTIONARIES))) + +.PHONY: dictionary.format +dictionary.format: $(DICTIONARIES) + ${Q}./share/format.pl $(DICTIONARIES) + +$(R)$(dictdir)/%: share/% + @echo INSTALL $(notdir $<) + ${Q}$(INSTALL) -m 644 $< $@ + +MANFILES := $(wildcard man/man*/*.?) +MANDIR := $(wildcard man/man*) +install.man: $(subst man/,$(R)$(mandir)/,$(MANFILES)) + +$(MANDIR): + ${Q}echo INSTALL $(patsubst $(R)$(mandir)/%,man/%,$@) + ${Q}$(INSTALL) -d -m 755 $@ + +$(R)$(mandir)/%: man/% | $(dir $@) + ${Q}echo INSTALL $(notdir $<) + ${Q}sed -e "s,/etc/raddb,$(raddbdir),g" \ + -e "s,/usr/local/share,$(datarootdir),g" \ + $< > $<.subst + ${Q}$(INSTALL) -m 644 $<.subst $@ + ${Q}rm $<.subst + +# +# Don't install rlm_test +# +ALL_INSTALL := $(patsubst %rlm_test.la,,$(ALL_INSTALL)) + +install: install.share install.man + ${Q}$(INSTALL) -d -m 700 $(R)$(logdir) + ${Q}$(INSTALL) -d -m 700 $(R)$(radacctdir) + +ifneq ($(RADMIN),) +ifneq ($(RGROUP),) +.PHONY: install-chown +install-chown: + chown -R $(RADMIN) $(R)$(raddbdir) + chgrp -R $(RGROUP) $(R)$(raddbdir) + chmod u=rwx,g=rx,o= `find $(R)$(raddbdir) -type d -print` + chmod u=rw,g=r,o= `find $(R)$(raddbdir) -type f -print` + chown -R $(RADMIN) $(R)$(logdir) + chgrp -R $(RGROUP) $(R)$(logdir) + find $(R)$(logdir) -type d -exec chmod u=rwx,g=rwx,o= {} \; + find $(R)$(logdir) -type d -exec chmod g+s {} \; + find $(R)$(logdir) -type f -exec chmod u=rw,g=rw,o= {} \; + chown -R $(RADMIN) $(R)$(RUNDIR) + chgrp -R $(RGROUP) $(R)$(RUNDIR) + find $(R)$(RUNDIR) -type d -exec chmod u=rwx,g=rwx,o= {} \; + find $(R)$(RUNDIR) -type d -exec chmod g+s {} \; + find $(R)$(RUNDIR) -type f -exec chmod u=rw,g=rw,o= {} \; +endif +endif + +distclean: clean + @-find src/modules -regex .\*/config[.][^.]*\$$ -delete + @-find src/modules -name autom4te.cache -exec rm -rf '{}' \; + @rm -rf config.cache config.log config.status libtool \ + src/include/radpaths.h src/include/stamp-h \ + libltdl/config.log libltdl/config.status \ + libltdl/libtool autom4te.cache build + @-find . ! -name configure.ac -name \*.in -print | \ + sed 's/\.in$$//' | \ + while read file; do rm -f $$file; done + +###################################################################### +# +# Automatic remaking rules suggested by info:autoconf#Automatic_Remaking +# +###################################################################### +# +# Do these checks ONLY if we're re-building the "configure" +# scripts, and ONLY the "configure" scripts. If we leave +# these rules enabled by default, then they're run too often. +# +ifeq "$(MAKECMDGOALS)" "reconfig" + +CONFIGURE_AC_FILES := $(shell find . -name configure.ac -print) +CONFIGURE_FILES := $(patsubst %.ac,%,$(CONFIGURE_AC_FILES)) + +# +# The GNU tools make autoconf=="missing autoconf", which then returns +# 0, even when autoconf doesn't exist. This check is to ensure that +# we run AUTOCONF only when it exists. +# +AUTOCONF_EXISTS := $(shell autoconf --version 2>/dev/null) + +ifeq "$(AUTOCONF_EXISTS)" "" +$(error You need to install autoconf to re-build the "configure" scripts) +endif + +# Configure files depend on ".ac" files, and on the top-level macro files +# If there are headers, run auto-header, too. +src/%configure: src/%configure.ac acinclude.m4 aclocal.m4 $(wildcard $(dir $@)m4/*m4) | src/freeradius-devel + @echo AUTOCONF $(dir $@) + ${Q}cd $(dir $@) && \ + $(ACLOCAL) --force -I $(top_builddir) -I $(top_builddir)/m4 && \ + $(AUTOCONF) --force + ${Q}if grep AC_CONFIG_HEADERS $@ >/dev/null; then\ + echo AUTOHEADER $@ \ + cd $(dir $@) && $(AUTOHEADER) --force; \ + fi + +# "%configure" doesn't match "configure" +configure: configure.ac $(wildcard ac*.m4) $(wildcard m4/*.m4) + @echo AUTOCONF $@ + @$(ACLOCAL) --force + @$(AUTOCONF) --force + +src/include/autoconf.h.in: configure.ac + @echo AUTOHEADER $@ + @$(AUTOHEADER) --force + +reconfig: $(CONFIGURE_FILES) src/include/autoconf.h.in + +config.status: configure + ./config.status --recheck + +# target is "reconfig" +endif + +# +# If we've already run configure, then add rules which cause the +# module-specific "all.mk" files to depend on the mk.in files, and on +# the configure script. +# +ifneq "$(wildcard config.log)" "" +CONFIGURE_ARGS := $(shell head -10 config.log | grep '^ \$$' | sed 's/^....//;s:.*configure ::') + +src/%all.mk: src/%all.mk.in src/%configure + ${Q}echo CONFIGURE $(dir $@) + ${Q}rm -f ./config.cache $(dir $<)/config.cache + ${Q}cd $(dir $<) && ./configure $(CONFIGURE_ARGS) && touch $(notdir $@) +endif + +.PHONY: check-includes +check-includes: + scripts/min-includes.pl `find . -name "*.c" -print` + +.PHONY: TAGS +TAGS: + etags `find src -type f -name '*.[ch]' -print` > $@ + +# +# Make test certificates. +# +.PHONY: certs +certs: + ${Q}$(MAKE) -C raddb/certs + +###################################################################### +# +# Make a release. +# +# Note that "Make.inc" has to be updated with the release number +# BEFORE running this command! +# +###################################################################### +BRANCH = $(shell git rev-parse --abbrev-ref HEAD) + +freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz: .git/HEAD + git archive --format=tar --prefix=freeradius-server-$(RADIUSD_VERSION_STRING)/ $(BRANCH) | gzip > $@ + +freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2: .git/HEAD + git archive --format=tar --prefix=freeradius-server-$(RADIUSD_VERSION_STRING)/ $(BRANCH) | bzip2 > $@ + +%.sig: % + gpg --default-key packages@freeradius.org -b $< + +# +# High-level targets +# +.PHONY: dist-check +dist-check: redhat/freeradius.spec suse/freeradius.spec debian/changelog + ${Q}if [ `grep ^Version: redhat/freeradius.spec | sed 's/.*://;s/ //g'` != "$(RADIUSD_VERSION_STRING)" ]; then \ + cat redhat/freeradius.spec | sed 's/^Version:.*/Version: $(RADIUSD_VERSION_STRING)/' > redhat/.foo; \ + mv redhat/.foo redhat/freeradius.spec; \ + echo redhat/freeradius.spec 'Version' needs to be updated; \ + exit 1; \ + fi + ${Q}if [ `grep ^Version: suse/freeradius.spec | sed 's/.*://;s/ //g'` != "$(RADIUSD_VERSION_STRING)" ]; then \ + cat suse/freeradius.spec | sed 's/^Version: .*/Version: $(RADIUSD_VERSION_STRING)/' > suse/.foo; \ + mv suse/.foo suse/freeradius.spec; \ + echo suse/freeradius.spec 'Version' needs to be updated; \ + exit 1; \ + fi + ${Q}if [ `head -n 1 doc/ChangeLog | awk '/^FreeRADIUS/{print $$2}'` != "$(RADIUSD_VERSION_STRING)" ]; then \ + echo doc/ChangeLog needs to be updated; \ + exit 1; \ + fi + ${Q}if [ `head -n 1 debian/changelog | sed 's/.*(//;s/-0).*//;s/-1).*//;s/\+.*//'` != "$(RADIUSD_VERSION_STRING)" ]; then \ + echo debian/changelog needs to be updated; \ + exit 1; \ + fi + ${Q}if [ `grep version doc/antora/antora.yml | sed 's/^.*version: //'` != "'$(RADIUSD_VERSION_STRING)'" ]; then \ + echo doc/antora/antora.yml needs to be updated with: version '$(RADIUSD_VERSION_STRING)'; \ + exit 1; \ + fi + +dist: dist-check freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 + +dist-sign: dist-check freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2.sig + +dist-publish: freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2.sig + scp $^ freeradius.org@ftp.freeradius.org:public_ftp + +# +# Note that we do NOT do the tagging here! We just print out what +# to do! +# +dist-tag: freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 + ${Q}echo "git tag release_`echo $(RADIUSD_VERSION_STRING) | tr .- __`" + +# +# Docker-related targets (main Docker images and crossbuild) +# +ifneq "$(findstring docker,$(MAKECMDGOALS))" "" +include scripts/docker/docker.mk +endif + +ifneq "$(findstring crossbuild,$(MAKECMDGOALS))" "" +include scripts/crossbuild/crossbuild.mk +endif + +# +# Build a Debian package +# +DEBBUILDEXTRA = --jobs=auto +.PHONY: deb +deb: + fakeroot debian/rules debian/control #clean + fakeroot dpkg-buildpackage $(DEBBUILDEXTRA) -b -uc + +# +# Build an RPM package +# +.PHONY: rpm +rpmbuild/SOURCES/freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2: freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 + ${Q}mkdir -p $(addprefix rpmbuild/,SOURCES SPECS BUILD RPMS SRPMS BUILDROOT) + ${Q}for file in `awk '/^Source...:/ {print $$2}' redhat/freeradius.spec` ; do cp redhat/$$file rpmbuild/SOURCES/$$file ; done + ${Q}cp $< $@ + +rpm: rpmbuild/SOURCES/freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 + ${Q}if ! yum-builddep -q -C --assumeno redhat/freeradius.spec 1> /dev/null 2>&1; then \ + echo "ERROR: Required depdendencies not found, install them with: yum-builddep redhat/freeradius.spec"; \ + exit 1; \ + fi + ${Q}QA_RPATHS=0x0003 rpmbuild --define "_topdir `pwd`/rpmbuild" -bb redhat/freeradius.spec + +# +# Developer checks +# +.PHONY: warnings +warnings: + ${Q}(make clean all 2>&1) | egrep -v '^/|deprecated|^In file included|: In function| from |^HEADER|^CC|^LN|^LINK' > warnings.txt + ${Q}@wc -l warnings.txt + +# +# Ensure we're using tabs in the configuration files, +# and remove trailing whitespace in source files. +# +.PHONY: whitespace +whitespace: + ${Q}for x in $$(git ls-files raddb/ src/); do unexpand $$x > $$x.bak; cp $$x.bak $$x; rm -f $$x.bak;done + ${Q}perl -p -i -e 'trim' $$(git ls-files src/) diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..75cc11c --- /dev/null +++ b/README.rst @@ -0,0 +1,179 @@ +The FreeRADIUS server +===================== + +|BuildStatus|_ |CoverityStatus|_ + +.. contents:: + :local: + +Introduction +------------ + +The FreeRADIUS Server Project is a high performance and highly +configurable multi-protocol policy server, supporting RADIUS, DHCPv4 +and VMPS. It is available under the terms of the GNU GPLv2. +Using RADIUS allows authentication and authorization for a network +to be centralized, and minimizes the number of changes that have to +be done when adding or deleting new users to a network. + +FreeRADIUS can authenticate users on systems such as 802.1X (WiFi), +dialup, PPPoE, VPN's, VoIP, and many others. It supports back-end +databases such as MySQL, PostgreSQL, Oracle, Microsoft Active +Directory, Redis, OpenLDAP, and many more. It is used daily to +authenticate the Internet access for hundreds of millions of people, +in sites ranging from 10 to 10 million+ users. + +Version 3.0 of the server is largely compatible with version 2.x, but +we highly recommend that you recreate your configuration, rather than +trying to get the older configuration to work. + +For a list of changes in version 3.0, please see ``doc/ChangeLog``. + +See ``raddb/README.rst`` for information on what to do to update your +configuration. + +Administrators upgrading from a previous version should install this +version in a different location from their existing systems. Any +existing configuration should be carefully migrated to the new +version, in order to take advantage of the new features which can +greatly simply configuration. + +Please see https://freeradius.org and https://wiki.freeradius.org for +more information. + + +Installation +------------ + +To install the server, please see the INSTALL file in this directory. + +Configuring the server +---------------------- + +We understand that the server may be difficult to configure, +install, or administer. It is, after all, a complex system with many +different configuration possibilities. + +The most common problem is that people change large amounts of the +configuration without understanding what they're doing, and without +testing their changes. The preferred method of operation is the +following: + +1. Start off with the default configuration files. +2. Save a copy of the default configuration: It WORKS. Don't change it! +3. Verify that the server starts - in debugging mode (``radiusd -X``). +4. Send it test packets using "radclient", or a NAS or AP. +5. Verify that the server does what you expect + + - If it does not work, change the configuration, and go to step (3) + - If you're stuck, revert to using the "last working" configuration. + - If it works, proceed to step (6). + +6. Save a copy of the working configuration, along with a note of what + you changed, and why. +7. Make a SMALL change to the configuration. +8. Repeat from step (3). + +This method will ensure that you have a working configuration that +is customized to your site as quickly as possible. While it may seem +frustrating to proceed via a series of small steps, the alternative +will always take more time. The "fast and loose" way will be MORE +frustrating than quickly making forward progress! + +Debugging the Server +-------------------- + +Run the server in debugging mode, (``radiusd -X``) and READ the output. +We cannot emphasize this point strongly enough. The vast majority of +problems can be solved by carefully reading the debugging output, +which includes WARNINGs about common issues, and suggestions for how +they may be fixed. + +Many questions are answered on the Wiki: + +https://wiki.freeradius.org + +Read the configuration files. Many parts of the server are +documented only with extensive comments in the configuration files. + +Search the mailing lists. For example, using Google, searching +"site:lists.freeradius.org " will return results from +the FreeRADIUS mailing lists. + +https://freeradius.org/support/ + + +Feedback, Defects, and Community Support +---------------------------------------- + +If you have any comments, or are having difficulty getting FreeRADIUS +to do what you want, please post to the 'freeradius-users' list +(see the URL above). The FreeRADIUS mailing list is operated, and +contributed to, by the FreeRADIUS community. Users of the list will be +more than happy to answer your questions, with the caveat that you've +read documentation relevant to your issue first. + +If you suspect a defect in the server, would like to request a feature, +or submit a code patch, please use the GitHub issue tracker for the +freeradius-server `repository +`_. However, it +is nearly always best to raise the issue on the mailing lists +first to determine whether it really is a defect or missing +feature. + +Instructions for gathering data for defect reports can be found in +``doc/bugs`` or on the `wiki +`_. + +Under no circumstances should the issue tracker be used for support +requests, those questions belong on the user's mailing list. If you +post questions related to the server in the issue tracker, the issue +will be closed and locked. If you persist in positing questions to +the issue tracker you will be banned from all FreeRADIUS project +repositories on GitHub. + +Please do NOT complain that the developers aren't answering your +questions quickly enough, or aren't fixing the problems quickly +enough. Please do NOT complain if you're told to go read +documentation. We recognize that the documentation isn't perfect, but +it *does* exist, and reading it can solve most common questions. + +FreeRADIUS is the cumulative effort of many years of work by many +people, and you've gotten it for free. No one is getting paid to answer +your questions. This is free software, and the only way it gets better +is if you make a contribution back to the project ($$, code, or +documentation). + +We will note that the people who get most upset about any answers to +their questions usually do not have any intention of contributing to +the project. We will repeat the comments above: no one is getting +paid to answer your questions or to fix your bugs. If you don't like +the responses you are getting, then fix the bug yourself, or pay +someone to address your concerns. Either way, make sure that any fix +is contributed back to the project so that no one else runs into the +same issue. + +Books on RADIUS +--------------- + +See ``doc/README`` for more information about FreeRADIUS. + +There is an O'Reilly book available. It serves as a good +introduction for anyone new to RADIUS. However, it is almost 20 years +old, and is not much more than a basic introduction to the subject. + +https://www.amazon.com/exec/obidos/ASIN/0596003226/freeradiusorg-20/ + +Commercial support +------------------ + +Technical support, managed systems support, custom deployments, +sponsored feature development and many other commercial services +are available from `Network RADIUS `_. + + +.. |CoverityStatus| image:: https://scan.coverity.com/projects/58/badge.svg? +.. _CoverityStatus: https://scan.coverity.com/projects/58 + +.. |BuildStatus| image:: https://github.com/FreeRADIUS/freeradius-server/workflows/CI/badge.svg?branch=v3.2.x +.. _BuildStatus: https://github.com/FreeRADIUS/freeradius-server/actions?query=workflow%3ACI diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..b347b11 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +3.2.3 diff --git a/config.guess b/config.guess new file mode 100644 index 0000000..f772702 --- /dev/null +++ b/config.guess @@ -0,0 +1,1701 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2021 Free Software Foundation, Inc. + +timestamp='2021-01-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +me=$(echo "$0" | sed -e 's,.*/,,') + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2021 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown +UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown +UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown +UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + EOF + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)) + case "$UNAME_MACHINE_ARCH" in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') + endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi-}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') + ;; + *5.*) + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "$( (/bin/universe) 2>/dev/null)" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case $(/usr/bin/uname -p) in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + exit ;; + sun4*:SunOS:*:*) + case "$(/usr/bin/arch -k)" in + Series*|S4*) + UNAME_RELEASE=$(uname -v) + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "$(/bin/arch)" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && + SYSTEM_NAME=$("$dummy" "$dummyarg") && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=$(/usr/bin/uname -p) + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=$(/usr/bin/oslevel) + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if test -x /usr/bin/lslpp ; then + IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if test -x /usr/bin/getconf; then + sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) + sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if test "$HP_ARCH" = hppa2.0w + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=$(uname -p) + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + fi + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=$(/usr/bin/uname -p) + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-pc-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + exit ;; + *:GNU:*:*) + # the GNU system + echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" + exit ;; + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI="$LIBC"x32 + fi + fi + echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case $(/bin/uname -X | grep "^Machine") in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=$( (uname -p) 2>/dev/null) + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=$(uname -p) + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=$(uname -p) + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + # shellcheck disable=SC2154 + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=$( (uname -p) 2>/dev/null) + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; +esac + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown) +uname -r = $( (uname -r) 2>/dev/null || echo unknown) +uname -s = $( (uname -s) 2>/dev/null || echo unknown) +uname -v = $( (uname -v) 2>/dev/null || echo unknown) + +/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) +/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) + +hostinfo = $( (hostinfo) 2>/dev/null) +/bin/universe = $( (/bin/universe) 2>/dev/null) +/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) +/bin/arch = $( (/bin/arch) 2>/dev/null) +/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) +/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub new file mode 100644 index 0000000..0cbdae6 --- /dev/null +++ b/config.sub @@ -0,0 +1,1855 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2021 Free Software Foundation, Inc. + +timestamp='2021-01-01' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=$(echo "$0" | sed -e 's,.*/,,') + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2021 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +# shellcheck disable=SC2162 +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=$(echo "$1" | sed -e 's/86.*/86/') + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=$(echo "$basic_machine" | sed 's/-.*//') + ;; + + *-*) + # shellcheck disable=SC2162 + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x$basic_os != x +then + +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|') + ;; + os2-emx) + kernel=os2 + os=$(echo $basic_os | sed -e 's|os2-emx|emx|') + ;; + nto-qnx*) + kernel=nto + os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|') + ;; + *-*) + # shellcheck disable=SC2162 + IFS="-" read kernel os <&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos*) + vendor=sun + ;; + *-cnk* | *-aix*) + vendor=ibm + ;; + *-beos*) + vendor=be + ;; + *-hpux*) + vendor=hp + ;; + *-mpeix*) + vendor=hp + ;; + *-hiux*) + vendor=hitachi + ;; + *-unos*) + vendor=crds + ;; + *-dgux*) + vendor=dg + ;; + *-luna*) + vendor=omron + ;; + *-genix*) + vendor=ns + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; + *-aux*) + vendor=apple + ;; + *-hms*) + vendor=hitachi + ;; + *-mpw* | *-macos*) + vendor=apple + ;; + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; + *-vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor-${kernel:+$kernel-}$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..5041ca2 --- /dev/null +++ b/configure @@ -0,0 +1,16139 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for freeradius $Id$. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +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 $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +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 +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 ${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 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) 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 + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +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="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 \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$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 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +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 + 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 + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +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 : + 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 +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + 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 + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: http://bugs.freeradius.org about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_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] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { 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 + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# 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*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# 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 +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='freeradius' +PACKAGE_TARNAME='freeradius' +PACKAGE_VERSION='$Id$' +PACKAGE_STRING='freeradius $Id$' +PACKAGE_BUGREPORT='http://bugs.freeradius.org' +PACKAGE_URL='http://www.freeradius.org' + +ac_unique_file="src/main/radiusd.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +enable_option_checking=no +ac_subst_vars='LTLIBOBJS +LIBOBJS +STATIC_MODULES +USE_STATIC_LIBS +USE_SHARED_LIBS +INSTALLSTRIP +MODULES +subdirs +HOSTINFO +CRYPTLIB +LIBPREFIX +COLLECTDC_LDFLAGS +COLLECTDC_LIBS +PCAP_LDFLAGS +PCAP_LIBS +OPENSSL_CPPFLAGS +OPENSSL_LDFLAGS +OPENSSL_LIBS +SYSTEMD_LDFLAGS +SYSTEMD_LIBS +LIBREADLINE +TALLOC_LDFLAGS +TALLOC_LIBS +DIRNAME +AUTOHEADER +AUTOCONF +ACLOCAL +RUSERS +SNMPWALK +SNMPGET +openssl_version_check_config +WITH_DHCP +modconfdir +dictdir +raddbdir +radacctdir +logdir +GIT +FR_MAKEFLAGS +MAKE +GMAKE +clang_path +RANLIB +EGREP +GREP +CPP +ac_ct_CXX +CXXFLAGS +CXX +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +ANTORA +GRAPHVIZ_DOT +DOXYGEN +PERL +PANDOC_ENGINE +PANDOC +ASCIIDOCTOR +RADIUSD_VERSION_STRING +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_developer +enable_verify_ptr +enable_fips_workaround +enable_largefile +enable_strict_dependencies +enable_werror +with_docdir +with_logdir +with_radacctdir +with_raddbdir +with_dictdir +with_ascend_binary +with_radiusv11 +with_threads +with_tcp +with_vmps +with_dhcp +with_static_modules +with_shared_libs +with_modules +with_experimental_modules +with_udpfromto +with_rlm_FOO_lib_dir +with_rlm_FOO_include_dir +with_openssl +with_openssl_lib_dir +with_openssl_include_dir +enable_openssl_version_check +enable_reproducible_builds +enable_fuzzer +enable_address_sanitizer +enable_leak_sanitizer +enable_thread_sanitizer +enable_undefined_behaviour_sanitizer +with_talloc_lib_dir +with_talloc_include_dir +with_pcap_lib_dir +with_pcap_include_dir +with_collectdclient_lib_dir +with_collectdclient_include_dir +with_cap_lib_dir +with_cap_include_dir +with_systemd +with_systemd_lib_dir +with_systemd_include_dir +with_execinfo_lib_dir +with_execinfo_include_dir +with_pcre +with_pcre_lib_dir +with_pcre_include_dir +with_regex +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP' +ac_subdirs_all='$mysubdirs' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -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=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures freeradius $Id$ to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/freeradius] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of freeradius $Id$:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-developer enables features of interest to developers. + --disable-verify-ptr disables WITH_VERIFY_PTR developer build option. + --enable-fips-workaround enables local MD4, MD5, etc. functionality to avoid OpenSSL FIPS issues. + --disable-largefile omit support for large files + --enable-strict-dependencies fail configure on lack of module dependancy. + --enable-werror causes the build to fail if any warnings are generated. + --disable-openssl-version-check + disable vulnerable OpenSSL version check + + --enable-reproducible-builds + ensure the build does not change each time + --enable-fuzzer build with support for a fuzzer + --enable-address-sanitizer + build with support for address sanitizer. + --enable-leak-sanitizer build with support for leak sanitizer. + --enable-thread-sanitizer + build with support for thread sanitizer. + --enable-undefined-behaviour-sanitizer + build with support for undefined behaviour + sanitizer. + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-docdir=DIR directory for documentation DATADIR/doc/freeradius + --with-logdir=DIR directory for logfiles LOCALSTATEDIR/log/radius + --with-radacctdir=DIR directory for detail files LOGDIR/radacct + --with-raddbdir=DIR directory for config files SYSCONFDIR/raddb + --with-dictdir=DIR directory for dictionary files DATAROOTDIR/freeradius + --with-ascend-binary include support for Ascend binary filter attributes (default=yes) + --with-radiusv11 compile in RADIUSv11 support. (default=no) + --with-threads use threads, if available. (default=yes) + --with-tcp compile in TCP support. (default=yes) + --with-vmps compile in VMPS support. (default=yes) + --with-dhcp compile in DHCP support. (default=yes) + --with-static-modules=QUOTED-MODULE-LIST + --with-shared-libs build dynamic libraries and link against them. + (default=yes) + --with-modules=QUOTED-MODULE-LIST + --with-experimental-modules + use experimental and unstable modules. (default=no, + unless --enable-developer=yes) + --with-udpfromto compile in UDPFROMTO support. (default=yes) + --with-rlm-FOO-lib-dir=DIR + directory in which to look for library files used by + module FOO + --with-rlm-FOO-include-dir=DIR + directory in which to look for include files used by + module FOO + --with-openssl use OpenSSL. (default=yes) + --with-openssl-lib-dir=DIR + directory to look for OpenSSL library files + --with-openssl-include-dir=DIR + directory to look for OpenSSL include files + --with-talloc-lib-dir=DIR + directory in which to look for talloc library files + --with-talloc-include-dir=DIR + directory in which to look for talloc include files + --with-pcap-lib-dir=DIR directory in which to look for pcap library files + --with-pcap-include-dir=DIR + directory in which to look for pcap include files + --with-collectdclient-lib-dir=DIR + directory in which to look for collectdclient + library files + --with-collectdclient-include-dir=DIR + directory in which to look for collectdclient + include files + --with-cap-lib-dir=DIR directory in which to look for cap library files + --with-cap-include-dir=DIR + directory in which to look for cap include files + --with-systemd add systemd support, if available (default=no) + --with-systemd-lib-dir=DIR + directory to look for systemd library files + --with-systemd-include-dir=DIR + directory to look for systemd include files + --with-execinfo-lib-dir=DIR + directory in which to look for execinfo library + files + --with-execinfo-include-dir=DIR + directory in which to look for execinfo include + files + --with-pcre use libpcre (if available). (default=yes) + --with-pcre-lib-dir=DIR directory in which to look for pcre library files + --with-pcre-include-dir=DIR + directory in which to look for pcre include files + --with-regex Whether to build with regular expressions + (default=yes) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +freeradius home page: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + 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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for 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 + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +freeradius configure $Id$ +generated by GNU Autoconf 2.71 + +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 + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + 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 : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { 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. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { 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_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + 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 : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# 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 + 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +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 +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + 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 : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { 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. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { 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_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { 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 + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { 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_type + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + +fi +eval ac_res=\$$3 + { 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_check_decl +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 freeradius $as_me $Id$, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { 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) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + 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 && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +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. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + 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" \ + || { { 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 +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { 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 + { 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; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" + +# Auxiliary files required by this configure script. +ac_aux_files="missing config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { 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) + { 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=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { 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 + { 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 + { 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=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { 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. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_config_headers="$ac_config_headers src/include/autoconf.h" + + +RADIUSD_MAJOR_VERSION=`cat VERSION | cut -f1 -d.` +RADIUSD_MINOR_VERSION=`cat VERSION | cut -f2 -d.` +RADIUSD_INCRM_VERSION=`cat VERSION | cut -f3 -d. | sed 's/[\.-].*$//'` + +RADIUSD_VERSION=`printf "%02i%02i%02i" $RADIUSD_MAJOR_VERSION $RADIUSD_MINOR_VERSION $RADIUSD_INCRM_VERSION` + +RADIUSD_VERSION_STRING=`cat VERSION` + + + + +printf "%s\n" "#define RADIUSD_VERSION ${RADIUSD_VERSION}" >>confdefs.h + + +printf "%s\n" "#define RADIUSD_VERSION_STRING \"${RADIUSD_VERSION_STRING}\"" >>confdefs.h + + + +unset ASAN_OPTIONS +unset LSAN_OPTIONS + +# Extract the first word of "asciidoctor", so it can be a program name with args. +set dummy asciidoctor; 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_path_ASCIIDOCTOR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ASCIIDOCTOR in + [\\/]* | ?:[\\/]*) + ac_cv_path_ASCIIDOCTOR="$ASCIIDOCTOR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_ASCIIDOCTOR="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +ASCIIDOCTOR=$ac_cv_path_ASCIIDOCTOR +if test -n "$ASCIIDOCTOR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ASCIIDOCTOR" >&5 +printf "%s\n" "$ASCIIDOCTOR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$ac_cv_path_ASCIIDOCTOR" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: asciidoctor not found - Please install if you want build the docs" >&5 +printf "%s\n" "$as_me: WARNING: asciidoctor not found - Please install if you want build the docs" >&2;} +fi + +# Extract the first word of "pandoc", so it can be a program name with args. +set dummy pandoc; 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_path_PANDOC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_PANDOC="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +printf "%s\n" "$PANDOC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$ac_cv_path_PANDOC" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pandoc not found - Please install if you want build the docs" >&5 +printf "%s\n" "$as_me: WARNING: pandoc not found - Please install if you want build the docs" >&2;} +else + # + # Pandoc v2 onwards renamed --latex-engine to --pdf-engine + # + if pandoc --help 2>&1 | grep -q "latex-engine"; then + PANDOC_ENGINE=latex + else + PANDOC_ENGINE=pdf + fi + +fi + +# pandoc and asciidoctor is defined? then check it. +if test "x$ac_cv_path_PANDOC" != "x" && test "x$ac_cv_path_ASCIIDOCTOR" != "x"; then + + + + + + +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; 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_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # 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_PERL="perl" + 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 +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +printf "%s\n" "$PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ax_perl_modules_failed=0 + for ax_perl_module in 'JSON' ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 +printf %s "checking for perl module $ax_perl_module... " >&6; } + + # Would be nice to log result here, but can't rely on autoconf internals + $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 + if test $? -ne 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; + ax_perl_modules_failed=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ax_perl_modules_failed" = 0; then + : + + else + : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Perl JSON module not found - Please install if you want build the docs" >&5 +printf "%s\n" "$as_me: WARNING: Perl JSON module not found - Please install if you want build the docs" >&2;} + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +printf "%s\n" "$as_me: WARNING: could not find perl" >&2;} +fi +fi + +# Extract the first word of "doxygen", so it can be a program name with args. +set dummy doxygen; 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_path_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DOXYGEN in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_DOXYGEN="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +DOXYGEN=$ac_cv_path_DOXYGEN +if test -n "$DOXYGEN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 +printf "%s\n" "$DOXYGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$ac_cv_path_DOXYGEN" != "x"; then + # Extract the first word of "dot", so it can be a program name with args. +set dummy dot; 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_path_GRAPHVIZ_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $GRAPHVIZ_DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GRAPHVIZ_DOT="$GRAPHVIZ_DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_GRAPHVIZ_DOT="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +GRAPHVIZ_DOT=$ac_cv_path_GRAPHVIZ_DOT +if test -n "$GRAPHVIZ_DOT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GRAPHVIZ_DOT" >&5 +printf "%s\n" "$GRAPHVIZ_DOT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test "x$ac_cv_path_GRAPHVIZ_DOT" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - Please install the graphviz if you want to build the docs/source" >&5 +printf "%s\n" "$as_me: WARNING: dot not found - Please install the graphviz if you want to build the docs/source" >&2;} + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - Please install if you want build the docs/source" >&5 +printf "%s\n" "$as_me: WARNING: doxygen not found - Please install if you want build the docs/source" >&2;} +fi + +# Extract the first word of "antora", so it can be a program name with args. +set dummy antora; 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_path_ANTORA+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ANTORA in + [\\/]* | ?:[\\/]*) + ac_cv_path_ANTORA="$ANTORA" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_ANTORA="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +ANTORA=$ac_cv_path_ANTORA +if test -n "$ANTORA"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ANTORA" >&5 +printf "%s\n" "$ANTORA" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$ac_cv_path_ANTORA" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: antora not found - Please install if you want build the site" >&5 +printf "%s\n" "$as_me: WARNING: antora not found - Please install if you want build the site" >&2;} +fi + +# Check whether --enable-developer was given. +if test ${enable_developer+y} +then : + enableval=$enable_developer; case "$enableval" in + no) + developer=no + ;; + *) + developer=yes + esac + +fi + + +if test -d $srcdir/.git; then + if test "x$developer" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: found .git directory, enabling developer build implicitly, disable with --disable-developer" >&5 +printf "%s\n" "$as_me: found .git directory, enabling developer build implicitly, disable with --disable-developer" >&6;} + developer="yes" + fi +fi + +if test "x$developer" = "xyes"; then + : ${CFLAGS=-g3} +fi + +# Check whether --enable-verify-ptr was given. +if test ${enable_verify_ptr+y} +then : + enableval=$enable_verify_ptr; case "$enableval" in + no) + verify_ptr="" + ;; + *) + verify_ptr="-DWITH_VERIFY_PTR=1" + esac +else $as_nop + verify_ptr="-DWITH_VERIFY_PTR=1" +fi + + +# Check whether --enable-fips-workaround was given. +if test ${enable_fips_workaround+y} +then : + enableval=$enable_fips_workaround; case "$enableval" in + no) + fips="" + ;; + *) + fips="-DWITH_FIPS=1" + esac +else $as_nop + fips="" +fi + + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf "%s\n" "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +case "$host" in + *-darwin*) + CFLAGS="$CFLAGS -DDARWIN" + LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib $LDFLAGS" + LIBS="-F /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ -framework DirectoryService $LIBS" + ;; +esac + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ 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}gcc" + 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 "gcc", so it can be a program name with args. +set dummy gcc; 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="gcc" + 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 + +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 +{ 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}cc" + 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 +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 +{ 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 + ac_prog_rejected=no +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 + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + 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 + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { 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 "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ 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$ac_prog" + 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 + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ 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="$ac_prog" + 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 + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ 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" && { { 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. +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 -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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# 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. +{ 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.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + 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, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else $as_nop + ac_file='' +fi +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 + +{ { 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_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 +{ 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_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 +{ 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 +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_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. +{ 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 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + 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 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + 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 + { { 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 +{ 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 +{ 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 (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + 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 + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { 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 +{ 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 +{ 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 (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ 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+y} +ac_save_CFLAGS=$CFLAGS +{ 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 + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +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 (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ 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 + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +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. */ +$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 + +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 + +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__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +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 +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + 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 +{ 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_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_tool_prefix$ac_prog" + 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 +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; 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_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$ac_prog" + 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_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + 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 + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +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 + { { 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\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ 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_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = 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_cxx_cxx11" = 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_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = 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_cxx_cxx98" = 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_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else $as_nop + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_should_define__xopen_source=no + if test $ac_cv_header_wchar_h = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + if test $ac_cv_header_minix_config_h = yes +then : + MINIX=yes + printf "%s\n" "#define _MINIX 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + +else $as_nop + MINIX= +fi + if test $ac_cv_safe_to_define___extensions__ = yes +then : + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + +fi + if test $ac_cv_should_define__xopen_source = yes +then : + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ 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 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. + # 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. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +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 : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ 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. + # 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. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +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 : + +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 + +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 + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +if test $ac_cv_c_compiler_gnu = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +printf %s "checking whether $CC needs -traditional... " >&6; } +if test ${ac_cv_prog_gcc_traditional+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : + ac_cv_prog_gcc_traditional=yes +else $as_nop + ac_cv_prog_gcc_traditional=no +fi +rm -rf conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : + ac_cv_prog_gcc_traditional=yes +fi +rm -rf conftest* + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are using SUNPro C" >&5 +printf %s "checking whether we are using SUNPro C... " >&6; } +if test ${ac_cv_prog_suncc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_suncc=yes +else + ac_cv_prog_suncc=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_suncc" >&5 +printf "%s\n" "$ac_cv_prog_suncc" >&6; } +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ 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_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_RANLIB="${ac_tool_prefix}ranlib" + 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 +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&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_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ 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_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_RANLIB="ranlib" + 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_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + 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 + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is clang" >&5 +printf %s "checking if compiler is clang... " >&6; } +if test ${ax_cv_cc_clang+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + #ifndef __clang__ + not clang + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_clang=yes +else $as_nop + ax_cv_cc_clang=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_clang" >&5 +printf "%s\n" "$ax_cv_cc_clang" >&6; } + +if test "x$ax_cv_cc_clang" = "xyes"; then + clang_path="$CC" + +else + clang_path="" + +fi + + +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -Wall -std=c99 -D_GNU_SOURCE" +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Wno-unknown-warning-option\"" >&5 +printf %s "checking for the compiler flag \"-Wno-unknown-warning-option\"... " >&6; } +if test ${ax_cv_cc_no_unknown_warning_option_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="-Werror -Wno-unknown-warning-option" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + /* + * gcc will happily accept -Wno-unknown-warning-option + * only emitting an error about it, if an error ocurrs in the source file. + */ + #if defined(__GNUC__) && !defined(__clang__) + gcc sucks + #endif + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_no_unknown_warning_option_flag=yes +else $as_nop + ax_cv_cc_no_unknown_warning_option_flag=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_no_unknown_warning_option_flag" >&5 +printf "%s\n" "$ax_cv_cc_no_unknown_warning_option_flag" >&6; } + +if test "x$ax_cv_cc_no_unknown_warning_option_flag" = "xyes"; then + CFLAGS="$CFLAGS -Wno-unknown-warning-option" +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Qunused-arguments\"" >&5 +printf %s "checking for the compiler flag \"-Qunused-arguments\"... " >&6; } +if test ${ax_cv_cc_qunused_arguments_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -Qunused-arguments -foobar" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_qunused_arguments_flag="yes" +else $as_nop + ax_cv_cc_qunused_arguments_flag="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_qunused_arguments_flag" >&5 +printf "%s\n" "$ax_cv_cc_qunused_arguments_flag" >&6; } + +if test "x$ax_cv_cc_qunused_arguments_flag" = "xyes"; then + CFLAGS="$CFLAGS -Qunused-arguments" + LDFLAGS="$LDFLAGS -Qunused-arguments" +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Wno-date-time\"" >&5 +printf %s "checking for the compiler flag \"-Wno-date-time\"... " >&6; } +if test ${ax_cv_cc_no_date_time_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -Wno-date-time" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_no_date_time_flag="yes" +else $as_nop + ax_cv_cc_no_date_time_flag="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_no_date_time_flag" >&5 +printf "%s\n" "$ax_cv_cc_no_date_time_flag" >&6; } + + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else $as_nop + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + +printf "%s\n" "#define FR_BIG_ENDIAN 1" >>confdefs.h +;; #( + no) + +printf "%s\n" "#define FR_LITTLE_ENDIAN 1" >>confdefs.h + + ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# Extract the first word of "gmake", so it can be a program name with args. +set dummy gmake; 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_GMAKE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$GMAKE"; then + ac_cv_prog_GMAKE="$GMAKE" # 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_GMAKE="yes" + 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 + + test -z "$ac_cv_prog_GMAKE" && ac_cv_prog_GMAKE="no" +fi +fi +GMAKE=$ac_cv_prog_GMAKE +if test -n "$GMAKE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMAKE" >&5 +printf "%s\n" "$GMAKE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test $GMAKE = no; then + # Extract the first word of "make", so it can be a program name with args. +set dummy make; 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_path_MAKE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_MAKE="$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 + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="/usr/local/bin/make" + ;; +esac +fi +MAKE=$ac_cv_path_MAKE +if test -n "$MAKE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 +printf "%s\n" "$MAKE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +else + # Extract the first word of "gmake", so it can be a program name with args. +set dummy gmake; 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_path_MAKE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_MAKE="$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 + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="/usr/local/gnu/bin/make" + ;; +esac +fi +MAKE=$ac_cv_path_MAKE +if test -n "$MAKE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 +printf "%s\n" "$MAKE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"` +if test -z "$makever"; then + as_fn_error $? "GNU Make is not installed. Please download and install it from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing." "$LINENO" 5 +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of system cores" >&5 +printf %s "checking number of system cores... " >&6; } +if test ${ax_cv_system_cores+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test "$cross_compiling" = yes +then : + ax_cv_system_cores= + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #ifdef _WIN32 + # include + #elif MACOS + # include + # include + #else + # include + #endif + + int main (int argc, char *argv[]) + { + uint32_t count; + + #ifdef WIN32 + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + + count = sysinfo.dwNumberOfProcessors; + + #elif MACOS + int nm[2]; + size_t len = 4; + + nm[0] = CTL_HW; + nm[1] = HW_AVAILCPU; + sysctl(nm, 2, &count, &len, NULL, 0); + + if(count < 1) { + nm[1] = HW_NCPU; + sysctl(nm, 2, &count, &len, NULL, 0); + if(count < 1) { + count = 1; + } + } + + #else + count = sysconf(_SC_NPROCESSORS_ONLN); + #endif + + return count; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ax_cv_system_cores=$? +else $as_nop + ax_cv_system_cores=$? +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_system_cores" >&5 +printf "%s\n" "$ax_cv_system_cores" >&6; } + + + + +# Extract the first word of "git", so it can be a program name with args. +set dummy git; 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_GIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$GIT"; then + ac_cv_prog_GIT="$GIT" # 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_GIT="yes" + 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 + + test -z "$ac_cv_prog_GIT" && ac_cv_prog_GIT="no" +fi +fi +GIT=$ac_cv_prog_GIT +if test -n "$GIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 +printf "%s\n" "$GIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + +# Check whether --enable-strict-dependencies was given. +if test ${enable_strict_dependencies+y} +then : + enableval=$enable_strict_dependencies; +fi + + +# Check whether --enable-werror was given. +if test ${enable_werror+y} +then : + enableval=$enable_werror; case "$enableval" in + no) + werror=no + ;; + *) + werror=yes + esac + +fi + + +docdir='${datadir}/doc/freeradius' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking docdir" >&5 +printf %s "checking docdir... " >&6; } + +# Check whether --with-docdir was given. +if test ${with_docdir+y} +then : + withval=$with_docdir; case "$withval" in + no) + docdir=no + ;; + yes) + ;; + [\\/$]* | ?:[\\/]* ) + docdir="$withval" + ;; + *) + as_fn_error $? "expected an absolute directory name for --with-docdir: $withval" "$LINENO" 5 + ;; + esac + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $docdir" >&5 +printf "%s\n" "$docdir" >&6; } +if test "x$docdir" = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Documentation files will NOT be installed." >&5 +printf "%s\n" "$as_me: WARNING: Documentation files will NOT be installed." >&2;} +fi + +logdir='${localstatedir}/log/radius' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking logdir" >&5 +printf %s "checking logdir... " >&6; } + +# Check whether --with-logdir was given. +if test ${with_logdir+y} +then : + withval=$with_logdir; case "$withval" in + no) + as_fn_error $? "Need logdir" "$LINENO" 5 + ;; + yes) + ;; + [\\/$]* | ?:[\\/]* ) + logdir="$withval" + ;; + *) + as_fn_error $? "expected an absolute directory name for --with-logdir: $withval" "$LINENO" 5 + ;; + esac + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $logdir" >&5 +printf "%s\n" "$logdir" >&6; } + +radacctdir='${logdir}/radacct' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking radacctdir" >&5 +printf %s "checking radacctdir... " >&6; } + +# Check whether --with-radacctdir was given. +if test ${with_radacctdir+y} +then : + withval=$with_radacctdir; case "$withval" in + no) + as_fn_error $? "Need radacctdir" "$LINENO" 5 + ;; + yes) + ;; + [\\/$]* | ?:[\\/]* ) + radacctdir="$withval" + ;; + *) + as_fn_error $? "expected an absolute directory name for --with-radacctdir: $withval" "$LINENO" 5 + ;; + esac + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $radacctdir" >&5 +printf "%s\n" "$radacctdir" >&6; } + +raddbdir='${sysconfdir}/raddb' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking raddbdir" >&5 +printf %s "checking raddbdir... " >&6; } + +# Check whether --with-raddbdir was given. +if test ${with_raddbdir+y} +then : + withval=$with_raddbdir; case "$withval" in + no) + as_fn_error $? "Need raddbdir" "$LINENO" 5 + ;; + yes) + ;; + [\\/$]* | ?:[\\/]* ) + raddbdir="$withval" + ;; + *) + as_fn_error $? "expected an absolute directory name for --with-raddbdir: $withval" "$LINENO" 5 + ;; + esac + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $raddbdir" >&5 +printf "%s\n" "$raddbdir" >&6; } + +dictdir='${datarootdir}/freeradius' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dictdir" >&5 +printf %s "checking dictdir... " >&6; } + +# Check whether --with-dictdir was given. +if test ${with_dictdir+y} +then : + withval=$with_dictdir; case "$withval" in + no) + as_fn_error $? "Need dictdir" "$LINENO" 5 + ;; + yes) + ;; + [\\/$]* | ?:[\\/]* ) + dictdir="$withval" + ;; + *) + as_fn_error $? "expected an absolute directory name for --with-dictdir: $withval" "$LINENO" 5 + ;; + esac + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dictdir" >&5 +printf "%s\n" "$dictdir" >&6; } + +modconfdir='${raddbdir}/mods-config' + + +WITH_ASCEND_BINARY=yes + +# Check whether --with-ascend-binary was given. +if test ${with_ascend_binary+y} +then : + withval=$with_ascend_binary; case "$withval" in + yes) + ;; + *) + WITH_ASCEND_BINARY=no + esac + +fi + +if test "x$WITH_ASCEND_BINARY" = "xyes"; then + +printf "%s\n" "#define WITH_ASCEND_BINARY 1" >>confdefs.h + +fi + +WITH_RADIUSV11= + +# Check whether --with-radiusv11 was given. +if test ${with_radiusv11+y} +then : + withval=$with_radiusv11; case "$withval" in + yes) + WITH_RADIUSV11=yes + ;; + *) + ;; + esac + +fi + +if test "x$WITH_RADIUSCV11" = "xyes"; then + +printf "%s\n" "#define WITH_RADIUSV11 1" >>confdefs.h + +fi + +WITH_THREADS=yes + +# Check whether --with-threads was given. +if test ${with_threads+y} +then : + withval=$with_threads; case "$withval" in + yes) + ;; + *) + WITH_THREADS=no + esac + +fi + + +WITH_TCP=yes + +# Check whether --with-tcp was given. +if test ${with_tcp+y} +then : + withval=$with_tcp; case "$withval" in + yes) + ;; + *) + WITH_TCP=no + esac + +fi + +if test "x$WITH_TCP" = "xyes"; then + +printf "%s\n" "#define WITH_TCP 1" >>confdefs.h + +fi + +WITH_VMPS=yes + +# Check whether --with-vmps was given. +if test ${with_vmps+y} +then : + withval=$with_vmps; case "$withval" in + yes) + ;; + *) + WITH_VMPS=no + esac + +fi + +if test "x$WITH_VMPS" = "xyes"; then + +printf "%s\n" "#define WITH_VMPS 1" >>confdefs.h + +fi + +WITH_DHCP=yes + +# Check whether --with-dhcp was given. +if test ${with_dhcp+y} +then : + withval=$with_dhcp; case "$withval" in + yes) + ;; + *) + WITH_DHCP=no + esac + +fi + +if test "x$WITH_DHCP" = "xyes"; then + +printf "%s\n" "#define WITH_DHCP 1" >>confdefs.h + +fi + + +STATIC_MODULES= + +# Check whether --with-static_modules was given. +if test ${with_static_modules+y} +then : + withval=$with_static_modules; + for i in $withval; do + STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la" + done + +fi + + +USE_SHARED_LIBS=yes + +# Check whether --with-shared-libs was given. +if test ${with_shared_libs+y} +then : + withval=$with_shared_libs; case "$withval" in + no) + USE_SHARED_LIBS=no + ;; + *) + esac + +fi + + +MODULES= + +# Check whether --with-modules was given. +if test ${with_modules+y} +then : + withval=$with_modules; + for i in $withval; do + MODULES="$MODULES $i" + done + +fi + + +EXPERIMENTAL= + +# Check whether --with-experimental-modules was given. +if test ${with_experimental_modules+y} +then : + withval=$with_experimental_modules; case "$withval" in + yes) + EXPERIMENTAL=yes + ;; + no) + EXPERIMENTAL=no + ;; + *) + esac + +fi + + +WITH_UDPFROMTO=yes + +# Check whether --with-udpfromto was given. +if test ${with_udpfromto+y} +then : + withval=$with_udpfromto; case "$withval" in + yes) + WITH_UDPFROMTO=yes + ;; + *) + WITH_UDPFROMTO=no + esac + +fi + + +if test "x$WITH_UDPFROMTO" = "xyes"; then + +printf "%s\n" "#define WITH_UDPFROMTO /**/" >>confdefs.h + +fi + + + +# Check whether --with-rlm-FOO-lib-dir was given. +if test ${with_rlm_FOO_lib_dir+y} +then : + withval=$with_rlm_FOO_lib_dir; case "$withval" in + *) + ;; + esac + +fi + + + +# Check whether --with-rlm-FOO-include-dir was given. +if test ${with_rlm_FOO_include_dir+y} +then : + withval=$with_rlm_FOO_include_dir; case "$withval" in + *) + ;; + esac + +fi + + +WITH_OPENSSL=yes + +# Check whether --with-openssl was given. +if test ${with_openssl+y} +then : + withval=$with_openssl; case "$withval" in + no) + WITH_OPENSSL=no + ;; + *) + WITH_OPENSSL=yes + ;; + esac + +fi + +if test "x$WITH_THREADS" = "xno"; then + if test "x$WITH_OPENSSL" = "xyes"; then + as_fn_error $? "Threads are required when using OpenSSL, use --with-threads=yes" "$LINENO" 5 + fi +fi + +openssl_lib_dir= + +# Check whether --with-openssl-lib-dir was given. +if test ${with_openssl_lib_dir+y} +then : + withval=$with_openssl_lib_dir; case "$withval" in + *) openssl_lib_dir="$withval" + ;; + esac + +fi + + +openssl_include_dir= + +# Check whether --with-openssl-include-dir was given. +if test ${with_openssl_include_dir+y} +then : + withval=$with_openssl_include_dir; case "$withval" in + *) openssl_include_dir="$withval" + ;; + esac + +fi + + +# Check whether --enable-openssl-version-check was given. +if test ${enable_openssl_version_check+y} +then : + enableval=$enable_openssl_version_check; +fi + +if test "x$enable_openssl_version_check" != "xno"; then + +printf "%s\n" "#define ENABLE_OPENSSL_VERSION_CHECK 1" >>confdefs.h + + openssl_version_check_config="\ + # + # allow_vulnerable_openssl: Allow the server to start with + # versions of OpenSSL known to have critical vulnerabilities. + # + # This check is based on the version number reported by libssl + # and may not reflect patches applied to libssl by + # distribution maintainers. + # + allow_vulnerable_openssl = no" +else + openssl_version_check_config= +fi + + +# Check whether --enable-reproducible-builds was given. +if test ${enable_reproducible_builds+y} +then : + enableval=$enable_reproducible_builds; case "$enableval" in + yes) + +printf "%s\n" "#define ENABLE_REPRODUCIBLE_BUILDS 1" >>confdefs.h + + reproducible_builds=yes + ;; + *) + reproducible_builds=no + esac + +fi + + +# Check whether --enable-fuzzer was given. +if test ${enable_fuzzer+y} +then : + enableval=$enable_fuzzer; case "$enableval" in + no) + fuzzer=no + ;; + *) + fuzzer=yes + esac + +fi + + +# Check whether --enable-address-sanitizer was given. +if test ${enable_address_sanitizer+y} +then : + enableval=$enable_address_sanitizer; case "$enableval" in + no) + address_sanitizer=no + ;; + *) + address_sanitizer=yes + esac + +fi + + +# Check whether --enable-leak-sanitizer was given. +if test ${enable_leak_sanitizer+y} +then : + enableval=$enable_leak_sanitizer; case "$enableval" in + no) + leak_sanitizer=no + ;; + *) + leak_sanitizer=yes + esac + +fi + + +# Check whether --enable-thread-sanitizer was given. +if test ${enable_thread_sanitizer+y} +then : + enableval=$enable_thread_sanitizer; case "$enableval" in + no) + thread_sanitizer=no + ;; + *) + thread_sanitizer=yes + esac + +fi + + +# Check whether --enable-undefined-behaviour-sanitizer was given. +if test ${enable_undefined_behaviour_sanitizer+y} +then : + enableval=$enable_undefined_behaviour_sanitizer; case "$enableval" in + no) + undefined_behaviour_sanitizer=no + ;; + *) + undefined_behaviour_sanitizer=yes + esac + +fi + + + +CHECKRAD=checkrad +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; 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_path_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_PERL="$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 + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/local/bin/perl" + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +printf "%s\n" "$PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$ac_cv_path_PERL" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - Simultaneous-Use and checkrad may not work" >&5 +printf "%s\n" "$as_me: WARNING: perl not found - Simultaneous-Use and checkrad may not work" >&2;} +fi +# Extract the first word of "snmpget", so it can be a program name with args. +set dummy snmpget; 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_path_SNMPGET+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SNMPGET in + [\\/]* | ?:[\\/]*) + ac_cv_path_SNMPGET="$SNMPGET" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_SNMPGET="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +SNMPGET=$ac_cv_path_SNMPGET +if test -n "$SNMPGET"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SNMPGET" >&5 +printf "%s\n" "$SNMPGET" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$ac_cv_path_SNMPGET" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: snmpget not found - Simultaneous-Use and checkrad may not work" >&5 +printf "%s\n" "$as_me: WARNING: snmpget not found - Simultaneous-Use and checkrad may not work" >&2;} +fi + +# Extract the first word of "snmpwalk", so it can be a program name with args. +set dummy snmpwalk; 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_path_SNMPWALK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SNMPWALK in + [\\/]* | ?:[\\/]*) + ac_cv_path_SNMPWALK="$SNMPWALK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_SNMPWALK="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +SNMPWALK=$ac_cv_path_SNMPWALK +if test -n "$SNMPWALK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SNMPWALK" >&5 +printf "%s\n" "$SNMPWALK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$ac_cv_path_SNMPWALK" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: snmpwalk not found - Simultaneous-Use and checkrad may not work" >&5 +printf "%s\n" "$as_me: WARNING: snmpwalk not found - Simultaneous-Use and checkrad may not work" >&2;} +fi + +# Extract the first word of "rusers", so it can be a program name with args. +set dummy rusers; 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_path_RUSERS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $RUSERS in + [\\/]* | ?:[\\/]*) + ac_cv_path_RUSERS="$RUSERS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_RUSERS="$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 + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_RUSERS" && ac_cv_path_RUSERS="/usr/bin/rusers" + ;; +esac +fi +RUSERS=$ac_cv_path_RUSERS +if test -n "$RUSERS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RUSERS" >&5 +printf "%s\n" "$RUSERS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +missing_dir=`cd $ac_aux_dir && pwd` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +# Extract the first word of "dirname", so it can be a program name with args. +set dummy dirname; 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_path_DIRNAME+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $DIRNAME in + [\\/]* | ?:[\\/]*) + ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_DIRNAME="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +DIRNAME=$ac_cv_path_DIRNAME +if test -n "$DIRNAME"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 +printf "%s\n" "$DIRNAME" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +# Extract the first word of "grep", so it can be a program name with args. +set dummy grep; 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_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $GREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_GREP="$GREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + 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_GREP="$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 + done +IFS=$as_save_IFS + + ;; +esac +fi +GREP=$ac_cv_path_GREP +if test -n "$GREP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 +printf "%s\n" "$GREP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + +talloc_lib_dir= + +# Check whether --with-talloc-lib-dir was given. +if test ${with_talloc_lib_dir+y} +then : + withval=$with_talloc_lib_dir; case "$withval" in + no) + as_fn_error $? "Need talloc-lib-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + talloc_lib_dir="$withval" + ;; + esac +fi + + +talloc_include_dir= + +# Check whether --with-talloc-include-dir was given. +if test ${with_talloc_include_dir+y} +then : + withval=$with_talloc_include_dir; case "$withval" in + no) + as_fn_error $? "Need talloc-include-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + talloc_include_dir="$withval" + ;; + esac +fi + + +smart_try_dir="$talloc_lib_dir" + + +sm_lib_safe=`echo "talloc" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "_talloc" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _talloc in -ltalloc in $try" >&5 +printf %s "checking for _talloc in -ltalloc in $try... " >&6; } + LIBS="-ltalloc $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char _talloc(); +int +main (void) +{ +_talloc() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-ltalloc" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _talloc in -ltalloc" >&5 +printf %s "checking for _talloc in -ltalloc... " >&6; } + LIBS="-ltalloc $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char _talloc(); +int +main (void) +{ +_talloc() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-ltalloc" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _talloc in -ltalloc in $try" >&5 +printf %s "checking for _talloc in -ltalloc in $try... " >&6; } + LIBS="-ltalloc $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char _talloc(); +int +main (void) +{ +_talloc() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-ltalloc" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + +if test "x$ac_cv_lib_talloc__talloc" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: talloc library not found. Use --with-talloc-lib-dir=." >&5 +printf "%s\n" "$as_me: WARNING: talloc library not found. Use --with-talloc-lib-dir=." >&2;} + as_fn_error $? "FreeRADIUS requires libtalloc" "$LINENO" 5 +fi + +TALLOC_LIBS="${smart_lib}" +TALLOC_LDFLAGS="${smart_ldflags}" + + +LIBS="$old_LIBS" + +old_CFLAGS=$CFLAGS +if test "x$WITH_THREADS" = "xyes"; then + if test $ac_cv_prog_suncc = "yes"; then + CFLAGS="$CFLAGS -mt" + fi + + for ac_header in pthread.h +do : + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h + +else $as_nop + + WITH_THREADS="no" + fail=pthread.h + +fi + +done + + if test "x$WITH_THREADS" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +printf %s "checking for pthread_create in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char pthread_create (); +int +main (void) +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_pthread_pthread_create=yes +else $as_nop + ac_cv_lib_pthread_pthread_create=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes +then : + + HAVE_LPTHREAD='yes' + CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" + LIBS="-lpthread $LIBS" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-pthread\"" >&5 +printf %s "checking for the compiler flag \"-pthread\"... " >&6; } +if test ${ax_cv_cc_pthread_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -pthread" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_pthread_flag="yes" +else $as_nop + ax_cv_cc_pthread_flag="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_pthread_flag" >&5 +printf "%s\n" "$ax_cv_cc_pthread_flag" >&6; } + + if test "x$ax_cv_cc_pthread_flag" != 'xyes'; then + CFLAGS="$CFLAGS -pthread" + fi + + +fi + + + if test "x$HAVE_LPTHREAD" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5 +printf %s "checking for pthread_create in -lc_r... " >&6; } +if test ${ac_cv_lib_c_r_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char pthread_create (); +int +main (void) +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_c_r_pthread_create=yes +else $as_nop + ac_cv_lib_c_r_pthread_create=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = xyes +then : + + CFLAGS="$CFLAGS -D_THREAD_SAFE" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-pthread\"" >&5 +printf %s "checking for the compiler flag \"-pthread\"... " >&6; } +if test ${ax_cv_cc_pthread_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -pthread" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_pthread_flag="yes" +else $as_nop + ax_cv_cc_pthread_flag="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_pthread_flag" >&5 +printf "%s\n" "$ax_cv_cc_pthread_flag" >&6; } + + if test "x$ax_cv_cc_pthread_flag" != 'xyes'; then + LIBS="-lc_r $LIBS" + else + CFLAGS="$CFLAGS -pthread" + fi + +else $as_nop + fail=-lc_r or -lpthread + +fi + + fi + fi + + if test "x$WITH_THREADS" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: silently not building with thread support." >&5 +printf "%s\n" "$as_me: WARNING: silently not building with thread support." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: FAILURE: thread support requires: $fail." >&5 +printf "%s\n" "$as_me: WARNING: FAILURE: thread support requires: $fail." >&2;} + else + +printf "%s\n" "#define WITH_THREADS 1" >>confdefs.h + + fi +fi + +if test "x$WITH_THREADS" != "xyes"; then + CFLAGS=$old_CFLAGS + ac_cv_header_pthread_h="no" + WITH_THREADS=no +else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 +printf %s "checking for library containing sem_init... " >&6; } +if test ${ac_cv_search_sem_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char sem_init (); +int +main (void) +{ +return sem_init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' pthread sem posix4 rt semaphore +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_sem_init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_sem_init+y} +then : + break +fi +done +if test ${ac_cv_search_sem_init+y} +then : + +else $as_nop + ac_cv_search_sem_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5 +printf "%s\n" "$ac_cv_search_sem_init" >&6; } +ac_res=$ac_cv_search_sem_init +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else $as_nop + as_fn_error $? "-lsem not found. You may want to download it from ftp://ftp.to.gd-es.com/pub/BSDI/libsem.tar.bz2 or ftp://ftp.freeradius.org/pub/radius/contrib/libsem.tar.gz" "$LINENO" 5 + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h + + LIBS="-ldl $LIBS" + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5 +printf %s "checking for getsockname in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_getsockname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char getsockname (); +int +main (void) +{ +return getsockname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_socket_getsockname=yes +else $as_nop + ac_cv_lib_socket_getsockname=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getsockname" >&5 +printf "%s\n" "$ac_cv_lib_socket_getsockname" >&6; } +if test "x$ac_cv_lib_socket_getsockname" = xyes +then : + printf "%s\n" "#define HAVE_LIBSOCKET 1" >>confdefs.h + + LIBS="-lsocket $LIBS" + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 +printf %s "checking for inet_aton in -lresolv... " >&6; } +if test ${ac_cv_lib_resolv_inet_aton+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char inet_aton (); +int +main (void) +{ +return inet_aton (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_resolv_inet_aton=yes +else $as_nop + ac_cv_lib_resolv_inet_aton=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 +printf "%s\n" "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = xyes +then : + printf "%s\n" "#define HAVE_LIBRESOLV 1" >>confdefs.h + + LIBS="-lresolv $LIBS" + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5 +printf %s "checking for inet_ntoa in -lnsl... " >&6; } +if test ${ac_cv_lib_nsl_inet_ntoa+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char inet_ntoa (); +int +main (void) +{ +return inet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_nsl_inet_ntoa=yes +else $as_nop + ac_cv_lib_nsl_inet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5 +printf "%s\n" "$ac_cv_lib_nsl_inet_ntoa" >&6; } +if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes +then : + printf "%s\n" "#define HAVE_LIBNSL 1" >>confdefs.h + + LIBS="-lnsl $LIBS" + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for htonl in -lws2_32" >&5 +printf %s "checking for htonl in -lws2_32... " >&6; } +if test ${ac_cv_lib_ws2_32_htonl+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lws2_32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char htonl (); +int +main (void) +{ +return htonl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ws2_32_htonl=yes +else $as_nop + ac_cv_lib_ws2_32_htonl=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_htonl" >&5 +printf "%s\n" "$ac_cv_lib_ws2_32_htonl" >&6; } +if test "x$ac_cv_lib_ws2_32_htonl" = xyes +then : + printf "%s\n" "#define HAVE_LIBWS2_32 1" >>confdefs.h + + LIBS="-lws2_32 $LIBS" + +fi + + +pcap_lib_dir= + +# Check whether --with-pcap-lib-dir was given. +if test ${with_pcap_lib_dir+y} +then : + withval=$with_pcap_lib_dir; case "$withval" in + no) + as_fn_error $? "Need pcap-lib-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + pcap_lib_dir="$withval" + ;; + esac +fi + + +pcap_include_dir= + +# Check whether --with-pcap-include-dir was given. +if test ${with_pcap_include_dir+y} +then : + withval=$with_pcap_include_dir; case "$withval" in + no) + as_fn_error $? "Need pcap-include-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + pcap_include_dir="$withval" + ;; + esac +fi + + +smart_try_dir="$pcap_lib_dir" + + +sm_lib_safe=`echo "pcap" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "pcap_open_live" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_open_live in -lpcap in $try" >&5 +printf %s "checking for pcap_open_live in -lpcap in $try... " >&6; } + LIBS="-lpcap $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char pcap_open_live(); +int +main (void) +{ +pcap_open_live() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lpcap" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_open_live in -lpcap" >&5 +printf %s "checking for pcap_open_live in -lpcap... " >&6; } + LIBS="-lpcap $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char pcap_open_live(); +int +main (void) +{ +pcap_open_live() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lpcap" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_open_live in -lpcap in $try" >&5 +printf %s "checking for pcap_open_live in -lpcap in $try... " >&6; } + LIBS="-lpcap $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char pcap_open_live(); +int +main (void) +{ +pcap_open_live() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lpcap" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + +if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=." >&5 +printf "%s\n" "$as_me: WARNING: pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=." >&2;} +else + ac_fn_c_check_func "$LINENO" "pcap_fopen_offline" "ac_cv_func_pcap_fopen_offline" +if test "x$ac_cv_func_pcap_fopen_offline" = xyes +then : + printf "%s\n" "#define HAVE_PCAP_FOPEN_OFFLINE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pcap_dump_fopen" "ac_cv_func_pcap_dump_fopen" +if test "x$ac_cv_func_pcap_dump_fopen" = xyes +then : + printf "%s\n" "#define HAVE_PCAP_DUMP_FOPEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pcap_create" "ac_cv_func_pcap_create" +if test "x$ac_cv_func_pcap_create" = xyes +then : + printf "%s\n" "#define HAVE_PCAP_CREATE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pcap_activate" "ac_cv_func_pcap_activate" +if test "x$ac_cv_func_pcap_activate" = xyes +then : + printf "%s\n" "#define HAVE_PCAP_ACTIVATE 1" >>confdefs.h + +fi + + + PCAP_LIBS="${smart_lib}" + PCAP_LDFLAGS="${smart_ldflags}" +fi +LIBS="${old_LIBS}" + +collectdclient_lib_dir= + +# Check whether --with-collectdclient-lib-dir was given. +if test ${with_collectdclient_lib_dir+y} +then : + withval=$with_collectdclient_lib_dir; case "$withval" in + no) + as_fn_error $? "Need collectdclient-lib-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + collectdclient_lib_dir="$withval" + ;; + esac +fi + + +collectdclient_include_dir= + +# Check whether --with-collectdclient-include-dir was given. +if test ${with_collectdclient_include_dir+y} +then : + withval=$with_collectdclient_include_dir; case "$withval" in + no) + as_fn_error $? "Need collectdclient-include-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + collectdclient_include_dir="$withval" + ;; + esac +fi + + +smart_try_dir="$collectdclient_lib_dir" + + +sm_lib_safe=`echo "collectdclient" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "lcc_connect" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lcc_connect in -lcollectdclient in $try" >&5 +printf %s "checking for lcc_connect in -lcollectdclient in $try... " >&6; } + LIBS="-lcollectdclient $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char lcc_connect(); +int +main (void) +{ +lcc_connect() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcollectdclient" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lcc_connect in -lcollectdclient" >&5 +printf %s "checking for lcc_connect in -lcollectdclient... " >&6; } + LIBS="-lcollectdclient $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char lcc_connect(); +int +main (void) +{ +lcc_connect() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcollectdclient" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lcc_connect in -lcollectdclient in $try" >&5 +printf %s "checking for lcc_connect in -lcollectdclient in $try... " >&6; } + LIBS="-lcollectdclient $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char lcc_connect(); +int +main (void) +{ +lcc_connect() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcollectdclient" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + +if test "x$ac_cv_lib_collectdclient_lcc_connect" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: collectdclient library not found. Use --with-collectdclient-lib-dir=." >&5 +printf "%s\n" "$as_me: WARNING: collectdclient library not found. Use --with-collectdclient-lib-dir=." >&2;} +else + COLLECTDC_LIBS="${smart_lib}" + COLLECTDC_LDFLAGS="${smart_ldflags}" +fi +LIBS="${old_LIBS}" + +cap_lib_dir= + +# Check whether --with-cap-lib-dir was given. +if test ${with_cap_lib_dir+y} +then : + withval=$with_cap_lib_dir; case "$withval" in + no) + as_fn_error $? "Need cap-lib-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + cap_lib_dir="$withval" + ;; + esac +fi + + +cap_include_dir= + +# Check whether --with-cap-include-dir was given. +if test ${with_cap_include_dir+y} +then : + withval=$with_cap_include_dir; case "$withval" in + no) + as_fn_error $? "Need cap-include-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + cap_include_dir="$withval" + ;; + esac +fi + + +smart_try_dir="$cap_lib_dir" + + +sm_lib_safe=`echo "cap" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "cap_get_proc" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cap_get_proc in -lcap in $try" >&5 +printf %s "checking for cap_get_proc in -lcap in $try... " >&6; } + LIBS="-lcap $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char cap_get_proc(); +int +main (void) +{ +cap_get_proc() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcap" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cap_get_proc in -lcap" >&5 +printf %s "checking for cap_get_proc in -lcap... " >&6; } + LIBS="-lcap $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char cap_get_proc(); +int +main (void) +{ +cap_get_proc() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcap" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cap_get_proc in -lcap in $try" >&5 +printf %s "checking for cap_get_proc in -lcap in $try... " >&6; } + LIBS="-lcap $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char cap_get_proc(); +int +main (void) +{ +cap_get_proc() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcap" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + +if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=." >&5 +printf "%s\n" "$as_me: WARNING: cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=." >&2;} +else + +printf "%s\n" "#define HAVE_LIBCAP 1" >>confdefs.h + + HAVE_LIBCAP=1 +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a readline compatible library" >&5 +printf %s "checking for a readline compatible library... " >&6; } +if test ${vl_cv_lib_readline+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ORIG_LIBS="$LIBS" + for readline_lib in readline edit editline; do + for termcap_lib in "" termcap curses ncurses; do + if test -z "$termcap_lib"; then + TRY_LIB="-l$readline_lib" + else + TRY_LIB="-l$readline_lib -l$termcap_lib" + fi + LIBS="$ORIG_LIBS $TRY_LIB" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char readline (); +int +main (void) +{ +return readline (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + vl_cv_lib_readline="$TRY_LIB" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -n "$vl_cv_lib_readline"; then + break + fi + done + if test -n "$vl_cv_lib_readline"; then + break + fi + done + if test -z "$vl_cv_lib_readline"; then + vl_cv_lib_readline="no" + LIBS="$ORIG_LIBS" + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vl_cv_lib_readline" >&5 +printf "%s\n" "$vl_cv_lib_readline" >&6; } + + if test "$vl_cv_lib_readline" != "no"; then + LIBREADLINE="$vl_cv_lib_readline" + +printf "%s\n" "#define HAVE_LIBREADLINE 1" >>confdefs.h + + ac_fn_c_check_header_compile "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_readline_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_READLINE_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5 +printf %s "checking whether readline supports history... " >&6; } +if test ${vl_cv_lib_readline_history+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + vl_cv_lib_readline_history="no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char add_history (); +int +main (void) +{ +return add_history (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + vl_cv_lib_readline_history="yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vl_cv_lib_readline_history" >&5 +printf "%s\n" "$vl_cv_lib_readline_history" >&6; } + if test "$vl_cv_lib_readline_history" = "yes"; then + +printf "%s\n" "#define HAVE_READLINE_HISTORY 1" >>confdefs.h + + ac_fn_c_check_header_compile "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default" +if test "x$ac_cv_header_history_h" = xyes +then : + printf "%s\n" "#define HAVE_HISTORY_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_history_h" = xyes +then : + printf "%s\n" "#define HAVE_READLINE_HISTORY_H 1" >>confdefs.h + +fi + + fi + fi + + + + +# Check whether --with-systemd was given. +if test ${with_systemd+y} +then : + withval=$with_systemd; case "$withval" in + no) + WITH_SYSTEMD=no + ;; + *) + WITH_SYSTEMD=yes + esac +else $as_nop + WITH_SYSTEMD=no +fi + + +systemd_lib_dir= + +# Check whether --with-systemd-lib-dir was given. +if test ${with_systemd_lib_dir+y} +then : + withval=$with_systemd_lib_dir; case "$withval" in + *) systemd_lib_dir="$withval" + ;; + esac + +fi + + +systemd_include_dir= + +# Check whether --with-systemd-include-dir was given. +if test ${with_systemd_include_dir+y} +then : + withval=$with_systemd_include_dir; case "$withval" in + *) systemd_include_dir="$withval" + ;; + esac + +fi + + +if test "x$WITH_SYSTEMD" = xyes; then + smart_try_dir="$systemd_lib_dir" + + +sm_lib_safe=`echo "systemd" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "sd_notify" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sd_notify in -lsystemd in $try" >&5 +printf %s "checking for sd_notify in -lsystemd in $try... " >&6; } + LIBS="-lsystemd $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char sd_notify(); +int +main (void) +{ +sd_notify() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lsystemd" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sd_notify in -lsystemd" >&5 +printf %s "checking for sd_notify in -lsystemd... " >&6; } + LIBS="-lsystemd $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char sd_notify(); +int +main (void) +{ +sd_notify() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lsystemd" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sd_notify in -lsystemd in $try" >&5 +printf %s "checking for sd_notify in -lsystemd in $try... " >&6; } + LIBS="-lsystemd $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char sd_notify(); +int +main (void) +{ +sd_notify() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lsystemd" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + + if test "x$ac_cv_lib_systemd_sd_notify" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: systemd library not found. Use --with-systemd-lib-dir=." >&5 +printf "%s\n" "$as_me: WARNING: systemd library not found. Use --with-systemd-lib-dir=." >&2;} + else + +printf "%s\n" "#define HAVE_SYSTEMD 1" >>confdefs.h + + HAVE_SYSTEMD=1 + SYSTEMD_LIBS="${smart_lib}" + SYSTEMD_LDFLAGS="${smart_ldflags}" + fi + LIBS="${old_LIBS}" +fi + +if test "x$HAVE_SYSTEMD" = x; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping test for systemd watchdog" >&5 +printf "%s\n" "$as_me: skipping test for systemd watchdog" >&6;} +else + smart_try_dir="$systemd_lib_dir" + + +sm_lib_safe=`echo "systemd" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "sd_watchdog_enabled" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sd_watchdog_enabled in -lsystemd in $try" >&5 +printf %s "checking for sd_watchdog_enabled in -lsystemd in $try... " >&6; } + LIBS="-lsystemd $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char sd_watchdog_enabled(); +int +main (void) +{ +sd_watchdog_enabled() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lsystemd" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sd_watchdog_enabled in -lsystemd" >&5 +printf %s "checking for sd_watchdog_enabled in -lsystemd... " >&6; } + LIBS="-lsystemd $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char sd_watchdog_enabled(); +int +main (void) +{ +sd_watchdog_enabled() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lsystemd" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sd_watchdog_enabled in -lsystemd in $try" >&5 +printf %s "checking for sd_watchdog_enabled in -lsystemd in $try... " >&6; } + LIBS="-lsystemd $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char sd_watchdog_enabled(); +int +main (void) +{ +sd_watchdog_enabled() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lsystemd" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + + if test "x$ac_cv_lib_systemd_sd_watchdog_enabled" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: systemd watchdog is only available from systemd 209." >&5 +printf "%s\n" "$as_me: WARNING: systemd watchdog is only available from systemd 209." >&2;} + else + +printf "%s\n" "#define HAVE_SYSTEMD_WATCHDOG 1" >>confdefs.h + + fi + LIBS="${old_LIBS}" +fi + +if test "x$WITH_SYSTEMD" != xyes || test "x$SYSTEMD_LIBS" = x; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping test for systemd/sd-daemon.h." >&5 +printf "%s\n" "$as_me: skipping test for systemd/sd-daemon.h." >&6;} +else + smart_try_dir="$systemd_include_dir" + + +ac_safe=`echo "systemd/sd-daemon.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for systemd/sd-daemon.h in $try" >&5 +printf %s "checking for systemd/sd-daemon.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/systemd/sd-daemon.h" >&5 +printf %s "checking for ${_prefix}/systemd/sd-daemon.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for systemd/sd-daemon.h" >&5 +printf %s "checking for systemd/sd-daemon.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 systemd/sd-daemon.h in $try" >&5 +printf %s "checking for systemd/sd-daemon.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + + if test "x$ac_cv_header_systemd_sdmdaemon_h" = "xyes"; then + +printf "%s\n" "#define HAVE_SYSTEMD_SD_DAEMON_H 1" >>confdefs.h + + + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: systemd headers not found. Use --with-systemd-include-dir=." >&5 +printf "%s\n" "$as_me: WARNING: systemd headers not found. Use --with-systemd-include-dir=." >&2;} + fi +fi + + +smart_try_dir="$talloc_include_dir" + + +ac_safe=`echo "talloc.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for talloc.h in $try" >&5 +printf %s "checking for talloc.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/talloc.h" >&5 +printf %s "checking for ${_prefix}/talloc.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for talloc.h" >&5 +printf %s "checking for talloc.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 talloc.h in $try" >&5 +printf %s "checking for talloc.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + +if test "x$ac_cv_header_talloc_h" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: talloc headers not found. Use --with-talloc-include-dir=." >&5 +printf "%s\n" "$as_me: WARNING: talloc headers not found. Use --with-talloc-include-dir=." >&2;} + as_fn_error $? "FreeRADIUS requires libtalloc" "$LINENO" 5 +fi + +case "$host" in + *-interix*) + CFLAGS="$CFLAGS -D_ALL_SOURCE" + ;; + *-darwin*) + +printf "%s\n" "#define __APPLE_USE_RFC_3542 1" >>confdefs.h + + ;; +esac + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main (void) +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_ac_Header=yes" +else $as_nop + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else $as_nop + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main (void) +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_opendir+y} +then : + break +fi +done +if test ${ac_cv_search_opendir+y} +then : + +else $as_nop + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + + + +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then + +printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi +# End of obsolete code. + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main (void) +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_header_sys_wait_h=yes +else $as_nop + ac_cv_header_sys_wait_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + + +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" +if test "x$ac_cv_header_crypt_h" = xyes +then : + printf "%s\n" "#define HAVE_CRYPT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "features.h" "ac_cv_header_features_h" "$ac_includes_default" +if test "x$ac_cv_header_features_h" = xyes +then : + printf "%s\n" "#define HAVE_FEATURES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fnmatch.h" "ac_cv_header_fnmatch_h" "$ac_includes_default" +if test "x$ac_cv_header_fnmatch_h" = xyes +then : + printf "%s\n" "#define HAVE_FNMATCH_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "glob.h" "ac_cv_header_glob_h" "$ac_includes_default" +if test "x$ac_cv_header_glob_h" = xyes +then : + printf "%s\n" "#define HAVE_GLOB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" +if test "x$ac_cv_header_grp_h" = xyes +then : + printf "%s\n" "#define HAVE_GRP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes +then : + printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/if_packet.h" "ac_cv_header_linux_if_packet_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_if_packet_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_IF_PACKET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" +if test "x$ac_cv_header_malloc_h" = xyes +then : + printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "prot.h" "ac_cv_header_prot_h" "$ac_includes_default" +if test "x$ac_cv_header_prot_h" = xyes +then : + printf "%s\n" "#define HAVE_PROT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "pwd.h" "ac_cv_header_pwd_h" "$ac_includes_default" +if test "x$ac_cv_header_pwd_h" = xyes +then : + printf "%s\n" "#define HAVE_PWD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "resource.h" "ac_cv_header_resource_h" "$ac_includes_default" +if test "x$ac_cv_header_resource_h" = xyes +then : + printf "%s\n" "#define HAVE_RESOURCE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" +if test "x$ac_cv_header_semaphore_h" = xyes +then : + printf "%s\n" "#define HAVE_SEMAPHORE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sia.h" "ac_cv_header_sia_h" "$ac_includes_default" +if test "x$ac_cv_header_sia_h" = xyes +then : + printf "%s\n" "#define HAVE_SIA_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "siad.h" "ac_cv_header_siad_h" "$ac_includes_default" +if test "x$ac_cv_header_siad_h" = xyes +then : + printf "%s\n" "#define HAVE_SIAD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_signal_h" = xyes +then : + printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default" +if test "x$ac_cv_header_stdatomic_h" = xyes +then : + printf "%s\n" "#define HAVE_STDATOMIC_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdalign.h" "ac_cv_header_stdalign_h" "$ac_includes_default" +if test "x$ac_cv_header_stdalign_h" = xyes +then : + printf "%s\n" "#define HAVE_STDALIGN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" +if test "x$ac_cv_header_stdbool_h" = xyes +then : + printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" +if test "x$ac_cv_header_stddef_h" = xyes +then : + printf "%s\n" "#define HAVE_STDDEF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" +if test "x$ac_cv_header_stdio_h" = xyes +then : + printf "%s\n" "#define HAVE_STDIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_event_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/fcntl.h" "ac_cv_header_sys_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FCNTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/prctl.h" "ac_cv_header_sys_prctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_prctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PRCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/procctl.h" "ac_cv_header_sys_procctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_procctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PROCCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ptrace.h" "ac_cv_header_sys_ptrace_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ptrace_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PTRACE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_resource_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/security.h" "ac_cv_header_sys_security_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_security_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SECURITY_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_un_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_wait_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" +if test "x$ac_cv_header_syslog_h" = xyes +then : + printf "%s\n" "#define HAVE_SYSLOG_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" +if test "x$ac_cv_header_utime_h" = xyes +then : + printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default" +if test "x$ac_cv_header_utmp_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default" +if test "x$ac_cv_header_utmpx_h" = xyes +then : + printf "%s\n" "#define HAVE_UTMPX_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "winsock.h" "ac_cv_header_winsock_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK_H 1" >>confdefs.h + +fi + + +ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + + +" +if test "x$ac_cv_header_net_if_h" = xyes +then : + printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h + +fi + + +if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes" +then + +printf "%s\n" "#define OSFC2 /**/" >>confdefs.h + +fi + +if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes" +then + +printf "%s\n" "#define OSFSIA /**/" >>confdefs.h + +fi + +if test "x$WITH_OPENSSL" = xyes; then + OLD_LIBS="$LIBS" + + CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5" + + smart_try_dir="$openssl_lib_dir" + + +sm_lib_safe=`echo "crypto" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "DH_new" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + 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 (void) +{ +DH_new() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcrypto" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { 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 (void) +{ +DH_new() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcrypto" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; 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 (void) +{ +DH_new() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lcrypto" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + + if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then + +printf "%s\n" "#define HAVE_LIBCRYPTO 1" >>confdefs.h + + OPENSSL_LIBS="$smart_lib" + OPENSSL_LDFLAGS="$smart_ldflags" + + + +sm_lib_safe=`echo "ssl" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "SSL_new" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl in $try" >&5 +printf %s "checking for SSL_new in -lssl in $try... " >&6; } + LIBS="-lssl $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char SSL_new(); +int +main (void) +{ +SSL_new() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lssl" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5 +printf %s "checking for SSL_new in -lssl... " >&6; } + LIBS="-lssl $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char SSL_new(); +int +main (void) +{ +SSL_new() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lssl" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl in $try" >&5 +printf %s "checking for SSL_new in -lssl in $try... " >&6; } + LIBS="-lssl $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char SSL_new(); +int +main (void) +{ +SSL_new() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lssl" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + + if test "x$ac_cv_lib_ssl_SSL_new" != "xyes"; then + { { 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 linking to libssl. Use --with-openssl-lib-dir=, or --with-openssl=no (builds without OpenSSL) +See \`config.log' for more details" "$LINENO" 5; } + else + +printf "%s\n" "#define HAVE_LIBSSL 1" >>confdefs.h + + OPENSSL_LIBS="$OPENSSL_LIBS $smart_lib" + + if test "$OPENSSL_LDFLAGS" != "$smart_ldflags"; then + { { 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 $? "\"inconsistent LDFLAGS between -lssl '$smart_ldflags' and -lcrypto '$OPENSSL_LDFLAGS'\" +See \`config.log' for more details" "$LINENO" 5; } + fi + fi + else + { { 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 linking to libcrypto. Use --with-openssl-lib-dir=, or --with-openssl=no (builds without OpenSSL) +See \`config.log' for more details" "$LINENO" 5; } + fi + + smart_try_dir="$openssl_include_dir" + + +ac_safe=`echo "openssl/ssl.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $try" >&5 +printf %s "checking for openssl/ssl.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/openssl/ssl.h" >&5 +printf %s "checking for ${_prefix}/openssl/ssl.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h" >&5 +printf %s "checking for openssl/ssl.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 openssl/ssl.h in $try" >&5 +printf %s "checking for openssl/ssl.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + + if test "x$ac_cv_header_openssl_ssl_h" = "xyes"; then + +printf "%s\n" "#define HAVE_OPENSSL_SSL_H 1" >>confdefs.h + + + for ac_header in openssl/asn1.h openssl/conf.h openssl/crypto.h openssl/err.h openssl/evp.h openssl/hmac.h openssl/md5.h openssl/md4.h openssl/rand.h openssl/sha.h openssl/ssl.h openssl/ocsp.h openssl/engine.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + OPENSSL_CPPFLAGS="$smart_include" +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 $? "failed locating OpenSSL headers. Use --with-openssl-include-dir=, or --with-openssl=no (builds without OpenSSL) +See \`config.log' for more details" "$LINENO" 5; } + + +fi + +done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL version >= 1.0.2" >&5 +printf %s "checking for OpenSSL version >= 1.0.2... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if (OPENSSL_VERSION_NUMBER >= 0x10002000L) + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + + { 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; } + { { 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 $? "OpenSSL version too old +See \`config.log' for more details" "$LINENO" 5; } + + +fi +rm -rf conftest* + + + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$OPENSSL_CPPFLAGS $CPPFLAGS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking OpenSSL library and header version consistency" >&5 +printf %s "checking OpenSSL library and header version consistency... " >&6; } + if test "$cross_compiling" = yes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compiling (assuming yes)" >&5 +printf "%s\n" "cross-compiling (assuming yes)" >&6; } + + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + printf("library: %lx header: %lx... ", (unsigned long) SSLeay(), (unsigned long) OPENSSL_VERSION_NUMBER); + if (SSLeay() == OPENSSL_VERSION_NUMBER) { + return 0; + } else { + return 1; + } + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + + { 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; } + { { 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 $? "OpenSSL library version does not match header version +See \`config.log' for more details" "$LINENO" 5; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + ac_fn_c_check_func "$LINENO" "SSL_get_client_random" "ac_cv_func_SSL_get_client_random" +if test "x$ac_cv_func_SSL_get_client_random" = xyes +then : + printf "%s\n" "#define HAVE_SSL_GET_CLIENT_RANDOM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "SSL_get_server_random" "ac_cv_func_SSL_get_server_random" +if test "x$ac_cv_func_SSL_get_server_random" = xyes +then : + printf "%s\n" "#define HAVE_SSL_GET_SERVER_RANDOM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "SSL_SESSION_get_master_key" "ac_cv_func_SSL_SESSION_get_master_key" +if test "x$ac_cv_func_SSL_SESSION_get_master_key" = xyes +then : + printf "%s\n" "#define HAVE_SSL_SESSION_GET_MASTER_KEY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "HMAC_CTX_new" "ac_cv_func_HMAC_CTX_new" +if test "x$ac_cv_func_HMAC_CTX_new" = xyes +then : + printf "%s\n" "#define HAVE_HMAC_CTX_NEW 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "HMAC_CTX_free" "ac_cv_func_HMAC_CTX_free" +if test "x$ac_cv_func_HMAC_CTX_free" = xyes +then : + printf "%s\n" "#define HAVE_HMAC_CTX_FREE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ASN1_STRING_get0_data" "ac_cv_func_ASN1_STRING_get0_data" +if test "x$ac_cv_func_ASN1_STRING_get0_data" = xyes +then : + printf "%s\n" "#define HAVE_ASN1_STRING_GET0_DATA 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "CONF_modules_load_file" "ac_cv_func_CONF_modules_load_file" +if test "x$ac_cv_func_CONF_modules_load_file" = xyes +then : + printf "%s\n" "#define HAVE_CONF_MODULES_LOAD_FILE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "CRYPTO_set_id_callback" "ac_cv_func_CRYPTO_set_id_callback" +if test "x$ac_cv_func_CRYPTO_set_id_callback" = xyes +then : + printf "%s\n" "#define HAVE_CRYPTO_SET_ID_CALLBACK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "CRYPTO_set_locking_callback" "ac_cv_func_CRYPTO_set_locking_callback" +if test "x$ac_cv_func_CRYPTO_set_locking_callback" = xyes +then : + printf "%s\n" "#define HAVE_CRYPTO_SET_LOCKING_CALLBACK 1" >>confdefs.h + +fi + + CPPFLAGS="$old_CPPFLAGS" + fi + + LIBS="$OLD_LIBS" + + + + export OPENSSL_LIBS OPENSSL_LDFLAGS OPENSSL_CPPFLAGS +fi + +if test "x$PCAP_LIBS" = x; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping test for pcap.h." >&5 +printf "%s\n" "$as_me: skipping test for pcap.h." >&6;} +else + smart_try_dir="$pcap_include_dir" + + +ac_safe=`echo "pcap.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap.h in $try" >&5 +printf %s "checking for pcap.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/pcap.h" >&5 +printf %s "checking for ${_prefix}/pcap.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap.h" >&5 +printf %s "checking for pcap.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 pcap.h in $try" >&5 +printf %s "checking for pcap.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + + if test "x$ac_cv_header_pcap_h" = "xyes" && test "x$ac_cv_lib_pcap_pcap_open_live" = "xyes"; then + +printf "%s\n" "#define HAVE_LIBPCAP 1" >>confdefs.h + + + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: pcap headers not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-include-dir=." >&5 +printf "%s\n" "$as_me: WARNING: pcap headers not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-include-dir=." >&2;} + fi +fi + +if test "x$COLLECTDC_LIBS" = x; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping test for collectd/client.h." >&5 +printf "%s\n" "$as_me: skipping test for collectd/client.h." >&6;} +else + smart_try_dir="$collectdclient_include_dir" + + +ac_safe=`echo "collectd/client.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for collectd/client.h in $try" >&5 +printf %s "checking for collectd/client.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/collectd/client.h" >&5 +printf %s "checking for ${_prefix}/collectd/client.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for collectd/client.h" >&5 +printf %s "checking for collectd/client.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 collectd/client.h in $try" >&5 +printf %s "checking for collectd/client.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + + if test "x$ac_cv_header_collectd_client_h" = "xyes"; then + +printf "%s\n" "#define HAVE_COLLECTDC_H 1" >>confdefs.h + + + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: collectdclient headers not found. Use --with-collectdclient-include-dir=." >&5 +printf "%s\n" "$as_me: WARNING: collectdclient headers not found. Use --with-collectdclient-include-dir=." >&2;} + fi +fi + +if test "x$HAVE_LIBCAP" = x; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping test for cap.h." >&5 +printf "%s\n" "$as_me: skipping test for cap.h." >&6;} +else + smart_try_dir="$cap_include_dir" + + +ac_safe=`echo "sys/capability.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/capability.h in $try" >&5 +printf %s "checking for sys/capability.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/sys/capability.h" >&5 +printf %s "checking for ${_prefix}/sys/capability.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/capability.h" >&5 +printf %s "checking for sys/capability.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 sys/capability.h in $try" >&5 +printf %s "checking for sys/capability.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + + if test "x$ac_cv_header_sys_capability_h" = "xyes"; then + +printf "%s\n" "#define HAVE_CAPABILITY_H 1" >>confdefs.h + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cap headers not found, will not perform debugger checks. Use --with-cap-include-dir=." >&5 +printf "%s\n" "$as_me: WARNING: cap headers not found, will not perform debugger checks. Use --with-cap-include-dir=." >&2;} + fi +fi + + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define off_t long int" >>confdefs.h + +fi + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + +fi + + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +printf %s "checking for uid_t in sys/types.h... " >&6; } +if test ${ac_cv_type_uid_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1 +then : + ac_cv_type_uid_t=yes +else $as_nop + ac_cv_type_uid_t=no +fi +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +printf "%s\n" "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +printf "%s\n" "#define uid_t int" >>confdefs.h + + +printf "%s\n" "#define gid_t int" >>confdefs.h + +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 +printf %s "checking for socklen_t... " >&6; } +if test ${ac_cv_type_socklen_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_socklen_t=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H + # include + #endif + + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + +int +main (void) +{ +socklen_t foo + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_socklen_t=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_socklen_t" >&5 +printf "%s\n" "$ac_cv_type_socklen_t" >&6; } + + if test "$ac_cv_type_socklen_t" != "yes"; then + +printf "%s\n" "#define socklen_t int" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint8_t" >&5 +printf %s "checking for uint8_t... " >&6; } +if test ${ac_cv_type_uint8_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_uint8_t=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + +int +main (void) +{ +uint8_t foo + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_uint8_t=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint8_t" >&5 +printf "%s\n" "$ac_cv_type_uint8_t" >&6; } + + if test "$ac_cv_type_uint8_t" != "yes"; then + +printf "%s\n" "#define uint8_t unsigned char" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint16_t" >&5 +printf %s "checking for uint16_t... " >&6; } +if test ${ac_cv_type_uint16_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_uint16_t=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + +int +main (void) +{ +uint16_t foo + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_uint16_t=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint16_t" >&5 +printf "%s\n" "$ac_cv_type_uint16_t" >&6; } + + if test "$ac_cv_type_uint16_t" != "yes"; then + +printf "%s\n" "#define uint16_t unsigned short" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint32_t" >&5 +printf %s "checking for uint32_t... " >&6; } +if test ${ac_cv_type_uint32_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_uint32_t=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + +int +main (void) +{ +uint32_t foo + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_uint32_t=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint32_t" >&5 +printf "%s\n" "$ac_cv_type_uint32_t" >&6; } + + if test "$ac_cv_type_uint32_t" != "yes"; then + +printf "%s\n" "#define uint32_t unsigned int" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint64_t" >&5 +printf %s "checking for uint64_t... " >&6; } +if test ${ac_cv_type_uint64_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_uint64_t=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + +int +main (void) +{ +uint64_t foo + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_type_uint64_t=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint64_t" >&5 +printf "%s\n" "$ac_cv_type_uint64_t" >&6; } + + if test "$ac_cv_type_uint64_t" != "yes"; then + +printf "%s\n" "#define uint64_t unsigned long long" >>confdefs.h + + fi + + +ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default" +if test "x$ac_cv_type___uint128_t" = xyes +then : + +printf "%s\n" "#define HAVE___UINT128_T 1" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "uint128_t" "ac_cv_type_uint128_t" " + #ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + + +" +if test "x$ac_cv_type_uint128_t" = xyes +then : + +printf "%s\n" "#define HAVE_UINT128_T 1" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" " + #ifdef HAVE_NETINET_IN_H + # include + #endif + + +" +if test "x$ac_cv_type_struct_in6_addr" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " + #ifdef HAVE_NETINET_IN_H + # include + #endif + + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" " + #ifdef HAVE_NETINET_IN_H + # include + #endif + +" +if test "x$ac_cv_type_struct_sockaddr_in6" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h + +fi + + +ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" " + #ifdef HAVE_SYS_TYPES_H + # include + #endif + + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + + #ifdef HAVE_NETDB_H + # include + #endif + + +" +if test "x$ac_cv_type_struct_addrinfo" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sig_t is defined" >&5 +printf %s "checking if sig_t is defined... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef HAVE_SIGNAL_H + # include + #endif + +int +main (void) +{ + + sig_t func; + return 0; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_SIG_T 1" >>confdefs.h + + +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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +ac_fn_c_check_func "$LINENO" "bindat" "ac_cv_func_bindat" +if test "x$ac_cv_func_bindat" = xyes +then : + printf "%s\n" "#define HAVE_BINDAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "closefrom" "ac_cv_func_closefrom" +if test "x$ac_cv_func_closefrom" = xyes +then : + printf "%s\n" "#define HAVE_CLOSEFROM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ctime_r" "ac_cv_func_ctime_r" +if test "x$ac_cv_func_ctime_r" = xyes +then : + printf "%s\n" "#define HAVE_CTIME_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "dladdr" "ac_cv_func_dladdr" +if test "x$ac_cv_func_dladdr" = xyes +then : + printf "%s\n" "#define HAVE_DLADDR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fcntl" "ac_cv_func_fcntl" +if test "x$ac_cv_func_fcntl" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fopencookie" "ac_cv_func_fopencookie" +if test "x$ac_cv_func_fopencookie" = xyes +then : + printf "%s\n" "#define HAVE_FOPENCOOKIE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "funopen" "ac_cv_func_funopen" +if test "x$ac_cv_func_funopen" = xyes +then : + printf "%s\n" "#define HAVE_FUNOPEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" +if test "x$ac_cv_func_getaddrinfo" = xyes +then : + printf "%s\n" "#define HAVE_GETADDRINFO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" +if test "x$ac_cv_func_getnameinfo" = xyes +then : + printf "%s\n" "#define HAVE_GETNAMEINFO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" +if test "x$ac_cv_func_getopt_long" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_LONG 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid" +if test "x$ac_cv_func_getpeereid" = xyes +then : + printf "%s\n" "#define HAVE_GETPEEREID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getresuid" "ac_cv_func_getresuid" +if test "x$ac_cv_func_getresuid" = xyes +then : + printf "%s\n" "#define HAVE_GETRESUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getusershell" "ac_cv_func_getusershell" +if test "x$ac_cv_func_getusershell" = xyes +then : + printf "%s\n" "#define HAVE_GETUSERSHELL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" +if test "x$ac_cv_func_gmtime_r" = xyes +then : + printf "%s\n" "#define HAVE_GMTIME_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "if_indextoname" "ac_cv_func_if_indextoname" +if test "x$ac_cv_func_if_indextoname" = xyes +then : + printf "%s\n" "#define HAVE_IF_INDEXTONAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" +if test "x$ac_cv_func_inet_aton" = xyes +then : + printf "%s\n" "#define HAVE_INET_ATON 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" +if test "x$ac_cv_func_inet_ntop" = xyes +then : + printf "%s\n" "#define HAVE_INET_NTOP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes +then : + printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups" +if test "x$ac_cv_func_initgroups" = xyes +then : + printf "%s\n" "#define HAVE_INITGROUPS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" +if test "x$ac_cv_func_kqueue" = xyes +then : + printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" +if test "x$ac_cv_func_localtime_r" = xyes +then : + printf "%s\n" "#define HAVE_LOCALTIME_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mallopt" "ac_cv_func_mallopt" +if test "x$ac_cv_func_mallopt" = xyes +then : + printf "%s\n" "#define HAVE_MALLOPT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkdirat" "ac_cv_func_mkdirat" +if test "x$ac_cv_func_mkdirat" = xyes +then : + printf "%s\n" "#define HAVE_MKDIRAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "openat" "ac_cv_func_openat" +if test "x$ac_cv_func_openat" = xyes +then : + printf "%s\n" "#define HAVE_OPENAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pthread_sigmask" "ac_cv_func_pthread_sigmask" +if test "x$ac_cv_func_pthread_sigmask" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setlinebuf" "ac_cv_func_setlinebuf" +if test "x$ac_cv_func_setlinebuf" = xyes +then : + printf "%s\n" "#define HAVE_SETLINEBUF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid" +if test "x$ac_cv_func_setresuid" = xyes +then : + printf "%s\n" "#define HAVE_SETRESUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setsid" "ac_cv_func_setsid" +if test "x$ac_cv_func_setsid" = xyes +then : + printf "%s\n" "#define HAVE_SETSID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setuid" "ac_cv_func_setuid" +if test "x$ac_cv_func_setuid" = xyes +then : + printf "%s\n" "#define HAVE_SETUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setvbuf" "ac_cv_func_setvbuf" +if test "x$ac_cv_func_setvbuf" = xyes +then : + printf "%s\n" "#define HAVE_SETVBUF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" +if test "x$ac_cv_func_sigaction" = xyes +then : + printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" +if test "x$ac_cv_func_sigprocmask" = xyes +then : + printf "%s\n" "#define HAVE_SIGPROCMASK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" +if test "x$ac_cv_func_strlcat" = xyes +then : + printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" +if test "x$ac_cv_func_strlcpy" = xyes +then : + printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" +if test "x$ac_cv_func_strsep" = xyes +then : + printf "%s\n" "#define HAVE_STRSEP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal" +if test "x$ac_cv_func_strsignal" = xyes +then : + printf "%s\n" "#define HAVE_STRSIGNAL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "unlinkat" "ac_cv_func_unlinkat" +if test "x$ac_cv_func_unlinkat" = xyes +then : + printf "%s\n" "#define HAVE_UNLINKAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vdprintf" "ac_cv_func_vdprintf" +if test "x$ac_cv_func_vdprintf" = xyes +then : + printf "%s\n" "#define HAVE_VDPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes +then : + printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h + +fi + + +if test "x$ac_cv_header_utmpx_h" = "xyes"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ut_xtime in struct utmpx" >&5 +printf %s "checking for ut_xtime in struct utmpx... " >&6; } + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_STDDEF_H +#include +#endif +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) +#endif + +int +main (void) +{ + int foo = offsetof(struct utmpx, ut_xtime) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + has_element=" " +else $as_nop + has_element= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + ac_safe_type=`echo "struct utmpx" | sed 'y% %_%'` + if test "x$has_element" != "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ut_xtime=yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ut_xtime=" + fi + + if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"; then + +printf "%s\n" "#define ut_xtime ut_tv.tv_sec" >>confdefs.h + + fi +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ipi_addr in struct in_pktinfo" >&5 +printf %s "checking for ipi_addr in struct in_pktinfo... " >&6; } + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_STDDEF_H +#include +#endif +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) +#endif + +int +main (void) +{ + int foo = offsetof(struct in_pktinfo, ipi_addr) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + has_element=" " +else $as_nop + has_element= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + ac_safe_type=`echo "struct in_pktinfo" | sed 'y% %_%'` + if test "x$has_element" != "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ipi_addr=yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ipi_addr=" + fi + +if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"; then + +printf "%s\n" "#define HAVE_IP_PKTINFO /**/" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ipi6_addr in struct in6_pktinfo" >&5 +printf %s "checking for ipi6_addr in struct in6_pktinfo... " >&6; } + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_STDDEF_H +#include +#endif +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) +#endif + +int +main (void) +{ + int foo = offsetof(struct in6_pktinfo, ipi6_addr) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + has_element=" " +else $as_nop + has_element= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + ac_safe_type=`echo "struct in6_pktinfo" | sed 'y% %_%'` + if test "x$has_element" != "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ipi6_addr=yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + eval "ac_cv_type_${ac_safe_type}_has_ipi6_addr=" + fi + +if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"; then + +printf "%s\n" "#define HAVE_IN6_PKTINFO /**/" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if htonll is defined" >&5 +printf %s "checking if htonll is defined... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + return htonll(0); + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_HTONLL 1" >>confdefs.h + + +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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if htonlll is defined" >&5 +printf %s "checking if htonlll is defined... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + return htonlll(0); + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_HTONLLL 1" >>confdefs.h + + +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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else $as_nop + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf "%s\n" "#define const /**/" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking type of OS" >&5 +printf %s "checking type of OS... " >&6; } +OS=`uname -s` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OS" >&5 +printf "%s\n" "$OS" >&6; } +if test "$OS" = "OS/2"; then + LIBPREFIX= +else + LIBPREFIX=lib +fi + + +if test "x$developer" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Setting additional developer CFLAGS" >&5 +printf "%s\n" "$as_me: Setting additional developer CFLAGS" >&6;} + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Wdocumentation\"" >&5 +printf %s "checking for the compiler flag \"-Wdocumentation\"... " >&6; } +if test ${ax_cv_cc_wdocumentation_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -Wdocumentation" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_wdocumentation_flag="yes" +else $as_nop + ax_cv_cc_wdocumentation_flag="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_wdocumentation_flag" >&5 +printf "%s\n" "$ax_cv_cc_wdocumentation_flag" >&6; } + + if test "x$ax_cv_cc_wdocumentation_flag" = "xyes"; then + devcflags="-Wdocumentation" + +printf "%s\n" "#define HAVE_WDOCUMENTATION 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Weverything\"" >&5 +printf %s "checking for the compiler flag \"-Weverything\"... " >&6; } +if test ${ax_cv_cc_weverything_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -Weverything -Wno-reserved-id-macro -Wno-unused-macros -Wno-unreachable-code-return -Wno-poison-system-directories" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_weverything_flag="yes" +else $as_nop + ax_cv_cc_weverything_flag="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_weverything_flag" >&5 +printf "%s\n" "$ax_cv_cc_weverything_flag" >&6; } + + if test "x$ax_cv_cc_weverything_flag" = "xyes"; then + devcflags="$devcflags -W -Weverything -Wformat=2 -Wno-missing-field-initializers -Wno-date-time -Wno-padded -Wno-gnu-zero-variadic-macro-arguments -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-conversion -Wno-switch-enum -Wno-gnu-statement-expression -Wno-extended-offsetof -Wno-cast-align -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-packed $verify_ptr $fips" + else + if test "x$GCC" = "xyes"; then + devcflags="$devcflags -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wno-cast-align -Wformat-nonliteral -Wformat-security -Wformat=2 $verify_ptr $fips" + INSTALLSTRIP="" + fi + fi + + fsanitizeflags= + + if test "x$fuzzer" = "xyes" && test "x$ax_cv_cc_clang" = "xyes"; then + fsanitizeflags="$fsanitizeflags,fuzzer" + fi + + if test "x$address_sanitizer" = "xyes"; then + devcflags="$devcflags -fno-omit-frame-pointer -fno-optimize-sibling-calls" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-fsanitize-address-use-after-scope\"" >&5 +printf %s "checking for the compiler flag \"-fsanitize-address-use-after-scope\"... " >&6; } +if test ${ax_cv_cc_sanitize_address_use_after_scope+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -fsanitize=address -fsanitize-address-use-after-scope" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_cc_sanitize_address_use_after_scope="yes" +else $as_nop + ax_cv_cc_sanitize_address_use_after_scope="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_sanitize_address_use_after_scope" >&5 +printf "%s\n" "$ax_cv_cc_sanitize_address_use_after_scope" >&6; } + + if test "x$ax_cv_cc_sanitize_address_use_after_scope" = "xyes"; then + devcflags="$devcflags -fsanitize-address-use-after-scope" + fi + + ac_fn_c_check_header_compile "$LINENO" "sanitizer/lsan_interface.h" "ac_cv_header_sanitizer_lsan_interface_h" "$ac_includes_default" +if test "x$ac_cv_header_sanitizer_lsan_interface_h" = xyes +then : + printf "%s\n" "#define HAVE_SANITIZER_LSAN_INTERFACE_H 1" >>confdefs.h + +fi + + fsanitizeflags="$fsanitizeflags,address" + fi + + if test "x$leak_sanitizer" = "xyes"; then + fsanitizeflags="$fsanitizeflags,leak" + fi + + if test "x$thread_sanitizer" = "xyes"; then + fsanitizeflags="$fsanitizeflags,thread" + fi + + if test "x$undefined_behaviour_sanitizer" = "xyes"; then + devcflags="$devcflags -fno-sanitize-recover=undefined -fno-omit-frame-pointer" + devldflags="$devldflags -fno-sanitize-recover=undefined" + fsanitizeflags="$fsanitizeflags,undefined" + fi + + if test "x$fsanitizeflags" != "x"; then + fsanitizeflags="$(echo $fsanitizeflags | sed 's/^,*//')" + devcflags="-fsanitize=$fsanitizeflags $devcflags" + devldflags="-fsanitize=$fsanitizeflags $devldflags" + fi + + devcflags="$(echo $devcflags | sed -e 's/\\t//g;s/ //g')" + devldflags="$(echo $devldflags | sed -e 's/\\t//g;s/ //g')" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Developer CFLAGS are \"$devcflags\"" >&5 +printf "%s\n" "$as_me: Developer CFLAGS are \"$devcflags\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Developer LDFLAGS are \"$devldflags\"" >&5 +printf "%s\n" "$as_me: Developer LDFLAGS are \"$devldflags\"" >&6;} + + if test "x$EXPERIMENTAL" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: is developer build, enabling experimental modules implicitly, disable with --without-experimental-modules" >&5 +printf "%s\n" "$as_me: is developer build, enabling experimental modules implicitly, disable with --without-experimental-modules" >&6;} + EXPERIMENTAL=yes + fi +else + devcflags="" + devldflags="" + CFLAGS="$CFLAGS -DNDEBUG" + INSTALLSTRIP="" +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if building with -DNDEBUG" >&5 +printf %s "checking if building with -DNDEBUG... " >&6; } +if echo "$CFLAGS" | grep '\-DNDEBUG' > /dev/null; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define WITH_NDEBUG 1" >>confdefs.h + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + +export EXPERIMENTAL + +if test -d $srcdir/.git -a "x$GIT" = "xyes"; then + RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1 | cut -c1-9` + +printf "%s\n" "#define RADIUSD_VERSION_COMMIT ${RADIUSD_VERSION_COMMIT}" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __thread support in compiler" >&5 +printf %s "checking for __thread support in compiler... " >&6; } + if test "$cross_compiling" = yes +then : + have_tls=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + static __thread int val; + int main(int argc, char **argv) { + val = 0; + return val; + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + have_tls=yes +else $as_nop + have_tls=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_tls" >&5 +printf "%s\n" "$have_tls" >&6; } + if test "x$have_tls" = "xyes"; then + +printf "%s\n" "#define TLS_STORAGE_CLASS __thread" >>confdefs.h + + fi + + if test "x$have_tls" = "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __declspec(thread) support in compiler" >&5 +printf %s "checking for __declspec(thread) support in compiler... " >&6; } + if test "$cross_compiling" = yes +then : + have_tls=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + static _Thread_local int val; + int main(int argc, char **argv) { + val = 0; + return val; + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + have_tls=yes +else $as_nop + have_tls=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_tls" >&5 +printf "%s\n" "$have_tls" >&6; } + if test "x$have_tls" = "xyes"; then + +printf "%s\n" "#define TLS_STORAGE_CLASS __declspec(thread)" >>confdefs.h + + fi + fi + if test "x$have_tls" = "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Thread_local support in compiler" >&5 +printf %s "checking for _Thread_local support in compiler... " >&6; } + if test "$cross_compiling" = yes +then : + have_tls=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + static _Thread_local int val; + int main(int argc, char **argv) { + val = 0; + return val; + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + have_tls=yes +else $as_nop + have_tls=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_tls" >&5 +printf "%s\n" "$have_tls" >&6; } + if test "x$have_tls" = "xyes"; then + +printf "%s\n" "#define TLS_STORAGE_CLASS _Thread_local" >>confdefs.h + + fi + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_choose_expr support in compiler" >&5 +printf %s "checking for __builtin_choose_expr support in compiler... " >&6; } +if test ${ax_cv_cc_builtin_choose_expr+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + if test "$cross_compiling" = yes +then : + { { 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 run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + int main(int argc, char **argv) { + if ((argc < 0) || !argv) return 1; /* -Werror=unused-parameter */ + return __builtin_choose_expr(0, 1, 0); + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ax_cv_cc_builtin_choose_expr=yes +else $as_nop + ax_cv_cc_builtin_choose_expr=no + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_builtin_choose_expr" >&5 +printf "%s\n" "$ax_cv_cc_builtin_choose_expr" >&6; } + if test "x$ax_cv_cc_builtin_choose_expr" = "xyes"; then + +printf "%s\n" "#define HAVE_BUILTIN_CHOOSE_EXPR 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p support in compiler" >&5 +printf %s "checking for __builtin_types_compatible_p support in compiler... " >&6; } +if test ${ax_cv_cc_builtin_types_compatible_p+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + if test "$cross_compiling" = yes +then : + { { 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 run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + int main(int argc, char **argv) { + if ((argc < 0) || !argv) return 1; /* -Werror=unused-parameter */ + return !(__builtin_types_compatible_p(char *, char *)); + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ax_cv_cc_builtin_types_compatible_p=yes +else $as_nop + ax_cv_cc_builtin_types_compatible_p=no + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_builtin_types_compatible_p" >&5 +printf "%s\n" "$ax_cv_cc_builtin_types_compatible_p" >&6; } + if test "x$ax_cv_cc_builtin_types_compatible_p" = "xyes"; then + +printf "%s\n" "#define HAVE_BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap64 support in compiler" >&5 +printf %s "checking for __builtin_bswap64 support in compiler... " >&6; } +if test ${ax_cv_cc_builtin_bswap64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + if test "$cross_compiling" = yes +then : + { { 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 run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + int main(int argc, char **argv) { + if ((argc < 0) || !argv) return 1; /* -Werror=unused-parameter */ + return (__builtin_bswap64(0)); + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ax_cv_cc_builtin_bswap64=yes +else $as_nop + ax_cv_cc_builtin_bswap64=no + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_builtin_bswap64" >&5 +printf "%s\n" "$ax_cv_cc_builtin_bswap64" >&6; } + if test "x$ax_cv_cc_builtin_bswap64" = "xyes"; then + +printf "%s\n" "#define HAVE_BUILTIN_BSWAP_64 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __attribute__((__bounded__)) support in compiler" >&5 +printf %s "checking for __attribute__((__bounded__)) support in compiler... " >&6; } +if test ${ax_cv_cc_bounded_attribute+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror" + if test "$cross_compiling" = yes +then : + { { 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 run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + void test(char *buff) __attribute__ ((__bounded__ (__string__, 1, 1))); + int main(int argc, char **argv) { + if ((argc < 0) || !argv) return 1; /* -Werror=unused-parameter */ + return 0; + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ax_cv_cc_bounded_attribute=yes +else $as_nop + ax_cv_cc_bounded_attribute=no + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + CFLAGS="$CFLAGS_SAVED" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_bounded_attribute" >&5 +printf "%s\n" "$ax_cv_cc_bounded_attribute" >&6; } + if test "x$ax_cv_cc_bounded_attribute" = "xyes"; then + +printf "%s\n" "#define HAVE_ATTRIBUTE_BOUNDED 1" >>confdefs.h + + fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for talloc_set_memlimit in -ltalloc" >&5 +printf %s "checking for talloc_set_memlimit in -ltalloc... " >&6; } +if test ${ac_cv_lib_talloc_talloc_set_memlimit+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltalloc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char talloc_set_memlimit (); +int +main (void) +{ +return talloc_set_memlimit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_talloc_talloc_set_memlimit=yes +else $as_nop + ac_cv_lib_talloc_talloc_set_memlimit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_talloc_talloc_set_memlimit" >&5 +printf "%s\n" "$ac_cv_lib_talloc_talloc_set_memlimit" >&6; } +if test "x$ac_cv_lib_talloc_talloc_set_memlimit" = xyes +then : + + +printf "%s\n" "#define HAVE_TALLOC_SET_MEMLIMIT 1" >>confdefs.h + + + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 +printf %s "checking for crypt in -lcrypt... " >&6; } +if test ${ac_cv_lib_crypt_crypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char crypt (); +int +main (void) +{ +return crypt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypt_crypt=yes +else $as_nop + ac_cv_lib_crypt_crypt=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 +printf "%s\n" "$ac_cv_lib_crypt_crypt" >&6; } +if test "x$ac_cv_lib_crypt_crypt" = xyes +then : + CRYPTLIB="-lcrypt" + +fi + + +if test "$CRYPTLIB" != ""; then + +printf "%s\n" "#define HAVE_CRYPT /**/" >>confdefs.h + +else + ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt" +if test "x$ac_cv_func_crypt" = xyes +then : + +printf "%s\n" "#define HAVE_CRYPT /**/" >>confdefs.h + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypt_r in -lcrypt" >&5 +printf %s "checking for crypt_r in -lcrypt... " >&6; } +if test ${ac_cv_lib_crypt_crypt_r+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char crypt_r (); +int +main (void) +{ +return crypt_r (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypt_crypt_r=yes +else $as_nop + ac_cv_lib_crypt_crypt_r=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt_r" >&5 +printf "%s\n" "$ac_cv_lib_crypt_crypt_r" >&6; } +if test "x$ac_cv_lib_crypt_crypt_r" = xyes +then : + +printf "%s\n" "#define HAVE_CRYPT_R /**/" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setkey in -lcipher" >&5 +printf %s "checking for setkey in -lcipher... " >&6; } +if test ${ac_cv_lib_cipher_setkey+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcipher $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char setkey (); +int +main (void) +{ +return setkey (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_cipher_setkey=yes +else $as_nop + ac_cv_lib_cipher_setkey=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cipher_setkey" >&5 +printf "%s\n" "$ac_cv_lib_cipher_setkey" >&6; } +if test "x$ac_cv_lib_cipher_setkey" = xyes +then : + CRYPTLIB="${CRYPTLIB} -lcipher" + +fi + + + +execinfo_lib_dir= + +# Check whether --with-execinfo-lib-dir was given. +if test ${with_execinfo_lib_dir+y} +then : + withval=$with_execinfo_lib_dir; case "$withval" in + no) + as_fn_error $? "Need execinfo-lib-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + execinfo_lib_dir="$withval" + ;; + esac + +fi + + +execinfo_include_dir= + +# Check whether --with-execinfo-include-dir was given. +if test ${with_execinfo_include_dir+y} +then : + withval=$with_execinfo_include_dir; case "$withval" in + no) + as_fn_error $? "Need execinfo-include-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + execinfo_include_dir="$withval" + ;; + esac + +fi + + +smart_try_dir=$execinfo_include_dir + + +ac_safe=`echo "execinfo.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for execinfo.h in $try" >&5 +printf %s "checking for execinfo.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/execinfo.h" >&5 +printf %s "checking for ${_prefix}/execinfo.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for execinfo.h" >&5 +printf %s "checking for execinfo.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 execinfo.h in $try" >&5 +printf %s "checking for execinfo.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + +if test "x$ac_cv_header_execinfo_h" = "xyes"; then + smart_try_dir=$execinfo_lib_dir + + +sm_lib_safe=`echo "execinfo" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "backtrace_symbols" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for backtrace_symbols in -lexecinfo in $try" >&5 +printf %s "checking for backtrace_symbols in -lexecinfo in $try... " >&6; } + LIBS="-lexecinfo $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char backtrace_symbols(); +int +main (void) +{ +backtrace_symbols() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lexecinfo" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for backtrace_symbols in -lexecinfo" >&5 +printf %s "checking for backtrace_symbols in -lexecinfo... " >&6; } + LIBS="-lexecinfo $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char backtrace_symbols(); +int +main (void) +{ +backtrace_symbols() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lexecinfo" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for backtrace_symbols in -lexecinfo in $try" >&5 +printf %s "checking for backtrace_symbols in -lexecinfo in $try... " >&6; } + LIBS="-lexecinfo $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char backtrace_symbols(); +int +main (void) +{ +backtrace_symbols() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lexecinfo" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + + if test "x$ac_cv_lib_execinfo_backtrace_symbols" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if execinfo provided as part of libc" >&5 +printf %s "checking if execinfo provided as part of libc... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + void *sym[1]; + backtrace_symbols(&sym, sizeof(sym)) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_lib_execinfo_backtrace_symbols="yes" + +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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + + if test "x$ac_cv_lib_execinfo_backtrace_symbols" = "xyes"; then + +printf "%s\n" "#define HAVE_EXECINFO 1" >>confdefs.h + + fi +fi + +PCRE=yes + +# Check whether --with-pcre was given. +if test ${with_pcre+y} +then : + withval=$with_pcre; case "$withval" in + no) + PCRE=no + ;; + yes) + PCRE=yes + ;; + esac + +fi + + +pcre_lib_dir= + +# Check whether --with-pcre-lib-dir was given. +if test ${with_pcre_lib_dir+y} +then : + withval=$with_pcre_lib_dir; case "$withval" in + no) + as_fn_error $? "Need pcre-lib-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + pcre_lib_dir="$withval" + ;; + esac + +fi + + +pcre_include_dir= + +# Check whether --with-pcre-include-dir was given. +if test ${with_pcre_include_dir+y} +then : + withval=$with_pcre_include_dir; case "$withval" in + no) + as_fn_error $? "Need pcre-include-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + pcre_include_dir="$withval" + ;; + esac + +fi + + +REGEX= + +# Check whether --with-regex was given. +if test ${with_regex+y} +then : + withval=$with_regex; case "$withval" in + no) + REGEX=no + ;; + *) + ;; + esac + +fi + + +if test "x$REGEX" != "xno" && test "x$PCRE" != "xno"; then + smart_try_dir=$pcre_include_dir + + +ac_safe=`echo "pcre.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcre.h in $try" >&5 +printf %s "checking for pcre.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/pcre.h" >&5 +printf %s "checking for ${_prefix}/pcre.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcre.h" >&5 +printf %s "checking for pcre.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 pcre.h in $try" >&5 +printf %s "checking for pcre.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + + if test "x$ac_cv_header_pcre_h" = "xyes"; then + smart_try_dir=$pcre_lib_dir + + +sm_lib_safe=`echo "pcre" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "pcre_compile" | sed 'y%./+-%__p_%'` + +old_LIBS="$LIBS" +old_CPPFLAGS="$CPPFLAGS" +smart_lib= +smart_ldflags= +smart_lib_dir= + +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre in $try" >&5 +printf %s "checking for pcre_compile in -lpcre in $try... " >&6; } + LIBS="-lpcre $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char pcre_compile(); +int +main (void) +{ +pcre_compile() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lpcre" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS="$old_LIBS" + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_lib" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +printf %s "checking for pcre_compile in -lpcre... " >&6; } + LIBS="-lpcre $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char pcre_compile(); +int +main (void) +{ +pcre_compile() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lpcre" + { 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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" +fi + +if test "x$smart_lib" = "x"; then + for try in /usr/local/lib /opt/lib; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre in $try" >&5 +printf %s "checking for pcre_compile in -lpcre in $try... " >&6; } + LIBS="-lpcre $old_LIBS" + CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char pcre_compile(); +int +main (void) +{ +pcre_compile() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + smart_lib="-lpcre" + smart_ldflags="-L$try -Wl,-rpath,$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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + 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" +fi + + if test "x$ac_cv_lib_pcre_pcre_compile" = "xyes"; then + REGEX=yes + +printf "%s\n" "#define HAVE_PCRE 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_BINSAFE_REGEX 1" >>confdefs.h + + fi + fi +fi + +if test "x$REGEX" = "x"; then + smart_try_dir= + + +ac_safe=`echo "regex.h" | sed 'y%./+-%__pm%'` +old_CPPFLAGS="$CPPFLAGS" +smart_include= +smart_include_dir="/usr/local/include /opt/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_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 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for regex.h in $try" >&5 +printf %s "checking for regex.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done + CPPFLAGS="$old_CPPFLAGS" +fi + +if test "x$smart_include" = "x"; then + for _prefix in $smart_prefix; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${_prefix}/regex.h" >&5 +printf %s "checking for ${_prefix}/regex.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem ${_prefix}/" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.beam conftest.$ac_ext + done +fi + +if test "x$smart_include" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for regex.h" >&5 +printf %s "checking for regex.h... " >&6; } + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include=" " + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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 regex.h in $try" >&5 +printf %s "checking for regex.h in $try... " >&6; } + CPPFLAGS="-isystem $try $old_CPPFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main (void) +{ +int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + smart_include="-isystem $try" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + break + +else $as_nop + + 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.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" +fi + +smart_prefix= + + if test "x$ac_cv_header_regex_h" = "xyes"; then + REGEX=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for extended regular expressions" >&5 +printf %s "checking for extended regular expressions... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifdef REG_EXTENDED + yes + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1 +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_REG_EXTENDED 1" >>confdefs.h + + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + +fi +rm -rf conftest* + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for regcomp in -lregex" >&5 +printf %s "checking for regcomp in -lregex... " >&6; } +if test ${ac_cv_lib_regex_regcomp+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lregex $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char regcomp (); +int +main (void) +{ +return regcomp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_regex_regcomp=yes +else $as_nop + ac_cv_lib_regex_regcomp=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_regex_regcomp" >&5 +printf "%s\n" "$ac_cv_lib_regex_regcomp" >&6; } +if test "x$ac_cv_lib_regex_regcomp" = xyes +then : + + LIBS="-lregex $LIBS" + + +fi + + + ac_fn_c_check_func "$LINENO" "regncomp" "ac_cv_func_regncomp" +if test "x$ac_cv_func_regncomp" = xyes +then : + printf "%s\n" "#define HAVE_REGNCOMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "regnexec" "ac_cv_func_regnexec" +if test "x$ac_cv_func_regnexec" = xyes +then : + printf "%s\n" "#define HAVE_REGNEXEC 1" >>confdefs.h + +fi + + if test x"$ac_cv_func_regncomp" = x"yes" && test x"$ac_cv_func_regnexec" = x"yes"; then + +printf "%s\n" "#define HAVE_BINSAFE_REGEX 1" >>confdefs.h + + fi + fi +fi + +# +# Some platforms require an explicit -latomic +# +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing __atomic_load_4" >&5 +printf %s "checking for library containing __atomic_load_4... " >&6; } +if test ${ac_cv_search___atomic_load_4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char __atomic_load_4 (); +int +main (void) +{ +return __atomic_load_4 (); + ; + return 0; +} +_ACEOF +for ac_lib in '' atomic +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search___atomic_load_4=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search___atomic_load_4+y} +then : + break +fi +done +if test ${ac_cv_search___atomic_load_4+y} +then : + +else $as_nop + ac_cv_search___atomic_load_4=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search___atomic_load_4" >&5 +printf "%s\n" "$ac_cv_search___atomic_load_4" >&6; } +ac_res=$ac_cv_search___atomic_load_4 +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +if test "x$REGEX" = "xyes"; then + +printf "%s\n" "#define HAVE_REGEX 1" >>confdefs.h + +fi + + +printf "%s\n" "#define GNUSTYLE 1" >>confdefs.h + + + +printf "%s\n" "#define SYSVSTYLE 2" >>confdefs.h + + + +printf "%s\n" "#define BSDSTYLE 3" >>confdefs.h + + +gethostbyaddrrstyle="" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyaddr_r() syntax" >&5 +printf %s "checking gethostbyaddr_r() syntax... " >&6; } +case "$host" in + *-freebsd*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { 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 make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "gethostbyaddr_r" "ac_cv_have_decl_gethostbyaddr_r" " + #ifdef HAVE_NETDB_H + #include + #endif + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_gethostbyaddr_r" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_GETHOSTBYADDR_R $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + +else $as_nop + + +printf "%s\n" "#define GETHOSTBYADDRRSTYLE BSDSTYLE" >>confdefs.h + + gethostbyaddrrstyle=BSD + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: FreeBSD overridden to BSD-style" >&5 +printf "%s\n" "$as_me: WARNING: FreeBSD overridden to BSD-style" >&2;} + +fi + + ;; +esac + +if test "x$gethostbyaddrrstyle" = "x"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define GETHOSTBYADDRRSTYLE GNUSTYLE" >>confdefs.h + + gethostbyaddrrstyle=GNU + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +if test "x$gethostbyaddrrstyle" = "x"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define GETHOSTBYADDRRSTYLE SYSVSTYLE" >>confdefs.h + + gethostbyaddrrstyle=SYSV + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + + +if test "x$gethostbyaddrrstyle" = "x"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + gethostbyaddr(NULL, 0, 0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define GETHOSTBYADDRRSTYLE BSDSTYLE" >>confdefs.h + + gethostbyaddrrstyle=BSD + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +if test "x$gethostbyaddrrstyle" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none! It must not exist, here." >&5 +printf "%s\n" "none! It must not exist, here." >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${gethostbyaddrrstyle}-style" >&5 +printf "%s\n" "${gethostbyaddrrstyle}-style" >&6; } +fi + +if test "x$gethostbyaddrrstyle" = "xBSD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** " >&5 +printf "%s\n" "$as_me: WARNING: ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** " >&2;} +fi + +gethostbynamerstyle="" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r() syntax" >&5 +printf %s "checking gethostbyname_r() syntax... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define GETHOSTBYNAMERSTYLE GNUSTYLE" >>confdefs.h + + gethostbynamerstyle=GNU + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +if test "x$gethostbynamerstyle" = "x"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + gethostbyname_r(NULL, NULL, NULL, 0, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define GETHOSTBYNAMERSTYLE SYSVSTYLE" >>confdefs.h + + gethostbynamerstyle=SYSV + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +if test "x$gethostbynamerstyle" = "x"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + gethostbyname(NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define GETHOSTBYNAMERSTYLE BSDSTYLE" >>confdefs.h + + gethostbynamerstyle=BSD + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +if test "x$gethostbynamerstyle" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none! It must not exist, here." >&5 +printf "%s\n" "none! It must not exist, here." >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${gethostbynamerstyle}-style" >&5 +printf "%s\n" "${gethostbynamerstyle}-style" >&6; } +fi + +if test "x$gethostbynamerstyle" = "xBSD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ****** BSD-style gethostbyname might NOT be thread-safe! ****** " >&5 +printf "%s\n" "$as_me: WARNING: ****** BSD-style gethostbyname might NOT be thread-safe! ****** " >&2;} +fi + +if test "x$ac_cv_header_pwd_h" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking getpwnam_r" >&5 +printf %s "checking getpwnam_r... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + getpwnam_r(NULL, NULL, NULL, 0, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_GETPWNAM_R 1" >>confdefs.h + + +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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +if test "x$ac_cv_header_grp_h" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking getgrnam_r" >&5 +printf %s "checking getgrnam_r... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + getgrnam_r(NULL, NULL, NULL, 0, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_GETGRNAM_R 1" >>confdefs.h + + +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 conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + + + +printf "%s\n" "#define POSIXSTYLE 1" >>confdefs.h + + +printf "%s\n" "#define SOLARISSTYLE 2" >>confdefs.h + +ctimerstyle="" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ctime_r() syntax" >&5 +printf %s "checking ctime_r() syntax... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + ctime_r(NULL, NULL, 0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define CTIMERSTYLE SOLARISSTYLE" >>confdefs.h + + ctimerstyle="SOLARIS" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +if test "x$ctimerstyle" = "x"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + ctime_r(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define CTIMERSTYLE POSIXSTYLE" >>confdefs.h + + ctimerstyle="POSIX" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +if test "x$ctimerstyle" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none! It must not exist, here." >&5 +printf "%s\n" "none! It must not exist, here." >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${ctimerstyle}-style" >&5 +printf "%s\n" "${ctimerstyle}-style" >&6; } +fi + +HOSTINFO=$host + + + +top_builddir=`pwd` +export top_builddir +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: top_builddir=$top_builddir" >&5 +printf "%s\n" "top_builddir=$top_builddir" >&6; } + + + + +if test "x$EXPERIMENTAL" = "xyes"; then + for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do + MODULES="$MODULES $foo" + done +else + for foo in `cat "${srcdir}"/src/modules/stable`; do + MODULES="$MODULES $foo" + done +fi + +mysubdirs="" +for bar in $MODULES; do + if test -f "${srcdir}"/src/modules/$bar/configure; then + mysubdirs="$mysubdirs src/modules/$bar" + fi +done + + + +subdirs="$subdirs $mysubdirs" + + + +if test "x$ax_cv_cc_no_date_time_flag" = "xyes" && test "x$reproducible_builds" != "xyes"; then + CFLAGS="-Wno-date-time $CFLAGS" +fi + +CFLAGS="$CFLAGS $devcflags" +LDFLAGS="$LDFLAGS $devldflags" + +if test "x$werror" = "xyes"; then + CFLAGS="-Werror $CFLAGS" +fi + +ac_config_commands="$ac_config_commands stamp-h" + +ac_config_commands="$ac_config_commands build-radpaths-h" + +ac_config_commands="$ac_config_commands main-chmod" + +ac_config_commands="$ac_config_commands scripts-chmod" + + + + + + +USE_STATIC_LIBS="yes" + + + +ac_config_files="$ac_config_files ./Make.inc ./src/include/build-radpaths-h ./src/main/radsniff.mk ./src/main/checkrad ./src/main/radlast ./src/main/radtest ./scripts/rc.radiusd ./scripts/cron/radiusd.cron.daily ./scripts/cron/radiusd.cron.monthly ./scripts/cryptpasswd ./raddb/radrelay.conf ./raddb/radiusd.conf" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { 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) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+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 + { 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 + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { 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 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +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=`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" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ 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 +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +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 $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +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 +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 ${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 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) 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 + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$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 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + 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. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# 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*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# 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 +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by freeradius $as_me $Id$, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to . +freeradius home page: ." + +_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='$ac_cs_config_escaped' +ac_cs_version="\\ +freeradius config.status $Id$ +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +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." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + 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=`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;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/include/autoconf.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/autoconf.h" ;; + "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;; + "build-radpaths-h") CONFIG_COMMANDS="$CONFIG_COMMANDS build-radpaths-h" ;; + "main-chmod") CONFIG_COMMANDS="$CONFIG_COMMANDS main-chmod" ;; + "scripts-chmod") CONFIG_COMMANDS="$CONFIG_COMMANDS scripts-chmod" ;; + "./Make.inc") CONFIG_FILES="$CONFIG_FILES ./Make.inc" ;; + "./src/include/build-radpaths-h") CONFIG_FILES="$CONFIG_FILES ./src/include/build-radpaths-h" ;; + "./src/main/radsniff.mk") CONFIG_FILES="$CONFIG_FILES ./src/main/radsniff.mk" ;; + "./src/main/checkrad") CONFIG_FILES="$CONFIG_FILES ./src/main/checkrad" ;; + "./src/main/radlast") CONFIG_FILES="$CONFIG_FILES ./src/main/radlast" ;; + "./src/main/radtest") CONFIG_FILES="$CONFIG_FILES ./src/main/radtest" ;; + "./scripts/rc.radiusd") CONFIG_FILES="$CONFIG_FILES ./scripts/rc.radiusd" ;; + "./scripts/cron/radiusd.cron.daily") CONFIG_FILES="$CONFIG_FILES ./scripts/cron/radiusd.cron.daily" ;; + "./scripts/cron/radiusd.cron.monthly") CONFIG_FILES="$CONFIG_FILES ./scripts/cron/radiusd.cron.monthly" ;; + "./scripts/cryptpasswd") CONFIG_FILES="$CONFIG_FILES ./scripts/cryptpasswd" ;; + "./raddb/radrelay.conf") CONFIG_FILES="$CONFIG_FILES ./raddb/radrelay.conf" ;; + "./raddb/radiusd.conf") CONFIG_FILES="$CONFIG_FILES ./raddb/radiusd.conf" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + 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 + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { 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=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + 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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { 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=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { 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 +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" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "stamp-h":C) echo timestamp > src/include/stamp-h ;; + "build-radpaths-h":C) (cd ./src/include && /bin/sh ./build-radpaths-h) ;; + "main-chmod":C) (cd ./src/main && chmod +x checkrad radlast radtest) ;; + "scripts-chmod":C) (cd ./scripts && chmod +x rc.radiusd cron/radiusd.cron.daily cron/radiusd.cron.monthly cryptpasswd) ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file, --srcdir, and --disable-option-checking arguments + # so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + --disable-option-checking) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_sub_configure_args " '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi + + # Always prepend --disable-option-checking to silence warnings, since + # different subdirs can have different --enable and --with options. + ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + printf "%s\n" "$ac_msg" >&6 + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + 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/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + cd "$ac_dir" + + # 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 + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative name. + ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +printf "%s\n" "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 + fi + + cd "$ac_popdir" + done +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { 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 + + + +module_list=$(find src/modules/ -type d -name 'rlm_*' -print | sort) + +echo +echo Module configure status report +echo ------------------------------ + +for module in $module_list; do + module_name="$(basename $module)" + module_print="$(echo "$module_name ........................" | cut -c 1-25)" + module_status="OK" + + if test -r $module/configure.ac; then + if test -r $module/config.report; then + module_status=$(cat $module/config.report) + fi + fi + + $as_echo "$module_print $module_status" +done + + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..a24a806 --- /dev/null +++ b/configure.ac @@ -0,0 +1,2645 @@ +dnl ############################################################# +dnl # +dnl # For information about autoconf, see: +dnl # +dnl # http://www.gnu.org/software/autoconf/ +dnl # +dnl # The recommended order is: +dnl # +dnl # AC_INIT +dnl # 0. checks for compiler, libtool, and command line options +dnl # 1. checks for programs +dnl # 2. checks for libraries +dnl # 3. checks for header files +dnl # 4. checks for typedefs +dnl # 5. checks for structures and functions +dnl # 6. checks for compiler characteristics +dnl # 7. checks for library functions +dnl # 8. checks for system services +dnl # AC_OUTPUT +dnl # +dnl ############################################################# + +AC_PREREQ([2.69]) +export CFLAGS LIBS LDFLAGS CPPFLAGS + +AC_INIT([freeradius],[$Id$],[http://bugs.freeradius.org],[],[http://www.freeradius.org]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([src/main/radiusd.c]) +AC_CONFIG_HEADER([src/include/autoconf.h]) + +dnl ############################################################# +dnl # +dnl # Custom hackery to discover version at configure time +dnl # +dnl ############################################################# +RADIUSD_MAJOR_VERSION=`cat VERSION | cut -f1 -d.` +RADIUSD_MINOR_VERSION=`cat VERSION | cut -f2 -d.` +RADIUSD_INCRM_VERSION=`cat VERSION | cut -f3 -d. | sed 's/[[\.-]].*$//'` + +RADIUSD_VERSION=`printf "%02i%02i%02i" $RADIUSD_MAJOR_VERSION $RADIUSD_MINOR_VERSION $RADIUSD_INCRM_VERSION` + +dnl # +dnl # Still useful for custom builds +dnl # +RADIUSD_VERSION_STRING=`cat VERSION` + +dnl # +dnl # Add definitions to Make.inc as it's used by various build targets +dnl # +AC_SUBST([RADIUSD_VERSION_STRING]) + +dnl # +dnl # Add definitions to autoconf.h, so that the headers that we install +dnl # contain the version number of the server. +dnl # +AC_DEFINE_UNQUOTED([RADIUSD_VERSION], [${RADIUSD_VERSION}], [Version integer in format ]) +AC_DEFINE_UNQUOTED([RADIUSD_VERSION_STRING], ["${RADIUSD_VERSION_STRING}"], [Raw version string from VERSION file]) + +dnl ############################################################# +dnl # +dnl # Override some of the default autoconf variables such as +dnl # CFLAGS if were building in developer mode +dnl # +dnl ############################################################# + +dnl # +dnl # Unset ASAN_OPTIONS and LSAN_OPTIONS so they don't interfere +dnl # with the build process. +dnl # +unset ASAN_OPTIONS +unset LSAN_OPTIONS + +dnl # +dnl # check for JSON.pm, ASCIIDOCTOR and pandoc +dnl # +AC_PATH_PROG(ASCIIDOCTOR, asciidoctor) +if test "x$ac_cv_path_ASCIIDOCTOR" = "x"; then + AC_MSG_WARN([asciidoctor not found - Please install if you want build the docs]) +fi + +AC_PATH_PROG(PANDOC, pandoc) +if test "x$ac_cv_path_PANDOC" = "x"; then + AC_MSG_WARN([pandoc not found - Please install if you want build the docs]) +else + # + # Pandoc v2 onwards renamed --latex-engine to --pdf-engine + # + if pandoc --help 2>&1 | grep -q "latex-engine"; then + PANDOC_ENGINE=latex + else + PANDOC_ENGINE=pdf + fi + AC_SUBST(PANDOC_ENGINE) +fi + +# pandoc and asciidoctor is defined? then check it. +if test "x$ac_cv_path_PANDOC" != "x" && test "x$ac_cv_path_ASCIIDOCTOR" != "x"; then + AX_PROG_PERL_MODULES(JSON, , AC_MSG_WARN([Perl JSON module not found - Please install if you want build the docs])) +fi + +dnl # +dnl # check for doxygen +dnl # +AC_PATH_PROG(DOXYGEN, doxygen) +if test "x$ac_cv_path_DOXYGEN" != "x"; then + AC_PATH_PROG(GRAPHVIZ_DOT, dot) + if test "x$ac_cv_path_GRAPHVIZ_DOT" = "x"; then + AC_MSG_WARN([dot not found - Please install the graphviz if you want to build the docs/source]) + fi +else + AC_MSG_WARN([doxygen not found - Please install if you want build the docs/source]) +fi + +dnl # +dnl # check for Antora +dnl # +AC_PATH_PROG(ANTORA, antora) +if test "x$ac_cv_path_ANTORA" = "x"; then + AC_MSG_WARN([antora not found - Please install if you want build the site]) +fi + +dnl # +dnl # Enable developer features like debugging symbols. +dnl # These checks must be done before expanding the AC_PROG_CC +dnl # and AC_PROG_CXX macros. +dnl # +AC_ARG_ENABLE(developer, +[ --enable-developer enables features of interest to developers.], +[ case "$enableval" in + no) + developer=no + ;; + *) + developer=yes + esac ] +) + +dnl # +dnl # Turn on the developer flag when taken from a git checkout (not a release) +dnl # +if test -d $srcdir/.git; then + if test "x$developer" != "xno"; then + AC_MSG_NOTICE([found .git directory, enabling developer build implicitly, disable with --disable-developer]) + developer="yes" + fi +fi + +dnl # +dnl # Autoconf sets -O2 and -g by default, but this is a PITA for debugging +dnl # so we remove the defaults if were building in developer mode, and set +dnl # -g3 so nice things like macro values are included. Other arguments are +dnl # added later when we know what compiler were using. +dnl # +if test "x$developer" = "xyes"; then + : ${CFLAGS=-g3} +fi + +dnl # +dnl # The developer option WITH_VERIFY_PTR significantly scews profiling so +dnl # we allow it to be disabled. +dnl # +AC_ARG_ENABLE(verify-ptr, +[ --disable-verify-ptr disables WITH_VERIFY_PTR developer build option.], +[ case "$enableval" in + no) + verify_ptr="" + ;; + *) + verify_ptr="-DWITH_VERIFY_PTR=1" + esac ], +[ verify_ptr="-DWITH_VERIFY_PTR=1" ], +) + +dnl # +dnl # Hard-code FIPS support/ +dnl # +AC_ARG_ENABLE(fips-workaround, +[ --enable-fips-workaround enables local MD4, MD5, etc. functionality to avoid OpenSSL FIPS issues.], +[ case "$enableval" in + no) + fips="" + ;; + *) + fips="-DWITH_FIPS=1" + esac ], +[ fips="" ], +) + +dnl ############################################################# +dnl # +dnl # 0. Checks for compiler, libtool, and command line options. +dnl # +dnl ############################################################# + +dnl # +dnl # Get system information +dnl # +AC_CANONICAL_TARGET + +dnl # +dnl # clang etc. on OSX no longer searches the default paths for things, +dnl # so we have to add them back in. +dnl # +case "$host" in + *-darwin*) + CFLAGS="$CFLAGS -DDARWIN" + LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib $LDFLAGS" + LIBS="-F /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ -framework DirectoryService $LIBS" + ;; +esac + + +dnl # +dnl # Check for GNU cc +dnl # +AC_PROG_CC +AC_PROG_CXX + +dnl # +dnl # check for AIX, to allow us to use some BSD functions +dnl # must be before macros that call the compiler. +dnl # +AC_USE_SYSTEM_EXTENSIONS + +AC_PROG_GCC_TRADITIONAL +AC_PROG_CC_SUNPRO +AC_PROG_RANLIB + +dnl # +dnl # Definitive check for whether the compiler is clang +dnl # +AX_CC_IS_CLANG +if test "x$ax_cv_cc_clang" = "xyes"; then + AC_SUBST(clang_path, "$CC") +else + AC_SUBST(clang_path, "") +fi + + +dnl # +dnl # Set Default CFLAGS for GCC compatible compilers +dnl # +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -Wall -std=c99 -D_GNU_SOURCE" +fi + +dnl # +dnl # -Wno-unknown-warning-option means the compiler doesn't complain about diag pragmas +dnl # for warnings it doesn't understand. This may sound like a bad idea, but consider +dnl # the number of different compiler versions we build under, and the fact that the +dnl # more anally retentive warnings are likely to be added in later versions. +dnl # +AX_CC_NO_UNKNOWN_WARNING_OPTION_FLAG +if test "x$ax_cv_cc_no_unknown_warning_option_flag" = "xyes"; then + CFLAGS="$CFLAGS -Wno-unknown-warning-option" +fi + +dnl # +dnl # -Qunused-arguments means the compiler won't complain about unsupported arguments +dnl # +AX_CC_QUNUSED_ARGUMENTS_FLAG +if test "x$ax_cv_cc_qunused_arguments_flag" = "xyes"; then + CFLAGS="$CFLAGS -Qunused-arguments" + LDFLAGS="$LDFLAGS -Qunused-arguments" +fi + +dnl # +dnl # Check for presence of -Wno-date-time warning. Older compilers +dnl # don't have it, and newer compilers warn without it... +dnl # +AX_CC_NO_DATE_TIME_FLAG + +dnl # +dnl # Compile in large (2G+) file support. +dnl # +AC_SYS_LARGEFILE + +dnl # +dnl # check for system bytesex +dnl # AC_DEFINES WORDS_BIGENDIAN +dnl # +AC_C_BIGENDIAN( + [AC_DEFINE(FR_BIG_ENDIAN, 1, [Define if your processor stores words with the most significant byte first])], + [AC_DEFINE(FR_LITTLE_ENDIAN, 1, [Define if your processor stores words with the least significant byte first])] +) + +dnl # +dnl # Find GNU Make. +dnl # +AC_CHECK_PROG(GMAKE, gmake, yes, no) +if test $GMAKE = no; then + AC_PATH_PROG(MAKE, make, /usr/local/bin/make) +else + AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make) +fi +makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"` +if test -z "$makever"; then + AC_MSG_ERROR([GNU Make is not installed. Please download and install it from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.]) +fi + +dnl # +dnl # autoconf explicitly sets MAKEFLAGS and MFLAGS to '' even though we +dnl # didn't tell it to, so we have to use FR_MAKEFLAGS. +dnl # +dnl # determine the number of cores available and set the number of build +dnl # processes appropriately. +dnl # +AX_SYSTEM_CORES + +dnl # Temporarily disabled because test and installation targets do not +dnl # have dependencies set up correctly for multiple build processes. +dnl if test "x$ax_cv_system_cores" != "x"; then +dnl : ${FR_MAKEFLAGS=-j$ax_cv_system_cores} +dnl fi +AC_SUBST(FR_MAKEFLAGS) + +dnl # +dnl # See if we have Git. +dnl # +AC_CHECK_PROG(GIT, git, yes, no) + +dnl Put this in later, when all distributed modules use autoconf. +dnl AC_ARG_WITH(disablemodulefoo, +dnl [ --without-rlm_foo Disables module compilation. Module list:] +dnl esyscmd([find src/modules -type d -name rlm_\* -print |\ +dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\ +dnl awk '{print " "$0}'])) + +AC_ARG_ENABLE(strict-dependencies, +[ --enable-strict-dependencies fail configure on lack of module dependancy.]) + +AC_ARG_ENABLE(werror, +[ --enable-werror causes the build to fail if any warnings are generated.], +[ case "$enableval" in + no) + werror=no + ;; + *) + werror=yes + esac ] +) + +dnl # +dnl # extra argument: --with-docdir +dnl # +docdir='${datadir}/doc/freeradius' +AC_MSG_CHECKING([docdir]) +AC_ARG_WITH(docdir, +[ --with-docdir=DIR directory for documentation [DATADIR/doc/freeradius] ], +[ case "$withval" in + no) + docdir=no + ;; + yes) + ;; + [[\\/$]]* | ?:[[\\/]]* ) + docdir="$withval" + ;; + *) + AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval]) + ;; + esac ] +) +AC_SUBST(docdir) +AC_MSG_RESULT($docdir) +if test "x$docdir" = xno; then + AC_MSG_WARN([Documentation files will NOT be installed.]) +fi + +dnl # +dnl # extra argument: --with-logdir +dnl # +logdir='${localstatedir}/log/radius' +AC_MSG_CHECKING(logdir) +AC_ARG_WITH(logdir, +[ --with-logdir=DIR directory for logfiles [LOCALSTATEDIR/log/radius] ], +[ case "$withval" in + no) + AC_MSG_ERROR([Need logdir]) + ;; + yes) + ;; + [[\\/$]]* | ?:[[\\/]]* ) + logdir="$withval" + ;; + *) + AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval]) + ;; + esac ] +) +AC_SUBST(logdir) +AC_MSG_RESULT($logdir) + +dnl # +dnl # extra argument: --with-radacctdir +dnl # +radacctdir='${logdir}/radacct' +AC_MSG_CHECKING(radacctdir) +AC_ARG_WITH(radacctdir, +[ --with-radacctdir=DIR directory for detail files [LOGDIR/radacct] ], +[ case "$withval" in + no) + AC_MSG_ERROR([Need radacctdir]) + ;; + yes) + ;; + [[\\/$]]* | ?:[[\\/]]* ) + radacctdir="$withval" + ;; + *) + AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval]) + ;; + esac ] +) +AC_SUBST(radacctdir) +AC_MSG_RESULT($radacctdir) + +dnl # +dnl # extra argument: --with-raddbdir +dnl # +raddbdir='${sysconfdir}/raddb' +AC_MSG_CHECKING(raddbdir) +AC_ARG_WITH(raddbdir, +[ --with-raddbdir=DIR directory for config files [SYSCONFDIR/raddb] ], +[ case "$withval" in + no) + AC_MSG_ERROR([Need raddbdir]) + ;; + yes) + ;; + [[\\/$]]* | ?:[[\\/]]* ) + raddbdir="$withval" + ;; + *) + AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval]) + ;; + esac ] +) +AC_SUBST(raddbdir) +AC_MSG_RESULT($raddbdir) + +dnl # +dnl # extra argument: --with-dictdir +dnl # +dictdir='${datarootdir}/freeradius' +AC_MSG_CHECKING(dictdir) +AC_ARG_WITH(dictdir, +[ --with-dictdir=DIR directory for dictionary files [DATAROOTDIR/freeradius] ], +[ case "$withval" in + no) + AC_MSG_ERROR([Need dictdir]) + ;; + yes) + ;; + [[\\/$]]* | ?:[[\\/]]* ) + dictdir="$withval" + ;; + *) + AC_MSG_ERROR([expected an absolute directory name for --with-dictdir: $withval]) + ;; + esac ] +) +AC_SUBST(dictdir) +AC_MSG_RESULT($dictdir) + +modconfdir='${raddbdir}/mods-config' +AC_SUBST(modconfdir) + +dnl # +dnl # extra argument: --with-ascend-binary +dnl # +WITH_ASCEND_BINARY=yes +AC_ARG_WITH(ascend-binary, +[ --with-ascend-binary include support for Ascend binary filter attributes (default=yes)], +[ case "$withval" in + yes) + ;; + *) + WITH_ASCEND_BINARY=no + esac ] +) +if test "x$WITH_ASCEND_BINARY" = "xyes"; then + AC_DEFINE(WITH_ASCEND_BINARY, [1], [include support for Ascend binary filter attributes]) +fi + +dnl # +dnl # extra argument: --with-radiusv11 +dnl # +WITH_RADIUSV11= +AC_ARG_WITH(radiusv11, +[ --with-radiusv11 compile in RADIUSv11 support. (default=no)], +[ case "$withval" in + yes) + WITH_RADIUSV11=yes + ;; + *) + ;; + esac ] +) +if test "x$WITH_RADIUSCV11" = "xyes"; then + AC_DEFINE(WITH_RADIUSV11, [1], [define if you want RADIUSv11 support (For RADSec et al)]) +fi + +dnl # +dnl # extra argument: --with-threads +dnl # +WITH_THREADS=yes +AC_ARG_WITH(threads, +[ --with-threads use threads, if available. (default=yes) ], +[ case "$withval" in + yes) + ;; + *) + WITH_THREADS=no + esac ] +) + +dnl # +dnl # extra argument: --with-tcp +dnl # +WITH_TCP=yes +AC_ARG_WITH(tcp, +[ --with-tcp compile in TCP support. (default=yes)], +[ case "$withval" in + yes) + ;; + *) + WITH_TCP=no + esac ] +) +if test "x$WITH_TCP" = "xyes"; then + AC_DEFINE(WITH_TCP, [1], [define if you want TCP support (For RADSec et al)]) +fi + +dnl # +dnl # extra argument: --with-vmps +dnl # +WITH_VMPS=yes +AC_ARG_WITH(vmps, +[ --with-vmps compile in VMPS support. (default=yes)], +[ case "$withval" in + yes) + ;; + *) + WITH_VMPS=no + esac ] +) +if test "x$WITH_VMPS" = "xyes"; then + AC_DEFINE(WITH_VMPS, [1], [define if you want VMPS support]) +fi + +dnl # +dnl # extra argument: --with-dhcp +dnl # +WITH_DHCP=yes +AC_ARG_WITH(dhcp, +[ --with-dhcp compile in DHCP support. (default=yes)], +[ case "$withval" in + yes) + ;; + *) + WITH_DHCP=no + esac ] +) +if test "x$WITH_DHCP" = "xyes"; then + AC_DEFINE(WITH_DHCP, [1], [define if you want DHCP support]) +fi +AC_SUBST(WITH_DHCP) + +dnl # +dnl # Allow the user to specify a list of modules to be linked +dnl # statically to the server. +dnl # +STATIC_MODULES= +AC_ARG_WITH(static_modules, +[ --with-static-modules=QUOTED-MODULE-LIST],[ + for i in $withval; do + STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la" + done +]) + +USE_SHARED_LIBS=yes +AC_ARG_WITH(shared-libs, +[AS_HELP_STRING([--with-shared-libs ], +[build dynamic libraries and link against them. (default=yes)])], +[ case "$withval" in + no) + USE_SHARED_LIBS=no + ;; + *) + esac +]) + +MODULES= +AC_ARG_WITH(modules, +[ --with-modules=QUOTED-MODULE-LIST],[ + for i in $withval; do + MODULES="$MODULES $i" + done +]) + +dnl # +dnl # extra argument: --with-experimental-modules +dnl # +EXPERIMENTAL= +AC_ARG_WITH(experimental-modules, +[AS_HELP_STRING([--with-experimental-modules], +[use experimental and unstable modules. (default=no, unless --enable-developer=yes)])], +[ case "$withval" in + yes) + EXPERIMENTAL=yes + ;; + no) + EXPERIMENTAL=no + ;; + *) + esac ] +) + +dnl # +dnl # extra argument: --with-udpfromto +dnl # +WITH_UDPFROMTO=yes +AC_ARG_WITH(udpfromto, +[ --with-udpfromto compile in UDPFROMTO support. (default=yes)], +[ case "$withval" in + yes) + WITH_UDPFROMTO=yes + ;; + *) + WITH_UDPFROMTO=no + esac ] +) + +if test "x$WITH_UDPFROMTO" = "xyes"; then + AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto]) +fi + +dnl # +dnl # These next two arguments don't actually do anything. They're +dnl # place holders so that the top-level configure script can tell +dnl # the user how to configure lower-level modules +dnl # + +dnl # +dnl # extra argument: --with-rlm-FOO-lib-dir +dnl # +AC_ARG_WITH(rlm-FOO-lib-dir, +[AS_HELP_STRING([--with-rlm-FOO-lib-dir=DIR], +[directory in which to look for library files used by module FOO])], +[ case "$withval" in + *) + ;; + esac ] +) + +dnl # +dnl # extra argument: --with-rlm-FOO-include-dir +dnl # +AC_ARG_WITH(rlm-FOO-include-dir, +[AS_HELP_STRING([--with-rlm-FOO-include-dir=DIR], +[directory in which to look for include files used by module FOO])], +[ case "$withval" in + *) + ;; + esac ] +) + +dnl # +dnl # extra argument: --with-openssl +dnl # +WITH_OPENSSL=yes +AC_ARG_WITH(openssl, +[ --with-openssl use OpenSSL. (default=yes)], +[ case "$withval" in + no) + WITH_OPENSSL=no + ;; + *) + WITH_OPENSSL=yes + ;; + esac ] +) +if test "x$WITH_THREADS" = "xno"; then + if test "x$WITH_OPENSSL" = "xyes"; then + AC_MSG_ERROR([[Threads are required when using OpenSSL, use --with-threads=yes]]) + fi +fi + +dnl # +dnl # extra argument: --with-openssl-lib-dir=dir +dnl # +openssl_lib_dir= +AC_ARG_WITH(openssl-lib-dir, +[AS_HELP_STRING([--with-openssl-lib-dir=DIR], +[directory to look for OpenSSL library files])], +[ case "$withval" in + *) openssl_lib_dir="$withval" + ;; + esac ] +) + +dnl # +dnl # extra argument: --with-openssl-includes=dir +dnl # +openssl_include_dir= +AC_ARG_WITH(openssl-include-dir, +[AS_HELP_STRING([--with-openssl-include-dir=DIR], +[directory to look for OpenSSL include files])], +[ case "$withval" in + *) openssl_include_dir="$withval" + ;; + esac ] +) + +dnl # +dnl # extra argument: --disable-openssl-version-check +dnl # +AC_ARG_ENABLE(openssl-version-check, +[AS_HELP_STRING([--disable-openssl-version-check], + [disable vulnerable OpenSSL version check])] +) +if test "x$enable_openssl_version_check" != "xno"; then + AC_DEFINE(ENABLE_OPENSSL_VERSION_CHECK, [1], + [Define to 1 to have OpenSSL version check enabled]) + openssl_version_check_config="\ + # + # allow_vulnerable_openssl: Allow the server to start with + # versions of OpenSSL known to have critical vulnerabilities. + # + # This check is based on the version number reported by libssl + # and may not reflect patches applied to libssl by + # distribution maintainers. + # + allow_vulnerable_openssl = no" +else + openssl_version_check_config= +fi +AC_SUBST([openssl_version_check_config]) + +dnl # +dnl # extra argument: --enable-reproducible-builds +dnl # +AC_ARG_ENABLE(reproducible-builds, +[AS_HELP_STRING([--enable-reproducible-builds], + [ensure the build does not change each time])], +[ case "$enableval" in + yes) + AC_DEFINE(ENABLE_REPRODUCIBLE_BUILDS, [1], + [Define to ensure each build is the same]) + reproducible_builds=yes + ;; + *) + reproducible_builds=no + esac ] +) + +dnl # +dnl # Enable the -fsanitize=fuzzer and link in the address sanitizer +dnl # libraries. +dnl # +AC_ARG_ENABLE(fuzzer, +[AS_HELP_STRING([--enable-fuzzer], + [build with support for a fuzzer])], +[ case "$enableval" in + no) + fuzzer=no + ;; + *) + fuzzer=yes + esac ] +) + +dnl # +dnl # Enable the -fsanitize=address and link in the address sanitizer +dnl # libraries. +dnl # +AC_ARG_ENABLE(address-sanitizer, +[AS_HELP_STRING([--enable-address-sanitizer], + [build with support for address sanitizer.])], +[ case "$enableval" in + no) + address_sanitizer=no + ;; + *) + address_sanitizer=yes + esac ] +) + +dnl # +dnl # Enable -fsanitize=leak and link in the leak sanitizer +dnl # libraries. +dnl # +AC_ARG_ENABLE(leak-sanitizer, +[AS_HELP_STRING([--enable-leak-sanitizer], + [build with support for leak sanitizer.])], +[ case "$enableval" in + no) + leak_sanitizer=no + ;; + *) + leak_sanitizer=yes + esac ] +) + +dnl # +dnl # Enable -fsanitize=thread and link in the thread sanitizer +dnl # libraries. +dnl # +AC_ARG_ENABLE(thread-sanitizer, +[AS_HELP_STRING([--enable-thread-sanitizer], + [build with support for thread sanitizer.])], +[ case "$enableval" in + no) + thread_sanitizer=no + ;; + *) + thread_sanitizer=yes + esac ] +) + +dnl # +dnl # Enable the -fsanitize=undefined and link in the address sanitizer +dnl # libraries. +dnl # +AC_ARG_ENABLE(undefined-behaviour-sanitizer, +[AS_HELP_STRING([--enable-undefined-behaviour-sanitizer], + [build with support for undefined behaviour sanitizer.])], +[ case "$enableval" in + no) + undefined_behaviour_sanitizer=no + ;; + *) + undefined_behaviour_sanitizer=yes + esac ] +) + +dnl ############################################################# +dnl # +dnl # 1. Checks for programs +dnl # +dnl ############################################################# + +CHECKRAD=checkrad +AC_PATH_PROG(PERL, perl, /usr/local/bin/perl) +if test "x$ac_cv_path_PERL" = "x"; then + AC_MSG_WARN([perl not found - Simultaneous-Use and checkrad may not work]) +fi +AC_PATH_PROG(SNMPGET, snmpget) +if test "x$ac_cv_path_SNMPGET" = "x"; then + AC_MSG_WARN([snmpget not found - Simultaneous-Use and checkrad may not work]) +fi + +AC_PATH_PROG(SNMPWALK, snmpwalk) +if test "x$ac_cv_path_SNMPWALK" = "x"; then + AC_MSG_WARN([snmpwalk not found - Simultaneous-Use and checkrad may not work]) +fi + +AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers) + +dnl # +dnl # FIXME This is truly gross. +dnl # +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) + +AC_PATH_PROG(DIRNAME,dirname) +AC_PATH_PROG(GREP,grep) + +dnl ############################################################# +dnl # +dnl # 2. Checks for libraries +dnl # +dnl ############################################################# + +dnl Check for talloc +dnl extra argument: --with-talloc-lib-dir=DIR +talloc_lib_dir= +AC_ARG_WITH(talloc-lib-dir, + [AS_HELP_STRING([--with-talloc-lib-dir=DIR], + [directory in which to look for talloc library files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need talloc-lib-dir]) + ;; + yes) + ;; + *) + talloc_lib_dir="$withval" + ;; + esac]) + +dnl extra argument: --with-talloc-include-dir=DIR +talloc_include_dir= +AC_ARG_WITH(talloc-include-dir, + [AS_HELP_STRING([--with-talloc-include-dir=DIR], + [directory in which to look for talloc include files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need talloc-include-dir]) + ;; + yes) + ;; + *) + talloc_include_dir="$withval" + ;; + esac]) + +smart_try_dir="$talloc_lib_dir" +FR_SMART_CHECK_LIB(talloc, _talloc) +if test "x$ac_cv_lib_talloc__talloc" != "xyes"; then + AC_MSG_WARN([talloc library not found. Use --with-talloc-lib-dir=.]) + AC_MSG_ERROR([FreeRADIUS requires libtalloc]) +fi + +TALLOC_LIBS="${smart_lib}" +TALLOC_LDFLAGS="${smart_ldflags}" +AC_SUBST(TALLOC_LIBS) +AC_SUBST(TALLOC_LDFLAGS) +LIBS="$old_LIBS" + +dnl # +dnl # If using pthreads, check for -lpthread (posix) or -lc_r (*BSD) +dnl # +old_CFLAGS=$CFLAGS +if test "x$WITH_THREADS" = "xyes"; then + if test $ac_cv_prog_suncc = "yes"; then + CFLAGS="$CFLAGS -mt" + fi + + AC_CHECK_HEADERS(pthread.h, [], + [ + WITH_THREADS="no" + fail=[pthread.h] + ]) + + dnl # + dnl # pthread stuff is usually in -lpthread + dnl # or in -lc_r, on *BSD + dnl # + dnl # On Some systems, we need extra pre-processor flags, to get them to + dnl # to do the threading properly. + dnl # + if test "x$WITH_THREADS" != "xno"; then + AC_CHECK_LIB(pthread, pthread_create, + [ + HAVE_LPTHREAD='yes' + CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" + LIBS="-lpthread $LIBS" + + dnl # + dnl # -pthread should add all required CPP definitions and linker + dnl # arguments. But not all compilers support it, or some compilers + dnl # only support it on certain platforms. + dnl # + AX_CC_PTHREAD_FLAG + if test "x$ax_cv_cc_pthread_flag" != 'xyes'; then + CFLAGS="$CFLAGS -pthread" + fi + ] + ) + + dnl # + dnl # Check for libc_r which used to be the threading library used + dnl # for FreeBSD. Internet says it may be deprecated, but if we + dnl # can't find lpthread it's probably worth checking. + dnl # + if test "x$HAVE_LPTHREAD" != "xyes"; then + AC_CHECK_LIB(c_r, pthread_create, + [ + CFLAGS="$CFLAGS -D_THREAD_SAFE" + + dnl # + dnl # -pthread should add all required CPP definitions and linker + dnl # arguments. But not all compilers support it, or some compilers + dnl # only support it on certain platforms. + dnl # + AX_CC_PTHREAD_FLAG + if test "x$ax_cv_cc_pthread_flag" != 'xyes'; then + LIBS="-lc_r $LIBS" + else + CFLAGS="$CFLAGS -pthread" + fi + ], + [ fail=[-lc_r or -lpthread] ] + ) + fi + fi + + if test "x$WITH_THREADS" != "xyes"; then + AC_MSG_WARN([silently not building with thread support.]) + AC_MSG_WARN([FAILURE: thread support requires: $fail.]) + else + AC_DEFINE(WITH_THREADS, [1], [define if you want thread support]) + fi +fi + +dnl # +dnl # If we have NO pthread libraries, remove any knowledge of threads. +dnl # +if test "x$WITH_THREADS" != "xyes"; then + CFLAGS=$old_CFLAGS + ac_cv_header_pthread_h="no" + WITH_THREADS=no +else + dnl # + dnl # We need sem_init() and friends, as they're the friendliest + dnl # semaphore functions for threading. + dnl # + dnl # HP/UX requires linking with librt, too, to get the sem_* symbols. + dnl # Some systems have them in -lsem + dnl # Solaris has them in -lposix4 + dnl # NetBSD has them in -lsemaphore + dnl # + + AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore, + [], + [AC_MSG_ERROR([[-lsem not found. You may want to download it from ftp://ftp.to.gd-es.com/pub/BSDI/libsem.tar.bz2 or ftp://ftp.freeradius.org/pub/radius/contrib/libsem.tar.gz]])] + ) +fi + +dnl # +dnl # Check if we have -ldl +dnl # +AC_CHECK_LIB(dl, dlopen) + +dnl # +dnl # Check if we need -lsocket +dnl # +AC_CHECK_LIB(socket, getsockname) + +dnl # +dnl # Check for -lresolv +dnl # This library may be needed later. +dnl # +AC_CHECK_LIB(resolv, inet_aton) + +dnl # +dnl # Check if we need -lnsl. Usually if we want to +dnl # link against -lsocket we need to include -lnsl as well. +dnl # +AC_CHECK_LIB(nsl, inet_ntoa) +AC_CHECK_LIB(ws2_32, htonl) + +dnl # +dnl # Check the pcap library for the RADIUS sniffer. +dnl # +dnl extra argument: --with-pcap-lib-dir=DIR +pcap_lib_dir= +AC_ARG_WITH(pcap-lib-dir, + [AS_HELP_STRING([--with-pcap-lib-dir=DIR], + [directory in which to look for pcap library files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need pcap-lib-dir]) + ;; + yes) + ;; + *) + pcap_lib_dir="$withval" + ;; + esac]) + +dnl extra argument: --with-pcap-include-dir=DIR +pcap_include_dir= +AC_ARG_WITH(pcap-include-dir, + [AS_HELP_STRING([--with-pcap-include-dir=DIR], + [directory in which to look for pcap include files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need pcap-include-dir]) + ;; + yes) + ;; + *) + pcap_include_dir="$withval" + ;; + esac]) + +smart_try_dir="$pcap_lib_dir" +FR_SMART_CHECK_LIB(pcap, pcap_open_live) +if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then + AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=.]) +else + AC_CHECK_FUNCS(\ + pcap_fopen_offline \ + pcap_dump_fopen \ + pcap_create \ + pcap_activate + ) + + PCAP_LIBS="${smart_lib}" + PCAP_LDFLAGS="${smart_ldflags}" +fi +dnl Set by FR_SMART_CHECK_LIB +LIBS="${old_LIBS}" + +dnl Check for collectdclient +dnl extra argument: --with-collectdclient-lib-dir=DIR +collectdclient_lib_dir= +AC_ARG_WITH(collectdclient-lib-dir, + [AS_HELP_STRING([--with-collectdclient-lib-dir=DIR], + [directory in which to look for collectdclient library files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need collectdclient-lib-dir]) + ;; + yes) + ;; + *) + collectdclient_lib_dir="$withval" + ;; + esac]) + +dnl extra argument: --with-collectdclient-include-dir=DIR +collectdclient_include_dir= +AC_ARG_WITH(collectdclient-include-dir, + [AS_HELP_STRING([--with-collectdclient-include-dir=DIR], + [directory in which to look for collectdclient include files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need collectdclient-include-dir]) + ;; + yes) + ;; + *) + collectdclient_include_dir="$withval" + ;; + esac]) + +smart_try_dir="$collectdclient_lib_dir" +FR_SMART_CHECK_LIB(collectdclient, lcc_connect) +if test "x$ac_cv_lib_collectdclient_lcc_connect" != "xyes"; then + AC_MSG_WARN([collectdclient library not found. Use --with-collectdclient-lib-dir=.]) +else + COLLECTDC_LIBS="${smart_lib}" + COLLECTDC_LDFLAGS="${smart_ldflags}" +fi +dnl Set by FR_SMART_CHECKLIB +LIBS="${old_LIBS}" + +dnl Check for cap +dnl extra argument: --with-cap-lib-dir=DIR +cap_lib_dir= +AC_ARG_WITH(cap-lib-dir, + [AS_HELP_STRING([--with-cap-lib-dir=DIR], + [directory in which to look for cap library files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need cap-lib-dir]) + ;; + yes) + ;; + *) + cap_lib_dir="$withval" + ;; + esac]) + +dnl extra argument: --with-cap-include-dir=DIR +cap_include_dir= +AC_ARG_WITH(cap-include-dir, + [AS_HELP_STRING([--with-cap-include-dir=DIR], + [directory in which to look for cap include files])], + [case "$withval" in + no) + AC_MSG_ERROR([Need cap-include-dir]) + ;; + yes) + ;; + *) + cap_include_dir="$withval" + ;; + esac]) + +smart_try_dir="$cap_lib_dir" +FR_SMART_CHECK_LIB(cap, cap_get_proc) +if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then + AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=.]) +else + AC_DEFINE(HAVE_LIBCAP, 1, + [Define to 1 if you have the `cap' library (-lcap).] + ) + HAVE_LIBCAP=1 +fi + +dnl # +dnl # Check for libreadline +dnl # +VL_LIB_READLINE + +dnl # +dnl # Checks for systemd +dnl # +dnl # extra argument: --with-systemd +dnl # +AC_ARG_WITH([systemd], + AS_HELP_STRING([--with-systemd], [add systemd support, if available (default=no)]), + [ case "$withval" in + no) + WITH_SYSTEMD=no + ;; + *) + WITH_SYSTEMD=yes + esac ], + [WITH_SYSTEMD=no]) + +dnl # +dnl # extra argument: --systemd-lib-dir=dir +dnl # +systemd_lib_dir= +AC_ARG_WITH(systemd-lib-dir, + [AS_HELP_STRING([--with-systemd-lib-dir=DIR], + [directory to look for systemd library files])], + [ case "$withval" in + *) systemd_lib_dir="$withval" + ;; + esac ] +) + +dnl # +dnl # extra argument: --with-systemd-includes=dir +dnl # +systemd_include_dir= +AC_ARG_WITH(systemd-include-dir, + [AS_HELP_STRING([--with-systemd-include-dir=DIR], + [directory to look for systemd include files])], + [ case "$withval" in + *) systemd_include_dir="$withval" + ;; + esac ] +) + +if test "x$WITH_SYSTEMD" = xyes; then + smart_try_dir="$systemd_lib_dir" + FR_SMART_CHECK_LIB(systemd, sd_notify) + if test "x$ac_cv_lib_systemd_sd_notify" != "xyes"; then + AC_MSG_WARN([systemd library not found. Use --with-systemd-lib-dir=.]) + else + AC_DEFINE([HAVE_SYSTEMD], [1], + [Define to 1 if you have the `systemd' library (-lsystemd).] + ) + HAVE_SYSTEMD=1 + SYSTEMD_LIBS="${smart_lib}" + SYSTEMD_LDFLAGS="${smart_ldflags}" + fi + dnl Set by FR_SMART_CHECKLIB + LIBS="${old_LIBS}" +fi + +if test "x$HAVE_SYSTEMD" = x; then + AC_MSG_NOTICE([skipping test for systemd watchdog]) +else + smart_try_dir="$systemd_lib_dir" + FR_SMART_CHECK_LIB(systemd, sd_watchdog_enabled) + if test "x$ac_cv_lib_systemd_sd_watchdog_enabled" != "xyes"; then + AC_MSG_WARN([systemd watchdog is only available from systemd 209.]) + else + AC_DEFINE([HAVE_SYSTEMD_WATCHDOG], [1], + [Define to 1 if you have watchdog support in the `systemd' library (-lsystemd).] + ) + fi + dnl Set by FR_SMART_CHECKLIB + LIBS="${old_LIBS}" +fi + +dnl # +dnl # Check for the systemd headers +dnl # +if test "x$WITH_SYSTEMD" != xyes || test "x$SYSTEMD_LIBS" = x; then + AC_MSG_NOTICE([skipping test for systemd/sd-daemon.h.]) +else + smart_try_dir="$systemd_include_dir" + FR_SMART_CHECK_INCLUDE([systemd/sd-daemon.h]) + if test "x$ac_cv_header_systemd_sdmdaemon_h" = "xyes"; then + AC_DEFINE(HAVE_SYSTEMD_SD_DAEMON_H, 1, [Define to 1 if you have the header file.]) + AC_SUBST(SYSTEMD_LIBS) + AC_SUBST(SYSTEMD_LDFLAGS) + else + AC_MSG_WARN([systemd headers not found. Use --with-systemd-include-dir=.]) + fi +fi + +dnl ############################################################# +dnl # +dnl # 3. Checks for header files +dnl # +dnl ############################################################# + +dnl # +dnl # Check for talloc header files +dnl # +smart_try_dir="$talloc_include_dir" +FR_SMART_CHECK_INCLUDE([talloc.h]) +if test "x$ac_cv_header_talloc_h" != "xyes"; then + AC_MSG_WARN([talloc headers not found. Use --with-talloc-include-dir=.]) + AC_MSG_ERROR([FreeRADIUS requires libtalloc]) +fi + +dnl # +dnl # Interix requires us to set -D_ALL_SOURCE, otherwise +dnl # getopt will be #included, but won't link. +dnl # +dnl # On the other hand, it's 20222. Interix has likely been dead for a decade. :( +dnl # +case "$host" in + *-interix*) + CFLAGS="$CFLAGS -D_ALL_SOURCE" + ;; + *-darwin*) + AC_DEFINE([__APPLE_USE_RFC_3542], 1, [Force OSX >= 10.7 Lion to use RFC2292 IPv6 socket options]) + ;; +esac + +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_HEADER_TIME +AC_HEADER_SYS_WAIT + +AC_CHECK_HEADERS( \ + arpa/inet.h \ + crypt.h \ + dlfcn.h \ + errno.h \ + fcntl.h \ + features.h \ + fnmatch.h \ + getopt.h \ + glob.h \ + grp.h \ + inttypes.h \ + limits.h \ + linux/if_packet.h \ + malloc.h \ + netdb.h \ + netinet/in.h \ + prot.h \ + pwd.h \ + resource.h \ + semaphore.h \ + sia.h \ + siad.h \ + signal.h \ + stdatomic.h \ + stdalign.h \ + stdbool.h \ + stddef.h \ + stdint.h \ + stdio.h \ + sys/event.h \ + sys/fcntl.h \ + sys/prctl.h \ + sys/procctl.h \ + sys/ptrace.h \ + sys/resource.h \ + sys/security.h \ + sys/select.h \ + sys/socket.h \ + sys/time.h \ + sys/types.h \ + sys/un.h \ + sys/wait.h \ + syslog.h \ + unistd.h \ + utime.h \ + utmp.h \ + utmpx.h \ + winsock.h +) + +dnl # +dnl # FreeBSD requires sys/socket.h before net/if.h +dnl # +AC_CHECK_HEADERS(net/if.h, [], [], + [ + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + ] +) + +dnl # +dnl # other checks which require headers +dnl # +if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes" +then + AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication]) +fi + +if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes" +then + AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication]) +fi + +dnl # +dnl # Were we told to use OpenSSL, if we were and we find an error, call AC_MSG_FAILURE and exit +dnl # +if test "x$WITH_OPENSSL" = xyes; then + OLD_LIBS="$LIBS" + + dnl # + dnl # Apparently OpenSSL will attempt to build with kerberos if we don't pass this?! + dnl # + CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5" + + dnl # + dnl # Check we can link to libcrypto and libssl + dnl # + smart_try_dir="$openssl_lib_dir" + FR_SMART_CHECK_LIB(crypto, DH_new) + if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then + AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).]) + OPENSSL_LIBS="$smart_lib" + OPENSSL_LDFLAGS="$smart_ldflags" + + FR_SMART_CHECK_LIB(ssl, SSL_new) + if test "x$ac_cv_lib_ssl_SSL_new" != "xyes"; then + AC_MSG_FAILURE([failed linking to libssl. Use --with-openssl-lib-dir=, or --with-openssl=no (builds without OpenSSL)]) + else + AC_DEFINE(HAVE_LIBSSL, 1, [Define to 1 if you have the `ssl' library (-lssl).]) + OPENSSL_LIBS="$OPENSSL_LIBS $smart_lib" + + if test "$OPENSSL_LDFLAGS" != "$smart_ldflags"; then + AC_MSG_FAILURE(["inconsistent LDFLAGS between -lssl '$smart_ldflags' and -lcrypto '$OPENSSL_LDFLAGS'"]) + fi + fi + else + AC_MSG_FAILURE([failed linking to libcrypto. Use --with-openssl-lib-dir=, or --with-openssl=no (builds without OpenSSL)]) + fi + + smart_try_dir="$openssl_include_dir" + FR_SMART_CHECK_INCLUDE(openssl/ssl.h) + if test "x$ac_cv_header_openssl_ssl_h" = "xyes"; then + AC_DEFINE(HAVE_OPENSSL_SSL_H, 1, [Define to 1 if you have the header file.]) + + AC_CHECK_HEADERS( \ + openssl/asn1.h \ + openssl/conf.h \ + openssl/crypto.h \ + openssl/err.h \ + openssl/evp.h \ + openssl/hmac.h \ + openssl/md5.h \ + openssl/md4.h \ + openssl/rand.h \ + openssl/sha.h \ + openssl/ssl.h \ + openssl/ocsp.h \ + openssl/engine.h, + [ OPENSSL_CPPFLAGS="$smart_include" ], + [ + AC_MSG_FAILURE([failed locating OpenSSL headers. Use --with-openssl-include-dir=, or --with-openssl=no (builds without OpenSSL)]) + ] + ) + + AC_MSG_CHECKING([for OpenSSL version >= 1.0.2]) + AC_EGREP_CPP(yes, + [#include + #if (OPENSSL_VERSION_NUMBER >= 0x10002000L) + yes + #endif + ], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + AC_MSG_FAILURE([OpenSSL version too old]) + ] + ) + + dnl # + dnl # CPPFLAGS are passed to the compiler first, so we use + dnl # them to ensure things like --sysroot don't override the + dnl # library location we discovered previously. + dnl # + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$OPENSSL_CPPFLAGS $CPPFLAGS" + + dnl # + dnl # Now check that the header versions match the library + dnl # + AC_MSG_CHECKING([OpenSSL library and header version consistency]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + #include + ]], + [[ + printf("library: %lx header: %lx... ", (unsigned long) SSLeay(), (unsigned long) OPENSSL_VERSION_NUMBER); + if (SSLeay() == OPENSSL_VERSION_NUMBER) { + return 0; + } else { + return 1; + } + ]] + )], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + AC_MSG_FAILURE([OpenSSL library version does not match header version]) + ], + [ + AC_MSG_RESULT([cross-compiling (assuming yes)]) + ] + ) + dnl # + dnl # Check if the new HMAC_CTX interface is defined + dnl # + AC_CHECK_FUNCS( \ + SSL_get_client_random \ + SSL_get_server_random \ + SSL_SESSION_get_master_key \ + HMAC_CTX_new \ + HMAC_CTX_free \ + ASN1_STRING_get0_data \ + CONF_modules_load_file \ + CRYPTO_set_id_callback \ + CRYPTO_set_locking_callback + ) + CPPFLAGS="$old_CPPFLAGS" + fi + + LIBS="$OLD_LIBS" + AC_SUBST(OPENSSL_LIBS) + AC_SUBST(OPENSSL_LDFLAGS) + AC_SUBST(OPENSSL_CPPFLAGS) + export OPENSSL_LIBS OPENSSL_LDFLAGS OPENSSL_CPPFLAGS +fi + +dnl # +dnl # Check the pcap includes for the RADIUS sniffer. +dnl # +if test "x$PCAP_LIBS" = x; then + AC_MSG_NOTICE([skipping test for pcap.h.]) +else + dnl # + dnl # Check for pcap header files + dnl # + smart_try_dir="$pcap_include_dir" + FR_SMART_CHECK_INCLUDE([pcap.h]) + if test "x$ac_cv_header_pcap_h" = "xyes" && test "x$ac_cv_lib_pcap_pcap_open_live" = "xyes"; then + AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the `pcap' library (-lpcap) and header file .]) + AC_SUBST(PCAP_LIBS) + AC_SUBST(PCAP_LDFLAGS) + else + AC_MSG_WARN([pcap headers not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-include-dir=.]) + fi +fi + +dnl Check for collectd-client +if test "x$COLLECTDC_LIBS" = x; then + AC_MSG_NOTICE([skipping test for collectd/client.h.]) +else + dnl # + dnl # Check for collectd-client header files + dnl # + smart_try_dir="$collectdclient_include_dir" + FR_SMART_CHECK_INCLUDE([collectd/client.h]) + if test "x$ac_cv_header_collectd_client_h" = "xyes"; then + AC_DEFINE(HAVE_COLLECTDC_H, 1, [Define to 1 if you have the `collectdclient' library (-lcollectdclient).]) + AC_SUBST(COLLECTDC_LIBS) + AC_SUBST(COLLECTDC_LDFLAGS) + else + AC_MSG_WARN([collectdclient headers not found. Use --with-collectdclient-include-dir=.]) + fi +fi + +dnl # +dnl # Check the CAP includes for debugger checks +dnl # +if test "x$HAVE_LIBCAP" = x; then + AC_MSG_NOTICE([skipping test for cap.h.]) +else + dnl # + dnl # Check for CAP header files + dnl # + smart_try_dir="$cap_include_dir" + FR_SMART_CHECK_INCLUDE([sys/capability.h]) + if test "x$ac_cv_header_sys_capability_h" = "xyes"; then + AC_DEFINE(HAVE_CAPABILITY_H, 1, [Define to 1 if you have the header file.]) + else + AC_MSG_WARN([cap headers not found, will not perform debugger checks. Use --with-cap-include-dir=.]) + fi +fi + +dnl ############################################################# +dnl # +dnl # 4. Checks for typedefs +dnl # +dnl ############################################################# + +dnl # +dnl # Ensure that these are defined +dnl # +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_UID_T + +dnl # +dnl # Check for socklen_t +dnl # +FR_CHECK_TYPE_INCLUDE( + [ + #ifdef HAVE_SYS_TYPES_H + # include + #endif + + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + ], + socklen_t, int, [socklen_t is generally 'int' on systems which don't use it] +) + +dnl # +dnl # Check for uint8_t +dnl # +FR_CHECK_TYPE_INCLUDE( + [ + #ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + ], + uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic] +) + +dnl # +dnl # Check for uint16_t +dnl # +FR_CHECK_TYPE_INCLUDE( + [ + #ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + ], + uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic] +) + +dnl # +dnl # Check for uint32_t +dnl # +FR_CHECK_TYPE_INCLUDE( + [ + #ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + ], + uint32_t, unsigned int, [uint32_t should be the canonical 'network integer'] +) + +dnl # +dnl # Check for uint64_t +dnl # +FR_CHECK_TYPE_INCLUDE( + [ + #ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + ], + uint64_t, unsigned long long, [uint64_t is required for larger counters] +) + +dnl # +dnl # Check for __uint128_t (compiler builtin) +dnl # +AC_CHECK_TYPE(__uint128_t, AC_DEFINE(HAVE___UINT128_T, 1, [compiler specific 128 bit unsigned integer]), [], []) + +dnl # +dnl # Check for uint128_t (fictitious future data type) +dnl # +AC_CHECK_TYPE(uint128_t, AC_DEFINE(HAVE_UINT128_T, 1, [128 bit unsigned integer]), [], + [ + #ifdef HAVE_INTTYPES_H + # include + #endif + + #ifdef HAVE_STDINT_H + # include + #endif + ] +) + +AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], + [ + #ifdef HAVE_NETINET_IN_H + # include + #endif + ] +) + +AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], + [ + #ifdef HAVE_NETINET_IN_H + # include + #endif + + #ifdef HAVE_SYS_SOCKET_H + # include + #endif +]) + +AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], + [ + #ifdef HAVE_NETINET_IN_H + # include + #endif +]) + +AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], + [ + #ifdef HAVE_SYS_TYPES_H + # include + #endif + + #ifdef HAVE_SYS_SOCKET_H + # include + #endif + + #ifdef HAVE_NETDB_H + # include + #endif + ] +) + +dnl # +dnl # Check for sig_t +dnl # +dnl # FR_CHECK_TYPE_INCLUDE doesn't work for callbacks as it doesn't produce typedefs +dnl # +AC_MSG_CHECKING([if sig_t is defined]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #ifdef HAVE_SIGNAL_H + # include + #endif + ]], + [[ + sig_t func; + return 0; + ]] + )], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SIG_T, 1, [Define if the type sig_t is defined by signal.h]) + ], + [ + AC_MSG_RESULT(no) + ] +) + +dnl ############################################################# +dnl # +dnl # 5. Checks for structures and functions +dnl # +dnl ############################################################# +AC_CHECK_FUNCS( \ + bindat \ + clock_gettime \ + closefrom \ + ctime_r \ + dladdr \ + fcntl \ + fopencookie \ + funopen \ + getaddrinfo \ + getnameinfo \ + getopt_long \ + getpeereid \ + getresuid \ + gettimeofday \ + getusershell \ + gmtime_r \ + if_indextoname \ + inet_aton \ + inet_ntop \ + inet_pton \ + initgroups \ + kqueue \ + localtime_r \ + mallopt \ + mkdirat \ + openat \ + pthread_sigmask \ + setlinebuf \ + setresuid \ + setsid \ + setuid \ + setvbuf \ + sigaction \ + sigprocmask \ + snprintf \ + strcasecmp \ + strlcat \ + strlcpy \ + strncasecmp \ + strsep \ + strsignal \ + unlinkat \ + vdprintf \ + vsnprintf +) + +dnl # +dnl # Check if we have utmpx.h +dnl # if so, check if struct utmpx has entry ut_xtime +dnl # if not, set it to define ut_xtime = ut_tv.tv_sec +dnl # +if test "x$ac_cv_header_utmpx_h" = "xyes"; then + FR_CHECK_STRUCT_HAS_MEMBER([#include ], [struct utmpx], ut_xtime) + if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"; then + AC_DEFINE(ut_xtime, ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx]) + fi +fi + +dnl # +dnl # struct ip_pktinfo +dnl # +FR_CHECK_STRUCT_HAS_MEMBER([#include ], [struct in_pktinfo], ipi_addr) +if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"; then + AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)]) +fi + +dnl # +dnl # struct in6_pktinfo +dnl # +FR_CHECK_STRUCT_HAS_MEMBER([#include ], [struct in6_pktinfo], ipi6_addr) +if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"; then + AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)]) +fi + +dnl # +dnl # Check for htonll and htonlll +dnl # +AC_MSG_CHECKING([if htonll is defined]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + ]], + [[ + return htonll(0); + ]] + )], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_HTONLL, 1, [Define if the function (or macro) htonll exists.]) + ], + [ + AC_MSG_RESULT(no) + ] +) + +AC_MSG_CHECKING([if htonlll is defined]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + ]], + [[ + return htonlll(0); + ]] + )], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_HTONLLL, 1, [Define if the function (or macro) htonlll exists.]) + ], + [ + AC_MSG_RESULT(no) + ] +) + +dnl ############################################################# +dnl # +dnl # 6. Checks for compiler characteristics +dnl # +dnl ############################################################# + +dnl # +dnl # Ensure that these are defined +dnl # +AC_C_CONST + +dnl # +dnl # See if this is OS/2 +dnl # +AC_MSG_CHECKING([type of OS]) +OS=`uname -s` +AC_MSG_RESULT($OS) +if test "$OS" = "OS/2"; then + LIBPREFIX= +else + LIBPREFIX=lib +fi +AC_SUBST(LIBPREFIX) + +if test "x$developer" = "xyes"; then + AC_MSG_NOTICE([Setting additional developer CFLAGS]) + + dnl # + dnl # Tell the compiler to parse doxygen documentation and verify it against function and variable declarations + dnl # + AX_CC_WDOCUMENTATION_FLAG + if test "x$ax_cv_cc_wdocumentation_flag" = "xyes"; then + devcflags="-Wdocumentation" + AC_DEFINE([HAVE_WDOCUMENTATION],1,[Define if the compiler supports -Wdocumentation]) + fi + + dnl # + dnl # If we have -Weverything, it really means *everything* unlike -Wall + dnl # It's so verbose we need to turn off warnings which aren't useful. + dnl # + AX_CC_WEVERYTHING_FLAG + if test "x$ax_cv_cc_weverything_flag" = "xyes"; then + devcflags="$devcflags -W -Weverything -Wformat=2 -Wno-missing-field-initializers -Wno-date-time -Wno-padded -Wno-gnu-zero-variadic-macro-arguments -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-conversion -Wno-switch-enum -Wno-gnu-statement-expression -Wno-extended-offsetof -Wno-cast-align -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-packed $verify_ptr $fips" + else + if test "x$GCC" = "xyes"; then + devcflags="$devcflags -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wno-cast-align -Wformat-nonliteral -Wformat-security -Wformat=2 $verify_ptr $fips" + INSTALLSTRIP="" + fi + fi + + dnl # + dnl # Can't use mutliple -fsanitize flags, so we need to combine + dnl # the values into one. + dnl # + fsanitizeflags= + + dnl # + dnl # If running with clang, add in FUZZER + dnl # + if test "x$fuzzer" = "xyes" && test "x$ax_cv_cc_clang" = "xyes"; then + dnl # + dnl # -fsanitize=fuzzer - Build with fuzzer support + dnl # + fsanitizeflags="$fsanitizeflags,fuzzer" + fi + + dnl # + dnl # Add in ASAN + dnl # + if test "x$address_sanitizer" = "xyes"; then + dnl # + dnl # -fsanitize=address - Build with address sanitizer support + dnl # -fno-omit-frame-pointer - Always keep the frame pointer in a register + dnl # -fno-optimize-sibling-calls - Don't optimize away tail recursion. + dnl # + devcflags="$devcflags -fno-omit-frame-pointer -fno-optimize-sibling-calls" + + AX_CC_SANITZE_ADDRESS_USE_AFTER_SCOPE_FLAG + if test "x$ax_cv_cc_sanitize_address_use_after_scope" = "xyes"; then + devcflags="$devcflags -fsanitize-address-use-after-scope" + fi + + AC_CHECK_HEADERS(sanitizer/lsan_interface.h) + fsanitizeflags="$fsanitizeflags,address" + fi + + dnl # + dnl # Add in LSAN + dnl # + if test "x$leak_sanitizer" = "xyes"; then + dnl # + dnl # -fsanitize=leak - Build with lsan support + dnl # + fsanitizeflags="$fsanitizeflags,leak" + fi + + dnl # + dnl # Add in TSAN + dnl # + if test "x$thread_sanitizer" = "xyes"; then + dnl # + dnl # -fsanitize=thread - Build with tsan support + dnl # + fsanitizeflags="$fsanitizeflags,thread" + fi + + dnl # + dnl # Add in UBSAN + dnl # + if test "x$undefined_behaviour_sanitizer" = "xyes"; then + dnl # + dnl # -fsanitize=undefined - Build with ubsan support + dnl # -fno-omit-frame-pointer - Always keep the frame pointer in a register + dnl # + devcflags="$devcflags -fno-sanitize-recover=undefined -fno-omit-frame-pointer" + devldflags="$devldflags -fno-sanitize-recover=undefined" + fsanitizeflags="$fsanitizeflags,undefined" + fi + + if test "x$fsanitizeflags" != "x"; then + fsanitizeflags="$(echo $fsanitizeflags | sed 's/^,*//')" + devcflags="-fsanitize=$fsanitizeflags $devcflags" + devldflags="-fsanitize=$fsanitizeflags $devldflags" + fi + + dnl # + dnl # Clean the flags up + dnl # + devcflags="$(echo $devcflags | sed -e 's/\\t//g;s/ //g')" + devldflags="$(echo $devldflags | sed -e 's/\\t//g;s/ //g')" + + AC_MSG_NOTICE([Developer CFLAGS are "$devcflags"]) + AC_MSG_NOTICE([Developer LDFLAGS are "$devldflags"]) + + dnl # + dnl # Enable experimental modules (we want to know if code changes breaks one of them) + dnl # + if test "x$EXPERIMENTAL" != "xno"; then + AC_MSG_NOTICE([is developer build, enabling experimental modules implicitly, disable with --without-experimental-modules]) + EXPERIMENTAL=yes + fi +else + devcflags="" + devldflags="" + CFLAGS="$CFLAGS -DNDEBUG" + INSTALLSTRIP="" +fi + +dnl # +dnl # May of been set outside of this configure script +dnl # +AC_MSG_CHECKING([if building with -DNDEBUG]) +if echo "$CFLAGS" | grep '\-DNDEBUG' > /dev/null; then + AC_MSG_RESULT([yes]) + AC_DEFINE([WITH_NDEBUG], [1], [define if the server was built with -DNDEBUG]) +else + AC_MSG_RESULT([no]) +fi + +export EXPERIMENTAL + +dnl # +dnl # append the current git hash onto the version string +dnl # +if test -d $srcdir/.git -a "x$GIT" = "xyes"; then + RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1 | cut -c1-9` + AC_DEFINE_UNQUOTED([RADIUSD_VERSION_COMMIT],[${RADIUSD_VERSION_COMMIT}],[Commit HEAD at time of configuring]) +fi + +dnl # +dnl # check for some compiler features +dnl # +FR_TLS +FR_HAVE_BUILTIN_CHOOSE_EXPR +FR_HAVE_BUILTIN_TYPES_COMPATIBLE_P +FR_HAVE_BUILTIN_BSWAP64 +FR_HAVE_BOUNDED_ATTRIBUTE + +dnl ############################################################# +dnl # +dnl # 7. Checks for library functions +dnl # +dnl ############################################################# + +dnl # +dnl # Check for talloc_set_memlimit +dnl # This was only included in version 2.0.8 +dnl # +AC_CHECK_LIB(talloc, talloc_set_memlimit, + [ + AC_DEFINE(HAVE_TALLOC_SET_MEMLIMIT, 1, [Define to 1 if you have the function talloc_set_memlimit.]) + ] +) + +dnl # +dnl # Check for libcrypt +dnl # We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) +dnl # +AC_CHECK_LIB(crypt, crypt, + CRYPTLIB="-lcrypt" +) + +if test "$CRYPTLIB" != ""; then + AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]) +else + AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])) +fi + +dnl crypt_r is the GNU thread-safe version +AC_CHECK_LIB(crypt, crypt_r, AC_DEFINE(HAVE_CRYPT_R, [], [Do we have the crypt_r function])) + +dnl Check for libcipher +AC_CHECK_LIB(cipher, setkey, + CRYPTLIB="${CRYPTLIB} -lcipher" +) +AC_SUBST(CRYPTLIB) + +dnl # +dnl # Check for libexecinfo support, on some systems this is built into libc +dnl # on others it's a separate library. +dnl # +dnl extra argument: --with-execinfo-lib-dir +execinfo_lib_dir= +AC_ARG_WITH(execinfo-lib-dir, +[AS_HELP_STRING([--with-execinfo-lib-dir=DIR], +[directory in which to look for execinfo library files])], +[ case "$withval" in + no) + AC_MSG_ERROR([Need execinfo-lib-dir]) + ;; + yes) + ;; + *) + execinfo_lib_dir="$withval" + ;; + esac ] +) + +dnl extra argument: --with-execinfo-include-dir +execinfo_include_dir= +AC_ARG_WITH(execinfo-include-dir, +[AS_HELP_STRING([--with-execinfo-include-dir=DIR], +[directory in which to look for execinfo include files])], +[ case "$withval" in + no) + AC_MSG_ERROR([Need execinfo-include-dir]) + ;; + yes) + ;; + *) + execinfo_include_dir="$withval" + ;; + esac ] +) + +dnl # +dnl # Look for execinfo.h and symbols +dnl # +smart_try_dir=$execinfo_include_dir +FR_SMART_CHECK_INCLUDE(execinfo.h) +if test "x$ac_cv_header_execinfo_h" = "xyes"; then + smart_try_dir=$execinfo_lib_dir + FR_SMART_CHECK_LIB(execinfo, backtrace_symbols) + if test "x$ac_cv_lib_execinfo_backtrace_symbols" != "xyes"; then + dnl # Might be provided as part of libc + AC_MSG_CHECKING([if execinfo provided as part of libc]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + void *sym[1]; + backtrace_symbols(&sym, sizeof(sym)) ]])],[ + AC_MSG_RESULT(yes) + ac_cv_lib_execinfo_backtrace_symbols="yes" + ],[ + AC_MSG_RESULT(no) + ]) + fi + + if test "x$ac_cv_lib_execinfo_backtrace_symbols" = "xyes"; then + AC_DEFINE(HAVE_EXECINFO, [1], [define this if we have and symbols]) + fi +fi + +dnl # +dnl # Check for regular expression support. +dnl # +dnl extra argument: --with-pcre +PCRE=yes +AC_ARG_WITH(pcre, +[AS_HELP_STRING([--with-pcre], +[use libpcre (if available). (default=yes)])], +[ case "$withval" in + no) + PCRE=no + ;; + yes) + PCRE=yes + ;; + esac ] +) + +dnl extra argument: --with-pcre-lib-dir +pcre_lib_dir= +AC_ARG_WITH(pcre-lib-dir, +[AS_HELP_STRING([--with-pcre-lib-dir=DIR], +[directory in which to look for pcre library files])], +[ case "$withval" in + no) + AC_MSG_ERROR(Need pcre-lib-dir) + ;; + yes) + ;; + *) + pcre_lib_dir="$withval" + ;; + esac ] +) + +dnl extra argument: --with-pcre-include-dir +pcre_include_dir= +AC_ARG_WITH(pcre-include-dir, +[AS_HELP_STRING([--with-pcre-include-dir=DIR], +[directory in which to look for pcre include files])], +[ case "$withval" in + no) + AC_MSG_ERROR(Need pcre-include-dir) + ;; + yes) + ;; + *) + pcre_include_dir="$withval" + ;; + esac ] +) + +dnl extra argument: --with-regex +REGEX= +AC_ARG_WITH(regex, +[AS_HELP_STRING([--with-regex], +[Whether to build with regular expressions (default=yes)])], +[ case "$withval" in + no) + REGEX=no + ;; + *) + ;; + esac ] +) + +dnl # +dnl # First look for PCRE +dnl # +if test "x$REGEX" != "xno" && test "x$PCRE" != "xno"; then + smart_try_dir=$pcre_include_dir + FR_SMART_CHECK_INCLUDE(pcre.h) + if test "x$ac_cv_header_pcre_h" = "xyes"; then + smart_try_dir=$pcre_lib_dir + FR_SMART_CHECK_LIB(pcre, pcre_compile) + if test "x$ac_cv_lib_pcre_pcre_compile" = "xyes"; then + REGEX=yes + AC_DEFINE(HAVE_PCRE, [1], [define this if we have libpcre]) + AC_DEFINE(HAVE_BINSAFE_REGEX, 1, [Define if we have a binary safe regular expression library]) + fi + fi +fi + +dnl # +dnl # If no PCRE, fallback to POSIX regular expressions +dnl # +if test "x$REGEX" = "x"; then + smart_try_dir= + FR_SMART_CHECK_INCLUDE(regex.h) + if test "x$ac_cv_header_regex_h" = "xyes"; then + REGEX=yes + AC_MSG_CHECKING([for extended regular expressions]) + AC_EGREP_CPP(yes, + [ + #include + #ifdef REG_EXTENDED + yes + #endif + ], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_REG_EXTENDED, [1], [define this if we have REG_EXTENDED (from )]) + ], + [ + AC_MSG_RESULT(no) + ] + ) + + dnl # + dnl # Some platforms require the regex library to be linked explicitly + dnl # + AC_CHECK_LIB(regex, regcomp, + [ + LIBS="-lregex $LIBS" + ] + ) + + dnl # + dnl # Check for some BSD extensions which allow normal regexes to be + dnl # binary safe. + dnl # + AC_CHECK_FUNCS(\ + regncomp \ + regnexec + ) + if test x"$ac_cv_func_regncomp" = x"yes" && test x"$ac_cv_func_regnexec" = x"yes"; then + AC_DEFINE(HAVE_BINSAFE_REGEX, 1, [Define if we have a binary safe regular expression library]) + fi + fi +fi + +# +# Some platforms require an explicit -latomic +# +AC_SEARCH_LIBS([__atomic_load_4], [atomic]) + +if test "x$REGEX" = "xyes"; then + AC_DEFINE(HAVE_REGEX, 1, [Define if we have any regular expression library]) +fi + +dnl # +dnl # Check the style of gethostbyaddr, in order of preference +dnl # GNU (_r eight args) +dnl # +AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r]) + +dnl # +dnl # SYSV (_r six args) +dnl # +AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r]) + +dnl # +dnl # BSD (three args, may not be thread safe) +dnl # +AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r]) + +dnl # +dnl # Tru64 has BSD version, but it is thread safe +dnl # http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM +dnl # We need #stdio.h to define NULL on FreeBSD (at least) +dnl # +gethostbyaddrrstyle="" +AC_MSG_CHECKING([gethostbyaddr_r() syntax]) +case "$host" in + *-freebsd*) + dnl # + dnl # With FreeBSD, check if there's a prototype for gethostbyaddr_r. + dnl # Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we + dnl # override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU + dnl # style support. + dnl # + AC_CHECK_DECLS([gethostbyaddr_r], [], + [ + AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, + [style of gethostbyaddr_r functions ]) + gethostbyaddrrstyle=BSD + AC_MSG_WARN([FreeBSD overridden to BSD-style]) + ], + [ + #ifdef HAVE_NETDB_H + #include + #endif + ]) + ;; +esac + +if test "x$gethostbyaddrrstyle" = "x"; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ]])],[ + AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ]) + gethostbyaddrrstyle=GNU + ],[]) +fi + +if test "x$gethostbyaddrrstyle" = "x"; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ]])],[ + AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ]) + gethostbyaddrrstyle=SYSV + ],[]) +fi + + +if test "x$gethostbyaddrrstyle" = "x"; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ gethostbyaddr(NULL, 0, 0) ]])],[ + AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ]) + gethostbyaddrrstyle=BSD + ],[]) +fi + +if test "x$gethostbyaddrrstyle" = "x"; then + AC_MSG_RESULT([none! It must not exist, here.]) +else + AC_MSG_RESULT([${gethostbyaddrrstyle}-style]) +fi + +if test "x$gethostbyaddrrstyle" = "xBSD"; then + AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ]) +fi + +dnl # +dnl # Check the style of gethostbyname, in order of preference +dnl # GNU (_r seven args) +dnl # SYSV (_r five args) +dnl # BSD (two args, may not be thread safe) +dnl # Tru64 has BSD version, but it _is_ thread safe +dnl # http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM +dnl # We need #stdio.h to define NULL on FreeBSD (at least) +dnl # +gethostbynamerstyle="" +AC_MSG_CHECKING([gethostbyname_r() syntax]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ]])],[ + AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ]) + gethostbynamerstyle=GNU +],[]) + +if test "x$gethostbynamerstyle" = "x"; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ]])],[ + AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ]) + gethostbynamerstyle=SYSV + ],[]) +fi + +if test "x$gethostbynamerstyle" = "x"; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ gethostbyname(NULL) ]])],[ + AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ]) + gethostbynamerstyle=BSD + ],[]) +fi + +if test "x$gethostbynamerstyle" = "x"; then + AC_MSG_RESULT([none! It must not exist, here.]) +else + AC_MSG_RESULT([${gethostbynamerstyle}-style]) +fi + +if test "x$gethostbynamerstyle" = "xBSD"; then + AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ]) +fi + +dnl # +dnl # Check for thread-safe getpwnam_r and getgrnam_r +dnl # +if test "x$ac_cv_header_pwd_h" = "xyes"; then + AC_MSG_CHECKING([getpwnam_r]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + #include + ]], [[ getpwnam_r(NULL, NULL, NULL, 0, NULL) ]])],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_GETPWNAM_R, 1, + [Define to 1 if you have the getpwnam_r.] + ) + ],[ + AC_MSG_RESULT(no) + ]) +fi + +if test "x$ac_cv_header_grp_h" = "xyes"; then + AC_MSG_CHECKING([getgrnam_r]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + #include + ]], [[ getgrnam_r(NULL, NULL, NULL, 0, NULL) ]])],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_GETGRNAM_R, 1, + [Define to 1 if you have the getgrnam_r.] + ) + ],[ + AC_MSG_RESULT(no) + ]) +fi + + +dnl # +dnl # Check for non-posix solaris ctime_r (extra buflen int arg) +dnl # +AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r]) +AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r]) +ctimerstyle="" +AC_MSG_CHECKING([ctime_r() syntax]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ ctime_r(NULL, NULL, 0) ]])],[ + AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function]) + ctimerstyle="SOLARIS" +],[]) + +if test "x$ctimerstyle" = "x"; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ ctime_r(NULL, NULL) ]])],[ + AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function]) + ctimerstyle="POSIX" + ],[]) +fi + +if test "x$ctimerstyle" = "x"; then + AC_MSG_RESULT([none! It must not exist, here.]) +else + AC_MSG_RESULT([${ctimerstyle}-style]) +fi + +AC_SUBST(HOSTINFO, $host) + +dnl ############################################################# +dnl # +dnl # 8. Checks for system services +dnl # +dnl ############################################################# + +dnl # +dnl # Figure out where libtool is located, +dnl # +top_builddir=`pwd` +export top_builddir +AC_MSG_RESULT([top_builddir=$top_builddir]) +dnl # AC_SUBST(top_builddir) + +dnl # +dnl # import libtool stuff +dnl # +dnl ############################################################# +dnl # +dnl # Configure in any module directories. +dnl # +dnl ############################################################# + +dnl ############################################################ +dnl # Remove any conflicting definitions if autoconf.h +dnl # is being included by a module. +dnl ############################################################# +AH_BOTTOM([#include ]) + +dnl ############################################################ +dnl # make modules by list +dnl ############################################################# +if test "x$EXPERIMENTAL" = "xyes"; then + for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do + MODULES="$MODULES $foo" + done +else + dnl # + dnl # make ONLY the stable modules + dnl # + for foo in `cat "${srcdir}"/src/modules/stable`; do + MODULES="$MODULES $foo" + done +fi + +dnl ############################################################ +dnl # Add autoconf subdirs, based on the module list we +dnl # previously created. +dnl ############################################################# +mysubdirs="" +for bar in $MODULES; do + if test -f "${srcdir}"/src/modules/$bar/configure; then + mysubdirs="$mysubdirs src/modules/$bar" + fi +done + +dnl # +dnl # Don't change the variable name here. Autoconf goes bonkers +dnl # if you do. +dnl # +AC_CONFIG_SUBDIRS($mysubdirs) +AC_SUBST(MODULES) + +dnl # +dnl # If reproducible builds are not enabled, disable +dnl # -Wdate-time so the compiler doesn't croak. +dnl # +if test "x$ax_cv_cc_no_date_time_flag" = "xyes" && test "x$reproducible_builds" != "xyes"; then + CFLAGS="-Wno-date-time $CFLAGS" +fi + +dnl ############################################################# +dnl # +dnl # Add $devcflags, $devldflags and -Werror last, so they don't +dnl # interfere with autoconf's test programs. +dnl # +dnl ############################################################# +CFLAGS="$CFLAGS $devcflags" +LDFLAGS="$LDFLAGS $devldflags" + +if test "x$werror" = "xyes"; then + CFLAGS="-Werror $CFLAGS" +fi + +dnl ############################################################# +dnl # +dnl # And finally, output the results. +dnl # +dnl ############################################################# +AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h]) +AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)]) +AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main && chmod +x checkrad radlast radtest)]) +AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts && chmod +x rc.radiusd cron/radiusd.cron.daily cron/radiusd.cron.monthly cryptpasswd)]) + +dnl # +dnl # Substitute whatever libraries we found to be necessary +dnl # +AC_SUBST(LIBS) +AC_SUBST(INSTALLSTRIP) + +AC_SUBST(USE_SHARED_LIBS) +USE_STATIC_LIBS="yes" +AC_SUBST(USE_STATIC_LIBS) +AC_SUBST(STATIC_MODULES) + +AC_CONFIG_FILES([\ + ./Make.inc \ + ./src/include/build-radpaths-h \ + ./src/main/radsniff.mk \ + ./src/main/checkrad \ + ./src/main/radlast \ + ./src/main/radtest \ + ./scripts/rc.radiusd \ + ./scripts/cron/radiusd.cron.daily \ + ./scripts/cron/radiusd.cron.monthly \ + ./scripts/cryptpasswd \ + ./raddb/radrelay.conf \ + ./raddb/radiusd.conf +]) +AC_OUTPUT + +FR_MODULE_REPORT diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..e35d885 --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +_build diff --git a/doc/ChangeLog b/doc/ChangeLog new file mode 100644 index 0000000..6b7006e --- /dev/null +++ b/doc/ChangeLog @@ -0,0 +1,189 @@ +FreeRADIUS 3.2.3 Fri 26 May 2023 12:00:00 EDT urgency=low + Configuration changes + * The rlm_ldap and rlm_sql modules now have a "max_retries" configuration + item in the pool section. This sets a limit on how many times an operation + will be retried if it fails indicating a connection issue. + * Added "check_crl" configuration to rlm_ldap. This only works with OpenSSL. + Many Linux distributions use other TLS libraries, which won't work. + * Note that rlm_ldap does not support "-=" operators. The documentation + disagreed with the code, so we fixed the documentation. + * If checkrad is called from SQL Simultaneous-Use checks it will now be + passed NAS-Port-Id (as stored in the database), rather than NAS-Port. + + Feature improvements + * Add "max_retries" for connection pools. Fixes #4908. Patch from Nick Porter. + * Update dictionary.ciena, dictionary.huawei, dictionary.wifialliance and + dictionary.wispr; add dictionary.eleven. + * You can now list "eap" in the "pre-proxy" section. If the packet + contains a malformed EAP message, then the request will be rejected. + The home server will either reject (or discard) this packet anyways, + so this change can only help with large proxy scenarios. + * Show warnings if libldap is not using OpenSSL. + * Support RADIUS/1.1. See https://datatracker.ietf.org/doc/draft-dekok-radext-radiusv11/ + Disabled by default, can be enabled by passing `--with-radiusv11` to the + configure script. For now, this is for testing interoperability. + * Add extra sanity checks for malformed EAP attributes. + * More TLS debugging output + * Clear old module instance data before HUP reload. Avoids burst memory use + when e.g. using large data files with rlm_files. Patch from Nick Porter. + * `rlm_cache_redis` is now included in the freeradius-redis packages. + * Separate out python2/python3 in Debian Packages. Previously python 2 or 3 + was built depending on the system default which led to confusion. We now build + both freeradius-python2 and freeradius-python3 packages where possible. + + Bug fixes + * Don't leak MD contexts with OpenSSL 3.0. + * Increase internal buffer size for TLS connections, which + can help with high-load proxies. + * Send Status-Server checks for TLS connections + * Give descriptive error if "update CoA" is used with "fake" packets, + as it won't work. i.e. inner-tunnel and virtual home servers. + * Many small ASAN / LSAN fixes from Jorge Pereira. + * Close inbound RADIUS/TLS socket on TLS errors. When a home server + sees a TLS error, it will now close the socket, so proxies do not + have an open (but dead) TLS connection. + * Fix mutex locking issues on inbound RADIUS/TLS connections. + This change avoids random issues with "bad record mac". + * Improve REST encoding loop. Patch from Herwin Weststrate. Closes #4950 + * Correctly report the LDAP group a user was found in. Fixes #3084. + Patch from Nick Porter. + * Force correct packet type when running Post-Auth-Type. Helps with #4980 + * Fix small leak in Client-Lost code. Patch from Terry Burton. PR #4996 + * Fix TCP socket statistics. Closes #4990 + * Use NAS-Port-Id instead of NAS-Port during SQL simultaneous-use + checks. Helps with #5010 + +FreeRADIUS 3.2.2 Thu 16 Feb 2023 12:00:00 EDT urgency=low + Configuration changes + * The linelog module now has a "header" configuration item, + which places a header in any new file it creates. + * The ldap module now supports setting "cipher_list". See + mods-available/ldap. + * Add "connect_timeout" for outgoing TLS sockets. Helps with #3501. + * Add config section for xlats in rlm_rest and an option to + control REST body data encoding. Patches by Nick Porter. + * Allow Operator-Name and Called-Station-Id in attr_filter when + proxying. Helps with less work in Eduroam configurations. + * Ensure that the AcctUpdateTime field in SQL is always updated. + This is so that we can track when the last packet arrived. + * Update the default configuration to reply to NAS when accounting + proxying fails, but we still write to the detail file. + + Feature improvements + * The "configure" process now gives a much clearer report + when it's finished. Patches by Matthew Newton. + * Fallback to "uname -n" on missing "hostname". Fixes #4771 + * Export thread details in radmin "stats threads". Fixes #4770 + * Improve queries for processing radacct into periodic usage data. + Fix from Nick Porter. + * Update dictionary.juniper + * Add dictionary.calix + * Fix dictionary.rfc6519 DS-Lite-Tunnel-Name to be "octets" + * Update documentation for robust-proxy-accounting, and be more + aggressive about sending packets. + * Add per-module README.md files in the source. + * Add default Visual Studio configuration for developers. + * Postgres can now automatically use alternate queries for errors + other than duplicate keys. + * %{listen:TLS-PSK-Identity} is now set when using PSK and psk_query + This helps the server track the identity of the client which is + connecting. + * Include thread stats in Status-Server attributes. Fixes #4870. + * Mark rlm_unbound stable and add to packages. Patches by Nick Porter. + * Remove broken/unsupported Dockerfiles for centos8 and + debian9. + * Ensure Docker containers have stable uid/gid. Patches + from Terry Burton. + + Bug fixes + * Preliminary support for non-blocking TLS sockets. Helps with #3501. + * Fix support for partial certificate chains after adding reload + support. Fixes #4753 + * Fix handling of debug_condition. + * Clean up home server states, and re-sync with the dictionaries. + * Correct certificate order when creating TLS-* attributes. + Fixes #4785 + * Update use of isalpha() etc. so broken configurations have less + impact on the server. + * Outgoing TLS sockets now set SNI correctly from the "hostname" + configuration item. + * Support Apple Homebrew on the M1. Fixes #4754 + * Better error messages when %{listen:TLS-...} is used. + * Getting statistics via Status-Server can now be done within a + virtual server. Fixes #4868 + * Make TTLS+MS-CHAP work with TLS 1.3. Fixes #4878. + * Fix md5 xlat memory leak when using OpenSSL 3. Fix by Terry Burton. + +FreeRADIUS 3.2.1 Mon 03 Oct 2022 12:00:00 EDT urgency=low + Feature improvements + * Add dictionary.ciena, dictionary.nile, and DHCPv4 dictionaries. + * Add simultaneous-use queries for MS SQL. + * Add radmin command for "stats pool " + Which prints out statistics about the connection pools + * Client statistics now shows "conflicts", to count conflicting + packets. + * New optional "lightweight accounting-on/off" strategy. When + refreshing queries.conf you should also add the new nasreload table + and corresponding GRANTs to your DB schema. + * Add TLS-Client-Cert-X509v3-Certificate-Policies, which helps with + Eduroam. Suggested by Stefan Winter. + * Allow auth+acct for TCP sockets, too. + * Add rlm_cache_redis. See raddb/mods-available/cache for details + * Allow radmin to look up home servers by name, too. + * Ensure that dynamic clients don't create loops on duplicates. + Reported by Sam Yee. + * Removed rlm_sqlhpwippool. There was no documentation, no configuration, + and the module was ~15 years old with no one using it. + * Marked rlm_python3 as stable. + * Add sigalgs_list. See raddb/mods-available/eap. Patch from + Boris Lytochkin. + * For rlm_linelog, when opening files in /dev, look at "permissions" to see + whether to open them r/w. + * More flexibility for dynamic home servers. See doc/configuration/dynamic_home_servers.md + and raddb/home_servers/README.md + * Allow setting of application_name for PostgreSQL. See mods-available/sql. + + Bug fixes + * Correct test for open sessions in radacct for MS SQL. + * The linelog module now opens /dev/stdout in "write-only" mode + if the permissions are set to "u+w" (0002). + * Various fixes to rlm_unbound from Nick Porter. + * PEAP now correctly runs Post-Auth-Type Accept + * Create "TLS-Cert-*" for outbound Radsec, instead of TLS-Client-Cert-* + Fixes #4698. See sites-available/tls, and fix_cert_order. + * Minor updates and fixes to CI, Dockerfiles and packaging. + * Fix rlm_python3 build with python >= 3.10. Fixes #4441 + +FreeRADIUS 3.2.0 Thu 21 Apr 2022 12:00:00 EDT urgency=low + Configuration changes + * "correct_escapes" has been removed, and is always set to "true" + internally. Configuration changes may be required if you are + using configurations from before 3.0.5. Other than this + difference, 3.2.x is compatible with 3.0.x, and configurations + from 3.0.x can be simply copied into a system running 3.2.x. + + Feature improvements + * All features from 3.0.x are included in the 3.2.x releases. In addition: + * Support PEAP and TTLS with TLS 1.3. This has been + tested with wpa_supplicant and Windows 11. + * Add 'reset_day' and '%%r' parameter for rlm_sqlcounter to specify which + day of the month the counter should be reset. + * Partial backport of rlm_json from v4, providing the json_encode xlat. + See mods-available/json for documentation. + * Support for haproxy "PROXY" protocol. + See sites-available/tls, "proxy_protocol" and doc/antora/modules/howto/pages/protocols/proxy/ + * Support for sending CoA-Request and Disconnect-Request packets + in "reverse" down RadSec tunnels. Experimental for now, and + undocumented. + * It is now possible to run a virtual server when saving / loading + TLS cache attributes. See sites-available/tls-cache for + more information. + * Removed the "cram" module. It was undocumented, and used old + and insecure authentication methods. + * Remove the "otp" module. The "otpd" program it needs is no longer available, + and the module has not been usable since at least 2015. + * All features from 3.0.x are included in the 3.2.x releases. + * 3.2.0 requires OpenSSL 1.0.2 or greater. + + Bug fixes + * All bug fixes from 3.0.x are included in the 3.2.x releases. diff --git a/doc/Makefile.sphinx b/doc/Makefile.sphinx new file mode 100644 index 0000000..235ba9d --- /dev/null +++ b/doc/Makefile.sphinx @@ -0,0 +1,95 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " pdf to make standalone PDF files" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +pdf: + $(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) _build/pdf + @echo + @echo "Build finished. The PDFs are in _build/pdf." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FreeRADIUS.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FreeRADIUS.qhc" + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..7801c90 --- /dev/null +++ b/doc/README @@ -0,0 +1,181 @@ +1. INTRO + + The FreeRADIUS Server Project is a high performance and highly + configurable multi-protocol policy server, supporting RADIUS, DHCPv4 + and VMPS. It is available under the terms of the GNU GPLv2. + + All code in this server was written for this project. + + +2. INSTALLATION + + See the INSTALL file, in the parent directory. + + +3. CONFIGURATION FILES + + Much of the server documentation is included only in the comments in the + configuration files. Reading the configuration files is REQUIRED to fully + understand how to create complex configurations of the server. + +3a. 'clients.conf' + + Make sure the clients (NAS, switches, access points etc) are set up to + use the host radiusd is running on as authentication and accounting host. + Configure these clients with a "radius secret", which should also be + entered into the client definition in /etc/raddb/clients.conf. + See also the manual page for clients.conf(5). + +3b. 'users' + + Users may be defined in the "users" file (raddb/mods-config/files/authorize). + All entries are processed in the order as they appear in the file. + If an entry matches the username, radiusd will stop scanning the users + file (unless the attribute "Fall-Through = Yes" is set). + + You can uses spaces in usernames by escaping them with \ or by using + quotes. For example, "joe user" or joe\ user. + + The 'users' file is read by the "rlm_files" module. + +3c. NEW RADIUS ATTRIBUTES (to be used in the USERS file). + + Name Type Descr. + ---- ---- ------ + Simultaneous-Use integer Max. number of concurrent logins + Fall-Through integer Yes/No + Login-Time string Defines when user may login. + Current-Time string Allows you to perform time-based + checks when a request is received. + + Login-Time defines the time span a user may login to the system. The + format of a so-called time string is like the format used by UUCP. + A time string may be a list of simple time strings separated by "|" or ",". + + Each simple time string must begin with a day definition. That can be just + one day, multiple days, or a range of days separated by a hyphen. A + day is Mo, Tu, We, Th, Fr, Sa or Su, or Wk for Mo-Fr. "Any" or "Al" + means all days. + + After that a range of hours follows in hhmm-hhmm format. + + For example, "Wk2305-0855,Sa,Su2305-1655". + + radiusd calculates the number of seconds left in the time span, and + sets the Session-Timeout to that number of seconds. So if someones + Login-Time is "Al0800-1800" and she logs in at 17:30, Session-Timeout + is set to 1800 seconds so that she is kicked off at 18:00. + + +4. LOG FILES + +4a. /var/log/radius/radutmp + + In this file the currently logged in users are held. The program "radwho" + reads this file and gives you a summary. Rogue sessions can be deleted + from this file with the "radzap" program. + +4b. /var/log/radius/radwtmp + + This file is "wtmp" compatible and keeps a history of all radius logins/ + logouts. This file can be read with the "last" program, and other Unix + accounting programs (such as "ac" and "sac") can be used to produce a + summary. + +4c. /var/log/radius/radius.log + + All RADIUS informational, diagnostic and error messages are logged in + this file, including all login attempts. + +4d. /var/log/radius/radacct//detail + + This is the original radius logfile, as written by all the Livingston + radius servers. It's only created if the directory + /var/log/radius/radacct exists. + + For more configuration options on the detail file please see + raddb/mods-available/detail as it expands upon this greatly. + + +5. MORE INFO, SUPPORT + + The latest version of FreeRADIUS is always available from + the git repository hosted on GitHub at + + https://github.com/FreeRADIUS/freeradius-server + + or see + + http://freeradius.org/git/ + + for more information. + + There are two mailing lists for users and developers. General + user, administrator and configuration issues should be discussed + on the users list at: + + http://lists.freeradius.org/mailman/listinfo/freeradius-users + + When asking for help on the users list, be sure the include a + detailed and clear description of the problem, together with + full debug output from FreeRADIUS, obtained by running + + radiusd -X + + Developers only discussion is to be had on the devel list: + + http://lists.freeradius.org/mailman/listinfo/freeradius-devel + + Please do not raise general configuration issues here. + + +6. OTHER INFORMATION + + The files in other directories are: + + debian/ Files to build Debian Linux packages. + + doc/ Various snippets of documentation + doc/rfc/ Copies of the RFC's. If you have Perl, do a 'make' in + that directory, and look at the HTML output. + + man/ Unix Manual pages for the server, configuration files, + and associated utilities. + + mibs/ SNMP Mibs for the server. + + raddb/ Default configuration files for the server. + + redhat/ Files to build RedHat RPM packages. + + scripts/ Sample scripts for startup and maintenance. + + share/ Attribute dictionaries. + + src/ Source code + src/main source code for the daemon and associated utilities + src/lib source code for the RADIUS library + src/include header files + src/modules dynamic plug-in modules + src/tests test harness used by "make test" + + suse/ Files to build SuSE RPM packages. + + + If you have ANY problems, concerns, or surprises when running + the server, then run it in debugging mode, as root, from the + command line: + + # radiusd -X + + It will produce a large number of messages. The answers to many + questions, and the solution to many problems, can usually be found in + these messages. + + For further details, see: + + https://freeradius.org/documentation/ + + and the 'bugs' file, in this directory. + +$Date$ diff --git a/doc/all.mk b/doc/all.mk new file mode 100644 index 0000000..1a88f52 --- /dev/null +++ b/doc/all.mk @@ -0,0 +1,55 @@ +ifneq "$(docdir)" "no" +install: install.doc + +clean: clean.doc + +DOCDIRS := $(patsubst doc/%,$(R)$(docdir)/%,$(filter-out doc/source%,$(shell find doc -type d))) +DOCFILES := $(filter-out %~ %/all.mk %.gitignore doc/rfc/update.sh doc/source/%,$(shell find doc -type f)) +DOCINSTALL := $(patsubst doc/%,$(R)$(docdir)/%,$(DOCFILES)) + +# Create the directories +$(DOCDIRS): + @echo INSTALL $(patsubst $(R)$(docdir)/%,doc/%,$@) + @$(INSTALL) -d -m 755 $@ + +# Files depend on directories (order only). +# We don't care if the directories change. +$(DOCINSTALL): | $(DOCDIRS) + +# Wildcard installation rule +$(R)$(docdir)/%: doc/% | $(dir $@) + @echo INSTALL $< + @$(INSTALL) -m 644 $< $@ + +install.doc: $(DOCINSTALL) + +.PHONY: clean.doc +clean.doc: + @rm -rf doc/*~ doc/rfc/*~ build/docsite + +# +# Deal with these later +# +DOCRST := $(wildcard *.rst) +%.html: %.rst + @rst2html.py $^ > $@ + +.PHONY: html +html: $(DOCRST:.rst=.html) + +# +# antora rebuilds the entire documentation site on each run +# so we need to pick a single file to compare dependency +# timestamps against. +# +# we use sitemap.xml as it'll be regenerated on every antora +# run. +# +build/docsite/sitemap.xml: $(ADOC_FILES) + @echo ANTORA site.yml + ${Q}$(ANTORA) $(ANTORA_FLAGS) site.yml + + +docsite: build/docsite/sitemap.xml + +endif diff --git a/doc/antora/antora.yml b/doc/antora/antora.yml new file mode 100644 index 0000000..e345e9c --- /dev/null +++ b/doc/antora/antora.yml @@ -0,0 +1,18 @@ +# +# Metadata for the freeradius-server component +# Examples of other components are the PAM module, +# apache module, and the client library. +# +name: freeradius-server +title: The FreeRADIUS Server +version: '3.2.3' +start_page: ROOT:index.adoc +nav: +- modules/ROOT/nav.adoc +- modules/installation/nav.adoc +- modules/concepts/nav.adoc +- modules/howto/nav.adoc +- modules/tutorials/nav.adoc +- modules/unlang/nav.adoc +- modules/developers/nav.adoc +- modules/raddb/nav.adoc diff --git a/doc/antora/modules/ROOT/assets/images/favicon.png b/doc/antora/modules/ROOT/assets/images/favicon.png new file mode 100644 index 0000000..8c71104 Binary files /dev/null and b/doc/antora/modules/ROOT/assets/images/favicon.png differ diff --git a/doc/antora/modules/ROOT/assets/images/favicon.svg b/doc/antora/modules/ROOT/assets/images/favicon.svg new file mode 100644 index 0000000..7476355 --- /dev/null +++ b/doc/antora/modules/ROOT/assets/images/favicon.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/antora/modules/ROOT/assets/images/networkradius.png b/doc/antora/modules/ROOT/assets/images/networkradius.png new file mode 100644 index 0000000..bf1ea80 Binary files /dev/null and b/doc/antora/modules/ROOT/assets/images/networkradius.png differ diff --git a/doc/antora/modules/ROOT/nav.adoc b/doc/antora/modules/ROOT/nav.adoc new file mode 100644 index 0000000..3d92412 --- /dev/null +++ b/doc/antora/modules/ROOT/nav.adoc @@ -0,0 +1 @@ +* xref:index.adoc[Introduction] diff --git a/doc/antora/modules/ROOT/pages/directories.adoc b/doc/antora/modules/ROOT/pages/directories.adoc new file mode 100644 index 0000000..9b16249 --- /dev/null +++ b/doc/antora/modules/ROOT/pages/directories.adoc @@ -0,0 +1,69 @@ += Directories + +The directories in the server source are laid out ad follows: + +== Documentation + +[width="100%",cols="50%,50%",options="header",] +|=== +| Directory | Description +| `doc/` | Various snippets of documentation. +| `doc/introduction/` | Concepts and introduction to FreeRADIUS. +| `doc/raddb/` | HTML versions of the configuration files. +| `doc/developers/` | Developer documentation for internal APIs +| `doc/unlang/` | The unlang processing language. +| `doc/upgrade/` | How to upgrade from version 3 to version 4. +| `doc/rfc/` | Copies of the RFC’s. If you have Perl, do a `make` in + that directory, and look at the HTML output. +| `doc/antora/` | Metadata and documentation source files to build + an Antora based documentation site. +| `doc/doxygen/` | Files to build a Doxygen site from the source code. +| `man/` | Unix Manual pages for the server, configuration files, + and associated utilities. +|=== + +== Utility + +[cols=",",options="header",] +|=== +|Directory | Description +| `mibs/` | SNMP Mibs for the server. +| `scripts/` | Sample scripts for startup and maintenance. +|=== + +== Configuration + +[width="100%",cols="50%,50%",options="header",] +|=== +| Directory | Description +| `raddb/` | Sample configuration files for the server. +| `raddb/mods-available` | Module configuration files. +| `raddb/mods-enabled` | Directory containing symlinks to `raddb/mods-available`. + Controls which modules are enabled. +| `raddb/sites-available` | Virtual servers. +| `raddb/sites-enabled` | Directory containing symlinks to `raddb/sites-available`. + Control which virtual servers are enabled. +|=== + +== Packaging + +[cols=",",options="header",] +|=== +|Directory | Description +| `debian/` | Files to build a `freeradius` Debian Linux package. +| `redhat/` | Additional files for a RedHat Linux system. +| `suse/` | Additional files for a SuSE (UnitedLinux) system. +|=== + +== Source + +[cols=",",options="header",] +|=== +|Directory | Description +| `src/` | Source code. +| `src/bin/` | Source code for the daemon and associated utilities. +| `src/lib/` | Source code for various utility libraries. +| `src/include/` | Header files. +| `src/protocols/` | Dynamic frontend plug-in modules. +| `src/modules/` | Dynamic backend plug-in modules. +|=== diff --git a/doc/antora/modules/ROOT/pages/index.adoc b/doc/antora/modules/ROOT/pages/index.adoc new file mode 100644 index 0000000..e9bc7a0 --- /dev/null +++ b/doc/antora/modules/ROOT/pages/index.adoc @@ -0,0 +1,137 @@ += Introduction + +This is the documentation for FreeRADIUS, version 3. The documentation +is available under the Creative Commons Non-Commercial license, as given +in the `LICENSE` file in this directory. + +FreeRADIUS is a complex piece of software with many configuration +options. However, we have taken great care to make the default +configuration work in most circumstances. The result is that for most +simple systems, it is trivial to install and configure the server. For +those situations, this documentation will serve to answer basic +questions about functionality, configuration, etc. + +For more complex requirements, FreeRADIUS can be difficult to +configure. The reason for this difficulty is that the server can do +almost anything, which means that there are a near-infinite number of +ways to configure it. The question for an administrator, then, is what +piece of the configuration to change, and how to change it. + +This documentation will answer those questions. The FreeRADIUS team has +put substantial effort into writing the documentation for this release. +Everything in the server is fully documented, and there are many +`how-to` guides available. + +The documentation is split into sections by subject area, oganized by +desired outcome. At a high level, the subject areas describe: + +* xref:concepts:index.adoc[Concepts] and introduction for newcomers. +* xref:installation:index.adoc[Installing] and xref:installation:upgrade.adoc[upgrading] FreeRADIUS. +* The syntax of the xref:unlang:index.adoc[unlang] processing language. +* The xref:raddb:index.adoc[configuration files] located in `/etc/raddb/`, or `/etc/freeradius/` +* Various xref:howto:index.adoc[how-to] guides. +* xref:developers:index.adoc[Developer documentation]. + +This organization means that for example, the `ldap` module will have +documention located in multiple places. We feel that organizing the +documentation by desired _goal_ is better than the alternatives. + +Within each section, the documentation is split into small pages, which +are generally no more than a few screens worth of information. We feel +that having multiple small pages with cross-links is more helpful than +having a smaller number of enormous pages. This division ensures that +(for example) the `how-to` guides are split into a series of small +steps, each of which can be performed quickly. + +We hope that this extended documentation will address any lingering +concerns about the quality of the FreeRADIUS documentation. + +== Changes From Earlier Versions + +Administrators who have version 2 and wish to upgrade to version 3 +should read the xref:installation:upgrade.adoc[upgrading] documentation. +That documentation explains the differences between the two versions, and +how an existing configuration can be reproduced in the latest +release. We do _not_ recommend using version 2 configuration files +with version 3. The configuration files are _not_ compatible across a +major version upgrade. + +== Getting Started with FreeRADIUS + +FreeRADIUS can be installed using the pre-built packages available +from http://packages.networkradius.com[Network RADIUS, +window="_blank"]. That page contains packages for all common OS +distributions. New packages are available as soon as a new version +has been released. Packages for older releases are also available for +historical purposes. + +FreeRADIUS can also be installed from the source code. Please see the +xref:installation:index.adoc[installation guide] for instructions. + +WARNING: Many Operating System distributions ship versions of FreeRADIUS +which are years out of date. Those versions may contain bugs which have +been fixed in newer releases. We recommend using the +http://packages.networkradius.com[Network RADIUS, window="_blank"] packages where +possible. + +Administrators who are new to FreeRADIUS should read the +xref:concepts:index.adoc[concepts section] as it describes the concepts behind +FreeRADIUS. It is vital for newcomers to understand these concepts, as the rest +of the documentation assumes familiarity with them. + +A detailed xref:unlang:index.adoc[unlang] reference guide is also available. +This section describes the syntax and functionality of the keywords, +data types, etc. used in the `unlang` processing language. + +All of the xref:raddb:index.adoc[configuration files] are available in +hypertext format. In can often be easier to read the configuration files +in a nicely formatted version, instead of as a fixed-width font in a +text editor. + +For specific problem solving, we recommend the xref:howto:index.adoc[how-to] +guides. These guides give instructions for reaching high-level goals, or +for configuring and testing individual xref:howto:modules/index.adoc[modules]. + +There is also xref:developers:index.adoc[developer documentation]. This section +documents the APIs for developers. Most people can ignore it. + +== Debugging + +If you have ANY problems, concerns, or surprises when running the +server, the the server should be run in debugging mode as root, from the +command line: + +``` +# radiusd -X +``` + +It will produce a large number of messages. The answers to many +questions, and the solution to many problems, can usually be found in +these messages. When run in a terminal window, error messages will be +shown in red text, and warning messages will be shown in yellow text. + +For other use-cases, please look for `ERROR` or `WARNING` in the +debug output. In many cases, those messages describe exactly what is +going wrong, and how to fix it. + +For further details, about the debug output see the +http://wiki.freeradius.org/radiusd-X[radiusd-X, window="_blank"] page on the +http://wiki.freeradius.org[wiki, window="_blank"]. + +== Getting Help + +We also recommend joining the +http://lists.freeradius.org/mailman/listinfo/freeradius-users[mailing +list] in order to ask questions and receive answers. The developers are +not on Stack Overflow, IRC, or other web sites. While the FreeRADIUS +source is available on +https://github.com/FreeRADIUS/freeradius-server/[GitHub, window="_blank"], questions +posted there will not be answered. + +Before posting to the list, please read the +http://wiki.freeradius.org/list-help[list help, window="_blank"] page. That page explains +how to run the server in debugging mode; how to understand the debug +output; and what information to post to the list. + +Commercial support for FreeRADIUS is available from +https://networkradius.com/freeradius-support/[Network RADIUS, window="_blank"]. diff --git a/doc/antora/modules/howto/nav.adoc b/doc/antora/modules/howto/nav.adoc new file mode 100644 index 0000000..351200b --- /dev/null +++ b/doc/antora/modules/howto/nav.adoc @@ -0,0 +1,19 @@ +* xref:index.adoc[Howto Guides] +** Protocols +**** xref:protocols/dhcp/index.adoc[DHCP] +***** xref:protocols/dhcp/prepare.adoc[Preparation] +***** xref:protocols/dhcp/enable.adoc[Enabling the DHCP service] +***** xref:protocols/dhcp/test.adoc[Testing the DHCP service] +***** xref:protocols/dhcp/policy.adoc[Defining the DHCP policy] +****** xref:protocols/dhcp/policy_ippool_creation.adoc[IP pool creation] +****** xref:protocols/dhcp/policy_common_options.adoc[Common options] +****** xref:protocols/dhcp/policy_network_options.adoc[Network options and IP pool selection] +****** xref:protocols/dhcp/policy_subnet_options.adoc[Subnet options] +****** xref:protocols/dhcp/policy_device_options.adoc[Device, class and group options] +****** xref:protocols/dhcp/policy_ippool_access.adoc[IP pool access restriction] +**** xref:protocols/proxy/index.adoc[PROXY Protocol] +***** xref:protocols/proxy/enable_radsec.adoc[Enabling RadSec] +***** xref:protocols/proxy/radsec_client.adoc[Configuring a test RadSec client] +***** xref:protocols/proxy/radsec_with_haproxy.adoc[Proxying RadSec with HAproxy] +***** xref:protocols/proxy/radsec_with_traefik.adoc[Proxying RadSec with Traefik] +***** xref:protocols/proxy/enable_proxy_protocol.adoc[Enabling PROXY Protocol for RadSec] diff --git a/doc/antora/modules/howto/pages/index.adoc b/doc/antora/modules/howto/pages/index.adoc new file mode 100644 index 0000000..47a5146 --- /dev/null +++ b/doc/antora/modules/howto/pages/index.adoc @@ -0,0 +1,17 @@ += Howto Guides + +The documents in this section describe how to perform various common tasks with +FreeRADIUS. They also provide worked examples on using the various modules in +common deployment scenarions. + +If you have a topic you'd like to see included in the list of howtos, contact +the developers on the +link:http://lists.freeradius.org/mailman/listinfo/freeradius-users[User's +mailing list]. + +Some of the documents here started life as pages on +link:http://wiki.freeradius.org[wiki.freeradius.org]. If you've just been +through a particularly arduous service configuration and deployment, and would +like to help your fellow users, then please create a new how to on the wiki. +If it's popular enough, we'll include it in the official documentation for the +next release. diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/enable.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/enable.adoc new file mode 100644 index 0000000..2824bd0 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/enable.adoc @@ -0,0 +1,213 @@ +== Enabling the DHCP service + +A major difference between configuring FreeRADIUS as a DHCP server versus most +other DHCP software such as ISC DHCP is that other software typically uses a +single monolithic configuration file whereas FreeRADIUS has a collection of +configuration files. This reflects the modularity of FreeRADIUS; attempting to +put the entire configuration in a single file would result in a very difficult +to read configuration. + +The root of the FreeRADIUS configuration may be in a different location on the +filesystem depending on how FreeRADIUS has been installed. This directory will +be referred to as `` below. The sample configuration files are well +commented describing what each configuration option does. + +FreeRADIUS compiled from source will default to `/usr/local/etc/raddb`. +Pre-built packages will default to either `/etc/raddb` or +`/etc/freeradius`. + + +=== Enable the DHCP virtual server + +The FreeRADIUS configuration separates each network service that it provides +into "virtual servers". A number of sample virtual server definitions are +provided in `/sites-available`, one of which is the sample +configuration for a DHCP service. + +Sites may be added to the working configuration by either creating a symlink to +them or copying them to `/sites-enabled` depending on how you wish to +manage future upgrades. + +[TIP] +==== +As with other package-managed configuration files, package upgrades will not +automatically replace files that you have edited but you will need to resolve +any local differences. Creating copies avoids the need to resolve conflicts +during a package upgrade. +==== + +Add the DHCP virtual server to the active configuration: + +[source,shell] +---- +cd /sites-enabled +ln -s ../sites-available/dhcp . +---- + +or: + +[source,shell] +---- +cd /sites-enabled +cp ../sites-available/dhcp . +---- + +The sample configuration has been set up in such a way that it is initially +safe. It will not actually take over live DHCP serving on the network when it +is simply enabled until it is configured to do so. Rather is set up for testing +prior to going live. + +The virtual server begins with a `listen` section. In this section your need to +modify the following configuration items: + +`ipaddr`:: The IP address to listen on. +`src_ipaddr`:: The source IP for unicast packets. +`port`:: The port to listen on. Setting this to `67` will make the DHCP service live on the network. +`interface`:: The network interface to listen on. +`broadcast`:: Allow broadcast packets. For most live systems this will need to be set to `yes`. + +Below the `listen` section, there are sections that define how to respond to +each of the DHCP packet types. Most installations will require that you review +the settings for `DHCP-Discover` and `DHCP-Request`. + +Their contents contain directives in the FreeRADIUS policy language, "unlang". +Many examples are provided which have been carefully described. + + +=== Enable SQL and IP pool modules + +FreeRADIUS has many modules to support different aspects of the functionality +required for the network protocols it can process. The two of most significance +for DHCP are `dhcp_sql` and `dhcp_sqlippool`. As with virtual servers, a +number of example module configurations are available in +`/mods-available`. +These should be symlinked or copied into `/mods-enabled` in order to +enable them. + + +==== Configure the `dhcp_sql` module + +Add the `dhcp_sql` module to the active configuration: + +[source,shell] +---- +cd /mods-enabled +ln -s ../mods-available/dhcp_sql . +---- + +or: + +[source,shell] +---- +cd /mods-enabled +cp ../mods-available/dhcp_sql . +---- + +The `dhcp_sql` module should be configured with the connection parameters for +whichever database is to be used. The key configuration items are: + +`dialect`:: Which SQL dialect is in use. +`driver`:: Which driver to use to access the database. For most databases this + is `rlm_sql_`, however Microsoft SQL Server has a choice of + drivers. + +Then, there are configuration options that are unique to each database, +including connection details. For most databases these are: + +`server`:: The host name or IP address of the database server. +`port`:: The port to connect to the database server on. +`login`:: The user name used to connect to the database. +`password`:: The password for authenticating to the database. +`radius_db`:: The name of the database. + +[NOTE] +==== +SQLite does not use these connection options, rather the `filename` +option within the `sqlite` section is used to determine where the database +will be stored. +==== + + +==== Configure the `dhcp_sqlippool` module + +Add the `dhcp_sqlippool` module to the active configuration: + +[source,shell] +---- +cd /mods-enabled +ln -s ../mods-available/dhcp_sqlippool . +---- + +or + +[source,shell] +---- +cd /mods-enabled +cp ../mods-available/dhcp_sqlippool . +---- + +The `dhcp_sqlippool` module must be configured. The key configuration +items are: + +`dialect`:: Set this to the same SQL dialect as in the `sql` module. +`offer_duration`:: How long an IP is offered to the client in a DHCP OFFER. +`lease_duration`:: How long an IP is leased to the client in a DHCP ACK. + + +=== Provision the database + +You should provision your database by creating a user for FreeRADIUS (matching +the configuration that you have previously provided) and then loading the +schema. The procedure for doing this will vary according to the database +server. + +The schema, stored procedure definition and any additional setup scripts for +your database are in `/mods-config/sql/ippool-dhcp/{dialect}/`. + +=== Test FreeRADIUS startup + +Once you have provisioned your schema, created a user account and granted +access to the user, you should be able to start FreeRADIUS. + +If FreeRADIUS has been configured correctly then the output of `ss` will +contain a line showing that FreeRADIUS is listening for DHCP packets on the +designated interface on port 67: + +.Example of FreeRADIUS listening on `` for DHCP packets +================================================================== + # ss -lunp + Netid Recv-Q Send-Q Local Address:Port ... + udp 0 0 0.0.0.0%:67 ... users:(("radiusd",...)) +================================================================== + +Note that if the database is inaccessible then FreeRADIUS will normally refuse +to start. + +The FreeRADIUS wiki contains extensive information about debugging FreeRADIUS +startup issues that we do not repeat in any detail here. + +Essentially, stop your init system from repeatedly trying to launch FreeRADIUS: + +[source,shell] +---- +service radiusd stop +---- + +Then start FreeRADIUS manually in debug mode: + +[source,shell] +---- +radiusd -X +---- + +Carefully read the output since this will tell you why FreeRADIUS was unable to +start. + +Once you have fixed the issue start FreeRADIUS as normal: + +[source,shell] +---- +service radiusd start +---- + +Now xref:protocols/dhcp/test.adoc[test the DHCP service] to ensure that it is responding to requests. diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/index.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/index.adoc new file mode 100644 index 0000000..fde2202 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/index.adoc @@ -0,0 +1,35 @@ += FreeRADIUS DHCP server + +This guide describes how FreeRADIUS can be used in place of ISC DHCP or ISC Kea +to provide a significantly more performant and, above all, more flexible DHCP +server. + +This guide provides a suggested configuration that should be somewhat familiar +to anyone who has previously implemented DHCP using the most frequently used +features of other DHCP server software. + +The modular design of FreeRADIUS means that there is no one "right" way to +implement the DHCP service. FreeRADIUS allows you to put together a "mix and +match" approach. + +For example you can manage the leases in an SQL database. You might then hard +code certain DHCP reply parameters within configuration and then look up +additional parameters using a datastore such as: + + * a local file such as a structured text file or an SQLite database + * an organisational LDAP directory + * an SQL or "no SQL" database + * a remote endpoint such as a RESTful HTTP API + +The policy language and modular configuration of FreeRADIUS is sufficiently +powerful and that almost any aspect of the server's behaviour can be customised +to implement even the most sophisticated DHCP configurations. + +== Sections in this guide + +This guide is organised into four parts that should be read in order: + +1. xref:protocols/dhcp/prepare.adoc[Preparation] +2. xref:protocols/dhcp/enable.adoc[Enabling the DHCP service] +3. xref:protocols/dhcp/test.adoc[Testing the DHCP service] +4. xref:protocols/dhcp/policy.adoc[Defining the DHCP policy] diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/policy.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/policy.adoc new file mode 100644 index 0000000..d8f1bcb --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/policy.adoc @@ -0,0 +1,14 @@ +== Defining the DHCP policy + +Now that FreeRADIUS is successfully running as a DHCP server it is necessary to +configure a DHCP policy so that it returns correctly formed responses to the DHCP +requests that it receives. + +This involves a number of steps: + + * xref:protocols/dhcp/policy_ippool_creation.adoc[Defining the IP address pools.] + * xref:protocols/dhcp/policy_common_options.adoc[Defining the options that are common to all replies.] + * xref:protocols/dhcp/policy_network_options.adoc[Defining the options for the network from which the request originates and ensuring that IP addresses are allocated from the correct pool.] + * xref:protocols/dhcp/policy_subnet_options.adoc[Defining the options for the subnet to which this issued IP address belongs.] + * xref:protocols/dhcp/policy_device_options.adoc[Defining the device, class and group based options specific to the device.] + * xref:protocols/dhcp/policy_ippool_access.adoc[Using device properties to restrict access to certain pools.] diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/policy_common_options.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/policy_common_options.adoc new file mode 100644 index 0000000..949868d --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/policy_common_options.adoc @@ -0,0 +1,80 @@ +== Configure common reply options + +FreeRADIUS includes a powerful xref:unlang/index.adoc[policy language] called +"unlang". + +Statements in unlang may be used to call further policies, update attribute +lists and invoke modules. There are also control flow statements (if, +switch, etc.) typical of most imperative languages. + +FreeRADIUS has a number attribute lists that it maintains as it processes +packets within the virtual server sections. Most relevant to DHCP are +`request`, `control` and `reply`. + +The DHCP options from the current request packet are provided in the +`request` list. This includes fixed DHCP parameters such as +`DHCP-Client-Hardware-Address`, optional parameters such as +`DHCP-Requested-IP-Address`, and parameters synthesised by FreeRADIUS such as +`DHCP-Message-Type` and `DHCP-Network-Subnet`. + +DHCP options can be set by updating their value in the `reply` list. This +forms the basis of the packet returned to the client. + +In the default DHCP server configuration, a "policy" (akin to a subroutine) is +used to set common options for reply packets. The policy is found in +`/policy.d/dhcp`. + +Look at the contents of the `dhcp_common` section and set any global options +applicable to all clients in this policy. + +[source,unlang] +---- +dhcp_common { + update reply { + &DHCP-Domain-Name-Server := 8.8.8.8 + &DHCP-Domain-Name-Server += 8.8.4.4 + &DHCP-Subnet-Mask := 255.255.255.0 + &DHCP-Router-Address := 192.0.2.1 + ... + } +} +---- + +Note, FreeRADIUS has four main operators for assigning values to attributes: + +`=`:: Add the attribute to the list, if and only if an attribute of the same + name is not already present in that list. +`:=`:: Add the attribute to the list. If any attribute of the same name is + already present in that list it is replaced with the new one. +`+=`:: Add the attribute to the tail of the list, even if attributes of the + same name are already present in the list. +`^=`:: Add the attribute to the head of the list, even if attributes of the + same name are already present in the list. + +These operators allow for attributes to be set to default values and then +overwritten, e.g. setting a default lease time, but then overwriting it for +a particular group of clients. + +Attributes in the `control` list are not returned in the DHCP reply packets +but instead govern aspects of server's behaviour. + +To use an SQL backend for either static or dynamic IP allocation, un-comment +the block: + +[source,unlang] +---- +update control { + &Pool-Name := "local" +} +dhcp_sqlippool +---- + +The `Pool-Name` control attribute is used in looking up addresses in the +database. The line containing `dhcp_sqlippool` is a call to invoke an +instance of a module with that name. This module is responsible for assigning a +free IP address into the `DHCP-Your-IP-Address` reply attribute from the pool +identified by `Pool-Name`. + +Here `Pool-Name` is being set to a constant value (`local`) indicating +that a single pool is to be used. If you have multiple pools, then replace this +`update` block with logic to map clients to the correct pool, as described below. diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/policy_device_options.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/policy_device_options.adoc new file mode 100644 index 0000000..05845ea --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/policy_device_options.adoc @@ -0,0 +1,310 @@ +== Configure "device", "class" and "group" options + +Beyond the global, network and subnet options already described, most sites +will have a number of group or class based options, and have a requirement for +setting reply parameters against individual devices. + +In general, FreeRADIUS does not differentiate between "classes" (memberships +defined by some attribute of the DHCP request) and "groups" (memberships +defined by some manually aggregation related devices, typically based on lists +of MAC address). + +The sample DHCP configuration provided with FreeRADIUS makes use of an internal +attribute `DHCP-Group-Name` to support the setting of different options for +different groups of devices. + +In general the groups to which a device belongs is determined during the +processing of a request and these are added as instances of the +`DHCP-Group-Name` attribute. This may be by performing a test on one or more +request parameters (akin to a "class"), hash-based lookup of up all of part of +an attribute in a local list (akin to a "subclass"), or doing the same using a +remote datastore (SQL, LDAP, REST API, etc). + +FreeRADIUS can then iterate over `DHCP-Group-Name` to set group-specific +options. + +We describe some of these options in more detail. + +=== Directly in Policy + +Simple class options can be written directly into policy. This is most +suited to those options that rarely change and are based on attributes in the +request such as the `User-Class`. + +Consider the ISC DHCP configuration snippet: + +[source,iscdhcp] +---- +filename "undionly.kpxe"; +class "pxeclient" { + match option substring(user-class,0,4); +} +subclass "pxeclient" "iPXE" { + filename "http://my.web.server/boot_script.php"; +} +---- + +Or the equivalent Kea configuration: + +[source,isckea] +---- +"Dhcp4": { + "option-data": [ + { "name": "boot-file-name", "data": "undionly.kpxe" } + ], + "client-classes": [ + { + "name": "pxeclient", + "test": "substring(option[77],0,4) == 'iPXE'", + "option-data": [ + { + "name": "boot-file-name", + "data": "http://my.web.server/boot_script.php" + } + ] + } + ] + ... +} +---- + +These define the "filename" DHCP option differently based on whether or not the +supplied "user-class" option begins with "iPXE". + +FreeRADIUS provides multiple ways for this to be configured. + +For example, the following "unlang" policy implements the class options defined +above: + +[source,unlang] +---- +if (&DHCP-User-Class && "%{substring:&DHCP-User-Class 0 4}" == "iPXE") { + update reply { + &DHCP-Boot-Filename := "http://my.web.server/boot_script.php" + } +} else { + update reply { + &DHCP-Boot-Filename := "undionly.kpxe" + } +} +---- + +Policy-based configuration of DHCP options is also useful for complex matching. +For example, the following Unlang sets the DHCP-Boot-Filename parameter based +on the request's DHCP-Client-Identifier using regular expression captures, +provided that it matches the given format: + +[source,unlang] +---- +if (&DHCP-Client-Identifier && \ + "%{string:DHCP-Client-Identifier}" =~ /^RAS([0-9])-site([A-Z])$/) { + update reply { + &DHCP-Boot-Filename := "rasboot-%{1}-%{2}.kpxe" + } +} +---- + +=== In Text Files + +The `files` module that has already been described for global, network and +subnet options can also be used to apply options to groups of clients. + +Firstly we must defined a mapping from a set of clients clients to their +respective groups. One option for this is to use the `passwd` module, for +which a sample configuration is included. + +Firstly symlink or copy the module configuration +`/mods-available/dhcp_passwd` into `/mods-enabled/`. The +suggested configuration expects the group membership file to be in +`/mods-config/files/dhcp_groups` and take the form of: + +[source,config] +---- +|,, +|, +---- + +i.e. one line for each group starting with the group name followed by a pipe +character and then a comma-separated list of hardware addresses. + +The `allow_multiple_keys` option allows for a host to be a member of +more than one group. + +Sample configuration for looking up group options is contained in +`/policy.d/dhcp` in the `dhcp_group_options` policy and in +`/mods-available/dhcp_files` as the `dhcp_set_group_options` instance. + +The same data file `/mods-config/files/dhcp` is used to lookup +group options as was used for global and network options. In this instance, +add entries with the group name as the key such as: + +[source,config] +---- +group1 + DHCP-Log-Server := 10.10.0.100, + DHCP-LPR-Server := 10.10.0.200 + +group2 + DHCP-LPR-Server := 192.168.20.200 +---- + +=== In the SQL Database + +Policy and files are both read during startup and editing them while +FreeRADIUS is running will not result in any changes in behaviour. If +you require regular changes to DHCP options, then storing them in +an SQL database provides greater flexibility since the queries will be run in +response to each DHCP packet rather than requiring the server to be restarted. + +DHCP reply options for devices (including network-specific options) can be +fetched from SQL using an arbitrary lookup key. This can be performed multiple +times as necessary using different contexts, for example to first set +subnet-specific options and then to set group-specific options. + +The default schema contains three tables to support this: + +"dhcpreply" contains reply options for a given identifier (e.g. MAC Address): + +.dhcpreply table +|=== +|Identifier |Attribute |Op |Value |Context + +|`02:01:aa:bb:cc:dd` |`DHCP-Log-Server` |`:=` |`192.0.2.10` |`by-mac` +|`02:01:aa:bb:cc:dd` |`DHCP-LPR-Server` |`:=` |`192.0.2.11` |`by-mac` +|`02:01:aa:bb:cc:dd` |`Fall-Through` |`:=` |`Yes` |`by-mac` +|=== + +"dhcpgroup" maps identifiers to a group of options that can be shared: + +.dhcpgroup table +|=== +|Identifier |GroupName |Priority |Context + +|`02:01:aa:bb:cc:dd` |`salesdept` |`10` |`by-mac` +|=== + +"dhcpgroupreply" contains reply options for each group: + +.dhcpgroupreply table +|=== +|GroupName |Attribute |Op |Value |Context + +|`salesdept` |`DHCP-NTP-Servers` |`:=` |`192.0.2.20` |`by-mac` +|`salesdept` |`DHCP-Log-Server` |`+=` |`192.0.2.21` |`by-mac` +|`salesdept` |`DHCP-LPR-Server` |`^=` |`192.0.2.22` |`by-mac` +|=== + +Within the context of assigning options directly to devices, as well as to +manually-curated groups of devices keyed by their MAC address: + + - Place device-specific options in the "dhcpreply" table. + - Add `Fall-Through := Yes` to the options in the "dhcpreply" table in order + to trigger group lookups, which are disabled by default. + - Place entries in the "dhcpgroup" `identifier = , groupname = , priority = + ` in the "dhcpgroup" table to map a device to its groups by + priority. + - Place the grouped options in the "dhcpgroupreply" table. + - For each of the above, set `Context` to something by which the option + lookup is referred to in the policy, for example `Context = 'by-mac'`. + +For the above example you would add the following to the DHCP virtual server to +perform reply option lookup using the device's MAC address against the `by-mac` +context: + +[source,unlang] +---- +update control { + &DHCP-SQL-Option-Context := "by-mac" + &DHCP-SQL-Option-Identifier := &request:DHCP-Client-Hardware-Address +} +dhcp_sql.authorize +---- + +In the above, the DHCP reply options would be assigned to a device with MAC +address 02:01:aa:bb:cc:dd as follows: + + - Firstly, the `DHCP-Log-Server` option would be set to `192.0.2.10` and the + `DHCP-LPR-Server` option set to `192.0.2.11`. + - `Fall-Through` is set, so the group mapping is then queried which + determines that the device belongs to a single `salesdept` group. + - Finally, the options for the `salesdept` group are now merged, setting a + `DHCP-NTP-Servers` option to `192.0.2.20`, appending an additional + `DHCP-Log-Server` option set to `192.0.2.21`, and prepending an additional + `DHCP-LPR-Server` option set to `192.0.2.22`. + +If instead you wanted to perform a "subclass" lookup based on the first three +octets of the device's MAC address then with tables containing the following +sample data you could invoke an SQL lookup as shown: + +."dhcpreply" table: +|=== +|Identifier |Attribute |Op |Value |Context + +|`000393` |`Fall-Through` |`:=` |`Yes` |`class-vendor` +|`000a27` |`Fall-Through` |`:=` |`Yes` |`class-vendor` +|`f40304` |`Fall-Through` |`:=` |`Yes` |`class-vendor` +|=== + +."dhcpgroup" table: +|=== +|Identifier |GroupName |Priority |Context + +|`000393` |`apple` |`10` |`class-vendor` +|`000a27` |`apple` |`10` |`class-vendor` +|`f40304` |`google` |`10` |`class-vendor` +|=== + +."dhcpgroupreply" table: +|=== +|GroupName |Attribute |Op |Value |Context + +|`apple` |`DHCP-Boot-Filename` |`:=` |`apple.efi` |`class-vendor` +|`google` |`DHCP-Boot-Filename` |`:=` |`google.efi` |`class-vendor` +|=== + + +[source,unlang] +---- +update control { + &DHCP-SQL-Option-Context := "class-vendor" + &DHCP-SQL-Option-Identifier := \ + "%{substring:%{hex:&DHCP-Client-Hardware-Address} 0 6}" +} +dhcp_sql.authorize +---- + +The file `policy.d/dhcp` contains a policy named `dhcp_policy_sql` which +provides further worked examples for different types of option lookups. + +=== Testing "device", "class" and "group" options + +You should now test that any device-related options that you have configured +using the various methods available are applied successfully by generating +packets containing those parameters based upon which the reply options are set. + +For example, to test the iPXE user class example above you might want to +generate a request as follows: + +[source,shell] +---- +cat < dhcp-packet-ipxe-boot.txt +DHCP-Message-Type := DHCP-Discover +DHCP-Client-Hardware-Address := 02:01:aa:bb:cc:dd +DHCP-User-Class := "iPXE-class-abc" +EOF +---- + +To which you would expect to see a response such as: + +.Example output from dhcpclient +=============================== + dhcpclient: ... + ---------------------------------------------------------------------- + Waiting for DHCP replies for: 5.000000 + ---------------------------------------------------------------------- + ... + DHCP-Message-Type = DHCP-Offer + DHCP-Your-IP-Address = 1.2.3.4 + DHCP-Boot-Filename := "http://my.web.server/boot_script.php" + ... +=============================== diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_access.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_access.adoc new file mode 100644 index 0000000..40b8e30 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_access.adoc @@ -0,0 +1,54 @@ +== Configure access restrictions for pools + +We can combine what we have learned in the preceeding sections to provide pools +whose access is restricted in some way, for example to a particular class. + +Consider the ISC DHCP configuration snippet: + +[source,iscdhcp] +---- +subnet 10.99.99.0 netmask 255.255.255.0 { + pool { + range 10.99.99.200 10.99.99.250; + allow members of "printers"; + } + option routers 10.99.99.1; +} +---- + +Or the equivalent Kea configuration: + +[source,isckea] +---- +"Dhcp4": { + "subnet4": [{ + "subnet": "10.99.99.0/24", + "pools": [ + { + "pool": "10.99.99.200 - 10.99.99.250", + "client-class": "printers" + } + ], + "option-data": [ + { "name": "routers", "data": "10.10.0.1" } + ] + }], + ... +} +---- + +These define a subnet containing a single pool that is restricted to members of +the "printers" class. (The definition for this class is omitted.) + +In FreeRADIUS, to filter access to this pool entries such as the following +should included in the `/mods-config/files/dhcp` configuration file: + +[source,config] +---- +network DHCP-Network-Subnet < 10.99.99.0/24, \ + DHCP-Group-Name == "printers", Pool-Name := "printers-pool" + DHCP-Router-Address := 10.99.99.1 +---- + +Note that any number of additional filters can be added to the initial "check" +line to restrict matches to the network block. diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_creation.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_creation.adoc new file mode 100644 index 0000000..e976873 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/policy_ippool_creation.adoc @@ -0,0 +1,112 @@ +=== Determine the IP pool plan + +Except for cases where all IP allocation is performed using a mapping from the +device MAC address to a fixed IP address, the DHCP configuration will involve +the use of one or more IP address pools. + +FreeRADIUS stores all the IP addresses in its pools in whichever database has +been chosen. An instance of the `sqlippools` module is used to manage all pools +within a single table (normally `dhcpippool`). Each row of this table +corresponds to an IP address that is a member of some pool. The pools are +distinguished by name, so the table has a column (`pool_name`) that denotes +this. + +Each pool in this table should be composed of a set of equally valid IP +addresses for the devices that are designated to be members of the pool. + +Firstly, consider the network locations to which distinct ranges of IP +addresses must be allocated and provisionally assign a pool to each. + +Next, consider that many networks support multiple co-existing subnets without +VLAN separation. We will call this a "shared-network" to use the original ISC +DHCP parlance. In Microsoft DHCP contexts this is often referred to as a +"multinet". + +Often in a shared-network the policy has no regard for which of the network's +devices is allocated to which subnet. In this case we must create a single, +combined pool containing all of the IP addresses from each subnet in that +network. Since all addresses in a pool are treated equally this will mean that +any IP address may be allocated to a device that is making a DHCP request from +that network. The appropriate DHCP parameters for the subnet to which the IP +address belongs is determined after allocation. + +There are sometimes shared-networks (or even single subnets) for which IP +addresses belonging to any subnet may be technically suitable for any device, +however some local policy wants to assigning them to a particular subnet, for +example to provide loose segregation between classes of device. In this case we +define multiple pools, one for each range of IP addresses whose devices needs to +be differentiated. + +The choice of pool is ordinarily determined based on the network from which the +request originates using a mapping from Layer 2 networks to the pool name +provided by the user. The indicator for the originating network can be +overridden when this alone is insufficient to implement the required pool +selection policy such as when you need to differentiate the pool's users with +more granularity that their Layer 2 network, such as by considering device +attributes ("class" membership in ISC parlance) or Option 82 circuit data. + + +=== Populate the IP Pools + +By this stage you should have derived a list of pools, the IP address ranges +contained therein, and the means of selecting the pool to use based on the +originating network and/or some additional criteria from the request. + +A helper Perl script is provided with FreeRADIUS that can be used to populate +the pools provide that you are using the default schema. + +[source,shell] +---- +rlm_sqlippool_tool -p -s -e \ + -t (-d | -f [ -i ]) \ + [ -c ] [ -x ] +---- + +If, for example, you had a range configured in ISC DHCP as: + +[source,iscdhcp] +---- +range 10.0.0.5 10.0.0.199 +---- + +and you are using PostgreSQL as your database, and you wish to refer to this pool +using the name `local`, this could be prepared with: + +[source,shell] +---- +rlm_sqlippool_tool -p local -s 10.0.0.5 -e 10.0.0.199 -t dhcpippool -d postgresql +---- + +If the SQL module of FreeRADIUS is already configured then this can +be referenced so that the tool is able to use the configured connection +parameters to connect to the database and populate the pool: + +[source,shell] +---- +rlm_sqlippool_tool -p local -s 10.0.0.5 -e 10.0.0.199 -t dhcpippool -f /etc/raddb +---- + +For installations that require multiple pools, `rlm_sqlippool_tool` can +be called referencing a YAML file defining the pools. Comments at the +head of `rlm_sqlippool_tool` explain the options in more detail. + +If static leases are required then these should be set up in the database +such that the MAC address of the client should be set as the `pool_key` +against the corresponding address and the `status` column of the row +representing the address set to `static`. A helper perl script, +`rlm_iscfixed2ippool` can be used to read an ISC DHCP config file and produce +SQL to perform these changes or directly update the database: + +[source,shell] +---- +rlm_iscfixed2ippool -c -t -k \ + (-d | -f [-i ]) +---- + +For example, to read /etc/dhcp/dhcpd.conf and populate the configured +FreeRADIUS database, using the mac as the identifier: + +[source,shell] +---- +rlm_iscfixed2ippool -c /etc/dhcp/dhcpd.conf -t dhcpippool -k mac -f /usr/local/etc/raddb +---- diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/policy_network_options.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/policy_network_options.adoc new file mode 100644 index 0000000..e2657a8 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/policy_network_options.adoc @@ -0,0 +1,237 @@ +== Configure network-specific options and IP pool selection + +In an environment where multiple networks (often VLANs) are in use, it is +necessary to identify which network a client belongs to in order to assign an +address from the correct pool. + +Consider the ISC DHCP configuration snippet: + +[source,iscdhcp] +---- +option domain-name "example.org"; + +subnet 10.10.0.0 netmask 255.255.0.0 { + range 10.10.1.10 10.10.10.254; + range 10.10.100.10 10.10.110.254; + option routers 10.10.0.1; + option domain-name-servers 10.10.0.2, 10.10.0.3; + default-lease-time 7200; +} +---- + +Or the equivalent Kea configuration: + +[source,isckea] +---- +"Dhcp4": { + "option-data": [ + { "name": "domain-name", "data": "example.org" } + ], + "subnet4": [{ + "subnet": "10.10.0.0/16", + "pools": [ { "pool": "10.10.1.10 - 10.10.10.254" }, + { "pool": "10.10.100.10 - 10.10.110.254" } + ], + "option-data": [ + { "name": "routers", "data": "10.10.0.1" }, + { "name": "domain-name-servers", "data": "10.10.0.2, 10.10.0.3" } + ], + "valid-lifetime": 7200 + }], + ... +} +---- + +These define a network consisting of a single subnet 10.10.0.0/16 containing two +IP address pools 10.10.1.10 - 10.10.10.254 and 10.10.100.10 - 10.10.110.254. +Requests that are determined to have originated from this network (e.g. because +their `giaddr` belongs within the subnet) will be assigned the specified DHCP +parameters and allocated an address from one of its ranges. + +To provide equivalent functionality, FreeRADIUS must identify the correct DHCP +reply parameters as well as the name of the pool to be used for IP address +assignment, based on the originating network of the request. + +The definition for this pool (the addresses contained within it, corresponding +to the `range` statement in ISC DHCP and Kea) is specified entirely in the +database: It is precisely the rows in the `dhcpippool` table with a particular +`pool_name`. + +[TIP] +==== +As described previously, in FreeRADIUS a pool is a set of IP addresses that are +equally valid with respect to the network policy; therefore, unlike ISC DHCP +and ISC Kea, FreeRADIUS does not differentiate between the two `range`s. +Instead we should have previously populated a single pool containing all of the +IP addresses from both ranges. +==== + +FreeRADIUS derives a request attribute called `DHCP-Network-Subnet` which +honours the standard DHCP process for designating the choice of network, in +order of preference: + + 1. Link Selection Suboption of Option 82 + 2. IPv4 Subnet Selection Option + 3. Gateway IP Address ("giaddr") + 4. Client IP Address ("ciaddr", only set for unicast packets) + +If `DHCP-Network-Subnet` contains an IP address then this should be used as +the basis of choosing a network. When there is no address in this attribute it +can be assumed that the packet has been received from a client on the local +LAN. + +The `files` module in FreeRADIUS provides a simple method to map +`DHCP-Network-Subnet` to the corresponding pool based on its network +membership, setting the appropriate options to return to clients. It can also +set the global options. + +[TIP] +==== +In the case where an instance of the `files` module is used to get global +default parameters, the `dhcp_common` policy becomes redundant so the +statement calling the policy (by name) can be commented out in +`/sites-enabled/dhcp`. +==== + +To use the provided example `files` module instance for DHCP, symlink or copy +`/mods-available/dhcp_files` into `/mods-enabled/` and then +uncomment the calls to `dhcp_network` in `/sites-enabled/dhcp`. + +A template configuration file `/mods-config/files/dhcp` is also +provided which should be adapted to suit your network topology. + +For the configuration above you may deduce the following configuration, which +has been extended to include an initial default section for requests originating +from directly-connected clients on the local LAN (192.168.20/24): + +[source,config] +---- +network Pool-Name := "local" + DHCP-Domain-Name := "example.org", + DHCP-Subnet-Mask := 255.255.255.0, + DHCP-Router-Address := 192.168.20.1, + DHCP-Domain-Name-Server := 192.168.20.2, + Fall-Through := yes + +network DHCP-Network-Subnet < 10.10.0.0/16, Pool-Name := "remote" + DHCP-Subnet-Mask := 255.0.0.0, + DHCP-Router-Address := 10.10.0.1, + DHCP-Domain-Name-Server := 10.10.0.2, + DHCP-Domain-Name-Server += 10.10.0.3, + DHCP-IP-Address-Lease-Time := 7200 +---- + +Each block in the file starts with a line beginning with the key to be matched. +In this case the keyword of `network` (defined earlier in `dhcp_networks` +configuration) is used for each block, so each of the above blocks is a +candidate during the search. + +There may be further filtering of the candidates in the form of ` + `. In the case of the second block we match the +`DHCP-Network-Subnet` to an enclosing subnet with +`DHCP-Network-Subnet < `. Additional filters could be added as +required, comma separated. + +Following the filters on the first line, attributes in the `control` list can +be set using the syntax of ` := `. In this example this is +used to specify the `Pool-Name` for choosing the appropriate IP pool to +allocate an address from. + +Subsequent indented lines are attribute assignments for values in the `reply` +list. Note that, apart from the last line, they are all terminated with a +comma. + +The special option `Fall-Through` determines whether, following a match, +other records are checked for a match. All lookups will match the entry +with a key of `network` and no further filtering, so `Fall-Through` +is set on that record in order that the other records will be tested +to find subnet matches. + +=== Example packet processing + +For our example, we consider a request arriving from a DHCP relay within +10.10.0.0/16. In the absence of any specific DHCP subnet selection options in +the request, the `DHCP-Network-Subnet` attribute is calculated to be the +relay's IP address, say 10.10.0.1. + +The request is matched against the first block, setting an initial pool name to +"local", domain name to "example.org" and setting some additional global +default parameters. By virtue of `Fall-Through` being set, the next block is +considered. + +Since the network identifier is within the specified subnet (i.e. `10.10.0.1 < +10.10.0.0/16`) this second block is matched. This block overrides the pool name +setting it to "remote", overrides some other global defaults and sets the lease +time to 7200 seconds. `Fall-Through` is not set, so we are now done with +deriving the pool name and network options. + +When the `dhcp_sqlippool` module is called during DHCP DISCOVER processing (in +`/sites-enabled/dhcp`) the `remote` pool will be used for IP address +allocation. + +The assigned IP address and network parameters will subsequently be returned in +the DHCP reply. + +=== Testing the pool operation and network-specific options + +Before proceeding further, you should test the operation of the IP pools and +ensure that any network-specific reply attributes that you have configured are +correctly set in replies. + +For example, if you have a single, flat pool you should test using sample +packets for devices with different MAC addresses and/or Client Identifiers. + +[source,shell] +---- +cat < dhcp-packet-1.txt +DHCP-Message-Type := DHCP-Discover +DHCP-Client-Hardware-Address := 02:01:11:11:11:11 +DHCP-Client-Identifier := device1 +EOF +---- + +[source,shell] +---- +cat < dhcp-packet-2.txt +DHCP-Message-Type := DHCP-Discover +DHCP-Client-Hardware-Address := 02:01:22:22:22:22 +DHCP-Client-Identifier := device2 +EOF +---- + +Generate these packets as show previously using the dhcpclient tool and look +for `DHCP-Your-IP-Address` in the DHCP responses to determine the IP address +that has been offered. + +Ensure that the DHCP Offer responses contain unique IP addresses. Ensure that +when these requests are resent within the lifetime of the initial offer that +the reponses to the subsequent replies contain the original IP address that was +in the initial offer to the device. + +Additionally, ensure that the DHCP Offers contain any network-specific +parameters that you have specified. + +In the case that the policy contains multiple IP pools and network definitions +for clients belonging to different Layer 2 networks (or indeed belonging to the +same network but segregated according to some local policy) you should ensure +that the devices are being mapped to the correct definition. + +For a typical policy that selects the IP pool and network options based on the +originating network for the DHCP packet, explicitly specifying a network by +including a `DHCP-Subnet-Selection-Option` parameter may avoid the need to test +from a host within each individual network: + +[source,shell] +---- +cat < dhcp-packet-network-10.10.10.0.txt +DHCP-Message-Type := DHCP-Discover +DHCP-Client-Hardware-Address := 02:01:aa:bb:cc:dd +DHCP-Client-Identifier := abc123 +DHCP-Subnet-Selection-Option := 10.10.10.0 +EOF +---- + +For policies where the IP pool and network option selection is based on some +custom criteria it is necessary to include different variations for the +parameters on which the policy makes the decision. The testing example for the +class-specific options later in this document provides such an example. diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/policy_subnet_options.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/policy_subnet_options.adoc new file mode 100644 index 0000000..1980e89 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/policy_subnet_options.adoc @@ -0,0 +1,184 @@ +== Configure subnet-specific options for shared networks + +In the case that shared-networks are in use, with the pool containing +equally-valid IP addresses from multiple subnets, it is necessary to set the +subnet-specific parameters such as `DHCP-Router-Address`, `DHCP-Subnet-Mask` +and `DHCP-Broadcast-Address` based on the IP address that has been allocated. + +Consider the ISC DHCP configuration snippet: + +[source,iscdhcp] +---- +option domain-name "example.org"; + +shared-network bigdept { + + option domain-name-servers 10.10.0.2, 10.10.0.3; + default-lease-time 7200; + + subnet 10.30.10.0 netmask 255.255.255.0 { + option routers 10.30.10.1; + } + subnet 10.30.20.0 netmask 255.255.255.0 { + option routers 10.30.20.1; + } + range 10.30.10.10 10.30.10.254; + range 10.30.20.10 10.30.20.254; + +} +---- + +Or the equivalent Kea configuration: + +[source,kea] +---- +"Dhcp4": { + "option-data": [ + { "name": "domain-name", "data": "example.org" } + ], + "shared-networks": [{ + "name": "bigdept", + "option-data": [ + { "name": "domain-name-servers", "data": "10.10.0.2, 10.10.0.3" } + ], + "valid-lifetime": 7200, + "subnet4": [{ + "subnet": "10.30.10.0/24", + "pools": [ { "pool": "10.30.10.10 - 10.30.10.254" } ], + "option-data": [ + { "name": "routers", "data": "10.30.10.1" } + ] + }], + "subnet4": [{ + "subnet": "10.30.20.0/24", + "pools": [ { "pool": "10.30.20.10 - 10.30.20.254" } ], + "option-data": [ + { "name": "routers", "data": "10.30.20.1" } + ] + }] + }], + ... +} +---- + +As with the network to pool lookup, an instance of the `files` modules can be +employed (this time after the allocation of an IP address) to set the correct +reply parameters based on the subnet membership of the assigned address. + +To do this, we can use this section of `/mods-available/dhcp_files`: + +[source,config] +---- +files dhcp_subnets { + filename = ${modconfdir}/files/dhcp + key = "subnet" +} +---- + +Additionally, uncomment the `dhcp_subnets` policy in `/policy.d/dhcp`. +This policy wraps the call to the `dhcp_subnets` files module with code that +"tightens" the `DHCP-Network-Subnet` attribute by setting it to the +just-allocated IP address. + +The relevant entries in the `/mods-config/files/dhcp` configuration +file might then look something like this: + +[source,config] +---- +network + DHCP-Domain-Name := "example.org", + Fall-Through := yes + +network DHCP-Network-Subnet < 10.30.0.0/16, Pool-Name := "bigdept" + DHCP-Domain-Name-Server := 10.10.0.2, + DHCP-Domain-Name-Server += 10.10.0.3, + DHCP-IP-Address-Lease-Time := 7200 + +subnet DHCP-Network-Subnet < 10.30.10.0/24 + DHCP-Router-Address := 10.30.10.1 + +subnet DHCP-Network-Subnet < 10.30.20.0/24 + DHCP-Router-Address := 10.30.20.1 +---- + +=== Example packet processing + +For our example, we consider a request arriving from a DHCP relay within +10.30.10.0/24. In the absence of any specific DHCP subnet selection options in +the request, the `DHCP-Network-Subnet` attribute is calculated to be the +relay's IP address, say 10.30.10.1. + +The request is matched against the first "network" block, setting the domain +name to "example.org". By virtue of `Fall-Through` being set, the next "network" +block is considered. + +Since the network identifier is within the specified subnet (i.e. `10.30.10.1 < +10.30.0.0/16`) this second "network" block is matched. This block sets the pool +name to "bigdept", sets some network-specific DNS resolvers and sets the lease +time to 7200 seconds. `Fall-Through` is not set, so we are now done with +deriving the pool name and network options. + +When the `dhcp_sqlippool` module is called during DHCP DISCOVER processing (in +`/sites-enabled/dhcp`) the `bigdept` pool will be used for IP address +allocation. + +After IP allocation the `dhcp_subnet` policy and files instance are called. +Before the subnet options are looked up the `DHCP-Network-Subnet` +attribute is tightened to match the assigned IP address, say 10.30.20.123. + +The request does not match the first subnet block since 10.30.20.123 is not +within 10.30.10.0/24. However, the request does match the second subnet block +since `10.30.20.123 < 10.30.20.0/24`. This block sets the default gateway +reply parameter. `Fall-Through` is not set, so we are now done with deriving +the pool name and network options. + +The assigned IP address, network and subnet parameters will subsequently be +returned in the DHCP reply. + +=== Testing the subnet-specific options + +If you have set any subnet-specific reply parameters then you should test these +before proceeding further. + +For example, in the case that you have a single, large pool spanning two IP +subnets you might want to test by repeatedly allocating addresses using sample +packets with different MAC addresses, each time checking to ensure that the +DHCP parameters correspond to the IP address that has been offered. + +.Example output from dhcpclient showing a response +================================================== + dhcpclient: ... + ... + ---------------------------------------------------------------------- + Waiting for DHCP replies for: 5.000000 + ---------------------------------------------------------------------- + ... + DHCP-Your-IP-Address = 10.0.10.50 + DHCP-Router-Address = 10.0.10.1 + DHCP-Broadcast-Address = 10.0.10.255 + DHCP-Subnet-Mask = 255.255.255.255 +================================================== + + +.Example output from dhcpclient showing a response +================================================== + dhcpclient: ... + ... + ---------------------------------------------------------------------- + Waiting for DHCP replies for: 5.000000 + ---------------------------------------------------------------------- + ... + DHCP-Your-IP-Address = 10.99.99.50 + DHCP-Router-Address = 10.99.99.1 + DHCP-Broadcast-Address = 10.99.99.255 + DHCP-Subnet-Mask = 255.255.255.255 +================================================== + + +[TIP] +==== +If the subnets are large then you might want to temporarily reduce their +size by setting the `status` field of the majority of the rows for each subnet +to "`disabled`" to cause offers to be made more readily with IP addresses in +different subnets. +==== diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/prepare.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/prepare.adoc new file mode 100644 index 0000000..aa43530 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/prepare.adoc @@ -0,0 +1,59 @@ +== Preparation + +It is necessary to consider the requirements for the installation in order to +devise an efficient and manageable set up. + +=== Understand the network topology + +When multiple networks (VLANs) are in use consideration must be given to how +the correct "pool" (IP address ranges) from which to allocate addresses is +identified. + +The policy for setting specific DHCP options (e.g. lease time, default gateway, +time server and vendor-specific parameters) for different groups of hosts, +based on their network or some device attributes either supplied in the DHCP +requests or determined by dynamic lookup, should be well defined and +understood. + +Other DHCP servers may implement implicit assumptions about the requirement of +your network topology and silently define particular behaviours, such as the +selection of IP address pool for a request based on a relay address. Some of +these behaviours must be specifed explicitly when using FreeRADIUS. + +=== Choose a database backend + +FreeRADIUS stores its leases in an SQL database, so one of the key decisions to +make is which database to use. + +FreeRADIUS supports: + + * SQLite + * PostgreSQL + * MySQL / MariaDB + * Microsoft SQL Server + * Oracle + +In most configurations the SQL database is likely to be the limiting component +that restricts the IP allocation throughput of the overall system. Each +database server has its own performance characteristics and unique approach to +features such as high-availability. + +The choice of database should be made carefully based on the performance and +high-availability requirements of the system, as well as any prior experience. + +[TIP] +==== +SQLite is an in-process database that uses the local file system, is simple to +configure and is suitable for smaller installations. However, users with larger +address pools or high availability requirements should choose one of the other +standalone databases based on criteria such as performance, features, +familiarity and your need for commercial support. +==== + +FreeRADIUS ships with a default database schema and set of queries for each +supported database. These are sufficient for most DHCP deployments but can be +reviewed and modified as required to suit a particular situation, for example +to customise the IP allocation policy such as by disabling address +"stickiness". + +Now xref:protocols/dhcp/enable.adoc[enable the DHCP service]. diff --git a/doc/antora/modules/howto/pages/protocols/dhcp/test.adoc b/doc/antora/modules/howto/pages/protocols/dhcp/test.adoc new file mode 100644 index 0000000..322de08 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/dhcp/test.adoc @@ -0,0 +1,143 @@ +== Testing the DHCP service + +We can verify that FreeRADIUS is providing a DHCP service using the +`dhcpclient` tool that is included with the FreeRADIUS distribution. + +Temporarily configure FreeRADIUS to issue a single static IP address to all +clients by updating the `dhcp DHCP-Discover` section in the `dhcp` virtual +server to include the following: + +[source,unlang] +---- +update reply { + &DHCP-Your-IP-Address := 1.2.3.4 +} +---- + +Define a sample DHCP packet as follows: + +[source,shell] +---- +cat < dhcp-packet.txt +DHCP-Message-Type := DHCP-Discover +DHCP-Client-Hardware-Address := 02:01:aa:bb:cc:dd +DHCP-Client-Identifier := abc123 +EOF +---- + +We can now generate this packet by invoking one of the following commands based +on the current circumstances... + +From the host that is running the FreeRADIUS DHCP server: + +[source,shell] +---- +dhcpclient -i lo 255.255.255.255 -f dhcp-packet.txt -x auto +---- + +From a different host with an interface (eth0) in the same broadcast domain +as the FreeRADIUS DHCP server: + +[source,shell] +---- +dhcpclient -i eth0 255.255.255.255 -f dhcp-packet.txt -x auto +---- + +If all of the DHCP broadcast traffic in other Layer 2 networks is converted to +unicast by DHCP relay agents then it is not necessary for FreeRADIUS to listen +on a broadcast address. In this case you can test DHCP using a unicast request: + +[source,shell] +---- +dhcpclient 192.0.2.10 -f dhcp-packet.txt -x auto +---- + +[NOTE] +==== +In order for the returned, unicast DHCP OFFER to be received it is necessary to +ensure that the `DHCP-Your-IP-Address` parameter set by FreeRADIUS matches an +address on the interface used by the dhcpclient tool to send the Discover +packet. +==== + +When one of the above commands is run, the tool with generate output such as +the following which shows that the packet was sent and that it is now waiting +for replies: + +.Example output from dhcpclient showing the request +=================================================== + dhcpclient: ... + ---------------------------------------------------------------------- + DHCP-Opcode = 0x01 + DHCP-Hardware-Type = 0x01 + DHCP-Hardware-Address-Length = 0x06 + DHCP-Hop-Count = 0x00 + DHCP-Transaction-Id = 0x5e0bbfab + DHCP-Number-of-Seconds = 0x0000 + DHCP-Flags = 0x0000 + DHCP-Client-IP-Address = 0x00000000 + DHCP-Your-IP-Address = 0x00000000 + DHCP-Server-IP-Address = 0x00000000 + DHCP-Gateway-IP-Address = 0x00000000 + ... + ---------------------------------------------------------------------- + Waiting for DHCP replies for: 5.000000 + ---------------------------------------------------------------------- +=================================================== + + +Each received DHCP response will generate output such as the following: + +.Example output from dhcpclient showing a response +================================================== + ... + ---------------------------------------------------------------------- + DHCP-Opcode = Server-Message + DHCP-Hardware-Type = Ethernet + DHCP-Hardware-Address-Length = 6 + DHCP-Hop-Count = 0 + DHCP-Transaction-Id = 1577828267 + DHCP-Number-of-Seconds = 0 + DHCP-Flags = 0 + DHCP-Client-IP-Address = 0.0.0.0 + DHCP-Your-IP-Address = 1.2.3.4 + DHCP-Server-IP-Address = 192.0.2.10 + DHCP-Gateway-IP-Address = 0.0.0.0 + DHCP-Client-Hardware-Address = 02:42:0a:00:00:0b + DHCP-Message-Type = DHCP-Offer + DHCP-Client-Identifier = 0x616263313233 + Waiting for additional DHCP replies for: 4.999429 + ... +================================================== + +Examine the DHCP response to ensure that it has the correct message type +(`DHCP-Offer`, in this case), contains the temporary IP address that you +configured earlier, i.e. `DHCP-Your-IP-Address = 1.2.3.4`, and any other +expected reply parameters (which we configure later). You should also carefully +examine the output of a FreeRADIUS debug session (`radius -X`) to ensure that +the policy is being executed in the way that you expect and that no warnings +are being generated. + +You can now change the content of the sample DHCP request by editing the +`dhcp-packet.txt` file and re-run the above command to see the server's reply. +You should examine the DHCP dictionary distrubuted with FreeRADIUS (usually +`/usr/share/freeradius/dictionary.dhcp`) which provides the list of all of the +DHCP parameters ("attributes") understood by FreeRADIUS. + +[WARNING] +==== +When you are done **remember** to remove the temporary edit that was made to +the `dhcp` virtual server that provides the static IP assignment. +==== + +=== Testing the DHCP policy + +The remainder of this guide describes how to configure the IP address plan, +setup the IP pools and define a DHCP policy. You should develop your policy by +making small, incremental changes to the provided configuration and then test +those changes with the approach described above, using `dhcpclient` and `radius -X`, +modifying the sample DHCP packet as required. If you break the policy then +revert the last change, attempt to understand what went wrong, and try +something else. + +Now xref:protocols/dhcp/policy.adoc[define the DHCP policy]. diff --git a/doc/antora/modules/howto/pages/protocols/proxy/enable_proxy_protocol.adoc b/doc/antora/modules/howto/pages/protocols/proxy/enable_proxy_protocol.adoc new file mode 100644 index 0000000..b689824 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/proxy/enable_proxy_protocol.adoc @@ -0,0 +1,114 @@ +== Enabling PROXY Protocol + +Now that we have a working configuration which used RadSec and HAproxy +or Traefik, we are finally ready to enable PROXY Protocol. + +Configure FreeRADIUS on the `radsecsvr` host to expect the PROXY +Protocol for RadSec connections. This is done by editing the `listen +{}` section of the `tls` virtual server to include a reference to the +proxy protocol: + +.Enabling PROXY Protocol in a FreeRADIUS virtual server +======================================================= + + listen { + ... + proxy_protocol = true + ... + } + +======================================================= + +Now restart the debugging session: +[source,shell] +---- +radiusd -fxxl /dev/stdout +---- + + +For HAproxy, you should enable the PROXY Protocol on connections to +the RadSec backend, by editing the `backend` definition to add a +`send-proxy` argument: + +.Example HAproxy backend configuration with PROXY Protocol +========================================================== + + backend radsec_be + mode tcp + balance roundrobin + server radsecsvr 172.23.0.3:2083 send-proxy + +========================================================== + +Note the `send-proxy` argument in the `server` definition. + +Now reload the HAproxy service: + +[source,shell] +---- +service haproxy reload +--- + + +For Traefik, enable the PROXY Protocol on connections to the RadSec +backend by editing the `radsec-service` definition to add a reference +to the proxy protocol" + +.Example Traefik service configuration with PROXY Protocol +========================================================== + + radsec-service: + loadBalancer: + servers: + - address: "172.23.0.3:2083" + proxyProtocol: + version: 1 + +========================================================== + +Note the `proxyProtocol` and `version: 1` directives. + +Traefik should automatically detect the updates and reconfigure the +service. + + +=== Testing RadSec connectivity via a proxy using PROXY Protocol + +Finally, with your test client configured to use the proxy, perform a +test authentication: + +[source,shell] +---- + echo "User-Name = bob" | radclient 127.0.0.1 auth testing123 +---- + +You should expect to see the familiar output: + +.Example output from radclient +============================== + + Sent Access-Request Id 252 from 0.0.0.0:50118 to 127.0.0.1:1812 length 27 + Received Access-Accept Id 252 from 127.0.0.1:1812 to 127.0.0.1:50118 length 39 + +============================== + +Now examine the FreeRADIUS debug output on the RadSec server: + +.Expected output from `radiusd -X` with PROXY Protocol +====================================================== + + ... + (0) (TLS) Received PROXY protocol connection from client \ + 172.23.0.2:55343 -> 172.23.0.4:2083, via proxy 172.23.0.4:40268 -> 0.0.0.0:2083 + ... + (0) Received Access-Request Id 227 from 172.23.0.2:55343 to 172.23.0.4:2083 length 49 + (0) Sent Access-Accept Id 227 from 172.23.0.4:2083 to 172.23.0.2:55343 length 0 + ... + +====================================================== + +The output indicates that FreeRADIUS is receiving the originating +connection information from the PROXY Protocol. FreeRADIUS then +handles the RadSec requests as though they have been received directly +from the originating client. + diff --git a/doc/antora/modules/howto/pages/protocols/proxy/enable_radsec.adoc b/doc/antora/modules/howto/pages/protocols/proxy/enable_radsec.adoc new file mode 100644 index 0000000..f5e7603 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/proxy/enable_radsec.adoc @@ -0,0 +1,188 @@ +== Enabling RadSec with FreeRADIUS + +Our first task is to set up a RadSec server by configuring an instance of +FreeRADIUS to accept RADIUS over TLS requests. + +The following steps should be performed on the host which will be the +RadSec server, we will call it `radsecsvr`. + +You can install FreeRADIUS using the NetworkRADIUS packages by +following the instructions provided here: + + + +Before making any configuration changes, you should stop the radiusd +service: + +[source,shell] +---- + service radiusd stop +---- + +Then, enable the `tls` virtual server: + +[source,shell] +---- +cd /etc/raddb/sites-enabled +ln -s ../sites-available/tls +---- + +The FreeRADIUS distribution contains an example Certificate Authority +that will have generated the necessary CA, server and client +certificates and keys during package installation. You can use this +CA, or you can use your own CA and certificates. + +[TIP] +==== +If the example certificates are not present (for example if FreeRADIUS was +installed from source) then FreeRADIUS will fail to start. The files can be +regenerated by running `make` in the `/etc/raddb/certs` directory. +==== + +Edit the `tls` virtual server configuration, in order to add +definitions for the clients by extending the `clients radsec {}` section: + +.Example radsec client definitions in `/etc/raddb/sites-available/tls` +==== + + clients radsec { + ... + # Direct connections from the test client + client radseccli { + ipaddr = 172.23.0.2 + proto = tls + virtual_server = default + } + # Connections via HAproxy + client haproxy { + ipaddr = 172.23.0.4 + proto = tls + virtual_server = default + } + # Connections via Traefik + client traefik { + ipaddr = 172.23.0.5 + proto = tls + virtual_server = default + } + } + +==== + +The client `ipaddr` configuration item is used to match the source IP +address of incoming connections. You must add client definitions for +each of the clients which will connect. + +For RadSec, you can just list the IP address of the RadSec client. +This client definition is used for processing RADIUS packets from the +RadSec client. + +[NOTE] +==== +A `secret` does not have to be specified for RadSec clients, as the +default is `radsec`. If you specify a secret, then that will be used +instead of `radsec`. +==== + +When the PROXY protocol is used, you must _also_ define a client which +matches the IP address of the proxy (haproxy, etc). This client is +only used to check that the source IP is permitted to connect to the +server. Fields other than `ipaddr` can be specified (and in some +cases may be required). However, all other fields will be ignored. + +For testing purposes, we want to amend the `default` virtual server so +that it accepts all authentication reqeusts and immediately responds +to accounting requests. + +Edit the `/etc/raddb/sites-enabled/default` file so that the beginning of +the `authorize` and `preacct` sections looks as follows: + +.Example default virtual server modification to unconditionally accept Access-Requests +==== + + authorize { + accept + ... + } + ... + preacct { + handled + ... + } + +==== + +This change makes the `authorize` section always "accept" the user, +and makes the `preacct` section always say "we handled the accounting +request". These changes are only for testing, and should never be +used in production. + +Start the FreeRADIUS service in the foreground with debugging enabled: + +[source,shell] +---- +radiusd -fxxl /dev/stdout +---- + +Examine the output from FreeRADIUS to ensure that it is now listening for +RadSec connection on TCP/2083: + +.Example output from running `radiusd -fxxl /dev/stdout` +==== + + FreeRADIUS Version 3.0.24 + Copyright (C) 1999-2021 The FreeRADIUS server project and contributors + ... + ... : Debug: Listening on auth+acct proto tcp address * port 2083 (TLS) bound to server default + ... : Debug: Listening on auth address * port 1812 bound to server default + ... : Debug: Listening on acct address * port 1813 bound to server default + ... : Debug: Listening on auth address :: port 1812 bound to server default + ... : Debug: Listening on acct address :: port 1813 bound to server default + ... + ... : Info: Ready to process requests + +==== + +FreeRADIUS is now ready to process RadSec traffic. + +For testing, we first test normal RADIUS over UDP functionality, then +the RadSec connection using a test client, then introduce a proxy +server, and finally we enable PROXY Protocol. Doing the tests in this +way ensures that we know that all previous steps work before trying +the next step. This process allows us to quickly narrow down +problems, and gets us to the final goal _faster_ than just "doing +everything all at once". + +=== Testing the RADIUS policy + +Before moving on, verify that the FreeRADIUS policy is able to +authenticate a local test RADIUS Access-Request over UDP: + +[source,shell] +---- +echo "User-Name = terry" | radclient 127.0.0.1 auth testing123 +---- + +Due to the `accept` we added in the `authorize` section, the expected +output should be an Access-Accept: + +.Expected output from radclient +=============================== + + Sent Access-Request Id 157 from 0.0.0.0:36850 to 127.0.0.1:1812 length 27 + Received Access-Accept Id 157 from 127.0.0.1:1812 to 127.0.0.1:36850 length 20 + +=============================== + +Any other output indicates that there is a problem with the FreeRADIUS +configuration which *must* be solved before testing RadSec. Carefully verify that +you have carried out each of the above steps correctly and examine the debug +output from FreeRADIUS, which will usually tell you what is wrong. + +See [how to read the debug +output](http://wiki.freeradius.org/radiusd-X) for instructions on +reading amd understanding the debug output. + +The next step is to xref:protocols/proxy/radsec_client.adoc[configure +FreeRADIUS as a RadSec test client] so that we can verify that our +RadSec server is working. diff --git a/doc/antora/modules/howto/pages/protocols/proxy/index.adoc b/doc/antora/modules/howto/pages/protocols/proxy/index.adoc new file mode 100644 index 0000000..5100635 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/proxy/index.adoc @@ -0,0 +1,126 @@ += Proxying RadSec and enabling PROXY Protocol + +This guide shows how to set up FreeRADIUS to serve RadSec connections, fronted +by either HAproxy or Traefik as Layer 4 proxies that pass on the original +client connection information using PROXY Protocol. + +It is not a comprehensive guide to using RadSec with FreeRADIUS. It presents a +basic configuration that uses an example CA and does not validate certificate +attributes or perform revokation status. + + +== Introduction + +FreeRADIUS supports receiving RADIUS requests over TLS-enabled TCP connections +and supports proxying of requests over TCP connections to another TLS-enabled +homeserver. The protocol for RADIUS over TLS is called "RadSec" and is defined +in RFC 6614. + +FreeRADIUS is a capable and performant application-aware ("Layer 7") proxy / +load-balancer for RadSec and other forms of RADIUS traffic. + + +=== Layer 4 proxying + +Rather than use an application-aware proxy it is sometimes better to reduce the +performance impact incurred by re-encoding an application protocol by using a +"Layer 4" proxy that operates at the level of individual connections without +regard for the application protocol. Such a proxy is more of a "bump in the +wire" than a request buffer and minimises the latency incurred due to proxying. + +It is common to see software such as HAproxy and Traefik used in Layer 4 mode +in place of FreeRADIUS for purposes such as connection load balancing. In +addition to improved performance, these tools have the benefit that they +typically support dynamic service discovery and "hitless" reloads to +automatically adapt their connection routing based on changes to backend +services such as the introduction of new nodes with even a momentary loss of +service. + + +=== Loss of connection information + +When TCP connections are relayed through Layer 4 proxies the information +about the originating source of the connection is no longer known to the +backend service, unless it is otherwise made available. Identifying the +originator of connections is often necessary for security purposes and for +request processing. + +Whilst many application protcols support headers that allow proxies to preserve +connection information these are not helpful in the context of Layer 4 +proxying: The process of populating headers requires knowledge of the +application protocol to re-encode requests as they are transmitted between the +frontend and backend connections. + + +=== PROXY Protocol + +PROXY Protocol overcomes this limitation by allowing the original connection +information to be provided to the backend at the start of the TCP connection. +After this initial data is encoded the remainder of the conversation then +proceeds as normal. However now that the connection information is known to the +backend server it is able to process requests made on the connection as though +the connection were being made directly by the client and not via the proxy. + +PROXY Protocol is specified in this document: +http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt + + +== Requirements + +PROXY Protocol Version 1 is supported by FreeRADIUS v3.0.24 and later versions. + +You will require the following set of VMs or containers, each with their own +IP address: + +[cols="1,1,1"] +|=== +|Hostname|IP address|Purpose + +|radseccli +|172.23.0.2 +|FreeRADIUS configured to provide a RadSec test client + +|radsecsvr +|172.23.0.3 +|FreeRADIUS configured as a RadSec server + +|haproxy +|172.23.0.4 +|HAproxy in Layer 4 mode to the FreeRADIUS RadSec backend +|=== + +Optionally you may want to configure a host to run Traefik within a Docker +container using host mode networking, perhaps configured by Docker Compose, +however the installation is beyond the scope of this guide: + +[cols="1,1,1"] +|=== +|traefik +|172.23.0.5 +|Traefik configured as a TCP router with TLS passthrough to the FreeRADIUS RadSec backend +|=== + +The hostnames and IP addresses provided above are for examples purposes and are +used throughout the remainder of this guide. This guide provides commands and +output for CentOS. Other distributions will have minor differences, including +the location of the FreeRADIUS configuration (the "raddb"). + +[NOTE] +==== +You can choose to use your own hostname, IP addresses and OS distribution. You +could also use official Docker images provided by the respecitive projects, +however these prescribe methods for configuring and managing the services +that are not typical for a normal package installation which would provide a +distraction if used for by guide. +==== + + +== Sections in this guide + +This guide is organised into four parts that should be read in order: + +1. xref:protocols/proxy/enable_radsec.adoc[Enabling RadSec] +2. xref:protocols/proxy/radsec_client.adoc[Configuring a test RadSec client] +3. xref:protocols/proxy/radsec_with_haproxy.adoc[Proxying RadSec with HAproxy] +4. xref:protocols/proxy/radsec_with_traefik.adoc[Proxying RadSec with Traefik] +5. xref:protocols/proxy/enable_proxy_protocol.adoc[Enabling PROXY Protocol for RadSec] diff --git a/doc/antora/modules/howto/pages/protocols/proxy/radsec_client.adoc b/doc/antora/modules/howto/pages/protocols/proxy/radsec_client.adoc new file mode 100644 index 0000000..d92345e --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/proxy/radsec_client.adoc @@ -0,0 +1,181 @@ +== Configuring FreeRADIUS as a RadSec test client + +Unfortunately, the `radclient` program does not support RadSec. We +must therefore configure an instance of FreeRADIUS as a "transport +converter" which proxies UDP-based RADIUS requests to a RadSec +destination of our choice. + +The following steps should be performed on a client system, which we +will call `radseccli`. This system should be a new system, with a +different IP address. That is, you shoudl not edit the configuration +on the `radsecsvr` host. Doing so will break the RadSec configuration. + +Install FreeRADIUS using the NetworkRADIUS packages by following the +instructions provided here: + + + +Before making any configuration changes, you should stop the radiusd +service: + +[source,shell] +---- + service radiusd stop +---- + +Add a new `tls` home server definition, which will point to the RadSec +server. We do this by creating a file +`/etc/raddb/sites-enabled/radsec-homeserver` with the following +contents: + +.Example homeserver, pool and realm definitions for the RadSec service +==== + + home_server tls { + ipaddr = 172.23.0.3 # IP address of our RadSec server + port = 2083 + type = auth+acct + proto = tcp + tls { + private_key_password = whatever + private_key_file = ${certdir}/client.pem + certificate_file = ${certdir}/client.pem + ca_file = ${cadir}/ca.pem + } + } + home_server_pool tls { + type = fail-over + home_server = tls + } + realm tls { + auth_pool = tls + acct_pool = tls + } + +==== + +[TIP] +==== +Complete descriptions of each of the above configuration items can be found in the +`[raddb]/sites-available/tls` example configuration file. For simple tests, however, +we can omit all of the comments from the file. +==== + +To use this `tls` home server, we change the `default` virtual server to proxy +all authentication and accounting requests to it. + +Edit the `/etc/raddb/sites-enabled/default` file so that the beginning of +the `authorize` and `preacct` sections looks as follows: + +.Example default virtual server modification to proxy requests to a RadSec proxy server +==== + + authorize { + update control { + &Proxy-To-Realm := tls + } + handled + ... + } + ... + preacct { + update control { + &Proxy-To-Realm := tls + } + handled + ... + } + +==== + +These changes make the `tls` virtual server always proxy packets. +These changes are only for testing, and should never be used in +production. + +We must now copy the example CA certificate as well as the client +certificate and key files which are on the `radsecsrv` host to this +test client. + +Replace the following files on `radseccli` with the equivalent files from +`radsecsrv`: + +[cols="1,1,1"] +|=== +|File|Corresponding configuration item|Purpose + +|/etc/raddb/certs/ca.pem +|`ca_file` +|CA certificate which is used to authenticate the server certificate presented by the RadSec server to the client. + +|/etc/raddb/certs/client.pem +|`certificate_file` +|Client certificate (signed by the CA certificate) that is presented by the test client to the RadSec server. + +|/etc/raddb/certs/client.pem +|`private_key_file` and `private_key_password` +|Private key corresponding to the client certificate +|=== + +Note that the client certificate and key are typically bundled into a single file. + +[CAUTION] +==== +If you do not correctly replace the CA, client certificate, and key +material on the test client then the RadSec client and RadSec server +will fail to mutually authenticate each other as they do not share a +trusted CA. If you see messages like `unknown CA`, then you know that +the certificates have not been set up correctly. +==== + +Start the FreeRADIUS service in debug mode: + +[source,shell] +---- +radiusd -X +---- + + +=== Testing RadSec connectivity + +At this stage you should be able to cause the test client to send RadSec +requests directly to the RadSec server. + +Run the following to send a RADUS (UDP) Access-Request to the local FreeRADIUS +instance. It should then proxy the request over RadSec connection to +the remote RadSec server: + +[source,shell] +---- + echo "User-Name = bob" | radclient 127.0.0.1 auth testing123 +---- + +If the test client is able to successfully establish the RadSec +connection, and the RadSec server replies with an Access-Accept +response, then the output will be as follows: + +.Expected output from radclient +=============================== + + Sent Access-Request Id 252 from 0.0.0.0:50118 to 127.0.0.1:1812 length 27 + Received Access-Accept Id 252 from 127.0.0.1:1812 to 127.0.0.1:50118 length 39 + +=============================== + +Lack of response or an Access-Reject response indicates that the RadSec +connection is not being established successfully. + +There may be serveral reasons for broken connectivity including: + + * The client not accepting the certificate presented by the server. + * The server not accepting the certificate presented by the client. + +Look at the debug output generated by both the test client and the RadSec +server. In many cases it will tell you exactly what the problem is. + +Do not proceed with any further steps until direct connections between the +RadSec client and Radsec Server are working properly. + +Once things are working we are ready to +xref:protocols/proxy/radsec_with_haproxy.adoc[configure HAproxy to proxy RadSec +connections] or to xref:protocols/proxy/radsec_with_traefik.adoc[configure +Traefik to proxy RadSec connections]. diff --git a/doc/antora/modules/howto/pages/protocols/proxy/radsec_with_haproxy.adoc b/doc/antora/modules/howto/pages/protocols/proxy/radsec_with_haproxy.adoc new file mode 100644 index 0000000..e58abfe --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/proxy/radsec_with_haproxy.adoc @@ -0,0 +1,134 @@ +== Proxying RadSec with HAproxy + +This section shows how to configure HAproxy to proxy RadSec connections. + +The following steps should be performed on the `haproxy` host, unless otherwise +stated. + +Install the HAproxy package supplied with the OS distribution: + +[source,shell] +---- + yum install haproxy +---- + +Stop the haproxy service: + +[source,shell] +---- + service haproxy stop +---- + +Modify the haproxy configuration (typically `/etc/haproxy/haproxy.conf`) so +that it includes new frontend and backend configuration for the radsec service: + +.Example minimal HAproxy configuration +====================================== + + global + maxconn 100 + defaults + mode tcp + timeout connect 10s + timeout client 30s + timeout server 30s + frontend radsec_fe + bind *:2083 + default_backend radsec_be + backend radsec_be + balance roundrobin + server radsecsvr 172.23.0.3:2083 + +====================================== + +Note the `mode tcp` directive which tells HAproxy to act as a Layer 4 +proxy, so that it doesn't attempt to perform SSL termination or +decode the RADIUS protocol. + +[NOTE] +==== +The above example is a minimal configuration. In practise you will want to +retain many of the HAproxy configuration items already present in the +configuration (e.g. `log`, `chroot`, `user`, `group`), but these vary across +distributions. Other HTTP-related options that may already exist in the +configuration will conflict with `mode tcp` (Layer 4 proxying) and should be +removed if HAproxy complains about them. + +However, you should first get things working with the minimal +configuration which is known to work, and then make customisations. +If you start off with a complex configuration, then there may be a +large number of things which are broken, and debugging them all will +be difficult. Start simple, and then add complexity! +==== + +Restart the haproxy service in foreground mode for debugging purposes: + +[source,shell] +---- +haproxy -f /etc/haproxy/haproxy.cfg -db +---- + + +=== Testing RadSec connectivity via HAproxy + +Now edit the test RadSec client, so that instead of making connections directly +to the RadSec server it makes connections to the HAproxy server. + +On `radseccli` edit the `/etc/raddb/sites-enabled/tls` file, and set +the IP address to the address of the `haproxy` host. + +.Example updated test client homeserver configuration +===================================================== + + home_server tls { + ipaddr = 172.23.0.4 # Updated from radsecsvr to haproxy + ... + } + +===================================================== + +Restart the debug mode session: + +[source,shell] +---- +radiusd -X +---- + +Perform a test authentication: + +[source,shell] +---- + echo "User-Name = bob" | radclient 127.0.0.1 auth testing123 +---- + +If the test client is able to successfully establish the RadSec +connection via HAproxy, and the RadSec server replies with an +Access-Accept response, then the output will be as follows: + +.Expected output from radclient +=============================== + + Sent Access-Request Id 252 from 0.0.0.0:50118 to 127.0.0.1:1812 length 27 + Received Access-Accept Id 252 from 127.0.0.1:1812 to 127.0.0.1:50118 length 39 + +=============================== + +HAproxy should also log a message that indicates that the connection was +proxied, such as the following: + +.Expected output from HAproxy +============================= + + <150>...: Connect from 172.23.0.2:50087 to 172.23.0.4:2083 (radius_fr/TCP) + +============================= + +Any other output from radclient or HAproxy indicates that there is a +problem with the HAproxy configuration, or that FreeRADIUS is not +accepting connection from the `haproxy` host, which must be solved +before continuing. + +Once proxied connections are working we are ready to +xref:protocols/proxy/enable_proxy_protocol.adoc[enable the PROXY +Protocol] on both HAproxy and the RadSec server. + diff --git a/doc/antora/modules/howto/pages/protocols/proxy/radsec_with_traefik.adoc b/doc/antora/modules/howto/pages/protocols/proxy/radsec_with_traefik.adoc new file mode 100644 index 0000000..11030e9 --- /dev/null +++ b/doc/antora/modules/howto/pages/protocols/proxy/radsec_with_traefik.adoc @@ -0,0 +1,128 @@ +== Proxying RadSec with Traefik + +This section shows how to configure Traefik to proxy RadSec connections. You +should skip this section if you are not using Traefik as your proxy. + +Installing Traefik is beyond the scope of this guide. It is typically installed +as a service mesh router within a Docker or Kubernetes environment using +offical Docker images. + +Traefik configuration has two components of interest: + + * Static configuration: Defines "entrypoints" on which Traefik listens for connections. + * Dynamic configuration: Defines backend service components and the routing policy. + +Traefik supports a number of providers of dynamic configuration data for the +router and service definitions. For demonstration purposes the files provider +is used here, however you can switch to another provide once you have things +working using this method. + +The static configuration can be provided by starting Traefik with the following +arguments: + +.Example Traefik static configuration +===================================== + + traefik \ + --log.level=DEBUG \ + --providers.file.filename=/etc/traefik/dynamic_config.yml + --providers.file.watch=true + --entryPoints.radsec.address=:2083 + +===================================== + +Note that a `radsec` entrypoint is defined to listen on port 2083 and that a +static `file` provider is used to defined the dynamic services. + +The backend for RadSec should be defined in this file as follows: + +.Example Traefik dynamic configuration +====================================== + + tcp: + routers: + radsec-router: + entryPoints: + - radsec + rule: "HostSNI(`*`)" + service: "radsec-service" + tls: + passthrough: true + services: + radsec-service: + loadBalancer: + servers: + - address: "172.23.0.3:2083" + +====================================== + +Note the `passthrough: true` directive under `tls:` which tells Treafik not to +attempt TLS termination which it would otherwise perform for all incoming TLS +connections. We require that the connection is passed through from the RadSec +client to the RadSec server without being reterminated since the end client's +certificate is authenticated by the RadSec server and many be used for +policy decisions. + + +=== Testing RadSec connectivity via Traefik + +Now amend the test RadSec client so that instead of making connections directly +to the RadSec server it makes them via Traefik. + +On `radseccli` amend `/etc/raddb/sites-enabled/tls` and set the IP address to +that of the `traefik` host. + +.Example updated test client homeserver configuration +===================================================== + + home_server tls { + ipaddr = 172.23.0.5 # Updated from radsecsvr to traefik + ... + } + +===================================================== + +Restart the debug mode session: + +[source,shell] +---- +radiusd -X +---- + +Perform a test authentication: + +[source,shell] +---- + echo "User-Name = bob" | radclient 127.0.0.1 auth testing123 +---- + +If the test client is able to successfully establish the RadSec connection via +Traefik and the RadSec server replies with an Access-Accept response then the +output will be as follows: + +.Example output from radclient +============================== + + Sent Access-Request Id 252 from 0.0.0.0:50118 to 127.0.0.1:1812 length 27 + Received Access-Accept Id 252 from 127.0.0.1:1812 to 127.0.0.1:50118 length 39 + +============================== + +Traefik should also log a message that indicates that the connection was +proxied, such as the following: + +.Example output from Traefik +============================ + + time="..." level=debug msg="Handling connection from 172.23.0.2:57367" + +============================ + +Any other output from radclient or Traefik indicates that there is a problem +with the Traefik configuration or that FreeRADIUS is not accepting connection +from the `traefik` host, which must be solved before continuing. + +Once proxied connections are working we are ready to +xref:protocols/proxy/enable_proxy_protocol.adoc[enable the PROXY Protocol] on +both Traefik and the RadSec server. + diff --git a/doc/antora/modules/installation/nav.adoc b/doc/antora/modules/installation/nav.adoc new file mode 100644 index 0000000..26ce32e --- /dev/null +++ b/doc/antora/modules/installation/nav.adoc @@ -0,0 +1,5 @@ +* xref:index.adoc[Installing and upgrading] +** xref:packages.adoc[Install from packages] +** xref:dependencies.adoc[Dependencies] +** xref:source.adoc[Build from source] +** xref:upgrade.adoc[Upgrading to v3] diff --git a/doc/antora/modules/installation/pages/dependencies.adoc b/doc/antora/modules/installation/pages/dependencies.adoc new file mode 100644 index 0000000..e910e76 --- /dev/null +++ b/doc/antora/modules/installation/pages/dependencies.adoc @@ -0,0 +1,58 @@ += FreeRADIUS Dependencies + +Some external dependencies must be installed before building or +running FreeRADIUS. The core depends on two mandatory libraries: +`libtalloc` for memory management and `libkqueue` for event +handling. + +Many of the modules also have optional dependencies. For example, +the LDAP module requires LDAP client libraries to be installed +and database modules need their respective database client +libraries. + +If building from source code, the configure stage will check for +the optional dependencies. Any missing libraries will cause that +particular module to be skipped. + +== Libraries + +=== libtalloc + +Talloc is a memory allocation library available at +https://talloc.samba.org/talloc/doc/html/index.html + +*OSX* + +`# brew install talloc` + +*Debian, Ubuntu and `dpkg`-based systems* + +`# apt-get install libtalloc-dev` + +*RedHat or CentOS* + +``` +# subscription-manager repos --enable rhel-7-server-optional-rpms +# yum install libtalloc-dev +``` + +=== kqueue + +Kqueue is an event / timer API originally written for BSD systems. +It is _much_ simpler to use than third-party event libraries. A +library, `libkqueue`, is available for Linux systems. + +*OSX* + +_kqueue is already available, there is nothing to install._ + +*Debian, Ubuntu and `dpkg`-based systems* + +`# apt-get install libkqueue-dev` + +*RedHat or CentOS* + +``` +# subscription-manager repos --enable rhel-7-server-optional-rpms +# yum install libkqueue-dev +``` diff --git a/doc/antora/modules/installation/pages/index.adoc b/doc/antora/modules/installation/pages/index.adoc new file mode 100644 index 0000000..b810078 --- /dev/null +++ b/doc/antora/modules/installation/pages/index.adoc @@ -0,0 +1,15 @@ +== Installation + +FreeRADIUS is available from multiple sources: + +* Official xref:packages.adoc[Network RADIUS packages] +* xref:source.adoc[Source code] +* Many Operating System distributions + +We highly recommend using the official packages from Network +RADIUS, where available. + +The documents in this section cover details of the above +installation methods, as well as instructions on building +packages locally. + diff --git a/doc/antora/modules/installation/pages/packages.adoc b/doc/antora/modules/installation/pages/packages.adoc new file mode 100644 index 0000000..ffc52cd --- /dev/null +++ b/doc/antora/modules/installation/pages/packages.adoc @@ -0,0 +1,22 @@ +== Install from packages + +Network RADIUS provide pre-built binary packages of FreeRADIUS for +common Linux distributions. This is the recommended installation +method when packages are available for your system. + +The official http://packages.networkradius.com[Network RADIUS +packages] page contains recent FreeRADIUS packages and +installation instructions. + +=== Distribution-supplied packages + +While many Operating System distributions ship FreeRADIUS +packages, the versions they include are often years out of date. +As well as missing out on the latest bug fixes and features, this +also means that it is very hard to know if an issue encountered is +still a problem or if it is fixed in the latest release. + +Therefore, whilst the distribution-supplied packages can often be +the most convenient to install, we do not usually recommend using +them. + diff --git a/doc/antora/modules/installation/pages/source.adoc b/doc/antora/modules/installation/pages/source.adoc new file mode 100644 index 0000000..cf40a79 --- /dev/null +++ b/doc/antora/modules/installation/pages/source.adoc @@ -0,0 +1,199 @@ +== Building from Source + +We recommend xref:packages.adoc[installing from packages] if +possible. Full instructions on building and installing from source +code follow. + +The mandatory xref:installation:dependencies.adoc[dependencies] +must be installed before FreeRADIUS can be built. These dependencies +are `libtalloc` and `libkqueue`, which FreeRADIUS uses for memory +management, and platform-independent event handling. + +Per-module dependencies that enable support for external services +such as LDAP, SQL, etc, are optional. They must be installed for +any modules that are to be used. The FreeRADIUS `./configure` step +will automatically detect if each module has its dependencies met +and automatically enable support for them. If the features you +require are not enabled you should inspect the configure script +output to figure out which additional development libraries need +to be installed. + +The FreeRADIUS source may be obtained from a number of locations: + +* Download the latest version of the FreeRADIUS source from + https://www.freeradius.org/releases/[the FreeRADIUS web site]; or +* download directly from the + ftp://ftp.freeradius.org/pub/freeradius/[FreeRADIUS FTP site]; or +* download from + https://github.com/FreeRADIUS/freeradius-server/[GitHub]. + +The file wil be name something like: `freeradius-server-3.0.22.tar.gz`. +Later versions will be `3.0.23`, or `4.0.0`, etc. PGP signatures are +also provided for official releases from the FTP site; these are +named e.g. `freeradius-server-3.0.22.tar.gz.sig`. + +Un-tar the file, and change to the FreeRADIUS directory (where +`VERSION` below is the version of the server that you have +downloaded). + +[source,shell] +---- +tar -zxf freeradius-server-VERSION.tar.gz +cd freeradius-server-VERSION +---- + +Take the following steps to build and install the server from source: + +[source,shell] +---- +./configure +make +sudo make install +---- + +=== Custom build + +FreeRADIUS has GNU autoconf support. This means you have to run +`./configure`, and then run `make`. To see which configuration +options are supported, run `./configure --help`, and read its output. + +The `make install` stage will install the binaries, the "man" pages, +and _may_ install the configuration files. If you have not installed a +RADIUS server before, then the configuration files for FreeRADIUS will +be installed. + +If you already have a RADIUS server installed, then *FreeRADIUS +WILL NOT over-write your current configuration.* + +The `make install` process will warn you about the files it could not +install. + +If you see a warning message about files that could not be +installed, then you *must* ensure that the new server is using the +new configuration files and not the old configuration files, as +this may cause undesired behavior and failure to operate correctly. + +The initial output from running in debugging mode (`radiusd -X`) +will tell you which configuration files are being used. See +xref:installation:upgrade.adoc[Upgrading] for information about +upgrading from older versions. There _may_ be changes in the +dictionary files which are required for a new version of the +software. These files will not be installed over your current +configuration, so you *must* verify and install any problem files by +hand, for example using `diff(1)` to check for changes. + +When installing from source, it is _extremely_ helpful to read the +output of `./configure`, `make`, and `make install`. If a +particular module you expected to be installed was not installed, +then the output will tell you why that module was not installed. +The most likely reason is that required libraries (including their +development header files) are not available. + +Please do _not_ post questions to the FreeRADIUS users list +without first carefully reading the output of this process as it +often contains the information needed to resolve a problem. + +== Upgrading To A New Minor Release + +The installation process will not over-write your existing configuration +files. It will, however, warn you about the files it did not install. +These will require manual integration with the existing files. + +It is not possible to re-use configurations between different major +versions of the server. + +For details on what has changed between the version, see the +xref:installation:upgrade.adoc[upgrade] guide. + +We _strongly_ recommend that new major versions be installed in a +different location than any existing installations. Any local policies +can then be migrated gradually to the configuration format of the new +major version. The number of differences in the new configuration mean +that is is both simpler and safer to migrate your configurations rather +than to try and just get the old configuration to work. + +== Running the server + +If the server builds and installs, but doesn’t run correctly, then +you should first use debugging mode (`radiusd -X`) to figure out +the problem. + +This is your best hope for understanding the problem. Read _all_ +of the messages which are printed to the screen, the answer to +your problem will often be in a warning or error message. + +We really cannot emphasize that last sentence enough. Configuring +a RADIUS server for complex local authentication isn’t a trivial +task. Your _best_ and _only_ method for debugging it is to read +the debug messages, where the server will tell you exactly what +it’s doing, and why. You should then compare its behaviour to what +you intended, and edit the configuration files as appropriate. + +If you don’t use debugging mode, and ask questions on the mailing +list, then the responses will all tell you to use debugging mode. +The server prints out a lot of information in this mode, including +suggestions for fixes to common problems. Look especially for +`WARNING` and `ERROR` messages in the output, and read the related +messages. + +Since the main developers of FreeRADIUS use debugging mode to +track down their configuration problems with the server, it’s a +good idea for you to use it, too. If you don’t, there is little +hope for you to solve any configuration problem related to the +server. + +To start the server in debugging mode, do: + +[source,shell] +---- +radiusd -X +---- + +You should see a lot of text printed on the screen as it starts up. If +you don’t, or if you see error messages, please read the FAQ: + +https://wiki.freeradius.org/guide/FAQ + +If the server says `Ready to process requests.`, then it is running +properly. From another shell (or another window), type + +[source,shell] +---- +radtest test test localhost 0 testing123 +---- + +You should see the server print out more messages as it receives the +request, and responds to it. The `radtest` program should receive the +response within a few seconds. It doesn’t matter if the authentication +request is accepted or rejected, what matters is that the server +received the request, and responded to it. + +You can now edit the configuration files for your local system. You will +usually want to start with `sites-enabled/default` for main +configurations. To set which NASes (clients) can communicate with this +server, edit `raddb/clients.conf`. Please read the configuration files +carefully, as many configuration options are only documented in comments +in the file. + +Note that is is _highly_ recommended that you use some sort of version +control system to manage your configuration, such as git or Subversion. +You should then make small changes to the configuration, checking in and +testing as you go. When a config change causes the server to stop +working, you will be able to easily step back and find out what update +broke the configuration. + +It is also considered a best practice to maintain a staging or +development environment. This allows you to test and integrate your +changes without impacting your active production environment. You should +make the appropirate investment in order to properly support a critical +resource such as your authentication servers. + +Configuring and running the server MAY be complicated. Many modules have +`man` pages. See `man rlm_pap`, or `man rlm_*` for information. +Please read the documentation in the doc/ directory. The comments in the +configuration files also contain a lot of documentation. + +If you have any additional issues, the FAQ is also a good place to +start. + +https://wiki.freeradius.org/guide/FAQ diff --git a/doc/antora/modules/installation/pages/upgrade.adoc b/doc/antora/modules/installation/pages/upgrade.adoc new file mode 100644 index 0000000..67874c8 --- /dev/null +++ b/doc/antora/modules/installation/pages/upgrade.adoc @@ -0,0 +1,737 @@ += Upgrading from v2 to v3 + +The configuration for 3.0 is *largely* compatible with the 2.x.x +configuration. However, it is NOT possible to simply use the 2.x.x +configuration as-is. Instead, you should re-create it. + +== Security + +A number of configuration items have moved into the "security" subsection of +radiusd.conf. If you use these, you should move them. Otherwise, they can +be ignored. + +The list of moved options is: + +* chroot +* user +* group +* allow_core_dumps +* reject_delay +* status_server + +These entries should be moved from "radiusd.conf" to the "security" +subsection of that file. + +== Naming + +Many names used by configuration items were inconsistent in earlier +versions of the server. These names have been unified in version 3.0. + +If a file is being referenced or created the config item `filename` +is used. + +If a file is being created, the initial permissions are set by the +`permissions` config item. + +If a directory hierarchy needs to be created, the permissions are set +by `dir_permissions`. + +If an external host is referenced in the context of a module the +`server` config item is used. + +Unless the config item is a well recognised portmanteau +(as `filename` is for example), it must be written as multiple +distinct words separated by underscores `_`. + +The configuration items `file`, `script_file`, `module`, +`detail`, `detailfile`, `attrsfile`, `perm`, `dirperm`, +`detailperm`, and `hostname` are deprecated. As well as any false +portmanteaus, and configuration items that used hyphens as word +delimiters. e.g. `foo-bar` has been changed to `foo_bar`. Please +update your module configuration to use the new syntax. + +In most cases the server will tell you the replacement config item to +use. As always, run the server in debugging mode to see these +messages. + +== Modules Directory + +As of version 3.0, the `modules/` directory no longer exists. + +Instead, all "example" modules have been put into the +`mods-available/` directory. Modules which can be loaded by the +server are placed in the `mods-enabled/` directory. All of the +modules in that directory will be loaded. This means that the +`instantiate` section of radiusd.conf is less important. The only +reason to list a module in the `instantiate` section is to force +ordering when the modules are loaded. + +Modules can be enabled by creating a soft link. For module `foo`, do: + +[source,shell] +---- +cd raddb/mods-enabled +ln -s ../mods-available/foo +---- + +To create "local" versions of the modules, we suggest copying the file +instead. This leaves the original file (with documentation) in the +`mods-available/` directory. Local changes should go into the +`mods-enabled/` directory. + +Module-specific configuration files are now in the `mods-config/` +directory. This change allows for better organization, and means that +there are fewer files in the main `raddb` directory. See +`mods-config/README.rst` for more details. + +== Changed Modules + +The following modules have been changed in this version. + +=== rlm_sql + +The SQL configuration has been moved from `sql.conf` to +`mods-available/sql`. The `sqlippool.conf` file has also been +moved to `mods-available/sqlippool`. + +The SQL module configuration has been changed. The old connection +pool options are no longer accepted: + +---- +num_sql_socks +connect_failure_retry_delay +lifetime +max_queries +---- + +Instead, a connection pool configuration is used. This configuration +contains all of the functionality of the previous configuration, but +in a more generic form. It also is used in multiple modules, meaning +that there are fewer different configuration items. The mapping +between the configuration items is: + +---- +num_sql_socks -> pool { max } +connect_failure_retry_delay -> pool { retry_delay } +lifetime -> pool { lifetime } +max_queries -> pool { uses } +---- + +The pool configuration adds a number of new configuration options, +which allow the administrator to better control how FreeRADIUS uses +SQL connection pools. + +The following parameters have been changed: + +---- +trace -> removed +tracefile -> logfile +---- + +The logfile is intended to log SQL queries performed. If you need to +debug the server, use debugging mode. If `logfile` is set, then +*all* SQL queries will go to `logfile`. + +You can now use a NULL SQL database: + +.Example +---- +driver = rlm_sql_null +---- + +This is an empty driver which will always return "success". It is +intended to be used to replace the `sql_log` module, and to work in +conjunction with the `radsqlrelay` program. Simply take your normal +configuration for raddb/mods-enabled/sql, and set: + +.Example +---- +driver = rlm_sql_null +... +logfile = ${radacctdir}/sql.log +---- + +All of the SQL queries will be logged to that file. The connection +pool does not need to be configured for the `null` SQL driver. It +can be left as-is, or deleted from the SQL configuration file. + + +=== rlm_sql_sybase + +The `rlm_sql_sybase` module has been renamed to `rlm_sql_freetds` +and the old `rlm_sql_freetds` module has been removed. + +`rlm_sql_sybase` used the newer ct-lib API, and `rlm_sql_freetds` +used an older API and was incomplete. + +The new `rlm_sql_freetds` module now also supports database +selection on connection startup so `use` statements no longer +have to be included in queries. + + +=== sql/dialup.conf + +Queries for post-auth and accounting calls have been re-arranged. The +SQL module will now expand the 'reference' configuration item in the +appropriate sub-section, and resolve this to a configuration +item. This behaviour is similar to rlm_linelog. This dynamic +expansion allows for a dynamic mapping between accounting types and +SQL queries. Previously, the mapping was fixed. Any "new" accounting +type was ignored by the module. Now, support for any accounting type +can be added by just adding a new target, as below. + +Queries from v2.x.x may be manually copied to the new v3.0 +`dialup.conf` file (`raddb/sql/main//queries.conf`). +When doing this you may also need to update references to the +accounting tables, as their definitions will now be outside of +the subsection containing the query. + +The mapping from old "fixed" query to new "dynamic" query is as follows: + +---- +accounting_onoff_query -> accounting.type.accounting-on.query +accounting_update_query -> accounting.type.interim-update.query +accounting_update_query_alt +> accounting.type.interim-update.query +accounting_start_query -> accounting.type.start.query +accounting_start_query_alt +> accounting.type.start.query +accounting_stop_query -> accounting.type.stop.query +accounting_stop_query_alt +> accounting.type.stop.query +postauth_query -> post-auth.query +---- + +Alternatively a 2.x.x config may be patched to work with the +3.0 module by adding the following: + +.Example +[source,unlang] +---- + accounting { + reference = "%{tolower:type.%{Acct-Status-Type}.query}" + type { + accounting-on { + query = "${....accounting_onoff_query}" + } + accounting-off { + query = "${....accounting_onoff_query}" + } + start { + query = "${....accounting_start_query}" + query = "${....accounting_start_query_alt}" + } + interim-update { + query = "${....accounting_update_query}" + query = "${....accounting_update_query_alt}" + } + stop { + query = "${....accounting_stop_query}" + query = "${....accounting_stop_query_alt}" + } + } + } + post-auth { + query = "${..postauth_query}" + } +---- + +In general, it is safer to migrate the configuration rather than +trying to "patch" it, to make it look like a v2 configuration. + +Note that the sub-sections holding the queries are labelled +`accounting-on`, and not `accounting_on`. The reason is that the +names of these sections are taken directly from the +`Accounting-Request` packet, and the `Acct-Status-Type` field. +The `sql` module looks at the value of that field, and then looks +for a section of that name, in order to find the query to use. + +That process means that the server can be extended to support any new +value of `Acct-Status-Type`, simply by adding a named sub-section, +and a query. This behavior is preferable to that of v2, which had +hard-coded queries for certain `Acct-Status-Type` values, and was +ignored all other values. + +=== rlm_ldap + +The LDAP module configuration has been substantially changed. Please +read `raddb/mods-available/ldap`. It now uses a connection pool, +just like the SQL module. + +Many of the configuration items remain the same, but they have been +moved into subsections. This change is largely cosmetic, but it makes +the configuration clearer. Instead of having a large set of random +configuration items, they are now organized into logical groups. + +You will need to read your old LDAP configuration, and migrate it +manually to the new configuration. Simply copying the old +configuration WILL NOT WORK. + +Users upgrading from 2.x.x who used to call the ldap module in +`post-auth` should now set `edir_autz = yes`, and remove the `ldap` +module from the `post-auth` section. + +=== rlm_ldap and LDAP-Group + +In 2.x.x the registration of the `LDAP-Group` pair comparison was done +by the last instance of rlm_ldap to be instantiated. In 3.0 this has +changed so that only the default `ldap {}` instance registers +`LDAP-Group`. + +If `-LDAP-Group` is already used throughout your configuration +no changes will be needed. + +=== rlm_ldap authentication + +In 2.x.x the LDAP module had a `set_auth_type` configuration item, +which forced `Auth-Type := ldap`. This was removed in 3.x.x as it +often did not work, and was not consistent with the rest of the +server. We generally recommend that LDAP should be used as a +database, and that FreeRADIUS should do authentication. + +The only reason to use `Auth-Type := ldap` is when the LDAP server +will not supply the "known good" password to FreeRADIUS, *and* where +the Access-Request contains User-Password. This situation happens +only for Active Directory. If you think you need to force `Auth-Type +:= ldap` in other situations, you are very likely to be wrong. + +The following is an example of what should be inserted into the +`authorize {}` and `authenticate {}` sections of the relevant +virtual-servers, to get functionality equivalent to v2.x: + +.Example +[source,unlang] +---- +authorize { + ... + ldap + if ((ok || updated) && User-Password) { + update control { + Auth-Type := ldap + } +... +} +authenticate { + ... + Auth-Type ldap { + ldap + } +... +} +---- + +=== rlm_eap + +The EAP configuration has been moved from `eap.conf` to +`mods-available/eap`. A new `pwd` subsection has been added for +EAP-PWD. + + +=== rlm_expiration & rlm_logintime + +The rlm_expiration and rlm_logintime modules no longer add a `Reply-Message`, +the same behaviour can be achieved checking the return code of the module and +adding the `Reply-Message` with unlang: + +.Example +[source,unlang] +---- +expiration +if (userlock) { + update reply { + Reply-Message := "Your account has expired" + } +} +---- + + +=== rlm_unix + +The `unix` module does not have an `authenticate` section. So you +cannot set `Auth-Type := System`. The `unix` module has also been +deleted from the examples in `sites-available/`. Listing it there +has been deprecated for many years. + +The PAP module can do crypt authentication. It should be used instead +of Unix authentication. + +The Unix module still can pull the passwords from `/etc/passwd`, or +`/etc/shadow`. This is done by listing it in the `authorize` +section, as is done in the examples in `sites-available/`. However, +some systems using NIS or NSS will not supply passwords to the +`unix` module. For those systems, we recommend putting users and +passwords into a database, instead of relying on `/etc/passwd`. + + +=== rlm_preprocess + +In 2.x.x `huntroups` and `users` files were loaded from default locations +without being configured explicitly. Since 3.x.x you need to set +`huntgroups` and `users` configuration item(s) in module section in order +to get them being processed. + + +== New Modules + +=== rlm_date + +Instances of rlm_date register an xlat method which can translate +integer and date values to an arbitrarily formatted date time +string, or an arbitrarily formated time string to an integer, +depending on the attribute type passed. + + +=== rlm_rest + +The `rest` module is used to translate RADIUS requests into +RESTfull HTTP requests. Currently supported body types are JSON +and POST. + + +=== rlm_unpack + +The `unpack` module is used to turn data buried inside of binary +attributes. e.g. if we have `Class = 0x00000001020304` then: + +.Example +[source,unlang] +---- +Tmp-Integer-0 := "%{unpack:&Class 4 short}" +---- + +will unpack octets 4 and 5 as a "short", which has value 0x0304. +All integers are assumed to be in network byte order. + + +=== rlm_yubikey + +The `yubikey` module can be used to forward yubikey OTP token +values to a Yubico validation server, or decrypt the token +using a PSK. + + +== Deleted Modules + +The following modules have been deleted, and are no longer supported +in Version 3. If you are using one of these modules, your +configuration can probably be changed to not need it. Otherwise email +the freeradius-devel list, and ask about the module. + + +=== rlm_acct_unique + +This module has been replaced by the "acct_unique" policy. See +raddb/policy.d/accounting. + +The method for calculating the value of acct_unique has changed. +However, as this method was configurable, this change should not +matter. The only issue is in having a v2 and v3 server writing to the +same database at the same time. They will calculate different values +for Acct-Unique-Id. + + +=== rlm_acctlog + +You should use rlm_linelog instead. That module has a superset of the +acctlog functionality. + + +=== rlm_attr_rewrite + +The attr_rewrite module looked for an attribute, and then re-wrote it, +or created a new attribute. All of that can be done in "unlang". + +A sample configuration in "unlang" is: + +.Example +[source,unlang] +---- +if (request:Calling-Station-Id) { + update request { + Calling-Station-Id := "...." + } +} +---- + +We suggest updating all uses of attr_rewrite to use unlang instead. + + +=== rlm_checkval + +The checkval module compared two attributes. All of that can be done in "unlang": + +.Example +[source,unlang] +---- +if (&request:Calling-Station-Id == &control:Calling-Station-Id) { + ok +} +---- + +We suggest updating all uses of checkval to use unlang instead. + + +=== rlm_dbm + +No one seems to use it. There is no sample configuration for it. +There is no speed advantage to using it over the "files" module. +Modern systems are fast enough that 10K entries can be read from the +"users" file in about 10ms. If you need more users than that, use a +real database such as SQL. + + +=== rlm_fastusers + +No one seems to use it. It has been deprecated since Version 2.0.0. +The "files" module was rewritten so that the "fastusers" module was no +longer necessary. + + +=== rlm_policy + +No one seems to use it. Almost all of its functionality is available +via `unlang`. + + +=== rlm_sim_files + +The rlm_sim_files module has been deleted. It was never marked "stable", +and was never used in a production environment. There are better ways +to test EAP. + +If you want similar functionality, see rlm_passwd. It can read CSV +files, and create attributes from them. + + +=== rlm_sql_log + +This has been replaced with the "null" sql driver. See +`raddb/mods-available/sql` for an example configuration. + +The main SQL module has more functionality than rlm_sql_log, and +results in less code in the server. + +== Other Functionality + +The following is a list of new / changed functionality. + +=== RadSec + +RadSec (or RADIUS over TLS) is now supported. RADIUS over bare TCP +is also supported, but is recommended only for secure networks. + +See `sites-available/tls` for complete details on using TLS. The server +can both receive incoming TLS connections, and also originate outgoing +TLS connections. + +The TLS configuration is taken from the old EAP-TLS configuration. It +is largely identical to the old EAP-TLS configuration, so it should be +simple to use and configure. It re-uses much of the EAP-TLS code, +so it is well-tested and reliable. + +Once RadSec is enabled, normal debugging mode will not work. This is +because the TLS code requires threading to work properly. Instead of doing: + +.Example +[source,shell] +---- +radiusd -X +---- + +you will need to do: + +.Example +[source,shell] +---- +radiusd -fxx -l stdout +---- + +That's the price to pay for using RadSec. This limitation may be +lifted in a future version of the server. + + +=== PAP and User-Password + +From version 3.0 onwards the server no longer supports authenticating +against a cleartext password in the 'User-Password' attribute. Any +occurences of this (for instance, in the users file) should now be changed +to 'Cleartext-Password' instead. + +e.g. change entries like this: + +---- +bob User-Password == "hello" +---- + +to ones like this: + +---- +bob Cleartext-Password := "hello" +---- + +If this is not done, authentication will likely fail. The server will +also print a helpful message in debugging mode. + +If it really is impossible to do this, the following unlang inserted above +the call to the pap module may be used to copy User-Password to the correct +attribute: + +.Example +[source,unlang] +---- +if (!control:Cleartext-Password && control:User-Password) { + update control { + Cleartext-Password := "%{control:User-Password}" + } +} +---- + +However, this should only be seen as a temporary, not permanent, fix. +It is better to fix your databases to use the correct configuration. + + +== Unlang + + +The unlang policy language is compatible with v2, but has a number of +new features. See `man unlang` for complete documentation. + + +=== Errors + +Many more errors are caught when the server is starting up. Syntax +errors in `unlang` are caught, and a helpful error message is +printed. The error message points to the exact place where the error +occurred: + +---- + ./raddb/sites-enabled/default[230]: Parse error in condition + ERROR: if (User-Name ! "bob") { + ERROR: ^ Invalid operator +---- + +`update` sections are more generic. Instead of doing `update +reply`, you can do the following: + +.Example +[source,unlang] +---- +update { + reply:Class := 0x0000 + control:Cleartext-Password := "hello" +} +---- + +This change means that you need fewer `update` sections. + + +=== Comparisons + +Attribute comparisons can be done via the `&` operator. When you +needed to compare two attributes, the old comparison style was: + +.Example +[source,unlang] +---- +if (User-Name == "%{control:Tmp-String-0}") { +---- + +This syntax is inefficient, as the `Tmp-String-0` attribute would be +printed to an intermediate string, causing unnecessary work. You can +now instead compare the two attributes directly: + +.Example +[source,unlang] +---- +if (&User-Name == &control:Tmp-String-0) { +---- + +See `man unlang` for more details. + +=== Casts + +Casts are now permitted. This allows you to force type-specific +comparisons: + +.Example +[source,unlang] +---- +if ("%{sql: SELECT...}" == 127.0.0.1) { +---- + +This forces the string returned by the SELECT to be treated as an IP +address, and compare to `127.0.0.1`. Previously, the comparison +would have been done as a simple string comparison. + + +=== Networks + +IP networks are now supported: + + if (127.0.0.1/32 == 127.0.0.1) { + +Will be `true`. The various comparison operators can be used to +check IP network membership:: + +.Example +[source,unlang] +---- +if (127/8 > 127.0.0.1) { +---- + +Returns `true`, because `127.0.0.1` is within the `127/8` +network. However, the following comparison will return `false`:: + +.Example +[source,unlang] +---- +if (127/8 > 192.168.0.1) { +---- + +because `192.168.0.1` is outside of the `127/8` network. + + +=== Optimization + +As `unlang` is now pre-compiled, many compile-time optimizations are +done. This means that the debug output may not be exactly the same as +what is in the configuration files: + + if (0 && (User-Name == "bob')) { + +The result will always be `false`, as the `if 0` prevents the +following `&& ...` from being evaluated. + +Not only that, but the entire contents of that section will be ignored +entirely: + +.Example +[source,unlang] +---- +if (0) { + this_module_does_not_exist + and_this_one_does_not_exist_either +} +---- + +In v2, that configuration would result in a parse error, as there is +no module called `this_module_does_not_exist`. In v3, that text is +ignored. This ability allows you to have dynamic configurations where +certain parts are used (or not) depending on compile-time configuration. + +Similarly, conditions which always evaluate to `true` will be +optimized away: + + +.Example +[source,unlang] +---- +if (1) { + files +} +---- + +That configuration will never show the `if (1)` output in debugging mode. + +=== Dialup_admin + +The dialup_admin directory has been removed. No one stepped forward +to maintain it, and the code had not been changed in many years. + diff --git a/doc/antora/modules/unlang/.gitignore b/doc/antora/modules/unlang/.gitignore new file mode 100644 index 0000000..c5722d7 --- /dev/null +++ b/doc/antora/modules/unlang/.gitignore @@ -0,0 +1 @@ +!*.adoc diff --git a/doc/antora/modules/unlang/nav.adoc b/doc/antora/modules/unlang/nav.adoc new file mode 100644 index 0000000..77be328 --- /dev/null +++ b/doc/antora/modules/unlang/nav.adoc @@ -0,0 +1,51 @@ +* xref:index.adoc[Unlang Policy Language] + +** xref:list.adoc[Attribute Lists] +** xref:attr.adoc[Attribute References] +** xref:return_codes.adoc[Return Codes] + +** xref:keywords.adoc[Keywords] +*** xref:break.adoc[break] +*** xref:case.adoc[case] +*** xref:else.adoc[else] +*** xref:elsif.adoc[elsif] +*** xref:foreach.adoc[foreach] +*** xref:group.adoc[group] +*** xref:if.adoc[if] +*** xref:load-balance.adoc[load-balance] +*** xref:redundant-load-balance.adoc[redundant-load-balance] +*** xref:redundant.adoc[redundant] +*** xref:return.adoc[return] +*** xref:switch.adoc[switch] +*** xref:update.adoc[update] + +** xref:module.adoc[Modules] +*** xref:module_method.adoc[Module Methods] +*** xref:module_builtin.adoc[Built-in Modules] + +** xref:type/index.adoc[Data Types] +*** xref:type/index.adoc[List of Data Types] +*** xref:type/ip.adoc[IP Addresses] +*** xref:type/numb.adoc[Numbers] +*** xref:type/string/single.adoc[Single Quoted Strings] +*** xref:type/string/double.adoc[Double Quoted Strings] +*** xref:type/string/backticks.adoc[Backtick-quoted string] +*** xref:type/string/unquoted.adoc[Unquoted Strings] + +** xref:condition/index.adoc[Conditional Expressions] +*** xref:condition/cmp.adoc[Comparisons] +*** xref:condition/operands.adoc[Operands] +*** xref:condition/return_code.adoc[The Return Code Operator] +*** xref:condition/eq.adoc[The '==' Operator] +*** xref:condition/and.adoc[The '&&' Operator] +*** xref:condition/or.adoc[The '||' Operator] +*** xref:condition/not.adoc[The '!' Operator] +*** xref:condition/para.adoc[The '( )' Operator] +*** xref:condition/regex.adoc[Regular Expressions] + +** xref:xlat/index.adoc[String Expansion] +*** xref:xlat/alternation.adoc[Alternation Syntax] +*** xref:xlat/builtin.adoc[Built-in Expansions] +*** xref:xlat/character.adoc[Single Letter Expansions] +*** xref:xlat/attribute.adoc[Attribute References] +*** xref:xlat/module.adoc[Module References] diff --git a/doc/antora/modules/unlang/pages/attr.adoc b/doc/antora/modules/unlang/pages/attr.adoc new file mode 100644 index 0000000..70afce4 --- /dev/null +++ b/doc/antora/modules/unlang/pages/attr.adoc @@ -0,0 +1,77 @@ += &Attribute References + +.Syntax +[source,unlang] +---- +[&]Attribute-Name +---- + +The `&Attribute-Name` operator returns a reference to the named +attribute. + +When used as an existence check in a condition, the condition +evaluates to `true` if the attribute exists. Otherwise, the condition +evaluates to `false`. + +When used elsewhere, such as in xref:switch.adoc[switch], it returns +the value of the named attribute. + +.Examples +[source,unlang] +---- +&User-Name +&NAS-IP-Address +---- + +== Lists + +The attribute reference can also be qualified with a +xref:list.adoc[list] reference. When no list is given, the server +looks in the input packet list for the named attribute. + +.Examples + +[source,unlang] +---- +&request:User-Name +&reply:NAS-IP-Address +---- + +== Array References + +.Syntax +[source,unlang] +---- +&Attribute-Name[] +---- + +When an attribute appears multiple times in a list, this syntax allows +you to address the attributes as if they were array entries. The +`` value defines which attribute to address. The `[0]` value +refers to the first attributes, `[1]` refers to the second attribute, +etc. + +.Examples +[source,unlang] +---- +&EAP-Message[1] +&reply:NAS-IP-Address[2] +---- + +== Removing ambuguity from the configuration files + +The server does not use the `&` character to distinguish attribute names +from other strings. + +Without the `&`, it is more difficult to parse the configuration file +clearly. You could interpret a string as `hello-there` +either as a literal string "hello-there", or as a reference to an +attribute named `hello-there`. + +Adding the leading `&` character means that attribute references are +now easily distinguishable from literal strings. The use of the leading +`&` character is highly recommended. + + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/break.adoc b/doc/antora/modules/unlang/pages/break.adoc new file mode 100644 index 0000000..01783ea --- /dev/null +++ b/doc/antora/modules/unlang/pages/break.adoc @@ -0,0 +1,28 @@ += The break statement + +.Syntax +[source,unlang] +---- +break +---- + +The `break` statement is used to exit an enclosing +xref:foreach.adoc[foreach] loop. The `break` statement only be used +inside of a xref:foreach.adoc[foreach] loop. + +.Example +[source,unlang] +---- +foreach &Class { + if (&Foreach-Variable-0 == 0xabcdef) { + break + } + + update reply { + Reply-Message += "Contains %{Foreach-Variable-0}" + } +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/case.adoc b/doc/antora/modules/unlang/pages/case.adoc new file mode 100644 index 0000000..ba2b5fe --- /dev/null +++ b/doc/antora/modules/unlang/pages/case.adoc @@ -0,0 +1,44 @@ += The case Statement + +.Syntax +[source,unlang] +---- +case [ ] { + [ statements ] +} +---- + +The `case` statement is used to match data inside of a +xref:switch.adoc[switch] statement. The `case` statement cannot be used +outside of a xref:switch.adoc[switch] statement. + + +The `` text can be an attribute reference such as `&User-Name`, +or it can be a xref:type/string/index.adoc[string]. If the match +text is a dynamically expanded string, then the match is performed on +the output of the string expansion. + +If no `` text is given, it means that the `case` statement is +the "default" and will match all which is not matched by another +`case` statement inside of the same xref:switch.adoc[switch]. + +.Example +[source,unlang] +---- +switch &User-Name { + case "bob" { + reject + } + + case &Filter-Id { + reject + } + + case { + ok + } +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/and.adoc b/doc/antora/modules/unlang/pages/condition/and.adoc new file mode 100644 index 0000000..50b3deb --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/and.adoc @@ -0,0 +1,21 @@ += The && Operator + +.Syntax +[source,unlang] +---- +(condition-1 && condition-2) +---- + +The `&&` operator performs a short-circuit "and" evaluation of the +two conditions. This operator evaluates _condition-1_ and returns +`false` if _condition-1_ returns `false`. Only if _condition-1_ +returns `true` is _condition-2_ evaluated and its result returned. + +.Examples +[source,unlang] +---- +if (&User-Name && &EAP-Message) { ... +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/cmp.adoc b/doc/antora/modules/unlang/pages/condition/cmp.adoc new file mode 100644 index 0000000..4138b86 --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/cmp.adoc @@ -0,0 +1,104 @@ += Comparisons + +.Syntax +[source,unlang] +---- +lhs OP rhs +---- + +The most common use-case for conditions is to perform comparisons. +The `lhs` and `rhs` of a conditional comparison can be +xref:attr.adoc[&Attribute-Name] or xref:type/index.adoc[data]. The +the `OP` is an operator, commonly `==` or `\<=`. It is used to +control how the two other portions of the condition are compared. + +== The Comparison Operators + +The comparison operators are given below. + +[options="header"] +|===== +| Operator | Description +| < | less than +| \<= | less than or equals +| == | equals +| != | not equals +| >= | greater than or equals +| > | greater than +| xref:condition/regex.adoc[=~] | regular expression matches +| xref:condition/regex.adoc[!~] | regular expression does not match +|===== + +The comparison operators perform _type-specific_ comparisons. The +only exceptions are the xref:condition/regex.adoc[regular expression] operators, +which interpret the `lhs` as a printable string, and the `rhs` as a +regular expression. + +== IP Address Comparisons + +The type-specific comparisons operate as expected for most data types. +The only exception is data types that are IP addresses or IP address +prefixes. For those data types, the comparisons are done via the +following rules: + +* Any unqualified IP address is assumed to have a /32 prefix (IPv4) + or a /128 prefix (IPv6). + +* If the prefixes of the left and right sides are equal, then the comparisons + are performed on the IP address portion. + +* If the prefixes of the left and right sides are not equal, then the + comparisons are performed as _set membership checks_. + +The syntax allows conditions such as `192.0.2.1 < 192.0.2/24`. This +condition will return `true`, as the IP address `192.0.2.1' is within +the network `192.0.2/24`. + +== Casting + +In some situations, it is useful to force the left side to be +interpreted as a particular data type. + +[NOTE] +The data types used by the cast *must* be a type taken from the RADIUS +dictionaries, e.g., `ipaddr`, `integer`, etc. These types are not the +same as the xref:type/index.adoc[data types] used in the +configuration files. + +.Syntax +[source,unlang] +---- +lhs OP rhs +---- + +The `cast` text can be any one of the standard RADIUS dictionary data +types, as with the following example: + +.Example +[source,unlang] +---- +&Class == 127.0.0.1 +---- + +In this example, the `Class` attribute is treated as if it was an IPv4 +address and is compared to the address `127.0.0.1` + +Casting is most useful when the left side of a comparison is a +dynamically expanded string. The cast ensures that the comparison is +done in a type-safe manner, instead of performing a string comparison. + +.Example +[source,unlang] +---- +`/bin/echo 00` == 0 +---- + +In this example, the string output of the `echo` program is interpreted as an +integer. It is then compared to the right side via integer +comparisons. Since the integer `00` is equivalent to the integer `0`, +the comparison will match. If the comparison had been performed via +string equality checks, then the comparison would fail, because the +strings `00` and `0` are different. + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/eq.adoc b/doc/antora/modules/unlang/pages/condition/eq.adoc new file mode 100644 index 0000000..d9e51f3 --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/eq.adoc @@ -0,0 +1,30 @@ += The == Operator + +.Syntax +`(data-1 == data-2)` + +The `==` operator compares the result of evaluating `data-1` and +`data-2`. As discussed in xref:type/index.adoc[Data Types], the `data-1` +field may be interpreted as a reference to an attribute. + +The `data-2` field is interpreted in a type-specific manner. For +example, if `data-1` refers to an attribute of type `ipaddr`, then +`data-2` is evaluated as an IP address. If `data-1` refers to an +attribute of type `integer`, then `data-2` is evaluated as an integer +or as a named enumeration defined by a `VALUE` statement in a +dictionary. Similarly, if `data-1` refers to an attribute of type +`date`, then `data-2` will be interpreted as a date string. + +If the resulting data evaluates to be the same, then the operator +returns `true`; otherwise, it returns `false`. + +.Example +[source,unlang] +---- +if (User-Name == "bob") { + ... +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/index.adoc b/doc/antora/modules/unlang/pages/condition/index.adoc new file mode 100644 index 0000000..b9d9d5f --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/index.adoc @@ -0,0 +1,85 @@ += Conditional Expressions + +Conditions are evaluated when parsing xref:if.adoc[if] and +xref:elsif.adoc[elsif] statements. These conditions allow the server to +make complex decisions based on one of a number of possible criteria. + +.Syntax +[source,unlang] +---- +if ( condition ) { ... + +elsif ( condition ) { ... +---- + +Conditions are expressed using the following syntax: + +[options="header"] +|===== +| Syntax | Description +| xref:attr.adoc[&Attribute-Name] | Check for attribute existence. +| xref:condition/return_code.adoc[rcode] | Check return code of a previous module. +| xref:condition/operands.adoc[data] | Check value of data. +| xref:condition/cmp.adoc[lhs OP rhs] | Compare two kinds of data. +| xref:condition/para.adoc[( condition )] | Check sub-condition +| xref:condition/not.adoc[! condition] | Negate a conditional check +| xref:condition/and.adoc[( condition ) && ...] | Check a condition AND the next one +| xref:condition/or.adoc[( condition ) \|\| ...] | Check a condition OR the next one +|===== + + +.Examples +[source,unlang] +---- +if ( &User-Name == "bob" ) { + ... +} + +if ( &Framed-IP-Address == 127.0.0.1 ) { + ... +} + +if ( &Calling-Station-Id == "%{sql:SELECT ...}" ) { + ... +} +---- + +== Load-time Syntax Checks + +The server performs a number of checks when it loads the configuration +files. Unlike version 2, all of the conditions are syntax checked +when the server loads. This checking greatly aids in creating +configurations that are correct. Where the configuration is +incorrect, a descriptive error is produced. + +This error contains the filename and line number of the syntax error. +In addition, it will print out a portion of the line that caused the +error and will point to the exact character where the error was seen. +These descriptive messages mean that most errors are easy to find and fix. + +== Load-time Optimizations + +The server performs a number of optimizations when it loads the +configuration files. Conditions that have static values are +evaluated and replaced with the result of the conditional comparison. + +.Example +[source,unlang] +---- +if ( 0 == 1 ) { + ... +} +---- + +The condition `0 == 1` is static and will evaluate to `false`. Since +it evaluates to `false`, the configuration inside of the `if` +statement is ignored. Any modules referenced inside of the `if` +statement will not be loaded. + +This optimization is most useful for creating configurations that +selectively load (or not) certain policies. If the condition above +was used in version 2, then the configuration inside of the `if` statement +would be loaded, even though it would never be used. + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/not.adoc b/doc/antora/modules/unlang/pages/condition/not.adoc new file mode 100644 index 0000000..bde038e --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/not.adoc @@ -0,0 +1,19 @@ += The ! Operator + +.Syntax +[source,unlang] +---- +! condition +---- + +The `!` operator negates the result of the following condition. It +returns `true` when _condition_ returns `false`. It returns `false` +when _condition_ returns `true`. + +.Examples + +`(! (foo == bar))` + +`! &User-Name` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/operands.adoc b/doc/antora/modules/unlang/pages/condition/operands.adoc new file mode 100644 index 0000000..4a2d00b --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/operands.adoc @@ -0,0 +1,37 @@ += Operands + +.Syntax +[source,unlang] +---- +string +integer +"double-quoted string" +'single-quoted string' +`back-quoted string` +---- + +Any text not matching xref:attr.adoc[&Attribute-Name] or +xref:condition/return_code.adoc[Return Code] is interpreted as a value for a +particular xref:type/index.adoc[data type]. + +Double-quoted strings and back-quoted strings are dynamically expanded +before the condition is evaluated. Single-quoted strings are static +literals and are not dynamically expanded. + +When used as an existence check, the condition evaluates to `true` if +the data is non-zero. Otherwise, the condition evaluates to `false`. + +For integer existence checks, `0` is `false`; all other values are `true`. + +For string existence checks, an empty string is `false`. All other +strings are `true`. + +All other data types are disallowed in existence checks. + +.Examples + +`"hello there"` + +`5` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/or.adoc b/doc/antora/modules/unlang/pages/condition/or.adoc new file mode 100644 index 0000000..80c2cb4 --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/or.adoc @@ -0,0 +1,21 @@ += The || Operator + +.Syntax +[source,unlang] +---- +(expression-1 || expression-2) +---- + +The `||` operator performs a short-circuit "or" evaluation of the two +expressions. This operator evaluates _condition-1_ and returns `true` +if _condition-1_ returns true. Only if _condition-1_ returns `false` +is _condition-2_ evaluated and its result returned. + +.Examples +[source,unlang] +---- +if (&User-Name || &NAS-IP-Address) { ... +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/para.adoc b/doc/antora/modules/unlang/pages/condition/para.adoc new file mode 100644 index 0000000..bdb3f01 --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/para.adoc @@ -0,0 +1,19 @@ += The ( ) Operator + +.Syntax +[source,unlang] +---- +( condition ) +---- + +The `( )` operator returns the result of evaluating the given +`condition`. It is used to clarify policies or to explicitly define +conditional precedence. + +.Examples + +`(foo)` + +`(bar || (baz && dub))` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/regex.adoc b/doc/antora/modules/unlang/pages/condition/regex.adoc new file mode 100644 index 0000000..038faa6 --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/regex.adoc @@ -0,0 +1,180 @@ += Regular Expressions + +.Syntax +==== +[source,unlang] +---- +( =~ //) +( =~ //[imsux]) + +( !~ //) +( !~ //[imsux]) +---- +==== + +== Matching +The regular expression operators perform regular expression matching +on the data. The `` field can be an attribute reference or data, +as with the other xref:condition/cmp.adoc[comparison] operators. The `//` +field must be a valid regular expression. + +The `=~` operator evaluates to `true` when `data` matches the +`//`. Otherwise, it evaluates to `false`. + +The `!~` operator evaluates to `true` when `data` does not match the +`//`. Otherwise, it evaluates to `true`. + +The regular expression comparison is performed on the _string representation_ +of the left side of the comparison. That is, if the left side is an +xref:type/numb.adoc[integer], the regular expression will behave is if the +value `0` was the literal string `"0"`. Similarly, if the left side is an +xref:attr.adoc[&Attribute-Name], then the regular expression will behave is if +the attribute was printed to a string, and the match was performed on the +resulting string. + +.Checking if the `User-Name` attribute contains a realm of example.com +==== +[source,unlang] +---- +if (&User-Name =~ /@example\.com$/) { + ... +} +---- +==== + +== Dialects + +The syntax of the regular expression is defined by the regular +expression library available on the local system. + +FreeRADIUS currently supports: + +* link:https://www.pcre.org/original/doc/html/[libpcre] and +link:https://www.pcre.org/current/doc/html/[libpcre2] both of which +provide +link:https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions[Perl +Compatible Regular expressions]. +* Regex support provided by the local libc implementation, usually +link:http://en.wikipedia.org/wiki/Regular_expression#POSIX_basic_and_extended[ +Posix regular expressions]. + +[TIP] +==== +Use the output of `radiusd -Xxv` to determine which regular expression library is in use. + +.... +... +Debug : regex-pcre : no +Debug : regex-pcre2 : yes +Debug : regex-posix : no +Debug : regex-posix-extended : no +Debug : regex-binsafe : yes +... +Debug : pcre2 : 10.33 (2019-04-16) - retrieved at build time +.... +==== + +[WARNING] +==== +Depending on the regular expression library or libc implementation the server +was built against, the pattern matching function available may not be binary +safe (see `regex-binsafe` in the output of `radiusd -Xxv`). + +If a binary safe regex match function is not available, and a match is +attempted against a subject that contains one or more `NUL` ('\0') bytes, the +match will be aborted, any condition that uses the result will evaluate to false, +and a warning will be emitted. +==== + +== Flags + +The regular expression `//` may be followed by one or more flag +characters. Again, which flags are available depends on the regular expression +library the server was built with. Multiple flags may be specified per +`/pattern/`. + +.Flags and their uses + +[options="header"] +|===== +| Flag Character | Available with | Effect +| `i` | All | Enable case-insensitive matching. +| `m` | All | '^' and '$' match newlines within the subject. +| `s` | libpcre[2] | '.' matches anything, including newlines. +| `u` | libpcre[2] | Treats subjects as UTF8. Invalid UTF8 + sequences will result in the match failing. + |`x` | libpcre[2] | Allows comments in expressions by ignoring + whitespace, and text between '#' and the next + newline character. +|===== + +== Subcapture groups + +When the `=~` or `!~` operators are used, then parentheses in the regular +expression will sub capture groups, which contain part of the subject string. + +The special expansion `%{0}` expands to the portion of the subject that +matched. The expansions + +`%{1}`..`%{32}` expand to the contents of any subcapture groups. + +When using libpcre[2], named capture groups may also be accessed using the +built-in expansion + +`%{regex:}`. + +Please see the xref:xlat/builtin.adoc#_0_32[xlat documentation] for +more information on regular expression matching. + +.Extracting the 'user' portion of a realm qualified string +==== +[source,unlang] +---- +if (&User-Name =~ /^(.*)@example\.com$/) { + update reply { + Reply-Message := "Hello %{1}" + } +} +---- +==== + +== Pre-Compiled vs Runtime Compiled + +When the server starts any regular expressions comparisons it finds will be +pre-compiled, and if support is available, JIT'd (converted to machine code) +to ensure fast execution. + +If a pattern contains a xref:xlat/index.adoc[string expansion], the pattern +cannot be compiled on startup, and will be compiled at runtime each time the +expression is evaluated. The server will also turn off JITing for runtime +compiled expressions, as the overhead is greater than the time that would be +saved during evaluation. + +.A runtime compiled regular expression +==== +[source,unlang] +---- +if (&User-Name =~ /^@%{Tmp-String-0}$/) { + ... +} +---- +==== + +To ensure optimal performance you should limit the number of patterns +containing xref:xlat/index.adoc[string expansions], and if using PCRE, combine +multiple expressions operating on the same subject into a single expression +using the PCRE alternation '|' operator. + +.Using multiple string expansions and the PCRE alternation operator +==== +[source,unlang] +---- +if (&User-Name =~ /^@(%{Tmp-String-0}|%{Tmp-String-1})$/) { + ... +} +---- +==== + + +// Licenced under CC-by-NC 4.0. +// Copyright (C) 2020 Network RADIUS SAS. +// Copyright (C) 2019 Arran Cudbard-Bell +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/condition/return_codes.adoc b/doc/antora/modules/unlang/pages/condition/return_codes.adoc new file mode 100644 index 0000000..ebc49ed --- /dev/null +++ b/doc/antora/modules/unlang/pages/condition/return_codes.adoc @@ -0,0 +1,35 @@ += The return code Operator + +.Syntax +[source,unlang] +---- +rcode +---- + +The Unlang interpreter tracks the return code of any module, string expansion +or keyword that has been called. + +This return code can be checked in any condition. If the saved return code +matches the `code` given here, then the condition evaluates to `true`. +Otherwise, it evaluates to `false`. + +rcodes cannot be set in a condition. rcodes cannot be compared with anything else. + +The list of valid return codes is as follows: + +.Return Codes + +include::partial$rcode_table.adoc[] + +.Examples + +[source,unlang] +---- +sql +if (notfound) { + ... +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/default.adoc b/doc/antora/modules/unlang/pages/default.adoc new file mode 100644 index 0000000..3b298f6 --- /dev/null +++ b/doc/antora/modules/unlang/pages/default.adoc @@ -0,0 +1,47 @@ += The case Statement + +.Syntax +[source,unlang] +---- +case [ ] { + [ statements ] +} +---- + +The `case` statement is used to match data inside of a +xref:switch.adoc[switch] statement. The `case` statement cannot be used +outside of a xref:switch.adoc[switch] statement. + + +The `` text can be an attribute reference such as `&User-Name`, +or it can be a xref:type/string/index.adoc[string]. If the match +text is a dynamically expanded string, then the match is performed on +the output of the string expansion. + +The keyword `default` can be used to specify the default action to +take inside of a xref:switch.adoc[switch] statement. + +If no `` text is given, it means that the `case` statement is +the "default" and will match all which is not matched by another +`case` statement inside of the same xref:switch.adoc[switch]. + +.Example +[source,unlang] +---- +switch &User-Name { + case "bob" { + reject + } + + case &Filter-Id { + reject + } + + default { + ok + } +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/else.adoc b/doc/antora/modules/unlang/pages/else.adoc new file mode 100644 index 0000000..a795d0e --- /dev/null +++ b/doc/antora/modules/unlang/pages/else.adoc @@ -0,0 +1,30 @@ += The else Statement + +.Syntax +[source,unlang] +---- +if (condition) { + [ statements ] +} +else { + [ statements ] +} +---- + +An xref:if.adoc[if] statement can have an `else` clause. If _condition_ +evaluates to `false`, the statements in the xref:if.adoc[if] subsection are skipped +and the statements within the `else` subsection are executed. + +.Example +[source,unlang] +---- +if (&User-Name == "bob") { + reject +} +else { + ok +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/elsif.adoc b/doc/antora/modules/unlang/pages/elsif.adoc new file mode 100644 index 0000000..ff5799c --- /dev/null +++ b/doc/antora/modules/unlang/pages/elsif.adoc @@ -0,0 +1,43 @@ += The elsif Statement + +.Syntax +[source,unlang] +---- +if (condition-1) { + [ statements-1 ] +} +elsif (condition-2) { + [ statements-2 ] +} +else { + [ statements-3 ] +} +---- + +An `elsif` statement is used to evaluate a subsequent +xref:condition/index.adoc[condition] after a preceding xref:if.adoc[if] statement +evaluates to `false`. In the example above, when _condition-1_ +evaluates to false, then _statements-1_ are skipped and _condition-2_ +is checked. When _condition-2_ evaluates true, then _statements-2_ +are executed. When _condition-2_ evaluates false, then +_statements-2_ are skipped and _statements-3_ are executed. + +As with xref:if.adoc[if], an `elsif` clause does not need to be followed by +an xref:else.adoc[else] statement. However, any xref:else.adoc[else] statement +must be the last statement in an `elsif` chain. An arbitrary number of +`elsif` statements can be chained together to create a series of +conditional checks and statements. + +.Example +[source,unlang] +---- +if (&User-Name == "bob") { + reject +} +elsif (&User-Name == "doug") { + ok +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/foreach.adoc b/doc/antora/modules/unlang/pages/foreach.adoc new file mode 100644 index 0000000..6ed3ddf --- /dev/null +++ b/doc/antora/modules/unlang/pages/foreach.adoc @@ -0,0 +1,40 @@ += The foreach Statement + +.Syntax +[source,unlang] +---- +foreach { + [ statements ] +} +---- + +The `foreach` statement loops over a set of attributes as given by +``. The loop can be exited early by using the +xref:break.adoc[break] keyword. + +:: + +The xref:attr.adoc[attribute reference] which will will be looped +over. The reference can be to one attribute, to an array, a child, or +be a subset. + +Inside of the `foreach` block, the attribute that is being looped over +can be referenced as `Foreach-Variable-0`, through +`Foreach-Variable-9`. The last digit is the depth of the loop, +starting at "0". The loops can be nested up to eight (8) deep, though +this is not recommended. + +The attributes being looped over cannot be modified or deleted. + +.Example +[source,unlang] +---- +foreach &Class { + update reply { + Reply-Message += "Contains %{Foreach-Variable-0}" + } +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/group.adoc b/doc/antora/modules/unlang/pages/group.adoc new file mode 100644 index 0000000..98801fd --- /dev/null +++ b/doc/antora/modules/unlang/pages/group.adoc @@ -0,0 +1,39 @@ += The group Statement + +.Syntax +[source,unlang] +---- +group { + [ statements ] +} +---- + +The `group` statement collects a series of statements into a list. +The default processing sections of the server (`authorize`, +`accounting`, etc.) are also `group` statements. Those sections are +given different name for management reasons, but they behave +internally exactly like a `group`. + +[ statements ]:: The `unlang` commands which will be executed. + +All of the statements inside of the `group` are executed in sequence. +The `group` statement is not normally used, as the statements within +it can just be placed inside of the enclosing section. However, the +`group` statement is included in the `unlang` syntax for completeness. + +.Examples + +[source,unlang] +---- +group { + sql + ldap + file + if (updated) { + ... + } +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/if.adoc b/doc/antora/modules/unlang/pages/if.adoc new file mode 100644 index 0000000..ea549ef --- /dev/null +++ b/doc/antora/modules/unlang/pages/if.adoc @@ -0,0 +1,29 @@ += The if Statement + +.Syntax +[source,unlang] +---- +if (condition) { + [ statements ] +} +---- + +.Description +The `if` statement evaluates a xref:condition/index.adoc[condition]. When the +_condition_ evaluates to `true`, the statements within the subsection +are executed. When the _condition_ evaluates to `false`, those +statements are skipped. + +An `if` statement can optionally be followed by an xref:else.adoc[else] or +an xref:elsif.adoc[elsif] statement. + +.Example +[source,unlang] +---- +if (&User-Name == "bob") { + reject +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/index.adoc b/doc/antora/modules/unlang/pages/index.adoc new file mode 100644 index 0000000..fc812f8 --- /dev/null +++ b/doc/antora/modules/unlang/pages/index.adoc @@ -0,0 +1,162 @@ += Unlang Policy Language + +The server supports a simple processing language called "Unlang", +which is short for "un-language". The original intention of using an +"un-language" was to avoid creating yet another programming language. +Instead, the `unlang` syntax allows for simple _if / then / else_ +checks, and attribute editing. It does not support recursion, +subroutines, or more complex flow controls. + +Where more complicated functionality is required, we recommend using +the `lua`, `perl` or `python` modules. Those modules allow the insertion of +full-featured scripts at any point in the packet processing. + +NOTE: The documentation is this directory is _reference_ +documentation. That is, it describes the syntax of `unlang` keywords, +using minimal examples. The reference documentation does not, +however, describe _when_ to use the keywords, or _how_ to create +policies. Please see the xref:howto:index.adoc[howto] directory for +more in-depth "how to" guides. + +The documentation is organized so that each item is on its own page. +The page beings with a description of the item, followed by some text +explaining what the item does. The page concludes with one or more +examples of using the item in `unlang` policies. + +The `unlang` processing can be split into some high-level concepts. + +== Keywords + +xref:keywords.adoc[Keywords], which are the basic statements of the +language, e.g., xref:load-balance.adoc[load-balance], +xref:if.adoc[if], xref:else.adoc[else], etc. + +.Example +[source,unlang] +---- +load-balance { + sql1 + sql2 + sql3 +} +---- + +== Conditional Expressions + +xref:condition/index.adoc[Conditional expressions], which are used to check +if conditions evaluate to _true_ or _false_. Conditional expressions +can be used to control the flow of processing. + +.Example +[source,unlang] +---- +if ((&User-Name == "bob") && (&Calling-Station-Id == "00:01:03:04:05")) { + ... +} +---- + +== Update Statements + +xref:update.adoc[update] statements are used to edit attributes and +lists of attributes. + +Most request packets will result in reply packets that contain +additional information for the requestor. The `update` section allows +policies to add attributes to requests, replies, or to other places. + +.Example +[source,unlang] +---- +update reply { + &Session-Timeout := 3600 + &Framed-IP-Address := 192.0.2.4 +} +---- + +== String Expansions + +xref:xlat/index.adoc[String expansion] Using `%{...}` to perform dynamic +string expansions. (also known as xref:xlat/index.adoc[xlat]) + +String expansions are usually performed in order to get additional +information which is not immediately available to the policy. This +information can be taken from almost any source, including other +attributes, databases, and scripts. + +.Example +[source,unlang] +---- +update reply { + &Framed-IP-Address := "%{sql:SELECT static_ip from table WHERE user = '%{User-Name}'}" +} +---- + +== Data Types + +Each attribute used by the server has an associated +xref:type/index.adoc[data type]. The `unlang` interpreter enforces +restrictions on assignments, so that only valid data types can be +assigned to an attribute. Invalid assignments result in a run-time +error. + +.Example +[source,unlang] +---- +update reply { + &Framed-IP-Address := 192.0.2.4 + &Session-Timeout := 5 + &Reply-Message := "hello" +} +---- + +== Design Goals of Unlang + +The goal of `unlang` is to allow simple policies to be written with +minimal effort. Conditional checks can be performed by the policies, +which can then update the request or response attributes based on the +results of those checks. `unlang` can only be used in a processing +section, it cannot be used anywhere else, including in configuration +sections for a client or a module. The reason for this limitation is +that the language is intended to perform specific actions on requests +and responses. The client and module sections contain definitions for +a client or module; they do not define how a request is processed. + +`unlang` uses the same the basic syntax as the configuration files. +The syntax of the configuration file for lines, comments, sections, +sub-section, etc., all apply to `unlang`. + +Where `unlang` differs from the basic configuration file format is in +complexity and operation. The normal configuration files are +_declarative_ and they are _static_. That is, they declare variables +and values for those variables. Those values do not change when the +server is running. + +In contrast, `unlang` performs run-time processing of requests. +Conditional statements such as xref:if.adoc[if] are evaluated for every +packet that is received. Attribute editing statements such as +xref:update.adoc[update] can be used to edit attribute contents or lists +of attributes. + +.Example +[source,unlang] +---- +# First, the keyword 'if' + +# followed by condition which checks that the User-Name +# attribute has value "bob" + +if (&User-Name == "bob") { + # keyword "update" + + # followed by instructions to add the Reply-Message + # attribute to the "reply" list, with contents + # "Hello, bob" + + update reply { + Reply-Message := "Hello, bob" + } +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/keywords.adoc b/doc/antora/modules/unlang/pages/keywords.adoc new file mode 100644 index 0000000..e6411ea --- /dev/null +++ b/doc/antora/modules/unlang/pages/keywords.adoc @@ -0,0 +1,78 @@ += Keywords + +The following tables list the keywords used in `Unlang`. These keywords +implement the "flow control" of the policies. + +== Flow Control Keywords + +The _flow control_ keywords allow _if / then / else_ checks, simple +looping, etc. + +.Flow Control +[options="header"] +[cols="30%,70%"] +|===== +| Keyword | Description +| xref:break.adoc[break] | Exit early from a `foreach` loop. +| xref:case.adoc[case] | Match inside of a `switch`. +| xref:else.adoc[else] | Do something when an `if` does not match. +| xref:elsif.adoc[elsif] | Check for condition when a previous `if` does not match. +| xref:foreach.adoc[foreach] | Loop over a list of attributes. +| xref:if.adoc[if] | Check for a condition, and execute a sub-policy if it matches. +| xref:return.adoc[return] | Immediately stop processing a section. +| xref:switch.adoc[switch] | Check for multiple values. +|===== + +== Attribute Editing Keywords + +The _attribute editing_ keywords allow policies to add, delete, and +modify attributes in any list or packet. + +.Attribute Editing +[options="header"] +[cols="30%,70%"] +|===== +| Keyword | Description +| xref:update.adoc[update] | Add or filter attributes to a list +|===== + +== Grouping Keywords + +The _grouping_ keywords allow policies to be organized into groups, +including load-balancing. + +.Grouping +[options="header"] +[cols="30%,70%"] +|===== +| Keyword | Description +| xref:group.adoc[group] | Group a series of statements. +| xref:load-balance.adoc[load-balance] | Define a load balancing group without fail-over. +| xref:redundant.adoc[redundant] | Define a redundant group with fail-over. +| xref:redundant-load-balance.adoc[redundant-load-balance] | Define a redundant group with fail-over and load balancing. +|===== + +== Module Keywords + +The _module_ keywords refer pre-packaged libraries that implement +specific functionality, such as connecting to SQL, LDAP, etc. The +name used here is not the literal string `module`. Instead, it is the +name of an instance of a pre-packaged module such as `sql`, or `ldap`, or +`eap`. + +The documentation below describes how to reference modules. That is, +how to use `sql`, etc. in the policies. Please see +`raddb/mods-available/` for configuration examples for each module. + +.Modules +[options="header"] +[cols="30%,70%"] +|===== +| Keyword | Description +| xref:module.adoc[] | Execute a named module, e.g., `sql`. +| xref:module_method.adoc[.] | Execute a particular method of a named module, e.g., `pap.authorize` +| xref:module_builtin.adoc[reject] | Built-in modules, e.g., `reject`, or `ok`, etc. +|===== + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/list.adoc b/doc/antora/modules/unlang/pages/list.adoc new file mode 100644 index 0000000..a55a54f --- /dev/null +++ b/doc/antora/modules/unlang/pages/list.adoc @@ -0,0 +1,72 @@ += Attribute Lists + +An attribute list contains a set of attributes. The allowed lists +are: + +`request`:: Attributes in the incoming request packet. + +`reply`:: Attributes in the outgoing reply packet. + +`control`:: Attributes in the internal "control" list that is +associated with the request. ++ +The `control` attributes are used to manage how the request is +processed. These attributes are never sent in any packet. + +`session-state`:: Attributes which are maintained across multi-packet +exchanges. + +`proxy-request`:: Attributes in the proxied request packet to a home server. + +`proxy-reply`:: Attributes in the reply packet from the home server. + +`coa`:: Attributes in a CoA-Request packet which is sent to a home server. + +`disconnect`:: Attributes in a Disconnect-Request packet which is sent to a home server. + +There must be a colon `:` after the list name and before the attribute name. +This syntax helps the server to distinguish between list names and attribute +names. + +With the exception of `session-state`, all of the above lists are +ephemeral. That is, they exist for one packet exchange, and only one +packet exchange. When a reply is sent for a request, the above lists +and all attributes are deleted. There is no way to reference an +attribute from a previous packet. We recommend using a database to +track complex state. + +The `coa` and `disconnect` lists can only be used when the server +receives an Access-Request or Accounting-Request. Use `request` and +`reply` instead of `coa` when the server receives a CoA-Request or +Disconnect-Request packet. + +Adding one or more attributes to either of the `coa` or `disconnect` +list causes server to originate a CoA-Request or Disconnect-Request +packet. That packet is sent when the current Access-Request or +Accounting-Request has been finished, and a reply sent to the NAS. +See `raddb/sites-available/originate-coa` for additional information. + +In some cases, requests are associated a multi-packet exchange. For +those situations, the `session-state` list is automatically saved when +a reply is sent, and it is automatically restored when the next packet +in sequence comes in. Once the packet exchange has been finished, the +`session-state` list is deleted. + +In some cases, there is a parent-child relationship between requests. +In those situations, it is possible for the policy rules in the child +to refer to attributes in the parent. This reference can be made by +prefixing the __ name with the `parent` qualifier. The key word +`outer` is also a synonym for `parent`. If there are multiple +parent-child relationships, the `parent` qualifier can be repeated. + +There is, however, no way for the parent to refer to the child. When +the child is running, the parent is suspended. Once the child +finishes, it is deleted, and is no longer accessible to the parent. + +.Examples +`&parent.request.User-Name` + +`&parent.reply.Reply-Message` + +`&parent.parent.session-state.Filter-Id` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/load-balance.adoc b/doc/antora/modules/unlang/pages/load-balance.adoc new file mode 100644 index 0000000..d64b161 --- /dev/null +++ b/doc/antora/modules/unlang/pages/load-balance.adoc @@ -0,0 +1,32 @@ += The load-balance Statement + +.Syntax +[source,unlang] +---- +load-balance { + [ statements ] +} +---- + +The `load-balance` section is similar to the `redundant` section +except that only one module in the subsection is ever called. + +In general, the +xref:redundant-load-balance.adoc[redundant-load-balance] statement is +more useful than this one. + +[ statements ]:: One or more `unlang` commands. Only one of the +statements is executed. + +.Examples + +[source,unlang] +---- +load-balance &User-Name { + sql1 + sql2 +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/module.adoc b/doc/antora/modules/unlang/pages/module.adoc new file mode 100644 index 0000000..fd18f2f --- /dev/null +++ b/doc/antora/modules/unlang/pages/module.adoc @@ -0,0 +1,86 @@ += Modules + +.Syntax +[source,unlang] +---- + +---- + +The `` statement is a reference to the named module. Common +module names include `pap`, `chap`, `files`, `eap`, and `sql`. The +`modules { ... }` subsection of `radiusd.conf` contains all of the +valid modules. + +When processing reaches a named module, the pre-compiled module is +called. The module may succeed or fail and will return a status code +to the `unlang` interpreter detailing success or failure. + +.Example +[source,unlang] +---- +chap +sql +---- + +== Module Return Codes + +When a module is called, it returns one of the following codes to +the interpreter; the meaning of each code is detailed to the right of +the source, below: + +.Module Return Codes + +The below table describes the purpose of the rcodes that may be returned +by a module call. In this case the 'operation' referenced in the table is +the current module call. + +include::partial$rcode_table.adoc[] + +These return codes can be used in a subsequent +xref:condition/index.adoc[conditional expression] thus allowing policies to +perform different actions based on the behaviour of the modules. + +.Example +[source,unlang] +---- +sql +if (notfound) { + update reply { + Reply-Message = "We don't know who you are" + } + reject +} +---- + +== Module Return Code priority overrides + +In the case of modules, rcodes can be modified on a per-call basis. + +Module priority overrides are specified in a block inline with the module call. +The format of an override is ` = (0+||return)` - That is, +a number greater than or equal to 0, the priority of another rcode, or the special +priority `return` which causes the current section to immediately exit. + +[source, unlang] +---- +ldap { <1> + fail = 1 <2> + ok = handled <3> + reject = return <4> +} +---- + +<1> Call to the `ldap` module. +<2> Sets the priority of the `fail` rcode to be `1`. If the priority + of the rcode for the request is `0`, then the request request rcode + will be set to `fail` if the module returns `fail`. +<3> Sets the priority of the `ok` rcode to be whatever the default is for + `handled` in this section. As the default for `handled` is usually + `return`. If `ok` is returned, the current section will immediately + exit. +<4> Sets the priority of `reject` to be `return`. If the module returns + `reject`, the current section will immediately exit. + + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/module_builtin.adoc b/doc/antora/modules/unlang/pages/module_builtin.adoc new file mode 100644 index 0000000..f21a128 --- /dev/null +++ b/doc/antora/modules/unlang/pages/module_builtin.adoc @@ -0,0 +1,42 @@ += Built-in Modules + +In some cases, it is useful to reject a request immediately or perform another +action on it. The built-in modules can be used to perform these actions. These +modules are named for the return codes given in the xref:module.adoc[module] +section. + +In practice, these modules are implemented by the `always` module and +exist so that a success or failure can be forced during the processing +of a policy. + +The names and behaviours of these modules are given below: + +`fail`:: +Causes the request to be treated as if a database failure had +occurred. + +`noop`:: +Do nothing. This also serves as an instruction to the +configurable failover tracking that nothing was done in the current +section. + +`ok`:: +Instructs the server that the request was processed properly. This keyword can be used to over-ride earlier failures if the local +administrator determines that the failures are not catastrophic. + +`reject`:: +Causes the request to be immediately rejected. + +.Example +[source,unlang] +---- +if (!&User-Name) { + update reply { + Reply-Message := "We don't know who you are" + } + reject +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/module_method.adoc b/doc/antora/modules/unlang/pages/module_method.adoc new file mode 100644 index 0000000..98cd375 --- /dev/null +++ b/doc/antora/modules/unlang/pages/module_method.adoc @@ -0,0 +1,27 @@ += Module methods + +.Syntax +[source,unlang] +---- +. +---- + +This variant of xref:module.adoc[] is used in one processing +section. It calls a module using the method of another processing +section. For example, it can be used to call a module's `authorize` +method while processing the `post-auth` section. + +The `` portion must refer to an existing module; the +`` portion must refer to processing method supported by that +module. Typically, the names of the processing method will be the +same as the processing sections. + +.Example +[source,unlang] +---- +sql.recv.Accounting-Request +files.recv.Access-Request +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/redundant-load-balance.adoc b/doc/antora/modules/unlang/pages/redundant-load-balance.adoc new file mode 100644 index 0000000..2322f72 --- /dev/null +++ b/doc/antora/modules/unlang/pages/redundant-load-balance.adoc @@ -0,0 +1,39 @@ += The redundant-load-balance Statement + +.Syntax +[source,unlang] +---- +redundant-load-balance { + [ statements ] +} +---- + +The `redundant-load-balance` section operates as a combination of the +xref:redundant.adoc[redundant] and xref:load-balance.adoc[load-balance] +sections. + +[ statements ]:: One or more `unlang` commands. ++ +If the selected statement succeeds, then the server stops processing +the `redundant-load-balance` section. If, however, that statement fails, +then the next statement in the list is chosen (wrapping around to the +top). This process continues until either one statement succeeds or all +of the statements have failed. ++ +All of the statements in the list should be modules, and of the same +type (e.g., `ldap` or `sql`). All of the statements in the list should +behave identically, otherwise different requests will be processed +through different modules and will give different results. + +.Example +[source,unlang] +---- +redundant-load-balance &User-Name { + sql1 + sql2 + sql3 +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/redundant.adoc b/doc/antora/modules/unlang/pages/redundant.adoc new file mode 100644 index 0000000..e837d1f --- /dev/null +++ b/doc/antora/modules/unlang/pages/redundant.adoc @@ -0,0 +1,42 @@ += The redundant Statement + +.Syntax +[source,unlang] +---- +redundant { + [ statements ] +} +---- + +The `redundant` section executes a series of statements in sequence. +As soon as one statement succeeds, the rest of the section is skipped. + +[ statements ]:: One or more `unlang` commands. Processing starts +from the first statement in the list. ++ +If the selected statement succeeds, then the server stops processing +the `redundant` section. If, however, that statement fails, then the +next statement in the list is chosen. This process continues until +either one statement succeeds or all of the statements have failed. ++ +All of the statements in the list should be modules, and of the same +type (e.g., `ldap` or `sql`). All of the statements in the list should +behave identically, otherwise different requests will be processed +through different modules and will give different results. + +In general, we recommend using the +xref:redundant-load-balance.adoc[redundant-load-balance] statement +instead of `redundant`. + +.Example +[source,unlang] +---- +redundant { + sql1 + sql2 + sql3 +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/return.adoc b/doc/antora/modules/unlang/pages/return.adoc new file mode 100644 index 0000000..aea1bc2 --- /dev/null +++ b/doc/antora/modules/unlang/pages/return.adoc @@ -0,0 +1,36 @@ += The return Statement + +.Syntax +[source,unlang] +---- +return +---- + +The `return` statement is used to exit a processing section such as +`authorize`. It behaves similarly to the +xref:break.adoc[break] statement, except that it is not limited to +being used inside of a xref:foreach.adoc[foreach] loop. + +The `return` statement is not strictly necessary. It is mainly used +to simplify the layout of `unlang` policies. If the `return` +statement did not exist, then every xref:if.adoc[if] statement might need +to have a matching xref:else.adoc[else] statement. + +The `return` statement will also exit a policy which is defined in the +`policy { ... } ` subsection. This behavior allows policies to be +treated as a function call. Any `return` inside of the policy section +will only return from that policy. The `return` will _not_ return +from the enclosing processing section which called the policy. + +.Example +[source,unlang] +---- +sql +if (&reply.Filter-Id == "hello") { + return +} +... +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/return_codes.adoc b/doc/antora/modules/unlang/pages/return_codes.adoc new file mode 100644 index 0000000..3b09c2d --- /dev/null +++ b/doc/antora/modules/unlang/pages/return_codes.adoc @@ -0,0 +1,17 @@ += Return codes + +Many operations in the server produce a return code (rcode). +The different rcodes give a course indication of whether a particular operation +(a module call, string expansion, or keyword) was successful. + +Unlike return values in other languages, FreeRADIUS' rcodes are are always taken +from a fixed compiled-in set. + +include::partial$rcode_table.adoc[] + +Return codes propagate through nested unlang sections based on their priority. +If a rcode returned by an operation has a higher priority than the current rcode +associated with the request, then the request rcode is overwritten. + +Return code priorities are assigned by the section the module call, expansion or +keyword was used in. diff --git a/doc/antora/modules/unlang/pages/switch.adoc b/doc/antora/modules/unlang/pages/switch.adoc new file mode 100644 index 0000000..deff703 --- /dev/null +++ b/doc/antora/modules/unlang/pages/switch.adoc @@ -0,0 +1,83 @@ += The switch Statement + +.Syntax +[source,unlang] +---- +switch { + case { + [ statements-1 ] + } + case { + [ statements-2 ] + } + case { + [ statements-3 ] + } +} +---- + +A `switch` statement causes the server to evaluate _expansion_, which +can be an xref:attr.adoc[&Attribute-Name] or +xref:condition/operands.adoc[data]. The result is compared against _match-1_ +and _match-2_ to find a match. If no string matches, then the server +looks for the default xref:case.adoc[case] statement, which has no +associated match. + +The matching is done via equality. The `switch` statement is mostly +syntactic sugar and is used to simplify the visual form of the +configuration. It is mostly equivalent to the following use of +xref:if.adoc[if] statements: + +.Nearly equivalent syntax +[source,unlang] +---- +if ( == ) { + [ statements-1 ] +} +elsif ( == ) { + [ statements-2 ] +} +else { + [ statements-3 ] +} +---- + +The only difference between the two forms is that for a `switch` +statement, the _expansion_ is evaluated only once. For the equivalent +xref:if.adoc[if] statement, the _expansion_ is evaluated again for every +xref:if.adoc[if]. + +If a matching xref:case.adoc[case] is found, the statements within +that xref:case.adoc[case] are evaluated. If no matching +xref:case.adoc[case] is found, the `case` section with no "match" is +evaluated. If there is no such `case { ...}` subsection, then the +`switch` statement behaves as if the `case {...}` section was empty. + +//// +For compatibility with version 3, and empty `case` statement can also +be used instead of `default`. +//// + +The _match_ text for the xref:case.adoc[case] statement can be an +xref:attr.adoc[&Attribute-Name] or xref:type/index.adoc[data]. + +No statement other than xref:case.adoc[case] can appear in a `switch` +statement, and the xref:case.adoc[case] statement cannot appear outside of a +`switch` statement. + +.Example +[source,unlang] +---- +switch &User-Name { + case "bob" { + reject + } + + case { + ok + } +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/all_types.adoc b/doc/antora/modules/unlang/pages/type/all_types.adoc new file mode 100644 index 0000000..0bace01 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/all_types.adoc @@ -0,0 +1,80 @@ += List of Data Types + +The server support a wide range of data types, both in `unlang` and in +the dictionaries. This page outlines the names and functionality of +those data types. + +== Basic Data Types + +There are a number of "basic" data types. These data types are +fixed-size, and encapsulate simple concepts such as "integer" or "IP +address". + +Basic data types can be used in `unlang`, as they contain simple +values which can be compared, or assigned to one attribute. In most +cases, it is not necessary to know the name of the data type. It is +possible to write values in the format you expect, The server will do +"the right thing" when interpreting the values. + +.Basic Data Types +[options="header"] +[cols="15%,85%"] +|===== +| Data Type | Description +| bool | boolean +| date | calendar date +| ethernet | Ethernet address +| float32 | 32-bit floating point number +| float64 | 64-bit floating point number +| ifid | interface ID +| int8 | 8-bit signed integer +| int16 | 16-bit signed integer +| int32 | 32-bit signed integer +| int64 | 64-bit signed integer +| ipaddr | IPv4 address +| ipv6addr | IPv6 address +| ipv4prefix | IPv4 network with address and prefix length +| ipv6prefix | IPv6 network with address and prefix length +| octets | raw binary, printed as hex strings +| string | printable strings +| time_delta | difference between two calendar dates +| uint8 | 8-bit unsigned integer +| uint16 | 16-bit unsigned integer +| uint32 | 32-bit unsigned integer +| uint64 | 64-bit unsigned integer +|===== + +=== Structural Data Types + +The following data types are "structural", in that they form +parent-child relationships between attributes. These data types can +only be used in the dictionaries. They cannot be used in `unlang` +statements. + +.Structural Data Types +[options="header"] +[cols="15%,85%"] +|===== +| Data Type | Description +| struct | structure which contains fixed-width fields +| tlv | type-length-value which contains other attributes +| vsa | Encapsulation of vendor-specific attributes +|===== + +=== Protocol-Specific Data Types + +The following data types are used only in certain protocols. These +data types can be used only in the dictionaries. They cannot be used +in `unlang` statements. + +.Protocol Specific Data Types +[options="header"] +[cols="15%,15%,70%"] +|===== +| Data Type | Protocol | Description +| abinary | RADIUS | Ascend binary filters +| extended | RADIUS | attributes which "extend" the number space +|===== + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS diff --git a/doc/antora/modules/unlang/pages/type/double.adoc b/doc/antora/modules/unlang/pages/type/double.adoc new file mode 100644 index 0000000..6c3e708 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/double.adoc @@ -0,0 +1,39 @@ += Double-Quoted Strings + +.Syntax +`"string"` + +A double-quoted string is interpreted via the usual rules in +programming languages for double quoted strings. The double-quote +character can be placed in a string by escaping it with a backslash. +Carriage returns and line-feeds can also be used via the usual `\r` and +`\n` syntax. + +The main difference between the single and double quoted strings is +that the double quoted strings can be dynamically expanded. The syntax +`${...}` is used for parse-time expansion and `%{...}` is used for +run-time expansion. The difference between the two methods is that the +`${...}` form is expanded when the server loads the configuration +files and is valid anywhere in the configuration files. The `%{...}` +link:xlat.adoc[string expansion] form is valid only in conditional +expressions and attribute assignments. + +The output of the dynamic expansion can be interpreted as a string, +a number, or an IP address, depending on its context. + +Note that the interpretation of text _strongly_ depends on the +context. The text `"0000"` can be interpreted as a data type +"integer", having value zero, or a data type "string", having value +`"0000"`. In general when a particular piece of text is used, it is +used with the context of a known attribute. That attribute has a +link:data.adoc[data type], and the text will be interpreted as that +data type. + +.Examples + +`"word"` + +`"a string"` + +`"this has embedded\ncharacters"` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/index.adoc b/doc/antora/modules/unlang/pages/type/index.adoc new file mode 100644 index 0000000..7d0d70f --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/index.adoc @@ -0,0 +1,117 @@ += Data Types + +Unlang supports a number of data types. These data types are used in +conditional expressions or when assigning a value to an attribute. + +== Using Data Types + +The server support a wide range of data types, as given in the +xref:unlang/type/all_types.adoc[list of data types] page. The choice +of which data type applies is determined by the context in which that +data type is used. This context is usually taken from an attribute +which is being assigned a value. + +The `unlang` interpreter uses pre-defined attributes which are defined +in dictionaries. The dictionaries define both a name, and a data type +for the attributes. In the interpreter, then, attributes can be +assigned a value or compared to a value, without specifying the data +type. The interpreter knows how to parse the value by using the data +type assigned to the attribute. + +The result is that in most cases, it is not necessary to know the name +of the data types. It is possible to write values in the format you +expect, and he server will do "the right thing" when interpreting the +values. + +.Attributes with Different Data Types +[source,unlang] +---- +Framed-IP-Address = 192.0.2.1 +Framed-IPv6-Address = 2001:db8:: +Reply-Message = "This is a reply" +Port-Limit = 5 +Boolean = true +Octets-Thing = 0xabcdef0102030405 +MAC-Address = 00:01:02:03:04:05 +---- + +== Parsing Data Types + +The interpreter is flexible when parsing data types. So long as the +value can be parsed as the given data type without error, the value +will be accepted. + +For example, a particular attribute may be of data type `ipaddr` in +order to store IPv4 addresses. The interpreter will then accept the +following strings as valid IPv4 addresses: + +`192.168.0.2`:: xref:type/string/unquoted.adoc[Unquoted text], interpreted as the data type + +`'192.168.0.2'`:: xref:type/string/single.adoc[Single-quoted string], the contents of the string are parsed as the data type. ++ +The single-quoted string form is most useful when the data type +contains special characters that may otherwise confuse the parser. + +`"192.168.0.2"`:: xref:type/string/double.adoc[Double-quoted string]. ++ +The contents of the string are dynamically expanded as described in +the xref:unlang/xlat/index.adoc[dynamic expansion] page. The +resulting output is then interpreted as the given data type. + +`{backtick}/bin/echo 192.168.0.2{backtick}`:: xref:type/string/backticks.adoc[backtick-quoted string]. +Run a script, and parse the resulting string as the data type. + +Similar processing rules are applied when parsing assignments and +comparisons, for all attributes and data types. + +=== Casting Data Types + +In some cases, it is necessary to parse values which do not refer to +attributes. This situation usually occurs when two values need to be +compared, as in the following example: + +[source,unlang] +---- +if ("%{sql:SELECT ipaddress FROM table WHERE user=%{User-Name}}" == 192.0.2.1) } + .... +} +---- + +Since there is no attribute on either side of the `==` operator, the +interpreter has no way of knowing that the string `192.0.2.1` is an IP +address. There is unfortunately no way of automatically parsing +strings in order to determine the data type to use. Any such +automatic parsing would work most of the time, but it would have +error cases where the parsing was incorrect. + +The solution is to resolve these ambiguities by allowing the values to +be cast to a particular type. Casting a value to a type tells the +interpreter how that value should be parsed. Casting is done by +prefixing a value with the type name, surrounded by angle brackets; +`<...>`. + +.Syntax +---- +<...>value +---- + +We can add a cast to the above example, as follows: + +[source,unlang] +---- +if ("%{sql:SELECT ipaddress FROM table WHERE user=%{User-Name}}" == 192.0.2.1) } + .... +} +---- + +In this example, we prefix the IP address with the string ``. +The interpreter then knows that the value `192.0.2.` should be +interpreted as the data type `ipaddr`, and not as the literal string +`"192.0.2."`. + +For a full list of data types which can be used in a cast, please see +the xref:unlang/type/all_types.adoc[list of data types] page, and the +"Basic Type Types" section. + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/ip.adoc b/doc/antora/modules/unlang/pages/type/ip.adoc new file mode 100644 index 0000000..fc25ae8 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/ip.adoc @@ -0,0 +1,15 @@ += IP Addresses + +.Examples + +`192.0.2.16` + +`::1` + +`example.com` + +Depending on the context, a "simple word", as above, may be +interpreted as an IPv4 or an IPv6 address. This interpretation is +usually done when the string is used in the context of an attribute, +or to compare two addresses or assign an address to an attribute. + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/numb.adoc b/doc/antora/modules/unlang/pages/type/numb.adoc new file mode 100644 index 0000000..284cf81 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/numb.adoc @@ -0,0 +1,11 @@ += Numbers + +.Examples + +`0` + +`563` + +Numbers are unsigned integers that are composed of decimal digits. + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/string/backticks.adoc b/doc/antora/modules/unlang/pages/type/string/backticks.adoc new file mode 100644 index 0000000..9372b4c --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/string/backticks.adoc @@ -0,0 +1,38 @@ += Backtick-quoted string + +.Syntax +`{backtick}string{backtick}` + +The backtick operator is used to perform a run-time expansion +similar to what is done with the Unix shell. The contents of the string +are split into one or more sub-strings, based on intermediate +whitespace. Each substring is then expanded as described above for +double quoted strings. The resulting set of strings is used to execute a +program with the associated arguments. + +The output of the program is recorded, and the resulting data is +used in place of the input string value. Where the output is composed of +multiple lines, any carriage returns and line feeds are replaced by +spaces. + +For safety reasons, the full path to the executed program should be +given. In addition, the string is split into arguments _before_ the +substrings are dynamically expanded. This step is done both to allow +the substrings to contain spaces, and to prevent spaces in the +expanded substrings from affecting the number of command-line +arguments. + +For performance reasons, we recommend that the use of back-quoted +strings be kept to a minimum. Executing external programs is +relatively expensive, and executing a large number of programs for +every request can quickly use all of the CPU time in a server. If many +programs need to be executed, it is suggested that alternative ways to +achieve the same result be found. In some cases, using a real +programming language such as `lua`, `perl` or `python` may be better. + +.Examples + +`{backtick}/bin/echo hello{backtick}` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/string/double.adoc b/doc/antora/modules/unlang/pages/type/string/double.adoc new file mode 100644 index 0000000..ea87bc5 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/string/double.adoc @@ -0,0 +1,68 @@ += Double Quoted Strings + +.Syntax +`"string"` + +A double-quoted string allows escape sequences and xref:xlat/index.adoc[dynamic +expansions]. As with xref:type/string/single.adoc[single-quoted strings], text +within double quotes can include spaces. + +The main difference between the single and double quoted strings is +that the double quoted strings can be dynamically expanded. The syntax +`${...}` is used for parse-time expansion and `%{...}` is used for +run-time expansion. The difference between the two methods is that the +`${...}` form is expanded when the server loads the configuration +files and is valid anywhere in the configuration files. The `%{...}` +xref:xlat/index.adoc[string expansion] form is valid only in conditional +expressions and attribute assignments. + +The output of the dynamic expansion can be interpreted as a string, +a number, or an IP address, depending on its context. + +Note that the interpretation of text _strongly_ depends on the +context. The text `"0000"` can be interpreted as a data type +"integer", having value zero, or a data type "string", having value +`"0000"`. In general when a particular piece of text is used, it is +used with the context of a known attribute. That attribute has a +xref:type/index.adoc[data type], and the text will be interpreted as that +data type. + +NOTE: Most values retrieved from external datastores will be treated implicitly +as double-quoted strings. + +== Escape sequences + +Escape sequences allow the inclusion of characters that may be difficult to +represent in datastores, or the FreeRADIUS configuration files. + +.Escape sequences and their descriptions +[options="header", cols="15%,85%"] +|===== +| Escape sequence | Character represented +| `\\` | Literal backslash (0x5c) +| `\r` | Carriage return (0x0d) +| `\n` | Line feed (0x0a) +| `\t` | Horizontal tab (0x09) +| `\"` | Double quote (0x22) +| `\x` | A byte whose numerical value is given by `` interpreted as a hexadecimal number. +| `\x` | A byte whose numerical value is given by `` interpreted as an octal number. +|===== + +.Examples + +`"word"` + +`"a string"' + +`"foo\"bar\""` + +`"this is a long string"` + +`"this has embedded\ncharacters"` + +`"attribute\tvalue\nusername\t%{User-Name}\nreply-message\t%{reply.Reply-Message}"` +`"The result of 'SELECT * FROM foo WHERE 1' is: %{sql:SELECT * FROM foo WHERE 1}"` + +// Licenced under CC-by-NC 4.0. +// Copyright (C) 2019 Arran Cudbard-Bell +// Copyright (C) 2019 The FreeRADIUS project. +// Copyright (C) 2020 Network RADIUS SAS. + + + + diff --git a/doc/antora/modules/unlang/pages/type/string/escaping.adoc b/doc/antora/modules/unlang/pages/type/string/escaping.adoc new file mode 100644 index 0000000..e63a498 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/string/escaping.adoc @@ -0,0 +1,14 @@ += Character Escaping + +The quotation characters in the above string data types can be +escaped by using the backslash, or `\,` character. The backslash +character itself can be created by using `\\`. Carriage returns and +line feeds can be created by using `\n` and `\r`. + +.Examples + +`"I say \"hello\" to you"` + +`"This is split\nacross two lines"` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/string/single.adoc b/doc/antora/modules/unlang/pages/type/string/single.adoc new file mode 100644 index 0000000..fa2ac05 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/string/single.adoc @@ -0,0 +1,19 @@ += Single Quoted Strings + +.Syntax +`'string'` + +A single-quoted string is interpreted without any dynamic string +expansion. The quotes allow the string to contain spaces, among other +special characters. The single quote character can be placed in such a +string by escaping it with a backslash. + +.Examples + +`'hello'` + +`'foo bar`' + +`'foo\\'bar'` + +`'this is a long string'` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/type/string/unquoted.adoc b/doc/antora/modules/unlang/pages/type/string/unquoted.adoc new file mode 100644 index 0000000..9dd6e55 --- /dev/null +++ b/doc/antora/modules/unlang/pages/type/string/unquoted.adoc @@ -0,0 +1,21 @@ += Unquoted Strings + +Where a series of characters cannot be parsed as a decimal number, +they are interpreted as a simple string composed of one word. This +word is delimited by spaces, or by other tokens, such as `)` in +conditional expressions. + +This unquoted text is interpreted as simple strings and are generally +equivalent to placing the string in single quotes. + +The interpretation of the text depends on the context, which is +usually defined by an attribute which has a xref:type/index.adoc[data type]. + +.Examples + +`Hello` + +`192.168.0.1` + +`00:01:02:03:04:05` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/update.adoc b/doc/antora/modules/unlang/pages/update.adoc new file mode 100644 index 0000000..645f4d8 --- /dev/null +++ b/doc/antora/modules/unlang/pages/update.adoc @@ -0,0 +1,160 @@ += The update Statement + +.Syntax +[source,unlang] +---- +update [ ] { + + ... +} +---- + +The `update` statement adds attributes to, or edits the attributes in, +the named __. + +The `update` statement consists of the following syntax elements: + +:: The attribute list which will be updated. The list is +usually `request`, `reply`, or `control`. ++ +If the __ qualifier is omitted, then each entry inside of the +`update` section *must* be prefixed with a list name. For example, +`&request.User-Name ...` + +:: The server attribute which is assigned the +__. + +:: The operator such as `=`, `:=`, etc. + +:: The value which is assigned to the attribute. If the field +is a double-quoted string, it undergoes xref:xlat/index.adoc[string +expansion], and the resulting value is assigned to the attribute. + +The update process is atomic, in that either all of the attributes are +modified, or none of them are modified. If the `update` fails for any +reason, then all of the results are discarded, and the `update` does +not affect any server attributes. + +.Example +[source,unlang] +---- +update reply { + &Reply-Message := "Hello!" + &Framed-IP-Address := 192.0.2.4 +} +---- + +== Lists + +The __ field sets the attribute list that will be updated. If +the __ qualifier is omitted, then each entry inside of the +`update` section *must* be prefixed with a list name. For example, +`&request.User-Name ...` + +Please see the xref:list.adoc[list] page for valid list names. + +== Server Attributes + +The __ field is an attribute name, such as +`&Reply-Message`. The attribute name may also be prefixed with a +__ qualifier, which overrides the __ given at the start +of the `update` section. + +NOTE: In version 3, the leading `&` is optional but recommended. + +== Editing Operators + +The `` field is used to define how the attribute is processed. +Different operators allow attributes to be added, deleted, or +replaced, as defined below. + +.Editing Operators +[options="header"] +[cols="10%,90%"] +|===== +| Operator | Description +| = | Add the attribute to the list, if and only if an attribute of +the same name is not already present in that list. +| := | Add the attribute to the list. If any attribute of the same +name is already present in that list, its value is replaced with the +value of the current attribute. +| += | Add the attribute to the tail of the list, even if attributes +of the same name are already present in the list. +| ^= | Add the attribute to the head of the list, even if attributes +of the same name are already present in the list. +| -= | Remove all attributes from the list that match __. +| !* | Delete all occurances of the attribute, no matter what the value. +|===== + +== Filtering Operators + +The following operators may also be used in addition to the ones +listed above. These operators use the __ and +__ fields to enforce limits on all attributes in the given +__, and to edit attributes which have a matching +__ name. All other attributes are ignored. + +.Filtering Operators +[options="header] +[cols="10%,90%"] +|===== +| Operator | Description +| == | Keep only the attributes in the list that match __ +| < | Keep only the attributes in the list that have values less than __. +| \<= | Keep only the attributes in the list that have values less than or equal to __. +| > | Keep only the attributes in the list that have values greater than __. +| >= | Keep only the attributes in the list that have values greater than or equal to __. +| =~ | Keep only the attributes in the list which match the regular expression given in __. +| !~ | Keep only the attributes in the list which do not match the regular expression given in __. +|===== + +The `==` operator is very different from the `=` operator listed +above. The `=` operator is used to add new attributes to the list, +while the `==` operator removes all attributes that do not match the +given value. + +The comparison operators `<`, `<=`, `>`, and `>=` have some additional +side effects. Any non-matching value is replaced by the __ +given here. If no attribute exists, it is created with the given +__. + +For IP addresses, the operators `>`, `>=`, `<`, and `\<=` check for +membership in a network. The __ field should then be a IP +network, given in `address/mask` format. + +.Example +[source,unlang] +---- +update reply { + &Session-timeout := 86400 +} +---- + +.Example +[source,unlang] +---- +update reply { + &Reply-Message += "Rejected: Also, realm does not end with ac.uk" +} +---- + +== Values + +The __ field is the value which is assigned to the +__. The interpretation of the __ field +depends on the data type of the contents. For example, if the string +`"192.0.2.1"` is assigned to an attribute of the `string` data type, +then the result is an ASCII string containing that value. However, if +the same string is assigned to an attribute of the `ipaddr` data type, +then the result is a 32-bit IPv4 address, with binary value `0xc0000201`. + +.Example +[source,unlang] +---- +update reply { + &Session-Timeout <= 3600 +} +---- + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/xlat/alternation.adoc b/doc/antora/modules/unlang/pages/xlat/alternation.adoc new file mode 100644 index 0000000..adb7604 --- /dev/null +++ b/doc/antora/modules/unlang/pages/xlat/alternation.adoc @@ -0,0 +1,24 @@ += Alternation Syntax + +Alternation syntax similar to that used in Unix shells may also be +used: + +`%{%{Foo}:-bar}` + +This code returns the value of `%{Foo}`, if it has a value. +Otherwise, it returns a literal string bar. + +`%{%{Foo}:-%{Bar}}` + +This code returns the value of `%{Foo}`, if it has a value. +Otherwise, it returns the expansion of `%{Bar}`. + +These conditional expansions can be nested to almost any depth, such +as with `%{%{One}:-%{%{Two}:-%{Three}}}`. + +.Examples +`%{%{Stripped-User-Name}:-%{User-Name}}` + +`%{%{Framed-IP-Address}:-}` + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/xlat/attribute.adoc b/doc/antora/modules/unlang/pages/xlat/attribute.adoc new file mode 100644 index 0000000..a3ee29b --- /dev/null +++ b/doc/antora/modules/unlang/pages/xlat/attribute.adoc @@ -0,0 +1,54 @@ += Attribute References + +Attributes in a list may be referenced via one of the following two +syntaxes: + +`%{Attribute-Name}` + +`%{:Attribute-Name}` + +The `:` prefix is optional. If given, it must be a valid +reference to an xref:list.adoc[attribute list]. + +If the `:` prefix is omitted, then the `request` list is +assumed. + +For EAP methods with tunneled authentication sessions (i.e. PEAP and +EAP-TTLS), the inner tunnel session can refer to a list for the outer +session by prefixing the list name with `outer.` ; for example, +`outer.request`. + +When a reference is encountered, the given list is examined for an +attribute of the given name. If found, the variable reference in the +string is replaced with the value of that attribute. Otherwise, the +reference is replacedd with an empty string. + +.Examples + +`%{User-Name}` + +`%{request.User-Name} # same as above` + +`%{reply.User-Name}` + +`%{outer.request.User-Name} # from inside of a TTLS/PEAP tunnel` + +Examples of using references inside of a string: + +`"Hello %{User-Name}"` + +`"You, %{User-Name} are not allowed to use %{NAS-IP-Address}"` + +== Additional Variations + +`%{Attribute-Name[#]}`:: +Returns an integer containing the number of named attributes + +`%{Attribute-Name[0]}`:: + +When an attribute appears multiple times in a list, this syntax allows +you to address the attributes as with array entries. `[0]` refers to +the first attributes, `[1]` refers to the second attribute, etc. + +`%{Attribute-Name[*]}`:: + +Returns a comma-separated string containing all values for the named +attributes. + +// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// Development of this documentation was sponsored by Network RADIUS SAS. diff --git a/doc/antora/modules/unlang/pages/xlat/builtin.adoc b/doc/antora/modules/unlang/pages/xlat/builtin.adoc new file mode 100644 index 0000000..f236a57 --- /dev/null +++ b/doc/antora/modules/unlang/pages/xlat/builtin.adoc @@ -0,0 +1,891 @@ += Built-In Expansions + +In addition to storing attribute references, the server has a number +of built-in expansions. These expansions act largely as functions +which operate on inputs, and produce an output. + + + +== Attribute Manipulation + +=== %{length: ... } + +The `length` expansion returns the size of the input as an integer. +When the input is a string, then the output is identical to the +`strlen` expansion. + +When the input is an attribute reference, the output is the size of +the attributes data as encoded "on the wire". + +.Return: _size_ + +.Determining the length of fixed and variable length attributes +==== +[source,unlang] +---- +update control { + &Tmp-String-0 := "Caipirinha" + &Framed-IP-Address := 192.0.2.1 +} + +update reply { + &Reply-Message := "The length of %{control:Tmp-String-0} is %{length:&control:Tmp-String-0}" + &Reply-Message += "The length of %{control:Framed-IP-Address} is %{length:&control:Framed-IP-Address}" +} +---- + +.Output +.... +The length of Caipirinha is 10 +The length of 192.168.0.2 is 4 +.... +==== + +`length` is built in to the server core. + + + +=== %{integer:<&ref>} + +Print the value of the attribute an integer. + +In normal operation, `integer` attributes are printed using the name +given by a `VALUE` statement in a dictionary. Similarly, date +attributes are printed as dates, i.e., "January 1 2010. + +The `integer` expansion applies only to attributes which can be +converted to an integer. For all other inputs, it returns `0`. + +A common usage is to find the difference between two dates. + +For example, if a request contains `Service-Type = Login-User`, the +expansion of `%{integer:&Service-Type}` will yield `1`, which is the +value associated with the `Login-User` name. Using +`%{integer:&Event-Timestamp}` will return the event timestamp as an +unsigned 32-bit number. + +.Return: _string_ + +.Determining the integer value of an enumerated attribute +==== +[source,unlang] +---- +update { + &control:Service-Type := Login-User +} +update reply { + &Reply-Message := "The value of Service-Type is %{integer:&control:Service-Type}" +} +---- + +.Output + +``` +The value of Service-Type is 1 +``` +==== + +`integer` is built in to the server core. + + + +=== %{rand:} + +Generate random number from `0` to `-1`. + +.Return: _uint64_ + +.Generating a random number between 0 and 511 +==== +[source,unlang] +---- +update reply { + &Reply-Message := "The random number is %{rand:512}" +} +---- + +.Output + +``` +The random number is 347 +``` +==== + +`rand` is provided by the `rlm_expr` module. + + + +=== %{tag:} + +CAUTION: This expansion is deprecated and will likely be removed. + +Returns a list of tags for any attributes found using ````. + +.Return: _int8_ + +.Determining the tag value of the second instance of the `radius.Tunnel-Server-Endpoint` attribute +==== +[source,unlang] +---- +update request { + &Tunnel-Server-Endpoint := '192.0.1.1' + &Tunnel-Server-Endpoint:1 := '192.0.5.2' + &Tunnel-Server-Endpoint:1 += '192.0.3.8' + &Tunnel-Server-Endpoint:2 := '192.0.2.1' + &Tunnel-Server-Endpoint:2 += '192.0.3.4' +} + +update reply { + &Reply-Message := "The tag value of the second instance of Tunnel-Server-Enpoint is %{request:Tunnel-Server-Endpoint[1]}" +} +---- + +.Output + +``` +The tag value of the second instance of Tunnel-Server-Enpoint is 192.0.5.2 +``` +==== + +`tag` is built in to the server core. + + + +=== %{string:} + +Convert input to a string (if possible). For _octets_ type attributes, this +means interpreting the data as a UTF8 string, and inserting octal escape +sequences where appropriate. + +For other types, this means printing the value in its _presentation_ format, +i.e. dotted quads for IPv4 addresses, link:https://en.wikipedia.org/wiki/ISO_8601[ISO 8601] +time for date types, enumeration values for attributes such as `radius.Service-Type` etc. + +.Return: _string_ + +.String interpolation using the raw octets value of Tmp-Octets-0, and the stringified version +==== +[source,unlang] +---- +update control { + &Tmp-Octets-0 := 0x7465737431 +} +update reply { + &Reply-Message := "The string value of %{control:Tmp-Octets-0} is %{string:%{control:Tmp-Octets-0}}" +} +---- +==== + +.Output + +``` +The string value of 0x7465737431 is test1 +``` + +`string` is built in to the server core. + + + +== Server Manipulation + +=== %{config:} + +Refers to a variable in the configuration file. See the documentation +on configuration file references. + +.Return: _string_ + +.Example + +[source,unlang] +---- +"Server installed in %{config:prefix}" +"Module rlm_exec.shell_escape = %{config:modules.exec.shell_escape}" +---- + +.Output + +``` +Server installed in /opt/freeradius +Module rlm_exec.shell_escape = yes +``` + +`config` is built in to the server core. + + + +=== %{client:} + +Refers to a variable that was defined in the client section for the +current client. See the sections `client { ... }` in `clients.conf`. + +.Return: _string_ + +.Example + +[source,unlang] +---- +"The client ipaddr is %{client:ipaddr}" +---- + +.Output + +``` +The client ipaddr is 192.168.5.9 +``` + +`client` is built in to the server core. + + + +=== %{debug:} + +Dynamically change the debug level to something high, recording the old level. + +.Return: _string_ + +.Example + +[source,unlang] +---- +authorize { + if (&request:User-Name == "bob") { + "%{debug:4}" + } else { + "%{debug:0}" + } + ... +} +---- + +.Output (_extra informations only for that condition_) + +``` +... +(0) authorize { +(0) if (&request:User-Name == "bob") { +(0) EXPAND %{debug:4} +(0) --> 2 +(0) } # if (&request:User-Name == "bob") (...) +(0) filter_username { +(0) if (&State) { +(0) ... +(0) } +... +``` + +`debug` is built in to the server core. + + + +=== %{debug_attr:} + +Print to debug output all instances of current attribute, or all attributes in a list. +expands to a zero-length string. + +.Return: _string_ + +.Example + +[source,unlang] +---- +authorize { + if (&request:User-Name == "bob") { + "%{debug_attr:request[*]}" + } + ... +} +---- + +.Output + +``` +... +(0) authorize { +(0) if (&request:User-Name == "bob") { +(0) Attributes matching "request[*]" +(0) &request:User-Name = bob +(0) &request:User-Password = hello +(0) &request:NAS-IP-Address = 127.0.1.1 +(0) &request:NAS-Port = 1 +(0) &request:Message-Authenticator = 0x9210ee447a9f4c522f5300eb8fc15e14 +(0) EXPAND %{debug_attr:request[*]} +(0) } # if (&request:User-Name == "bob") (...) +... +``` + +`debug_attr` is built in to the server core. + + + +== String manipulation + +=== %{lpad:<&ref> } + +Left-pad a string. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "123" +} +update reply { + &Reply-Message := "Maximum should be %{lpad:&control:Tmp-String-0 11 0}" +} +---- + +.Output + +``` +Maximum should be 00000000123 +``` + +`lpad` is provided by the `rlm_expr` module. + + + +=== %{rpad:<&ref> } + +Right-pad a string. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "123" +} +update reply { + &Reply-Message := "Maximum should be %{rpad:&control:Tmp-String-0 11 0}" +} +---- + +.Output + +``` +Maximum should be 12300000000 +``` + +`rpad` is provided by the `rlm_expr` module. + + + +=== %{pairs:<&list:[*]>} + +Serialize attributes as comma-delimited string. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update { + &control:Tmp-String-0 := "This is a string" + &control:Tmp-String-0 += "This is another one" +} + +update reply { + &Reply-Message := "Serialize output: %{pairs:&control[*]}" +} +---- + +.Output + +``` +Serialize output: Tmp-String-0 = \"This is a string\"Tmp-String-0 = \"This is another one\" +``` + +`pairs` is provided by the `rlm_expr` module. + + + +=== %{randstr: ...} + +Get random string built from character classes. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update reply { + &Reply-Message := "The random string output is %{randstr:aaaaaaaa}" +} +---- + +.Output + +``` +The random string output is 4Uq0gPyG +``` + +`randstr` is provided by the `rlm_expr` module. + + + +=== %{strlen: ... } + +Length of given string. + +.Return: _integer_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "Caipirinha" +} +update reply { + &Reply-Message := "The length of %{control:Tmp-String-0} is %{strlen:&control:Tmp-String-0}" +} +---- + +.Output + +``` +The length of Caipirinha is 21 +``` + +`strlen` is built in to the server core. + + + +=== %{tolower: ... } + +Dynamically expands the string and returns the lowercase version of +it. This definition is only available in version 2.1.10 and later. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "CAIPIRINHA" +} +update reply { + &Reply-Message := "tolower of %{control:Tmp-String-0} is %{tolower:%{control:Tmp-String-0}}" +} +---- + +.Output + +``` +tolower of CAIPIRINHA is caipirinha +``` + +`tolower` is provided by the `rlm_expr` module. + + + +=== %{toupper: ... } + +Dynamically expands the string and returns the uppercase version of +it. This definition is only available in version 2.1.10 and later. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "caipirinha" +} +update reply { + &Reply-Message := "toupper of %{control:Tmp-String-0} is %{toupper:%{control:Tmp-String-0}}" +} +---- + +.Output + +``` +toupper of caipirinha is CAIPIRINHA +``` + +`toupper` is provided by the `rlm_expr` module. + + + +== String Conversion + +=== %{base64: ... } + +Encode a string using Base64. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "Caipirinha" +} +update reply { + &Reply-Message := "The base64 of %{control:Tmp-String-0} is %{base64:%{control:Tmp-String-0}}" +} +---- + +.Output + +``` +The base64 of foo is Q2FpcGlyaW5oYQ== +``` + +`base64` is provided by the `rlm_expr` module. + + + +=== %{base64tohex: ... } + +Decode a base64 string (e.g. previously encoded using `base64`) to +hex. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "Q2FpcGlyaW5oYQ==" +} +update reply { + &Reply-Message := "The base64tohex of %{control:Tmp-String-0} is %{base64tohex:%{control:Tmp-String-0}}" +} +---- + +.Output + +``` +The base64decode of Q2FpcGlyaW5oYQ== is 436169706972696e6861 +``` + +`base64tohex` is provided by the `rlm_expr` module. + + + +=== %{hex: ... } + +Convert to hex. + +.Return: _string_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "12345" +} +update reply { + &Reply-Message := "The value of %{control:Tmp-String-0} in hex is %{hex:%{control:Tmp-String-0}}" +} +---- + +.Output + +``` +The value of 12345 in hex is 3132333435 +``` + +`hex` is built in to the server core. + + + +=== %{urlquote: ... } + +Quote URL special characters. + +.Return: _string_. + +.Example + +[source,unlang] +---- +update { + &control:Tmp-String-0 := "http://example.org/" +} +update reply { + &Reply-Message += "The urlquote of %{control:Tmp-String-0} is %{urlquote:%{control:Tmp-String-0}}" +} +---- + +.Output + +``` +The urlquote of http://example.org/ is http%3A%2F%2Fexample.org%2F +``` + +`urlquote` is provided by the `rlm_expr` module. + + + +=== %{urlunquote: ... } + +Unquote URL special characters. + +.Return: _string_. + +.Example + +[source,unlang] +---- +update { + &control:Tmp-String-0 := "http%%3A%%2F%%2Fexample.org%%2F" # Attention for the double %. +} +update reply { + &Reply-Message += "The urlunquote of %{control:Tmp-String-0} is %{urlunquote:%{control:Tmp-String-0}}" +} +---- + +.Output + +``` +The urlunquote of http%3A%2F%2Fexample.org%2F is http://example.org/ +``` + +`urlunquote` is provided by the `rlm_expr` module. + + + +== Hashing and Encryption + +=== %{hmacmd5: } + +Generate `HMAC-MD5` of string. + +.Return: _octal_ + +.Example + +[source,unlang] +---- +update { + &control:Tmp-String-0 := "mykey" + &control:Tmp-String-1 := "Caipirinha" +} +update { + &control:Tmp-Octets-0 := "%{hmacmd5:%{control:Tmp-String-0} %{control:Tmp-String-1}}" +} + +update reply { + &Reply-Message := "The HMAC-MD5 of %{control:Tmp-String-1} in octets is %{control:Tmp-Octets-0}" + &Reply-Message += "The HMAC-MD5 of %{control:Tmp-String-1} in hex is %{hex:control:Tmp-Octets-0}" +} +---- + +.Output + +``` +The HMAC-MD5 of Caipirinha in octets is \317}\264@K\216\371\035\304\367\202,c\376\341\203 +The HMAC-MD5 of Caipirinha in hex is 636f6e74726f6c3a546d702d4f63746574732d30 +``` + +`hmacmd5` is provided by the `rlm_expr` module. + + + +=== %{hmacsha1: } + +Generate `HMAC-SHA1` of string. + +.Return: _octal_ + +.Example + +[source,unlang] +---- +update { + &control:Tmp-String-0 := "mykey" + &control:Tmp-String-1 := "Caipirinha" +} +update { + &control:Tmp-Octets-0 := "%{hmacsha1:%{control:Tmp-String-0} %{control:Tmp-String-1}}" +} + +update reply { + &Reply-Message := "The HMAC-SHA1 of %{control:Tmp-String-1} in octets is %{control:Tmp-Octets-0}" + &Reply-Message += "The HMAC-SHA1 of %{control:Tmp-String-1} in hex is %{hex:control:Tmp-Octets-0}" +} +---- + +.Output + +``` +The HMAC-SHA1 of Caipirinha in octets is \311\007\212\234j\355\207\035\225\256\372Ê™>R\"\341\351O) +The HMAC-SHA1 of Caipirinha in hex is 636f6e74726f6c3a546d702d4f63746574732d30 +``` + +`hmacsha1` is provided by the `rlm_expr` module. + + + +=== %{md5: ... } + +Dynamically expands the string and performs an MD5 hash on it. The +result is binary data. + +.Return: _binary data_ + +.Example + +[source,unlang] +---- +update control { + &Tmp-String-0 := "Caipirinha" +} +update reply { + &Reply-Message := "md5 of %{control:Tmp-String-0} is octal=%{md5:%{control:Tmp-String-0}}" + &Reply-Message := "md5 of %{control:Tmp-String-0} is hex=%{hex:%{md5:%{control:Tmp-String-0}}}" +} +---- + +.Output + +``` +md5 of Caipirinha is octal=\024\204\013md||\230\243\3472\3703\330n\251 +md5 of Caipirinha is hex=14840b6d647c7c98a3e732f833d86ea9 +``` + +`md5` is provided by the `rlm_expr` module. + + + +== Miscellaneous Expansions + +=== +%{0}+..+%{32}+ + +`%{0}` expands to the portion of the subject that matched the last regular +expression evaluated. `%{1}`..`%{32}` expand to the contents of any capture +groups in the pattern. + +Every time a regular expression is evaluated, whether it matches or not, +the numbered capture group values will be cleared. + + + +=== +%{regex:}+ + +Return named subcapture value from the last regular expression evaluated. + +Results of named capture groups are available using the `%{regex:}` expansion. They will also be accessible using the numbered expansions +described xref:builtin.adoc#_0_32[above]. + +Every time a regular expression is evaluated, whether it matches or not, +the named capture group values will be cleared. + +[NOTE] +==== +This expansion is only available if the server is built with libpcre or libpcre2. +Use the output of `radiusd -Xxv` to determine which regular expression library in use. + +.... +... +Debug : regex-pcre : no +Debug : regex-pcre2 : yes +Debug : regex-posix : no +Debug : regex-posix-extended : no +Debug : regex-binsafe : yes +... +Debug : pcre2 : 10.33 (2019-04-16) - retrieved at build time +.... +==== + +`regex` is built in to the server core. + + + +=== +%{nexttime: