Commits

Anonymous committed 69c10ea

Safety checkpoint, lightly tested.
Adding more support for build-make custom interface.

Comments (0)

Files changed (1)

   "Standardizes the fetching of XEmacs from the CVS repository."
   :group 'build)
 
+(defgroup build-with-MS nil
+  "Standardizes the building of XEmacs with MiroSoft tools."
+  :group 'build)
+
+(defcustom build-with-MS-make-command
+  "nmake"
+  "Path of MicroSoft make utility used to build XEmacs."
+  :type 'file
+  :group 'build-with-MS)
+
+(defcustom build-with-MS-make-options
+  "/n /f xemacs.mak"
+  "Options to use with MicroSoft make utility when building XEmacs."
+  :type 'string
+  :group 'build-with-MS)
+
 (defgroup build-tarball nil
   "Standardized the fetching of XEmacs beta tarballs."
   :group 'build)
 (defun build-extract-tarball (file)
   (cd build-tarball-dest)
   (let ((cmd
-	 (concat "gunzip -c " build-tarball-prefix file " | tar -xvfpB -"))
+	 (format "gunzip -c %s%s | tar -xvfpB -" build-tarball-prefix file))
 	(compilation-mode-hook
 	 'build-compilation-mode-hook)
 	(compilation-buffer-name-function
   (if dir
       (cd dir))
   (let ((cmd
-	 (concat "sh configure"
+	 (format "sh configure%s"
 		 (mapconcat
 		  (function (lambda (e)
 			      (cond
 				    (string= "defaulted" (rest e)))
 				"")
 			       ((string= "yes" (rest e))
-				(concat " '" (first e) "'"))
+				(format " '%s'" (first e)))
 			       ((and
 				 (string-match "\\`--without-\\(.+\\)\\'" (first e))
 				 (string= "no" (rest e)))
-				(concat " '-with-" (match-string 1 (first e)) "'"))
+				(format " '-with-%s'" (match-string 1 (first e))))
 			       (t
-				(concat " '" (first e) "=" (rest e) "'")))))
+				(concat " '%s=%s'" (first e) (rest e))))))
 		  (delete-duplicates
 		   build-configure-options :from-end t
 		   :test (lambda (a b)
 			   (string=
 			    (first a) (first b))))
-		  "")
-		 ""))    
+		  "")))    
 	(compilation-mode-hook
 	 'build-compilation-mode-hook)
 	(compilation-buffer-name-function
     (make-directory build-cvs-working-dir t))
   (cd build-cvs-working-dir)
   (let ((cmd
-	 (concat "cvs " build-cvs-options " -d "
-		 build-cvs-xemacs-repository " login"))
+	 (format "cvs %s -d %s login" build-cvs-options
+		 build-cvs-xemacs-repository))
 	(compilation-mode-hook
 	 'build-compilation-mode-hook)
 	(compilation-buffer-name-function
     (make-directory build-cvs-working-dir t))
   (cd build-cvs-working-dir)
   (let ((cmd
-	 (concat "cvs " build-cvs-options " -d "
-		 build-cvs-xemacs-repository " checkout "
+	 (format "cvs %s -d %s checkout %s%s %s" build-cvs-options
+		 build-cvs-xemacs-repository
 		 build-cvs-checkout-options
-		 (when release-tag
-		   (concat " -r " release-tag))
-		 " " build-cvs-xemacs-module ""))
+		 (if release-tag
+		   (concat " -r " release-tag)
+		   "")
+		 build-cvs-xemacs-module))
 	(compilation-mode-hook
 	 'build-compilation-mode-hook)
 	(compilation-buffer-name-function
 	 '(lambda (mode)
 	    (generate-new-buffer-name
-	     (concat build-cvs-xemacs-module "-cvs-checkout"
-		     (when release-tag
-		       (format "-%s" release-tag))
-		     ".err")))))
+	     (format "%s-cvs-checkout%s.err" build-cvs-xemacs-module
+		     (if release-tag
+		       (format "-%s" release-tag)
+""))))))
     (compile cmd)))
 
 (defun build-cvs-update (&optional release-tag)
    (expand-file-name build-cvs-xemacs-module
 		     build-cvs-working-dir))
   (let ((cmd
-	 (concat "cvs "
+	 (format "cvs %s update %s%s"
 		 build-cvs-options
-		 " update "
 		 build-cvs-update-options
-		 (when release-tag
-		   (concat " -r " release-tag))
-		 ""))
+		 (if release-tag
+		   (concat " -r " release-tag)
+"")
+		 ))
 	(compilation-mode-hook
 	 'build-compilation-mode-hook)
 	(compilation-buffer-name-function
 				(expand-file-name
 				 build-tarball-prefix
 				 build-tarball-dest)))))
