Changeset 2603


Ignore:
Timestamp:
2001-06-21T14:35:31+12:00 (23 years ago)
Author:
jrm21
Message:

Look for gdbm in /usr/local before failing (eg FreeBSD).

Location:
trunk/gsdl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/configure

    r2521 r2603  
    31823182  if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
    31833183    echo "$ac_t""$gdbmdir" 1>&6 ;
    3184     cat >> confdefs.h <<\EOF
    3185 #define HAVE_LIBGDBM  1
    3186 EOF
    3187 
    31883184  else
    3189     echo "$ac_t""can't find both gdbm.h and libgdbm.a in $gdbmdir" 1>&6;
     3185    echo "$ac_t""can't find gdbm.h and libgdbm.a in $gdbmdir" 1>&6;
    31903186    echo $ac_n "checking looking for GDBM library in default locations""... $ac_c" 1>&6
    3191 echo "configure:3192: checking looking for GDBM library in default locations" >&5
     3187echo "configure:3188: checking looking for GDBM library in default locations" >&5
    31923188  fi
    31933189fi
    31943190
     3191# look in default path and in /usr/local
    31953192if test -z "$GDBM_INCLUDE" ; then
    31963193  # try in system directory
    31973194  cat > conftest.$ac_ext <<EOF
    3198 #line 3199 "configure"
     3195#line 3196 "configure"
    31993196#include "confdefs.h"
    32003197#include <gdbm.h>
     
    32043201; return 0; }
    32053202EOF
    3206 if { (eval echo configure:3207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3203if { (eval echo configure:3204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    32073204  rm -rf conftest*
    32083205  success=yes
     
    32153212fi
    32163213rm -f conftest*
     3214
     3215  if test $success = "no"; then
     3216# last chance - look in /usr/local (eg FreeBSD)
     3217    GDBM_LIBPATH=-L/usr/local/lib
     3218    GDBM_INCLUDE=-I/usr/local/include
     3219    ac_save_CXXFLAGS="$CXXFLAGS"
     3220    ac_save_LIBS="$LIBS"
     3221      CXXFLAGS="$CXXFLAGS -I/usr/local/include"
     3222      LIBS="$LIBS -L/usr/local/lib -lgdbm"
     3223      cat > conftest.$ac_ext <<EOF
     3224#line 3225 "configure"
     3225#include "confdefs.h"
     3226#include <gdbm.h>
     3227#include <stdio.h>
     3228   
     3229int main() {
     3230printf("%s",gdbm_version);
     3231; return 0; }
     3232EOF
     3233if { (eval echo configure:3234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     3234  rm -rf conftest*
     3235  success=/usr/local
     3236else
     3237  echo "configure: failed program was:" >&5
     3238  cat conftest.$ac_ext >&5
     3239  rm -rf conftest*
     3240  success=no
     3241     
     3242fi
     3243rm -f conftest*
     3244      CXXFLAGS=$ac_save_CXXFLAGS
     3245      LIBS=$ac_save_LIBS
     3246  fi
     3247
    32173248  echo "$ac_t""$success" 1>&6
    32183249  if test $success = "no"; then
    32193250  { echo "configure: error: GDBM Library not available - cannot install" 1>&2; exit 1; }
    32203251  fi
    3221   GDBM_LIBPATH=
    3222   GDBM_INCLUDE=
    3223 fi
     3252fi
     3253cat >> confdefs.h <<\EOF
     3254#define HAVE_LIBGDBM  1
     3255EOF
     3256
    32243257
    32253258
     
    32273260
    32283261echo $ac_n "checking that Perl 5 is available""... $ac_c" 1>&6
    3229 echo "configure:3230: checking that Perl 5 is available" >&5
     3262echo "configure:3263: checking that Perl 5 is available" >&5
    32303263success="no"
    32313264pl_path="$PATH"
     
    32573290success=no
    32583291echo $ac_n "checking "whether STL library has known faults"""... $ac_c" 1>&6
    3259 echo "configure:3260: checking "whether STL library has known faults"" >&5
     3292echo "configure:3293: checking "whether STL library has known faults"" >&5
    32603293
    32613294cat > conftest.$ac_ext <<EOF
    3262 #line 3263 "configure"
     3295#line 3296 "configure"
    32633296#include "confdefs.h"
    32643297#include <vector>
     
    32683301; return 0; }
    32693302EOF
    3270 if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3303if { (eval echo configure:3304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    32713304  rm -rf conftest*
    32723305  success=yes
     
    32793312if test $success = "no"; then
    32803313cat > conftest.$ac_ext <<EOF
    3281 #line 3282 "configure"
     3314#line 3315 "configure"
    32823315#include "confdefs.h"
    32833316#include <vector.h>
     
    32873320; return 0; }
    32883321EOF
    3289 if { (eval echo configure:3290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3322if { (eval echo configure:3323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    32903323  rm -rf conftest*
    32913324  success="yes"
     
    32993332if test $success = "no"; then
    33003333cat > conftest.$ac_ext <<EOF
    3301 #line 3302 "configure"
     3334#line 3335 "configure"
    33023335#include "confdefs.h"
    33033336#include <ospace\\std\\vector>
     
    33073340; return 0; }
    33083341EOF
    3309 if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3342if { (eval echo configure:3343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    33103343  rm -rf conftest*
    33113344  success="yes"
  • trunk/gsdl/configure.in

    r2521 r2603  
    208208  if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
    209209    AC_MSG_RESULT($gdbmdir) ;
    210     AC_DEFINE(HAVE_LIBGDBM , 1)
    211210  else
    212     AC_MSG_RESULT(can't find both gdbm.h and libgdbm.a in $gdbmdir);
     211    AC_MSG_RESULT(can't find gdbm.h and libgdbm.a in $gdbmdir);
    213212    AC_MSG_CHECKING(   looking for GDBM library in default locations)
    214213  fi
    215214fi
    216215
     216# look in default path and in /usr/local
    217217if test -z "$GDBM_INCLUDE" ; then
    218218  # try in system directory
     
    224224  success=no
    225225  )
     226
     227  if test $success = "no"; then
     228# last chance - look in /usr/local (eg FreeBSD)
     229    GDBM_LIBPATH=-L/usr/local/lib
     230    GDBM_INCLUDE=-I/usr/local/include
     231    ac_save_CXXFLAGS="$CXXFLAGS"
     232    ac_save_LIBS="$LIBS"
     233      CXXFLAGS="$CXXFLAGS -I/usr/local/include"
     234      LIBS="$LIBS -L/usr/local/lib -lgdbm"
     235      AC_TRY_LINK(
     236    [#include <gdbm.h>
     237#include <stdio.h>
     238    ],
     239    [printf("%s",gdbm_version);],
     240    success=/usr/local,
     241    success=no
     242      )
     243      CXXFLAGS=$ac_save_CXXFLAGS
     244      LIBS=$ac_save_LIBS
     245  fi
     246
    226247  AC_MSG_RESULT($success)
    227248  if test $success = "no"; then
    228249  AC_MSG_ERROR(GDBM Library not available - cannot install)
    229250  fi
    230   GDBM_LIBPATH=
    231   GDBM_INCLUDE=
    232 fi
     251fi
     252dnl I don't think anything actually checks this define, but...
     253AC_DEFINE(HAVE_LIBGDBM , 1)
    233254
    234255AC_SUBST(GDBM_LIBPATH)
Note: See TracChangeset for help on using the changeset viewer.