summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-05-21 23:07:52 +0000
committerRoy Marples <roy@marples.name>2014-05-21 23:07:52 +0000
commit26c177737ee4c0c6dbe0bd33208a25574073c4b1 (patch)
tree940f22ddb6a2e870bbdb91f2ac9ec67827eb203b /configure
parentd8cb89586bb3eb504a0ba71177731e1f4aeb538b (diff)
downloaddhcpcd-26c177737ee4c0c6dbe0bd33208a25574073c4b1.tar.xz
Source now compiles on Solaris, just missing the if-sun.c support so
linking fails.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure61
1 files changed, 59 insertions, 2 deletions
diff --git a/configure b/configure
index d01914ad..9e9c25cc 100755
--- a/configure
+++ b/configure
@@ -301,7 +301,7 @@ if [ -e "$LDELF" ]; then
fi
case "$OS" in
-linux*) ;;
+linux*|sunos*) ;;
*)
if ! [ -x "$LDELF" -o -x /libexec/ld-elf.so.[0-9]* ] && \
[ -z "$PREFIX" -o "$PREFIX" = "/" ]
@@ -332,7 +332,7 @@ CFLAGS+= -Wmissing-prototypes -Wmissing-declarations
CFLAGS+= -Wmissing-noreturn -Wmissing-format-attribute
CFLAGS+= -Wnested-externs
CFLAGS+= -Winline -Wwrite-strings -Wcast-align -Wcast-qual
-CFLAGS+= -Wpointer-arith -Wstrict-overflow
+CFLAGS+= -Wpointer-arith
CFLAGS+= -Wdeclaration-after-statement
CFLAGS+= -Wconversion
EOF
@@ -340,6 +340,11 @@ EOF
mirbsd*|openbsd*);; # OpenBSD has many redundant decs in system headers
*) echo "CFLAGS+= -Wredundant-decls" >>$CONFIG_MK;;
esac
+
+ case "$OS" in
+ sunos*);;
+ *) echo "CFLAGS+= -Wstrict-overflow" >>$CONFIG_MF;;
+ esac
fi
if [ -z "$EMBEDDED" -o "$EMBEDDED" = yes ]; then
@@ -366,6 +371,11 @@ kfreebsd*)
echo "DHCPCD_SRCS+= if-bsd.c" >>$CONFIG_MK
echo "COMPAT_SRCS+= compat/linkaddr.c" >>$CONFIG_MK
;;
+sunos*)
+# echo "CSTD= gnu99" >>$CONFIG_MK
+ echo "CPPFLAGS+= -D_XPG4_2 -D__EXTENSIONS__ -DBSD_COMP" \
+ >>$CONFIG_MK
+ ;;
*)
echo "DHCPCD_SRCS+= if-bsd.c" >>$CONFIG_MK
;;
@@ -397,6 +407,9 @@ int main(void) {
EOF
if $XCC _getifaddrs.c -o _getifaddrs 2>/dev/null; then
echo "yes"
+elif $XCC _getifaddrs.c -o _getifaddrs -lsocket >/dev/null; then
+ echo "yes (-lsocket)"
+ echo "LDADD+= -lsocket" >>$CONFIG_MK
else
echo "no"
echo "libc support for getifaddrs is required - aborting" >&2
@@ -426,6 +439,29 @@ fi
rm -f _clock_gettime.c _clock_gettime
$abort && exit 1
+printf "Testing for inet_ntoa ... "
+cat <<EOF >_inet_ntoa.c
+#include <netinet/in.h>
+#include <arpa/inet.h>
+int main(void) {
+ struct in_addr in;
+ inet_ntoa(in);
+ return 0;
+}
+EOF
+if $XCC _inet_ntoa.c -o _inet_ntoa 2>/dev/null; then
+ echo "yes"
+elif $XCC _inet_ntoa.c -lnsl -o _inet_ntoa 2>/dev/null; then
+ echo "yes (-lnsl)"
+ echo "LDADD+= -lnsl" >>$CONFIG_MK
+else
+ echo "no"
+ echo "libc support for inet_ntoa is required - aborting" >&2
+ abort=true
+fi
+rm -f _inet_ntoa.c _inet_ntoa
+$abort && exit 1
+
if [ -z "$ARC4RANDOM" ]; then
printf "Testing for arc4random ... "
cat <<EOF >_arc4random.c
@@ -519,6 +555,27 @@ if [ "$STRLCPY" = no ]; then
echo "#include \"compat/strlcpy.h\"" >>$CONFIG_H
fi
+if [ -z "$DPRINTF" ]; then
+ printf "Testing for dprintf ... "
+ cat <<EOF >_dprintf.c
+#include <stdio.h>
+int main(void) {
+ return dprintf(0, "%d", 0);
+}
+EOF
+ if $XCC _dprintf.c -o _dprintf 2>/dev/null; then
+ DPRINTF=yes
+ else
+ DPRINTF=no
+ fi
+ echo "$DPRINTF"
+ rm -f _dprintf.c _dprintf
+fi
+if [ "$DPRINTF" = no ]; then
+ echo "COMPAT_SRCS+= compat/dprintf.c" >>$CONFIG_MK
+ echo "#include \"compat/dprintf.h\"" >>$CONFIG_H
+fi
+
if [ -z "$TAILQ_FOREACH_SAFE" ]; then
printf "Testing for TAILQ_FOREACH_SAFE ... "
cat <<EOF >_queue.c