source: proiecte/HadoopJUnit/hadoop-0.20.1/src/native/acinclude.m4 @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1# AC_COMPUTE_NEEDED_DSO(LIBRARY, PREPROC_SYMBOL)
2# --------------------------------------------------
3# Compute the 'actual' dynamic-library used
4# for LIBRARY and set it to PREPROC_SYMBOL
5AC_DEFUN([AC_COMPUTE_NEEDED_DSO],
6[
7AC_CACHE_CHECK([Checking for the 'actual' dynamic-library for '-l$1'], ac_cv_libname_$1,
8  [
9  echo 'int main(int argc, char **argv){return 0;}' > conftest.c
10  if test -z "`${CC} ${LDFLAGS} -o conftest conftest.c -l$1 2>&1`"; then
11    dnl Try objdump and ldd in that order to get the dynamic library
12    if test ! -z "`which objdump | grep -v 'no objdump'`"; then
13      ac_cv_libname_$1="`objdump -p conftest | grep NEEDED | grep $1 | sed 's/\W*NEEDED\W*\(.*\)\W*$/\"\1\"/'`"
14    elif test ! -z "`which ldd | grep -v 'no ldd'`"; then
15      ac_cv_libname_$1="`ldd conftest | grep $1 | sed 's/^[[[^A-Za-z0-9]]]*\([[[A-Za-z0-9\.]]]*\)[[[^A-Za-z0-9]]]*=>.*$/\"\1\"/'`"
16    else
17      AC_MSG_ERROR(Can't find either 'objdump' or 'ldd' to compute the dynamic library for '-l$1')
18    fi
19  else
20    ac_cv_libname_$1=libnotfound.so
21  fi
22  rm -f conftest*
23  ]
24)
25AC_DEFINE_UNQUOTED($2, ${ac_cv_libname_$1}, [The 'actual' dynamic-library for '-l$1'])
26])# AC_COMPUTE_NEEDED_DSO
Note: See TracBrowser for help on using the repository browser.