From 27e231ff35ae02954b40bd81d015ab2eafbd87f2 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Fri, 3 Jan 2014 11:52:53 +0100 Subject: [PATCH] Only build linux_termios.c on Linux. --- Makefile.am | 5 ++++- configure.ac | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index cf8fe5f..fbc45e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) diff --git a/configure.ac b/configure.ac index 3030d1d..961031d 100644 --- a/configure.ac +++ b/configure.ac @@ -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)