Adding a DOWNLOADER variable to autotools which detects curl if wget is not found
authorJames Fournie <jfournie@sitka.bclibraries.ca>
Tue, 13 Sep 2011 22:52:53 +0000 (15:52 -0700)
committerJames Fournie <jfournie@sitka.bclibraries.ca>
Tue, 13 Sep 2011 22:53:24 +0000 (15:53 -0700)
This is currently only used to download xulrunner bits for staff client builds

Signed-off-by: James Fournie <jfournie@sitka.bclibraries.ca>
Open-ILS/xul/staff_client/Makefile.am
configure.ac

index dab3b2f..855b2bb 100644 (file)
@@ -273,7 +273,7 @@ branding_check:
 
 win-xulrunner: unzip_check branding_check client_app
        @echo 'Preparing Windows xulrunner'
-       @if [ ! -f ${XULRUNNER_WINFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_WINFILE}; fi
+       @if [ ! -f ${XULRUNNER_WINFILE} ]; then ${DOWNLOADER} ${XULRUNNER_URL}${XULRUNNER_WINFILE}; fi
        @unzip -q ${XULRUNNER_WINFILE} -dclient
        @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","win");' >> client/defaults/preferences/autochannel.js; fi;
        @echo 'Preparing stub'
@@ -281,7 +281,7 @@ win-xulrunner: unzip_check branding_check client_app
 
 linux-xulrunner: client_app
        @echo 'Preparing Linux xulrunner'
-       @if [ ! -f ${XULRUNNER_LINUXFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_LINUXFILE}; fi
+       @if [ ! -f ${XULRUNNER_LINUXFILE} ]; then ${DOWNLOADER} ${XULRUNNER_URL}${XULRUNNER_LINUXFILE}; fi
        @cd client; tar xjf ../${XULRUNNER_LINUXFILE}; cd ..
        @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","lin");' >> client/defaults/preferences/autochannel.js; fi;
        @echo 'Preparing stub'
@@ -290,7 +290,7 @@ linux-xulrunner: client_app
 # Build a windows installer.
 
 win-client: nsis_check win-xulrunner
-       @if [ "${NSIS_AUTOUPDATE}${NSIS_PERMACHINE}" -a ! -d AccessControl ]; then echo 'Fetching AccessControl Plugin'; wget ${NSIS_ACCESSCONTROL} -O AccessControl.zip; unzip AccessControl.zip; fi
+       @if [ "${NSIS_AUTOUPDATE}${NSIS_PERMACHINE}" -a ! -d AccessControl ]; then echo 'Fetching AccessControl Plugin'; ${DOWNLOADER} ${NSIS_ACCESSCONTROL} -O AccessControl.zip; unzip AccessControl.zip; fi
        @echo 'Building installer'
        @makensis -V2 -DPRODUCT_VERSION="${STAFF_CLIENT_VERSION}" ${NSIS_WICON} ${NSIS_AUTOUPDATE} ${NSIS_DEV} ${NSIS_PERMACHINE} ${NSIS_EXTRAS} ${NSIS_EXTRAOPTS} windowssetup.nsi
        @echo 'Done'
index dd0b098..f228570 100644 (file)
@@ -42,6 +42,21 @@ AC_PROG_MKDIR_P
 AM_PROG_CC_C_O
 
 #-----------------------------------
+# Checks for wget vs curl
+#-----------------------------------
+AC_CHECK_PROGS([DOWNLOADER], [wget curl])
+if test "X$DOWNLOADER" = "Xwget"; then
+   DOWNLOADER="wget -q";
+else
+    if test "X$DOWNLOADER" = "Xcurl"; then
+        DOWNLOADER="curl -O";
+    else
+        AC_MSG_ERROR(Could not find wget or curl);
+    fi
+fi
+
+
+#-----------------------------------
 # Install options 
 #-----------------------------------