AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
#AC_PROG_RANLIB
-AC_CONFIG_SUBDIRS(libltdl)
+AC_CONFIG_SUBDIRS(libltdl src/libconfig)
#
# Checks for header files.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
+AC_TYPE_UID_T
AC_HEADER_TIME
#
fi
AM_CONDITIONAL(BUILD_MODULE_USERS, test "x$enable_users" = "xyes")
-AC_OUTPUT(Makefile src/libping/Makefile src/Makefile)
+AC_OUTPUT(Makefile src/libconfig/Makefile src/libping/Makefile src/Makefile)
cat <<EOF;
configfile.c configfile.h
#collectd_CFLAGS = -DPLUGINDIR='"$(pkglibdir)"'
collectd_CPPFLAGS = -DLOCALSTATEDIR='"$(localstatedir)"' -DPLUGINDIR='"$(pkglibdir)"'
-collectd_LDFLAGS = -export-dynamic -lconfig
+collectd_LDFLAGS = -export-dynamic
collectd_CFLAGS = -Werror
collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la
noinst_LTLIBRARIES = libconfig.la
+libconfig_la_CFLAGS =
libconfig_la_LDFLAGS = -avoid-version
libconfig_la_SOURCES = \
libconfig.c libconfig.h \
#define RSK_COMPAT_H
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#ifdef __WIN32__
#include "win32.h"
#define LC_LINEBUF_LEN 1024
#endif
-#ifndef HAVE_GETUID
-#include "getuid.h"
-#endif
-#ifndef HAVE_STRTOLL
-#include "strtoll.h"
-#endif
-#ifndef HAVE_STRSEP
-#include "strsep.h"
-#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
+++ /dev/null
-#include "getuid.h"
-
-uid_t getuid(void) {
- return(0);
-}
+++ /dev/null
-#ifndef _LC_GETUID_H
-#define _LC_GETUID_H
-
-typedef int uid_t;
-
-uid_t getuid(void);
-
-#endif
+++ /dev/null
-/*
- * Copyright (C) 2001, 2002, and 2003 Roy Keene
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * email: libconfig@rkeene.org
- */
-
-/* Compliments of Jay Freeman <saurik@saurik.com> */
-
-#include <string.h>
-#include "strsep.h"
-
-char *strsep(char **stringp, const char *delim) {
- char *ret = *stringp;
- if (ret == NULL) return(NULL); /* grrr */
- if ((*stringp = strpbrk(*stringp, delim)) != NULL) {
- *((*stringp)++) = '\0';
- }
- return(ret);
-}
-
+++ /dev/null
-/*
- * Copyright (C) 2001, 2002, and 2003 Roy Keene
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * email: libconfig@rkeene.org
- */
-
-/* Compliments of Jay Freeman <saurik@saurik.com> */
-
-#ifndef _RSK_STRSEP_H
-#define _RSK_STRSEP_H
-
-/* This is safe, because we're only included when there's no real strsep
- available. */
-#define strsep(x,y) lc_strsep(x,y)
-
-char *strsep(char **stringp, const char *delim);
-
-#endif
+++ /dev/null
-#include <sys/types.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <ctype.h>
-#include <stdio.h>
-
-/* We only handle base 10. */
-long long int strtoll(const char *nptr, char **endptr, int base) {
- long long int retval = 0;
- const char **endptrd = (const char **) endptr;
- const char *idx = NULL;
- int allowspace = 1;
-
- idx = nptr;
- while (1) {
- if (*idx == '\0') {
- break;
- }
-
- if (!isdigit(*idx)) {
- if (*idx == '-') {
- retval *= -1;
- continue;
- }
- if ((*idx == ' ' || *idx == '\t') && allowspace) {
- continue;
- }
- break;
- }
-
- retval *= 10;
- retval += (*idx - '0');
-
- allowspace = 0;
- idx++;
- }
-
- if (endptrd != NULL) {
- *endptrd = idx;
- }
-
- return(retval);
-}
+++ /dev/null
-#ifndef _RSK_STRTOLL_H
-#define _RSK_STRTOLL_H
-
-long long int strtoll(const char *nptr, char **endptr, int base);
-
-#endif