Matthieu Herrb wrote (in a message from Tuesday 28)
 >  > 
 >  > Unfortunately, -R is not a recognized option to ld on Darwin and 
 >  > perhaps other platforms as well. This should be conditionalized in 
 >  > some way. My configure-foo is fairly weak, but it appears that the 
 >  > hardcode_libdir_flag_spec is the configure option that should be used 
 >  > here, rather then a hardwired ELF loader specific option.
 > 
 > There's also bugzilla #832 that requests that the same is done for the
 > other xxx-config and xxx.pc files shipped by XFree86. 

Here's the patch I intend to commit. I didn't want to use
EXTRA_LOAD_FLAGS directly, as its semantics is not clearly defined. 
I've used 'hardcode_libdir_flag_spec' for consistancy with
autoconf/libtool. 

Someone also mentionned possible issues on mixed 32/64 bits platforms
where a separate directory may be used for 64 bit versions of the
libraries; more work is needed in this case in other areas too...

                                        Matthieu

Index: xc/config/cf/Imake.tmpl
===================================================================
RCS file: /cvs/xf86/xc/config/cf/Imake.tmpl,v
retrieving revision 3.151
diff -u -r3.151 Imake.tmpl
--- xc/config/cf/Imake.tmpl     29 Oct 2003 05:51:37 -0000      3.151
+++ xc/config/cf/Imake.tmpl     30 Oct 2003 22:52:38 -0000
@@ -991,6 +991,9 @@
 #ifndef DefaultCplusplusOptions
 #define DefaultCplusplusOptions /* floating point, etc. */
 #endif
+#ifndef HardCodeLibdirFlag
+#define HardCodeLibdirFlag     /**/
+#endif
 #ifndef NoRConst
 #define NoRConst NO /* YES if const for structs of funcs is bad */
 #endif
Index: xc/config/cf/OpenBSDLib.rules
===================================================================
RCS file: /cvs/xf86/xc/config/cf/OpenBSDLib.rules,v
retrieving revision 1.9
diff -u -r1.9 OpenBSDLib.rules
--- xc/config/cf/OpenBSDLib.rules       11 Oct 2003 09:40:09 -0000      1.9
+++ xc/config/cf/OpenBSDLib.rules       30 Oct 2003 22:52:38 -0000
@@ -53,7 +53,10 @@
 #define ExtraLoadFlags -Wl,-rpath,$(USRLIBDIRPATH) -Wl,-rpath-link,$(BUILDLIBDIR)
 #endif
 #endif
+#ifndef HardCodeLibdirFlag
+#define HardCodeLibdirFlag -Wl,-rpath,$(USRLIBDIRPATH)
 #endif
