Modifications to work on MacOS, submitted by Bernard Desgraupes.
Mainly ensuring the files are output in the appropriate directory. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4203 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
477b1260c6
commit
01033bcdf3
3 changed files with 33 additions and 19 deletions
|
|
@ -61,6 +61,7 @@ class JAVA : public Language {
|
|||
String *wrapper_conversion_code; //C++ casts for inheritance hierarchies JNI code
|
||||
String *jniclass_cppcasts_code; //C++ casts up inheritance hierarchies JNI class Java code
|
||||
String *destructor_call; //Destructor (delete) call if any
|
||||
String *outfile;
|
||||
|
||||
enum type_additions {none, pointer, reference};
|
||||
|
||||
|
|
@ -110,7 +111,8 @@ class JAVA : public Language {
|
|||
module_class_modifiers(NULL),
|
||||
wrapper_conversion_code(NULL),
|
||||
jniclass_cppcasts_code(NULL),
|
||||
destructor_call(NULL)
|
||||
destructor_call(NULL),
|
||||
outfile(NULL)
|
||||
|
||||
{
|
||||
}
|
||||
|
|
@ -202,7 +204,7 @@ class JAVA : public Language {
|
|||
virtual int top(Node *n) {
|
||||
|
||||
/* Initialize all of the output files */
|
||||
String *outfile = Getattr(n,"outfile");
|
||||
outfile = Getattr(n,"outfile");
|
||||
|
||||
f_runtime = NewFile(outfile,"w");
|
||||
if (!f_runtime) {
|
||||
|
|
@ -290,7 +292,7 @@ class JAVA : public Language {
|
|||
|
||||
// Generate the Java JNI class
|
||||
{
|
||||
String *filen = NewStringf("%s.java", jniclass_name);
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), jniclass_name);
|
||||
File *f_java = NewFile(filen,"w");
|
||||
if(!f_java) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -327,7 +329,7 @@ class JAVA : public Language {
|
|||
|
||||
// Generate the Java module class
|
||||
{
|
||||
String *filen = NewStringf("%s.java", module_class_name);
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), module_class_name);
|
||||
File *f_module = NewFile(filen,"w");
|
||||
if(!f_module) {
|
||||
Printf(stderr,"Unable to open %s\n", filen);
|
||||
|
|
@ -1154,7 +1156,7 @@ class JAVA : public Language {
|
|||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
String *filen = NewStringf("%s.java", shadow_classname);
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), shadow_classname);
|
||||
f_shadow = NewFile(filen,"w");
|
||||
if(!f_shadow) {
|
||||
Printf(stderr, "Unable to create proxy class file: %s\n", filen);
|
||||
|
|
@ -1744,7 +1746,7 @@ class JAVA : public Language {
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void emitJavaClass(String *javaclassname, SwigType *type) {
|
||||
String *filen = NewStringf("%s.java", javaclassname);
|
||||
String *filen = NewStringf("%s%s.java", Swig_file_dirname(outfile), javaclassname);
|
||||
File *f_swigtype = NewFile(filen,"w");
|
||||
String *swigtype = NewString("");
|
||||
|
||||
|
|
|
|||
|
|
@ -204,8 +204,16 @@ public:
|
|||
Printv(mlfile,module,".ml",NIL);
|
||||
Printv(mlifile,module,".mli",NIL);
|
||||
|
||||
f_mlout = NewFile(mlfile,"w");
|
||||
f_mliout = NewFile(mlifile,"w");
|
||||
String *mlfilen = NewStringf("%s%s", Swig_file_dirname(outfile),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);
|
||||
if ((f_mliout = NewFile(mlifilen,"w")) == 0) {
|
||||
Printf(stderr,"Unable to open %s\n", mlifilen);
|
||||
SWIG_exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Language::top(n);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,23 +15,27 @@
|
|||
|
||||
char cvsroot_php4_cxx[] = "$Header$";
|
||||
|
||||
#include "swigmod.h"
|
||||
|
||||
#ifndef MACSWIG
|
||||
#include "swigconfig.h"
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "swigmod.h"
|
||||
#include "swigconfig.h"
|
||||
|
||||
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\
|
||||
-proxy - Create 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\
|
||||
-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\
|
||||
\n";
|
||||
|
||||
static int constructors=0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue