$NetBSD: patch-aa,v 1.9 2013/10/25 06:25:18 dholland Exp $ - always set the compiler to "gcc" for pkgsrc - honor pkgsrc LDFLAGS --- configure.orig 2010-07-09 12:41:23.000000000 +0000 +++ configure @@ -65,8 +65,8 @@ chmod +x script/harch || exit 1 MACHINE=`script/harch` case $MACHINE in - powerpc-Darwin[56]) CCC=${CC-cc} ;; - *) CCC=${CC-gcc} ; ;; + powerpc-Darwin*) CCC=gcc;; + *) CCC=gcc;; esac STRIP=${STRIP} @@ -482,16 +482,16 @@ main() { void test (void) { mvaddstr(1,2,"hello world"); } int main (void) { test(); } !!! - if $CCC $COPTS -m32 -o curses curses.c >/dev/null 2>/dev/null + if $CCC $COPTS $LDFLAGS -m32 -o curses curses.c >/dev/null 2>/dev/null then CURSES="" else - if $CCC $COPTS -m32 -o curses curses.c -lncurses >/dev/null 2>/dev/null + if $CCC $COPTS $LDFLAGS -m32 -o curses curses.c -lncurses >/dev/null 2>/dev/null then CURSES="-lncurses" else - if $CCC $COPTS -m32 -o curses curses.c -lcurses >/dev/null 2>/dev/null + if $CCC $COPTS $LDFLAGS -m32 -o curses curses.c -lcurses >/dev/null 2>/dev/null then CURSES="-lcurses" else - if $CCC $COPTS -m32 -o curses curses.c -lcurses -ltermcap >/dev/null 2>/dev/null + if $CCC $COPTS $LDFLAGS -m32 -o curses curses.c -lcurses -ltermcap >/dev/null 2>/dev/null then CURSES="-lcurses -ltermcap" else CURSES="-ltermcap -lcurses" # don't know a good default? fi @@ -508,10 +508,10 @@ int main (void) { test(); } echo -n "Testing for the readline library: " echo 'main(){readline();}' >rd.c - if ${CCC} $COPTS -m32 -o rd.out rd.c -lreadline >/dev/null 2>&1 + if ${CCC} $COPTS $LDFLAGS -m32 -o rd.out rd.c -lreadline >/dev/null 2>&1 then echo ' -lreadline (detected)' READLINE="-DUSE_READLINE=1 -lreadline" - else if ${CCC} $COPTS -m32 -o rd.out rd.c -lreadline $CURSES >/dev/null 2>&1 + else if ${CCC} $COPTS $LDFLAGS -m32 -o rd.out rd.c -lreadline $CURSES >/dev/null 2>&1 then echo " -lreadline $CURSES (detected)" READLINE="-DUSE_READLINE=1 -lreadline $CURSES" else echo ' no (detected)'