From 025c264448de771ceb130d4d01aacbb9ca8453ea Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sun, 19 Apr 2015 18:36:58 +0200 Subject: [PATCH] autotools: Don't set/override "user variables". This fixes bug #577. --- Makefile.am | 11 ++++++++--- configure.ac | 4 ---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 58185e9..8c0276c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,9 @@ ACLOCAL_AMFLAGS = -I autostuff AM_CPPFLAGS = -I$(top_srcdir) +# Enable more compiler warnings. +AM_CFLAGS = -std=c99 -Wall -Wextra -pedantic -Wmissing-prototypes -Wshadow + lib_LTLIBRARIES = libserialport.la libserialport_la_SOURCES = serialport.c libserialport_internal.h @@ -39,13 +42,15 @@ libserialport_la_SOURCES += freebsd.c endif libserialport_la_LIBADD = $(LIBOBJS) - -libserialport_la_LDFLAGS = $(SP_LIB_LDFLAGS) -no-undefined - if WIN32 libserialport_la_LIBADD += $(SP_LIBS) endif +libserialport_la_LDFLAGS = $(SP_LIB_LDFLAGS) -no-undefined +if MACOSX +libserialport_la_LDFLAGS += -framework IOKit -framework CoreFoundation +endif + library_includedir = $(includedir) library_include_HEADERS = libserialport.h diff --git a/configure.ac b/configure.ac index 0662eb6..e569ee0 100644 --- a/configure.ac +++ b/configure.ac @@ -42,9 +42,6 @@ AM_INIT_AUTOMAKE([1.11 -Wall -Werror check-news]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -# Enable more compiler warnings. -CFLAGS="$CFLAGS -std=c99 -Wall -Wextra -pedantic -Wmissing-prototypes -Wshadow" - # Checks for programs. AC_PROG_CC AC_PROG_CPP @@ -89,7 +86,6 @@ case $host_os in AM_CONDITIONAL([WIN32], false) AM_CONDITIONAL([MACOSX], true) AM_CONDITIONAL([FREEBSD], 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])]) ;; mingw* | cygwin*)