From 3264a77eada6ca0c761f4bd3e74196723bb99882 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 15 Feb 2012 01:06:47 +0000 Subject: [PATCH] [ENHANCEMENT] (Author: Dave Brotherstone) Enhance Scintilla compiling script for PCRE support. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@864 f5eea248-9336-0410-98b8-ebc06183d4e3 --- scintilla/boostregex/BuildBoost.bat | 30 +++++++++++++++++++-------- scintilla/boostregex/nppSpecifics.mak | 25 +++++++++++++++++++--- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/scintilla/boostregex/BuildBoost.bat b/scintilla/boostregex/BuildBoost.bat index ac53449f3..1183443e3 100644 --- a/scintilla/boostregex/BuildBoost.bat +++ b/scintilla/boostregex/BuildBoost.bat @@ -15,6 +15,7 @@ IF NOT EXIST "%BOOSTPATH%\bjam\bin\bjam.exe" ( CALL bootstrap.bat %BOOSTPATH%\tools\build\v2\b2 --prefix=%BOOSTPATH%\bjam install + POPD ) IF NOT ERRORLEVEL 0 ( @@ -24,7 +25,7 @@ IF NOT ERRORLEVEL 0 ( ECHO. ECHO Building Boost::regex -CD %BOOSTPATH%\libs\regex\build +PUSHD %BOOSTPATH%\libs\regex\build %BOOSTPATH%\bjam\bin\bjam variant=release threading=multi link=static runtime-link=static IF NOT ERRORLEVEL 0 ( @@ -36,18 +37,29 @@ IF NOT ERRORLEVEL 0 ( GOTO BUILDERROR ) -IF EXIST "%BOOSTPATH%\bin.v2\libs\regex\build\msvc-8.0" ( - SET BOOSTVSVERPATH=%BOOSTPATH%\bin.v2\libs\regex\build\msvc-8.0 -) ELSE IF EXIST "%BOOSTPATH%\bin.v2\libs\regex\build\msvc-9.0" ( - SET BOOSTVSVERPATH=%BOOSTPATH%\bin.v2\libs\regex\build\msvc-9.0 -) ELSE IF EXIST "%BOOSTPATH%\bin.v2\libs\regex\build\msvc-10.0" ( - SET BOOSTVSVERPATH=%BOOSTPATH%\bin.v2\libs\regex\build\msvc-10.0 +:: VS2010 +IF EXIST %BOOSTPATH%\bin.v2\libs\regex\build\msvc-10.0\release\link-static\runtime-link-static\threading-multi\libboost_regex-vc100-mt-s-1_48.lib ( + SET BOOSTLIBPATH=%BOOSTPATH%\bin.v2\libs\regex\build\msvc-10.0 +) + +:: VS2008 +IF EXIST %BOOSTPATH%\bin.v2\libs\regex\build\msvc-9.0\release\link-static\runtime-link-static\threading-multi\libboost_regex-vc90-mt-s-1_48.lib ( + SET BOOSTLIBPATH=%BOOSTPATH%\bin.v2\libs\regex\build\msvc-9.0 +) + +:: VS2005 +IF EXIST %BOOSTPATH%\bin.v2\libs\regex\build\msvc-8.0\release\link-static\runtime-link-static\threading-multi\libboost_regex-vc80-mt-s-1_48.lib ( + SET BOOSTLIBPATH=%BOOSTPATH%\bin.v2\libs\regex\build\msvc-8.0 +) + +:: Error case, so we try to give the user a helpful error message +IF [%BOOSTLIBPATH%] == [] ( + SET BOOSTLIBPATH=no_boost_library_found__Set_BoostLibPath_in_BoostPath.mak__Should_be_under_%BOOSTPATH%\bin.v2\libs\regex\build\_something_ ) ECHO # Autogenerated file, run BuildBoost.bat [path_to_boost] to generate > %~dp0%\boostpath.mak ECHO BOOSTPATH=%BOOSTPATH% >> %~dp0%\boostpath.mak -ECHO BOOSTVSVERPATH=%BOOSTVSVERPATH% >> %~dp0%\boostpath.mak - +ECHO BOOSTLIBPATH=%BOOSTLIBPATH% >> %~dp0%\boostpath.mak POPD ECHO Boost::regex built. diff --git a/scintilla/boostregex/nppSpecifics.mak b/scintilla/boostregex/nppSpecifics.mak index 422f3724c..3bdf6ceac 100644 --- a/scintilla/boostregex/nppSpecifics.mak +++ b/scintilla/boostregex/nppSpecifics.mak @@ -26,9 +26,9 @@ INCLUDEDIRS=$(INCLUDEDIRS) -I$(BOOSTPATH) CXXFLAGS=$(CXXFLAGS) -DSCI_OWNREGEX !IFDEF DEBUG -LDFLAGS=$(LDFLAGS) -LIBPATH:$(BOOSTVSVERPATH)\debug\link-static\runtime-link-static\threading-multi +LDFLAGS=$(LDFLAGS) -LIBPATH:$(BOOSTLIBPATH)\debug\link-static\runtime-link-static\threading-multi !ELSE -LDFLAGS=$(LDFLAGS) -LIBPATH:$(BOOSTVSVERPATH)\release\link-static\runtime-link-static\threading-multi +LDFLAGS=$(LDFLAGS) -LIBPATH:$(BOOSTLIBPATH)\release\link-static\runtime-link-static\threading-multi !ENDIF @@ -39,6 +39,25 @@ $(DIR_O)\UTF8DocumentIterator.obj:: ../boostregex/UTF8DocumentIterator.cxx $(DIR_O)\BoostRegexSearch.obj:: ../boostregex/BoostRegexSearch.cxx ../src/CharClassify.h ../src/RESearch.h $(CC) $(CXXFLAGS) -c ../boostregex/BoostRegexSearch.cxx +!ELSE + +!IFDEF NOBOOST +!MESSAGE Note: Building without Boost-Regex support. +!ELSE +!MESSAGE Note: It looks like you've not built boost yet. +!MESSAGE You can build boost::regex by running BuildBoost.bat +!MESSAGE from scintilla\BoostRegex directory with the path where +!MESSAGE you have extracted the boost archive (from www.boost.org) +!MESSAGE e.g. +!MESSAGE buildboost.bat d:\libs\boost_1_48_0 +!MESSAGE +!MESSAGE If you want to build scintilla without Boost (and just +!MESSAGE use the limited built-in regular expressions), +!MESSAGE then run nmake again, with NOBOOST=1 +!MESSAGE e.g. +!MESSAGE nmake NOBOOST=1 -f scintilla.mak +!MESSAGE +!ERROR Stopping build. Either build boost or specify NOBOOST=1 !ENDIF - +!ENDIF