| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 | require 'formula'
class Ncview < Formula
  url 'ftp://cirrus.ucsd.edu/pub/ncview/ncview-2.1.1.tar.gz'
  homepage 'http://meteora.ucsd.edu/~pierce/ncview_home_page.html'
  md5 '34e25f5949af342a1783542799f51bed'
  depends_on :x11
  depends_on "netcdf"
  # Disable a block in configure that tries to pass an RPATH to the compiler.
  # The code guesses wrong which causes the linking step to fail.
  def patches
    DATA
  end
  def install
    system "./configure", "--prefix=#{prefix}",
                          "--disable-dependency-tracking"
    system "make install"
  end
end
__END__
Don't try to mess with the compiler rpath. Just not a good idea.
diff --git a/configure b/configure
index b80ae96..a650f6f 100755
--- a/configure
+++ b/configure
@@ -8672,29 +8672,6 @@ if test x$CC_TEST_SAME != x$NETCDF_CC_TEST_SAME; then
 	exit -1
 fi
 
-#----------------------------------------------------------------------------------
-# Construct our RPATH flags.  Idea here is that we have LDFLAGS that might look,
-# for example, something like this:
-#	LIBS="-L/usr/local/lib -lnetcdf -L/home/pierce/lib -ludunits"
-# We want to convert this to -rpath flags suitable for the compiler, which would
-# have this format:
-#	"-Wl,-rpath,/usr/local/lib -Wl,-rpath,/home/pierce/lib"
-#
-# As a safety check, I only do this for the GNU compiler, as I don't know if this
-# is anything like correct syntax for other compilers.  Note that this *does* work
-# for the Intel icc compiler, but also that the icc compiler sets $ac_compiler_gnu
-# to "yes".  Go figure.
-#----------------------------------------------------------------------------------
-if test x$ac_compiler_gnu = xyes; then
-	RPATH_FLAGS=""
-	for word in $UDUNITS2_LDFLAGS $NETCDF_LDFLAGS; do
-		if test `expr $word : -L/` -eq 3; then
-			RPDIR=`expr substr $word 3 999`;
-			RPATH_FLAGS="$RPATH_FLAGS -Wl,-rpath,$RPDIR"
-		fi
-	done
-
-fi
 
 
 ac_config_files="$ac_config_files Makefile src/Makefile"
 |