~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to m4/boinc_check_lib_with.m4

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_DEFUN([BOINC_CHECK_LIB_WITH],[
 
2
dnl arguments  $1 library name (-l$1)
 
3
dnl            $2 function name
 
4
dnl            $3 variable to append LDFLAGS to
 
5
  AC_LANG_PUSH(C)
 
6
  _sv_libs="$LIBS"
 
7
  AC_ARG_WITH([lib$1],
 
8
    AC_HELP_STRING([--with-lib$1=DIR],[look for the $1 library in DIR]),
 
9
   [_lib_with=$withval],[_lib_with=no])
 
10
  _NEW_LDFLAGS=
 
11
  if test "x${_lib_with}" != "xno" ; then
 
12
    if test -d $_lib_with/. ; then
 
13
      _NEW_LDFLAGS="${_NEW_LDFLAGS} -L${_lib_with}"
 
14
      LIBS="${LIBS} ${_NEW_LDFLAGS}"
 
15
    fi
 
16
    AC_CHECK_LIB([$1],[$2],[_lib_found=yes])
 
17
    if test "x${_lib_found}" = "xyes" ; then
 
18
      if test -f ${_lib_with} ; then
 
19
        _NEW_LDFLAGS="${_NEW_LDFLAGS} ${_lib_with}"
 
20
      elif test -h ${_lib_with} -a ! -d ${_lib_with}/. ; then
 
21
        _NEW_LDFLAGS="${_NEW_LDFLAGS} ${_lib_with}"
 
22
      else
 
23
        _NEW_LDFLAGS="${_NEW_LDFLAGS} -l$1"
 
24
      fi
 
25
      $3="${$3} ${_NEW_LDFLAGS}"
 
26
    fi
 
27
  fi
 
28
  LIBS="${_sv_libs}"
 
29
  AC_LANG_POP(C)
 
30
])
 
31