]> git.stg.codes - stg.git/blobdiff - projects/sgconf_xml/build
Add missing documentation.
[stg.git] / projects / sgconf_xml / build
index a1084554f5ec8bf31be5eebc82791e61f3f6f575..c0d17f8baa46e549fc5ea681f284ecda67f0e0b9 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
@@ -104,6 +111,16 @@ then
     CXX=g++
 fi
 
+if [ -z "$AR" ]
+then
+    AR=ar
+fi
+
+if [ -z "$RANLIB" ]
+then
+    RANLIB=ranlib
+fi
+
 printf "Checking CC... "
 $CC --version > /dev/null 2> /dev/null
 if [ $? != 0 ]
@@ -122,6 +139,24 @@ then
     exit;
 fi
 printf "found\n"
+printf "Checking AR... "
+$AR --version > /dev/null 2> /dev/null
+if [ $? != 0 ]
+then
+    printf "FAIL!\n"
+    printf "$AR not found\n"
+    exit;
+fi
+printf "found\n"
+printf "Checking RANLIB... "
+$RANLIB --version > /dev/null 2> /dev/null
+if [ $? != 0 ]
+then
+    printf "FAIL!\n"
+    printf "$RANLIB not found\n"
+    exit;
+fi
+printf "found\n"
 
 printf "Checking endianess... "
 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
@@ -200,6 +235,8 @@ printf "\n" >> $CONFFILE
 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
 printf "CC=$CC\n" >> $CONFFILE
 printf "CXX=$CXX\n" >> $CONFFILE
+printf "AR=$AR\n" >> $CONFFILE
+printf "RANLIB=$RANLIB\n" >> $CONFFILE
 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE