Do not hardcode gcc

This commit is contained in:
dcoppa 2017-02-27 10:09:05 +00:00
parent b1047f4533
commit 5b0b39b898
2 changed files with 62 additions and 2 deletions

View File

@ -1,6 +1,15 @@
$OpenBSD: patch-Makefile,v 1.6 2013/06/05 09:29:56 dcoppa Exp $
$OpenBSD: patch-Makefile,v 1.7 2017/02/27 10:09:05 dcoppa Exp $
--- Makefile.orig Fri Apr 20 02:28:07 2012
+++ Makefile Wed Jun 5 10:47:08 2013
+++ Makefile Mon Feb 27 11:03:47 2017
@@ -13,7 +13,7 @@ MANDIR := $(DESTDIR)/usr/share/man
# _ALL_SOURCE is for AIX 5.3 LOG_PERROR constant
#
NAME := cntlm
-CC := gcc
+CC ?= gcc
VER := $(shell cat VERSION)
OS := $(shell uname -s)
OSLDFLAGS := $(shell [ $(OS) = "SunOS" ] && echo "-lrt -lsocket -lnsl")
@@ -23,7 +23,7 @@ CYGWIN_REQS := cygwin1.dll cyggcc_s-1.dll cygstdc++-6.
ifeq ($(DEBUG),1)
CFLAGS += -g -std=c99 -Wall -pedantic -D__BSD_VISIBLE -D_ALL_SOURCE -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112 -D_ISOC99_SOURCE -D_REENTRANT -D_BSD_SOURCE -DVERSION=\"'$(VER)'\"

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-configure,v 1.1 2017/02/27 10:09:05 dcoppa Exp $
--- configure.orig Mon Feb 27 10:55:40 2017
+++ configure Mon Feb 27 10:58:21 2017
@@ -10,47 +10,6 @@
# This can be disabled if neccessary.
#
-CCS="xlc_r gcc"
-
-#
-# Look for supported compilers
-#
-for c in $CCS; do
- if CCPATH=`which $c 2>&1` && [ -z "${CCPATH%%/*}" ]; then
- CC="$c"
- break
- fi
-done
-
-#
-# Make a link to a proper Makefile.*
-#
-if [ -z "$CC" ]; then
- echo "Unable to find GNU GCC or IBM XL C/C++. Fix your PATH!"
- exit 1
-else
- echo "Using $CCPATH to compile Cntlm"
- [ -h Makefile ] && rm -f Makefile 2>/dev/null
- case "$CC" in
- gcc)
- # default Makefile is for GCC; just revert back to
- # GCC if Makefile is linked to other compiler version
- if [ ! -f Makefile ]; then
- mv Makefile.gcc Makefile
- fi
- ;;
- *)
- # backup default GCC Makefile and create a link to other
- if [ -f Makefile ]; then
- mv Makefile Makefile.gcc
- fi
-
- EXT=`echo "$CC" | sed 's/_.*//'`
- ln -s Makefile.$EXT Makefile
- ;;
- esac
-fi
-
STAMP=configure-stamp
CONFIG=config/config.h
TESTS="endian strdup socklen_t gethostname"