# vim: ft=make ts=4 sw=4 noet
NAME    = bash
VERSION = 5.3
GARTYPE = v2

MASTER_SITES = http://ftp.gnu.org/gnu/bash/
DISTFILES   += $(DISTNAME).tar.gz

LICENSE = COPYING

PACKAGES              += OZSWbash
SPKG_DESC_OZSWbash     = GNU Bourne Again SHell
CATALOGNAME_OZSWbash   = bash

RUNTIME_DEP_PKGS_OZSWbash += OZSWreadline

# Use installed readline from /opt/ozsw; disable bash's bundled malloc
# (Solaris malloc is fine); enable readline and history
EXTRA_CONFIGURE_ARGS += --with-installed-readline=$(prefix)
EXTRA_CONFIGURE_ARGS += --without-bash-malloc
EXTRA_CONFIGURE_ARGS += --enable-readline
EXTRA_CONFIGURE_ARGS += --enable-history

# readline links against system curses; bash must drag it along
EXTRA_LD_FLAGS += -lreadline -lhistory -lcurses

# Fix libtool ECHO="print -r --" (ksh93 builtin, fails under bash)
post-configure:
	@if [ -f $(WORKSRC)/libtool ]; then \
	    find $(WORKSRC) -name "libtool" -type f -exec \
	        gsed -i 's/ECHO="print -r --"/ECHO="printf %s\\n"/g' {} \; ; \
	fi
	@$(MAKECOOKIE)

include gar/category.mk
