2 dnl Additional macros for configure.in packaged up for easier theft.
3 dnl $Id: cyrus.m4,v 1.4 2003/10/08 20:35:24 rjs3 Exp $
4 dnl tjs@andrew.cmu.edu 6-may-1998
7 dnl It would be good if ANDREW_ADD_LIBPATH could detect if something was
8 dnl already there and not redundantly add it if it is.
10 dnl add -L(arg), and possibly (runpath switch)(arg), to LDFLAGS
11 dnl (so the runpath for shared libraries is set).
12 AC_DEFUN([CMU_ADD_LIBPATH], [
13 # this is CMU ADD LIBPATH
14 if test "$andrew_runpath_switch" = "none" ; then
15 LDFLAGS="-L$1 ${LDFLAGS}"
17 LDFLAGS="-L$1 $andrew_runpath_switch$1 ${LDFLAGS}"
21 dnl add -L(1st arg), and possibly (runpath switch)(1st arg), to (2nd arg)
22 dnl (so the runpath for shared libraries is set).
23 AC_DEFUN([CMU_ADD_LIBPATH_TO], [
24 # this is CMU ADD LIBPATH TO
25 if test "$andrew_runpath_switch" = "none" ; then
28 $2="-L$1 ${$2} $andrew_runpath_switch$1"
32 dnl runpath initialization
33 AC_DEFUN([CMU_GUESS_RUNPATH_SWITCH], [
34 # CMU GUESS RUNPATH SWITCH
35 AC_CACHE_CHECK(for runpath switch, andrew_runpath_switch, [
37 SAVE_LDFLAGS="${LDFLAGS}"
39 AC_TRY_LINK([],[],[andrew_runpath_switch="-R"], [
40 LDFLAGS="-Wl,-rpath,/usr/lib"
41 AC_TRY_LINK([],[],[andrew_runpath_switch="-Wl,-rpath,"],
42 [andrew_runpath_switch="none"])
44 LDFLAGS="${SAVE_LDFLAGS}"