mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-24 19:02:56 +08:00
Compare commits
32 Commits
core-linux
...
v4.5.dev.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a75916944 | |||
| da45eb4f33 | |||
| 59d75ed148 | |||
| ccc4d751d0 | |||
| a020d3dbf9 | |||
| 7852b7fbe8 | |||
| a64fd8792d | |||
| 32448298a3 | |||
| b3384f1466 | |||
| 93274395a9 | |||
| 2726e14445 | |||
| 75e32a1562 | |||
| 8c2637b89c | |||
| ef389872df | |||
| 6fc611fdfc | |||
| 0cabb63336 | |||
| f501bf7930 | |||
| 7b617dc9e9 | |||
| 245f989ae3 | |||
| 429729b979 | |||
| d709652992 | |||
| 776d799fd2 | |||
| a975cb8261 | |||
| c932b5af26 | |||
| 423e8dda86 | |||
| afcf6b079e | |||
| 3ed2224f93 | |||
| 5307855120 | |||
| 3c9a91af45 | |||
| 9f06f94c93 | |||
| 4954ef2934 | |||
| 721e8800f1 |
@ -49,8 +49,8 @@
|
||||
6967917D1D9E8AEE002CA4BA /* BinReaderWriterDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 696791791D9E8AEE002CA4BA /* BinReaderWriterDefines.h */; };
|
||||
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967917A1D9E8AEE002CA4BA /* BinWriters.cpp */; };
|
||||
6967917F1D9E8AEE002CA4BA /* BinWriters.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967917B1D9E8AEE002CA4BA /* BinWriters.h */; };
|
||||
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */; };
|
||||
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 69F181AD1C77274E00B2952B /* FileDownloader.h */; };
|
||||
69F181B51C77276D00B2952B /* FileDownloader_curl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -97,8 +97,8 @@
|
||||
696791791D9E8AEE002CA4BA /* BinReaderWriterDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinReaderWriterDefines.h; path = ../../BinWriter/BinReaderWriterDefines.h; sourceTree = "<group>"; };
|
||||
6967917A1D9E8AEE002CA4BA /* BinWriters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BinWriters.cpp; path = ../../BinWriter/BinWriters.cpp; sourceTree = "<group>"; };
|
||||
6967917B1D9E8AEE002CA4BA /* BinWriters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinWriters.h; path = ../../BinWriter/BinWriters.h; sourceTree = "<group>"; };
|
||||
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; name = FileDownloader_mac.mm; path = ../../../Common/FileDownloader/FileDownloader_mac.mm; sourceTree = "<group>"; };
|
||||
69F181AD1C77274E00B2952B /* FileDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader.h; path = ../../../Common/FileDownloader/FileDownloader.h; sourceTree = "<group>"; };
|
||||
69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileDownloader_curl.cpp; path = ../../../Common/FileDownloader/FileDownloader_curl.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -230,7 +230,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69F181AD1C77274E00B2952B /* FileDownloader.h */,
|
||||
69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */,
|
||||
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */,
|
||||
);
|
||||
name = Common;
|
||||
sourceTree = "<group>";
|
||||
@ -339,7 +339,6 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
69F181B51C77276D00B2952B /* FileDownloader_curl.cpp in Sources */,
|
||||
17C1FE961ACC42C4006B99B3 /* Common.cpp in Sources */,
|
||||
17C1FE971ACC42C4006B99B3 /* ChartFromToBinary.cpp in Sources */,
|
||||
17C1FE981ACC42C4006B99B3 /* CSVReader.cpp in Sources */,
|
||||
@ -348,6 +347,7 @@
|
||||
17C1FE9B1ACC42C4006B99B3 /* CSVWriter.cpp in Sources */,
|
||||
69414A301CB51666003E771B /* ChartWriter.cpp in Sources */,
|
||||
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */,
|
||||
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */,
|
||||
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
|
||||
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
|
||||
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
|
||||
@ -379,6 +379,7 @@
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@ -416,6 +417,7 @@
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
|
||||
@ -189,14 +189,14 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->hyperlinks_.str();
|
||||
}
|
||||
}
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}//props выше legacyDrawing !!
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (impl_->commentsId_.length()>0)
|
||||
{
|
||||
CP_XML_NODE(L"legacyDrawing")
|
||||
|
||||
@ -601,12 +601,14 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
|
||||
CSlideInfo* pNotesWrapper = &m_arNotesWrapper.back();
|
||||
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty())
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
else
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
pNotesWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
//грузим placeholder
|
||||
pNotesWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
|
||||
|
||||
std::vector<CRecordNotesAtom*> oArrayNotesAtoms;
|
||||
@ -627,6 +629,9 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
//????? у заметок нет слайда !!!
|
||||
}
|
||||
//-----------------------------------------------------
|
||||
size_t index = pPairSlide->second->m_Index;
|
||||
if (index >= m_arSlides.size())
|
||||
return;
|
||||
CSlide* pSlide = m_arSlides[pPairSlide->second->m_Index];
|
||||
|
||||
pNotes->m_lSlideID = pPairSlide->second->m_Index;
|
||||
@ -796,12 +801,14 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
CSlideInfo* pSlideWrapper = &m_arSlideWrapper.back();
|
||||
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty())
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
else
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
|
||||
pSlideWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
// вот, грузим placeholder
|
||||
pSlideWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
|
||||
|
||||
// записываем шрифты
|
||||
@ -1402,7 +1409,11 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
indexUser = pPairMaster1->second->m_IndexUser;
|
||||
pMasterWrapper->m_arTextPlaceHolders = pPairMaster1->second->m_oPersist.m_arTextAttrs;
|
||||
}
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty() == false)
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
else
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
|
||||
pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
// читаем настройки текстовых стилей -----------------------------------------------
|
||||
@ -1784,11 +1795,13 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
CSlideInfo* pMasterWrapper = &m_arMasterWrapper[m_arMasterWrapper.size() - 1];
|
||||
|
||||
// вот, грузим placeholder
|
||||
pMasterWrapper->m_arTextPlaceHolders = pCurMaster->m_oPersist.m_arTextAttrs;
|
||||
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures;
|
||||
pMasterWrapper->m_arTextPlaceHolders = pCurMaster->m_oPersist.m_arTextAttrs;
|
||||
pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
if (m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures.empty() == false)
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures;
|
||||
else
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
|
||||
std::map<DWORD, LONG>::iterator pPairTheme = m_mapMasterToTheme.find(dwID);
|
||||
|
||||
|
||||
@ -232,10 +232,12 @@ void CPPTFileReader::ReadPictures()
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (pStream->isEOF())
|
||||
break;
|
||||
//if (pStream->isEOF()) случаются неверно записанные стримы
|
||||
// break;
|
||||
|
||||
int pos = pStream->getStreamPointer();
|
||||
if (pos >= pStream->getStreamSize())
|
||||
break;
|
||||
|
||||
SRecordHeader oHeader;
|
||||
if (pDecryptor)
|
||||
@ -256,6 +258,9 @@ void CPPTFileReader::ReadPictures()
|
||||
else
|
||||
oHeader.ReadFromStream(pStream->stream_);
|
||||
|
||||
if (oHeader.RecType == 0 && oHeader.RecLen == 0 )
|
||||
break;// окончание стрима забито нулями (выравнивание)
|
||||
|
||||
CRecordOfficeArtBlip art_blip;
|
||||
art_blip.m_strTmpDirectory = m_strTmpDirectory;
|
||||
art_blip.m_oDocumentInfo = &m_oDocumentInfo;
|
||||
|
||||
@ -250,12 +250,26 @@ namespace PPTX
|
||||
}
|
||||
else if (L"oleObj" == strName)
|
||||
{
|
||||
olePic = oNode.ReadNode(L"p:pic");
|
||||
olePic = oNode.ReadNode(L"p:pic"); //нормальный вариант объекта
|
||||
if (olePic.IsInit())
|
||||
{
|
||||
olePic->fromXMLOle(oNode);
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
olePic.Init(); //старый вариант описания объекта через spid в VmlDrawing
|
||||
olePic->spPr.xfrm;
|
||||
|
||||
Logic::PrstGeom* geom = new Logic::PrstGeom();
|
||||
geom->prst = L"rect";
|
||||
olePic->spPr.Geometry.m_geometry.reset(geom);
|
||||
|
||||
olePic->fromXMLOle(oNode);
|
||||
result = true;
|
||||
}
|
||||
if (olePic->spPr.xfrm.IsInit() == false)
|
||||
olePic->spPr.xfrm = xfrm;
|
||||
}
|
||||
else if (L"AlternateContent" == strName)
|
||||
{
|
||||
|
||||
@ -619,6 +619,45 @@ namespace PPTX
|
||||
if(oleObject.IsInit())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_OLE);
|
||||
|
||||
if (oleObject->m_sShapeId.IsInit() && (!blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty()) &&
|
||||
parentFileIs<PPTX::Slide>() && parentFileAs<PPTX::Slide>().Vml.IsInit())
|
||||
{
|
||||
OOX::CVmlDrawing *pVml = parentFileAs<PPTX::Slide>().Vml.operator->();
|
||||
|
||||
std::map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pPair = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
|
||||
if (pVml->m_mapShapes.end() != pPair)
|
||||
{
|
||||
pPair->second.bUsed = true;
|
||||
OOX::Vml::CShape* pShape = dynamic_cast<OOX::Vml::CShape*>(pPair->second.pElement);
|
||||
for(size_t j = 0; (pShape) && (j < pShape->m_arrItems.size()); ++j)
|
||||
{
|
||||
OOX::WritingElement* pChildElemShape = pShape->m_arrItems[j];
|
||||
if(OOX::et_v_imagedata == pChildElemShape->getType())
|
||||
{
|
||||
OOX::Vml::CImageData* pImageData = static_cast<OOX::Vml::CImageData*>(pChildElemShape);
|
||||
|
||||
std::wstring sIdImageFileCache;
|
||||
|
||||
if (pImageData->m_oRelId.IsInit()) sIdImageFileCache = pImageData->m_oRelId->GetValue();
|
||||
else if (pImageData->m_rId.IsInit()) sIdImageFileCache = pImageData->m_rId->GetValue();
|
||||
|
||||
if (!sIdImageFileCache.empty())
|
||||
{
|
||||
//ищем физический файл ( rId относительно vml_drawing)
|
||||
smart_ptr<OOX::File> pFile = pVml->Find(sIdImageFileCache);
|
||||
|
||||
if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type()))
|
||||
{
|
||||
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.operator->());
|
||||
|
||||
blipFill.blip->oleFilepathImage = pImageFileCache->filename().GetPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (nvPicPr.nvPr.media.is_init())
|
||||
{
|
||||
@ -630,10 +669,17 @@ namespace PPTX
|
||||
blipFill.blip->mediaFilepath = mediaFile->filename().GetPath();
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
|
||||
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
|
||||
}
|
||||
else if (nvPicPr.nvPr.media.is<WavAudioFile>() || nvPicPr.nvPr.media.is<AudioCD>())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
|
||||
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
|
||||
}
|
||||
else
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
@ -1338,6 +1384,7 @@ namespace PPTX
|
||||
blipFill.blip.Init();
|
||||
blipFill.blip->oleRid = oleObject->m_oId->get();
|
||||
}
|
||||
node.ReadAttributeBase(L"spid", oleObject->m_sShapeId);
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -259,7 +259,7 @@ namespace PPTX
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, bool in_group = false);
|
||||
//----------------------------------------------------------------------
|
||||
NvPicPr nvPicPr;
|
||||
BlipFill blipFill;
|
||||
mutable BlipFill blipFill;
|
||||
SpPr spPr;
|
||||
nullable<ShapeStyle> style;
|
||||
//internal
|
||||
|
||||
@ -35,11 +35,11 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
DbOrParamQry::DbOrParamQry()
|
||||
DbOrParamQry::DbOrParamQry(int typeRecord_)
|
||||
{
|
||||
typeRecord = typeRecord_;
|
||||
}
|
||||
|
||||
|
||||
DbOrParamQry::~DbOrParamQry()
|
||||
{
|
||||
}
|
||||
@ -52,10 +52,32 @@ BaseObjectPtr DbOrParamQry::clone()
|
||||
|
||||
void DbOrParamQry::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### DbOrParamQry record is not implemented")
|
||||
Log::error("DbOrParamQry record is not implemented.");
|
||||
size_t size = record.getDataSize() - record.getRdPtr();
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
if (typeRecord == 1)
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
record >> param.wTypeSql >> flags >> param.grbit >> param.fVal;
|
||||
|
||||
param.pbt = GETBITS(flags, 0, 1);
|
||||
param.fNonDefaultName = GETBIT(flags, 2);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
record >> flags >> query.cparams >> query.cstQuery >> query.cstWebPost >> query.cstSQLSav >> query.cstOdbcConn;
|
||||
|
||||
query.dbt = GETBITS(flags, 0, 2);
|
||||
query.fOdbcConn = GETBIT(flags, 3);
|
||||
query.fSql = GETBIT(flags, 4);
|
||||
query.fSqlSav = GETBIT(flags, 5);
|
||||
query.fWeb = GETBIT(flags, 6);
|
||||
query.fSavePwd = GETBIT(flags, 7);
|
||||
query.fTablesOnlyHTML = GETBIT(flags, 8);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,24 +36,48 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DbOrParamQry record in BIFF8
|
||||
class DbOrParamQry: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(DbOrParamQry)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DbOrParamQry)
|
||||
public:
|
||||
DbOrParamQry();
|
||||
DbOrParamQry(int typeRecord = 2);
|
||||
~DbOrParamQry();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeDbOrParamQry;
|
||||
static const ElementType type = typeDbOrParamQry;
|
||||
|
||||
int typeRecord;
|
||||
|
||||
//PARAMQRY_Fixed - 8 bytes + variable
|
||||
struct
|
||||
{
|
||||
unsigned short wTypeSql;
|
||||
unsigned char pbt;
|
||||
bool fNonDefaultName;
|
||||
unsigned short grbit;
|
||||
unsigned short fVal;
|
||||
}param;
|
||||
|
||||
//---------------------------------------
|
||||
struct
|
||||
{
|
||||
unsigned char dbt;
|
||||
bool fOdbcConn;
|
||||
bool fSql;
|
||||
bool fSqlSav;
|
||||
bool fWeb;
|
||||
bool fSavePwd;
|
||||
bool fTablesOnlyHTML;
|
||||
short cparams;
|
||||
short cstQuery;
|
||||
short cstWebPost;
|
||||
short cstSQLSav;
|
||||
short cstOdbcConn;
|
||||
}query;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -52,24 +52,13 @@ BaseObjectPtr SXDBB::clone()
|
||||
|
||||
void SXDBB::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned int sz = record.getDataSize() - record.getRdPtr();
|
||||
size = record.getDataSize() - record.getRdPtr();
|
||||
|
||||
//std::list<CFRecordPtr>& recs = continue_records[rt_Continue];
|
||||
blob = boost::shared_array<unsigned char>(new unsigned char[size]);
|
||||
|
||||
//while (record.getRdPtr() + lcb > record.getDataSize() && !recs.empty())
|
||||
//{
|
||||
// record.appendRawData(recs.front());
|
||||
// recs.pop_front();
|
||||
//}
|
||||
memcpy(blob.get(), record.getCurData<unsigned char>(), size);
|
||||
|
||||
if (record.checkFitReadSafe(sz))
|
||||
{
|
||||
blob = boost::shared_array<char>(new char[sz]);
|
||||
|
||||
memcpy(blob.get(), record.getCurData<char>(), sz);
|
||||
|
||||
record.skipNunBytes(sz);
|
||||
}
|
||||
record.skipNunBytes(size);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -50,7 +50,8 @@ public:
|
||||
|
||||
static const ElementType type = typeSXDBB;
|
||||
|
||||
boost::shared_array<char> blob;
|
||||
boost::shared_array<unsigned char> blob;
|
||||
unsigned int size;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -39,12 +39,10 @@ SXDI::SXDI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SXDI::~SXDI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr SXDI::clone()
|
||||
{
|
||||
return BaseObjectPtr(new SXDI(*this));
|
||||
@ -61,5 +59,22 @@ void SXDI::readFields(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
int SXDI::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"dataField")
|
||||
{
|
||||
if (stName.value().empty() == false)
|
||||
CP_XML_ATTR(L"name", stName.value());
|
||||
|
||||
CP_XML_ATTR(L"fld", isxvdData);
|
||||
CP_XML_ATTR(L"baseField", df);
|
||||
CP_XML_ATTR(L"baseItem", isxvi);
|
||||
CP_XML_ATTR(L"numFmtId", ifmt);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,6 +49,8 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSXDI;
|
||||
|
||||
short isxvdData;
|
||||
|
||||
@ -53,6 +53,15 @@ void SXDtr::readFields(CFRecord& record)
|
||||
{
|
||||
record >> yr >> mon >> dom >> hr >> min >> sec;
|
||||
}
|
||||
|
||||
std::wstring SXDtr::get_string_date()
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << yr << L"-" << (mon < 10 ? L"0" : L"") << mon << L"-" << (dom < 10 ? L"0" : L"") << dom << L"T"
|
||||
<< (hr < 10 ? L"0" : L"") << hr << L":" << (min < 10 ? L"0" : L"") << min << L":" << (sec < 10 ? L"0" : L"") << sec;
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
int SXDtr::serialize(std::wostream & strm)
|
||||
{
|
||||
@ -60,10 +69,8 @@ int SXDtr::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"d")
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << yr << L"-" << mon << L"-" << dom << L"T" << hr << L":" << min << L":" << sec;
|
||||
|
||||
CP_XML_ATTR(L"v", s.str());
|
||||
CP_XML_ATTR(L"v", get_string_date());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -59,6 +59,8 @@ public:
|
||||
unsigned char min;
|
||||
unsigned char sec;
|
||||
|
||||
std::wstring get_string_date();
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -69,6 +69,11 @@ void SXFDB::readFields(CFRecord& record)
|
||||
fServerBased = GETBIT(flags, 13);
|
||||
fCantGetUniqueItems = GETBIT(flags, 14);
|
||||
fCalculatedField = GETBIT(flags, 15);
|
||||
|
||||
GlobalWorkbookInfoPtr global_info = record.getGlobalWorkbookInfo();
|
||||
|
||||
global_info->arPivotCacheFieldShortSize.push_back(fShortIitms);
|
||||
global_info->arPivotCacheFields.push_back(fAllAtoms);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -51,6 +51,9 @@ BaseObjectPtr SXFormula::clone()
|
||||
|
||||
void SXFormula::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short reserved;
|
||||
|
||||
record >> reserved >> ifdb;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -50,7 +50,7 @@ public:
|
||||
|
||||
static const ElementType type = typeSXFormula;
|
||||
|
||||
|
||||
short ifdb;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -35,8 +35,9 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
SXLI::SXLI()
|
||||
SXLI::SXLI(int count_)
|
||||
{
|
||||
count = count_;
|
||||
}
|
||||
|
||||
|
||||
@ -50,17 +51,15 @@ BaseObjectPtr SXLI::clone()
|
||||
}
|
||||
|
||||
void SXLI::readFields(CFRecord& record)
|
||||
{// 0 or 2 records SXLIItem
|
||||
int size_item = (record.getDataSize() - record.getRdPtr()) / 2;
|
||||
|
||||
if (size_item < 8)
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
//??
|
||||
return;
|
||||
}
|
||||
int size_item = record.getDataSize() - record.getRdPtr();
|
||||
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
if (size_item < 8)
|
||||
{
|
||||
break;
|
||||
}
|
||||
SXLIItem item;
|
||||
|
||||
unsigned short flags;
|
||||
@ -74,13 +73,24 @@ void SXLI::readFields(CFRecord& record)
|
||||
item.fGrand = GETBIT(flags, 11);
|
||||
item.fMultiDataOnAxis = GETBIT(flags, 12);
|
||||
|
||||
int count = (size_item - 8) / 2;
|
||||
if (item.fGrand)
|
||||
item.isxviMac = 1;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
if (item.cSic > item.isxviMac)
|
||||
item.cSic = item.isxviMac;
|
||||
|
||||
if (item.fSbt && item.itmType < 0x000D)
|
||||
item.isxviMac++;
|
||||
|
||||
for (short i = 0; i < count/*item.isxviMac*/; i++)
|
||||
{
|
||||
short val; record >> val;
|
||||
item.rgisxvi.push_back(val);
|
||||
if (val >= 0x0000 && val <= 0x7EF4)
|
||||
{
|
||||
item.rgisxvi.push_back(val);
|
||||
}
|
||||
}
|
||||
|
||||
m_arItems.push_back(item);
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ class SXLI: public BiffRecordContinued
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SXLI)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SXLI)
|
||||
public:
|
||||
SXLI();
|
||||
SXLI(int count_);
|
||||
~SXLI();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
@ -65,6 +65,7 @@ public:
|
||||
static const ElementType type = typeSXLI;
|
||||
|
||||
std::vector<SXLIItem> m_arItems;
|
||||
int count;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "SXString.h"
|
||||
|
||||
#include "../../../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -39,12 +39,10 @@ SXString::SXString()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SXString::~SXString()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr SXString::clone()
|
||||
{
|
||||
return BaseObjectPtr(new SXString(*this));
|
||||
@ -73,5 +71,15 @@ int SXString::serialize(std::wostream & strm)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::wstring SXString::value()
|
||||
{
|
||||
std::wstring s = segment.value();
|
||||
XmlUtils::replace_all(s, L"\x0d", L"_x000d_");
|
||||
XmlUtils::replace_all(s, L"\x0a", L"_x000a_");
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,6 +49,8 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
std::wstring value();
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSXString;
|
||||
|
||||
@ -57,8 +57,8 @@ void SXVI::readFields(CFRecord& record)
|
||||
|
||||
fHidden = GETBIT(flags, 0);
|
||||
fHideDetail = GETBIT(flags, 1);
|
||||
fFormula = GETBIT(flags, 4);
|
||||
fMissing = GETBIT(flags, 5);
|
||||
fFormula = GETBIT(flags, 3);
|
||||
fMissing = GETBIT(flags, 4);
|
||||
|
||||
if (cchName > 0 && cchName < 0xFFFF)
|
||||
{
|
||||
@ -67,6 +67,39 @@ void SXVI::readFields(CFRecord& record)
|
||||
|
||||
}
|
||||
}
|
||||
int SXVI::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"item")
|
||||
{
|
||||
if (fMissing) CP_XML_ATTR(L"m", 1);
|
||||
if (fHidden) CP_XML_ATTR(L"h", 1);
|
||||
if (fHideDetail)CP_XML_ATTR(L"sd", 1);
|
||||
if (fFormula) CP_XML_ATTR(L"f", 1);
|
||||
|
||||
if (itmType == 0)
|
||||
{
|
||||
CP_XML_ATTR(L"x", iCache);
|
||||
}
|
||||
switch(itmType)
|
||||
{
|
||||
case 0x0001: CP_XML_ATTR(L"t", L"default"); break;
|
||||
case 0x0002: CP_XML_ATTR(L"t", L"sum"); break;
|
||||
case 0x0003: CP_XML_ATTR(L"t", L"countA"); break;
|
||||
case 0x0004: CP_XML_ATTR(L"t", L"avg"); break;
|
||||
case 0x0005: CP_XML_ATTR(L"t", L"max"); break;
|
||||
case 0x0006: CP_XML_ATTR(L"t", L"min"); break;
|
||||
case 0x0007: CP_XML_ATTR(L"t", L"product"); break;
|
||||
case 0x0008: CP_XML_ATTR(L"t", L"count"); break;
|
||||
case 0x0009: CP_XML_ATTR(L"t", L"stdDev"); break;
|
||||
case 0x000a: CP_XML_ATTR(L"t", L"stdDevP"); break;
|
||||
case 0x000b: CP_XML_ATTR(L"t", L"var"); break;
|
||||
case 0x000c: CP_XML_ATTR(L"t", L"varP"); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,6 +48,8 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSXVI;
|
||||
|
||||
unsigned short itmType; //enum
|
||||
|
||||
@ -56,6 +56,18 @@ void SxBool::readFields(CFRecord& record)
|
||||
|
||||
val = (flags != 0);
|
||||
}
|
||||
int SxBool::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"b")
|
||||
{
|
||||
|
||||
CP_XML_ATTR(L"v", val);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,6 +48,8 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSxBool;
|
||||
|
||||
bool val;
|
||||
|
||||
@ -54,7 +54,6 @@ public:
|
||||
|
||||
DXFN dxfn;
|
||||
XFExtNoFRT xfext;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,7 +53,7 @@ BaseObjectPtr SxFilt::clone()
|
||||
void SxFilt::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags1;
|
||||
unsigned char flags2;
|
||||
unsigned short flags2;
|
||||
|
||||
record >> flags1 >> isxvd >> flags2 >> grbitSbt >> cisxvi;
|
||||
|
||||
@ -63,7 +63,8 @@ void SxFilt::readFields(CFRecord& record)
|
||||
sxaxisData = GETBIT(flags1, 3);
|
||||
iDim = GETBITS(flags1, 4, 15);
|
||||
|
||||
fSelected = GETBIT(flags2, 0);
|
||||
isxvd = GETBITS(flags2, 0, 9);
|
||||
fSelected = GETBIT(flags2, 10);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -58,7 +58,7 @@ public:
|
||||
unsigned short isxvd;
|
||||
bool fSelected;
|
||||
|
||||
unsigned short grbitSbt;
|
||||
short grbitSbt;
|
||||
unsigned short cisxvi;
|
||||
};
|
||||
|
||||
|
||||
@ -51,7 +51,6 @@ public:
|
||||
static const ElementType type = typeSxIvd;
|
||||
|
||||
std::vector<short> rgSxivd;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -45,7 +45,6 @@ Sxvd::~Sxvd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr Sxvd::clone()
|
||||
{
|
||||
return BaseObjectPtr(new Sxvd(*this));
|
||||
|
||||
@ -750,7 +750,7 @@ class pConnectionSitesDir : public OfficeArtFOPTE
|
||||
|
||||
virtual void ReadComplexData(XLS::CFRecord& record);
|
||||
|
||||
IMsoArray<ODRAW::FixedPoint> complex;
|
||||
IMsoArray<OSHARED::FixedPoint> complex;
|
||||
};
|
||||
|
||||
class pInscribe : public OfficeArtFOPTE
|
||||
|
||||
@ -45,13 +45,51 @@ BiffStructurePtr PtgSxName::clone()
|
||||
void PtgSxName::loadFields(CFRecord& record)
|
||||
{
|
||||
record >> sxIndex;
|
||||
|
||||
global_info = record.getGlobalWorkbookInfo();
|
||||
}
|
||||
|
||||
void PtgSxName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref)
|
||||
{
|
||||
Log::info("PtgSxName structure is not assemble.");
|
||||
//RevNamePtr tab_id;
|
||||
//if(!extra_data.empty() && (tab_id = boost::dynamic_pointer_cast<RevName>(extra_data.front())))
|
||||
//{
|
||||
// Log::error("PtgNameX struct for revisions is not assemble.");
|
||||
// ptg_stack.push(L"#REF!");
|
||||
// extra_data.pop();
|
||||
// return;
|
||||
//}
|
||||
|
||||
std::wstring _Name;
|
||||
if(sxIndex > 0 && sxIndex <= global_info->AddinUdfs.size() && !(_Name = global_info->AddinUdfs[sxIndex - 1]).empty())
|
||||
{
|
||||
ptg_stack.push(_Name);
|
||||
}
|
||||
else if(sxIndex > 0 && sxIndex <= global_info->xti_parsed.size())
|
||||
{
|
||||
std::wstring sheet = global_info->xti_parsed[sxIndex-1];
|
||||
|
||||
if (!sheet.empty()) sheet += L"!";
|
||||
|
||||
if (sxIndex > 0 && sxIndex <= global_info->arDefineNames.size())
|
||||
{
|
||||
_Name = global_info->arDefineNames[sxIndex - 1];
|
||||
}
|
||||
|
||||
if (sheet.empty() && _Name.empty() && sxIndex <= global_info->arExternalNames.size() && sxIndex > 0)
|
||||
{
|
||||
_Name = global_info->arExternalNames[sxIndex - 1];
|
||||
}
|
||||
|
||||
ptg_stack.push(sheet + _Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::warning("PtgSxName structure is not assemble.");
|
||||
|
||||
ptg_stack.push(L""); // This would let us to continue without an error
|
||||
}
|
||||
|
||||
ptg_stack.push(L"#REF!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -44,14 +44,13 @@ class PtgSxName: public OperandPtg
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
|
||||
virtual void loadFields(CFRecord& record);
|
||||
|
||||
virtual void loadFields(CFRecord& record);
|
||||
|
||||
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref = false);
|
||||
|
||||
private:
|
||||
_UINT32 sxIndex;
|
||||
private:
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -55,10 +55,13 @@ BiffStructurePtr XFExtNoFRT::clone()
|
||||
|
||||
void XFExtNoFRT::load(CFRecord& record)
|
||||
{
|
||||
if (record.isEOF()) return;
|
||||
|
||||
record.skipNunBytes(6); // reserved
|
||||
unsigned short cexts;
|
||||
record >> cexts;
|
||||
for(unsigned short i = 0; i < cexts; ++i)
|
||||
|
||||
for(unsigned short i = 0; !record.isEOF() && i < cexts; ++i)
|
||||
{
|
||||
ExtProp prop;
|
||||
record >> prop;
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
unsigned char Byte4;
|
||||
unsigned short type;
|
||||
unsigned short fExprO;
|
||||
};
|
||||
}bytes;
|
||||
double value;
|
||||
} data;
|
||||
};
|
||||
|
||||
@ -38,12 +38,15 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
DBB::DBB()
|
||||
{
|
||||
bString = false;
|
||||
bDate = false;
|
||||
bNumber = false;
|
||||
bEmpty = false;
|
||||
bBool = false;
|
||||
}
|
||||
|
||||
|
||||
DBB::~DBB()
|
||||
{
|
||||
}
|
||||
@ -53,7 +56,6 @@ BaseObjectPtr DBB::clone()
|
||||
return BaseObjectPtr(new DBB(*this));
|
||||
}
|
||||
|
||||
|
||||
// DBB = [SXDBB] *SXOPER
|
||||
const bool DBB::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -66,6 +68,13 @@ const bool DBB::loadContent(BinProcessor& proc)
|
||||
while(count--)
|
||||
{
|
||||
m_arSXOPER.push_back(elements_.front()); elements_.pop_front();
|
||||
SXOPER* operatr = dynamic_cast<SXOPER*>(m_arSXOPER.back().get());
|
||||
|
||||
bString |= operatr->bString;
|
||||
bDate |= operatr->bDate;
|
||||
bNumber |= operatr->bNumber;
|
||||
bEmpty |= operatr->bEmpty;
|
||||
bBool |= operatr->bBool;
|
||||
}
|
||||
|
||||
if (!m_SXDBB && m_arSXOPER.empty())
|
||||
@ -73,6 +82,50 @@ const bool DBB::loadContent(BinProcessor& proc)
|
||||
|
||||
return true;
|
||||
}
|
||||
int DBB::serialize(std::wostream & strm)
|
||||
{
|
||||
SXDBB* dbb = dynamic_cast<SXDBB*>(m_SXDBB.get());
|
||||
|
||||
if (!dbb && m_arSXOPER.empty()) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"r")
|
||||
{
|
||||
int indexOPER = 0;
|
||||
size_t posBlob = 0;
|
||||
|
||||
for (size_t i = 0; i < arPivotCacheFields.size(); i++)
|
||||
{
|
||||
if(arPivotCacheFields[i] == false)
|
||||
{
|
||||
m_arSXOPER[indexOPER++]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (arPivotCacheFieldShortSize[i])//fShortIitms
|
||||
{
|
||||
unsigned short * values = (unsigned short *)(dbb->blob.get() + posBlob);
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", *values);
|
||||
}
|
||||
posBlob+=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char * values = (unsigned char *)(dbb->blob.get() + posBlob);
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", *values);
|
||||
}
|
||||
posBlob++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,10 +47,22 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeDBB;
|
||||
|
||||
BaseObjectPtr m_SXDBB;
|
||||
std::vector<BaseObjectPtr> m_arSXOPER;
|
||||
|
||||
//---------------------------------------------------
|
||||
std::vector<bool> arPivotCacheFields;
|
||||
std::vector<bool> arPivotCacheFieldShortSize;
|
||||
|
||||
bool bString;
|
||||
bool bDate;
|
||||
bool bNumber;
|
||||
bool bEmpty;
|
||||
bool bBool;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -63,7 +63,8 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.mandatory<DbOrParamQry>();
|
||||
DbOrParamQry param(1);
|
||||
proc.mandatory(param);
|
||||
return true;
|
||||
};
|
||||
};
|
||||
@ -80,11 +81,14 @@ public:
|
||||
|
||||
const bool loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(!proc.mandatory<DbOrParamQry>())
|
||||
DbOrParamQry param(1);
|
||||
if(!proc.mandatory(param))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.repeated<Parenthesis_DBQUERY_3>(0, 0);
|
||||
|
||||
int count = proc.repeated<Parenthesis_DBQUERY_3>(0, 0);
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
@ -105,8 +109,11 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.repeated<SXString>(0, 0);
|
||||
|
||||
int count = proc.repeated<SXString>(0, 0);
|
||||
|
||||
proc.optional<Parenthesis_DBQUERY_2>();
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
@ -117,20 +124,126 @@ BaseObjectPtr DBQUERY::clone()
|
||||
return BaseObjectPtr(new DBQUERY(*this));
|
||||
}
|
||||
|
||||
|
||||
// DBQUERY = DbOrParamQry [1*SXString [DbOrParamQry *(SXString DbOrParamQry)]] *SXString
|
||||
const bool DBQUERY::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<DbOrParamQry>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.optional<Parenthesis_DBQUERY_1>();
|
||||
proc.repeated<SXString>(0, 0);
|
||||
m_DbQry = elements_.front(); elements_.pop_front();
|
||||
|
||||
proc.optional<Parenthesis_DBQUERY_1>();
|
||||
|
||||
while(!elements_.empty())
|
||||
{
|
||||
SXString* str = dynamic_cast<SXString*>(elements_.front().get());
|
||||
if (!str)
|
||||
{
|
||||
m_DbParam = elements_.front(); elements_.pop_front();
|
||||
break;
|
||||
}
|
||||
m_arSXString.push_back(str->value());
|
||||
elements_.pop_front();
|
||||
}
|
||||
|
||||
while(!elements_.empty())
|
||||
{
|
||||
SXString* str = dynamic_cast<SXString*>(elements_.front().get());
|
||||
if (str)
|
||||
{
|
||||
_DbParam a;
|
||||
a.string = str->value();
|
||||
m_arParams.push_back(a);
|
||||
}
|
||||
else
|
||||
{
|
||||
DbOrParamQry* param = dynamic_cast<DbOrParamQry*>(elements_.front().get());
|
||||
if (param)
|
||||
{
|
||||
m_arParams.back().param = elements_.front();
|
||||
}
|
||||
|
||||
}
|
||||
elements_.pop_front();
|
||||
}
|
||||
int count = proc.repeated<SXString>(0, 0);
|
||||
while(!elements_.empty())
|
||||
{
|
||||
SXString* str = dynamic_cast<SXString*>(elements_.front().get());
|
||||
if (str)
|
||||
{
|
||||
m_arSXString.push_back(str->value());
|
||||
}
|
||||
elements_.pop_front();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int DBQUERY::serialize(std::wostream & strm)
|
||||
{
|
||||
connectionId = ++global_info->connectionId;
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"cacheSource")
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"external");
|
||||
CP_XML_ATTR(L"connectionId", connectionId); //connectionId in connections(root)
|
||||
}
|
||||
}
|
||||
serialize_connection(global_info->connections_stream);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DBQUERY::serialize_connection(std::wostream & strm)
|
||||
{
|
||||
DbOrParamQry* queryOrParam = dynamic_cast<DbOrParamQry*>(m_DbQry.get());
|
||||
if (!queryOrParam) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"connection")
|
||||
{
|
||||
CP_XML_ATTR(L"id", 1); //connectionId in connections(root)
|
||||
CP_XML_ATTR(L"name", L"Connection");
|
||||
|
||||
CP_XML_ATTR(L"type", queryOrParam->query.dbt);
|
||||
//switch(queryOrParam->query.dbt)
|
||||
//{
|
||||
// case 0x1: CP_XML_ATTR(L"type", 1); break;
|
||||
// case 0x2:
|
||||
// case 0x3:
|
||||
// case 0x4:
|
||||
// case 0x5:
|
||||
// case 0x6:
|
||||
// case 0x7:
|
||||
//}
|
||||
|
||||
if (queryOrParam->query.fSavePwd) CP_XML_ATTR(L"savePassword", 1);
|
||||
if (queryOrParam->query.fSavePwd) CP_XML_ATTR(L"refreshedVersion", 1);
|
||||
|
||||
int index = 0;
|
||||
CP_XML_NODE(L"dbPr")
|
||||
{
|
||||
if (index < m_arSXString.size())
|
||||
{
|
||||
CP_XML_ATTR(L"command", m_arSXString[index]);
|
||||
}
|
||||
index++;
|
||||
|
||||
if (index < m_arSXString.size())
|
||||
{
|
||||
CP_XML_ATTR(L"connection", m_arSXString[index]);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -35,9 +35,12 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
struct _DbParam
|
||||
{
|
||||
std::wstring string;
|
||||
BaseObjectPtr param;
|
||||
};
|
||||
|
||||
|
||||
// Logical representation of DBQUERY union of records
|
||||
class DBQUERY: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DBQUERY)
|
||||
@ -49,6 +52,18 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
int serialize_connection(std::wostream & strm);
|
||||
|
||||
BaseObjectPtr m_DbQry;
|
||||
|
||||
BaseObjectPtr m_DbParam;
|
||||
std::vector<_DbParam> m_arParams;
|
||||
|
||||
std::vector<std::wstring> m_arSXString;
|
||||
//------------------------------------------------------
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
int connectionId;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DBQUERYEXT union of records
|
||||
class DBQUERYEXT: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DBQUERYEXT)
|
||||
@ -49,6 +47,11 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
BaseObjectPtr m_TxtQry;
|
||||
BaseObjectPtr m_DBQueryExt;
|
||||
BaseObjectPtr m_ExtString;
|
||||
std::vector<BaseObjectPtr> m_arExtString;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,10 +31,11 @@
|
||||
*/
|
||||
|
||||
#include "DBQUERYEXT.h"
|
||||
#include <Logic/Biff_records/DBQueryExt.h>
|
||||
#include <Logic/Biff_records/ExtString.h>
|
||||
#include <Logic/Biff_records/OleDbConn.h>
|
||||
#include <Logic/Biff_records/TxtQry.h>
|
||||
|
||||
#include "../Biff_records/DBQueryExt.h"
|
||||
#include "../Biff_records/ExtString.h"
|
||||
#include "../Biff_records/OleDbConn.h"
|
||||
#include "../Biff_records/TxtQry.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -84,11 +85,30 @@ const bool DBQUERYEXT::loadContent(BinProcessor& proc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.optional<ExtString>();
|
||||
proc.repeated<Parenthesis_DBQUERYEXT_1>(0, 4);
|
||||
m_DBQueryExt = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
if (proc.optional<ExtString>())
|
||||
{
|
||||
m_ExtString = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
int count = proc.repeated<Parenthesis_DBQUERYEXT_1>(0, 4);
|
||||
|
||||
//....
|
||||
|
||||
if(proc.optional<TxtQry>())
|
||||
{
|
||||
proc.repeated<ExtString>(0, 0);
|
||||
m_TxtQry = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
int count = proc.repeated<ExtString>(0, 0);
|
||||
|
||||
while(count--)
|
||||
{
|
||||
m_arExtString.insert(m_arExtString.begin(), elements_.back());
|
||||
elements_.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -92,9 +92,51 @@ int DREF::serialize(std::wostream & strm)
|
||||
}
|
||||
else if(bin)
|
||||
{
|
||||
switch(bin->nBuiltin)
|
||||
{
|
||||
|
||||
case 0x0004:/*Database*/
|
||||
case 0x000d:/*_FilterDatabase*/
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"external");
|
||||
//connectionId in connections(root)
|
||||
}break;
|
||||
case 0x0000:/*Consolidate_Area*/
|
||||
//{
|
||||
// CP_XML_ATTR(L"type", L"consolidation");
|
||||
// CP_XML_NODE(L"consolidation")
|
||||
// {
|
||||
// CP_XML_ATTR(L"name", bin->stFile.value());
|
||||
// }
|
||||
//}break;
|
||||
case 0x0001:/*Auto_Open*/
|
||||
case 0x0002:/*Auto_Close*/
|
||||
case 0x0003:/*Extract*/
|
||||
case 0x0005:/*Criteria*/
|
||||
case 0x0006:/*Print_Area*/
|
||||
case 0x0007:/*Print_Titles*/
|
||||
case 0x0008:/*Recorder*/
|
||||
case 0x0009:/*Data_Form*/
|
||||
case 0x000a:/*Auto_Activate*/
|
||||
case 0x000b:/*Auto_Deactivate*/
|
||||
case 0x000c:/*Sheet_Title*/
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"scenario");
|
||||
CP_XML_NODE(L"worksheetSource")
|
||||
{
|
||||
CP_XML_ATTR(L"name", bin->stFile.value());
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
else if(ref)
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"worksheet");
|
||||
CP_XML_NODE(L"worksheetSource")
|
||||
{
|
||||
CP_XML_ATTR(L"ref", ref->ref.toString());
|
||||
CP_XML_ATTR(L"sheet", ref->stFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,14 +74,18 @@ private:
|
||||
|
||||
FDB::FDB()
|
||||
{
|
||||
bString = false;
|
||||
bDate = false;
|
||||
bNumber = false;
|
||||
bEmpty = false;
|
||||
bInteger = false;
|
||||
bBool = false;
|
||||
}
|
||||
|
||||
|
||||
FDB::~FDB()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr FDB::clone()
|
||||
{
|
||||
return BaseObjectPtr(new FDB(*this));
|
||||
@ -123,10 +127,15 @@ const bool FDB::loadContent(BinProcessor& proc)
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
SXOPER * oper = dynamic_cast<SXOPER*> (elements_.front().get());
|
||||
if (oper)
|
||||
SXOPER * operatr = dynamic_cast<SXOPER*> (elements_.front().get());
|
||||
if (operatr)
|
||||
{
|
||||
m_arGRPSXOPER.push_back(elements_.front());
|
||||
|
||||
//bString |= operatr->bString;
|
||||
//bDate |= operatr->bDate;
|
||||
//bNumber |= operatr->bNumber;
|
||||
//bEmpty |= operatr->bEmpty;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -150,6 +159,15 @@ const bool FDB::loadContent(BinProcessor& proc)
|
||||
while(count--)
|
||||
{
|
||||
m_arSRCSXOPER.push_back(elements_.front()); elements_.pop_front();
|
||||
|
||||
SXOPER* operatr = dynamic_cast<SXOPER*> (m_arSRCSXOPER.back().get());
|
||||
|
||||
bString |= operatr->bString;
|
||||
bDate |= operatr->bDate;
|
||||
bNumber |= operatr->bNumber;
|
||||
bEmpty |= operatr->bEmpty;
|
||||
bInteger|= operatr->bInteger;
|
||||
bBool |= operatr->bBool;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -167,7 +185,16 @@ int FDB::serialize(std::wostream & strm)
|
||||
CP_XML_NODE(L"cacheField")
|
||||
{
|
||||
CP_XML_ATTR(L"name", fdb->stFieldName.value());
|
||||
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
|
||||
|
||||
if (fdb_type->wTypeSql > 0)
|
||||
{
|
||||
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
|
||||
//CP_XML_ATTR(L"sqlType", fdb_type->wTypeSql); //in db
|
||||
}
|
||||
if (m_arSRCSXOPER.empty() && m_arGRPSXOPER.empty() == false)
|
||||
{
|
||||
CP_XML_ATTR(L"databaseField", 0);
|
||||
}
|
||||
|
||||
switch(fdb_type->wTypeSql)//format code
|
||||
{
|
||||
@ -189,32 +216,68 @@ int FDB::serialize(std::wostream & strm)
|
||||
{
|
||||
//{formula
|
||||
}
|
||||
//caption, databaseFields, ..
|
||||
|
||||
if (m_arSRCSXOPER.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"sharedItems")
|
||||
{
|
||||
//CP_XML_ATTR(L"containsSemiMixedTypes", 0);
|
||||
CP_XML_ATTR(L"containsNonDate", fdb->fNonDates);
|
||||
CP_XML_ATTR(L"containsDate", fdb->fDateInField);
|
||||
CP_XML_ATTR(L"containsNumber", fdb->fNumField);
|
||||
CP_XML_ATTR(L"containsBlank", fdb->fTextEtcField);
|
||||
//CP_XML_ATTR(L"containsString", 0);
|
||||
//использовать поля присутствия из xls низя - они частенько записаны неверно!!
|
||||
//if (!fdb->fNonDates) CP_XML_ATTR(L"containsNonDate", fdb->fNonDates);
|
||||
//if (fdb->fDateInField) CP_XML_ATTR(L"containsDate", fdb->fDateInField);
|
||||
//if (fdb->fNumField) CP_XML_ATTR(L"containsNumber", fdb->fNumField);
|
||||
////CP_XML_ATTR(L"containsBlank", fdb->fTextEtcField);
|
||||
|
||||
//if (m_arSRCSXOPER.empty())
|
||||
//{
|
||||
// if (!fdb->fTextEtcField)
|
||||
// {
|
||||
// CP_XML_ATTR(L"containsString", 0);
|
||||
// }
|
||||
// else if (fdb->fNumField || fdb->fDateInField)
|
||||
// {
|
||||
// CP_XML_ATTR(L"containsBlank", 1);
|
||||
// CP_XML_ATTR(L"containsString", 0);
|
||||
// }
|
||||
//}
|
||||
if (bInteger)
|
||||
{
|
||||
if (bNumber) bInteger = false;
|
||||
else bNumber = true;
|
||||
}
|
||||
if ((bDate & bNumber) || (bNumber & bString))
|
||||
{
|
||||
CP_XML_ATTR(L"containsSemiMixedTypes", 1);
|
||||
}
|
||||
else if ( bDate & bString)
|
||||
{
|
||||
CP_XML_ATTR(L"containsMixedTypes", 1);
|
||||
}
|
||||
else if (!bEmpty && !bString && !bBool)
|
||||
{
|
||||
CP_XML_ATTR(L"containsSemiMixedTypes", 0);
|
||||
}
|
||||
if (bNumber) CP_XML_ATTR(L"containsNumber", 1);
|
||||
if (bDate) CP_XML_ATTR(L"containsDate", 1);
|
||||
if (bEmpty) CP_XML_ATTR(L"containsBlank", 1);
|
||||
if (bInteger) CP_XML_ATTR(L"containsInteger", 1);
|
||||
|
||||
if (!bString && (bInteger || bDate || bNumber || bEmpty))
|
||||
CP_XML_ATTR(L"containsString", 0);
|
||||
|
||||
if (fdb->fnumMinMaxValid)
|
||||
{
|
||||
if (fdb->fDateInField)
|
||||
{
|
||||
CP_XML_ATTR(L"minDate", 0); // "2007-11-18T00:00:00"
|
||||
CP_XML_ATTR(L"maxDate", 0); // "2007-12-25T00:00:00"
|
||||
}
|
||||
else if (fdb->fNumField)
|
||||
{
|
||||
CP_XML_ATTR(L"minValue", 0);
|
||||
CP_XML_ATTR(L"maxValue", 0);
|
||||
}
|
||||
//if (fdb->fDateInField)
|
||||
//{
|
||||
// CP_XML_ATTR(L"minDate", 0); // "2007-11-18T00:00:00"
|
||||
// CP_XML_ATTR(L"maxDate", 0); // "2007-12-25T00:00:00"
|
||||
//}
|
||||
//else if (fdb->fNumField)
|
||||
//{
|
||||
// CP_XML_ATTR(L"minValue", 0);
|
||||
// CP_XML_ATTR(L"maxValue", 0);
|
||||
//}
|
||||
}
|
||||
CP_XML_ATTR(L"count", fdb->catm);
|
||||
CP_XML_ATTR(L"count", m_arSRCSXOPER.size());
|
||||
|
||||
for (size_t i = 0; i < m_arSRCSXOPER.size(); i++)
|
||||
{
|
||||
|
||||
@ -59,6 +59,14 @@ public:
|
||||
std::vector<BaseObjectPtr> m_arGRPSXOPER;
|
||||
BaseObjectPtr m_SXRANGE;
|
||||
std::vector<BaseObjectPtr> m_arSxIsxoper;
|
||||
|
||||
bool bString;
|
||||
bool bDate;
|
||||
bool bNumber;
|
||||
bool bEmpty;
|
||||
bool bInteger;
|
||||
bool bBool;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -60,6 +60,11 @@ BaseObjectPtr PIVOTCACHE::clone()
|
||||
// PIVOTCACHE = SXDB SXDBEx *SXFORMULA *FDB *DBB EOF
|
||||
const bool PIVOTCACHE::loadContent(BinProcessor& proc)
|
||||
{
|
||||
GlobalWorkbookInfoPtr global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
global_info->arPivotCacheFieldShortSize.clear();
|
||||
global_info->arPivotCacheFields.clear();
|
||||
|
||||
if(!proc.mandatory<SXDB>())
|
||||
{
|
||||
return false;
|
||||
@ -90,6 +95,11 @@ const bool PIVOTCACHE::loadContent(BinProcessor& proc)
|
||||
while(count--)
|
||||
{
|
||||
m_arDBB.push_back(elements_.front()); elements_.pop_front();
|
||||
|
||||
DBB* dbb = dynamic_cast<DBB*>(m_arDBB.back().get());
|
||||
|
||||
dbb->arPivotCacheFieldShortSize = global_info->arPivotCacheFieldShortSize;
|
||||
dbb->arPivotCacheFields = global_info->arPivotCacheFields;
|
||||
}
|
||||
if (proc.optional<EOF_T>())
|
||||
{
|
||||
|
||||
@ -55,6 +55,8 @@ public:
|
||||
std::vector<BaseObjectPtr> m_arFDB;
|
||||
std::vector<BaseObjectPtr> m_arDBB;
|
||||
|
||||
std::vector<bool> m_arAllAtoms;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -116,9 +116,10 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", L"rId1" );
|
||||
}
|
||||
CP_XML_ATTR(L"recordCount", db->crdbUsed);
|
||||
CP_XML_ATTR(L"refreshedBy", db->rgb.value());
|
||||
CP_XML_ATTR(L"refreshedDate", db_ex->numDate.data.value);
|
||||
CP_XML_ATTR(L"enableRefresh", 1);
|
||||
CP_XML_ATTR(L"refreshedBy", db->rgb.value());
|
||||
CP_XML_ATTR(L"refreshedDate", db_ex->numDate.data.value);
|
||||
CP_XML_ATTR(L"recordCount", db->crdbUsed);
|
||||
//createdVersion="1"
|
||||
//refreshedVersion="2"
|
||||
//upgradeOnRefresh="1">
|
||||
@ -138,7 +139,18 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pivot_cache->m_arSXFORMULA.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"calculatedItems")
|
||||
{
|
||||
CP_XML_ATTR(L"count", pivot_cache->m_arSXFORMULA.size());
|
||||
|
||||
for (size_t i = 0; i < pivot_cache->m_arSXFORMULA.size(); i++)
|
||||
{
|
||||
pivot_cache->m_arSXFORMULA[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -31,34 +31,31 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTCORE.h"
|
||||
#include <Logic/Biff_records/SxView.h>
|
||||
#include <Logic/Biff_unions/PIVOTVD.h>
|
||||
#include <Logic/Biff_unions/PIVOTIVD.h>
|
||||
#include <Logic/Biff_unions/PIVOTPI.h>
|
||||
#include <Logic/Biff_records/SXDI.h>
|
||||
#include <Logic/Biff_unions/PIVOTLI.h>
|
||||
#include <Logic/Biff_unions/PIVOTEX.h>
|
||||
#include "PIVOTVD.h"
|
||||
#include "PIVOTIVD.h"
|
||||
#include "PIVOTPI.h"
|
||||
#include "PIVOTLI.h"
|
||||
#include "PIVOTEX.h"
|
||||
|
||||
#include "../Biff_records/SXDI.h"
|
||||
#include "../Biff_records/SxView.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTCORE::PIVOTCORE()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PIVOTCORE::~PIVOTCORE()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PIVOTCORE::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PIVOTCORE(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTCORE = SxView *PIVOTVD *2PIVOTIVD [PIVOTPI] *SXDI *PIVOTLI PIVOTEX
|
||||
const bool PIVOTCORE::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -69,6 +66,8 @@ const bool PIVOTCORE::loadContent(BinProcessor& proc)
|
||||
m_SxView = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
SxView* sxView = dynamic_cast<SxView*>(m_SxView.get());
|
||||
|
||||
int count = 0;
|
||||
|
||||
count = proc.repeated<PIVOTVD>(0, 0);
|
||||
@ -93,12 +92,21 @@ const bool PIVOTCORE::loadContent(BinProcessor& proc)
|
||||
{
|
||||
m_arSXDI.push_back(elements_.front()); elements_.pop_front();
|
||||
}
|
||||
|
||||
count = proc.repeated<PIVOTLI>(0, 0);
|
||||
while(count--)
|
||||
PIVOTLI rwLines(sxView->cDimRw);
|
||||
if (proc.optional(rwLines))
|
||||
{
|
||||
m_arPIVOTLI.push_back(elements_.front()); elements_.pop_front();
|
||||
}
|
||||
PIVOTLI colLines(sxView->cDimCol);
|
||||
if (proc.optional(colLines))
|
||||
{
|
||||
m_arPIVOTLI.push_back(elements_.front()); elements_.pop_front();
|
||||
}
|
||||
//count = proc.repeated<PIVOTLI>(0, 0);
|
||||
//while(count--)
|
||||
//{
|
||||
// m_arPIVOTLI.push_back(elements_.front()); elements_.pop_front();
|
||||
//}
|
||||
|
||||
if (proc.mandatory<PIVOTEX>())
|
||||
{
|
||||
|
||||
@ -55,7 +55,6 @@ BaseObjectPtr PIVOTFRT9::clone()
|
||||
return BaseObjectPtr(new PIVOTFRT9(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTFRT9 = QsiSXTag [DBQUERYEXT] [PIVOTVIEWEX] SXViewEx9
|
||||
const bool PIVOTFRT9::loadContent(BinProcessor& proc)
|
||||
{
|
||||
|
||||
@ -31,13 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTIVD.h"
|
||||
#include <Logic/Biff_records/SxIvd.h>
|
||||
#include <Logic/Biff_records/Continue.h>
|
||||
#include "../Biff_records/SxIvd.h"
|
||||
#include "../Biff_records/Continue.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTIVD::PIVOTIVD()
|
||||
{
|
||||
}
|
||||
@ -53,7 +52,6 @@ BaseObjectPtr PIVOTIVD::clone()
|
||||
return BaseObjectPtr(new PIVOTIVD(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTIVD = SxIvd *Continue
|
||||
const bool PIVOTIVD::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -68,6 +66,21 @@ const bool PIVOTIVD::loadContent(BinProcessor& proc)
|
||||
|
||||
return true;
|
||||
}
|
||||
int PIVOTIVD::serialize(std::wostream & strm)
|
||||
{
|
||||
SxIvd* vd = dynamic_cast<SxIvd*>(m_SxIvd.get());
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
for (size_t i = 0; i < vd->rgSxivd.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"field")
|
||||
{
|
||||
CP_XML_ATTR(L"x", vd->rgSxivd[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,6 +47,8 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typePIVOTIVD;
|
||||
|
||||
BaseObjectPtr m_SxIvd;
|
||||
|
||||
@ -31,40 +31,89 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTLI.h"
|
||||
#include <Logic/Biff_records/SXLI.h>
|
||||
#include <Logic/Biff_records/Continue.h>
|
||||
|
||||
#include "../Biff_records/SXLI.h"
|
||||
#include "../Biff_records/Continue.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTLI::PIVOTLI()
|
||||
PIVOTLI::PIVOTLI(int count_lines_)
|
||||
{
|
||||
count_lines = count_lines_;
|
||||
}
|
||||
|
||||
|
||||
PIVOTLI::~PIVOTLI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PIVOTLI::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PIVOTLI(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTLI = SXLI *Continue
|
||||
const bool PIVOTLI::loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(!proc.mandatory<SXLI>())
|
||||
SXLI sx_line(count_lines);
|
||||
|
||||
if(!proc.mandatory(sx_line))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_SXLI = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
proc.repeated<Continue>(0, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int PIVOTLI::serialize(std::wostream & strm)
|
||||
{
|
||||
SXLI* line_items = dynamic_cast<SXLI*>(m_SXLI.get());
|
||||
if (!line_items) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
for (size_t i = 0; i < line_items->m_arItems.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"i")
|
||||
{
|
||||
switch(line_items->m_arItems[i].itmType)
|
||||
{
|
||||
case 0x0001: CP_XML_ATTR(L"t", L"default"); break;
|
||||
case 0x0002: CP_XML_ATTR(L"t", L"sum"); break;
|
||||
case 0x0003: CP_XML_ATTR(L"t", L"countA"); break;
|
||||
case 0x0004: CP_XML_ATTR(L"t", L"count"); break;
|
||||
case 0x0005: CP_XML_ATTR(L"t", L"avg"); break;
|
||||
case 0x0006: CP_XML_ATTR(L"t", L"max"); break;
|
||||
case 0x0007: CP_XML_ATTR(L"t", L"min"); break;
|
||||
case 0x0008: CP_XML_ATTR(L"t", L"product"); break;
|
||||
case 0x0009: CP_XML_ATTR(L"t", L"stdDev"); break;
|
||||
case 0x000A: CP_XML_ATTR(L"t", L"stdDevP"); break;
|
||||
case 0x000B: CP_XML_ATTR(L"t", L"var"); break;
|
||||
case 0x000C: CP_XML_ATTR(L"t", L"varP"); break;
|
||||
case 0x000D: CP_XML_ATTR(L"t", L"grand"); break;
|
||||
case 0x000E: CP_XML_ATTR(L"t", L"blank"); break;
|
||||
}
|
||||
|
||||
if (line_items->m_arItems[i].cSic > 0 && line_items->m_arItems[i].itmType == 0)//??
|
||||
{
|
||||
CP_XML_ATTR(L"r", line_items->m_arItems[i].cSic);
|
||||
}
|
||||
|
||||
for (size_t j = line_items->m_arItems[i].cSic; j < line_items->m_arItems[i].rgisxvi.size(); j++)
|
||||
{
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", line_items->m_arItems[i].rgisxvi[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -36,20 +36,24 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of PIVOTLI union of records
|
||||
class PIVOTLI: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PIVOTLI)
|
||||
public:
|
||||
PIVOTLI();
|
||||
PIVOTLI(int count_lines_);
|
||||
~PIVOTLI();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
static const ElementType type = typePIVOTLI;
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typePIVOTLI;
|
||||
|
||||
BaseObjectPtr m_SXLI;
|
||||
|
||||
int count_lines;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,13 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTPI.h"
|
||||
#include <Logic/Biff_records/SXPI.h>
|
||||
#include <Logic/Biff_records/Continue.h>
|
||||
#include "../Biff_records/SXPI.h"
|
||||
#include "../Biff_records/Continue.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTPI::PIVOTPI()
|
||||
{
|
||||
}
|
||||
@ -53,7 +52,6 @@ BaseObjectPtr PIVOTPI::clone()
|
||||
return BaseObjectPtr(new PIVOTPI(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTPI = SXPI *Continue
|
||||
const bool PIVOTPI::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -69,5 +67,22 @@ const bool PIVOTPI::loadContent(BinProcessor& proc)
|
||||
return true;
|
||||
}
|
||||
|
||||
int PIVOTPI::serialize(std::wostream & strm)
|
||||
{
|
||||
SXPI* page_items = dynamic_cast<SXPI*>(m_SXPI.get());
|
||||
if (!page_items) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
for (size_t i = 0; i < page_items->m_arItems.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"pageField")
|
||||
{
|
||||
CP_XML_ATTR(L"fld", page_items->m_arItems[i].isxvd);
|
||||
CP_XML_ATTR(L"hier",0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,6 +47,8 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typePIVOTPI;
|
||||
|
||||
BaseObjectPtr m_SXPI;
|
||||
|
||||
@ -31,30 +31,26 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTVD.h"
|
||||
#include <Logic/Biff_records/Sxvd.h>
|
||||
#include <Logic/Biff_records/SXVI.h>
|
||||
#include <Logic/Biff_records/SXVDEx.h>
|
||||
#include "../Biff_records/Sxvd.h"
|
||||
#include "../Biff_records/SXVI.h"
|
||||
#include "../Biff_records/SXVDEx.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTVD::PIVOTVD()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PIVOTVD::~PIVOTVD()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PIVOTVD::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PIVOTVD(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTVD = Sxvd *SXVI SXVDEx
|
||||
const bool PIVOTVD::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -79,6 +75,92 @@ const bool PIVOTVD::loadContent(BinProcessor& proc)
|
||||
|
||||
return true;
|
||||
}
|
||||
int PIVOTVD::serialize(std::wostream & strm)
|
||||
{
|
||||
Sxvd* vd = dynamic_cast<Sxvd*>(m_Sxvd.get());
|
||||
SXVDEx* vd_ex = dynamic_cast<SXVDEx*>(m_SXVDEx.get());
|
||||
|
||||
if (!vd || !vd_ex) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"pivotField")
|
||||
{
|
||||
if (vd->sxaxis.bRw) CP_XML_ATTR(L"axis", L"axisRow");
|
||||
else if (vd->sxaxis.bCol) CP_XML_ATTR(L"axis", L"axisCol");
|
||||
else if (vd->sxaxis.bPage) CP_XML_ATTR(L"axis", L"axisPage");
|
||||
else if (vd->sxaxis.bData)
|
||||
{
|
||||
CP_XML_ATTR(L"dataField", 1);
|
||||
}
|
||||
|
||||
CP_XML_ATTR(L"compact", 0);
|
||||
|
||||
if (vd_ex->ifmt > 0)
|
||||
{
|
||||
CP_XML_ATTR(L"numFmtId", vd_ex->ifmt);
|
||||
}
|
||||
|
||||
if (vd->stName.value().empty() == false)
|
||||
CP_XML_ATTR(L"name", vd->stName.value());
|
||||
|
||||
if (vd->fCounta) CP_XML_ATTR(L"countASubtotal", 1);
|
||||
if (vd->fCount) CP_XML_ATTR(L"countSubtotal", 1);
|
||||
if (vd->fSum) CP_XML_ATTR(L"sumSubtotal", 1);
|
||||
if (vd->fAverage) CP_XML_ATTR(L"avgSubtotal", 1);
|
||||
if (vd->fMax) CP_XML_ATTR(L"maxSubtotal", 1);
|
||||
if (vd->fMin) CP_XML_ATTR(L"minSubtotal", 1);
|
||||
if (vd->fProduct) CP_XML_ATTR(L"productSubtotal", 1);
|
||||
if (vd->fStdev) CP_XML_ATTR(L"stdSubtotal", 1);
|
||||
if (vd->fStdevp) CP_XML_ATTR(L"stdDevSubtotal", 1);
|
||||
if (vd->fVariance) CP_XML_ATTR(L"varSubtotal", 1);
|
||||
if (vd->fVariancep) CP_XML_ATTR(L"varPSubtotal", 1);
|
||||
|
||||
CP_XML_ATTR(L"outline", vd_ex->fOutline);
|
||||
CP_XML_ATTR(L"subtotalTop", vd_ex->fSubtotalAtTop);
|
||||
CP_XML_ATTR(L"showAll", vd_ex->fShowAllItems);
|
||||
|
||||
if (vd_ex->fNotDragToData) CP_XML_ATTR(L"dragToData", 0);
|
||||
if (!vd_ex->fDragToRow) CP_XML_ATTR(L"dragToRow", 0);
|
||||
if (!vd_ex->fDragToColumn) CP_XML_ATTR(L"dragToCol", 0);
|
||||
if (!vd_ex->fDragToPage) CP_XML_ATTR(L"dragToPage", 0);
|
||||
|
||||
if (vd_ex->fHideNewItems) CP_XML_ATTR(L"hideNewItems", 1);
|
||||
if (vd_ex->fInsertBlankRow) CP_XML_ATTR(L"insertBlankRow", 1);
|
||||
if (vd_ex->fPageBreaksBetweenItems) CP_XML_ATTR(L"insertPageBreak", 1);
|
||||
if (!vd_ex->fTopAutoShow) CP_XML_ATTR(L"topAutoShow", 0);
|
||||
//if (!vd_ex->fDragToHide) CP_XML_ATTR(L"dragOff", 0); //??
|
||||
if (vd_ex->fServerBased) CP_XML_ATTR(L"serverField", 1);
|
||||
|
||||
//CP_XML_ATTR(L"", vd_ex->fCalculatedField);
|
||||
CP_XML_ATTR(L"includeNewItemsInFilter", 1);
|
||||
|
||||
//CP_XML_ATTR(L"nonAutoSortDefault", !vd_ex->fAutoSort);
|
||||
if (vd_ex->fAutoSort)
|
||||
{
|
||||
// vd_ex->isxdiAutoSort
|
||||
|
||||
if (vd_ex->fAscendSort) CP_XML_ATTR(L"sortType", L"ascending");
|
||||
}
|
||||
if (vd_ex->isxdiAutoShow >= 0)
|
||||
{
|
||||
CP_XML_ATTR(L"rankBy", vd_ex->isxdiAutoShow);
|
||||
}
|
||||
if (!vd->fDefault) CP_XML_ATTR(L"defaultSubtotal", 0);
|
||||
if (!m_arSXVI.empty())
|
||||
{
|
||||
CP_XML_NODE(L"items")
|
||||
{
|
||||
CP_XML_ATTR(L"count", m_arSXVI.size());
|
||||
for (size_t i = 0; i < m_arSXVI.size(); i++)
|
||||
{
|
||||
m_arSXVI[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,6 +49,8 @@ public:
|
||||
|
||||
static const ElementType type = typePIVOTVD;
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
BaseObjectPtr m_Sxvd;
|
||||
std::vector<BaseObjectPtr> m_arSXVI;
|
||||
BaseObjectPtr m_SXVDEx;
|
||||
|
||||
@ -31,29 +31,34 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTVIEW.h"
|
||||
#include <Logic/Biff_unions/PIVOTCORE.h>
|
||||
#include <Logic/Biff_unions/PIVOTFRT.h>
|
||||
#include "PIVOTCORE.h"
|
||||
#include "PIVOTFRT.h"
|
||||
#include "PIVOTVD.h"
|
||||
#include "PIVOTIVD.h"
|
||||
#include "PIVOTPI.h"
|
||||
#include "PIVOTLI.h"
|
||||
#include "PIVOTEX.h"
|
||||
|
||||
#include "../Biff_records/SXDI.h"
|
||||
#include "../Biff_records/SxView.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTVIEW::PIVOTVIEW()
|
||||
{
|
||||
indexCache = -1;
|
||||
}
|
||||
|
||||
|
||||
PIVOTVIEW::~PIVOTVIEW()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PIVOTVIEW::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PIVOTVIEW(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTVIEW = PIVOTCORE [PIVOTFRT]
|
||||
const bool PIVOTVIEW::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -73,5 +78,135 @@ const bool PIVOTVIEW::loadContent(BinProcessor& proc)
|
||||
return true;
|
||||
}
|
||||
|
||||
int PIVOTVIEW::serialize(std::wostream & strm)
|
||||
{
|
||||
PIVOTCORE* core = dynamic_cast<PIVOTCORE*>(m_PIVOTCORE.get());
|
||||
if (!core) return 0;
|
||||
|
||||
SxView* view = dynamic_cast<SxView*>(core->m_SxView.get());
|
||||
if (!view) return 0;
|
||||
|
||||
PIVOTFRT* frt = dynamic_cast<PIVOTFRT*>(m_PIVOTFRT.get());
|
||||
|
||||
indexCache = view->iCache;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"pivotTableDefinition")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
|
||||
CP_XML_ATTR(L"name", view->stTable.value());
|
||||
CP_XML_ATTR(L"cacheId", view->iCache);
|
||||
CP_XML_ATTR(L"useAutoFormatting", view->fAutoFormat);
|
||||
CP_XML_ATTR(L"dataOnRows", view->sxaxis4Data.bRw);
|
||||
CP_XML_ATTR(L"autoFormatId", view->itblAutoFmt);
|
||||
CP_XML_ATTR(L"applyNumberFormats", view->fAtrNum);
|
||||
CP_XML_ATTR(L"applyBorderFormats", view->fAtrBdr);
|
||||
CP_XML_ATTR(L"applyFontFormats", view->fAtrFnt);
|
||||
CP_XML_ATTR(L"applyPatternFormats", view->fAtrPat);
|
||||
CP_XML_ATTR(L"applyAlignmentFormats", view->fAtrAlc);
|
||||
CP_XML_ATTR(L"applyWidthHeightFormats", view->fAtrProc);
|
||||
if (!view->stData.value().empty())
|
||||
{
|
||||
CP_XML_ATTR(L"dataCaption", view->stData.value());
|
||||
}
|
||||
//updatedVersion="2"
|
||||
//asteriskTotals="1"
|
||||
//showMemberPropertyTips="0"
|
||||
//itemPrintTitles="1"
|
||||
//createdVersion="1"
|
||||
//indent="0"
|
||||
//compact="0"
|
||||
//compactData="0"
|
||||
//gridDropZones="1"
|
||||
CP_XML_NODE(L"location")
|
||||
{
|
||||
CP_XML_ATTR(L"ref", view->ref.toString());
|
||||
CP_XML_ATTR(L"firstHeaderRow", view->rwFirstHead - view->ref.rowFirst );
|
||||
CP_XML_ATTR(L"firstDataRow", view->rwFirstData - view->ref.rowFirst);
|
||||
CP_XML_ATTR(L"firstDataCol", view->colFirstData - view->ref.columnFirst);
|
||||
CP_XML_ATTR(L"rowPageCount", 1);
|
||||
CP_XML_ATTR(L"colPageCount", 1);
|
||||
}
|
||||
CP_XML_NODE(L"pivotFields")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cDim);//Sxvd
|
||||
for (size_t i = 0; i < core->m_arPIVOTVD.size(); i++)
|
||||
{
|
||||
core->m_arPIVOTVD[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_arPIVOTIVD.size() >= 1)
|
||||
{
|
||||
CP_XML_NODE(L"rowFields")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cDimRw);
|
||||
|
||||
PIVOTIVD* ivd = dynamic_cast<PIVOTIVD*>(core->m_arPIVOTIVD[0].get());
|
||||
ivd->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_arPIVOTLI.size() >= 1)//0 or 2
|
||||
{
|
||||
CP_XML_NODE(L"rowItems")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cRw);
|
||||
|
||||
PIVOTLI* line = dynamic_cast<PIVOTLI*>(core->m_arPIVOTLI[0].get());
|
||||
line->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_arPIVOTIVD.size() == 2)//0 or 2
|
||||
{
|
||||
CP_XML_NODE(L"colFields")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cDimCol);
|
||||
|
||||
PIVOTIVD* ivd = dynamic_cast<PIVOTIVD*>(core->m_arPIVOTIVD[1].get());
|
||||
ivd->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_arPIVOTLI.size() == 2)//0 or 2
|
||||
{
|
||||
CP_XML_NODE(L"colItems")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cCol);
|
||||
|
||||
PIVOTLI* line = dynamic_cast<PIVOTLI*>(core->m_arPIVOTLI[1].get());
|
||||
line->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_PIVOTPI)
|
||||
{
|
||||
CP_XML_NODE(L"pageFields")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cDimPg);
|
||||
|
||||
core->m_PIVOTPI->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"dataFields")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cDimData);
|
||||
for (size_t i = 0; i < core->m_arSXDI.size(); i++)
|
||||
{
|
||||
core->m_arSXDI[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
//CP_XML_NODE(L"pivotTableStyleInfo")
|
||||
//{
|
||||
// CP_XML_ATTR(L"showRowHeaders", 1);
|
||||
// CP_XML_ATTR(L"showColHeaders", 1);
|
||||
// CP_XML_ATTR(L"showRowStripes", 0);
|
||||
// CP_XML_ATTR(L"showColStripes", 0);
|
||||
// CP_XML_ATTR(L"showLastColumn", 1);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,10 +47,14 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typePIVOTVIEW;
|
||||
|
||||
BaseObjectPtr m_PIVOTCORE;
|
||||
BaseObjectPtr m_PIVOTFRT;
|
||||
//----------------------------------
|
||||
int indexCache;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -39,23 +39,19 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTVIEWEX::PIVOTVIEWEX()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PIVOTVIEWEX::~PIVOTVIEWEX()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PIVOTVIEWEX::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PIVOTVIEWEX(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTVIEWEX = SXViewEx *PIVOTTH *SXPIEx *PIVOTVDTEX
|
||||
const bool PIVOTVIEWEX::loadContent(BinProcessor& proc)
|
||||
{
|
||||
|
||||
@ -38,6 +38,28 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
// (SxName *SXPair)
|
||||
class Parenthesis_SXFMLA: public ABNFParenthesis
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(Parenthesis_SXFMLA)
|
||||
public:
|
||||
BaseObjectPtr clone()
|
||||
{
|
||||
return BaseObjectPtr(new Parenthesis_SXFMLA(*this));
|
||||
}
|
||||
|
||||
const bool loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(!proc.mandatory<SxName>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int count = proc.repeated<SXPair>(0, 0);
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
SXFMLA::SXFMLA()
|
||||
{
|
||||
@ -57,6 +79,8 @@ BaseObjectPtr SXFMLA::clone()
|
||||
// SXFMLA = SxFmla *(SxName *SXPair)
|
||||
const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
{
|
||||
GlobalWorkbookInfoPtr global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<SxFmla>())
|
||||
{
|
||||
return false;
|
||||
@ -64,6 +88,34 @@ const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
m_SxFmla = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
int count = proc.repeated<Parenthesis_SXFMLA>(0, 0);
|
||||
|
||||
while(!elements_.empty())
|
||||
{
|
||||
if (dynamic_cast<SxName*>(elements_.front().get()))
|
||||
{
|
||||
_sx_name sx_name;
|
||||
sx_name.name = elements_.front(); elements_.pop_front();
|
||||
|
||||
global_info->arPivotSxNames.push_back(sx_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
while(!elements_.empty())
|
||||
{
|
||||
if (dynamic_cast<SxName*>(elements_.front().get()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
global_info->arPivotSxNames.back().pair.push_back(elements_.front());
|
||||
elements_.pop_front();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -35,11 +35,11 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
class SXFMLA: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SXFMLA)
|
||||
public:
|
||||
|
||||
SXFMLA();
|
||||
~SXFMLA();
|
||||
|
||||
@ -49,7 +49,7 @@ public:
|
||||
|
||||
static const ElementType type = typeSXFMLA;
|
||||
|
||||
BaseObjectPtr m_SxFmla;
|
||||
BaseObjectPtr m_SxFmla;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -34,7 +34,11 @@
|
||||
|
||||
#include "SXFMLA_bu.h"
|
||||
#include "PIVOTRULE.h"
|
||||
|
||||
#include "../Biff_records/SXFormula.h"
|
||||
#include "../Biff_records/SxFmla.h"
|
||||
#include "../Biff_records/SxName.h"
|
||||
#include "../Biff_records/SXPair.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -56,6 +60,8 @@ BaseObjectPtr SXFORMULA::clone()
|
||||
// SXFORMULA = SXFMLA PIVOTRULE SXFormula
|
||||
const bool SXFORMULA::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<SXFMLA>())
|
||||
{
|
||||
return false;
|
||||
@ -74,6 +80,29 @@ const bool SXFORMULA::loadContent(BinProcessor& proc)
|
||||
elements_.pop_back();
|
||||
} return true;
|
||||
}
|
||||
int SXFORMULA::serialize(std::wostream & strm)
|
||||
{
|
||||
SXFMLA* fmla = dynamic_cast<SXFMLA*>(m_SXFMLA.get());
|
||||
if (!fmla) return 0;
|
||||
|
||||
SxFmla* sx_fmla = dynamic_cast<SxFmla*>(fmla->m_SxFmla.get());
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"calculatedItem")
|
||||
{
|
||||
CP_XML_ATTR(L"formula", sx_fmla->fmla.getAssembledFormula());
|
||||
|
||||
//for (size_t j = 0; j < global_info->arPivotSxNames.size(); j++)//???
|
||||
//{
|
||||
// SxName *name = dynamic_cast<SxName*>(global_info->arPivotSxNames[j].m_SxName.get());
|
||||
// CP_XML_NODE(L"pivotArea")
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,11 +47,15 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
|
||||
static const ElementType type = typeSXFORMULA;
|
||||
|
||||
BaseObjectPtr m_SXFMLA;
|
||||
BaseObjectPtr m_PIVOTRULE;
|
||||
BaseObjectPtr m_SXFormula;
|
||||
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -43,6 +43,12 @@ namespace XLS
|
||||
|
||||
SXOPER::SXOPER()
|
||||
{
|
||||
bString = false;
|
||||
bDate = false;
|
||||
bNumber = false;
|
||||
bEmpty = false;
|
||||
bInteger= false;
|
||||
bBool = false;
|
||||
}
|
||||
|
||||
SXOPER::~SXOPER()
|
||||
@ -59,21 +65,36 @@ const bool SXOPER::loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(proc.optional<SxNil>())
|
||||
{
|
||||
bEmpty = true;
|
||||
}
|
||||
else if(proc.optional<SXNum>())
|
||||
{
|
||||
|
||||
SXNum *num = dynamic_cast<SXNum*>(elements_.back().get());
|
||||
if (num)
|
||||
{
|
||||
bInteger = (num->num.data.bytes.Byte1==num->num.data.bytes.Byte2 &&
|
||||
num->num.data.bytes.Byte2==num->num.data.bytes.Byte3 &&
|
||||
num->num.data.bytes.Byte3==num->num.data.bytes.Byte4 &&
|
||||
num->num.data.bytes.Byte4==0);
|
||||
}
|
||||
bNumber = !bInteger;
|
||||
}
|
||||
else if(proc.optional<SxBool>())
|
||||
{
|
||||
bBool = true;
|
||||
}
|
||||
else if(proc.optional<SxErr>())
|
||||
{
|
||||
bNumber = true;
|
||||
}
|
||||
else if(proc.optional<SXString>())
|
||||
{
|
||||
bString = true;
|
||||
}
|
||||
else if(proc.optional<SXDtr>())
|
||||
{
|
||||
bDate =true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
@ -52,6 +52,13 @@ public:
|
||||
static const ElementType type = typeSXOPER;
|
||||
|
||||
BaseObjectPtr m_element;
|
||||
|
||||
bool bString;
|
||||
bool bDate;
|
||||
bool bNumber;
|
||||
bool bEmpty;
|
||||
bool bInteger;
|
||||
bool bBool;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -140,12 +140,8 @@ int SXRANGE::serialize(std::wostream & strm)
|
||||
SXDtr* startDate = dynamic_cast<SXDtr*>(m_arSXDtr[0].get());
|
||||
SXDtr* endDate = dynamic_cast<SXDtr*>(m_arSXDtr[1].get());
|
||||
|
||||
std::wstringstream s_start, s_end;
|
||||
s_start << startDate->yr << L"-" << startDate->mon << L"-" << startDate->dom << L"T" << startDate->hr << L":" << startDate->min << L":" << startDate->sec;
|
||||
s_end << endDate->yr << L"-" << endDate->mon << L"-" << endDate->dom << L"T" << endDate->hr << L":" << endDate->min << L":" << endDate->sec;
|
||||
|
||||
CP_XML_ATTR(L"startDate", s_start.str());
|
||||
CP_XML_ATTR(L"endDate", s_end.str());
|
||||
CP_XML_ATTR(L"startDate", startDate->get_string_date());
|
||||
CP_XML_ATTR(L"endDate", endDate->get_string_date());
|
||||
}
|
||||
if (m_arSXNum.size() == 3)
|
||||
{
|
||||
|
||||
@ -54,7 +54,6 @@ BaseObjectPtr SXSRC::clone()
|
||||
return BaseObjectPtr(new SXSRC(*this));
|
||||
}
|
||||
|
||||
|
||||
// SXSRC = DREF / SXTBL / DBQUERY
|
||||
const bool SXSRC::loadContent(BinProcessor& proc)
|
||||
{
|
||||
|
||||
@ -31,11 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "XFS.h"
|
||||
#include <Logic/Biff_records/XF.h>
|
||||
#include <Logic/Biff_records/XFCRC.h>
|
||||
#include <Logic/Biff_records/XFExt.h>
|
||||
|
||||
#include <Logic/Biff_structures/ExtProp.h>
|
||||
#include "../Biff_records/XF.h"
|
||||
#include "../Biff_records/XFCRC.h"
|
||||
#include "../Biff_records/XFExt.h"
|
||||
|
||||
#include "../Biff_structures/ExtProp.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -114,6 +114,8 @@ GlobalWorkbookInfo::GlobalWorkbookInfo(const unsigned short code_page, XlsConver
|
||||
cellStyleXfs_count = 0;
|
||||
cellStyleDxfs_count = 0;
|
||||
|
||||
connectionId = 0;
|
||||
|
||||
defaultDigitFontSize = std::pair<float, float>(0, 0);
|
||||
applicationFonts = NULL;
|
||||
}
|
||||
|
||||
@ -60,6 +60,13 @@ static const std::wstring DefaultPalette[] = {
|
||||
L"00003366", L"00339966", L"00003300", L"00333300", L"00993300", L"00993366", L"00333399", L"00333333"
|
||||
};
|
||||
|
||||
|
||||
struct _sx_name
|
||||
{
|
||||
BaseObjectPtr name;
|
||||
std::vector<BaseObjectPtr> pair;
|
||||
};
|
||||
|
||||
class GlobalWorkbookInfo
|
||||
{
|
||||
public:
|
||||
@ -75,7 +82,6 @@ public:
|
||||
|
||||
unsigned int GenerateAXESId();
|
||||
|
||||
|
||||
unsigned short CodePage;
|
||||
CRYPT::DecryptorPtr decryptor;
|
||||
std::wstring password;
|
||||
@ -100,6 +106,10 @@ public:
|
||||
const static unsigned int initial_AXES_id = 0x2000000;
|
||||
|
||||
std::map<int, BaseObjectPtr> mapPivotCache;
|
||||
std::vector<bool> arPivotCacheFields;
|
||||
std::vector<bool> arPivotCacheFieldShortSize;
|
||||
std::vector<_sx_name> arPivotSxNames;
|
||||
|
||||
std::map<std::wstring, std::vector<std::wstring>> mapDefineNames;
|
||||
std::vector<std::wstring> arDefineNames;
|
||||
std::vector<std::wstring> arExternalNames;
|
||||
@ -132,6 +142,9 @@ public:
|
||||
int cellStyleDxfs_count;
|
||||
|
||||
std::wstringstream users_Dxfs_stream;
|
||||
std::wstringstream connections_stream;
|
||||
|
||||
int connectionId;
|
||||
|
||||
XlsConverter *xls_converter;
|
||||
|
||||
|
||||
@ -218,7 +218,6 @@ XlsConverter::XlsConverter(const std::wstring & xls_file, const std::wstring & _
|
||||
xls_global_info->mapPivotCache.insert(std::make_pair(index, pivot_cache));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -533,6 +532,7 @@ void XlsConverter::convert(XLS::GlobalsSubstream* global)
|
||||
{
|
||||
convert((XLS::PIVOTCACHEDEFINITION*)global->m_arPIVOTCACHEDEFINITION[i].get());
|
||||
}
|
||||
xlsx_context->get_pivots_context().add_connections(xls_global_info->connections_stream.str());
|
||||
}
|
||||
|
||||
typedef boost::unordered_map<XLS::FillInfo, int> mapFillInfo;
|
||||
@ -1916,6 +1916,18 @@ void XlsConverter::convert(XLS::PIVOTVIEW * pivot_view)
|
||||
{
|
||||
if (pivot_view == NULL) return;
|
||||
|
||||
std::wstringstream strm;
|
||||
|
||||
pivot_view->serialize(strm);
|
||||
|
||||
int index_view = xlsx_context->get_pivots_context().add_view(strm.str(), pivot_view->indexCache);
|
||||
|
||||
if (index_view > 0)
|
||||
{
|
||||
xlsx_context->current_sheet().sheet_rels().add(oox::relationship(L"pvId" + std::to_wstring(index_view),
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
|
||||
L"../pivotTables/pivotTable" + std::to_wstring(index_view) + L".xml"));
|
||||
}
|
||||
}
|
||||
|
||||
void XlsConverter::convert(XLS::PIVOTCACHEDEFINITION * pivot_cached)
|
||||
|
||||
@ -272,16 +272,35 @@ void xlsx_conversion_context::end_document()
|
||||
CP_XML_ATTR(L"r:id", rId);
|
||||
}
|
||||
|
||||
xlsx_pivots_context_.dump_rels(i, content->get_rels());
|
||||
xlsx_pivots_context_.write_definitions_to(i, content->definitions());
|
||||
xlsx_pivots_context_.write_records_to(i, content->records());
|
||||
xlsx_pivots_context_.dump_rels_cache(i, content->get_rels());
|
||||
xlsx_pivots_context_.write_cache_definitions_to(i, content->definitions());
|
||||
xlsx_pivots_context_.write_cache_records_to(i, content->records());
|
||||
|
||||
output_document_->get_xl_files().add_pivot_cache(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int pivot_view_count = xlsx_pivots_context_.get_view_count();
|
||||
if (pivot_view_count > 0)
|
||||
{
|
||||
for (int i = 0; i < pivot_view_count; i++)
|
||||
{
|
||||
package::pivot_table_content_ptr content = package::pivot_table_content::create();
|
||||
|
||||
xlsx_pivots_context_.dump_rels_view(i, content->get_rels());
|
||||
xlsx_pivots_context_.write_table_view_to(i, content->content());
|
||||
|
||||
output_document_->get_xl_files().add_pivot_table(content);
|
||||
}
|
||||
}
|
||||
if (xlsx_pivots_context_.is_connections())
|
||||
{
|
||||
std::wstringstream strm;
|
||||
xlsx_pivots_context_.write_connections_to(strm);
|
||||
|
||||
output_document_->get_xl_files().set_connections( package::simple_element::create(L"connections.xml", strm.str()) );
|
||||
}
|
||||
}
|
||||
output_document_->get_xl_files().set_workbook( package::simple_element::create(L"workbook.xml", strm_workbook.str()) );
|
||||
|
||||
output_document_->content_type().set_media(get_mediaitems());
|
||||
@ -294,10 +313,8 @@ void xlsx_conversion_context::end_document()
|
||||
output_document_->get_xl_files().set_vml_drawings(drawings_vml);
|
||||
|
||||
package::xl_comments_ptr comments = package::xl_comments::create(xlsx_comments_context_handle_.content());
|
||||
output_document_->get_xl_files().set_comments(comments);
|
||||
|
||||
output_document_->get_xl_files().set_comments(comments);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2423,7 +2423,7 @@ void xlsx_drawing_context::set_custom_connection(std::vector<ODRAW::MSOPOINT>& p
|
||||
|
||||
current_drawing_states->back()->custom_connection = points;
|
||||
}
|
||||
void xlsx_drawing_context::set_custom_connectionDir(std::vector<ODRAW::FixedPoint>& points)
|
||||
void xlsx_drawing_context::set_custom_connectionDir(std::vector<OSHARED::FixedPoint>& points)
|
||||
{
|
||||
if (current_drawing_states == NULL) return;
|
||||
if (current_drawing_states->empty()) return;
|
||||
|
||||
@ -182,7 +182,7 @@ public:
|
||||
std::vector<ODRAW::MSOPOINT> custom_verticles;
|
||||
std::vector<ODRAW::ADJH> custom_adjustHandles;
|
||||
std::vector<ODRAW::MSOPOINT> custom_connection;
|
||||
std::vector<ODRAW::FixedPoint> custom_connectionDir;
|
||||
std::vector<OSHARED::FixedPoint>custom_connectionDir;
|
||||
std::vector<ODRAW::MSORECT> custom_inscribe;
|
||||
|
||||
_rect custom_rect;
|
||||
@ -413,7 +413,7 @@ public:
|
||||
void set_custom_adjustValues(std::vector<_CP_OPT(int)> & values);
|
||||
void set_custom_path (int type_path);
|
||||
void set_custom_connection (std::vector<ODRAW::MSOPOINT> & points);
|
||||
void set_custom_connectionDir(std::vector<ODRAW::FixedPoint>& points);
|
||||
void set_custom_connectionDir(std::vector<OSHARED::FixedPoint>& points);
|
||||
void set_custom_inscribe (std::vector<ODRAW::MSORECT> & rects);
|
||||
void set_custom_x_limo (int val);
|
||||
void set_custom_y_limo (int val);
|
||||
|
||||
@ -53,7 +53,6 @@ xlsx_content_types_file::xlsx_content_types_file()
|
||||
|
||||
content_type_.add_override(L"/_rels/.rels", L"application/vnd.openxmlformats-package.relationships+xml");
|
||||
content_type_.add_override(L"/xl/_rels/workbook.xml.rels", L"application/vnd.openxmlformats-package.relationships+xml");
|
||||
content_type_.add_override(L"/xl/sharedStrings.xml", L"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml");
|
||||
content_type_.add_override(L"/xl/workbook.xml", L"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml");
|
||||
content_type_.add_override(L"/xl/styles.xml", L"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml");
|
||||
content_type_.add_override(L"/docProps/app.xml", L"application/vnd.openxmlformats-officedocument.extended-properties+xml");
|
||||
@ -89,13 +88,20 @@ _CP_PTR(pivot_cache_content) pivot_cache_content::create()
|
||||
{
|
||||
return boost::make_shared<pivot_cache_content>();
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
pivot_table_content::pivot_table_content() : rels_file_(rels_file::create(L""))
|
||||
{
|
||||
}
|
||||
|
||||
_CP_PTR(pivot_table_content) pivot_table_content::create()
|
||||
{
|
||||
return boost::make_shared<pivot_table_content>();
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
sheet_content::sheet_content() : rels_(rels_file::create(L""))
|
||||
{
|
||||
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
|
||||
_CP_PTR(sheet_content) sheet_content::create()
|
||||
{
|
||||
return boost::make_shared<sheet_content>();
|
||||
@ -169,21 +175,37 @@ void xl_files::write(const std::wstring & RootPath)
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"xl";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
sheets_files_.set_rels(&rels_files_);
|
||||
{
|
||||
pivot_cache_files_.set_rels(&rels_files_);
|
||||
pivot_cache_files_.set_main_document(get_main_document());
|
||||
pivot_cache_files_.write(path);
|
||||
}
|
||||
{
|
||||
pivot_table_files_.set_main_document(get_main_document());
|
||||
pivot_table_files_.write(path);
|
||||
}
|
||||
|
||||
sheets_files_.set_rels(&rels_files_);
|
||||
sheets_files_.set_main_document( this->get_main_document() );
|
||||
sheets_files_.write(path);
|
||||
|
||||
int index = 1;
|
||||
if (true)
|
||||
{
|
||||
//workbook_->hyperlinks->write(path);
|
||||
rels_files_.add( relationship( L"hId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"xl/workbook.xml" ) );
|
||||
}
|
||||
if (sharedStrings_)
|
||||
{
|
||||
sharedStrings_->write(path);
|
||||
rels_files_.add( relationship( L"shId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings", L"sharedStrings.xml" ) );
|
||||
}
|
||||
|
||||
content_type & contentTypes = this->get_main_document()->content_type().get_content_type();
|
||||
contentTypes.add_override(L"/xl/sharedStrings.xml", L"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml");
|
||||
}
|
||||
|
||||
if (connections_)
|
||||
{
|
||||
connections_->write(path);
|
||||
rels_files_.add( relationship( L"cnId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections", L"connections.xml" ) );
|
||||
|
||||
content_type & contentTypes = this->get_main_document()->content_type().get_content_type();
|
||||
contentTypes.add_override(L"/xl/connections.xml", L"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml");
|
||||
}
|
||||
|
||||
if (styles_)
|
||||
{
|
||||
@ -206,16 +228,11 @@ void xl_files::write(const std::wstring & RootPath)
|
||||
media_->set_main_document(get_main_document());
|
||||
media_->write(path);
|
||||
}
|
||||
|
||||
{
|
||||
charts_files_.set_main_document(get_main_document());
|
||||
charts_files_.write(path);
|
||||
}
|
||||
{
|
||||
pivot_cache_files_.set_rels(&rels_files_);
|
||||
pivot_cache_files_.set_main_document(get_main_document());
|
||||
pivot_cache_files_.write(path);
|
||||
}
|
||||
|
||||
if (drawings_)
|
||||
{
|
||||
drawings_->set_main_document(get_main_document());
|
||||
@ -249,6 +266,10 @@ void xl_files::set_sharedStrings(element_ptr Element)
|
||||
{
|
||||
sharedStrings_ = Element;
|
||||
}
|
||||
void xl_files::set_connections(element_ptr Element)
|
||||
{
|
||||
connections_ = Element;
|
||||
}
|
||||
|
||||
void xl_files::add_sheet(sheet_content_ptr sheet)
|
||||
{
|
||||
@ -281,6 +302,10 @@ void xl_files::add_pivot_cache(pivot_cache_content_ptr pivot_cache)
|
||||
{
|
||||
pivot_cache_files_.add_pivot_cache(pivot_cache);
|
||||
}
|
||||
void xl_files::add_pivot_table(pivot_table_content_ptr pivot_table)
|
||||
{
|
||||
pivot_table_files_.add_pivot_table(pivot_table);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------
|
||||
void xl_pivot_cache_files::add_pivot_cache(pivot_cache_content_ptr pivot_cache)
|
||||
{
|
||||
@ -326,7 +351,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
const std::wstring fileNameR = std::wstring(L"pivotCacheRecords") + std::to_wstring(i + 1) + L".xml";
|
||||
|
||||
contentTypes.add_override(std::wstring(L"/xl/pivotCache/") + fileNameR, kWSConTypeD);
|
||||
contentTypes.add_override(std::wstring(L"/xl/pivotCache/") + fileNameR, kWSConTypeR);
|
||||
|
||||
package::simple_element(fileNameR, content_records).write(path);
|
||||
}
|
||||
@ -334,6 +359,41 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------
|
||||
void xl_pivot_table_files::add_pivot_table(pivot_table_content_ptr pivot_table)
|
||||
{
|
||||
pivot_tables_.push_back(pivot_table);
|
||||
}
|
||||
void xl_pivot_table_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"pivotTables";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
content_type & contentTypes = this->get_main_document()->content_type().get_content_type();
|
||||
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml";
|
||||
|
||||
for (size_t i = 0; i < pivot_tables_.size(); i++)
|
||||
{
|
||||
if (pivot_tables_[i])
|
||||
{
|
||||
const std::wstring fileName = std::wstring(L"pivotTable") + std::to_wstring(i + 1) + L".xml";
|
||||
|
||||
contentTypes.add_override(std::wstring(L"/xl/pivotTables/") + fileName, kWSConType);
|
||||
|
||||
package::simple_element(fileName, pivot_tables_[i]->str()).write(path);
|
||||
|
||||
if (pivot_tables_[i]->get_rels().empty() == false)
|
||||
{
|
||||
rels_files relFiles;
|
||||
pivot_tables_[i]->rels_file_->set_file_name(fileName + L".rels");
|
||||
|
||||
relFiles.add_rel_file(pivot_tables_[i]->rels_file_);
|
||||
relFiles.write(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------
|
||||
void xl_charts_files::add_chart(chart_content_ptr chart)
|
||||
{
|
||||
charts_.push_back(chart);
|
||||
|
||||
@ -89,6 +89,26 @@ private:
|
||||
rels_file_ptr definitions_rels_file_;
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
class pivot_table_content;
|
||||
typedef _CP_PTR(pivot_table_content) pivot_table_content_ptr;
|
||||
|
||||
class pivot_table_content : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
pivot_table_content();
|
||||
static _CP_PTR(pivot_table_content) create();
|
||||
|
||||
std::wostream & content() { return content_; }
|
||||
rels & get_rels() { return rels_file_->get_rels(); }
|
||||
|
||||
std::wstring str() { return content_.str(); }
|
||||
|
||||
friend class xl_pivot_table_files;
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_file_;
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
class sheets_files : public element
|
||||
{
|
||||
public:
|
||||
@ -119,7 +139,16 @@ public:
|
||||
std::vector<chart_content_ptr> charts_;
|
||||
|
||||
};
|
||||
|
||||
class xl_pivot_table_files : public element
|
||||
{
|
||||
public:
|
||||
xl_pivot_table_files(){}
|
||||
|
||||
void add_pivot_table(pivot_table_content_ptr pivot_table);
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
std::vector<pivot_table_content_ptr> pivot_tables_;
|
||||
};
|
||||
class xl_pivot_cache_files : public element
|
||||
{
|
||||
public:
|
||||
@ -194,23 +223,26 @@ public:
|
||||
void set_workbook (element_ptr Element);
|
||||
void set_styles (element_ptr Element);
|
||||
void set_sharedStrings (element_ptr Element);
|
||||
void set_connections (element_ptr Element);
|
||||
void add_sheet (sheet_content_ptr sheet);
|
||||
void set_media (external_items & _Mediaitems);
|
||||
void set_drawings (element_ptr Element);
|
||||
void set_vml_drawings (element_ptr Element);
|
||||
void set_comments (element_ptr Element);
|
||||
void add_charts (chart_content_ptr chart);
|
||||
void add_pivot_cache (pivot_cache_content_ptr pivot);
|
||||
|
||||
void add_pivot_cache (pivot_cache_content_ptr cache);
|
||||
void add_pivot_table (pivot_table_content_ptr table);
|
||||
private:
|
||||
rels_files rels_files_;
|
||||
sheets_files sheets_files_;
|
||||
xl_charts_files charts_files_;
|
||||
xl_pivot_cache_files pivot_cache_files_;
|
||||
xl_pivot_table_files pivot_table_files_;
|
||||
|
||||
element_ptr theme_;
|
||||
element_ptr workbook_;
|
||||
|
||||
element_ptr connections_;
|
||||
element_ptr styles_;
|
||||
element_ptr sharedStrings_;
|
||||
element_ptr media_;
|
||||
|
||||
@ -31,14 +31,11 @@
|
||||
*/
|
||||
#include "xlsx_pivots_context.h"
|
||||
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <simple_xml_writer.h>
|
||||
|
||||
namespace oox {
|
||||
|
||||
|
||||
|
||||
class xlsx_pivots_context::Impl
|
||||
{
|
||||
public:
|
||||
@ -47,10 +44,17 @@ public:
|
||||
std::wstring definitionsData_;
|
||||
std::wstring recordsData_;
|
||||
};
|
||||
struct _pivot_view
|
||||
{
|
||||
std::wstring data_;
|
||||
int indexCache_;
|
||||
};
|
||||
|
||||
Impl() {}
|
||||
|
||||
std::vector<_pivot_cache> caches_;
|
||||
std::vector<_pivot_cache> caches_;
|
||||
std::vector<_pivot_view> views_;
|
||||
std::wstring connections_;
|
||||
};
|
||||
|
||||
xlsx_pivots_context::xlsx_pivots_context() : impl_(new xlsx_pivots_context::Impl())
|
||||
@ -67,24 +71,74 @@ int xlsx_pivots_context::get_cache_count()
|
||||
{
|
||||
return (int)impl_->caches_.size();
|
||||
}
|
||||
void xlsx_pivots_context::dump_rels(int index, rels & Rels)
|
||||
bool xlsx_pivots_context::is_connections()
|
||||
{
|
||||
if (!impl_->caches_[index].recordsData_.empty())
|
||||
return !impl_->connections_.empty();
|
||||
}
|
||||
void xlsx_pivots_context::dump_rels_cache(int index, rels & Rels)
|
||||
{
|
||||
if (impl_->caches_[index].recordsData_.empty() == false)
|
||||
{
|
||||
Rels.add(relationship(L"rId1",
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",
|
||||
L"pivotCacheRecords" + std::to_wstring(index) + L".xml", L""));
|
||||
L"pivotCacheRecords" + std::to_wstring(index + 1) + L".xml", L""));
|
||||
}
|
||||
}
|
||||
void xlsx_pivots_context::write_definitions_to(int index, std::wostream & strm)
|
||||
void xlsx_pivots_context::dump_rels_view(int index, rels & Rels)
|
||||
{
|
||||
if (impl_->views_[index].indexCache_ >= 0)
|
||||
{
|
||||
Rels.add(relationship(L"rId1",
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
|
||||
L"../pivotCache/pivotCacheDefinition" + std::to_wstring(impl_->views_[index].indexCache_ + 1) + L".xml", L""));
|
||||
}
|
||||
}
|
||||
void xlsx_pivots_context::write_cache_definitions_to(int index, std::wostream & strm)
|
||||
{
|
||||
strm << impl_->caches_[index].definitionsData_;
|
||||
}
|
||||
void xlsx_pivots_context::write_connections_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"connections")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
|
||||
void xlsx_pivots_context::write_records_to(int index, std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->connections_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_pivots_context::write_cache_records_to(int index, std::wostream & strm)
|
||||
{
|
||||
strm << impl_->caches_[index].recordsData_;
|
||||
}
|
||||
void xlsx_pivots_context::write_table_view_to(int index, std::wostream & strm)
|
||||
{
|
||||
strm << impl_->views_[index].data_;
|
||||
}
|
||||
int xlsx_pivots_context::add_view(std::wstring table_view, int indexCache)
|
||||
{
|
||||
if (table_view.empty()) return 0;
|
||||
|
||||
Impl::_pivot_view v = {table_view, indexCache};
|
||||
impl_->views_.push_back(v);
|
||||
|
||||
return (int)impl_->views_.size();
|
||||
}
|
||||
|
||||
void xlsx_pivots_context::add_connections(std::wstring connections)
|
||||
{
|
||||
if (connections.empty()) return;
|
||||
|
||||
impl_->connections_ = connections;
|
||||
}
|
||||
|
||||
int xlsx_pivots_context::get_view_count()
|
||||
{
|
||||
return (int)impl_->views_.size();
|
||||
}
|
||||
|
||||
xlsx_pivots_context::~xlsx_pivots_context()
|
||||
{
|
||||
|
||||
@ -43,13 +43,24 @@ public:
|
||||
xlsx_pivots_context();
|
||||
~xlsx_pivots_context();
|
||||
|
||||
int add_view(std::wstring table_view, int indexCache);
|
||||
int get_view_count();
|
||||
|
||||
void add_cache(std::wstring definitions, std::wstring records);
|
||||
int get_cache_count();
|
||||
|
||||
void write_definitions_to (int index, std::wostream & strm);
|
||||
void write_records_to (int index, std::wostream & strm);
|
||||
void write_cache_definitions_to (int index, std::wostream & strm);
|
||||
void write_cache_records_to (int index, std::wostream & strm);
|
||||
void write_connections_to (std::wostream & strm);
|
||||
|
||||
void write_table_view_to (int index, std::wostream & strm);
|
||||
|
||||
void dump_rels_cache(int index, rels & Rels);
|
||||
void dump_rels_view (int index, rels & Rels);
|
||||
|
||||
void add_connections(std::wstring connections);
|
||||
bool is_connections();
|
||||
|
||||
void dump_rels(int index, rels & Rels);
|
||||
private:
|
||||
class Impl;
|
||||
_CP_PTR(Impl) impl_;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
@CMAKE_CONFIGURABLE_FILE_CONTENT@
|
||||
|
||||
@ -1,535 +0,0 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
/* Time with sys/time test */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if ((struct tm *) 0)
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_O_NONBLOCK
|
||||
|
||||
/* headers for FCNTL_O_NONBLOCK test */
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
/* */
|
||||
#if defined(sun) || defined(__sun__) || \
|
||||
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# if defined(__SVR4) || defined(__srv4__)
|
||||
# define PLATFORM_SOLARIS
|
||||
# else
|
||||
# define PLATFORM_SUNOS4
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
|
||||
# define PLATFORM_AIX_V3
|
||||
#endif
|
||||
/* */
|
||||
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
|
||||
#error "O_NONBLOCK does not work on this platform"
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
/* O_NONBLOCK source test */
|
||||
int flags = 0;
|
||||
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* tests for gethostbyaddr_r or gethostbyname_r */
|
||||
#if defined(HAVE_GETHOSTBYADDR_R_5_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_7_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_8_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||
# define _REENTRANT
|
||||
/* no idea whether _REENTRANT is always set, just invent a new flag */
|
||||
# define TEST_GETHOSTBYFOO_REENTRANT
|
||||
#endif
|
||||
#if defined(HAVE_GETHOSTBYADDR_R_5) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_7) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_8) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||
defined(TEST_GETHOSTBYFOO_REENTRANT)
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int main(void)
|
||||
{
|
||||
char *address = "example.com";
|
||||
int length = 0;
|
||||
int type = 0;
|
||||
struct hostent h;
|
||||
int rc = 0;
|
||||
#if defined(HAVE_GETHOSTBYADDR_R_5) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_5_REENTRANT) || \
|
||||
\
|
||||
defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
|
||||
struct hostent_data hdata;
|
||||
#elif defined(HAVE_GETHOSTBYADDR_R_7) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_7_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_8) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_8_REENTRANT) || \
|
||||
\
|
||||
defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent *hp;
|
||||
#endif
|
||||
|
||||
#ifndef gethostbyaddr_r
|
||||
(void)gethostbyaddr_r;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETHOSTBYADDR_R_5) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_5_REENTRANT)
|
||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
||||
#elif defined(HAVE_GETHOSTBYADDR_R_7) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_7_REENTRANT)
|
||||
hp = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &h_errnop);
|
||||
(void)hp;
|
||||
#elif defined(HAVE_GETHOSTBYADDR_R_8) || \
|
||||
defined(HAVE_GETHOSTBYADDR_R_8_REENTRANT)
|
||||
rc = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &hp, &h_errnop);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
|
||||
rc = gethostbyname_r(address, &h, &hdata);
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
|
||||
rc = gethostbyname_r(address, &h, buffer, 8192, 0, &h_errnop);
|
||||
(void)hp; /* not used for test */
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||
rc = gethostbyname_r(address, &h, buffer, 8192, &hp, &h_errnop);
|
||||
#endif
|
||||
|
||||
(void)length;
|
||||
(void)type;
|
||||
(void)rc;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SOCKLEN_T
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if ((socklen_t *) 0)
|
||||
return 0;
|
||||
if (sizeof (socklen_t))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IN_ADDR_T
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if ((in_addr_t *) 0)
|
||||
return 0;
|
||||
if (sizeof (in_addr_t))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BOOL_T
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (sizeof (bool *) )
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <float.h>
|
||||
int main() { return 0; }
|
||||
#endif
|
||||
#ifdef RETSIGTYPE_TEST
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#ifdef signal
|
||||
# undef signal
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" void (*signal (int, void (*)(int)))(int);
|
||||
#else
|
||||
void (*signal ()) ();
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_INET_NTOA_R_DECL
|
||||
#include <arpa/inet.h>
|
||||
|
||||
typedef void (*func_type)();
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef inet_ntoa_r
|
||||
func_type func;
|
||||
func = (func_type)inet_ntoa_r;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_INET_NTOA_R_DECL_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <arpa/inet.h>
|
||||
|
||||
typedef void (*func_type)();
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef inet_ntoa_r
|
||||
func_type func;
|
||||
func = (func_type)&inet_ntoa_r;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
struct addrinfo hints, *ai;
|
||||
int error;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
#ifndef getaddrinfo
|
||||
(void)getaddrinfo;
|
||||
#endif
|
||||
error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
|
||||
if (error) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_FILE_OFFSET_BITS
|
||||
#ifdef _FILE_OFFSET_BITS
|
||||
#undef _FILE_OFFSET_BITS
|
||||
#endif
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#include <sys/types.h>
|
||||
/* Check that off_t can represent 2**63 - 1 correctly.
|
||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
int main () { ; return 0; }
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
/* ioctlsocket source code */
|
||||
int socket;
|
||||
unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET_CAMEL
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
/* IoctlSocket source code */
|
||||
if(0 != IoctlSocket(0, 0, 0))
|
||||
return 1;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
/* IoctlSocket source code */
|
||||
long flags = 0;
|
||||
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET_FIONBIO
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
int flags = 0;
|
||||
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTL_FIONBIO
|
||||
/* headers for FIONBIO test */
|
||||
/* includes start */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_STROPTS_H
|
||||
# include <stropts.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
int flags = 0;
|
||||
if(0 != ioctl(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTL_SIOCGIFADDR
|
||||
/* headers for FIONBIO test */
|
||||
/* includes start */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_STROPTS_H
|
||||
# include <stropts.h>
|
||||
#endif
|
||||
#include <net/if.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct ifreq ifr;
|
||||
if(0 != ioctl(0, SIOCGIFADDR, &ifr))
|
||||
return 1;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
/* includes start */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
/* includes end */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
|
||||
return 1;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GLIBC_STRERROR_R
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
int
|
||||
main () {
|
||||
char buffer[1024]; /* big enough to play with */
|
||||
char *string =
|
||||
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
/* this should've returned a string */
|
||||
if(!string || !string[0])
|
||||
return 99;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_POSIX_STRERROR_R
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
int
|
||||
main () {
|
||||
char buffer[1024]; /* big enough to play with */
|
||||
int error =
|
||||
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
/* This should've returned zero, and written an error string in the
|
||||
buffer.*/
|
||||
if(!buffer[0] || error)
|
||||
return 99;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -1,289 +0,0 @@
|
||||
# - Try to find the GSS Kerberos library
|
||||
# Once done this will define
|
||||
#
|
||||
# GSS_ROOT_DIR - Set this variable to the root installation of GSS
|
||||
#
|
||||
# Read-Only variables:
|
||||
# GSS_FOUND - system has the Heimdal library
|
||||
# GSS_FLAVOUR - "MIT" or "Heimdal" if anything found.
|
||||
# GSS_INCLUDE_DIR - the Heimdal include directory
|
||||
# GSS_LIBRARIES - The libraries needed to use GSS
|
||||
# GSS_LINK_DIRECTORIES - Directories to add to linker search path
|
||||
# GSS_LINKER_FLAGS - Additional linker flags
|
||||
# GSS_COMPILER_FLAGS - Additional compiler flags
|
||||
# GSS_VERSION - This is set to version advertised by pkg-config or read from manifest.
|
||||
# In case the library is found but no version info availabe it'll be set to "unknown"
|
||||
|
||||
set(_MIT_MODNAME mit-krb5-gssapi)
|
||||
set(_HEIMDAL_MODNAME heimdal-gssapi)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckTypeSize)
|
||||
|
||||
set(_GSS_ROOT_HINTS
|
||||
"${GSS_ROOT_DIR}"
|
||||
"$ENV{GSS_ROOT_DIR}"
|
||||
)
|
||||
|
||||
# try to find library using system pkg-config if user didn't specify root dir
|
||||
if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
|
||||
if(UNIX)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_search_module(_GSS_PKG ${_MIT_MODNAME} ${_HEIMDAL_MODNAME})
|
||||
list(APPEND _GSS_ROOT_HINTS "${_GSS_PKG_PREFIX}")
|
||||
elseif(WIN32)
|
||||
list(APPEND _GSS_ROOT_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos;InstallDir]")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approach.
|
||||
find_file(_GSS_CONFIGURE_SCRIPT
|
||||
NAMES
|
||||
"krb5-config"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
# if not found in user-supplied directories, maybe system knows better
|
||||
find_file(_GSS_CONFIGURE_SCRIPT
|
||||
NAMES
|
||||
"krb5-config"
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
)
|
||||
|
||||
if(_GSS_CONFIGURE_SCRIPT)
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--cflags" "gssapi"
|
||||
OUTPUT_VARIABLE _GSS_CFLAGS
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
)
|
||||
message(STATUS "CFLAGS: ${_GSS_CFLAGS}")
|
||||
if(NOT _GSS_CONFIGURE_FAILED) # 0 means success
|
||||
# should also work in an odd case when multiple directories are given
|
||||
string(STRIP "${_GSS_CFLAGS}" _GSS_CFLAGS)
|
||||
string(REGEX REPLACE " +-I" ";" _GSS_CFLAGS "${_GSS_CFLAGS}")
|
||||
string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1"_GSS_CFLAGS "${_GSS_CFLAGS}")
|
||||
|
||||
foreach(_flag ${_GSS_CFLAGS})
|
||||
if(_flag MATCHES "^-I.*")
|
||||
string(REGEX REPLACE "^-I" "" _val "${_flag}")
|
||||
list(APPEND _GSS_INCLUDE_DIR "${_val}")
|
||||
else()
|
||||
list(APPEND _GSS_COMPILER_FLAGS "${_flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--libs" "gssapi"
|
||||
OUTPUT_VARIABLE _GSS_LIB_FLAGS
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
)
|
||||
message(STATUS "LDFLAGS: ${_GSS_LIB_FLAGS}")
|
||||
if(NOT _GSS_CONFIGURE_FAILED) # 0 means success
|
||||
# this script gives us libraries and link directories. Blah. We have to deal with it.
|
||||
string(STRIP "${_GSS_LIB_FLAGS}" _GSS_LIB_FLAGS)
|
||||
string(REGEX REPLACE " +-(L|l)" ";-\\1" _GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
||||
string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1"_GSS_LIB_FLAGS "${_GSS_LIB_FLAGS}")
|
||||
|
||||
foreach(_flag ${_GSS_LIB_FLAGS})
|
||||
if(_flag MATCHES "^-l.*")
|
||||
string(REGEX REPLACE "^-l" "" _val "${_flag}")
|
||||
list(APPEND _GSS_LIBRARIES "${_val}")
|
||||
elseif(_flag MATCHES "^-L.*")
|
||||
string(REGEX REPLACE "^-L" "" _val "${_flag}")
|
||||
list(APPEND _GSS_LINK_DIRECTORIES "${_val}")
|
||||
else()
|
||||
list(APPEND _GSS_LINKER_FLAGS "${_flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--version"
|
||||
OUTPUT_VARIABLE _GSS_VERSION
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
)
|
||||
|
||||
# older versions may not have the "--version" parameter. In this case we just don't care.
|
||||
if(_GSS_CONFIGURE_FAILED)
|
||||
set(_GSS_VERSION 0)
|
||||
endif()
|
||||
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--vendor"
|
||||
OUTPUT_VARIABLE _GSS_VENDOR
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
)
|
||||
|
||||
# older versions may not have the "--vendor" parameter. In this case we just don't care.
|
||||
if(_GSS_CONFIGURE_FAILED)
|
||||
set(GSS_FLAVOUR "Heimdal") # most probably, shouldn't really matter
|
||||
else()
|
||||
if(_GSS_VENDOR MATCHES ".*H|heimdal.*")
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
else()
|
||||
set(GSS_FLAVOUR "MIT")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else() # either there is no config script or we are on platform that doesn't provide one (Windows?)
|
||||
|
||||
find_path(_GSS_INCLUDE_DIR
|
||||
NAMES
|
||||
"gssapi/gssapi.h"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
inc
|
||||
)
|
||||
|
||||
if(_GSS_INCLUDE_DIR) #jay, we've found something
|
||||
set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIR}")
|
||||
check_include_files( "gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _GSS_HAVE_MIT_HEADERS)
|
||||
|
||||
if(_GSS_HAVE_MIT_HEADERS)
|
||||
set(GSS_FLAVOUR "MIT")
|
||||
else()
|
||||
# prevent compiling the header - just check if we can include it
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
|
||||
check_include_file( "roken.h" _GSS_HAVE_ROKEN_H)
|
||||
|
||||
check_include_file( "heimdal/roken.h" _GSS_HAVE_HEIMDAL_ROKEN_H)
|
||||
if(_GSS_HAVE_ROKEN_H OR _GSS_HAVE_HEIMDAL_ROKEN_H)
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "")
|
||||
endif()
|
||||
else()
|
||||
# I'm not convienced if this is the right way but this is what autotools do at the moment
|
||||
find_path(_GSS_INCLUDE_DIR
|
||||
NAMES
|
||||
"gssapi.h"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
inc
|
||||
)
|
||||
|
||||
if(_GSS_INCLUDE_DIR)
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# if we have headers, check if we can link libraries
|
||||
if(GSS_FLAVOUR)
|
||||
set(_GSS_LIBDIR_SUFFIXES "")
|
||||
set(_GSS_LIBDIR_HINTS ${_GSS_ROOT_HINTS})
|
||||
get_filename_component(_GSS_CALCULATED_POTENTIAL_ROOT "${_GSS_INCLUDE_DIR}" PATH)
|
||||
list(APPEND _GSS_LIBDIR_HINTS ${_GSS_CALCULATED_POTENTIAL_ROOT})
|
||||
|
||||
if(WIN32)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND _GSS_LIBDIR_SUFFIXES "lib/AMD64")
|
||||
if(GSS_FLAVOUR STREQUAL "MIT")
|
||||
set(_GSS_LIBNAME "gssapi64")
|
||||
else()
|
||||
set(_GSS_LIBNAME "libgssapi")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND _GSS_LIBDIR_SUFFIXES "lib/i386")
|
||||
if(GSS_FLAVOUR STREQUAL "MIT")
|
||||
set(_GSS_LIBNAME "gssapi32")
|
||||
else()
|
||||
set(_GSS_LIBNAME "libgssapi")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
list(APPEND _GSS_LIBDIR_SUFFIXES "lib;lib64") # those suffixes are not checked for HINTS
|
||||
if(GSS_FLAVOUR STREQUAL "MIT")
|
||||
set(_GSS_LIBNAME "gssapi_krb5")
|
||||
else()
|
||||
set(_GSS_LIBNAME "gssapi")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(_GSS_LIBRARIES
|
||||
NAMES
|
||||
${_GSS_LIBNAME}
|
||||
HINTS
|
||||
${_GSS_LIBDIR_HINTS}
|
||||
PATH_SUFFIXES
|
||||
${_GSS_LIBDIR_SUFFIXES}
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
else()
|
||||
if(_GSS_PKG_${_MIT_MODNAME}_VERSION)
|
||||
set(GSS_FLAVOUR "MIT")
|
||||
set(_GSS_VERSION _GSS_PKG_${_MIT_MODNAME}_VERSION)
|
||||
else()
|
||||
set(GSS_FLAVOUR "Heimdal")
|
||||
set(_GSS_VERSION _GSS_PKG_${_MIT_HEIMDAL}_VERSION)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(GSS_INCLUDE_DIR ${_GSS_INCLUDE_DIR})
|
||||
set(GSS_LIBRARIES ${_GSS_LIBRARIES})
|
||||
set(GSS_LINK_DIRECTORIES ${_GSS_LINK_DIRECTORIES})
|
||||
set(GSS_LINKER_FLAGS ${_GSS_LINKER_FLAGS})
|
||||
set(GSS_COMPILER_FLAGS ${_GSS_COMPILER_FLAGS})
|
||||
set(GSS_VERSION ${_GSS_VERSION})
|
||||
|
||||
if(GSS_FLAVOUR)
|
||||
|
||||
if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal")
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.amd64.manifest")
|
||||
else()
|
||||
set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.x86.manifest")
|
||||
endif()
|
||||
|
||||
if(EXISTS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}")
|
||||
file(STRINGS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}" heimdal_version_str
|
||||
REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$")
|
||||
|
||||
string(REGEX MATCH "[0-9]\\.[^\"]+"
|
||||
GSS_VERSION "${heimdal_version_str}")
|
||||
endif()
|
||||
|
||||
if(NOT GSS_VERSION)
|
||||
set(GSS_VERSION "Heimdal Unknown")
|
||||
endif()
|
||||
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT")
|
||||
get_filename_component(_MIT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE)
|
||||
if(WIN32 AND _MIT_VERSION)
|
||||
set(GSS_VERSION "${_MIT_VERSION}")
|
||||
else()
|
||||
set(GSS_VERSION "MIT Unknown")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
set(_GSS_REQUIRED_VARS GSS_LIBRARIES GSS_FLAVOUR)
|
||||
|
||||
find_package_handle_standard_args(GSS
|
||||
REQUIRED_VARS
|
||||
${_GSS_REQUIRED_VARS}
|
||||
VERSION_VAR
|
||||
GSS_VERSION
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
|
||||
)
|
||||
|
||||
mark_as_advanced(GSS_INCLUDE_DIR GSS_LIBRARIES)
|
||||
@ -1,95 +0,0 @@
|
||||
#File defines convenience macros for available feature testing
|
||||
|
||||
# This macro checks if the symbol exists in the library and if it
|
||||
# does, it prepends library to the list. It is intended to be called
|
||||
# multiple times with a sequence of possibly dependent libraries in
|
||||
# order of least-to-most-dependent. Some libraries depend on others
|
||||
# to link correctly.
|
||||
macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
|
||||
check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}"
|
||||
${VARIABLE})
|
||||
if(${VARIABLE})
|
||||
set(CURL_LIBS ${LIBRARY} ${CURL_LIBS})
|
||||
endif(${VARIABLE})
|
||||
endmacro(CHECK_LIBRARY_EXISTS_CONCAT)
|
||||
|
||||
# Check if header file exists and add it to the list.
|
||||
# This macro is intended to be called multiple times with a sequence of
|
||||
# possibly dependent header files. Some headers depend on others to be
|
||||
# compiled correctly.
|
||||
macro(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
|
||||
check_include_files("${CURL_INCLUDES};${FILE}" ${VARIABLE})
|
||||
if(${VARIABLE})
|
||||
set(CURL_INCLUDES ${CURL_INCLUDES} ${FILE})
|
||||
set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}")
|
||||
endif(${VARIABLE})
|
||||
endmacro(CHECK_INCLUDE_FILE_CONCAT)
|
||||
|
||||
# For other curl specific tests, use this macro.
|
||||
macro(CURL_INTERNAL_TEST CURL_TEST)
|
||||
if(NOT DEFINED "${CURL_TEST}")
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}")
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CURL_TEST_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
message(STATUS "Performing Curl Test ${CURL_TEST}")
|
||||
try_compile(${CURL_TEST}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
"${CURL_TEST_ADD_LIBRARIES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(${CURL_TEST})
|
||||
set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
message(STATUS "Performing Curl Test ${CURL_TEST} - Success")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing Curl Test ${CURL_TEST} passed with the following output:\n"
|
||||
"${OUTPUT}\n")
|
||||
else(${CURL_TEST})
|
||||
message(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
|
||||
set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||
"${OUTPUT}\n")
|
||||
endif(${CURL_TEST})
|
||||
endif()
|
||||
endmacro(CURL_INTERNAL_TEST)
|
||||
|
||||
macro(CURL_INTERNAL_TEST_RUN CURL_TEST)
|
||||
if(NOT DEFINED "${CURL_TEST}_COMPILE")
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CURL_TEST_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
message(STATUS "Performing Curl Test ${CURL_TEST}")
|
||||
try_run(${CURL_TEST} ${CURL_TEST}_COMPILE
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
"${CURL_TEST_ADD_LIBRARIES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||
set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
message(STATUS "Performing Curl Test ${CURL_TEST} - Success")
|
||||
else(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||
message(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
|
||||
set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||
"${OUTPUT}")
|
||||
if(${CURL_TEST}_COMPILE)
|
||||
file(APPEND
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||
"There was a problem running this test\n")
|
||||
endif(${CURL_TEST}_COMPILE)
|
||||
file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||
"\n\n")
|
||||
endif(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||
endif()
|
||||
endmacro(CURL_INTERNAL_TEST_RUN)
|
||||
@ -1,229 +0,0 @@
|
||||
include(CheckCSourceCompiles)
|
||||
# The begin of the sources (macros and includes)
|
||||
set(_source_epilogue "#undef inline")
|
||||
|
||||
macro(add_header_include check header)
|
||||
if(${check})
|
||||
set(_source_epilogue "${_source_epilogue}\n#include <${header}>")
|
||||
endif(${check})
|
||||
endmacro(add_header_include)
|
||||
|
||||
set(signature_call_conv)
|
||||
if(HAVE_WINDOWS_H)
|
||||
add_header_include(HAVE_WINDOWS_H "windows.h")
|
||||
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||
add_header_include(HAVE_WINSOCK_H "winsock.h")
|
||||
set(_source_epilogue
|
||||
"${_source_epilogue}\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif")
|
||||
set(signature_call_conv "PASCAL")
|
||||
if(HAVE_LIBWS2_32)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
|
||||
endif()
|
||||
else(HAVE_WINDOWS_H)
|
||||
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||
add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
|
||||
endif(HAVE_WINDOWS_H)
|
||||
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
int main(void) {
|
||||
recv(0, 0, 0, 0);
|
||||
return 0;
|
||||
}" curl_cv_recv)
|
||||
if(curl_cv_recv)
|
||||
if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
foreach(recv_retv "int" "ssize_t" )
|
||||
foreach(recv_arg1 "int" "ssize_t" "SOCKET")
|
||||
foreach(recv_arg2 "void *" "char *")
|
||||
foreach(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||
foreach(recv_arg4 "int" "unsigned int")
|
||||
if(NOT curl_cv_func_recv_done)
|
||||
unset(curl_cv_func_recv_test CACHE)
|
||||
check_c_source_compiles("
|
||||
${_source_epilogue}
|
||||
extern ${recv_retv} ${signature_call_conv}
|
||||
recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4});
|
||||
int main(void) {
|
||||
${recv_arg1} s=0;
|
||||
${recv_arg2} buf=0;
|
||||
${recv_arg3} len=0;
|
||||
${recv_arg4} flags=0;
|
||||
${recv_retv} res = recv(s, buf, len, flags);
|
||||
(void) res;
|
||||
return 0;
|
||||
}"
|
||||
curl_cv_func_recv_test)
|
||||
message(STATUS
|
||||
"Tested: ${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})")
|
||||
if(curl_cv_func_recv_test)
|
||||
set(curl_cv_func_recv_args
|
||||
"${recv_arg1},${recv_arg2},${recv_arg3},${recv_arg4},${recv_retv}")
|
||||
set(RECV_TYPE_ARG1 "${recv_arg1}")
|
||||
set(RECV_TYPE_ARG2 "${recv_arg2}")
|
||||
set(RECV_TYPE_ARG3 "${recv_arg3}")
|
||||
set(RECV_TYPE_ARG4 "${recv_arg4}")
|
||||
set(RECV_TYPE_RETV "${recv_retv}")
|
||||
set(HAVE_RECV 1)
|
||||
set(curl_cv_func_recv_done 1)
|
||||
endif(curl_cv_func_recv_test)
|
||||
endif(NOT curl_cv_func_recv_done)
|
||||
endforeach(recv_arg4)
|
||||
endforeach(recv_arg3)
|
||||
endforeach(recv_arg2)
|
||||
endforeach(recv_arg1)
|
||||
endforeach(recv_retv)
|
||||
else()
|
||||
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}")
|
||||
endif()
|
||||
|
||||
if("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
message(FATAL_ERROR "Cannot find proper types to use for recv args")
|
||||
endif("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
else(curl_cv_recv)
|
||||
message(FATAL_ERROR "Unable to link function recv")
|
||||
endif(curl_cv_recv)
|
||||
set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
|
||||
set(HAVE_RECV 1)
|
||||
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
int main(void) {
|
||||
send(0, 0, 0, 0);
|
||||
return 0;
|
||||
}" curl_cv_send)
|
||||
if(curl_cv_send)
|
||||
if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
foreach(send_retv "int" "ssize_t" )
|
||||
foreach(send_arg1 "int" "ssize_t" "SOCKET")
|
||||
foreach(send_arg2 "const void *" "void *" "char *" "const char *")
|
||||
foreach(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||
foreach(send_arg4 "int" "unsigned int")
|
||||
if(NOT curl_cv_func_send_done)
|
||||
unset(curl_cv_func_send_test CACHE)
|
||||
check_c_source_compiles("
|
||||
${_source_epilogue}
|
||||
extern ${send_retv} ${signature_call_conv}
|
||||
send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4});
|
||||
int main(void) {
|
||||
${send_arg1} s=0;
|
||||
${send_arg2} buf=0;
|
||||
${send_arg3} len=0;
|
||||
${send_arg4} flags=0;
|
||||
${send_retv} res = send(s, buf, len, flags);
|
||||
(void) res;
|
||||
return 0;
|
||||
}"
|
||||
curl_cv_func_send_test)
|
||||
message(STATUS
|
||||
"Tested: ${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})")
|
||||
if(curl_cv_func_send_test)
|
||||
string(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}")
|
||||
string(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}")
|
||||
set(curl_cv_func_send_args
|
||||
"${send_arg1},${send_arg2},${send_arg3},${send_arg4},${send_retv},${send_qual_arg2}")
|
||||
set(SEND_TYPE_ARG1 "${send_arg1}")
|
||||
set(SEND_TYPE_ARG2 "${send_arg2}")
|
||||
set(SEND_TYPE_ARG3 "${send_arg3}")
|
||||
set(SEND_TYPE_ARG4 "${send_arg4}")
|
||||
set(SEND_TYPE_RETV "${send_retv}")
|
||||
set(HAVE_SEND 1)
|
||||
set(curl_cv_func_send_done 1)
|
||||
endif(curl_cv_func_send_test)
|
||||
endif(NOT curl_cv_func_send_done)
|
||||
endforeach(send_arg4)
|
||||
endforeach(send_arg3)
|
||||
endforeach(send_arg2)
|
||||
endforeach(send_arg1)
|
||||
endforeach(send_retv)
|
||||
else()
|
||||
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}")
|
||||
endif()
|
||||
|
||||
if("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
message(FATAL_ERROR "Cannot find proper types to use for send args")
|
||||
endif("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
set(SEND_QUAL_ARG2 "const")
|
||||
else(curl_cv_send)
|
||||
message(FATAL_ERROR "Unable to link function send")
|
||||
endif(curl_cv_send)
|
||||
set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
|
||||
set(HAVE_SEND 1)
|
||||
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
int main(void) {
|
||||
int flag = MSG_NOSIGNAL;
|
||||
(void)flag;
|
||||
return 0;
|
||||
}" HAVE_MSG_NOSIGNAL)
|
||||
|
||||
if(NOT HAVE_WINDOWS_H)
|
||||
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
|
||||
add_header_include(TIME_WITH_SYS_TIME "time.h")
|
||||
add_header_include(HAVE_TIME_H "time.h")
|
||||
endif()
|
||||
check_c_source_compiles("${_source_epilogue}
|
||||
int main(void) {
|
||||
struct timeval ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_usec = 0;
|
||||
(void)ts;
|
||||
return 0;
|
||||
}" HAVE_STRUCT_TIMEVAL)
|
||||
|
||||
|
||||
include(CheckCSourceRuns)
|
||||
set(CMAKE_REQUIRED_FLAGS)
|
||||
if(HAVE_SYS_POLL_H)
|
||||
set(CMAKE_REQUIRED_FLAGS "-DHAVE_SYS_POLL_H")
|
||||
endif(HAVE_SYS_POLL_H)
|
||||
check_c_source_runs("
|
||||
#ifdef HAVE_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
int main(void) {
|
||||
return poll((void *)0, 0, 10 /*ms*/);
|
||||
}" HAVE_POLL_FINE)
|
||||
|
||||
set(HAVE_SIG_ATOMIC_T 1)
|
||||
set(CMAKE_REQUIRED_FLAGS)
|
||||
if(HAVE_SIGNAL_H)
|
||||
set(CMAKE_REQUIRED_FLAGS "-DHAVE_SIGNAL_H")
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
|
||||
endif(HAVE_SIGNAL_H)
|
||||
check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
|
||||
if(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||
check_c_source_compiles("
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
# include <signal.h>
|
||||
#endif
|
||||
int main(void) {
|
||||
static volatile sig_atomic_t dummy = 0;
|
||||
(void)dummy;
|
||||
return 0;
|
||||
}" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
if(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
set(HAVE_SIG_ATOMIC_T_VOLATILE 1)
|
||||
endif(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
endif(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||
|
||||
if(HAVE_WINDOWS_H)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h)
|
||||
else()
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
if(HAVE_SYS_SOCKET_H)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
|
||||
endif(HAVE_SYS_SOCKET_H)
|
||||
endif()
|
||||
|
||||
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
|
||||
endif(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
|
||||
@ -1,125 +0,0 @@
|
||||
if(NOT UNIX)
|
||||
if(WIN32)
|
||||
set(HAVE_LIBDL 0)
|
||||
set(HAVE_LIBUCB 0)
|
||||
set(HAVE_LIBSOCKET 0)
|
||||
set(NOT_NEED_LIBNSL 0)
|
||||
set(HAVE_LIBNSL 0)
|
||||
set(HAVE_GETHOSTNAME 1)
|
||||
set(HAVE_LIBZ 0)
|
||||
set(HAVE_LIBCRYPTO 0)
|
||||
|
||||
set(HAVE_DLOPEN 0)
|
||||
|
||||
set(HAVE_ALLOCA_H 0)
|
||||
set(HAVE_ARPA_INET_H 0)
|
||||
set(HAVE_DLFCN_H 0)
|
||||
set(HAVE_FCNTL_H 1)
|
||||
set(HAVE_INTTYPES_H 0)
|
||||
set(HAVE_IO_H 1)
|
||||
set(HAVE_MALLOC_H 1)
|
||||
set(HAVE_MEMORY_H 1)
|
||||
set(HAVE_NETDB_H 0)
|
||||
set(HAVE_NETINET_IF_ETHER_H 0)
|
||||
set(HAVE_NETINET_IN_H 0)
|
||||
set(HAVE_NET_IF_H 0)
|
||||
set(HAVE_PROCESS_H 1)
|
||||
set(HAVE_PWD_H 0)
|
||||
set(HAVE_SETJMP_H 1)
|
||||
set(HAVE_SGTTY_H 0)
|
||||
set(HAVE_SIGNAL_H 1)
|
||||
set(HAVE_SOCKIO_H 0)
|
||||
set(HAVE_STDINT_H 0)
|
||||
set(HAVE_STDLIB_H 1)
|
||||
set(HAVE_STRINGS_H 0)
|
||||
set(HAVE_STRING_H 1)
|
||||
set(HAVE_SYS_PARAM_H 0)
|
||||
set(HAVE_SYS_POLL_H 0)
|
||||
set(HAVE_SYS_SELECT_H 0)
|
||||
set(HAVE_SYS_SOCKET_H 0)
|
||||
set(HAVE_SYS_SOCKIO_H 0)
|
||||
set(HAVE_SYS_STAT_H 1)
|
||||
set(HAVE_SYS_TIME_H 0)
|
||||
set(HAVE_SYS_TYPES_H 1)
|
||||
set(HAVE_SYS_UTIME_H 1)
|
||||
set(HAVE_TERMIOS_H 0)
|
||||
set(HAVE_TERMIO_H 0)
|
||||
set(HAVE_TIME_H 1)
|
||||
set(HAVE_UNISTD_H 0)
|
||||
set(HAVE_UTIME_H 0)
|
||||
set(HAVE_X509_H 0)
|
||||
set(HAVE_ZLIB_H 0)
|
||||
|
||||
set(HAVE_SIZEOF_LONG_DOUBLE 1)
|
||||
set(SIZEOF_LONG_DOUBLE 8)
|
||||
|
||||
set(HAVE_SOCKET 1)
|
||||
set(HAVE_POLL 0)
|
||||
set(HAVE_SELECT 1)
|
||||
set(HAVE_STRDUP 1)
|
||||
set(HAVE_STRSTR 1)
|
||||
set(HAVE_STRTOK_R 0)
|
||||
set(HAVE_STRFTIME 1)
|
||||
set(HAVE_UNAME 0)
|
||||
set(HAVE_STRCASECMP 0)
|
||||
set(HAVE_STRICMP 1)
|
||||
set(HAVE_STRCMPI 1)
|
||||
set(HAVE_GETHOSTBYADDR 1)
|
||||
set(HAVE_GETTIMEOFDAY 0)
|
||||
set(HAVE_INET_ADDR 1)
|
||||
set(HAVE_INET_NTOA 1)
|
||||
set(HAVE_INET_NTOA_R 0)
|
||||
set(HAVE_TCGETATTR 0)
|
||||
set(HAVE_TCSETATTR 0)
|
||||
set(HAVE_PERROR 1)
|
||||
set(HAVE_CLOSESOCKET 1)
|
||||
set(HAVE_SETVBUF 0)
|
||||
set(HAVE_SIGSETJMP 0)
|
||||
set(HAVE_GETPASS_R 0)
|
||||
set(HAVE_STRLCAT 0)
|
||||
set(HAVE_GETPWUID 0)
|
||||
set(HAVE_GETEUID 0)
|
||||
set(HAVE_UTIME 1)
|
||||
set(HAVE_RAND_EGD 0)
|
||||
set(HAVE_RAND_SCREEN 0)
|
||||
set(HAVE_RAND_STATUS 0)
|
||||
set(HAVE_GMTIME_R 0)
|
||||
set(HAVE_LOCALTIME_R 0)
|
||||
set(HAVE_GETHOSTBYADDR_R 0)
|
||||
set(HAVE_GETHOSTBYNAME_R 0)
|
||||
set(HAVE_SIGNAL_FUNC 1)
|
||||
set(HAVE_SIGNAL_MACRO 0)
|
||||
|
||||
set(HAVE_GETHOSTBYADDR_R_5 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_7 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_8 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_3 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_6 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
|
||||
|
||||
set(TIME_WITH_SYS_TIME 0)
|
||||
set(HAVE_O_NONBLOCK 0)
|
||||
set(HAVE_IN_ADDR_T 0)
|
||||
set(HAVE_INET_NTOA_R_DECL 0)
|
||||
set(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
|
||||
if(ENABLE_IPV6)
|
||||
set(HAVE_GETADDRINFO 1)
|
||||
else()
|
||||
set(HAVE_GETADDRINFO 0)
|
||||
endif()
|
||||
set(STDC_HEADERS 1)
|
||||
set(RETSIGTYPE_TEST 1)
|
||||
|
||||
set(HAVE_SIGACTION 0)
|
||||
set(HAVE_MACRO_SIGSETJMP 0)
|
||||
else(WIN32)
|
||||
message("This file should be included on Windows platform only")
|
||||
endif(WIN32)
|
||||
endif(NOT UNIX)
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
# File containing various utilities
|
||||
|
||||
# Converts a CMake list to a string containing elements separated by spaces
|
||||
function(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR)
|
||||
set(NEW_LIST_SPACE)
|
||||
foreach(ITEM ${${_LIST_NAME}})
|
||||
set(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}")
|
||||
endforeach()
|
||||
string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
|
||||
set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Appends a lis of item to a string which is a space-separated list, if they don't already exist.
|
||||
function(LIST_SPACES_APPEND_ONCE LIST_NAME)
|
||||
string(REPLACE " " ";" _LIST ${${LIST_NAME}})
|
||||
list(APPEND _LIST ${ARGN})
|
||||
list(REMOVE_DUPLICATES _LIST)
|
||||
to_list_spaces(_LIST NEW_LIST_SPACE)
|
||||
set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value.
|
||||
# Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND)
|
||||
function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL)
|
||||
list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS)
|
||||
if(${FIND_POS} EQUAL -1)
|
||||
set(${RETVAL} FALSE PARENT_SCOPE)
|
||||
else()
|
||||
set(${RETVAL} TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,21 +0,0 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2015, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright
|
||||
notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
||||
OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization of the copyright holder.
|
||||
@ -1,146 +0,0 @@
|
||||
#!/bin/bash
|
||||
# This script performs all of the steps needed to build a
|
||||
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
|
||||
#
|
||||
# Hendrik Visage:
|
||||
# Generalizations added since Snowleopard (10.6) do not include
|
||||
# the 10.4u SDK.
|
||||
#
|
||||
# Also note:
|
||||
# 10.5 is the *ONLY* SDK that support PPC64 :( -- 10.6 do not have ppc64 support
|
||||
#If you need to have PPC64 support then change below to 1
|
||||
PPC64_NEEDED=0
|
||||
# Apple does not support building for PPC anymore in Xcode 4 and later.
|
||||
# If you're using Xcode 3 or earlier and need PPC support, then change
|
||||
# the setting below to 1
|
||||
PPC_NEEDED=0
|
||||
|
||||
# For me the default is to develop for the platform I am on, and if you
|
||||
#desire compatibility with older versions then change USE_OLD to 1 :)
|
||||
USE_OLD=0
|
||||
|
||||
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
|
||||
FRAMEWORK_VERSION=Versions/Release-$VERSION
|
||||
|
||||
#I also wanted to "copy over" the system, and thus the reason I added the
|
||||
# version to Versions/Release-7.20.1 etc.
|
||||
# now a simple rsync -vaP libcurl.framework /Library/Frameworks will install it
|
||||
# and setup the right paths to this version, leaving the system version
|
||||
# "intact", so you can "fix" it later with the links to Versions/A/...
|
||||
|
||||
DEVELOPER_PATH=`xcode-select --print-path`
|
||||
# Around Xcode 4.3, SDKs were moved from the Developer folder into the
|
||||
# MacOSX.platform folder
|
||||
if test -d "$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs"; then
|
||||
SDK_PATH="$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs"
|
||||
else
|
||||
SDK_PATH="$DEVELOPER_PATH/SDKs";
|
||||
fi
|
||||
OLD_SDK=`ls $SDK_PATH|head -1`
|
||||
NEW_SDK=`ls -r $SDK_PATH|head -1`
|
||||
|
||||
if test "0"$USE_OLD -gt 0
|
||||
then
|
||||
SDK32=$OLD_SDK
|
||||
else
|
||||
SDK32=$NEW_SDK
|
||||
fi
|
||||
|
||||
MACVER=`echo $SDK32|sed -e s/[a-zA-Z]//g -e s/.\$//`
|
||||
|
||||
SDK32_DIR=$SDK_PATH/$SDK32
|
||||
MINVER32='-mmacosx-version-min='$MACVER
|
||||
if test $PPC_NEEDED -gt 0; then
|
||||
ARCHES32='-arch i386 -arch ppc'
|
||||
else
|
||||
ARCHES32='-arch i386'
|
||||
fi
|
||||
|
||||
if test $PPC64_NEEDED -gt 0
|
||||
then
|
||||
SDK64=10.5
|
||||
ARCHES64='-arch x86_64 -arch ppc64'
|
||||
SDK64=`ls $SDK_PATH|grep 10.5|head -1`
|
||||
else
|
||||
ARCHES64='-arch x86_64'
|
||||
#We "know" that 10.4 and earlier do not support 64bit
|
||||
OLD_SDK64=`ls $SDK_PATH|egrep -v "10.[0-4]"|head -1`
|
||||
NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4]"|head -1`
|
||||
if test $USE_OLD -gt 0
|
||||
then
|
||||
SDK64=$OLD_SDK64
|
||||
else
|
||||
SDK64=$NEW_SDK64
|
||||
fi
|
||||
fi
|
||||
|
||||
SDK64_DIR=$SDK_PATH/$SDK64
|
||||
MACVER64=`echo $SDK64|sed -e s/[a-zA-Z]//g -e s/.\$//`
|
||||
|
||||
MINVER64='-mmacosx-version-min='$MACVER64
|
||||
|
||||
if test ! -z $SDK32; then
|
||||
echo "----Configuring libcurl for 32 bit universal framework..."
|
||||
make clean
|
||||
./configure --disable-dependency-tracking --disable-static --with-gssapi --with-darwinssl \
|
||||
CFLAGS="-Os -isysroot $SDK32_DIR $ARCHES32" \
|
||||
LDFLAGS="-Wl,-syslibroot,$SDK32_DIR $ARCHES32 -Wl,-headerpad_max_install_names" \
|
||||
CC=$CC
|
||||
|
||||
echo "----Building 32 bit libcurl..."
|
||||
make -j `sysctl -n hw.logicalcpu_max`
|
||||
|
||||
echo "----Creating 32 bit framework..."
|
||||
rm -r libcurl.framework
|
||||
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources
|
||||
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist
|
||||
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||
cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||
pushd libcurl.framework
|
||||
ln -fs ${FRAMEWORK_VERSION}/libcurl libcurl
|
||||
ln -fs ${FRAMEWORK_VERSION}/Resources Resources
|
||||
ln -fs ${FRAMEWORK_VERSION}/Headers Headers
|
||||
cd Versions
|
||||
ln -fs $(basename "${FRAMEWORK_VERSION}") Current
|
||||
|
||||
echo Testing for SDK64
|
||||
if test -d $SDK64_DIR; then
|
||||
echo entering...
|
||||
popd
|
||||
make clean
|
||||
echo "----Configuring libcurl for 64 bit universal framework..."
|
||||
./configure --disable-dependency-tracking --disable-static --with-gssapi --with-darwinssl \
|
||||
CFLAGS="-Os -isysroot $SDK64_DIR $ARCHES64" \
|
||||
LDFLAGS="-Wl,-syslibroot,$SDK64_DIR $ARCHES64 -Wl,-headerpad_max_install_names" \
|
||||
CC=$CC
|
||||
|
||||
echo "----Building 64 bit libcurl..."
|
||||
make -j `sysctl -n hw.logicalcpu_max`
|
||||
|
||||
echo "----Appending 64 bit framework to 32 bit framework..."
|
||||
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||
cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32
|
||||
pwd
|
||||
lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
rm libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||
cp libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild32.h
|
||||
cp include/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild64.h
|
||||
cat >libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h <<EOF
|
||||
#ifdef __LP64__
|
||||
#include "curl/curlbuild64.h"
|
||||
#else
|
||||
#include "curl/curlbuild32.h"
|
||||
#endif
|
||||
EOF
|
||||
fi
|
||||
|
||||
pwd
|
||||
lipo -info libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
echo "libcurl.framework is built and can now be included in other projects."
|
||||
echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
|
||||
else
|
||||
echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4/5/6 SDK installed."
|
||||
fi
|
||||
@ -1,530 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in \
|
||||
CMake/CurlTests.c CMake/FindGSS.cmake CMake/OtherTests.cmake \
|
||||
CMake/Platforms/WindowsCache.cmake CMake/Utilities.cmake \
|
||||
include/curl/curlbuild.h.cmake CMake/Macros.cmake
|
||||
|
||||
VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl
|
||||
VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp
|
||||
VC6_LIBDSP_DEPS = $(VC6_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC6_SRCTMPL = projects/Windows/VC6/src/curlsrc.tmpl
|
||||
VC6_SRCDSP = projects/Windows/VC6/src/curlsrc.dsp
|
||||
VC6_SRCDSP_DEPS = $(VC6_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC7_LIBTMPL = projects/Windows/VC7/lib/libcurl.tmpl
|
||||
VC7_LIBVCPROJ = projects/Windows/VC7/lib/libcurl.vcproj
|
||||
VC7_LIBVCPROJ_DEPS = $(VC7_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC7_SRCTMPL = projects/Windows/VC7/src/curlsrc.tmpl
|
||||
VC7_SRCVCPROJ = projects/Windows/VC7/src/curlsrc.vcproj
|
||||
VC7_SRCVCPROJ_DEPS = $(VC7_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC71_LIBTMPL = projects/Windows/VC7.1/lib/libcurl.tmpl
|
||||
VC71_LIBVCPROJ = projects/Windows/VC7.1/lib/libcurl.vcproj
|
||||
VC71_LIBVCPROJ_DEPS = $(VC71_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC71_SRCTMPL = projects/Windows/VC7.1/src/curlsrc.tmpl
|
||||
VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curlsrc.vcproj
|
||||
VC71_SRCVCPROJ_DEPS = $(VC71_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC8_LIBTMPL = projects/Windows/VC8/lib/libcurl.tmpl
|
||||
VC8_LIBVCPROJ = projects/Windows/VC8/lib/libcurl.vcproj
|
||||
VC8_LIBVCPROJ_DEPS = $(VC8_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC8_SRCTMPL = projects/Windows/VC8/src/curlsrc.tmpl
|
||||
VC8_SRCVCPROJ = projects/Windows/VC8/src/curlsrc.vcproj
|
||||
VC8_SRCVCPROJ_DEPS = $(VC8_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC9_LIBTMPL = projects/Windows/VC9/lib/libcurl.tmpl
|
||||
VC9_LIBVCPROJ = projects/Windows/VC9/lib/libcurl.vcproj
|
||||
VC9_LIBVCPROJ_DEPS = $(VC9_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC9_SRCTMPL = projects/Windows/VC9/src/curlsrc.tmpl
|
||||
VC9_SRCVCPROJ = projects/Windows/VC9/src/curlsrc.vcproj
|
||||
VC9_SRCVCPROJ_DEPS = $(VC9_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC10_LIBTMPL = projects/Windows/VC10/lib/libcurl.tmpl
|
||||
VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj
|
||||
VC10_LIBVCXPROJ_DEPS = $(VC10_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC10_SRCTMPL = projects/Windows/VC10/src/curlsrc.tmpl
|
||||
VC10_SRCVCXPROJ = projects/Windows/VC10/src/curlsrc.vcxproj
|
||||
VC10_SRCVCXPROJ_DEPS = $(VC10_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC11_LIBTMPL = projects/Windows/VC11/lib/libcurl.tmpl
|
||||
VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj
|
||||
VC11_LIBVCXPROJ_DEPS = $(VC11_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC11_SRCTMPL = projects/Windows/VC11/src/curlsrc.tmpl
|
||||
VC11_SRCVCXPROJ = projects/Windows/VC11/src/curlsrc.vcxproj
|
||||
VC11_SRCVCXPROJ_DEPS = $(VC11_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC12_LIBTMPL = projects/Windows/VC12/lib/libcurl.tmpl
|
||||
VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj
|
||||
VC12_LIBVCXPROJ_DEPS = $(VC12_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC12_SRCTMPL = projects/Windows/VC12/src/curlsrc.tmpl
|
||||
VC12_SRCVCXPROJ = projects/Windows/VC12/src/curlsrc.vcxproj
|
||||
VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC_DIST = projects/README \
|
||||
projects/build-openssl.bat \
|
||||
projects/checksrc.bat \
|
||||
projects/Windows/VC6/curl.dsw \
|
||||
projects/Windows/VC6/lib/libcurl.dsw $(VC6_LIBDSP) \
|
||||
projects/Windows/VC6/src/curlsrc.dsw $(VC6_SRCDSP) \
|
||||
projects/Windows/VC7/curl.sln \
|
||||
projects/Windows/VC7/lib/libcurl.sln $(VC7_LIBVCPROJ) \
|
||||
projects/Windows/VC7/src/curlsrc.sln $(VC7_SRCVCPROJ) \
|
||||
projects/Windows/VC7.1/curl.sln \
|
||||
projects/Windows/VC7.1/lib/libcurl.sln $(VC71_LIBVCPROJ) \
|
||||
projects/Windows/VC7.1/src/curlsrc.sln $(VC71_SRCVCPROJ) \
|
||||
projects/Windows/VC8/curl.sln \
|
||||
projects/Windows/VC8/lib/libcurl.sln $(VC8_LIBVCPROJ) \
|
||||
projects/Windows/VC8/src/curlsrc.sln $(VC8_SRCVCPROJ) \
|
||||
projects/Windows/VC9/curl.sln \
|
||||
projects/Windows/VC9/lib/libcurl.sln $(VC9_LIBVCPROJ) \
|
||||
projects/Windows/VC9/src/curlsrc.sln $(VC9_SRCVCPROJ) \
|
||||
projects/Windows/VC10/curl.sln \
|
||||
projects/Windows/VC10/lib/libcurl.sln $(VC10_LIBVCXPROJ) \
|
||||
projects/Windows/VC10/src/curlsrc.sln $(VC10_SRCVCXPROJ) \
|
||||
projects/Windows/VC11/curl.sln \
|
||||
projects/Windows/VC11/lib/libcurl.sln $(VC11_LIBVCXPROJ) \
|
||||
projects/Windows/VC11/src/curlsrc.sln $(VC11_SRCVCXPROJ) \
|
||||
projects/Windows/VC12/curl.sln \
|
||||
projects/Windows/VC12/lib/libcurl.sln $(VC12_LIBVCXPROJ) \
|
||||
projects/Windows/VC12/src/curlsrc.sln $(VC12_SRCVCXPROJ)
|
||||
|
||||
WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \
|
||||
winbuild/MakefileBuild.vc winbuild/Makefile.vc \
|
||||
winbuild/Makefile.msvc.names
|
||||
|
||||
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
|
||||
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework \
|
||||
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in
|
||||
|
||||
CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
|
||||
$(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \
|
||||
$(VC9_LIBVCPROJ) $(VC9_SRCVCPROJ) $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) \
|
||||
$(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ)
|
||||
|
||||
bin_SCRIPTS = curl-config
|
||||
|
||||
SUBDIRS = lib src include
|
||||
DIST_SUBDIRS = $(SUBDIRS) tests packages docs
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libcurl.pc
|
||||
|
||||
# List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files
|
||||
include lib/Makefile.inc
|
||||
include src/Makefile.inc
|
||||
|
||||
dist-hook:
|
||||
rm -rf $(top_builddir)/tests/log
|
||||
find $(distdir) -name "*.dist" -exec rm {} \;
|
||||
(distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
|
||||
for file in $$distit; do \
|
||||
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
|
||||
cp $$file $(distdir)$$strip; \
|
||||
done)
|
||||
|
||||
html:
|
||||
cd docs; make html
|
||||
|
||||
pdf:
|
||||
cd docs; make pdf
|
||||
|
||||
check: test examples
|
||||
|
||||
if CROSSCOMPILING
|
||||
test-full: test
|
||||
test-torture: test
|
||||
|
||||
test:
|
||||
@echo "NOTICE: we can't run the tests when cross-compiling!"
|
||||
|
||||
else
|
||||
|
||||
test:
|
||||
@(cd tests; $(MAKE) all quiet-test)
|
||||
|
||||
test-full:
|
||||
@(cd tests; $(MAKE) all full-test)
|
||||
|
||||
test-torture:
|
||||
@(cd tests; $(MAKE) all torture-test)
|
||||
|
||||
test-am:
|
||||
@(cd tests; $(MAKE) all am-test)
|
||||
|
||||
endif
|
||||
|
||||
examples:
|
||||
@(cd docs/examples; $(MAKE) check)
|
||||
|
||||
# This is a hook to have 'make clean' also clean up the docs and the tests
|
||||
# dir. The extra check for the Makefiles being present is necessary because
|
||||
# 'make distcheck' will make clean first in these directories _before_ it runs
|
||||
# this hook.
|
||||
clean-local:
|
||||
@(if test -f tests/Makefile; then cd tests; $(MAKE) clean; fi)
|
||||
@(if test -f docs/Makefile; then cd docs; $(MAKE) clean; fi)
|
||||
|
||||
#
|
||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||
# must contain the following line:
|
||||
# %_topdir /home/loic/local/rpm
|
||||
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
|
||||
#
|
||||
# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
|
||||
#
|
||||
# If additional configure flags are needed to build the package, add the
|
||||
# following in ~/.rpmmacros
|
||||
# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
|
||||
# and run make rpm in the following way:
|
||||
# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
|
||||
#
|
||||
|
||||
rpms:
|
||||
$(MAKE) RPMDIST=curl rpm
|
||||
$(MAKE) RPMDIST=curl-ssl rpm
|
||||
|
||||
rpm:
|
||||
RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
|
||||
cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
|
||||
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
|
||||
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
|
||||
mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
|
||||
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
||||
|
||||
#
|
||||
# Build a Solaris pkgadd format file
|
||||
# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
|
||||
# file (which ends up back in this directory).
|
||||
# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
|
||||
# pkgadd -d ./HAXXcurl-*
|
||||
#
|
||||
|
||||
# gak - libtool requires an absoulte directory, hence the pwd below...
|
||||
pkgadd:
|
||||
umask 022 ; \
|
||||
make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \
|
||||
cat COPYING > $(srcdir)/packages/Solaris/copyright ; \
|
||||
cd $(srcdir)/packages/Solaris && $(MAKE) package
|
||||
|
||||
#
|
||||
# Build a cygwin binary tarball installation file
|
||||
# resulting .tar.bz2 file will end up at packages/Win32/cygwin
|
||||
cygwinbin:
|
||||
$(MAKE) -C packages/Win32/cygwin cygwinbin
|
||||
|
||||
# We extend the standard install with a custom hook:
|
||||
install-data-hook:
|
||||
cd include && $(MAKE) install
|
||||
cd docs && $(MAKE) install
|
||||
|
||||
# We extend the standard uninstall with a custom hook:
|
||||
uninstall-hook:
|
||||
cd include && $(MAKE) uninstall
|
||||
cd docs && $(MAKE) uninstall
|
||||
|
||||
ca-bundle: lib/mk-ca-bundle.pl
|
||||
@echo "generating a fresh ca-bundle.crt"
|
||||
@perl $< -b -l -u lib/ca-bundle.crt
|
||||
|
||||
ca-firefox: lib/firefox-db2pem.sh
|
||||
@echo "generating a fresh ca-bundle.crt"
|
||||
./lib/firefox-db2pem.sh lib/ca-bundle.crt
|
||||
|
||||
checksrc:
|
||||
cd lib && $(MAKE) checksrc
|
||||
cd src && $(MAKE) checksrc
|
||||
|
||||
.PHONY: vc-ide
|
||||
|
||||
vc-ide: $(VC6_LIBDSP_DEPS) $(VC6_SRCDSP_DEPS) $(VC7_LIBVCPROJ_DEPS) \
|
||||
$(VC7_SRCVCPROJ_DEPS) $(VC71_LIBVCPROJ_DEPS) $(VC71_SRCVCPROJ_DEPS) \
|
||||
$(VC8_LIBVCPROJ_DEPS) $(VC8_SRCVCPROJ_DEPS) $(VC9_LIBVCPROJ_DEPS) \
|
||||
$(VC9_SRCVCPROJ_DEPS) $(VC10_LIBVCXPROJ_DEPS) $(VC10_SRCVCXPROJ_DEPS) \
|
||||
$(VC11_LIBVCXPROJ_DEPS) $(VC11_SRCVCXPROJ_DEPS) $(VC12_LIBVCXPROJ_DEPS) \
|
||||
$(VC12_SRCVCXPROJ_DEPS)
|
||||
@(win32_lib_srcs='$(LIB_CFILES)'; \
|
||||
win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \
|
||||
win32_lib_rc='$(LIB_RCFILES)'; \
|
||||
win32_lib_vtls_srcs='$(LIB_VTLS_CFILES)'; \
|
||||
win32_lib_vtls_hdrs='$(LIB_VTLS_HFILES)'; \
|
||||
win32_src_srcs='$(CURL_CFILES)'; \
|
||||
win32_src_hdrs='$(CURL_HFILES)'; \
|
||||
win32_src_rc='$(CURL_RCFILES)'; \
|
||||
win32_src_x_srcs='$(CURLX_CFILES)'; \
|
||||
win32_src_x_hdrs='$(CURLX_HFILES) ../lib/config-win32.h'; \
|
||||
\
|
||||
sorted_lib_srcs=`for file in $$win32_lib_srcs; do echo $$file; done | sort`; \
|
||||
sorted_lib_hdrs=`for file in $$win32_lib_hdrs; do echo $$file; done | sort`; \
|
||||
sorted_lib_vtls_srcs=`for file in $$win32_lib_vtls_srcs; do echo $$file; done | sort`; \
|
||||
sorted_lib_vtls_hdrs=`for file in $$win32_lib_vtls_hdrs; do echo $$file; done | sort`; \
|
||||
sorted_src_srcs=`for file in $$win32_src_srcs; do echo $$file; done | sort`; \
|
||||
sorted_src_hdrs=`for file in $$win32_src_hdrs; do echo $$file; done | sort`; \
|
||||
sorted_src_x_srcs=`for file in $$win32_src_x_srcs; do echo $$file; done | sort`; \
|
||||
sorted_src_x_hdrs=`for file in $$win32_src_x_hdrs; do echo $$file; done | sort`; \
|
||||
\
|
||||
awk_code='\
|
||||
function gen_element(type, dir, file)\
|
||||
{\
|
||||
sub(/vtls\//, "", file);\
|
||||
\
|
||||
spaces=" ";\
|
||||
if(dir == "lib\\vtls")\
|
||||
tabs=" ";\
|
||||
else\
|
||||
tabs=" ";\
|
||||
\
|
||||
if(type == "dsp") {\
|
||||
printf("# Begin Source File\r\n");\
|
||||
printf("\r\n");\
|
||||
printf("SOURCE=..\\..\\..\\..\\%s\\%s\r\n", dir, file);\
|
||||
printf("# End Source File\r\n");\
|
||||
}\
|
||||
else if(type == "vcproj1") {\
|
||||
printf("%s<File\r\n", tabs);\
|
||||
printf("%s RelativePath=\"..\\..\\..\\..\\%s\\%s\">\r\n",\
|
||||
tabs, dir, file);\
|
||||
printf("%s</File>\r\n", tabs);\
|
||||
}\
|
||||
else if(type == "vcproj2") {\
|
||||
printf("%s<File\r\n", tabs);\
|
||||
printf("%s RelativePath=\"..\\..\\..\\..\\%s\\%s\"\r\n",\
|
||||
tabs, dir, file);\
|
||||
printf("%s>\r\n", tabs);\
|
||||
printf("%s</File>\r\n", tabs);\
|
||||
}\
|
||||
else if(type == "vcxproj") {\
|
||||
i = index(file, ".");\
|
||||
ext = substr(file, i == 0 ? 0 : i + 1);\
|
||||
\
|
||||
if(ext == "c")\
|
||||
printf("%s<ClCompile Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
|
||||
spaces, dir, file);\
|
||||
else if(ext == "h")\
|
||||
printf("%s<ClInclude Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
|
||||
spaces, dir, file);\
|
||||
else if(ext == "rc")\
|
||||
printf("%s<ResourceCompile Include=\"..\\..\\..\\..\\%s\\%s\" />\r\n",\
|
||||
spaces, dir, file);\
|
||||
}\
|
||||
}\
|
||||
\
|
||||
{\
|
||||
\
|
||||
if($$0 == "CURL_LIB_C_FILES") {\
|
||||
split(lib_srcs, arr);\
|
||||
for(val in arr) gen_element(proj_type, "lib", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_LIB_H_FILES") {\
|
||||
split(lib_hdrs, arr);\
|
||||
for(val in arr) gen_element(proj_type, "lib", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_LIB_RC_FILES") {\
|
||||
split(lib_rc, arr);\
|
||||
for(val in arr) gen_element(proj_type, "lib", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_LIB_VTLS_C_FILES") {\
|
||||
split(lib_vtls_srcs, arr);\
|
||||
for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_LIB_VTLS_H_FILES") {\
|
||||
split(lib_vtls_hdrs, arr);\
|
||||
for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_SRC_C_FILES") {\
|
||||
split(src_srcs, arr);\
|
||||
for(val in arr) gen_element(proj_type, "src", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_SRC_H_FILES") {\
|
||||
split(src_hdrs, arr);\
|
||||
for(val in arr) gen_element(proj_type, "src", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_SRC_RC_FILES") {\
|
||||
split(src_rc, arr);\
|
||||
for(val in arr) gen_element(proj_type, "src", arr[val]);\
|
||||
}\
|
||||
else if($$0 == "CURL_SRC_X_C_FILES") {\
|
||||
split(src_x_srcs, arr);\
|
||||
for(val in arr) {\
|
||||
sub(/..\/lib\//, "", arr[val]);\
|
||||
gen_element(proj_type, "lib", arr[val]);\
|
||||
}\
|
||||
}\
|
||||
else if($$0 == "CURL_SRC_X_H_FILES") {\
|
||||
split(src_x_hdrs, arr);\
|
||||
for(val in arr) {\
|
||||
sub(/..\/lib\//, "", arr[val]);\
|
||||
gen_element(proj_type, "lib", arr[val]);\
|
||||
}\
|
||||
}\
|
||||
else\
|
||||
printf("%s\r\n", $$0);\
|
||||
}';\
|
||||
\
|
||||
echo "generating '$(VC6_LIBDSP)'"; \
|
||||
awk -v proj_type=dsp \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC6_LIBTMPL) > $(VC6_LIBDSP) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC6_SRCDSP)'"; \
|
||||
awk -v proj_type=dsp \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC6_SRCTMPL) > $(VC6_SRCDSP) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC7_LIBVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj1 \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC7_LIBTMPL) > $(VC7_LIBVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC7_SRCVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj1 \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC7_SRCTMPL) > $(VC7_SRCVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC71_LIBVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj1 \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC71_LIBTMPL) > $(VC71_LIBVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC71_SRCVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj1 \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC71_SRCTMPL) > $(VC71_SRCVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC8_LIBVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj2 \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC8_LIBTMPL) > $(VC8_LIBVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC8_SRCVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj2 \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC8_SRCTMPL) > $(VC8_SRCVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC9_LIBVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj2 \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC9_LIBTMPL) > $(VC9_LIBVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC9_SRCVCPROJ)'"; \
|
||||
awk -v proj_type=vcproj2 \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC9_SRCTMPL) > $(VC9_SRCVCPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC10_LIBVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC10_LIBTMPL) > $(VC10_LIBVCXPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC10_SRCVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC10_SRCTMPL) > $(VC10_SRCVCXPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC11_LIBVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC11_LIBTMPL) > $(VC11_LIBVCXPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC11_SRCVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC11_SRCTMPL) > $(VC11_SRCVCXPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC12_LIBVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC12_LIBTMPL) > $(VC12_LIBVCXPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC12_SRCVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; };)
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,49 +0,0 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
README
|
||||
|
||||
Curl is a command line tool for transferring data specified with URL
|
||||
syntax. Find out how to use curl by reading the curl.1 man page or the
|
||||
MANUAL document. Find out how to install Curl by reading the INSTALL
|
||||
document.
|
||||
|
||||
libcurl is the library curl is using to do its job. It is readily
|
||||
available to be used by your software. Read the libcurl.3 man page to
|
||||
learn how!
|
||||
|
||||
You find answers to the most frequent questions we get in the FAQ document.
|
||||
|
||||
Study the COPYING file for distribution terms and similar. If you distribute
|
||||
curl binaries or other binaries that involve libcurl, you might enjoy the
|
||||
LICENSE-MIXING document.
|
||||
|
||||
CONTACT
|
||||
|
||||
If you have problems, questions, ideas or suggestions, please contact us
|
||||
by posting to a suitable mailing list. See http://curl.haxx.se/mail/
|
||||
|
||||
All contributors to the project are listed in the THANKS document.
|
||||
|
||||
WEB SITE
|
||||
|
||||
Visit the curl web site for the latest news and downloads:
|
||||
|
||||
http://curl.haxx.se/
|
||||
|
||||
GIT
|
||||
|
||||
To download the very latest source off the GIT server do this:
|
||||
|
||||
git clone git://github.com/bagder/curl.git
|
||||
|
||||
(you'll get a directory named curl created, filled with the source code)
|
||||
|
||||
NOTICE
|
||||
|
||||
Curl contains pieces of source code that is Copyright (c) 1998, 1999
|
||||
Kungliga Tekniska H<>gskolan. This notice is included here to comply with the
|
||||
distribution terms.
|
||||
@ -1,183 +0,0 @@
|
||||
Curl and libcurl 7.40.0
|
||||
|
||||
Public curl releases: 143
|
||||
Command line options: 162
|
||||
curl_easy_setopt() options: 208
|
||||
Public functions in libcurl: 58
|
||||
Contributors: 1219
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o http_digest: Added support for Windows SSPI based authentication
|
||||
o version info: Added Kerberos V5 to the supported features
|
||||
o Makefile: Added VC targets for WinIDN
|
||||
o config-win32: Introduce build targets for VS2012+
|
||||
o SSL: Add PEM format support for public key pinning
|
||||
o smtp: Added support for the conversion of Unix newlines during mail send [8]
|
||||
o smb: Added initial support for the SMB/CIFS protocol
|
||||
o Added support for HTTP over unix domain sockets, via
|
||||
CURLOPT_UNIX_SOCKET_PATH and --unix-socket
|
||||
o sasl: Added support for GSS-API based Kerberos V5 authentication
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o darwinssl: fix session ID keys to only reuse identical sessions [18]
|
||||
o url-parsing: reject CRLFs within URLs [19]
|
||||
o OS400: Adjust specific support to last release
|
||||
o THANKS: Remove duplicate names
|
||||
o url.c: Fixed compilation warning
|
||||
o ssh: Fixed build on platforms where R_OK is not defined [1]
|
||||
o tool_strdup.c: include the tool strdup.h
|
||||
o build: Fixed Visual Studio project file generation of strdup.[c|h]
|
||||
o curl_easy_setopt.3: add CURLOPT_PINNEDPUBLICKEY [2]
|
||||
o curl.1: show zone index use in a URL
|
||||
o mk-ca-bundle.vbs: switch to new certdata.txt url
|
||||
o Makefile.dist: Added some missing SSPI configurations
|
||||
o build: Fixed no NTLM support for email when CURL_DISABLE_HTTP is defined
|
||||
o SSH: use the port number as well for known_known checks [3]
|
||||
o libssh2: detect features based on version, not configure checks
|
||||
o http2: Deal with HTTP/2 data inside Upgrade response header buffer [4]
|
||||
o multi: removed Curl_multi_set_easy_connection
|
||||
o symbol-scan.pl: do not require autotools
|
||||
o cmake: add ENABLE_THREADED_RESOLVER, rename ARES
|
||||
o cmake: build libhostname for test suite
|
||||
o cmake: fix HAVE_GETHOSTNAME definition
|
||||
o tests: fix libhostname visibility
|
||||
o tests: fix memleak in server/resolve.c
|
||||
o vtls.h: Fixed compiler warning when compiled without SSL
|
||||
o CMake: Restore order-dependent header checks
|
||||
o CMake: Restore order-dependent library checks
|
||||
o tool: Removed krb4 from the supported features
|
||||
o http2: Don't send Upgrade headers when we already do HTTP/2
|
||||
o examples: Don't call select() to sleep on windows [6]
|
||||
o win32: Updated some legacy APIs to use the newer extended versions [5]
|
||||
o easy.c: Fixed compilation warning when no verbose string support
|
||||
o connect.c: Fixed compilation warning when no verbose string support
|
||||
o build: in Makefile.m32 pass -F flag to windres
|
||||
o build: in Makefile.m32 add -m32 flag for 32bit
|
||||
o multi: when leaving for timeout, close accordingly
|
||||
o CMake: Simplify if() conditions on check result variables
|
||||
o build: in Makefile.m32 try to detect 64bit target
|
||||
o multi: inform about closed sockets before they are closed
|
||||
o multi-uv.c: close the file handle after download
|
||||
o examples: Wait recommended 100ms when no file descriptors are ready
|
||||
o ntlm: Split the SSPI based messaging code from the native messaging code
|
||||
o cmake: fix NTLM detection when CURL_DISABLE_HTTP defined
|
||||
o cmake: add Kerberos to the supported feature
|
||||
o CURLOPT_POSTFIELDS.3: mention the COPYPOSTFIELDS option
|
||||
o http: Disable pipelining for HTTP/2 and upgraded connections
|
||||
o ntlm: Fixed static'ness of local decode function
|
||||
o sasl: Reduced the need for two sets of NTLM messaging functions
|
||||
o multi.c: Fixed compilation warnings when no verbose string support
|
||||
o select.c: fix compilation for VxWorks [7]
|
||||
o multi-single.c: switch to use curl_multi_wait
|
||||
o curl_multi_wait.3: clarify numfds being used if not NULL
|
||||
o http.c: Fixed compilation warnings from features being disabled
|
||||
o NSS: enable the CAPATH option [9]
|
||||
o docs: Fix FAILONERROR typos
|
||||
o HTTP: don't abort connections with pending Negotiate authentication
|
||||
o HTTP: Free (proxy)userpwd for NTLM/Negotiate after sending a request
|
||||
o http_perhapsrewind: don't abort CONNECT requests
|
||||
o build: updated dependencies in makefiles
|
||||
o multi.c: Fixed compilation warning
|
||||
o ftp.c: Fixed compilation warnings when proxy support disabled
|
||||
o get_url_file_name: Fixed crash on OOM on debug build
|
||||
o cookie.c: Refactored cleanup code to simplify
|
||||
o OS400: enable NTLM authentication
|
||||
o ntlm: Use Windows Crypt API
|
||||
o http2: avoid logging neg "failure" if h2 was not requested
|
||||
o schannel_recv: return the correct code [10]
|
||||
o VC build: added sspi define for winssl-zlib builds
|
||||
o Curl_client_write(): chop long data, convert data only once
|
||||
o openldap: do not ignore Curl_client_write() return code
|
||||
o ldap: check Curl_client_write() return codes
|
||||
o parsedate.c: Fixed compilation warning
|
||||
o url.c: Fixed compilation warning when USE_NTLM is not defined
|
||||
o ntlm_wb_response: fix "statement not reached" [11]
|
||||
o telnet: fix "cast increases required alignment of target type"
|
||||
o smtp: Fixed dot stuffing when EOL characters at end of input buffers [12]
|
||||
o ntlm: Allow NTLM2Session messages when USE_NTRESPONSES manually defined
|
||||
o ntlm: Disable NTLM v2 when 64-bit integers are not supported
|
||||
o ntlm: Use short integer when decoding 16-bit values
|
||||
o ftp.c: Fixed compilation warning when no verbose string support
|
||||
o synctime.c: fixed timeserver URLs
|
||||
o mk-ca-bundle.pl: restored forced run again
|
||||
o ntlm: Fixed return code for bad type-2 Target Info
|
||||
o curl_schannel.c: Data may be available before connection shutdown
|
||||
o curl_schannel: Improvements to memory re-allocation strategy [13]
|
||||
o darwinssl: aprintf() to allocate the session key
|
||||
o tool_util.c: Use GetTickCount64 if it is available
|
||||
o lib: Fixed multiple code analysis warnings if SAL are available
|
||||
o tool_binmode.c: Explicitly ignore the return code of setmode
|
||||
o tool_urlglob.c: Silence warning C6293: Ill-defined for-loop
|
||||
o opts: Warn CURLOPT_TIMEOUT overrides when set after CURLOPT_TIMEOUT_MS
|
||||
o SFTP: work-around servers that return zero size on STAT [14]
|
||||
o connect: singleipconnect(): properly try other address families after failure
|
||||
o IPV6: address scope != scope id [15]
|
||||
o parseurlandfillconn(): fix improper non-numeric scope_id stripping [16]
|
||||
o secureserver.pl: make OpenSSL CApath and cert absolute path values
|
||||
o secureserver.pl: update Windows detection and fix path conversion
|
||||
o secureserver.pl: clean up formatting of config and fix verbose output
|
||||
o tests: Added Windows support using Cygwin-based OpenSSH
|
||||
o sockfilt.c: use non-Ex functions that are available before WinXP
|
||||
o VMS: Updates for 0740-0D1220
|
||||
o openssl: warn for SRP set if SSLv3 is used, not for TLS version
|
||||
o openssl: make it compile against openssl 1.1.0-DEV master branch
|
||||
o openssl: fix SSL/TLS versions in verbose output
|
||||
o curl: show size of inhibited data when using -v
|
||||
o build: Removed WIN32 definition from the Visual Studio projects
|
||||
o build: Removed WIN64 definition from the libcurl Visual Studio projects
|
||||
o vtls: Use bool for Curl_ssl_getsessionid() return type
|
||||
o sockfilt.c: Replace 100ms sleep with thread throttle
|
||||
o sockfilt.c: Reduce the number of individual memory allocations
|
||||
o vtls: Don't set cert info count until memory allocation is successful
|
||||
o nss: Don't ignore Curl_ssl_init_certinfo() OOM failure
|
||||
o nss: Don't ignore Curl_extract_certinfo() OOM failure
|
||||
o vtls: Fixed compilation warning and an ignored return code
|
||||
o sockfilt.c: Fixed compilation warnings
|
||||
o darwinssl: Fixed compilation warning
|
||||
o vtls: Use '(void) arg' for unused parameters
|
||||
o sepheaders.c: Fixed resource leak on failure
|
||||
o lib1900.c: Fixed cppcheck error [17]
|
||||
o ldap: Fixed Unicode connection details in Win32 initialsation / bind calls
|
||||
o ldap: Fixed Unicode DN, attributes and filter in Win32 search calls
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Andrey Labunets, Anthon Pang, Bill Nagel, Brad Harder, Brad King, Carlo Wood,
|
||||
Christian Hägele, Dan Fandrich, Daniel Stenberg, Dave Reisner, Frank Gevaerts,
|
||||
Gisle Vanem, Guenter Knauf, Jan Ehrhardt, Johan Lantz, John E. Malmberg,
|
||||
Jon Spencer, Julien Nabet, Kamil Dudka, Kyle J. McKay, Lucas Pardue,
|
||||
Marc Hesse, Marc Hoersken, Marc Renault, Michael Osipov, Nick Zitzmann,
|
||||
Nobuhiro Ban, Patrick Monnerat, Peter Wu, Ray Satiro, Sam Hurst,
|
||||
Stefan Bühler, Stefan Neis, Steve Holme, Tae Hyoung Ahn, Tatsuhiro Tsujikawa,
|
||||
Tomasz Kojm, Tor Arntsen, Waldek Kozba, Warren Menzer
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
||||
References to bug reports and discussions on issues:
|
||||
|
||||
[1] = http://curl.haxx.se/mail/lib-2014-11/0035.html
|
||||
[2] = http://curl.haxx.se/mail/lib-2014-11/0078.html
|
||||
[3] = http://curl.haxx.se/bug/view.cgi?id=1448
|
||||
[4] = https://github.com/tatsuhiro-t/nghttp2/issues/103
|
||||
[5] = http://sourceforge.net/p/curl/feature-requests/82/
|
||||
[6] = http://curl.haxx.se/mail/lib-2014-11/0221.html
|
||||
[7] = http://curl.haxx.se/bug/view.cgi?id=1455
|
||||
[8] = http://curl.haxx.se/bug/view.cgi?id=1456
|
||||
[9] = http://curl.haxx.se/bug/view.cgi?id=1457
|
||||
[10] = http://curl.haxx.se/bug/view.cgi?id=1462
|
||||
[11] = http://curl.haxx.se/mail/lib-2014-12/0089.html
|
||||
[12] = http://curl.haxx.se/bug/view.cgi?id=1456
|
||||
[13] = http://curl.haxx.se/bug/view.cgi?id=1450
|
||||
[14] = http://curl.haxx.se/mail/lib-2014-12/0103.html
|
||||
[15] = http://curl.haxx.se/bug/view.cgi?id=1451
|
||||
[16] = http://curl.haxx.se/bug/view.cgi?id=1449
|
||||
[17] = https://github.com/bagder/curl/pull/133
|
||||
[18] = http://curl.haxx.se/docs/adv_20150108A.html
|
||||
[19] = http://curl.haxx.se/docs/adv_20150108B.html
|
||||
File diff suppressed because it is too large
Load Diff
1205
Common/3dParty/curl/aclocal.m4
vendored
1205
Common/3dParty/curl/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
43
Common/3dParty/curl/build.bat
Normal file
43
Common/3dParty/curl/build.bat
Normal file
@ -0,0 +1,43 @@
|
||||
SET SCRIPTPATH=%~dp0
|
||||
CD /D %~dp0
|
||||
SET MACHINE=x86
|
||||
if defined ProgramFiles(x86) (
|
||||
SET MACHINE=x64
|
||||
)
|
||||
|
||||
if "%TARGET%" == "win-32" (
|
||||
SET MACHINE=x86
|
||||
)
|
||||
|
||||
if "%TARGET%" == "win-64" (
|
||||
SET MACHINE=x64
|
||||
)
|
||||
|
||||
if "%MACHINE%" == "x86" (
|
||||
SET OUTPUT=win_32
|
||||
)
|
||||
|
||||
if "%MACHINE%" == "x64" (
|
||||
SET OUTPUT=win_64
|
||||
)
|
||||
|
||||
SET VC=%ProgramFiles%\Microsoft Visual Studio 12.0\VC
|
||||
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC
|
||||
if exist %VC64% (
|
||||
SET VC=%VC64%
|
||||
)
|
||||
|
||||
call "%VC%\vcvarsall.bat" %MACHINE%
|
||||
|
||||
cd curl
|
||||
call buildconf.bat
|
||||
cd winbuild
|
||||
nmake /f Makefile.vc mode=static ENABLE_WINSSL=yes MACHINE=%MACHINE% VC=12
|
||||
|
||||
if not exist "%SCRIPTPATH%%OUTPUT%" (
|
||||
md %SCRIPTPATH%%OUTPUT%\build
|
||||
xcopy /Y /S ..\builds\libcurl-vc12-%MACHINE%-release-static-ipv6-sspi-winssl\lib\libcurl_a.lib %SCRIPTPATH%%OUTPUT%\build\
|
||||
mv %SCRIPTPATH%%OUTPUT%\build\libcurl_a.lib %SCRIPTPATH%%OUTPUT%\build\curl.lib
|
||||
)
|
||||
|
||||
cd ..\..
|
||||
@ -1,447 +0,0 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# die prints argument string to stdout and exits this shell script.
|
||||
#
|
||||
die(){
|
||||
echo "buildconf: $@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# findtool works as 'which' but we use a different name to make it more
|
||||
# obvious we aren't using 'which'! ;-)
|
||||
# Unlike 'which' does, the current directory is ignored.
|
||||
#
|
||||
findtool(){
|
||||
file="$1"
|
||||
|
||||
if { echo "$file" | grep "/" >/dev/null 2>&1; } then
|
||||
# when file is given with a path check it first
|
||||
if test -f "$file"; then
|
||||
echo "$file"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
old_IFS=$IFS; IFS=':'
|
||||
for path in $PATH
|
||||
do
|
||||
IFS=$old_IFS
|
||||
# echo "checks for $file in $path" >&2
|
||||
if test "$path" -a "$path" != '.' -a -f "$path/$file"; then
|
||||
echo "$path/$file"
|
||||
return
|
||||
fi
|
||||
done
|
||||
IFS=$old_IFS
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# removethis() removes all files and subdirectories with the given name,
|
||||
# inside and below the current subdirectory at invocation time.
|
||||
#
|
||||
removethis(){
|
||||
if test "$#" = "1"; then
|
||||
find . -depth -name $1 -print > buildconf.tmp.$$
|
||||
while read fdname
|
||||
do
|
||||
if test -f "$fdname"; then
|
||||
rm -f "$fdname"
|
||||
elif test -d "$fdname"; then
|
||||
rm -f -r "$fdname"
|
||||
fi
|
||||
done < buildconf.tmp.$$
|
||||
rm -f buildconf.tmp.$$
|
||||
fi
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Ensure that buildconf runs from the subdirectory where configure.ac lives
|
||||
#
|
||||
if test ! -f configure.ac ||
|
||||
test ! -f src/tool_main.c ||
|
||||
test ! -f lib/urldata.h ||
|
||||
test ! -f include/curl/curl.h ||
|
||||
test ! -f m4/curl-functions.m4; then
|
||||
echo "Can not run buildconf from outside of curl's source subdirectory!"
|
||||
echo "Change to the subdirectory where buildconf is found, and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# autoconf 2.57 or newer. Unpatched version 2.67 does not generate proper
|
||||
# configure script. Unpatched version 2.68 is simply unusable, we should
|
||||
# disallow 2.68 usage.
|
||||
#
|
||||
need_autoconf="2.57"
|
||||
ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
if test -z "$ac_version"; then
|
||||
echo "buildconf: autoconf not found."
|
||||
echo " You need autoconf version $need_autoconf or newer installed."
|
||||
exit 1
|
||||
fi
|
||||
old_IFS=$IFS; IFS='.'; set $ac_version; IFS=$old_IFS
|
||||
if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then
|
||||
echo "buildconf: autoconf version $ac_version found."
|
||||
echo " You need autoconf version $need_autoconf or newer installed."
|
||||
echo " If you have a sufficient autoconf installed, but it"
|
||||
echo " is not named 'autoconf', then try setting the"
|
||||
echo " AUTOCONF environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test "$1" = "2" -a "$2" -eq "67"; then
|
||||
echo "buildconf: autoconf version $ac_version (BAD)"
|
||||
echo " Unpatched version generates broken configure script."
|
||||
elif test "$1" = "2" -a "$2" -eq "68"; then
|
||||
echo "buildconf: autoconf version $ac_version (BAD)"
|
||||
echo " Unpatched version generates unusable configure script."
|
||||
else
|
||||
echo "buildconf: autoconf version $ac_version (ok)"
|
||||
fi
|
||||
|
||||
am4te_version=`${AUTOM4TE:-autom4te} --version 2>/dev/null|head -n 1| sed -e 's/autom4te\(.*\)/\1/' -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
if test -z "$am4te_version"; then
|
||||
echo "buildconf: autom4te not found. Weird autoconf installation!"
|
||||
exit 1
|
||||
fi
|
||||
if test "$am4te_version" = "$ac_version"; then
|
||||
echo "buildconf: autom4te version $am4te_version (ok)"
|
||||
else
|
||||
echo "buildconf: autom4te version $am4te_version (ERROR: does not match autoconf version)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# autoheader 2.50 or newer
|
||||
#
|
||||
ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
if test -z "$ah_version"; then
|
||||
echo "buildconf: autoheader not found."
|
||||
echo " You need autoheader version 2.50 or newer installed."
|
||||
exit 1
|
||||
fi
|
||||
old_IFS=$IFS; IFS='.'; set $ah_version; IFS=$old_IFS
|
||||
if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
|
||||
echo "buildconf: autoheader version $ah_version found."
|
||||
echo " You need autoheader version 2.50 or newer installed."
|
||||
echo " If you have a sufficient autoheader installed, but it"
|
||||
echo " is not named 'autoheader', then try setting the"
|
||||
echo " AUTOHEADER environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "buildconf: autoheader version $ah_version (ok)"
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# automake 1.7 or newer
|
||||
#
|
||||
need_automake="1.7"
|
||||
am_version=`${AUTOMAKE:-automake} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'`
|
||||
if test -z "$am_version"; then
|
||||
echo "buildconf: automake not found."
|
||||
echo " You need automake version $need_automake or newer installed."
|
||||
exit 1
|
||||
fi
|
||||
old_IFS=$IFS; IFS='.'; set $am_version; IFS=$old_IFS
|
||||
if test "$1" = "1" -a "$2" -lt "7" || test "$1" -lt "1"; then
|
||||
echo "buildconf: automake version $am_version found."
|
||||
echo " You need automake version $need_automake or newer installed."
|
||||
echo " If you have a sufficient automake installed, but it"
|
||||
echo " is not named 'automake', then try setting the"
|
||||
echo " AUTOMAKE environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "buildconf: automake version $am_version (ok)"
|
||||
|
||||
acloc_version=`${ACLOCAL:-aclocal} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'`
|
||||
if test -z "$acloc_version"; then
|
||||
echo "buildconf: aclocal not found. Weird automake installation!"
|
||||
exit 1
|
||||
fi
|
||||
if test "$acloc_version" = "$am_version"; then
|
||||
echo "buildconf: aclocal version $acloc_version (ok)"
|
||||
else
|
||||
echo "buildconf: aclocal version $acloc_version (ERROR: does not match automake version)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# GNU libtoolize preliminary check
|
||||
#
|
||||
want_lt_major=1
|
||||
want_lt_minor=4
|
||||
want_lt_patch=2
|
||||
want_lt_version=1.4.2
|
||||
|
||||
# This approach that tries 'glibtoolize' first is intended for systems that
|
||||
# have GNU libtool named as 'glibtoolize' and libtoolize not being GNU's.
|
||||
|
||||
libtoolize=`findtool glibtoolize 2>/dev/null`
|
||||
if test ! -x "$libtoolize"; then
|
||||
libtoolize=`findtool ${LIBTOOLIZE:-libtoolize}`
|
||||
fi
|
||||
if test -z "$libtoolize"; then
|
||||
echo "buildconf: libtoolize not found."
|
||||
echo " You need GNU libtoolize $want_lt_version or newer installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
lt_pver=`$libtoolize --version 2>/dev/null|head -n 1`
|
||||
lt_qver=`echo $lt_pver|sed -e "s/([^)]*)//g" -e "s/^[^0-9]*//g"`
|
||||
lt_version=`echo $lt_qver|sed -e "s/[- ].*//" -e "s/\([a-z]*\)$//"`
|
||||
if test -z "$lt_version"; then
|
||||
echo "buildconf: libtoolize not found."
|
||||
echo " You need GNU libtoolize $want_lt_version or newer installed."
|
||||
exit 1
|
||||
fi
|
||||
old_IFS=$IFS; IFS='.'; set $lt_version; IFS=$old_IFS
|
||||
lt_major=$1
|
||||
lt_minor=$2
|
||||
lt_patch=$3
|
||||
|
||||
if test -z "$lt_major"; then
|
||||
lt_status="bad"
|
||||
elif test "$lt_major" -gt "$want_lt_major"; then
|
||||
lt_status="good"
|
||||
elif test "$lt_major" -lt "$want_lt_major"; then
|
||||
lt_status="bad"
|
||||
elif test -z "$lt_minor"; then
|
||||
lt_status="bad"
|
||||
elif test "$lt_minor" -gt "$want_lt_minor"; then
|
||||
lt_status="good"
|
||||
elif test "$lt_minor" -lt "$want_lt_minor"; then
|
||||
lt_status="bad"
|
||||
elif test -z "$lt_patch"; then
|
||||
lt_status="bad"
|
||||
elif test "$lt_patch" -gt "$want_lt_patch"; then
|
||||
lt_status="good"
|
||||
elif test "$lt_patch" -lt "$want_lt_patch"; then
|
||||
lt_status="bad"
|
||||
else
|
||||
lt_status="good"
|
||||
fi
|
||||
if test "$lt_status" != "good"; then
|
||||
echo "buildconf: libtoolize version $lt_version found."
|
||||
echo " You need GNU libtoolize $want_lt_version or newer installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "buildconf: libtoolize version $lt_version (ok)"
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# m4 check
|
||||
#
|
||||
m4=`(${M4:-m4} --version || ${M4:-gm4} --version) 2>/dev/null | head -n 1`;
|
||||
m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'`
|
||||
|
||||
if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then
|
||||
echo "buildconf: GNU m4 version $m4_version (ok)"
|
||||
else
|
||||
if test -z "$m4"; then
|
||||
echo "buildconf: m4 version not recognized. You need a GNU m4 installed!"
|
||||
else
|
||||
echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# perl check
|
||||
#
|
||||
PERL=`findtool ${PERL:-perl}`
|
||||
if test -z "$PERL"; then
|
||||
echo "buildconf: perl not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Remove files generated on previous buildconf/configure run.
|
||||
#
|
||||
for fname in .deps \
|
||||
.libs \
|
||||
*.la \
|
||||
*.lo \
|
||||
*.a \
|
||||
*.o \
|
||||
Makefile \
|
||||
Makefile.in \
|
||||
aclocal.m4 \
|
||||
aclocal.m4.bak \
|
||||
ares_build.h \
|
||||
ares_config.h \
|
||||
ares_config.h.in \
|
||||
autom4te.cache \
|
||||
compile \
|
||||
config.guess \
|
||||
curl_config.h \
|
||||
curl_config.h.in \
|
||||
config.log \
|
||||
config.lt \
|
||||
config.status \
|
||||
config.sub \
|
||||
configure \
|
||||
configurehelp.pm \
|
||||
curl-config \
|
||||
curlbuild.h \
|
||||
depcomp \
|
||||
libcares.pc \
|
||||
libcurl.pc \
|
||||
libtool \
|
||||
libtool.m4 \
|
||||
libtool.m4.tmp \
|
||||
ltmain.sh \
|
||||
ltoptions.m4 \
|
||||
ltsugar.m4 \
|
||||
ltversion.m4 \
|
||||
lt~obsolete.m4 \
|
||||
stamp-h1 \
|
||||
stamp-h2 \
|
||||
stamp-h3 ; do
|
||||
removethis "$fname"
|
||||
done
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# run the correct scripts now
|
||||
#
|
||||
|
||||
echo "buildconf: running libtoolize"
|
||||
${libtoolize} --copy --automake --force || die "libtoolize command failed"
|
||||
|
||||
# When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4
|
||||
# subdirectory and this local copy is patched to fix some warnings that
|
||||
# are triggered when running aclocal and using autoconf 2.62 or later.
|
||||
|
||||
if test "$lt_major" = "1" && test "$lt_minor" = "5"; then
|
||||
if test -z "$lt_patch" || test "$lt_patch" -lt "26"; then
|
||||
echo "buildconf: copying libtool.m4 to local m4 subdir"
|
||||
ac_dir=`${ACLOCAL:-aclocal} --print-ac-dir`
|
||||
if test -f $ac_dir/libtool.m4; then
|
||||
cp -f $ac_dir/libtool.m4 m4/libtool.m4
|
||||
else
|
||||
echo "buildconf: $ac_dir/libtool.m4 not found"
|
||||
fi
|
||||
if test -f m4/libtool.m4; then
|
||||
echo "buildconf: renaming some variables in local m4/libtool.m4"
|
||||
$PERL -i.tmp -pe \
|
||||
's/lt_prog_compiler_pic_works/lt_cv_prog_compiler_pic_works/g; \
|
||||
s/lt_prog_compiler_static_works/lt_cv_prog_compiler_static_works/g;' \
|
||||
m4/libtool.m4
|
||||
rm -f m4/libtool.m4.tmp
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -f m4/libtool.m4; then
|
||||
echo "buildconf: converting all mv to mv -f in local m4/libtool.m4"
|
||||
$PERL -i.tmp -pe 's/\bmv +([^-\s])/mv -f $1/g' m4/libtool.m4
|
||||
rm -f m4/libtool.m4.tmp
|
||||
fi
|
||||
|
||||
echo "buildconf: running aclocal"
|
||||
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "aclocal command failed"
|
||||
|
||||
echo "buildconf: converting all mv to mv -f in local aclocal.m4"
|
||||
$PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
|
||||
|
||||
echo "buildconf: running autoheader"
|
||||
${AUTOHEADER:-autoheader} || die "autoheader command failed"
|
||||
|
||||
echo "buildconf: running autoconf"
|
||||
${AUTOCONF:-autoconf} || die "autoconf command failed"
|
||||
|
||||
if test -d ares; then
|
||||
cd ares
|
||||
echo "buildconf: running in ares"
|
||||
./buildconf
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo "buildconf: running automake"
|
||||
${AUTOMAKE:-automake} --add-missing --copy || die "automake command failed"
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# GNU libtool complementary check
|
||||
#
|
||||
# Depending on the libtool and automake versions being used, config.guess
|
||||
# might not be installed in the subdirectory until automake has finished.
|
||||
# So we can not attempt to use it until this very last buildconf stage.
|
||||
#
|
||||
if test ! -f ./config.guess; then
|
||||
echo "buildconf: config.guess not found"
|
||||
else
|
||||
buildhost=`./config.guess 2>/dev/null|head -n 1`
|
||||
case $buildhost in
|
||||
*-*-darwin*)
|
||||
need_lt_major=1
|
||||
need_lt_minor=5
|
||||
need_lt_patch=26
|
||||
need_lt_check="yes"
|
||||
;;
|
||||
*-*-hpux*)
|
||||
need_lt_major=1
|
||||
need_lt_minor=5
|
||||
need_lt_patch=24
|
||||
need_lt_check="yes"
|
||||
;;
|
||||
esac
|
||||
if test ! -z "$need_lt_check"; then
|
||||
if test -z "$lt_major"; then
|
||||
lt_status="bad"
|
||||
elif test "$lt_major" -gt "$need_lt_major"; then
|
||||
lt_status="good"
|
||||
elif test "$lt_major" -lt "$need_lt_major"; then
|
||||
lt_status="bad"
|
||||
elif test -z "$lt_minor"; then
|
||||
lt_status="bad"
|
||||
elif test "$lt_minor" -gt "$need_lt_minor"; then
|
||||
lt_status="good"
|
||||
elif test "$lt_minor" -lt "$need_lt_minor"; then
|
||||
lt_status="bad"
|
||||
elif test -z "$lt_patch"; then
|
||||
lt_status="bad"
|
||||
elif test "$lt_patch" -gt "$need_lt_patch"; then
|
||||
lt_status="good"
|
||||
elif test "$lt_patch" -lt "$need_lt_patch"; then
|
||||
lt_status="bad"
|
||||
else
|
||||
lt_status="good"
|
||||
fi
|
||||
if test "$lt_status" != "good"; then
|
||||
need_lt_version="$need_lt_major.$need_lt_minor.$need_lt_patch"
|
||||
echo "buildconf: libtool version $lt_version found."
|
||||
echo " $buildhost requires GNU libtool $need_lt_version or newer installed."
|
||||
rm -f configure
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Finished successfully.
|
||||
#
|
||||
echo "buildconf: OK"
|
||||
exit 0
|
||||
@ -1,347 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2012-10-14.11; # UTC
|
||||
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user