From: James Peterson Date: Thu, 5 Dec 2002 05:59:52 +0000 (+0000) Subject: STABLE12-windows-versioning-updates-20021205 X-Git-Tag: openafs-stable-1_2_8~8 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a74d70bb4fed2d9517af49ac4a4db3921cd94bf8;p=packages%2Fo%2Fopenafs.git STABLE12-windows-versioning-updates-20021205 conditionalize parts of windows build process on what platform the build is on --- diff --git a/src/WINNT/client_creds/NTMakefile b/src/WINNT/client_creds/NTMakefile index 85f9736b2..98b1f4dad 100644 --- a/src/WINNT/client_creds/NTMakefile +++ b/src/WINNT/client_creds/NTMakefile @@ -5,12 +5,6 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -# make compiler warnings fatal - -AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX - -# include the AFSD source tree on our inclusion path - AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd # include the primary makefile diff --git a/src/WINNT/install/InstallShield5/NTMakefile b/src/WINNT/install/InstallShield5/NTMakefile index 91a960b7d..498daa220 100644 --- a/src/WINNT/install/InstallShield5/NTMakefile +++ b/src/WINNT/install/InstallShield5/NTMakefile @@ -20,6 +20,15 @@ AFSBUILDCOMMENTS=Build:*DatE* *TimE* CellServDB:$(CELLSERVDB_INSTALL) ############################################################################ +#CHECK which OS we are using to avoid using the wrong options +!IF (([$(DESTDIR)\bin\util_cr.exe _ xp w2])==1) +XCOPY= xcopy /s/e/y +!ELSE +XCOPY= xcopy /s/e +!ENDIF + +#check which version of the complier we are using + prep: AFS_component_version_number.txt $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" ".\lang\en_US\value.txt" ".\lang\en_US\value.shl" $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" "default.txt" "default.rge" @@ -62,7 +71,7 @@ build: $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.* $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a !ENDIF - $(DESTDIR)\bin\util_cr.exe # xp w2 # xcopy /s/e/y /s/e Media\OpenAFS\DiskIm~1\disk1\*.* $(DESTDIR)\WinInstall + $(XCOPY) Media\OpenAFS\DiskIm~1\disk1\*.* $(DESTDIR)\WinInstall copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt $(DEL) /q "Media\OpenAFS\Disk Images\disk1\*.*" install: prep build diff --git a/src/config/NTMakefile.i386_nt40 b/src/config/NTMakefile.i386_nt40 index fe7b908c2..9d390b50d 100644 --- a/src/config/NTMakefile.i386_nt40 +++ b/src/config/NTMakefile.i386_nt40 @@ -37,7 +37,7 @@ APPVER = 4.0 !ENDIF #define used in WinNT/2000 installation and program version display -AFSPRODUCT_VERSION=1.2.8 a +AFSPRODUCT_VERSION=1.2.8 CELLNAME_DEFAULT=openafs.org CELLSERVDB_INSTALL=CellServDB.GrandCentral CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB @@ -61,28 +61,9 @@ AFSDEV_BUILDTYPE = NONE !ENDIF -# Limit default include and library directories to those specified for build. - -#!IFNDEF AFSDEV_INCLUDE -#!ERROR Must define AFSDEV_INCLUDE to be the default include directories. -#!ENDIF - -#!IF ((!DEFINED(INCLUDE)) && ([set INCLUDE=$(AFSDEV_INCLUDE)] != 0)) -# If env. var. INCLUDE not defined then macro assignment won't set it. -#!ERROR Failed setting environment variable INCLUDE. -#!ENDIF -#INCLUDE = $(AFSDEV_INCLUDE) - - -#!IFNDEF AFSDEV_LIB -#!ERROR Must define AFSDEV_LIB to be the default library directories. -#!ENDIF - -#!IF ((!DEFINED(LIB)) && ([set LIB=$(AFSDEV_LIB)] != 0)) -# If env. var. LIB not defined then macro assignment won't set it. -#!ERROR Failed setting environment variable LIB. -#!ENDIF -#LIB = $(AFSDEV_LIB) +!IFNDEF AFSDEV_BIN +!ERROR Must define AFSDEV_BIN to be the default build binary directories. +!ENDIF # Undefine WIN32.MAK NODEBUG macro. # Always generate full debug info, unless profiling or tuning (see below). @@ -104,6 +85,42 @@ DESTDIR = $(AFSDEV_DESTDIR) DESTDIR = $(AFSROOT)\DEST !ENDIF +#CHECK which VERSION of the complier we are using +#v6.0 doesn't work using msvcrtd.lib unless AFSDEV_CRTDEBUG is defined, v7.0 requires it +!IF ("$(AFSVER)"=="") +!IF EXISTS("$(DESTDIR)\bin\util_cr.exe") +!IF EXISTS("$(AFSDEV_BIN)\CL.exe") +!IF (([$(DESTDIR)\bin\util_cr.exe __ $(AFSDEV_BIN)\CL.exe 7])==1) +AFSVER_CL=70 +!ELSE +AFSVER_CL=60 +!ENDIF +!ELSE +!MESSAGE WARNING-Complier version not available +!ENDIF +!ELSE +!MESSAGE WARNING-Complier version not available +!ENDIF +!ENDIF + +#CHECK which VERSION of the complier we are using +#v6.0 doesn't work using msvcrtd.lib unless AFSDEV_CRTDEBUG is defined, v7.0 requires it +!IF ("$(AFSVER)"=="") +!IF EXISTS("$(DESTDIR)\bin\util_cr.exe") +!IF EXISTS("$(AFSDEV_BIN)\CL.exe") +!IF (([$(DESTDIR)\bin\util_cr.exe __ $(AFSDEV_BIN)\CL.exe 7])==1) +AFSVER_CL=70 +!ELSE +AFSVER_CL=60 +!ENDIF +!ELSE +!MESSAGE WARNING-Complier version not available +!ENDIF +!ELSE +!MESSAGE WARNING-Complier version not available +!ENDIF +!ENDIF + # Command macros. COPY = copy DEL = -del @@ -169,16 +186,16 @@ afscflags =\ !IF ("$(AFSDEV_BUILDTYPE)" == "FREE") # Apply full optimization; generate full debug info in obj. -afscflags = $(afscflags) /Ox /Zi +afscflags = $(afscflags) /Ox /Z7 ldebug = $(ldebug) cdebug = $(cdebug:-Od=) # avoid annoying override warning (D4025) cvarsdll = $(cvarsdll:-MDd=-MD) !ELSEIF ("$(AFSDEV_BUILDTYPE)" == "CHECKED") # Disable optimization; generate full debug info in obj. -afscflags = $(afscflags) /Od /Zi +afscflags = $(afscflags) /Od /Z7 ldebug = $(ldebug) -debugtype:both -cdebug = $(cdebug:-Z7=-Zi) # avoid annoying override warning (D4025) +cdebug = $(cdebug:-Z7=-Z7) # avoid annoying override warning (D4025) !ENDIF # Set compiler warning level @@ -209,8 +226,8 @@ afslflags =\ # For checked builds, define DEBUG (but not the MS control flag _DEBUG). -!IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED") -#afscdefs = $(afscdefs) -DDEBUG +!IF (("$(AFSDEV_BUILDTYPE)" == "CHECKED") && ("$(AFSVER_CL)"=="60")) +afscdefs = $(afscdefs) -DDEBUG !ENDIF # Utilize the debug version of the MSVC runtime, if requested. @@ -255,7 +272,7 @@ mfcdlllflags = $(mfcdlllflags) /NODEFAULTLIB:msvcrt.lib # Macros for creating/modifying binary targets # EXE link macro for console applications -EXECONLINK = $(link) /OUT:$@ $(ldebug) $(conlflags) $(afslflags) $(conlibsdll) $** +EXECONLINK = $(link) /OUT:$@ $(ldebug) $(conlflags) $(afslflags) $(conlibsdll) version.lib $** # EXE link macro for GUI applications EXEGUILINK = $(link) /OUT:$@ $(ldebug) $(guilflags) $(afslflags) $(guilibsdll) $** @@ -272,11 +289,18 @@ DLLGUILINK = $(link) /OUT:$@ /NODEFAULTLIB:LIBC $(ldebug) $(dlllflags) $(afslfla !ELSE DLLGUILINK = $(link) /OUT:$@ $(ldebug) $(dlllflags) $(afslflags) $(guilibsdll) $** !ENDIF -DLLGUILINK = $(link) /OUT:$@ $(ldebug) $(dlllflags) $(afslflags) $(guilibsdll) $** # DLL link macro for MFC applications DLLMFCLINK = $(link) /OUT:$@ $(ldebug) $(mfcdlllflags) $(afslflags) $(mfclibsdll) $** +#v6.0 doesn't work using msvcrtd.lib unless AFSDEV_CRTDEBUG is defined, v7.0 requires it +!IFNDEF AFSDEV_CRTDEBUG +!IF ("$(AFSVER_CL)"=="60") +EXEMFCLINK=$(EXEMFCLINK:/NODEFAULTLIB:msvcrtd.lib=) +DLLMFCLINK=$(DLLMFCLINK:/NODEFAULTLIB:msvcrtd.lib=) +!ENDIF +!ENDIF + # DLL link macro for resource-only DLLs DLLRESLINK = $(link) /OUT:$@ $(dlllflags:-entry:_DllMainCRTStartup@12=-noentry) $(afslflags) $** diff --git a/src/config/util_cr.c b/src/config/util_cr.c index 73adc3d2c..77e77e888 100644 --- a/src/config/util_cr.c +++ b/src/config/util_cr.c @@ -17,6 +17,7 @@ #include "malloc.h" #include "time.h" #include "stdlib.h" +#include void usuage() { @@ -31,11 +32,52 @@ void usuage() OR util_cr @ file.ini \"[SectionKey]variable=value\" ; update ini-ipr-pwf file\n\ OR util_cr @ file.ini \"[SectionKey]variable=value*DatE*\" ; update ini-ipr-pwf file, insert date\n\ OR util_cr ~ ;force error\n\ - OR util_cr # [nt xp 98 9x w2] ;test for OS, return 0 if match else 1\n\ - OR util_cr # [nt xp 98 9x w2] #[command] [true options] [false optiosn] [paramters] \n\t test for OS; execute command with options\n"); + OR util_cr _ [nt xp 98 9x w2] ;test for OS, return 1 if match else 0\n\ + OR util_cr _ [nt xp 98 9x w2] _[command] [true options] [false options] [paramters] \n\t test for OS; execute command with options\n"); exit(0xc000); } +struct TRANSLATION { + WORD langID; // language ID + WORD charset; // character set (code page) +}; + +int CheckProductVersion (int argc,char *argv[]) +{ + DWORD wHandle; + DWORD rc; + UINT len; + char query[1024]; + BYTE *lpData; + struct TRANSLATION mTrans,* pTrans; + LPCTSTR pVal; + UINT iLenVal; + int ret; + lpData=NULL; + ret=0; +/* printf("1=%s,2=%s\n",argv[2],argv[3]);*/ + rc =GetFileVersionInfoSize(argv[2],&wHandle); + if (rc>0) + { + lpData=(BYTE *)malloc(rc*sizeof(BYTE)); + if (GetFileVersionInfo(argv[2],wHandle,rc,lpData)) + { + if (VerQueryValue(lpData, + "\\VarFileInfo\\Translation", (PVOID *)&pTrans, &len) && len >= 4) { + mTrans = *pTrans; + } + sprintf(query,"\\StringFileInfo\\%04x%04x\\%s",mTrans.langID,mTrans.charset,"ProductVersion"); + if (VerQueryValue(lpData, (LPTSTR)(LPCTSTR)query, + (LPVOID*)&pVal, &iLenVal)) { + ret=(atoi(pVal)>=atoi(argv[3]))?1:0; + } + } + if (lpData) + free(lpData); + } + return ret; +} + int CheckVersion(int argc,char *argv[]) { OSVERSIONINFO VersionInfo; @@ -53,48 +95,48 @@ int CheckVersion(int argc,char *argv[]) if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) && (VersionInfo.dwMajorVersion==4) && (VersionInfo.dwMinorVersion==0)) - return 0; + return 1; } if (stricmp(argv[i],"xp")==0) { if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) && (VersionInfo.dwMajorVersion==5) && (VersionInfo.dwMinorVersion==1)) - return 0; + return 1; } if (stricmp(argv[i],"w2")==0) { if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) && (VersionInfo.dwMajorVersion==5) && (VersionInfo.dwMinorVersion==0)) - return 0; + return 1; } if (stricmp(argv[i],"98")==0) { if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) && (VersionInfo.dwMinorVersion==10)) - return 0; + return 1; } if (stricmp(argv[i],"95")==0) { if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) && (VersionInfo.dwMinorVersion==0)) - return 0; + return 1; } if (stricmp(argv[i],"9x")==0) { if (VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) - return 0; + return 1; } - if (stricmp(argv[i],"#")==0) - return 1; + if (stricmp(argv[i],"_")==0) + return 0; } - return 1; + return 0; } int DoCheckVersion(int argc,char *argv[]) { //arg 1 nth versions - //arg nth # + //arg nth _ //arg n+1 command //arg n+2 option true //arg n+3 option false @@ -102,14 +144,16 @@ int DoCheckVersion(int argc,char *argv[]) int x,i; int ret; char command[1024]; - for (x=1;((x=argc) - return (!ret)?0:1; - for (++x;((x