build system adaptions for osx

This commit is contained in:
Rainer Gerhards 2017-05-12 12:39:31 +02:00
parent a6a24abf13
commit 470c7be57c
5 changed files with 26 additions and 10 deletions

View File

@ -81,6 +81,7 @@ AC_DEFINE_UNQUOTED([PLATFORM_ID], ["${host}"], [platform id for display purposes
# nice to have the extra information.
AC_DEFINE_UNQUOTED([PLATFORM_ID_LSB], ["`lsb_release -d`"], [platform id for display purposes])
echo HOST: ${host}
case "${host}" in
*-*-linux*)
AC_DEFINE([OS_LINUX], [1], [Indicator for a Linux OS])
@ -90,6 +91,10 @@ case "${host}" in
AC_DEFINE([OS_BSD], [1], [Indicator for a BSD OS])
os_type="bsd"
;;
*-apple-*)
AC_DEFINE([OS_APPLE], [1], [Indicator for APPLE OS])
os_type="apple"
;;
*-*-kfreebsd*)
# kernel is FreeBSD, but userspace is glibc - i.e. like linux
# do not DEFINE OS_BSD
@ -109,19 +114,19 @@ case "${host}" in
LIBUUID_LIBS=${LIBUUID_LIBS:=-luuid}
AC_SUBST(SOL_LIBS)
;;
# AIXPORT START
*-*-aix*)
os_type="aix"
AC_DEFINE([OS_AIX], [1], [Indicator for a AIX OS])
;;
# AIXPORT END
esac
AM_CONDITIONAL(OS_APPLE, test x$os_type == xapple)
AM_CONDITIONAL(xOS_LINUX, test x$os_type == xlinux)
AM_CONDITIONAL(OS_LINUX, test x$os_type == xlinux)
# Running from git source?
in_git_src=no
AS_IF([test -d "$srcdir"/.git && ! test -f "$srcdir"/.tarball-version], [in_git_src=yes])
AM_CONDITIONAL(OS_LINUX, test x$os_type == xlinux)
AC_DEFINE_UNQUOTED([HOSTENV], "$host", [the host environment, can be queried via a system variable])

View File

@ -36,7 +36,7 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__APPLE__)
#include <sys/wait.h>
#else
#include <wait.h>

View File

@ -88,7 +88,7 @@ librsyslog_la_SOURCES = \
../parse.h \
\
sd-daemon.c \
sd-daemon.h
sd-daemon.h \
\
hashtable.c \
hashtable.h \

View File

@ -32,8 +32,7 @@ echo "****************************** END PREP STEP *****************************
export ASAN_OPTIONS=detect_leaks=0
autoreconf --force --verbose --install
#export CONFIG_FLAGS="--prefix=/opt/rsyslog --enable-silent-rules --disable-generate-man-pages --enable-testbench --enable-imdiag --enable-imfile --enable-impstats --enable-mmrm1stspace --enable-imptcp --enable-mmanon --enable-mmaudit --enable-mmfields --enable-mmjsonparse --enable-mmpstrucdata --enable-mmsequence --enable-mmutf8fix --enable-mail --enable-omprog --enable-omstdout --enable-omuxsock --enable-pmaixforwardedfrom --enable-pmciscoios --enable-pmcisconames --enable-pmlastmsg --enable-pmsnare --enable-libgcrypt --enable-mmnormalize --disable-omudpspoof --enable-relp --disable-snmp --disable-mmsnmptrapd --enable-gnutls --enable-usertools --enable-libdbi --enable-pgsql --enable-omhttpfs --enable-elasticsearch --enable-omrelp-default-port=13515 --enable-omtcl --enable-mmdblookup"
export CONFIG_FLAGS="--prefix=/opt/rsyslog --enable-silent-rules --disable-generate-man-pages --enable-testbench --enable-imdiag --enable-imfile --enable-impstats --enable-mmrm1stspace --enable-imptcp --enable-mmanon --enable-mmaudit --enable-mmfields --enable-mmjsonparse --enable-mmpstrucdata --enable-mmsequence --enable-mmutf8fix --enable-mail --enable-omprog --enable-omstdout --enable-omuxsock --enable-pmaixforwardedfrom --enable-pmciscoios --enable-pmcisconames --enable-pmlastmsg --enable-pmsnare --disable-omudpspoof --disable-snmp --disable-mmsnmptrapd --disable-uuid --disable-libgcrypt"
export CONFIG_FLAGS="--prefix=/opt/rsyslog --enable-silent-rules --disable-generate-man-pages --enable-testbench --enable-imdiag --enable-imfile --enable-impstats --enable-mmrm1stspace --enable-mmanon --enable-mmaudit --enable-mmfields --enable-mmjsonparse --enable-mmpstrucdata --enable-mmsequence --enable-mmutf8fix --enable-mail --enable-omprog --enable-omstdout --enable-omuxsock --enable-pmaixforwardedfrom --enable-pmciscoios --enable-pmcisconames --enable-pmlastmsg --enable-pmsnare --disable-omudpspoof --disable-snmp --disable-mmsnmptrapd --disable-uuid --disable-libgcrypt"
./configure $CONFIG_FLAGS
export USE_AUTO_DEBUG="off" # set to "on" to enable this for travis
make -j

View File

@ -42,11 +42,23 @@ rsyslogd_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(LIBLOGGING_STDLOG_CFLAG
# otherwise dependencies are not properly calculated (resulting in a
# potentially incomplete build, a problem we had several times...)
rsyslogd_LDADD = ../grammar/libgrammar.la ../runtime/librsyslog.la ../compat/compat.la $(ZLIB_LIBS) $(PTHREADS_LIBS) $(RSRT_LIBS) $(SOL_LIBS) $(LIBUUID_LIBS)
# if you know how to do an "if AIX os OS_APPLE" or an elseif chain, let me now!
#rsyslogd_LDFLAGS = -export-dynamic \
# -Wl,$(top_builddir)/runtime/.libs/librsyslog.a
#if OS_LINUX
rsyslogd_LDFLAGS = -export-dynamic \
#-Wl,--whole-archive,$(top_builddir)/runtime/.libs/librsyslog.a,--no-whole-archive
#endif
if OS_APPLE
rsyslogd_LDFLAGS = -export-dynamic \
-Wl,$(top_builddir)/runtime/.libs/librsyslog.a
endif
if AIX
rsyslogd_LDFLAGS = -export-dynamic
else
rsyslogd_LDFLAGS = -export-dynamic \
-Wl,--whole-archive,$(top_builddir)/runtime/.libs/librsyslog.a,--no-whole-archive
#else
#rsyslogd_LDFLAGS = -export-dynamic \
#-Wl,--whole-archive,$(top_builddir)/runtime/.libs/librsyslog.a,--no-whole-archive
endif
EXTRA_DIST = $(man_MANS) \