+ sed \
+ -e 's/CPPFLAGS =/CPPFLAGS +=/g' \
+ -e 's/CFLAGS =/CFLAGS +=/g' \
+ -e 's/LDFLAGS =/LDFLAGS +=/g' \
+ -e 's/_BSD_SOURCE/_DEFAULT_SOURCE/' \
+ -i config.mk
+ sed '/@tic/d' -i Makefile
+ for file in "${source[@]}"; do
+ if [[ "$file" == "config.h" ]]; then
+ # add config.h if present in source array
+ # Note: this supersedes the above sed to config.def.h
+ cp "$srcdir/$file" .
+ elif [[ "$file" == *.diff || "$file" == *.patch ]]; then
+ # add all patches present in source array
+ patch -Np1 <"$srcdir/$(basename ${file})"
+ fi
+ done