From b3de9d5c20bf0ccfb940649645d0a673c7ceaf7b Mon Sep 17 00:00:00 2001 From: fedor Date: Fri, 11 May 2001 22:23:11 +0000 Subject: [PATCH] Add check for tiff git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9922 72102866-910b-0410-8b05-ffd578937521 --- .cvsignore | 1 + ChangeLog | 6 + Source/GNUmakefile | 1 + Source/GNUmakefile.preamble | 2 +- config.make.in | 7 ++ configure | 228 ++++++++++++++++++++++++++++++++++-- configure.in | 43 ++++++- 7 files changed, 278 insertions(+), 10 deletions(-) create mode 100644 config.make.in diff --git a/.cvsignore b/.cvsignore index 4431a8f93..09ece0689 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,5 +1,6 @@ config.log config.status config.cache +config.make gnustep-gui.spec gnustep-gui-debug.spec diff --git a/ChangeLog b/ChangeLog index 7cd97ef08..84003ae3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-05-11 Adam Fedor + + * configure.in: Check for tiffio.h. Add path to include dirs + * config.make.in: New file + * Source/GNUmakefile: Include config.make + 2001-05-07 Adam Fedor * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Abort diff --git a/Source/GNUmakefile b/Source/GNUmakefile index a22394c87..6a2a28aa1 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -32,6 +32,7 @@ GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version +include ../config.make # The library to be compiled LIBRARY_NAME=libgnustep-gui diff --git a/Source/GNUmakefile.preamble b/Source/GNUmakefile.preamble index a33599871..59be0a791 100644 --- a/Source/GNUmakefile.preamble +++ b/Source/GNUmakefile.preamble @@ -68,7 +68,7 @@ ADDITIONAL_OBJCFLAGS = -Wall # ADDITIONAL_CFLAGS = # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS = -I../Headers +ADDITIONAL_INCLUDE_DIRS += -I../Headers # Additional LDFLAGS to pass to the linker # ADDITIONAL_LDFLAGS = diff --git a/config.make.in b/config.make.in new file mode 100644 index 000000000..a7b567353 --- /dev/null +++ b/config.make.in @@ -0,0 +1,7 @@ +# -*-makefile-*- +# Extra make variables for gui library +# + +ADDITIONAL_INCLUDE_DIRS += @ADDITIONAL_INCLUDE_DIRS@ +ADDITIONAL_LDFLAGS += @ADDITIONAL_LDFLAGS@ + diff --git a/configure b/configure index 3cae3277d..1619b6b98 100755 --- a/configure +++ b/configure @@ -11,6 +11,10 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: +ac_help="$ac_help + --with-tiff-library=DIR TIFF library file are in DIR" +ac_help="$ac_help + --with-tiff-include=DIR TIFF include files are in DIR" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -525,7 +529,7 @@ fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:529: checking for main in -lm" >&5 +echo "configure:533: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -533,14 +537,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -570,12 +574,12 @@ fi for ac_func in rintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:574: checking for $ac_func" >&5 +echo "configure:578: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -623,6 +627,208 @@ fi done +#-------------------------------------------------------------------- +# Find for TIFF +# Do a superficial find only - The tiff library is actually linked with +# the backend, and typically in conjunction with other graphic libraries. +#-------------------------------------------------------------------- +# Check whether --with-tiff_library or --without-tiff_library was given. +if test "${with_tiff_library+set}" = set; then + withval="$with_tiff_library" + : +else + with_tiff_library= +fi + +# Check whether --with-tiff_include or --without-tiff_include was given. +if test "${with_tiff_include+set}" = set; then + withval="$with_tiff_include" + : +else + with_tiff_include= +fi + + +save_cpp=${CPPFLAGS} +save_ldf=${LDFLAGS} +if test "$with_tiff_include" != ""; then + CPPFLAGS="-I$with_tiff_include ${CPPFLAGS}" + ADDITIONAL_INCLUDE_DIRS="-I$with_tiff_include" +fi +if test -n "$with_tiff_library"; then + LDFLAGS="-L$with_tiff_library $LDFLAGS" + ADDITIONAL_LDFLAGS="-L$with_tiff_library" +fi +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:664: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 +echo "configure:745: checking for tiffio.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + +if test $ac_cv_header_tiffio_h = no; then + echo "configure: warning: Cannot find libtiff header tiffio" 1>&2 + echo "* The GUI library requres the TIFF library" + echo "* Use --with-tiff-include to specify the tiff header directory" + echo "* and --with-tiff-library to specify the tiff library directory" + echo "* if it is not in the usual place(s)" + { echo "configure: error: gnustep-gui will not compile without tiff includes" 1>&2; exit 1; } +fi +echo $ac_n "checking for main in -ltiff""... $ac_c" 1>&6 +echo "configure:785: checking for main in -ltiff" >&5 +ac_lib_var=`echo tiff'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ltiff $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo tiff | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +CPPFLAGS="$save_cpp" +LDFLAGS="$save_ldf" + + + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -723,7 +929,7 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo " Headers/gnustep/gui/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "config.make Headers/gnustep/gui/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -971,3 +1180,6 @@ test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + + + diff --git a/configure.in b/configure.in index c349d61be..dfa3f3d52 100644 --- a/configure.in +++ b/configure.in @@ -30,6 +30,47 @@ AC_CONFIG_HEADER(Headers/gnustep/gui/config.h) AC_CHECK_LIB(m, main) AC_CHECK_FUNCS(rintf) -AC_OUTPUT() +#-------------------------------------------------------------------- +# Find for TIFF +# Do a superficial find only - The tiff library is actually linked with +# the backend, and typically in conjunction with other graphic libraries. +#-------------------------------------------------------------------- +AC_ARG_WITH(tiff_library, + [ --with-tiff-library=DIR TIFF library file are in DIR], , + with_tiff_library=) +AC_ARG_WITH(tiff_include, + [ --with-tiff-include=DIR TIFF include files are in DIR], , + with_tiff_include=) + +save_cpp=${CPPFLAGS} +save_ldf=${LDFLAGS} +if test "$with_tiff_include" != ""; then + CPPFLAGS="-I$with_tiff_include ${CPPFLAGS}" + ADDITIONAL_INCLUDE_DIRS="-I$with_tiff_include" +fi +if test -n "$with_tiff_library"; then + LDFLAGS="-L$with_tiff_library $LDFLAGS" + ADDITIONAL_LDFLAGS="-L$with_tiff_library" +fi +AC_CHECK_HEADER(tiffio.h) +if test $ac_cv_header_tiffio_h = no; then + AC_MSG_WARN(Cannot find libtiff header tiffio) + echo "* The GUI library requres the TIFF library" + echo "* Use --with-tiff-include to specify the tiff header directory" + echo "* and --with-tiff-library to specify the tiff library directory" + echo "* if it is not in the usual place(s)" + AC_MSG_ERROR(gnustep-gui will not compile without tiff includes) +fi +AC_CHECK_LIB(tiff, main) +CPPFLAGS="$save_cpp" +LDFLAGS="$save_ldf" + +AC_SUBST(ADDITIONAL_LDFLAGS) +AC_SUBST(ADDITIONAL_INCLUDE_DIRS) + +AC_OUTPUT(config.make) + + +