anchor.diff:  }
   
   do_install_append() {
  -	oe_multilib_header apr.h
  -	install -d ${D}${datadir}/apr
  -	cp ${S}/${HOST_SYS}-libtool ${D}${datadir}/build-1/libtool
  +	oe_multilib_header apr-1.0/apr.h
  +	install -m 0755 ${S}/${HOST_SYS}-libtool ${D}${datadir}/apr-1.0/build/libtool
  +
  +	ln -sf apr-1-config ${D}${bindir}/apr-config
   }
   
  +# apr-config is a symlink, only apr-1-config should be modified
  +BINCONFIG_GLOB = "apr-1-config"
   SSTATE_SCAN_FILES += "apr_rules.mk libtool"
   
   SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
   
   apr_sysroot_preprocess () {
  -	d=${SYSROOT_DESTDIR}${datadir}/apr
  -	install -d $d/
  -	cp ${S}/build/apr_rules.mk $d/
  +	d=${SYSROOT_DESTDIR}${datadir}/apr-1.0/build
   	sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
   	sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
   	sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
  -	sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
  -	cp ${S}/build/mkdir.sh $d/
  -	cp ${S}/build/make_exports.awk $d/
  -	cp ${S}/build/make_var_export.awk $d/
  +	sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr-1.0/build,g $d/apr_rules.mk
  +
  +	sed -i "s,cd /usr/share,cd ${STAGING_DATADIR},g" ${SYSROOT_DESTDIR}${bindir_crossscripts}/apr-1-config
   }
  +
  +DEBIANNAME_${PN} = "lib${PN}1"
  +DEBIANNAME_${PN}-dev = "lib${PN}1-dev"
  +DEBIANNAME_${PN}-dbg = "lib${PN}1-dbg"
   
   do_compile_ptest() {
   	cd ${S}/test
  
positive.code: # base branch: daisy
  #
  
  PR = "r0"
  
  inherit debian-package
  
  
negative.code: 
  OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
  
  # base on debian/rules
  EXTRA_OECONF = " \
      --enable-layout=Debian \
      --includedir=${includedir}/apr-1.0 \
      --with-installbuilddir=${datadir}/apr-1.0/build \
      --enable-nonportable-atomics \
      --enable-allocator-uses-mmap \
  "
  CACHED_CONFIGUREVARS += "ac_cv_prog_AWK=mawk"
  
  # apr_cv_mutex_robust_shared causes hangs in procmutex test on arm(el|hf) and alpha
  CACHED_CONFIGUREVARS_append_arm = " apr_cv_mutex_robust_shared=no"
  CACHED_CONFIGUREVARS_append_alpha = " apr_cv_mutex_robust_shared=no"
  
  # some minimal cross-building support
  CACHED_CONFIGUREVARS_append_class-target = " \
      ac_cv_file__dev_zero=yes \
      ac_cv_func_setpgrp_void=yes \
      apr_cv_epoll=yes \
      ac_cv_struct_rlimit=yes \
      apr_cv_tcp_nodelay_with_cork=yes \
      apr_cv_process_shared_works=yes \
  "
  CACHED_CONFIGUREVARS_append_class-target = " \
      ${@base_conditional('SITEINFO_BITS','32','ac_cv_sizeof_struct_iovec=8','',d)}"
  CACHED_CONFIGUREVARS_append_class-target = " \
      ${@base_conditional('SITEINFO_BITS','64','ac_cv_sizeof_struct_iovec=16','',d)}"
  
  # Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
  CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
  
  do_configure() {
  	cd ${S}
  	./buildconf
  
  	# We need to force the use of bash here. Otherwise, if apr is built with
  	# /bin/sh -> /bin/bash, the resulting libtool will not work on systems
  	# where /bin/sh -> /bin/dash.
  	${CACHED_CONFIGUREVARS} CONFIG_SHELL=/bin/bash \
  		/bin/bash ${CONFIGURE_SCRIPT} ${CONFIGUREOPTS} ${EXTRA_OECONF}
  }
  
  FILES_${PN}-dev += "${libdir}/apr.exp ${datadir}/apr-1.0/build/*"
  RDEPENDS_${PN}-dev = "bash"
  
  #for some reason, build/libtool.m4 handled by buildconf still be overwritten
  #when autoconf, so handle it again.
  