]> sigrok.org Git - sigrok-cli.git/commitdiff
configure: check version dependent sigrokdecode features
authorGerhard Sittig <redacted>
Sun, 26 Dec 2021 06:51:14 +0000 (07:51 +0100)
committerGerhard Sittig <redacted>
Sun, 26 Dec 2021 12:56:03 +0000 (13:56 +0100)
Check for the presence of the srd_session_send_eof() API routine which
depends on the libsigrokdecode library version.

configure.ac

index ef0ea0b2ce34dff2379c742785d9d0b95f2e5654..f7e689be976b5516c9b15f73e207e5f5d3b7d721 100644 (file)
@@ -91,6 +91,15 @@ AC_SYS_LARGEFILE
 PKG_CHECK_MODULES([SIGROK_CLI],
        [glib-2.0 >= 2.32.0 libsigrok >= 0.5.0 $SC_PKGLIBS])
 
+# Check for version dependent availability of functions.
+srd_save_cflags=$CFLAGS
+srd_save_libs=$LIBS
+CFLAGS="$SIGROK_CLI_CFLAGS $CFLAGS"
+LIBS="$SIGROK_CLI_LIBS $LIBS"
+AC_CHECK_FUNCS([srd_session_send_eof])
+CFLAGS=$srd_save_cflags
+LIBS=$srd_save_libs
+
 sc_glib_version=`$PKG_CONFIG --modversion glib-2.0 2>&AS_MESSAGE_LOG_FD`
 sc_libsigrok_version=`$PKG_CONFIG --modversion libsigrok 2>&AS_MESSAGE_LOG_FD`