# Checks for programs.
AC_PROG_CC
-AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_LANG([C])
-# Enable the C11 standard if possible, and enforce the use
+# Enable the C99 standard if possible, and enforce the use
# of SR_API to explicitly mark all public API functions.
SR_EXTRA_CFLAGS=
-SR_CHECK_COMPILE_FLAGS([SR_EXTRA_CFLAGS], [C11], [-std=gnu11 -std=c11])
+SR_CHECK_COMPILE_FLAGS([SR_EXTRA_CFLAGS], [C99], [-std=c99 -c99 -AC99 -qlanglvl=extc99])
SR_CHECK_COMPILE_FLAGS([SR_EXTRA_CFLAGS], [visibility], [-fvisibility=hidden])
SR_ARG_ENABLE_WARNINGS([SR_WFLAGS], [-Wall], [-Wall -Wextra -Wmissing-prototypes])
AC_CHECK_HEADERS([sys/ioctl.h], [SR_APPEND([sr_deps_avail], [sys_ioctl_h])])
AC_CHECK_HEADERS([sys/timerfd.h], [SR_APPEND([sr_deps_avail], [sys_timerfd_h])])
+# We need to link against the Winsock2 library for SCPI over TCP.
+AS_CASE([$host], [*-mingw*], [SR_EXTRA_LIBS='-lws2_32'], [SR_EXTRA_LIBS=])
+
+# libm (the standard math library) is always needed.
+SR_SEARCH_LIBS([SR_EXTRA_LIBS], [pow], [m])
+
# RPC is only needed for VXI support.
AC_CACHE_CHECK([for RPC support], [sr_cv_have_rpc],
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
AS_CASE([" $sr_deps_avail "], [*" $sr_dep "*],,
[SR_APPEND([sr_deps_missing], [', '], [$sr_dep])])
done
+ test -z "$sr_deps_missing" || return 1
}
AC_ARG_ENABLE([all-drivers],
[$3=$enableval], [$3=$enable_all_drivers])
AS_IF([test "x[$]$3" = xyes], [sr_hw_info=yes[]m4_ifval([$4], [
- sr_check_driver_deps $4
- AS_IF([test -n "$sr_deps_missing"],
- [$3=no sr_hw_info="no (missing: $sr_deps_missing)"])
+ sr_check_driver_deps $4 \
+ || $3=no sr_hw_info="no (missing: $sr_deps_missing)"
])], [sr_hw_info='no (disabled)'])
sr_driver_summary_append "$2" "$sr_hw_info"
sr_cxx_missing=
# Check if the C++ compiler supports the C++11 standard.
-AX_CXX_COMPILE_STDCXX_11(, [optional])
+AX_CXX_COMPILE_STDCXX_11([noext], [optional])
AS_IF([test "x$HAVE_CXX11" != x1],
[SR_APPEND([sr_cxx_missing], [', '], ['C++11'])])
AC_DEFINE_UNQUOTED([CONF_HOST], ["$host"],
[The canonical host libsigrok will run on.])
-AC_LANG([C])
-
-# libm (the standard math library) is always needed.
-AC_SEARCH_LIBS([pow], [m])
-
-# We need to link against the Winsock2 library for SCPI over TCP.
-AS_CASE([$host], [*mingw*], [LIBS="$LIBS -lws2_32"])
-
-AC_SUBST([FIRMWARE_DIR], ['$(datadir)/sigrok-firmware'])
-AC_SUBST([MAKEFLAGS], ['--no-print-directory'])
-AC_SUBST([AM_LIBTOOLFLAGS], ['--silent'])
-
AC_CONFIG_FILES([Makefile libsigrok.pc bindings/cxx/libsigrokcxx.pc])
AC_OUTPUT