From b19fa66f5164fa81afd55016ba56dcc4f2ba3e24 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 8 Jul 2008 13:08:46 +0000 Subject: [PATCH] * SunOS / Solaris compilation fixes --- Makefile | 11 ++++++----- configure | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 224f46a1..07479195 100644 --- a/Makefile +++ b/Makefile @@ -11,13 +11,14 @@ MANDIR=/usr/local/man # __BSD_VISIBLE is for FreeBSD AF_* constants # _ALL_SOURCE is for AIX 5.3 LOG_PERROR constant # +NAME=cntlm CC=gcc +VER=`cat VERSION` OBJS=utils.o ntlm.o xcrypt.o config.o socket.o acl.o auth.o http.o proxy.o CFLAGS=$(FLAGS) -std=c99 -Wall -pedantic -O3 -D__BSD_VISIBLE -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112 -D_ISOC99_SOURCE -D_REENTRANT -DVERSION=\"`cat VERSION`\" -LDFLAGS=-lpthread -NAME=cntlm -VER=`cat VERSION` -DIR=`pwd` +OS=$(shell uname -s) +OSLDFLAGS=$(shell [ $(OS) = "SunOS" ] && echo "-lrt -lsocket -lnsl") +LDFLAGS:=-lpthread $(OSLDFLAGS) $(NAME): configure-stamp $(OBJS) @echo "Linking $@" @@ -61,7 +62,7 @@ rpm: tgz: mkdir -p tmp rm -f tmp/$(NAME)-$(VER) - ln -s $(DIR) tmp/$(NAME)-$(VER) + ln -s $(PWD) tmp/$(NAME)-$(VER) sed "s/^\./$(NAME)-$(VER)/" doc/files.txt | tar zchf $(NAME)-$(VER).tar.gz --no-recursion -C tmp -T - rm tmp/$(NAME)-$(VER) rmdir tmp 2>/dev/null || true diff --git a/configure b/configure index 5146d865..473a4d6f 100755 --- a/configure +++ b/configure @@ -6,8 +6,8 @@ # # To prevent ugly Makefile extensions, underscore and chars following it # in the name XXX are automatically removed before locating relevant -# Makefile. This is why compiler "xlc_r" has automatic Makefile extension -# just "xlc". This can be disabled if neccessary. +# Makefile. This is why compiler "xlc_r" has Makefile extension "xlc". +# This can be disabled if neccessary. # CCS="xlc_r gcc" @@ -16,7 +16,7 @@ CCS="xlc_r gcc" # Look for supported compilers # for c in $CCS; do - if CCPATH=`which $c 2>&1`; then + if CCPATH=`which $c 2>&1` && [ `expr substr "$CCPATH" 1 1` = "/" ]; then CC="$c" break fi