Ensure, string is terminated
[bcusdk.git] / configure.in
blob9a76a5b7d443483a18f0a0c1392c969573e1e65c
1 AC_PREREQ(2.59)
3 AC_INIT(bcusdk, 0.0.2.1)
4 AM_INIT_AUTOMAKE
6 AC_CANONICAL_HOST
7 AC_PROG_CC
8 AC_PROG_CXX
9 AC_STDC_HEADERS
10 AC_PROG_YACC
11 AC_PROG_LEX
12 AM_PROG_AS
13 AC_PROG_RANLIB
14 AC_CHECK_PTHSEM(2.0.4,yes,yes,no)
15 AC_CHECK_HEADER(argp.h,,[AC_MSG_ERROR([argp_parse not found])])
16 AC_SEARCH_LIBS(argp_parse,argp,,[AC_MSG_ERROR([argp_parse not found])])
17 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])])
18 have_source_info=no
19 have_linux_api=no
20 AC_CHECK_HEADER(linux/rtnetlink.h,[AC_DEFINE(HAVE_LINUX_NETLINK, 1,[Linux netlink layer available]) have_source_info=yes],[],[-])
21 AC_CHECK_HEADER(linux/usbdevice_fs.h,[AC_DEFINE(LINUX_API, 1, [Linux usb available]) have_linux_api=yes; have_usb=yes],[],[-])
22 AC_CHECK_HEADER(iphlpapi.h,[AC_DEFINE(HAVE_WINDOWS_IPHELPER, 1,[Windows IPHelper available]) 
23   LIBS="-liphlpapi $LIBS"; have_source_info=yes],[],[-])
25 AC_CHECK_FUNCS(gethostbyname_r,,[AC_MSG_WARN([eibd client library not thread safe])])
27 AM_CONDITIONAL(LINUX_API, test x$have_linux_api = xyes)
29 AC_ARG_ENABLE(onlyeibd,
30 [  --enable-onlyeibd            build only eibd (requires no libxml and m68hc05-gnu)],
31 [case "${enableval}" in
32  yes) onlyeibd=true ;;
33   no)  onlyeibd=false ;;
34    *) AC_MSG_ERROR(bad value ${enableval} for --enable-onlyeibd) ;;
35  esac],[onlyeibd=false])
36 AM_CONDITIONAL(HAVE_ONLYEIBD, test x$onlyeibd = xtrue)
38 if test x$onlyeibd = xfalse ; then
40 AM_PATH_XML2(2.6.16,,[AC_MSG_ERROR([limxml2 not found])])
41 AC_PATH_PROG(TAS,[m68hc05-as],,[$PATH:$bindir:$prefix/bin])
42 AC_PATH_PROG(TLD,[m68hc05-ld],,[$PATH:$bindir:$prefix/bin])
43 AC_PATH_PROG(TAR,[m68hc05-ar],,[$PATH:$bindir:$prefix/bin])
44 AC_PATH_PROG(TRANLIB,[m68hc05-ranlib],,[$PATH:$bindir:$prefix/bin])
45 AC_PATH_PROG(TGCC,[m68hc05-gcc],,[$PATH:$bindir:$prefix/bin])
47 test -z "$TAS" && AC_MSG_ERROR([m68hc05-as not found])
48 test -z "$TAR" && AC_MSG_ERROR([m68hc05-ar not found])
49 test -z "$TLD" && AC_MSG_ERROR([m68hc05-ld not found])
50 test -z "$TRANLIB" && AC_MSG_ERROR([m68hc05 ranlib not found])
51 test -z "$TGCC" && AC_MSG_ERROR([m68hc05 gcc not found])
55 AC_ARG_ENABLE(ft12,
56 [  --enable-ft12                enable FT1.2 backend],
57 [case "${enableval}" in
58  yes) ft12=true ;;
59   no)  ft12=false ;;
60    *) AC_MSG_ERROR(bad value ${enableval} for --enable-ft12) ;;
61  esac],[ft12=false])
62 AM_CONDITIONAL(HAVE_FT12, test x$ft12 = xtrue)
63 if test x$ft12 = xtrue ; then
64  AC_DEFINE(HAVE_FT12, 1 , [FT1.2 enabled])
67 AC_ARG_ENABLE(pei16,
68 [  --enable-pei16       enable BCU1 kernel driver backend],
69 [case "${enableval}" in
70  yes) pei16=true ;;
71   no)  pei16=false ;;
72    *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16) ;;
73  esac],[pei16=false])
74 AM_CONDITIONAL(HAVE_PEI16, test x$pei16 = xtrue)
75 if test x$pei16 = xtrue; then
76  AC_DEFINE(HAVE_PEI16, 1 , [PEI16 enabled])
79 AC_ARG_ENABLE(tpuart,
80 [  --enable-tpuart      enable TPUART kernel driver backend],
81 [case "${enableval}" in
82  yes) tpuart=true ;;
83   no)  tpuart=false ;;
84    *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuart) ;;
85  esac],[tpuart=false])
86 AM_CONDITIONAL(HAVE_TPUART, test x$tpuart = xtrue)
87 if test x$tpuart = xtrue ; then
88  AC_DEFINE(HAVE_TPUART, 1 , [TPUART enabled])
91 AC_ARG_ENABLE(pei16s,
92 [  --enable-pei16s      enable BCU1 user driver backend (very experimental)],
93 [case "${enableval}" in
94  yes) pei16s=true ;;
95   no)  pei16s=false ;;
96    *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16s) ;;
97  esac],[pei16s=false])
98 AM_CONDITIONAL(HAVE_PEI16s, test x$pei16s = xtrue)
99 if test x$pei16s = xtrue ; then
100  AC_DEFINE(HAVE_PEI16s, 1 , [PEI16s enabled])
103 AC_ARG_ENABLE(tpuarts,
104 [  --enable-tpuarts     enable TPUART user driver backend (experimental)],
105 [case "${enableval}" in
106  yes) tpuarts=true ;;
107   no)  tpuarts=false ;;
108    *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuarts) ;;
109  esac],[tpuarts=false])
110 AM_CONDITIONAL(HAVE_TPUARTs, test x$tpuarts = xtrue)
111 if test x$tpuarts = xtrue ; then
112  AC_DEFINE(HAVE_TPUARTs, 1 , [TPUARTs enabled])
115 AC_ARG_ENABLE(eibnetip,
116 [  --enable-eibnetip    enable EIBnet/IP routing backend],
117 [case "${enableval}" in
118  yes) eibnetip=true ;;
119   no)  eibnetip=false ;;
120    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetip) ;;
121  esac],[eibnetip=false])
122 AM_CONDITIONAL(HAVE_EIBNETIP, test x$eibnetip = xtrue)
123 if test x$eibnetip = xtrue ; then
124  AC_DEFINE(HAVE_EIBNETIP, 1 , [EIBnet/IP enabled])
127 AC_ARG_ENABLE(eibnetiptunnel,
128 [  --enable-eibnetiptunnel      enable EIBnet/IP tunneling backend],
129 [case "${enableval}" in
130  yes) eibnetiptunnel=true ;;
131   no)  eibnetiptunnel=false ;;
132    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetiptunnel) ;;
133  esac],[eibnetiptunnel=false])
134 AM_CONDITIONAL(HAVE_EIBNETIPTUNNEL, test x$eibnetiptunnel = xtrue)
135 if test x$eibnetiptunnel = xtrue ; then
136  if test x$have_source_info != xyes ; then
137   AC_MSG_ERROR(not all needed functions for EIBnet/IP tunneling backend available)
138  fi
139  AC_DEFINE(HAVE_EIBNETIPTUNNEL, 1 , [EIBnet/IP tunneling enabled])
142 AC_ARG_ENABLE(usb,
143 [  --enable-usb                 enable USB backend],
144 [case "${enableval}" in
145  yes) usb=true ;;
146   no)  usb=false ;;
147    *) AC_MSG_ERROR(bad value ${enableval} for --enable-usb) ;;
148  esac],[usb=false])
149 AM_CONDITIONAL(HAVE_USB, test x$usb = xtrue)
150 if test x$usb = xtrue ; then
151  if test x$have_usb != xyes ; then
152   AC_MSG_ERROR(not all needed functions for USB backend available)
153  fi
154  AC_DEFINE(HAVE_USB, 1 , [USB backend enabled])
157 AC_ARG_ENABLE(eibnetipserver,
158 [  --enable-eibnetipserver      enable EIBnet/IP server frontend],
159 [case "${enableval}" in
160  yes) eibnetipserver=true ;;
161   no)  eibnetipserver=false ;;
162    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetipserver) ;;
163  esac],[eibnetipserver=false])
164 if test x$eibnetipserver = xtrue ; then
165  if test x$have_source_info != xyes ; then
166   AC_MSG_ERROR(not all needed functions for EIBnet/IP server available)
167  fi
168  AC_DEFINE(HAVE_EIBNETIPSERVER, 1 , [EIBnet/IP server enabled])
171 AC_ARG_ENABLE(groupcache,
172 [  --enable-groupcache          enable Group Cache],
173 [case "${enableval}" in
174  yes) groupcache=true ;;
175   no)  groupcache=false ;;
176    *) AC_MSG_ERROR(bad value ${enableval} for --enable-groupcache) ;;
177  esac],[groupcache=false])
178 if test x$groupcache = xtrue ; then
179  AC_DEFINE(HAVE_GROUPCACHE, 1 , [Group Cache enabled])
183 AM_CONDITIONAL(HAVE_SOURCE_INFO, test x$have_source_info = xyes )
185 AC_CONFIG_HEADERS(config.h)
186 AC_OUTPUT(Makefile 
187 common/Makefile
188 eibd/Makefile eibd/include/Makefile  eibd/client/Makefile eibd/examples/Makefile eibd/libserver/Makefile eibd/server/Makefile eibd/backend/Makefile
189 eibd/eibnet/Makefile eibd/bcu/Makefile eibd/usb/Makefile
190 xml/Makefile xml/gui/Makefile xml/gui/examples/Makefile
191 bcu/Makefile bcu/lib/Makefile bcu/include/Makefile bcu/ldscripts/Makefile
192 bcugen/Makefile bcugen/struct/Makefile bcugen/configfile/Makefile bcugen/lib/Makefile
193 archive/Makefile build/Makefile
194 contrib/Makefile
195 debian/Makefile