From 831d929e8cb588d8021824538c60744306f11b58 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Thu, 28 Oct 2010 20:57:11 +0000 Subject: [PATCH] Cleanup OptionalBuildFeatures and add CLucene as optional build feature / fix dependencies. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39176 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/OptionalBuildFeatures | 124 ++++++++++++------ src/add-ons/index_server/FullText/Jamfile | 13 +- .../index_server/fulltext_search/Jamfile | 21 ++- 3 files changed, 108 insertions(+), 50 deletions(-) diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index c08ebbeb2b..c5f71dee61 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -110,46 +110,6 @@ if $(TARGET_ARCH) = ppc { } -# EtPan - -# Automatically install the EtPan mail lib, when the optional EtPan optional -# package is enabled. -if [ IsOptionalHaikuImagePackageAdded EtPan ] { - HAIKU_BUILD_FEATURE_ETPAN = 1 ; -} - -HAIKU_ETPAN_GCC_2_PACKAGE = etpan-1.0-x86-gcc2-2010-10-20.zip ; -HAIKU_ETPAN_GCC_4_PACKAGE = etpan-1.0-x86-gcc4-2010-10-20.zip ; - -if $(TARGET_ARCH) != x86 { - Echo "EtPan not available for $(TARGET_ARCH)" ; -} else { - local etpan_package ; - if $(HAIKU_GCC_VERSION[1]) = 2 { - etpan_package = $(HAIKU_ETPAN_GCC_2_PACKAGE) ; - } else { - etpan_package = $(HAIKU_ETPAN_GCC_4_PACKAGE) ; - } - - local zipFile = [ DownloadFile $(etpan_package) - : $(baseURL)/$(etpan_package) ] ; - - # zip file and output directory - HAIKU_ETPAN_ZIP_FILE = $(zipFile) ; - HAIKU_ETPAN_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) - $(etpan_package:B) ] ; - - # extract libraries - HAIKU_ETPAN_LIBS = [ ExtractArchive $(HAIKU_ETPAN_DIR) - : - common/lib/libetpan.a - : $(zipFile) - ] ; - HAIKU_ETPAN_HEADERS - = [ FDirName $(HAIKU_ETPAN_DIR) common include ] ; -} - - # zip file and output directory HAIKU_ICU_DEVEL_ZIP_FILE = [ DownloadFile $(HAIKU_ICU_DEVEL_PACKAGE) : $(baseURL)/$(HAIKU_ICU_DEVEL_PACKAGE) ] ; @@ -162,3 +122,87 @@ HAIKU_ICU_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_ICU_DEVEL_DIR) HAIKU_ICU_HEADERS = [ FDirName $(HAIKU_ICU_DEVEL_DIR) develop headers 3rdparty ] ; + + +# EtPan + +# Automatically install the EtPan mail lib, when the optional EtPan optional +# package is enabled. +if [ IsOptionalHaikuImagePackageAdded EtPan ] { + HAIKU_BUILD_FEATURE_ETPAN = 1 ; +} + +HAIKU_ETPAN_GCC_2_PACKAGE = etpan-1.0-x86-gcc2-2010-10-20.zip ; +HAIKU_ETPAN_GCC_4_PACKAGE = etpan-1.0-x86-gcc4-2010-10-20.zip ; + +if $(HAIKU_BUILD_FEATURE_ETPAN) { + if $(TARGET_ARCH) != x86 { + Echo "EtPan not available for $(TARGET_ARCH)" ; + } else { + local etpan_package ; + if $(HAIKU_GCC_VERSION[1]) = 2 { + etpan_package = $(HAIKU_ETPAN_GCC_2_PACKAGE) ; + } else { + etpan_package = $(HAIKU_ETPAN_GCC_4_PACKAGE) ; + } + + local zipFile = [ DownloadFile $(etpan_package) + : $(baseURL)/$(etpan_package) ] ; + + # zip file and output directory + HAIKU_ETPAN_ZIP_FILE = $(zipFile) ; + HAIKU_ETPAN_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) + $(etpan_package:B) ] ; + + # extract libraries + HAIKU_ETPAN_LIBS = [ ExtractArchive $(HAIKU_ETPAN_DIR) + : + common/lib/libetpan.a + : $(zipFile) + ] ; + HAIKU_ETPAN_HEADERS + = [ FDirName $(HAIKU_ETPAN_DIR) common include ] ; + } +} + + +# CLucene + +# Automatically install the CLucene feature, when the optional CLucene optional +# package is enabled. +if [ IsOptionalHaikuImagePackageAdded CLucene ] { + HAIKU_BUILD_FEATURE_CLUCENE = 1 ; +} + +local baseURL = http://haiku-files.org/files/optional-packages ; +HAIKU_CLUCENE_PACKAGE = clucene-0.9.21svn-x86-gcc4-haiku-2009-08-11.zip ; +HAIKU_CLUCENE_URL = $(baseURL)/$(HAIKU_CLUCENE_PACKAGE) ; + +if $(HAIKU_BUILD_FEATURE_CLUCENE) { + if $(TARGET_ARCH) != x86 { + Echo "CLucene build feature not available for $(TARGET_ARCH)" ; + } else { + # Download the zip archive. + local zipFile = [ DownloadFile $(HAIKU_CLUCENE_PACKAGE) + : $(HAIKU_CLUCENE_URL) ] ; + + # zip file and output directory + HAIKU_CLUCENE_ZIP_FILE = $(zipFile) ; + HAIKU_CLUCENE_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) + $(HAIKU_CLUCENE_PACKAGE:B) ] ; + + # extract headers and libraries + HAIKU_CLUCENE_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_CLUCENE_DIR) + : common/include/ : $(zipFile) + ] ; + + HAIKU_CLUCENE_LIBS = [ ExtractArchive $(HAIKU_CLUCENE_DIR) + : + common/lib/libclucene.a + : $(zipFile) + ] ; + + HAIKU_CLUCENE_HEADERS + = [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ; + } +} diff --git a/src/add-ons/index_server/FullText/Jamfile b/src/add-ons/index_server/FullText/Jamfile index 46a910de68..c35bb7d23e 100644 --- a/src/add-ons/index_server/FullText/Jamfile +++ b/src/add-ons/index_server/FullText/Jamfile @@ -2,13 +2,20 @@ SubDir HAIKU_TOP src add-ons index_server FullText ; UsePrivateHeaders index_server shared ; -SubDirSysHdrs $(HAIKU_CLUCENE_HEADERS) ; - -Addon FullTextAnalyser : +local sources = CLuceneDataBase.cpp FullTextAnalyser.cpp IndexServerAddOn.cpp + ; + +SubDirSysHdrs $(HAIKU_CLUCENE_HEADERS) ; +Includes [ FGristFiles $(sources) ] : $(HAIKU_CLUCENE_HEADERS_DEPENDENCY) ; + # Dependency needed to trigger downloading/unzipping the package before + # compiling the files. + +Addon FullTextAnalyser : + $(sources) : be translation $(HAIKU_CLUCENE_LIBS) $(TARGET_LIBSTDC++) ; diff --git a/src/tests/add-ons/index_server/fulltext_search/Jamfile b/src/tests/add-ons/index_server/fulltext_search/Jamfile index 39eff10967..8ef8bac1cc 100644 --- a/src/tests/add-ons/index_server/fulltext_search/Jamfile +++ b/src/tests/add-ons/index_server/fulltext_search/Jamfile @@ -1,13 +1,20 @@ SubDir HAIKU_TOP src tests add-ons index_server fulltext_search ; -UsePrivateHeaders index_server shared ; -SubDirSysHdrs $(HAIKU_CLUCENE_HEADERS) ; - - -Application FullTextSearch : +local sources = BeaconSearcher.cpp main.cpp SearchWindow.cpp - : be $(HAIKU_CLUCENE_LIBS) $(TARGET_LIBSTDC++) -# : Sudoku.rdef + ; + +UsePrivateHeaders index_server shared ; +SubDirSysHdrs $(HAIKU_CLUCENE_HEADERS) ; +local cluceneSources ; +Includes [ FGristFiles $(sources) ] : $(HAIKU_CLUCENE_HEADERS_DEPENDENCY) ; + # Dependency needed to trigger downloading/unzipping the package before + # compiling the files. + +Application FullTextSearch : + $(sources) + : + be $(HAIKU_CLUCENE_LIBS) $(TARGET_LIBSTDC++) ;