Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Compiling zsh-4.0.2 on Mac OS X

Sourceforge have just added a couple of MacOS X machines to the compile
farm so it is now easier to work out what is happening here. 

Wes Morgan wrote:
> This patch causes the "checking for executable suffix..." test in the
> configure script to fail with "compiler cannot create executables." The
> man page for ld on Mac OS X says that -x overlaps with a compiler option
> and that to invoke it from cc, it needs to be specified as "-Wl,-x". I
> changed this in the configure script and configure worked again. Then

Yes, that seems to work so I'll commit that change (both branches).

> "make" succeeded, but "make check" had some problems. I don't know if
> they are specific to OS X or something I did/didn't do. Here's the errors:
> Test ./C02cond.ztst failed: bad status 1, expected 0 from:
>   [[ -k modish && ! -k zerolength ]]
> Was testing: -k cond

This appears to be a bug in chmod as far as I can tell. chmod +t simply
doesn't work even though the man page says it should and the numeric
equivalent does. Changing the three chmods to one numeric one allows it
to set the sticky bit and the test to then work. If this change causes
problems on other platforms, we can use a $OSTYPE check. Anyone know
where I should report Darwin bugs to?

As Andrej pointed out the remaining failures were due to the lack of
modules such as zpty. Dynamic module loading doesn't work on MacOS X
because it uses Mach-O instead of ELF binaries which the dl* functions
are based around. Darwin uses some different NeXT based system instead
apparently. Perhaps the tests should better handle missing modules by
printing a succinct message and skipping the affected tests.

Anyway, I rebuilt a static zsh with the necessary extra modules. All
tests up until Y03 then passed successfully. Y03 hangs indefintely.
>From the verbose output, it is hanging on the `a and b' test. I'm not
very familiar with these completion tests so I've not looked into this
in detail.

The patch below also adds a mention of Darwin in Etc/MACHINES: it
should build `out-of-the-box' now though I expect there to be other


Index: zshconfig.ac
RCS file: /cvsroot/zsh/zsh/zshconfig.ac,v
retrieving revision 1.18
diff -u -r1.18 zshconfig.ac
--- zshconfig.ac        2001/09/13 18:47:02     1.18
+++ zshconfig.ac        2001/09/27 14:13:14
@@ -307,6 +307,7 @@
 if test -n "$auto_ldflags"; then
   case "${enable_zsh_debug}$host_os" in
     yesaix*|yeshpux*|yesnetbsd*|yesopenbsd*) ;;  # "ld -g" is not valid on these systems
+    darwin*) LDFLAGS=-Wl,-x ;;
     yes*)    LDFLAGS=-g ;;
     *)       LDFLAGS=-s ;;
RCS file: /cvsroot/zsh/zsh/Etc/MACHINES,v
retrieving revision 1.13
diff -u -r1.13 MACHINES
--- Etc/MACHINES        2001/06/29 14:59:43     1.13
+++ Etc/MACHINES        2001/09/27 14:13:14
@@ -17,6 +17,9 @@
+Apple: MacOS X/Darwin 1.4
+       Should build `out-of-the-box'. Dynamic loading does not work.
 Red Hat Inc.: Cygwin
        Should build `out-of-the-box'.  The compilation directory should
        be on a file system mounted as binary (the mount command shows
Index: Test/C02cond.ztst
RCS file: /cvsroot/zsh/zsh/Test/C02cond.ztst,v
retrieving revision 1.9
diff -u -r1.9 C02cond.ztst
--- Test/C02cond.ztst   2001/08/22 15:59:27     1.9
+++ Test/C02cond.ztst   2001/09/27 14:13:14
@@ -18,9 +18,7 @@
   mkdir modish
   chgrp $EGID modish
-  chmod g+xs modish
-  chmod u+s modish
-  chmod +t modish
+  chmod 7710 modish  # g+xs,u+s,+t
   touch unmodish
   chmod 000 unmodish

This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit

Messages sorted by: Reverse Date, Date, Thread, Author