1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-06-16 06:25:23 +00:00

Build fixes for NetBSD and TCP wrappers (libwrap)

This commit is contained in:
Kim Holviala 2018-01-29 14:42:12 +02:00
parent 60b391e65e
commit f56ae187ef
6 changed files with 20 additions and 22 deletions

View File

@ -54,14 +54,14 @@ IPCRM = /usr/bin/ipcrm
all:
@case `uname` in \
Darwin) $(MAKE) ROOT="$(OSXROOT)" DESTDIR="$(OSXDEST)" $(BINARY); ;; \
Haiku) $(MAKE) EXTRA_LDFLAGS="-lnetwork" $(BINARY); ;; \
Haiku) $(MAKE) EXTRA_LIBS="-lnetwork" $(BINARY); ;; \
*) if [ -f "/usr/include/tcpd.h" ]; then $(MAKE) withwrap; else $(MAKE) $(BINARY); fi; ;; \
esac
generic: $(BINARY)
withwrap:
$(MAKE) EXTRA_CFLAGS="-DHAVE_LIBWRAP" EXTRA_LDFLAGS="-lwrap" $(BINARY)
$(MAKE) EXTRA_CFLAGS="-DHAVE_LIBWRAP" EXTRA_LIBS="-lwrap" $(BINARY)
#
@ -87,7 +87,7 @@ ChangeLog:
$(NAME).c: $(NAME).h $(HEADERS)
$(BINARY): $(OBJECTS)
$(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJECTS) -o $@
$(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJECTS) $(EXTRA_LIBS) -o $@
.c.o:
$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DVERSION="\"$(VERSION)\"" -DCODENAME="\"$(CODENAME)\"" -DDEFAULT_ROOT="\"$(ROOT)\"" $< -o $@

View File

@ -26,6 +26,15 @@
#include "gophernicus.h"
/*
* Libwrap needs these defined
*/
#ifdef HAVE_LIBWRAP
int allow_severity = LOG_DEBUG;
int deny_severity = LOG_ERR;
#endif
/*
* Print gopher menu line
*/

View File

@ -113,7 +113,6 @@
#include <errno.h>
#include <pwd.h>
#include <limits.h>
#include <ctype.h>
#ifdef HAVE_SENDFILE
#include <sys/sendfile.h>

View File

@ -35,11 +35,13 @@ void platform(state *st)
#if defined(_AIX) || defined(__linux) || defined(__APPLE__)
FILE *fp;
#endif
#if defined(__linux) || defined(__APPLE__)
char buf[BUFSIZE];
#endif
#ifdef __linux
struct stat file;
#endif
struct utsname name;
char buf[BUFSIZE];
char sysname[64];
char release[64];
char machine[64];
@ -154,13 +156,11 @@ void platform(state *st)
/* No DMI? Get possible hypervisor name */
if (!*st->server_description && (fp = fopen("/sys/hypervisor/type" , "r"))) {
if (fgets(buf, sizeof(buf), fp) == NULL) strclear(buf);
if (fgets(buf, sizeof(buf), fp) != NULL) {
chomp(buf);
if (*buf) snprintf(st->server_description, sizeof(st->server_description), "%s virtual machine", buf);
}
fclose(fp);
chomp(buf);
ucfirst(buf);
if (*buf) snprintf(st->server_description, sizeof(st->server_description), "%s virtual machine", buf);
}
/* Identify Gentoo */

View File

@ -26,16 +26,6 @@
#include "gophernicus.h"
/*
* Make a string's first character uppercase
*/
void ucfirst(char *str)
{
if (str == NULL || !*str) return;
*str = toupper(*str);
}
/*
* Repeat a character num times and zero-terminate
*/

View File

@ -4,7 +4,7 @@
## Generate Gophernicus version/build number
##
DEFAULT=99
DEFAULT="PE"
if which git >/dev/null && test -d .git; then
git log | grep -c "^commit"