123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- dnl @synopsis AX_ISC_RPATH
- dnl
- dnl @summary figure out whether and which "rpath" linker option is available
- dnl
- dnl This macro checks if the linker supports an option to embed a path
- dnl to a runtime library (often installed in an uncommon place), such as the
- dnl commonly used -R option. If found, it sets the ISC_RPATH_FLAG variable to
- dnl the found option flag. The main configure.ac can use it as follows:
- dnl if test "x$ISC_RPATH_FLAG" != "x"; then
- dnl LDFLAGS="$LDFLAGS ${ISC_RPATH_FLAG}/usr/local/lib/some_library"
- dnl fi
- dnl
- dnl If you pass
- AC_DEFUN([AX_ISC_RPATH], [
- AC_ARG_ENABLE(rpath,
- [AC_HELP_STRING([
- rpath=$enableval, rpath=yes)
- if test x$rpath != xno; then
-
-
-
-
-
-
-
- CXXFLAGS_SAVED="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -Wl,-R/usr/lib"
- CCFLAGS_SAVED="$CCFLAGS"
- CCFLAGS="$CCFLAGS -Wl,-R/usr/lib"
-
-
-
-
- AC_MSG_CHECKING([whether -Wl,-R flag is available in linker])
- AC_TRY_LINK([],[],
- [ AC_MSG_RESULT(yes)
- ISC_RPATH_FLAG=-Wl,-R
- ],[ AC_MSG_RESULT(no)
- AC_MSG_CHECKING([whether -R flag is available in linker])
-
-
-
- CXXFLAGS="$CXXFLAGS_SAVED -R/usr/lib"
- CCFLAGS="$CCFLAGS_SAVED -R/usr/lib"
- AC_TRY_LINK([], [],
- [ AC_MSG_RESULT([yes; note that -R is more sensitive about the position in option arguments])
- ISC_RPATH_FLAG=-R
- ],[ AC_MSG_RESULT(no) ])
- ])
- CXXFLAGS=$CXXFLAGS_SAVED
- CCFLAGS=$CCFLAGS_SAVED
- fi
- ])dnl AX_ISC_RPATH
|