[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: readline with shared libraries on Mac OS X/Darwin
From: |
David R. Morrison |
Subject: |
Re: readline with shared libraries on Mac OS X/Darwin |
Date: |
Sat, 3 Aug 2002 12:42:13 -0400 |
Chet Ramey wrote:
> > We've noticed a problem with the darwin|macosx "stanza" in the shobj-conf
> > file in readline. In Darwin, the shared library command requires a bunch
> > of flags which are unknown on ELF and other systems. The flag giving
> > trouble is Darwin's -install_name flag.
> >
> > Whoever wrote this stanza (and it may well have been Fink's founder, chrisp,
> > who is no longer with the project), wrote
> > -install_name $(libdir)/$@
> > and when this is actually used (in the current version, say), $@ expands to
> > libreadline.4.3.dylib or libhistory.4.3.dylib. However, what we need it to
> > expand to is libreadline.4.dylib or libhistory.4.dylib. In other words, it
> > should show the filename with only the major version number present, not
> > the minor version number.
>
> You should be able to do what you want by changing the assignment to
> SHLIB_LIBVERSION in the darwin/macosx stanza. If you make it look like
>
> SHLIB_LIBVERSION='$(SHLIB_MAJOR).$(SHLIB_LIBSUFF)'
>
> the makefile will create libreadline.4.dylib and libhistory.4.dylib as
> targets and `$@' will expand to what you want.
That didn't quite work, becuase the wrong targets were created and the
linking routine got messed up. But it did lead me to a good solution,
borrowing code from the definition of LINK2 in support/shlib-install.
Appended below is a patch for readline-4.3 which causes the readline
libraries to be created with the correct -install_name flag in
darwin/macosx.
-- Dave
diff -ru readline-4.3/support/shobj-conf readline-4.3-patched/support/shobj-conf
--- readline-4.3/support/shobj-conf Wed Apr 17 10:27:46 2002
+++ readline-4.3-patched/support/shobj-conf Sat Aug 3 09:20:01 2002
@@ -146,7 +146,7 @@
SHLIB_LIBSUFF='dylib'
SHOBJ_LDFLAGS='-dynamic'
- SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@
-current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version
$(SHLIB_MAJOR) -v'
+ SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name
$(libdir)/`echo $@ | sed "s:\\(.*\\.[0-9]\\)\\.[0-9]:\\1:"` -current_version
$(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
SHLIB_LIBS='-lSystem'
;;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: readline with shared libraries on Mac OS X/Darwin,
David R. Morrison <=