Permalink
Browse files

Build fixes for NetBSD and TCP wrappers (libwrap)

  • Loading branch information...
kimholviala committed Jan 29, 2018
1 parent 60b391e commit f56ae187ef90edab29396deae0937d4fce63815a
Showing with 20 additions and 22 deletions.
  1. +3 −3 Makefile
  2. +9 −0 gophernicus.c
  3. +0 −1 gophernicus.h
  4. +7 −7 platform.c
  5. +0 −10 string.c
  6. +1 −1 version
View
@@ -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
@@ -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
@@ -113,7 +113,6 @@
#include <errno.h>
#include <pwd.h>
#include <limits.h>
#include <ctype.h>
#ifdef HAVE_SENDFILE
#include <sys/sendfile.h>
View
@@ -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
@@ -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
@@ -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"

0 comments on commit f56ae18

Please sign in to comment.