# # Copyright 2026 Zygaena Project # # Hammerhead: zsh 5.9 autotools wrapper # Installs to /bin (boot-essential shell, root login shell) # include ../Makefile.cmd unexport LD_ALTEXEC unexport VERSION CONTRIBDIR = $(CONTRIB)/zsh BUILDDIR = $(CURDIR)/build CC = $(GNUC_ROOT)/bin/gcc CONFIGURE = $(CONTRIBDIR)/configure CONFIGURE_FLAGS = \ --prefix=/usr \ --bindir=/bin \ --mandir=/usr/share/man \ --enable-multibyte \ --enable-dynamic \ --enable-largefile \ --with-tcsetpgrp \ --with-term-lib=curses \ --disable-gdbm \ --enable-fndir=/usr/share/zsh/5.9/functions \ --enable-scriptdir=/usr/share/zsh/5.9/scripts \ DL_EXT=so CONFIGURE_ENV = \ CC="$(CC)" \ CFLAGS="-m64 -O2 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion" \ LDFLAGS="-m64" \ DLLDFLAGS="-shared" \ zsh_cv_sys_nis=no \ zsh_cv_sys_nis_plus=no # Set the correct dynamic linker for the target system (not the build host). # Cannot be in LDFLAGS during configure — test programs must run on build host. # Uses illumos ld -I syntax (LD_ALTEXEC unexported, so GCC uses /usr/bin/ld). INTERP_FLAG = -Wl,-I/usr/lib/ld.so.1 all: $(BUILDDIR)/Makefile $(MAKE) -C $(BUILDDIR) -j4 EXELDFLAGS="$(INTERP_FLAG)" $(BUILDDIR)/Makefile: $(CONTRIBDIR)/configure mkdir -p $(BUILDDIR) cd $(BUILDDIR) && $(CONFIGURE_ENV) $(CONFIGURE) --srcdir=$(CONTRIBDIR) \ --build=x86_64-pc-solaris2.11 --host=x86_64-pc-solaris2.11 \ $(CONFIGURE_FLAGS) sed -i '/^name=zsh\/zftp/s/link=dynamic/link=no/' $(BUILDDIR)/config.modules # Touch all autotools-generated files so the generated Makefile # won't try to regenerate them (no GNU m4 / autoconf on Hammerhead). # Must happen AFTER configure so timestamps are newer than .ac sources. touch $(CONTRIBDIR)/aclocal.m4 $(CONTRIBDIR)/configure \ $(CONTRIBDIR)/config.h.in $(CONTRIBDIR)/stamp-h.in install: all DESTDIR=$(ROOT) $(MAKE) -C $(BUILDDIR) install EXELDFLAGS="$(INTERP_FLAG)" $(RM) $(ROOTESSBIN)/zsh-5.9 $(SYMLINK) zsh $(ROOTESSBIN)/zsh-5.9 clean: $(RM) -r $(BUILDDIR) clobber: clean _msg: .PHONY: all install clean clobber _msg