diff --git a/configure.ac b/configure.ac index e43893b..59887ed 100644 --- a/configure.ac +++ b/configure.ac @@ -33,23 +33,18 @@ AC_CHECK_HEADERS(windows.h) # Change master uri for sbcl-bin AC_ARG_WITH([sbcl_bin_base], [AC_HELP_STRING([--with-sbcl-bin-base=URI],[set URI for sbcl-bin [default=http://prdownloads.sourceforge.net/sbcl/]])], - [SBCL_BIN_BASE_URI=$withval],[SBCL_BIN_BASE_URI="http://prdownloads.sourceforge.net/sbcl/"]) -AC_DEFINE_UNQUOTED([SBCL_BIN_BASE_URI],["${SBCL_BIN_BASE_URI}"],[uri for sbcl master]) - -AC_ARG_WITH([quicklisp_base], - [AC_HELP_STRING([--with-quicklisp-base=URI],[set URI for quicklisp [default=http://beta.quicklisp.org/]])], - [QUICKLISP_BASE_URI=$withval],[QUICKLISP_BASE_URI="http://beta.quicklisp.org/"]) -AC_DEFINE_UNQUOTED([QUICKLISP_BASE_URI],["${QUICKLISP_BASE_URI}"],[uri for quicklisp]) + [SBCL_BIN_URI=$withval],[SBCL_BIN_URI="http://prdownloads.sourceforge.net/sbcl/"]) +AC_DEFINE_UNQUOTED([SBCL_BIN_URI],["${SBCL_BIN_URI}"],[uri for sbcl master]) AC_ARG_WITH([platformhtml_base], [AC_HELP_STRING([--with-platformhtml-base=URI],[set URI for platform.html [default=http://www.sbcl.org/]])], - [PLATFORM_HTML_BASE_URI=$withval],[PLATFORM_HTML_BASE_URI="http://www.sbcl.org/"]) -AC_DEFINE_UNQUOTED([PLATFORM_HTML_BASE_URI],["${PLATFORM_HTML_BASE_URI}"],[uri for platform.html]) + [PLATFORM_HTML_URI=$withval],[PLATFORM_HTML_URI="http://www.sbcl.org/"]) +AC_DEFINE_UNQUOTED([PLATFORM_HTML_URI],["${PLATFORM_HTML_URI}"],[uri for platform.html]) AC_ARG_WITH([platformhtml_backup_base], [AC_HELP_STRING([--with-platformhtml-backup-base=URI],[set backup URI for platform.html [default is gist]])], - [PLATFORM_HTML_BACKUP_BASE_URI=$withval],[PLATFORM_HTML_BACKUP_BASE_URI="https://gist.githubusercontent.com/snmsts/12f0cf8567b8e26ae15f/raw/0b9134f9820c195e1ca84d382176777ec989183e/"]) -AC_DEFINE_UNQUOTED([PLATFORM_HTML_BACKUP_BASE_URI],["${PLATFORM_HTML_BACKUP_BASE_URI}"],[backup uri for platform.html]) + [PLATFORM_HTML_BACKUP_URI=$withval],[PLATFORM_HTML_BACKUP_URI="https://gist.githubusercontent.com/snmsts/12f0cf8567b8e26ae15f/raw/0b9134f9820c195e1ca84d382176777ec989183e/"]) +AC_DEFINE_UNQUOTED([PLATFORM_HTML_BACKUP_URI],["${PLATFORM_HTML_BACKUP_URI}"],[backup uri for platform.html]) # man file (ros.1) generation switch AC_ARG_ENABLE([manual_generation], diff --git a/lisp/locations.lisp b/lisp/locations.lisp index 1877c4f..86d811c 100644 --- a/lisp/locations.lisp +++ b/lisp/locations.lisp @@ -6,8 +6,17 @@ (:use :cl)) (in-package :ros.locations) -(defmacro defuri (name uri) - `(export (defun ,name () ,uri))) +(defvar *locations* '()) + +(defmacro defuri (name &optional uri) + (let ((downcased (format nil "~(~A~)" name))) + `(progn + (export + (defun ,name () + (or (ros:opt ,downcased) + ,uri + (ros:roswell '("roswell-internal-use" "version" ,downcased) :string t)))) + (push ,name *locations*)))) (defuri clisp-version-uri "http://ftp.gnu.org/pub/gnu/clisp/release/") (defuri 7za-uri "http://sourceforge.net/projects/sevenzip/files/7-Zip/9.20/7za920.zip/download#") @@ -30,3 +39,6 @@ (defuri asdf-uri "https://github.com/fare/asdf/archive/") (defuri ecl-uri "https://github.com/roswell/mirror-ecl/archive/") (defuri sbcl-uri "https://github.com/sbcl/sbcl/archive/") + +(defuri sbcl-bin-version-uri) +(defuri sbcl-bin-uri) diff --git a/src/cmd-internal.c b/src/cmd-internal.c index 077233e..68abd47 100644 --- a/src/cmd-internal.c +++ b/src/cmd-internal.c @@ -82,6 +82,10 @@ int cmd_internal_version (int argc,char **argv,struct sub_command* cmd) { printf("%s\n",PACKAGE_STRING); }else if(strcmp(argv[1],"revision")==0) { printf("%s\n",ROS_REVISION); + }else if(strcmp(argv[1],"sbcl-bin-version-uri")==0) { + printf("%s\n",PLATFORM_HTML_URI); + }else if(strcmp(argv[1],"sbcl-bin-uri")==0) { + printf("%s\n",SBCL_BIN_URI); }else return 1; } diff --git a/src/install-sbcl-bin.c b/src/install-sbcl-bin.c index 67fc04f..2ef8e23 100644 --- a/src/install-sbcl-bin.c +++ b/src/install-sbcl-bin.c @@ -41,10 +41,10 @@ int sbcl_version_bin(struct install_options* param) { if(!param->version) { int ret; printf("No SBCL version specified. Downloading platform-table.html to see the available versions...\n"); - ret=download_simple(PLATFORM_HTML_BASE_URI "platform-table.html",platforms_html,0); + ret=download_simple(PLATFORM_HTML_URI "platform-table.html",platforms_html,0); if(ret!=0) { printf("Something wrong! Check the connection or sbcl.org is down. Download failed (Code=%d), tring the backup URL.\n",ret); - ret=download_simple(PLATFORM_HTML_BACKUP_BASE_URI"platform-table.html",platforms_html,0); + ret=download_simple(PLATFORM_HTML_BACKUP_URI"platform-table.html",platforms_html,0); } if(ret!=0) { printf("Download failed (Code=%d)\n",ret); @@ -70,7 +70,7 @@ int sbcl_bin_download(struct install_options* param) { param->expand_path=cat(home,"src",SLASH,"sbcl","-",param->version,"-","arm-linux",SLASH,NULL); else param->expand_path=cat(home,"src",SLASH,"sbcl","-",param->version,"-",arch,SLASH,NULL); - impls_sbcl_bin.uri=cat(SBCL_BIN_BASE_URI "sbcl-",param->version, + impls_sbcl_bin.uri=cat(SBCL_BIN_URI "sbcl-",param->version, "-",arch,"-binary",sbcl_bin_extention(param),NULL); result = download(param); if(!result) {