Skip to content

Commit 28a3d0f

Browse files
hummeltechǝɹʇʇɐʃǝ◖ xıʃǝɟ
authored andcommitted
Allow for iniparser.h in either iniparser.h or iniparser/iniparser.h
1 parent db3c169 commit 28a3d0f

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fi
3131
PKG_CHECK_MODULES([GLIB], [glib-2.0])
3232

3333
# Checks for header files.
34-
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h utime.h paths.h sys/cdefs.h sys/loadavg.h])
34+
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h utime.h paths.h sys/cdefs.h sys/loadavg.h iniparser.h iniparser/iniparser.h])
3535

3636
# Checks for typedefs, structures, and compiler characteristics.
3737
AC_C_INLINE
@@ -59,6 +59,10 @@ AC_CHECK_LIB(rados, rados_version, [
5959
LIBRADOS_LDFLAGS='-lrados'
6060
AC_SUBST(LIBRADOS_LDFLAGS)
6161
][])
62+
AC_CHECK_LIB(iniparser, iniparser_load, [
63+
INIPARSER_LDFLAGS='-liniparser'
64+
AC_SUBST(INIPARSER_LDFLAGS)
65+
], [AC_MSG_ERROR([Unable to find libiniparser])])
6266

6367
AC_CHECK_FUNCS([bzero gethostbyname gettimeofday inet_ntoa memset mkdir pow select socket strchr strdup strerror strrchr strstr strtol strtoul utime],[],[AC_MSG_ERROR([One of the required functions was not found])])
6468
AC_CHECK_FUNCS([daemon getloadavg],[],[])

src/daemon.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
#include "g_logger.h"
4545

4646
// extern "C" {
47-
#ifdef __FreeBSD__
48-
#include <iniparser.h>
49-
#else
47+
#ifdef HAVE_INIPARSER_INIPARSER_H
5048
#include <iniparser/iniparser.h>
49+
#else
50+
#include <iniparser.h>
5151
#endif
5252
// }
5353

0 commit comments

Comments
 (0)