]> git.stg.codes - stg.git/commitdiff
Allow to build sgconf on Darwin.
authorMaxim Mamontov <faust.madf@gmail.com>
Thu, 1 Aug 2013 10:24:21 +0000 (13:24 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Thu, 1 Aug 2013 10:24:21 +0000 (13:24 +0300)
projects/sgconf/Makefile
projects/sgconf/build

index 297d3e206983bb40c96ce9e9d5ab51e5b4051732..096991221d761977ddd36c10897a4ff922d8ac55 100644 (file)
@@ -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)
 
 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
 
 .PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data
 all: libs $(PROG) ../../Makefile.conf
index 47706a94f0b9d8cd35a52b96128313a532ed6c1b..d7b72363cdc6dc8f23f931c637195989d292b6dd 100755 (executable)
@@ -51,6 +51,13 @@ then
     MAKE="gmake"
 fi
 
     MAKE="gmake"
 fi
 
+if [ "$sys" = "Darwin" ]
+then
+    OS=darwin
+    ETC_DIR="./inst/freebsd/etc/stargazer"
+    MAKE="gmake"
+fi
+
 if [ "$OS" = "unknown" ]
 then 
     printf "#############################################################################\n"
 if [ "$OS" = "unknown" ]
 then 
     printf "#############################################################################\n"
@@ -77,12 +84,18 @@ else
     then
         DEFS="$DEFS -DFREE_BSD"
     else
     then
         DEFS="$DEFS -DFREE_BSD"
     else
-        DEFS="$DEFS -DFREE_BSD5"
         if [ "$OS" = "bsd7" ]
         then
         if [ "$OS" = "bsd7" ]
         then
+            DEFS="$DEFS -DFREE_BSD5"
             LIB_THREAD=-lpthread
         else
             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
         fi
     fi
 fi