]> git.stg.codes - stg.git/blobdiff - projects/sgconf_xml/build
Fix build on Darwin.
[stg.git] / projects / sgconf_xml / build
index fc2067405827e6f0b503392031bf603f9325647d..eb782f9f58f7ae893e4b7bc5ab2e3824b461b7d9 100755 (executable)
@@ -54,7 +54,7 @@ fi
 if [ "$sys" = "Darwin" ]
 then
     OS=darwin
-    MAKE="gmake"
+    MAKE="make"
 fi
 
 if [ "$OS" = "unknown" ]
@@ -83,13 +83,20 @@ 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
@@ -150,7 +157,7 @@ rm -f fake
 
 printf "Checking for -lexpat... "
 printf "int main() { return 0; }\n" > build_check.c
-$CC $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
+$CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
 if [ $? != 0 ]
 then
     CHECK_EXPAT=no
@@ -163,7 +170,7 @@ rm -f fake
 
 printf "Checking for iconv 2nd argument... "
 printf "#include <iconv.h>\nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c
-$CXX $CXXFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null
+$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null
 if [ $? != 0 ]
 then
     printf "non-const\n"