Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Date: Wed, 8 Dec 1999 23:22:35 -0500 From: Chris Faylor To: Mumit Khan Cc: Corinna Vinschen , cygdev Subject: Re: snapshot-991207 Message-ID: <19991208232235.A16604@cygnus.com> Mail-Followup-To: Mumit Khan , Corinna Vinschen , cygdev References: <19991208212157 DOT B15078 AT cygnus DOT com> <199912090408 DOT WAA15036 AT mercury DOT xraylith DOT wisc DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <199912090408.WAA15036@mercury.xraylith.wisc.edu>; from khan@nanotech.wisc.edu on Wed, Dec 08, 1999 at 10:08:52PM -0600 On Wed, Dec 08, 1999 at 10:08:52PM -0600, Mumit Khan wrote: >Chris Faylor writes: >> On Wed, Dec 08, 1999 at 08:22:38PM -0500, Chris Faylor wrote: >>Just in case anyone cares, my supposition was correct. Mumit's changes >>do not work with the windres (v 2.95) that I'm using. > >Let's please use --define until all windres versions catch up. It >works for your version as well I assume. Yup. I've done that. >Is the trouble you're having something to do with quotes? Could you >please send me the output so I can put something together that works >both ways? I'm going to build winsup on a win9x machine running v1.0 >later this evening and what the problem is. Yes. It is quote related. When I was first setting this up I'd tried to pass in the build date and cygwin version using the same method that you used in your patch but I ran into problems. I had assumed that the usage was something like C where, if you pass in a defined symbol as -DFOO="\"This is foo\"" you would be able to use FOO anywhere you can use a quoted string. That doesn't seem to be the case with windres, for some reason. I kept getting syntax errors whereever I used these symbols. So, I got rid of the extra quotes and used STRINGIFY instead. I was actually surprised that this worked... Anyway, the enclosed patch may fix things. I've just eliminated the need to pass in a string with a space in it. It's a hack, but it *should* work with either version of windres. This will be in tonight's snapshot. Thanks, Corinna and Mumit, for actually trying out the new snapshots. I assume that since I haven't heard any screams of anguish that the new signal code isn't deleting files from your hard disk or something similar. cgf Index: Makefile.in =================================================================== RCS file: /cvs/cvsfiles/devo/winsup/Makefile.in,v retrieving revision 1.177 diff -u -p -r1.177 Makefile.in --- Makefile.in 1999/12/07 03:35:06 1.177 +++ Makefile.in 1999/12/09 04:12:35 @@ -142,7 +142,7 @@ DOC=faq.txt faq.info readme.txt readme.i HTMLDOC=faq.html readme.html .PHONY: all force dll_ofiles utils info info-html install-info subdir_dobefore \ - subdir_doafter install + subdir_doafter install winver_version all: new-$(DLL_NAME) $(LIBGMON_A) $(THEIR_LIBS) $(LIB_NAME) force @$(MAKE) subdir_dobefore DO=$@ $(FLAGS_TO_PASS) @@ -356,20 +356,23 @@ DLL_STUFF=--as=$(AS) --dllname $(DLL_NAM dll_ofiles: $(DLL_OFILES) -onew-$(DLL_NAME): dll_ofiles $(DEF_FILE) $(DLL_IMPORTS) $(LIBC_A) $(LIBM_A) Makefile version.o +onew-$(DLL_NAME): dll_ofiles $(DEF_FILE) $(DLL_IMPORTS) $(LIBC_A) $(LIBM_A) Makefile version.o winver.o $(LD) --base-file=cygwin.base -s -o /dev/null $(LD_STUFF) $(DLLTOOL) $(DLL_STUFF) $(LD) --base-file=cygwin.base cygwin.exp -s -o /dev/null $(LD_STUFF) $(DLLTOOL) $(DLL_STUFF) $(LD) cygwin.exp -o new-$(DLL_NAME) $(LD_STUFF) -new-$(DLL_NAME): $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC_A) $(LIBM_A) Makefile version.o +new-$(DLL_NAME): $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC_A) $(LIBM_A) Makefile version.o winver.o $(LD) -shared -o $@ -e $(DLL_ENTRY) cygwin.def $(DLL_OFILES) version.o winver.o $(DLL_IMPORTS) $(LIBM_A) $(LIBGCC) $(MALLOC_OBJ) $(LIBC_A) $(LIBGCC) $(LIBGMON_A): $(GMON_OFILES) $(GMON_START) $(AR) rcv $(LIBGMON_A) $(GMON_OFILES) -winver.o version.cc: mkvers.sh include/cygwin/version.h winver.rc $(DLL_OFILES) +version.cc winver.o: winver_version + @/bin/true + +winver_version: mkvers.sh include/cygwin/version.h winver.rc $(DLL_OFILES) @echo "Making version.cc";rm -f $@;\ $(SHELL) ${word 1,$^} ${word 2,$^} ${word 3,$^} $(WINDRES) > $@ Index: mkvers.sh =================================================================== RCS file: /cvs/cvsfiles/devo/winsup/mkvers.sh,v retrieving revision 1.11 diff -u -p -r1.11 mkvers.sh --- mkvers.sh 1999/12/07 03:35:11 1.11 +++ mkvers.sh 1999/12/09 04:12:36 @@ -29,24 +29,29 @@ set -$- $build_date # Translate the month into a number # case "$2" in - Jan) m=1 ;; - Feb) m=2 ;; - Mar) m=3 ;; - Apr) m=4 ;; - May) m=5 ;; - Jun) m=6 ;; - Jul) m=7 ;; - Aug) m=8 ;; - Sep) m=9 ;; + Jan) m=01 ;; + Feb) m=02 ;; + Mar) m=03 ;; + Apr) m=04 ;; + May) m=05 ;; + Jun) m=06 ;; + Jul) m=07 ;; + Aug) m=08 ;; + Sep) m=09 ;; Oct) m=10 ;; Nov) m=11 ;; Dec) m=12 ;; esac +if [ "$3" -le 10 ]; then + d=0$3 +else + d=$3 +fi # # Set date into YYYY-MM-DD HH:MM:SS format # -builddate="${6-$5}-$m-$3 $4" +builddate="${6-$5}-$m-$d $4" set -$- '' @@ -85,7 +90,7 @@ cvs_tag="`sed 's%^.\(.*\)%\1%' $dir/CVS/ # file for a ".snapshot-date" file. If one is found then this information # will be saved for output to the DLL. # -dir=`echo $dir | sed 's%/include/cygwin.*$%%'` +dir=`echo $dir | sed -e 's%/include/cygwin.*$%%' -e 's%include/cygwin.*$%%'` if [ -r "$dir/.snapshot-date" ]; then read snapshot < "$dir/.snapshot-date" snapshot="snapshot date @@ -153,4 +158,5 @@ if [ -n "$cvs_tag" ]; then cygwin_ver="$cygwin_ver ($cvs_tag)" fi -$windres --include-dir $dir/include -DBUILD_DATE="$builddate" -DVERSION="$cygwin_ver" $rcfile winver.o || { rm -f version.cc; exit 1; } +set -$- $builddate +exec $windres --include-dir $dir/include --define CYGWIN_BUILD_DATE="$1" --define CYGWIN_BUILD_TIME="$2" --define CYGWIN_VERSION='"'"$cygwin_ver"'"' $rcfile winver.o Index: winver.rc =================================================================== RCS file: /cvs/cvsfiles/devo/winsup/winver.rc,v retrieving revision 1.1 diff -u -p -r1.1 winver.rc --- winver.rc 1999/12/07 03:35:11 1.1 +++ winver.rc 1999/12/09 04:12:37 @@ -1,20 +1,20 @@ #include #include -#define STRINGIFY1(x) #x -#define STRINGIFY(x) STRINGIFY1(x) +#define STRINGIFY1(x) #x +#define STRINGIFY(x) STRINGIFY1(x) -#define CYGWIN_BUILD_DATE STRINGIFY(BUILD_DATE) - #define CYGWIN_DLL_NAME CYGWIN_VERSION_DLL_IDENTIFIER STRINGIFY(.dll) -#define CYGWIN_VERSION STRINGIFY(VERSION) - #define CYGWIN_REGISTRY_KEY CYGWIN_INFO_CYGNUS_REGISTRY_NAME "\\" \ CYGWIN_INFO_CYGWIN_REGISTRY_NAME #define CYGWIN_API_VERSION STRINGIFY(CYGWIN_VERSION_API_MAJOR) "." \ STRINGIFY(CYGWIN_VERSION_API_MINOR) + +#define CYGWIN_BUILD_DATE_TIME STRINGIFY(CYGWIN_BUILD_DATE) " " \ + STRINGIFY(CYGWIN_BUILD_TIME) + VS_VERSION_INFO VERSIONINFO FILEVERSION CYGWIN_VERSION_DLL_MAJOR,CYGWIN_VERSION_DLL_MINOR,0,0 PRODUCTVERSION CYGWIN_VERSION_DLL_MAJOR,CYGWIN_VERSION_DLL_MINOR,0,0 @@ -34,16 +34,16 @@ BEGIN BEGIN VALUE "CompanyName", "Cygnus Solutions" VALUE "FileDescription", "Cygwin\256 POSIX Emulation DLL" - VALUE "FileVersion", CYGWIN_VERSION + VALUE "FileVersion", STRINGIFY(CYGWIN_VERSION) VALUE "InternalName", CYGWIN_DLL_NAME VALUE "LegalCopyright", "Copyright \251 Cygnus Solutions. 1996-1999" VALUE "OriginalFilename", CYGWIN_DLL_NAME VALUE "ProductName", "Cygwin" - VALUE "ProductVersion", CYGWIN_VERSION + VALUE "ProductVersion", STRINGIFY(CYGWIN_VERSION) VALUE "APIVersion", CYGWIN_API_VERSION VALUE "SharedMemoryVersion", STRINGIFY(CYGWIN_VERSION_SHARED_DATA) VALUE "RegistryKey", CYGWIN_REGISTRY_KEY - VALUE "BuildDate", CYGWIN_BUILD_DATE + VALUE "BuildDate", CYGWIN_BUILD_DATE_TIME END END BLOCK "VarFileInfo"