]> git.stg.codes - stg.git/commitdiff
Allowed to build on Darwin.
authorMaxim Mamontov <faust.madf@gmail.com>
Fri, 3 Oct 2014 09:29:16 +0000 (12:29 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Sat, 10 Jan 2015 19:02:55 +0000 (21:02 +0200)
projects/rscriptd/Makefile
projects/rscriptd/build

index adbc4eb38dca2336acb407bce7542975b23f429c..4c960db72b2fb61df756017224bee48d560fc3bb 100644 (file)
@@ -31,7 +31,12 @@ 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)
+
+ifneq ($(OS),darwin)
+LDFLAGS += -Wl,-E
+endif
+
+LDFLAGS += $(STGLIBS_LIBS)
 
 .PHONY: all clean distclean libs install uninstall
 all: libs $(PROG) ../../Makefile.conf
index 59927348bab369f99774c204ffbc1fd3e409a52c..451e08aa14e31fd70e6b3c7d448c316817257091 100755 (executable)
@@ -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,14 +84,19 @@ else
     if [ "$OS" = "bsd" ]
     then
         DEFS="$DEFS -DFREE_BSD"
-        LIB_THREAD=-lc_r
     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