summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 15:02:11 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 15:02:11 -0700
commita086d9b0c33d54bbce83fafe4057e8b8dc28a35e (patch)
tree83210ba51ce2b8488b727aff76a90600d7af049f /acinclude.m4
downloadchrpath-a086d9b0c33d54bbce83fafe4057e8b8dc28a35e.tar.gz
chrpath-a086d9b0c33d54bbce83fafe4057e8b8dc28a35e.tar.bz2
chrpath-a086d9b0c33d54bbce83fafe4057e8b8dc28a35e.zip
Imported Upstream version 0.13upstream/0.13
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m444
1 files changed, 44 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..82e5df6
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,44 @@
+dnl
+dnl Add macros
+dnl JAPHAR_GREP_CFLAGS
+dnl
+
+dnl
+dnl JAPHAR_GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present)
+dnl
+dnl From Japhar. Report changes to japhar@hungry.com
+dnl
+AC_DEFUN(JAPHAR_GREP_CFLAGS,
+[case "$CFLAGS" in
+"$1" | "$1 "* | *" $1" | *" $1 "* )
+ ifelse($#, 3, [$3], [:])
+ ;;
+*)
+ $2
+ ;;
+esac
+])
+
+AC_DEFUN(CHRPATH_LDRPATH_OPTION,
+[AC_REQUIRE([AC_CANONICAL_TARGET])[]dnl
+case "$target" in
+ *-linux*)
+ LDRPATH=-Wl,-rpath,
+ ;;
+ *-*-irix*|*-*-osf*)
+ LDRPATH="-rpath "
+ ;;
+ *-*-hpux*)
+ # Hm, this seem to set runpath on ia64, not rpath
+ LDRPATH="-Wl,+b,"
+ ;;
+ *-*-darwin*)
+ # No idea how to add rpath/runpath on Darwin
+ LDRPATH=""
+ ;;
+ *)
+ LDRPATH="-R "
+ ;;
+esac
+AC_SUBST(LDRPATH)
+])