#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk

IS_FREMANTLE=$(shell if grep Fremantle /etc/maemo_version &> /dev/null; then echo y; else echo n; fi)

# LDFLAGS= 
DEB_TAR_SRCDIR:=bash-4.2
DEB_CONFIGURE_NORMAL_ARGS:=--prefix=/usr --sysconfdir=/etc -C \
	--bindir=/bin --sbindir=/sbin \
	--with-curses \
	--with-installed-readline=no \
	--disable-nls \
	--enable-separate-helpfiles \
	--disable-debugger \
	--disable-mem-scramble \
	--enable-multibyte \
	--enable-largefile \
	--infodir=/usr/share/info \
	--mandir=/usr/share/man \
	--without-bash-malloc
ifeq ($(IS_FREMANTLE),y)
DEB_OPT_FLAG_armel:=-O2 -fomit-frame-pointer -pipe -mcpu=cortex-a8
else
DEB_OPT_FLAG_armel:=-O2 -fomit-frame-pointer -pipe
endif
DEB_OPT_FLAG_i386:=-O2 -fomit-frame-pointer -pipe -march=i686 -mtune=pentium2
DEB_OPT_FLAG:=$(DEB_OPT_FLAG_$(DEB_HOST_ARCH))
DEB_DESTDIR=$(CURDIR)/debian/tmp

include /usr/share/cdbs/1/rules/tarball.mk

install/bash4::
	mv debian/tmp/bin/bash debian/tmp/bin/bash4

binary-predeb/%::
	maemo-optify $*