-		   "Build XEmacs Now")
+		   (format "Build XEmacs With %s Now" build-with-what))
     (use-local-map widget-keymap)
     (custom-mode)
     (widget-setup)
      (if (boundp 'build-configure-options)
 	 :deactivate
        :activate))
-    (if (boundp 'build-configure-options)
-	(widget-insert
-	 " You will need to restart XEmacs to activate the generated interface to Build Config.\n\n"))
+    (when (boundp 'build-configure-options)
+      (widget-insert "\n\t")
+      (widget-insert
+       "You will need to restart XEmacs to activate
+	the generated interface to Build Config.\n\n"))
     (widget-create 'push-button
 		   :notify (lambda (&rest ignore)
 			     (customize-browse 'build-config))
     (kill-all-local-variables)
     (cd (expand-file-name "nt" dir))
     (widget-insert "\n")
+    (widget-insert
+     "\nYou may customize MicroSoft Tools options.\n\n")
+    (widget-create 'push-button
+		   :notify (lambda (&rest ignore)
+			     (customize-browse 'build-with-MS))
+		   "Browse Build With MS Options")
+    (widget-insert "\n\n")
     (widget-create 'push-button
 		   :notify (lambda (&rest ignore)
 			     (build-make-generate "xemacs.mak"))
 		   "Generate XEmacs Make")
+    (widget-insert "\n\t")
+    (widget-apply
+     (widget-create 'push-button
+		    :notify (lambda (&rest ignore)
+			      (eval-buffer "build-make.el"))
+		    "Activate Generated Build Make")
+     (if (boundp 'build-make-options)
+	 :deactivate
+       :activate))
+    (when (boundp 'build-make-options)
+      (widget-insert "\n\t")
+      (widget-insert
+       "You will need to restart XEmacs to activate
+	the generated interface to Build Make.\n\n"))
+    (widget-create 'push-button
+		   :notify (lambda (&rest ignore)
+			     (customize-browse 'build-make))
+		   "Customize Build Make")
     (widget-insert "\n\n")
     (widget-create 'push-button
 		   :notify (lambda (&rest ignore)
-			     (build-make "distclean" "nmake /f xemacs.mak"))
+			     (build-make
+			      "distclean"
+			      (format "%s %s"
+			       build-with-MS-make-command
+			       build-with-MS-make-options)))
 		   "Clean XEmacs Distribution")
     (widget-insert "\n\n")
     (widget-create 'push-button
 		   :notify (lambda (&rest ignore)
 			     (build-make
 			      "all"
-			      (concat
-			       "nmake -f xemacs.mak"
-			       " PACKAGEPATH=\"c:\\\\Program Files\\\\XEmacs\\\\xemacs-packages\""
-			       " USE_UNION_TYPE=1"
-			       " GUNG_HO=1"
-			       " HAVE_MSW=1"
-			       " HAVE_MULE=1"
-			       " HAVE_NATIVE_SOUND=1"
-			       " HAVE_XFACE=1 COMPFACE_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\compface\""
-			       " HAVE_XPM=1 XPM_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\xpm-3.4k\""
-			       " HAVE_PNG=1 PNG_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\libpng-1.0.2\""
-			       " HAVE_TIFF=1 TIFF_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\tiff-v3.4\""
-			       " HAVE_JPEG=1 JPEG_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\jpeg-6b\""
-			       " ZLIB_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\zlib\""
-			       " DEBUG_XEMACS=0")))
+			      (format "%s %s %s"
+			       build-with-MS-make-command
+			       build-with-MS-make-options
+			       (build-make-get-option-string))))
 ;;; 			       " USE_ASSERTIONS=1 ASSERTIONS_DONT_ABORT=1"
 ;;; 			       " ERROR_CHECK_GC=1 ERROR_CHECK_BUFPOS=1 DEBUG_XEMACS=1")))
 		   "Build XEmacs")
 		   :notify (lambda (&rest ignore)
 			     (build-make
 			      "install"
-			      (concat
-			       "nmake -f xemacs.mak"
-			       " PACKAGEPATH=\"c:\\\\Program Files\\\\XEmacs\\\\xemacs-packages\""
-			       " USE_UNION_TYPE=1"
-			       " GUNG_HO=1"
-			       " HAVE_MSW=1"
-			       " HAVE_MULE=1"
-			       " HAVE_NATIVE_SOUND=1"
-			       " HAVE_XFACE=1 COMPFACE_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\compface\""
-			       " HAVE_XPM=1 XPM_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\xpm-3.4k\""
-			       " HAVE_PNG=1 PNG_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\libpng-1.0.2\""
-			       " HAVE_TIFF=1 TIFF_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\tiff-v3.4\""
-			       " HAVE_JPEG=1 JPEG_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\jpeg-6b\""
-			       " ZLIB_DIR=\"d:\\export\\home\\tmp\\libs4xemacs\\zlib\""
-			       " DEBUG_XEMACS=0")))
+			      (format "%s %s %s"
+			       build-with-MS-make-command
+			       build-with-MS-make-options
+			       (build-make-get-option-string))))
 ;;; 			       " USE_ASSERTIONS=1 ASSERTIONS_DONT_ABORT=1"
 ;;; 			       " ERROR_CHECK_GC=1 ERROR_CHECK_BUFPOS=1 DEBUG_XEMACS=1")))
 		   "Build and Install XEmacs")
     (widget-setup)
     (goto-char (point-min))))
 
+(defun build-make-get-option-string ()
+  (mapconcat
+   (function (lambda (e)
+	       (cond
+		(t
+		 (format " %s=%s" (first e) (rest e))))))
+   (delete-duplicates
+    build-make-options :from-end t
+    :test (lambda (a b)
+	    (string=
+	     (first a) (first b))))
+   ""))
+
 (defun build-build-report ()
   (interactive)
   (let
 
 (defun build-make-customize (a-list)
   (princ "
-(provide 'build-make)\n
-(setq build-make-options nil)\n
+(provide 'build-make)
+
+(setq build-make-options nil)
+
 (defun sym-to-opt (sym)
-  (substring (symbol-name sym) 11))\n
+  (substring (symbol-name sym) 11))
+
 (defun build-set-value (sym val)
-  (setq build-make-options 
-	(acons (sym-to-opt sym) val
-	       build-make-options))
-  (set-default sym val))\n")		;
-  (princ (format "(defgroup build-make nil\n"))
-  (princ (format "  \"build-make options.\"\n"))
-  (princ "  :group 'build)\n\n")
+  (cond
+   ((equal val (first (get sym 'standard-value)))
+    (setq build-make-options (remassoc (sym-to-opt sym) build-make-options)))
+   (t
+    (setq build-make-options 
+	  (acons (sym-to-opt sym) val
+		 build-make-options))))
+  (set-default sym val))
+
+(defgroup build-make nil
+  \"build-make options.\"
+  :group 'build)
+
+")
   (mapcar 
    (lambda (macro)
      (build-make-string (first macro) (second macro))