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 *wrapper_conversion_code; //C++ casts for inheritance hierarchies JNI code
|
||||||
String *jniclass_cppcasts_code; //C++ casts up inheritance hierarchies JNI class Java code
|
String *jniclass_cppcasts_code; //C++ casts up inheritance hierarchies JNI class Java code
|
||||||
String *destructor_call; //Destructor (delete) call if any
|
String *destructor_call; //Destructor (delete) call if any
|
||||||
|
String *outfile;
|
||||||
|
|
||||||
enum type_additions {none, pointer, reference};
|
enum type_additions {none, pointer, reference};
|
||||||
|
|
||||||
|
|
@ -110,7 +111,8 @@ class JAVA : public Language {
|
||||||
module_class_modifiers(NULL),
|
module_class_modifiers(NULL),
|
||||||
wrapper_conversion_code(NULL),
|
wrapper_conversion_code(NULL),
|
||||||
jniclass_cppcasts_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) {
|
virtual int top(Node *n) {
|
||||||
|
|
||||||
/* Initialize all of the output files */
|
/* Initialize all of the output files */
|
||||||
String *outfile = Getattr(n,"outfile");
|
outfile = Getattr(n,"outfile");
|
||||||
|
|
||||||
f_runtime = NewFile(outfile,"w");
|
f_runtime = NewFile(outfile,"w");
|
||||||
if (!f_runtime) {
|
if (!f_runtime) {
|
||||||
|
|
@ -290,7 +292,7 @@ class JAVA : public Language {
|
||||||
|
|
||||||
// Generate the Java JNI class
|
// 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");
|
File *f_java = NewFile(filen,"w");
|
||||||
if(!f_java) {
|
if(!f_java) {
|
||||||
Printf(stderr,"Unable to open %s\n", filen);
|
Printf(stderr,"Unable to open %s\n", filen);
|
||||||
|
|
@ -327,7 +329,7 @@ class JAVA : public Language {
|
||||||
|
|
||||||
// Generate the Java module class
|
// 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");
|
File *f_module = NewFile(filen,"w");
|
||||||
if(!f_module) {
|
if(!f_module) {
|
||||||
Printf(stderr,"Unable to open %s\n", filen);
|
Printf(stderr,"Unable to open %s\n", filen);
|
||||||
|
|
@ -1154,7 +1156,7 @@ class JAVA : public Language {
|
||||||
SWIG_exit(EXIT_FAILURE);
|
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");
|
f_shadow = NewFile(filen,"w");
|
||||||
if(!f_shadow) {
|
if(!f_shadow) {
|
||||||
Printf(stderr, "Unable to create proxy class file: %s\n", filen);
|
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) {
|
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");
|
File *f_swigtype = NewFile(filen,"w");
|
||||||
String *swigtype = NewString("");
|
String *swigtype = NewString("");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -204,8 +204,16 @@ public:
|
||||||
Printv(mlfile,module,".ml",NIL);
|
Printv(mlfile,module,".ml",NIL);
|
||||||
Printv(mlifile,module,".mli",NIL);
|
Printv(mlifile,module,".mli",NIL);
|
||||||
|
|
||||||
f_mlout = NewFile(mlfile,"w");
|
String *mlfilen = NewStringf("%s%s", Swig_file_dirname(outfile),mlfile);
|
||||||
f_mliout = NewFile(mlifile,"w");
|
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);
|
Language::top(n);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,23 +15,27 @@
|
||||||
|
|
||||||
char cvsroot_php4_cxx[] = "$Header$";
|
char cvsroot_php4_cxx[] = "$Header$";
|
||||||
|
|
||||||
|
#include "swigmod.h"
|
||||||
|
|
||||||
|
#ifndef MACSWIG
|
||||||
|
#include "swigconfig.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "swigmod.h"
|
|
||||||
#include "swigconfig.h"
|
|
||||||
|
|
||||||
static const char *usage = (char*)"\
|
static const char *usage = (char*)"\
|
||||||
PHP4 Options (available with -php4)\n\
|
PHP4 Options (available with -php4)\n\
|
||||||
-ldflags - Print runtime libraries to link with\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\
|
||||||
-proxy - Create proxy classes.\n\
|
-noproxy - Don't generate proxy classes.\n\
|
||||||
-dlname name - Set module prefix.\n\
|
-dlname name - Set module prefix.\n\
|
||||||
-make - Create simple makefile.\n\
|
-make - Create simple makefile.\n\
|
||||||
-phpfull - Create full make files.\n\
|
-phpfull - Create full make files.\n\
|
||||||
-withincs libs - With -phpfull writes needed incs in config.m4\n\
|
-withincs libs - With -phpfull writes needed incs in config.m4\n\
|
||||||
-withlibs libs - With -phpfull writes needed libs in config.m4\n\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\
|
-withc libs - With -phpfull makes extra c files in Makefile.in\n\
|
||||||
-withcxx libs - With -phpfull makes extra c++ files in Makefile.in\n\
|
-withcxx libs - With -phpfull makes extra c++ files in Makefile.in\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
||||||
static int constructors=0;
|
static int constructors=0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue