1 dnl librestrict.m4--restrict libraries and includes
3 dnl from KTH krb and Arla
4 dnl $Id: librestrict.m4,v 1.6 2006/02/25 18:26:22 cg2v Exp $
6 AC_DEFUN([CMU_RESTRICT_LIB_WHERE1], [
8 LIBS="$saved_LIBS -L$1 -lrestrict"
11 [ac_cv_found_restrict_lib=yes],
12 ac_cv_found_restrict_lib=no)
16 AC_DEFUN([CMU_RESTRICT_LIB_WHERE], [
18 AC_MSG_CHECKING(for restrict library in $i)
19 CMU_RESTRICT_LIB_WHERE1($i)
20 CMU_TEST_LIBPATH($i, restrict)
21 if test "$ac_cv_found_restrict_lib" = "yes" ; then
22 ac_cv_restrict_where_lib=$i
26 AC_MSG_RESULT(no found)
31 AC_DEFUN([CMU_RESTRICT], [
32 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
34 [ --with-restrict=PREFIX Compile with RESTRICT support],
35 [if test "X$with_restrict" = "X"; then
39 if test "X$with_restrict" != "X"; then
40 if test "$with_restrict" != "yes"; then
41 ac_cv_restrict_where_lib=$with_restrict/$CMU_LIB_SUBDIR
45 if test "X$with_restrict_lib" != "X"; then
46 ac_cv_restrict_where_lib=$with_restrict_lib
48 if test "X$ac_cv_restrict_where_lib" = "X"; then
49 CMU_RESTRICT_LIB_WHERE(/usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
52 AC_MSG_CHECKING(whether to include restrict)
53 if test "X$ac_cv_restrict_where_lib" = "X"; then
54 ac_cv_found_restrict=no
57 ac_cv_found_restrict=yes
58 AC_DEFINE(HAVE_RESTRICT,, [Use librestrict])
60 RESTRICT_LIB_DIR=$ac_cv_restrict_where_lib
61 RESTRICT_LIB_FLAGS="-L${RESTRICT_LIB_DIR} -lrestrict"
62 if test "X$RPATH" = "X"; then
67 if test "X$RPATH" = "X"; then
68 RPATH="-Wl,-rpath,${RESTRICT_LIB_DIR}"
70 RPATH="${RPATH}:${RESTRICT_LIB_DIR}"
74 if test "X$RPATH" = "X"; then
75 RPATH="-Wl,+b${RESTRICT_LIB_DIR}"
77 RPATH="${RPATH}:${RESTRICT_LIB_DIR}"
81 if test "X$RPATH" = "X"; then
82 RPATH="-Wl,-rpath,${RESTRICT_LIB_DIR}"
84 RPATH="${RPATH}:${RESTRICT_LIB_DIR}"
88 if test "$ac_cv_prog_gcc" = yes; then
89 if test "X$RPATH" = "X"; then
90 RPATH="-Wl,-R${RESTRICT_LIB_DIR}"
92 RPATH="${RPATH}:${RESTRICT_LIB_DIR}"
95 RPATH="${RPATH} -R${RESTRICT_LIB_DIR}"