From a2558120749e27f619dff2dfbcb41c85920fc673 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Tue, 3 Apr 2001 03:51:57 +0000 Subject: [PATCH] added Darwin test to see if -lm needed --- ChangeLog | 3 +++ config.site | 4 ++-- configure | 24 +++++++++++++++++++----- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8660b400..8962a94a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-04-02 Frank Warmerdam + * configure/config.site: modified to check if -lm is needed for + MACHDEPLIBS if not supplied by config.site. Needed for Darwin. + * config.guess: updated wholesale to an FSF version apparently from 1998 (as opposed to 1994). This is mainly inspired by providing for MacOS X support. diff --git a/config.site b/config.site index 0650e2c3..ee81b622 100644 --- a/config.site +++ b/config.site @@ -1,4 +1,4 @@ -# $Header: /cvs/maptools/cvsroot/libtiff/Attic/config.site,v 1.3 2001-03-30 01:55:32 warmerda Exp $ +# $Header: /cvs/maptools/cvsroot/libtiff/Attic/config.site,v 1.4 2001-04-03 03:51:57 warmerda Exp $ # # TIFF Software # @@ -134,7 +134,7 @@ #GCOPTS="-g" # options to pass C compiler #OPTIMIZER="-O" # Optimization options for compiler #LIBPORT='${PORT}/libport.a' # library with emulation code -#MACHDEPLIBS="" # extra libraries for linking +#MACHDEPLIBS="-lm" # extra libraries for linking #PORTFUNCS="" # non-standard functions to emulate #RANLIB=":" # pathname of suitable ranlib program #DSOSUF="so" # DSO filename suffix diff --git a/configure b/configure index fa1bd2d2..635da62b 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #!/bin/sh -# $Header: /cvs/maptools/cvsroot/libtiff/configure,v 1.11 2001-03-30 01:55:32 warmerda Exp $ +# $Header: /cvs/maptools/cvsroot/libtiff/configure,v 1.12 2001-04-03 03:51:57 warmerda Exp $ # # Tag Image File Format (TIFF) Software # @@ -57,7 +57,6 @@ PORT=auto # enable portability emulations HTML=no # install HTML documentation LIBGL=auto # auto-enable build of SGI -lgl apps LIBIMAGE=auto # auto-enable build of SGI -limage apps -MACHDEPLIBS=-lm # machine-dependent libraries for apps : ${CC=} # name of C compiler to use : ${CCOMPILER=} # full pathname of C compiler : ${OPTIMIZER=-O} # Optimization flag @@ -153,7 +152,7 @@ do -target|--target) ac_prev=TARGET;; -target=*|--target=*) TARGET="$ac_optarg" ;; -version|--version) - echo "This is TIFF configure $Revision: 1.11 $" + echo "This is TIFF configure $Revision: 1.12 $" exit 0 ;; -help|--help) usage; exit 0;; @@ -592,10 +591,10 @@ if [ -z "${GCOPTS-}" ]; then if capture $CCOMPILER $ENVOPTS -g -c dummy.c; then Note "Looks like $CCOMPILER supports the -g option." # NB: cannot use captureX here 'cuz we lose stderr - if $CCOMPILER $ENVOPTS -c -g -O dummy.c >t 2>&1 && CheckForGandO t; then + if $CCOMPILER $ENVOPTS -c -g $OPTIMIZER dummy.c >t 2>&1 && CheckForGandO t; then GCOPTS="-g" else - Note "... but not together with the -O option, not using it." + Note "... but not together with the $OPTIMIZER option, not using it." GCOPTS= fi else @@ -764,6 +763,21 @@ CheckForFunc() runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c ${MACHDEPLIBS}" } +# +# Verify that we have -lm. Darwin (for instance) does not. Add to +# MACHDEPLIBS if required. +# + +if [ -z "${MACHDEPLIBS-}" ]; then + MACHDEPLIBS="" + if ! CheckForFunc cos ; then + MACHDEPLIBS="-lm" + echo "Defaulting MACHDEPLIBS to -lm." + else + echo "Leaving MACHDEPLIBS empty, apparently you don't need -lm." + fi +fi + # # Look for a function declaration in system include files. #