home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 April / PCO0499.ISO / filesbbs / os2 / apach134.arj / APACH134.ZIP / src / helpers / find-dbm-lib < prev    next >
Encoding:
Text File  |  1998-04-14  |  1.0 KB  |  44 lines

  1. # Our config tool sucks... if this script decides to modify the
  2. # LIBS variable it won't be used by any of the other TestCompiles.
  3. # So unless we protect ourselves with the found_dbm variable
  4. # we'd end up having to do the work twice... and we'd end up putting
  5. # two -ldbm -ldbm into the LIBS variable.
  6.  
  7. if [ "x$found_dbm" = "x" ]; then
  8.     if ./helpers/TestCompile func dbm_open; then
  9.     found_dbm=1
  10.     else
  11.     found_dbm=0
  12.     case "$PLAT" in
  13.         *-linux*)
  14.         # many systems don't have -ldbm
  15.         DBM_LIB=""
  16.         if ./helpers/TestCompile lib dbm dbm_open; then
  17.             DBM_LIB="-ldbm"
  18.         elif ./helpers/TestCompile lib ndbm dbm_open; then
  19.             DBM_LIB="-lndbm"
  20.         fi
  21.         if [ "X$DBM_LIB" != "X" ]; then
  22.             LIBS="$LIBS $DBM_LIB"
  23.             found_dbm=1
  24.         fi
  25.         ;;
  26.         *)
  27.         if [ "X$DBM_LIB" != "X" ]; then
  28.             oldLIBS="$LIBS"
  29.             LIBS="$LIBS $DBM_LIB"
  30.             if ./helpers/TestCompile func dbm_open; then
  31.             found_dbm=1
  32.             else
  33.             found_dbm=0
  34.             LIBS="$oldLIBS"
  35.             fi
  36.         fi
  37.         ;;
  38.     esac
  39.     if [ "X$found_dbm" = "X1" ]; then
  40.         echo " + using $DBM_LIB for DBM support"
  41.     fi
  42.     fi
  43. fi
  44.