# vim: ft=make ts=4 sw=4 noet
NAME    = readline
VERSION = 8.3
GARTYPE = v2

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

LICENSE = COPYING

PACKAGES                  += OZSWreadline
SPKG_DESC_OZSWreadline     = GNU readline library
CATALOGNAME_OZSWreadline   = readline

# Keep static libs alongside shared (for static linking by bash etc.)
MERGE_EXCLUDE_STATICLIBS =

EXTRA_CONFIGURE_ARGS += --with-curses
EXTRA_CONFIGURE_ARGS += --enable-shared
EXTRA_CONFIGURE_ARGS += --enable-static

# readline links against system curses (/usr/lib/libcurses.so — Solaris system lib)
EXTRA_LD_FLAGS += -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
