From f0d3b7afa9bd02df53ab98c3e8ff9463664be1f7 Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 28 Aug 2015 12:20:00 +0300 Subject: [PATCH] 0026615: Configuration, genconfdeps.tcl - do not search for FreeImagePlus on non-Windows --- adm/genconfdeps.tcl | 49 ++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/adm/genconfdeps.tcl b/adm/genconfdeps.tcl index 602426d8dc..5e32ecf995 100644 --- a/adm/genconfdeps.tcl +++ b/adm/genconfdeps.tcl @@ -426,43 +426,56 @@ proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theEr set aFImagePlusDist "Wrapper/FreeImagePlus/dist" set isFound "true" - set aFImageHPath [wokdep:SearchHeader "FreeImage.h"] - set aFImagePlusHPath [wokdep:SearchHeader "FreeImagePlus.h"] - if { "$aFImageHPath" == "" || "$aFImagePlusHPath" == "" } { + set aFImageHPath [wokdep:SearchHeader "FreeImage.h"] + if { "$aFImageHPath" == "" } { set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$::ARCH" ] - if { "$aPath" != "" && [file exists "$aPath/include/FreeImage.h"] && [file exists "$aPath/include/FreeImagePlus.h"] } { + if { "$aPath" != "" && [file exists "$aPath/include/FreeImage.h"] } { lappend ::CSF_OPT_INC "$aPath/include" - } elseif { "$aPath" != "" && [file exists "$aPath/$aFImageDist/FreeImage.h"] && [file exists "$aPath/$aFImagePlusDist/FreeImagePlus.h"] } { + } elseif { "$aPath" != "" && [file exists "$aPath/$aFImageDist/FreeImage.h"] } { lappend ::CSF_OPT_INC "$aPath/$aFImageDist" - lappend ::CSF_OPT_INC "$aPath/$aFImagePlusDist" + if { [file exists "$aPath/$aFImagePlusDist/FreeImagePlus.h"] } { + lappend ::CSF_OPT_INC "$aPath/$aFImagePlusDist" + } } else { - lappend anErrInc "Error: 'FreeImage.h' or 'FreeImagePlus.h' not found (FreeImage)" + lappend anErrInc "Error: 'FreeImage.h' not found (FreeImage)" set isFound "false" } } + set aFImagePlusHPath [wokdep:SearchHeader "FreeImagePlus.h"] + if { "$::tcl_platform(platform)" == "windows" && "$aFImagePlusHPath" == "" } { + lappend anErrInc "Error: 'FreeImagePlus.h' not found (FreeImage)" + set isFound "false" + } + foreach anArchIter {64 32} { - set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter"] - set aFImagePlusLibPath [wokdep:SearchLib "freeimageplus" "$anArchIter"] - if { "$aFImageLibPath" == "" || "$aFImagePlusLibPath" == "" } { + set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter"] + if { "$aFImageLibPath" == "" } { set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ] - set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/lib"] - set aFImagePlusLibPath [wokdep:SearchLib "freeimageplus" "$anArchIter" "$aPath/lib"] - if { "$aFImageLibPath" != "" && "$aFImagePlusLibPath" != "" } { + set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/lib"] + if { "$aFImageLibPath" != "" } { lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib" } else { - set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/$aFImageDist"] - set aFImagePlusLibPath [wokdep:SearchLib "freeimageplus" "$anArchIter" "$aPath/$aFImagePlusDist"] - if { "$aFImageLibPath" != "" && "$aFImagePlusLibPath" != "" } { + set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/$aFImageDist"] + if { "$aFImageLibPath" != "" } { lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImageDist" - lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImagePlusDist" + set aFImagePlusLibPath [wokdep:SearchLib "freeimageplus" "$anArchIter" "$aPath/$aFImagePlusDist"] + if { "$aFImagePlusLibPath" != "" } { + lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImagePlusDist" + } } else { - lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimage.${::SYS_LIB_SUFFIX}' or '${::SYS_LIB_PREFIX}freeimageplus.${::SYS_LIB_SUFFIX}' not found (FreeImage)" + lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimage.${::SYS_LIB_SUFFIX}' not found (FreeImage)" if { "$::ARCH" == "$anArchIter"} { set isFound "false" } } } } if { "$::tcl_platform(platform)" == "windows" } { + set aFImagePlusLibPath [wokdep:SearchLib "freeimageplus" "$anArchIter"] + if { "$aFImagePlusLibPath" == "" } { + lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimageplus.${::SYS_LIB_SUFFIX}' not found (FreeImage)" + if { "$::ARCH" == "$anArchIter"} { set isFound "false" } + } + set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter"] set aFImagePlusDllPath [wokdep:SearchBin "freeimageplus.dll" "$anArchIter"] if { "$aFImageDllPath" == "" || "$aFImagePlusDllPath" == "" } { -- 2.20.1