anchor.diff:  	sed -i "s#LIBTOOL=\$(apr_builddir)#LIBTOOL=${STAGING_BINDIR_NATIVE}#" ${S}/build/rules.mk
   }
   
  -FILES_${PN}     += "${libdir}/apr-util-1/apr_dbm_gdbm-1.so"
  -FILES_${PN}-dev += "${libdir}/aprutil.exp ${libdir}/apr-util-1/apr_dbm_gdbm.so* ${libdir}/apr-util-1/apr_dbm_gdbm.la"
  +do_install_append() {
  +	install -D -m 0644 ${S}/build/find_apu.m4 ${D}${datadir}/apr-1.0/build/find_apu.m4
  +	ln -sf apu-1-config ${D}${bindir}/apu-config
  +}
  +
  +# apu-config is a symlink, only apu-1-config should be modified
  +BINCONFIG_GLOB = "apu-1-config"
  +
  +PACKAGES =+ "libaprutil1-ldap libaprutil1-dbd-mysql libaprutil1-dbd-sqlite3 \
  +             libaprutil1-dbd-odbc libaprutil1-dbd-pgsql"
  +
  +FILES_libaprutil1-ldap = "${libdir}/apr-util-1/apr_ldap-1.so"
  +FILES_libaprutil1-dbd-mysql = "${libdir}/apr-util-1/apr_dbd_mysql-1.so"
  +FILES_libaprutil1-dbd-sqlite3 = "${libdir}/apr-util-1/apr_dbd_sqlite3-1.so"
  +FILES_libaprutil1-dbd-odbc = "${libdir}/apr-util-1/apr_dbd_odbc-1.so"
  +FILES_libaprutil1-dbd-pgsql = "${libdir}/apr-util-1/apr_dbd_pgsql-1.so"
  +
  +FILES_${PN} += " \
  +    ${libdir}/apr-util-1/apr_dbm_db-1.so \
  +    ${libdir}/apr-util-1/apr_crypto_openssl-1.so \
  +"
  +FILES_${PN}-dev += " \
  +    ${libdir}/aprutil.exp \
  +    ${libdir}/apr-util-1/*.a \
  +    ${libdir}/apr-util-1/*.la \
  +    ${libdir}/apr-util-1/*[!-1].so \
  +    ${datadir}/apr-1.0/build/* \
  +"
   FILES_${PN}-dbg += "${libdir}/apr-util-1/.debug/*"
  -FILES_${PN}-staticdev += "${libdir}/apr-util-1/apr_dbm_gdbm.a"
  +FILES_${PN}-staticdev += "${libdir}/apr-util-1/*.a"
  +
  +RDEPENDS_libaprutil1-ldap += "${PN}"
  +RDEPENDS_libaprutil1-dbd-mysql += "${PN}"
  +RDEPENDS_libaprutil1-dbd-sqlite3 += "${PN}"
  +RDEPENDS_libaprutil1-dbd-odbc += "${PN}"
  +RDEPENDS_libaprutil1-dbd-pgsql += "${PN}"
  +
  +DEBIANNAME_${PN} = "libaprutil1"
  +DEBIANNAME_${PN}-dev = "libaprutil1-dev"
  +
  +RPROVIDES_${PN} += "libaprutil1"
  +RPROVIDES_${PN}-dev += "libaprutil1-dev"
   
   inherit ptest
   
  
positive.code: # base branch: daisy
  #
  
  PR = "r0"
  
  inherit debian-package
  
  DEPENDS = "apr expat gdbm"
  
  BBCLASSEXTEND = "native"
  
  
negative.code: file://run-ptest \
  "
  
  # base on debian/rules
  EXTRA_OECONF = " \
      LTFLAGS=--no-silent \
      --with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
      --enable-layout=Debian \
      --includedir=${includedir}/apr-1.0 \
      --with-expat=${STAGING_DIR_HOST}${prefix} \
  "
  CACHED_CONFIGUREVARS += "ac_cv_prog_AWK=mawk"
  CACHED_CONFIGUREVARS += " \
      ${@base_conditional('DPKG_ARCH','i386',\
        'apr_lock_method=USE_PROC_PTHREAD_SERIALIZE',\
        'ac_cv_func_pthread_mutexattr_setpshared=no \
         ac_cv_func_sem_open=no'\
        ,d)}"
  
  PACKAGECONFIG ??= "db53 ldap mysql odbc openssl pgsql sqlite3"
  PACKAGECONFIG[db53] = " \
      --with-dbm=db53 --with-berkeley-db=${STAGING_DIR_HOST}${prefix}, \
      --without-berkeley-db,db"
  PACKAGECONFIG[gdbm] = " \
      --with-dbm=gdbm --with-gdbm=${STAGING_DIR_HOST}${prefix}, \
      --without-gdbm,gdbm"
  PACKAGECONFIG[ldap] = " \
      --with-ldap=yes --with-ldap-include=${STAGING_INCDIR}/ --with-ldap-lib=${STAGING_LIBDIR}, \
      --with-ldap=no,libldap openldap"
  PACKAGECONFIG[mysql] = " \
      --with-mysql=${STAGING_DIR_HOST}${prefix} MYSQL_CONFIG=${STAGING_BINDIR_CROSS}/mysql_config, \
      --without-mysql,mysql"
  PACKAGECONFIG[odbc] = "--with-odbc=${STAGING_DIR_HOST}${prefix},--without-odbc,unixodbc"
  PACKAGECONFIG[openssl] = " \
      --with-crypto --with-openssl=${STAGING_DIR_HOST}${prefix}, \
      --without-openssl,openssl"
  PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_HOST}${prefix},--without-pgsql,postgresql"
  PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_DIR_HOST}${prefix},--without-sqlite3,sqlite3"
  PACKAGECONFIG[sqlite2] = "--with-sqlite2=${STAGING_DIR_HOST}${prefix},--without-sqlite2,sqlite"
  
  inherit autotools-brokensep lib_package binconfig
  
  OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
  
  do_configure_prepend() {
  	./buildconf --with-apr=$(apr-1-config --srcdir)
  }
  
  do_configure_append_class-native() {
  