From e4403464ed7de23f8fa3a2a57acee31248993c3d Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 2 Mar 2017 12:43:47 +0100 Subject: octphy: add conditional compilation to support latest octasic header release With octasics latest release (octsdr-2g-02.07.01-B1351-beta), some struct members are moved or renamed. This patch adds ifdef-logic and configure checks to restore compatibilty. Change-Id: I73287983e8bed8bf64b2ab87e6b810c2c59ea6fd --- configure.ac | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 001e10e4..cbfbf125 100644 --- a/configure.ac +++ b/configure.ac @@ -72,10 +72,46 @@ AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], [#include ]) - AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], AC_DEFINE([OCTPHY_MULTI_TRX], [1], [Define to 1 if your octphy header files support multi-trx]), [], [#include ]) + + AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], + AC_DEFINE([OCTPHY_MULTI_TRX], + [1], + [Define to 1 if your octphy header files support multi-trx]), + [], + [#include ]) + + AC_CHECK_MEMBER([tOCTVC1_HW_RF_PORT_RX_STATS.Frequency], + AC_DEFINE([OCTPHY_USE_FREQUENCY], + [1], + [Define to 1 if your octphy header files support tOCTVC1_RADIO_FREQUENCY_VALUE type]), + [], + [#include ]) + + AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLossCnt], + AC_DEFINE([OCTPHY_USE_SYNC_LOSS_CNT], + [1], + [Define to 1 if your octphy header files renamed ulSyncLosseCnt to ulSyncLossCnt]), + [], + [#include ]) + + AC_CHECK_MEMBER([tOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_TX_CONFIG_RSP.TxConfig], + AC_DEFINE([OCTPHY_USE_TX_CONFIG], + [1], + [Define to 1 if your octphy header files support tOCTVC1_HW_RF_PORT_ANTENNA_TX_CONFIG type]), + [], + [#include ]) + + AC_CHECK_MEMBER([tOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_RX_CONFIG_RSP.RxConfig], + AC_DEFINE([OCTPHY_USE_RX_CONFIG], + [1], + [Define to 1 if your octphy header files support tOCTVC1_HW_RF_PORT_ANTENNA_RX_CONFIG type]), + [], + [#include ]) + CPPFLAGS=$oldCPPFLAGS fi -- cgit v1.2.3