have_econf=no
AS_IF([test "x$with_econf" != xno], [
- PKG_CHECK_MODULES([ECONF], [libeconf], [have_econf=yes], [have_econf=no])
- AS_CASE([$with_econf:$have_econf],
+ PKG_CHECK_MODULES([ECONF], [libeconf],
+ [have_econf=yes
+ AC_CHECK_LIB([econf], [econf_readConfig], [
+ AC_DEFINE([HAVE_ECONF_READCONFIG], [1], [Define if econf_readConfig exist in -leconf])
+ ])
+ ],
+ [have_econf=no]
+ )
+ AS_CASE([$with_econf:$have_econf],
[yes:no],
[AC_MSG_ERROR([libeconf expected but libeconf not found])],
[*:yes],
/* Maximum number of PIDs system supports */
#define _PATH_PROC_PIDMAX "/proc/sys/kernel/pid_max"
+/* econf path */
+#if USE_VENDORDIR
+# define UL_VENDORDIR_PATH _PATH_VENDORDIR
+#else
+# define UL_VENDORDIR_PATH NULL
+#endif
+
#endif /* PATHNAMES_H */
if (file != NULL)
free_getlogindefs_data();
- error = econf_readDirs(&file,
-#if USE_VENDORDIR
- _PATH_VENDORDIR,
+#ifdef HAVE_ECONF_READCONFIG
+ error = econf_readConfig(&file, NULL,
+ UL_VENDORDIR_PATH, "login", "defs", "= \t", "#");
#else
- NULL,
+ error = econf_readDirs(&file,
+ UL_VENDORDIR_PATH, "/etc", "login", "defs", "= \t", "#");
#endif
- "/etc", "login", "defs", "= \t", "#");
-
if (error)
syslog(LOG_NOTICE, _("Error reading login.defs: %s"),
econf_errString(error));
#include <stdint.h>
#include <stdarg.h>
#if defined (HAVE_LIBECONF)
-#include <libeconf.h>
+# include <libeconf.h>
+# include "pathnames.h"
#endif
#include "blkidP.h"
DBG(CONFIG, ul_debug("reading config file: %s.", filename));
error = econf_readFile(&file, filename, "= \t", "#");
} else {
- error = econf_readDirs(&file,
-#if USE_VENDORDIR
- _PATH_VENDORDIR,
+#ifdef HAVE_ECONF_READCONFIG
+ error = econf_readConfig(&file, NULL,
+ UL_VENDORDIR_PATH, "blkid", "conf", "= \t", "#");
#else
- NULL,
+ error = econf_readDirs(&file,
+ UL_VENDORDIR_PATH, "/etc", "blkid", "conf", "= \t", "#");
#endif
- "/etc", "blkid", "conf", "= \t", "#");
}
if (error) {
required : get_option('econf'))
conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
+have = cc.has_function(
+ 'econf_readConfig',
+ dependencies : lib_econf)
+conf.set('HAVE_ECONF_READCONFIG', have ? 1 : false)
+
lib_audit = dependency(
'audit',
required : get_option('audit'))