1 dnl $Id: common.m4,v 1.13 2006/02/25 18:29:46 cg2v Exp $
3 AC_DEFUN([CMU_TEST_LIBPATH], [
5 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
7 if test "$CMU_AC_CV_FOUND" = "yes"; then
8 if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl" -a \! -r "$1/lib$2.dylib"; then
14 AC_DEFUN([CMU_TEST_INCPATH], [
16 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_inc, [ *], [_p]))
18 if test "$CMU_AC_CV_FOUND" = "yes"; then
19 if test \! -r "$1/$2.h"; then
25 dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
26 AC_DEFUN([CMU_CHECK_HEADER_NOCACHE],
27 [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
28 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
29 AC_MSG_CHECKING([for $1])
30 AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
31 eval "ac_cv_header_$ac_safe=no")
32 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
34 ifelse([$2], , :, [$2])
42 AC_DEFUN([CMU_FIND_LIB_SUBDIR],
44 AC_ARG_WITH([lib-subdir], AC_HELP_STRING([--with-lib-subdir=DIR],[Find libraries in DIR instead of lib]))
46 AC_CACHE_CHECK([what directory libraries are found in], [ac_cv_cmu_lib_subdir],
47 [test "X$with_lib_subdir" = "Xyes" && with_lib_subdir=
48 test "X$with_lib_subdir" = "Xno" && with_lib_subdir=
49 if test "X$with_lib_subdir" = "X" ; then
50 ac_cv_cmu_lib_subdir=lib
51 if test $ac_cv_sizeof_long -eq 4 ; then
52 test -d /usr/lib32 && ac_cv_cmu_lib_subdir=lib32
54 if test $ac_cv_sizeof_long -eq 8 ; then
55 test -d /usr/lib64 && ac_cv_cmu_lib_subdir=lib64
58 ac_cv_cmu_lib_subdir=$with_lib_subdir
60 AC_SUBST(CMU_LIB_SUBDIR, $ac_cv_cmu_lib_subdir)