default_pre_build &&
cd $SOURCE_DIRECTORY &&

# assure we don't use the included libs by accident
rm -Rf neon apr apr-util &&

if [[ "$(get_spell_provider $SPELL APR)" == "apr" ]] || \
   [[ "$(get_spell_provider $SPELL APU)" == "apr-util" ]]; then
  message "${MESSAGE_COLOR}Configuring ${SPELL} for APR/APR-UTIL 1.x...${DEFAULT_COLOR}" &&

  # this is one of the lovely fixes for building perl with apr 1.x
  patch -p1 < ${SPELL_DIRECTORY}/subversion-apr_cppflags.patch &&

  sedit "s:apr-config:apr-1-config:g" build/ac-macros/{find_,}ap* &&
  sedit "s:apu-config:apu-1-config:g" build/ac-macros/{find_,}ap* &&
  sedit 's,\(subversion/svnversion/svnversion.*\)\(>.*svn-revision.txt\),echo "exported" \2,' Makefile.in &&

  autoreconf -v -f &&
  libtoolize -f
fi
