From e3aef5c688f5c4a471f92494c0b2599574140658 Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Sat, 24 Jul 2010 15:35:31 +0200 Subject: [PATCH] New make target for Windows platform: make dist (bug#6602) * admin/admin.el: Write version number to nt/makefile.w32-in. * admin/nt/makedist.bat: Remove; replaced with `zipdist.bat' in the nt/ directory. * admin/nt/README.W32: Relocate to nt/ directory. * etc/NEWS: Document new --distfiles configure.bat option and `dist' make target on Windows. * nt/INSTALL: Document new dist target and add section about creating binary distributions. * nt/configure.bat: New parameter `--distfiles'. * nt/makefile.w32-in: Add version number, new target `dist'. Add new target `install-shortcuts'. * nt/zipdist.bat: New file; create zipped binary distribution, replaces admin/nt/makedist.bat. --- admin/ChangeLog | 7 ++++ admin/admin.el | 3 ++ admin/nt/makedist.bat | 65 ------------------------------------ etc/ChangeLog | 5 +++ etc/NEWS | 6 ++++ nt/ChangeLog | 13 ++++++++ nt/INSTALL | 29 ++++++++++++++++ {admin/nt => nt}/README.W32 | 0 nt/configure.bat | 58 ++++++++++++++++++++++++++++++-- nt/makefile.w32-in | 17 ++++++++-- nt/zipdist.bat | 66 +++++++++++++++++++++++++++++++++++++ 11 files changed, 200 insertions(+), 69 deletions(-) delete mode 100755 admin/nt/makedist.bat rename {admin/nt => nt}/README.W32 (100%) create mode 100644 nt/zipdist.bat diff --git a/admin/ChangeLog b/admin/ChangeLog index bda2901ed6..e082eee36b 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,10 @@ +2010-07-24 Christoph Scholtes + + * admin.el: Write version number to nt/makefile.w32-in. + * nt/makedist.bat: Remove; replaced with `zipdist.bat' + in the nt/ directory. + * nt/README.W32: Relocate to nt/ directory. + 2010-07-11 Andreas Schwab * CPP-DEFINES (HAVE_INDEX, HAVE_RINDEX): Remove. diff --git a/admin/admin.el b/admin/admin.el index f2cf008f47..51bbecf4c5 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -95,6 +95,9 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "lib-src/makefile.w32-in" version (rx (and "VERSION" (0+ space) "=" (0+ space) (submatch (1+ (in "0-9.")))))) + (set-version-in-file root "nt/makefile.w32-in" version + (rx (and "VERSION" (0+ space) "=" (0+ space) + (submatch (1+ (in "0-9.")))))) ;; nt/emacs.rc also contains the version number, but in an awkward ;; format. It must contain four components, separated by commas, and ;; in two places those commas are followed by space, in two other diff --git a/admin/nt/makedist.bat b/admin/nt/makedist.bat deleted file mode 100755 index 6546e6e10d..0000000000 --- a/admin/nt/makedist.bat +++ /dev/null @@ -1,65 +0,0 @@ -@echo off - -rem Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -rem Free Software Foundation, Inc. - -rem Cannot use brackets in andrewi's email below because -rem older Windows shells will treat that as redirection. - -rem Author: Andrew Innes andrewi@gnu.org - -rem This file is part of GNU Emacs. - -rem GNU Emacs is free software: you can redistribute it and/or modify -rem it under the terms of the GNU General Public License as published by -rem the Free Software Foundation, either version 3 of the License, or -rem (at your option) any later version. - -rem GNU Emacs is distributed in the hope that it will be useful, -rem but WITHOUT ANY WARRANTY; without even the implied warranty of -rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -rem GNU General Public License for more details. - -rem You should have received a copy of the GNU General Public License -rem along with GNU Emacs. If not, see http://www.gnu.org/licenses/. - - -if (%3) == () goto usage -if not (%4) == () goto %4 - -:bin - -echo Create full bin distribution -copy %3\README.W32 emacs-%1\README.W32 -rem Info-ZIP zip seems to be broken on Windows. -rem It always writes to zip.zip and treats the zipfile argument as one -rem of the files to go in it. -rem zip -9 -r %2-bin-i386 emacs-%1/BUGS emacs-%1/COPYING emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim -x emacs.mdp *.pdb *.opt *~ CVS -7z a -tZIP -mx=9 -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory %2-bin-i386.zip emacs-%1/BUGS emacs-%1/COPYING emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim emacs-%1/site-lisp -del emacs-%1\README.W32 -if not (%4) == () goto end - -:barebin -echo Create archive with just the basic binaries and generated files -echo (the user needs to unpack the full source distribution for -echo everything else) -copy %3\README.W32 emacs-%1\README.W32 -rem Info-ZIP zip seems to be broken on Windows. -rem It always writes to zip.zip and treats the zipfile argument as one -rem of the files to go in it. -rem zip -9 -r %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING -7z a -tZIP -mx=9 %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING -del emacs-%1\README.W32 -if not (%4) == () goto end - -goto end - -:usage -echo Generate source and binary distributions of emacs. -echo Usage: %0 emacs-version dist-basename distfiles [bin,barebin] -echo (e.g., %0 19.34 emacs-19.34.5 d:\andrewi\distfiles) -:end - -goto skipArchTag - arch-tag: 6e2ddd92-c1c9-4992-b6b5-207aaab72f68 -:skipArchTag diff --git a/etc/ChangeLog b/etc/ChangeLog index 16d49e1f8a..a2770c1230 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2010-07-24 Christoph Scholtes + + * NEWS: Document new --distfiles configure.bat option and + `dist' make target on Windows. + 2010-07-20 Juanma Barranquero * PROBLEMS: Add note about use of backslashes in Windows paths. diff --git a/etc/NEWS b/etc/NEWS index 31dd69d5b4..6b781ab836 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -432,6 +432,12 @@ displayed with a "spinning bar". ** New configure.bat option --enable-checking builds emacs with extra runtime checks. +** New configure.bat option --distfiles to specify files to be + included in binary distribution + +** New make target `dist' to create binary disttribution for Windows + platform + ---------------------------------------------------------------------- This file is part of GNU Emacs. diff --git a/nt/ChangeLog b/nt/ChangeLog index 08f12203ec..fbf5bdbaa3 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,16 @@ +2010-07-24 Christoph Scholtes + + New make target for Windows platform: make dist (bug#6602) + + * INSTALL: Document new dist target and add section about + creating binary distributions. + * README.W32: Relocate from admin/nt/ directory. + * configure.bat: New parameter `--distfiles'. + * makefile.w32-in: Add version number, new target `dist'. + Add new target `install-shortcuts'. + * zipdist.bat: New file; create zipped binary distribution, + replaces admin/nt/makedist.bat. + 2010-07-21 Juanma Barranquero * INSTALL: Add note about backslashes in Windows paths. diff --git a/nt/INSTALL b/nt/INSTALL index 1f1f75395f..8af8e3020d 100644 --- a/nt/INSTALL +++ b/nt/INSTALL @@ -406,6 +406,9 @@ Removes the installed files in the bin subdirectory in addition to the files removed by make cleanall. + make dist + Builds Emacs from the available sources and pre-compiled lisp files. + Packages Emacs binaries as full distribution and barebin distribution. The following targets are intended only for use with the Bazaar sources. @@ -428,6 +431,32 @@ bootstrap to rebuild. Occasionally it may be necessary to run this target after an update. +* Creating binary distributions + + Binary distributions (full and barebin distributions) can be + automatically built and packaged from source tarballs or a bzr + checkout. + + When building Emacs binary distributions, the --distfiles argument + to configure.bat specifies files to be included in the bin directory + of the binary distributions. This is intended for libraries that are + not built as part of Emacs, e.g. image libraries. + + For example, specifying + + --distfiles D:\distfiles\libXpm.dll + + results in libXpm.dll being copied from D:\distfiles to the + bin directory before packaging starts. + + Multiple files can be specified using multiple --distfiles arguments: + + --distfiles D:\distfiles\libXpm.dll --distfiles C:\jpeglib\jpeg.dll + + For packaging the binary distributions, the 'dist' make target uses + 7-Zip (http://www.7-zip.org), which must be installed and available + on the Windows Path. + * Trouble-shooting diff --git a/admin/nt/README.W32 b/nt/README.W32 similarity index 100% rename from admin/nt/README.W32 rename to nt/README.W32 diff --git a/nt/configure.bat b/nt/configure.bat index 705d4e9271..c7bfad3518 100755 --- a/nt/configure.bat +++ b/nt/configure.bat @@ -90,6 +90,8 @@ set userldflags= set doldflags= set sep1= set sep2= +set sep3= +set distfiles= rem ---------------------------------------------------------------------- rem Handle arguments. @@ -112,6 +114,7 @@ if "%1" == "--without-gif" goto withoutgif if "%1" == "--without-tiff" goto withouttiff if "%1" == "--without-xpm" goto withoutxpm if "%1" == "--with-svg" goto withsvg +if "%1" == "--distfiles" goto distfiles if "%1" == "" goto checkutils :usage echo Usage: configure [options] @@ -132,6 +135,7 @@ echo. --without-gif do not use GIF library even if it is installed echo. --without-tiff do not use TIFF library even if it is installed echo. --without-xpm do not use XPM library even if it is installed echo. --with-svg use the RSVG library (experimental) +echo. --distfiles path to files for make dist, e.g. libXpm.dll goto end rem ---------------------------------------------------------------------- :setprefix @@ -233,6 +237,16 @@ shift set svgsupport=Y goto again +rem ---------------------------------------------------------------------- + +:distfiles +set HAVE_DISTFILES=1 +shift +set distfiles=%distfiles%%sep3%%1 +set sep3= %nothing% +shift +goto again + rem ---------------------------------------------------------------------- rem Check that necessary utilities (cp and rm) are present. :checkutils @@ -521,6 +535,35 @@ set HAVE_RSVG=1 :svgDone rm -f junk.c junk.obj junk.err junk.out +rem Any distfiles provided for building distribution? If no, we're done. +if "(%HAVE_DISTFILES%)"=="()" goto :distFilesDone + +rem Any arguments to --distfiles specified? If no, we're done. +if not "%distfiles%"=="" goto :checkDistFiles +set distFilesOk=0 +echo No arguments specified for option --distfiles! +goto distfilesDone + +:checkDistFiles +echo Checking for distfiles... +rem Check if all specified distfiles exist +set fileNotFound= +for %%d in (%distfiles%) do if not exist %%d set fileNotFound=%%d +if not "%fileNotFound%"=="" goto distFilesNotFound + +set distFilesOK=1 +echo ...all distfiles found. +goto :distFilesDone + +:distFilesNotFound +set distFilesOk=0 +echo ...%fileNotFound% not found. +set distfiles= +goto :distfilesDone + +:distFilesDone +set fileNotFound= + rem ---------------------------------------------------------------------- :genmakefiles echo Generating makefiles @@ -541,6 +584,7 @@ if (%enablechecking%) == (Y) echo ENABLECHECKS=1 >>config.settings if (%profile%) == (Y) echo PROFILE=1 >>config.settings if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings +if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles%>>config.settings rem We go thru docflags because usercflags could be "-DFOO=bar" -something rem and the if command cannot cope with this for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y @@ -642,12 +686,19 @@ if (%tiffsupport%) == (N) goto checkgif echo Install libtiff development files or use --without-tiff :checkgif -if not "(%HAVE_GIF%)" == "()" goto donelibchecks -if (%gifsupport%) == (N) goto donelibchecks +if not "(%HAVE_GIF%)" == "()" goto checkdistfiles +if (%gifsupport%) == (N) goto checkdistfiles set libsOK=0 echo GIF support is missing. echo Install giflib or libungif development files or use --without-gif +:checkdistfiles +if "(%HAVE_DISTFILES%)" == "()" goto donelibchecks +if (%distFilesOk%) == (1) goto donelibchecks +echo. +echo Files specified with option --distfiles could not be found. +echo Fix these issues before running make dist + :donelibchecks if (%libsOK%) == (1) goto success echo. @@ -680,6 +731,9 @@ set userldflags= set doldflags= set mingwflag= set mf= +set distfiles= +set HAVE_DISTFILES= +set distFilesOk= goto skipArchTag arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index 48b3ab1405..47f9b90107 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -23,6 +23,8 @@ # FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out # (and remove or replace this comment). +VERSION = 24.0.50 + TRES = $(BLD)/emacs.res CLIENTRES = $(BLD)/emacsclient.res @@ -197,12 +199,15 @@ $(INSTALL_DIR)/bin: $(INSTALL_DIR) # # Build and install emacs in INSTALL_DIR # -install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE) +.PHONY: install-bin install-shortcuts + +install: install-bin install-shortcuts + +install-bin: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE) - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin - - "$(INSTALL_DIR)/bin/addpm" -q - $(DEL) ../same-dir.tst - $(DEL) $(INSTALL_DIR)/same-dir.tst echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" @@ -238,6 +243,14 @@ install-other-dirs-gmake: $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install +install-shortcuts: + "$(INSTALL_DIR)/bin/addpm" -q + +dist: install-bin + $(CP) $(DIST_FILES) $(INSTALL_DIR)/bin + $(CP) README.W32 $(INSTALL_DIR) + $(COMSPEC)$(ComSpec) /c $(ARGQUOTE)zipdist.bat $(INSTALL_DIR) $(VERSION)$(ARGQUOTE) + force-info: # Note that doc/emacs/makefile knows how to # put the info files in $(infodir), diff --git a/nt/zipdist.bat b/nt/zipdist.bat new file mode 100644 index 0000000000..87c4e06c4b --- /dev/null +++ b/nt/zipdist.bat @@ -0,0 +1,66 @@ +@echo off +rem Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +rem Free Software Foundation, Inc. + +rem Author: Christoph Scholtes cschol2112 at gmail.com + +rem This file is part of GNU Emacs. + +rem GNU Emacs is free software: you can redistribute it and/or modify +rem it under the terms of the GNU General Public License as published by +rem the Free Software Foundation, either version 3 of the License, or +rem (at your option) any later version. + +rem GNU Emacs is distributed in the hope that it will be useful, +rem but WITHOUT ANY WARRANTY; without even the implied warranty of +rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +rem GNU General Public License for more details. + +rem You should have received a copy of the GNU General Public License +rem along with GNU Emacs. If not, see http://www.gnu.org/licenses/. + +SETLOCAL +rem arg 1: full path to Emacs root directory +set ARG_PATH="%~f1" +rem Path separator cannot be parsed correctly, substitute +set ARG_PATH=%ARG_PATH:\=;% + +rem arg 2: Emacs version number +set EMACS_VER=%2 + +rem Parse out last directory from passed in full path (arg 1) +for /f "tokens=* delims=;" %%G in (%ARG_PATH%) do call :PARSE_PATH %%G +goto :EXIT + +:PARSE_PATH +if "%1"=="" ( + goto :ZIP_CHECK +) +set ROOT_DIR=%1 +SHIFT +goto :PARSE_PATH + +rem Check, if 7zip is installed and available on path +:ZIP_CHECK +7z +if %ERRORLEVEL% NEQ 0 goto :ZIP_ERROR +goto ZIP_DIST + +:ZIP_ERROR +echo. +echo ERROR: Make sure 7zip is installed and available on the Windows Path! +goto EXIT + +rem Build distributions +:ZIP_DIST +pushd ..\.. +rem Build and verify full distribution +7z a -bd -tZIP -mx=9 -x!.bzrignore -x!.gitignore -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory emacs-%EMACS_VER%-bin-i386.zip %ROOT_DIR%/BUGS %ROOT_DIR%/COPYING %ROOT_DIR%/README %ROOT_DIR%/README.W32 %ROOT_DIR%/INSTALL %ROOT_DIR%/bin %ROOT_DIR%/etc %ROOT_DIR%/info %ROOT_DIR%/lisp %ROOT_DIR%/leim %ROOT_DIR%/site-lisp +7z t emacs-%EMACS_VER%-bin-i386.zip +rem Build and verify binary only distribution +7z a -bd -tZIP -mx=9 emacs-%EMACS_VER%-barebin-i386.zip %ROOT_DIR%/README.W32 %ROOT_DIR%/bin %ROOT_DIR%/etc/DOC-X %ROOT_DIR%/COPYING +7z t emacs-%EMACS_VER%-barebin-i386.zip +popd +goto EXIT + +:EXIT -- 2.20.1