Add route source info function for FreeBSD
[bcusdk.git] / configure.in
blobe67f28b61744b145de2e0fada4f80d9de33b3a44
1 AC_PREREQ(2.59)
3 AC_INIT(bcusdk, 0.0.3)
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 have_bsd_source_info=no
26 if test x$have_bsd_source_info = xyes ; then
27   AC_DEFINE(HAVE_BSD_SOURCEINFO, 1,[FreeBSD compatible sourceinfo])
28   have_source_info=yes
31 AC_CHECK_FUNCS(gethostbyname_r,,[AC_MSG_WARN([eibd client library not thread safe])])
33 AM_CONDITIONAL(LINUX_API, test x$have_linux_api = xyes)
35 AC_ARG_ENABLE(onlyeibd,
36 [  --enable-onlyeibd            build only eibd (requires no libxml and m68hc05-gnu)],
37 [case "${enableval}" in
38  yes) onlyeibd=true ;;
39   no)  onlyeibd=false ;;
40    *) AC_MSG_ERROR(bad value ${enableval} for --enable-onlyeibd) ;;
41  esac],[onlyeibd=false])
42 AM_CONDITIONAL(HAVE_ONLYEIBD, test x$onlyeibd = xtrue)
44 if test x$onlyeibd = xfalse ; then
46 AM_PATH_XML2(2.6.16,,[AC_MSG_ERROR([limxml2 not found])])
47 AC_PATH_PROG(TAS,[m68hc05-as],,[$PATH:$bindir:$prefix/bin])
48 AC_PATH_PROG(TLD,[m68hc05-ld],,[$PATH:$bindir:$prefix/bin])
49 AC_PATH_PROG(TAR,[m68hc05-ar],,[$PATH:$bindir:$prefix/bin])
50 AC_PATH_PROG(TRANLIB,[m68hc05-ranlib],,[$PATH:$bindir:$prefix/bin])
51 AC_PATH_PROG(TGCC,[m68hc05-gcc],,[$PATH:$bindir:$prefix/bin])
53 test -z "$TAS" && AC_MSG_ERROR([m68hc05-as not found])
54 test -z "$TAR" && AC_MSG_ERROR([m68hc05-ar not found])
55 test -z "$TLD" && AC_MSG_ERROR([m68hc05-ld not found])
56 test -z "$TRANLIB" && AC_MSG_ERROR([m68hc05 ranlib not found])
57 test -z "$TGCC" && AC_MSG_ERROR([m68hc05 gcc not found])
61 AC_ARG_ENABLE(ft12,
62 [  --enable-ft12                enable FT1.2 backend],
63 [case "${enableval}" in
64  yes) ft12=true ;;
65   no)  ft12=false ;;
66    *) AC_MSG_ERROR(bad value ${enableval} for --enable-ft12) ;;
67  esac],[ft12=false])
68 AM_CONDITIONAL(HAVE_FT12, test x$ft12 = xtrue)
69 if test x$ft12 = xtrue ; then
70  AC_DEFINE(HAVE_FT12, 1 , [FT1.2 enabled])
73 AC_ARG_ENABLE(pei16,
74 [  --enable-pei16       enable BCU1 kernel driver backend],
75 [case "${enableval}" in
76  yes) pei16=true ;;
77   no)  pei16=false ;;
78    *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16) ;;
79  esac],[pei16=false])
80 AM_CONDITIONAL(HAVE_PEI16, test x$pei16 = xtrue)
81 if test x$pei16 = xtrue; then
82  AC_DEFINE(HAVE_PEI16, 1 , [PEI16 enabled])
85 AC_ARG_ENABLE(tpuart,
86 [  --enable-tpuart      enable TPUART kernel driver backend],
87 [case "${enableval}" in
88  yes) tpuart=true ;;
89   no)  tpuart=false ;;
90    *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuart) ;;
91  esac],[tpuart=false])
92 AM_CONDITIONAL(HAVE_TPUART, test x$tpuart = xtrue)
93 if test x$tpuart = xtrue ; then
94  AC_DEFINE(HAVE_TPUART, 1 , [TPUART enabled])
97 AC_ARG_ENABLE(pei16s,
98 [  --enable-pei16s      enable BCU1 user driver backend (very experimental)],
99 [case "${enableval}" in
100  yes) pei16s=true ;;
101   no)  pei16s=false ;;
102    *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16s) ;;
103  esac],[pei16s=false])
104 AM_CONDITIONAL(HAVE_PEI16s, test x$pei16s = xtrue)
105 if test x$pei16s = xtrue ; then
106  AC_DEFINE(HAVE_PEI16s, 1 , [PEI16s enabled])
109 AC_ARG_ENABLE(tpuarts,
110 [  --enable-tpuarts     enable TPUART user driver backend (experimental)],
111 [case "${enableval}" in
112  yes) tpuarts=true ;;
113   no)  tpuarts=false ;;
114    *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuarts) ;;
115  esac],[tpuarts=false])
116 AM_CONDITIONAL(HAVE_TPUARTs, test x$tpuarts = xtrue)
117 if test x$tpuarts = xtrue ; then
118  AC_DEFINE(HAVE_TPUARTs, 1 , [TPUARTs enabled])
121 AC_ARG_ENABLE(eibnetip,
122 [  --enable-eibnetip    enable EIBnet/IP routing backend],
123 [case "${enableval}" in
124  yes) eibnetip=true ;;
125   no)  eibnetip=false ;;
126    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetip) ;;
127  esac],[eibnetip=false])
128 AM_CONDITIONAL(HAVE_EIBNETIP, test x$eibnetip = xtrue)
129 if test x$eibnetip = xtrue ; then
130  AC_DEFINE(HAVE_EIBNETIP, 1 , [EIBnet/IP enabled])
133 AC_ARG_ENABLE(eibnetiptunnel,
134 [  --enable-eibnetiptunnel      enable EIBnet/IP tunneling backend],
135 [case "${enableval}" in
136  yes) eibnetiptunnel=true ;;
137   no)  eibnetiptunnel=false ;;
138    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetiptunnel) ;;
139  esac],[eibnetiptunnel=false])
140 AM_CONDITIONAL(HAVE_EIBNETIPTUNNEL, test x$eibnetiptunnel = xtrue)
141 if test x$eibnetiptunnel = xtrue ; then
142  if test x$have_source_info != xyes ; then
143   AC_MSG_ERROR(not all needed functions for EIBnet/IP tunneling backend available)
144  fi
145  AC_DEFINE(HAVE_EIBNETIPTUNNEL, 1 , [EIBnet/IP tunneling enabled])
148 AC_ARG_ENABLE(usb,
149 [  --enable-usb                 enable USB backend],
150 [case "${enableval}" in
151  yes) usb=true ;;
152   no)  usb=false ;;
153    *) AC_MSG_ERROR(bad value ${enableval} for --enable-usb) ;;
154  esac],[usb=false])
155 AM_CONDITIONAL(HAVE_USB, test x$usb = xtrue)
156 if test x$usb = xtrue ; then
157  if test x$have_usb != xyes ; then
158   AC_MSG_ERROR(not all needed functions for USB backend available)
159  fi
160  AC_DEFINE(HAVE_USB, 1 , [USB backend enabled])
163 AC_ARG_ENABLE(eibnetipserver,
164 [  --enable-eibnetipserver      enable EIBnet/IP server frontend],
165 [case "${enableval}" in
166  yes) eibnetipserver=true ;;
167   no)  eibnetipserver=false ;;
168    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetipserver) ;;
169  esac],[eibnetipserver=false])
170 if test x$eibnetipserver = xtrue ; then
171  if test x$have_source_info != xyes ; then
172   AC_MSG_ERROR(not all needed functions for EIBnet/IP server available)
173  fi
174  AC_DEFINE(HAVE_EIBNETIPSERVER, 1 , [EIBnet/IP server enabled])
177 AC_ARG_ENABLE(groupcache,
178 [  --enable-groupcache          enable Group Cache (default: yes)],
179 [case "${enableval}" in
180  yes) groupcache=true ;;
181   no)  groupcache=false ;;
182    *) AC_MSG_ERROR(bad value ${enableval} for --enable-groupcache) ;;
183  esac],[groupcache=true])
184 if test x$groupcache = xtrue ; then
185  AC_DEFINE(HAVE_GROUPCACHE, 1 , [Group Cache enabled])
189 AM_CONDITIONAL(HAVE_SOURCE_INFO, test x$have_source_info = xyes )
191 AC_CHECK_PROGS(INDENT, indent, no)
192 AC_CHECK_PROGS(JAR, fastjar jar, no)
193 AC_CHECK_PROGS(JAVAC, "gcj -C" javac, no)
195 AC_ARG_ENABLE(java,
196 [  --enable-java                build java client library],
197 [case "${enableval}" in
198  yes) enablejava=true ;;
199   no)  enablejava=false ;;
200    *) AC_MSG_ERROR(bad value ${enableval} for --enable-java) ;;
201  esac],[enablejava=false])
202 if test x$enablejava = xtrue ; then
203  AC_DEFINE(BUILD_JAVA, 1 , [building java client library])
205  if test x"$JAVAC" = xno ; then
206   AC_MSG_ERROR(no java compiler found)
207  fi
209  if test x"$JAR" = xno ; then
210   AC_MSG_ERROR(jar not found)
211  fi
215 AM_CONDITIONAL(BUILD_JAVA, test x$enablejava = xtrue )
217 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],[AC_DEFINE(HAVE_SOCKADDR_IN_LEN,1,[Do we have sockaddr_in.sin_len?])],[],
219 #include <sys/types.h>
220 #include <sys/socket.h>
221 #include <netinet/in.h>
224 AC_CONFIG_HEADERS(config.h)
225 AC_OUTPUT(Makefile 
226 common/Makefile
227 eibd/Makefile eibd/include/Makefile  eibd/client/Makefile eibd/examples/Makefile eibd/libserver/Makefile eibd/server/Makefile eibd/backend/Makefile
228 eibd/client/def/Makefile eibd/client/c/Makefile eibd/client/java/Makefile eibd/client/php/Makefile eibd/client/cs/Makefile
229 eibd/eibnet/Makefile eibd/bcu/Makefile eibd/usb/Makefile
230 xml/Makefile xml/gui/Makefile xml/gui/examples/Makefile
231 bcu/Makefile bcu/lib/Makefile bcu/include/Makefile bcu/ldscripts/Makefile
232 bcugen/Makefile bcugen/struct/Makefile bcugen/configfile/Makefile bcugen/lib/Makefile
233 archive/Makefile build/Makefile
234 contrib/Makefile
235 debian/Makefile