# wrapper for configure to create the config files to build bash using the clang19 toolchain in Android
#
#

#DEBUG_CFLAGS="-g -O0"
DEBUG_CFLAGS=""

CFLAGS="${CFLAGS} -Wno-implicit-function-declaration -Wno-int-conversion ${DEBUG_CFLAGS}"

CFLAGS="${CFLAGS} "
LDFLAGS="${LDFLAGS} "

CXXFLAGS="${CFLAGS}"
CXXFLAGS="${CXXFLAGS} ${DEBUG_CFLAGS}"


CONFIGURE_OPTIONS="
--enable-multibyte --without-bash-malloc --with-installed-readline
 bash_cv_job_control_missing=present
 bash_cv_sys_siglist=yes
 bash_cv_func_sigsetjmp=present
 bash_cv_unusable_rtsigs=no
 ac_cv_func_mbsnrtowcs=no
 bash_cv_dev_fd=whacky
 bash_cv_getcwd_malloc=yes
--disable-nls

--enable-alias
--enable-job-control
--enable-translatable-strings
--enable-net-redirections
--enable-select    

--enable-readline 
--enable-history 
"

TEST_VAR="
  --enable-alias          
  --enable-arith-for-command
  --enable-bang-history  
  --enable-brace-expansion
  --enable-casemod-attributes
  --enable-casemod-expansions
  --enable-command-timing 
  --enable-cond-command   
  --enable-cond-regexp    
  --enable-coprocesses    
  --enable-debugger       
  --enable-directory-stack
  --enable-disabled-builtins
  --enable-dparen-arithmetic
  --enable-extended-glob  
  --enable-function-import
  --enable-glob-asciiranges-default
  --enable-help-builtin   
  --enable-history        
  --enable-job-control    
  --enable-multibyte      
  --enable-net-redirections
  --enable-process-substitution
  --enable-progcomp       
  --enable-prompt-string-decoding
  --enable-readline       
  --enable-restricted     
  --enable-select         
  --enable-translatable-strings
  --enable-xpg-echo-default
  --enable-mem-scramble   
  --enable-profiling      
  --disable-rpath         
  --enable-array-variables
"

#  --enable-static-link    link bash statically, for use as a root shell



TARGET_ROOT="${TARGET_ROOT:=/system}"

${PREFIX}  ./configure  --prefix=${TARGET_ROOT}/usr/ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ${CONFIGURE_OPTIONS}  $* 

