Only compile dpfp examples when sigaction is available
authorDaniel Drake <dan@reactivated.net>
Wed, 21 Jul 2010 23:49:21 +0000 (17:49 -0600)
committerDaniel Drake <dan@reactivated.net>
Fri, 23 Jul 2010 00:33:37 +0000 (18:33 -0600)
It's not available on MinGW.

configure.ac
examples/Makefile.am

index 0c8eb76..36f364c 100644 (file)
@@ -127,6 +127,10 @@ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
        nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="")
 CFLAGS="$saved_cflags"
 
+# sigaction not available on MinGW
+AC_CHECK_FUNC([sigaction], [have_sigaction=yes], [have_sigaction=no])
+AM_CONDITIONAL([HAVE_SIGACTION], [test "x$have_sigaction" = "xyes"])
+
 # headers not available on all platforms but required on others
 AC_CHECK_HEADERS([sys/time.h])
 
index bed1837..9535ea7 100644 (file)
@@ -1,16 +1,21 @@
 INCLUDES = -I$(top_srcdir)
-noinst_PROGRAMS = lsusb dpfp
+noinst_PROGRAMS = lsusb
 
 lsusb_SOURCES = lsusb.c
 lsusb_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
 
+if HAVE_SIGACTION
 dpfp_SOURCES = dpfp.c
 dpfp_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
+noinst_PROGRAMS += dpfp
+endif
 
 if THREADS_POSIX
+if HAVE_SIGACTION
 dpfp_threaded_SOURCES = dpfp_threaded.c
 dpfp_threaded_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS)
 dpfp_threaded_LDADD = ../libusb/libusb-1.0.la -lusb-1.0
 noinst_PROGRAMS += dpfp_threaded
 endif
+endif