COMP: Fix build problems

This commit is contained in:
Andy Cedilnik 2006-01-02 10:37:00 -05:00
parent 8b0c04724c
commit bf044cec81
4 changed files with 37 additions and 21 deletions

View File

@ -271,13 +271,6 @@ const char* cmCPackGenericGenerator::GetOption(const char* op)
return m_MakefileMap->GetDefinition(op); return m_MakefileMap->GetDefinition(op);
} }
//----------------------------------------------------------------------
int cmCPackGenericGenerator::GenerateHeader(std::ostream* os)
{
(void)os;
return 1;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackGenericGenerator::FindRunningCMake(const char* arg0) int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
{ {

View File

@ -70,7 +70,6 @@ public:
protected: protected:
int PrepareNames(); int PrepareNames();
int InstallProject(); int InstallProject();
virtual int GenerateHeader(std::ostream* os);
virtual const char* GetOutputExtension() { return "cpack"; } virtual const char* GetOutputExtension() { return "cpack"; }
virtual const char* GetOutputPostfix() { return 0; } virtual const char* GetOutputPostfix() { return 0; }

View File

@ -31,6 +31,16 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
//----------------------------------------------------------------------
class cmCPackTGZGeneratorForward
{
public:
static int GenerateHeader(cmCPackTGZGenerator* gg, std::ostream* os)
{
return gg->GenerateHeader(os);
}
};
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCPackTGZGenerator::cmCPackTGZGenerator() cmCPackTGZGenerator::cmCPackTGZGenerator()
{ {
@ -64,8 +74,15 @@ public:
cmCPackTGZGenerator* Generator; cmCPackTGZGenerator* Generator;
}; };
extern "C" {
int cmCPackTGZ_Data_Open(void *client_data, const char* name, int oflags, mode_t mode);
ssize_t cmCPackTGZ_Data_Write(void *client_data, void *buff, size_t n);
int cmCPackTGZ_Data_Close(void *client_data);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackTGZGenerator::TGZ_Open(void *client_data, const char* pathname, int, mode_t) int cmCPackTGZ_Data_Open(void *client_data, const char* pathname, int, mode_t)
{ {
cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data; cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data;
@ -79,7 +96,7 @@ int cmCPackTGZGenerator::TGZ_Open(void *client_data, const char* pathname, int,
gf->SetCompression(true); gf->SetCompression(true);
gf->SetCompressionExtraExtension(false); gf->SetCompressionExtraExtension(false);
if ( !mydata->Generator->GenerateHeader(mydata->OutputStream)) if ( !cmCPackTGZGeneratorForward::GenerateHeader(mydata->Generator,mydata->OutputStream))
{ {
return -1; return -1;
} }
@ -87,7 +104,7 @@ int cmCPackTGZGenerator::TGZ_Open(void *client_data, const char* pathname, int,
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
ssize_t cmCPackTGZGenerator::TGZ_Write(void *client_data, void *buff, size_t n) ssize_t cmCPackTGZ_Data_Write(void *client_data, void *buff, size_t n)
{ {
cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data; cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data;
@ -100,7 +117,7 @@ ssize_t cmCPackTGZGenerator::TGZ_Write(void *client_data, void *buff, size_t n)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackTGZGenerator::TGZ_Close(void *client_data) int cmCPackTGZ_Data_Close(void *client_data)
{ {
cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data; cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data;
@ -120,10 +137,10 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName, const char* topl
char pathname[TAR_MAXPATHLEN]; char pathname[TAR_MAXPATHLEN];
tartype_t gztype = { tartype_t gztype = {
(openfunc_t)cmCPackTGZGenerator::TGZ_Open, (openfunc_t)cmCPackTGZ_Data_Open,
(closefunc_t)cmCPackTGZGenerator::TGZ_Close, (closefunc_t)cmCPackTGZ_Data_Close,
(readfunc_t)0, (readfunc_t)0,
(writefunc_t)cmCPackTGZGenerator::TGZ_Write, (writefunc_t)cmCPackTGZ_Data_Write,
&mydata &mydata
}; };
@ -173,3 +190,12 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName, const char* topl
} }
return 1; return 1;
} }
//----------------------------------------------------------------------
int cmCPackTGZGenerator::GenerateHeader(std::ostream* os)
{
(void)os;
return 1;
}

View File

@ -18,9 +18,9 @@
#ifndef cmCPackTGZGenerator_h #ifndef cmCPackTGZGenerator_h
#define cmCPackTGZGenerator_h #define cmCPackTGZGenerator_h
#include "cmCPackGenericGenerator.h" #include "cmCPackGenericGenerator.h"
#include "CPack/cmCPackConfigure.h" // for ssize_t
class cmCPackTGZGeneratorForward;
/** \class cmCPackTGZGenerator /** \class cmCPackTGZGenerator
* \brief A generator for TGZ files * \brief A generator for TGZ files
@ -30,6 +30,7 @@
class cmCPackTGZGenerator : public cmCPackGenericGenerator class cmCPackTGZGenerator : public cmCPackGenericGenerator
{ {
public: public:
friend class cmCPackTGZGeneratorForward;
cmCPackTypeMacro(cmCPackTGZGenerator, cmCPackGenericGenerator); cmCPackTypeMacro(cmCPackTGZGenerator, cmCPackGenericGenerator);
/** /**
@ -50,10 +51,7 @@ public:
virtual ~cmCPackTGZGenerator(); virtual ~cmCPackTGZGenerator();
protected: protected:
static int TGZ_Open(void *client_data, const char* name, int oflags, mode_t mode); virtual int GenerateHeader(std::ostream* os);
static ssize_t TGZ_Write(void *client_data, void *buff, size_t n);
static int TGZ_Close(void *client_data);
int CompressFiles(const char* outFileName, const char* toplevel, int CompressFiles(const char* outFileName, const char* toplevel,
const std::vector<std::string>& files); const std::vector<std::string>& files);
virtual const char* GetOutputExtension() { return "tar.gz"; } virtual const char* GetOutputExtension() { return "tar.gz"; }