bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] Fix building readline on future OS X versions, and al


From: Hiroo Hayashi
Subject: Re: [Bug-readline] Fix building readline on future OS X versions, and also cleanup the relevant code
Date: Sun, 23 Feb 2014 13:54:30 +0900

Hi,

On 6.3-rc2 'support/shobj_conf' was fixed for Mac OS but there is a
issue on Marvericks, although it is not fatal.

On Marvericks "-arch_only i386' flag is ignored and X86_64 binaries are
generated by default.

-----------------------------
$ uname -a
Darwin tonny.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 
2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
$ make > /dev/null
...
rm -f libreadline.6.3.dylib
gcc -dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch` 
-dynamiclib -arch_only `/usr/bin/arch` -install_name 
/Users/hiroo/Work/trg/6.3/lib/`echo libreadline.6.3.dylib | sed 
"s:\..*::"`.6.dylib -current_version 6.3 -compatibility_version 6 -v -o 
libreadline.6.3.dylib readline.so vi_mode.so funmap.so keymaps.so parens.so 
search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so 
kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so 
misc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so 
tilde.so colors.so parse-colors.so xmalloc.so xfree.so compat.so -lncurses
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
clang: warning: argument unused during compilation: '-arch_only i386'
clang: warning: argument unused during compilation: '-arch_only i386'
 "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -dynamic -dylib 
-dylib_compatibility_version 6 -dylib_current_version 6.3 -arch x86_64 
-dylib_install_name /Users/hiroo/Work/trg/6.3/lib/libreadline.6.dylib -dynamic 
-macosx_version_min 10.9.0 -undefined dynamic_lookup -undefined dynamic_lookup 
-o libreadline.6.3.dylib readline.so vi_mode.so funmap.so keymaps.so parens.so 
search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so 
kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so 
misc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so 
tilde.so colors.so parse-colors.so xmalloc.so xfree.so compat.so -lncurses 
-lSystem 
/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.0/lib/darwin/libclang_rt.osx.a
rm -f libhistory.6.3.dylib
gcc -dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch` 
-dynamiclib -arch_only `/usr/bin/arch` -install_name 
/Users/hiroo/Work/trg/6.3/lib/`echo libhistory.6.3.dylib | sed 
"s:\..*::"`.6.dylib -current_version 6.3 -compatibility_version 6 -v -o 
libhistory.6.3.dylib history.so histexpand.so histfile.so histsearch.so 
shell.so mbutil.so xmalloc.so xfree.so -lncurses
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
clang: warning: argument unused during compilation: '-arch_only i386'
clang: warning: argument unused during compilation: '-arch_only i386'
 "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -dynamic -dylib 
-dylib_compatibility_version 6 -dylib_current_version 6.3 -arch x86_64 
-dylib_install_name /Users/hiroo/Work/trg/6.3/lib/libhistory.6.dylib -dynamic 
-macosx_version_min 10.9.0 -undefined dynamic_lookup -undefined dynamic_lookup 
-o libhistory.6.3.dylib history.so histexpand.so histfile.so histsearch.so 
shell.so mbutil.so xmalloc.so xfree.so -lncurses -lSystem 
/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.0/lib/darwin/libclang_rt.osx.a
$ 
-------------------------

Here is a patch.
I did not specify 'i386', because it seems that it is not default on Mac
OS X (even though /usr/bin/arch returns 'i386').
I also added two lines to generate 32 and 64bit universal library which
some Mac OS X binaries (ex. /usr/bin/perl) expect.

--- support/shobj-conf-dist     2014-01-28 22:53:19.000000000 +0900
+++ support/shobj-conf  2014-02-23 13:35:45.977232800 +0900
@@ -193,8 +193,19 @@
                ;;
        # Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
        *)
-               SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup 
-arch_only `/usr/bin/arch`'
-               SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` 
-install_name $(libdir)/`echo $@ | sed 
"s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version 
$(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+               case "${host_os}" in
+               darwin[89]*|darwin1[012]*)
+                       SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`'
+                       ;;
+               *)      # Mac OS X 10.9 (Mavericks) and later
+                       SHOBJ_ARCHFLAGS=
+                       # for 32 and 64bit universal library
+                       #SHOBJ_ARCHFLAGS='-arch i386 -arch x86_64'
+                       #SHOBJ_CFLAGS=${SHOBJ_CFLAGS}' -arch i386 -arch x86_64'
+                       ;;
+               esac
+               SHOBJ_LDFLAGS="-dynamiclib -dynamic -undefined dynamic_lookup 
${SHOBJ_ARCHFLAGS}"
+               SHLIB_XLDFLAGS="-dynamiclib ${SHOBJ_ARCHFLAGS}"' -install_name 
$(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) 
-current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version 
$(SHLIB_MAJOR) -v'
                ;;
        esac


-- 
Hiroo Hayashi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]