From 9f2fcf1cf2b6e0665bb6375b69346117f26b6bf0 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 1 Aug 2013 13:24:21 +0300 Subject: [PATCH] Allow to build sgconf on Darwin. --- projects/sgconf/Makefile | 6 +++++- projects/sgconf/build | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/projects/sgconf/Makefile b/projects/sgconf/Makefile index 297d3e20..09699122 100644 --- a/projects/sgconf/Makefile +++ b/projects/sgconf/Makefile @@ -41,7 +41,11 @@ OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -LDFLAGS += -Wl,-E $(STGLIBS_LIBS) +LDFLAGS += $(STGLIBS_LIBS) + +ifneq ($(OS),darwin) +LDFLAGS += -Wl,-E +endif .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data all: libs $(PROG) ../../Makefile.conf diff --git a/projects/sgconf/build b/projects/sgconf/build index 47706a94..d7b72363 100755 --- a/projects/sgconf/build +++ b/projects/sgconf/build @@ -51,6 +51,13 @@ then MAKE="gmake" fi +if [ "$sys" = "Darwin" ] +then + OS=darwin + ETC_DIR="./inst/freebsd/etc/stargazer" + MAKE="gmake" +fi + if [ "$OS" = "unknown" ] then printf "#############################################################################\n" @@ -77,12 +84,18 @@ else then DEFS="$DEFS -DFREE_BSD" else - DEFS="$DEFS -DFREE_BSD5" if [ "$OS" = "bsd7" ] then + DEFS="$DEFS -DFREE_BSD5" LIB_THREAD=-lpthread else - LIB_THREAD=-lc_r + if [ "$OS" == "darwin" ] + then + DEFS="$DEFS -DDARWIN" + LIB_THREAD=-lpthread + else + LIB_THREAD=-lc_r + fi fi fi fi -- 2.44.2