~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/search_for_lib.m4

  • Committer: Monty Taylor
  • Date: 2008-11-22 08:45:48 UTC
  • mto: This revision was merged to the branch mainline in revision 603.
  • Revision ID: monty@inaugust.com-20081122084548-s4jx3tiel52fhi7o
Added possible search path list... 

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
  AS_IF([test AS_VAR_GET([with_lib]) = yes],[
22
22
    AC_CHECK_HEADERS([$3])
23
 
    AS_IF([test AS_VAR_GET([ac_header]) = no],
24
 
      AC_MSG_WARN([Couldn't find $3. Try installing lib$3 development packages])
25
 
      [$4])
26
23
 
27
24
    my_save_LIBS="$LIBS"
28
25
    LIBS=""
33
30
    AS_IF([test AS_VAR_GET([ac_header]) = "$3" -a AS_VAR_GET([ac_lib]) = yes],
34
31
      [AS_VAR_SET([have_lib],[yes])],
35
32
      [AS_VAR_SET([have_lib],[no])
36
 
       [$4]])
37
 
  ],[
38
 
    AC_MSG_CHECKING(for $1 in $withval)
39
 
    if test -f $withval/$3 -a -f $withval/lib$1.a
 
33
       AS_VAR_SET([with_lib],[AS_VAR_GET([with_lib]) /usr/local /opt/csw])
 
34
      ])
 
35
  ])
 
36
  AS_IF([test AS_VAR_GET([with_lib]) != yes],[
 
37
   AC_MSG_CHECKING(for $1 in $withval)
 
38
   for libloc in AS_VAR_GET([with_lib])
 
39
   do
 
40
    if test -f $libloc/$3 -a -f $libloc/lib$1.a
40
41
    then
41
42
      owd=`pwd`
42
 
      if cd $withval; then withval=`pwd`; cd $owd; fi
43
 
      AS_VAR_SET([cppflags_var],[-I$withval])
44
 
      AS_VAR_SET([libs_var],[-L$withval -l$1])
 
43
      if cd $libloc; then libloc=`pwd`; cd $owd; fi
 
44
      AS_VAR_SET([cppflags_var],[-I$libloc])
 
45
      AS_VAR_SET([libs_var],[-L$libloc -l$1])
45
46
      AS_VAR_SET([have_lib],[yes])
46
 
    elif test -f $withval/include/$3 -a -f $withval/lib/lib$1.a; then
 
47
      break
 
48
    elif test -f $libloc/include/$3 -a -f $libloc/lib/lib$1.a; then
47
49
      owd=`pwd`
48
 
      if cd $withval; then withval=`pwd`; cd $owd; fi
49
 
      AS_VAR_SET([cppflags_var],[-I$withval/include])
50
 
      AS_VAR_SET([libs_var],[-L$withval/lib -l$1])
 
50
      if cd $libloc; then libloc=`pwd`; cd $owd; fi
 
51
      AS_VAR_SET([cppflags_var],[-I$libloc/include])
 
52
      AS_VAR_SET([libs_var],[-L$libloc/lib -l$1])
51
53
      AS_VAR_SET([have_lib],[yes])
 
54
      break
52
55
    else
53
 
      AC_MSG_WARN([$3 or lib$1.a not found in $withval])
54
56
      AS_VAR_SET([have_lib],[no])
55
 
      [$4]
56
57
    fi
 
58
   done
 
59
  ])
 
60
  AS_IF([test AS_VAR_GET([have_lib]) = no],[
 
61
    AC_MSG_WARN([$3 or lib$1.a not found. Try installing $1 developement packages])
 
62
    [$4]
57
63
  ])
58
64
  AC_SUBST(libs_var)
59
65
  AC_SUBST(cppflags_var)