-dnl Macro to set the module name for use later on.
+dnl Macro to set the module name and other useful common functions
+dnl
+dnl Usages:
+dnl FR_INIT_MODULE([rlm_example])
+dnl FR_INIT_MODULE([rlm_example], [the example module])
dnl
AC_DEFUN([FR_INIT_MODULE],
[
-AC_DEFUN([modname],$1)
+ AC_DEFUN([modname],$1)
+ AC_DEFUN([modname_useropt],[m4_bpatsubst([]modname,[[-+.]],[_])])
-AC_ARG_WITH([$1],
-[AS_HELP_STRING([--without-$1],[build without ]ifelse([$2],[],[$1],[$2]))])
+ AC_ARG_WITH([$1],
+ [AS_HELP_STRING([--without-$1],[build without ]ifelse([$2],[],[$1],[$2]))])
])
+
+AC_DEFUN([FR_INIT_LIBRARY], m4_defn([FR_INIT_MODULE]))
+
# Check whether --with-rlm_cache was given.
if test "${with_rlm_cache+set}" = set; then :
withval=$with_rlm_cache;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_cache" != xno; then
ac_ext=c
+
# Check whether --with-rlm_cache_memcached was given.
if test "${with_rlm_cache_memcached+set}" = set; then :
withval=$with_rlm_cache_memcached;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_cache_memcached" != xno; then
ac_ext=c
+
# Check whether --with-rlm_cache_redis was given.
if test "${with_rlm_cache_redis+set}" = set; then :
withval=$with_rlm_cache_redis;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_cache_redis" != xno; then
+
# Check whether --with-rlm_couchbase was given.
if test "${with_rlm_couchbase+set}" = set; then :
withval=$with_rlm_couchbase;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_couchbase" != xno; then
ac_ext=c
+
# Check whether --with-rlm_counter was given.
if test "${with_rlm_counter+set}" = set; then :
withval=$with_rlm_counter;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_counter" != xno; then
ac_ext=c
+
# Check whether --with-rlm_eap was given.
if test "${with_rlm_eap+set}" = set; then :
withval=$with_rlm_eap;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_eap" != xno; then
ac_ext=c
+
# Check whether --with-rlm_eap_fast was given.
if test "${with_rlm_eap_fast+set}" = set; then :
withval=$with_rlm_eap_fast;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_eap_fast" != xno; then
openssl_lib_dir=
+
# Check whether --with-rlm_eap_ikev2 was given.
if test "${with_rlm_eap_ikev2+set}" = set; then :
withval=$with_rlm_eap_ikev2;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_eap_ikev2" != xno; then
eap_ikev2_include_dir=
+
# Check whether --with-rlm_eap_pwd was given.
if test "${with_rlm_eap_pwd+set}" = set; then :
withval=$with_rlm_eap_pwd;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_eap_pwd" != xno; then
+
# Check whether --with-rlm_eap_sim was given.
if test "${with_rlm_eap_sim+set}" = set; then :
withval=$with_rlm_eap_sim;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_eap_sim" != xno; then
+
# Check whether --with-rlm_eap_tnc was given.
if test "${with_rlm_eap_tnc+set}" = set; then :
withval=$with_rlm_eap_tnc;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_eap_tnc" != xno; then
eap_tnc_include_dir=
+
# Check whether --with-rlm_example was given.
if test "${with_rlm_example+set}" = set; then :
withval=$with_rlm_example;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_example" != xno; then
ac_ext=c
+
# Check whether --with-rlm_idn was given.
if test "${with_rlm_idn+set}" = set; then :
withval=$with_rlm_idn;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_idn" != xno; then
ac_ext=c
+
# Check whether --with-rlm_ippool was given.
if test "${with_rlm_ippool+set}" = set; then :
withval=$with_rlm_ippool;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_ippool" != xno; then
ac_ext=c
+
# Check whether --with-rlm_json was given.
if test "${with_rlm_json+set}" = set; then :
withval=$with_rlm_json;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_json" != xno; then
ac_ext=c
+
# Check whether --with-rlm_krb5 was given.
if test "${with_rlm_krb5+set}" = set; then :
withval=$with_rlm_krb5;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_krb5" != xno; then
ac_ext=c
+
# Check whether --with-rlm_ldap was given.
if test "${with_rlm_ldap+set}" = set; then :
withval=$with_rlm_ldap;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_ldap" != xno; then
+
# Check whether --with-rlm_mschap was given.
if test "${with_rlm_mschap+set}" = set; then :
withval=$with_rlm_mschap;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_mschap" != xno; then
ac_ext=c
+
# Check whether --with-rlm_opendirectory was given.
if test "${with_rlm_opendirectory+set}" = set; then :
withval=$with_rlm_opendirectory;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_opendirectory" != xno; then
ac_ext=c
+
# Check whether --with-rlm_pam was given.
if test "${with_rlm_pam+set}" = set; then :
withval=$with_rlm_pam;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_pam" != xno; then
ac_ext=c
+
# Check whether --with-rlm_perl was given.
if test "${with_rlm_perl+set}" = set; then :
withval=$with_rlm_perl;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_perl" != xno; then
ac_ext=c
+
# Check whether --with-rlm_python was given.
if test "${with_rlm_python+set}" = set; then :
withval=$with_rlm_python;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_python" != xno; then
ac_ext=c
+
# Check whether --with-rlm_python3 was given.
if test "${with_rlm_python3+set}" = set; then :
withval=$with_rlm_python3;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_python3" != xno; then
ac_ext=c
+
# Check whether --with-rlm_radutmp was given.
if test "${with_rlm_radutmp+set}" = set; then :
withval=$with_rlm_radutmp;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_radutmp" != xno; then
ac_ext=c
+
# Check whether --with-rlm_realm was given.
if test "${with_rlm_realm+set}" = set; then :
withval=$with_rlm_realm;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_realm" != xno; then
ac_ext=c
+
# Check whether --with-rlm_redis was given.
if test "${with_rlm_redis+set}" = set; then :
withval=$with_rlm_redis;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_redis" != xno; then
+
# Check whether --with-rlm_rediswho was given.
if test "${with_rlm_rediswho+set}" = set; then :
withval=$with_rlm_rediswho;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_rediswho" != xno; then
+
# Check whether --with-rlm_rest was given.
if test "${with_rlm_rest+set}" = set; then :
withval=$with_rlm_rest;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_rest" != xno; then
ac_ext=c
+
# Check whether --with-rlm_ruby was given.
if test "${with_rlm_ruby+set}" = set; then :
withval=$with_rlm_ruby;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_ruby" != xno; then
ac_ext=c
+
# Check whether --with-rlm_securid was given.
if test "${with_rlm_securid+set}" = set; then :
withval=$with_rlm_securid;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_securid" != xno; then
+
# Check whether --with-rlm_smsotp was given.
if test "${with_rlm_smsotp+set}" = set; then :
withval=$with_rlm_smsotp;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_smsotp" != xno; then
ac_ext=c
+
# Check whether --with-rlm_sql was given.
if test "${with_rlm_sql+set}" = set; then :
withval=$with_rlm_sql;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql" != xno; then
ac_ext=c
+
# Check whether --with-rlm_sql_db2 was given.
if test "${with_rlm_sql_db2+set}" = set; then :
withval=$with_rlm_sql_db2;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_db2" != xno; then
ibmdb2_include_dir=
+
# Check whether --with-rlm_sql_firebird was given.
if test "${with_rlm_sql_firebird+set}" = set; then :
withval=$with_rlm_sql_firebird;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_firebird" != xno; then
firebird_include_dir=
+
# Check whether --with-rlm_sql_freetds was given.
if test "${with_rlm_sql_freetds+set}" = set; then :
withval=$with_rlm_sql_freetds;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_freetds" != xno; then
+
# Check whether --with-rlm_sql_iodbc was given.
if test "${with_rlm_sql_iodbc+set}" = set; then :
withval=$with_rlm_sql_iodbc;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_iodbc" != xno; then
iodbc_include_dir=
+
# Check whether --with-rlm_sql_mongo was given.
if test "${with_rlm_sql_mongo+set}" = set; then :
withval=$with_rlm_sql_mongo;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_mongo" != xno; then
+
# Check whether --with-rlm_sql_mysql was given.
if test "${with_rlm_sql_mysql+set}" = set; then :
withval=$with_rlm_sql_mysql;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_mysql" != xno; then
+
# Check whether --with-rlm_sql_oracle was given.
if test "${with_rlm_sql_oracle+set}" = set; then :
withval=$with_rlm_sql_oracle;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_oracle" != xno; then
+
# Check whether --with-rlm_sql_postgresql was given.
if test "${with_rlm_sql_postgresql+set}" = set; then :
withval=$with_rlm_sql_postgresql;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_postgresql" != xno; then
ac_ext=c
+
# Check whether --with-rlm_sql_sqlite was given.
if test "${with_rlm_sql_sqlite+set}" = set; then :
withval=$with_rlm_sql_sqlite;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_sqlite" != xno; then
+
# Check whether --with-rlm_sql_unixodbc was given.
if test "${with_rlm_sql_unixodbc+set}" = set; then :
withval=$with_rlm_sql_unixodbc;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_unixodbc" != xno; then
unixodbc_include_dir=
+
# Check whether --with-rlm_sql_map was given.
if test "${with_rlm_sql_map+set}" = set; then :
withval=$with_rlm_sql_map;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sql_map" != xno; then
+
# Check whether --with-rlm_sqlcounter was given.
if test "${with_rlm_sqlcounter+set}" = set; then :
withval=$with_rlm_sqlcounter;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sqlcounter" != xno; then
ac_ext=c
+
# Check whether --with-rlm_sqlippool was given.
if test "${with_rlm_sqlippool+set}" = set; then :
withval=$with_rlm_sqlippool;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_sqlippool" != xno; then
+
# Check whether --with-rlm_unbound was given.
if test "${with_rlm_unbound+set}" = set; then :
withval=$with_rlm_unbound;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_unbound" != xno; then
rlm_unbound_lib_dir=
+
# Check whether --with-rlm_unix was given.
if test "${with_rlm_unix+set}" = set; then :
withval=$with_rlm_unix;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_unix" != xno; then
ac_ext=c
+
# Check whether --with-rlm_yubikey was given.
if test "${with_rlm_yubikey+set}" = set; then :
withval=$with_rlm_yubikey;
-if test x"$with_modname_useropt" != xno; then
+if test x"$with_rlm_yubikey" != xno; then