|
root / base / usr / src / cmd / zsh / Makefile
Makefile Makefile 75 lines 2.1 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# 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