From b1565e868d5549753fd710529b88bd4c183889ab Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 25 Jun 2012 09:09:14 +0200 Subject: zlib is now compiled as a dll --- bdftopcf/makefile | 2 +- include/sys/types.h | 98 ++++++++++++++++++++++++++++++++-- libXfont/src/fontfile/makefile | 2 - libxml2/bin/zlib1.dll | Bin 77824 -> 0 bytes makefile.after | 10 ++-- makefile.before | 5 +- mkfontscale/makefile | 2 +- tools/mhmake/genkdev4.sh | 6 +-- tools/mhmake/mhmake.vcxproj | 25 ++++----- tools/mhmake/mhmake.vcxproj.filters | 13 +++-- tools/mhmake/src/build.cpp | 7 +-- tools/mhmake/src/commandqueue.cpp | 6 +-- tools/mhmake/src/commandqueue.h | 10 ++-- tools/mhmake/src/fileinfo.cpp | 2 +- tools/mhmake/src/functions.cpp | 18 +++---- tools/mhmake/src/mhmakefileparser.cpp | 70 ++++++++++-------------- tools/mhmake/src/mhmakefileparser.h | 10 ++-- tools/mhmake/src/mhmakelexer.l | 27 ++++++++-- tools/mhmake/src/mhmakeparser.y | 23 +++++++- tools/mhmake/src/rule.h | 2 +- tools/mhmake/src/util.cpp | 35 +++++------- tools/mhmake/src/util.h | 2 +- xorg-server/hw/xwin/xlaunch/main.cc | 3 ++ xorg-server/installer/vcxsrv.nsi | 2 +- xorg-server/makefile | 6 ++- zlib/Makefile | 10 ++-- 26 files changed, 264 insertions(+), 132 deletions(-) delete mode 100644 libxml2/bin/zlib1.dll diff --git a/bdftopcf/makefile b/bdftopcf/makefile index 02e92b422..81986617f 100644 --- a/bdftopcf/makefile +++ b/bdftopcf/makefile @@ -1,7 +1,7 @@ TTYAPP = bdftopcf INCLUDELIBFILES = \ - $(MHMAKECONF)\zlib\$(OBJDIR)\libz.lib \ + $(MHMAKECONF)\zlib\$(OBJDIR)\zlib1.lib \ $(MHMAKECONF)\libXfont\src\fontfile\$(OBJDIR)\libfontfile.lib \ $(MHMAKECONF)\libXfont\src\bitmap\$(OBJDIR)\libbitmap.lib \ $(MHMAKECONF)\libXfont\src\util\$(OBJDIR)\libutil.lib diff --git a/include/sys/types.h b/include/sys/types.h index 07e9640a2..dabb3902b 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -1,11 +1,101 @@ -#ifndef __TYPES_H__ -#define __TYPES_H__ +/*** +*sys/types.h - types returned by system level calls for file and time info +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* +*Purpose: +* This file defines types used in defining values returned by system +* level calls for file status and time information. +* [System V] +* +* [Public] +* +****/ -#include +#pragma once + +#ifndef _INC_TYPES +#define _INC_TYPES + +#if !defined(_WIN32) +#error ERROR: Only Win32 target supported! +#endif typedef int pid_t; typedef long off_t; typedef int gid_t; typedef int uid_t; -#endif \ No newline at end of file +#if !defined(_W64) +#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) +#define _W64 __w64 +#else +#define _W64 +#endif +#endif + +#ifdef _USE_32BIT_TIME_T +#ifdef _WIN64 +#include +#endif +#endif + +#ifndef _TIME32_T_DEFINED +typedef _W64 long __time32_t; /* 32-bit time value */ +#define _TIME32_T_DEFINED +#endif + +#ifndef _TIME64_T_DEFINED +typedef __int64 __time64_t; /* 64-bit time value */ +#define _TIME64_T_DEFINED +#endif + +#ifndef _TIME_T_DEFINED +#ifdef _USE_32BIT_TIME_T +typedef __time32_t time_t; /* time value */ +#else +typedef __time64_t time_t; /* time value */ +#endif +#define _TIME_T_DEFINED /* avoid multiple def's of time_t */ +#endif + + +#ifndef _INO_T_DEFINED + +typedef unsigned short _ino_t; /* i-node number (not used on DOS) */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +typedef unsigned short ino_t; +#endif + +#define _INO_T_DEFINED +#endif + + +#ifndef _DEV_T_DEFINED + +typedef unsigned int _dev_t; /* device code */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +typedef unsigned int dev_t; +#endif + +#define _DEV_T_DEFINED +#endif + + +#ifndef _OFF_T_DEFINED + +typedef long _off_t; /* file offset value */ + +#if !__STDC__ +/* Non-ANSI name for compatibility */ +typedef long off_t; +#endif + +#define _OFF_T_DEFINED +#endif + +#endif /* _INC_TYPES */ diff --git a/libXfont/src/fontfile/makefile b/libXfont/src/fontfile/makefile index 6468ff9b5..619cdbdbb 100644 --- a/libXfont/src/fontfile/makefile +++ b/libXfont/src/fontfile/makefile @@ -1,8 +1,6 @@ LIBRARY = libfontfile -INCLUDES += $(MHMAKECONF)\zlib\src\zlib-1.2.3 - DEFINES += X_GZIP_FONT_COMPRESSION CSRCS = bitsource.c \ diff --git a/libxml2/bin/zlib1.dll b/libxml2/bin/zlib1.dll deleted file mode 100644 index 82913fb9f..000000000 Binary files a/libxml2/bin/zlib1.dll and /dev/null differ diff --git a/makefile.after b/makefile.after index 5dd5e1cac..996fbb93f 100644 --- a/makefile.after +++ b/makefile.after @@ -62,11 +62,11 @@ endif all: $(EXE) -$(EXE) : $(OBJS) $(INCLUDELIBFILES) $(RESOBJS) $(MANIFESTFILE) $(EXTRALIB) +$(EXE) : $(OBJS) $(INCLUDELIBFILES) $(INCLUDENOSERVLIBFILES) $(RESOBJS) $(MANIFESTFILE) $(EXTRALIB) ifndef VS2008 - $(LINK) $(LINKFLAGS) /OUT:$(relpath $@) $(INCLUDELIBFILES) $(SYSTEMLIBS) $(LINKLIBS) $(EXTRALIB) $(OBJS) $(RESOBJS) + $(LINK) $(LINKFLAGS) /OUT:$(relpath $@) $(INCLUDELIBFILES) $(INCLUDENOSERVLIBFILES) $(SYSTEMLIBS) $(LINKLIBS) $(EXTRALIB) $(OBJS) $(RESOBJS) else - $(LINK) $(LINKFLAGS) /MANIFEST:NO /OUT:$(relpath $@) $(INCLUDELIBFILES) $(SYSTEMLIBS) $(LINKLIBS) $(EXTRALIB) $(OBJS) $(RESOBJS) + $(LINK) $(LINKFLAGS) /MANIFEST:NO /OUT:$(relpath $@) $(INCLUDELIBFILES) $(INCLUDENOSERVLIBFILES) $(SYSTEMLIBS) $(LINKLIBS) $(EXTRALIB) $(OBJS) $(RESOBJS) mt -nologo -manifest $(MANIFESTFILE) -outputresource:$(relpath $@);\#1 endif @@ -118,6 +118,10 @@ ifdef INC_BDF_RULES load_makefile $(MHMAKECONF)\bdftopcf\makefile MAKESERVER=0 DEBUG=$(DEBUG) load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG) +#bdftopcf is dependent on zlib1.dll, so we need to add the directory of the zlib dll to the path env variable +PATH:=$(relpath $(MHMAKECONF)\zlib\$(NOSERVOBJDIR))\;$(PATH) +export PATH + $(DESTDIR)\%.pcf.gz: %.bdf @del -e $@ $(BDFTOPCF) -t $< | gzip > $@ diff --git a/makefile.before b/makefile.before index 55bef4663..cdf91594a 100644 --- a/makefile.before +++ b/makefile.before @@ -38,7 +38,6 @@ endif ifeq ($(NORELDBG),1) # This all is here to avoid unnecessary rebuilds when switching between release and debug and MAKESERVER OBJDIR?=obj -OBJDIRPREFIX=noreldbg DEBUG=0 MAKESERVER=0 endif @@ -47,6 +46,7 @@ ifeq ($(DEBUG),1) CCFLAGS += -MDd -RTCc -RTC1 -Od -GS -GR -Zi LINKFLAGS += /DEBUG OBJDIR ?= obj\$(OBJDIRPREFIX)debug +NOSERVOBJDIR ?= obj\debug DEFINES += _DEBUG DEBUG RCFLAGS += -d "_DEBUG" else @@ -54,13 +54,14 @@ CCFLAGS += -MD -O2 -Ob2 -Oi -Ox -Oy -Ot -Zi -GL DEFINES += NDEBUG LINKFLAGS += /OPT:REF /OPT:ICF /DEBUG /LTCG:STATUS OBJDIR ?= obj\$(OBJDIRPREFIX)release +NOSERVOBJDIR ?= obj\release RCFLAGS += -d "NDEBUG" AR += /LTCG endif -DEFINES += WIN32 _WIN32 _WINDOWS WINDOWS _MBCS __i386__ __MINGW32__ OPEN_MAX=256 PATH_MAX=256 _TIMEVAL_DEFINED mode_t=int __STDC__ X_LOCALE +DEFINES += WIN32 _WIN32 _WINDOWS WINDOWS _MBCS __i386__ __MINGW32__ _POSIX_ X_NOT_POSIX _TIMEVAL_DEFINED mode_t=int __STDC__ X_LOCALE DEFINES += FAKEIT HAVE_CONFIG_H _BSD_SOURCE _WIN32_WINNT=_WIN32_WINNT_WINXP TOPSRCDIR=$(MHMAKECONF)\xorg-server diff --git a/mkfontscale/makefile b/mkfontscale/makefile index be789d4df..ff1c44887 100644 --- a/mkfontscale/makefile +++ b/mkfontscale/makefile @@ -5,7 +5,7 @@ DEFINES += _BSD_SOURCE INCLUDES += $(MHMAKECONF)\freetype\include INCLUDELIBFILES = \ - $(MHMAKECONF)\zlib\$(OBJDIR)\libz.lib \ + $(MHMAKECONF)\zlib\$(OBJDIR)\zlib1.lib \ $(MHMAKECONF)\libXfont\src\fontfile\$(OBJDIR)\libfontfile.lib \ $(MHMAKECONF)\libXfont\src\util\$(OBJDIR)\libutil.lib \ $(MHMAKECONF)\libfontenc\src\$(OBJDIR)\libfontenc.lib diff --git a/tools/mhmake/genkdev4.sh b/tools/mhmake/genkdev4.sh index 1acfe13b4..c3b1cbaa5 100755 --- a/tools/mhmake/genkdev4.sh +++ b/tools/mhmake/genkdev4.sh @@ -1,12 +1,12 @@ -mkdir build +[ ! -d build ] && mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .. cd .. -mkdir build.dbg +[ ! -d build.dbg ] && mkdir build.dbg cd build.dbg cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug .. cd .. -mkdir .kdev4 +[ ! -d .kdev4 ] && mkdir .kdev4 echo [CMake] > .kdev4/mhmake.kdev4 echo BuildDirs[\$e]=$PWD/build,$PWD/build.dbg >> .kdev4/mhmake.kdev4 diff --git a/tools/mhmake/mhmake.vcxproj b/tools/mhmake/mhmake.vcxproj index 913b03d63..2b395f11f 100644 --- a/tools/mhmake/mhmake.vcxproj +++ b/tools/mhmake/mhmake.vcxproj @@ -413,6 +413,7 @@ + @@ -425,24 +426,24 @@ cmd.exe /c makelex.bat Debug - .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;%(Outputs) + %(RelativeDir)flex.skl + $(IntDir)%(Filename).cpp cmd.exe /c makelex.bat Debug64 .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;%(Outputs) cmd.exe /c makelex.bat Profile - .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;%(Outputs) + %(RelativeDir)flex.skl + $(IntDir)%(Filename).cpp cmd.exe /c makelex.bat Profile64 .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;%(Outputs) cmd.exe /c makelex.bat Release - .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;%(Outputs) + %(RelativeDir)flex.skl + $(IntDir)%(Filename).cpp cmd.exe /c makelex.bat Release64 .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;%(Outputs) @@ -450,23 +451,23 @@ cmd.exe /c makebison.bat Debug - .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) + %(RelativeDir)bisondata/bison.m4;%(RelativeDir)bisondata/lalr1.cc;%(RelativeDir)bisondata/c++.m4;%(RelativeDir)bisondata/c.m4;%(RelativeDir)bisondata/location.cc + $(IntDir)%(Filename).cpp;$(IntDir)%(Filename).hpp;$(IntDir)location.hh;$(IntDir)position.hh;$(IntDir)stack.hh cmd.exe /c makebison.bat Debug64 .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) cmd.exe /c makebison.bat Profile - .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) + %(RelativeDir)bisondata/bison.m4;%(RelativeDir)bisondata/lalr1.cc;%(RelativeDir)bisondata/c++.m4;%(RelativeDir)bisondata/c.m4;%(RelativeDir)bisondata/location.cc + $(IntDir)%(Filename).cpp;$(IntDir)%(Filename).hpp;$(IntDir)location.hh;$(IntDir)position.hh;$(IntDir)stack.hh cmd.exe /c makebison.bat Profile64 .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) cmd.exe /c makebison.bat Release - .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) + %(RelativeDir)bisondata/bison.m4;%(RelativeDir)bisondata/lalr1.cc;%(RelativeDir)bisondata/c++.m4;%(RelativeDir)bisondata/c.m4;%(RelativeDir)bisondata/location.cc + $(IntDir)%(Filename).cpp;$(IntDir)%(Filename).hpp;$(IntDir)location.hh;$(IntDir)position.hh;$(IntDir)stack.hh cmd.exe /c makebison.bat Release64 .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) diff --git a/tools/mhmake/mhmake.vcxproj.filters b/tools/mhmake/mhmake.vcxproj.filters index 77d66e01c..0ec28f785 100644 --- a/tools/mhmake/mhmake.vcxproj.filters +++ b/tools/mhmake/mhmake.vcxproj.filters @@ -2,23 +2,23 @@ - {e9db2f40-4c63-488d-bb89-1eee3e458055} + {bafa54b0-cf70-4114-a02b-5950c0d4d6e3} cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - {bf259917-974f-4378-94e5-126d6d1889e9} + {a92d61c8-68ae-49f8-b843-a793ac9bb6c6} h;hpp;hxx;hm;inl - {5c6c4864-cd40-427e-825a-4a3028933fe0} + {a793606c-0dbc-4f42-9ad8-a61cf7773455} l;y;cpp;h - {06532204-d72c-459e-be81-db8b0725c996} + {e31daf7b-6a21-4a06-ac86-07625e21fd87} cpp;h - {c4505c11-9108-48e9-8d61-6247b696335e} + {bd4cf27c-0b86-4d5c-8dae-963cc3953cbb} ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe @@ -94,6 +94,9 @@ Header Files + + Header Files + diff --git a/tools/mhmake/src/build.cpp b/tools/mhmake/src/build.cpp index ba6a6e4da..ed9647d17 100644 --- a/tools/mhmake/src/build.cpp +++ b/tools/mhmake/src/build.cpp @@ -497,7 +497,7 @@ mh_pid_t mhmakefileparser::CopyFiles(const string &Params) const if (pSrc->IsDir()) { - SrcFileName+=OSPATHSEPSTR"*"; + SrcFileName+=OSPATHSEPSTR "*"; pSrc=GetFileInfo(SrcFileName,m_MakeDir); } @@ -797,7 +797,7 @@ static void CommandSep(const string &Command, unsigned &EndPos, unsigned &NextBe { continue; } - while (strchr(" \t|<>",Command[NextBegin])) NextBegin++; + while (strchr(" \t|<>",Command[NextBegin])) NextBegin++; } while (strchr(" \t|<>",Command[EndPos])) EndPos--; break; @@ -838,6 +838,7 @@ mh_pid_t mhmakefileparser::OsExeCommand(const string &Command, const string &Par unsigned NextBegin=0; unsigned EndPos=0; CommandSep(ComspecCommandLine,EndPos,NextBegin); + // We have multiple commands so create an temporary batch file FILE *pFile; while (1) @@ -1507,7 +1508,7 @@ mh_time_t mhmakefileparser::StartBuildTarget(fileinfo* pTarget,bool bCheckTarget } ImplicitRuleDepsIt++; } - + IMPLICITRULE::PopRule(ResultIt->second); #ifdef _DEBUG m_ImplicitSearch--; diff --git a/tools/mhmake/src/commandqueue.cpp b/tools/mhmake/src/commandqueue.cpp index 45a1d1043..c8f823b39 100644 --- a/tools/mhmake/src/commandqueue.cpp +++ b/tools/mhmake/src/commandqueue.cpp @@ -80,9 +80,9 @@ commandqueue::commandqueue() : { if (!szProc[cur+1]) { - NrProcs++; + NrProcs++; + } } - } cur++; } } @@ -120,7 +120,7 @@ void commandqueue::SetNrParallelBuilds(unsigned NrParallelBuilds) void commandqueue::ThrowCommandExecutionError(refptr pActiveEntry) { fileinfo* pTarget=pActiveEntry->pTarget; - const string &Command=pActiveEntry->Command; + const string &Command=pActiveEntry->Command; mhmakefileparser *pMakefile=pTarget->GetRule()->GetMakefile(); string ErrorMessage = string("Error running command: ")+ Command +"\n"; diff --git a/tools/mhmake/src/commandqueue.h b/tools/mhmake/src/commandqueue.h index 8b327be8c..815dba643 100644 --- a/tools/mhmake/src/commandqueue.h +++ b/tools/mhmake/src/commandqueue.h @@ -41,11 +41,11 @@ class commandqueue }; private: queue m_Queue; - unsigned m_MaxNrCommandsInParallel; - mh_pid_t *m_pActiveProcesses; - refptr *m_pActiveEntries; - unsigned m_NrActiveEntries; - mh_pid_t m_DummyWaitHandle; + unsigned m_MaxNrCommandsInParallel; + mh_pid_t *m_pActiveProcesses; + refptr *m_pActiveEntries; + unsigned m_NrActiveEntries; + mh_pid_t m_DummyWaitHandle; private: void ThrowCommandExecutionError(refptr pActiveEntry); diff --git a/tools/mhmake/src/fileinfo.cpp b/tools/mhmake/src/fileinfo.cpp index 9f4ae1ca1..884d645b5 100644 --- a/tools/mhmake/src/fileinfo.cpp +++ b/tools/mhmake/src/fileinfo.cpp @@ -257,7 +257,7 @@ string &NormalizePathName(string &Name) if (pLastSlash mhmakefileparser::sm_ParserStack; // Keeps track of the currently active parser string mhmakefileparser::GetFileNameLineNo(void) @@ -93,11 +93,7 @@ bool mhmakefileparser::IsDefined(const string &Var) const bool Ret = m_Variables.find(Var)!=m_Variables.end(); if (!Ret) { - string Env=GetFromEnv(Var); - if (!Env.empty()) - { - Ret=true; - } + GetFromEnv(Var, &Ret); } return Ret; } @@ -185,21 +181,21 @@ inline string mhmakefileparser::ExpandExpression(const string &ExprIn) const char Char=Expr[i++]; if (Char=='$') { - size_t inew=SkipMakeExpr(Expr,i); - i++; - if (inew>i) - { - ToAdd=ExpandMacro(Expr.substr(i,inew-i-1)); - i=inew; - } - else - { - // This is a single character expression - ToAdd=ExpandMacro(string(1,Expr[i-1])); - } - if (ToAdd.find('$')!=string::npos && ToAdd.length()!=1) - { - Recurse=true; + size_t inew=SkipMakeExpr(Expr,i); + i++; + if (inew>i) + { + ToAdd=ExpandMacro(Expr.substr(i,inew-i-1)); + i=inew; + } + else + { + // This is a single character expression + ToAdd=ExpandMacro(string(1,Expr[i-1])); + } + if (ToAdd.find('$')!=string::npos && ToAdd.length()!=1) + { + Recurse=true; } Ret+=ToAdd; } @@ -298,7 +294,7 @@ string mhmakefileparser::ExpandMacro(const string &Expr) const return ExpandExpression(Ret); else return Ret; -} + } } /////////////////////////////////////////////////////////////////////////////// @@ -682,7 +678,7 @@ const refptr mhmakefileparser::GetIncludeDirs() const ((mhmakefileparser*)this)->m_IncludeDirs=Includes; ((mhmakefileparser*)this)->m_pIncludeDirs=refptr(new fileinfoarray); if (Includes.empty()) // If not defined try a default path - Includes="include inc .."OSPATHSEPSTR"include .."OSPATHSEPSTR"inc"; + Includes="include inc .." OSPATHSEPSTR "include .." OSPATHSEPSTR "inc"; const char *pTmp=Includes.c_str(); while (*pTmp) { @@ -774,7 +770,7 @@ void mhmakefileparser::LoadAutoDepsFile(fileinfo *pDepFile) if (!pTarget->CompareMd5_32(0) && !pTarget->CompareMd5_32(Md5_32)) { - MakeNotDirty=false; /* BuildTarget had set the dirty flag, but since the md5 did not change it was a false dirty. This is for BuildTargets called before this routine */ + MakeNotDirty=false; /* BuildTarget had set the dirty flag, but since the md5 did not change it was a false dirty. This is for BuildTargets called before this routine */ #ifdef _DEBUG cout << "Warning: trying to set to different md5's for Target "<GetQuotedFullFileName()<<" Old: "<GetCommandsMd5_32()<<" New: "<::const_iterator pLineFind=m_CommandLineVars.find(Var); if (pLineFind!=m_CommandLineVars.end()) { ((mhmakefileparser*)this)->m_UsedEnvVars.insert(Var); - if (Cache) - ((mhmakefileparser*)this)->m_Variables[Var]=pLineFind->second; + ((mhmakefileparser*)this)->m_Variables[Var]=pLineFind->second; + if (pDefined) *pDefined=true; return pLineFind->second; } const char *pEnv=getenv(Var.c_str()); if (!pEnv) { + if (pDefined) *pDefined=false; return g_EmptyString; } ((mhmakefileparser*)this)->m_UsedEnvVars.insert(Var); - if (Cache) - ((mhmakefileparser*)this)->m_Variables[Var]=pEnv; + ((mhmakefileparser*)this)->m_Variables[Var]=pEnv; + if (pDefined) *pDefined=true; return pEnv; } /////////////////////////////////////////////////////////////////////////////// -// Creates the variable USER_ENVVARS to be saved in the autodeps file +// Creates the variable USED_ENVVARS to be saved in the autodeps file // void mhmakefileparser::CreateUSED_ENVVARS() diff --git a/tools/mhmake/src/mhmakefileparser.h b/tools/mhmake/src/mhmakefileparser.h index 9ad13446c..848329226 100644 --- a/tools/mhmake/src/mhmakefileparser.h +++ b/tools/mhmake/src/mhmakefileparser.h @@ -57,7 +57,7 @@ class mhmakefileparser : public refbase friend class yy::mhmakeparser; private: - static commandqueue sm_CommandQueue; + static commandqueue sm_CommandQueue; static stack sm_ParserStack; // Keeps track of the currently active parser private: fileinfo *m_RuleThatIsBuild; @@ -93,6 +93,7 @@ protected: bool m_RebuildAll; /* true when to rebuild all targets of this makefile */ set m_UsedEnvVars; // Array containing a list of variables that are taken from the environment (This is used for rebuild checking) + set m_EnvVarsToIgnore; // List of env vars that do not have to be taken into account for rebuild checking set m_Exports; // Array containing a list of exported variables in the makefile (This is used for rebuild checking) vector< pair< string, refptr > > m_vPath; #ifdef WIN32 @@ -135,6 +136,9 @@ public: SetVariable("MAKE_VERSION",MHMAKEVER); SetVariable(OBJEXTVAR,OBJEXT); SetVariable(EXEEXTVAR,EXEEXT); + m_EnvVarsToIgnore.insert(WC_REVISION); + m_EnvVarsToIgnore.insert(WC_URL); + m_EnvVarsToIgnore.insert(MAKE); } /* Needed if you only want to use the searchcommand and execommand functions */ @@ -151,7 +155,7 @@ public: bool CompareEnv() const; uint32 CreateEnvMd5_32() const; - string GetFromEnv(const string &Var,bool Cache=true) const; + string GetFromEnv(const string &Var, bool *pDefined=NULL) const; void CreateUSED_ENVVARS(); void SetExport(const string & Var, const string & Val); @@ -350,7 +354,7 @@ public: mh_time_t TargetDate=StartBuildTarget(pTarget,bCheckTargetDir); if (!TargetDate.IsDateValid()) TargetDate=WaitBuildTarget(pTarget); - return TargetDate; + return TargetDate; } void BuildDependencies(const refptr &pRule, fileinfo* pTarget, mh_time_t TargetDate, mh_time_t &YoungestDate, bool &MakeTarget); diff --git a/tools/mhmake/src/mhmakelexer.l b/tools/mhmake/src/mhmakelexer.l index 9dc1a23a0..9b933c305 100644 --- a/tools/mhmake/src/mhmakelexer.l +++ b/tools/mhmake/src/mhmakelexer.l @@ -35,7 +35,7 @@ static uint32 LoadMakMd5(fileinfo *pTarget) return Md5_32; if (1!=fread(&Md5_32,sizeof(Md5_32),1,pFile)) { - fclose(pFile); + fclose(pFile); return Md5_32; } pTarget->SetCommandsMd5_32(Md5_32); @@ -71,7 +71,7 @@ static void ReplaceCurlyBraces(string &String) Pos=0; while ((Pos=String.find_first_of('}',Pos))!=(int)string::npos) String.replace(Pos,1,1,')'); - } + } } #include "mhmakeparser.hpp" @@ -247,6 +247,13 @@ load_makefile { return yy::mhmakeparser::token::SPACE; } + /*---------------------------------------------------------------------------*/ +[ \t]*override[ \t]* { + // override is not supported by mhmake, it is the default behavior + PRINTF(("%s %d: SPACE (ignoring override):\n",m_InputFileName.c_str(),lineno())); + return yy::mhmakeparser::token::SPACE; +} + /*---------------------------------------------------------------------------*/ [ \t]*=[ \t]*\\[ \t\r]*\n[ \t]* { PRINTF(("%s %d: EQUAL: %s\n",m_InputFileName.c_str(),lineno(),yytext)); @@ -297,6 +304,12 @@ load_makefile { return yy::mhmakeparser::token::PEQUAL; } + /*---------------------------------------------------------------------------*/ +\\; { + PRINTF(("%s %d: -Escaped SEMICOLON (STRING): %s\n",m_InputFileName.c_str(),lineno(),yytext)); + yylval->theString=(const char *)yytext+1; + return yy::mhmakeparser::token::STRING; +} /*---------------------------------------------------------------------------*/ [ \t]*;[ \t]*\\[ \t\r]*\n[ \t]* { PRINTF(("%s %d: -SEMICOLON (NEWLINE): %s\n",m_InputFileName.c_str(),lineno(),yytext)); @@ -595,7 +608,7 @@ load_makefile { } /*---------------------------------------------------------------------------*/ -[a-zA-Z]+ /* skip */ +[a-zA-Z]+ /* skip */ /*---------------------------------------------------------------------------*/ [^a-zA-Z\n]+ /* skip */ /*---------------------------------------------------------------------------*/ @@ -631,6 +644,12 @@ load_makefile { return yy::mhmakeparser::token::AUTODEPS; } + /*---------------------------------------------------------------------------*/ +\.ENVVARS_TOIGNORE { + PRINTF(("%s %d: .ENVVARS_TOIGNORE: %s\n",m_InputFileName.c_str(),lineno(),yytext)); + return yy::mhmakeparser::token::ENVVARS_TOIGNORE; +} + /*---------------------------------------------------------------------------*/ export { PRINTF(("%s %d: export: %s\n",m_InputFileName.c_str(),lineno(),yytext)); @@ -842,7 +861,7 @@ export { [^\\\'\r\n$]+ | [\\\$] | -\\\' | +\\\' | \\# { yymore(); } diff --git a/tools/mhmake/src/mhmakeparser.y b/tools/mhmake/src/mhmakeparser.y index 847cda48a..d8edb1d51 100644 --- a/tools/mhmake/src/mhmakeparser.y +++ b/tools/mhmake/src/mhmakeparser.y @@ -53,7 +53,7 @@ const char Test[]="dit is een test"; %token COMMAND %token COMMA %token STRING DOLLAREXPR EQUAL COLON DOUBLECOLON VARDEF VARVAL -%token IMEQUAL PEQUAL OPTEQUAL PHONY AUTODEPS EXPORT NEWLINE INCLUDEMAK SPACE VPATH +%token IMEQUAL PEQUAL OPTEQUAL PHONY AUTODEPS EXPORT NEWLINE INCLUDEMAK SPACE VPATH ENVVARS_TOIGNORE %type expression nonspaceexpression simpleexpression %type maybeemptyexpression @@ -92,6 +92,7 @@ statement: NEWLINE | ruledef | phonyrule | autodepsrule | + envvarstoignorerule | varassignment | imvarassignment | pvarassignment | @@ -179,6 +180,26 @@ autodepsrule: AUTODEPS COLON expression NEWLINE ; +envvarstoignorerule: ENVVARS_TOIGNORE COLON expression + { + string VarsStr=m_pMakefile->ExpandExpression($3); + PRINTF(("Defining envvarstoignore rule : %s\n",$3.c_str())); + PRINTF((" Expanded to : %s\n",m_pMakefile->ExpandExpression($3).c_str())); + const char *pTmp=VarsStr.c_str(); + while (*pTmp) + { + string Var; + pTmp=NextItem(pTmp,Var); + if (!Var.empty()) + { // Add it to the list of env vars to ignore + m_pMakefile->m_EnvVarsToIgnore.insert(Var); + } + } + } + NEWLINE +; + + exportrule: EXPORT space exportstrings NEWLINE | EXPORT space STRING EQUAL maybeemptyexpression { diff --git a/tools/mhmake/src/rule.h b/tools/mhmake/src/rule.h index 7cc287600..04827b129 100644 --- a/tools/mhmake/src/rule.h +++ b/tools/mhmake/src/rule.h @@ -82,7 +82,7 @@ class IMPLICITRULE static set m_ImplicitRuleRecurseDetStack; static vector m_ImplicitRules; // Use a vector and not a map because the order of the implicit rules is important public: - static void AddImplicitRule(fileinfo *pTarget,const vector &Deps, refptr pRule); + static void AddImplicitRule(fileinfo *pTarget,const vector &Deps,refptr pRule); static void SearchImplicitRule(const fileinfo *pTarget, implicitruledep_t &Result); static void PrintImplicitRules(); static bool PushRule(rule *pRule) diff --git a/tools/mhmake/src/util.cpp b/tools/mhmake/src/util.cpp index 3e20706dd..9fe006e95 100644 --- a/tools/mhmake/src/util.cpp +++ b/tools/mhmake/src/util.cpp @@ -650,27 +650,7 @@ void loadedmakefile::LoadMakefile() } else { - /* Create a file that is depending on the makefile name and the arguments */ - md5_context ctx; - - md5_starts( &ctx ); - - map::const_iterator pIt=m_CommandLineVars.begin(); - while (pIt!=m_CommandLineVars.end()) - { - if (pIt->first!="MAKE") - { - md5_update(&ctx, (uint8*)pIt->first.c_str(), pIt->first.size()); - md5_update(&ctx, (uint8*)pIt->second.c_str(), pIt->second.size()); - } - pIt++; - } - md5_update(&ctx, (uint8*)m_Makefile->GetFullFileName().c_str(), m_Makefile->GetFullFileName().size()); - - char ID[10]; - sprintf(ID,"_%lx",md5_finish32( &ctx)); - - pDepFile=GetFileInfo(string(".") + m_Makefile->GetName()+ ".dep"+ID,m_MakeDir); + pDepFile=GetFileInfo(string(".") + m_Makefile->GetName()+ ".dep",m_MakeDir); m_pMakefileParser->SetVariable(AUTODEPFILE,pDepFile->GetQuotedFullFileName()); } @@ -683,10 +663,12 @@ void loadedmakefile::LoadMakefile() { throw string("Error parsing ")+m_Makefile->GetQuotedFullFileName(); } + + fileinfo *pMaybeNewDepFile=GetFileInfo(m_pMakefileParser->ExpandVar(AUTODEPFILE),m_MakeDir); #ifdef _DEBUG /* Check if the makefile has changed the AUTODEPFILE variable, if so generate a warning that a * rebuild could happen for the rules defined for making included makefiles */ - if (m_pMakefileParser->ExpandVar(AUTODEPFILE)!=pDepFile->GetQuotedFullFileName()) + if (pMaybeNewDepFile!=pDepFile) { cout << "\n\nWARNING:\n makefile '"<< m_Makefile->GetQuotedFullFileName() <<"' re-defines AUTODEPFILE\n from '"<< pDepFile->GetQuotedFullFileName() <<"'\n to '"<< m_pMakefileParser->ExpandVar(AUTODEPFILE) << "'\n (may cause needless rebuilds when having rules for included makefiles!!!!!)\n\n\n"; @@ -700,6 +682,15 @@ void loadedmakefile::LoadMakefile() cout<<"No First target for "<GetQuotedFullFileName()<Exists()) + m_pMakefileParser->LoadAutoDepsFile(pDepFile); /* If it already exists, load it. */ + } + m_pMakefileParser->UpdateDate(m_Makefile->GetDate()); if (sm_Statics.m_MhMakeConf) diff --git a/tools/mhmake/src/util.h b/tools/mhmake/src/util.h index b4a17a6cf..e7f9ccf57 100644 --- a/tools/mhmake/src/util.h +++ b/tools/mhmake/src/util.h @@ -50,7 +50,7 @@ #define PLATFORM "linux" #endif -#define MHMAKEVER "3.0.15" +#define MHMAKEVER "3.0.19" class makecommand { diff --git a/xorg-server/hw/xwin/xlaunch/main.cc b/xorg-server/hw/xwin/xlaunch/main.cc index 1bdcf6ae3..dcbb36d64 100644 --- a/xorg-server/hw/xwin/xlaunch/main.cc +++ b/xorg-server/hw/xwin/xlaunch/main.cc @@ -35,6 +35,9 @@ #include #include +// Define here because it is not defined in stdlib.h because of the _POSIX_ defined +extern "C" +_Check_return_ _CRTIMP int __cdecl _putenv(_In_z_ const char * _EnvString); #include /// @brief Send WM_ENDSESSION to all program windows. diff --git a/xorg-server/installer/vcxsrv.nsi b/xorg-server/installer/vcxsrv.nsi index a80c7dab5..5cb2cb654 100644 --- a/xorg-server/installer/vcxsrv.nsi +++ b/xorg-server/installer/vcxsrv.nsi @@ -98,7 +98,7 @@ Section "VcXsrv (required)" File "..\swrastwgl_dri_dbg.dll" File "..\dxtn.dll" File "..\..\libxml2\bin\libxml2.dll" - File "..\..\libxml2\bin\zlib1.dll" + File "..\..\zlib\obj\release\zlib1.dll" File "..\..\libxml2\bin\iconv.dll" !ifndef VS2008 File "msvcr100.dll" diff --git a/xorg-server/makefile b/xorg-server/makefile index 6cb0ee817..6e86820d0 100644 --- a/xorg-server/makefile +++ b/xorg-server/makefile @@ -43,16 +43,20 @@ INCLUDELIBFILES = \ $(MHMAKECONF)\libX11\modules\lc\utf8\$(OBJDIR)\libxlcUTF8Load.lib \ $(MHMAKECONF)\libX11\modules\lc\def\$(OBJDIR)\libxlcDef.lib \ $(MHMAKECONF)\libX11\modules\lc\gen\$(OBJDIR)\liblcGenConvLoad.lib \ - $(MHMAKECONF)\zlib\$(OBJDIR)\libz.lib \ $(MHMAKECONF)\libX11\modules\lc\xlocale\$(OBJDIR)\libxlocale.lib \ $(MHMAKECONF)\libfontenc\src\$(OBJDIR)\libfontenc.lib \ $(MHMAKECONF)\libXfont\src\freetype\$(OBJDIR)\libft.lib \ $(MHMAKECONF)\libXfont\src\stubs\$(OBJDIR)\libstubs.lib \ $(MHMAKECONF)\libXinerama\src\$(OBJDIR)\libXinerama.lib +INCLUDENOSERVLIBFILES = \ + $(MHMAKECONF)\zlib\$(NOSERVOBJDIR)\zlib1.lib + LIBDIRS=$(dir $(INCLUDELIBFILES)) +NOSERVLIBDIRS=$(dir $(INCLUDENOSERVLIBFILES)) load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=$(MAKESERVER) DEBUG=$(DEBUG);) +load_makefile $(NOSERVLIBDIRS:%$(NOSERVOBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);) OBJS = dix\$(OBJDIR)\main.obj diff --git a/zlib/Makefile b/zlib/Makefile index 9fecb13ef..69371a621 100644 --- a/zlib/Makefile +++ b/zlib/Makefile @@ -1,4 +1,8 @@ -LIBRARY=libz -CSRCS = adler32.c compress.c crc32.c gzio.c uncompr.c deflate.c trees.c \ - zutil.c inflate.c infback.c inftrees.c inffast.c +SHAREDLIB=zlib1 +DEFFILE = win32\zlib.def +DEFINES += ZLIB_DLL + +CSRCS = adler32.c compress.c crc32.c uncompr.c deflate.c trees.c \ + zutil.c inflate.c infback.c inftrees.c inffast.c gzlib.c \ + gzclose.c gzread.c gzwrite.c -- cgit v1.2.3