+#endif /* UseElfFormat */
 
 /*
  * InstallSharedLibrary - generate rules to install the shared library.
Index: xc/config/cf/bsdLib.rules
===================================================================
RCS file: /cvs/xf86/xc/config/cf/bsdLib.rules,v
retrieving revision 3.24
diff -u -r3.24 bsdLib.rules
--- xc/config/cf/bsdLib.rules   18 Oct 2003 17:21:41 -0000      3.24
+++ xc/config/cf/bsdLib.rules   30 Oct 2003 22:52:39 -0000
@@ -201,6 +201,10 @@
 #endif
 #endif
 
+#ifndef HardCodeLibdirFlag
+#define HardCodeLibdirFlag -Wl,-rpath,$(USRLIBDIRPATH)
+#endif
+
 #if !defined(ShlibGlobalsFlags)
 #define ShlibGlobalsFlags -Wl,-Bsymbolic
 #endif
Index: xc/config/cf/lnxLib.rules
===================================================================
RCS file: /cvs/xf86/xc/config/cf/lnxLib.rules,v
retrieving revision 3.51
diff -u -r3.51 lnxLib.rules
--- xc/config/cf/lnxLib.rules   25 Oct 2003 01:21:25 -0000      3.51
+++ xc/config/cf/lnxLib.rules   30 Oct 2003 22:52:39 -0000
@@ -85,7 +85,9 @@
 #   define ExtraLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
 #  endif
 # endif
-
+# ifndef HardCodeLibdirFlag
+#  define HardCodeLibdirFlag -Wl,-rpath,$(USRLIBDIRPATH)
+# endif
 # if !defined(ShlibGlobalsFlags)
 #  define ShlibGlobalsFlags -Wl,-Bsymbolic
 # endif
Index: xc/extras/fontconfig/fontconfig-config.in
===================================================================
RCS file: /cvs/xf86/xc/extras/fontconfig/fontconfig-config.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 fontconfig-config.in
--- xc/extras/fontconfig/fontconfig-config.in   4 Jun 2003 02:56:24 -0000       1.1.1.1
+++ xc/extras/fontconfig/fontconfig-config.in   30 Oct 2003 22:52:40 -0000
@@ -3,6 +3,7 @@
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 libdir="@libdir@"
[EMAIL PROTECTED]@
 includedir="@includedir@"
 version="@PACKAGE_VERSION@"
 
@@ -85,7 +86,7 @@
 if test "$echo_libs" = "yes" ; then
  libs="-lfontconfig"
  if test "${libdir}" != "/usr/lib" ; then
-  echo -L${libdir} $libs
+  echo ${hardcode_libdir_flag_spec} -L${libdir} $libs
  else
   echo $libs
  fi
Index: xc/extras/fontconfig/fontconfig.pc.in
===================================================================
RCS file: /cvs/xf86/xc/extras/fontconfig/fontconfig.pc.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 fontconfig.pc.in
--- xc/extras/fontconfig/fontconfig.pc.in       4 Jun 2003 02:56:24 -0000       1.1.1.1
+++ xc/extras/fontconfig/fontconfig.pc.in       30 Oct 2003 22:52:40 -0000
@@ -1,10 +1,11 @@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
[EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 
 Name: Fontconfig
 Description: Font configuration and customization library
 Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lfontconfig
+Libs: ${hardcode_libdir_flag_spec} -L${libdir} -lfontconfig
 Cflags: -I${includedir}
Index: xc/extras/freetype2/builds/unix/freetype-config.in
===================================================================
RCS file: /cvs/xf86/xc/extras/freetype2/builds/unix/freetype-config.in,v
retrieving revision 1.4
diff -u -r1.4 freetype-config.in
--- xc/extras/freetype2/builds/unix/freetype-config.in  22 Oct 2003 18:51:24 -0000     
 1.4
+++ xc/extras/freetype2/builds/unix/freetype-config.in  30 Oct 2003 22:52:40 -0000
@@ -4,6 +4,7 @@
 
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
[EMAIL PROTECTED]@
 
 usage()
 {
@@ -92,7 +93,7 @@
 if test "$echo_libs" = "yes" ; then
  libs="-lfreetype @LIBZ@"
  if test "@libdir@" != "/usr/lib" ; then
-  echo -Wl,[EMAIL PROTECTED]@ [EMAIL PROTECTED]@ $libs
+  echo ${hardcode_libdir_flag_spec} [EMAIL PROTECTED]@ $libs
  else
   echo $libs
  fi
Index: xc/lib/Xcursor/Imakefile
===================================================================
RCS file: /cvs/xf86/xc/lib/Xcursor/Imakefile,v
retrieving revision 1.3
diff -u -r1.3 Imakefile
--- xc/lib/Xcursor/Imakefile    26 Sep 2002 07:52:01 -0000      1.3
+++ xc/lib/Xcursor/Imakefile    30 Oct 2003 22:52:41 -0000
@@ -29,6 +29,8 @@
 REQUIREDLIBS = $(LDPRELIB) $(XRENDERLIB)
 #endif
 
+RPATH_CFLAG = HardCodeLibdirFlag
+
 ICONDIR=$(LIBDIR)/icons
 
 DEFINES=-DICONDIR=\"$(ICONDIR)\"
@@ -42,6 +44,7 @@
 SUBSTVARS=prefix="$(PROJECTROOT)" \
          exec_prefix="$(BINDIR)" \
          libdir="$(USRLIBDIR)" \
+         hardcode_libdir_flag_spec="$(RPATH_CFLAG)" \
          includedir="$(INCROOT)" \
          PACKAGE_VERSION="$(SOXCURSORREV).$(XCURSOR_REVISION)"
 
Index: xc/lib/Xcursor/xcursor-config.in
===================================================================
RCS file: /cvs/xf86/xc/lib/Xcursor/xcursor-config.in,v
retrieving revision 1.1
diff -u -r1.1 xcursor-config.in
--- xc/lib/Xcursor/xcursor-config.in    29 Aug 2002 04:40:34 -0000      1.1
+++ xc/lib/Xcursor/xcursor-config.in    30 Oct 2003 22:52:41 -0000
@@ -3,6 +3,7 @@
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 libdir="@libdir@"
[EMAIL PROTECTED]@
 includedir="@includedir@"
 version="@PACKAGE_VERSION@"
 
@@ -85,7 +86,7 @@
 if test "$echo_libs" = "yes" ; then
  libs="-lXcursor"
  if test "${libdir}" != "/usr/lib" ; then
-  echo -L${libdir} $libs
+  echo ${hardcode_libdir_flag_spec} -L${libdir} $libs
  else
   echo $libs
  fi
Index: xc/lib/Xcursor/xcursor.pc.in
===================================================================
RCS file: /cvs/xf86/xc/lib/Xcursor/xcursor.pc.in,v
retrieving revision 1.1
diff -u -r1.1 xcursor.pc.in
--- xc/lib/Xcursor/xcursor.pc.in        29 Aug 2002 04:40:34 -0000      1.1
+++ xc/lib/Xcursor/xcursor.pc.in        30 Oct 2003 22:52:41 -0000
@@ -1,11 +1,12 @@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
[EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 
 Name: Xcursor
 Description: X Cursor library
 Version: @PACKAGE_VERSION@
 Requires:
-Libs: -L${libdir} -lXcursor
+Libs: ${hardcode_libdir_flag_spec} -L${libdir} -lXcursor
 Cflags: -I${includedir}
Index: xc/lib/Xft/Imakefile
===================================================================
RCS file: /cvs/xf86/xc/lib/Xft/Imakefile,v
retrieving revision 1.26
diff -u -r1.26 Imakefile
--- xc/lib/Xft/Imakefile        24 Oct 2003 16:20:53 -0000      1.26
+++ xc/lib/Xft/Imakefile        30 Oct 2003 22:52:41 -0000
@@ -81,9 +81,12 @@
 
 #endif
 
+RPATH_CFLAG = HardCodeLibdirFlag
+
 SUBSTVARS=prefix="$(PROJECTROOT)" \
          exec_prefix="$(BINDIR)" \
          libdir="$(USRLIBDIR)" \
+         hardcode_libdir_flag_spec="$(RPATH_CFLAG)" \
          includedir="$(INCROOT)" \
          PACKAGE_VERSION="$(SOXFTREV).$(XFT_REVISION)" \
          FREETYPE_LIBS="$(FREETYPE_LIBS)" \
Index: xc/lib/Xft/xft-config.in
===================================================================
RCS file: /cvs/xf86/xc/lib/Xft/xft-config.in,v
retrieving revision 1.2
diff -u -r1.2 xft-config.in
--- xc/lib/Xft/xft-config.in    28 May 2002 15:59:32 -0000      1.2
+++ xc/lib/Xft/xft-config.in    30 Oct 2003 22:52:41 -0000
@@ -3,6 +3,7 @@
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 libdir="@libdir@"
[EMAIL PROTECTED]@
 includedir="@includedir@"
 version="@PACKAGE_VERSION@"
 freetypelibs="@FREETYPE_LIBS@"
@@ -91,7 +92,7 @@
 if test "$echo_libs" = "yes" ; then
  libs="-lXft ${freetypelibs} ${fontconfiglibs} ${xrenderlibs}"
  if test "${libdir}" != "/usr/lib" ; then
-  echo -L${libdir} $libs
+  echo ${hardcode_libdir_flag_spec} -L${libdir} $libs
  else
   echo $libs
  fi
Index: xc/lib/Xft/xft.pc.in
===================================================================
RCS file: /cvs/xf86/xc/lib/Xft/xft.pc.in,v
retrieving revision 1.1
diff -u -r1.1 xft.pc.in
--- xc/lib/Xft/xft.pc.in        23 May 2002 23:01:56 -0000      1.1
+++ xc/lib/Xft/xft.pc.in        30 Oct 2003 22:52:41 -0000
@@ -1,6 +1,7 @@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
[EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
 [EMAIL PROTECTED]@
@@ -11,5 +12,5 @@
 Description: X FreeType library
 Version: @PACKAGE_VERSION@
 Requires: fontconfig
-Libs: -L${libdir} -lXft ${freetypelibs} ${xrenderlibs}
+Libs: ${hardcode_libdir_flag_spec} -L${libdir} -lXft ${freetypelibs} ${xrenderlibs}
 Cflags: -I${includedir} ${freetypecflags} ${xrendercflags}
Index: xc/lib/fontconfig/Imakefile
===================================================================
RCS file: /cvs/xf86/xc/lib/fontconfig/Imakefile,v
retrieving revision 1.13
diff -u -r1.13 Imakefile
--- xc/lib/fontconfig/Imakefile 24 Oct 2003 16:21:12 -0000      1.13
+++ xc/lib/fontconfig/Imakefile 30 Oct 2003 22:52:42 -0000
@@ -75,9 +75,12 @@
 FONTDIRS=/usr/share/fonts $(FONTDIR) $(MACFONTDIRS)
 #endif
 
+RPATH_CFLAG = HardCodeLibdirFlag
+
 SUBSTVARS=prefix=$(PROJECTROOT) \
           exec_prefix=$(BINDIR) \
           libdir=$(USRLIBDIR) \
+         hardcode_libdir_flag_spec=$(RPATH_CFLAG) \
           includedir=$(INCROOT) \
           PACKAGE_VERSION=$(SOFONTCONFIGREV).$(FONTCONFIG_REVISION)
 
Index: xc/lib/freetype2/freetype/config/Imakefile
===================================================================
RCS file: /cvs/xf86/xc/lib/freetype2/freetype/config/Imakefile,v
retrieving revision 1.12
diff -u -r1.12 Imakefile
--- xc/lib/freetype2/freetype/config/Imakefile  24 Oct 2003 16:21:17 -0000      1.12
+++ xc/lib/freetype2/freetype/config/Imakefile  30 Oct 2003 22:52:42 -0000
@@ -30,10 +30,13 @@
 
 FREETYPE_VERSION=Freetype2Version
 
+RPATH_CFLAG = HardCodeLibdirFlag
+
 freetype-config: freetype-config.in
        sed -e [EMAIL PROTECTED]@%$(PROJECTROOT)% -e [EMAIL 
PROTECTED]@%$(PROJECTROOT)% \
        -e [EMAIL PROTECTED]@%$(USRLIBDIR)%g -e [EMAIL PROTECTED]@%$(INCDIR)%   \
        -e [EMAIL PROTECTED]@%$(FREETYPE_VERSION)% -e [EMAIL PROTECTED]@%% \
+       -e [EMAIL PROTECTED]@%$(RPATH_CFLAG)% \
        < freetype-config.in > $@
 
 includes:: freetype-config
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to