From f6585ff1b5abc38ba4fd107311967963fbd0fe98 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sun, 4 Dec 2011 02:54:10 -0800 Subject: [PATCH] OSX port --- configure.ac | 16 ++++++++++------ gen-apple.sh | 7 +++++++ src/Makefile.am | 9 ++++++--- src/plugins/Makefile.am | 15 +++++++++------ src/plugins/alert.c | 1 - src/plugins/level2.c | 1 - src/plugins/radar.c | 1 - 7 files changed, 32 insertions(+), 18 deletions(-) create mode 100755 gen-apple.sh diff --git a/configure.ac b/configure.ac index c8f9a3d..3cded34 100644 --- a/configure.ac +++ b/configure.ac @@ -21,17 +21,21 @@ AC_CHECK_LIB(rsl, RSL_wsr88d_to_radar, RSL_LIBS="-lrsl") AM_CONDITIONAL(HAVE_RSL, test "$RSL_LIBS" != "") AC_SUBST(RSL_LIBS) -# Test for Windows vs. Unix +# Test for windowing system case "${host}" in - *mingw32*) WIN32="yes" ;; - *) WIN32="no" ;; + *mingw32*) SYS="WIN" ;; + *cygwin*) SYS="WIN" ;; + *apple*) SYS="MAC" ;; + *) SYS="X11" ;; esac -if test "$WIN32" = yes; then +if test "$SYS" = "WIN"; then ac_default_prefix="/" fi -AM_CONDITIONAL([WIN32], test "$WIN32" = "yes") +AM_CONDITIONAL([SYS_WIN], test "$SYS" = "WIN") +AM_CONDITIONAL([SYS_MAC], test "$SYS" = "MAC") +AM_CONDITIONAL([SYS_X11], test "$SYS" = "X11") -# Output +# Output AC_CONFIG_FILES([ Makefile src/Makefile diff --git a/gen-apple.sh b/gen-apple.sh new file mode 100755 index 0000000..a2246be --- /dev/null +++ b/gen-apple.sh @@ -0,0 +1,7 @@ +#!/bin/bash +dir=$(pwd) +PKG_CONFIG_PATH="../grits/src/" \ +./autogen.sh \ + "--datadir=$dir/data" \ + "--libdir=$dir/src/plugins" \ + CFLAGS="-g -Werror $CFLAGS" diff --git a/src/Makefile.am b/src/Makefile.am index fb2e6f5..e31c394 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,11 @@ SUBDIRS = plugins AM_CFLAGS = -Wall --std=gnu99 $(GRITS_CFLAGS) -AM_LDFLAGS = -Wl,--export-dynamic \ - -Wl,--as-needed -Wl,--no-undefined +AM_LDFLAGS = -Wl,--export-dynamic -Wl,--no-undefined + +if !SYS_MAC +AM_LDFLAGS += -Wl,--as-needed +endif bin_PROGRAMS = aweather wsr88ddec aweather_SOURCES = main.c \ @@ -18,7 +21,7 @@ aweather_LDADD = $(GRITS_LIBS) wsr88ddec = wsr88ddec.c wsr88ddec_LDADD = $(GLIB_LIBS) -lbz2 -if WIN32 +if SYS_WIN dots = .. wsr88ddec_LDFLAGS = -mwindows diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 912bb46..b873d1b 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -1,8 +1,16 @@ AM_CFLAGS = -Wall --std=gnu99 $(GRITS_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib -AM_LDFLAGS = -shared -module -avoid-version -Wl,--as-needed +AM_LDFLAGS = -shared -module -avoid-version LIBS = $(GRITS_LIBS) +if SYS_WIN +AM_LDFLAGS += -no-undefined +dots = .. +endif +if !SYS_MAC +AM_LDFLAGS += -Wl,--as-needed +endif + pluginsdir = $(pkglibdir) plugins_LTLIBRARIES = alert.la @@ -28,11 +36,6 @@ radar_la_CPPFLAGS = \ radar_la_LIBADD = $(RSL_LIBS) $(GRITS_LIBS) endif -if WIN32 -AM_LDFLAGS += -no-undefined -dots = .. -endif - test: ( cd ../; make test ) diff --git a/src/plugins/alert.c b/src/plugins/alert.c index 1f19a45..8ac35e0 100644 --- a/src/plugins/alert.c +++ b/src/plugins/alert.c @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/src/plugins/level2.c b/src/plugins/level2.c index 2edaabc..c6b7194 100644 --- a/src/plugins/level2.c +++ b/src/plugins/level2.c @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/src/plugins/radar.c b/src/plugins/radar.c index 1b4e2b8..8166e66 100644 --- a/src/plugins/radar.c +++ b/src/plugins/radar.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include -- 2.43.2