-outdir commandline option support => directory for proxy class and other language specific files
-help tidy up git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4981 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
edc0896b2b
commit
06ed231b7d
17 changed files with 150 additions and 115 deletions
|
|
@ -32,15 +32,14 @@ char cvsroot_chicken_cxx[] = "$Header$";
|
|||
static const char *chicken_usage = (char*)"\
|
||||
\
|
||||
CHICKEN Options (available with -chicken)\n\
|
||||
-help - Print this help.\n\
|
||||
-prefix name - Set a prefix to be prepended to all names.\n\
|
||||
Defaults to the name of the module.\n\
|
||||
-noprefix - Don't use a prefix.\n\
|
||||
-mixed - Convert mixed case (ex. aMethodName) into \n\
|
||||
dash seperated, lower case (ex. a-method-name).\n\
|
||||
-noclos - Don't generate clos TinyCLOS code.\n\
|
||||
-nogeneric - Don't generate (make-generic) definitions.\n\
|
||||
-ldflags - Print runtime libraries to link with.\n\
|
||||
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
|
||||
Defaults to the name of the module\n\
|
||||
-noprefix - Don't use a prefix\n\
|
||||
-mixed - Convert mixed case (ex. aMethodName) into\n\
|
||||
dash seperated, lower case (ex. a-method-name)\n\
|
||||
-noclos - Don't generate clos TinyCLOS code\n\
|
||||
-nogeneric - Don't generate (make-generic) definitions\n\
|
||||
-ldflags - Print runtime libraries to link with\n\
|
||||
\n"
|
||||
;
|
||||
|
||||
|
|
@ -265,7 +264,7 @@ CHICKEN::top(Node *n)
|
|||
}
|
||||
}
|
||||
|
||||
Printf(chicken_filename,"%s%s.scm", Swig_file_dirname(outfile), module);
|
||||
Printf(chicken_filename,"%s%s.scm", SWIG_output_directory(), module);
|
||||
if ((f_scm = NewFile(chicken_filename,"w")) == 0) {
|
||||
Printf(stderr,"Unable to open %s\n", chicken_filename);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
|
|
@ -309,7 +308,7 @@ CHICKEN::top(Node *n)
|
|||
|
||||
if (generic) {
|
||||
Printf(generic_filename,"%s%s-generic.scm",
|
||||
Swig_file_dirname(outfile), module);
|
||||
SWIG_output_directory(), module);
|
||||
if ((f_generic = NewFile(generic_filename,"w")) == 0) {
|
||||
Printf(stderr,"Unable to open %s\n", generic_filename);
|
||||
SWIG_exit (EXIT_FAILURE);
|
||||
|
|
@ -325,7 +324,7 @@ CHICKEN::top(Node *n)
|
|||
}
|
||||
|
||||
if (clos) {
|
||||
Printf(clos_filename,"%s%s-clos.scm", Swig_file_dirname(outfile), module);
|
||||
Printf(clos_filename,"%s%s-clos.scm", SWIG_output_directory(), module);
|
||||
if ((f_clos = NewFile(clos_filename,"w")) == 0) {
|
||||
Printf(stderr,"Unable to open %s\n", clos_filename);
|
||||
SWIG_exit (EXIT_FAILURE);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ class CSHARP : public Language {
|
|||
String *upcasts_code; //C++ casts for inheritance hierarchies C++ code
|
||||
String *imclass_cppcasts_code; //C++ casts up inheritance hierarchies intermediary class code
|
||||
String *destructor_call; //C++ destructor call if any
|
||||
String *outfile;
|
||||
|
||||
enum type_additions {none, pointer, reference};
|
||||
|
||||
|
|
@ -109,8 +108,7 @@ class CSHARP : public Language {
|
|||
module_class_modifiers(NULL),
|
||||
upcasts_code(NULL),
|
||||
imclass_cppcasts_code(NULL),
|
||||
destructor_call(NULL),
|
||||
outfile(NULL)
|
||||
destructor_call(NULL)
|
||||
|
||||
{
|
||||
}
|
||||
|
|
@ -179,7 +177,7 @@ class CSHARP : public Language {
|
|||
virtual int top(Node *n) {
|
||||
|
||||
/* Initialize all of the output files */
|
||||
outfile = Getattr(n,"outfile");
|
||||
String *outfile = Getattr(n,"outfile");
|
||||
|
||||
f_runtime = NewFile(outfile,"w");
|
||||
if (!f_runtime) {
|
||||
|
|
@ -256,7 +254,7 @@ class CSHARP : public Language {
|
|||
|
||||
// Generate the intermediary class
|
||||
{
|
||||
String *filen = NewStringf("%s%s.cs", Swig_file_dirname(outfile), imclass_name);
|
||||
String *filen = NewStringf("%s%s.cs", SWIG_output_directory(), imclass_name);
|
||||
File *f_im = NewFile(filen,"w");
|
||||
if(!f_im) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -293,7 +291,7 @@ class CSHARP : public Language {
|
|||
|
||||
// Generate the C# module class
|
||||
{
|
||||
String *filen = NewStringf("%s%s.cs", Swig_file_dirname(outfile), module_class_name);
|
||||
String *filen = NewStringf("%s%s.cs", SWIG_output_directory(), module_class_name);
|
||||
File *f_module = NewFile(filen,"w");
|
||||
if(!f_module) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -1120,7 +1118,7 @@ class CSHARP : public Language {
|
|||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
String *filen = NewStringf("%s%s.cs", Swig_file_dirname(outfile), proxy_class_name);
|
||||
String *filen = NewStringf("%s%s.cs", SWIG_output_directory(), proxy_class_name);
|
||||
f_proxy = NewFile(filen,"w");
|
||||
if(!f_proxy) {
|
||||
Printf(stderr, "Unable to create proxy class file: %s\n", filen);
|
||||
|
|
@ -1855,7 +1853,7 @@ class CSHARP : public Language {
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void emitTypeWrapperClass(String *classname, SwigType *type) {
|
||||
String *filen = NewStringf("%s%s.cs", Swig_file_dirname(outfile), classname);
|
||||
String *filen = NewStringf("%s%s.cs", SWIG_output_directory(), classname);
|
||||
File *f_swigtype = NewFile(filen,"w");
|
||||
String *swigtype = NewString("");
|
||||
|
||||
|
|
@ -2010,7 +2008,8 @@ swig_csharp(void) {
|
|||
|
||||
const char *CSHARP::usage = (char*)"\
|
||||
C# Options (available with -csharp)\n\
|
||||
-package <name> - set name of the assembly\n\
|
||||
-noproxy - Generate the low-level functional interface instead of proxy classes\n\
|
||||
-package <name> - set name of the assembly to <name>\n\
|
||||
-noproxy - Generate the low-level functional interface instead\n\
|
||||
of proxy classes\n\
|
||||
\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -346,6 +346,7 @@ void emit_mark_varargs(ParmList *l) {
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* -----------------------------------------------------------------------------
|
||||
* replace_args()
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
|
@ -360,6 +361,7 @@ void replace_args(Parm *p, String *s) {
|
|||
p = nextSibling(p);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* replace_contract_args. This function replaces argument names in contract
|
||||
specifications. Used in conjunction with the %contract directive. */
|
||||
|
|
|
|||
|
|
@ -33,22 +33,22 @@ char cvsroot_guile_cxx[] = "$Header$";
|
|||
static const char *guile_usage = (char*)"\
|
||||
Guile Options (available with -guile)\n\
|
||||
-ldflags - Print runtime libraries to link with\n\
|
||||
-prefix name - Use NAME as prefix [default \"gswig_\"]\n\
|
||||
-package name - Set the path of the module [default NULL]\n\
|
||||
-prefix <name> - Use <name> as prefix [default \"gswig_\"]\n\
|
||||
-package <name> - Set the path of the module to <name> [default NULL]\n\
|
||||
-emit-setters - Emit procedures-with-setters for variables\n\
|
||||
and structure slots.\n\
|
||||
-linkage lstyle - Use linkage protocol LSTYLE [default `module']\n\
|
||||
-procdoc file - Output procedure documentation to FILE\n\
|
||||
-procdocformat format - Output procedure documentation in FORMAT;\n\
|
||||
one of `guile-1.4', `plain', `texinfo'\n\
|
||||
-scmstub file - Output Scheme FILE with module declaration and\n\
|
||||
-procdoc <file> - Output procedure documentation to <file>\n\
|
||||
-procdocformat <format> - Output procedure documentation in <format>;\n\
|
||||
one of `guile-1.4', `plain', `texinfo'\n\
|
||||
-linkage <lstyle> - Use linkage protocol <lstyle> [default `module']\n\
|
||||
-scmstub <file> - Output Scheme <file> with module declaration and\n\
|
||||
exports; only with `passive' and `simple' linkage\n\
|
||||
-gh - Use the gh_ guile interface. (default) \n\
|
||||
-scm - Use the scm guile interface. (guile >=1.6) \n\
|
||||
\n\
|
||||
When unspecified, the default LSTYLE is `simple'. For native Guile\n\
|
||||
When unspecified, the default <lstyle> is `simple'. For native Guile\n\
|
||||
module linking (for Guile versions >=1.5.0), use `module'. Other\n\
|
||||
LSTYLE values are: `passive' for passive linking (no C-level\n\
|
||||
<lstyle> values are: `passive' for passive linking (no C-level\n\
|
||||
module-handling code), `ltdlmod' for Guile's old dynamic module\n\
|
||||
convention (versions <= 1.4), or `hobbit' for hobbit modules.\n\
|
||||
\n";
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ class JAVA : public Language {
|
|||
String *upcasts_code; //C++ casts for inheritance hierarchies C++ code
|
||||
String *imclass_cppcasts_code; //C++ casts up inheritance hierarchies intermediary class code
|
||||
String *destructor_call; //C++ destructor call if any
|
||||
String *outfile;
|
||||
|
||||
enum type_additions {none, pointer, reference};
|
||||
|
||||
|
|
@ -111,8 +110,7 @@ class JAVA : public Language {
|
|||
module_class_modifiers(NULL),
|
||||
upcasts_code(NULL),
|
||||
imclass_cppcasts_code(NULL),
|
||||
destructor_call(NULL),
|
||||
outfile(NULL)
|
||||
destructor_call(NULL)
|
||||
|
||||
{
|
||||
}
|
||||
|
|
@ -204,7 +202,7 @@ class JAVA : public Language {
|
|||
virtual int top(Node *n) {
|
||||
|
||||
/* Initialize all of the output files */
|
||||
outfile = Getattr(n,"outfile");
|
||||
String *outfile = Getattr(n,"outfile");
|
||||
|
||||
f_runtime = NewFile(outfile,"w");
|
||||
if (!f_runtime) {
|
||||
|
|
@ -292,7 +290,7 @@ class JAVA : public Language {
|
|||
|
||||
// Generate the intermediary class
|
||||
{
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), imclass_name);
|
||||
String *filen = NewStringf("%s%s.java", SWIG_output_directory(), imclass_name);
|
||||
File *f_im = NewFile(filen,"w");
|
||||
if(!f_im) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -329,7 +327,7 @@ class JAVA : public Language {
|
|||
|
||||
// Generate the Java module class
|
||||
{
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), module_class_name);
|
||||
String *filen = NewStringf("%s%s.java", SWIG_output_directory(), module_class_name);
|
||||
File *f_module = NewFile(filen,"w");
|
||||
if(!f_module) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -372,7 +370,7 @@ class JAVA : public Language {
|
|||
|
||||
// Generate the Java constants interface
|
||||
if (Len(module_class_constants_code) != 0 ) {
|
||||
String *filen = NewStringf("%s%sConstants.java", Swig_file_dirname(outfile), module_class_name);
|
||||
String *filen = NewStringf("%s%sConstants.java", SWIG_output_directory(), module_class_name);
|
||||
File *f_module = NewFile(filen,"w");
|
||||
if(!f_module) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -1231,7 +1229,7 @@ class JAVA : public Language {
|
|||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), proxy_class_name);
|
||||
String *filen = NewStringf("%s%s.java", SWIG_output_directory(), proxy_class_name);
|
||||
f_proxy = NewFile(filen,"w");
|
||||
if(!f_proxy) {
|
||||
Printf(stderr, "Unable to create proxy class file: %s\n", filen);
|
||||
|
|
@ -1845,7 +1843,7 @@ class JAVA : public Language {
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void emitTypeWrapperClass(String *classname, SwigType *type) {
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), classname);
|
||||
String *filen = NewStringf("%s%s.java", SWIG_output_directory(), classname);
|
||||
File *f_swigtype = NewFile(filen,"w");
|
||||
String *swigtype = NewString("");
|
||||
|
||||
|
|
@ -2000,7 +1998,8 @@ swig_java(void) {
|
|||
|
||||
const char *JAVA::usage = (char*)"\
|
||||
Java Options (available with -java)\n\
|
||||
-package <name> - set name of the Java package\n\
|
||||
-noproxy - Generate the low-level functional interface instead of proxy classes\n\
|
||||
-package <name> - set name of the Java package to <name>\n\
|
||||
-noproxy - Generate the low-level functional interface instead\n\
|
||||
of proxy classes\n\
|
||||
\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ extern "C" {
|
|||
int Verbose = 0;
|
||||
int NoExtern = 0;
|
||||
int NoExcept = 0;
|
||||
char *SwigLib;
|
||||
|
||||
|
||||
extern "C" {
|
||||
extern String *ModuleName;
|
||||
|
|
@ -55,29 +57,37 @@ static char *usage = (char*)"\
|
|||
-c - Produce raw wrapper code (omit support code)\n\
|
||||
-c++ - Enable C++ processing\n\
|
||||
-co - Check a file out of the SWIG library\n\
|
||||
-Dsymbol - Define a symbol (for conditional compilation)\n\
|
||||
-I<dir> - Look for SWIG files in <dir>\n\
|
||||
-includeall - Follow all #include statements\n\
|
||||
-importall - Follow all #include statements as imports\n\
|
||||
-ignoremissing - Ignore missing include files.\n\
|
||||
-l<ifile> - Include SWIG library file.\n\
|
||||
-M - List all dependencies. \n\
|
||||
-MM - List dependencies, but omit files in SWIG library.\n\
|
||||
-makedefault - Create default constructors/destructors (the default)\n\
|
||||
-module - Set module name\n\
|
||||
-nodefault - Do not generate constructors/destructors\n\
|
||||
-noexcept - Do not wrap exception specifiers.\n\
|
||||
-noextern - Do not generate extern declarations.\n\
|
||||
-o outfile - Set name of the output file.\n\
|
||||
-swiglib - Report location of SWIG library and exit\n\
|
||||
-v - Run in verbose mode\n\
|
||||
-D<symbol> - Define a symbol <symbol> (for conditional compilation)\n\
|
||||
-fcompact - Compile in compact mode\n\
|
||||
-fvirtual - Compile in virtual elimination mode\n\
|
||||
-help - This output\n\
|
||||
-I<dir> - Look for SWIG files in <dir>\n\
|
||||
-ignoremissing - Ignore missing include files\n\
|
||||
-importall - Follow all #include statements as imports\n\
|
||||
-includeall - Follow all #include statements\n\
|
||||
-l<ifile> - Include SWIG library file <ifile>\n\
|
||||
-M - List all dependencies \n\
|
||||
-MM - List dependencies, but omit files in SWIG library\n\
|
||||
-makedefault - Create default constructors/destructors (the default)\n\
|
||||
-module <name> - Set module name to <name>\n\
|
||||
-nodefault - Do not generate constructors/destructors\n\
|
||||
-noexcept - Do not wrap exception specifiers\n\
|
||||
-noextern - Do not generate extern declarations\n\
|
||||
-o <outfile> - Set name of the output file to <outfile>\n\
|
||||
-outdir <dir> - Set language specific files output directory\n\
|
||||
-small - Compile in virtual elimination & compact mode\n\
|
||||
-swiglib - Report location of SWIG library and exit\n\
|
||||
-v - Run in verbose mode\n\
|
||||
-version - Print SWIG version number\n\
|
||||
-Wall - Enable all warning messages\n\
|
||||
-wn - Suppress warning number n\n\
|
||||
-help - This output.\n\n";
|
||||
-w<n> - Suppress warning number <n>\n\
|
||||
\n";
|
||||
|
||||
// Local variables
|
||||
static int freeze = 0;
|
||||
static String *lang_config = 0;
|
||||
static char *cpp_extension = (char *) "cxx";
|
||||
static String *outdir = 0;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// check_suffix(char *name)
|
||||
|
|
@ -139,17 +149,31 @@ install_opts(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Sets the output directory for language specific (proxy) files if not set and
|
||||
// adds trailing file separator if necessary.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static void set_outdir(const String *c_wrapper_file_dir) {
|
||||
|
||||
// Add file delimiter if not present in output directory name
|
||||
if (outdir && Len(outdir) != 0) {
|
||||
const char* outd = Char(outdir);
|
||||
if (strcmp(outd + strlen(outd) - strlen(SWIG_FILE_DELIMETER), SWIG_FILE_DELIMETER) != 0)
|
||||
Printv(outdir, SWIG_FILE_DELIMETER, NIL);
|
||||
}
|
||||
// Use the C wrapper file's directory if the output directory has not been set by user
|
||||
if (!outdir)
|
||||
outdir = NewString(c_wrapper_file_dir);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
// main()
|
||||
//
|
||||
// Main program. Initializes the files and starts the parser.
|
||||
//-----------------------------------------------------------------
|
||||
|
||||
char *SwigLib;
|
||||
static int freeze = 0;
|
||||
static String *lang_config = 0;
|
||||
static char *cpp_extension = (char *) "cxx";
|
||||
|
||||
/* This function sets the name of the configuration file */
|
||||
|
||||
void SWIG_config_file(const String_or_char *filename) {
|
||||
|
|
@ -160,6 +184,12 @@ void SWIG_library_directory(const char *filename) {
|
|||
strcpy(LibDir,filename);
|
||||
}
|
||||
|
||||
// Returns the directory for generating language specific files (non C/C++ files)
|
||||
const String *SWIG_output_directory() {
|
||||
assert(outdir);
|
||||
return outdir;
|
||||
}
|
||||
|
||||
void SWIG_config_cppext(const char *ext) {
|
||||
cpp_extension = (char *) ext;
|
||||
}
|
||||
|
|
@ -399,6 +429,14 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
} else if (strcmp(argv[i],"-MM") == 0) {
|
||||
depend = 2;
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i],"-outdir") == 0) {
|
||||
Swig_mark_arg(i);
|
||||
if (argv[i+1]) {
|
||||
outdir = NewString(argv[i+1]);
|
||||
Swig_mark_arg(i+1);
|
||||
} else {
|
||||
Swig_arg_error();
|
||||
}
|
||||
} else if (strcmp(argv[i],"-Wall") == 0) {
|
||||
Swig_mark_arg(i);
|
||||
Swig_warnall();
|
||||
|
|
@ -430,7 +468,6 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
memory_debug =1;
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i],"-help") == 0) {
|
||||
//fputs("Help.\n",stderr);
|
||||
fputs(usage,stderr);
|
||||
Swig_mark_arg(i);
|
||||
help = 1;
|
||||
|
|
@ -642,6 +679,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
Setattr(top,"outfile_h", NewStringf("%s.h", header));
|
||||
free(header);
|
||||
}
|
||||
set_outdir(Swig_file_dirname(Getattr(top,"outfile")));
|
||||
if (Swig_contract_mode_get()) {
|
||||
Swig_contracts(top);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,13 +32,11 @@ char cvsroot_mzscheme_cxx[] = "$Header$";
|
|||
#include <ctype.h>
|
||||
|
||||
static const char *usage = (char*)"\
|
||||
\n\
|
||||
Mzscheme Options (available with -mzscheme)\n\
|
||||
-ldflags - Print runtime libraries to link with\n\
|
||||
-prefix name - Set a prefix to be appended to all names\n\
|
||||
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
|
||||
-declaremodule - Create extension that declares a module\n\
|
||||
\n"
|
||||
;
|
||||
\n";
|
||||
|
||||
static char *prefix=0;
|
||||
static bool declaremodule = false;
|
||||
|
|
|
|||
|
|
@ -26,11 +26,10 @@ char cvsroot_ocaml_cxx[] = "$Header$";
|
|||
|
||||
#include <ctype.h>
|
||||
|
||||
static const char *usage = (char*)
|
||||
("\n"
|
||||
"Ocaml Options (available with -ocaml)\n"
|
||||
"-prefix name - Set a prefix to be appended to all names\n"
|
||||
"\n");
|
||||
static const char *usage = (char*)"\
|
||||
Ocaml Options (available with -ocaml)\n\
|
||||
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
|
||||
\n";
|
||||
|
||||
static int classmode = 0;
|
||||
static int in_constructor = 0, in_destructor = 0, in_copyconst = 0;
|
||||
|
|
@ -475,12 +474,12 @@ public:
|
|||
Printv(mlfile,module,".ml",NIL);
|
||||
Printv(mlifile,module,".mli",NIL);
|
||||
|
||||
String *mlfilen = NewStringf("%s%s", Swig_file_dirname(outfile),mlfile);
|
||||
String *mlfilen = NewStringf("%s%s", SWIG_output_directory(),mlfile);
|
||||
if ((f_mlout = NewFile(mlfilen,"w")) == 0) {
|
||||
Printf(stderr,"Unable to open %s\n", mlfilen);
|
||||
SWIG_exit (EXIT_FAILURE);
|
||||
}
|
||||
String *mlifilen = NewStringf("%s%s", Swig_file_dirname(outfile),mlifile);
|
||||
String *mlifilen = NewStringf("%s%s", SWIG_output_directory(),mlifile);
|
||||
if ((f_mliout = NewFile(mlifilen,"w")) == 0) {
|
||||
Printf(stderr,"Unable to open %s\n", mlifilen);
|
||||
SWIG_exit (EXIT_FAILURE);
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ char cvsroot_perl5_cxx[] = "$Header$";
|
|||
static const char *usage = (char*)"\
|
||||
Perl5 Options (available with -perl5)\n\
|
||||
-ldflags - Print runtime libraries to link with\n\
|
||||
-static - Omit code related to dynamic loading.\n\
|
||||
-nopm - Do not generate the .pm file.\n\
|
||||
-proxy - Create proxy classes.\n\
|
||||
-const - Wrap constants as constants and not variables (implies -shadow).\n\
|
||||
-compat - Compatibility mode.\n\n";
|
||||
-static - Omit code related to dynamic loading\n\
|
||||
-nopm - Do not generate the .pm file\n\
|
||||
-proxy - Create proxy classes\n\
|
||||
-const - Wrap constants as constants and not variables (implies -proxy)\n\
|
||||
-compat - Compatibility mode\n\n";
|
||||
|
||||
static int compat = 0;
|
||||
|
||||
|
|
@ -247,11 +247,12 @@ public:
|
|||
}
|
||||
pmfile = NewStringf("%s.pm", m);
|
||||
}
|
||||
String *filen = NewStringf("%s%s", Swig_file_dirname(outfile),pmfile);
|
||||
String *filen = NewStringf("%s%s", SWIG_output_directory(),pmfile);
|
||||
if ((f_pm = NewFile(filen,"w")) == 0) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
SWIG_exit (EXIT_FAILURE);
|
||||
}
|
||||
Delete(filen); filen = NULL;
|
||||
Swig_register_filebyname("pm",f_pm);
|
||||
}
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,15 +27,15 @@ char cvsroot_php4_cxx[] = "$Header$";
|
|||
static const char *usage = (char*)"\
|
||||
PHP4 Options (available with -php4)\n\
|
||||
-ldflags - Print runtime libraries to link with\n\
|
||||
-cppext - cpp file extension (default to .cpp)\n\
|
||||
-cppext - cpp file extension (default to .cpp)\n\
|
||||
-noproxy - Don't generate proxy classes.\n\
|
||||
-dlname name - Set module prefix.\n\
|
||||
-make - Create simple makefile.\n\
|
||||
-phpfull - Create full make files.\n\
|
||||
-withincs libs - With -phpfull writes needed incs in config.m4\n\
|
||||
-withlibs libs - With -phpfull writes needed libs in config.m4\n\n\
|
||||
-withc libs - With -phpfull makes extra c files in Makefile.in\n\
|
||||
-withcxx libs - With -phpfull makes extra c++ files in Makefile.in\n\
|
||||
-dlname <name> - Set module prefix to <name>\n\
|
||||
-make - Create simple makefile\n\
|
||||
-phpfull - Create full make files\n\
|
||||
-withincs <libs>- With -phpfull writes needed incs in config.m4\n\
|
||||
-withlibs <libs>- With -phpfull writes needed libs in config.m4\n\
|
||||
-withc <libs> - With -phpfull makes extra c files in Makefile.in\n\
|
||||
-withcxx <libs> - With -phpfull makes extra c++ files in Makefile.in\n\
|
||||
\n";
|
||||
|
||||
static int constructors=0;
|
||||
|
|
@ -48,7 +48,6 @@ static String *withlibs = 0;
|
|||
static String *withincs = 0;
|
||||
static String *withc = 0;
|
||||
static String *withcxx = 0;
|
||||
static String *outfile = 0;
|
||||
|
||||
//static char *package = 0; // Name of the package
|
||||
static char *shadow_classname;
|
||||
|
|
@ -358,7 +357,7 @@ public:
|
|||
Close(f_make);
|
||||
}
|
||||
|
||||
void create_extra_files(void) {
|
||||
void create_extra_files(String *outfile) {
|
||||
File *f_extra;
|
||||
|
||||
static String *configm4=0;
|
||||
|
|
@ -366,13 +365,13 @@ public:
|
|||
static String *credits=0;
|
||||
|
||||
configm4=NewString("");
|
||||
Printv(configm4, Swig_file_dirname(outfile), "config.m4", NIL);
|
||||
Printv(configm4, SWIG_output_directory(), "config.m4", NIL);
|
||||
|
||||
makefilein=NewString("");
|
||||
Printv(makefilein, Swig_file_dirname(outfile), "Makefile.in", NIL);
|
||||
Printv(makefilein, SWIG_output_directory(), "Makefile.in", NIL);
|
||||
|
||||
credits=NewString("");
|
||||
Printv(credits, Swig_file_dirname(outfile), "CREDITS", NIL);
|
||||
Printv(credits, SWIG_output_directory(), "CREDITS", NIL);
|
||||
|
||||
// are we a --with- or --enable-
|
||||
int with=(withincs || withlibs)?1:0;
|
||||
|
|
@ -566,7 +565,7 @@ public:
|
|||
String *s_type;
|
||||
|
||||
/* Initialize all of the output files */
|
||||
outfile = Getattr(n,"outfile");
|
||||
String *outfile = Getattr(n,"outfile");
|
||||
|
||||
/* main output file */
|
||||
f_runtime = NewFile(outfile,"w");
|
||||
|
|
@ -623,7 +622,7 @@ public:
|
|||
|
||||
/* PHP module file */
|
||||
filen = NewString("");
|
||||
Printv(filen, Swig_file_dirname(outfile), module, ".php", NIL);
|
||||
Printv(filen, SWIG_output_directory(), module, ".php", NIL);
|
||||
phpfilename = NewString(filen);
|
||||
|
||||
f_phpcode = NewFile(filen, "w");
|
||||
|
|
@ -676,7 +675,7 @@ public:
|
|||
|
||||
/* Create the .h file too */
|
||||
filen = NewString("");
|
||||
Printv(filen, Swig_file_dirname(outfile), "php_", module, ".h", NIL);
|
||||
Printv(filen, SWIG_output_directory(), "php_", module, ".h", NIL);
|
||||
f_h = NewFile(filen, "w");
|
||||
if (!f_h) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -879,7 +878,7 @@ public:
|
|||
Printf(f_phpcode, "%s\n%s\n?>\n", pragma_incl, pragma_code);
|
||||
Close(f_phpcode);
|
||||
|
||||
create_extra_files();
|
||||
create_extra_files(outfile);
|
||||
|
||||
if(!gen_extra && gen_make)
|
||||
create_simple_make();
|
||||
|
|
|
|||
|
|
@ -302,12 +302,12 @@ static String *real_classname;
|
|||
static const char *usage = (char *)"\
|
||||
Python Options (available with -python)\n\
|
||||
-ldflags - Print runtime libraries to link with\n\
|
||||
-globals name - Set name used to access C global variable ('cvar' by default).\n\
|
||||
-interface name - Set the lib name\n\
|
||||
-globals <name> - Set <name> used to access C global variable [default: 'cvar']\n\
|
||||
-interface <lib>- Set the lib name to <lib>\n\
|
||||
-keyword - Use keyword arguments\n\
|
||||
-classic - Use classic classes only\n\
|
||||
-noexcept - No automatic exception handling.\n\
|
||||
-noproxy - Don't generate proxy classes. \n\n";
|
||||
-noexcept - No automatic exception handling\n\
|
||||
-noproxy - Don't generate proxy classes \n\n";
|
||||
|
||||
class PYTHON : public Language {
|
||||
public:
|
||||
|
|
@ -461,11 +461,9 @@ public:
|
|||
Printf(f_directors, "#include \"%s\"\n\n", outfile_h);
|
||||
}
|
||||
|
||||
char filen[256];
|
||||
|
||||
/* If shadow classing is enabled, we're going to change the module name to "_module" */
|
||||
if (shadow) {
|
||||
sprintf(filen,"%s%s.py", Swig_file_dirname(outfile), Char(module));
|
||||
String *filen = NewStringf("%s%s.py", SWIG_output_directory(), Char(module));
|
||||
// If we don't have an interface then change the module name X to _X
|
||||
if (interface) module = interface;
|
||||
else Insert(module,0,"_");
|
||||
|
|
@ -473,6 +471,8 @@ public:
|
|||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
SWIG_exit (EXIT_FAILURE);
|
||||
}
|
||||
Delete(filen); filen = NULL;
|
||||
|
||||
f_shadow_stubs = NewString("");
|
||||
|
||||
Swig_register_filebyname("shadow",f_shadow);
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ Ruby Options (available with -ruby)\n\
|
|||
-ldflags - Print runtime libraries to link with\n\
|
||||
-globalmodule - Wrap everything into the global module\n\
|
||||
-minherit - Attempt to support multiple inheritance\n\
|
||||
-feature name - Set feature name (used by `require')\n";
|
||||
-feature <name> - Set feature name to <name> (used by `require')\n";
|
||||
|
||||
|
||||
#define RCLASS(hash, name) (RClass*)(Getattr(hash, name) ? Data(Getattr(hash, name)) : 0)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
char cvsroot_s_exp_cxx[] = "$Header$";
|
||||
static const char *usage = "\
|
||||
S-Exp Options (available with -sexp)\n\
|
||||
-typemaplang lang - Typemap language.\n\n";
|
||||
-typemaplang <lang> - Typemap language\n\n";
|
||||
|
||||
#include "swigmod.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ int main(int argc, char **argv) {
|
|||
Printf(stderr,"Target Language Options:\n");
|
||||
for (int j = 0; modules[j].name; j++) {
|
||||
if (modules[j].help) {
|
||||
Printf(stderr," %-15s - Generate %s wrappers.\n", modules[j].name, modules[j].help);
|
||||
Printf(stderr," %-15s - Generate %s wrappers\n", modules[j].name, modules[j].help);
|
||||
}
|
||||
}
|
||||
Swig_mark_arg(i);
|
||||
|
|
|
|||
|
|
@ -252,6 +252,7 @@ extern int SWIG_main(int, char **, Language *);
|
|||
extern void emit_args(SwigType *, ParmList *, Wrapper *f);
|
||||
extern void SWIG_exit(int); /* use EXIT_{SUCCESS,FAILURE} */
|
||||
extern void SWIG_config_file(const String_or_char *);
|
||||
extern const String *SWIG_output_directory();
|
||||
extern void SWIG_config_cppext(const char *ext);
|
||||
|
||||
extern "C" void SWIG_typemap_lang(const char *);
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ char cvsroot_tcl8_cxx[] = "$Header$";
|
|||
static const char *usage = (char*)"\
|
||||
Tcl 8 Options (available with -tcl)\n\
|
||||
-ldflags - Print runtime libraries to link with\n\
|
||||
-prefix name - Set a prefix to be appended to all names\n\
|
||||
-namespace - Build module into a Tcl 8 namespace. \n\
|
||||
-pkgversion - Set package version.\n\n";
|
||||
-prefix <name> - Set a prefix <name> to be prepended to all names\n\
|
||||
-namespace - Build module into a Tcl 8 namespace\n\
|
||||
-pkgversion - Set package version\n\n";
|
||||
|
||||
static String *cmd_tab = 0; /* Table of command names */
|
||||
static String *var_tab = 0; /* Table of global variables */
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
char cvsroot_xml_cxx[] = "$Header$";
|
||||
static const char *usage = "\
|
||||
XML Options (available with -xml)\n\
|
||||
-xmllang lang - Typedef language\n\
|
||||
-xmllang <lang> - Typedef language\n\
|
||||
------\n\
|
||||
deprecated (use -o): -xml output.xml - Use output.xml as output file (extension .xml mandatory)\n";
|
||||
deprecated (use -o): -xml <output.xml> - Use <output.xml> as output file (extension .xml mandatory)\n";
|
||||
|
||||
|
||||
#include "swigmod.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue