1 dnl Process this file with autoconf to produce a configure script.
4 AM_INIT_AUTOMAKE(rda, 0.1)
5 AM_CONFIG_HEADER(config.h:config.in)
9 dnl AC_LIBTOOL_WIN32_DLL
15 AC_CHECK_HEADERS(sys/time.h)
18 dnl Check for host characteristics
21 dnl Check for socket libs
22 AC_CHECK_LIB(socket, connect)
23 AC_CHECK_LIB(nsl, gethostbyname)
24 AC_CHECK_LIB(resolv, gethostbyname)
25 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netinet/tcp.h arpa/inet.h)
27 # NOTE: Don't add -Wall or -Wunused, they both include
28 # -Wunused-parameter which reports bogus warnings.
29 build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
30 -Wformat -Wparentheses -Wpointer-arith"
31 # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
32 # -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
33 # -Wchar-subscripts -Wuninitialized -Wtraditional -Wshadow -Wcast-qual
34 # -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
35 # -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
36 # -Woverloaded-virtual -Winline -Werror"
37 AC_ARG_ENABLE(build-warnings,
38 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
39 [case "${enableval}" in
41 no) build_warnings="-w";;
42 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
43 build_warnings="${build_warnings} ${t}";;
44 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
45 build_warnings="${t} ${build_warnings}";;
46 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
48 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
49 echo "Setting compiler warning flags = $build_warnings" 6>&1
51 AC_ARG_ENABLE(rda-build-warnings,
52 [ --enable-rda-build-warnings Enable RDA specific build-time compiler warnings if gcc is used],
53 [case "${enableval}" in
55 no) build_warnings="-w";;
56 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
57 build_warnings="${build_warnings} ${t}";;
58 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
59 build_warnings="${t} ${build_warnings}";;
60 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
62 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
63 echo "Setting LIBREMOTE specific compiler warning flags = $build_warnings" 6>&1
67 if test "x${build_warnings}" != x -a "x$GCC" = xyes
69 AC_MSG_CHECKING(compiler warning flags)
70 # Separate out the -Werror flag as some files just cannot be
71 # compiled with it enabled.
72 for w in ${build_warnings}; do
74 -Werr*) WERROR_CFLAGS=-Werror ;;
75 *) # Check that GCC accepts it
76 if $CC $w 2>&1 | grep 'unrecognized option' > /dev/null; then
79 WARN_CFLAGS="${WARN_CFLAGS} $w"
83 AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS})
86 AC_SUBST(WERROR_CFLAGS)
88 # Add target dependent subdirectories here
92 targ_subdirs="$targ_subdirs unix"
93 AC_CONFIG_SUBDIRS(unix)
97 dnl $targ_subdirs is expanded at configure run time
98 AC_SUBST(targ_subdirs)
101 AC_OUTPUT(Makefile lib/Makefile samples/Makefile qe/Makefile)