Changeset 2990

Show
Ignore:
Timestamp:
12/03/99 17:00:09 (14 years ago)
Author:
ucacoxh
Message:

- Tweaks to tcl/tk/common path searching (that I wish I'd never started...)

Location:
rat/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • rat/trunk/configure

    r2989 r2990  
    2121  --with-tcl=DIR          specify location of Tcl installation" 
    2222ac_help="$ac_help 
    23   --with-tk=DIR           specify location of Tk installation" 
     23  --with-tk=DIR          specify location of Tk installation" 
    2424ac_help="$ac_help 
    2525  --with-common=DIR       specify location of UCL's common library" 
     
    30653065# TCL/TK  
    30663066# Hopefully using UCL modified Tcl/Tk. 
     3067 
    30673068PARENT=`echo $PWD | sed -e 's%/[^/]*$%%'` 
    3068 TCL_INC=${PARENT}/tcl-8.0/generic 
    3069 TCL_LIB=${PARENT}/tcl-8.0/unix 
     3069TCL_INC=${PARENT}/tcl-8.0 
     3070TCL_LIB=${PARENT}/tcl-8.0 
    30703071 
    30713072# Check whether --with-tcl or --without-tcl was given. 
    30723073if test "${with_tcl+set}" = set; then 
    30733074  withval="$with_tcl" 
    3074    TCL_INC=$withval/include 
    3075           TCL_LIB=$withval/lib 
    3076 fi 
    3077  
     3075   TCL_INC=$withval 
     3076          TCL_LIB=$withval 
     3077fi 
     3078 
     3079 
     3080# Depending on config expect tcl.h to be tcl source dir or include path 
     3081for i in $TCL_INC/generic $TCL_INC/include/tcl8.0 $TCL_INC/include $TCL_INC 
     3082do 
     3083        if test -d $i ; then 
     3084                TCL_INC=$i 
     3085                break 
     3086        fi 
     3087done 
    30783088 
    30793089ac_safe=`echo "${TCL_INC}/tcl.h" | sed 'y%./+-%__p_%'` 
    30803090echo $ac_n "checking for ${TCL_INC}/tcl.h""... $ac_c" 1>&6 
    3081 echo "configure:3082: checking for ${TCL_INC}/tcl.h" >&5 
     3091echo "configure:3092: checking for ${TCL_INC}/tcl.h" >&5 
    30823092if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 
    30833093  echo $ac_n "(cached) $ac_c" 1>&6 
    30843094else 
    30853095  cat > conftest.$ac_ext <<EOF 
    3086 #line 3087 "configure" 
     3096#line 3097 "configure" 
    30873097#include "confdefs.h" 
    30883098#include <${TCL_INC}/tcl.h> 
    30893099EOF 
    30903100ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 
    3091 { (eval echo configure:3092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
     3101{ (eval echo configure:3102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
    30923102ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 
    30933103if test -z "$ac_err"; then 
     
    31053115if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 
    31063116  echo "$ac_t""yes" 1>&6 
    3107   TCL_INC=-I${TCL_INC} 
     3117  TCL_INC=-I${inc} 
     3118         break 
    31083119else 
    31093120  echo "$ac_t""no" 1>&6 
    3110 ac_safe=`echo "${TCL_INC}/tcl8.0/tcl.h" | sed 'y%./+-%__p_%'` 
    3111 echo $ac_n "checking for ${TCL_INC}/tcl8.0/tcl.h""... $ac_c" 1>&6 
    3112 echo "configure:3113: checking for ${TCL_INC}/tcl8.0/tcl.h" >&5 
    3113 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 
    3114   echo $ac_n "(cached) $ac_c" 1>&6 
    3115 else 
    3116   cat > conftest.$ac_ext <<EOF 
    3117 #line 3118 "configure" 
    3118 #include "confdefs.h" 
    3119 #include <${TCL_INC}/tcl8.0/tcl.h> 
    3120 EOF 
    3121 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 
    3122 { (eval echo configure:3123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
    3123 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 
    3124 if test -z "$ac_err"; then 
    3125   rm -rf conftest* 
    3126   eval "ac_cv_header_$ac_safe=yes" 
    3127 else 
    3128   echo "$ac_err" >&5 
    3129   echo "configure: failed program was:" >&5 
    3130   cat conftest.$ac_ext >&5 
    3131   rm -rf conftest* 
    3132   eval "ac_cv_header_$ac_safe=no" 
    3133 fi 
    3134 rm -f conftest* 
    3135 fi 
    3136 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 
    3137   echo "$ac_t""yes" 1>&6 
    3138   TCL_INC=-I${TCL_INC}/tcl8.0 
    3139 else 
    3140   echo "$ac_t""no" 1>&6 
    3141   
    3142                         echo "Could not find tcl.h.  One of the following halted progress:" 
    3143                         echo "   (a) Tcl is not installed." 
    3144                         echo "   (b) Tcl's location was mis-specified, or not specified (--with-tcl=DIR)." 
    3145                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    3146                         exit 
    3147                  
    3148 fi 
    3149  
    3150          
    3151 fi 
    3152  
    3153  
    3154 echo $ac_n "checking for Tcl_Init in -ltcl8.0""... $ac_c" 1>&6 
    3155 echo "configure:3156: checking for Tcl_Init in -ltcl8.0" >&5 
    3156 ac_lib_var=`echo tcl8.0'_'Tcl_Init | sed 'y%./+-%__p_%'` 
    3157 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 
    3158   echo $ac_n "(cached) $ac_c" 1>&6 
    3159 else 
    3160   ac_save_LIBS="$LIBS" 
    3161 LIBS="-ltcl8.0 -L${TCL_LIB} -lm $LIBS" 
     3121TCL_INC=no 
     3122fi 
     3123 
     3124 
     3125if test $TCL_INC = no  
     3126then 
     3127        echo "Could not find tcl.h.  One of the following halted progress:" 
     3128        echo "   (a) Tcl is not installed." 
     3129        echo "   (b) Tcl's location was mis-specified, or not specified (--with-tcl=DIR)." 
     3130        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     3131        exit 
     3132fi 
     3133 
     3134# Guess most probable tcl lib location 
     3135for i in $TCL_LIB/unix $TCL_LIB/lib $TCL_LIB 
     3136do 
     3137        if test -d $i ; then 
     3138                TCL_LIB=$i 
     3139                break 
     3140        fi 
     3141done 
     3142 
     3143SAVED_LIBS=$LIBS 
     3144LIBS="" 
     3145FOUND_TCL_LIB=no 
     3146 
     3147echo $ac_n "checking for library containing Tcl_Init""... $ac_c" 1>&6 
     3148echo "configure:3149: checking for library containing Tcl_Init" >&5 
     3149if eval "test \"`echo '$''{'ac_cv_search_Tcl_Init'+set}'`\" = set"; then 
     3150  echo $ac_n "(cached) $ac_c" 1>&6 
     3151else 
     3152  ac_func_search_save_LIBS="$LIBS" 
     3153ac_cv_search_Tcl_Init="no" 
    31623154cat > conftest.$ac_ext <<EOF 
    3163 #line 3164 "configure" 
     3155#line 3156 "configure" 
    31643156#include "confdefs.h" 
    31653157/* Override any gcc2 internal prototype to avoid an error.  */ 
     
    31723164; return 0; } 
    31733165EOF 
    3174 if { (eval echo configure:3175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
    3175   rm -rf conftest* 
    3176   eval "ac_cv_lib_$ac_lib_var=yes" 
    3177 else 
    3178   echo "configure: failed program was:" >&5 
    3179   cat conftest.$ac_ext >&5 
    3180   rm -rf conftest* 
    3181   eval "ac_cv_lib_$ac_lib_var=no" 
    3182 fi 
    3183 rm -f conftest* 
    3184 LIBS="$ac_save_LIBS" 
    3185  
    3186 fi 
    3187 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 
    3188   echo "$ac_t""yes" 1>&6 
    3189   TCL_LIB="-L$TCL_LIB -ltcl8.0" 
    3190 else 
    3191   echo "$ac_t""no" 1>&6 
    3192 echo $ac_n "checking for Tcl_Init in -ltcl80""... $ac_c" 1>&6 
    3193 echo "configure:3194: checking for Tcl_Init in -ltcl80" >&5 
    3194 ac_lib_var=`echo tcl80'_'Tcl_Init | sed 'y%./+-%__p_%'` 
    3195 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 
    3196   echo $ac_n "(cached) $ac_c" 1>&6 
    3197 else 
    3198   ac_save_LIBS="$LIBS" 
    3199 LIBS="-ltcl80 -L${TCL_LIB} -lm $LIBS" 
     3166if { (eval echo configure:3167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
     3167  rm -rf conftest* 
     3168  ac_cv_search_Tcl_Init="none required" 
     3169else 
     3170  echo "configure: failed program was:" >&5 
     3171  cat conftest.$ac_ext >&5 
     3172fi 
     3173rm -f conftest* 
     3174test "$ac_cv_search_Tcl_Init" = "no" && for i in tcl8.0 tcl80; do 
     3175LIBS="-l$i -L${TCL_LIB} -lm $ac_func_search_save_LIBS" 
    32003176cat > conftest.$ac_ext <<EOF 
    3201 #line 3202 "configure" 
     3177#line 3178 "configure" 
    32023178#include "confdefs.h" 
    32033179/* Override any gcc2 internal prototype to avoid an error.  */ 
     
    32103186; return 0; } 
    32113187EOF 
    3212 if { (eval echo configure:3213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
    3213   rm -rf conftest* 
    3214   eval "ac_cv_lib_$ac_lib_var=yes" 
    3215 else 
    3216   echo "configure: failed program was:" >&5 
    3217   cat conftest.$ac_ext >&5 
    3218   rm -rf conftest* 
    3219   eval "ac_cv_lib_$ac_lib_var=no" 
    3220 fi 
    3221 rm -f conftest* 
    3222 LIBS="$ac_save_LIBS" 
    3223  
    3224 fi 
    3225 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 
    3226   echo "$ac_t""yes" 1>&6 
    3227   TCL_LIB="-L$TCL_LIB -ltcl80" 
    3228 else 
    3229   echo "$ac_t""no" 1>&6 
    3230  
    3231                         echo "Could not find Tcl library.  One of the following halted progess:" 
    3232                         echo "   (a) Tcl is not installed." 
    3233                         echo "   (b) Library is not built or not in expected location (--with-tcl=DIR)." 
    3234                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    3235                         exit 
    3236                  
    3237 fi 
    3238  
    3239 fi 
    3240  
    3241  
    3242 TK_INC=${PARENT}/tk-8.0/generic 
    3243 TK_LIB=${PARENT}/tk-8.0/unix 
     3188if { (eval echo configure:3189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
     3189  rm -rf conftest* 
     3190  ac_cv_search_Tcl_Init="-l$i" 
     3191break 
     3192else 
     3193  echo "configure: failed program was:" >&5 
     3194  cat conftest.$ac_ext >&5 
     3195fi 
     3196rm -f conftest* 
     3197done 
     3198LIBS="$ac_func_search_save_LIBS" 
     3199fi 
     3200 
     3201echo "$ac_t""$ac_cv_search_Tcl_Init" 1>&6 
     3202if test "$ac_cv_search_Tcl_Init" != "no"; then 
     3203  test "$ac_cv_search_Tcl_Init" = "none required" || LIBS="$ac_cv_search_Tcl_Init $LIBS" 
     3204  FOUND_TCL_LIB=yes 
     3205else : 
     3206   
     3207fi 
     3208TCL_LIB="-L${TCL_LIB} $LIBS" 
     3209LIBS=$SAVED_LIBS 
     3210 
     3211if test $FOUND_TCL_LIB = no 
     3212then 
     3213        echo "Could not find Tcl library.  One of the following halted progess:" 
     3214        echo "   (a) Tcl is not installed." 
     3215        echo "   (b) Library is not built or not in expected location (--with-tcl=DIR)." 
     3216        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     3217        exit 
     3218fi 
     3219 
     3220TK_INC=${PARENT}/tk-8.0 
     3221TK_LIB=${PARENT}/tk-8.0 
    32443222 
    32453223# Check whether --with-tk or --without-tk was given. 
    32463224if test "${with_tk+set}" = set; then 
    32473225  withval="$with_tk" 
    3248    TK_INC=$withval/include 
    3249           TK_LIB=$withval/lib 
    3250 fi 
    3251  
    3252  
    3253 # NB for tk.h we don't want to compile anything, AC_CHECK_HEADER(S) compiles 
    3254 # a file with specified header, but does not include X and tcl headers. 
    3255 # Could use AC_TRY_CPP with $ac_x_include/Xlib.h, etc... for time being just 
    3256 # check for existence...autoconf generates a warning here. 
    3257  
    3258 ac_safe=`echo "$TK_INC/tk.h" | sed 'y%./+-%__p_%'` 
    3259 echo $ac_n "checking for $TK_INC/tk.h""... $ac_c" 1>&6 
    3260 echo "configure:3261: checking for $TK_INC/tk.h" >&5 
    3261 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then 
    3262   echo $ac_n "(cached) $ac_c" 1>&6 
    3263 else 
    3264   if test "$cross_compiling" = yes; then 
    3265     { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; } 
    3266 else 
    3267   if test -r $TK_INC/tk.h; then 
    3268     eval "ac_cv_file_$ac_safe=yes" 
    3269   else 
    3270     eval "ac_cv_file_$ac_safe=no" 
    3271   fi 
    3272 fi 
    3273 fi 
    3274 if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then 
    3275   echo "$ac_t""yes" 1>&6 
    3276   TK_INC=-I${TK_INC} 
    3277 else 
    3278   echo "$ac_t""no" 1>&6 
    3279  
    3280                  
    3281 ac_safe=`echo "$TK_INC/tk8.0/tk.h" | sed 'y%./+-%__p_%'` 
    3282 echo $ac_n "checking for $TK_INC/tk8.0/tk.h""... $ac_c" 1>&6 
    3283 echo "configure:3284: checking for $TK_INC/tk8.0/tk.h" >&5 
    3284 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then 
    3285   echo $ac_n "(cached) $ac_c" 1>&6 
    3286 else 
    3287   if test "$cross_compiling" = yes; then 
    3288     { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; } 
    3289 else 
    3290   if test -r $TK_INC/tk8.0/tk.h; then 
    3291     eval "ac_cv_file_$ac_safe=yes" 
    3292   else 
    3293     eval "ac_cv_file_$ac_safe=no" 
    3294   fi 
    3295 fi 
    3296 fi 
    3297 if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then 
    3298   echo "$ac_t""yes" 1>&6 
    3299   TK_INC=-I${TK_INC}/tk8.0 
    3300 else 
    3301   echo "$ac_t""no" 1>&6 
    3302   
    3303                         echo "Could not find tk.h.  One of the following halted progress:" 
    3304                         echo "   (a) Tk is not installed." 
    3305                         echo "   (b) Tk's location was mis-specified, or not specified (--with-tk=DIR)." 
    3306                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    3307                         exit 
    3308                  
    3309 fi 
    3310  
    3311          
    3312 fi 
    3313  
    3314  
    3315 echo $ac_n "checking for Tk_Init in -ltk8.0""... $ac_c" 1>&6 
    3316 echo "configure:3317: checking for Tk_Init in -ltk8.0" >&5 
    3317 ac_lib_var=`echo tk8.0'_'Tk_Init | sed 'y%./+-%__p_%'` 
    3318 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 
    3319   echo $ac_n "(cached) $ac_c" 1>&6 
    3320 else 
    3321   ac_save_LIBS="$LIBS" 
    3322 LIBS="-ltk8.0 -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS  -lXext -lX11 $X_EXTRA_LIBS -lm $LIBS" 
     3226   TK_INC=$withval 
     3227          TK_LIB=$withval 
     3228fi 
     3229 
     3230 
     3231# Depending on config expect tk.h to be tk source dir or include path 
     3232# AC_CHECK_HEADER(S) are totally inadequate since it is necessary to 
     3233# include tcl.h, Xlib.h, Xutil.h before tk.h. 
     3234FOUND_TK_INC=0 
     3235for i in $TK_INC/generic $TK_INC/include/tk8.0 $TK_INC/include $TK_INC 
     3236do 
     3237        echo $ac_n "checking $i/tk.h""... $ac_c" 1>&6 
     3238echo "configure:3239: checking $i/tk.h" >&5 
     3239        if test -r $i/tk.h ; then 
     3240                TK_INC=$i 
     3241                FOUND_TK_INC=1 
     3242                echo "$ac_t""yes" 1>&6 
     3243                break 
     3244        fi 
     3245        echo "$ac_t""no" 1>&6 
     3246done 
     3247 
     3248if test $FOUND_TK_INC = 0 ; then 
     3249        echo "Could not find tk.h.  One of the following halted progress:" 
     3250        echo "   (a) Tk is not installed." 
     3251        echo "   (b) Tk's location was mis-specified, or not specified (--with-tk=DIR)." 
     3252        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     3253        exit 
     3254fi 
     3255 
     3256# Guess most probable tk lib location 
     3257for i in $TK_LIB/unix $TK_LIB/lib $TK_LIB 
     3258do 
     3259        if test -d $i ; then 
     3260                TK_LIB=$i 
     3261                break 
     3262        fi 
     3263done 
     3264 
     3265SAVED_LIBS=$LIBS 
     3266LIBS="" 
     3267FOUND_TK_LIB=no 
     3268 
     3269echo $ac_n "checking for library containing Tk_Init""... $ac_c" 1>&6 
     3270echo "configure:3271: checking for library containing Tk_Init" >&5 
     3271if eval "test \"`echo '$''{'ac_cv_search_Tk_Init'+set}'`\" = set"; then 
     3272  echo $ac_n "(cached) $ac_c" 1>&6 
     3273else 
     3274  ac_func_search_save_LIBS="$LIBS" 
     3275ac_cv_search_Tk_Init="no" 
    33233276cat > conftest.$ac_ext <<EOF 
    3324 #line 3325 "configure" 
     3277#line 3278 "configure" 
    33253278#include "confdefs.h" 
    33263279/* Override any gcc2 internal prototype to avoid an error.  */ 
     
    33333286; return 0; } 
    33343287EOF 
    3335 if { (eval echo configure:3336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
    3336   rm -rf conftest* 
    3337   eval "ac_cv_lib_$ac_lib_var=yes" 
    3338 else 
    3339   echo "configure: failed program was:" >&5 
    3340   cat conftest.$ac_ext >&5 
    3341   rm -rf conftest* 
    3342   eval "ac_cv_lib_$ac_lib_var=no" 
    3343 fi 
    3344 rm -f conftest* 
    3345 LIBS="$ac_save_LIBS" 
    3346  
    3347 fi 
    3348 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 
    3349   echo "$ac_t""yes" 1>&6 
    3350   TK_LIB="-L$TK_LIB -ltk8.0" 
    3351 else 
    3352   echo "$ac_t""no" 1>&6 
    3353 echo $ac_n "checking for Tk_Init in -ltk80""... $ac_c" 1>&6 
    3354 echo "configure:3355: checking for Tk_Init in -ltk80" >&5 
    3355 ac_lib_var=`echo tk80'_'Tk_Init | sed 'y%./+-%__p_%'` 
    3356 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 
    3357   echo $ac_n "(cached) $ac_c" 1>&6 
    3358 else 
    3359   ac_save_LIBS="$LIBS" 
    3360 LIBS="-ltk80 -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS -lm $LIBS" 
     3288if { (eval echo configure:3289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
     3289  rm -rf conftest* 
     3290  ac_cv_search_Tk_Init="none required" 
     3291else 
     3292  echo "configure: failed program was:" >&5 
     3293  cat conftest.$ac_ext >&5 
     3294fi 
     3295rm -f conftest* 
     3296test "$ac_cv_search_Tk_Init" = "no" && for i in tk8.0 tk80; do 
     3297LIBS="-l$i -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS  -lXext -lX11 $X_EXTRA_LIBS -lm $ac_func_search_save_LIBS" 
    33613298cat > conftest.$ac_ext <<EOF 
    3362 #line 3363 "configure" 
     3299#line 3300 "configure" 
    33633300#include "confdefs.h" 
    33643301/* Override any gcc2 internal prototype to avoid an error.  */ 
     
    33713308; return 0; } 
    33723309EOF 
    3373 if { (eval echo configure:3374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
    3374   rm -rf conftest* 
    3375   eval "ac_cv_lib_$ac_lib_var=yes" 
    3376 else 
    3377   echo "configure: failed program was:" >&5 
    3378   cat conftest.$ac_ext >&5 
    3379   rm -rf conftest* 
    3380   eval "ac_cv_lib_$ac_lib_var=no" 
    3381 fi 
    3382 rm -f conftest* 
    3383 LIBS="$ac_save_LIBS" 
    3384  
    3385 fi 
    3386 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 
    3387   echo "$ac_t""yes" 1>&6 
    3388   TK_LIB="-L$TK_LIB -ltk80" 
    3389 else 
    3390   echo "$ac_t""no" 1>&6 
    3391  
    3392                         echo "Could not find Tk library.  One of the following halted progess:" 
    3393                         echo "   (a) Tk is not installed." 
    3394                         echo "   (b) Library is not built or not in expected location (--with-tk=DIR)." 
    3395                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    3396                         exit 
    3397                  
    3398 fi 
    3399  
    3400 fi 
    3401  
     3310if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
     3311  rm -rf conftest* 
     3312  ac_cv_search_Tk_Init="-l$i" 
     3313break 
     3314else 
     3315  echo "configure: failed program was:" >&5 
     3316  cat conftest.$ac_ext >&5 
     3317fi 
     3318rm -f conftest* 
     3319done 
     3320LIBS="$ac_func_search_save_LIBS" 
     3321fi 
     3322 
     3323echo "$ac_t""$ac_cv_search_Tk_Init" 1>&6 
     3324if test "$ac_cv_search_Tk_Init" != "no"; then 
     3325  test "$ac_cv_search_Tk_Init" = "none required" || LIBS="$ac_cv_search_Tk_Init $LIBS" 
     3326  FOUND_TK_LIB=yes 
     3327else : 
     3328   
     3329fi 
     3330TK_LIB="$L{TK_LIB} $LIBS" 
     3331LIBS=$SAVED_LIBS 
     3332 
     3333if test $FOUND_TK_LIB = no 
     3334then 
     3335        echo "Could not find Tk library.  One of the following halted progess:" 
     3336        echo "   (a) Tk is not installed." 
     3337        echo "   (b) Library is not built or not in expected location (--with-tk=DIR)." 
     3338        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     3339        exit 
     3340fi 
    34023341 
    34033342 
     
    34193358 
    34203359 
    3421 ac_safe=`echo "${COMMON_INC}/mbus.h" | sed 'y%./+-%__p_%'` 
    3422 echo $ac_n "checking for ${COMMON_INC}/mbus.h""... $ac_c" 1>&6 
    3423 echo "configure:3424: checking for ${COMMON_INC}/mbus.h" >&5 
     3360FOUND_COMMON_H=no 
     3361for h in ${COMMON_INC} ${COMMON_INC}/include 
     3362do 
     3363ac_safe=`echo "$h/mbus.h" | sed 'y%./+-%__p_%'` 
     3364echo $ac_n "checking for $h/mbus.h""... $ac_c" 1>&6 
     3365echo "configure:3366: checking for $h/mbus.h" >&5 
    34243366if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 
    34253367  echo $ac_n "(cached) $ac_c" 1>&6 
    34263368else 
    34273369  cat > conftest.$ac_ext <<EOF 
    3428 #line 3429 "configure" 
    3429 #include "confdefs.h" 
    3430 #include <${COMMON_INC}/mbus.h> 
     3370#line 3371 "configure" 
     3371#include "confdefs.h" 
     3372#include <$h/mbus.h> 
    34313373EOF 
    34323374ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 
    3433 { (eval echo configure:3434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
     3375{ (eval echo configure:3376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
    34343376ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 
    34353377if test -z "$ac_err"; then 
     
    34473389if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 
    34483390  echo "$ac_t""yes" 1>&6 
    3449   COMMON_INC=-I$COMMON_INC 
     3391   
     3392                COMMON_INC=$h 
     3393                FOUND_COMMON_H=yes 
     3394                break 
     3395         
    34503396else 
    34513397  echo "$ac_t""no" 1>&6 
    3452 ac_safe=`echo "${COMMON_INC}/include/mbus.h" | sed 'y%./+-%__p_%'` 
    3453 echo $ac_n "checking for ${COMMON_INC}/include/mbus.h""... $ac_c" 1>&6 
    3454 echo "configure:3455: checking for ${COMMON_INC}/include/mbus.h" >&5 
    3455 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 
    3456   echo $ac_n "(cached) $ac_c" 1>&6 
    3457 else 
    3458   cat > conftest.$ac_ext <<EOF 
    3459 #line 3460 "configure" 
    3460 #include "confdefs.h" 
    3461 #include <${COMMON_INC}/include/mbus.h> 
    3462 EOF 
    3463 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 
    3464 { (eval echo configure:3465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 
    3465 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 
    3466 if test -z "$ac_err"; then 
    3467   rm -rf conftest* 
    3468   eval "ac_cv_header_$ac_safe=yes" 
    3469 else 
    3470   echo "$ac_err" >&5 
    3471   echo "configure: failed program was:" >&5 
    3472   cat conftest.$ac_ext >&5 
    3473   rm -rf conftest* 
    3474   eval "ac_cv_header_$ac_safe=no" 
    3475 fi 
    3476 rm -f conftest* 
    3477 fi 
    3478 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 
    3479   echo "$ac_t""yes" 1>&6 
    3480   COMMON_INC=-I${COMMON_INC}/include 
    3481                  COMMON_LIB=${COMMON_LIB}/lib 
    3482 else 
    3483   echo "$ac_t""no" 1>&6 
    3484  
    3485                         echo "Could not find mbus.h from UCL's common library.  Maybe:" 
    3486                         echo "   (a) common library is not installed." 
    3487                         echo "   (b) common library's locations was mis/not specified (--with-common=DIR)." 
    3488                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    3489                         exit 
    3490                  
    3491 fi 
    3492  
    3493          
    3494 fi 
    3495  
     3398fi 
     3399 
     3400done 
     3401 
     3402if test $FOUND_COMMON_H = no 
     3403then 
     3404        echo "Could not find mbus.h from UCL's common library.  Maybe:" 
     3405        echo "   (a) common library is not installed." 
     3406        echo "   (b) common library's locations was mis/not specified (--with-common=DIR)." 
     3407        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     3408        exit 
     3409fi 
     3410 
     3411# Check if installed it on it's own... 
     3412if test ! -d ${COMMON_LIB}  
     3413then 
     3414        COMMON_LIB=${COMMON_LIB}/lib 
     3415fi 
    34963416 
    34973417echo $ac_n "checking for mbus_init in -lcommon""... $ac_c" 1>&6 
    3498 echo "configure:3499: checking for mbus_init in -lcommon" >&5 
     3418echo "configure:3419: checking for mbus_init in -lcommon" >&5 
    34993419ac_lib_var=`echo common'_'mbus_init | sed 'y%./+-%__p_%'` 
    35003420if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 
     
    35043424LIBS="-lcommon -L${COMMON_LIB} $LIBS" 
    35053425cat > conftest.$ac_ext <<EOF 
    3506 #line 3507 "configure" 
     3426#line 3427 "configure" 
    35073427#include "confdefs.h" 
    35083428/* Override any gcc2 internal prototype to avoid an error.  */ 
     
    35153435; return 0; } 
    35163436EOF 
    3517 if { (eval echo configure:3518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
     3437if { (eval echo configure:3438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 
    35183438  rm -rf conftest* 
    35193439  eval "ac_cv_lib_$ac_lib_var=yes" 
  • rat/trunk/configure.in

    r2989 r2990  
    174174# TCL/TK  
    175175# Hopefully using UCL modified Tcl/Tk. 
     176 
    176177PARENT=`echo $PWD | sed -e 's%/[[^/]]*$%%'` 
    177 TCL_INC=${PARENT}/tcl-8.0/generic 
    178 TCL_LIB=${PARENT}/tcl-8.0/unix 
     178TCL_INC=${PARENT}/tcl-8.0 
     179TCL_LIB=${PARENT}/tcl-8.0 
    179180 
    180181AC_ARG_WITH(tcl,            
    181182        [  --with-tcl=DIR          specify location of Tcl installation], 
    182         [ TCL_INC=$withval/include 
    183           TCL_LIB=$withval/lib]) 
     183        [ TCL_INC=$withval 
     184          TCL_LIB=$withval]) 
     185 
     186# Depending on config expect tcl.h to be tcl source dir or include path 
     187for i in $TCL_INC/generic $TCL_INC/include/tcl8.0 $TCL_INC/include $TCL_INC 
     188do 
     189        if test -d $i ; then 
     190                TCL_INC=$i 
     191                break 
     192        fi 
     193done 
    184194 
    185195AC_CHECK_HEADER(${TCL_INC}/tcl.h, 
    186         TCL_INC=-I${TCL_INC}, 
    187         [AC_CHECK_HEADER(${TCL_INC}/tcl8.0/tcl.h, 
    188                 TCL_INC=-I${TCL_INC}/tcl8.0, 
    189                 [  
    190                         echo "Could not find tcl.h.  One of the following halted progress:" 
    191                         echo "   (a) Tcl is not installed." 
    192                         echo "   (b) Tcl's location was mis-specified, or not specified (--with-tcl=DIR)." 
    193                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    194                         exit 
    195                 ]) 
    196         ]) 
    197  
    198 AC_CHECK_LIB(tcl8.0,  
    199         Tcl_Init, 
    200         TCL_LIB="-L$TCL_LIB -ltcl8.0", 
    201         [AC_CHECK_LIB(tcl80,  
    202                 Tcl_Init, 
    203                 TCL_LIB="-L$TCL_LIB -ltcl80", 
    204                 [ 
    205                         echo "Could not find Tcl library.  One of the following halted progess:" 
    206                         echo "   (a) Tcl is not installed." 
    207                         echo "   (b) Library is not built or not in expected location (--with-tcl=DIR)." 
    208                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    209                         exit 
    210                 ], 
    211                 -L${TCL_LIB} -lm)], 
     196        [TCL_INC=-I${inc} 
     197         break], 
     198        TCL_INC=no) 
     199 
     200if test $TCL_INC = no  
     201then 
     202        echo "Could not find tcl.h.  One of the following halted progress:" 
     203        echo "   (a) Tcl is not installed." 
     204        echo "   (b) Tcl's location was mis-specified, or not specified (--with-tcl=DIR)." 
     205        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     206        exit 
     207fi 
     208 
     209# Guess most probable tcl lib location 
     210for i in $TCL_LIB/unix $TCL_LIB/lib $TCL_LIB 
     211do 
     212        if test -d $i ; then 
     213                TCL_LIB=$i 
     214                break 
     215        fi 
     216done 
     217 
     218SAVED_LIBS=$LIBS 
     219LIBS="" 
     220FOUND_TCL_LIB=no 
     221AC_SEARCH_LIBS(Tcl_Init, tcl8.0 tcl80,  
     222        FOUND_TCL_LIB=yes, 
     223        ,  
    212224        -L${TCL_LIB} -lm) 
    213  
    214 TK_INC=${PARENT}/tk-8.0/generic 
    215 TK_LIB=${PARENT}/tk-8.0/unix 
     225TCL_LIB="-L${TCL_LIB} $LIBS" 
     226LIBS=$SAVED_LIBS 
     227 
     228if test $FOUND_TCL_LIB = no 
     229then 
     230        echo "Could not find Tcl library.  One of the following halted progess:" 
     231        echo "   (a) Tcl is not installed." 
     232        echo "   (b) Library is not built or not in expected location (--with-tcl=DIR)." 
     233        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     234        exit 
     235fi 
     236 
     237TK_INC=${PARENT}/tk-8.0 
     238TK_LIB=${PARENT}/tk-8.0 
    216239 
    217240AC_ARG_WITH(tk,            
    218         [  --with-tk=DIR           specify location of Tk installation], 
    219         [ TK_INC=$withval/include 
    220           TK_LIB=$withval/lib]) 
    221  
    222 # NB for tk.h we don't want to compile anything, AC_CHECK_HEADER(S) compiles 
    223 # a file with specified header, but does not include X and tcl headers. 
    224 # Could use AC_TRY_CPP with $ac_x_include/Xlib.h, etc... for time being just 
    225 # check for existence...autoconf generates a warning here. 
    226 AC_CHECK_FILE($TK_INC/tk.h, 
    227         TK_INC=-I${TK_INC}, 
    228         [ 
    229                 AC_CHECK_FILE($TK_INC/tk8.0/tk.h, 
    230                 TK_INC=-I${TK_INC}/tk8.0, 
    231                 [  
    232                         echo "Could not find tk.h.  One of the following halted progress:" 
    233                         echo "   (a) Tk is not installed." 
    234                         echo "   (b) Tk's location was mis-specified, or not specified (--with-tk=DIR)." 
    235                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    236                         exit 
    237                 ]) 
    238         ]) 
    239  
    240 AC_CHECK_LIB(tk8.0,  
    241         Tk_Init, 
    242         TK_LIB="-L$TK_LIB -ltk8.0", 
    243         [AC_CHECK_LIB(tk80,  
    244                 Tk_Init, 
    245                 TK_LIB="-L$TK_LIB -ltk80", 
    246                 [ 
    247                         echo "Could not find Tk library.  One of the following halted progess:" 
    248                         echo "   (a) Tk is not installed." 
    249                         echo "   (b) Library is not built or not in expected location (--with-tk=DIR)." 
    250                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    251                         exit 
    252                 ], 
    253                 -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS -lm)], 
    254          -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS  -lXext -lX11 $X_EXTRA_LIBS -lm) 
     241        [  --with-tk=DIR          specify location of Tk installation], 
     242        [ TK_INC=$withval 
     243          TK_LIB=$withval]) 
     244 
     245# Depending on config expect tk.h to be tk source dir or include path 
     246# AC_CHECK_HEADER(S) are totally inadequate since it is necessary to 
     247# include tcl.h, Xlib.h, Xutil.h before tk.h. 
     248FOUND_TK_INC=0 
     249for i in $TK_INC/generic $TK_INC/include/tk8.0 $TK_INC/include $TK_INC 
     250do 
     251        AC_MSG_CHECKING(for $i/tk.h) 
     252        if test -r $i/tk.h ; then 
     253                TK_INC=$i 
     254                FOUND_TK_INC=1 
     255                AC_MSG_RESULT(yes) 
     256                break 
     257        fi 
     258        AC_MSG_RESULT(no) 
     259done 
     260 
     261if test $FOUND_TK_INC = 0 ; then 
     262        echo "Could not find tk.h.  One of the following halted progress:" 
     263        echo "   (a) Tk is not installed." 
     264        echo "   (b) Tk's location was mis-specified, or not specified (--with-tk=DIR)." 
     265        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     266        exit 
     267fi 
     268 
     269# Guess most probable tk lib location 
     270for i in $TK_LIB/unix $TK_LIB/lib $TK_LIB 
     271do 
     272        if test -d $i ; then 
     273                TK_LIB=$i 
     274                break 
     275        fi 
     276done 
     277 
     278SAVED_LIBS=$LIBS 
     279LIBS="" 
     280FOUND_TK_LIB=no 
     281AC_SEARCH_LIBS(Tk_Init, tk8.0 tk80, 
     282        FOUND_TK_LIB=yes, 
     283        , 
     284        -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS  -lXext -lX11 $X_EXTRA_LIBS -lm) 
     285TK_LIB="$L{TK_LIB} $LIBS" 
     286LIBS=$SAVED_LIBS 
     287 
     288if test $FOUND_TK_LIB = no 
     289then 
     290        echo "Could not find Tk library.  One of the following halted progess:" 
     291        echo "   (a) Tk is not installed." 
     292        echo "   (b) Library is not built or not in expected location (--with-tk=DIR)." 
     293        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     294        exit 
     295fi 
    255296 
    256297AC_SUBST(TCL_INC) 
     
    269310          COMMON_LIB=$withval]) 
    270311 
    271 AC_CHECK_HEADER(${COMMON_INC}/mbus.h, 
    272         COMMON_INC=-I$COMMON_INC, 
    273         [AC_CHECK_HEADER(${COMMON_INC}/include/mbus.h, 
    274                 [COMMON_INC=-I${COMMON_INC}/include 
    275                  COMMON_LIB=${COMMON_LIB}/lib], 
    276                 [ 
    277                         echo "Could not find mbus.h from UCL's common library.  Maybe:" 
    278                         echo "   (a) common library is not installed." 
    279                         echo "   (b) common library's locations was mis/not specified (--with-common=DIR)." 
    280                         echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
    281                         exit 
    282                 ]) 
     312FOUND_COMMON_H=no 
     313for h in ${COMMON_INC} ${COMMON_INC}/include 
     314do 
     315AC_CHECK_HEADER($h/mbus.h, 
     316        [ 
     317                COMMON_INC=$h 
     318                FOUND_COMMON_H=yes 
     319                break 
    283320        ]) 
     321done 
     322 
     323if test $FOUND_COMMON_H = no 
     324then 
     325        echo "Could not find mbus.h from UCL's common library.  Maybe:" 
     326        echo "   (a) common library is not installed." 
     327        echo "   (b) common library's locations was mis/not specified (--with-common=DIR)." 
     328        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)." 
     329        exit 
     330fi 
     331 
     332# Check if installed it on it's own... 
     333if test ! -d ${COMMON_LIB}  
     334then 
     335        COMMON_LIB=${COMMON_LIB}/lib 
     336fi 
    284337 
    285338AC_CHECK_LIB(common,