On Fri, 2006-09-22 at 13:19 -0500, Adam Litke wrote:
> Can you include an update to HOWTO in this patch?

build: Move ld.hugetlbfs into our share directory and symlink it to ld so
that using it can be as easy as gcc -B/usr/share/libhugetlbfs/. Also move
our custom ld scripts under our share dir to keep our files together.

docs: Update HOWTO with easier instructions for linking

Signed-off-by: Steve Fox <[EMAIL PROTECTED]>

diff --git a/HOWTO b/HOWTO
index 5b4e820..d236593 100644
--- a/HOWTO
+++ b/HOWTO
@@ -2,7 +2,7 @@ libhugetlbfs HOWTO
 ==================
 
 Author: David Gibson <[EMAIL PROTECTED]>, Adam Litke <[EMAIL PROTECTED]>, and 
others
-Last updated: Wednesday, 1st March 2006
+Last updated: Monday, September 25th 2006
 
 Introduction
 ============
@@ -260,27 +260,23 @@ convince gcc to invoke the ld.hugetlbfs 
 linker, rather than modifying your build procedure to invoke the
 ld.hugetlbfs directly; the compilers may often add special libraries
 or other linker options which can be fiddly to reproduce by hand.
+To make this easier, 'make install' will install ld.hugetlbfs into 
+$PREFIX/share/libhugetlbfs and create an 'ld' symlink to it.
 
-To do this with gcc, you will need a copy of the ld.hugetlbfs script
-(or a symbolic link to it) with the name 'ld' - gcc always expects the
-linker to be called "ld".  If you do this in a directory in your path
-you will effectively replace your normal ld with the ld.hugetlbfs
-script for all links (this is safe, because ld.hugetlbfs just invokes
-the linker normally if it's not given the --hugetblfs-link option).
-
-Once you have a suitable copy of the ld.hugetlbfs script, invoke gcc
-as a linker with two options:
-       -B /path/to/renamed/ld.hugetlbfs/script
-This option tells gcc to look in a nonstandard location for the
-linker, thus finding your renamed script rather than the normal
-linker.  If you put your renamed linker in the PATH, you can skip this
-option.
+Then with gcc, you invoke it as a linker with two options:
+
+       -B $PREFIX/share/libhugetlbfs
+
+This option tells gcc to look in a non-standard location for the
+linker, thus finding our script rather than the normal linker. This
+can optionally be set in the CFLAGS environment variable.
 
        -Wl,--hugetlbfs-link=B
 OR     -Wl,--hugetlbfs-link=BDT
+
 This option instructs gcc to pass the --hugetblfs-link option down to
 the linker, thus invoking the special behaviour of the ld.hugetblfs
-script.
+script. This can optionally be set in the LDFLAGS environment variable.
 
 If you use a compiler other than gcc, you will need to consult its
 documentation to see how to convince it to invoke ld.hugetlbfs in
diff --git a/Makefile b/Makefile
index 998f74d..f11eba5 100644
--- a/Makefile
+++ b/Makefile
@@ -57,8 +57,8 @@ endif
 
 LIBDIR32 = $(DESTDIR)$(PREFIX)/$(LIB32)
 LIBDIR64 = $(DESTDIR)$(PREFIX)/$(LIB64)
-LDSCRIPTDIR = $(PREFIX)/$(LIB32)/ldscripts
-BINDIR = $(DESTDIR)$(PREFIX)/bin
+LDSCRIPTDIR = $(PREFIX)/share/libhugetlbfs/ldscripts
+BINDIR = $(DESTDIR)$(PREFIX)/share/libhugetlbfs
 SBINDIR = $(DESTDIR)$(PREFIX)/sbin
 DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/libhugetlbfs
 
@@ -206,6 +206,7 @@ install: all $(OBJDIRS:%=%/install) $(IN
        $(INSTALL) -d $(BINDIR)
        for x in $(INSTALL_OBJSCRIPT); do \
                $(INSTALL) -m 755 objscript.$$x $(BINDIR)/$$x; done
+       cd $(BINDIR) && ln -s ld.hugetlbfs ld
 
 install-docs:
        $(INSTALL) -d $(DOCDIR)

-- 

Steve Fox
IBM Linux Technology Center

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to