# 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
############################################################################
+#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"
$(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
!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
!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).
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
!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
# 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.
# 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) $**
!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) $**
#include "malloc.h"
#include "time.h"
#include "stdlib.h"
+#include <Winver.h>
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;
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
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));
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];
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];