]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-windows-versioning-updates-20021205
authorJames Peterson <james@abrakus.com>
Thu, 5 Dec 2002 05:59:52 +0000 (05:59 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 5 Dec 2002 05:59:52 +0000 (05:59 +0000)
conditionalize parts of windows build process on what platform the build is on

src/WINNT/client_creds/NTMakefile
src/WINNT/install/InstallShield5/NTMakefile
src/config/NTMakefile.i386_nt40
src/config/util_cr.c

index 85f9736b2a08e67d9efffcbdd8d8d9a7404cb5f1..98b1f4dadf6dd7a658b2fb1a43736ac9f8d14817 100644 (file)
@@ -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
index 91a960b7da1cdcbe553b7d9984f59f939e6f1c5f..498daa2204a805f16c51a77c6258a8864f08c666 100644 (file)
@@ -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
index fe7b908c2c155325fef0696e9661fd070169f5ca..9d390b50d283b85f14d340bf4e5b93827057b821 100644 (file)
@@ -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) $**
 
index 73adc3d2c33afb59d73055fba1a357a873a13549..77e77e8881a28cd693a3b4c7567dea2559c1fa06 100644 (file)
@@ -17,6 +17,7 @@
 #include "malloc.h"
 #include "time.h"
 #include "stdlib.h"
+#include <Winver.h>
 
 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) && (strcmp(argv[x],"#")!=0));x++);
-       if (strcmp(argv[x],"#")!=0)
+       for (x=1;((x<argc) && (strcmp(argv[x],"_")!=0));x++);
+       if (strcmp(argv[x],"_")!=0)
                return 0xc000;
        ret=CheckVersion(argc-x,&argv[x]);
        if (x+6>=argc)
-               return (!ret)?0:1;
-       for (++x;((x<argc) && (strcmp(argv[x],"#")!=0));x++);
-       if (strcmp(argv[x],"#")!=0)
+       {
+               return ret;
+       }
+       for (++x;((x<argc) && (strcmp(argv[x],"_")!=0));x++);
+       if (strcmp(argv[x],"_")!=0)
                return 0xc000;
        i=0;
        GetSystemDirectory(command,sizeof(command));
@@ -117,7 +161,7 @@ int DoCheckVersion(int argc,char *argv[])
        argv[i++]=command;
        argv[i++]="/c";
        argv[i++]=argv[x+1];
-       if (!ret) 
+       if (ret) 
                argv[i++]=argv[x+2];
        else 
                argv[i++]=argv[x+3];
@@ -201,13 +245,16 @@ int main(int argc, char* argv[])
        char **pvar,*ch;
        long len;
        typedef char * CHARP;
-
-       if (argc<3)
+        if (argc<3)
                usuage();
-       if (strcmp(argv[1],"#")==0)
-       {
+       if (strcmp(argv[1],"_")==0)
+       {
                return DoCheckVersion(argc,argv);
        }
+       if (strcmp(argv[1],"__")==0)
+       {
+               return CheckProductVersion(argc,argv);
+       }
        if (strcmp(argv[1],"}")==0)
        {
                char v1[4],v2[4],v3[4],v4[4];