[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OSF sia stuff in 0.4b



Mark Davies <mark@mcs.vuw.ac.nz> writes:
> Changing the  "sed 's,-R,-rpath,g'"  to  "sed 's,-R,-rpath ,g'" gives 
> something that does link:

ok

> But I'm not sure that the "-rpath"s are actually right.  I'm pretty
> sure that ld ignores all but the last of multiple -rpaths passed to
> it and that if you actually want multiple directories on the path
> you need to colon separate them.

Yeah, I'm afraid you're completely right.  libtool actually
accumulates all of them and sends in a colon-separated list.

This appended patch should make it do the right thing.  Can you test
it?

/assar

Index: Makefile.am
===================================================================
RCS file: /afs/pdc.kth.se/src/packages/kth-krb/SourceRepository/lib/auth/sia/Makefile.am,v
retrieving revision 1.11
diff -u -w -r1.11 Makefile.am
--- Makefile.am	2001/07/11 22:12:56	1.11
+++ Makefile.am	2001/07/13 08:02:12
@@ -80,11 +80,11 @@
 
 libsia_krb5.so: $(OBJS)
 	@if test -f $(top_builddir)/lib/krb5/.libs/libkrb5.a; then \
-		echo "$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L) | sed 's,-R,-rpath,g'`"; \
-		$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L) | sed 's,-R,-rpath,g'`; \
+		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`"; \
+		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`; \
 	elif test -f $(top_builddir)/lib/krb5/.libs/libkrb5.so; then \
-		echo "$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L_shared) | sed 's,-R,-rpath,g'`"; \
-		$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L_shared) | sed 's,-R,-rpath,g'`; \
+		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`"; \
+		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`; \
 	else \
 		echo "missing libraries"; exit 1; \
 	fi
@@ -92,11 +92,11 @@
 
 libsia_krb4.so: $(OBJS)
 	@if test -f $(top_builddir)/lib/krb/.libs/libkrb.a; then \
-		echo "$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L) | sed 's,-R,-rpath,g'`"; \
-		$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L) | sed 's,-R,-rpath,g'`; \
+		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`"; \
+		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`; \
 	elif test -f $(top_builddir)/lib/krb/.libs/libkrb.so; then \
-		echo "$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L_shared) | sed 's,-R,-rpath,g'`"; \
-		$(CC) -shared -o $@ `echo $(LDFLAGS) | sed 's,-R,-rpath,g'` $(OBJS) `echo $(L_shared) | sed 's,-R,-rpath,g'`; \
+		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`"; \
+		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`; \
 	else \
 		echo "missing libraries"; exit 1; \
 	fi
Index: make-rpath
===================================================================
RCS file: make-rpath
diff -N make-rpath
--- /dev/null	Fri Jul 13 10:02:11 2001
+++ make-rpath	Fri Jul 13 09:55:20 2001
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id$
+rlist=
+rest=
+while test $# -gt 0; do
+case $1 in
+-R|-rpath)
+  if test "$rlist"; then
+    rlist="${rlist}:$2"
+  else
+    rlist="$2"
+  fi
+  shift 2
+  ;;
+-R*) 
+  d=`echo $1 | sed 's,^-R,,'`
+  if test "$rlist"; then
+    rlist="${rlist}:${d}"
+  else
+    rlist="${d}"
+  fi
+  shift
+  ;;
+*)
+  rest="${rest} $1"
+  shift
+  ;;
+esac
+done
+if test "$rlist"; then
+  echo -n "-rpath $rlist "
+fi
+echo "$rest"