sr_driver_summary_append "$2" "$sr_hw_info"
AM_CONDITIONAL([$3], [test "x[$]$3" = xyes])
- AM_COND_IF([$3], [AC_DEFINE([HAVE_$3], [1], [Whether to support $1 device.])])
+ AM_COND_IF([$3], [AC_DEFINE([HAVE_$3], [1], [Whether to support $1 device.]) AC_DEFINE([HAVE_DRIVERS], [1], [Whether at least one driver is enabled.])])
])
## SR_DRIVER(Device name, driver-name, [dependencies...])
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <glib.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
*/
SR_API void sr_drivers_init(struct sr_context *ctx)
{
- struct sr_dev_driver **drivers;
GArray *array;
array = g_array_new(TRUE, FALSE, sizeof(struct sr_dev_driver *));
- for (drivers = &__start_sr_driver_list; drivers < &__stop_sr_driver_list;
- drivers++)
+#ifdef HAVE_DRIVERS
+ for (struct sr_dev_driver **drivers = &__start_sr_driver_list;
+ drivers < &__stop_sr_driver_list; drivers++)
g_array_append_val(array, *drivers);
+#endif
ctx->driver_list = (struct sr_dev_driver **)array->data;
g_array_free(array, FALSE);
}