summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-05-24 13:08:29 +0000
committerRoy Marples <roy@marples.name>2014-05-24 13:08:29 +0000
commiteb33667132656e033e767dd9d4a9a2446607d6eb (patch)
tree3ef7e783cd158c6bf291c72e0358d55352ad510a /configure
parent26c177737ee4c0c6dbe0bd33208a25574073c4b1 (diff)
downloaddhcpcd-eb33667132656e033e767dd9d4a9a2446607d6eb.tar.xz
Add a compat syslog function if the libc syslog does not support LOG_PERROR.
Add a non working if-sun.c stub. Define IN6_IFF_TENTATIVE and friends to zero so IPv6 at least compiles on Solaris. Warn that Solaris support presently does not work.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure32
1 files changed, 31 insertions, 1 deletions
diff --git a/configure b/configure
index 9e9c25cc..c048c5fa 100755
--- a/configure
+++ b/configure
@@ -372,9 +372,16 @@ kfreebsd*)
echo "COMPAT_SRCS+= compat/linkaddr.c" >>$CONFIG_MK
;;
sunos*)
-# echo "CSTD= gnu99" >>$CONFIG_MK
+ echo "WARNING!!! Solaris support is at early development stage!" >&2
+ echo "so don't expect it to work just yet, patches welcome" >&2
echo "CPPFLAGS+= -D_XPG4_2 -D__EXTENSIONS__ -DBSD_COMP" \
>>$CONFIG_MK
+ echo "DHCPCD_SRCS+= if-sun.c" >>$CONFIG_MK
+
+ # IPv6 won't work, but it will at least compile.
+ echo "CPPFLAGS+= -DIN6_IFF_DETACHED=0" >>$CONFIG_MK
+ echo "CPPFLAGS+= -DIN6_IFF_TENTATIVE=0" >>$CONFIG_MK
+ echo "CPPFLAGS+= -DIN6_IFF_DUPLICATED=0" >>$CONFIG_MK
;;
*)
echo "DHCPCD_SRCS+= if-bsd.c" >>$CONFIG_MK
@@ -719,6 +726,29 @@ pselect)
;;
esac
+if [ -z "$LOG_PERROR" ]; then
+ printf "Testing for LOG_PERROR ... "
+ cat <<EOF >_log_perror.c
+#include <syslog.h>
+int main(void) {
+ openlog("test", LOG_PERROR, LOG_DAEMON);
+ return 0;
+}
+EOF
+ if $XCC _log_perror.c -o _log_perror 2>/dev/null; then
+ LOG_PERROR=yes
+ else
+ LOG_PERROR=no
+ fi
+ echo "$LOG_PERROR"
+ rm -f _log_perror.c _log_perror
+fi
+if [ "$LOG_PERROR" = no ]; then
+ echo "COMPAT_SRCS+= compat/psyslog.c" >>$CONFIG_MK
+ echo "#include \"compat/psyslog.h\"" >>$CONFIG_H
+ echo "#define syslog psyslog" >>$CONFIG_H
+fi
+
if [ -z "$MD5" ]; then
MD5_LIB=
printf "Testing for MD5Init ... "