Add missing files
[bcusdk.git] / configure.in
blob7f3a8bd07312337ce92c768d747df0f8dcb30d15
1 dnl ##    BCU SDK bcu development enviroment - autoconf & automake files
2 dnl ##    Copyright (C) 2005-2011 Martin Koegler <mkoegler@auto.tuwien.ac.at>
3 dnl ##
4 dnl ##    Redistribution and use in source and binary forms, with or without
5 dnl ##    modification, are permitted provided that the following conditions
6 dnl ##    are met:
7 dnl ##    1. Redistributions of source code must retain the above copyright
8 dnl ##       notice, this list of conditions and the following disclaimer.
9 dnl ##    2. Redistributions in binary form must reproduce the above copyright
10 dnl ##       notice, this list of conditions and the following disclaimer in the
11 dnl ##       documentation and/or other materials provided with the distribution.
12 dnl ##    
13 dnl ##    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
14 dnl ##    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 dnl ##    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 dnl ##    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17 dnl ##    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 dnl ##    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 dnl ##    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 dnl ##    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 dnl ##    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 dnl ##    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 dnl ##    SUCH DAMAGE.
26 AC_PREREQ(2.59)
28 AC_INIT(bcusdk, 0.0.5)
29 AM_INIT_AUTOMAKE([foreign])
31 AC_CANONICAL_HOST
32 AC_PROG_CC
33 AC_PROG_CXX
34 AC_STDC_HEADERS
35 AC_PROG_YACC
36 AC_PROG_LEX
37 AM_PROG_AS
38 AC_PROG_RANLIB
39 AC_PROG_LIBTOOL
41 AC_CHECK_HEADERS([sys/time.h])
43 GMP_PROG_CPP_FOR_BUILD
44 GMP_PROG_EXEEXT_FOR_BUILD
45 CC_FOR_BUILD_OPTS
47 AC_COMPILER_OPTION(nortti,[-fno-rtti],[-fno-rtti],CXXFLAGS="$CXXFLAGS -fno-rtti")
48 AC_COMPILER_OPTION(noexceptions,[-fno-exceptions],[-fno-exceptions],CXXFLAGS="$CXXFLAGS -fno-exceptions")
49 AC_CHECK_PTHSEM(2.0.8,yes,yes,no)
50 AC_CHECK_HEADER(argp.h,,[AC_MSG_ERROR([argp_parse not found])])
51 AC_SEARCH_LIBS(argp_parse,argp,,[AC_MSG_ERROR([argp_parse not found])])
52 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])])
53 have_source_info=no
54 have_linux_api=no
55 AC_CHECK_HEADER(linux/rtnetlink.h,[AC_DEFINE(HAVE_LINUX_NETLINK, 1,[Linux netlink layer available]) have_source_info=yes],[],[-])
56 AC_CHECK_HEADER(linux/usbdevice_fs.h,[AC_DEFINE(OS_LINUX, 1, [Linux usb available]) have_linux_api=yes; have_usb=yes],[],[-])
57 AC_CHECK_HEADER(iphlpapi.h,[AC_DEFINE(HAVE_WINDOWS_IPHELPER, 1,[Windows IPHelper available]) 
58   LIBS="-liphlpapi $LIBS"; have_source_info=yes],[],[-])
60 AC_CHECK_DECL(SA_SIZE,[AC_DEFINE(HAVE_SA_SIZE, 1,[SA_SIZE function available])],[],[#include <net/route.h>])
61 have_bsd_source_info=no
62 AC_CHECK_DECL(__FreeBSD__,[have_bsd_source_info=yes],[],[])
63 AC_CHECK_DECL(__APPLE__,[have_bsd_source_info=yes],[],[])
64 if test x$have_bsd_source_info = xyes ; then
65   AC_DEFINE(HAVE_BSD_SOURCEINFO, 1,[FreeBSD compatible sourceinfo])
66   have_source_info=yes
69 AC_CHECK_FUNCS(gethostbyname_r,,[AC_MSG_WARN([eibd client library not thread safe])])
71 AM_CONDITIONAL(LINUX_API, test x$have_linux_api = xyes)
73 AC_ARG_ENABLE(onlyeibd,
74 [  --enable-onlyeibd            build only eibd (requires no libxml and m68hc05-gnu)],
75 [case "${enableval}" in
76  yes) onlyeibd=true ;;
77   no)  onlyeibd=false ;;
78    *) AC_MSG_ERROR(bad value ${enableval} for --enable-onlyeibd) ;;
79  esac],[onlyeibd=false])
80 AM_CONDITIONAL(HAVE_ONLYEIBD, test x$onlyeibd = xtrue)
82 if test x$onlyeibd = xfalse ; then
84 AM_PATH_XML2(2.6.16,,[AC_MSG_ERROR([limxml2 not found])])
85 AC_PATH_PROG(TAS,[m68hc05-as],,[$PATH:$bindir:$prefix/bin])
86 AC_PATH_PROG(TLD,[m68hc05-ld],,[$PATH:$bindir:$prefix/bin])
87 AC_PATH_PROG(TAR,[m68hc05-ar],,[$PATH:$bindir:$prefix/bin])
88 AC_PATH_PROG(TRANLIB,[m68hc05-ranlib],,[$PATH:$bindir:$prefix/bin])
89 AC_PATH_PROG(TGCC,[m68hc05-gcc],,[$PATH:$bindir:$prefix/bin])
91 test -z "$TAS" && AC_MSG_ERROR([m68hc05-as not found])
92 test -z "$TAR" && AC_MSG_ERROR([m68hc05-ar not found])
93 test -z "$TLD" && AC_MSG_ERROR([m68hc05-ld not found])
94 test -z "$TRANLIB" && AC_MSG_ERROR([m68hc05 ranlib not found])
95 test -z "$TGCC" && AC_MSG_ERROR([m68hc05 gcc not found])
99 AC_ARG_ENABLE(ft12,
100 [  --enable-ft12                enable FT1.2 backend],
101 [case "${enableval}" in
102  yes) ft12=true ;;
103   no)  ft12=false ;;
104    *) AC_MSG_ERROR(bad value ${enableval} for --enable-ft12) ;;
105  esac],[ft12=false])
106 AM_CONDITIONAL(HAVE_FT12, test x$ft12 = xtrue)
107 if test x$ft12 = xtrue ; then
108  AC_DEFINE(HAVE_FT12, 1 , [FT1.2 enabled])
111 AC_ARG_ENABLE(pei16,
112 [  --enable-pei16       enable BCU1 kernel driver backend],
113 [case "${enableval}" in
114  yes) pei16=true ;;
115   no)  pei16=false ;;
116    *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16) ;;
117  esac],[pei16=false])
118 AM_CONDITIONAL(HAVE_PEI16, test x$pei16 = xtrue)
119 if test x$pei16 = xtrue; then
120  AC_DEFINE(HAVE_PEI16, 1 , [PEI16 enabled])
123 AC_ARG_ENABLE(tpuart,
124 [  --enable-tpuart      enable TPUART kernel driver backend (deprecated)],
125 [case "${enableval}" in
126  yes) tpuart=true ;;
127   no)  tpuart=false ;;
128    *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuart) ;;
129  esac],[tpuart=false])
130 AM_CONDITIONAL(HAVE_TPUART, test x$tpuart = xtrue)
131 if test x$tpuart = xtrue ; then
132  AC_DEFINE(HAVE_TPUART, 1 , [TPUART enabled])
135 AC_ARG_ENABLE(pei16s,
136 [  --enable-pei16s      enable BCU1 user driver backend (very experimental)],
137 [case "${enableval}" in
138  yes) pei16s=true ;;
139   no)  pei16s=false ;;
140    *) AC_MSG_ERROR(bad value ${enableval} for --enable-pei16s) ;;
141  esac],[pei16s=false])
142 AM_CONDITIONAL(HAVE_PEI16s, test x$pei16s = xtrue)
143 if test x$pei16s = xtrue ; then
144  AC_DEFINE(HAVE_PEI16s, 1 , [PEI16s enabled])
147 AC_ARG_ENABLE(tpuarts,
148 [  --enable-tpuarts     enable TPUART user driver backend],
149 [case "${enableval}" in
150  yes) tpuarts=true ;;
151   no)  tpuarts=false ;;
152    *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpuarts) ;;
153  esac],[tpuarts=false])
154 AM_CONDITIONAL(HAVE_TPUARTs, test x$tpuarts = xtrue)
155 if test x$tpuarts = xtrue ; then
156  AC_DEFINE(HAVE_TPUARTs, 1 , [TPUARTs enabled])
159 AC_ARG_ENABLE(eibnetip,
160 [  --enable-eibnetip    enable EIBnet/IP routing backend],
161 [case "${enableval}" in
162  yes) eibnetip=true ;;
163   no)  eibnetip=false ;;
164    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetip) ;;
165  esac],[eibnetip=false])
166 AM_CONDITIONAL(HAVE_EIBNETIP, test x$eibnetip = xtrue)
167 if test x$eibnetip = xtrue ; then
168  AC_DEFINE(HAVE_EIBNETIP, 1 , [EIBnet/IP enabled])
171 AC_ARG_ENABLE(eibnetiptunnel,
172 [  --enable-eibnetiptunnel      enable EIBnet/IP tunneling backend],
173 [case "${enableval}" in
174  yes) eibnetiptunnel=true ;;
175   no)  eibnetiptunnel=false ;;
176    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetiptunnel) ;;
177  esac],[eibnetiptunnel=false])
178 AM_CONDITIONAL(HAVE_EIBNETIPTUNNEL, test x$eibnetiptunnel = xtrue)
179 if test x$eibnetiptunnel = xtrue ; then
180  if test x$have_source_info != xyes ; then
181   AC_MSG_ERROR(not all needed functions for EIBnet/IP tunneling backend available)
182  fi
183  AC_DEFINE(HAVE_EIBNETIPTUNNEL, 1 , [EIBnet/IP tunneling enabled])
186 AC_ARG_ENABLE(usb,
187 [  --enable-usb                 enable USB backend],
188 [case "${enableval}" in
189  yes) usb=true ;;
190   no)  usb=false ;;
191    *) AC_MSG_ERROR(bad value ${enableval} for --enable-usb) ;;
192  esac],[usb=false])
193 AM_CONDITIONAL(HAVE_USB, test x$usb = xtrue)
194 if test x$usb = xtrue ; then
195  if test x$have_usb != xyes ; then
196   AC_MSG_ERROR(not all needed functions for USB backend available)
197  fi
198  AC_DEFINE(HAVE_USB, 1 , [USB backend enabled])
201 AC_ARG_ENABLE(eibnetipserver,
202 [  --enable-eibnetipserver      enable EIBnet/IP server frontend],
203 [case "${enableval}" in
204  yes) eibnetipserver=true ;;
205   no)  eibnetipserver=false ;;
206    *) AC_MSG_ERROR(bad value ${enableval} for --enable-eibnetipserver) ;;
207  esac],[eibnetipserver=false])
208 if test x$eibnetipserver = xtrue ; then
209  if test x$have_source_info != xyes ; then
210   AC_MSG_ERROR(not all needed functions for EIBnet/IP server available)
211  fi
212  AC_DEFINE(HAVE_EIBNETIPSERVER, 1 , [EIBnet/IP server enabled])
215 AC_ARG_ENABLE(groupcache,
216 [  --enable-groupcache          enable Group Cache (default: yes)],
217 [case "${enableval}" in
218  yes) groupcache=true ;;
219   no)  groupcache=false ;;
220    *) AC_MSG_ERROR(bad value ${enableval} for --enable-groupcache) ;;
221  esac],[groupcache=true])
222 if test x$groupcache = xtrue ; then
223  AC_DEFINE(HAVE_GROUPCACHE, 1 , [Group Cache enabled])
227 AM_CONDITIONAL(HAVE_SOURCE_INFO, test x$have_source_info = xyes )
229 AC_CHECK_PROGS(INDENT, indent, no)
230 AC_CHECK_PROGS(JAR, fastjar jar, no)
231 AC_CHECK_PROGS(JAVAC, "gcj -C" javac, no)
233 AC_ARG_ENABLE(java,
234 [  --enable-java                build java client library],
235 [case "${enableval}" in
236  yes) enablejava=true ;;
237   no)  enablejava=false ;;
238    *) AC_MSG_ERROR(bad value ${enableval} for --enable-java) ;;
239  esac],[enablejava=false])
240 if test x$enablejava = xtrue ; then
241  AC_DEFINE(BUILD_JAVA, 1 , [building java client library])
243  if test x"$JAVAC" = xno ; then
244   AC_MSG_ERROR(no java compiler found)
245  fi
247  if test x"$JAR" = xno ; then
248   AC_MSG_ERROR(jar not found)
249  fi
253 AC_ARG_WITH(libstdc,
254 [  --without-libstdc    don't use function from libstdc++],
255 [case "${withval}" in
256  yes) use_libstdc=true ;;
257   no)  use_libstdc=false ;;
258    *) AC_MSG_ERROR(bad value ${withval} for --with-libstdc) ;;
259  esac],[use_libstdc=true])
260 if test x$use_libstdc = xfalse ; then
261  AC_DEFINE(USE_NOLIBSTDC, 1 , [don't use libstdc++])
262  CXX=$CC
265 AM_CONDITIONAL(BUILD_JAVA, test x$enablejava = xtrue )
267 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],[AC_DEFINE(HAVE_SOCKADDR_IN_LEN,1,[Do we have sockaddr_in.sin_len?])],[],
269 #include <sys/types.h>
270 #include <sys/socket.h>
271 #include <netinet/in.h>
274 AC_CONFIG_HEADERS(config.h)
275 AC_OUTPUT(Makefile 
276 common/Makefile
277 eibd/Makefile eibd/include/Makefile  eibd/client/Makefile eibd/examples/Makefile eibd/libserver/Makefile eibd/server/Makefile eibd/backend/Makefile
278 eibd/client/def/Makefile eibd/client/c/Makefile eibd/client/java/Makefile eibd/client/php/Makefile eibd/client/cs/Makefile
279 eibd/client/perl/Makefile eibd/client/python/Makefile eibd/client/pascal/Makefile
280 eibd/eibnet/Makefile eibd/bcu/Makefile eibd/usb/Makefile
281 xml/Makefile xml/gui/Makefile xml/gui/examples/Makefile
282 bcu/Makefile bcu/lib/Makefile bcu/include/Makefile bcu/ldscripts/Makefile
283 bcugen/Makefile bcugen/struct/Makefile bcugen/configfile/Makefile bcugen/lib/Makefile
284 archive/Makefile build/Makefile
285 contrib/Makefile
286 debian/Makefile
289 AC_CONFIG_MACRO_DIR([m4])