]> git.stg.codes - stg.git/blobdiff - projects/sgconf/build
Allow user-defined 'ar' and 'ranlib'.
[stg.git] / projects / sgconf / build
index e2eb835b6de59dfc4282688cd4754549fc039e94..50c9a1178fb19221d898fb1f8452e7c019acee26 100755 (executable)
@@ -55,7 +55,7 @@ if [ "$sys" = "Darwin" ]
 then
     OS=darwin
     ETC_DIR="./inst/freebsd/etc/stargazer"
-    MAKE="gmake"
+    MAKE="make"
 fi
 
 if [ "$OS" = "unknown" ]
@@ -94,7 +94,6 @@ else
             then
                 DEFS="$DEFS -DDARWIN"
                 LIB_THREAD=-lpthread
-                LIBICONV=""
             else
                 LIB_THREAD=-lc_r
             fi
@@ -112,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 ]
@@ -130,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
@@ -208,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