AC_PREREQ(2.59) AC_INIT(bcusdk, 0.0.3) AM_INIT_AUTOMAKE AC_CANONICAL_HOST AC_PROG_CC AC_PROG_CXX AC_STDC_HEADERS AC_PROG_YACC AC_PROG_LEX AM_PROG_AS AC_PROG_RANLIB AC_CHECK_PTHSEM(2.0.4,yes,yes,no) AC_CHECK_HEADER(argp.h,,[AC_MSG_ERROR([argp_parse not found])]) AC_SEARCH_LIBS(argp_parse,argp,,[AC_MSG_ERROR([argp_parse not found])]) AC_CHECK_HEADER(linux/serial.h,[AC_DEFINE(HAVE_LINUX_LOWLATENCY, 1 , [Linux low latency mode enabled])],[AC_MSG_WARN([No supported low latency mode found])]) have_source_info=no have_linux_api=no AC_CHECK_HEADER(linux/rtnetlink.h,[AC_DEFINE(HAVE_LINUX_NETLINK, 1,[Linux netlink layer available]) have_source_info=yes],[],[-]) AC_CHECK_HEADER(linux/usbdevice_fs.h,[AC_DEFINE(LINUX_API, 1, [Linux usb available]) have_linux_api=yes; have_usb=yes],[],[-]) AC_CHECK_HEADER(iphlpapi.h,[AC_DEFINE(HAVE_WINDOWS_IPHELPER, 1,[Windows IPHelper available]) LIBS="-liphlpapi $LIBS"; have_source_info=yes],[],[-]) AC_CHECK_FUNCS(gethostbyname_r,,[AC_MSG_WARN([eibd client library not thread safe])]) AM_CONDITIONAL(LINUX_API, test x$have_linux_api = xyes) AC_ARG_ENABLE(onlyeibd, [ --enable-onlyeibd build only eibd (requires no libxml and m68hc05-gnu)], [case "${enableval}" in yes) onlyeibd=true ;; no) onlyeibd=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-onlyeibd) ;; esac],[onlyeibd=false]) AM_CONDITIONAL(HAVE_ONLYEIBD, test x$onlyeibd = xtrue) if test x$onlyeibd = xfalse ; then AM_PATH_XML2(2.6.16,,[AC_MSG_ERROR([limxml2 not found])]) AC_PATH_PROG(TAS,[m68hc05-as],,[$PATH:$bindir:$prefix/bin]) AC_PATH_PROG(TLD,[m68hc05-ld],,[$PATH:$bindir:$prefix/bin]) AC_PATH_PROG(TAR,[m68hc05-ar],,[$PATH:$bindir:$prefix/bin]) AC_PATH_PROG(TRANLIB,[m68hc05-ranlib],,[$PATH:$bindir:$prefix/bin]) AC_PATH_PROG(TGCC,[m68hc05-gcc],,[$PATH:$bindir:$prefix/bin]) test -z "$TAS" && AC_MSG_ERROR([m68hc05-as not found]) test -z "$TAR" && AC_MSG_ERROR([m68hc05-ar not found]) test -z "$TLD" && AC_MSG_ERROR([m68hc05-ld not found]) test -z "$TRANLIB" && AC_MSG_ERROR([m68hc05 ranlib not found]) test -z "$TGCC" && AC_MSG_ERROR([m68hc05 gcc not found]) fi AC_ARG_ENABLE(ft12, [ --enable-ft12 enable FT1.2 backend], [case "${enableval}" in yes) ft12=true ;; no) ft12=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-ft12) ;; esac],[ft12=false]) AM_CONDITIONAL(HAVE_FT12, test x$ft12 = xtrue) if test x$ft12 = xtrue ; then AC_DEFINE(HAVE_FT12, 1 , [FT1.2 enabled]) fi AC_ARG_ENABLE(pei16, [ --enable-pei16 enable BCU1 kernel driver backend], [case "${enableval}" in yes) pei16=true ;; no) pei16=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16) ;; esac],[pei16=false]) AM_CONDITIONAL(HAVE_PEI16, test x$pei16 = xtrue) if test x$pei16 = xtrue; then AC_DEFINE(HAVE_PEI16, 1 , [PEI16 enabled]) fi AC_ARG_ENABLE(tpuart, [ --enable-tpuart enable TPUART kernel driver backend], [case "${enableval}" in yes) tpuart=true ;; no) tpuart=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuart) ;; esac],[tpuart=false]) AM_CONDITIONAL(HAVE_TPUART, test x$tpuart = xtrue) if test x$tpuart = xtrue ; then AC_DEFINE(HAVE_TPUART, 1 , [TPUART enabled]) fi AC_ARG_ENABLE(pei16s, [ --enable-pei16s enable BCU1 user driver backend (very experimental)], [case "${enableval}" in yes) pei16s=true ;; no) pei16s=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16s) ;; esac],[pei16s=false]) AM_CONDITIONAL(HAVE_PEI16s, test x$pei16s = xtrue) if test x$pei16s = xtrue ; then AC_DEFINE(HAVE_PEI16s, 1 , [PEI16s enabled]) fi AC_ARG_ENABLE(tpuarts, [ --enable-tpuarts enable TPUART user driver backend (experimental)], [case "${enableval}" in yes) tpuarts=true ;; no) tpuarts=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuarts) ;; esac],[tpuarts=false]) AM_CONDITIONAL(HAVE_TPUARTs, test x$tpuarts = xtrue) if test x$tpuarts = xtrue ; then AC_DEFINE(HAVE_TPUARTs, 1 , [TPUARTs enabled]) fi AC_ARG_ENABLE(eibnetip, [ --enable-eibnetip enable EIBnet/IP routing backend], [case "${enableval}" in yes) eibnetip=true ;; no) eibnetip=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetip) ;; esac],[eibnetip=false]) AM_CONDITIONAL(HAVE_EIBNETIP, test x$eibnetip = xtrue) if test x$eibnetip = xtrue ; then AC_DEFINE(HAVE_EIBNETIP, 1 , [EIBnet/IP enabled]) fi AC_ARG_ENABLE(eibnetiptunnel, [ --enable-eibnetiptunnel enable EIBnet/IP tunneling backend], [case "${enableval}" in yes) eibnetiptunnel=true ;; no) eibnetiptunnel=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetiptunnel) ;; esac],[eibnetiptunnel=false]) AM_CONDITIONAL(HAVE_EIBNETIPTUNNEL, test x$eibnetiptunnel = xtrue) if test x$eibnetiptunnel = xtrue ; then if test x$have_source_info != xyes ; then AC_MSG_ERROR(not all needed functions for EIBnet/IP tunneling backend available) fi AC_DEFINE(HAVE_EIBNETIPTUNNEL, 1 , [EIBnet/IP tunneling enabled]) fi AC_ARG_ENABLE(usb, [ --enable-usb enable USB backend], [case "${enableval}" in yes) usb=true ;; no) usb=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-usb) ;; esac],[usb=false]) AM_CONDITIONAL(HAVE_USB, test x$usb = xtrue) if test x$usb = xtrue ; then if test x$have_usb != xyes ; then AC_MSG_ERROR(not all needed functions for USB backend available) fi AC_DEFINE(HAVE_USB, 1 , [USB backend enabled]) fi AC_ARG_ENABLE(eibnetipserver, [ --enable-eibnetipserver enable EIBnet/IP server frontend], [case "${enableval}" in yes) eibnetipserver=true ;; no) eibnetipserver=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetipserver) ;; esac],[eibnetipserver=false]) if test x$eibnetipserver = xtrue ; then if test x$have_source_info != xyes ; then AC_MSG_ERROR(not all needed functions for EIBnet/IP server available) fi AC_DEFINE(HAVE_EIBNETIPSERVER, 1 , [EIBnet/IP server enabled]) fi AC_ARG_ENABLE(groupcache, [ --enable-groupcache enable Group Cache (default: yes)], [case "${enableval}" in yes) groupcache=true ;; no) groupcache=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-groupcache) ;; esac],[groupcache=true]) if test x$groupcache = xtrue ; then AC_DEFINE(HAVE_GROUPCACHE, 1 , [Group Cache enabled]) fi AM_CONDITIONAL(HAVE_SOURCE_INFO, test x$have_source_info = xyes ) AC_CHECK_PROGS(INDENT, indent, no) AC_CHECK_PROGS(JAR, fastjar jar, no) AC_CHECK_PROGS(JAVAC, "gcj -C" javac, no) AC_ARG_ENABLE(java, [ --enable-java build java client library], [case "${enableval}" in yes) enablejava=true ;; no) enablejava=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-java) ;; esac],[enablejava=false]) if test x$enablejava = xtrue ; then AC_DEFINE(BUILD_JAVA, 1 , [building java client library]) if test x"$JAVAC" = xno ; then AC_MSG_ERROR(no java compiler found) fi if test x"$JAR" = xno ; then AC_MSG_ERROR(jar not found) fi fi AM_CONDITIONAL(BUILD_JAVA, test x$enablejava = xtrue ) AC_CONFIG_HEADERS(config.h) AC_OUTPUT(Makefile common/Makefile eibd/Makefile eibd/include/Makefile eibd/client/Makefile eibd/examples/Makefile eibd/libserver/Makefile eibd/server/Makefile eibd/backend/Makefile eibd/client/def/Makefile eibd/client/c/Makefile eibd/client/java/Makefile eibd/client/php/Makefile eibd/eibnet/Makefile eibd/bcu/Makefile eibd/usb/Makefile xml/Makefile xml/gui/Makefile xml/gui/examples/Makefile bcu/Makefile bcu/lib/Makefile bcu/include/Makefile bcu/ldscripts/Makefile bcugen/Makefile bcugen/struct/Makefile bcugen/configfile/Makefile bcugen/lib/Makefile archive/Makefile build/Makefile contrib/Makefile debian/Makefile )