]> sigrok.org Git - libserialport.git/commitdiff
Only build linux_termios.c on Linux.
authorMartin Ling <redacted>
Fri, 3 Jan 2014 10:52:53 +0000 (11:52 +0100)
committerMartin Ling <redacted>
Fri, 3 Jan 2014 10:52:53 +0000 (11:52 +0100)
Makefile.am
configure.ac

index cf8fe5f85dd4662b9eac1a4f3e3a146a9fe7cb9b..fbc45e8cf686cac5d9497e5ae779a630186fcdfe 100644 (file)
@@ -24,7 +24,10 @@ AM_CPPFLAGS = -I$(top_srcdir)
 
 lib_LTLIBRARIES = libserialport.la
 
-libserialport_la_SOURCES = serialport.c linux_termios.c linux_termios.h
+libserialport_la_SOURCES = serialport.c linux_termios.h
+if LINUX
+libserialport_la_SOURCES += linux_termios.c
+endif
 
 libserialport_la_LIBADD = $(LIBOBJS)
 
index 3030d1d2c82735715964a0a84d7c048b0526b84a..961031dcb9938c6946a49eb807d044d71aea146c 100644 (file)
@@ -79,6 +79,7 @@ SP_PKGLIBS=""
 
 case $target_os in
 *linux*)
+       AM_CONDITIONAL([LINUX], true)
        # On Linux libudev is currently required for enumeration.
        AC_ARG_WITH([libudev],
             [AS_HELP_STRING([--with-libudev],
@@ -90,9 +91,12 @@ case $target_os in
                SP_PKGLIBS="$SP_PKGLIBS libudev"; AC_DEFINE(HAVE_LIBUDEV)])], [])
        ;;
 *darwin*)
+       AM_CONDITIONAL([LINUX], false)
        LDFLAGS="$LDFLAGS -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation"
        AC_CHECK_HEADER(IOKit/IOKitLib.h, [], [AC_MSG_ERROR([IOKit/IOKitLib.h not found])])
        ;;
+*)
+       AM_CONDITIONAL([LINUX], false)
 esac
 
 AC_SUBST(SP_PKGLIBS)